Revert "merged branch jakzal/2.0-StaticMethodLoaderFix (PR #3937)"
This reverts commit0078faa84b
, reversing changes made to098b934410
.
This commit is contained in:
parent
580c8fa875
commit
29a41ec13b
@ -37,7 +37,7 @@ class StaticMethodLoader implements LoaderInterface
|
|||||||
throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->getName(), $this->methodName));
|
throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->getName(), $this->methodName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($reflClass->isAbstract() || $reflMethod->getDeclaringClass()->getName() != $reflClass->getName()) {
|
if ($reflMethod->getDeclaringClass()->getName() != $reflClass->getName()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,14 +35,6 @@ class StaticMethodLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertFalse($loader->loadClassMetadata($metadata));
|
$this->assertFalse($loader->loadClassMetadata($metadata));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLoadClassMetadataReturnsFalseIfMethodIsAbstract()
|
|
||||||
{
|
|
||||||
$loader = new StaticMethodLoader('loadMetadata');
|
|
||||||
$metadata = new ClassMetadata(__NAMESPACE__.'\AbstractStaticLoaderEntity');
|
|
||||||
|
|
||||||
$this->assertFalse($loader->loadClassMetadata($metadata));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testLoadClassMetadata()
|
public function testLoadClassMetadata()
|
||||||
{
|
{
|
||||||
$loader = new StaticMethodLoader('loadMetadata');
|
$loader = new StaticMethodLoader('loadMetadata');
|
||||||
@ -88,8 +80,3 @@ class BaseStaticLoaderDocument
|
|||||||
$metadata->addConstraint(new ConstraintA());
|
$metadata->addConstraint(new ConstraintA());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AbstractStaticLoaderEntity
|
|
||||||
{
|
|
||||||
abstract public static function loadMetadata(ClassMetadata $metadata);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user