Supported Versions: PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
Finds whether a variable is null
<?php is_null(mixed $value): bool
<?php $policy, $user, $ability, $arguments
);
if (! is_null($result)) {
return $result;
}
<?php $user, $ability, $arguments
);
if (is_null($result)) {
$result = $this->callAuthCallback($user, $ability, $arguments);
}
<?php protected function canBeCalledWithUser($user, $class, $method = null)
{
if (! is_null($user)) {
return true;
}
<?php return true;
}
if (! is_null($method)) {
return $this->methodAllowsGuests($class, $method);
}
<?php protected function parameterAllowsGuests($parameter)
{
return ($parameter->hasType() && $parameter->allowsNull()) ||
($parameter->isDefaultValueAvailable() && is_null($parameter->getDefaultValue()));
}
<?php continue;
}
if (! is_null($result = $before($user, $ability, $arguments))) {
return $result;
}
}
<?php protected function resolveAuthCallback($user, $ability, array $arguments)
{
if (isset($arguments[0]) &&
! is_null($policy = $this->getPolicyFor($arguments[0])) &&
$callback = $this->resolvePolicyCallback($user, $ability, $arguments, $policy)) {
return $callback;
}
<?php if (! is_null($result)) {
return $result;
}
<?php {
$config = $this->getConfig($name);
if (is_null($config)) {
throw new InvalidArgumentException("Auth guard [{$name}] is not defined.");
}
<?php public function createUserProvider($provider = null)
{
if (is_null($config = $this->getProviderConfiguration($provider))) {
return;
}
<?php protected function getGenericUser($user)
{
if (! is_null($user)) {
return new GenericUser((array) $user);
}
}
<?php public function validateCredentials(UserContract $user, array $credentials)
{
if (is_null($plain = $credentials['password'])) {
return false;
}
<?php protected function newModelQuery($model = null)
{
$query = is_null($model)
? $this->createModel()->newQuery()
: $model->newQuery();
<?php public function hasUser()
{
return ! is_null($this->user);
}
<?php public function check()
{
return ! is_null($this->user());
}