Source: www.eloquentarchitecture.com

Locality of Behavior
The LoB principle dictates that the behavior of a unit of code should be as obvious as possible by looking only at that unit of code. The behaviour of a unit of code should be as obvious as possible by looking only at that unit of codeThe LoB principle is a simple prescriptive formulation of the quoted statement from https://www.dreamsongs.com. In as much as it is possible, and in balance with other concerns, developers should strive to make the behaviour of a code element obvious on inspection.

But, is simply placing these things next to each other enough to make a unit of code "obvious"?

You have to admit that this code satisfies the LoB principle pretty damn well.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners