Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"require-dev": {
"phpstan/phpstan": "^0.8",
"doctrine/coding-standard": "^5.0",
"doctrine/coding-standard": "^6.0",
"phpunit/phpunit": "^7.0"
},
"conflict": {
Expand Down
123 changes: 84 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ public function getReflectionService()
if ($this->reflectionService === null) {
$this->reflectionService = new RuntimeReflectionService();
}

return $this->reflectionService;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public function isTransient($className)
return false;
}
}

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ public function loadMetadataForClass($className, ClassMetadata $metadata)
foreach ($this->drivers as $namespace => $driver) {
if (strpos($className, $namespace) === 0) {
$driver->loadMetadataForClass($className, $metadata);

return;
}
}

if ($this->defaultDriver !== null) {
$this->defaultDriver->loadMetadataForClass($className, $metadata);

return;
}

Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/Persistence/Mapping/StaticReflectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function getClassShortName($className)
if (strpos($className, '\\') !== false) {
$className = substr($className, strrpos($className, '\\') + 1);
}

return $className;
}

Expand All @@ -40,6 +41,7 @@ public function getClassNamespace($className)
if (strpos($className, '\\') !== false) {
$namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1));
}

return $namespace;
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/Persistence/ManagerRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public function testResetManager()
private function getManagerFactory()
{
return function () {
$mock = $this->createMock(ObjectManager::class);
$mock = $this->createMock(ObjectManager::class);

Copy link
Contributor Author

@patrickjahns patrickjahns Mar 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change related to upstream bug in slevomat/coding-standard slevomat/coding-standard#635

$driver = $this->createMock(MappingDriver::class);
$metadata = $this->createMock(ClassMetadata::class);
$mock->method('getMetadataFactory')->willReturn(new TestClassMetadataFactory($driver, $metadata));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ protected function getDriver()
{
return $this->driver;
}

protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService)
{
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Doctrine/Tests/Persistence/Mapping/FileDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private function newLocator()
$locator = $this->createMock(FileLocator::class);
$locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml'));
$locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__ . '/_files']));

return $locator;
}
}
Expand All @@ -153,6 +154,7 @@ protected function loadMappingFile($file)
if (strpos($file, 'global.yml') !== false) {
return ['stdGlobal' => 'stdGlobal', 'stdGlobal2' => 'stdGlobal2'];
}

return ['stdClass' => 'stdClass'];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ public function testFindMappingFileWithCustomNsSeparator($separator, $dir, $file
}
}


public function testFindMappingFile()
{
$path = __DIR__ . '/_files';
Expand Down
2 changes: 2 additions & 0 deletions tests/Doctrine/Tests/Persistence/PersistentObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class TestObjectMetadata implements ClassMetadata
public function getAssociationMappedByTargetField($assocName)
{
$assoc = ['children' => 'parent'];

return $assoc[$assocName];
}

Expand Down Expand Up @@ -220,6 +221,7 @@ public function getReflectionClass()
public function getTypeOfField($fieldName)
{
$types = ['id' => 'integer', 'name' => 'string'];

return $types[$fieldName];
}

Expand Down