Code Duplication    Length = 11-13 lines in 2 locations

src/Annotation/Transactional.php 1 location

@@ 158-170 (lines=13) @@
155
    private function validateNoRollbackExceptions($annotationNoRollbackExceptions)
156
    {
157
        $noRollbackExceptions = [];
158
        foreach ($annotationNoRollbackExceptions as $exceptionClassName) {
159
            try {
160
                $exceptionClass = new ReflectionClass($exceptionClassName);
161
            } catch (ReflectionException $e) {
162
                throw new AnnotationException('Class not found: \'' . $exceptionClassName . '\'', null, $e);
163
            }
164
165
            if (($exceptionClassName !== Exception::class) && !$exceptionClass->isSubclassOf(Exception::class)) {
166
                throw new AnnotationException('Not an exception: \'' . $exceptionClassName . '\'');
167
            }
168
169
            $noRollbackExceptions[] = $exceptionClassName;
170
        }
171
        return $noRollbackExceptions;
172
    }
173
}

src/DependencyInjection/InneairTransactionExtension.php 1 location

@@ 74-84 (lines=11) @@
71
        $container->setParameter(Configuration::ROOT_NODE_NAME . '.' . Configuration::DEFAULT_POLICY, $policy);
72
73
        $noRollbackExceptions = array_unique($config[Configuration::NO_ROLLBACK_EXCEPTIONS]);
74
        foreach ($noRollbackExceptions as $exceptionClassName) {
75
            try {
76
                $exceptionClass = new ReflectionClass($exceptionClassName);
77
            } catch (ReflectionException $e) {
78
                throw new InvalidArgumentException('Class not found: \'' . $exceptionClassName . '\'', null, $e);
79
            }
80
81
            if (($exceptionClassName !== Exception::class) && !$exceptionClass->isSubclassOf(Exception::class)) {
82
                throw new InvalidArgumentException('Not an exception: \'' . $exceptionClassName . '\'');
83
            }
84
        }
85
        $container->setParameter(
86
            Configuration::ROOT_NODE_NAME . '.' . Configuration::NO_ROLLBACK_EXCEPTIONS,
87
            $noRollbackExceptions