Skip to content

Instantly share code, notes, and snippets.

@igormx
Created April 2, 2019 14:46
Show Gist options
  • Save igormx/6eaafa2d33e04672b85019e2f00202fa to your computer and use it in GitHub Desktop.
Save igormx/6eaafa2d33e04672b85019e2f00202fa to your computer and use it in GitHub Desktop.
<?php
/**
* This code is missing:
* -a way to inject the dependecy for Motor
* -a way to accept multiple kinds of Motors as a dependecy
**/
class Coche
{
/**
* @var Motor
**/
protected $motor;
public function arrancar()
{
$this->motor->encender();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment