PHP code example of chh / bob

1. Go to this page and download the library: Download chh/bob 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/ */

    

chh / bob example snippets




namespace Bob\BuildConfig;

task('default', ['hello']);

task('hello', function() {
	echo "Hello World!\n";
});



use Bob\Application;
use Bob\TaskLibraryInterface;
use Bob\BuildConfig as b;

class TestTasks implements TaskLibraryInterface
{
    function register(Application $app)
    {}

    function boot(Application $app)
    {
        $app->fileTask("phpunit.xml", array("phpunit.dist.xml"), function($task) {
            copy($task->prerequisites->current(), $task->name);
        });

        $app->task("test", array("phpunit.xml"), function($task) {
            b\sh("./vendor/bin/phpunit");

        })->description = "Runs the test suite";
    }
}



namespace Bob\BuildConfig;

register(new TestTasks);