Code Duplication    Length = 5-5 lines in 4 locations

src/PlaygroundGame/Service/Game.php 4 locations

@@ 2055-2059 (lines=5) @@
2052
                if ($lengthMin && $lengthMin > 0) {
2053
                    $options['min'] = $lengthMin;
2054
                }
2055
                if ($lengthMax && $lengthMax > $lengthMin) {
2056
                    $options['max'] = $lengthMax;
2057
                    $element->setAttribute('maxlength', $lengthMax);
2058
                    $options['messages'] = array(
2059
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2060
                            $this->getServiceLocator()->get('translator')->translate(
2061
                                'This field contains more than %s characters',
2062
                                'playgroundgame'
@@ 2130-2134 (lines=5) @@
2127
                if ($lengthMin && $lengthMin > 0) {
2128
                    $options['min'] = $lengthMin;
2129
                }
2130
                if ($lengthMax && $lengthMax > $lengthMin) {
2131
                    $options['max'] = $lengthMax;
2132
                    $element->setAttribute('maxlength', $lengthMax);
2133
                    $options['messages'] = array(
2134
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2135
                            $this->getServiceLocator()->get('translator')->translate(
2136
                                'This field contains more than %s characters',
2137
                                'playgroundgame'
@@ 2184-2188 (lines=5) @@
2181
                if ($lengthMin && $lengthMin > 0) {
2182
                    $options['min'] = $lengthMin;
2183
                }
2184
                if ($lengthMax && $lengthMax > $lengthMin) {
2185
                    $options['max'] = $lengthMax;
2186
                    $element->setAttribute('maxlength', $lengthMax);
2187
                    $options['messages'] = array(
2188
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2189
                            $this->getServiceLocator()->get('translator')->translate(
2190
                                'This field contains more than %s characters',
2191
                                'playgroundgame'
@@ 2239-2243 (lines=5) @@
2236
                if ($lengthMin && $lengthMin > 0) {
2237
                    $options['min'] = $lengthMin;
2238
                }
2239
                if ($lengthMax && $lengthMax > $lengthMin) {
2240
                    $options['max'] = $lengthMax;
2241
                    $element->setAttribute('maxlength', $lengthMax);
2242
                    $options['messages'] = array(
2243
                        \Zend\Validator\StringLength::TOO_LONG => sprintf(
2244
                            $this->getServiceLocator()->get('translator')->translate(
2245
                                'This field contains more than %s characters',
2246
                                'playgroundgame'