Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupalci_testbot
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
drupalci_testbot
Merge requests
!3
Support custom phpstan rules
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Support custom phpstan rules
issue/drupalci_testbot-3254634:drupalci_testbot-3254634
into
dev
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
James Gilliland
requested to merge
issue/drupalci_testbot-3254634:drupalci_testbot-3254634
into
dev
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Allow core and contrib to run phpstan how ever it likes.
0
0
Merge request reports
Compare
dev
version 3
ecb58bb0
2 years ago
version 2
5a772900
2 years ago
version 1
5a772900
3 years ago
dev (base)
and
latest version
latest version
a68f9eba
1 commit,
2 years ago
version 3
ecb58bb0
1 commit,
2 years ago
version 2
5a772900
1 commit,
2 years ago
version 1
5a772900
1 commit,
3 years ago
1 file
+
7
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/DrupalCI/Plugin/BuildTask/BuildStep/CodebaseValidate/Phpstan.php
+
7
−
3
Options
@@ -83,16 +83,20 @@ class Phpstan extends BuildTaskBase implements BuildStepInterface, BuildTaskInte
return
0
;
}
$this
->
addPhpstanNeon
();
// Run phpstan.
$source_dir
=
$this
->
environment
->
getExecContainerSourceDir
();
$project_dir
=
$this
->
codebase
->
getProjectConfigDirectory
(
FALSE
);
$work_dir
=
$this
->
environment
->
getContainerWorkDir
();
$this
->
io
->
writeln
(
'<info>Running PHPStan at '
.
$source_dir
);
// If phpstan file is missing, provide some basic deprecation checks.
if
(
!
file_exists
(
$work_dir
.
'/phpstan.neon'
)
||
!
file_exists
(
$work_dir
.
'/phpstan.neon.dist'
))
{
$this
->
addPhpstanNeon
();
$neon
=
'-c '
.
$work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan.neon'
;
}
$result
=
$this
->
execEnvironmentCommands
([
'cd '
.
$project_dir
.
' && sudo -u www-data '
.
$source_dir
.
static
::
$phpstanExecutable
.
' analyse --error-format checkstyle
-c
'
.
$
work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan.
neon . > '
.
$work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan_results.xml'
,
'cd '
.
$project_dir
.
' && sudo -u www-data '
.
$source_dir
.
static
::
$phpstanExecutable
.
' analyse --error-format checkstyle '
.
$neon
.
'
> '
.
$work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan_results.xml'
,
]);
// Save phpstan results for later examination.
Loading