for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Classifier\Filter;
use ReflectionAttribute;
use ReflectionClass;
final class TargetAttribute implements FilterInterface
{
/**
* @param class-string $attribute
class-string
0
*/
public function __construct(private string $attribute)
}
public function match(ReflectionClass $reflectionClass): bool
$attributes = $reflectionClass->getAttributes($this->attribute, ReflectionAttribute::IS_INSTANCEOF);
$attributeNames = array_map(
static fn(ReflectionAttribute $attribute) => $attribute->getName(),
$attributes
);
return !empty($attributeNames);