11
0
Fork 0
mirror of https://github.com/n3w/helpers-cli-input.git synced 2025-12-19 12:43:23 +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,35 @@
<?php
declare(strict_types=1);
namespace pointybeard\Helpers\Cli\Input;
abstract class AbstractInputType implements Interfaces\InputTypeInterface
{
protected static $type;
protected $name;
protected $flags;
protected $description;
protected $validator;
protected $value;
public function __construct($name, int $flags = null, string $description = null, object $validator = null)
{
$this->name = $name;
$this->flags = $flags;
$this->description = $description;
$this->validator = $validator;
}
public function __call($name, array $args = [])
{
return $this->$name;
}
public function getType(): string
{
return strtolower((new \ReflectionClass(static::class))->getShortName());
}
}