Skip to content

Commit 090838c

Browse files
committed
:octocat: dependency update
1 parent 8abb497 commit 090838c

6 files changed

Lines changed: 92 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,36 @@ jobs:
3737
- "8.1"
3838
- "8.2"
3939
- "8.3"
40+
- "8.4"
41+
- "8.5"
4042

4143
steps:
4244
- name: "Checkout"
43-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
4446

4547
- name: "Install PHP"
4648
uses: shivammathur/setup-php@v2
4749
with:
4850
php-version: ${{ matrix.php-version }}
49-
extensions: ${{ env.PHP_EXTENSIONS }}
51+
extensions: ast, ${{ env.PHP_EXTENSIONS }}
5052
ini-values: ${{ env.PHP_INI_VALUES }}
5153
coverage: none
5254

55+
- name: "Validate composer.json"
56+
run: composer validate --no-interaction --ansi --verbose --with-dependencies
57+
5358
- name: "Install dependencies with composer"
5459
uses: ramsey/composer-install@v3
5560

56-
- name: "Run PHPStan"
57-
run: php vendor/bin/phpstan
58-
59-
- name: "Run PHP_CodeSniffer"
61+
- name: "Run PHPCodeSniffer"
6062
run: php vendor/bin/phpcs
6163

64+
- name: "Run phan"
65+
run: php vendor/bin/phan --target-php-version=${{ matrix.php-version }}
66+
67+
# - name: "Run PHPStan"
68+
# run: php vendor/bin/phpstan
69+
6270

6371
tests:
6472
name: "Unit Tests"
@@ -76,10 +84,11 @@ jobs:
7684
- "8.2"
7785
- "8.3"
7886
- "8.4"
87+
- "8.5"
7988

8089
steps:
8190
- name: "Checkout"
82-
uses: actions/checkout@v4
91+
uses: actions/checkout@v6
8392

8493
- name: "Install PHP with extensions"
8594
uses: shivammathur/setup-php@v2

