From 044049e00d5311c1b957da4ec16c9245873d82f8 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 11 Oct 2020 01:06:37 +0200 Subject: [PATCH 01/49] feat: removes rector --- .gitattributes | 6 ++---- .gitignore | 1 - .travis.yml | 20 -------------------- README.md | 2 +- composer.json | 18 +++++++----------- phpstan.neon.dist | 5 ----- rector.yaml | 16 ---------------- tests/Feature.php | 5 +++++ tests/Feature/ExampleTest.php | 7 ------- 9 files changed, 15 insertions(+), 65 deletions(-) delete mode 100644 .travis.yml delete mode 100644 rector.yaml create mode 100644 tests/Feature.php delete mode 100644 tests/Feature/ExampleTest.php diff --git a/.gitattributes b/.gitattributes index f19490b..7b50fc8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,10 +7,8 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.travis.yml export-ignore -phpstan.neon export-ignore -rector.yaml export-ignore -phpunit.xml export-ignore +phpstan.neon.dist export-ignore +phpunit.xml.dist export-ignore CHANGELOG.md export-ignore CONTRIBUTING.md export-ignore README.md export-ignore diff --git a/.gitignore b/.gitignore index 8c2406a..2d81636 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ .idea/codeStyleSettings.xml composer.lock /vendor/ -coverage.xml .phpunit.result.cache .php_cs.cache *.swp diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5211b17..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: php - -sudo: false - -php: - - 7.2 - - 7.3 - - nightly - -env: - matrix: - - COMPOSER_FLAGS="--prefer-lowest" - - COMPOSER_FLAGS="" - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - composer test diff --git a/README.md b/README.md index 55236dc..85bdb87 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This package provides a wonderful **PHP Skeleton** to start building your next p composer create-project nunomaduro/skeleton-php --prefer-source PackageName ``` -🧹 Keep a modern codebase with **PHP CS Fixer** & **Rector**: +🧹 Keep a modern codebase with **PHP CS Fixer**: ```bash composer lint ``` diff --git a/composer.json b/composer.json index 498766f..220ff67 100644 --- a/composer.json +++ b/composer.json @@ -10,17 +10,13 @@ } ], "require": { - "php": "^7.3" + "php": "^7.4" }, "require-dev": { - "pestphp/pest": "^0.2.2", - "friendsofphp/php-cs-fixer": "^2.16.3", - "ergebnis/phpstan-rules": "^0.15.0", - "phpstan/phpstan": "^0.12.31", - "phpstan/phpstan-strict-rules": "^0.12.2", - "symfony/var-dumper": "^5.1.2", - "rector/rector": "^0.7.37", - "thecodingmachine/phpstan-strict-rules": "^0.12.0" + "pestphp/pest": "^0.3.8", + "friendsofphp/php-cs-fixer": "^2.16.4", + "phpstan/phpstan": "^0.12.48", + "symfony/var-dumper": "^5.2.0" }, "autoload": { "psr-4": { @@ -39,8 +35,8 @@ "preferred-install": "dist" }, "scripts": { - "lint": "rector process src && php-cs-fixer fix -v", - "test:lint": "php-cs-fixer fix -v --dry-run && rector process src --dry-run", + "lint": "php-cs-fixer fix -v", + "test:lint": "php-cs-fixer fix -v --dry-run", "test:types": "phpstan analyse --ansi --memory-limit=0", "test:unit": "pest --colors=always", "test": [ diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 92a52bf..14bdd86 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,8 +1,3 @@ -includes: - - vendor/phpstan/phpstan-strict-rules/rules.neon - - vendor/ergebnis/phpstan-rules/rules.neon - - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon - parameters: level: max paths: diff --git a/rector.yaml b/rector.yaml deleted file mode 100644 index 90dd811..0000000 --- a/rector.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# rector.yaml -parameters: - sets: - - 'action-injection-to-constructor-injection' - - 'array-str-functions-to-static-call' - - 'celebrity' - - 'doctrine' - - 'phpstan' - - 'phpunit-code-quality' - - 'solid' - - 'early-return' - - 'doctrine-code-quality' - - 'code-quality' - - 'php71' - - 'php72' - - 'php73' diff --git a/tests/Feature.php b/tests/Feature.php new file mode 100644 index 0000000..61cd84c --- /dev/null +++ b/tests/Feature.php @@ -0,0 +1,5 @@ +toBeTrue(); +}); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index 59f7d2a..0000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,7 +0,0 @@ - Date: Sun, 11 Oct 2020 01:09:50 +0200 Subject: [PATCH 02/49] fix: github action running php 7.3 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ef25a1f..b3de6a3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: [7.3, 7.4] + php: [7.4] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From 5be302945db52d5f66eef88766ed8877a442f3b8 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 11 Oct 2020 01:36:39 +0200 Subject: [PATCH 03/49] fix: github action format --- .github/workflows/formats.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index bbdd577..e32b015 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -38,9 +38,7 @@ jobs: run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist - name: Coding Style Checks - run: | - vendor/bin/rector process src --dry-run - vendor/bin/php-cs-fixer fix -v --dry-run + run: composer test:lint - name: Type Checks - run: vendor/bin/phpstan analyse --ansi + run: composer test:types From db198ec994ac87219cbc29994aaf0a623e21fc01 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 11 Oct 2020 22:49:43 +0200 Subject: [PATCH 04/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 85bdb87..77210d2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ------ This package provides a wonderful **PHP Skeleton** to start building your next package idea. -> **Requires [PHP 7.3.0+](https://php.net/releases/)** +> **Requires [PHP 7.4.0+](https://php.net/releases/)** ⚡️ Create your package using [Composer](https://getcomposer.org): From 501602a47301ef0ca6f907198a1ad73de47fdaf2 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 5 May 2021 20:48:01 +0100 Subject: [PATCH 05/49] Adds support to PHP 8 and CS Fixer v3 --- .gitignore | 10 +++++----- .php_cs => .php-cs-fixer.dist.php | 2 +- composer.json | 10 +++++----- phpstan.neon.dist | 2 -- 4 files changed, 11 insertions(+), 13 deletions(-) rename .php_cs => .php-cs-fixer.dist.php (95%) diff --git a/.gitignore b/.gitignore index 2d81636..487716c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -.idea/* -.idea/codeStyleSettings.xml -composer.lock +/.phpunit.result.cache +/.php-cs-fixer.cache +/.php-cs-fixer.php +/composer.lock +/phpunit.xml /vendor/ -.phpunit.result.cache -.php_cs.cache *.swp *.swo diff --git a/.php_cs b/.php-cs-fixer.dist.php similarity index 95% rename from .php_cs rename to .php-cs-fixer.dist.php index 4277bb1..4dad68e 100644 --- a/.php_cs +++ b/.php-cs-fixer.dist.php @@ -22,7 +22,7 @@ $rules['increment_style'] = ['style' => 'post']; -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setUsingCache(true) ->setRules($rules) ->setFinder($finder); diff --git a/composer.json b/composer.json index 220ff67..edc1158 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,13 @@ } ], "require": { - "php": "^7.4" + "php": "^8.0" }, "require-dev": { - "pestphp/pest": "^0.3.8", - "friendsofphp/php-cs-fixer": "^2.16.4", - "phpstan/phpstan": "^0.12.48", - "symfony/var-dumper": "^5.2.0" + "pestphp/pest": "^1.1.0", + "friendsofphp/php-cs-fixer": "^3.0.0", + "phpstan/phpstan": "^0.12.85", + "symfony/var-dumper": "^5.2.7" }, "autoload": { "psr-4": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 14bdd86..5fd25fc 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -3,6 +3,4 @@ parameters: paths: - src - checkMissingIterableValueType: true - checkGenericClassInNonGenericObjectType: false reportUnmatchedIgnoredErrors: true From 33015b2f0597dc0275dbf724828433045d7e3ff0 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 5 May 2021 20:48:58 +0100 Subject: [PATCH 06/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77210d2..a4e4e27 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ------ This package provides a wonderful **PHP Skeleton** to start building your next package idea. -> **Requires [PHP 7.4.0+](https://php.net/releases/)** +> **Requires [PHP 8.0+](https://php.net/releases/)** ⚡️ Create your package using [Composer](https://getcomposer.org): From 13a7ec9f86308b557ba9a4e4a47b6d684ba3ff82 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 5 May 2021 20:50:31 +0100 Subject: [PATCH 07/49] Moves actions to PHP 8 --- .github/workflows/formats.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index e32b015..2339b03 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -10,7 +10,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [7.4] + php: [8.0] dependency-version: [prefer-lowest, prefer-stable] name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3de6a3..776d7d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: [7.4] + php: [8.0] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From 3d11d521dbb194b9e240edbba8dbdae38e5b19da Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 8 Nov 2021 09:07:34 +0000 Subject: [PATCH 08/49] chore: bumps dependencies --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index edc1158..4d78c62 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ "php": "^8.0" }, "require-dev": { - "pestphp/pest": "^1.1.0", - "friendsofphp/php-cs-fixer": "^3.0.0", - "phpstan/phpstan": "^0.12.85", - "symfony/var-dumper": "^5.2.7" + "pestphp/pest": "^1.20.0", + "friendsofphp/php-cs-fixer": "^3.2.1", + "phpstan/phpstan": "^1.1.1", + "symfony/var-dumper": "^5.3.10" }, "autoload": { "psr-4": { @@ -37,7 +37,7 @@ "scripts": { "lint": "php-cs-fixer fix -v", "test:lint": "php-cs-fixer fix -v --dry-run", - "test:types": "phpstan analyse --ansi --memory-limit=0", + "test:types": "phpstan analyse --ansi", "test:unit": "pest --colors=always", "test": [ "@test:lint", From 2527c92a2f405cbe4a3bd883b5b3323c9d375783 Mon Sep 17 00:00:00 2001 From: Daniel Ang Date: Mon, 8 Nov 2021 12:03:56 +0100 Subject: [PATCH 09/49] Test Example foo --- tests/Feature.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/Feature.php b/tests/Feature.php index 61cd84c..31c45e4 100644 --- a/tests/Feature.php +++ b/tests/Feature.php @@ -1,5 +1,14 @@ toBeTrue(); +use NunoMaduro\SkeletonPhp\Example; + +test('foo returns bar', function () { + //Arrange + $example = new Example(); + + //Act + $result = $example->foo(); + + //Assert + expect($result)->toBe('bar'); }); From 3139197ad8a3489ee4be8f0c53ce5aaaf4bb61cb Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 8 Nov 2021 15:11:24 +0000 Subject: [PATCH 10/49] chore: updates test --- tests/Feature.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/Feature.php b/tests/Feature.php index 31c45e4..d885ae9 100644 --- a/tests/Feature.php +++ b/tests/Feature.php @@ -2,13 +2,10 @@ use NunoMaduro\SkeletonPhp\Example; -test('foo returns bar', function () { - //Arrange +it('foo', function () { $example = new Example(); - //Act $result = $example->foo(); - //Assert expect($result)->toBe('bar'); }); From e056b954934142b9ff3a7b98a5a2ba705d47a57f Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 21 Nov 2021 18:22:47 +0000 Subject: [PATCH 11/49] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index d03cb24..0f791b1 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -2,4 +2,4 @@ github: nunomaduro patreon: nunomaduro -custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L +custom: https://www.paypal.com/paypalme/enunomaduro From 853878e8f2e96039b14ff9dc8ec6aaddbf267cda Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 12 Jun 2022 18:38:11 +0100 Subject: [PATCH 12/49] chore: allow to install pest plugins and updates dependencies --- composer.json | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 4d78c62..3e13570 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,13 @@ } ], "require": { - "php": "^8.0" + "php": "^8.1" }, "require-dev": { - "pestphp/pest": "^1.20.0", - "friendsofphp/php-cs-fixer": "^3.2.1", - "phpstan/phpstan": "^1.1.1", - "symfony/var-dumper": "^5.3.10" + "pestphp/pest": "^1.21.3", + "friendsofphp/php-cs-fixer": "^3.8.0", + "phpstan/phpstan": "^1.7.12", + "symfony/var-dumper": "^6.1.0" }, "autoload": { "psr-4": { @@ -32,7 +32,10 @@ "prefer-stable": true, "config": { "sort-packages": true, - "preferred-install": "dist" + "preferred-install": "dist", + "allow-plugins": { + "pestphp/pest-plugin": true + } }, "scripts": { "lint": "php-cs-fixer fix -v", From 3413591b87b8073e8b4934795ba674f7b5dfc8ee Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 12 Jun 2022 18:39:29 +0100 Subject: [PATCH 13/49] docs: requires PHP 8.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4e4e27..4e5390e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ------ This package provides a wonderful **PHP Skeleton** to start building your next package idea. -> **Requires [PHP 8.0+](https://php.net/releases/)** +> **Requires [PHP 8.1+](https://php.net/releases/)** ⚡️ Create your package using [Composer](https://getcomposer.org): From 346927efd0f2d6d4eb8b7a80a18e105600a75682 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 12 Jun 2022 18:40:29 +0100 Subject: [PATCH 14/49] chore: updates workflow php version --- .github/workflows/formats.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 2339b03..01f04a2 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -10,7 +10,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.0] + php: [8.1] dependency-version: [prefer-lowest, prefer-stable] name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 776d7d6..3b93dd7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: [8.0] + php: [8.1] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From 192b3a30e01d1481c6935d73602a455032f296b8 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 27 Jun 2022 10:56:35 +0100 Subject: [PATCH 15/49] Uses Laravel Pint --- .php-cs-fixer.dist.php | 28 ---------------------------- README.md | 2 +- composer.json | 6 +++--- 3 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 .php-cs-fixer.dist.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php deleted file mode 100644 index 4dad68e..0000000 --- a/.php-cs-fixer.dist.php +++ /dev/null @@ -1,28 +0,0 @@ -in(__DIR__ . DIRECTORY_SEPARATOR . 'tests') - ->in(__DIR__ . DIRECTORY_SEPARATOR . 'src') - ->append(['.php_cs']); - -$rules = [ - '@Symfony' => true, - 'phpdoc_no_empty_return' => false, - 'array_syntax' => ['syntax' => 'short'], - 'yoda_style' => false, - 'binary_operator_spaces' => [ - 'operators' => [ - '=>' => 'align', - '=' => 'align', - ], - ], - 'concat_space' => ['spacing' => 'one'], - 'not_operator_with_space' => false, -]; - -$rules['increment_style'] = ['style' => 'post']; - -return (new PhpCsFixer\Config()) - ->setUsingCache(true) - ->setRules($rules) - ->setFinder($finder); diff --git a/README.md b/README.md index 4e5390e..1a564ba 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This package provides a wonderful **PHP Skeleton** to start building your next p composer create-project nunomaduro/skeleton-php --prefer-source PackageName ``` -🧹 Keep a modern codebase with **PHP CS Fixer**: +🧹 Keep a modern codebase with **Pint**: ```bash composer lint ``` diff --git a/composer.json b/composer.json index 3e13570..2135d40 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "php": "^8.1" }, "require-dev": { + "laravel/pint": "^0.2.0", "pestphp/pest": "^1.21.3", - "friendsofphp/php-cs-fixer": "^3.8.0", "phpstan/phpstan": "^1.7.12", "symfony/var-dumper": "^6.1.0" }, @@ -38,8 +38,8 @@ } }, "scripts": { - "lint": "php-cs-fixer fix -v", - "test:lint": "php-cs-fixer fix -v --dry-run", + "lint": "pint -v", + "test:lint": "pint --test -v", "test:types": "phpstan analyse --ansi", "test:unit": "pest --colors=always", "test": [ From eaad272a06bc0e0fdeebc3433ce75b153c48d1e5 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 3 Sep 2022 12:54:43 +0100 Subject: [PATCH 16/49] Use stable version of Pint --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2135d40..d5e988b 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "^8.1" }, "require-dev": { - "laravel/pint": "^0.2.0", + "laravel/pint": "^1.1.2", "pestphp/pest": "^1.21.3", "phpstan/phpstan": "^1.7.12", "symfony/var-dumper": "^6.1.0" From ce812814dc0586ee2a187d7eae24000322b5534c Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Fri, 23 Sep 2022 22:34:18 +0100 Subject: [PATCH 17/49] Uses Pest v2.x --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index d5e988b..fd8a026 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,13 @@ } ], "require": { - "php": "^8.1" + "php": "^8.1.0" }, "require-dev": { - "laravel/pint": "^1.1.2", - "pestphp/pest": "^1.21.3", - "phpstan/phpstan": "^1.7.12", - "symfony/var-dumper": "^6.1.0" + "laravel/pint": "^1.2.0", + "pestphp/pest": "^2.0.0", + "phpstan/phpstan": "^1.8.6", + "symfony/var-dumper": "^6.2.0" }, "autoload": { "psr-4": { From 603b80b21e12024b8d87fddf028456de5978dc0f Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 7 Jan 2023 02:08:49 +0000 Subject: [PATCH 18/49] Uses PHP 8.2 --- .github/workflows/tests.yml | 2 +- composer.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b93dd7..e68401f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: [8.1] + php: [8.2] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} diff --git a/composer.json b/composer.json index fd8a026..2de0ab3 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,13 @@ } ], "require": { - "php": "^8.1.0" + "php": "^8.2.0" }, "require-dev": { - "laravel/pint": "^1.2.0", + "laravel/pint": "^1.3.0", "pestphp/pest": "^2.0.0", - "phpstan/phpstan": "^1.8.6", - "symfony/var-dumper": "^6.2.0" + "phpstan/phpstan": "^1.9.7", + "symfony/var-dumper": "^6.2.3" }, "autoload": { "psr-4": { From 000fdaa268bf51dcb5379246d00b477568378b35 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 15 Jan 2023 11:31:39 +0000 Subject: [PATCH 19/49] chore: requires PHP 8.2 --- .github/workflows/formats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 01f04a2..5974f60 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -10,7 +10,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.1] + php: [8.2] dependency-version: [prefer-lowest, prefer-stable] name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From 5dadfc10301ac956d806ea661e1bc439dbb5c389 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 15 Jan 2023 11:33:39 +0000 Subject: [PATCH 20/49] chore: migrates phpunit configuration --- .gitignore | 1 + composer.json | 4 ++-- phpunit.xml.dist | 16 ++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 487716c..2e9998e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.phpunit.result.cache +/.phpunit.cache /.php-cs-fixer.cache /.php-cs-fixer.php /composer.lock diff --git a/composer.json b/composer.json index 2de0ab3..28fe645 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,9 @@ "php": "^8.2.0" }, "require-dev": { - "laravel/pint": "^1.3.0", + "laravel/pint": "^1.4", "pestphp/pest": "^2.0.0", - "phpstan/phpstan": "^1.9.7", + "phpstan/phpstan": "^1.9.11", "symfony/var-dumper": "^6.2.3" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 368f6bd..ced37b4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,16 +1,16 @@ + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" + colors="true" + cacheDirectory=".phpunit.cache"> + + + ./src + + ./tests - - - ./src - - From c3edfe6af00f8684de26e31c924a25e5cf10762d Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 15 Jan 2023 11:34:49 +0000 Subject: [PATCH 21/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a564ba..e4a57ae 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ------ This package provides a wonderful **PHP Skeleton** to start building your next package idea. -> **Requires [PHP 8.1+](https://php.net/releases/)** +> **Requires [PHP 8.2+](https://php.net/releases/)** ⚡️ Create your package using [Composer](https://getcomposer.org): From e0e94774c124f750209324e66ac67ff0978dcd8c Mon Sep 17 00:00:00 2001 From: askdkc Date: Sun, 15 Jan 2023 21:09:15 +0900 Subject: [PATCH 22/49] Fix Status Badge This PR fixes Readme Status Badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4a57ae..f8d1450 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Skeleton Php

- GitHub Workflow Status (master) + GitHub Workflow Status (master) Total Downloads Latest Version License From 8804ebc3dbe7d6cc045e84fc5dc909054ee145bc Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 16 Apr 2023 14:29:00 +0100 Subject: [PATCH 23/49] chore: uses rector --- .gitattributes | 1 + README.md | 5 +++++ composer.json | 18 +++++++++++------- phpunit.xml.dist | 4 ++-- rector.php | 27 +++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 rector.php diff --git a/.gitattributes b/.gitattributes index 7b50fc8..b293739 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ .gitignore export-ignore phpstan.neon.dist export-ignore phpunit.xml.dist export-ignore +rector.php export-ignore CHANGELOG.md export-ignore CONTRIBUTING.md export-ignore README.md export-ignore diff --git a/README.md b/README.md index f8d1450..c0d2169 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,11 @@ composer create-project nunomaduro/skeleton-php --prefer-source PackageName composer lint ``` +✅ Run refactors using **Rector** +```bash +composer refacto +``` + ⚗️ Run static analysis using **PHPStan**: ```bash composer test:types diff --git a/composer.json b/composer.json index 28fe645..41ac1d1 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,11 @@ "php": "^8.2.0" }, "require-dev": { - "laravel/pint": "^1.4", - "pestphp/pest": "^2.0.0", - "phpstan/phpstan": "^1.9.11", - "symfony/var-dumper": "^6.2.3" + "laravel/pint": "^1.8", + "pestphp/pest": "^2.5.0", + "phpstan/phpstan": "^1.10.13", + "rector/rector": "^0.15.24", + "symfony/var-dumper": "^6.2.8" }, "autoload": { "psr-4": { @@ -28,7 +29,7 @@ "Tests\\": "tests/" } }, - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true, "config": { "sort-packages": true, @@ -38,11 +39,14 @@ } }, "scripts": { - "lint": "pint -v", - "test:lint": "pint --test -v", + "refacto": "rector", + "lint": "pint", + "test:refacto": "rector --dry-run", + "test:lint": "pint --test", "test:types": "phpstan analyse --ansi", "test:unit": "pest --colors=always", "test": [ + "@test:refacto", "@test:lint", "@test:types", "@test:unit" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ced37b4..35ce165 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,11 +3,11 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" colors="true" cacheDirectory=".phpunit.cache"> - + ./src - + ./tests diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..589b8cd --- /dev/null +++ b/rector.php @@ -0,0 +1,27 @@ +paths([ + __DIR__.'/src', + ]); + + $rectorConfig->rules([ + InlineConstructorDefaultToPropertyRector::class, + ]); + + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_81, + SetList::CODE_QUALITY, + SetList::DEAD_CODE, + SetList::EARLY_RETURN, + SetList::TYPE_DECLARATION, + SetList::PRIVATIZATION, + ]); +}; From e8455dd2b997cbaa25a66b94a5ffa8052e0dee3d Mon Sep 17 00:00:00 2001 From: Juse Less Date: Sun, 16 Apr 2023 17:01:56 +0200 Subject: [PATCH 24/49] Rector UP_TO_PHP_82 composer.json is set as PHP 8.2 as minimum, so setting up that for Rector --- rector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rector.php b/rector.php index 589b8cd..8f4319c 100644 --- a/rector.php +++ b/rector.php @@ -17,7 +17,7 @@ ]); $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_81, + LevelSetList::UP_TO_PHP_82, SetList::CODE_QUALITY, SetList::DEAD_CODE, SetList::EARLY_RETURN, From 33f59c237249f7409b7f099c66a2b97e4e72a901 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 8 Jun 2023 09:05:46 +0200 Subject: [PATCH 25/49] chore: increase deps --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 41ac1d1..c056e1f 100644 --- a/composer.json +++ b/composer.json @@ -13,11 +13,11 @@ "php": "^8.2.0" }, "require-dev": { - "laravel/pint": "^1.8", - "pestphp/pest": "^2.5.0", - "phpstan/phpstan": "^1.10.13", - "rector/rector": "^0.15.24", - "symfony/var-dumper": "^6.2.8" + "laravel/pint": "^1.10.1", + "pestphp/pest": "^2.6.3", + "phpstan/phpstan": "^1.10.18", + "rector/rector": "^0.15.25", + "symfony/var-dumper": "^6.3.0" }, "autoload": { "psr-4": { From be9212d2ec7d5d43ce5be88d0e908d8e372d5eaf Mon Sep 17 00:00:00 2001 From: Jayan Ratna Date: Fri, 9 Jun 2023 08:40:22 +1200 Subject: [PATCH 26/49] feat: update github workflow dependencies --- .github/workflows/formats.yml | 19 ++++++++++++------- .github/workflows/tests.yml | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 5974f60..2cef942 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -18,13 +18,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -34,6 +28,17 @@ jobs: tools: prestissimo coverage: pcov + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + restore-keys: dependencies-php-${{ matrix.php }}-composer- + - name: Install Composer dependencies run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e68401f..d3a1bcc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,13 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -32,6 +26,17 @@ jobs: extensions: dom, mbstring, zip coverage: none + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + restore-keys: dependencies-php-${{ matrix.php }}-composer- + - name: Install Composer dependencies run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist From a07d185f3f7b312aaad080c22273f2faf3ff97e3 Mon Sep 17 00:00:00 2001 From: Jayan Ratna Date: Fri, 9 Jun 2023 09:15:16 +1200 Subject: [PATCH 27/49] update shell --- .github/workflows/formats.yml | 1 + .github/workflows/tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 2cef942..0d05045 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -30,6 +30,7 @@ jobs: - name: Get Composer cache directory id: composer-cache + shell: bash run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d3a1bcc..8f368f5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,7 @@ jobs: - name: Get Composer cache directory id: composer-cache + shell: bash run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies From 554d360256bfe7c2625cbcb9927c8c0f37ed96ed Mon Sep 17 00:00:00 2001 From: Jayan Ratna Date: Fri, 9 Jun 2023 09:22:18 +1200 Subject: [PATCH 28/49] update cache key to be more specific --- .github/workflows/formats.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 0d05045..9337975 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -37,8 +37,8 @@ jobs: uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - restore-keys: dependencies-php-${{ matrix.php }}-composer- + key: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }} + restore-keys: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer- - name: Install Composer dependencies run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f368f5..3b1fc4a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,8 +35,8 @@ jobs: uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - restore-keys: dependencies-php-${{ matrix.php }}-composer- + key: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }} + restore-keys: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer- - name: Install Composer dependencies run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist From ca919e6718e5d53b889f223d2e9b1f5cbe3a9fd8 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 24 Jul 2023 10:05:52 +0100 Subject: [PATCH 29/49] chore: bump dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index c056e1f..e2e82bb 100644 --- a/composer.json +++ b/composer.json @@ -13,11 +13,11 @@ "php": "^8.2.0" }, "require-dev": { - "laravel/pint": "^1.10.1", - "pestphp/pest": "^2.6.3", - "phpstan/phpstan": "^1.10.18", + "laravel/pint": "^1.10.5", + "pestphp/pest": "^2.9.4", + "phpstan/phpstan": "^1.10.26", "rector/rector": "^0.15.25", - "symfony/var-dumper": "^6.3.0" + "symfony/var-dumper": "^6.3.1" }, "autoload": { "psr-4": { From 9eb08fb5f9850d2b1dff49a1e34a67a8bd52b88e Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Sat, 5 Aug 2023 22:54:52 +0200 Subject: [PATCH 30/49] prestissimo is no longer needed with composer 2 --- .github/workflows/formats.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 9337975..393394e 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -25,7 +25,6 @@ jobs: with: php-version: ${{ matrix.php }} extensions: dom, mbstring, zip - tools: prestissimo coverage: pcov - name: Get Composer cache directory From 504dcc1295f51c6edd436af9e3c4fcdd183597bc Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 19 Sep 2023 13:56:28 +0100 Subject: [PATCH 31/49] chore: bumps dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index e2e82bb..1dd6e7e 100644 --- a/composer.json +++ b/composer.json @@ -13,11 +13,11 @@ "php": "^8.2.0" }, "require-dev": { - "laravel/pint": "^1.10.5", - "pestphp/pest": "^2.9.4", - "phpstan/phpstan": "^1.10.26", + "laravel/pint": "^1.13.1", + "pestphp/pest": "^2.19.2", + "phpstan/phpstan": "^1.10.34", "rector/rector": "^0.15.25", - "symfony/var-dumper": "^6.3.1" + "symfony/var-dumper": "^6.3.4" }, "autoload": { "psr-4": { From 220866743534f1ea80d7b9615c80e43dc61d5982 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 19 Sep 2023 14:01:28 +0100 Subject: [PATCH 32/49] chore: bumps dependencies --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1dd6e7e..b8575ec 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "laravel/pint": "^1.13.1", "pestphp/pest": "^2.19.2", "phpstan/phpstan": "^1.10.34", - "rector/rector": "^0.15.25", + "rector/rector": "^0.18.3", "symfony/var-dumper": "^6.3.4" }, "autoload": { From 05f9a0809593f4b9247cf440190ae7bca48411dd Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 10 Oct 2023 09:44:20 +0100 Subject: [PATCH 33/49] chore: tests against PHP 8.3 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b1fc4a..f60fcec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: [8.2] + php: ['8.2', '8.3'] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From 5fcfb92e30904ad9337a5d3bde127da5bf8421d8 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 26 Dec 2023 09:29:13 +0000 Subject: [PATCH 34/49] chore: adds symfony 7 support --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index b8575ec..5e036dd 100644 --- a/composer.json +++ b/composer.json @@ -13,11 +13,11 @@ "php": "^8.2.0" }, "require-dev": { - "laravel/pint": "^1.13.1", - "pestphp/pest": "^2.19.2", - "phpstan/phpstan": "^1.10.34", - "rector/rector": "^0.18.3", - "symfony/var-dumper": "^6.3.4" + "laravel/pint": "^1.13.7", + "pestphp/pest": "^2.28.1", + "phpstan/phpstan": "^1.10.50", + "rector/rector": "^0.18.13", + "symfony/var-dumper": "^6.4.0|^7.0.0" }, "autoload": { "psr-4": { From e6749dce247e7c99927dab6409e4aa7fc9b98256 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 19 Sep 2024 12:43:26 +0100 Subject: [PATCH 35/49] chore: bumps dependencies --- composer.json | 12 ++++++------ rector.php | 37 +++++++++++++++++-------------------- tests/Feature.php | 2 +- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 5e036dd..65b11fe 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ } ], "require": { - "php": "^8.2.0" + "php": "^8.3.0" }, "require-dev": { - "laravel/pint": "^1.13.7", - "pestphp/pest": "^2.28.1", - "phpstan/phpstan": "^1.10.50", - "rector/rector": "^0.18.13", - "symfony/var-dumper": "^6.4.0|^7.0.0" + "laravel/pint": "^1.17.3", + "pestphp/pest": "^3.0.7", + "phpstan/phpstan": "^1.12.4", + "rector/rector": "^1.2.5", + "symfony/var-dumper": "^7.1.4" }, "autoload": { "psr-4": { diff --git a/rector.php b/rector.php index 8f4319c..0c54648 100644 --- a/rector.php +++ b/rector.php @@ -2,26 +2,23 @@ declare(strict_types=1); -use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; +use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure() + ->withPaths([ __DIR__.'/src', - ]); - - $rectorConfig->rules([ - InlineConstructorDefaultToPropertyRector::class, - ]); - - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_82, - SetList::CODE_QUALITY, - SetList::DEAD_CODE, - SetList::EARLY_RETURN, - SetList::TYPE_DECLARATION, - SetList::PRIVATIZATION, - ]); -}; + __DIR__.'/tests', + ]) + ->withSkip([ + AddOverrideAttributeToOverriddenMethodsRector::class, + ]) + ->withPreparedSets( + deadCode: true, + codeQuality: true, + typeDeclarations: true, + privatization: true, + earlyReturn: true, + strictBooleans: true, + ) + ->withPhpSets(); diff --git a/tests/Feature.php b/tests/Feature.php index d885ae9..d8ad650 100644 --- a/tests/Feature.php +++ b/tests/Feature.php @@ -2,7 +2,7 @@ use NunoMaduro\SkeletonPhp\Example; -it('foo', function () { +it('foo', function (): void { $example = new Example(); $result = $example->foo(); From 521b19c34e0f14c00883ec15a7e83fa1973dd6f0 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 19 Sep 2024 12:45:31 +0100 Subject: [PATCH 36/49] chore: bumps dependencies --- composer.json | 3 ++- tests/Feature.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 65b11fe..62d7afe 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "require-dev": { "laravel/pint": "^1.17.3", "pestphp/pest": "^3.0.7", + "pestphp/pest-plugin-type-coverage": "^3.0", "phpstan/phpstan": "^1.12.4", "rector/rector": "^1.2.5", "symfony/var-dumper": "^7.1.4" @@ -44,7 +45,7 @@ "test:refacto": "rector --dry-run", "test:lint": "pint --test", "test:types": "phpstan analyse --ansi", - "test:unit": "pest --colors=always", + "test:unit": "pest --colors=always --coverage --parallel --min=100", "test": [ "@test:refacto", "@test:lint", diff --git a/tests/Feature.php b/tests/Feature.php index d8ad650..cfc83bb 100644 --- a/tests/Feature.php +++ b/tests/Feature.php @@ -3,7 +3,7 @@ use NunoMaduro\SkeletonPhp\Example; it('foo', function (): void { - $example = new Example(); + $example = new Example; $result = $example->foo(); From 44b4e57b70ac502a213a1949123dcf2d6b002167 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 19 Sep 2024 21:02:45 +0100 Subject: [PATCH 37/49] chore: bumps php version on ci actions --- .github/workflows/formats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 393394e..98ea749 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -10,7 +10,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2] + php: [8.3] dependency-version: [prefer-lowest, prefer-stable] name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From 5d9a46dad877878dc3566c8b991984dae848a36d Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 19 Sep 2024 21:03:30 +0100 Subject: [PATCH 38/49] chore: bumps php version on ci actions --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f60fcec..7110f8d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: ['8.2', '8.3'] + php: ['8.3'] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From 9db99f597ed77ddadb4d5af1c9855af0e79ced5c Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 19 Sep 2024 21:14:05 +0100 Subject: [PATCH 39/49] chore: updates readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0d2169..d0940da 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ------ This package provides a wonderful **PHP Skeleton** to start building your next package idea. -> **Requires [PHP 8.2+](https://php.net/releases/)** +> **Requires [PHP 8.3+](https://php.net/releases/)** ⚡️ Create your package using [Composer](https://getcomposer.org): From 7dd031fc29441b33c0386efa22235ef32625b762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Ign=C3=A1cz?= Date: Thu, 24 Oct 2024 21:34:04 +0200 Subject: [PATCH 40/49] docs: update readme twitter link to x --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0940da..57e2ee8 100644 --- a/README.md +++ b/README.md @@ -44,4 +44,4 @@ composer test:unit composer test ``` -**Skeleton PHP** was created by **[Nuno Maduro](https://twitter.com/enunomaduro)** under the **[MIT license](https://opensource.org/licenses/MIT)**. +**Skeleton PHP** was created by **[Nuno Maduro](https://x.com/enunomaduro)** under the **[MIT license](https://opensource.org/licenses/MIT)**. From dc29ddada57857cea57d9dafef71f052e3a86e9b Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 2 Nov 2024 07:11:39 -0400 Subject: [PATCH 41/49] chore: bumps dependencies --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 62d7afe..9cefe75 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,12 @@ "php": "^8.3.0" }, "require-dev": { - "laravel/pint": "^1.17.3", - "pestphp/pest": "^3.0.7", - "pestphp/pest-plugin-type-coverage": "^3.0", - "phpstan/phpstan": "^1.12.4", - "rector/rector": "^1.2.5", - "symfony/var-dumper": "^7.1.4" + "laravel/pint": "^1.18.1", + "pestphp/pest": "^3.5.1", + "pestphp/pest-plugin-type-coverage": "^3.1", + "phpstan/phpstan": "^1.12.7", + "rector/rector": "^1.2.8", + "symfony/var-dumper": "^7.1.6" }, "autoload": { "psr-4": { From a868800d1807f30de02b987e3afd0e26f3026aed Mon Sep 17 00:00:00 2001 From: Paul Albandoz Date: Sun, 19 Jan 2025 20:14:11 +0100 Subject: [PATCH 42/49] chore: adds peck --- .gitattributes | 1 + composer.json | 3 +++ peck.json | 8 ++++++++ 3 files changed, 12 insertions(+) create mode 100644 peck.json diff --git a/.gitattributes b/.gitattributes index b293739..cabf750 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,6 +7,7 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore +peck.json export-ignore phpstan.neon.dist export-ignore phpunit.xml.dist export-ignore rector.php export-ignore diff --git a/composer.json b/composer.json index 9cefe75..002804a 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ }, "require-dev": { "laravel/pint": "^1.18.1", + "peckphp/peck": "^0.1.1", "pestphp/pest": "^3.5.1", "pestphp/pest-plugin-type-coverage": "^3.1", "phpstan/phpstan": "^1.12.7", @@ -44,11 +45,13 @@ "lint": "pint", "test:refacto": "rector --dry-run", "test:lint": "pint --test", + "test:typos": "peck", "test:types": "phpstan analyse --ansi", "test:unit": "pest --colors=always --coverage --parallel --min=100", "test": [ "@test:refacto", "@test:lint", + "@test:typos", "@test:types", "@test:unit" ] diff --git a/peck.json b/peck.json new file mode 100644 index 0000000..94b4e71 --- /dev/null +++ b/peck.json @@ -0,0 +1,8 @@ +{ + "preset": "base", + "ignore": { + "words": [ + "php" + ] + } +} From e8adbc05e96e962a5a81cca49d80caed2d82edad Mon Sep 17 00:00:00 2001 From: Edwin van de Pol Date: Fri, 11 Apr 2025 12:51:41 +0200 Subject: [PATCH 43/49] chore: fix typo in composer scripts After seeing your talk at Laracon India 2025, I realised this is probably a typo. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 002804a..8738e1c 100644 --- a/composer.json +++ b/composer.json @@ -41,15 +41,15 @@ } }, "scripts": { - "refacto": "rector", + "refactor": "rector", "lint": "pint", - "test:refacto": "rector --dry-run", + "test:refactor": "rector --dry-run", "test:lint": "pint --test", "test:typos": "peck", "test:types": "phpstan analyse --ansi", "test:unit": "pest --colors=always --coverage --parallel --min=100", "test": [ - "@test:refacto", + "@test:refactor", "@test:lint", "@test:typos", "@test:types", From 407e6cfc265dcc4a1a3b8491fb07178aae6027e5 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 24 Apr 2025 06:51:42 +0100 Subject: [PATCH 44/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57e2ee8..86916bd 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ composer lint ✅ Run refactors using **Rector** ```bash -composer refacto +composer refactor ``` ⚗️ Run static analysis using **PHPStan**: From 4bfdfd5999ca02c72ba9b852915e267221b50b98 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 19 May 2025 20:29:13 +0100 Subject: [PATCH 45/49] chore: bumps dependencies --- .gitignore | 1 + composer.json | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 2e9998e..58e0c87 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ /composer.lock /phpunit.xml /vendor/ +/.idea/ *.swp *.swo diff --git a/composer.json b/composer.json index 8738e1c..c56042d 100644 --- a/composer.json +++ b/composer.json @@ -10,16 +10,16 @@ } ], "require": { - "php": "^8.3.0" + "php": "^8.4.0" }, "require-dev": { - "laravel/pint": "^1.18.1", - "peckphp/peck": "^0.1.1", - "pestphp/pest": "^3.5.1", - "pestphp/pest-plugin-type-coverage": "^3.1", - "phpstan/phpstan": "^1.12.7", - "rector/rector": "^1.2.8", - "symfony/var-dumper": "^7.1.6" + "laravel/pint": "^1.22.1", + "peckphp/peck": "^0.1.3", + "pestphp/pest": "^4.0.0", + "pestphp/pest-plugin-type-coverage": "^4.0.0", + "phpstan/phpstan": "^2.1.16", + "rector/rector": "^2.0.16", + "symfony/var-dumper": "^7.2.6" }, "autoload": { "psr-4": { @@ -31,7 +31,7 @@ "Tests\\": "tests/" } }, - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true, "config": { "sort-packages": true, @@ -41,19 +41,21 @@ } }, "scripts": { - "refactor": "rector", "lint": "pint", - "test:refactor": "rector --dry-run", - "test:lint": "pint --test", + "refactor": "rector", + "test:type-coverage": "pest --type-coverage --exactly=100", "test:typos": "peck", - "test:types": "phpstan analyse --ansi", - "test:unit": "pest --colors=always --coverage --parallel --min=100", + "test:lint": "pint --test", + "test:unit": "pest --coverage --exactly=100", + "test:types": "phpstan", + "test:refactor": "rector --dry-run", "test": [ - "@test:refactor", "@test:lint", + "@test:type-coverage", "@test:typos", + "@test:unit", "@test:types", - "@test:unit" + "@test:refactor" ] } } From f9ac747214d4e10aab4041556649037b05adf7b8 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 19 May 2025 20:31:17 +0100 Subject: [PATCH 46/49] chore: fixes ci --- .github/workflows/formats.yml | 6 +++--- .github/workflows/tests.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 98ea749..ceef196 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -10,7 +10,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.3] + php: [8.4] dependency-version: [prefer-lowest, prefer-stable] name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -33,7 +33,7 @@ jobs: run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7110f8d..e582bdd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: ['8.3'] + php: [8.4] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -32,7 +32,7 @@ jobs: run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }} From 7512f1aadcdb70cc45521f9e1036a403cd1138cd Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 17 Sep 2025 01:13:20 +0100 Subject: [PATCH 47/49] chore: bumps dependencies --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index c56042d..ce0636f 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,13 @@ "php": "^8.4.0" }, "require-dev": { - "laravel/pint": "^1.22.1", + "laravel/pint": "^1.24.0", "peckphp/peck": "^0.1.3", - "pestphp/pest": "^4.0.0", - "pestphp/pest-plugin-type-coverage": "^4.0.0", - "phpstan/phpstan": "^2.1.16", - "rector/rector": "^2.0.16", - "symfony/var-dumper": "^7.2.6" + "pestphp/pest": "^4.1.0", + "pestphp/pest-plugin-type-coverage": "^4.0.2", + "phpstan/phpstan": "^2.1.26", + "rector/rector": "^2.1.7", + "symfony/var-dumper": "^7.3.3" }, "autoload": { "psr-4": { From 25690997fa1314d571804316c31b999386245b60 Mon Sep 17 00:00:00 2001 From: nuno maduro Date: Wed, 17 Sep 2025 01:14:20 +0100 Subject: [PATCH 48/49] version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 86916bd..bcc4aa0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ------ This package provides a wonderful **PHP Skeleton** to start building your next package idea. -> **Requires [PHP 8.3+](https://php.net/releases/)** +> **Requires [PHP 8.4+](https://php.net/releases/)** ⚡️ Create your package using [Composer](https://getcomposer.org): From 83f0bcdf2823c73a8f1d074d70aa8c26f2a43f98 Mon Sep 17 00:00:00 2001 From: nuno maduro Date: Wed, 17 Sep 2025 20:43:02 +0100 Subject: [PATCH 49/49] Change Composer command option in README Updated Composer command to use --prefer-dist instead of --prefer-source. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bcc4aa0..dad8d64 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This package provides a wonderful **PHP Skeleton** to start building your next p ⚡️ Create your package using [Composer](https://getcomposer.org): ```bash -composer create-project nunomaduro/skeleton-php --prefer-source PackageName +composer create-project nunomaduro/skeleton-php --prefer-dist PackageName ``` 🧹 Keep a modern codebase with **Pint**: