cs fix
This commit is contained in:
parent
cfb218456c
commit
5ec6ff378b
@ -111,8 +111,9 @@ class AppVariable
|
||||
if (null === $this->requestStack) {
|
||||
throw new \RuntimeException('The "app.session" variable is not available.');
|
||||
}
|
||||
$request = $this->getRequest();
|
||||
|
||||
return ($request = $this->getRequest()) ? $request->getSession() : null;
|
||||
return $request && $request->hasSession() ? $request->getSession() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -154,8 +155,7 @@ class AppVariable
|
||||
public function getFlashes($types = null)
|
||||
{
|
||||
try {
|
||||
$session = $this->getSession();
|
||||
if (null === $session) {
|
||||
if (null === $session = $this->getSession()) {
|
||||
return [];
|
||||
}
|
||||
} catch (\RuntimeException $e) {
|
||||
|
@ -70,7 +70,9 @@ class GlobalVariables
|
||||
*/
|
||||
public function getSession()
|
||||
{
|
||||
return ($request = $this->getRequest()) ? $request->getSession() : null;
|
||||
$request = $this->getRequest();
|
||||
|
||||
return $request && $request->hasSession() ? $request->getSession() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,10 +42,8 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
|
||||
|
||||
/**
|
||||
* Returns an associated type to the given parameter if available.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function)
|
||||
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function): ?string
|
||||
{
|
||||
if (!$type = $parameter->getType()) {
|
||||
return null;
|
||||
|
@ -242,12 +242,9 @@ class Profiler implements ResetInterface
|
||||
return $this->collectors[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
private function getTimestamp($value)
|
||||
private function getTimestamp(?string $value): ?int
|
||||
{
|
||||
if (null === $value || '' == $value) {
|
||||
if (null === $value || '' === $value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user