File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -154,18 +154,14 @@ public function getToken(): string
154154 */
155155 public static function loadVerifyFile (string $ json_path ): ?array
156156 {
157- echo 'Loading JSON file from ' . ($ json_path ) . PHP_EOL ;
158157 $ directory = dirname ($ json_path );
159158 if (!is_dir ($ directory )) {
160159 mkdir ($ directory , 0777 , true );
161- echo 'Created directories for path: ' . $ directory . PHP_EOL ;
162160 }
163161 if (!file_exists ($ json_path )) {
164162 file_put_contents ($ json_path , "[] " );
165- echo 'Created empty JSON file at ' . realpath ($ json_path ) . PHP_EOL ;
166163 }
167164 $ data = file_get_contents ($ json_path );
168- var_dump ($ data );
169165 if ($ data === false ) {
170166 throw new \Exception ("Failed to read {$ json_path }" );
171167 }
@@ -214,7 +210,6 @@ public static function loadEnvConfig(): array
214210 "DB_PASSWORD=your_password " . PHP_EOL .
215211 "#DB_OPTIONS={ \"option1 \": \"value1 \", \"option2 \": \"value2 \"} "
216212 );
217- echo "No .env file found. Creating one with default values. " . PHP_EOL ;
218213 }
219214
220215 $ dotenv = Dotenv::createImmutable (__DIR__ . '\\.. \\.. \\' );
Original file line number Diff line number Diff line change @@ -32,13 +32,14 @@ public function __construct(
3232 * @param bool $fatal Optional. Indicates whether the error is fatal. Defaults to false.
3333 * If true, the server will stop after logging the error.
3434 *
35- * @return void
35+ * @return string
3636 */
37- public function logError ($ e , bool $ fatal = false ) {
38- echo 'Error: ' . $ e ->getMessage () . PHP_EOL .
39- 'Line ' . $ e ->getLine () . ' in ' . $ e ->getFile () . PHP_EOL .
40- $ e ->getTraceAsString ();
37+ public function logError ($ e , bool $ fatal = false ): string
38+ {
4139 if ($ fatal ) $ this ->stop ();
40+ return 'Error: ' . $ e ->getMessage () . PHP_EOL .
41+ 'Line ' . $ e ->getLine () . ' in ' . $ e ->getFile () . PHP_EOL .
42+ $ e ->getTraceAsString ();
4243 }
4344
4445 /**
@@ -282,7 +283,6 @@ public function handleResource($client): null
282283 throw new \Exception ("Failed to write to client " );
283284 }
284285 fclose ($ client );
285- var_dump ($ response );
286286 return null ;
287287 }
288288
You can’t perform that action at this time.
0 commit comments