Code Duplication    Length = 14-14 lines in 2 locations

eZ/Publish/Core/MVC/Symfony/Translation/TranslatableExceptionsFileVisitor.php 1 location

@@ 138-151 (lines=14) @@
135
            }
136
        }
137
138
        if (!$node->args[0]->value instanceof String_) {
139
            if ($ignore) {
140
                return;
141
            }
142
143
            $message = sprintf('Can only extract the translation id from a scalar string, but got "%s". Please refactor your code to make it extractable, or add the doc comment /** @Ignore */ to this code element (in %s on line %d).', get_class($node->args[0]->value), $this->file, $node->args[0]->value->getLine());
144
145
            if ($this->logger) {
146
                $this->logger->error($message);
147
148
                return;
149
            }
150
151
            throw new RuntimeException($message);
152
        }
153
154
        $id = $node->args[0]->value->value;

eZ/Publish/Core/MVC/Symfony/Translation/ValidationErrorFileVisitor.php 1 location

@@ 131-144 (lines=14) @@
128
            }
129
        }
130
131
        if (!$node->args[0]->value instanceof String_) {
132
            if ($ignore) {
133
                return;
134
            }
135
136
            $message = sprintf('Can only extract the translation id from a scalar string, but got "%s". Please refactor your code to make it extractable, or add the doc comment /** @Ignore */ to this code element (in %s on line %d).', get_class($node->args[0]->value), $this->file, $node->args[0]->value->getLine());
137
138
            if ($this->logger) {
139
                $this->logger->error($message);
140
141
                return;
142
            }
143
144
            throw new RuntimeException($message);
145
        }
146
147
        $message = new Message($node->args[0]->value->value, $this->defaultDomain);