Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit c217cab

Browse files
committed
Minor code cleanups
1 parent 9ae94c1 commit c217cab

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/Actions/KernelInfoAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public function call(array $header, array $content)
5454
'name' => 'PHP',
5555
'version' => phpversion(),
5656
'mimetype' => 'text/x-php',
57-
'file_extension' => '.php'
57+
'file_extension' => '.php',
58+
'pygments_lexer' => 'PHP'
5859
]
5960
]
6061
);

src/Handlers/ShellMessagesHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Litipk\JupyterPHP\Actions\ShutdownAction;
1111
use Litipk\JupyterPHP\JupyterBroker;
1212

13-
use Litipk\JupyterPHP\SoulVoice;
13+
use Litipk\JupyterPHP\KernelOutput;
1414
use Monolog\Logger;
1515
use Psy\Shell;
1616
use React\ZMQ\SocketWrapper;
@@ -60,7 +60,7 @@ public function __construct(
6060
$iopubSocket, 'status', ['execution_state' => 'starting'], []
6161
);
6262

63-
$this->shellSoul->setOutput(new SoulVoice($this->executeAction, $this->logger->withName('SoulVoice')));
63+
$this->shellSoul->setOutput(new KernelOutput($this->executeAction, $this->logger->withName('KernelOutput')));
6464
}
6565

6666
/**

src/SoulVoice.php renamed to src/KernelOutput.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Symfony\Component\Console\Output\OutputInterface;
1111

1212

13-
final class SoulVoice implements OutputInterface
13+
final class KernelOutput implements OutputInterface
1414
{
1515
/** @var ExecuteAction */
1616
private $executeAction;
@@ -19,7 +19,7 @@ final class SoulVoice implements OutputInterface
1919
private $logger;
2020

2121
/**
22-
* SoulVoice constructor.
22+
* KernelOutput constructor.
2323
* @param ExecuteAction $executeAction
2424
* @param LoggerInterface $logger
2525
*/
@@ -38,7 +38,7 @@ public function __construct(ExecuteAction $executeAction, LoggerInterface $logge
3838
*/
3939
public function write($messages, $newline = false, $options = 0)
4040
{
41-
$this->logger->debug('Write operation inside SoulVoice');
41+
$this->logger->debug('Write operation inside KernelOutput');
4242

4343

4444
if (is_string($messages)) {
@@ -127,12 +127,11 @@ public function isDebug()
127127

128128
/**
129129
* Sets the decorated flag.
130-
*
131130
* @param bool $decorated Whether to decorate the messages
132131
*/
133132
public function setDecorated($decorated)
134133
{
135-
// TODO: Implement setDecorated() method.
134+
// Interface compliance
136135
}
137136

138137
/**
@@ -147,12 +146,11 @@ public function isDecorated()
147146

148147
/**
149148
* Sets output formatter.
150-
*
151149
* @param OutputFormatterInterface $formatter
152150
*/
153151
public function setFormatter(OutputFormatterInterface $formatter)
154152
{
155-
// TODO: Implement setFormatter() method.
153+
// Interface compliance
156154
}
157155

158156
/**

0 commit comments

Comments
 (0)