rector/src/Util/MultiInstanceofChecker.php
2023-05-01 21:33:18 +00:00

21 lines
397 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Core\Util;
final class MultiInstanceofChecker
{
/**
* @param array<class-string> $types
*/
public function isInstanceOf(object $object, array $types) : bool
{
foreach ($types as $type) {
if ($object instanceof $type) {
return \true;
}
}
return \false;
}
}