Skip to content

Commit d969485

Browse files
authored
Merge pull request #51 from fp4php/psalm-v5
Psalm v5
2 parents 88630c5 + b0f74d2 commit d969485

File tree

170 files changed

+960
-7066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+960
-7066
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,15 @@ PHP Functional Programming library. Monads and common use functions.
1616

1717
### Composer
1818

19+
Supported installation method is via [composer](https://getcomposer.org):
20+
1921
```console
2022
$ composer require fp4php/functional
2123
```
2224

23-
### Enable psalm plugin (optional)
24-
25-
Read more about [plugin](doc/Psalm.md).
25+
### Psalm integration
2626

27-
```console
28-
$ composer require --dev fp4php/psalm-toolkit
29-
$ vendor/bin/psalm-plugin enable fp4php/psalm-toolkit
30-
$ vendor/bin/psalm-plugin enable fp4php/functional
31-
```
27+
Please refer to the [fp4php/functional-psalm-plugin](https://github.com/fp4php/functional-psalm-plugin) repository.
3228

3329
## Overview
3430
Typesafe and concise.

UPGRADING-v6.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Update psalm to v5
2+
3+
Since fp4php/functional v6 Psalm integration ships as separate package.
4+
Including the Psalm integration in the main fp4php/functional repository was a mistake.
5+
6+
For migration:
7+
8+
1. Remove old toolkit:
9+
10+
```shell
11+
composer remove fp4php/psalm-toolkit
12+
```
13+
14+
2. Install new psalm plugin:
15+
16+
```shell
17+
composer require --dev fp4php/functional-psalm-plugin
18+
```
19+
20+
3. Update psalm.xml:
21+
22+
```diff
23+
<?xml version="1.0"?>
24+
<psalm ...>
25+
...
26+
<plugins>
27+
- <pluginClass class="Fp\Psalm\FunctionalPlugin"/>
28+
- <pluginClass class="Fp\PsalmToolkit\Toolkit\Plugin"/>
29+
+ <pluginClass class="Fp\PsalmPlugin\FunctionalPlugin"/>
30+
</plugins>
31+
</psalm>
32+
```

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,26 @@
2222
"ext-simplexml": "*"
2323
},
2424
"require-dev": {
25-
"vimeo/psalm": "^4.23",
25+
"vimeo/psalm": "^5.7",
2626
"phpunit/phpunit": "^9",
2727
"symfony/process": "^5.2",
2828
"rregeer/phpunit-coverage-check": "^0.3.1",
2929
"php-coveralls/php-coveralls": "~2.4.0",
30-
"fp4php/psalm-toolkit": "dev-main"
30+
"fp4php/psalm-toolkit": "dev-psalm-v5",
31+
"fp4php/functional-psalm-plugin": "^1.0"
3132
},
3233
"autoload": {
3334
"psr-4": {
3435
"Fp\\Operations\\": "src/Fp/Operations",
3536
"Fp\\Collections\\": "src/Fp/Collections",
3637
"Fp\\Streams\\": "src/Fp/Streams",
37-
"Fp\\Functional\\": "src/Fp/Functional",
38-
"Fp\\Psalm\\": "src/Fp/Psalm"
38+
"Fp\\Functional\\": "src/Fp/Functional"
3939
},
4040
"files": [
4141
"src/Fp/Functions/Callable/Ctor.php",
4242
"src/Fp/Functions/Callable/ToSafeClosure.php",
4343
"src/Fp/Functions/Callable/DropFirstArg.php",
44+
"src/Fp/Functions/Callable/Pipe.php",
4445
"src/Fp/Functions/Callable/Compose.php",
4546
"src/Fp/Functions/Callable/Partial.php",
4647
"src/Fp/Functions/Callable/PartialLeft.php",
@@ -98,6 +99,7 @@
9899
"src/Fp/Functions/Evidence/ProveObject.php",
99100
"src/Fp/Functions/Evidence/ProveOf.php",
100101
"src/Fp/Functions/Evidence/ProveString.php",
102+
"src/Fp/Functions/Util/ToString.php",
101103
"src/Fp/Functions/Util/JsonDecode.php",
102104
"src/Fp/Functions/Util/RegExp.php",
103105
"src/Fp/Functions/Util/Writeln.php",

psalm.xml

Lines changed: 10 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,27 @@
11
<?xml version="1.0"?>
2-
<psalm
3-
errorLevel="1"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xmlns="https://getpsalm.org/schema/config"
6-
findUnusedPsalmSuppress="true"
7-
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8-
>
2+
<psalm errorLevel="1"
3+
findUnusedBaselineEntry="false"
4+
findUnusedCode="false"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
findUnusedPsalmSuppress="true"
8+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd">
99
<projectFiles>
1010
<directory name="src"/>
1111
<directory name="tests"/>
1212
<ignoreFiles>
1313
<directory name="vendor"/>
1414
</ignoreFiles>
1515
</projectFiles>
16-
<plugins>
17-
<pluginClass class="Fp\Psalm\FunctionalPlugin"/>
18-
<pluginClass class="Fp\PsalmToolkit\Toolkit\Plugin"/>
19-
</plugins>
2016
<issueHandlers>
2117
<Trace errorLevel="error"/>
22-
<DeprecatedMethod errorLevel="suppress">
23-
<errorLevel type="suppress">
24-
<directory name="tests"/>
25-
</errorLevel>
26-
</DeprecatedMethod>
27-
<UnusedVariable errorLevel="suppress">
28-
<errorLevel type="suppress">
29-
<directory name="src/Fp/Functions"/>
30-
</errorLevel>
31-
</UnusedVariable>
32-
<DuplicateFunction errorLevel="suppress">
33-
<errorLevel type="suppress">
34-
<directory name="src/Fp/Functions"/>
35-
</errorLevel>
36-
</DuplicateFunction>
3718
<PropertyNotSetInConstructor errorLevel="suppress">
3819
<errorLevel type="suppress">
3920
<directory name="tests"/>
4021
</errorLevel>
4122
</PropertyNotSetInConstructor>
42-
<DuplicateClass errorLevel="suppress">
43-
<errorLevel type="suppress">
44-
<directory name="src/Fp/Functional"/>
45-
</errorLevel>
46-
</DuplicateClass>
47-
<InternalMethod errorLevel="suppress">
48-
<errorLevel type="suppress">
49-
<directory name="src/Fp/Psalm"/>
50-
</errorLevel>
51-
</InternalMethod>
52-
<InternalClass errorLevel="suppress">
53-
<errorLevel type="suppress">
54-
<directory name="src/Fp/Psalm"/>
55-
</errorLevel>
56-
</InternalClass>
57-
<InternalProperty errorLevel="suppress">
58-
<errorLevel type="suppress">
59-
<directory name="src/Fp/Psalm"/>
60-
</errorLevel>
61-
</InternalProperty>
62-
<UnusedClosureParam errorLevel="suppress"/>
63-
<UnusedMethodCall errorLevel="suppress">
64-
<errorLevel type="suppress">
65-
<directory name="tests"/>
66-
</errorLevel>
67-
</UnusedMethodCall>
6823
</issueHandlers>
24+
<plugins>
25+
<pluginClass class="Fp\PsalmPlugin\FunctionalPlugin"/>
26+
</plugins>
6927
</psalm>

0 commit comments

Comments
 (0)