Optimized Actions, Tests and renamed LIST to THREAD out of php incompatibility reasons

This commit is contained in:
Kevin Frantz
2019-01-27 20:28:31 +01:00
parent c2d0c5f60d
commit 81dd63c152
12 changed files with 95 additions and 15 deletions

View File

@@ -11,13 +11,13 @@ use App\DBAL\Types\Meta\Right\CRUDType;
*/
final class ActionType extends CRUDType
{
const LIST = 'list';
const THREAD = 'thread';
protected static $choices = [
parent::CREATE => 'create',
parent::READ => 'read',
parent::UPDATE => 'update',
parent::DELETE => 'delete',
self::LIST => 'list',
self::THREAD => 'thread',
];
}

View File

@@ -7,6 +7,15 @@ use App\Domain\ActionManagement\AbstractAction;
/**
* @author kevinfrantz
*/
abstract class AbstractCreateAction extends AbstractAction
abstract class AbstractCreateAction extends AbstractAction implements CreateActionInterface
{
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isSecure()
*/
protected function isSecure(): bool
{
return $this->actionService->isRequestedActionSecure();
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Domain\ActionManagement\Create;
use App\Domain\ActionManagement\ActionInterface;
/**
* @author kevinfrantz
*/
interface CreateActionInterface extends ActionInterface
{
}

View File

@@ -7,10 +7,6 @@ namespace App\Domain\ActionManagement\Create;
*/
final class CreateSourceAction extends AbstractCreateAction
{
protected function isSecure(): bool
{
}
protected function isValidByForm(): bool
{
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Domain\ActionManagement\Thread;
use App\Domain\ActionManagement\AbstractAction;
/**
* @author kevinfrantz
*/
abstract class AbstractThreadAction extends AbstractAction
{
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Domain\ActionManagement\Thread;
/**
* @author kevinfrantz
*/
final class ThreadSourceAction extends AbstractThreadAction
{
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isSecure()
*/
protected function isSecure(): bool
{
}
protected function isValidByForm(): bool
{
}
protected function proccess()
{
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Domain\ActionManagement\Update;
use App\Domain\ActionManagement\AbstractAction;
/**
* @author kevinfrantz
*/
abstract class AbstractUpdateAction extends AbstractAction
{
}

View File

@@ -2,6 +2,20 @@
namespace App\Domain\ActionManagement\Update;
class UpdateSourceAction
/**
* @author kevinfrantz
*/
final class UpdateSourceAction extends AbstractUpdateAction
{
protected function isSecure(): bool
{
}
protected function isValidByForm(): bool
{
}
protected function proccess()
{
}
}

View File

@@ -19,7 +19,7 @@ final class LayerActionMap implements LayerActionMapInterface
ActionType::CREATE,
ActionType::UPDATE,
ActionType::DELETE,
ActionType::LIST,
ActionType::THREAD,
],
];

View File

@@ -23,7 +23,7 @@ class RequestedAction extends RequestedUser implements RequestedActionInterface
* @var array Containes the mapping of non standard actions to a crud
*/
const ACTION_CRUD_MAP = [
ActionType::LIST => CRUDType::READ,
ActionType::THREAD => CRUDType::READ,
];
/**