Skip to content

Commit

Permalink
More nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Oct 17, 2024
1 parent aea2ff7 commit 383b43f
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Cli/Executable.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ abstract class Executable
* @param Colors|null $colors Optional. Instance of the Colors object to use. Defaults to null to instantiate a
* new one.
*/
public function __construct($autocatch = true, Options $options = null, Colors $colors = null)
public function __construct($autocatch = true, ?Options $options = null, ?Colors $colors = null)
{
if ($autocatch) {
set_exception_handler([$this, 'fatal']);
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Options
* @param Colors $colors Optional. Configured color object.
* @throws InvalidArgument When arguments can't be read.
*/
public function __construct(Colors $colors = null)
public function __construct(?Colors $colors = null)
{
$this->colors = $colors instanceof Colors ? $colors : new Colors();

Expand Down
2 changes: 1 addition & 1 deletion src/Cli/TableFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TableFormatter
*
* @param Colors|null $colors Optional. Instance of the Colors helper object.
*/
public function __construct(Colors $colors = null)
public function __construct(?Colors $colors = null)
{
// Try to get terminal width.
$width = $this->getTerminalWidth();
Expand Down
2 changes: 1 addition & 1 deletion src/Optimizer/Error/CannotPreloadImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class CannotPreloadImage implements Error
* @param Element|null $element Optional. Image element that has the srcset attribute, or null if no element.
* @return self
*/
public static function fromImageWithSrcsetAttribute(Element $element = null)
public static function fromImageWithSrcsetAttribute(?Element $element = null)
{
$message = self::SRCSET_STRING;

Expand Down
2 changes: 1 addition & 1 deletion src/Validator/ValidationHandler.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Validator/ValidationResult.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Validator/ValidatorRules.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/Optimizer/TransformationEngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function testDependencyResolution($transformerClass)
* @param Configuration|null $configuration Optional. Configuration object to use.
* @return TransformationEngine Transformation engine instance to test against.
*/
private function getTransformationEngine(Configuration $configuration = null)
private function getTransformationEngine(?Configuration $configuration = null)
{
return new TransformationEngine(
$configuration,
Expand Down

0 comments on commit 383b43f

Please sign in to comment.