From 82ef76508feab9a1a774737f9b163d3c50707780 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sat, 12 Apr 2025 17:30:26 +0200 Subject: [PATCH 1/4] chore: drop PHP <7.4, move to GitHub Actions --- .github/workflows/ci.yml | 51 +++++++++++++++++++++++++++++++++ .travis.yml | 62 ---------------------------------------- 2 files changed, 51 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6dfa161 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + - pull_request + - push + +jobs: + tests: + name: "PHP ${{matrix.php}}" + runs-on: "ubuntu-24.04" + strategy: + fail-fast: false + matrix: + include: + - php: "7.4" + COMPOSER_FLAGS: "--ignore-platform-reqs --prefer-stable --prefer-lowest" + - php: "8.0" + - php: "8.1" + - php: "8.2" + - php: "8.3" + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: PHP setup + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + ini-values: zend.assertions=1, error_reporting=-1, display_errors=On, log_errors_max_len=0 + - name: "Update composer dependencies" + run: composer update -o --no-interaction --no-progress ${{ matrix.COMPOSER_FLAGS }} + - name: Tests + env: + PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }} + run: vendor/bin/phpunit + sca: + name: Static Code Analysis + runs-on: 'ubuntu-24.04' + env: + php-version: '7.1' + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: PHP setup + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + ini-values: zend.assertions=1, error_reporting=-1, display_errors=On, log_errors_max_len=0 + - name: "Update composer dependencies" + run: composer update -o --no-interaction --no-progress ${{ matrix.COMPOSER_FLAGS }} + - name: "composer-require-checker" + run: vendor/bin/composer-require-checker check composer.json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aadd63a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -language: php - -git: - depth: 1 - -cache: - directories: - - $HOME/.composer - -env: - global: - - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress" - - COMPOSER_FLAGS="" - -before_install: - # turn off XDebug - - phpenv config-rm xdebug.ini || return 0 - - # Composer: boost installation - - composer global show hirak/prestissimo -q || travis_retry composer global require $DEFAULT_COMPOSER_FLAGS hirak/prestissimo - -jobs: - include: - - - stage: Static Code Analysis - php: 7.1 - install: - - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS - - composer info -D | sort - script: - - ./vendor/bin/php-cs-fixer fix -v --dry-run - - ./vendor/bin/composer-require-checker check composer.json - - - &STANDARD_TEST_JOB - stage: Test - php: 7.2 - install: - - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS - - composer info -D | sort - script: - - vendor/bin/phpunit || travis_terminate 1 - - - - <<: *STANDARD_TEST_JOB - stage: Test - php: 7.1 - env: COMPOSER_FLAGS="--ignore-platform-reqs --prefer-stable --prefer-lowest" - - - - <<: *STANDARD_TEST_JOB - stage: Test - php: 7.3 - - - - <<: *STANDARD_TEST_JOB - stage: Test - php: 7.4 - - - - <<: *STANDARD_TEST_JOB - stage: Test - php: 8.0 From ac901f83c7563b9215cd5a7ab028aada0fc5a655 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sat, 12 Apr 2025 17:45:07 +0200 Subject: [PATCH 2/4] chore: allow PHP 8.4 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dfa161..d104683 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - php: "8.1" - php: "8.2" - php: "8.3" + - php: "8.4" steps: - name: Checkout source uses: actions/checkout@v4 From 19cfd3566095efd55a614c1361cbb49713d699fd Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sat, 12 Apr 2025 17:53:40 +0200 Subject: [PATCH 3/4] fix php 8.4 --- src/ExecutionException.php | 2 +- src/ScriptExecutor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ExecutionException.php b/src/ExecutionException.php index 64517e8..89a941b 100644 --- a/src/ExecutionException.php +++ b/src/ExecutionException.php @@ -20,7 +20,7 @@ final class ExecutionException extends \RuntimeException */ private $result; - public function __construct(CliResult $result, $message = '', $code = 0, \Exception $previous = null) + public function __construct(CliResult $result, $message = '', $code = 0, ?\Exception $previous = null) { parent::__construct($message, $code, $previous); diff --git a/src/ScriptExecutor.php b/src/ScriptExecutor.php index 36c873b..831972d 100644 --- a/src/ScriptExecutor.php +++ b/src/ScriptExecutor.php @@ -51,7 +51,7 @@ final class ScriptExecutor * @param string[] $scriptParts * @param ?string[] $scriptInit */ - public function __construct(array $scriptParts, string $cwd, array $scriptInit = null) + public function __construct(array $scriptParts, string $cwd, ?array $scriptInit = null) { $this->scriptParts = $scriptParts; $this->cwd = $cwd; From a9a4d3d08897c453b6b47a90551894fcfdff0c91 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sat, 12 Apr 2025 17:54:40 +0200 Subject: [PATCH 4/4] fix --- src/ScriptExecutor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScriptExecutor.php b/src/ScriptExecutor.php index 831972d..da61f47 100644 --- a/src/ScriptExecutor.php +++ b/src/ScriptExecutor.php @@ -69,7 +69,7 @@ public function __destruct() * @param string[] $scriptParts * @param ?string[] $scriptInit */ - public static function create(array $scriptParts, string $cwd, array $scriptInit = null): self + public static function create(array $scriptParts, string $cwd, ?array $scriptInit = null): self { return new self($scriptParts, $cwd, $scriptInit); }