container entries debug #505
Conversation
Thanks! I have written a few comments inline, also could you add a changelog entry in the |
$this->assertEquals('foo', $container->debugEntry('string')); | ||
$this->assertEquals('string', $container->debugEntry('entry')); | ||
$this->assertEquals('stdClass', $container->debugEntry('object')); | ||
} |
mnapoli
Jun 10, 2017
Member
This test is ContainerGetTest.php
and it's supposed to test the get()
method.
I think it would make more sense to move those 2 new tests into a new test class in IntegrationTest
(instead of UnitTest) that would test the debug features, i.e. DebugTest
?
This test is ContainerGetTest.php
and it's supposed to test the get()
method.
I think it would make more sense to move those 2 new tests into a new test class in IntegrationTest
(instead of UnitTest) that would test the debug features, i.e. DebugTest
?
* | ||
* @return array | ||
*/ | ||
public function getKnownEntryNames() |
mnapoli
Jun 10, 2017
Member
You can add the array
return type here and remove the same line that is in the phpdoc (PHP 7 FTW ^^)
You can add the array
return type here and remove the same line that is in the phpdoc (PHP 7 FTW ^^)
juliangut
Jun 10, 2017
Author
Contributor
I think code base must be reviewed on missing type hinting hunt, for example on Container::has
I think code base must be reviewed on missing type hinting hunt, for example on Container::has
mnapoli
Jun 11, 2017
Member
I cannot add it for has()
and get()
because those are defined in PSR-11 unfortunately.
I cannot add it for has()
and get()
because those are defined in PSR-11 unfortunately.
* | ||
* @return string | ||
*/ | ||
public function debugEntry($name) |
mnapoli
Jun 10, 2017
Member
Could you add the strict types here too? (parameter + return type)
Could you add the strict types here too? (parameter + return type)
return is_object($entry) ? get_class($entry) : gettype($entry); | ||
} | ||
|
||
throw new InvalidArgumentException("No entry or class found for '$name'"); |
mnapoli
Jun 10, 2017
Member
You could throw a NotFound
exception? (it wouldn't be a huge difference but since the exception exists let's use it)
You could throw a NotFound
exception? (it wouldn't be a huge difference but since the exception exists let's use it)
Thanks! |
covers container entries debug dumper as per comment on #152