Skip to content

Commit

Permalink
Address reviewer feedback: disable code coverage and update issetField()
Browse files Browse the repository at this point in the history
  • Loading branch information
sadeesh-sdet committed Oct 3, 2023
1 parent 078521b commit 00d0429
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
# 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 }}
12 changes: 2 additions & 10 deletions src/Test/DefaultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,17 @@ 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<string, numeric-string|array<string, numeric-string>>|numeric-string $data
* @param array<string,numeric-string|array<string,numeric-string>> $data
* The data array to check for the offset in.
* @param array<string> $fields
* An array of string keys representing the path to the desired offset.
*
* @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);

Expand Down

0 comments on commit 00d0429

Please sign in to comment.