PHPackages                             apie/apie-phpstan-rules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. apie/apie-phpstan-rules

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

apie/apie-phpstan-rules
=======================

Composer package of the apie library: apie phpstan rules

1.0.0.x-dev(1y ago)0451MITPHPPHP &gt;=8.3

Since Mar 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/apie-lib/apie-phpstan-rules)[ Packagist](https://packagist.org/packages/apie/apie-phpstan-rules)[ RSS](/packages/apie-apie-phpstan-rules/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

[![](https://raw.githubusercontent.com/apie-lib/apie-lib-monorepo/main/docs/apie-logo.svg)](https://raw.githubusercontent.com/apie-lib/apie-lib-monorepo/main/docs/apie-logo.svg)

apie-phpstan-rules
==================

[](#apie-phpstan-rules)

[![Latest Stable Version](https://camo.githubusercontent.com/638d37c8586510c67bd0a2d83070d802a61e5ecbb6ddaa05342ab2524d3036a7/68747470733a2f2f706f7365722e707567782e6f72672f617069652f617069652d7068707374616e2d72756c65732f76)](https://packagist.org/packages/apie/apie-phpstan-rules) [![Total Downloads](https://camo.githubusercontent.com/716d0eb0be834af444b742723af3cfc9495f718a719e14a7e029b14999949ceb/68747470733a2f2f706f7365722e707567782e6f72672f617069652f617069652d7068707374616e2d72756c65732f646f776e6c6f616473)](https://packagist.org/packages/apie/apie-phpstan-rules) [![Latest Unstable Version](https://camo.githubusercontent.com/4e8f50f3f7db5cc70026bd10ca6a55a21cd29333ed83dc2fabb9b4ad77073c37/68747470733a2f2f706f7365722e707567782e6f72672f617069652f617069652d7068707374616e2d72756c65732f762f756e737461626c65)](https://packagist.org/packages/apie/apie-phpstan-rules) [![License](https://camo.githubusercontent.com/f07205a1e78d631b601c15a0ed39a62a3631cebab24e0453395c1f8dd761b622/68747470733a2f2f706f7365722e707567782e6f72672f617069652f617069652d7068707374616e2d72756c65732f6c6963656e7365)](https://packagist.org/packages/apie/apie-phpstan-rules) [![PHP Composer](https://camo.githubusercontent.com/1d5c9239423650b9a313defdda8ff3d73dfc05ae0b7f3919334c2aa3a1ab0231/68747470733a2f2f617069652d6c69622e6769746875622e696f2f70726f6a656374436f7665726167652f636f7665726167652d617069652d7068707374616e2d72756c65732e737667)](https://apie-lib.github.io/projectCoverage/apie-phpstan-rules/index.html)

[![PHP Composer](https://github.com/apie-lib/apie-phpstan-rules/actions/workflows/php.yml/badge.svg?event=push)](https://github.com/apie-lib/apie-phpstan-rules/actions/workflows/php.yml)

This package is part of the [Apie](https://github.com/apie-lib) library. The code is maintained in a monorepo, so PR's need to be sent to the [monorepo](https://github.com/apie-lib/apie-lib-monorepo/pulls)

Documentation
-------------

[](#documentation)

Adds phpstan rules specifically for Apie.

Usage:

```
composer require --dev apie/apie-phpstan-rules
```

and in your phpstan.neon the include to the neon file.

```
includes
    - './vendor/apie/apie-phpstan-rules/apie-phpstan-rules.neon'
```

### Added phpstan rules

[](#added-phpstan-rules)

#### Entity getId() should be specific

[](#entity-getid-should-be-specific)

The interface of an entity requires you to have a getId() method with IdentifierInterface as return type. For better reflection it is better if you specify the class it returns instead.

```
