Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns the name of the class of an object
<?php get_class(object $object = ?): string
<?php protected function eventIsIgnored($event)
{
return collect(config('statamic.api.cache.ignored_events'))->contains(get_class($event));
}
}
<?php public function __call($method, $args)
{
if (! property_exists($this, $method)) {
throw new \Exception(sprintf('Call to undefined method %s::%s', get_class($this), $method));
}
if (empty($args)) {
<?php protected function eventIsIgnored($event)
{
return collect(config('statamic.git.ignored_events'))->contains(get_class($event));
}
}
<?php protected function eventIsIgnored($event)
{
return collect(config('statamic.graphql.cache.ignored_events'))->contains(get_class($event));
}
}
<?php protected function hasDisabledExceptionHandlingInTests()
{
$class = get_class(app(ExceptionHandler::class));
return Str::contains($class, 'InteractsWithExceptionHandling');
}
<?php {
if (! is_string($this->value) && ! method_exists($this->value, '__toString')) {
throw new ModifierException(
'Attempted to access modified value as a string, but encountered ['.get_class($this->value).']'
);
}
<?php if (! is_array($this->value)) {
throw new ModifierException(sprintf(
'Attempted to access modified value as an array, but encountered [%s]',
is_string($this->value) ? 'string' : get_class($this->value)
));
}
<?php private function getAddonByServiceProvider()
{
return Addon::all()->first(function ($addon) {
return Str::startsWith(get_class($this), $addon->namespace().'\\');
});
}
<?php }
if (is_object($value)) {
throw new \LogicException("Cannot query [$field] using value [".get_class($value).']');
}
return $value;
<?php }
})
->each(function ($script) {
$script->console()->info('Running update script <comment>['.get_class($script).']</comment>');
$script->update();
});
}
<?php throw new \InvalidArgumentException(sprintf(
'Expecting array or object implementing Arrayable. Encountered [%s]',
($type = gettype($data)) === 'object' ? get_class($data) : $type
));
}