diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 34b2a0b..4ed432e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['7.3', '7.4', '8.0'] + php-versions: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: - name: Checkout diff --git a/composer.json b/composer.json index 35f4f6e..7ffb8a2 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "search engine" ], "require": { - "php": "^7.3|^8.0" + "php": "^8.0" }, "require-dev": { "phpunit/phpunit": "^7.0|^9.0", diff --git a/src/Commands/Command.php b/src/Commands/Command.php index e3a32fa..b8f3991 100644 --- a/src/Commands/Command.php +++ b/src/Commands/Command.php @@ -6,10 +6,16 @@ abstract class Command implements CommandInterface { - private $command; - private $parameters; + private string $command; + /** + * @var array + */ + private array $parameters; - public function __construct($command, $parameters = []) + /** + * @param array $parameters + */ + public function __construct(string $command, array $parameters = []) { $this->command = $command; $this->parameters = $parameters; @@ -18,8 +24,9 @@ public function __construct($command, $parameters = []) /** * Wrap the string in quotes, and normalize whitespace. Also remove double quotes. */ - protected function wrapInQuotes($string) + protected function wrapInQuotes(string $string):string { + /** @var string $string */ $string = preg_replace('/[\r\n\t"]/', ' ', $string); $string = '"' . str_replace('"', '\"', $string) . '"'; return $string;