This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Inject logger instance via constructor #34
Merged
tux-rampage
merged 12 commits into
zendframework:develop
from
tux-rampage:logging-fixes
Jan 26, 2018
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
86b40ea
Change test to constructor injection
tux-rampage d01d106
Remove the use of logger aware trait
tux-rampage bc72b60
Change logger consumption to constructor injection
tux-rampage 5f9bb1f
Revert local changes to .gitignore
tux-rampage c488646
Update changelog
tux-rampage df8b616
Update documentation
tux-rampage 6a5ff77
Rephrase the changelog
tux-rampage f629444
Correct constructor phpdoc
tux-rampage 5304a77
Rephrase changelog and documentation
tux-rampage 814501f
Correct typehint style
tux-rampage 77f8759
Add missing dot after "Nothing"
tux-rampage 2f65872
Revert accidental changes to .gitignore
tux-rampage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,11 +74,10 @@ public function testGeneratorLogsDebugForEachClass() | |
{ | ||
$config = new Config(); | ||
$resolver = new DependencyResolver(new RuntimeDefinition(), $config); | ||
$generator = new InjectorGenerator($config, $resolver); | ||
$logger = $this->prophesize(LoggerInterface::class); | ||
|
||
$generator = new InjectorGenerator($config, $resolver, null, $logger->reveal()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you also change the constructor, or was it already accepting an optional logger? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the test, only. Just commited the code changes ;-) |
||
$generator->setOutputDirectory($this->dir); | ||
$generator->setLogger($logger->reveal()); | ||
$generator->generate([ | ||
TestAsset\B::class | ||
]); | ||
|
@@ -90,11 +89,10 @@ public function testGeneratorLogsErrorWhenFactoryGenerationFailed() | |
{ | ||
$config = new Config(); | ||
$resolver = new DependencyResolver(new RuntimeDefinition(), $config); | ||
$generator = new InjectorGenerator($config, $resolver); | ||
$logger = $this->prophesize(LoggerInterface::class); | ||
$generator = new InjectorGenerator($config, $resolver, null, $logger->reveal()); | ||
|
||
$generator->setOutputDirectory($this->dir); | ||
$generator->setLogger($logger->reveal()); | ||
$generator->generate([ | ||
'Bad.And.Undefined.ClassName' | ||
]); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrase slightly: