for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Ray.Aop package
*
* @license http://opensource.org/licenses/bsd-license.php BSD
*/
namespace Ray\Aop\Matcher;
use Ray\Aop\AbstractMatcher;
use Ray\Aop\Exception\InvalidAnnotationException;
class SubclassesOfMatcher extends AbstractMatcher
{
* {@inheritdoc}
public function matchesClass(\ReflectionClass $class, array $arguments)
list($superClass) = $arguments;
$isSubClass = $class->isSubclassOf($superClass) || ($class->name === $superClass);
return $isSubClass;
}
public function matchesMethod(\ReflectionMethod $method, array $arguments)
throw new InvalidAnnotationException('subclassesOf is only for class match');