Skip to content

Commit 4138bd5

Browse files
authored
qa/workflow-improvements (#40)
* Mark package as abandoned and update README with new package info. The `composer.json` now indicates that `dropelikeit/laravel-responsefactory` is abandoned. The README advises users to transition to a new package that offers additional functions, and support will extend only until Laravel 11's end. * Add .php-cs-fixer.cache to .gitignore Ignore the cache file generated by PHP-CS-Fixer to prevent unintentional version control. This helps maintain a clean repository, avoiding unnecessary files from being tracked. * Enable cache directory assertion Re-enable the assertion to ensure the cache directory is a non-empty string. This change helps prevent potential errors related to invalid cache directory configurations. Adjustments improve code reliability and enforce stricter input validation. * Remove unnecessary assertion from cache directory setup The assertion ensuring the cache directory is not empty has been removed to simplify the code, as its necessity was reevaluated. A comment has been added to suppress PHPStan warnings on this line, ensuring the codebase remains free of analysis errors. * Update dependencies and add PHP 8.4 workflow Upgraded versions of Psalm, its Laravel plugin, and Infection in `composer.json`. Simplified PHP CS Fixer command in the CI workflow. Added a new workflow to support testing and analysis for PHP 8.4. * Update infection/infection version constraint in composer.json Allow compatibility with both 0.27.10 and ^0.29.10 versions. This change ensures greater flexibility in dependency resolution while maintaining support for specific versions. * Update Psalm dependency to support version 5.x This change ensures compatibility with both Psalm 5.x and 6.x. It provides greater flexibility for projects that rely on older versions of Psalm while maintaining support for the latest version.
1 parent 4357297 commit 4138bd5

File tree

5 files changed

+53
-6
lines changed

5 files changed

+53
-6
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
run: "composer test-coverage"
7878

7979
- name: "Run PHP CS Check"
80-
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"
80+
run: "composer cs-check"
8181

8282
- name: "Run PHPStan"
8383
run: "composer analyze"
@@ -119,7 +119,7 @@ jobs:
119119
run: "composer test-coverage"
120120

121121
- name: "Run PHP CS Check"
122-
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"
122+
run: "composer cs-check"
123123

124124
- name: "Run PHPStan"
125125
run: "composer analyze"
@@ -133,4 +133,46 @@ jobs:
133133
- name: "Run infection"
134134
env:
135135
INFECTION_BADGE_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
136+
run: "composer infection-ci"
137+
138+
php84:
139+
name: PHP 8.4
140+
runs-on: ubuntu-latest
141+
steps:
142+
- name: "Checkout"
143+
uses: "actions/checkout@v4"
144+
with:
145+
fetch-depth: 2
146+
147+
- name: "Install PHP 8.4"
148+
uses: "shivammathur/setup-php@v2"
149+
with:
150+
php-version: "8.4"
151+
152+
- name: "Cache composer packages"
153+
uses: "actions/cache@v4"
154+
with:
155+
path: "vendor"
156+
key: "php-composer-locked-php-8.4-${{ hashFiles('**/composer.lock') }}"
157+
restore-keys: "php-composer-locked-php-8.3-"
158+
159+
- name: "Install dependencies with composer"
160+
run: "composer install --no-interaction --prefer-dist"
161+
162+
- name: "Run PHPUnit Tests"
163+
run: "composer test-coverage"
164+
165+
- name: "Run PHP CS Check"
166+
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"
167+
168+
- name: "Run PHPStan"
169+
run: "composer analyze"
170+
171+
- name: "Run Psalm"
172+
run: "composer psalm"
173+
174+
- name: "PHP Lint"
175+
run: "composer lint"
176+
177+
- name: "Run infection"
136178
run: "composer infection-ci"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# PHPUnit specific
22
.phpunit.result.cache
3+
.php-cs-fixer.cache
34

45
# Composer
56
/vendor/

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ JMS-Serializer: https://github.com/schmittjoh/serializer
1717

1818
You are also welcome to use the Issue Tracker to set bugs, improvements or upgrade requests.
1919

20+
> Please use the new package https://github.com/Dropelikeit/laravel-responsefactory in the future. The new package contains some new and useful functions!
21+
This package will only be supported until the end of Laravel 11. Until then, you should use the new package.
22+
2023
### Installation
2124

2225
``` composer require dropelikeit/laravel-jms-serializer ```

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"keywords": ["Lumen", "Laravel", "JMS Serializer", "JMS"],
55
"minimum-stability": "stable",
66
"license": "MIT",
7+
"abandoned": "dropelikeit/laravel-responsefactory",
78
"authors": [
89
{
910
"name": "Marcel Strahl",
@@ -44,10 +45,10 @@
4445
"phpstan/phpstan-phpunit": "^1.3",
4546
"php-parallel-lint/php-parallel-lint": "^1.3",
4647
"symfony/cache": "^6.3|^7.0",
47-
"vimeo/psalm": "^5.23",
48-
"psalm/plugin-laravel": "^2.10",
48+
"vimeo/psalm": "^5.0|^6.0",
49+
"psalm/plugin-laravel": "^2.11",
4950
"psalm/plugin-phpunit": "^0.19",
50-
"infection/infection": "^0.27.10",
51+
"infection/infection": "0.27.10|^0.29.10",
5152
"laravel/framework": "^10.0|^v11.0"
5253
},
5354
"scripts": {

src/Config/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ private function __construct(
4545
array $customHandlers,
4646
) {
4747
$cacheDir = sprintf('%s%s', $cacheDir, self::CACHE_DIR);
48-
#Assert::stringNotEmpty($cacheDir);
4948

49+
// @phpstan-ignore-next-line
5050
$this->cacheDir = $cacheDir;
5151
$this->customHandlers = $customHandlers;
5252
}

0 commit comments

Comments
 (0)