cs fix
This commit is contained in:
parent
cfb218456c
commit
5ec6ff378b
@ -111,8 +111,9 @@ class AppVariable
|
|||||||
if (null === $this->requestStack) {
|
if (null === $this->requestStack) {
|
||||||
throw new \RuntimeException('The "app.session" variable is not available.');
|
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)
|
public function getFlashes($types = null)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$session = $this->getSession();
|
if (null === $session = $this->getSession()) {
|
||||||
if (null === $session) {
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
} catch (\RuntimeException $e) {
|
} catch (\RuntimeException $e) {
|
||||||
|
@ -70,7 +70,9 @@ class GlobalVariables
|
|||||||
*/
|
*/
|
||||||
public function getSession()
|
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.
|
* 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()) {
|
if (!$type = $parameter->getType()) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -242,12 +242,9 @@ class Profiler implements ResetInterface
|
|||||||
return $this->collectors[$name];
|
return $this->collectors[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private function getTimestamp(?string $value): ?int
|
||||||
* @return int|null
|
|
||||||
*/
|
|
||||||
private function getTimestamp($value)
|
|
||||||
{
|
{
|
||||||
if (null === $value || '' == $value) {
|
if (null === $value || '' === $value) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user