Code Duplication    Length = 5-7 lines in 3 locations

AbstractNewFeatureSniff.php 1 location

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

Sniffs/PHP/NewExecutionDirectivesSniff.php 1 location

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

Sniffs/PHP/RequiredOptionalFunctionParametersSniff.php 1 location

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