Type checking: Verifying that values in a program are used consistently with their declared types. Static type checking happens at compile time (TypeScript, Java); dynamic type checking happens at runtime (Python, JavaScript). Type checking verifies that values are used according to their types: that a function expecting a number does not receive a string, or that a method you call actually exists on the object.
Static type checking happens before the code runs, as in TypeScript, Java or C#, or with tools like PHPStan and Psalm for PHP. Dynamic type checking happens at runtime, when the operation is attempted.
What should you keep in mind with Type checking?
Static checks catch whole categories of bugs early, such as null values where an object was expected or misspelled properties, and make editors smarter with better autocompletion. PHP has gained strong type declarations over the years, and combining them with PHPStan at a high level gives much of the safety of a compiled language. Running these checks in CI keeps the benefit for the whole team.
Apply Spatie's Laravel and PHP coding standards for any task that creates, edits, reviews, refactors, or formats Laravel/PHP code or Blade templates; use for controllers, Eloquent models, routes, config, validation, migrations, tests, and related files to align with Laravel conventions and PSR-12.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.