@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @link https://github.com/old-town/old-town-workflow |
|
4 | - * @author Malofeykin Andrey <[email protected]> |
|
5 | - */ |
|
3 | + * @link https://github.com/old-town/old-town-workflow |
|
4 | + * @author Malofeykin Andrey <[email protected]> |
|
5 | + */ |
|
6 | 6 | namespace OldTown\Workflow\PhpUnit\Utils; |
7 | 7 | |
8 | 8 | use OldTown\Workflow\PhpUnit\Test\Paths; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | public function initialize($workflowName, $initialAction, TransientVarsInterface $inputs = null) |
130 | 130 | { |
131 | 131 | try { |
132 | - $initialAction = (integer)$initialAction; |
|
132 | + $initialAction = (integer) $initialAction; |
|
133 | 133 | |
134 | 134 | $wf = $this->getConfiguration()->getWorkflow($workflowName); |
135 | 135 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $theResult = null; |
305 | 305 | |
306 | 306 | |
307 | - $currentStepId = null !== $step ? $step->getStepId() : -1; |
|
307 | + $currentStepId = null !== $step ? $step->getStepId() : -1; |
|
308 | 308 | foreach ($conditionalResults as $conditionalResult) { |
309 | 309 | if ($this->passesConditionsWithType(null, $conditionalResult->getConditions(), $transientVars, $ps, $currentStepId)) { |
310 | 310 | $theResult = $conditionalResult; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | |
325 | - if (null === $theResult) { |
|
325 | + if (null === $theResult) { |
|
326 | 326 | $theResult = $action->getUnconditionalResult(); |
327 | 327 | $this->verifyInputs($entry, $theResult->getValidators(), $transientVars, $ps); |
328 | 328 | $extraPreFunctions = $theResult->getPreFunctions(); |
@@ -710,15 +710,15 @@ discard block |
||
710 | 710 | |
711 | 711 | if (null !== $owner) { |
712 | 712 | $o = $variableResolver->translateVariables($owner, $transientVars, $ps); |
713 | - $owner = null !== $o ? (string)$o : null; |
|
713 | + $owner = null !== $o ? (string) $o : null; |
|
714 | 714 | } |
715 | 715 | |
716 | 716 | |
717 | 717 | $oldStatus = $theResult->getOldStatus(); |
718 | - $oldStatus = (string)$variableResolver->translateVariables($oldStatus, $transientVars, $ps); |
|
718 | + $oldStatus = (string) $variableResolver->translateVariables($oldStatus, $transientVars, $ps); |
|
719 | 719 | |
720 | 720 | $status = $theResult->getStatus(); |
721 | - $status = (string)$variableResolver->translateVariables($status, $transientVars, $ps); |
|
721 | + $status = (string) $variableResolver->translateVariables($status, $transientVars, $ps); |
|
722 | 722 | |
723 | 723 | |
724 | 724 | if (null !== $currentStep) { |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | $startDate = new DateTime(); |
730 | 730 | $dueDate = null; |
731 | 731 | |
732 | - $theResultDueDate = (string)$theResult->getDueDate(); |
|
732 | + $theResultDueDate = (string) $theResult->getDueDate(); |
|
733 | 733 | $theResultDueDate = trim($theResultDueDate); |
734 | 734 | if (strlen($theResultDueDate) > 0) { |
735 | 735 | $dueDateObject = $variableResolver->translateVariables($theResultDueDate, $transientVars, $ps); |
@@ -748,15 +748,15 @@ discard block |
||
748 | 748 | } |
749 | 749 | |
750 | 750 | $newStep = $store->createCurrentStep($entry->getId(), $nextStep, $owner, $startDate, $dueDate, $status, $previousIds); |
751 | - $transientVars['createdStep'] = $newStep; |
|
751 | + $transientVars['createdStep'] = $newStep; |
|
752 | 752 | |
753 | 753 | if (null === $currentStep && 0 === count($previousIds)) { |
754 | 754 | $currentSteps = []; |
755 | 755 | $currentSteps[] = $newStep; |
756 | - $transientVars['currentSteps'] = $currentSteps; |
|
756 | + $transientVars['currentSteps'] = $currentSteps; |
|
757 | 757 | } |
758 | 758 | |
759 | - if (! $transientVars->offsetExists('descriptor')) { |
|
759 | + if (!$transientVars->offsetExists('descriptor')) { |
|
760 | 760 | $errMsg = 'Ошибка при получение дескриптора workflow из transientVars'; |
761 | 761 | throw new InternalWorkflowException($errMsg); |
762 | 762 | } |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | */ |
815 | 815 | public function doAction($entryId, $actionId, TransientVarsInterface $inputs = null) |
816 | 816 | { |
817 | - $actionId = (integer)$actionId; |
|
817 | + $actionId = (integer) $actionId; |
|
818 | 818 | if (null === $inputs) { |
819 | 819 | $inputs = $this->transientVarsFactory(); |
820 | 820 | } |
@@ -1264,7 +1264,7 @@ discard block |
||
1264 | 1264 | } |
1265 | 1265 | |
1266 | 1266 | |
1267 | - $result = (boolean)$result; |
|
1267 | + $result = (boolean) $result; |
|
1268 | 1268 | |
1269 | 1269 | return $result; |
1270 | 1270 | } |
@@ -1654,9 +1654,9 @@ discard block |
||
1654 | 1654 | return $l; |
1655 | 1655 | } |
1656 | 1656 | |
1657 | - $actions = $s->getActions(); |
|
1657 | + $actions = $s->getActions(); |
|
1658 | 1658 | |
1659 | - if (null === $actions || 0 === $actions->count()) { |
|
1659 | + if (null === $actions || 0 === $actions->count()) { |
|
1660 | 1660 | return $l; |
1661 | 1661 | } |
1662 | 1662 | |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | */ |
1970 | 1970 | public function setDefaultTypeResolverClass($defaultTypeResolverClass) |
1971 | 1971 | { |
1972 | - $this->defaultTypeResolverClass = (string)$defaultTypeResolverClass; |
|
1972 | + $this->defaultTypeResolverClass = (string) $defaultTypeResolverClass; |
|
1973 | 1973 | |
1974 | 1974 | return $this; |
1975 | 1975 | } |
@@ -2085,7 +2085,7 @@ discard block |
||
2085 | 2085 | } |
2086 | 2086 | |
2087 | 2087 | if (-1 !== $currentStepId) { |
2088 | - $stepId = array_key_exists('stepId', $args) ? (integer)$args['stepId'] : null; |
|
2088 | + $stepId = array_key_exists('stepId', $args) ? (integer) $args['stepId'] : null; |
|
2089 | 2089 | |
2090 | 2090 | if (null !== $stepId && -1 === $stepId) { |
2091 | 2091 | $args['stepId'] = $currentStepId; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * Переход между двумя статусами |
273 | 273 | * |
274 | 274 | * @param WorkflowEntryInterface $entry |
275 | - * @param SplObjectStorage|StepInterface[] $currentSteps |
|
275 | + * @param SplObjectStorage $currentSteps |
|
276 | 276 | * @param WorkflowStoreInterface $store |
277 | 277 | * @param WorkflowDescriptor $wf |
278 | 278 | * @param ActionDescriptor $action |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | |
525 | 525 | |
526 | 526 | /** |
527 | - * @param $id |
|
527 | + * @param integer $id |
|
528 | 528 | * @param TransientVarsInterface $inputs |
529 | 529 | * |
530 | 530 | * @return array |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | |
904 | 904 | /** |
905 | 905 | * @param ActionDescriptor $action |
906 | - * @param $id |
|
906 | + * @param integer $id |
|
907 | 907 | * |
908 | 908 | * @return void |
909 | 909 | * |
@@ -1042,8 +1042,8 @@ discard block |
||
1042 | 1042 | /** |
1043 | 1043 | * Получение шагов информации о шагах процесса workflow |
1044 | 1044 | * |
1045 | - * @param $entryId |
|
1046 | - * @param $type |
|
1045 | + * @param integer $entryId |
|
1046 | + * @param string $type |
|
1047 | 1047 | * |
1048 | 1048 | * @return Spi\StepInterface[]|SplObjectStorage |
1049 | 1049 | * |
@@ -1227,7 +1227,7 @@ discard block |
||
1227 | 1227 | * |
1228 | 1228 | * @param WorkflowDescriptor $wfDesc |
1229 | 1229 | * @param integer $actionId |
1230 | - * @param StepInterface[]|SplObjectStorage $currentSteps |
|
1230 | + * @param SplObjectStorage $currentSteps |
|
1231 | 1231 | * @param TransientVarsInterface $transientVars |
1232 | 1232 | * @param PropertySetInterface $ps |
1233 | 1233 | * |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @link https://github.com/old-town/old-town-workflow |
|
4 | - * @author Malofeykin Andrey <[email protected]> |
|
5 | - */ |
|
3 | + * @link https://github.com/old-town/old-town-workflow |
|
4 | + * @author Malofeykin Andrey <[email protected]> |
|
5 | + */ |
|
6 | 6 | namespace OldTown\Workflow\Spi; |
7 | 7 | |
8 | 8 | use OldTown\PropertySet\PropertySetInterface; |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | interface WorkflowStoreInterface |
19 | 19 | { |
20 | 20 | /** |
21 | - * Устанавливает состояние для текущего workflow |
|
22 | - * |
|
23 | - * @param integer $entryId id workflow |
|
24 | - * @param integer $state id состояния в которое переводится сущность workflow |
|
25 | - * @return void |
|
26 | - */ |
|
21 | + * Устанавливает состояние для текущего workflow |
|
22 | + * |
|
23 | + * @param integer $entryId id workflow |
|
24 | + * @param integer $state id состояния в которое переводится сущность workflow |
|
25 | + * @return void |
|
26 | + */ |
|
27 | 27 | public function setEntryState($entryId, $state); |
28 | 28 | |
29 | 29 | /** |