@@ -103,7 +103,7 @@ |
||
| 103 | 103 | // have been invoked. |
| 104 | 104 | $this->logger->warning( |
| 105 | 105 | 'Transactional interceptor was invoked, but no annotation was found for method \'' . |
| 106 | - $methodDefinition->getDeclaringClass()->getName() . '::' . $methodDefinition->getName() . '\'' |
|
| 106 | + $methodDefinition->getDeclaringClass()->getName() . '::' . $methodDefinition->getName() . '\'' |
|
| 107 | 107 | ); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $policy = Transactional::NOT_REQUIRED; |
| 89 | 89 | } elseif ($annotation->getPolicy() === null) { |
| 90 | 90 | $policy = $this->container->getParameter( |
| 91 | - Configuration::ROOT_NODE_NAME . '.' . Configuration::DEFAULT_POLICY); |
|
| 91 | + Configuration::ROOT_NODE_NAME.'.'.Configuration::DEFAULT_POLICY); |
|
| 92 | 92 | } else { |
| 93 | 93 | $policy = $annotation->getPolicy(); |
| 94 | 94 | } |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | // No annotation found: there is probably a bug in the pointcut class, because the interceptor should not |
| 98 | 98 | // have been invoked. |
| 99 | 99 | $this->logger->warning( |
| 100 | - 'Transactional interceptor was invoked, but no annotation was found for method \'' . |
|
| 101 | - $methodDefinition->getDeclaringClass()->getName() . '::' . $methodDefinition->getName() . '\'' |
|
| 100 | + 'Transactional interceptor was invoked, but no annotation was found for method \''. |
|
| 101 | + $methodDefinition->getDeclaringClass()->getName().'::'.$methodDefinition->getName().'\'' |
|
| 102 | 102 | ); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | try { |
| 116 | 116 | // Invokes the method. |
| 117 | 117 | $this->logger->debug( |
| 118 | - $methodDefinition->getDeclaringClass()->getName() . '::' . $methodDefinition->getName() |
|
| 118 | + $methodDefinition->getDeclaringClass()->getName().'::'.$methodDefinition->getName() |
|
| 119 | 119 | ); |
| 120 | 120 | $result = $method->proceed(); |
| 121 | 121 | $this->afterMethodInvocationSuccess($transactionRequired); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | } elseif ($annotation->getNoRollbackExceptions() === null) { |
| 128 | 128 | // No exceptions set in the annotation (even if the parameter was found), use the default configuration. |
| 129 | 129 | $noRollbackExceptions = $this->container->getParameter( |
| 130 | - Configuration::ROOT_NODE_NAME . '.' . Configuration::NO_ROLLBACK_EXCEPTIONS |
|
| 130 | + Configuration::ROOT_NODE_NAME.'.'.Configuration::NO_ROLLBACK_EXCEPTIONS |
|
| 131 | 131 | ); |
| 132 | 132 | } else { |
| 133 | 133 | // Use the annotation parameter. |
@@ -166,11 +166,11 @@ discard block |
||
| 166 | 166 | if ($transactionRequired) { |
| 167 | 167 | if ($this->isRollbackEnabled($e, $noRollbackExceptions)) { |
| 168 | 168 | // Rollbacks the transaction. |
| 169 | - $this->logger->debug('Exception ' . get_class($e) . ' causes rollback'); |
|
| 169 | + $this->logger->debug('Exception '.get_class($e).' causes rollback'); |
|
| 170 | 170 | $this->rollback(); |
| 171 | 171 | } else { |
| 172 | 172 | // Commits the transaction. |
| 173 | - $this->logger->debug('No rollback for exception ' . get_class($e)); |
|
| 173 | + $this->logger->debug('No rollback for exception '.get_class($e)); |
|
| 174 | 174 | $this->commit(); |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | protected function beginTransaction() |
| 211 | 211 | { |
| 212 | - $this->logger->debug(static::class . '::beginTransaction'); |
|
| 212 | + $this->logger->debug(static::class.'::beginTransaction'); |
|
| 213 | 213 | $this->getEntityManager()->beginTransaction(); |
| 214 | 214 | } |
| 215 | 215 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | protected function commit() |
| 220 | 220 | { |
| 221 | - $this->logger->debug(static::class . '::commit'); |
|
| 221 | + $this->logger->debug(static::class.'::commit'); |
|
| 222 | 222 | $this->getEntityManager()->flush(); |
| 223 | 223 | $this->getEntityManager()->commit(); |
| 224 | 224 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | protected function rollback() |
| 232 | 232 | { |
| 233 | - $this->logger->debug(static::class . '::rollback'); |
|
| 233 | + $this->logger->debug(static::class.'::rollback'); |
|
| 234 | 234 | $this->getEntityManager()->rollback(); |
| 235 | 235 | |
| 236 | 236 | // Close the manager if there is no transaction started. |
@@ -96,17 +96,17 @@ |
||
| 96 | 96 | |
| 97 | 97 | if ($transactionalEnabled) { |
| 98 | 98 | switch ($annotation->getPolicy()) { |
| 99 | - case Transactional::NOT_REQUIRED: |
|
| 100 | - $policyName = 'not required'; |
|
| 101 | - break; |
|
| 102 | - case Transactional::REQUIRED: |
|
| 103 | - $policyName = 'required'; |
|
| 104 | - break; |
|
| 105 | - case Transactional::NESTED: |
|
| 106 | - $policyName = 'nested'; |
|
| 107 | - break; |
|
| 108 | - default: |
|
| 109 | - $policyName = 'default'; |
|
| 99 | + case Transactional::NOT_REQUIRED: |
|
| 100 | + $policyName = 'not required'; |
|
| 101 | + break; |
|
| 102 | + case Transactional::REQUIRED: |
|
| 103 | + $policyName = 'required'; |
|
| 104 | + break; |
|
| 105 | + case Transactional::NESTED: |
|
| 106 | + $policyName = 'nested'; |
|
| 107 | + break; |
|
| 108 | + default: |
|
| 109 | + $policyName = 'default'; |
|
| 110 | 110 | } |
| 111 | 111 | $methodString = $method->getDeclaringClass()->name . '::' . $method->name; |
| 112 | 112 | $this->logger->debug('TX policy for \'' . $methodString . '\': ' . $policyName); |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | default: |
| 109 | 109 | $policyName = 'default'; |
| 110 | 110 | } |
| 111 | - $methodString = $method->getDeclaringClass()->name . '::' . $method->name; |
|
| 112 | - $this->logger->debug('TX policy for \'' . $methodString . '\': ' . $policyName); |
|
| 111 | + $methodString = $method->getDeclaringClass()->name.'::'.$method->name; |
|
| 112 | + $this->logger->debug('TX policy for \''.$methodString.'\': '.$policyName); |
|
| 113 | 113 | $noRollbackExceptionsStr = implode( |
| 114 | 114 | ', ', |
| 115 | 115 | ($annotation->getNoRollbackExceptions() === null) |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | : $annotation->getNoRollbackExceptions() |
| 118 | 118 | ); |
| 119 | 119 | $this->logger->debug( |
| 120 | - 'TX no-rollback exceptions for \'' . $methodString . '\': ' . $noRollbackExceptionsStr |
|
| 120 | + 'TX no-rollback exceptions for \''.$methodString.'\': '.$noRollbackExceptionsStr |
|
| 121 | 121 | ); |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | $policy = $annotationPolicy; |
| 139 | 139 | } else { |
| 140 | 140 | throw new AnnotationException( |
| 141 | - 'Invalid policy: "' . $annotationPolicy . '", must be one of the constants [' . |
|
| 142 | - implode(', ', $policies) . ']' |
|
| 141 | + 'Invalid policy: "'.$annotationPolicy.'", must be one of the constants ['. |
|
| 142 | + implode(', ', $policies).']' |
|
| 143 | 143 | ); |
| 144 | 144 | } |
| 145 | 145 | return $policy; |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | try { |
| 160 | 160 | $exceptionClass = new ReflectionClass($exceptionClassName); |
| 161 | 161 | } catch (ReflectionException $e) { |
| 162 | - throw new AnnotationException('Class not found: \'' . $exceptionClassName . '\'', null, $e); |
|
| 162 | + throw new AnnotationException('Class not found: \''.$exceptionClassName.'\'', null, $e); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | if (($exceptionClassName !== Exception::class) && !$exceptionClass->isSubclassOf(Exception::class)) { |
| 166 | - throw new AnnotationException('Not an exception: \'' . $exceptionClassName . '\''); |
|
| 166 | + throw new AnnotationException('Not an exception: \''.$exceptionClassName.'\''); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $noRollbackExceptions[] = $exceptionClassName; |
@@ -54,19 +54,19 @@ |
||
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | 56 | switch ($config[Configuration::DEFAULT_POLICY]) { |
| 57 | - case Configuration::POLICY_NOT_REQUIRED: |
|
| 58 | - $policy = Transactional::NOT_REQUIRED; |
|
| 59 | - break; |
|
| 60 | - case Configuration::POLICY_REQUIRED: |
|
| 61 | - $policy = Transactional::REQUIRED; |
|
| 62 | - break; |
|
| 63 | - case Configuration::POLICY_NESTED: |
|
| 64 | - $policy = Transactional::NESTED; |
|
| 65 | - break; |
|
| 66 | - default: |
|
| 67 | - throw new InvalidArgumentException( |
|
| 68 | - 'Unsupported default policy "' . $config[Configuration::DEFAULT_POLICY] . '"' |
|
| 69 | - ); |
|
| 57 | + case Configuration::POLICY_NOT_REQUIRED: |
|
| 58 | + $policy = Transactional::NOT_REQUIRED; |
|
| 59 | + break; |
|
| 60 | + case Configuration::POLICY_REQUIRED: |
|
| 61 | + $policy = Transactional::REQUIRED; |
|
| 62 | + break; |
|
| 63 | + case Configuration::POLICY_NESTED: |
|
| 64 | + $policy = Transactional::NESTED; |
|
| 65 | + break; |
|
| 66 | + default: |
|
| 67 | + throw new InvalidArgumentException( |
|
| 68 | + 'Unsupported default policy "' . $config[Configuration::DEFAULT_POLICY] . '"' |
|
| 69 | + ); |
|
| 70 | 70 | } |
| 71 | 71 | $container->setParameter(Configuration::ROOT_NODE_NAME . '.' . Configuration::DEFAULT_POLICY, $policy); |
| 72 | 72 | |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function load(array $configs, ContainerBuilder $container) |
| 45 | 45 | { |
| 46 | - $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 46 | + $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 47 | 47 | $loader->load('services.yml'); |
| 48 | 48 | |
| 49 | 49 | $config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs); |
| 50 | 50 | |
| 51 | 51 | $container->setParameter( |
| 52 | - Configuration::ROOT_NODE_NAME . '.' . Configuration::STRICT_MODE, |
|
| 52 | + Configuration::ROOT_NODE_NAME.'.'.Configuration::STRICT_MODE, |
|
| 53 | 53 | $config[Configuration::STRICT_MODE] |
| 54 | 54 | ); |
| 55 | 55 | |
@@ -65,25 +65,25 @@ discard block |
||
| 65 | 65 | break; |
| 66 | 66 | default: |
| 67 | 67 | throw new InvalidArgumentException( |
| 68 | - 'Unsupported default policy "' . $config[Configuration::DEFAULT_POLICY] . '"' |
|
| 68 | + 'Unsupported default policy "'.$config[Configuration::DEFAULT_POLICY].'"' |
|
| 69 | 69 | ); |
| 70 | 70 | } |
| 71 | - $container->setParameter(Configuration::ROOT_NODE_NAME . '.' . Configuration::DEFAULT_POLICY, $policy); |
|
| 71 | + $container->setParameter(Configuration::ROOT_NODE_NAME.'.'.Configuration::DEFAULT_POLICY, $policy); |
|
| 72 | 72 | |
| 73 | 73 | $noRollbackExceptions = array_unique($config[Configuration::NO_ROLLBACK_EXCEPTIONS]); |
| 74 | 74 | foreach ($noRollbackExceptions as $exceptionClassName) { |
| 75 | 75 | try { |
| 76 | 76 | $exceptionClass = new ReflectionClass($exceptionClassName); |
| 77 | 77 | } catch (ReflectionException $e) { |
| 78 | - throw new InvalidArgumentException('Class not found: \'' . $exceptionClassName . '\'', null, $e); |
|
| 78 | + throw new InvalidArgumentException('Class not found: \''.$exceptionClassName.'\'', null, $e); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | if (($exceptionClassName !== Exception::class) && !$exceptionClass->isSubclassOf(Exception::class)) { |
| 82 | - throw new InvalidArgumentException('Not an exception: \'' . $exceptionClassName . '\''); |
|
| 82 | + throw new InvalidArgumentException('Not an exception: \''.$exceptionClassName.'\''); |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | $container->setParameter( |
| 86 | - Configuration::ROOT_NODE_NAME . '.' . Configuration::NO_ROLLBACK_EXCEPTIONS, |
|
| 86 | + Configuration::ROOT_NODE_NAME.'.'.Configuration::NO_ROLLBACK_EXCEPTIONS, |
|
| 87 | 87 | $noRollbackExceptions |
| 88 | 88 | ); |
| 89 | 89 | } |
@@ -93,6 +93,6 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function getXsdValidationBasePath() |
| 95 | 95 | { |
| 96 | - return __DIR__ . '/../Resources/config/schema'; |
|
| 96 | + return __DIR__.'/../Resources/config/schema'; |
|
| 97 | 97 | } |
| 98 | 98 | } |