1
1
<?php
2
+
2
3
namespace JakubOnderka \PhpParallelLint \Process ;
3
4
4
5
use JakubOnderka \PhpParallelLint \RunTimeException ;
@@ -33,7 +34,7 @@ class Process
33
34
/**
34
35
* @param string $cmdLine
35
36
* @param string $stdInInput
36
- * @throws RuntimeException
37
+ * @throws RunTimeException
37
38
*/
38
39
public function __construct ($ cmdLine , $ stdInInput = null )
39
40
{
@@ -46,7 +47,7 @@ public function __construct($cmdLine, $stdInInput = null)
46
47
$ this ->process = proc_open ($ cmdLine , $ descriptors , $ pipes , null , null , array ('bypass_shell ' => true ));
47
48
48
49
if ($ this ->process === false ) {
49
- throw new RuntimeException ("Cannot create new process $ cmdLine " );
50
+ throw new RunTimeException ("Cannot create new process $ cmdLine " );
50
51
}
51
52
52
53
list ($ stdin , $ this ->stdout , $ this ->stderr ) = $ pipes ;
@@ -102,38 +103,38 @@ public function waitForFinish()
102
103
103
104
/**
104
105
* @return string
105
- * @throws RuntimeException
106
+ * @throws RunTimeException
106
107
*/
107
108
public function getOutput ()
108
109
{
109
110
if (!$ this ->isFinished ()) {
110
- throw new RuntimeException ("Cannot get output for running process " );
111
+ throw new RunTimeException ("Cannot get output for running process " );
111
112
}
112
113
113
114
return $ this ->output ;
114
115
}
115
116
116
117
/**
117
118
* @return string
118
- * @throws RuntimeException
119
+ * @throws RunTimeException
119
120
*/
120
121
public function getErrorOutput ()
121
122
{
122
123
if (!$ this ->isFinished ()) {
123
- throw new RuntimeException ("Cannot get error output for running process " );
124
+ throw new RunTimeException ("Cannot get error output for running process " );
124
125
}
125
126
126
127
return $ this ->errorOutput ;
127
128
}
128
129
129
130
/**
130
131
* @return int
131
- * @throws RuntimeException
132
+ * @throws RunTimeException
132
133
*/
133
134
public function getStatusCode ()
134
135
{
135
136
if (!$ this ->isFinished ()) {
136
- throw new RuntimeException ("Cannot get status code for running process " );
137
+ throw new RunTimeException ("Cannot get status code for running process " );
137
138
}
138
139
139
140
return $ this ->statusCode ;
@@ -146,4 +147,4 @@ public function isFail()
146
147
{
147
148
return $ this ->getStatusCode () === 1 ;
148
149
}
149
- }
150
+ }
0 commit comments