Files
DrupalTutorial/vendor/consolidation/annotated-command/src/Input/StdinAwareTrait.php
2024-07-15 12:33:27 +02:00

31 lines
546 B
PHP

<?php
namespace Consolidation\AnnotatedCommand\Input;
/**
* StdinAwareTrait provides the implementation for StdinAwareInterface.
*/
trait StdinAwareTrait
{
protected $stdinHandler;
/**
* @inheritdoc
*/
public function setStdinHandler(StdinHandler $stdin)
{
$this->stdinHandler = $stdin;
}
/**
* @inheritdoc
*/
public function stdin()
{
if (!$this->stdinHandler) {
$this->stdinHandler = new StdinHandler();
}
return $this->stdinHandler;
}
}