Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
AnalyseImpactFlow | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
loadStepsConfig | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace App\Domain\AIPD\Form\Flow; |
6 | |
7 | use App\Domain\AIPD\Form\Type\AnalyseImpactType; |
8 | use App\Domain\AIPD\Model\AnalyseImpact; |
9 | use App\Domain\AIPD\Model\CriterePrincipeFondamental; |
10 | use Craue\FormFlowBundle\Form\FormFlow; |
11 | use Craue\FormFlowBundle\Form\FormFlowInterface; |
12 | |
13 | class AnalyseImpactFlow extends FormFlow |
14 | { |
15 | protected $allowDynamicStepNavigation = true; |
16 | |
17 | protected function loadStepsConfig() |
18 | { |
19 | return [ |
20 | [ |
21 | 'label' => 'description', |
22 | 'form_type' => AnalyseImpactType::class, |
23 | 'skip' => function ($estimatedCurrentStepNumber, FormFlowInterface $flow) { |
24 | /** |
25 | * @var AnalyseImpact |
26 | */ |
27 | $aipd = $flow->getFormData(); |
28 | $visible = array_filter($aipd->getCriterePrincipeFondamentaux()->toArray(), function (CriterePrincipeFondamental $critere) { |
29 | return $critere->isVisible(); |
30 | }); |
31 | |
32 | return 0 === count($visible); |
33 | }, |
34 | ], |
35 | [ |
36 | 'label' => 'conformite', |
37 | 'form_type' => AnalyseImpactType::class, |
38 | ], |
39 | [ |
40 | 'label' => 'risques', |
41 | 'form_type' => AnalyseImpactType::class, |
42 | ], |
43 | [ |
44 | 'label' => 'mesures', |
45 | 'form_type' => AnalyseImpactType::class, |
46 | ], |
47 | ]; |
48 | } |
49 | } |