Skip to content

Commit

Permalink
Support PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ariademur committed May 26, 2023
1 parent bba627c commit f03da59
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/downgraded_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Downgraded Release

on:
push:
tags:
- '*'

jobs:
downgrade_release:
runs-on: ubuntu-latest

steps:
-
uses: "actions/checkout@v2"

-
uses: "shivammathur/setup-php@v2"
with:
php-version: 8.2
coverage: none

- uses: "ramsey/composer-install@v2"

# downgrade /src to PHP 7.4
- run: vendor/bin/rector process src --config build/rector-downgrade-php-74.php --ansi

# copy PHP 7.4 composer
- run: cp build/composer-php-74.json composer.json

# clear the dev files
- run: rm -rf .github .phpcs .scannerwork build tests

# setup git user
-
run: |
git config user.email "action@github.com"
git config user.name "GitHub Action"
# publish to the same repository with a new tag
-
name: "Tag Downgraded Code"
run: |
git commit -a -m "release PHP 7.4 downgraded ${GITHUB_REF#refs/tags/}"
git tag "${GITHUB_REF#refs/tags/}.74"
git push origin "${GITHUB_REF#refs/tags/}.74"
28 changes: 28 additions & 0 deletions build/composer-php-74.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"authors" : [
{
"name" : "Radu Maier",
"email" : "ariademur@webserv.co"
}
],
"autoload" : {
"psr-4" : {
"Tests\\Unit\\" : "tests/Unit/",
"WebServCo\\" : "src/WebServCo/"
}
},
"description" : "A PHP component.",
"homepage" : "https://webserv.co",
"keywords" : [
"component",
"webservco"
],
"license" : "MIT",
"name" : "webservco/log",
"require": {
"php" : "^7.4",
"psr/log": "^3"

},
"type" : "library"
}
10 changes: 10 additions & 0 deletions build/rector-downgrade-php-74.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\DowngradeLevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_74]);
};
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"phpstan/phpstan-phpunit": "^1",
"phpstan/phpstan" : "^1",
"phpunit/phpunit": "^10",
"rector/rector": "^0",
"slevomat/coding-standard": "^8",
"squizlabs/php_codesniffer" : "^3",
"vimeo/psalm": "^5",
Expand Down

0 comments on commit f03da59

Please sign in to comment.