Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jun 12, 2024
1 parent e273171 commit b331b45
Show file tree
Hide file tree
Showing 17 changed files with 411 additions and 391 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ updates:
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: 'acquia/coding-standards'
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"symfony/yaml": "^6"
},
"require-dev": {
"acquia/coding-standards": "^2.0",
"acquia/coding-standards": "^1.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"squizlabs/php_codesniffer": "^3.6"
},
Expand All @@ -68,8 +68,8 @@
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"acquia/drupal-recommended-settings": true
"acquia/drupal-recommended-settings": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
"php": "8",
"platform": {
Expand Down
701 changes: 354 additions & 347 deletions composer.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Robo/Blt.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct(
Config $config,
InputInterface $input = NULL,
OutputInterface $output = NULL,
ClassLoader $classLoader = NULL
ClassLoader $classLoader = NULL,
) {

$this->setConfig($config);
Expand Down Expand Up @@ -136,7 +136,7 @@ private function addBuiltInCommandsAndHooks() {
* An array of Command classes
*/
private function getCommands(
array $options = ['path' => NULL, 'namespace' => NULL]
array $options = ['path' => NULL, 'namespace' => NULL],

Check failure on line 139 in src/Robo/Blt.php

View workflow job for this annotation

GitHub Actions / build (STRICT_DEPRECATED_CODE_SCAN, 8.1, FALSE, ^4)

Default value of the parameter #1 $options (array<string, null>) of method Acquia\Blt\Robo\Blt::getCommands() is incompatible with type array<string>.
) {
$discovery = new CommandFileDiscovery();
$discovery
Expand All @@ -157,7 +157,7 @@ private function getCommands(
* An array of Hook classes
*/
private function getHooks(
array $options = ['path' => NULL, 'namespace' => NULL]
array $options = ['path' => NULL, 'namespace' => NULL],

Check failure on line 160 in src/Robo/Blt.php

View workflow job for this annotation

GitHub Actions / build (STRICT_DEPRECATED_CODE_SCAN, 8.1, FALSE, ^4)

Default value of the parameter #1 $options (array<string, null>) of method Acquia\Blt\Robo\Blt::getHooks() is incompatible with type array<string>.
) {
$discovery = new CommandFileDiscovery();
$discovery->setSearchPattern('*Hook.php')->setSearchLocations([]);
Expand Down
18 changes: 10 additions & 8 deletions src/Robo/Commands/Artifact/DeployCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ public function initialize() {
* @throws \Robo\Exception\TaskException
* @throws \Exception
*/
public function deploy(array $options = [
'branch' => InputOption::VALUE_REQUIRED,
'tag' => InputOption::VALUE_REQUIRED,
'commit-msg' => InputOption::VALUE_REQUIRED,
'ignore-dirty' => FALSE,
'dry-run' => FALSE,
'ignore-platform-reqs' => FALSE,
]) {
public function deploy(
array $options = [
'branch' => InputOption::VALUE_REQUIRED,
'tag' => InputOption::VALUE_REQUIRED,
'commit-msg' => InputOption::VALUE_REQUIRED,
'ignore-dirty' => FALSE,
'dry-run' => FALSE,
'ignore-platform-reqs' => FALSE,
],
) {
if ($options['dry-run']) {
$this->logger->warning("This will be a dry run, the artifact will not be pushed.");
}
Expand Down
8 changes: 5 additions & 3 deletions src/Robo/Commands/Blt/WizardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ class WizardCommand extends BltTasks {
*
* @command wizard
*/
public function wizard($options = [
'recipe' => InputOption::VALUE_REQUIRED,
]) {
public function wizard(
$options = [
'recipe' => InputOption::VALUE_REQUIRED,
],
) {
$recipe_filename = $options['recipe'];
if ($recipe_filename) {
$answers = $this->loadRecipeFile($recipe_filename);
Expand Down
10 changes: 6 additions & 4 deletions src/Robo/Commands/Drupal/SyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ public function allSites() {
* @command drupal:sync:default:site
* @aliases ds drupal:sync drupal:sync:default sync sync:refresh
*/
public function sync(array $options = [
'sync-public-files' => FALSE,
'sync-private-files' => FALSE,
]) {
public function sync(
array $options = [
'sync-public-files' => FALSE,
'sync-private-files' => FALSE,
],
) {
$commands = $this->getConfigValue('sync.commands');
if ($options['sync-public-files'] || $this->getConfigValue('sync.public-files')) {
$commands[] = 'drupal:sync:public-files';
Expand Down
12 changes: 7 additions & 5 deletions src/Robo/Commands/Source/LinkPackageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ class LinkPackageCommand extends BltTasks {
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function linkComposer(array $options = [
'name' => 'acquia/blt',
'path' => '../../dev/blt',
'version-constraint' => '*',
]) {
public function linkComposer(
array $options = [
'name' => 'acquia/blt',
'path' => '../../dev/blt',
'version-constraint' => '*',
],
) {
$path_parts = explode('/', $options['path']);
$path_counts = array_count_values($path_parts);
$levels = $path_counts['..'];
Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Common/ArrayManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ArrayManipulator {
*/
public static function arrayMergeRecursiveDistinct(
array &$array1,
array &$array2
array &$array2,
) {
$merged = $array1;
foreach ($array2 as $key => &$value) {
Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Common/IO.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function askRequired($message) {
*/
protected function printArrayAsTable(
array $array,
array $headers = ['Property', 'Value']
array $headers = ['Property', 'Value'],
) {
$table = new Table($this->output);
$table->setHeaders($headers)
Expand Down
17 changes: 10 additions & 7 deletions src/Robo/Common/StringManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ public static function trimStartingLines($text, $num_lines) {
* @return mixed
* Safe string.
*/
public static function convertStringToMachineSafe($identifier, array $filter = [
' ' => '_',
'-' => '_',
'/' => '_',
'[' => '_',
']' => '',
]) {
public static function convertStringToMachineSafe(
$identifier,
array $filter = [
' ' => '_',
'-' => '_',
'/' => '_',
'[' => '_',
']' => '',
],
) {
$identifier = str_replace(array_keys($filter), array_values($filter), $identifier);
// Valid characters are:
// - a-z (U+0030 - U+0039)
Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Doctor/DoctorCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(
Config $config,
Inspector $inspector,
Executor $executor,
$drush_status
$drush_status,
) {
$this->setConfig($config);
$this->setInspector($inspector);
Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Exceptions/BltException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BltException extends \Exception {
public function __construct(
$message = "",
$code = 0,
\Throwable $previous = NULL
\Throwable $previous = NULL,
) {

$message .= "\nFor troubleshooting guidance and support, see https://docs.acquia.com/blt/support/";
Expand Down
8 changes: 4 additions & 4 deletions src/Robo/Hooks/InteractHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function setOutput(OutputInterface $output) {
public function interactGenerateSettingsFiles(
InputInterface $input,
OutputInterface $output,
AnnotationData $annotationData
AnnotationData $annotationData,
) {
/** @var \Acquia\Blt\Robo\Wizards\SetupWizard $setup_wizard */
$setup_wizard = $this->getContainer()->get(SetupWizard::class);
Expand All @@ -54,7 +54,7 @@ public function interactGenerateSettingsFiles(
public function interactInstallDrupal(
InputInterface $input,
OutputInterface $output,
AnnotationData $annotationData
AnnotationData $annotationData,
) {
/** @var \Acquia\Blt\Robo\Wizards\SetupWizard $setup_wizard */
$setup_wizard = $this->getContainer()->get(SetupWizard::class);
Expand All @@ -69,7 +69,7 @@ public function interactInstallDrupal(
public function interactExecuteUpdates(
InputInterface $input,
OutputInterface $output,
AnnotationData $annotationData
AnnotationData $annotationData,
) {
if ($this->invokeDepth == 0
&& $input->getFirstArgument() != 'blt:update'
Expand All @@ -94,7 +94,7 @@ public function interactExecuteUpdates(
public function interactConfigIdentical(
InputInterface $input,
OutputInterface $output,
AnnotationData $annotationData
AnnotationData $annotationData,
) {
$cm_strategies = [
'config-split',
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Robo/ArrayManipulatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ArrayManipulatorTest extends TestCase {
public function testArrayMergeRecursiveDistinct(
$array1,
$array2,
$expected_array
$expected_array,
) {
$this->assertEquals(ArrayManipulator::arrayMergeRecursiveDistinct($array1,
$array2), $expected_array);
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Robo/TextMungeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TextMungeTest extends TestCase {
public function testArrayMergeNoDuplicates(
$array1,
$array2,
$expected_array
$expected_array,
) {
$munged = TextMunge::arrayMergeNoDuplicates($array1, $array2);
$this->assertEquals($munged, $expected_array);
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Robo/YamlMungeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class YamlMungeTest extends TestCase {
public function testArrayMergeRecursiveExceptEmpty(
$array1,
$array2,
$expected_array
$expected_array,
) {
$this->assertEquals(YamlMunge::arrayMergeRecursiveExceptEmpty($array1,
$array2), $expected_array);
Expand Down

0 comments on commit b331b45

Please sign in to comment.