-
Notifications
You must be signed in to change notification settings - Fork 4.6k
enhance delegation example #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
In general I think the approach is ok. Needs some formatting changes.
@domnikl - would you like to merge?
More/Delegation/JuniorDeveloper.php
Outdated
@@ -8,4 +8,11 @@ public function writeBadCode(): string | |||
{ | |||
return 'Some junior developer generated code...'; | |||
} | |||
/** |
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.
Since you are changing the file please work on proper formatting. Thanks.
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.
Sure, tnx. Comments was added just to explain reason for change.
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.
@carousel - I mean new line before comments of course :)
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.
Looks good to me. @domnikl ?
More/Delegation/TeamLead.php
Outdated
@@ -21,4 +21,17 @@ public function writeCode(): string | |||
{ | |||
return $this->junior->writeBadCode(); | |||
} | |||
public function writeBadCode(): string |
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.
It needs a space between the methods definitions
/** | ||
* @test | ||
*/ | ||
public function teamLeadCanBlameJuniorForBadCode() |
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.
please use the test in method name convention here instead of using @test
: testTeamLeadCanBlameJuniorForBadCode
@carousel could you please fix the issues in the PR mentioned by @malukenho and me? Then it is ready to get merged. |
sure, working on it |
@carousel merged, thx! |
Hi folks;
I have enhanced delegation pattern example by sending $this object as context (TeamLead) to delegate (Junior)
Cheers