Skip to content

Instantly share code, notes, and snippets.

View mhlavac's full-sized avatar

Martin Hlavac mhlavac

View GitHub Profile
@mhlavac
mhlavac / avoid.php
Created November 29, 2015 18:26
If you see this code... avoid the project! :-)
$a = getAllCars();
foreach ($a as $a1) {
$b1 = $a1;
$b1['name'] = $a1['name'] . '_';
// ... about 100 lines later...
if ($b1['name'] == $a1['name']) {
save($a2);
} else {
@mhlavac
mhlavac / greeter.php
Last active August 29, 2015 14:24
Container vs Composite vs Chain
<?php
interface Greeter
{
public function greet($name);
}
class ChainGreeter implements Greeter
{
private $greeters = [];