11
0
Fork 0
mirror of https://github.com/n3w/helpers-cli-input.git synced 2025-12-20 21:23:24 +00:00

Initial commit

This commit is contained in:
Alannah Kearney 2019-05-20 15:08:41 +10:00
commit 0620d00f08
24 changed files with 1054 additions and 0 deletions

View file

@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace pointybeard\Helpers\Cli\Input\Interfaces;
use pointybeard\Helpers\Cli\Input;
interface InputHandlerInterface
{
public function bind(Input\InputCollection $inputCollection, bool $skipValidation = false): bool;
public function validate(): void;
public function getArgument(string $name): ?string;
// note that the return value of getOption() isn't always going to be
// a string like getArgument()
public function getOption(string $name);
public function getArguments(): array;
public function getOptions(): array;
public function getCollection(): ?Input\InputCollection;
}

View file

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace pointybeard\Helpers\Cli\Input\Interfaces;
interface InputTypeInterface
{
const FLAG_REQUIRED = 0x0001;
const FLAG_OPTIONAL = 0x0002;
const FLAG_VALUE_REQUIRED = 0x0004;
const FLAG_VALUE_OPTIONAL = 0x0008;
const FLAG_TYPE_STRING = 0x0100;
const FLAG_TYPE_INT = 0x0200;
const FLAG_TYPE_INCREMENTING = 0x0400;
public function getType(): string;
}

View file

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace pointybeard\Helpers\Cli\Input\Interfaces;
use pointybeard\Helpers\Cli\Input;
interface InputValidatorInterface
{
public function validate(Input\AbstractInputType $input, Input\AbstractInputHandler $context);
}