Created
April 30, 2012 07:21
-
-
Save roderik/2556198 to your computer and use it in GitHub Desktop.
BillSplitCommand v1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Kunstmaan\Hosting\BillSplitBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; | |
class BillSplitCommand extends ContainerAwareCommand | |
{ | |
protected function configure() | |
{ | |
$this | |
->setName('bill:split') | |
->setDescription('Split the bill') | |
->addArgument('billpath', InputArgument::REQUIRED, 'The path to the bill yml file'); | |
} | |
protected function execute(InputInterface $input, OutputInterface $output) | |
{ | |
// TODO: parse input, pass to the parseBill method. | |
} | |
/** | |
* Parses the YAML file containing the bill content into an array. | |
* | |
* @param SplFileObject $bill | |
* @param OutputInterface $output | |
* @return array a multidimensional array with the bill.yml content | |
*/ | |
private function parseBill(SplFileObject $bill, OutputInterface $output) | |
{ | |
// TODO: add code | |
return array(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment