* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Mapping\Loader; use Symfony\Component\Validator\Exception\MappingException; use Symfony\Component\Validator\Mapping\ClassMetadata; /** * Loads validation metadata by calling a static method on the loaded class. * * @author Bernhard Schussek */ class StaticMethodLoader implements LoaderInterface { protected $methodName; /** * Creates a new loader. * * @param string $methodName The name of the static method to call */ public function __construct($methodName = 'loadValidatorMetadata') { $this->methodName = $methodName; } /** * {@inheritdoc} */ public function loadClassMetadata(ClassMetadata $metadata) { /** @var \ReflectionClass $reflClass */ $reflClass = $metadata->getReflectionClass(); if (!$reflClass->isInterface() && $reflClass->hasMethod($this->methodName)) { $reflMethod = $reflClass->getMethod($this->methodName); if ($reflMethod->isAbstract()) { return false; } if (!$reflMethod->isStatic()) { throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->name, $this->methodName)); } if ($reflMethod->getDeclaringClass()->name != $reflClass->name) { return false; } $reflMethod->invoke(null, $metadata); return true; } return false; } } __halt_compiler();----SIGNATURE:----AnbgFjjI45oylSO95GZmxAZpuCAWUkow9GocKZ8RNR2PoEZIa7DSrQgDD42nSUUX5Pm7mE/iy7xNeyjRpfIjkPw4xRDRwFLdzFWoWE2RZdak1SIp3v84CVc5VnC0S8C3LY9RlbSy9y5sRUhqONz0YVfQzMsmnFjbDEpbzU2t9XNDT+lL8I8qBAuDf/nMkKQc1BPzHtBez0d9Sk05KXJP7tn/Z76+GTWjgJ9xKwqYQCQYfufUAvzI2cJht0kSIVAXPxiij9TkQzAVuQzi1JpyGrItVfpvtGhaLnsJQSXUArS2w9yI4wu2apmpJfRIcsjGcBrjAlOjnVQTybSUEwn4gDij7yhz4IQi5YiAr9Ftuc/+hE3iSG9a5dDInCexYSrNlcve45RIGh5xly61tn0hnh5jOkWgjzkSk7aTDGwooFbTvFDQvQpGlu0NOd/mJ7beEbivjU2ostiiS+2qJ3rJHllSvGYFkzcLPiLMafHlcE1ERJE9277qo8yHYqGQAEBHCxQTVo9Pa+SoqzzA/NQDvu/CwMWht1kI2rYXUzcoqZx6QjY7Im5QHumyHHhyZ9R+Uc6Ljl+drFPsR2BuBosGgDLC7FCjXOIzEN9fqPnaR76yfdoMV/KeW5t573fK1kDDuGZ0Jqvg9MhUp/rTOuGhXTd+krhCLAhweMQ8qQZoMaM=----ATTACHMENT:----MzQ4Nzc3Mjg5NTAzNDU4NCAxMzUyNjYyNDEzMTUwOTMgOTExMjY3MTAzMzgyNDkx