Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the object has this class as one of its parents or implements it
is_subclass_of(mixed $object_or_class, string $class, bool $allow_string = true): bool
}
foreach ($this->policies as $expected => $policy) {
if (is_subclass_of($class, $expected)) {
return $this->resolvePolicy($policy);
}
}
foreach ($this->policies as $expected => $policy) {
if (is_subclass_of($class, $expected)) {
return $this->resolvePolicy($policy);
}
}
protected function parseCommand($command, $parameters)
{
if (is_subclass_of($command, SymfonyCommand::class)) {
$callingClass = true;
$command = $this->laravel->make($command)->getName();
{
if (is_subclass_of($command, SymfonyCommand::class)) {
$callingClass = true;
$command = $this->laravel->make($command)->getName();
public function resolve($command)
{
if (is_subclass_of($command, SymfonyCommand::class) && ($commandName = $command::getDefaultName())) {
$this->commandMap[$commandName] = $command;
return null;
{
if (is_subclass_of($command, SymfonyCommand::class) && ($commandName = $command::getDefaultName())) {
$this->commandMap[$commandName] = $command;
return null;
$this->fireBeforeCallbackArray($abstract, $parameters, $this->globalBeforeResolvingCallbacks);
foreach ($this->beforeResolvingCallbacks as $type => $callbacks) {
if ($type === $abstract || is_subclass_of($abstract, $type)) {
$this->fireBeforeCallbackArray($abstract, $parameters, $callbacks);
}
}
foreach ($this->beforeResolvingCallbacks as $type => $callbacks) {
if ($type === $abstract || is_subclass_of($abstract, $type)) {
$this->fireBeforeCallbackArray($abstract, $parameters, $callbacks);
}
}
$arguments = explode(',', $segments[1]);
}
if (is_subclass_of($castType, Castable::class)) {
$castType = $castType::castUsing($arguments);
}
}
if (is_subclass_of($castType, Castable::class)) {
$castType = $castType::castUsing($arguments);
}
}
foreach (static::$ignoreOnTouch as $ignoredClass) {
if ($class === $ignoredClass || is_subclass_of($class, $ignoredClass)) {
return true;
}
}
foreach (static::$ignoreOnTouch as $ignoredClass) {
if ($class === $ignoredClass || is_subclass_of($class, $ignoredClass)) {
return true;
}
}
Str::after($command->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR)
);
if (is_subclass_of($command, Command::class) &&
! (new ReflectionClass($command))->isAbstract()) {
Artisan::starting(function ($artisan) use ($command) {
$artisan->resolve($command);
);
if (is_subclass_of($command, Command::class) &&
! (new ReflectionClass($command))->isAbstract()) {
Artisan::starting(function ($artisan) use ($command) {
$artisan->resolve($command);
protected function newModelFor($table)
{
return is_subclass_of($table, Model::class) ? (new $table) : null;
}
{
return is_subclass_of($table, Model::class) ? (new $table) : null;
}
protected function wasDispatched($needle, array $haystack)
{
foreach ($haystack as $dispatched) {
if ((is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched, $needle))) ||
$dispatched instanceof $needle) {
return true;
}
{
foreach ($haystack as $dispatched) {
if ((is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched, $needle))) ||
$dispatched instanceof $needle) {
return true;
}
return $table;
}
if (is_subclass_of($table, Model::class)) {
$model = new $table;
if (str_contains($model->getTable(), '.')) {
}
if (is_subclass_of($table, Model::class)) {
$model = new $table;
if (str_contains($model->getTable(), '.')) {