Skip to content

Commit 7111157

Browse files
author
Greg Bowler
committed
Update documentation
1 parent de9b6dd commit 7111157

File tree

2 files changed

+47
-21
lines changed

2 files changed

+47
-21
lines changed

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These are supported funding model platforms
2+
github: [g105b]

README.md

+45-21
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,36 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v2
24-
- uses: php-actions/composer@v2 # or alternative dependency management
25-
- uses: php-actions/phpstan@v1
24+
- uses: php-actions/composer@v5 # or alternative dependency management
25+
- uses: php-actions/phpstan@v2
2626
# ... then your own project steps ...
2727
```
2828

29-
Commands
30-
--------
29+
Example
30+
-------
3131

32-
By default, adding - uses: php-actions/phpstan@v1 into your workflow will run `phpstan analyse`, as `analyse` is the default command name.
32+
We've put together an extremely simple example application that uses `php-actions/phpstan`. Check it out here: https://github.com/php-actions/example-phpstan.
33+
34+
Inputs
35+
------
36+
37+
The following configuration options are available:
38+
39+
+ `version` The version of PHPUnit to use e.g. `9` or `9.5.0` (default: latest)
40+
+ `php_version` The version of PHP to use e.g. `7.4` (default: latest)
41+
+ `php_extensions` Space-separated list of extensions using [php-build][php-build] e.g. `xdebug mbstring` (default: N/A)
42+
+ `command` The command to run e.g. `list` or `worker` (default: analyse)
43+
+ `path` Path(s) with source code to run analysis on (required)
44+
+ `configuration` Configuration file location
45+
+ `level` Level of rule options - the higher, the stricter
46+
+ `paths_file` Path to a file with a list of paths to run analysis on
47+
+ `autoload_file` Project's additional autoload file path
48+
+ `error_format` Format in which to print the result of the analysis
49+
+ `generate_baseline` Path to a file where the baseline should be saved
50+
+ `memory_limit` Memory limit for analysis
51+
+ `args` Extra arguments to pass to the phpstan binary
52+
53+
By default, adding - uses: php-actions/phpstan@v2 into your workflow will run `phpstan analyse`, as `analyse` is the default command name.
3354

3455
You can issue custom commands by passing a command input, like so:
3556

@@ -40,24 +61,11 @@ jobs:
4061
...
4162

4263
- name: PHPStan
43-
uses: php-actions/phpstan@v1
64+
uses: php-actions/phpstan@v2
4465
with:
4566
command: your-command-here
4667
```
4768
48-
Inputs
49-
------
50-
51-
The following configuration options are available:
52-
53-
+ `configuration` Path to the project configuration file
54-
+ `level` Level of rule options - the higher the stricter
55-
+ `paths_file` Path to a file with a list of paths to run analysis on
56-
+ `autoload_file` Project's additional autoload file path
57-
+ `error_format` Format in which to print the result of the analysis
58-
+ `generate_baseline` Path to a file where the baseline should be saved
59-
+ `memory_limit` Memory limit for analysis
60-
6169
The syntax for passing in a custom input is the following:
6270
6371
```yaml
@@ -69,14 +77,30 @@ jobs:
6977
...
7078

7179
- name: PHPStan Static Analysis
72-
uses: php-actions/phpstan@v1
80+
uses: php-actions/phpstan@v2
7381
with:
7482
configuration: custom/path/to/phpstan.neon
7583
memory_limit: 256M
7684
```
7785
7886
If you require other configurations of phpstan, please request them in the [Github issue tracker](https://github.com/php-actions/phpstan/issues)
7987
88+
PHP and PHPStan versions
89+
------------------------
90+
91+
It's possible to run any version of PHPStan under any version of PHP, with any PHP extensions you require. This is configured with the following inputs:
92+
93+
+ `version` - the version number of PHPStan to run e.g. `0.12.63` (default: latest)
94+
+ `php_version` - the version number of PHP to use e.g. `7.4` (default: latest)
95+
+ `php_extensions` - a space-separated list of extensions to install using [php-build][php-build] e.g. `xdebug mbstring` (default: N/A)
96+
97+
If you require a specific version combination that is not compatible with Github Actions for some reason, please make a request in the [Github issue tracker][issues].
98+
99+
100+
***
101+
80102
If you found this repository helpful, please consider [sponsoring the developer][sponsor].
81103

82-
[sponsor]: https://github.com/sponsors/g105b
104+
[php-build]: https://github.com/php-actions/php-build
105+
[issues]: https://github.com/php-actions/phpstan/issues
106+
[sponsor]: https://github.com/sponsors/g105b

0 commit comments

Comments
 (0)