mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-23 17:22:41 +01:00
33 lines
629 B
PHP
33 lines
629 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\More\Delegation;
|
|
|
|
/**
|
|
* Class TeamLead
|
|
* @package DesignPatterns\Delegation
|
|
* The `TeamLead` class, he delegate work to `JuniorDeveloper`
|
|
*/
|
|
class TeamLead
|
|
{
|
|
/** @var JuniorDeveloper */
|
|
protected $slave;
|
|
|
|
/**
|
|
* Give junior developer into teamlead submission
|
|
* @param JuniorDeveloper $junior
|
|
*/
|
|
public function __construct(JuniorDeveloper $junior)
|
|
{
|
|
$this->slave = $junior;
|
|
}
|
|
|
|
/**
|
|
* TeamLead drink coffee, junior work
|
|
* @return mixed
|
|
*/
|
|
public function writeCode()
|
|
{
|
|
return $this->slave->writeBadCode();
|
|
}
|
|
}
|