for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class ListInstalledModulesCommand extends SilverstripeCommand
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* @var string
*/
protected $name = 'list:modules';
protected $description = 'List all installed modules';
public function fire()
$this->table($this->getTableHeaders(), $this->getTableData());
}
protected function getTableHeaders()
return ['Module', 'Version'];
protected function getTableData()
return $this->getInstalledModules();
* @param string $file
* @return mixed
protected function parseComposerFile($file)
return json_decode(file_get_contents($file));
* @return string
protected function getRootComposerFile()
return BASE_PATH . '/vendor/composer/installed.json';
protected function getInstalledModules()
$content = $this->parseComposerFile($this->getRootComposerFile());
$rows = [];
foreach($content as $module) {
$rows[] = [$module->name, $module->version];
return $rows;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.