PHPackages                             wubbleyou/wubblestan - 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. wubbleyou/wubblestan

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

wubbleyou/wubblestan
====================

A set of prebuilt rules for Larastan/PHPStan

07.1k↓41.5%PHP

Since Dec 4Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/Wubbleyou/wubblestan)[ Packagist](https://packagist.org/packages/wubbleyou/wubblestan)[ RSS](/packages/wubbleyou-wubblestan/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Wubbleyou\\Wubblestan
=====================

[](#wubbleyouwubblestan)

A simple set of prebuilt rules for PHPStan/Larastan.

### Setup

[](#setup)

Simply install this as you would any other composer package:

`composer require --dev "wubbleyou/wubblestan"`

#### Neon Config

[](#neon-config)

Add the class definition to your services, this should be in a `phpstan.neon` file in your project root. See [Larastan - Getting Started](https://github.com/larastan/larastan?tab=readme-ov-file#-getting-started-in-3-steps) if you're confused.

```
services:
    - class: Wubbleyou\Wubblestan\Rules\RULE_CLASS
      tags:
        - phpstan.rules.rule

```

#### Whitelisting

[](#whitelisting)

We can just use [PHPStans ignoring errors](https://phpstan.org/user-guide/ignoring-errors) functionality to whitelist specific controllers/methods.

### AuthorisationInController

[](#authorisationincontroller)

This rule scans all controller methods and fails whenever one is detected without any authorisation - essentially checks if `$this->authorize(...)` is present.

### StandardRequestInController

[](#standardrequestincontroller)

This rule scans all controller methods to make sure the standard Laravel request class is not being used. We should *always* be creating a dedicated request class extending `FormRequest`. Any method using `Illuminate\Http\Request` **will fail**.

### ModelsInController

[](#modelsincontroller)

This rule scans all controller methods to make sure you're not using model classes directly within a controller. For an example the following is forbidden:

- `$user = User::find(2);`
- `User::create([...])`

### BusinessLogicInController

[](#businesslogicincontroller)

This rule scans all controller methods to make sure no business logic is present - we should be using services instead. Currently it checks for usage of:

- `if`
- `for`
- `foreach`
- `while`
- `switch`

### MaxLengthController

[](#maxlengthcontroller)

This rule scans all controller methods to make sure none of them exceed a limit of 20 lines in length.

### Example phpstan.neon config

[](#example-phpstanneon-config)

***Note: level should be set somewhere between 1 and 10.***

[Read about levels here](https://phpstan.org/user-guide/rule-levels)

```
includes:
    - vendor/larastan/larastan/extension.neon
    - vendor/nesbot/carbon/extension.neon

parameters:
    paths:
        - app/
    level: 0-10

services:
    - class: Wubbleyou\Wubblestan\Rules\BusinessLogicInController
      tags:
        - phpstan.rules.rule
    - class: Wubbleyou\Wubblestan\Rules\ModelsInController
      tags:
        - phpstan.rules.rule
    - class: Wubbleyou\Wubblestan\Rules\MaxLengthController
      tags:
        - phpstan.rules.rule
    - class: Wubbleyou\Wubblestan\Rules\StandardRequestInController
      tags:
        - phpstan.rules.rule
    - class: Wubbleyou\Wubblestan\Rules\AuthorisationInController
      tags:
        - phpstan.rules.rule

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance49

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dfd5e4243f46321d051e985fbd72c28e91ba23a007b2eac4cb8a0d4a9564698?d=identicon)[wubbleyou](/maintainers/wubbleyou)

---

Top Contributors

[![joey-wub](https://avatars.githubusercontent.com/u/167451463?v=4)](https://github.com/joey-wub "joey-wub (13 commits)")

### Embed Badge

![Health badge](/badges/wubbleyou-wubblestan/health.svg)

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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