Skip to content

[1.x] Set up PHPStan on GitHub Actions #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ci: set up PHPStan
  • Loading branch information
nhedger committed Sep 17, 2022
commit d7330a75f5c076d7c581ae2112045a261cd76b1a
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,23 @@ jobs:
- run: composer self-update --2.2 # downgrade Composer for HHVM
- run: hhvm $(which composer) install
- run: hhvm vendor/bin/phpunit

PHPStan:
name: PHPStan
runs-on: ubuntu-20.04
strategy:
matrix:
php: [ 8.1 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: phpstan
- name: Install Composer dependencies
run: composer install
- name: Run static analysis
run: phpstan analyse
216 changes: 216 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
parameters:
ignoreErrors:
-
message: "#^Method React\\\\Cache\\\\ArrayCache\\:\\:getMultiple\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/ArrayCache.php

-
message: "#^Method React\\\\Cache\\\\ArrayCache\\:\\:setMultiple\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#"
count: 1
path: src/ArrayCache.php

-
message: "#^Property React\\\\Cache\\\\ArrayCache\\:\\:\\$data has no type specified\\.$#"
count: 1
path: src/ArrayCache.php

-
message: "#^Property React\\\\Cache\\\\ArrayCache\\:\\:\\$expires has no type specified\\.$#"
count: 1
path: src/ArrayCache.php

-
message: "#^Property React\\\\Cache\\\\ArrayCache\\:\\:\\$limit has no type specified\\.$#"
count: 1
path: src/ArrayCache.php

-
message: "#^Property React\\\\Cache\\\\ArrayCache\\:\\:\\$supportsHighResolution has no type specified\\.$#"
count: 1
path: src/ArrayCache.php

-
message: "#^Method React\\\\Cache\\\\CacheInterface\\:\\:getMultiple\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/CacheInterface.php

-
message: "#^Method React\\\\Cache\\\\CacheInterface\\:\\:setMultiple\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#"
count: 1
path: src/CacheInterface.php

-
message: "#^PHPDoc tag @return contains generic type React\\\\Promise\\\\PromiseInterface\\<array\\> but interface React\\\\Promise\\\\PromiseInterface is not generic\\.$#"
count: 1
path: src/CacheInterface.php

-
message: "#^PHPDoc tag @return contains generic type React\\\\Promise\\\\PromiseInterface\\<bool\\> but interface React\\\\Promise\\\\PromiseInterface is not generic\\.$#"
count: 6
path: src/CacheInterface.php

-
message: "#^PHPDoc tag @return contains generic type React\\\\Promise\\\\PromiseInterface\\<mixed\\> but interface React\\\\Promise\\\\PromiseInterface is not generic\\.$#"
count: 1
path: src/CacheInterface.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:deleteShouldDeleteKey\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:getShouldResolvePromiseWithNullForNonExistentKey\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:hasShouldResolvePromiseForExistingKey\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:hasShouldResolvePromiseForNonExistentKey\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:setShouldSetKey\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:setUpArrayCache\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testClearShouldClearCache\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testDeleteMultiple\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testGetMultiple\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testGetWillResolveWithDefaultIfItemIsExpired\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testGetWillResolveWithDefaultValueForCacheMiss\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testGetWillResolveWithExplicitNullValueForCacheHit\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testGetWillResolveWithNullForCacheMiss\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testGetWillResolveWithValueIfItemIsNotExpired\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testGetWithLimitedSizeWillUpdateLRUInfo\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testHasWillResolveForExplicitNullValue\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testHasWillResolveIfItemIsExpired\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testHasWillResolveIfItemIsNotExpired\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testHasWithLimitedSizeWillUpdateLRUInfo\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testLimitSizeToOneWillOnlyReturnLastWrite\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testLimitSizeToZeroDoesNotStoreAnyData\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testOverwriteWithLimitedSizeWillUpdateLRUInfo\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testSetMultiple\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testSetWillOverwritOldestItemIfNoEntryIsExpired\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\ArrayCacheTest\\:\\:testSetWillOverwriteExpiredItemIfAnyEntryIsExpired\\(\\) has no return type specified\\.$#"
count: 1
path: tests/ArrayCacheTest.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\TestCase\\:\\:createCallableMock\\(\\) has no return type specified\\.$#"
count: 1
path: tests/TestCase.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\TestCase\\:\\:expectCallableExactly\\(\\) has no return type specified\\.$#"
count: 1
path: tests/TestCase.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\TestCase\\:\\:expectCallableExactly\\(\\) has parameter \\$amount with no type specified\\.$#"
count: 1
path: tests/TestCase.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\TestCase\\:\\:expectCallableNever\\(\\) has no return type specified\\.$#"
count: 1
path: tests/TestCase.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\TestCase\\:\\:expectCallableOnce\\(\\) has no return type specified\\.$#"
count: 1
path: tests/TestCase.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\TestCase\\:\\:expectCallableOnceWith\\(\\) has no return type specified\\.$#"
count: 1
path: tests/TestCase.php

-
message: "#^Method React\\\\Tests\\\\Cache\\\\TestCase\\:\\:expectCallableOnceWith\\(\\) has parameter \\$param with no type specified\\.$#"
count: 1
path: tests/TestCase.php
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- phpstan-baseline.neon

parameters:
level: 9
paths:
- src
- tests
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy