In the drush command definition hook for the Node Revision Delete project I have the following code:
use Drupal\node_revision_delete\Utility\Time;
...
function node_revision_delete_drush_command() {
$values = array_keys(Time::convertWordToTime());
The namespace exists and is in the correct place but once I use drush cr
I got this error:
Error: Uncaught Error: Class 'Drupal\node_revision_delete\Utility\Time' not found in /Users/adriancid/Sites/drupal84-test/modules/drupal.org/node_revision_delete/node_revision_delete.drush.inc:34
It's weird because I call the same function in the line 179 for the drush nrd-st
command and is working fine:
Time::convertWordToTime();
Trying to understand what happens I tried to use an Utility function from the Core in the drush definition command hook and works fine without problem, but with my function call it doesn't works.
Any idea about class not found problem?
hook_drush_command()
and I'm getting:\Drupal::$container is not initialized yet