Skip to content

Commit 85e181e

Browse files
committed
Misc fixes
1 parent 5600652 commit 85e181e

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

src/PHPCR/Shell/Config/ConfigManager.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,19 @@ public function initConfig(OutputInterface $output = null, $noInteraction = fals
207207
}
208208

209209
if ($this->filesystem->exists($destFile)) {
210-
if (null !== $this->questionHelper) {
211-
if (false === $noInteraction) {
212-
$confirmed = $this->questionHelper->askConfirmation(
213-
$output,
214-
'"' . $configFilename . '" already exists, do you want to overwrite it?'
215-
);
216-
217-
if (!$confirmed) {
218-
return;
219-
}
210+
if (false === $noInteraction) {
211+
$confirmed = $this->questionHelper->askConfirmation(
212+
$output,
213+
'"' . $configFilename . '" already exists, do you want to overwrite it?'
214+
);
215+
216+
if (!$confirmed) {
217+
return;
220218
}
221-
} else {
222-
$log(sprintf('<info>File</info> %s <info> already exists, not overwriting.', $destFile));
223219
}
220+
221+
$log(sprintf('<info>File</info> %s <info> already exists, not overwriting.', $destFile));
222+
return;
224223
}
225224

226225
$this->filesystem->copy($srcFile, $destFile);

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,8 @@
2222
*/
2323
class EmbeddedApplication extends ShellApplication
2424
{
25-
protected $mode;
26-
2725
/**
28-
* The $mode can be one of PhpcrShell::MODE_SHELL or PhpcrShell::MODE_COMMAND.
29-
*
30-
* - Shell mode initializes the whole environement
31-
* - Command mode initailizes only enough to run commands
32-
*
33-
* @param string $mode
26+
* @param Container $container
3427
*/
3528
public function __construct(Container $container)
3629
{
@@ -55,6 +48,6 @@ public function init()
5548
*/
5649
protected function getDefaultCommand()
5750
{
58-
return $this->mode === PhpcrShell::MODE_EMBEDDED_SHELL ? 'shell:path:show' : 'list';
51+
return $this->container->getMode() === PhpcrShell::MODE_EMBEDDED_SHELL ? 'shell:path:show' : 'list';
5952
}
6053
}

src/PHPCR/Shell/PhpcrShell.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use PHPCR\SessionInterface;
1616
use PHPCR\Shell\DependencyInjection\Container;
1717
use PHPCR\Shell\Console\Application\Shell;
18+
use PHPCR\Shell\Phpcr\PhpcrSession;
1819

1920
/**
2021
* PHPCRShell entry point

0 commit comments

Comments
 (0)