Skip to content

Commit

Permalink
Merge pull request #11 from worksome/feature/laravel-11
Browse files Browse the repository at this point in the history
feat: add support for Laravel 11
  • Loading branch information
owenvoke authored Feb 13, 2024
2 parents b7cdc1b + 2b4d8c6 commit 13b0577
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
25 changes: 9 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
{
"name": "worksome/pest-graphql-coverage",
"description": "A plugin for PestPHP to add GraphQL coverage via LighthousePHP",
"description": "A plugin for Pest to add GraphQL coverage via Lighthouse",
"keywords": [
"worksome",
"laravel",
"pest-graphql-coverage"
],
"homepage": "https://github.com/worksome/pest-graphql-coverage",
"license": "MIT",
"authors": [
{
"name": "Oliver Nybroe",
"email": "oliver@worksome.com",
"role": "Developer"
}
],
"require": {
"php": "^8.2",
"illuminate/contracts": "^10.0",
"nuwave/lighthouse": "^6.0.0",
"pestphp/pest": "^2.2.3",
"pestphp/pest-plugin-laravel": "^2.0"
"illuminate/contracts": "^10.0 || ^11.0",
"nuwave/lighthouse": "^6.33",
"pestphp/pest": "^2.33",
"pestphp/pest-plugin-laravel": "^2.2"
},
"require-dev": {
"nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^2.4",
"orchestra/testbench": "^8.0",
"worksome/coding-style": "^2.5"
"nunomaduro/collision": "^7.10 || ^8.1",
"larastan/larastan": "^2.6",
"orchestra/testbench": "^8.21 || ^9.0",
"worksome/coding-style": "^2.8"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 6 additions & 6 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function isEnabled(): bool

public function handleArguments(array $arguments): array
{
if (!($coverageIndex = array_search('--gql-coverage', $arguments)) && !self::isEnabled()) {
if (! ($coverageIndex = array_search('--gql-coverage', $arguments)) && ! self::isEnabled()) {
return $arguments;
}

Expand Down Expand Up @@ -81,7 +81,7 @@ private function handleMinCoverage(array &$arguments): void
unset($arguments[array_keys($min)[0]]);

preg_match($coverageMinRegex, array_pop($min), $matches);
$this->coverageMin = (int)$matches[1];
$this->coverageMin = (int) $matches[1];
}

private function handleSchemaCommand(array &$arguments): void
Expand Down Expand Up @@ -115,13 +115,13 @@ private function handleMaxUntestedFields(array &$arguments): void

preg_match($maxUntestedFieldsRegex, array_pop($command), $matches);

$this->maxUntestedFieldsCount = is_numeric($matches[1]) ? (int)$matches[1] : $this->maxUntestedFieldsCount;
$this->maxUntestedFieldsCount = is_numeric($matches[1]) ? (int) $matches[1] : $this->maxUntestedFieldsCount;
}

public function addOutput(int $testReturnCode): int
public function addOutput(int $exitCode): int
{
if (self::isEnabled() === false) {
return $testReturnCode;
return $exitCode;
}

$style = new SymfonyStyle(new ArrayInput([]), $this->output);
Expand Down Expand Up @@ -159,7 +159,7 @@ public function addOutput(int $testReturnCode): int
return 1;
}

return $testReturnCode;
return $exitCode;
}

private function collectAllNodesFromSchema(): array
Expand Down

0 comments on commit 13b0577

Please sign in to comment.