---
title: "TL;DR"
canonical_url: "https://handbook.propay.co.za/php/tldr"
---
# TL;DR

There are two main approaches to using modern PHP: like Ruby, or like Java. We prefer the Java way: less magic, more types.

We strive to minimize magic and help IDE and static code analyzers to help us.

We use [PSR-12](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md) extended by other rules (mostly by powerful [Slevomat Coding Standard](https://github.com/slevomat/coding-standard)). Additionally, we like [Spatie’s code guidelines](https://spatie.be/guidelines/laravel-php) and borrow some rules from them.

We generally observe the standards from the [PHP FIG](http://www.php-fig.org/). We use automated tools to check our code on CI:

- [Laravel Pint](https://laravel.com/docs/11.x/pint)
- [PHPStan](https://phpstan.org/)
- [PHPInsights](https://phpinsights.com)
- and more...

Our codebase has some legacy code that does not fully follow our standards; please treat this document as the main source of truth. Main legacy parts:

- Setters. We SHOULD use domain-specific methods to change a model’s state.


## Sitemap

See the full [sitemap](https://handbook.propay.co.za/sitemap.md) for all pages.
