Skip to content

Commit

Permalink
Update to latest PHP 8.1 syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
  • Loading branch information
samsonasik committed Nov 2, 2024
1 parent ab90e62 commit 5496332
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/AbstractContainerCommandLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ abstract class AbstractContainerCommandLoader implements CommandLoaderInterface
private $commandMap;

/** @psalm-param array<string, string> $commandMap */
final public function __construct(private ContainerInterface $container, array $commandMap)
final public function __construct(private readonly ContainerInterface $container, array $commandMap)
{
Assert::isMap($commandMap);
Assert::allString($commandMap);
Expand Down
2 changes: 1 addition & 1 deletion src/ContainerResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class ContainerResolver
* @psalm-param non-empty-string $projectRoot
*/
public function __construct(
private string $projectRoot
private readonly string $projectRoot
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Input/AbstractInputParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(
/**
* Parameter name; must be set by class composing trait!
*/
private string $name
private readonly string $name
) {
}

Expand Down
3 changes: 2 additions & 1 deletion src/Input/AbstractParamAwareInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Laminas\Cli\Input;

use InvalidArgumentException;
use Stringable;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -26,7 +27,7 @@
*
* @internal
*/
abstract class AbstractParamAwareInput implements ParamAwareInputInterface
abstract class AbstractParamAwareInput implements ParamAwareInputInterface, Stringable
{
/**
* @param array<string, InputParamInterface> $params
Expand Down
2 changes: 1 addition & 1 deletion src/Input/Mapper/ArrayInputMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class ArrayInputMapper implements InputMapperInterface
* @psalm-param array<string|int, string|array<string, string>> $map
*/
public function __construct(
private array $map
private readonly array $map
) {
}

Expand Down
5 changes: 2 additions & 3 deletions src/Listener/TerminateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

use function array_search;
use function file_get_contents;
use function get_debug_type;
use function getcwd;
use function gettype;
use function is_array;
use function is_int;
use function is_object;
use function is_string;
use function json_decode;
use function preg_match;
Expand Down Expand Up @@ -143,7 +142,7 @@ private function createInputMapper(mixed $inputMapperSpec, string $commandClass)
'Expected array option map or %s class implementation name for %s input mapper; received "%s"',
InputMapperInterface::class,
$commandClass,
is_object($inputMapperSpec) ? $inputMapperSpec::class : gettype($inputMapperSpec)
get_debug_type($inputMapperSpec)
));

Assert::classExists(
Expand Down

0 comments on commit 5496332

Please sign in to comment.