Renamed function

This commit is contained in:
Kevin Frantz 2019-02-12 16:47:37 +01:00
parent 6347308672
commit 5d4592e27c
12 changed files with 38 additions and 15 deletions

View File

@ -19,7 +19,7 @@ abstract class AbstractAction extends AbstractActionConstructor implements Actio
/**
* @return bool
*/
abstract protected function isValidByForm(): bool;
abstract protected function isValid(): bool;
/**
* Process the routine.
@ -38,7 +38,7 @@ abstract class AbstractAction extends AbstractActionConstructor implements Actio
final public function execute()
{
if ($this->isSecure()) {
if ($this->isValidByForm()) {
if ($this->isValid()) {
return $this->proccess();
}
throw new NotValidByFormException('The requested Entity is not valid!');

View File

@ -37,9 +37,9 @@ final class CreateSourceAction extends AbstractCreateAction
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isValidByForm()
* @see \App\Domain\ActionManagement\AbstractAction::isValid()
*/
protected function isValidByForm(): bool
protected function isValid(): bool
{
return $this->actionService->getCurrentFormBuilder()->getForm()->isValid();
}

View File

@ -24,9 +24,9 @@ final class DeleteAction extends AbstractAction
* @todo Implement!
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isValidByForm()
* @see \App\Domain\ActionManagement\AbstractAction::isValid()
*/
protected function isValidByForm(): bool
protected function isValid(): bool
{
return true;
}

View File

@ -23,9 +23,9 @@ final class ReadAction extends AbstractAction implements ReadActionInterface
* @todo Implement!
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isValidByForm()
* @see \App\Domain\ActionManagement\AbstractAction::isValid()
*/
protected function isValidByForm(): bool
protected function isValid(): bool
{
return true;
}

View File

@ -16,10 +16,20 @@ final class ThreadSourceAction extends AbstractThreadAction
{
}
protected function isValidByForm(): bool
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isValid()
*/
protected function isValid(): bool
{
}
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::proccess()
*/
protected function proccess()
{
}

View File

@ -7,14 +7,29 @@ namespace App\Domain\ActionManagement\Update;
*/
final class UpdateSourceAction extends AbstractUpdateAction
{
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isSecure()
*/
protected function isSecure(): bool
{
}
protected function isValidByForm(): bool
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::isValid()
*/
protected function isValid(): bool
{
}
/**
* {@inheritdoc}
*
* @see \App\Domain\ActionManagement\AbstractAction::proccess()
*/
protected function proccess()
{
}

View File

@ -22,7 +22,7 @@ class RequestedActionFormBuilder implements RequestedActionFormBuilderInterface
private $formClassNameService;
/**
* @param FormFactoryInterface $formFactory
* @param FormFactoryInterface $formFactory
* @param FormClassNameServiceInterface $formClassNameService
*/
public function __construct(FormFactoryInterface $formFactory, FormClassNameServiceInterface $formClassNameService)

View File

@ -4,7 +4,6 @@ namespace App\Domain\FormManagement;
use Symfony\Component\Form\FormBuilderInterface;
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
use FOS\UserBundle\Form\Factory\FormFactory;
use Symfony\Component\Form\FormFactoryInterface;
/**

View File

@ -11,6 +11,7 @@ class SourceType extends AbstractType
{
/**
* @deprecated
*
* @var string
*/
const CLASS_PARAMETER_NAME = 'class';

View File

@ -16,7 +16,6 @@ use App\Domain\SecureManagement\SecureRequestedRightCheckerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use App\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;
use App\Domain\FormManagement\RequestedActionFormBuilderServiceInterface;
use App\Form\Source\PureSourceType;
use Symfony\Component\Form\FormBuilderInterface;
use App\Form\Source\PureSourceTypeInterface;

View File

@ -36,7 +36,7 @@ class AbstractActionTest extends TestCase
return $this->isSecure;
}
protected function isValidByForm(): bool
protected function isValid(): bool
{
return $this->validByForm;
}

View File

@ -37,6 +37,5 @@ class RequestedActionFormBuilderServiceTest extends TestCase
//$this->assertTrue(method_exists($result, 'isValid'));
$this->assertEquals($formBuilder, $result);
$this->assertEquals($entityFormBuilderService->create($requestedAction), $entityFormBuilderService->createByService());
}
}