PHP code example of delboy1978uk / bone-console
1. Go to this page and download the library: Download delboy1978uk/bone-console 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/ */
delboy1978uk / bone-console example snippets
declare(strict_types=1);
namespace Your\PackageName;
use Barnacle\Container;
use Barnacle\RegistrationInterface;
use Bone\Console\CommandRegistrationInterface;
class MyPackage extends RegistrationInterface implements CommandRegistrationInterface
{
/**
* @param Container $container
* @return array
*/
public function registerConsoleCommands(Container $container) : array
{
$someDependency = $container->get(Some::class);
$awesomeCommand = new AwesomeCommand();
$differentCommand = new DifferentCommand($someDependency);
return [
$awesomeCommand,
$differentCommand,
];
}
}