Skip to content

Commit a92c509

Browse files
committed
Update psalm 5 , setup release workflow
1 parent 132b398 commit a92c509

File tree

7 files changed

+81
-46
lines changed

7 files changed

+81
-46
lines changed

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/.github/ export-ignore
2+
/benchmark/ export-ignore
3+
/docs/ export-ignore
4+
/tests/ export-ignore
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.laminas-ci.json export-ignore
8+
/phpbench.json
9+
/phpcs.xml export-ignore
10+
/phpunit.xml.dist export-ignore
11+
/psalm.xml
12+
/psalm-baseline.xml
13+
/mkdocs.yml export-ignore
14+
15+
/examples/ export-ignore
16+
/vendor-bin/ export-ignore
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Automatic Releases"
2+
3+
on:
4+
milestone:
5+
types:
6+
- "closed"
7+
8+
jobs:
9+
release:
10+
uses: laminas/workflow-automatic-releases/.github/workflows/[email protected]
11+
secrets:
12+
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
13+
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
14+
ORGANIZATION_ADMIN_TOKEN: ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
15+
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}

composer.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
}
1212
],
1313
"require": {
14-
"php" : ">=7.2.0",
15-
"vimeo/psalm": "^4"
14+
"php": "^7.4.0 || ^8.0 || ^8.1 || ^8.2",
15+
"vimeo/psalm": "^5"
1616
},
1717
"require-dev": {
1818
"psr/log": "^1.1",
19-
"squizlabs/php_codesniffer": "^3.3",
20-
"weirdan/codeception-psalm-module": "^0.13.1"
19+
"squizlabs/php_codesniffer": "^3.7",
20+
"weirdan/codeception-psalm-module": "^0.14.0"
2121
},
2222
"extra": {
2323
"psalm" : {
@@ -37,6 +37,16 @@
3737
]
3838
}
3939
},
40+
"config": {
41+
"sort-packages": true,
42+
"allow-plugins": {
43+
"dealerdirect/phpcodesniffer-composer-installer": true,
44+
"bamarni/composer-bin-plugin": true
45+
},
46+
"platform": {
47+
"php": "7.4.99"
48+
}
49+
},
4050
"scripts" : {
4151
"check": [
4252
"@cs-check",
File renamed without changes.
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?xml version="1.0"?>
22
<psalm
3-
totallyTyped="true"
3+
errorLevel="1"
4+
findUnusedPsalmSuppress="true"
5+
findUnusedBaselineEntry="true"
6+
findUnusedCode="true"
47
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
58
xmlns="https://getpsalm.org/schema/config"
69
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
@@ -13,20 +16,11 @@
1316
</projectFiles>
1417

1518
<issueHandlers>
16-
1719
<LessSpecificReturnType errorLevel="info" />
18-
1920
<PropertyNotSetInConstructor>
2021
<errorLevel type="suppress">
2122
<directory name="tests" />
2223
</errorLevel>
2324
</PropertyNotSetInConstructor>
24-
25-
<TypeCoercion>
26-
<errorLevel type="suppress">
27-
<directory name="tests" />
28-
</errorLevel>
29-
</TypeCoercion>
30-
3125
</issueHandlers>
3226
</psalm>

tests/acceptance/ExceptionAcceptance.feature

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ Feature: Exception
5757
When I run Psalm
5858
Then I see these errors
5959
| Type | Message |
60-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::emergency expects array{exception?: Exception}, but array{exception: "foo"} provided |
61-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::alert expects array{exception?: Exception}, but array{exception: "foo"} provided |
62-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::critical expects array{exception?: Exception}, but array{exception: "foo"} provided |
63-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::error expects array{exception?: Exception}, but array{exception: "foo"} provided |
64-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::warning expects array{exception?: Exception}, but array{exception: "foo"} provided |
65-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::notice expects array{exception?: Exception}, but array{exception: "foo"} provided |
66-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::info expects array{exception?: Exception}, but array{exception: "foo"} provided |
67-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::debug expects array{exception?: Exception}, but array{exception: "foo"} provided |
60+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::emergency expects array{exception?: Exception}, but array{exception: 'foo'} provided |
61+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::alert expects array{exception?: Exception}, but array{exception: 'foo'} provided |
62+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::critical expects array{exception?: Exception}, but array{exception: 'foo'} provided |
63+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::error expects array{exception?: Exception}, but array{exception: 'foo'} provided |
64+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::warning expects array{exception?: Exception}, but array{exception: 'foo'} provided |
65+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::notice expects array{exception?: Exception}, but array{exception: 'foo'} provided |
66+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::info expects array{exception?: Exception}, but array{exception: 'foo'} provided |
67+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::debug expects array{exception?: Exception}, but array{exception: 'foo'} provided |
6868
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::emergency expects array{exception?: Exception}, but array{exception: Error} provided |
6969
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::alert expects array{exception?: Exception}, but array{exception: Error} provided |
7070
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::critical expects array{exception?: Exception}, but array{exception: Error} provided |
@@ -98,14 +98,14 @@ Feature: Exception
9898
When I run Psalm
9999
Then I see these errors
100100
| Type | Message |
101-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::emergency expects array{exception?: Exception}, but array{exception: "foo"} provided |
102-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::alert expects array{exception?: Exception}, but array{exception: "foo"} provided |
103-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::critical expects array{exception?: Exception}, but array{exception: "foo"} provided |
104-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::error expects array{exception?: Exception}, but array{exception: "foo"} provided |
105-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::warning expects array{exception?: Exception}, but array{exception: "foo"} provided |
106-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::notice expects array{exception?: Exception}, but array{exception: "foo"} provided |
107-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::info expects array{exception?: Exception}, but array{exception: "foo"} provided |
108-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::debug expects array{exception?: Exception}, but array{exception: "foo"} provided |
101+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::emergency expects array{exception?: Exception}, but array{exception: 'foo'} provided |
102+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::alert expects array{exception?: Exception}, but array{exception: 'foo'} provided |
103+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::critical expects array{exception?: Exception}, but array{exception: 'foo'} provided |
104+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::error expects array{exception?: Exception}, but array{exception: 'foo'} provided |
105+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::warning expects array{exception?: Exception}, but array{exception: 'foo'} provided |
106+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::notice expects array{exception?: Exception}, but array{exception: 'foo'} provided |
107+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::info expects array{exception?: Exception}, but array{exception: 'foo'} provided |
108+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::debug expects array{exception?: Exception}, but array{exception: 'foo'} provided |
109109
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::emergency expects array{exception?: Exception}, but array{exception: Error} provided |
110110
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::alert expects array{exception?: Exception}, but array{exception: Error} provided |
111111
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::critical expects array{exception?: Exception}, but array{exception: Error} provided |

tests/acceptance/ThrowableAcceptance.feature

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ Feature: Throwable
5959
When I run Psalm
6060
Then I see these errors
6161
| Type | Message |
62-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::emergency expects array{exception?: Throwable}, but array{exception: "foo"} provided |
63-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::alert expects array{exception?: Throwable}, but array{exception: "foo"} provided |
64-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::critical expects array{exception?: Throwable}, but array{exception: "foo"} provided |
65-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::error expects array{exception?: Throwable}, but array{exception: "foo"} provided |
66-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::warning expects array{exception?: Throwable}, but array{exception: "foo"} provided |
67-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::notice expects array{exception?: Throwable}, but array{exception: "foo"} provided |
68-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::info expects array{exception?: Throwable}, but array{exception: "foo"} provided |
69-
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::debug expects array{exception?: Throwable}, but array{exception: "foo"} provided |
62+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::emergency expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
63+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::alert expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
64+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::critical expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
65+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::error expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
66+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::warning expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
67+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::notice expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
68+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::info expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
69+
| InvalidArgument | Argument 2 of Psr\Log\LoggerInterface::debug expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
7070
And I see no other errors
7171

7272
Scenario: `exception` key is actually an Throwable Object AS per AbstractLogger
@@ -92,12 +92,12 @@ Feature: Throwable
9292
When I run Psalm
9393
Then I see these errors
9494
| Type | Message |
95-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::emergency expects array{exception?: Throwable}, but array{exception: "foo"} provided |
96-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::alert expects array{exception?: Throwable}, but array{exception: "foo"} provided |
97-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::critical expects array{exception?: Throwable}, but array{exception: "foo"} provided |
98-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::error expects array{exception?: Throwable}, but array{exception: "foo"} provided |
99-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::warning expects array{exception?: Throwable}, but array{exception: "foo"} provided |
100-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::notice expects array{exception?: Throwable}, but array{exception: "foo"} provided |
101-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::info expects array{exception?: Throwable}, but array{exception: "foo"} provided |
102-
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::debug expects array{exception?: Throwable}, but array{exception: "foo"} provided |
95+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::emergency expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
96+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::alert expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
97+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::critical expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
98+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::error expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
99+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::warning expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
100+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::notice expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
101+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::info expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
102+
| InvalidArgument | Argument 2 of Psr\Log\AbstractLogger::debug expects array{exception?: Throwable}, but array{exception: 'foo'} provided |
103103
And I see no other errors

0 commit comments

Comments
 (0)