mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-26 06:19:20 +02:00
20 lines
406 B
PHP
20 lines
406 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\More\Delegation;
|
|
|
|
class JuniorDeveloper
|
|
{
|
|
public function writeBadCode(): string
|
|
{
|
|
return 'Some junior developer generated code...';
|
|
}
|
|
|
|
/**
|
|
* Junior is authorized to call method on TeamLead (real delegation)
|
|
*/
|
|
public function writeReallyBadCode(TeamLead $teamLead): string
|
|
{
|
|
return $teamLead->writeReallyBadCode();
|
|
}
|
|
}
|