Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

kherge-archive/php-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go

Build Status

Go is a simple PHP build tool built on Symfony Console.

Gofile:

<?php

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

// create our task
task(
    'hello',
    'Say hello',
    function (InputInterface $input, OutputInterface $output) {
        $output->writeln(
            sprintf(
                'Hello, %s%s',
                $input->getArgument('name'),
                $input->getOption('ending')
            )
        );
    }
);

// add an argument to the task
arg('name', ARG_IS_OPTIONAL, 'Your name', 'world');

// add an option to the task
option('ending', 'e', OPT_IS_OPTIONAL, 'How to end', '!');
$ bin/go hello
Hello, world!
$ bin/go hello Kevin -e .
Hello, Kevin.

Documentation