Create initial structure and classes

This commit is contained in:
2017-03-08 11:37:15 +03:00
commit 4984f44d0a
8 changed files with 1587 additions and 0 deletions

View File

@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
namespace Anwinged\Reason\Status;
use Anwinged\Reason\ReasonStatusInterface;
class BooleanStatus implements ReasonStatusInterface
{
/**
* @var bool
*/
private $value;
/**
* @param bool $value
*/
public function __construct(bool $value)
{
$this->value = $value;
}
/**
* @return bool
*/
public function isSuccess(): bool
{
return $this->value;
}
/**
* @return bool
*/
public function isFail(): bool
{
return !$this->value;
}
/**
* @return int
*/
public function getWeight(): int
{
return $this->value ? 0 : 1;
}
}