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
                return;
148
            }
149
150
            throw new RuntimeException($message);
151
        }
152
153
        $id = $node->args[0]->value->value;
154

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

@@ 132-145 (lines=14) @@
129
            }
130
        }
131
132
        if (!$node->args[0]->value instanceof String_) {
133
            if ($ignore) {
134
                return;
135
            }
136
137
            $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());
138
139
            if ($this->logger) {
140
                $this->logger->error($message);
141
                return;
142
            }
143
144
            throw new RuntimeException($message);
145
        }
146
147
        $message = new Message($node->args[0]->value->value, $this->defaultDomain);
148
        $message->setDesc($desc);