PHPackages                             coolgoose/larastan-legacy - 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. coolgoose/larastan-legacy

ActivePhpstan-extension[Utility &amp; Helpers](/categories/utility)

coolgoose/larastan-legacy
=========================

Larastan Legacy 1.x - Unmaintained fork to fix composer dependency

v2.9.5(2y ago)05MITPHPPHP ^8.0.2

Since Jul 17Pushed 2y agoCompare

[ Source](https://github.com/CoolGoose/larastan-legacy)[ Packagist](https://packagist.org/packages/coolgoose/larastan-legacy)[ Fund](https://www.paypal.com/paypalme/enunomaduro)[ GitHub Sponsors](https://github.com/canvural)[ RSS](/packages/coolgoose-larastan-legacy/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (151)Used By (0)

> Note, this is just a workaround release for removing the direct composer dependency for the legacy unmaintained 1.x version. see [composer/composer#11940](https://github.com/composer/composer/issues/11940)

---

⚗️ About Larastan
-----------------

[](#️-about-larastan)

Larastan was created by [Can Vural](https://github.com/canvural) and [Nuno Maduro](https://github.com/nunomaduro), got artwork designed by [@Caneco](http://github.com/caneco), is maintained by [Can Vural](https://github.com/canvural), [Nuno Maduro](https://github.com/nunomaduro), and [Viktor Szépe](https://github.com/szepeviktor), and is a [PHPStan](https://phpstan.org/) wrapper for Laravel. Larastan focuses on **finding errors in your code**. It catches whole classes of bugs even **before you write tests** for the code.

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

> While by definition, "static analysis" doesn't load any of your application's code. Larastan boots your application's container, so it can resolve types that are only possible to compute at runtime. That's why we use the term "code analysis" instead of "static analysis".

✨ 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 nunomaduro/larastan:^1.0 --dev
```

> 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/nunomaduro/larastan/extension.neon

parameters:

    paths:
        - app

    # The level 9 is the highest level
    level: 5

    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
```

Ignoring errors
---------------

[](#ignoring-errors)

Ignoring a specific error can be done either with a php comment or in the configuration file:

```
// @phpstan-ignore-next-line
$test->badMethod();

$test->badMethod(); // @phpstan-ignore-line
```

When ignoring errors in PHPStan's configuration file, they are ignored by writing a regex based on error messages:

```
parameters:
    ignoreErrors:
        - '#Call to an undefined method .*badMethod\(\)#'
```

### Baseline file

[](#baseline-file)

In older codebases it might be hard to spend the time fixing all the code to pass a high PHPStan Level.

To get around this a baseline file can be generated. The baseline file will create a configuration file with all of the current errors, so new code can be written following a higher standard than the old code. ([PHPStan Docs](https://phpstan.org/user-guide/baseline))

```
./vendor/bin/phpstan analyse --generate-baseline
```

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)

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

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~14 days

Recently: every ~1 days

Total

149

Last Release

750d ago

Major Versions

v0.7.15 → 1.0.02021-11-01

1.0.3 → 2.0.02022-01-26

1.0.4 → 2.3.02022-12-23

PHP version history (4 changes)v0.1.0PHP ^7.1.3

v0.5.1PHP ^7.2

v0.6.9PHP ^7.2 || ^8.0

2.0.0PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/788070702680f86523e3af807ef66c89c5be92ac4054efca6a129992bedf48e2?d=identicon)[CoolGoose](/maintainers/CoolGoose)

---

Top Contributors

[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (419 commits)")[![canvural](https://avatars.githubusercontent.com/u/1574232?v=4)](https://github.com/canvural "canvural (360 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (130 commits)")[![Daanra](https://avatars.githubusercontent.com/u/6588838?v=4)](https://github.com/Daanra "Daanra (34 commits)")[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (22 commits)")[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (19 commits)")[![CyberiaResurrection](https://avatars.githubusercontent.com/u/9083866?v=4)](https://github.com/CyberiaResurrection "CyberiaResurrection (14 commits)")[![kylekatarnls](https://avatars.githubusercontent.com/u/5966783?v=4)](https://github.com/kylekatarnls "kylekatarnls (12 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (11 commits)")[![johanvanhelden](https://avatars.githubusercontent.com/u/19389981?v=4)](https://github.com/johanvanhelden "johanvanhelden (8 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (8 commits)")[![CoolGoose](https://avatars.githubusercontent.com/u/51180?v=4)](https://github.com/CoolGoose "CoolGoose (7 commits)")[![0xb4lint](https://avatars.githubusercontent.com/u/3747631?v=4)](https://github.com/0xb4lint "0xb4lint (7 commits)")[![mr-feek](https://avatars.githubusercontent.com/u/5747667?v=4)](https://github.com/mr-feek "mr-feek (7 commits)")[![haringsrob](https://avatars.githubusercontent.com/u/866743?v=4)](https://github.com/haringsrob "haringsrob (6 commits)")[![UksusoFF](https://avatars.githubusercontent.com/u/1931442?v=4)](https://github.com/UksusoFF "UksusoFF (5 commits)")[![BertvanHoekelen](https://avatars.githubusercontent.com/u/7521173?v=4)](https://github.com/BertvanHoekelen "BertvanHoekelen (5 commits)")[![deleugpn](https://avatars.githubusercontent.com/u/9533181?v=4)](https://github.com/deleugpn "deleugpn (5 commits)")[![Josh-G](https://avatars.githubusercontent.com/u/487384?v=4)](https://github.com/Josh-G "Josh-G (5 commits)")[![rajyan](https://avatars.githubusercontent.com/u/38206553?v=4)](https://github.com/rajyan "rajyan (4 commits)")

---

Tags

phpPHPStanlaravelstatic analysispackagecode analysiscode analyselarastan

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/coolgoose-larastan-legacy/health.svg)

```
[![Health](https://phpackages.com/badges/coolgoose-larastan-legacy/health.svg)](https://phpackages.com/packages/coolgoose-larastan-legacy)
```

###  Alternatives

[larastan/larastan

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

6.4k43.5M5.2k](/packages/larastan-larastan)[calebdw/larastan

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

1484.6k3](/packages/calebdw-larastan)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)

PHPackages © 2026

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