PHPackages                             dreikern/phpstan-oxid - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. dreikern/phpstan-oxid

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

dreikern/phpstan-oxid
=====================

PHPStan extension for OXID eShop

0.2.0(1y ago)39.8k↓75%1MITPHPPHP ^8.0

Since Aug 25Pushed 1y ago3 watchersCompare

[ Source](https://github.com/dreikern/phpstan-oxid)[ Packagist](https://packagist.org/packages/dreikern/phpstan-oxid)[ RSS](/packages/dreikern-phpstan-oxid/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (7)Dependencies (8)Versions (9)Used By (0)

OXID eShop extensions for PHPStan
=================================

[](#oxid-eshop-extensions-for-phpstan)

[![Build](https://github.com/dreikern/phpstan-oxid/workflows/Build/badge.svg)](https://github.com/dreikern/phpstan-oxid/actions)[![Latest Stable Version](https://camo.githubusercontent.com/58d4449244dfc33954f2d631704ffc2a553d5330d0c8787cda05a2d62c591608/68747470733a2f2f706f7365722e707567782e6f72672f647265696b65726e2f7068707374616e2d6f7869642f762f737461626c65)](https://packagist.org/packages/dreikern/phpstan-oxid)[![License](https://camo.githubusercontent.com/580ce5aadad76573b94797dbf8a32732d25bff5d871497bc0df9384eed04027b/68747470733a2f2f706f7365722e707567782e6f72672f647265696b65726e2f7068707374616e2d6f7869642f6c6963656e7365)](https://packagist.org/packages/dreikern/phpstan-oxid)

- [PHPStan](https://phpstan.org/)
- [OXID eShop](https://github.com/OXID-eSales/oxideshop_ce)

This extension provides following features:

- OXID eShop uses class chaining in order to inject modules into their system. This class chain is built at runtime so PHPStan, as a static code analyzer, isn't able to detect that. This extension reads your shop configuration (e.g. `var/configuration/shops/1.yaml`) and builds this class chain when PHPStan is analyzing your code. Only activated modules are considered. This allows PHPStan to do its magic.
- When using `oxNew()` or `Registry::get()` this extension dynamically changes the return type when PHPStan is analyzing your code, so it is aware of any changes your code adds to OXID eShop classes.
- Stubs [some](stubs) OXID eShops classes to fix incorrect phpdoc comments in OXID eShop. Feel free to contribute more stubs when you encounter such mistakes. [PHPStan Documentation](https://phpstan.org/user-guide/stub-files)
- Provide [rules](#rules) to detect usage of legacy class names (e.g. `oxdiscount` instead of `\OxidEsales\Eshop\Application\Model\Discount`) or classes without unified namespace (e.g. `\OxidEsales\EshopCommunity\Application\Model\Voucher` instead of `\OxidEsales\Eshop\Application\Model\Voucher`).

Installation
------------

[](#installation)

To use this extension, require it in [Composer](https://getcomposer.org/):

```
composer require --dev dreikern/phpstan-oxid
```

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

 Manual installationIf you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

```
includes:
    - vendor/dreikern/phpstan-oxid/extension.neon
```

Configuration
-------------

[](#configuration)

If the path to your shops module configuration differs from `var/configuration/shops/1.yaml` , you can override the path in your `phpstan.neon`:

```
parameters:
    oxid:
        shopConfigurationPath: var/configuration/shops/1.yaml
```

If you need to analyze different subshops without changing your `phpstan.neon` you are able to set the path via environment variable:

```
PHPSTAN_OXID_CONFIG_PATH=path/to/config/1.yaml ./vendor/bin/phpstan analyze path/to/oxid/module
```

Rules
-----

[](#rules)

### OxNewCalledWithEditionNamespaceRule

[](#oxnewcalledwitheditionnamespacerule)

oxNew() call with edition namespace for class `%s`. Use `%s` instead.

- class: [`dreikern\PhpStanOxid\Rule\OxNewCalledWithEditionNamespaceRule`](src/Rule/OxNewCalledWithEditionNamespaceRule.php)

```
oxNew(\OxidEsales\EshopCommunity\Application\Model\Voucher::class);
```

❌

```
oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class);
```

✅

### OxNewCalledWithLegacyClassNameRule

[](#oxnewcalledwithlegacyclassnamerule)

oxNew() call with legacy className `%s`. Use `%s` instead.

- class: [`dreikern\PhpStanOxid\Rule\OxNewCalledWithLegacyClassNameRule`](src/Rule/OxNewCalledWithLegacyClassNameRule.php)

```
oxNew('oxdiscount');
```

❌

```
oxNew(\OxidEsales\Eshop\Application\Model\Discount::class);
```

✅

### RegistryGetCalledWithEditionNamespaceRule

[](#registrygetcalledwitheditionnamespacerule)

Registry::get() call with edition namespace for class `%s`. Use `%s` instead.

- class: [`dreikern\PhpStanOxid\Rule\RegistryGetCalledWithEditionNamespaceRule`](src/Rule/RegistryGetCalledWithEditionNamespaceRule.php)

```
Registry::get(\OxidEsales\EshopCommunity\Application\Model\Voucher::class);
```

❌

```
Registry::get(\OxidEsales\Eshop\Application\Model\Discount::class);
```

✅

### RegistryGetCalledWithLegacyClassNameRule

[](#registrygetcalledwithlegacyclassnamerule)

Registry::get() call with legacy className `%s`. Use `%s` instead.

- class: [`dreikern\PhpStanOxid\Rule\RegistryGetCalledWithLegacyClassNameRule`](src/Rule/RegistryGetCalledWithLegacyClassNameRule.php)

```
Registry::get('oxdiscount');
```

❌

```
Registry::get(\OxidEsales\Eshop\Application\Model\Voucher::class);
```

✅

Credits
-------

[](#credits)

This PHPStan extensions is heavily inspired by [phpstan-doctrine](https://github.com/phpstan/phpstan-doctrine)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~116 days

Recently: every ~203 days

Total

8

Last Release

596d ago

PHP version history (2 changes)0.1.0PHP ^7.4 || ^8.0

0.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7562357bac818920bab26d187dcd9f2ad3ed379a9f7c289f52dde8c6790a787c?d=identicon)[adriankirchner](/maintainers/adriankirchner)

---

Top Contributors

[![adriankirchner](https://avatars.githubusercontent.com/u/149483?v=4)](https://github.com/adriankirchner "adriankirchner (46 commits)")

###  Code Quality

TestsPHPUnit

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dreikern-phpstan-oxid/health.svg)

```
[![Health](https://phpackages.com/badges/dreikern-phpstan-oxid/health.svg)](https://phpackages.com/packages/dreikern-phpstan-oxid)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.5k](/packages/larastan-larastan)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k101.8M2.2k](/packages/behat-behat)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.2k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67272.8M1.4k](/packages/phpstan-phpstan-doctrine)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20731.4M189](/packages/mglaman-phpstan-drupal)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4853.5M92](/packages/shipmonk-dead-code-detector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
