PHP code example of hshn / class-matcher
1. Go to this page and download the library: Download hshn/class-matcher library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hshn / class-matcher example snippets
use Hshn\ClassMatcher\ClassMatcher;
$builder = ClassMatcher::createBuilder();
$matcher = $builder->logicalOr([
$builder->equalsTo('Foo'),
$builder->implemented('FooInterface'),
$builder->extended('Foo'),
$builder->logicalAnd([
$builder->anything()
]),
]);
if ($matcher->matches('FooExtended')) {
} else {
}