Skip to content
7 changes: 6 additions & 1 deletion robo-components/AutoUpdateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function updateModules() {
}
$this->say("Update module is installed, checking status of projects.");
$this->say("In case of some errors manually loading /admin/reports/updates can help.");
$this->yell("Don't forget to run ddev drush updb manually at the end!");

if (!($available = update_get_available(TRUE))) {
$this->say("Cannot fetch info about the releases.");
Expand Down Expand Up @@ -125,6 +124,12 @@ public function updateModules() {
$git_command = "git commit -m 'Update " . $package . ' to ' . $version . "'";
$this->taskExec($git_command)->printOutput(TRUE)->run();
}
// Composer audit can show vulnerabilities.
$exit_code = $this->taskExec('bash -lc "exec composer audit"')
Comment thread
balagan73 marked this conversation as resolved.
Outdated
->printOutput(TRUE)
->run();
$this->yell("Now run ddev drush updb manually!");

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected function isImageSource(string $path) {
* @throws \Exception
*/
protected function getFileNameFromPath(string $path) {
$file_name = $this->fileSystem->basename($path);
$file_name = basename($path);
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getFileNameFromPath() no longer uses $this->fileSystem, and a repo-wide search shows no other references to $this->fileSystem in this class. This leaves an unused FileSystemInterface import/property (and likely unused service injection in subclasses), which is confusing and can drift over time. Either revert to using the Drupal file system service here, or remove the unused property/import and any related injection.

Suggested change
$file_name = basename($path);
$file_name = $this->fileSystem->basename($path);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileSystemInterface::basename() was deprecated in Drupal 9.3 and removed in Drupal 11. Use PHP's native basename() instead:

if (empty($file_name)) {
throw new \Exception(sprintf('File name cannot be found for path: %s', $path));
}
Expand Down
Loading