Last active
January 22, 2017 21:09
-
-
Save mkusher/c2fb335d5252b6302f630db7c758d77e to your computer and use it in GitHub Desktop.
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 | |
interface Logger | |
{ | |
public function log(string $message, int $level = 0): void; | |
} |
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 Service | |
{ | |
private $logger; | |
public function __construct(Logger $logger) { | |
$this->logger = $logger; | |
} | |
public function action() { | |
$this->logger->log("start"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment