From 2df303347ea4ea7628b0d6cf2c098dd7ce84a99d Mon Sep 17 00:00:00 2001 From: Harings Rob Date: Wed, 4 Jan 2023 09:55:25 +0100 Subject: [PATCH 1/5] BC checker. --- .github/workflows/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8576de89c..1a90476e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,23 @@ on: pull_request: jobs: + roave-backwards-compatibility-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: "Install PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + - name: "Install dependencies" + run: "composer install" + - name: "Install checker" + run: "composer require roave/backward-compatibility-check --dev" + - name: "Check for BC breaks" + run: "vendor/bin/roave-backward-compatibility-check --format=github-actions --from=2.12.3" + test: runs-on: ${{ matrix.os }} strategy: From 513413921270535b3720e73c0c4199e1315cdec6 Mon Sep 17 00:00:00 2001 From: Harings Rob Date: Wed, 4 Jan 2023 09:59:55 +0100 Subject: [PATCH 2/5] Add dependency. --- .github/workflows/main.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a90476e2..91f09f407 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,16 +13,18 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: "Install PHP" + - name: Install PHP uses: shivammathur/setup-php@v2 with: php-version: "8.1" - - name: "Install dependencies" - run: "composer install" - - name: "Install checker" - run: "composer require roave/backward-compatibility-check --dev" - - name: "Check for BC breaks" - run: "vendor/bin/roave-backward-compatibility-check --format=github-actions --from=2.12.3" + - name: Install dependencies + run: composer install + - name: Install checker + run: composer require roave/backward-compatibility-check --dev + - name: Require dep + run: composer require kalnoy/nestedset + - name: Check for BC breaks + run: vendor/bin/roave-backward-compatibility-check --format=github-actions --from=2.12.3 test: runs-on: ${{ matrix.os }} From 1509a743aaf0216b7cec50528422d0cfd630dbd6 Mon Sep 17 00:00:00 2001 From: Harings Rob Date: Wed, 4 Jan 2023 10:12:02 +0100 Subject: [PATCH 3/5] Add dev deps. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91f09f407..735fececf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: - name: Require dep run: composer require kalnoy/nestedset - name: Check for BC breaks - run: vendor/bin/roave-backward-compatibility-check --format=github-actions --from=2.12.3 + run: vendor/bin/roave-backward-compatibility-check --format=github-actions --from=2.12.3 --install-development-dependencies test: runs-on: ${{ matrix.os }} From 96ae7df47050023c4b48331dec33b80b73b5da79 Mon Sep 17 00:00:00 2001 From: Harings Rob Date: Wed, 4 Jan 2023 10:16:38 +0100 Subject: [PATCH 4/5] Test bc should break. --- src/Repositories/ModuleRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Repositories/ModuleRepository.php b/src/Repositories/ModuleRepository.php index be2c9c139..08ec66b0c 100644 --- a/src/Repositories/ModuleRepository.php +++ b/src/Repositories/ModuleRepository.php @@ -166,7 +166,7 @@ public function getById($id, $with = [], $withCount = []) * @param string $pluckby * @return \Illuminate\Support\Collection */ - public function listAll($column = 'title', $orders = [], $exceptId = null, $pluckby = 'id') + public function listAll($column = 'title', $orders = [], $exceptId = null, $pluckby = 'id', $barfoo = 'break') { $query = $this->model->newQuery(); From 7d8228f13d7bb36266f9d61e085713bad0baf247 Mon Sep 17 00:00:00 2001 From: Harings Rob Date: Wed, 4 Jan 2023 10:22:50 +0100 Subject: [PATCH 5/5] Remove pluckby. --- src/Repositories/ModuleRepository.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Repositories/ModuleRepository.php b/src/Repositories/ModuleRepository.php index 08ec66b0c..cb6986e0d 100644 --- a/src/Repositories/ModuleRepository.php +++ b/src/Repositories/ModuleRepository.php @@ -163,10 +163,9 @@ public function getById($id, $with = [], $withCount = []) * @param string $column * @param array $orders * @param null $exceptId - * @param string $pluckby * @return \Illuminate\Support\Collection */ - public function listAll($column = 'title', $orders = [], $exceptId = null, $pluckby = 'id', $barfoo = 'break') + public function listAll($column = 'title', $orders = [], $exceptId = null) { $query = $this->model->newQuery(); @@ -184,7 +183,7 @@ public function listAll($column = 'title', $orders = [], $exceptId = null, $pluc $query = $query->withTranslation(); } - return $query->get()->pluck($column, $pluckby); + return $query->get()->pluck($column, 'id'); } /**