File tree 3 files changed +29
-28
lines changed
3 files changed +29
-28
lines changed Original file line number Diff line number Diff line change 6
6
* Class JuniorDeveloper
7
7
* @package DesignPatterns\Delegation
8
8
*/
9
- class JuniorDeveloper {
10
- public function writeBadCode ()
11
- {
12
- return "Some junior developer generated code... " ;
13
- }
9
+ class JuniorDeveloper
10
+ {
11
+ public function writeBadCode ()
12
+ {
13
+ return "Some junior developer generated code... " ;
14
+ }
14
15
}
Original file line number Diff line number Diff line change 9
9
*/
10
10
class TeamLead
11
11
{
12
- /** @var JuniorDeveloper */
13
- protected $ slave ;
12
+ /** @var JuniorDeveloper */
13
+ protected $ slave ;
14
14
15
- /**
16
- * Give junior developer into teamlead submission
17
- * @param JuniorDeveloper $junior
18
- */
19
- public function __construct (JuniorDeveloper $ junior )
20
- {
21
- $ this ->slave = $ junior ;
22
- }
15
+ /**
16
+ * Give junior developer into teamlead submission
17
+ * @param JuniorDeveloper $junior
18
+ */
19
+ public function __construct (JuniorDeveloper $ junior )
20
+ {
21
+ $ this ->slave = $ junior ;
22
+ }
23
23
24
- /**
25
- * TeamLead drink coffee, junior work
26
- * @return mixed
27
- */
28
- public function writeCode ()
29
- {
30
- return $ this ->slave ->writeBadCode ();
31
- }
24
+ /**
25
+ * TeamLead drink coffee, junior work
26
+ * @return mixed
27
+ */
28
+ public function writeCode ()
29
+ {
30
+ return $ this ->slave ->writeBadCode ();
31
+ }
32
32
}
Original file line number Diff line number Diff line change 9
9
*/
10
10
class DelegationTest extends \PHPUnit_Framework_TestCase
11
11
{
12
- public function testHowTeamLeadWriteCode ()
13
- {
12
+ public function testHowTeamLeadWriteCode ()
13
+ {
14
14
$ junior = new Delegation \JuniorDeveloper ();
15
- $ teamLead = new Delegation \TeamLead ($ junior );
16
- $ this ->assertEquals ($ junior ->writeBadCode (), $ teamLead ->writeCode ());
17
- }
15
+ $ teamLead = new Delegation \TeamLead ($ junior );
16
+ $ this ->assertEquals ($ junior ->writeBadCode (), $ teamLead ->writeCode ());
17
+ }
18
18
}
You can’t perform that action at this time.
0 commit comments