Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gitlab_templates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
gitlab_templates
Merge requests
!316
#3498244
PHPCS fixes for Coder 8.3.27
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
#3498244
PHPCS fixes for Coder 8.3.27
issue/gitlab_templates-3498244:3498244-fix-phpcs-for-new-sniffs
into
main
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Jonathan Smith
requested to merge
issue/gitlab_templates-3498244:3498244-fix-phpcs-for-new-sniffs
into
main
5 months ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
Closes
#3498244
0
0
Merge request reports
Compare
main
version 1
80f61b0f
5 months ago
main (base)
and
latest version
latest version
80f61b0f
1 commit,
5 months ago
version 1
80f61b0f
1 commit,
5 months ago
1 file
+
4
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
scripts/unformatted-links.php
+
4
−
4
Options
@@ -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