Skip to content
Snippets Groups Projects

#3498244 PHPCS fixes for Coder 8.3.27

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
@@ -29,26 +29,26 @@ foreach ($files as $f => $filename) {
foreach ($lines as $lnum => $text) {
switch (TRUE) {
// Detect when a code block begins and ends.
case strstr($text, "```");
case strstr($text, "```"):
$code_block = !$code_block;
$quiet ?: print $lnum . ' $code_block changed to ' . ($code_block ? 'true' : 'false') . ' in: ' . $text;
break;
// If the line does not contain http or we are still in a code block then
// move on to the next line.
case !stristr($text, 'http') || $code_block;
case !stristr($text, 'http') || $code_block:
$quiet ?: print $lnum . ' No http or still in code block in: ' . $text;
break;
// If the http is part of an inline code block then it is OK.
case preg_match('/`.*http.*`/', $text, $matches);
case preg_match('/`.*http.*`/', $text, $matches):
$quiet ?: print $lnum . ' Found inline code with http so ignore: ' . $text;
$quiet ?: print_r($matches, TRUE);
break;
// If the http link is properly formatted with [text](url) then it is OK.
// Note that this only checking the markup, not validating the url format.
case preg_match('/\[.+\]\(http.+\)/', $text, $matches);
case preg_match('/\[.+\]\(http.+\)/', $text, $matches):
$quiet ?: print $lnum . ' Link is correctly formatted in ' . $text . '$matches=' . print_r($matches, TRUE) . PHP_EOL;
break;
Loading