Category: dependency

Disco with Design Patterns: A Fresh Look at Dependency Injection

Dependency Injection is all about code reusability. It’s a design pattern aiming to make high-level code reusable, by separating the object creation / configuration from usage. Consider the following code: <?php class Test { protected $dbh; public function __construct(PDO $dbh) { ...

Sourcehunt #4 – Reflection, Authorization, Crons, and more

We skipped January’s Sourcehunt, but we’re back now, ready to boost the stardom of more projects! mult1mate/cron-manager [125 ★] mult1mate/cron-manager is a flexible tasks manager designed for MVC-type applications. It’s used instead of crontab and its purpose is to provide an easy way to manipulate repetitive...

How to Build Your Own Dependency Injection Container

A search for “dependency injection container” on packagist currently provides over 95 pages of results. It is safe to say that this particular “wheel” has been invented. However, no chef ever learned to cook using only ready meals. Likewise, no developer ever learned programming using only “ready code”. In...