Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
This package has been abandoned. Use larastan/larastan instead.

nunomaduro/larastan v2.9.2

Larastan - Discover bugs in your code without running it. A phpstan/phpstan wrapper for Laravel
Package summary
Share
0
issues
0
licenses
Package created
5 Jul 2018
Version published
27 Feb 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does nunomaduro/larastan do?

Nunomaduro/larastan is a powerful tool that can be used to identify errors in your Laravel code without actually running the code. Acting as a wrapper for PHPStan, larastan focuses on analyzing your code to uncover potential issues before you even write tests for it. By incorporating static typing into Laravel, the tool aids in improving your code's quality and the overall productivity of the developer. It is capable of catching entire classes of bugs, uncovering hidden errors in your codebase, and supports most of Laravel's magic.

How do you use nunomaduro/larastan?

In order to use nunomaduro/larastan, you should first install the package using Composer as a development dependency. Here's a simple example of how you can do it:

composer require nunomaduro/larastan:^2.0 --dev

After this, you need to create a phpstan.neon or phpstan.neon.dist file in your project's root directory with configurations as shown below:

includes:
    - ./vendor/nunomaduro/larastan/extension.neon

parameters:
    paths:
        - app/
    level: 5

You can then start analyzing your code using the phpstan console command:

./vendor/bin/phpstan analyse

If you encounter a memory error, you can specify a memory limit to fix the issue:

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

In addition to this basic usage, larastan provides ways to ignore specific errors and set up a baseline file for large code bases where fixing all errors is time-consuming.

Where are the nunomaduro/larastan docs?

The comprehensive documentation for nunomaduro/larastan is available directly in the GitHub repository. This includes details on configurable rules, features, custom PHPDoc types, custom config parameters, and common errors to ignore. For more in-depth information, you can refer to the official PHPStan documentation.