Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandembassy/phpstan-forbidden-method-calls-rule
https://github.com/brandembassy/phpstan-forbidden-method-calls-rule
phpstan phpstan-rules
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brandembassy/phpstan-forbidden-method-calls-rule
- Owner: BrandEmbassy
- License: mit
- Created: 2018-08-21T07:31:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-21T16:26:57.000Z (over 1 year ago)
- Last Synced: 2024-04-23T11:55:19.171Z (9 months ago)
- Topics: phpstan, phpstan-rules
- Language: PHP
- Size: 3.91 KB
- Stars: 6
- Watchers: 9
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPStan Forbidden Method Calls Rule
> This PHPStan rule was created by Petr Morávek (https://github.com/xificurk).
## Usage
```bash
composer require --dev brandembassy/phpstan-forbidden-method-calls-rule
```And then in your `phpstan.neon` register service:
```
services:
-
class: BrandEmbasssy\ForbiddenMethodCallsRule\ForbiddenMethodCallsRule
setup:
- addForbiddenMethod(Psr\Http\Message\StreamInterface, getContents)
tags:
- phpstan.rules.rule
```## Example
```
------ -----------------------------------------------------------------
Line foo/Bar/Baz.php (in context of class Foo\Bar\Baz)
------ -----------------------------------------------------------------
95 Calling forbidden method
Psr\Http\Message\StreamInterface:getContents().
------ -----------------------------------------------------------------
```