Code Duplication    Length = 5-7 lines in 3 locations

PHPCompatibility/AbstractNewFeatureSniff.php 1 location

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

PHPCompatibility/Sniffs/PHP/NewExecutionDirectivesSniff.php 1 location

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

PHPCompatibility/Sniffs/PHP/RequiredOptionalFunctionParametersSniff.php 1 location

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