diff --git a/bin/acli b/bin/acli index 2a3a576ae..5c8c5c150 100755 --- a/bin/acli +++ b/bin/acli @@ -73,7 +73,7 @@ if (in_array($input->getFirstArgument(), ['clear-kernel-cache', 'ckc'])) { $kernel_cache_dir = $kernel->getCacheDir(); $filesystem->remove([$kernel_cache_dir]); $filesystem->mkdir($kernel_cache_dir); - $filesystem->touch("{$kernel_cache_dir}/.gitkeep"); + $filesystem->touch("$kernel_cache_dir/.gitkeep"); exit; } diff --git a/src/Command/Api/ApiCommandHelper.php b/src/Command/Api/ApiCommandHelper.php index bbe360d15..f2beb3dd9 100644 --- a/src/Command/Api/ApiCommandHelper.php +++ b/src/Command/Api/ApiCommandHelper.php @@ -164,7 +164,7 @@ private function addPostArgumentUsageToExample(mixed $requestBody, mixed $propKe if (array_key_exists('example', $requestBodyContent)) { $example = $requestBodyContent['example']; - $prefix = $type === 'argument' ? '' : "--{$propKey}="; + $prefix = $type === 'argument' ? '' : "--$propKey="; if (array_key_exists($propKey, $example)) { switch ($paramDefinition['type']) { case 'object': @@ -194,7 +194,7 @@ private function addPostArgumentUsageToExample(mixed $requestBody, mixed $propKe } else { $value = $example[$propKey]; } - $usage .= $prefix . "\"{$value}\" "; + $usage .= $prefix . "\"$value\" "; break; } } @@ -486,7 +486,7 @@ private function generateApiListCommands(array $apiCommands, string $commandPref $command->setName($name); $command->setNamespace($name); $command->setAliases([]); - $command->setDescription("List all API commands for the {$namespace} resource"); + $command->setDescription("List all API commands for the $namespace resource"); $apiListCommands[$name] = $command; } } diff --git a/src/Command/App/From/Recommendation/DefinedRecommendation.php b/src/Command/App/From/Recommendation/DefinedRecommendation.php index a59677d99..c62045d12 100644 --- a/src/Command/App/From/Recommendation/DefinedRecommendation.php +++ b/src/Command/App/From/Recommendation/DefinedRecommendation.php @@ -228,7 +228,7 @@ public function normalize(): array // phpcs:disable SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys $normalized = [ 'type' => 'packageRecommendation', - 'id' => "{$this->packageName}:{$this->versionConstraint}", + 'id' => "$this->packageName:$this->versionConstraint", 'attributes' => [ 'requirePackage' => [ 'name' => $this->packageName, diff --git a/src/Command/App/UnlinkCommand.php b/src/Command/App/UnlinkCommand.php index f2d07ae20..7e0b03242 100644 --- a/src/Command/App/UnlinkCommand.php +++ b/src/Command/App/UnlinkCommand.php @@ -25,7 +25,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $application = $this->getCloudApplication($this->datastoreAcli->get('cloud_app_uuid')); $this->datastoreAcli->set('cloud_app_uuid', null); - $output->writeln("Unlinked $projectDir from Cloud application {$application->name}"); + $output->writeln("Unlinked $projectDir from Cloud application $application->name"); return Command::SUCCESS; } diff --git a/src/Command/Archive/ArchiveExportCommand.php b/src/Command/Archive/ArchiveExportCommand.php index 8fca0966a..9539247e8 100644 --- a/src/Command/Archive/ArchiveExportCommand.php +++ b/src/Command/Archive/ArchiveExportCommand.php @@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $randomString = (string) random_int(10000, 100000); $tempDirName = 'acli-archive-' . basename($this->dir) . '-' . time() . '-' . $randomString; $archiveTempDir = Path::join(sys_get_temp_dir(), $tempDirName); - $this->io->confirm("This will generate a new archive in {$this->destinationDir} containing the contents of your Drupal application at {$this->dir}.\n Do you want to continue?"); + $this->io->confirm("This will generate a new archive in $this->destinationDir containing the contents of your Drupal application at $this->dir.\n Do you want to continue?"); $this->checklist->addItem('Removing temporary artifact directory'); $this->checklist->updateProgressBar("Removing $archiveTempDir"); @@ -98,7 +98,7 @@ private function determineDestinationDir(InputInterface $input): void { $this->destinationDir = $input->getArgument('destination-dir'); if (!$this->fs->exists($this->destinationDir)) { - throw new AcquiaCliException("The destination directory {$this->destinationDir} does not exist!"); + throw new AcquiaCliException("The destination directory $this->destinationDir does not exist!"); } } @@ -107,7 +107,7 @@ private function determineDestinationDir(InputInterface $input): void */ private function createArchiveDirectory(string $artifactDir): void { - $this->checklist->updateProgressBar("Mirroring source files from {$this->dir} to {$artifactDir}"); + $this->checklist->updateProgressBar("Mirroring source files from $this->dir to $artifactDir"); $originFinder = $this->localMachineHelper->getFinder(); $originFinder->files()->in($this->dir) // Include dot files like .htaccess. diff --git a/src/Command/CodeStudio/CodeStudioCommandTrait.php b/src/Command/CodeStudio/CodeStudioCommandTrait.php index 170cc1dae..266444b87 100644 --- a/src/Command/CodeStudio/CodeStudioCommandTrait.php +++ b/src/Command/CodeStudio/CodeStudioCommandTrait.php @@ -184,14 +184,14 @@ private function determineGitLabProject(ApplicationResponse $cloudApplication): $projects, 'id', 'path_with_namespace', - "Found multiple projects that could match the {$cloudApplication->name} application. Choose which one to configure." + "Found multiple projects that could match the $cloudApplication->name application. Choose which one to configure." ); } // Prompt to create project. $this->io->writeln([ "", - "Could not find any existing Code Studio project for Acquia Cloud Platform application {$cloudApplication->name}.", - "Searched for UUID {$cloudApplication->uuid} in project descriptions.", + "Could not find any existing Code Studio project for Acquia Cloud Platform application $cloudApplication->name.", + "Searched for UUID $cloudApplication->uuid in project descriptions.", ]); $createProject = $this->io->confirm('Would you like to create a new Code Studio project? If you select "no" you may choose from a full list of existing projects.'); if ($createProject) { @@ -202,7 +202,7 @@ private function determineGitLabProject(ApplicationResponse $cloudApplication): $this->gitLabClient->projects()->all(), 'id', 'path_with_namespace', - "Choose a Code Studio project to configure for the {$cloudApplication->name} application" + "Choose a Code Studio project to configure for the $cloudApplication->name application" ); } diff --git a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php index 83abdc3b6..1ee1f6fd1 100644 --- a/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php +++ b/src/Command/CodeStudio/CodeStudioPipelinesMigrateCommand.php @@ -88,7 +88,7 @@ private function checkGitLabCiCdVariables(array $project): void $existingKeys = array_column($gitlabCicdExistingVariables, 'key'); foreach ($gitlabCicdVariables as $gitlabCicdVariable) { if (!in_array($gitlabCicdVariable, $existingKeys, true)) { - throw new AcquiaCliException("Code Studio CI/CD variable {$gitlabCicdVariable} is not configured properly"); + throw new AcquiaCliException("Code Studio CI/CD variable $gitlabCicdVariable is not configured properly"); } } } diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 8de74f368..9c4ab7e37 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -104,10 +104,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->io->writeln([ "", "This command will configure the Code Studio project {$project['path_with_namespace']} for automatic deployment to the", - "Acquia Cloud Platform application {$cloudApplication->name} ($appUuid)", - "using credentials (API Token and SSH Key) belonging to {$account->mail}.", + "Acquia Cloud Platform application $cloudApplication->name ($appUuid)", + "using credentials (API Token and SSH Key) belonging to $account->mail.", "", - "If the {$account->mail} Cloud account is deleted in the future, this Code Studio project will need to be re-configured.", + "If the $account->mail Cloud account is deleted in the future, this Code Studio project will need to be re-configured.", ]); $answer = $this->io->confirm('Do you want to continue?'); if (!$answer) { @@ -142,7 +142,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int " git remote add codestudio {$project['http_url_to_repo']}", " git push codestudio", ]); - $this->io->note(["If the {$account->mail} Cloud account is deleted in the future, this Code Studio project will need to be re-configured."]); + $this->io->note(["If the $account->mail Cloud account is deleted in the future, this Code Studio project will need to be re-configured."]); return Command::SUCCESS; } diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 2f17d3788..a8f56a816 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -743,7 +743,7 @@ private function findCloudApplicationByGitUrl( $terminalWidth = (new Terminal())->getWidth(); foreach ($customerApplications as $application) { // Ensure that the message takes up the full terminal width to prevent display artifacts. - $message = "Searching {$application->name} for matching git URLs"; + $message = "Searching $application->name for matching git URLs"; $suffixLength = $terminalWidth - strlen($message) - 17; $suffix = $suffixLength > 0 ? str_repeat(' ', $suffixLength) : ''; $progressBar->setMessage($message . $suffix); @@ -789,7 +789,7 @@ private function searchApplicationEnvironmentsForGitUrl( ): ?ApplicationResponse { foreach ($applicationEnvironments as $environment) { if ($environment->flags->production && in_array($environment->vcs->url, $localGitRemotes, true)) { - $this->logger->debug("Found matching Cloud application! {$application->name} with uuid {$application->uuid} matches local git URL {$environment->vcs->url}"); + $this->logger->debug("Found matching Cloud application! $application->name with uuid $application->uuid matches local git URL {$environment->vcs->url}"); return $application; } @@ -809,7 +809,7 @@ protected function inferCloudAppFromLocalGitConfig( Client $acquiaCloudClient ): ?ApplicationResponse { if ($this->projectDir && $this->input->isInteractive()) { - $this->output->writeln("There is no Cloud Platform application linked to {$this->projectDir}/.git."); + $this->output->writeln("There is no Cloud Platform application linked to $this->projectDir/.git."); $answer = $this->io->confirm('Would you like Acquia CLI to search for a Cloud application that matches your local git config?'); if ($answer) { $this->output->writeln('Searching for a matching Cloud application...'); @@ -976,7 +976,7 @@ public static function validateUuid(string $uuid): string private function saveCloudUuidToDatastore(ApplicationResponse $application): bool { $this->datastoreAcli->set('cloud_app_uuid', $application->uuid); - $this->io->success("The Cloud application {$application->name} has been linked to this repository by writing to {$this->datastoreAcli->filepath}"); + $this->io->success("The Cloud application $application->name has been linked to this repository by writing to {$this->datastoreAcli->filepath}"); return true; } @@ -1102,7 +1102,7 @@ private function doGetEnvFromAlias(string $alias): EnvironmentResponse $environments = $environmentsResource->getAll($customerApplication->uuid); foreach ($environments as $environment) { if ($environment->name === $environmentAlias) { - $this->logger->debug("Found environment {$environment->uuid} matching $environmentAlias."); + $this->logger->debug("Found environment $environment->uuid matching $environmentAlias."); return $environment; } @@ -1158,7 +1158,7 @@ private function doGetApplicationFromAlias(string $applicationAlias): mixed $customerApplication = $customerApplications[0]; - $this->logger->debug("Found application {$customerApplication->uuid} matching alias $applicationAlias."); + $this->logger->debug("Found application $customerApplication->uuid matching alias $applicationAlias."); return $customerApplication; } @@ -1474,9 +1474,9 @@ private function getCloudSites(EnvironmentResponse $cloudEnvironment): array protected function getCloudSitesPath(mixed $cloudEnvironment, mixed $sitegroup): string { if ($cloudEnvironment->platform === 'cloud-next') { - $path = "/home/clouduser/{$cloudEnvironment->name}/sites"; + $path = "/home/clouduser/$cloudEnvironment->name/sites"; } else { - $path = "/mnt/files/$sitegroup.{$cloudEnvironment->name}/sites"; + $path = "/mnt/files/$sitegroup.$cloudEnvironment->name/sites"; } return $path; } @@ -1680,7 +1680,7 @@ protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string 'mysqldump', 'gzip', ]); - $filename = "acli-mysql-dump-{$dbName}.sql.gz"; + $filename = "acli-mysql-dump-$dbName.sql.gz"; $localTempDir = sys_get_temp_dir(); $localFilepath = $localTempDir . '/' . $filename; $this->logger->debug("Dumping MySQL database to $localFilepath on this machine"); @@ -1692,10 +1692,10 @@ protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string $outputCallback('out', "Dumping MySQL database to $localFilepath on this machine"); } if ($this->localMachineHelper->commandExists('pv')) { - $command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | pv --rate --bytes | gzip -9 > $localFilepath\""; + $command = "bash -c \"set -o pipefail; MYSQL_PWD=$dbPassword mysqldump --host=$dbHost --user=$dbUser $dbName | pv --rate --bytes | gzip -9 > $localFilepath\""; } else { $this->io->warning('Install `pv` to see progress bar'); - $command = "bash -c \"set -o pipefail; MYSQL_PWD={$dbPassword} mysqldump --host={$dbHost} --user={$dbUser} {$dbName} | gzip -9 > $localFilepath\""; + $command = "bash -c \"set -o pipefail; MYSQL_PWD=$dbPassword mysqldump --host=$dbHost --user=$dbUser $dbName | gzip -9 > $localFilepath\""; } $process = $this->localMachineHelper->executeFromCmd($command, $outputCallback, null, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL)); @@ -1918,17 +1918,17 @@ protected function waitForNotificationToComplete(Client $acquiaCloudClient, stri private function writeCompletedMessage(NotificationResponse $notification): void { if ($notification->status === 'completed') { - $this->io->success("The task with notification uuid {$notification->uuid} completed"); + $this->io->success("The task with notification uuid $notification->uuid completed"); } elseif ($notification->status === 'failed') { - $this->io->error("The task with notification uuid {$notification->uuid} failed"); + $this->io->error("The task with notification uuid $notification->uuid failed"); } else { - throw new AcquiaCliException("Unknown task status: {$notification->status}"); + throw new AcquiaCliException("Unknown task status: $notification->status"); } $duration = strtotime($notification->completed_at) - strtotime($notification->created_at); $completedAt = date("D M j G:i:s T Y", strtotime($notification->completed_at)); - $this->io->writeln("Progress: {$notification->progress}"); + $this->io->writeln("Progress: $notification->progress"); $this->io->writeln("Completed: $completedAt"); - $this->io->writeln("Task type: {$notification->label}"); + $this->io->writeln("Task type: $notification->label"); $this->io->writeln("Duration: $duration seconds"); } @@ -1959,7 +1959,7 @@ private static function getNotificationUuidFromUrl(string $notificationUrl): str protected function validateRequiredCloudPermissions(Client $acquiaCloudClient, ?string $cloudApplicationUuid, AccountResponse $account, array $requiredPermissions): void { - $permissions = $acquiaCloudClient->request('get', "/applications/{$cloudApplicationUuid}/permissions"); + $permissions = $acquiaCloudClient->request('get', "/applications/$cloudApplicationUuid/permissions"); $keyedPermissions = []; foreach ($permissions as $permission) { $keyedPermissions[$permission->name] = $permission; diff --git a/src/Command/Env/EnvDeleteCommand.php b/src/Command/Env/EnvDeleteCommand.php index e4c8488f9..0818b9309 100644 --- a/src/Command/Env/EnvDeleteCommand.php +++ b/src/Command/Env/EnvDeleteCommand.php @@ -33,7 +33,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $environmentsResource->delete($environment->uuid); $this->io->success([ - "The {$environment->label} environment is being deleted", + "The $environment->label environment is being deleted", ]); return Command::SUCCESS; diff --git a/src/Command/Env/EnvMirrorCommand.php b/src/Command/Env/EnvMirrorCommand.php index 18d1f0db6..0b2b871e6 100644 --- a/src/Command/Env/EnvMirrorCommand.php +++ b/src/Command/Env/EnvMirrorCommand.php @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $destinationEnvironment = $environmentsResource->get($destinationEnvironmentUuid); $this->checklist->completePreviousItem(); - $answer = $this->io->confirm("Are you sure that you want to overwrite everything on {$destinationEnvironment->label} ({$destinationEnvironment->name}) and replace it with source data from {$sourceEnvironment->label} ({$sourceEnvironment->name})"); + $answer = $this->io->confirm("Are you sure that you want to overwrite everything on $destinationEnvironment->label ($destinationEnvironment->name) and replace it with source data from $sourceEnvironment->label ($sourceEnvironment->name)"); if (!$answer) { return 1; } @@ -92,7 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $this->io->success([ - "Done! {$destinationEnvironment->label} now matches {$sourceEnvironment->label}", + "Done! $destinationEnvironment->label now matches $sourceEnvironment->label", "You can visit it here:", "https://" . $destinationEnvironment->domains[0], ]); @@ -117,7 +117,7 @@ private function mirrorDatabase(Client $acquiaCloudClient, mixed $sourceEnvironm $databasesResource = new Databases($acquiaCloudClient); $databases = $acquiaCloudClient->request('get', "/environments/$sourceEnvironmentUuid/databases"); $defaultDatabase = $this->getDefaultDatabase($databases); - $outputCallback('out', "Copying {$defaultDatabase->name}"); + $outputCallback('out', "Copying $defaultDatabase->name"); // @todo Create database if its missing. $dbCopyResponse = $databasesResource->copy($sourceEnvironmentUuid, $defaultDatabase->name, $destinationEnvironmentUuid); diff --git a/src/Command/Ide/IdeListCommand.php b/src/Command/Ide/IdeListCommand.php index 37bd43a86..f25e4612c 100644 --- a/src/Command/Ide/IdeListCommand.php +++ b/src/Command/Ide/IdeListCommand.php @@ -36,7 +36,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $table->setHeaders(['IDEs']); foreach ($applicationIdes as $ide) { $table->addRows([ - ["{$ide->label} ({$ide->owner->mail})"], + ["$ide->label ({$ide->owner->mail})"], ["IDE URL: links->ide->href}>{$ide->links->ide->href}"], ["Web URL: links->web->href}>{$ide->links->web->href}"], new TableSeparator(), diff --git a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php index 27814df56..c6cdf6443 100644 --- a/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php +++ b/src/Command/Ide/Wizard/IdeWizardDeleteSshKeyCommand.php @@ -37,7 +37,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->deleteSshKeyFromCloud($output, $cloudKey); $this->deleteLocalSshKey(); - $this->output->writeln("Deleted local files {$this->publicSshKeyFilepath} and {$this->privateSshKeyFilepath}"); + $this->output->writeln("Deleted local files $this->publicSshKeyFilepath and $this->privateSshKeyFilepath"); return Command::SUCCESS; } diff --git a/src/Command/Pull/PullCommandBase.php b/src/Command/Pull/PullCommandBase.php index 75ca778b9..5a12dec73 100644 --- a/src/Command/Pull/PullCommandBase.php +++ b/src/Command/Pull/PullCommandBase.php @@ -582,9 +582,9 @@ private function printDatabaseBackupInfo( $interval = time() - strtotime($backupResponse->completedAt); $hoursInterval = floor($interval / 60 / 60); $dateFormatted = date("D M j G:i:s T Y", strtotime($backupResponse->completedAt)); - $webLink = "https://cloud.acquia.com/a/environments/{$sourceEnvironment->uuid}/databases"; + $webLink = "https://cloud.acquia.com/a/environments/$sourceEnvironment->uuid/databases"; $messages = [ - "Using a database backup that is $hoursInterval hours old. Backup #$backupResponse->id was created at {$dateFormatted}.", + "Using a database backup that is $hoursInterval hours old. Backup #$backupResponse->id was created at $dateFormatted.", "You can view your backups here: $webLink", "To generate a new backup, re-run this command with the --on-demand option.", ]; @@ -603,11 +603,11 @@ private function importRemoteDatabase(DatabaseResponse $database, string $localF } elseif (AcquiaDrupalEnvironmentDetector::isAhIdeEnv() && !getenv('IDE_ENABLE_MULTISITE')) { // Import non-default db into default db. Needed on legacy IDE without multiple dbs. // @todo remove this case once all IDEs support multiple dbs. - $this->io->note("Cloud IDE only supports importing into the default Drupal database. Acquia CLI will import the NON-DEFAULT database {$database->name} into the DEFAULT database {$this->getLocalDbName()}"); + $this->io->note("Cloud IDE only supports importing into the default Drupal database. Acquia CLI will import the NON-DEFAULT database $database->name into the DEFAULT database {$this->getLocalDbName()}"); $this->doImportRemoteDatabase($this->getLocalDbHost(), $this->getLocalDbUser(), $this->getLocalDbName(), $this->getLocalDbPassword(), $localFilepath, $outputCallback); } else { // Import non-default db into non-default db. - $this->io->note("Acquia CLI assumes that the local name for the {$database->name} database is also {$database->name}"); + $this->io->note("Acquia CLI assumes that the local name for the $database->name database is also $database->name"); if (AcquiaDrupalEnvironmentDetector::isLandoEnv() || AcquiaDrupalEnvironmentDetector::isAhIdeEnv()) { $this->doImportRemoteDatabase($this->getLocalDbHost(), 'root', $database->name, '', $localFilepath, $outputCallback); } else { diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index b893f11e7..26b0a7bd0 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -34,7 +34,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $databases = $this->determineCloudDatabases($acquiaCloudClient, $destinationEnvironment, $input->getArgument('site')); // We only support pushing a single database. $database = $databases[0]; - $answer = $this->io->confirm("Overwrite the $database->name database on {$destinationEnvironment->name} with a copy of the database from the current machine?"); + $answer = $this->io->confirm("Overwrite the $database->name database on $destinationEnvironment->name with a copy of the database from the current machine?"); if (!$answer) { return Command::SUCCESS; } @@ -87,7 +87,7 @@ private function uploadDatabaseDump( private function importDatabaseDumpOnRemote(EnvironmentResponse $environment, string $remoteDumpFilepath, DatabaseResponse $database): void { $this->logger->debug("Importing $remoteDumpFilepath to MySQL on remote machine"); - $command = "pv $remoteDumpFilepath --bytes --rate | gunzip | MYSQL_PWD={$database->password} mysql --host={$this->getHostFromDatabaseResponse($environment, $database)} --user={$database->user_name} {$this->getNameFromDatabaseResponse($database)}"; + $command = "pv $remoteDumpFilepath --bytes --rate | gunzip | MYSQL_PWD=$database->password mysql --host={$this->getHostFromDatabaseResponse($environment, $database)} --user=$database->user_name {$this->getNameFromDatabaseResponse($database)}"; $process = $this->sshHelper->executeCommand($environment->sshUrl, [$command], ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL)); if (!$process->isSuccessful()) { throw new AcquiaCliException('Unable to import database on remote machine. {message}', ['message' => $process->getErrorOutput()]); diff --git a/tests/phpunit/src/CommandTestBase.php b/tests/phpunit/src/CommandTestBase.php index c96fb653c..46f89217a 100644 --- a/tests/phpunit/src/CommandTestBase.php +++ b/tests/phpunit/src/CommandTestBase.php @@ -155,7 +155,7 @@ protected function writeFullWidthLine(string $message, OutputInterface $output): $terminalWidth = (new Terminal())->getWidth(); $paddingLen = (int) (($terminalWidth - strlen($message)) / 2); $pad = $paddingLen > 0 ? str_repeat('-', $paddingLen) : ''; - $output->writeln("{$pad}{$message}{$pad}"); + $output->writeln("$pad$message$pad"); } /** @@ -311,7 +311,7 @@ protected function mockGetCloudSites(mixed $sshHelper, mixed $environment): void $sitegroup = reset($parts); $sshHelper->executeCommand( Argument::type('string'), - ['ls', "/mnt/files/$sitegroup.{$environment->name}/sites"], + ['ls', "/mnt/files/$sitegroup.$environment->name/sites"], false )->willReturn($cloudMultisiteFetchProcess->reveal())->shouldBeCalled(); } @@ -344,7 +344,7 @@ static function (mixed $databaseResponse) { ); $this->clientProphecy->request( 'get', - "/environments/{$environmentsResponse->id}/databases" + "/environments/$environmentsResponse->id/databases" ) ->willReturn($databasesResponse) ->shouldBeCalled(); @@ -369,14 +369,14 @@ protected function mockDatabaseBackupsResponse( if ($existingBackups) { $this->clientProphecy->request( 'get', - "/environments/{$environmentsResponse->id}/databases/$dbName/backups" + "/environments/$environmentsResponse->id/databases/$dbName/backups" ) ->willReturn($databaseBackupsResponse->_embedded->items) ->shouldBeCalled(); } else { $this->clientProphecy->request( 'get', - "/environments/{$environmentsResponse->id}/databases/$dbName/backups" + "/environments/$environmentsResponse->id/databases/$dbName/backups" ) ->willReturn([], $databaseBackupsResponse->_embedded->items) ->shouldBeCalled(); @@ -391,7 +391,7 @@ protected function mockDownloadBackupResponse( mixed $backupId ): void { $stream = $this->prophet->prophesize(StreamInterface::class); - $this->clientProphecy->stream('get', "/environments/{$environmentsResponse->id}/databases/{$dbName}/backups/{$backupId}/actions/download", []) + $this->clientProphecy->stream('get', "/environments/$environmentsResponse->id/databases/$dbName/backups/$backupId/actions/download", []) ->willReturn($stream->reveal()) ->shouldBeCalled(); } @@ -401,7 +401,7 @@ protected function mockDatabaseBackupCreateResponse( mixed $dbName ): mixed { $backupCreateResponse = $this->getMockResponseFromSpec('/environments/{environmentId}/databases/{databaseName}/backups', 'post', 202)->{'Creating backup'}->value; - $this->clientProphecy->request('post', "/environments/$environmentsResponse->id/databases/{$dbName}/backups") + $this->clientProphecy->request('post', "/environments/$environmentsResponse->id/databases/$dbName/backups") ->willReturn($backupCreateResponse) ->shouldBeCalled(); @@ -686,7 +686,7 @@ protected function mockGitLabPermissionsRequest(mixed $applicationUuid): array $permission = clone reset($permissions); $permission->name = "administer environment variables on non-prod"; $permissions[] = $permission; - $this->clientProphecy->request('get', "/applications/{$applicationUuid}/permissions") + $this->clientProphecy->request('get', "/applications/$applicationUuid/permissions") ->willReturn($permissions) ->shouldBeCalled(); return $permissions; diff --git a/tests/phpunit/src/Commands/App/AppVcsInfoTest.php b/tests/phpunit/src/Commands/App/AppVcsInfoTest.php index 304f1f17d..3d7c42665 100644 --- a/tests/phpunit/src/Commands/App/AppVcsInfoTest.php +++ b/tests/phpunit/src/Commands/App/AppVcsInfoTest.php @@ -118,7 +118,7 @@ public function testNoDeployedVcs(): void $this->clientProphecy->request( 'get', - "/applications/{$application->uuid}/environments" + "/applications/$application->uuid/environments" ) ->willReturn($environments) ->shouldBeCalled(); diff --git a/tests/phpunit/src/Commands/Email/EmailInfoForSubscriptionCommandTest.php b/tests/phpunit/src/Commands/Email/EmailInfoForSubscriptionCommandTest.php index 8ac115a92..7ea67c3da 100644 --- a/tests/phpunit/src/Commands/Email/EmailInfoForSubscriptionCommandTest.php +++ b/tests/phpunit/src/Commands/Email/EmailInfoForSubscriptionCommandTest.php @@ -127,7 +127,7 @@ public function testEmailInfoForSubscriptionWith101Apps(): void ->willReturn($applicationsResponse->_embedded->items); foreach ($applicationsResponse->_embedded->items as $app) { - $this->clientProphecy->request('get', "/applications/{$app->uuid}/email/domains") + $this->clientProphecy->request('get', "/applications/$app->uuid/email/domains") ->willReturn([]); } diff --git a/tests/phpunit/src/Commands/Env/EnvDeleteCommandTest.php b/tests/phpunit/src/Commands/Env/EnvDeleteCommandTest.php index deb1eb431..2b7de8555 100644 --- a/tests/phpunit/src/Commands/Env/EnvDeleteCommandTest.php +++ b/tests/phpunit/src/Commands/Env/EnvDeleteCommandTest.php @@ -126,7 +126,7 @@ public function testNoEnvironmentArgumentPassed(): void } $this->clientProphecy->request( 'get', - "/applications/{$application->uuid}/environments" + "/applications/$application->uuid/environments" ) ->willReturn($environments) ->shouldBeCalled(); diff --git a/tests/phpunit/src/Commands/Env/EnvMirrorCommandTest.php b/tests/phpunit/src/Commands/Env/EnvMirrorCommandTest.php index 1f1d8c987..8882e7d91 100644 --- a/tests/phpunit/src/Commands/Env/EnvMirrorCommandTest.php +++ b/tests/phpunit/src/Commands/Env/EnvMirrorCommandTest.php @@ -28,7 +28,7 @@ public function testEnvironmentMirror(): void $response->links = $response->{'_links'}; $this->clientProphecy->request( 'post', - "/environments/{$environmentResponse->id}/code/actions/switch", + "/environments/$environmentResponse->id/code/actions/switch", [ 'form_params' => [ 'branch' => $environmentResponse->vcs->path, @@ -41,7 +41,7 @@ public function testEnvironmentMirror(): void $databasesResponse = $this->getMockResponseFromSpec("/environments/{environmentId}/databases", 'get', '200'); $this->clientProphecy->request( 'get', - "/environments/{$environmentResponse->id}/databases" + "/environments/$environmentResponse->id/databases" ) ->willReturn($databasesResponse->_embedded->items) ->shouldBeCalled(); @@ -50,7 +50,7 @@ public function testEnvironmentMirror(): void $response = $dbCopyResponse->{'Database being copied'}->value; $this->mockNotificationResponseFromObject($response); $response->links = $response->{'_links'}; - $this->clientProphecy->request('post', "/environments/{$environmentResponse->id}/databases", [ + $this->clientProphecy->request('post', "/environments/$environmentResponse->id/databases", [ 'json' => [ 'name' => $databasesResponse->_embedded->items[0]->name, 'source' => $environmentResponse->id, @@ -63,7 +63,7 @@ public function testEnvironmentMirror(): void $response = $filesCopyResponse->{'Files queued for copying'}->value; $this->mockNotificationResponseFromObject($response); $response->links = $response->{'_links'}; - $this->clientProphecy->request('post', "/environments/{$environmentResponse->id}/files", [ + $this->clientProphecy->request('post', "/environments/$environmentResponse->id/files", [ 'json' => [ 'source' => $environmentResponse->id, ], @@ -72,7 +72,7 @@ public function testEnvironmentMirror(): void ->shouldBeCalled(); $environmentUpdateResponse = $this->getMockResponseFromSpec("/environments/{environmentId}", 'put', '202'); - $this->clientProphecy->request('put', "/environments/{$environmentResponse->id}", Argument::type('array')) + $this->clientProphecy->request('put', "/environments/$environmentResponse->id", Argument::type('array')) ->willReturn($environmentUpdateResponse) ->shouldBeCalled(); $this->mockNotificationResponseFromObject($environmentUpdateResponse); @@ -94,6 +94,6 @@ public function testEnvironmentMirror(): void $this->assertStringContainsString("Switching to {$environmentResponse->vcs->path}", $output); $this->assertStringContainsString("Copying {$databasesResponse->_embedded->items[0]->name}", $output); $this->assertStringContainsString("Copying PHP version, acpu memory limit, etc.", $output); - $this->assertStringContainsString("[OK] Done! {$environmentResponse->label} now matches {$environmentResponse->label}", $output); + $this->assertStringContainsString("[OK] Done! $environmentResponse->label now matches $environmentResponse->label", $output); } } diff --git a/tests/phpunit/src/Commands/Pull/PullCodeCommandTest.php b/tests/phpunit/src/Commands/Pull/PullCodeCommandTest.php index e9defea1b..137532eb5 100644 --- a/tests/phpunit/src/Commands/Pull/PullCodeCommandTest.php +++ b/tests/phpunit/src/Commands/Pull/PullCodeCommandTest.php @@ -279,7 +279,7 @@ public function testMatchPhpVersion(string $phpVersion): void $output = $this->getDisplay(); IdeHelper::unsetCloudIdeEnvVars(); - $message = "Would you like to change the PHP version on this IDE to match the PHP version on the {$environmentResponse->label} ({$environmentResponse->configuration->php->version}) environment?"; + $message = "Would you like to change the PHP version on this IDE to match the PHP version on the $environmentResponse->label ({$environmentResponse->configuration->php->version}) environment?"; if ($phpVersion === '7.1') { $this->assertStringNotContainsString($message, $output); } else { diff --git a/tests/phpunit/src/Commands/Pull/PullCommandTestBase.php b/tests/phpunit/src/Commands/Pull/PullCommandTestBase.php index 22bb890a7..5498eb3f3 100644 --- a/tests/phpunit/src/Commands/Pull/PullCommandTestBase.php +++ b/tests/phpunit/src/Commands/Pull/PullCommandTestBase.php @@ -374,7 +374,7 @@ protected function mockDownloadBackup(object $database, object $environment, obj $requestException = $this->prophet->prophesize(RequestException::class); $requestException->getHandlerContext() ->willReturn(['errno' => $curlCode]); - $this->clientProphecy->stream('get', "/environments/{$environment->id}/databases/{$database->name}/backups/1/actions/download", []) + $this->clientProphecy->stream('get', "/environments/$environment->id/databases/$database->name/backups/1/actions/download", []) ->willThrow($requestException->reveal()) ->shouldBeCalled(); $response = $this->prophet->prophesize(ResponseInterface::class); @@ -382,7 +382,7 @@ protected function mockDownloadBackup(object $database, object $environment, obj ->willReturn($response->reveal()) ->shouldBeCalled(); $domainsResponse = $this->getMockResponseFromSpec('/environments/{environmentId}/domains', 'get', 200); - $this->clientProphecy->request('get', "/environments/{$environment->id}/domains") + $this->clientProphecy->request('get', "/environments/$environment->id/domains") ->willReturn($domainsResponse->_embedded->items); $this->command->setBackupDownloadUrl(new Uri('https://www.example.com/download-backup')); } else { diff --git a/tests/phpunit/src/Commands/WizardTestBase.php b/tests/phpunit/src/Commands/WizardTestBase.php index 36ff823c9..727b8c8a9 100644 --- a/tests/phpunit/src/Commands/WizardTestBase.php +++ b/tests/phpunit/src/Commands/WizardTestBase.php @@ -54,7 +54,7 @@ public static function getEnvVars(): array protected function runTestCreate(): void { $environmentsResponse = $this->getMockEnvironmentsResponse(); - $this->clientProphecy->request('get', "/applications/{$this::$applicationUuid}/environments") + $this->clientProphecy->request('get', "/applications/" . $this::$applicationUuid . "/environments") ->willReturn($environmentsResponse->_embedded->items) ->shouldBeCalled(); $request = $this->getMockRequestBodyFromSpec('/account/ssh-keys'); @@ -127,7 +127,7 @@ protected function runTestSshKeyAlreadyUploaded(): void ->shouldBeCalled(); $environmentsResponse = $this->getMockEnvironmentsResponse(); - $this->clientProphecy->request('get', "/applications/{$this::$applicationUuid}/environments") + $this->clientProphecy->request('get', "/applications/" . $this::$applicationUuid . "/environments") ->willReturn($environmentsResponse->_embedded->items) ->shouldBeCalled();