mirror of
https://github.com/mrclay/minify.git
synced 2025-08-12 00:54:35 +02:00
explicitly mark parameters as nullable
This commit is contained in:
@@ -85,7 +85,7 @@ class Minify
|
||||
* @param Minify_CacheInterface $cache
|
||||
* @param LoggerInterface $logger
|
||||
*/
|
||||
public function __construct(Minify_CacheInterface $cache, LoggerInterface $logger = null)
|
||||
public function __construct(Minify_CacheInterface $cache, ?LoggerInterface $logger = null)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->logger = $logger;
|
||||
|
@@ -29,7 +29,7 @@ class Minify_Cache_File implements Minify_CacheInterface
|
||||
* @param bool $fileLocking
|
||||
* @param LoggerInterface $logger
|
||||
*/
|
||||
public function __construct($path = '', $fileLocking = false, LoggerInterface $logger = null)
|
||||
public function __construct($path = '', $fileLocking = false, ?LoggerInterface $logger = null)
|
||||
{
|
||||
if (! $path) {
|
||||
$path = sys_get_temp_dir();
|
||||
|
@@ -38,7 +38,7 @@ abstract class Minify_Controller_Base implements Minify_ControllerInterface
|
||||
* @param Minify_Source_Factory $sourceFactory
|
||||
* @param LoggerInterface $logger
|
||||
*/
|
||||
public function __construct(Minify_Env $env, Minify_Source_Factory $sourceFactory, LoggerInterface $logger = null)
|
||||
public function __construct(Minify_Env $env, Minify_Source_Factory $sourceFactory, ?LoggerInterface $logger = null)
|
||||
{
|
||||
$this->env = $env;
|
||||
$this->sourceFactory = $sourceFactory;
|
||||
|
@@ -163,7 +163,7 @@ class Minify_HTML_Helper
|
||||
* @return \Minify\App
|
||||
* @internal
|
||||
*/
|
||||
public static function app(\Minify\App $app = null)
|
||||
public static function app(?\Minify\App $app = null)
|
||||
{
|
||||
static $cached;
|
||||
if ($app) {
|
||||
|
@@ -44,7 +44,7 @@ class Minify_Source_Factory
|
||||
* @param Minify_CacheInterface $cache Optional cache for handling .less files.
|
||||
*
|
||||
*/
|
||||
public function __construct(Minify_Env $env, array $options = array(), Minify_CacheInterface $cache = null)
|
||||
public function __construct(Minify_Env $env, array $options = array(), ?Minify_CacheInterface $cache = null)
|
||||
{
|
||||
$this->env = $env;
|
||||
$this->options = array_merge(array(
|
||||
|
@@ -108,7 +108,7 @@ class Cli
|
||||
* @return Arg
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function addArgument($letter, $required, Arg $arg = null)
|
||||
public function addArgument($letter, $required, ?Arg $arg = null)
|
||||
{
|
||||
if (! preg_match('/^[a-zA-Z]$/', $letter)) {
|
||||
throw new InvalidArgumentException('$letter must be in [a-zA-Z]');
|
||||
|
Reference in New Issue
Block a user