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