@@ -25,13 +25,13 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @throws \OldTown\Workflow\ZF2\Service\TypeResolver\ServiceTypeResolver\Exception\RuntimeException |
| 27 | 27 | */ |
| 28 | - public function passesCondition(TransientVarsInterface $transientVars, array $args = [], PropertySetInterface $ps) |
|
| 28 | + public function passesCondition(TransientVarsInterface $transientVars, array $args = [ ], PropertySetInterface $ps) |
|
| 29 | 29 | { |
| 30 | 30 | $serviceUtil = $this->getServiceUtil(); |
| 31 | 31 | $service = $this->getService(); |
| 32 | 32 | $metadata = $this->getMetadata(); |
| 33 | 33 | $listArguments = $serviceUtil->buildArgumentsForService($service, $metadata, $transientVars, $args); |
| 34 | 34 | |
| 35 | - return (boolean)call_user_func_array($service, $listArguments); |
|
| 35 | + return (boolean) call_user_func_array($service, $listArguments); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @throws \OldTown\Workflow\ZF2\Service\TypeResolver\ServiceTypeResolver\Exception\RuntimeException |
| 30 | 30 | */ |
| 31 | - public function registerVariable(WorkflowContextInterface $context, WorkflowEntryInterface $entry, array $args = [], PropertySetInterface $ps) |
|
| 31 | + public function registerVariable(WorkflowContextInterface $context, WorkflowEntryInterface $entry, array $args = [ ], PropertySetInterface $ps) |
|
| 32 | 32 | { |
| 33 | 33 | $serviceUtil = $this->getServiceUtil(); |
| 34 | 34 | $service = $this->getService(); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @throws \OldTown\Workflow\ZF2\Service\TypeResolver\ServiceTypeResolver\Exception\RuntimeException |
| 25 | 25 | */ |
| 26 | - public function validate(TransientVarsInterface $transientVars, array $args = [], PropertySetInterface $ps) |
|
| 26 | + public function validate(TransientVarsInterface $transientVars, array $args = [ ], PropertySetInterface $ps) |
|
| 27 | 27 | { |
| 28 | 28 | $serviceUtil = $this->getServiceUtil(); |
| 29 | 29 | $service = $this->getService(); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @throws \OldTown\Workflow\ZF2\Service\TypeResolver\ServiceTypeResolver\Exception\InvalidFunctionResultException |
| 28 | 28 | * @throws \OldTown\Workflow\ZF2\Service\TypeResolver\ServiceTypeResolver\Exception\InvalidMapResultException |
| 29 | 29 | */ |
| 30 | - public function execute(TransientVarsInterface $transientVars, array $args = [], PropertySetInterface $ps) |
|
| 30 | + public function execute(TransientVarsInterface $transientVars, array $args = [ ], PropertySetInterface $ps) |
|
| 31 | 31 | { |
| 32 | 32 | $serviceUtil = $this->getServiceUtil(); |
| 33 | 33 | $service = $this->getService(); |
@@ -55,19 +55,19 @@ discard block |
||
| 55 | 55 | $errMsg = sprintf('Data already exist named %s', $to); |
| 56 | 56 | throw new Exception\InvalidMapResultException($errMsg); |
| 57 | 57 | } |
| 58 | - $transientVars[$to] = $value; |
|
| 58 | + $transientVars[ $to ] = $value; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $resultVariableName = $metadata->getResultVariableName(); |
| 63 | 63 | if (null !== $resultVariableName && array_key_exists($resultVariableName, $args)) { |
| 64 | - $resultVariableKey = $args[$resultVariableName]; |
|
| 64 | + $resultVariableKey = $args[ $resultVariableName ]; |
|
| 65 | 65 | |
| 66 | 66 | if ($transientVars->offsetExists($resultVariableKey) && false === $metadata->isAllowOverrideResult()) { |
| 67 | 67 | $errMsg = sprintf('Data already exist named %s', $resultVariableKey); |
| 68 | 68 | throw new Exception\InvalidMapResultException($errMsg); |
| 69 | 69 | } |
| 70 | - $transientVars[$resultVariableKey] = $result; |
|
| 70 | + $transientVars[ $resultVariableKey ] = $result; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | */ |
| 131 | 131 | public function setServiceUtilClassName($serviceUtilClassName) |
| 132 | 132 | { |
| 133 | - $this->serviceUtilClassName = (string)$serviceUtilClassName; |
|
| 133 | + $this->serviceUtilClassName = (string) $serviceUtilClassName; |
|
| 134 | 134 | $this->serviceUtil = null; |
| 135 | 135 | |
| 136 | 136 | return $this; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -33,5 +33,5 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @return array |
| 35 | 35 | */ |
| 36 | - public function buildArgumentsForService(callable $service, MetadataInterface $metadata, TransientVarsInterface $transientVars, array $args = []); |
|
| 36 | + public function buildArgumentsForService(callable $service, MetadataInterface $metadata, TransientVarsInterface $transientVars, array $args = [ ]); |
|
| 37 | 37 | } |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | /** |
| 20 | 20 | * @var array |
| 21 | 21 | */ |
| 22 | - protected static $listArgumentForMethodCache = []; |
|
| 22 | + protected static $listArgumentForMethodCache = [ ]; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * @param callable $service |
@@ -54,17 +54,17 @@ discard block |
||
| 54 | 54 | $key = get_class($serviceObject) . '--' . $serviceMethod; |
| 55 | 55 | |
| 56 | 56 | if (array_key_exists($key, static::$listArgumentForMethodCache)) { |
| 57 | - return static::$listArgumentForMethodCache[$key]; |
|
| 57 | + return static::$listArgumentForMethodCache[ $key ]; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $r = new ReflectionObject($serviceObject); |
| 61 | 61 | $rParameters = $r->getMethod($serviceMethod)->getParameters(); |
| 62 | 62 | |
| 63 | - $arguments = []; |
|
| 63 | + $arguments = [ ]; |
|
| 64 | 64 | foreach ($rParameters as $rParameter) { |
| 65 | 65 | $position = $rParameter->getPosition(); |
| 66 | 66 | |
| 67 | - $arguments[$position] = [ |
|
| 67 | + $arguments[ $position ] = [ |
|
| 68 | 68 | 'name' => $rParameter->getName(), |
| 69 | 69 | 'defaultValue' => $rParameter->isDefaultValueAvailable() ? $rParameter->getDefaultValue() : null |
| 70 | 70 | ]; |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | ksort($arguments, SORT_NUMERIC); |
| 74 | 74 | |
| 75 | - $listArgument = []; |
|
| 75 | + $listArgument = [ ]; |
|
| 76 | 76 | foreach ($arguments as $argument) { |
| 77 | - $listArgument[$argument['name']] = $argument['defaultValue']; |
|
| 77 | + $listArgument[ $argument[ 'name' ] ] = $argument[ 'defaultValue' ]; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | return $listArgument; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @throws Exception\FunctionArgumentNotFoundException |
| 95 | 95 | * @throws Exception\ArgumentNotFoundInTransientVarsException |
| 96 | 96 | */ |
| 97 | - public function buildArgumentsForService(callable $service, MetadataInterface $metadata, TransientVarsInterface $transientVars, array $args = []) |
|
| 97 | + public function buildArgumentsForService(callable $service, MetadataInterface $metadata, TransientVarsInterface $transientVars, array $args = [ ]) |
|
| 98 | 98 | { |
| 99 | 99 | $listArgument = $this->getListArgumentForService($service); |
| 100 | 100 | |
@@ -112,30 +112,30 @@ discard block |
||
| 112 | 112 | // } |
| 113 | 113 | |
| 114 | 114 | |
| 115 | - $arguments = []; |
|
| 115 | + $arguments = [ ]; |
|
| 116 | 116 | foreach ($listArgument as $name => $defaultValue) { |
| 117 | 117 | if (array_key_exists($name, $argumentsMap)) { |
| 118 | - $argName = $argumentsMap[$name]; |
|
| 118 | + $argName = $argumentsMap[ $name ]; |
|
| 119 | 119 | if (array_key_exists($argName, $args)) { |
| 120 | - $key = $args[$argName]; |
|
| 120 | + $key = $args[ $argName ]; |
|
| 121 | 121 | if ($transientVars->offsetExists($key)) { |
| 122 | - $arguments[$name] = $transientVars[$key]; |
|
| 122 | + $arguments[ $name ] = $transientVars[ $key ]; |
|
| 123 | 123 | continue; |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if ($transientVars->offsetExists($name)) { |
| 129 | - $arguments[$name] = $transientVars[$name]; |
|
| 129 | + $arguments[ $name ] = $transientVars[ $name ]; |
|
| 130 | 130 | continue; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (array_key_exists($name, $args)) { |
| 134 | - $arguments[$name] = $args[$name]; |
|
| 134 | + $arguments[ $name ] = $args[ $name ]; |
|
| 135 | 135 | continue; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $arguments[$name] = $defaultValue; |
|
| 138 | + $arguments[ $name ] = $defaultValue; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | return $arguments; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * @param array $options |
| 53 | 53 | */ |
| 54 | - public function __construct(array $options = []) |
|
| 54 | + public function __construct(array $options = [ ]) |
|
| 55 | 55 | { |
| 56 | - call_user_func_array([$this, 'init'], $options); |
|
| 56 | + call_user_func_array([ $this, 'init' ], $options); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @throws Exception\ErrorCreatingValidatorException |
| 76 | 76 | */ |
| 77 | - public function getValidator($type, array $args = []) |
|
| 77 | + public function getValidator($type, array $args = [ ]) |
|
| 78 | 78 | { |
| 79 | 79 | try { |
| 80 | 80 | $wrapper = $this->wrapperFactory($type, $args, ServiceTypeResolver\ValidatorWrapper::class); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @throws Exception\ErrorCreatingRegisterException |
| 94 | 94 | */ |
| 95 | - public function getRegister($type, array $args = []) |
|
| 95 | + public function getRegister($type, array $args = [ ]) |
|
| 96 | 96 | { |
| 97 | 97 | try { |
| 98 | 98 | $wrapper = $this->wrapperFactory($type, $args, ServiceTypeResolver\RegisterWrapper::class); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * |
| 111 | 111 | * @throws Exception\ErrorCreatingFunctionException |
| 112 | 112 | */ |
| 113 | - public function getFunction($type, array $args = []) |
|
| 113 | + public function getFunction($type, array $args = [ ]) |
|
| 114 | 114 | { |
| 115 | 115 | try { |
| 116 | 116 | $wrapper = $this->wrapperFactory($type, $args, ServiceTypeResolver\FunctionWrapper::class); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * |
| 129 | 129 | * @throws Exception\ErrorCreatingConditionException |
| 130 | 130 | */ |
| 131 | - public function getCondition($type, array $args = []) |
|
| 131 | + public function getCondition($type, array $args = [ ]) |
|
| 132 | 132 | { |
| 133 | 133 | try { |
| 134 | 134 | $wrapper = $this->wrapperFactory($type, $args, ServiceTypeResolver\ConditionWrapper::class); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * @throws \Zend\ServiceManager\Exception\RuntimeException |
| 168 | 168 | * @throws Exception\InvalidServiceException |
| 169 | 169 | */ |
| 170 | - protected function wrapperFactory($type, array $args = [], $classWrapper) |
|
| 170 | + protected function wrapperFactory($type, array $args = [ ], $classWrapper) |
|
| 171 | 171 | { |
| 172 | 172 | if (static::SERVICE_TYPE !== $type) { |
| 173 | 173 | return null; |
@@ -177,16 +177,16 @@ discard block |
||
| 177 | 177 | $errMsg = sprintf('Argument %s not found', static::SERVICE_NAME); |
| 178 | 178 | throw new Exception\InvalidServiceNameException($errMsg); |
| 179 | 179 | } |
| 180 | - $serviceName = $args[static::SERVICE_NAME]; |
|
| 180 | + $serviceName = $args[ static::SERVICE_NAME ]; |
|
| 181 | 181 | |
| 182 | 182 | if (!array_key_exists(static::SERVICE_METHOD, $args)) { |
| 183 | 183 | $errMsg = sprintf('Argument %s not found', static::SERVICE_METHOD); |
| 184 | 184 | throw new Exception\InvalidServiceNameException($errMsg); |
| 185 | 185 | } |
| 186 | - $serviceMethod = $args[static::SERVICE_METHOD]; |
|
| 186 | + $serviceMethod = $args[ static::SERVICE_METHOD ]; |
|
| 187 | 187 | |
| 188 | 188 | $service = $this->getWorkflowServiceManager()->get($serviceName); |
| 189 | - $serviceCallback = [$service, $serviceMethod]; |
|
| 189 | + $serviceCallback = [ $service, $serviceMethod ]; |
|
| 190 | 190 | |
| 191 | 191 | if (!is_callable($serviceCallback)) { |
| 192 | 192 | $errMsg = sprintf('Service name %s and method %s', $serviceName, $serviceMethod); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @throws Exception\RuntimeException |
| 73 | 73 | * @throws Exception\ResultNotFoundException |
| 74 | 74 | */ |
| 75 | - public function getValidator($type, array $args = []) |
|
| 75 | + public function getValidator($type, array $args = [ ]) |
|
| 76 | 76 | { |
| 77 | 77 | $chain = clone $this->chain; |
| 78 | 78 | while ($chain) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @throws Exception\ResultNotFoundException |
| 105 | 105 | * @throws Exception\RuntimeException |
| 106 | 106 | */ |
| 107 | - public function getRegister($type, array $args = []) |
|
| 107 | + public function getRegister($type, array $args = [ ]) |
|
| 108 | 108 | { |
| 109 | 109 | $chain = clone $this->chain; |
| 110 | 110 | while ($chain) { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * @throws Exception\RuntimeException |
| 137 | 137 | * @throws Exception\ResultNotFoundException |
| 138 | 138 | */ |
| 139 | - public function getFunction($type, array $args = []) |
|
| 139 | + public function getFunction($type, array $args = [ ]) |
|
| 140 | 140 | { |
| 141 | 141 | $chain = clone $this->chain; |
| 142 | 142 | while ($chain) { |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * @throws Exception\ResultNotFoundException |
| 169 | 169 | * @throws Exception\RuntimeException |
| 170 | 170 | */ |
| 171 | - public function getCondition($type, array $args = []) |
|
| 171 | + public function getCondition($type, array $args = [ ]) |
|
| 172 | 172 | { |
| 173 | 173 | $chain = clone $this->chain; |
| 174 | 174 | while ($chain) { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function setFlagIgnoreException($flagIgnoreException) |
| 208 | 208 | { |
| 209 | - $this->flagIgnoreException = (boolean)$flagIgnoreException; |
|
| 209 | + $this->flagIgnoreException = (boolean) $flagIgnoreException; |
|
| 210 | 210 | |
| 211 | 211 | return $this; |
| 212 | 212 | } |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/old-town/workflow-zf2-service |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace OldTown\Workflow\ZF2\Service; |
| 7 | 7 | |
| 8 | 8 | |