Skip to content

Reliability Analyzers ​

28 analyzers ensuring your application handles errors gracefully, maintains uptime, and prevents runtime failures.

Overview ​

Reliability analyzers focus on preventing runtime errors, ensuring proper configuration, validating dependencies, and maintaining application stability. These analyzers help catch issues before they cause production outages or user-facing errors.

Key Analyzers ​

Configuration & Environment ​

Infrastructure & Permissions ​

Queue & Database ​

Cache & Redis ​

Horizon ​

Application Servers & Deployment ​

Monitoring & Observability ​

Extensions & Variables ​

Static Analysis ​

PHPStan Detection Categories
  • Compile Errors - Syntax errors, colliding use imports, and methods, properties, constants, enum cases or parameters declared twice, all of which PHP refuses to load
  • Dead Code - Unreachable statements, unused variables, and code with no effect
  • Deprecated Code - Usage of deprecated methods, classes, and functions
  • Foreach Iterable Issues - Invalid foreach usage with non-iterable values
  • Invalid Function Calls - Calls to undefined or incorrectly parameterized functions
  • Invalid Imports - Invalid use statements for non-existent classes
  • Invalid Method Calls - Calls to undefined or incorrectly parameterized methods
  • Invalid Method Overrides - Incompatible method signature overrides
  • Invalid Offset Access - Invalid array offset access and type mismatches
  • Invalid Property Access - Access to undefined or inaccessible properties
  • Missing Model Relations - References to non-existent Eloquent relations
  • Missing Return Statements - Methods with missing return statements
  • Undefined Constants - References to undefined constants
  • Undefined Variables - References to undefined variables
  • Used Void Results - Using the result of a void function, method, closure, match or yield, which is always null
  • Other PHPStan Issues - PHPStan errors that no specific category claims

How They Work ​

Reliability analyzers use a combination of:

  1. Static Analysis (PHPStan): Detects code-level issues like undefined variables, invalid method calls, and type mismatches
  2. Configuration Validation: Checks Laravel configuration files, environment variables, and Composer dependencies
  3. Runtime Checks: Validates that services (cache, database) are accessible and functioning
  4. File System Analysis: Verifies file permissions, existence of required files, and directory structure

Running Reliability Analyzers ​

Run All Reliability Analyzers ​

bash
php artisan shield:analyze --category=reliability

Run Specific Analyzer ​

bash
php artisan shield:analyze --analyzer=database-status
php artisan shield:analyze --analyzer=up-to-date-migrations
php artisan shield:analyze --analyzer=cache-status

Run Multiple Analyzers ​

bash
php artisan shield:analyze --analyzer=composer-validation,queue-timeout-configuration,maintenance-mode-status

Best Practices ​

Development ​

  • Run reliability analyzers before committing code
  • Fix Critical and High severity issues immediately
  • Use static analysis (PHPStan) to catch issues early

CI/CD ​

  • Run reliability analyzers on every pull request
  • Fail builds on Critical severity issues
  • Monitor reliability metrics over time

Production ​

  • Schedule periodic reliability checks
  • Monitor for configuration drift
  • Validate environment variables on deployment