1
1
<?php
2
2
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
+ */
3
11
4
12
namespace Litipk \JupyterPHP \Actions ;
5
13
@@ -36,13 +44,7 @@ final class ExecuteAction implements Action
36
44
/** @var int */
37
45
private $ execCount = 0 ;
38
46
39
- /**
40
- * ExecuteAction constructor.
41
- * @param JupyterBroker $broker
42
- * @param SocketWrapper $iopubSocket
43
- * @param SocketWrapper $shellSocket
44
- * @param Shell $shellSoul
45
- */
47
+
46
48
public function __construct (
47
49
JupyterBroker $ broker ,
48
50
SocketWrapper $ iopubSocket ,
@@ -74,8 +76,7 @@ public function call(array $header, array $content, $zmqId = null)
74
76
);
75
77
}
76
78
77
- $ closure = $ this ->getClosure ();
78
- $ closure ();
79
+ ($ this ->getClosure ())();
79
80
80
81
$ replyContent = [
81
82
'status ' => 'ok ' ,
@@ -89,10 +90,7 @@ public function call(array $header, array $content, $zmqId = null)
89
90
$ this ->broker ->send ($ this ->iopubSocket , 'status ' , ['execution_state ' => 'idle ' ], $ this ->header );
90
91
}
91
92
92
- /**
93
- * @param string $message
94
- */
95
- public function notifyMessage ($ message )
93
+ public function notifyMessage (string $ message )
96
94
{
97
95
$ this ->broker ->send ($ this ->iopubSocket , 'stream ' , ['name ' => 'stdout ' , 'text ' => $ message ], $ this ->header );
98
96
$ this ->broker ->send (
@@ -103,10 +101,7 @@ public function notifyMessage($message)
103
101
);
104
102
}
105
103
106
- /**
107
- * @return callable
108
- */
109
- private function getClosure ()
104
+ private function getClosure (): callable
110
105
{
111
106
$ closure = function () {
112
107
extract ($ this ->shellSoul ->getScopeVariables ());
0 commit comments