Skip to content

Commit 3286dbf

Browse files
committed
Issue #3088730 by Spokje, anmolgoyal74, ankithashetty, Mile23, longwave, naresh_bavaskar, greg.1.anderson, Mixologic, klausi: Include 'composer' directory in phpcs scans
(cherry picked from commit 01bd426e282a7543b3c7951615f83f1a0eac01e7)
1 parent 8539fd0 commit 3286dbf

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

Git.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Composer\Util\ProcessExecutor;
77

88
/**
9-
* Provide some Git utility operations
9+
* Provide some Git utility operations.
1010
*
1111
* @internal
1212
*/
@@ -21,6 +21,8 @@ private function __construct() {
2121
/**
2222
* Determines whether the specified scaffold file is already ignored.
2323
*
24+
* @param \Composer\IO\IOInterface $io
25+
* The Composer IO interface.
2426
* @param string $path
2527
* Path to scaffold file to check.
2628
* @param string $dir
@@ -39,6 +41,8 @@ public static function checkIgnore(IOInterface $io, $path, $dir = NULL) {
3941
/**
4042
* Determines whether the specified scaffold file is tracked by git.
4143
*
44+
* @param \Composer\IO\IOInterface $io
45+
* The Composer IO interface.
4246
* @param string $path
4347
* Path to scaffold file to check.
4448
* @param string $dir
@@ -57,8 +61,11 @@ public static function checkTracked(IOInterface $io, $path, $dir = NULL) {
5761
/**
5862
* Checks to see if the project root dir is in a git repository.
5963
*
64+
* @param \Composer\IO\IOInterface $io
65+
* The Composer IO interface.
6066
* @param string $dir
6167
* Base directory for git process.
68+
*
6269
* @return bool
6370
* True if this is a repository.
6471
*/

ManageGitIgnore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class ManageGitIgnore {
2828
/**
2929
* ManageGitIgnore constructor.
3030
*
31+
* @param \Composer\IO\IOInterface $io
32+
* The Composer IO interface.
3133
* @param string $dir
3234
* The directory where the project is located.
3335
*/

Operations/AppendOp.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ public function process(ScaffoldFilePath $destination, IOInterface $io, Scaffold
126126
$io->write($interpolator->interpolate(" - Prepend to <info>[dest-rel-path]</info> from <info>[prepend-rel-path]</info>"));
127127
}
128128
// Notify that we are appending, if there is append data.
129-
$append_contents = '';
130129
if (!empty($this->append)) {
131130
$this->append->addInterpolationData($interpolator, 'append');
132131
$io->write($interpolator->interpolate(" - Append to <info>[dest-rel-path]</info> from <info>[append-rel-path]</info>"));
@@ -187,10 +186,12 @@ public function scaffoldAtNewLocation(ScaffoldFilePath $destination) {
187186

188187
/**
189188
* Check to see if the append/prepend data has already been applied.
189+
*
190190
* @param string $contents
191191
* The contents of the target file.
192192
* @param \Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath $data_path
193193
* The path to the data to append or prepend
194+
*
194195
* @return bool
195196
* 'TRUE' if the append/prepend data already exists in contents.
196197
*/

Operations/OperationData.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class OperationData {
2525
protected $data;
2626

2727
/**
28-
* The destination path
28+
* The destination path.
2929
*
3030
* @var string
3131
*/
@@ -34,6 +34,8 @@ class OperationData {
3434
/**
3535
* OperationData constructor.
3636
*
37+
* @param string $destination
38+
* The destination path.
3739
* @param mixed $data
3840
* The raw data array to wrap.
3941
*/
@@ -53,7 +55,7 @@ public function destination() {
5355
}
5456

5557
/**
56-
* Gets operation mode
58+
* Gets operation mode.
5759
*
5860
* @return string
5961
* Operation mode.
@@ -63,7 +65,7 @@ public function mode() {
6365
}
6466

6567
/**
66-
* Checks if path exists
68+
* Checks if path exists.
6769
*
6870
* @return bool
6971
* Returns true if path exists
@@ -73,7 +75,7 @@ public function hasPath() {
7375
}
7476

7577
/**
76-
* Gets path
78+
* Gets path.
7779
*
7880
* @return string
7981
* The path.

Operations/ScaffoldFileCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function filterFiles(array $files_to_filter) {
103103
* TRUE if at least one item in the list has content
104104
*/
105105
protected function checkListHasItemWithContent(array $scaffold_files) {
106-
foreach ($scaffold_files as $destination_rel_path => $scaffold_file) {
106+
foreach ($scaffold_files as $scaffold_file) {
107107
$contents = $scaffold_file->op()->contents();
108108
if (!empty($contents)) {
109109
return TRUE;
@@ -186,7 +186,7 @@ public static function process(ScaffoldFileCollection $collection, IOInterface $
186186
*/
187187
public function checkUnchanged() {
188188
$results = [];
189-
foreach ($this as $project_name => $scaffold_files) {
189+
foreach ($this as $scaffold_files) {
190190
foreach ($scaffold_files as $scaffold_file) {
191191
if (!$scaffold_file->hasChanged()) {
192192
$results[] = $scaffold_file->destination()->relativePath();

0 commit comments

Comments
 (0)