Commit 641f0874 authored by Jonathan Sacksick's avatar Jonathan Sacksick Committed by Klaus Purer
Browse files

fix(Deprecated): Fix project version not correctly matched in deprecated checks. (#3050166)

parent 9b63c4a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ class DeprecatedSniff implements Sniff
            // case and numbers can be one or two digits.
            foreach (array('in-version' => $matches[1], 'removal-version' => $matches[2]) as $name => $version) {
                if (preg_match('/^drupal:\d{1,2}\.\d{1,2}\.\d{1,2}$/', $version) === 0
                    && preg_match('/^[a-z\d_]:\d{1,2}\.x\-\d{1,2}\.\d{1,2}$/', $version) === 0
                    && preg_match('/^[a-z\d_]+:\d{1,2}\.x\-\d{1,2}\.\d{1,2}$/', $version) === 0
                ) {
                    $error = "The deprecation %s '%s' does not match the standard: drupal:n.n.n or project:n.x-n.n";
                    $phpcsFile->addWarning($error, $stackPtr, 'DeprecatedVersionFormat', array($name, $version));
+8 −0
Original line number Diff line number Diff line
@@ -50,3 +50,11 @@ function y() {
 */
function z() {
}

/**
 * This doc block will also pass the 'Deprecated' standards checks.
 *
 * @deprecated in myproj:8.x-1.8 and will be removed from myproj:8.x-2.0.
 *   This function block is OK.
 * @see http://www.drupal.org/node/7890
 */