Code Duplication    Length = 5-5 lines in 4 locations

src/PlaygroundGame/Service/Game.php 4 locations

@@ 1927-1931 (lines=5) @@
1924
                if ($lengthMin && $lengthMin > 0) {
1925
                    $options['min'] = $lengthMin;
1926
                }
1927
                if ($lengthMax && $lengthMax > $lengthMin) {
1928
                    $options['max'] = $lengthMax;
1929
                    $element->setAttribute('maxlength', $lengthMax);
1930
                    $options['messages'] = array(\Zend\Validator\StringLength::TOO_LONG => sprintf($this->getServiceLocator()->get('translator')->translate('This field contains more than %s characters', 'playgroundgame'), $lengthMax));
1931
                }
1932
1933
                $validators = array(
1934
                    array(
@@ 1984-1988 (lines=5) @@
1981
                if ($lengthMin && $lengthMin > 0) {
1982
                    $options['min'] = $lengthMin;
1983
                }
1984
                if ($lengthMax && $lengthMax > $lengthMin) {
1985
                    $options['max'] = $lengthMax;
1986
                    $element->setAttribute('maxlength', $lengthMax);
1987
                    $options['messages'] = array(\Zend\Validator\StringLength::TOO_LONG => sprintf($this->getServiceLocator()->get('translator')->translate('This field contains more than %s characters', 'playgroundgame'), $lengthMax));
1988
                }
1989
                $inputFilter->add($factory->createInput(array(
1990
                    'name'     => $name,
1991
                    'required' => $required,
@@ 2030-2034 (lines=5) @@
2027
                if ($lengthMin && $lengthMin > 0) {
2028
                    $options['min'] = $lengthMin;
2029
                }
2030
                if ($lengthMax && $lengthMax > $lengthMin) {
2031
                    $options['max'] = $lengthMax;
2032
                    $element->setAttribute('maxlength', $lengthMax);
2033
                    $options['messages'] = array(\Zend\Validator\StringLength::TOO_LONG => sprintf($this->getServiceLocator()->get('translator')->translate('This field contains more than %s characters', 'playgroundgame'), $lengthMax));
2034
                }
2035
                $inputFilter->add($factory->createInput(array(
2036
                    'name'     => $name,
2037
                    'required' => $required,
@@ 2077-2081 (lines=5) @@
2074
                if ($lengthMin && $lengthMin > 0) {
2075
                    $options['min'] = $lengthMin;
2076
                }
2077
                if ($lengthMax && $lengthMax > $lengthMin) {
2078
                    $options['max'] = $lengthMax;
2079
                    $element->setAttribute('maxlength', $lengthMax);
2080
                    $options['messages'] = array(\Zend\Validator\StringLength::TOO_LONG => sprintf($this->getServiceLocator()->get('translator')->translate('This field contains more than %s characters', 'playgroundgame'), $lengthMax));
2081
                }
2082
                $inputFilter->add($factory->createInput(array(
2083
                    'name'     => $name,
2084
                    'required' => $required,