Courses

Larastan: Catch Bugs with Static Analysis

PHPStan Levels

You're reading a FREE PREVIEW of a PREMIUM course.

As you might have noticed - we have used quite a few levels of PHPStan in this course. Let's look at what they mean.

Level 0

  • basic checks
  • unknown classes
  • unknown functions
  • unknown methods called on $this
  • wrong number of arguments passed to those methods and functions
  • always undefined variables

It means that running PHPStan on level 0 will give you information about issues with the code, such as missing classes or functions. It will cover the basic syntax errors or misuse of functions.

Level 1

  • possibly undefined variables
  • unknown magic methods and properties on classes with call and get

It will warn you about possible issues with the code, such as calling a method that does not exist in the class, or they are accessed via magic methods.

The full lesson is only for Premium Members.
Want to access all 8 text lessons of this course? (30 min read)

You also get:

  • 77 courses
  • Premium tutorials
  • Access to repositories
  • Private Discord