cattr-app/server-application

View on GitHub
app/Console/Commands/ModuleVersion.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace App\Console\Commands;

use App\Helpers\Version;
use Illuminate\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'cattr:module:version')]
class ModuleVersion extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'cattr:module:version {module}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Get version of provided module';

    /**
     * Execute the console command.
     */
    public function handle(): void
    {
        $this->info((string)new Version($this->argument('module')));
    }
}