From b0722ca2ec8fa190e7d14c28d102276a24f58db0 Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Sat, 1 Mar 2025 14:05:17 +0800 Subject: [PATCH 1/4] ci: workflows --- .github/workflows/continuous-integration.yml | 22 ++++++++----- .github/workflows/pint.yml | 9 ++++-- .github/workflows/static-analysis.yml | 34 +++++--------------- 3 files changed, 29 insertions(+), 36 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a521b25..800bcb4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,36 +1,42 @@ -name: "Continuous Integration" +name: Continuous Integration on: push: branches: - master - - 11.x + - '*.x' pull_request: schedule: - cron: '0 0 * * *' jobs: - phpunit: - + tests: runs-on: ubuntu-latest + services: + oracle: + image: deepdiver/docker-oracle-xe-11g:2.0 + ports: + - 49160:22 + - 1521:1521 + strategy: fail-fast: true matrix: php: [8.2, 8.3, 8.4] stability: [prefer-stable] - name: PHP ${{ matrix.php }} - ${{ matrix.stability }} + name: PHP ${{ matrix.php }} - STABILITY ${{ matrix.stability }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, memcached + extensions: oci8 tools: composer:v2 coverage: none @@ -42,7 +48,7 @@ jobs: with: timeout_minutes: 5 max_attempts: 5 - command: COMPOSER_ROOT_VERSION=dev-master composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress + command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress - name: Execute tests run: vendor/bin/phpunit diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index bac3eab..c07577f 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -1,11 +1,16 @@ name: PHP Linting + on: pull_request: push: branches: - master + - '*.x' + jobs: - phplint: + pint: + name: Pint + runs-on: ubuntu-latest permissions: @@ -25,4 +30,4 @@ jobs: - uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: "fix: pint" + commit_message: "fix: pint :robot:" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 5e53d63..4dccad0 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,24 +1,12 @@ -name: "Static Analysis" +name: Static Analysis on: push: branches: - master - - 11.x - paths: - - .github/workflows/static-analysis.yml - - composer.* - - phpstan.neon.dist - - src/** - - tests/** + - '*.x' pull_request: - paths: - - .github/workflows/static-analysis.yml - - composer.* - - phpstan.neon.dist - - src/** - - tests/** schedule: - cron: '0 0 * * *' @@ -26,15 +14,9 @@ on: jobs: static-analysis-phpstan: - name: "Static Analysis with PHPStan" + name: Source Code runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: [8.2, 8.3, 8.4] - stability: [prefer-stable] - steps: - name: Checkout code uses: actions/checkout@v4 @@ -42,16 +24,16 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: 8.2 tools: composer:v2 coverage: none - name: Install dependencies - uses: nick-invision/retry@v1 + uses: nick-fields/retry@v3 with: timeout_minutes: 5 max_attempts: 5 - command: COMPOSER_ROOT_VERSION=dev-master composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - name: "Run a static analysis with phpstan/phpstan" - run: "vendor/bin/phpstan --error-format=table" + - name: Run Static Analysis + run: vendor/bin/phpstan From 3dd16ee4c86a10ecac05fd6a41fe5e1e59a3bd2e Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Sat, 1 Mar 2025 14:15:05 +0800 Subject: [PATCH 2/4] ci: rm service --- .github/workflows/continuous-integration.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 800bcb4..fe75aa3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -13,13 +13,6 @@ jobs: tests: runs-on: ubuntu-latest - services: - oracle: - image: deepdiver/docker-oracle-xe-11g:2.0 - ports: - - 49160:22 - - 1521:1521 - strategy: fail-fast: true matrix: From 9f85d7a75bb2b131b3df7c025f71ef8b887ebe2b Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Tue, 18 Mar 2025 14:37:33 +0800 Subject: [PATCH 3/4] fix: stubs with generics --- src/Generators/stubs/builder.stub | 4 +++- src/Generators/stubs/datatables.stub | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Generators/stubs/builder.stub b/src/Generators/stubs/builder.stub index 2ed2af7..511be79 100644 --- a/src/Generators/stubs/builder.stub +++ b/src/Generators/stubs/builder.stub @@ -13,7 +13,7 @@ class DummyClass extends DataTable /** * Build the DataTable class. * - * @param QueryBuilder $query Results from query() method. + * @param QueryBuilder $query Results from query() method. */ public function dataTable(QueryBuilder $query): EloquentDataTable { @@ -24,6 +24,8 @@ class DummyClass extends DataTable /** * Get the query source of dataTable. + * + * @return QueryBuilder */ public function query(ModelName $model): QueryBuilder { diff --git a/src/Generators/stubs/datatables.stub b/src/Generators/stubs/datatables.stub index bccfede..1a574c1 100644 --- a/src/Generators/stubs/datatables.stub +++ b/src/Generators/stubs/datatables.stub @@ -17,7 +17,7 @@ class DummyClass extends DataTable /** * Build the DataTable class. * - * @param QueryBuilder $query Results from query() method. + * @param QueryBuilder $query Results from query() method. */ public function dataTable(QueryBuilder $query): EloquentDataTable { @@ -28,6 +28,8 @@ class DummyClass extends DataTable /** * Get the query source of dataTable. + * + * @return QueryBuilder */ public function query(ModelName $model): QueryBuilder { From 8f388e3c6890442d9d85368b2a84a414e281b4ae Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Tue, 18 Mar 2025 21:39:50 +0800 Subject: [PATCH 4/4] chore: release v12.1.2 :rocket: --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99be259..f1b3da5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Laravel DataTables Buttons Plugin CHANGELOG. +## v12.1.2 - 2025-03-18 + +- fix: stubs with generics #196 + ## v12.1.1 - 2025-02-26 - fix: stubs #195