mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-12 22:22:24 +00:00
254ea14c44
495c51f376
[Util]: Use instead of (#3723)
21 lines
397 B
PHP
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;
|
|
}
|
|
}
|