From 50e3f6001018008879f14842b6dc17d8f460a633 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 10:15:28 +0000 Subject: [PATCH 01/42] Bump ramsey/composer-install from 1 to 2 Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 1 to 2. - [Release notes](https://github.com/ramsey/composer-install/releases) - [Commits](https://github.com/ramsey/composer-install/compare/v1...v2) --- updated-dependencies: - dependency-name: ramsey/composer-install dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/phpstan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 557d263e..9d41c0cf 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -20,7 +20,7 @@ jobs: coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v1 + uses: ramsey/composer-install@v2 - name: Run PHPStan run: ./vendor/bin/phpstan --error-format=github From 9ed4a06c7fa38d90c34518f959cdee39cf4bfaae Mon Sep 17 00:00:00 2001 From: riccardodallavia Date: Mon, 19 Dec 2022 16:16:08 +0100 Subject: [PATCH 02/42] FIX run-tests workflow failing on prefer-lowest runs --- .github/workflows/run-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index eeb3eae3..08cc9ab4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,6 +19,7 @@ jobs: include: - laravel: 9.* testbench: 7.* + carbon: ^2.63 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -40,7 +41,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: List Installed Dependencies From 31104b4dd254ca103d3d001905246f67c1de400c Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Mon, 19 Dec 2022 17:01:38 +0000 Subject: [PATCH 03/42] docs: update broken Shields badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1c21a60..375da962 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # :package_description [![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug) -[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/run-tests?label=tests)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain) -[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) +[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain) +[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug) --- From 9a8ebdb89a688520025ea51dff0c209282e04a4b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jan 2023 10:02:24 +0000 Subject: [PATCH 04/42] Bump aglipanci/laravel-pint-action from 1.0.0 to 2.1.0 Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 1.0.0 to 2.1.0. - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases) - [Commits](https://github.com/aglipanci/laravel-pint-action/compare/1.0.0...2.1.0) --- updated-dependencies: - dependency-name: aglipanci/laravel-pint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/fix-php-code-style-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 150750cb..39a77e7b 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -16,7 +16,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@1.0.0 + uses: aglipanci/laravel-pint-action@2.1.0 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 From 9f829d42a61bd34bf0db65df97088f7ea1f71724 Mon Sep 17 00:00:00 2001 From: riccardodallavia Date: Wed, 18 Jan 2023 12:46:33 +0100 Subject: [PATCH 05/42] UPDATE laravel-package-tools dependency version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b5e1f873..bddfe85a 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^8.1", - "spatie/laravel-package-tools": "^1.13.0", + "spatie/laravel-package-tools": "^1.14.0", "illuminate/contracts": "^9.0" }, "require-dev": { From 69c97567420dda3be2c3a60942eb5b52d2923b47 Mon Sep 17 00:00:00 2001 From: Peter Fox Date: Sun, 29 Jan 2023 15:10:16 +0000 Subject: [PATCH 06/42] Bug reporting via GH forms ## Uses Github's issue forms feature Documentation: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms Announcement: https://github.blog/changelog/2021-06-23-issues-forms-beta-for-public-repositories/ Example of it in use: [Feature Flags for Laravel new Issue Page](https://github.com/ylsideas/feature-flags/issues/new/choose) [Feature Flags for Laravel Bug Report Form](https://github.com/ylsideas/feature-flags/issues/new?assignees=peterfox&labels=bug&template=bug.yml&title=%5BBug%5D%3A+) --- I've been using this technique for a few months and it's a lot better in guiding users of a package to provide the right information. The form will ask for info like what happened, how to reproduce the bug, the package version, PHP version, Laravel version and which operating systems were used. There is also an optional notes field for further thoughts from the end user. The Issue link can be removed from `.github/ISSUE_TEMPLATE/config.yml` because the `.github/ISSUE_TEMPLATE/bug.yml` file will be found and automatically displayed on the new issue page. --- .github/ISSUE_TEMPLATE/bug.yml | 66 +++++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 3 -- 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 00000000..fe4cfe6d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,66 @@ +name: Bug Report +description: Report an Issue or Bug with the Package +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + We're sorry to hear you have a problem. Can you help us solve it by providing the following details. + - type: textarea + id: what-happened + attributes: + label: What happened? + description: What did you expect to happen? + placeholder: I cannot currently do X thing because when I do, it breaks X thing. + validations: + required: true + - type: textarea + id: how-to-reproduce + attributes: + label: How to reproduce the bug + description: How did this occur, please add any config values used and provide a set of reliable steps if possible. + placeholder: When I do X I see Y. + validations: + required: true + - type: input + id: package-version + attributes: + label: Package Version + description: What version of our Package are you running? Please be as specific as possible + placeholder: 2.0.0 + validations: + required: true + - type: input + id: php-version + attributes: + label: PHP Version + description: What version of PHP are you running? Please be as specific as possible + placeholder: 8.2.0 + validations: + required: true + - type: input + id: laravel-version + attributes: + label: Laravel Version + description: What version of Laravel are you running? Please be as specific as possible + placeholder: 9.0.0 + validations: + required: true + - type: dropdown + id: operating-systems + attributes: + label: Which operating systems does with happen with? + description: You may select more than one. + multiple: true + options: + - macOS + - Windows + - Linux + - type: textarea + id: notes + attributes: + label: Notes + description: Use this field to provide any other notes that you feel might be relevant to the issue. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ea26ad41..96701be9 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -9,6 +9,3 @@ contact_links: - name: Report a security issue url: https://github.com/:vendor_name/:package_name/security/policy about: Learn how to notify us for sensitive bugs - - name: Report a bug - url: https://github.com/:vendor_name/:package_name/issues/new - about: Report a reproducible bug From de867e81c7b8a23f919b3bf192d01ccab383a81c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:04:20 +0000 Subject: [PATCH 07/42] Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.5 to 1.3.6. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.5...v1.3.6) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index e7e28b90..32f77541 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.5 + uses: dependabot/fetch-metadata@v1.3.6 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 03f65fa0af6acec71804a041f97c14a445e7ce7a Mon Sep 17 00:00:00 2001 From: Oliver Lumby Date: Mon, 20 Feb 2023 12:15:18 +0100 Subject: [PATCH 08/42] bump default versions to Laravel 10 --- .github/workflows/run-tests.yml | 6 +++--- composer.json | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 08cc9ab4..57152e11 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,11 +14,11 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.2, 8.1] - laravel: [9.*] + laravel: [10.*] stability: [prefer-lowest, prefer-stable] include: - - laravel: 9.* - testbench: 7.* + - laravel: 10.* + testbench: 8.* carbon: ^2.63 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index bddfe85a..47b65968 100644 --- a/composer.json +++ b/composer.json @@ -18,19 +18,19 @@ "require": { "php": "^8.1", "spatie/laravel-package-tools": "^1.14.0", - "illuminate/contracts": "^9.0" + "illuminate/contracts": "^10.0" }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^6.0", + "nunomaduro/collision": "^6.1", "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^7.0", + "orchestra/testbench": "^8.0", "pestphp/pest": "^1.21", "pestphp/pest-plugin-laravel": "^1.1", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6", "spatie/laravel-ray": "^1.26" }, "autoload": { From dc1f117c9a658d316268f90da429b7bb6bf05273 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Fri, 24 Feb 2023 09:55:13 +0530 Subject: [PATCH 09/42] use Pest 2 by default --- composer.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 47b65968..6cf7fafe 100644 --- a/composer.json +++ b/composer.json @@ -22,15 +22,14 @@ }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^6.1", + "nunomaduro/collision": "^7.9", "nunomaduro/larastan": "^2.0.1", "orchestra/testbench": "^8.0", - "pestphp/pest": "^1.21", - "pestphp/pest-plugin-laravel": "^1.1", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.6", "spatie/laravel-ray": "^1.26" }, "autoload": { From 3bca2edadde7cda301aaa9ff87981a2d693b6a40 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 25 Feb 2023 15:14:07 +0100 Subject: [PATCH 10/42] Set permissions to contents: write Update permission of default GITHUB_TOKEN to contents: write. GitHub changed the default permission of the GITHUB_TOKEN to read-only at the beginning of February 2023 on all **new** repositories.[^1] [^1]: https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/ --- .github/workflows/fix-php-code-style-issues.yml | 3 +++ .github/workflows/update-changelog.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 39a77e7b..bdb26591 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -5,6 +5,9 @@ on: paths: - '**.php' +permissions: + contents: write + jobs: php-code-styling: runs-on: ubuntu-latest diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index b20f3b6f..8c12ba9e 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -4,6 +4,9 @@ on: release: types: [released] +permissions: + contents: write + jobs: update: runs-on: ubuntu-latest From c57cad51d59798fb98fd19c711ef993aa928233e Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Sun, 26 Feb 2023 00:48:01 +0530 Subject: [PATCH 11/42] add arch test --- composer.json | 2 ++ tests/ArchTest.php | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 tests/ArchTest.php diff --git a/composer.json b/composer.json index 6cf7fafe..a64e5f20 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,8 @@ "nunomaduro/larastan": "^2.0.1", "orchestra/testbench": "^8.0", "pestphp/pest": "^2.0", + "pestphp/pest-plugin-arch": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", diff --git a/tests/ArchTest.php b/tests/ArchTest.php new file mode 100644 index 00000000..7d12d93d --- /dev/null +++ b/tests/ArchTest.php @@ -0,0 +1,6 @@ +expect(['dd', 'dump', 'ray']) + ->each->not->toBeUsed(); + From d077f46284a45d4dac12cd16579f00d5712fc480 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Sun, 26 Feb 2023 00:49:12 +0530 Subject: [PATCH 12/42] wip --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index a64e5f20..affdc004 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,6 @@ "orchestra/testbench": "^8.0", "pestphp/pest": "^2.0", "pestphp/pest-plugin-arch": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", From 364d029433afe97ccede56d38f87137f2119cffd Mon Sep 17 00:00:00 2001 From: freekmurze Date: Sat, 25 Feb 2023 19:19:40 +0000 Subject: [PATCH 13/42] Fix styling --- tests/ArchTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/ArchTest.php b/tests/ArchTest.php index 7d12d93d..837924bb 100644 --- a/tests/ArchTest.php +++ b/tests/ArchTest.php @@ -3,4 +3,3 @@ test('globals') ->expect(['dd', 'dump', 'ray']) ->each->not->toBeUsed(); - From c42bf03a978199e45a438acb7498dce4defb1d62 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Sun, 26 Feb 2023 00:51:04 +0530 Subject: [PATCH 14/42] wip --- tests/ArchTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ArchTest.php b/tests/ArchTest.php index 7d12d93d..a965e967 100644 --- a/tests/ArchTest.php +++ b/tests/ArchTest.php @@ -1,6 +1,6 @@ expect(['dd', 'dump', 'ray']) ->each->not->toBeUsed(); From 9d4fbc5f25834bd6e1faffb85f90c28beba1e8dd Mon Sep 17 00:00:00 2001 From: Oliver Lumby Date: Wed, 1 Mar 2023 12:27:30 +0100 Subject: [PATCH 15/42] update phpunit.xml.dist for PHPUnit 10 --- phpunit.xml.dist | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3bbe22af..0ebf6618 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,14 +1,10 @@ From 5606a16d47212ba231f1439174e6d3b7b0dc2675 Mon Sep 17 00:00:00 2001 From: Patrick Hesselberg Date: Mon, 6 Mar 2023 14:21:16 +0100 Subject: [PATCH 16/42] Ignore PHPUnit 10 cache --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 83c9b9fc..a7f372d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .idea -.phpunit.result.cache +.phpunit.cache build composer.lock coverage From da9f33563e47c2d0a39a3ebdc882d93192052608 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 10:58:08 +0000 Subject: [PATCH 17/42] Bump aglipanci/laravel-pint-action from 2.1.0 to 2.2.0 Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases) - [Commits](https://github.com/aglipanci/laravel-pint-action/compare/2.1.0...2.2.0) --- updated-dependencies: - dependency-name: aglipanci/laravel-pint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/fix-php-code-style-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index bdb26591..097689b8 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -19,7 +19,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.1.0 + uses: aglipanci/laravel-pint-action@2.2.0 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 From 9f71e1964a6baefd4ac30bfa19b091fdf6b45366 Mon Sep 17 00:00:00 2001 From: bnzo <17174973+bnzo@users.noreply.github.com> Date: Mon, 20 Mar 2023 13:13:21 +0100 Subject: [PATCH 18/42] add slashes Useful when refactoring --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index affdc004..c1db049c 100644 --- a/composer.json +++ b/composer.json @@ -35,13 +35,13 @@ }, "autoload": { "psr-4": { - "VendorName\\Skeleton\\": "src", - "VendorName\\Skeleton\\Database\\Factories\\": "database/factories" + "VendorName\\Skeleton\\": "src/", + "VendorName\\Skeleton\\Database\\Factories\\": "database/factories/" } }, "autoload-dev": { "psr-4": { - "VendorName\\Skeleton\\Tests\\": "tests" + "VendorName\\Skeleton\\Tests\\": "tests/" } }, "scripts": { From 5082b6e9fde1f01d2cfaf251a74eb53460e433f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:57:46 +0000 Subject: [PATCH 19/42] Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.6 to 1.4.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.6...v1.4.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 32f77541..8fc65382 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.3.6 + uses: dependabot/fetch-metadata@v1.4.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 8a8aa24121b9ed328915bcfcea9e37b0f6903dcb Mon Sep 17 00:00:00 2001 From: Lloric Mayuga Garcia Date: Sat, 13 May 2023 11:49:42 +0800 Subject: [PATCH 20/42] Add --ci on test --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 57152e11..b5d67203 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -48,4 +48,4 @@ jobs: run: composer show -D - name: Execute tests - run: vendor/bin/pest + run: vendor/bin/pest --ci From ef6bade96cb01b6db96feaa674c6da67c4701423 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 10:57:53 +0000 Subject: [PATCH 21/42] Bump dependabot/fetch-metadata from 1.4.0 to 1.5.1 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.4.0 to 1.5.1. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.4.0...v1.5.1) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 8fc65382..4af8e6b6 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.4.0 + uses: dependabot/fetch-metadata@v1.5.1 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 62c48727b98b654d37ebbf46adf3225fc3ca0fed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:24:26 +0000 Subject: [PATCH 22/42] Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.1 to 1.6.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.5.1...v1.6.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 4af8e6b6..ca2197dc 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.5.1 + uses: dependabot/fetch-metadata@v1.6.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From c380b084212a5cd67a7840191b29b9f05956e70e Mon Sep 17 00:00:00 2001 From: Nick Retel Date: Sat, 8 Jul 2023 12:38:15 +0200 Subject: [PATCH 23/42] Update phpunit.xml.dist --- phpunit.xml.dist | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0ebf6618..e953c0e0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ - - ./src - @@ -33,4 +30,9 @@ + + + ./src + + From f5de2e97a74d52b8973d4fce2350037ad2123609 Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 7 Aug 2023 12:51:23 +0200 Subject: [PATCH 24/42] Fix nunomaduro/collision version Current required version 7.9 does not exist. Use latest availabele version 7.8 instead. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c1db049c..a0e5622b 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^7.9", + "nunomaduro/collision": "^7.8", "nunomaduro/larastan": "^2.0.1", "orchestra/testbench": "^8.0", "pestphp/pest": "^2.0", From 1c2a5720df48bee1a8affb427ef4cd0ef58030d4 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 15 Aug 2023 19:29:56 +0800 Subject: [PATCH 25/42] Support Workbench Signed-off-by: Mior Muhammad Zaki --- composer.json | 13 +++++++--- .../Providers/WorkbenchServiceProvider.php | 25 +++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 workbench/app/Providers/WorkbenchServiceProvider.php diff --git a/composer.json b/composer.json index a0e5622b..c49770ab 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "laravel/pint": "^1.0", "nunomaduro/collision": "^7.8", "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^8.0", + "orchestra/testbench": "^8.8", "pestphp/pest": "^2.0", "pestphp/pest-plugin-arch": "^2.0", "pestphp/pest-plugin-laravel": "^2.0", @@ -41,11 +41,18 @@ }, "autoload-dev": { "psr-4": { - "VendorName\\Skeleton\\Tests\\": "tests/" + "VendorName\\Skeleton\\Tests\\": "tests/", + "Workbench\\App\\": "workbench/app/" } }, "scripts": { - "post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi", + "post-autoload-dump": "@php vendor/bin/testbench package:discover --ansi", + "clear": "@php vendor/bin/testbench package:purge-skeleton --ansi", + "build": "@php vendor/bin/testbench workbench:build --ansi", + "start": [ + "@composer run build", + "@php vendor/bin/testbench serve", + ], "analyse": "vendor/bin/phpstan analyse", "test": "vendor/bin/pest", "test-coverage": "vendor/bin/pest --coverage", diff --git a/workbench/app/Providers/WorkbenchServiceProvider.php b/workbench/app/Providers/WorkbenchServiceProvider.php new file mode 100644 index 00000000..001d06d7 --- /dev/null +++ b/workbench/app/Providers/WorkbenchServiceProvider.php @@ -0,0 +1,25 @@ + Date: Tue, 15 Aug 2023 19:31:29 +0800 Subject: [PATCH 26/42] wip Signed-off-by: Mior Muhammad Zaki --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 9e9519b3..c09f81e5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ /art export-ignore /docs export-ignore /tests export-ignore +/workbench export-ignore /.editorconfig export-ignore /.php_cs.dist.php export-ignore /psalm.xml export-ignore From ecad99a764e8d126d98768f6143ccc73b7b94ee3 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 17 Aug 2023 06:27:21 +0800 Subject: [PATCH 27/42] wip --- composer.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c49770ab..868cfd28 100644 --- a/composer.json +++ b/composer.json @@ -46,9 +46,13 @@ } }, "scripts": { - "post-autoload-dump": "@php vendor/bin/testbench package:discover --ansi", + "post-autoload-dump": "@composer run prepare", "clear": "@php vendor/bin/testbench package:purge-skeleton --ansi", - "build": "@php vendor/bin/testbench workbench:build --ansi", + "prepare": "@php vendor/bin/testbench package:discover --ansi", + "build": [ + "@composer run prepare", + "@php vendor/bin/testbench workbench:build --ansi" + ], "start": [ "@composer run build", "@php vendor/bin/testbench serve", From 5f7d35204045e86f24a2802ff54a321e7f7dbe5a Mon Sep 17 00:00:00 2001 From: Sven Date: Mon, 21 Aug 2023 10:08:33 +0200 Subject: [PATCH 28/42] Fix composer.json syntax Fix composer.json syntax to fix composer install execution --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 868cfd28..2356fd37 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ ], "start": [ "@composer run build", - "@php vendor/bin/testbench serve", + "@php vendor/bin/testbench serve" ], "analyse": "vendor/bin/phpstan analyse", "test": "vendor/bin/pest", From 08edb4d70b927f7a3492a3ede10abfd42210e156 Mon Sep 17 00:00:00 2001 From: Markus Hartman Date: Sat, 26 Aug 2023 13:05:46 +0200 Subject: [PATCH 29/42] Removed trailing comma --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 868cfd28..2356fd37 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ ], "start": [ "@composer run build", - "@php vendor/bin/testbench serve", + "@php vendor/bin/testbench serve" ], "analyse": "vendor/bin/phpstan analyse", "test": "vendor/bin/pest", From a07199141ce910f4a8e8327f5f2bd4751ae287b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Popowicz?= Date: Thu, 31 Aug 2023 22:07:38 +0200 Subject: [PATCH 30/42] fix: prevent start script timeout --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 2356fd37..b2ab6253 100644 --- a/composer.json +++ b/composer.json @@ -54,6 +54,7 @@ "@php vendor/bin/testbench workbench:build --ansi" ], "start": [ + "Composer\\Config::disableProcessTimeout", "@composer run build", "@php vendor/bin/testbench serve" ], From d81b850d2c3447e1274c52235fba438459f46559 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:33:34 +0000 Subject: [PATCH 31/42] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/fix-php-code-style-issues.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 2 +- .github/workflows/update-changelog.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 097689b8..b9257ba6 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 9d41c0cf..ccfa9d9f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -11,7 +11,7 @@ jobs: name: phpstan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b5d67203..7fefe350 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 8c12ba9e..a817f81e 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main From d2e85118abd939510fc44f0e6a52957bf79b5266 Mon Sep 17 00:00:00 2001 From: enricodelazzari Date: Wed, 4 Oct 2023 12:54:52 +0200 Subject: [PATCH 32/42] UPDATE update pest version in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b2ab6253..c8ba78b6 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "nunomaduro/collision": "^7.8", "nunomaduro/larastan": "^2.0.1", "orchestra/testbench": "^8.8", - "pestphp/pest": "^2.0", + "pestphp/pest": "^2.20", "pestphp/pest-plugin-arch": "^2.0", "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", From d446dc6ae1505e8b01fb23733ce81e06e50c643e Mon Sep 17 00:00:00 2001 From: Gaurav Date: Wed, 1 Nov 2023 17:28:20 +0530 Subject: [PATCH 33/42] dependabot suggestions --- .github/workflows/fix-php-code-style-issues.yml | 4 ++-- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 2 +- .github/workflows/update-changelog.yml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 097689b8..230b10ff 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} @@ -22,6 +22,6 @@ jobs: uses: aglipanci/laravel-pint-action@2.2.0 - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Fix styling diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 9d41c0cf..ccfa9d9f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -11,7 +11,7 @@ jobs: name: phpstan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b5d67203..7fefe350 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 8c12ba9e..ec40921c 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main @@ -24,7 +24,7 @@ jobs: release-notes: ${{ github.event.release.body }} - name: Commit updated CHANGELOG - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: branch: main commit_message: Update CHANGELOG From 6515822ea0d8e670435cedf2baed6ced896e9914 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Wed, 1 Nov 2023 17:30:46 +0530 Subject: [PATCH 34/42] dependabot suggestion --- .github/workflows/fix-php-code-style-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 230b10ff..28816d34 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -19,7 +19,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.2.0 + uses: aglipanci/laravel-pint-action@2.3.0 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 From 5070e753fdf8e8e199841cab60d91c14b431aaa9 Mon Sep 17 00:00:00 2001 From: Patrick Organ Date: Sun, 19 Nov 2023 07:02:16 -0500 Subject: [PATCH 35/42] enhance github author/vendor username guessing --- configure.php | 113 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 106 insertions(+), 7 deletions(-) diff --git a/configure.php b/configure.php index d7e0fcc0..8ea199a2 100644 --- a/configure.php +++ b/configure.php @@ -141,19 +141,118 @@ function replaceForAllOtherOSes(): array return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|VendorName|skeleton|migration_table_name|vendor_name|vendor_slug|author@domain.com" --exclude-dir=vendor ./* ./.github/* | grep -v '.basename(__FILE__))); } +function getGithubApiEndpoint(string $endpoint): ?stdClass +{ + try { + $curl = curl_init("https://api.github.com/{$endpoint}"); + curl_setopt_array($curl, [ + CURLOPT_RETURNTRANSFER => true, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTPGET => true, + CURLOPT_HTTPHEADER => [ + 'User-Agent: spatie-configure-script/1.0' + ], + ]); + + $response = curl_exec($curl); + $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + + curl_close($curl); + + if ($statusCode === 200) { + return json_decode($response); + } + } catch (Exception $e) { + // ignore + } + + return null; +} + +function searchCommitsForGithubUsername(): string +{ + $authorName = strtolower(trim(shell_exec("git config user.name"))); + + $committersRaw = shell_exec("git log --author='@users.noreply.github.com' --pretty='%an:%ae' --reverse"); + $committersLines = explode("\n", $committersRaw); + $committers = array_filter(array_map(function($line) use ($authorName) { + $line = trim($line); + [$name, $email] = explode(':', $line) + [null, null]; + + return [ + 'name' => $name, + 'email' => $email, + 'isMatch' => strtolower($name) === $authorName && !str_contains($name, '[bot]') + ]; + }, $committersLines), fn($item) => $item['isMatch']); + + if (empty($committers)) { + return ''; + } + + $firstCommitter = reset($committers); + return explode('@', $firstCommitter['email'])[0] ?? ''; +} + +function guessGithubUsernameUsingCli() +{ + try { + if (preg_match('/ogged in to github\.com as ([a-zA-Z-_]+).+/', shell_exec('gh auth status -h github.com'), $matches) === 1) { + return $matches[1]; + } + } catch (Exception $e) { + // ignore + } + + return ''; +} + +function guessGithubUsername(): string +{ + $username = searchCommitsForGithubUsername(); + if (!empty($username)) { + return $username; + } + + $username = guessGithubUsernameUsingCli(); + if (!empty($username)) { + return $username; + } + + // fall back to using the username from the git remote + $remoteUrl = shell_exec("git config remote.origin.url"); + $remoteUrlParts = explode('/', str_replace(':', '/', trim($remoteUrl))); + + return $remoteUrlParts[1] ?? ''; +} + +function guessGithubVendorInfo($authorName, $username): array +{ + $remoteUrl = shell_exec("git config remote.origin.url"); + $remoteUrlParts = explode('/', str_replace(':', '/', trim($remoteUrl))); + + $response = getGithubApiEndpoint("orgs/{$remoteUrlParts[1]}"); + + if ($response === null) { + return $username; + } + + return [$response->name ?? $authorName, $response->login ?? $username]; +} + $gitName = run('git config user.name'); $authorName = ask('Author name', $gitName); $gitEmail = run('git config user.email'); $authorEmail = ask('Author email', $gitEmail); +$authorUsername = ask('Author username', guessGithubUsername()); + +$guessGithubVendorInfo = guessGithubVendorInfo($authorName, $authorUsername); -$usernameGuess = explode(':', run('git config remote.origin.url'))[1]; -$usernameGuess = dirname($usernameGuess); -$usernameGuess = basename($usernameGuess); -$authorUsername = ask('Author username', $usernameGuess); +$vendorName = ask('Vendor name', $guessGithubVendorInfo[0]); +$vendorUsername = ask('Vendor username', $guessGithubVendorInfo[1] ?? slugify($vendorName)); +$vendorSlug = slugify($vendorUsername); -$vendorName = ask('Vendor name', $authorUsername); -$vendorSlug = slugify($vendorName); $vendorNamespace = str_replace('-', '', ucwords($vendorName)); $vendorNamespace = ask('Vendor namespace', $vendorNamespace); @@ -183,7 +282,7 @@ function replaceForAllOtherOSes(): array writeln("Class name : {$className}"); writeln('---'); writeln('Packages & Utilities'); -writeln('Use Laravel/Pint : '.($useLaravelPint ? 'yes' : 'no')); +writeln('Use Laravel/Pint : '.($useLaravelPint ? 'yes' : 'no')); writeln('Use Larastan/PhpStan : '.($usePhpStan ? 'yes' : 'no')); writeln('Use Dependabot : '.($useDependabot ? 'yes' : 'no')); writeln('Use Ray App : '.($useLaravelRay ? 'yes' : 'no')); From c7fbd14fe735d6a9d70e9d20f86d65cc62ea10f6 Mon Sep 17 00:00:00 2001 From: patinthehat Date: Sun, 19 Nov 2023 12:03:37 +0000 Subject: [PATCH 36/42] Fix styling --- configure.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/configure.php b/configure.php index 8ea199a2..76ca8010 100644 --- a/configure.php +++ b/configure.php @@ -150,7 +150,7 @@ function getGithubApiEndpoint(string $endpoint): ?stdClass CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTPGET => true, CURLOPT_HTTPHEADER => [ - 'User-Agent: spatie-configure-script/1.0' + 'User-Agent: spatie-configure-script/1.0', ], ]); @@ -171,26 +171,27 @@ function getGithubApiEndpoint(string $endpoint): ?stdClass function searchCommitsForGithubUsername(): string { - $authorName = strtolower(trim(shell_exec("git config user.name"))); + $authorName = strtolower(trim(shell_exec('git config user.name'))); $committersRaw = shell_exec("git log --author='@users.noreply.github.com' --pretty='%an:%ae' --reverse"); $committersLines = explode("\n", $committersRaw); - $committers = array_filter(array_map(function($line) use ($authorName) { + $committers = array_filter(array_map(function ($line) use ($authorName) { $line = trim($line); [$name, $email] = explode(':', $line) + [null, null]; return [ 'name' => $name, 'email' => $email, - 'isMatch' => strtolower($name) === $authorName && !str_contains($name, '[bot]') + 'isMatch' => strtolower($name) === $authorName && ! str_contains($name, '[bot]'), ]; - }, $committersLines), fn($item) => $item['isMatch']); + }, $committersLines), fn ($item) => $item['isMatch']); if (empty($committers)) { return ''; } $firstCommitter = reset($committers); + return explode('@', $firstCommitter['email'])[0] ?? ''; } @@ -210,17 +211,17 @@ function guessGithubUsernameUsingCli() function guessGithubUsername(): string { $username = searchCommitsForGithubUsername(); - if (!empty($username)) { + if (! empty($username)) { return $username; } $username = guessGithubUsernameUsingCli(); - if (!empty($username)) { + if (! empty($username)) { return $username; } // fall back to using the username from the git remote - $remoteUrl = shell_exec("git config remote.origin.url"); + $remoteUrl = shell_exec('git config remote.origin.url'); $remoteUrlParts = explode('/', str_replace(':', '/', trim($remoteUrl))); return $remoteUrlParts[1] ?? ''; @@ -228,7 +229,7 @@ function guessGithubUsername(): string function guessGithubVendorInfo($authorName, $username): array { - $remoteUrl = shell_exec("git config remote.origin.url"); + $remoteUrl = shell_exec('git config remote.origin.url'); $remoteUrlParts = explode('/', str_replace(':', '/', trim($remoteUrl))); $response = getGithubApiEndpoint("orgs/{$remoteUrlParts[1]}"); From 6750164364010f0c7d196ba2ee8fc53ab61faecc Mon Sep 17 00:00:00 2001 From: Patrick Organ Date: Sun, 19 Nov 2023 07:14:24 -0500 Subject: [PATCH 37/42] hide stderr output when attempting gh cli exec --- configure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.php b/configure.php index 76ca8010..199f0907 100644 --- a/configure.php +++ b/configure.php @@ -198,7 +198,7 @@ function searchCommitsForGithubUsername(): string function guessGithubUsernameUsingCli() { try { - if (preg_match('/ogged in to github\.com as ([a-zA-Z-_]+).+/', shell_exec('gh auth status -h github.com'), $matches) === 1) { + if (preg_match('/ogged in to github\.com as ([a-zA-Z-_]+).+/', shell_exec('gh auth status -h github.com 2>&1'), $matches)) { return $matches[1]; } } catch (Exception $e) { From f4a5797d5a8b1e138cd6fb41de6ec17338e959e7 Mon Sep 17 00:00:00 2001 From: Patrick Organ Date: Mon, 20 Nov 2023 06:47:06 -0500 Subject: [PATCH 38/42] fix casing for"GitHub " --- configure.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/configure.php b/configure.php index 199f0907..ac721868 100644 --- a/configure.php +++ b/configure.php @@ -141,7 +141,7 @@ function replaceForAllOtherOSes(): array return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|VendorName|skeleton|migration_table_name|vendor_name|vendor_slug|author@domain.com" --exclude-dir=vendor ./* ./.github/* | grep -v '.basename(__FILE__))); } -function getGithubApiEndpoint(string $endpoint): ?stdClass +function getGitHubApiEndpoint(string $endpoint): ?stdClass { try { $curl = curl_init("https://api.github.com/{$endpoint}"); @@ -169,7 +169,7 @@ function getGithubApiEndpoint(string $endpoint): ?stdClass return null; } -function searchCommitsForGithubUsername(): string +function searchCommitsForGitHubUsername(): string { $authorName = strtolower(trim(shell_exec('git config user.name'))); @@ -195,7 +195,7 @@ function searchCommitsForGithubUsername(): string return explode('@', $firstCommitter['email'])[0] ?? ''; } -function guessGithubUsernameUsingCli() +function guessGitHubUsernameUsingCli() { try { if (preg_match('/ogged in to github\.com as ([a-zA-Z-_]+).+/', shell_exec('gh auth status -h github.com 2>&1'), $matches)) { @@ -208,14 +208,14 @@ function guessGithubUsernameUsingCli() return ''; } -function guessGithubUsername(): string +function guessGitHubUsername(): string { - $username = searchCommitsForGithubUsername(); + $username = searchCommitsForGitHubUsername(); if (! empty($username)) { return $username; } - $username = guessGithubUsernameUsingCli(); + $username = guessGitHubUsernameUsingCli(); if (! empty($username)) { return $username; } @@ -227,12 +227,12 @@ function guessGithubUsername(): string return $remoteUrlParts[1] ?? ''; } -function guessGithubVendorInfo($authorName, $username): array +function guessGitHubVendorInfo($authorName, $username): array { $remoteUrl = shell_exec('git config remote.origin.url'); $remoteUrlParts = explode('/', str_replace(':', '/', trim($remoteUrl))); - $response = getGithubApiEndpoint("orgs/{$remoteUrlParts[1]}"); + $response = getGitHubApiEndpoint("orgs/{$remoteUrlParts[1]}"); if ($response === null) { return $username; @@ -246,12 +246,12 @@ function guessGithubVendorInfo($authorName, $username): array $gitEmail = run('git config user.email'); $authorEmail = ask('Author email', $gitEmail); -$authorUsername = ask('Author username', guessGithubUsername()); +$authorUsername = ask('Author username', guessGitHubUsername()); -$guessGithubVendorInfo = guessGithubVendorInfo($authorName, $authorUsername); +$guessGitHubVendorInfo = guessGitHubVendorInfo($authorName, $authorUsername); -$vendorName = ask('Vendor name', $guessGithubVendorInfo[0]); -$vendorUsername = ask('Vendor username', $guessGithubVendorInfo[1] ?? slugify($vendorName)); +$vendorName = ask('Vendor name', $guessGitHubVendorInfo[0]); +$vendorUsername = ask('Vendor username', $guessGitHubVendorInfo[1] ?? slugify($vendorName)); $vendorSlug = slugify($vendorUsername); $vendorNamespace = str_replace('-', '', ucwords($vendorName)); From 01d86f4633f87c54c295dfa93342368c9c5e04a6 Mon Sep 17 00:00:00 2001 From: Patrick Organ Date: Mon, 20 Nov 2023 08:43:40 -0500 Subject: [PATCH 39/42] minor bug fix --- configure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.php b/configure.php index ac721868..810cfa88 100644 --- a/configure.php +++ b/configure.php @@ -235,7 +235,7 @@ function guessGitHubVendorInfo($authorName, $username): array $response = getGitHubApiEndpoint("orgs/{$remoteUrlParts[1]}"); if ($response === null) { - return $username; + return [$authorName, $username]; } return [$response->name ?? $authorName, $response->login ?? $username]; From 5f16d9caa96ad842a5351847e1fa896196834f6c Mon Sep 17 00:00:00 2001 From: Pyae Sone Aung <44226349+PyaeSoneAungRgn@users.noreply.github.com> Date: Sat, 9 Dec 2023 03:04:12 +0630 Subject: [PATCH 40/42] update nunomaduro/larastan to larastan/larastan --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c8ba78b6..c0aa6da9 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require-dev": { "laravel/pint": "^1.0", "nunomaduro/collision": "^7.8", - "nunomaduro/larastan": "^2.0.1", + "larastan/larastan": "^2.0.1", "orchestra/testbench": "^8.8", "pestphp/pest": "^2.20", "pestphp/pest-plugin-arch": "^2.0", From f41188a7bec178ecdde0a5a59f40d6bf396ad7ff Mon Sep 17 00:00:00 2001 From: Bastien Philippe Date: Thu, 14 Dec 2023 13:33:15 +0100 Subject: [PATCH 41/42] Update cs config --- .php-cs-fixer.dist.php | 87 ++++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 24 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 267354d6..c0819240 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,4 +1,4 @@ -in([ 'config', @@ -18,6 +18,9 @@ 'syntax' => 'short', ], 'assign_null_coalescing_to_coalesce_equal' => true, + 'attribute_empty_parentheses' => [ + 'use_parentheses' => false, + ], 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', @@ -35,12 +38,15 @@ ], ], 'blank_line_between_import_groups' => false, - 'braces' => [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => true, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', + 'blank_lines_before_namespace' => true, + 'braces_position' => [ + 'allow_single_line_anonymous_functions' => true, + 'allow_single_line_empty_anonymous_classes' => true, + 'anonymous_classes_opening_brace' => 'same_line', + 'anonymous_functions_opening_brace' => 'same_line', + 'classes_opening_brace' => 'next_line_unless_newline_at_signature_end', + 'control_structures_opening_brace' => 'same_line', + 'functions_opening_brace' => 'next_line_unless_newline_at_signature_end', ], 'cast_spaces' => [ 'space' => 'single', @@ -76,11 +82,6 @@ 'control_structure_continuation_position' => [ 'position' => 'same_line', ], - 'curly_braces_position' => [ - 'allow_single_line_anonymous_functions' => true, - 'allow_single_line_empty_anonymous_classes' => true, - 'anonymous_classes_opening_brace' => 'same_line', - ], 'date_time_create_from_format_call' => true, 'date_time_immutable' => true, 'declare_equal_normalize' => [ @@ -104,8 +105,11 @@ 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, 'fopen_flag_order' => true, - 'fully_qualified_strict_types' => true, + 'fully_qualified_strict_types' => [ + 'leading_backslash_in_global_namespace' => true, + ], 'function_declaration' => [ + 'closure_fn_spacing' => 'one', 'closure_function_spacing' => 'one', 'trailing_comma_single_line' => false, ], @@ -119,13 +123,13 @@ 5 => 'pi', ], ], - 'function_typehint_space' => true, 'general_phpdoc_annotation_remove' => [ 'annotations' => [ 0 => 'author', 1 => 'class', 2 => 'namespace', ], + 'case_sensitive' => true, ], 'get_class_to_class_keyword' => true, 'global_namespace_import' => [ @@ -146,11 +150,13 @@ 'syntax' => 'short', ], 'logical_operators' => true, + 'long_to_shorthand_operator' => true, 'magic_constant_casing' => true, 'magic_method_casing' => true, 'mb_str_functions' => true, 'method_argument_space' => [ 'after_heredoc' => true, + 'attribute_placement' => 'standalone', 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline', ], @@ -169,8 +175,8 @@ 'scope' => 'namespaced', 'strict' => true, ], - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => [ + 'native_type_declaration_casing' => true, + 'new_with_parentheses' => [ 'anonymous_class' => true, 'named_class' => true, ], @@ -221,11 +227,19 @@ 'no_superfluous_phpdoc_tags' => [ 'allow_mixed' => true, 'allow_unused_params' => false, - 'remove_inheritdoc' => true, + 'remove_inheritdoc' => false, + ], + 'no_trailing_comma_in_singleline' => [ + 'elements' => [ + 0 => 'arguments', + 1 => 'array', + 2 => 'array_destructuring', + 3 => 'group_import', + ], + ], + 'no_unneeded_braces' => [ + 'namespaces' => false, ], - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_comma_in_singleline_function_call' => true, 'no_unneeded_control_parentheses' => [ 'statements' => [ 0 => 'break', @@ -240,7 +254,6 @@ 9 => 'yield_from', ], ], - 'no_unneeded_curly_braces' => true, 'no_unneeded_final_method' => [ 'private_methods' => true, ], @@ -248,6 +261,7 @@ 'no_unreachable_default_argument_value' => true, 'no_unset_cast' => true, 'no_unused_imports' => true, + 'no_useless_concat_operator' => true, 'no_useless_else' => true, 'no_useless_nullsafe_operator' => true, 'no_useless_return' => true, @@ -259,6 +273,9 @@ 'use_escape_sequences_in_strings' => true, ], 'normalize_index_brace' => true, + 'nullable_type_declaration' => [ + 'syntax' => 'question_mark', + ], 'nullable_type_declaration_for_default_null_value' => [ 'use_nullable_type_declaration' => true, ], @@ -269,6 +286,7 @@ 'position' => 'beginning', ], 'ordered_class_elements' => [ + 'case_sensitive' => false, 'order' => [ 0 => 'use_trait', 1 => 'constant', @@ -280,6 +298,7 @@ 'sort_algorithm' => 'none', ], 'ordered_imports' => [ + 'case_sensitive' => false, 'imports_order' => [ 0 => 'class', 1 => 'function', @@ -288,11 +307,21 @@ 'sort_algorithm' => 'alpha', ], 'ordered_interfaces' => [ + 'case_sensitive' => false, 'direction' => 'ascend', 'order' => 'alpha', ], - 'ordered_traits' => true, + 'ordered_traits' => [ + 'case_sensitive' => false, + ], + 'ordered_types' => [ + 'case_sensitive' => false, + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'none', + ], 'php_unit_construct' => true, + 'php_unit_data_provider_return_type' => true, + 'php_unit_data_provider_static' => true, 'php_unit_dedicate_assert' => true, 'php_unit_dedicate_assert_internal_type' => true, 'php_unit_expectation' => true, @@ -351,6 +380,7 @@ 'phpdoc_no_access' => true, 'phpdoc_no_alias_tag' => [ 'replacements' => [ + 'inheritDoc' => 'inheritdoc', 'type' => 'var', 'link' => 'see', ], @@ -363,7 +393,8 @@ 0 => 'param', 1 => 'return', 2 => 'throws', - 3 => 'phpcsSuppress', + 3 => 'inheritdoc', + 4 => 'phpcsSuppress', ], ], 'phpdoc_order_by_value' => [ @@ -372,6 +403,8 @@ 1 => 'throws', ], ], + 'phpdoc_param_order' => true, + 'phpdoc_return_self_reference' => true, 'phpdoc_scalar' => true, 'phpdoc_single_line_var_spacing' => true, 'phpdoc_summary' => true, @@ -385,6 +418,7 @@ ], ], 'phpdoc_types_order' => [ + 'case_sensitive' => false, 'null_adjustment' => 'always_last', 'sort_algorithm' => 'alpha', ], @@ -419,13 +453,17 @@ 0 => 'hash', ], ], + 'single_line_empty_body' => true, 'single_quote' => [ 'strings_containing_single_quote_chars' => false, ], - 'single_space_after_construct' => true, + 'single_space_around_construct' => true, 'space_after_semicolon' => [ 'remove_in_empty_for_expressions' => true, ], + 'spaces_inside_parentheses' => [ + 'space' => 'none', + ], 'standardize_not_equals' => true, 'statement_indentation' => true, 'strict_param' => true, @@ -442,6 +480,7 @@ ], ], 'trim_array_spaces' => true, + 'type_declaration_spaces' => true, 'types_spaces' => [ 'space' => 'none', 'space_multiple_catch' => 'none', From 6b13c35a6bffd8da815858a94c30f1854fa750d0 Mon Sep 17 00:00:00 2001 From: bastien-phi Date: Thu, 14 Dec 2023 12:33:46 +0000 Subject: [PATCH 42/42] Fix styling --- src/Skeleton.php | 4 +--- tests/ArchTest.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Skeleton.php b/src/Skeleton.php index eb72cf30..3bf00f9f 100755 --- a/src/Skeleton.php +++ b/src/Skeleton.php @@ -2,6 +2,4 @@ namespace VendorName\Skeleton; -class Skeleton -{ -} +class Skeleton {} diff --git a/tests/ArchTest.php b/tests/ArchTest.php index ccc19b27..faa6c86c 100644 --- a/tests/ArchTest.php +++ b/tests/ArchTest.php @@ -1,4 +1,4 @@ -expect(['dd', 'dump', 'ray'])