Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit d04eaea

Browse files
authored
Fix code standards, remove superglobals (#4523)
* Fix code standards, remove superglobals * hmm * global * fix
1 parent 23beaf4 commit d04eaea

20 files changed

+450
-51
lines changed

bin/blt-robo-run.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$timer->start();
1717

1818
// Initialize input and output.
19-
$input = new ArgvInput($_SERVER['argv']);
19+
$input = new ArgvInput($argv);
2020
$output = new ConsoleOutput();
2121

2222
// Write BLT version for debugging.

bin/blt-robo.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
function find_repo_root() {
2929
$possible_repo_roots = [
3030
getcwd(),
31-
realpath(__DIR__ . '/../'),
32-
realpath(__DIR__ . '/../../../'),
31+
dirname(__DIR__) . '/',
32+
dirname(__DIR__, 3) . '/',
3333
];
3434
$blt_files = ['vendor/acquia/blt', 'vendor/autoload.php'];
3535
// Check for PWD - some local environments will not have this key.
36-
if (isset($_SERVER['PWD'])) {
37-
array_unshift($possible_repo_roots, $_SERVER['PWD']);
36+
if (getenv('PWD')) {
37+
array_unshift($possible_repo_roots, getenv('PWD'));
3838
}
3939
foreach ($possible_repo_roots as $possible_repo_root) {
4040
if ($repo_root = find_directory_containing_files($possible_repo_root, $blt_files)) {

composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@
4242
"acquia/blt-behat": "<=1.0.0"
4343
},
4444
"require-dev": {
45+
"acquia/coding-standards": "^1.0",
46+
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
4547
"squizlabs/php_codesniffer": "^3.6"
4648
},
4749
"suggest": {
4850
"davereid/drush-acquia-hook-invoke": "dev-master"
4951
},
5052
"config": {
53+
"allow-plugins": {
54+
"dealerdirect/phpcodesniffer-composer-installer": true
55+
},
5156
"php": "7",
5257
"platform": {
5358
"php": "7.4"
@@ -60,7 +65,7 @@
6065
"dev-main": "13.x-dev"
6166
},
6267
"class": "Acquia\\Blt\\Composer\\Plugin",
63-
"phpcodesniffer-search-depth": 4,
68+
"phpcodesniffer-search-depth": "4",
6469
"violinist": {
6570
"allow_updates_beyond_constraint": 0,
6671
"bundled_packages": {

0 commit comments

Comments
 (0)