From 64e3db798c5b7b4c0fc0a81d69be04213d332a42 Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 12:03:26 +0700 Subject: [PATCH 1/9] Refactor --- src/Console/Commands/HelperMakeCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Console/Commands/HelperMakeCommand.php b/src/Console/Commands/HelperMakeCommand.php index 5dbfd69..ad3208c 100644 --- a/src/Console/Commands/HelperMakeCommand.php +++ b/src/Console/Commands/HelperMakeCommand.php @@ -32,9 +32,9 @@ class HelperMakeCommand extends GeneratorCommand * * @return string */ - protected function getStub() + protected function getStub(): string { - return __DIR__.'/stubs/helper.stub'; + return base_path('stubs/helper.stub'); } /** @@ -43,8 +43,8 @@ protected function getStub() * @param string $rootNamespace * @return string */ - protected function getDefaultNamespace($rootNamespace) + protected function getDefaultNamespace($rootNamespace): string { - return $rootNamespace.'\\'.config('helpers.directory', 'Helpers'); + return $rootNamespace . '\\' . config('helpers.directory', 'Helpers'); } } From b4a229adde7646399b1a740d18480220091de017 Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 13:04:43 +0700 Subject: [PATCH 2/9] Update HelperMakeCommand.php --- src/Console/Commands/HelperMakeCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Console/Commands/HelperMakeCommand.php b/src/Console/Commands/HelperMakeCommand.php index ad3208c..5dbfd69 100644 --- a/src/Console/Commands/HelperMakeCommand.php +++ b/src/Console/Commands/HelperMakeCommand.php @@ -32,9 +32,9 @@ class HelperMakeCommand extends GeneratorCommand * * @return string */ - protected function getStub(): string + protected function getStub() { - return base_path('stubs/helper.stub'); + return __DIR__.'/stubs/helper.stub'; } /** @@ -43,8 +43,8 @@ protected function getStub(): string * @param string $rootNamespace * @return string */ - protected function getDefaultNamespace($rootNamespace): string + protected function getDefaultNamespace($rootNamespace) { - return $rootNamespace . '\\' . config('helpers.directory', 'Helpers'); + return $rootNamespace.'\\'.config('helpers.directory', 'Helpers'); } } From ad40f9df66846bb2910812c612e6cf99d67d5b37 Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 13:04:50 +0700 Subject: [PATCH 3/9] Add pint --- composer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 165c6a2..0f45636 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,10 @@ "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.0", + "laravel/pint": "^1.18", "orchestra/testbench": "^4.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0", - "phpunit/phpunit": "^8.4 || ^9.0 || ^10.0", - "friendsofphp/php-cs-fixer": "^3.0" + "phpunit/phpunit": "^8.4 || ^9.0 || ^10.0" }, "autoload": { "psr-4": { From 7cb075c805ca1ec9254b445ad05e7d17610cb346 Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 15:43:10 +0700 Subject: [PATCH 4/9] Fix test --- .github/workflows/tests.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 694a44a..c1be2f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,8 +4,8 @@ on: push: branches: - "**" - pull_request: - branches: [main] + pull_request: + branches: [main] jobs: run-tests: @@ -13,10 +13,12 @@ jobs: strategy: matrix: - php: [7.2, 7.3, 7.4, '8.0', 8.1, 8.2] - laravel: [6.*, 7.*, 8.*, 9.*, 10.*] + php: [7.3, 7.4, '8.0', 8.1, 8.2] + laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*] os: [ubuntu-latest] include: + - laravel: 11.* + testbench: 9.* - laravel: 10.* testbench: 8.* - laravel: 9.* @@ -65,6 +67,12 @@ jobs: php: 7.4 - laravel: 10.* php: '8.0' + - laravel: 11.* + php: 7.3 + - laravel: 11.* + php: 7.4 + - laravel: 11.* + php: '8.0' name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} From 60d125f84a3fe5f2533a0a9a1eff896332355734 Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 15:50:25 +0700 Subject: [PATCH 5/9] Update tests.yml --- .github/workflows/tests.yml | 61 ++----------------------------------- 1 file changed, 2 insertions(+), 59 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c1be2f2..5f0b19c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,66 +13,9 @@ jobs: strategy: matrix: - php: [7.3, 7.4, '8.0', 8.1, 8.2] - laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*] + php: [8.0, 8.1, 8.2, 8.3] + laravel: [9.*, 10.*, 11.*] os: [ubuntu-latest] - include: - - laravel: 11.* - testbench: 9.* - - laravel: 10.* - testbench: 8.* - - laravel: 9.* - testbench: 7.* - - laravel: 8.* - testbench: 6.* - - laravel: 7.* - testbench: 5.* - - laravel: 6.* - testbench: 4.* - - exclude: - - laravel: 6.* - php: 7.1 - - laravel: 6.* - php: 8.1 - - laravel: 6.* - php: 8.2 - - laravel: 7.* - php: 7.1 - - laravel: 7.* - php: 8.1 - - laravel: 7.* - php: 8.2 - - laravel: 8.* - php: 7.1 - - laravel: 8.* - php: 7.2 - - laravel: 8.* - php: 8.2 - - laravel: 9.* - php: 7.1 - - laravel: 9.* - php: 7.2 - - laravel: 9.* - php: 7.3 - - laravel: 9.* - php: 7.4 - - laravel: 10.* - php: 7.1 - - laravel: 10.* - php: 7.2 - - laravel: 10.* - php: 7.3 - - laravel: 10.* - php: 7.4 - - laravel: 10.* - php: '8.0' - - laravel: 11.* - php: 7.3 - - laravel: 11.* - php: 7.4 - - laravel: 11.* - php: '8.0' name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} From f95011d19496f9adadfa7a6297ae302e0671789a Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 15:51:56 +0700 Subject: [PATCH 6/9] Update tests.yml --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f0b19c..c4520bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,6 +16,13 @@ jobs: php: [8.0, 8.1, 8.2, 8.3] laravel: [9.*, 10.*, 11.*] os: [ubuntu-latest] + include: + - laravel: 11.* + testbench: 9.* + - laravel: 10.* + testbench: 8.* + - laravel: 9.* + testbench: 7.* name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} From 1e0797ae4a30c180e726fe354adf543f433b9e6b Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 15:59:18 +0700 Subject: [PATCH 7/9] Update tests.yml --- .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 c4520bf..861a634 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - php: [8.0, 8.1, 8.2, 8.3] + php: [8.1, 8.2, 8.3] laravel: [9.*, 10.*, 11.*] os: [ubuntu-latest] include: From 81796988ab42364f486e39a615ddd1307dbbdd93 Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 16:03:03 +0700 Subject: [PATCH 8/9] Update tests.yml --- .github/workflows/tests.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 861a634..d46ed02 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,20 +9,23 @@ on: jobs: run-tests: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - php: [8.1, 8.2, 8.3] - laravel: [9.*, 10.*, 11.*] os: [ubuntu-latest] + php: [8.1, 8.2, 8.3] include: - - laravel: 11.* - testbench: 9.* - - laravel: 10.* - testbench: 8.* - - laravel: 9.* + - php: 8.1 + laravel: 9.* testbench: 7.* + - php: 8.2 + laravel: 10.* + testbench: 8.* + - php: 8.3 + laravel: 11.* + testbench: 9.* name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} From 8566a54576f09292a86f797e791d75995ee9532e Mon Sep 17 00:00:00 2001 From: Wahyu Kristianto Date: Tue, 22 Oct 2024 16:05:00 +0700 Subject: [PATCH 9/9] Update tests.yml --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d46ed02..2968318 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,13 +31,13 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extension: mbstring + extensions: mbstring coverage: none - name: Install dependencies