public static function err($string) { fwrite(static::$err, self::colorize($string . PHP_EOL, 'red')); }
/** * Decode a received message * * @param string $json Received json message * @return MessageInterface|void * @throws ComponentException */ protected function jsonDecode($json) { $obj = @json_decode($json); if (json_last_error() !== JSON_ERROR_NONE) { $strErr = 'JSON ERROR: ' . $json; if ($this->application->getVerboseLevel() == 2) { Output::err($strErr); } throw new ComponentException($strErr); } return $obj; }