Skip to content

Commit

Permalink
Merge pull request #17 from liip/drop-php7
Browse files Browse the repository at this point in the history
get rid of legacy things in code
  • Loading branch information
dbu authored Dec 14, 2023
2 parents b6389c2 + a611ff4 commit a6d5551
Show file tree
Hide file tree
Showing 11 changed files with 346 additions and 753 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- 1.x
- 2.x
pull_request:

jobs:
Expand All @@ -14,9 +14,9 @@ jobs:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'

steps:
- name: Setup PHP
Expand All @@ -28,9 +28,5 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Update dependencies for PHP 8
if: matrix.php >= '8.0'
run: composer update --prefer-dist --no-interaction --no-progress --no-ansi

- name: Execute tests
run: make phpcs
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
coverage: none
ini-values: phar.readonly=0

Expand All @@ -26,16 +26,12 @@ jobs:
- name: Update application version
run: sed -i 's/Varnish Plus CLI/Varnish Plus CLI ${{ steps.get-version.outputs.version }}/g' bin/varnish-plus-cli.php && cat bin/varnish-plus-cli.php

- name: Build PHP 7.4 phar with makefile
- name: Build phar with makefile
run: make dist

- name: Build PHP 8.0 phar with makefile
run: make dist-php8

- name: Check if we can run the phar
run: |
./dist/varnish-plus-cli.phar --version
./dist/varnish-plus-cli.8.0.phar --version
- name: Create Release
uses: ncipollo/release-action@v1
Expand All @@ -46,5 +42,5 @@ jobs:
name: ${{ steps.get-version.outputs.version }}
tag: ${{ steps.get-version.outputs.version }}
body: 'Stable release.'
artifacts: ./dist/varnish-plus-cli.phar, ./dist/varnish-plus-cli.8.0.phar
artifacts: ./dist/varnish-plus-cli.phar
artifactContentType: application/x-php
9 changes: 1 addition & 8 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PSR12' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
Expand Down Expand Up @@ -46,15 +47,7 @@
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_dedicate_assert' => true,
'php_unit_expectation' => true,
'php_unit_mock' => true,
'php_unit_namespaced' => true,
'php_unit_no_expectation_annotation' => true,
'phpdoc_order_by_value' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_strict' => true,
'php_unit_test_annotation' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Changelog
2.x
===

2.0.0
-----

* Drop support for PHP 7 and PHP 8.0
* Only provide CLI for PHP 8.1 or newer as varnish-plus-cli.phar
* Upgraded the bundled libraries to new versions

1.x
===

Expand Down
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ SRC_FILES= $(shell find $(SRC_DIR) -name "*.php")
dist/varnish-plus-cli.phar: vendor box.json.dist tools/box bin/varnish-plus-cli.php $(SRC_FILES) composer.lock
./tools/box compile --quiet

dist/varnish-plus-cli.8.0.phar: vendor box.json.dist tools/box bin/varnish-plus-cli.php $(SRC_FILES) composer.lock
mv dist/varnish-plus-cli.phar dist/tmp
composer update --optimize-autoloader --no-dev --no-suggest --quiet
./tools/box compile --quiet
mv dist/varnish-plus-cli.phar dist/varnish-plus-cli.8.0.phar
mv dist/tmp dist/varnish-plus-cli.phar

tools/box:
wget --directory-prefix=tools --quiet https://github.com/humbug/box/releases/download/3.16.0/box.phar
mv tools/box.phar tools/box
Expand Down Expand Up @@ -40,8 +33,6 @@ fix-cs: tools/php-cs-fixer

dist: dist/varnish-plus-cli.phar

dist-php8: dist/varnish-plus-cli.8.0.phar

clean:
rm -Rf tools/ dist/ vendor/

Expand Down
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
"psr-4": { "App\\": "src/" }
},
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.3",
"pnz/json-exception": "^1.0.1",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"symfony/console": "^4.2 || ^5.0 || ^6.0",
"symfony/filesystem": "^4.2 || ^5.0 || ^6.0",
"twig/twig": "^2.5"
"guzzlehttp/guzzle": "^7.8.1",
"psr/log": "^3.0",
"symfony/console": "^6.4",
"symfony/filesystem": "^6.4",
"twig/twig": "^3.8"
},
"config": {
"sort-packages": true
Expand Down
Loading

0 comments on commit a6d5551

Please sign in to comment.