mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-01 12:40:11 +02:00
Fix codesniffer errors
This commit is contained in:
@@ -6,9 +6,10 @@ namespace DesignPatterns\Delegation;
|
|||||||
* Class JuniorDeveloper
|
* Class JuniorDeveloper
|
||||||
* @package DesignPatterns\Delegation
|
* @package DesignPatterns\Delegation
|
||||||
*/
|
*/
|
||||||
class JuniorDeveloper {
|
class JuniorDeveloper
|
||||||
public function writeBadCode()
|
{
|
||||||
{
|
public function writeBadCode()
|
||||||
return "Some junior developer generated code...";
|
{
|
||||||
}
|
return "Some junior developer generated code...";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,24 +9,24 @@ namespace DesignPatterns\Delegation;
|
|||||||
*/
|
*/
|
||||||
class TeamLead
|
class TeamLead
|
||||||
{
|
{
|
||||||
/** @var JuniorDeveloper */
|
/** @var JuniorDeveloper */
|
||||||
protected $slave;
|
protected $slave;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Give junior developer into teamlead submission
|
* Give junior developer into teamlead submission
|
||||||
* @param JuniorDeveloper $junior
|
* @param JuniorDeveloper $junior
|
||||||
*/
|
*/
|
||||||
public function __construct(JuniorDeveloper $junior)
|
public function __construct(JuniorDeveloper $junior)
|
||||||
{
|
{
|
||||||
$this->slave = $junior;
|
$this->slave = $junior;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TeamLead drink coffee, junior work
|
* TeamLead drink coffee, junior work
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function writeCode()
|
public function writeCode()
|
||||||
{
|
{
|
||||||
return $this->slave->writeBadCode();
|
return $this->slave->writeBadCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,10 +9,10 @@ use DesignPatterns\Delegation;
|
|||||||
*/
|
*/
|
||||||
class DelegationTest extends \PHPUnit_Framework_TestCase
|
class DelegationTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function testHowTeamLeadWriteCode()
|
public function testHowTeamLeadWriteCode()
|
||||||
{
|
{
|
||||||
$junior = new Delegation\JuniorDeveloper();
|
$junior = new Delegation\JuniorDeveloper();
|
||||||
$teamLead = new Delegation\TeamLead($junior);
|
$teamLead = new Delegation\TeamLead($junior);
|
||||||
$this->assertEquals($junior->writeBadCode(), $teamLead->writeCode());
|
$this->assertEquals($junior->writeBadCode(), $teamLead->writeCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user