Code Duplication    Length = 5-5 lines in 4 locations

src/PlaygroundGame/Service/Game.php 4 locations

@@ 2065-2069 (lines=5) @@
2062
                if ($lengthMin && $lengthMin > 0) {
2063
                    $options['min'] = $lengthMin;
2064
                }
2065
                if ($lengthMax && $lengthMax > $lengthMin) {
2066
                    $options['max'] = $lengthMax;
2067
                    $element->setAttribute('maxlength', $lengthMax);
2068
                    $options['messages'] = array(
2069
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2070
                            $this->getServiceLocator()->get('translator')->translate(
2071
                                'This field contains more than %s characters',
2072
                                'playgroundgame'
@@ 2140-2144 (lines=5) @@
2137
                if ($lengthMin && $lengthMin > 0) {
2138
                    $options['min'] = $lengthMin;
2139
                }
2140
                if ($lengthMax && $lengthMax > $lengthMin) {
2141
                    $options['max'] = $lengthMax;
2142
                    $element->setAttribute('maxlength', $lengthMax);
2143
                    $options['messages'] = array(
2144
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2145
                            $this->getServiceLocator()->get('translator')->translate(
2146
                                'This field contains more than %s characters',
2147
                                'playgroundgame'
@@ 2194-2198 (lines=5) @@
2191
                if ($lengthMin && $lengthMin > 0) {
2192
                    $options['min'] = $lengthMin;
2193
                }
2194
                if ($lengthMax && $lengthMax > $lengthMin) {
2195
                    $options['max'] = $lengthMax;
2196
                    $element->setAttribute('maxlength', $lengthMax);
2197
                    $options['messages'] = array(
2198
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2199
                            $this->getServiceLocator()->get('translator')->translate(
2200
                                'This field contains more than %s characters',
2201
                                'playgroundgame'
@@ 2249-2253 (lines=5) @@
2246
                if ($lengthMin && $lengthMin > 0) {
2247
                    $options['min'] = $lengthMin;
2248
                }
2249
                if ($lengthMax && $lengthMax > $lengthMin) {
2250
                    $options['max'] = $lengthMax;
2251
                    $element->setAttribute('maxlength', $lengthMax);
2252
                    $options['messages'] = array(
2253
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2254
                            $this->getServiceLocator()->get('translator')->translate(
2255
                                'This field contains more than %s characters',
2256
                                'playgroundgame'