mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized RequestManagement and pushed code coverage for it to 100%
This commit is contained in:
@@ -5,6 +5,8 @@ namespace App\Domain\LayerManagement;
|
||||
use App\DBAL\Types\Meta\Right\LayerType;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
use App\Exception\NotSetException;
|
||||
use App\Entity\Meta\Law;
|
||||
use App\Entity\Meta\Right;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -13,6 +15,8 @@ final class LayerClassMap implements LayerClassMapInterface
|
||||
{
|
||||
const LAYER_CLASS_MAP = [
|
||||
LayerType::SOURCE => AbstractSource::class,
|
||||
LayerType::LAW => Law::class,
|
||||
LayerType::RIGHT => Right::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@@ -122,6 +122,6 @@ abstract class AbstractRequestedRightFacade implements RequestedRightInterface
|
||||
*/
|
||||
public function hasRequestedEntity(): bool
|
||||
{
|
||||
$this->requestedRight->hasRequestedEntity();
|
||||
return $this->requestedRight->hasRequestedEntity();
|
||||
}
|
||||
}
|
||||
|
@@ -7,7 +7,6 @@ use App\Attribut\CrudAttribut;
|
||||
use App\Attribut\LayerAttribut;
|
||||
use App\Attribut\RecieverAttribut;
|
||||
use App\Exception\PreconditionFailedException;
|
||||
use App\Exception\NotSetException;
|
||||
use App\Domain\RequestManagement\Entity\RequestedEntityInterface;
|
||||
use App\Attribut\RequestedEntityAttribut;
|
||||
use App\Entity\Meta\MetaInterface;
|
||||
@@ -68,19 +67,10 @@ class RequestedRight implements RequestedRightInterface
|
||||
{
|
||||
$this->validateRequestedEntity();
|
||||
$this->loadSource();
|
||||
$this->validateLoad();
|
||||
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
private function validateLoad(): void
|
||||
{
|
||||
if ($this->source) {
|
||||
return;
|
||||
}
|
||||
throw new NotSetException('The Requested Source couldn\'t be found!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Overriding is neccessary to declare the correct relation.
|
||||
*
|
||||
|
Reference in New Issue
Block a user