Skip to content

Commit bd8498d

Browse files
committed
Encapsulated string input into EmbeddedApplication
1 parent b0f3f06 commit bd8498d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/PHPCR/Shell/Console/Application/EmbeddedApplication.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use PHPCR\Shell\DependencyInjection\Container;
1515
use PHPCR\Shell\PhpcrShell;
16+
use PHPCR\Shell\Console\Input\StringInput;
17+
use Symfony\Component\Console\Output\OutputInterface;
1618

1719
/**
1820
* Subclass of the full ShellApplication for running as an EmbeddedApplication
@@ -50,4 +52,10 @@ protected function getDefaultCommand()
5052
{
5153
return $this->container->getMode() === PhpcrShell::MODE_EMBEDDED_SHELL ? 'shell:path:show' : 'list';
5254
}
55+
56+
public function runWithStringInput($stringInput, OutputInterface $output)
57+
{
58+
$input = new StringInput($stringInput);
59+
$this->run($input, $output);
60+
}
5361
}

0 commit comments

Comments
 (0)