11<?php
22
3+ /*
4+ * This file is part of Jupyter-PHP.
5+ *
6+ * (c) 2015-2017 Litipk
7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
311
412namespace Litipk \JupyterPHP \Actions ;
513
@@ -36,13 +44,7 @@ final class ExecuteAction implements Action
3644 /** @var int */
3745 private $ execCount = 0 ;
3846
39- /**
40- * ExecuteAction constructor.
41- * @param JupyterBroker $broker
42- * @param SocketWrapper $iopubSocket
43- * @param SocketWrapper $shellSocket
44- * @param Shell $shellSoul
45- */
47+
4648 public function __construct (
4749 JupyterBroker $ broker ,
4850 SocketWrapper $ iopubSocket ,
@@ -74,8 +76,7 @@ public function call(array $header, array $content, $zmqId = null)
7476 );
7577 }
7678
77- $ closure = $ this ->getClosure ();
78- $ closure ();
79+ ($ this ->getClosure ())();
7980
8081 $ replyContent = [
8182 'status ' => 'ok ' ,
@@ -89,10 +90,7 @@ public function call(array $header, array $content, $zmqId = null)
8990 $ this ->broker ->send ($ this ->iopubSocket , 'status ' , ['execution_state ' => 'idle ' ], $ this ->header );
9091 }
9192
92- /**
93- * @param string $message
94- */
95- public function notifyMessage ($ message )
93+ public function notifyMessage (string $ message )
9694 {
9795 $ this ->broker ->send ($ this ->iopubSocket , 'stream ' , ['name ' => 'stdout ' , 'text ' => $ message ], $ this ->header );
9896 $ this ->broker ->send (
@@ -103,10 +101,7 @@ public function notifyMessage($message)
103101 );
104102 }
105103
106- /**
107- * @return callable
108- */
109- private function getClosure ()
104+ private function getClosure (): callable
110105 {
111106 $ closure = function () {
112107 extract ($ this ->shellSoul ->getScopeVariables ());
0 commit comments