Closed lyrixx closed 9 years ago
About the lib:
functions.php
. In all modern PHP application, we have a DIC or something like that.What do you think?
Actually, I did not see that the Factory and the Registry where used in the Bundle. So now, I just want to remove the functions.php
;)
And finally, The bundle does't use the Factory nor the Registry anymore...
I would rather keep tests in a separate folder rather than nesting them inside the library codebase
I would rather keep tests in a separate folder rather than nesting them inside the library codebase
Why? Symfony and lot of other lib share the same folder
Why? Symfony and lot of other lib share the same folder
Symfony has it in the code because of the subtree splits which should include tests. Before that, they were in a separate folder
I know, But it there a valid reason to have 2 different folders? For me, tests are part of code, and so should live inside the same folder.
Disappointed that functions.php
is gone. It was awesome being able to add the metrics functions to my code without having to update tests
1/ You can still use version 1.X
2/ IMHO, it's a bad practice to use a "Singleton". It's better to inject a Collector
inside your code. More over, if you don't want to update your tests, you can use this kind of code:
use Beberlei\Metrics\Collector\Collector;
use Beberlei\Metrics\Collector\Null;
class ServiceFooBar
{
private $collector;
public function __construct(Collector $collector = null)
{
$this->collector = $collector ?: new Null();
}
//.....
I always use this "hack" for a logger / collector / ...
fixes #24