mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Implemented new law draft
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Logic\Operation;
|
||||
|
||||
use App\Logic\Result\ResultInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface OperandInterface
|
||||
{
|
||||
/**
|
||||
* Returns the result of the Operation
|
||||
* Returns the result of the Operation.
|
||||
*
|
||||
* @return ResultInterface
|
||||
*/
|
||||
public function getResult():ResultInterface;
|
||||
public function getResult(): ResultInterface;
|
||||
}
|
||||
|
||||
|
@@ -1,26 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Logic\Operation;
|
||||
|
||||
use App\Logic\Result\ResultInterface;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface OperationInterface extends OperandInterface
|
||||
{
|
||||
/**
|
||||
* Sets the Operators the operation has to deal with
|
||||
* Sets the Operators the operation has to deal with.
|
||||
*
|
||||
* @param ArrayCollection $operands | OperandInterface[]
|
||||
*/
|
||||
public function setOperators(ArrayCollection $operands):void;
|
||||
|
||||
/**
|
||||
* Process the logic
|
||||
*/
|
||||
public function process():void;
|
||||
}
|
||||
public function setOperators(ArrayCollection $operands): void;
|
||||
|
||||
/**
|
||||
* Process the logic.
|
||||
*/
|
||||
public function process(): void;
|
||||
}
|
||||
|
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Logic\Result;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class Result implements ResultInterface
|
||||
{
|
||||
@@ -12,9 +11,10 @@ class Result implements ResultInterface
|
||||
* @var bool
|
||||
*/
|
||||
protected $bool;
|
||||
|
||||
|
||||
/**
|
||||
* The concrete result value
|
||||
* The concrete result value.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $value;
|
||||
@@ -28,7 +28,7 @@ class Result implements ResultInterface
|
||||
{
|
||||
return $this->bool;
|
||||
}
|
||||
|
||||
|
||||
public function setBool(bool $bool): void
|
||||
{
|
||||
$this->bool = $bool;
|
||||
@@ -38,12 +38,10 @@ class Result implements ResultInterface
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
public function setAll($value): void
|
||||
{
|
||||
$this->bool = (bool)$value;
|
||||
$this->bool = (bool) $value;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,39 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Logic\Result;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface ResultInterface
|
||||
interface ResultInterface
|
||||
{
|
||||
/**
|
||||
* Returns the Result as a string
|
||||
* Returns the Result as a string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
//public function __toString():string;
|
||||
|
||||
|
||||
/**
|
||||
* Returns if the result is true
|
||||
* Returns if the result is true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getBool():bool;
|
||||
|
||||
public function setBool(bool $bool):void;
|
||||
|
||||
public function getBool(): bool;
|
||||
|
||||
public function setBool(bool $bool): void;
|
||||
|
||||
/**
|
||||
* Returns the concrete result value
|
||||
* Returns the concrete result value.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public function getValue();
|
||||
|
||||
public function setValue($value):void;
|
||||
|
||||
|
||||
public function setValue($value): void;
|
||||
|
||||
/**
|
||||
* Sets bool and value attribut
|
||||
* Sets bool and value attribut.
|
||||
*
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setAll($value):void;
|
||||
public function setAll($value): void;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user