11
0
Fork 0
mirror of https://github.com/n3w/helpers-cli-input.git synced 2025-12-19 12:43:23 +00:00
helpers-cli-input/src/Input/AbstractInputType.php

35 lines
796 B
PHP
Raw Normal View History

2019-05-20 15:08:41 +10:00
<?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());
}
}