Code Duplication    Length = 7-9 lines in 3 locations

src/FormerHelper.php 3 locations

@@ 127-133 (lines=7) @@
124
     * @param string $name
125
     * @return string
126
     */
127
    public function getLabel($name): string
128
    {
129
        $key = "validation.labels.{$name}";
130
        $trans = $this->translator->trans($key);
131
132
        return $trans == $key ? $this->translator->trans("validation.attributes.{$name}") : $trans;
133
    }
134
135
    /**
136
     * Get the placeholder of field by name.
@@ 141-149 (lines=9) @@
138
     * @param string $name
139
     * @return string|null
140
     */
141
    public function getPlaceholder($name)
142
    {
143
        $key = "validation.placeholders.{$name}";
144
        $trans = $this->translator->trans($key);
145
146
        if ($trans != $key) {
147
            return $trans;
148
        }
149
    }
150
151
    /**
152
     * Get the text of field by name.
@@ 157-165 (lines=9) @@
154
     * @param string $name
155
     * @return string|null
156
     */
157
    public function getText($name)
158
    {
159
        $key = "validation.texts.{$name}";
160
        $trans = $this->translator->trans($key);
161
162
        if ($trans != $key) {
163
            return $trans;
164
        }
165
    }
166
167
    /**
168
     * Get url by route name.