Created
April 2, 2019 14:46
-
-
Save igormx/6eaafa2d33e04672b85019e2f00202fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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