mrjulio/rapture-command

Rapture CLI command component

v1.0.1 2017-11-18 19:10 UTC

This package is not auto-updated.

Last update: 2024-11-02 16:19:15 UTC


README

PhpVersion License

Simple PHP command class.

Requirements

  • PHP v5.4

Install

composer require mrjulio/rapture-command

Quick start

namespace AppName\Domain\Command;

class DayOfWeek extends Command
{
	public static function getOptions()
    {
        return [
            'd' => ['date', self::REQUIRED, 'Date', null],
        ];
    }
    
    public function execute()
    {
    	$date = new \DateTime($this->getOption('date'));
        
        $this->output($date->format('W'));
    }
}
# run inside \AppName\Domain\Command
php console.php --cmd=DayOfWeek --env=dev --date=2017-01-01

About

Author

Iulian N. rapture@iuliann.ro

Testing

cd ./test && phpunit

License

Rapture PHP command is licensed under the MIT License - see the LICENSE file for details.