mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-28 23:10:51 +00:00
6c20d257e3
d3d18d442c
keep relative paths
25 lines
465 B
PHP
25 lines
465 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace RectorPrefix202209\Symplify\PackageBuilder\Php;
|
|
|
|
/**
|
|
* @api
|
|
*/
|
|
final class TypeChecker
|
|
{
|
|
/**
|
|
* @param array<class-string> $types
|
|
* @param object|string $object
|
|
*/
|
|
public function isInstanceOf($object, array $types) : bool
|
|
{
|
|
foreach ($types as $type) {
|
|
if (\is_a($object, $type, \true)) {
|
|
return \true;
|
|
}
|
|
}
|
|
return \false;
|
|
}
|
|
}
|