Skip to content

Commit

Permalink
Pass PHPStan level 8 without breaking BC
Browse files Browse the repository at this point in the history
  • Loading branch information
charjr committed Aug 12, 2024
1 parent e655c8d commit 7162f45
Show file tree
Hide file tree
Showing 56 changed files with 2,599 additions and 3,339 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Continuous Integration"

on:
pull_request:
push:
branches:
tags:

jobs:
ci:
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]
43 changes: 0 additions & 43 deletions .github/workflows/php.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"additional_checks": [
{
"name": "PHPStan",
"job": {
"php": "*",
"dependencies": "*",
"command": "vendor/bin/phpstan analyse"
}
}
],
"stablePHP": "8.0"
}
19 changes: 7 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,17 @@
}
},
"require": {
"php": "^7.1 || ^8.0",
"php": "^8.2",
"ext-json": "*",
"psr/http-message": "^1.0 || ^2.0 ",
"psr/http-message": "^2.0 ",
"psr/http-client": "^1.0",
"guzzlehttp/guzzle": "^6.3|^7.0.1"
"guzzlehttp/guzzle": "^7.0.1"
},
"require-dev": {
"phpunit/phpunit": "^7.5|^8.0|^9.0",
"codacy/coverage": "^1.4",
"aws/aws-sdk-php": "^3.186"
},
"conflict": {
"guzzlehttp/psr7": "< 1.7.0"
},
"scripts": {
"test": "phpunit tests/ --whitelist src/ --coverage-clover build/coverage/xml"
"aws/aws-sdk-php": "^3.186",
"phpstan/phpstan": "^1.11.4",
"squizlabs/php_codesniffer": "3.10.1",
"phpunit/phpunit": "^10.5.20"
},
"suggest": {
"aws/aws-sdk-php": "Move this package to require section to use AWS IAM authorization",
Expand Down
2 changes: 1 addition & 1 deletion examples/mutation_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@

// Reformat the results to an array and get the results of part of the array
$results->reformatResults(true);
print_r($results->getData()['pokemon']);
print_r($results->getData()['pokemon']);
11 changes: 11 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<ruleset name="PSR">
<description>PHPCS configuration file.</description>
<file>src</file>

<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="PSR1"/>
<rule ref="PSR12"/>
</ruleset>
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 8
paths:
- src
treatPhpDocTypesAsCertain: false
14 changes: 14 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="true" beStrictAboutCoverageMetadata="true">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
9 changes: 3 additions & 6 deletions src/Auth/AuthInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace GraphQL\Auth;

use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;

interface AuthInterface
{
/**
* @param Request $request
* @param array $options
* @return Request
*/
public function run(Request $request, array $options = []): Request;
/** @param array<mixed> $options */
public function run(Request $request, array $options = []): RequestInterface;
}
62 changes: 0 additions & 62 deletions src/Auth/AwsIamAuth.php

This file was deleted.

Loading

0 comments on commit 7162f45

Please sign in to comment.