PHPackages                             lemax10/ocstan - 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. lemax10/ocstan

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

lemax10/ocstan
==============

OCStan - Discover bugs in your code without running it. A nunomaduro/larastan wrapper for OctoberCMS

v0.1.4(5y ago)5952[1 issues](https://github.com/LeMaX10/ocstan/issues)MITPHPPHP ^7.2 || ^8.0

Since Apr 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/LeMaX10/ocstan)[ Packagist](https://packagist.org/packages/lemax10/ocstan)[ RSS](/packages/lemax10-ocstan/feed)WikiDiscussions master Synced today

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

---

⚗️ About OcStan
---------------

[](#️-about-ocstan)

- Adds static typing to Laravel to improve developer productivity and **code quality**
- Supports most of [Laravel](https://laravel.com)'s **beautiful magic**
- Supports most of [OctoberCMS](https://octobercms.com)'s **beautiful magic**
- Discovers bugs in your code without running it

✨ Getting Started In 3 Steps
----------------------------

[](#-getting-started-in-3-steps)

> **Requires:**

- **[PHP 7.2+](https://php.net/releases/)**
- **[Laravel 6.0+](https://github.com/laravel/laravel)**

**1**: First, you may use [Composer](https://getcomposer.org) to install Larastan as a development dependency into your Laravel project:

```
composer require --dev lemax10/ocstan
```

> Using Larastan for analysing Laravel packages? You may need to install `orchestra/testbench`.

**2**: Then, create a `phpstan.neon` or `phpstan.neon.dist` file in the root of your application. It might look like this:

```
includes:
    - ./vendor/lemax10/ocstan/extension.neon

parameters:

    paths:
        - app

    # The level 8 is the highest level
    level: 4

    ignoreErrors:
        - '#Unsafe usage of new static#'

    excludePaths:
        - ./*/*/FileToBeExcluded.php

    checkMissingIterableValueType: false

```

For all available options, please take a look at the PHPStan documentation: ****

**3**: Finally, you may start analyzing your code using the phpstan console command:

```
./vendor/bin/phpstan analyse
```

If you are getting the error `Allowed memory size exhausted`, then you can use the `--memory-limit` option fix the problem:

```
./vendor/bin/phpstan analyse --memory-limit=2G
```

Rules
-----

[](#rules)

A list of configurable rules specific to Laravel can be found [here](docs/rules.md).

Custom PHPDoc types
-------------------

[](#custom-phpdoc-types)

A list of PHPDoc types specific to Larastan can be found [here](docs/custom-types.md).

Custom PHPStan config parameters
--------------------------------

[](#custom-phpstan-config-parameters)

A list of custom config parameters that you can use in your PHPStan config file can be found [here](docs/custom-config-paramaters.md).

Errors To Ignore
----------------

[](#errors-to-ignore)

Some parts of Laravel are currently too magical for Larastan/PHPStan to understand. We listed common [errors to ignore](docs/errors-to-ignore.md), add them as needed.

👊🏻 Contributing
---------------

[](#-contributing)

Thank you for considering contributing to Larastan. All the contribution guidelines are mentioned [here](CONTRIBUTING.md).

You can have a look at the [CHANGELOG](CHANGELOG.md) for constant updates &amp; detailed information about the changes. You can also follow the Twitter account for the latest announcements or just come say hi!: [@enunomaduro](https://twitter.com/enunomaduro), [@can\_\_vural](https://twitter.com/can__vural).

❤️ Support The Development
--------------------------

[](#️-support-the-development)

**Do you like this project? Support it by donating**

- PayPal: [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L)
- Patreon: [Donate](https://www.patreon.com/nunomaduro)

📖 License
---------

[](#-license)

OCStan is an open-sourced software licensed under the [MIT license](LICENSE.md). Larastan is an open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% 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 ~0 days

Total

5

Last Release

1913d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef45edc1714e9db2e22281c81519aacedecf52235e89e3c5a2434a12b9b3f87c?d=identicon)[LeMaX10](/maintainers/LeMaX10)

---

Top Contributors

[![LeMaX10](https://avatars.githubusercontent.com/u/10564391?v=4)](https://github.com/LeMaX10 "LeMaX10 (7 commits)")[![dead23angel](https://avatars.githubusercontent.com/u/3616247?v=4)](https://github.com/dead23angel "dead23angel (2 commits)")[![igmobecan](https://avatars.githubusercontent.com/u/109527432?v=4)](https://github.com/igmobecan "igmobecan (1 commits)")

---

Tags

phpPHPStanlaravelstatic analysispackagecode analysiscode analyselarastanoctobercmsocstan

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lemax10-ocstan/health.svg)

```
[![Health](https://phpackages.com/badges/lemax10-ocstan/health.svg)](https://phpackages.com/packages/lemax10-ocstan)
```

###  Alternatives

[larastan/larastan

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

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

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

15118.7k4](/packages/calebdw-larastan)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

33110.3M1.4k](/packages/szepeviktor-phpstan-wordpress)[yamadashy/phpstan-friendly-formatter

Simple error formatter for PHPStan that display code frame

64861.2k47](/packages/yamadashy-phpstan-friendly-formatter)[nunomaduro/laravel-mojito

A lightweight package for testing Laravel views.

369461.8k12](/packages/nunomaduro-laravel-mojito)[calebdw/larastan-livewire

A Larastan / PHPStan extension for Livewire.

47698.4k6](/packages/calebdw-larastan-livewire)

PHPackages © 2026

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