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:
commit
0620d00f08
24 changed files with 1054 additions and 0 deletions
35
src/Input/AbstractInputType.php
Normal file
35
src/Input/AbstractInputType.php
Normal 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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue