Larastan: Catch Bugs with Static Analysis

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.

This lesson is only for Premium Members.
Want to access all lessons of this course?

You also get:

  • 58 courses (1056 lessons, 44 h 09 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord