mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
21 lines
480 B
PHP
21 lines
480 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Core\Validation;
|
|
|
|
use Zend\Filter\StringTrim;
|
|
use Zend\Filter\StripTags;
|
|
use Zend\InputFilter\Input;
|
|
|
|
trait InputFactoryTrait
|
|
{
|
|
private function createInput($name, $required = true): Input
|
|
{
|
|
$input = new Input($name);
|
|
$input->setRequired($required)
|
|
->getFilterChain()->attach(new StripTags())
|
|
->attach(new StringTrim());
|
|
return $input;
|
|
}
|
|
}
|