for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Date: 23.03.18
* Time: 12:56
*
* @author : Korotkov Danila <[email protected]>
* @copyright Copyright (c) 2018, Korotkov Danila
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3.0
*/
namespace Creational\Builder;
* Class Computer
* @package Creational\Builder
class Computer
{
* @var string
protected $software;
* @var int
protected $hdd = 500;
protected $ram = 4096;
protected $gpu = 2048;
protected $cpu = 2000;
* Computer constructor.
* @param string $software
public function __construct(string $software)
$this->software = $software;
}
* @param null $key
$key
null
* @return $this
public function increaseHdd($key = null)
$this->hdd = isset($key) ? $this->hdd * $key : $this->hdd + 500;
return $this;
public function increaseRam($key = null)
$this->ram = isset($key) ? $this->ram * $key : $this->ram + 4096;
public function overclockGpu($key = null)
$this->gpu = isset($key) ? $this->gpu * $key : $this->gpu + 1024;
public function overclockCpu($key = null)
$this->cpu = isset($key) ? $this->cpu + $key : $this->cpu + 500;
public function changeSoftware(string $software)
* @return mixed
public function getSoftware(): string
return $this->software;
* @return int
public function getHdd(): int
return $this->hdd;
public function getRam(): int
return $this->ram;
public function getGpu(): int
return $this->gpu;
public function getCpu(): int
return $this->cpu;