comparison vendor/symfony/console/Event/ConsoleErrorEvent.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
49 * @param \Throwable $error 49 * @param \Throwable $error
50 */ 50 */
51 public function setError($error) 51 public function setError($error)
52 { 52 {
53 if (!$error instanceof \Throwable && !$error instanceof \Exception) { 53 if (!$error instanceof \Throwable && !$error instanceof \Exception) {
54 throw new InvalidArgumentException(sprintf('The error passed to ConsoleErrorEvent must be an instance of \Throwable or \Exception, "%s" was passed instead.', is_object($error) ? get_class($error) : gettype($error))); 54 throw new InvalidArgumentException(sprintf('The error passed to ConsoleErrorEvent must be an instance of \Throwable or \Exception, "%s" was passed instead.', \is_object($error) ? \get_class($error) : \gettype($error)));
55 } 55 }
56 56
57 $this->error = $error; 57 $this->error = $error;
58 } 58 }
59 59
76 * 76 *
77 * @return int The command exit code 77 * @return int The command exit code
78 */ 78 */
79 public function getExitCode() 79 public function getExitCode()
80 { 80 {
81 return null !== $this->exitCode ? $this->exitCode : (is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); 81 return null !== $this->exitCode ? $this->exitCode : (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1);
82 } 82 }
83 } 83 }