Skip to content

Instantly share code, notes, and snippets.

@mchelen
Created September 28, 2016 13:23
Show Gist options
  • Save mchelen/812a8c1f524f9a280a1b019ec0929ca7 to your computer and use it in GitHub Desktop.
Save mchelen/812a8c1f524f9a280a1b019ec0929ca7 to your computer and use it in GitHub Desktop.
<?php
namespace Example;
class Foo {
private $logger;
__construct (\Psr\Log\LoggerInterface $logger = new \Psr\Log\NullLogger()) {
$this->logger = $logger;
}
public function bar($baz) {
$this->logger->addDebug($baz);
}
}
@mchelen
Copy link
Author

mchelen commented Sep 28, 2016

doesn't work because of example #4 http://php.net/manual/en/functions.arguments.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment