PHP code example of switon / command

1. Go to this page and download the library: Download switon/command library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

switon / command example snippets


use Switon\Command\Attribute\Hidden;
use Switon\Command\Attribute\Tool;

class ReportCommand
{
    #[Hidden]
    #[Tool('Returns JSON: report status by id.')]
    public function statusAction(string $id): array
    {
        return ['id' => $id, 'status' => 'ready'];
    }
}