.phan/config.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
* This configuration will be read and overlaid on top of the
4+
* default configuration. Command-line arguments will be applied
5+
* after this file is read.
6+
*
7+
* @see https://github.com/phan/phan/wiki/Getting-Started#creating-a-config-file
8+
*/
9+
return [
10+
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`,
11+
// `'7.4'`, `null`.
12+
// If this is set to `null`,
13+
// then Phan assumes the PHP version which is closest to the minor version
14+
// of the php executable used to execute Phan.
15+
//
16+
// Note that the **only** effect of choosing `'5.6'` is to infer
17+
// that functions removed in php 7.0 exist.
18+
// (See `backward_compatibility_checks` for additional options)
19+
'target_php_version' => null,
20+
'minimum_target_php_version' => '8.1',
21+
22+
// A list of directories that should be parsed for class and
23+
// method information. After excluding the directories
24+
// defined in exclude_analysis_directory_list, the remaining
25+
// files will be statically analyzed for errors.
26+
//
27+
// Thus, both first-party and third-party code being used by
28+
// your application should be included in this list.
29+
'directory_list' => [
30+
# '.phan/stubs',
31+
# 'examples',
32+
'src',
33+
'tests',
34+
'vendor',
35+
],
36+
37+
// A regex used to match every file name that you want to
38+
// exclude from parsing. Actual value will exclude every
39+
// "test", "tests", "Test" and "Tests" folders found in
40+
// "vendor/" directory.
41+
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
42+
43+
// A directory list that defines files that will be excluded
44+
// from static analysis, but whose class and method
45+
// information should be included.
46+
//
47+
// Generally, you'll want to include the directories for
48+
// third-party code (such as "vendor/") in this list.
49+
//
50+
// n.b.: If you'd like to parse but not analyze 3rd
51+
// party code, directories containing that code
52+
// should be added to both the `directory_list`
53+
// and `exclude_analysis_directory_list` arrays.
54+
'exclude_analysis_directory_list' => [
55+
'vendor/',
56+
'.phan/stubs',
57+
],
58+
'suppress_issue_types' => [
59+
'PhanAccessMethodInternal',
60+
],
61+
];

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727
},
2828
"require-dev": {
2929
"chillerlan/php-httpinterface": "^6.0",
30-
"guzzlehttp/guzzle": "^7.9",
31-
"phpstan/phpstan": "^1.11",
32-
"phpstan/phpstan-deprecation-rules": "^1.2",
30+
"guzzlehttp/guzzle": "^7.10",
31+
"phan/phan": "^6.0.2",
32+
"phpstan/phpstan": "^2.1.42",
33+
"phpstan/phpstan-deprecation-rules": "^2.0.4",
3334
"phpunit/phpunit": "^10.5",
34-
"slevomat/coding-standard": "^8.15",
35-
"squizlabs/php_codesniffer": "^3.10"
35+
"slevomat/coding-standard": "^8.28",
36+
"squizlabs/php_codesniffer": "^4.0"
3637
},
3738
"suggest": {
3839
},
@@ -47,7 +48,9 @@
4748
}
4849
},
4950
"scripts": {
51+
"phan": "@php vendor/bin/phan",
5052
"phpcs": "@php vendor/bin/phpcs",
53+
"phpmd": "@php vendor/bin/phpmd src text ./phpmd.xml.dist",
5154
"phpstan": "@php vendor/bin/phpstan",
5255
"phpstan-baseline": "@php vendor/bin/phpstan --generate-baseline",
5356
"phpunit": "@php vendor/bin/phpunit"

phpcs.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@
108108

109109
<rule ref="SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable">
110110
<exclude-pattern>examples</exclude-pattern>
111-
<exclude-pattern>src/Storage/SessionStorage.php</exclude-pattern>
112-
<exclude-pattern>tests/Storage/SessionStorageTest.php</exclude-pattern>
113111
</rule>
114112

115113
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat">
@@ -218,7 +216,6 @@
218216

219217
<rule ref="PSR1.Files.SideEffects">
220218
<exclude-pattern>examples</exclude-pattern>
221-
<exclude-pattern>benchmark</exclude-pattern>
222219
</rule>
223220

224221

phpstan-baseline.neon

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Access to protected property chillerlan\\\\HTTP\\\\HTTPOptions\\:\\:\\$ca_info\\.$#"
4+
rawMessage: Access to protected property chillerlan\HTTP\HTTPOptions::$ca_info.
5+
identifier: property.protected
56
count: 1
67
path: src/ChillerlanHttpClientFactory.php
78

89
-
9-
message: "#^Access to protected property chillerlan\\\\HTTP\\\\HTTPOptions\\:\\:\\$user_agent\\.$#"
10+
rawMessage: Access to protected property chillerlan\HTTP\HTTPOptions::$user_agent.
11+
identifier: property.protected
1012
count: 1
1113
path: src/ChillerlanHttpClientFactory.php

tests/PHPUnitHttpFactoryTestAbstract.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function testInvalidClassException():void{
7979
public function testVonstantNotDefinedException():void{
8080
$this->expectException(InvalidArgumentException::class);
8181
$this->expectExceptionMessage('constant "REQUEST_FACTORY" not defined');
82-
82+
/** @phan-suppress-next-line PhanTypeObjectUnsetDeclaredProperty */
8383
unset($this->REQUEST_FACTORY);
8484

8585
$this->initFactories('');
@@ -93,10 +93,11 @@ public function testNoCacertException():void{
9393
}
9494

9595
public function testInvokeWithoutHttpClient():void{
96+
/** @phan-suppress-next-line PhanTypeObjectUnsetDeclaredProperty, PhanUndeclaredProperty */
9697
unset($this->httpClientFactory, $this->httpClient, $this->HTTP_CLIENT_FACTORY);
9798

9899
$this->initFactories();
99-
100+
/** @phan-suppress-next-line PhanPossiblyUnsetPropertyOfThis */
100101
$this::assertFalse(isset($this->httpClientFactory, $this->httpClient));
101102
}
102103

0 commit comments

Comments
 (0)