mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-24 08:41:22 +02:00
remove Interface-Suffix
This commit is contained in:
@@ -3,13 +3,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Structural\Facade;
|
||||
|
||||
interface BiosInterface
|
||||
interface Bios
|
||||
{
|
||||
public function execute();
|
||||
|
||||
public function waitForKeyPress();
|
||||
|
||||
public function launch(OsInterface $os);
|
||||
public function launch(OperatingSystem $os);
|
||||
|
||||
public function powerDown();
|
||||
}
|
@@ -6,20 +6,20 @@ namespace DesignPatterns\Structural\Facade;
|
||||
class Facade
|
||||
{
|
||||
/**
|
||||
* @var OsInterface
|
||||
* @var OperatingSystem
|
||||
*/
|
||||
private $os;
|
||||
|
||||
/**
|
||||
* @var BiosInterface
|
||||
* @var Bios
|
||||
*/
|
||||
private $bios;
|
||||
|
||||
/**
|
||||
* @param BiosInterface $bios
|
||||
* @param OsInterface $os
|
||||
* @param Bios $bios
|
||||
* @param OperatingSystem $os
|
||||
*/
|
||||
public function __construct(BiosInterface $bios, OsInterface $os)
|
||||
public function __construct(Bios $bios, OperatingSystem $os)
|
||||
{
|
||||
$this->bios = $bios;
|
||||
$this->os = $os;
|
||||
|
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace DesignPatterns\Structural\Facade;
|
||||
|
||||
interface OsInterface
|
||||
interface OperatingSystem
|
||||
{
|
||||
public function halt();
|
||||
|
@@ -41,15 +41,15 @@ Facade.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
OsInterface.php
|
||||
OperatingSystem.php
|
||||
|
||||
.. literalinclude:: OsInterface.php
|
||||
.. literalinclude:: OperatingSystem.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
BiosInterface.php
|
||||
Bios.php
|
||||
|
||||
.. literalinclude:: BiosInterface.php
|
||||
.. literalinclude:: Bios.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
|
@@ -4,20 +4,20 @@ declare(strict_types=1);
|
||||
namespace DesignPatterns\Structural\Facade\Tests;
|
||||
|
||||
use DesignPatterns\Structural\Facade\Facade;
|
||||
use DesignPatterns\Structural\Facade\OsInterface;
|
||||
use DesignPatterns\Structural\Facade\OperatingSystem;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FacadeTest extends TestCase
|
||||
{
|
||||
public function testComputerOn()
|
||||
{
|
||||
/** @var OsInterface|\PHPUnit_Framework_MockObject_MockObject $os */
|
||||
$os = $this->createMock('DesignPatterns\Structural\Facade\OsInterface');
|
||||
/** @var OperatingSystem|\PHPUnit_Framework_MockObject_MockObject $os */
|
||||
$os = $this->createMock('DesignPatterns\Structural\Facade\OperatingSystem');
|
||||
|
||||
$os->method('getName')
|
||||
->will($this->returnValue('Linux'));
|
||||
|
||||
$bios = $this->getMockBuilder('DesignPatterns\Structural\Facade\BiosInterface')
|
||||
$bios = $this->getMockBuilder('DesignPatterns\Structural\Facade\Bios')
|
||||
->setMethods(['launch', 'execute', 'waitForKeyPress'])
|
||||
->disableAutoload()
|
||||
->getMock();
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 39 KiB |
Reference in New Issue
Block a user