Created
April 16, 2017 03:17
-
-
Save pedrogk/f40a968f0a141e3a2ce617c8198b8979 to your computer and use it in GitHub Desktop.
Inyección via métodos
This file contains 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 | |
class MyClass { | |
private $logger; | |
public function setLogger(LoggerInterface $logger) { | |
$this->logger = $logger; | |
} | |
public function send($message) { | |
return $this->logger->info($message); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment