unify short ternary operator
This commit is contained in:
parent
2a9daff8d9
commit
2888594dbd
@ -41,7 +41,7 @@ class Router extends BaseRouter implements WarmableInterface
|
||||
$this->container = $container;
|
||||
|
||||
$this->resource = $resource;
|
||||
$this->context = null === $context ? new RequestContext() : $context;
|
||||
$this->context = $context ?: new RequestContext();
|
||||
$this->setOptions($options);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ abstract class Output implements OutputInterface
|
||||
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null)
|
||||
{
|
||||
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
|
||||
$this->formatter = null === $formatter ? new OutputFormatter() : $formatter;
|
||||
$this->formatter = $formatter ?: new OutputFormatter();
|
||||
$this->formatter->setDecorated($decorated);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\Tests;
|
||||
|
||||
use \Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
|
||||
class RedirectResponseTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ class Router implements RouterInterface
|
||||
$this->loader = $loader;
|
||||
$this->resource = $resource;
|
||||
$this->logger = $logger;
|
||||
$this->context = null === $context ? new RequestContext() : $context;
|
||||
$this->context = $context ?: new RequestContext();
|
||||
$this->setOptions($options);
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,8 @@ class JsonEncoder implements EncoderInterface, DecoderInterface
|
||||
|
||||
public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodingImpl = null)
|
||||
{
|
||||
$this->encodingImpl = null === $encodingImpl ? new JsonEncode() : $encodingImpl;
|
||||
$this->decodingImpl = null === $decodingImpl ? new JsonDecode(true) : $decodingImpl;
|
||||
$this->encodingImpl = $encodingImpl ?: new JsonEncode();
|
||||
$this->decodingImpl = $decodingImpl ?: new JsonDecode(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user