Code Duplication    Length = 5-7 lines in 3 locations

AbstractNewFeatureSniff.php 1 location

@@ 53-59 (lines=7) @@
50
        $versionArray = $this->getVersionArray($itemArray);
51
52
        if (empty($versionArray) === false) {
53
            foreach ($versionArray as $version => $present) {
54
                if ($errorInfo['not_in_version'] === '' && $present === false
55
                    && $this->supportsBelow($version) === true
56
                ) {
57
                    $errorInfo['not_in_version'] = $version;
58
                }
59
            }
60
        }
61
62
        return $errorInfo;

Sniffs/PHP/NewExecutionDirectivesSniff.php 1 location

@@ 194-200 (lines=7) @@
191
        $versionArray = $this->getVersionArray($itemArray);
192
193
        if (empty($versionArray) === false) {
194
            foreach ($versionArray as $version => $present) {
195
                if (is_string($present) === true && $this->supportsBelow($version) === true) {
196
                    // We cannot test for compilation option (ok, except by scraping the output of phpinfo...).
197
                    $errorInfo['conditional_version'] = $version;
198
                    $errorInfo['condition']           = $present;
199
                }
200
            }
201
        }
202
203
        return $errorInfo;

Sniffs/PHP/RequiredOptionalFunctionParametersSniff.php 1 location

@@ 174-178 (lines=5) @@
171
172
        $versionArray = $this->getVersionArray($itemArray);
173
174
        foreach ($versionArray as $version => $required) {
175
            if ($version !== 'name' && $required === true && $this->supportsBelow($version) === true) {
176
                $errorInfo['requiredVersion'] = $version;
177
            }
178
        }
179
180
        $errorInfo['paramName'] = $itemArray['name'];
181