mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 05:51:46 +02:00
cs
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\Builder;
|
||||
|
||||
/**
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\Builder;
|
||||
|
||||
/**
|
||||
@@ -20,14 +16,28 @@ namespace DesignPatterns\Builder;
|
||||
*/
|
||||
interface Builder
|
||||
{
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function createVehicle();
|
||||
|
||||
function createVehicle();
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function addWheel();
|
||||
|
||||
function addWheel();
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function addEngine();
|
||||
|
||||
function addEngine();
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function addDoors();
|
||||
|
||||
function addDoors();
|
||||
|
||||
function getVehicle();
|
||||
}
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getVehicle();
|
||||
}
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\Builder;
|
||||
|
||||
/**
|
||||
@@ -42,5 +38,4 @@ class CarBuilder implements Builder
|
||||
{
|
||||
return $this->car;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\Builder;
|
||||
|
||||
/**
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\Builder\Parts;
|
||||
|
||||
/**
|
||||
@@ -11,5 +7,5 @@ namespace DesignPatterns\Builder\Parts;
|
||||
*/
|
||||
class Bike extends Vehicle
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\Builder\Parts;
|
||||
|
||||
/**
|
||||
@@ -11,5 +7,5 @@ namespace DesignPatterns\Builder\Parts;
|
||||
*/
|
||||
class Car extends Vehicle
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace DesignPatterns\Builder\Parts;
|
||||
|
||||
/**
|
||||
* Class Door
|
||||
*/
|
||||
class Door
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace DesignPatterns\Builder\Parts;
|
||||
|
||||
/**
|
||||
* Class Engine
|
||||
*/
|
||||
class Engine
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\Builder\Parts;
|
||||
|
||||
/**
|
||||
@@ -11,12 +7,17 @@ namespace DesignPatterns\Builder\Parts;
|
||||
*/
|
||||
abstract class Vehicle
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $data;
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setPart($key, $value)
|
||||
{
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user