for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* (c) 2019, Wesley O. Nichols
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Wesnick\WorkflowBundle\Validation;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\Workflow;
/**
* Class ValidationStateProviderStrategy.
* @author Wesley O. Nichols <[email protected]>
class ValidationStateProviderStrategy implements WorkflowValidationStrategyInterface
{
* {@inheritdoc}
public function getValidationGroupsForSubject($subject, Workflow $workflow, Transition $transition): array
$groups = [];
if ($subject instanceof ValidationStateProviderInterface) {
foreach ($transition->getTos() as $state) {
$groups = array_merge($groups, $subject->getGroupSequenceForState($state, $workflow->getName()));
}
return $groups;