• Introduction
    • Security and Updates
    • Introduction
    • Final Thoughts
    • Introduction
    • Single Responsibility Principle
    • Open Closed Principle (OCP)
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle
    • Final Thoughts
    • Introduction
    • Variables
    • Comparison
    • Functions
    • Objects and Data Structures
    • Classes
    • Tests
    • SOLID
    • DRY principle
    • Imports
    • Final Thoughts
    • Strategy
    • Facades
    • Eloquent Models
    • Elequent Factories
    • Artisan Commands
    • Controllers
    • Requests & Responses
    • Routing
    • Authorization
    • Middleware
    • Validation
    • Views
    • Translations
    • Exceptions
    • Jobs
    • Events
    • Configs
    • Migrations
    • Security
    • Files & Disks
    • Tests
    • Services
    • Final Thoughts
    • Naming
    • TL;DR
    • Final by default
    • Strict types
    • Typed Properties
    • Void return types
    • Doc Blocks
    • Generic types and templates
    • Strings
    • Comments
    • Classes
    • Type-casting
    • Named constructors
    • Domain-specific operations
    • assert() vs throw
    • Regex
    • Final Thought
    • Introduction
    • Routing
    • Controllers
    • Authentication
    • Versioning
    • Introduction
    • Indices
    • Introduction
    • Gitflow
    • Final Thoughts
    • Resources

Typed Properties

You should specify property types whenever possible. Don’t use a docblock when you can use typed properties.

Edit this page on GitHub
PhpStrict types
PhpVoid return types

Powered by Docus