Completed
Push — master ( 73da01...28cf8c )
by Wesley
04:37 queued 01:27
created

StateProviderWithWorkflow::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) 2019, Wesley O. Nichols
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Wesnick\WorkflowBundle\Tests\Fixtures;
13
14
use ApiPlatform\Core\Annotation\ApiResource;
15
use Wesnick\WorkflowBundle\Model\PotentialActionInterface;
16
use Wesnick\WorkflowBundle\Model\PotentialActionsTrait;
17
use Wesnick\WorkflowBundle\Validation\ValidationStateProviderInterface;
18
19
/**
20
 * Class ArticleWithWorkflow.
21
 *
22
 * @author Wesley O. Nichols <[email protected]>
23
 * @ApiResource()
24
 */
25
class StateProviderWithWorkflow implements ValidationStateProviderInterface
26
{
27
    private $discriminator;
28
29
    /**
30
     * StateProviderWithWorkflow constructor.
31
     * @param string $discriminator
32
     */
33
    public function __construct(string $discriminator)
34
    {
35
        $this->discriminator = $discriminator;
36
    }
37
38
39
    public function getGroupSequenceForState(string $state, string $workflowName): array
40
    {
41
        return [
42
            sprintf('%s_%s', $state, $this->discriminator)
43
        ];
44
    }
45
}
46