Skip to content

Commit

Permalink
fix undeclared variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Jan 5, 2023
1 parent a97ab32 commit 586755b
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 24 deletions.
5 changes: 5 additions & 0 deletions lib/Doctrine/ODM/PHPCR/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ class DocumentManager implements DocumentManagerInterface
*/
protected $localeChooserStrategy;

/**
* @var ValueConverter
*/
private $valueConverter;

public function __construct(SessionInterface $session, Configuration $config = null, EventManager $evm = null)
{
$this->session = $session;
Expand Down
10 changes: 10 additions & 0 deletions lib/Doctrine/ODM/PHPCR/Query/Builder/ConstraintChild.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
*/
class ConstraintChild extends AbstractLeafNode
{
/**
* @var string
*/
private $alias;

/**
* @var string
*/
private $parentPath;

public function __construct(AbstractNode $parent, $alias, $parentPath)
{
$this->alias = $alias;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CascadePersistTest extends PHPCRFunctionalTestCase
public function setUp(): void
{
$this->dm = $this->createDocumentManager([__DIR__]);
$this->node = $this->resetFunctionalNode($this->dm);
$this->resetFunctionalNode($this->dm);

$class = $this->dm->getClassMetadata(CmsUser::class);
$class->mappings['groups']['cascade'] = ClassMetadata::CASCADE_PERSIST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CascadeRefreshTest extends PHPCRFunctionalTestCase
public function setUp(): void
{
$this->dm = $this->createDocumentManager([__DIR__]);
$this->node = $this->resetFunctionalNode($this->dm);
$this->resetFunctionalNode($this->dm);

$class = $this->dm->getClassMetadata(CmsUser::class);
$class->mappings['groups']['cascade'] = ClassMetadata::CASCADE_REFRESH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CascadeRemoveTest extends PHPCRFunctionalTestCase
public function setUp(): void
{
$this->dm = $this->createDocumentManager([__DIR__]);
$this->node = $this->resetFunctionalNode($this->dm);
$this->resetFunctionalNode($this->dm);

$class = $this->dm->getClassMetadata(CmsUser::class);
$class->mappings['groups']['cascade'] = ClassMetadata::CASCADE_REMOVE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setUp(): void
$this->listener = new ChangesetListener();
$this->dm = $this->createDocumentManager();
$this->dm->setLocaleChooserStrategy(new LocaleChooser(['en' => ['fr'], 'fr' => ['en']], 'en'));
$this->node = $this->resetFunctionalNode($this->dm);
$this->resetFunctionalNode($this->dm);
}

public function testComputeChangeset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function testComputingBetweenEventsWithTranslation(): void
// name has been changed when translation was updated
$this->assertEquals('preUpdateTranslation', $user->name);

$this->dm->name = 'neuer Name';
$user->name = 'neuer Name';
$this->dm->bindTranslation($user, 'de');

$this->dm->flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function setUp(): void
{
$this->listener = new TestEventDocumentChanger2();
$this->dm = $this->createDocumentManager();
$this->node = $this->resetFunctionalNode($this->dm);
}

public function testComputingBetweenEvents(): void
Expand Down
1 change: 0 additions & 1 deletion tests/Doctrine/Tests/ODM/PHPCR/Functional/MergeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public function testMergeUnknownAssignedId(): void
{
$doc = new CmsArticle();
$doc->id = '/foo';
$doc->name = 'Foo';

$mergedDoc = $this->dm->merge($doc);

Expand Down
20 changes: 7 additions & 13 deletions tests/Doctrine/Tests/ODM/PHPCR/Functional/ReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,6 @@ public function testReferenceMany(): void
{
$refManyTestObj = new RefManyTestObj();
$refManyTestObj->id = '/functional/refManyTestObj';
$refManyTestObj->name = 'referrer';

$max = 5;

Expand Down Expand Up @@ -826,7 +825,6 @@ public function testReferenceManyPath(): void
{
$refManyTestObj = new RefManyTestObjPathStrategy();
$refManyTestObj->id = '/functional/refManyTestObjWP';
$refManyTestObj->name = 'referrer';

$max = 5;

Expand Down Expand Up @@ -855,7 +853,6 @@ public function testNoReferenceInitOnFlush(): void
{
$refManyTestObj = new RefManyTestObj();
$refManyTestObj->id = '/functional/refManyTestObj';
$refManyTestObj->name = 'referrer';

$max = 5;

Expand Down Expand Up @@ -932,7 +929,6 @@ public function testModificationAfterPersist(): void
$referenced->id = '/functional/refRefTestObj';

$this->dm->persist($referrer);
$referrer->name = 'Referrer';
$referrer->reference = $referenced;
$referenced->name = 'Referenced';

Expand Down Expand Up @@ -997,7 +993,6 @@ public function testCreateCascade(): void

$refCascadeTestObj = new RefCascadeTestObj();
$refCascadeTestObj->id = '/functional/refCascadeTestObj';
$refCascadeTestObj->name = 'refCascadeTestObj';

$referrer->reference = $refCascadeTestObj;

Expand Down Expand Up @@ -1335,25 +1330,24 @@ public function testCascadeRemoveByCollection(): void
for ($i = 0; $i < $max; ++$i) {
$newReferrerTestObj = new ReferenceRefTestObj();
$newReferrerTestObj->id = "/functional/referenceRefTestObj$i";
$newReferrerTestObj->name = "referrerTestObj$i";
$referrerRefManyTestObj->reference[] = $newReferrerTestObj;
}

$this->dm->persist($referrerRefManyTestObj);
$this->dm->flush();
$this->dm->clear();

$referrered = $this->dm->find(null, '/functional/referenceTestObj');
$this->assertCount($max, $referrered->reference);
$referrered->reference->remove(0);
$referrered->reference->remove(3);
$this->assertCount($max - 2, $referrered->reference);
$referred = $this->dm->find(null, '/functional/referenceTestObj');
$this->assertCount($max, $referred->reference);
$referred->reference->remove(0);
$referred->reference->remove(3);
$this->assertCount($max - 2, $referred->reference);

$this->dm->flush();
$this->dm->clear();

$referrered = $this->dm->find(null, '/functional/referenceTestObj');
$this->assertCount($max - 2, $referrered->reference);
$referred = $this->dm->find(null, '/functional/referenceTestObj');
$this->assertCount($max - 2, $referred->reference);
}
}

Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/ODM/PHPCR/Functional/ReferrerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function testCreate(): void
$referrerTestObj->id = '/functional/referrerTestObj';
$referrerTestObj->name = 'referrer';
$referrerRefTestObj->id = '/functional/referrerRefTestObj';
$referrerRefTestObj->name = 'referenced';

$referrerTestObj->reference = $referrerRefTestObj;

Expand Down Expand Up @@ -615,7 +614,6 @@ public function testCascadeRemoveByCollection(): void
for ($i = 0; $i < $max; ++$i) {
$newReferrerTestObj = new ReferrerTestObj2();
$newReferrerTestObj->id = "/functional/referrerTestObj$i";
$newReferrerTestObj->name = "referrerTestObj$i";
$newReferrerTestObj->reference = $referrerRefManyTestObj;
$this->dm->persist($newReferrerTestObj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public function testFindTranslationNonPersisted(): void
{
$a = new Article();
$a->id = '/functional/'.$this->testNodeName;
$a->title = 'Hello';
$a->topic = 'Hello';
$this->dm->persist($a);

$translations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class ParentClassMetadataProxy extends ClassMetadata

protected $_nodename;

protected $_id;
private $_identifier;

public function __construct($parent, $nodename, $identifier, $mockField = null)
{
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit_doctrine_dbal.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<!-- to adjust performance results to your specific hardware, use integers only. -->
<!-- the InsertPerformanceTest tries to insert count nodes in one second -->
<var name="DOCTRINE_PHPCR_PERFORMANCE_COUNT" value="100" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
</php>

<testsuites>
Expand Down

0 comments on commit 586755b

Please sign in to comment.