From 00d0429869b20b53f22086d41abefee063c5785e Mon Sep 17 00:00:00 2001 From: sadeesh-sdet Date: Tue, 3 Oct 2023 20:04:22 +0530 Subject: [PATCH] Address reviewer feedback: disable code coverage and update issetField() --- .github/workflows/tests.yml | 16 +++++++++------- src/Test/DefaultTest.php | 12 ++---------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 795910f..4c3a818 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,10 +41,12 @@ jobs: - name: Analyse PHP Code (PHPStan) run: composer phpstan - - name: Validate code quality - run: composer phpunit-with-coverage - - - name: Send code coverage report to Codecov.io - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + # As codecov throwing lot of errors, disabling the respective check temporarily + # Reference discussion: https://github.com/axelerant/mdtt/pull/24#pullrequestreview-1632092133 + # - name: Validate code quality + # run: composer phpunit-with-coverage + + # - name: Send code coverage report to Codecov.io + # uses: codecov/codecov-action@v2 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/src/Test/DefaultTest.php b/src/Test/DefaultTest.php index b8a5596..b3687c6 100644 --- a/src/Test/DefaultTest.php +++ b/src/Test/DefaultTest.php @@ -58,7 +58,7 @@ public function execute(array $sourceData, array $destinationData): bool * a specified offset (string key) within them. It performs recursive checks on * nested arrays to ensure that the offset exists at each level. * - * @param array>|numeric-string $data + * @param array> $data * The data array to check for the offset in. * @param array $fields * An array of string keys representing the path to the desired offset. @@ -66,17 +66,9 @@ public function execute(array $sourceData, array $destinationData): bool * @return bool * Returns `true` if the specified offset exists in the nested array, * `false` otherwise. - * - * Used a combination of type hinting and explicit checks to assist PHPStan - * in understanding the types involved and resolving static analysis errors. */ - private function issetField(mixed $data, array $fields): bool + private function issetField(array $data, array $fields): bool { - // Check if $data is an array - if (!is_array($data)) { - return false; - } - // Get the next key to check $key = array_shift($fields);