PluginProbe
WP Console – WordPress PHP Console powered by PsySH / 2.4.0
WP Console – WordPress PHP Console powered by PsySH v2.4.0
trunk 2.4.0 2.4.1 2.5.0 2.5.1 2.6.0
wp-console / includes / Core / Console / Psy / Shell.php

Shell.php in WP Console – WordPress PHP Console powered by PsySH 2.4.0, at includes/Core/Console/Psy/Shell.php

60 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPConsole\Core\Console\Psy;
4
5 use Psy\Configuration;
6 use Psy\Exception\ErrorException;
7 use Psy\Shell as PsyShell;
8
9 class Shell extends PsyShell {
10
11 /**
12 * Return value indicator override
13 *
14 * @since 1.0.0
15 *
16 * @var string
17 */
18 const RETVAL = '';
19
20 /**
21 * Shell Configuration
22 *
23 * @since 1.1.0
24 *
25 * @var \Psy\Configuration
26 */
27 private $config;
28
29 /**
30 * Create a new Psy Shell.
31 *
32 * @since 1.1.0
33 *
34 * @param \Psy\Configuration|null $config
35 *
36 * @return void
37 */
38 public function __construct( Configuration $config = null ) {
39 $this->config = $config;
40 parent::__construct( $config );
41 }
42
43 /**
44 * Helper for throwing an ErrorException.
45 *
46 * @since 1.1.0
47 * @since 1.2.0 Using $errfile and remove line number increament
48 *
49 * @param int $errno Error type
50 * @param string $errstr Message
51 * @param string $errfile Filename
52 * @param int $errline Line number
53 *
54 * @return void
55 */
56 public function handleError( $errno, $errstr, $errfile, $errline ) {
57 $this->config->getOutput()->exception = new ErrorException( $errstr, 0, $errno, $errfile, $errline );
58 }
59 }
60