Rapture PHP command component
, (*1)
Simple PHP command class., (*2)
Requirements
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
, (*3)
Testing
cd ./test && phpunit
License
Rapture PHP command is licensed under the MIT License - see the LICENSE
file for details., (*4)