Skip to content

Commit 423ed7e

Browse files
author
Jon Simonsen
committed
Add suggested PHP changes in drush and composer files
1 parent 7b93a67 commit 423ed7e

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

drush/Commands/PolicyCommands.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ public function rsyncValidate(CommandData $commandData) {
3737
throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));
3838
}
3939
}
40+
4041
}

scripts/composer/ScriptHandler.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<?php
22

3-
/**
4-
* @file
5-
* Contains \DrupalProject\composer\ScriptHandler.
6-
*/
7-
83
namespace DrupalProject\composer;
94

105
use Composer\Script\Event;
@@ -14,8 +9,16 @@
149
use DrupalFinder\DrupalFinderComposerRuntime;
1510
use Symfony\Component\Filesystem\Filesystem;
1611

12+
/**
13+
*
14+
*/
1715
class ScriptHandler {
1816

17+
/**
18+
* @param \Composer\Script\Event $event
19+
*
20+
* @return void
21+
*/
1922
public static function createRequiredFiles(Event $event) {
2023
$fs = new Filesystem();
2124
$drupalFinder = new DrupalFinderComposerRuntime();
@@ -32,15 +35,15 @@ public static function createRequiredFiles(Event $event) {
3235
'themes',
3336
];
3437

35-
// Required for unit testing
38+
// Required for unit testing.
3639
foreach ($dirs as $dir) {
37-
if (!$fs->exists($drupalRoot . '/'. $dir)) {
38-
$fs->mkdir($drupalRoot . '/'. $dir);
39-
$fs->touch($drupalRoot . '/'. $dir . '/.gitkeep');
40+
if (!$fs->exists($drupalRoot . '/' . $dir)) {
41+
$fs->mkdir($drupalRoot . '/' . $dir);
42+
$fs->touch($drupalRoot . '/' . $dir . '/.gitkeep');
4043
}
4144
}
4245

43-
// Prepare the settings file for installation
46+
// Prepare the settings file for installation.
4447
if (!$fs->exists($drupalRoot . '/sites/default/settings.php') && $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
4548
$fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
4649
require_once $drupalRoot . '/core/includes/bootstrap.inc';
@@ -55,7 +58,7 @@ public static function createRequiredFiles(Event $event) {
5558
$event->getIO()->write("Created a sites/default/settings.php file with chmod 0666");
5659
}
5760

58-
// Create the files directory with chmod 0777
61+
// Create the files directory with chmod 0777.
5962
if (!$fs->exists($drupalRoot . '/sites/default/files') && !is_link($drupalRoot . '/sites/default/files')) {
6063
$oldmask = umask(0);
6164
$fs->mkdir($drupalRoot . '/sites/default/files', 0777);

0 commit comments

Comments
 (0)