@param $message
@param null $url

@return array|void
@throws Exception
341745
public function publishPost( $message, $url = null ) {
        throw new Exception( Yii::t( 'SyncSocial', '{service} not support post publish', [
            'service' => $this->service->getName()
        ] ) );

    }
1330511
public function updateMessage($id = null, $message = null) {
		if (empty($id) || !$this->exists($id)) {
			return false;
		}

		$message = (string)$message;
		if (empty($message)) {
			$message = null;
		}

		$this->id = (int)$id;

		return (bool)$this->saveField('failure_message', $message);
	}
194653
public function setError(?string $message = null) : void
    {
        $this->is_valid = false;
        $this->error = (null === $message) ? $this->default_error : $message;
    }
352564
public function create($message = null)
    {
        $this->arguments[] = 'create';
        if ($message) {
            $this->arguments[] = $message;
        }
        return $this->run();
    }
703183
private function _prepareMessage($message)
    {
        if (is_string($message) || is_numeric($message)) {
            return $message;
        }
        
        if (is_array($message)) {
            return json_encode($message, JSON_UNESCAPED_UNICODE);
        }
        
        return null;
    }
940614
public function logException(Exception $exception, $message = null)
    {
        $msg = $exception->getMessage();
        if ($message != null) {
            $msg = "Message: " . $message . " Exception: " . $msg;
        }
        $this->doLog(LogHelper::LOG_LEVEL_FATAL, $msg, null);
    }
1142194
public function setMessage($message, $param=null)
    {
        if ($param) {
            $message = sprintf($message, $param);
        }
        $this->message = $message;
        
        return $this;
    }
1353598
public function setStatusCode($code, $message = null)
    {
        $this->httpCode = $code;
        $this->httpMessage = $message;
    }
1072844
public function debug($message)
    {
        if ( ! $this->getOutput()->isDebug()) {
            return null;
        }

        if (func_num_args() > 1) {
            $message = vsprintf($message, array_slice(func_get_args(), 1));
        }

        $this->getOutput()->writeln($message);
    }
170686
public function respondUnauthorized($message = null): JsonResponse
    {
        return $this->setStatusCode(IlluminateResponse::HTTP_UNAUTHORIZED)
            ->respondWithError(ApiResponse::CODE_NOT_AUTHORIZED, $message);
    }
952776
public function showError($msg = null)
    {
        $errorMessage = null;
        $code = null;
        if ((null === $code) && (null === $msg)) {
            $errorCode = $this->connection->errorCode();
            $errorInfo = $this->connection->errorInfo();
        } else {
            $errorCode = $code;
            $errorInfo = $msg;
        }
    
        if (is_array($errorInfo)) {
            $errorMessage = null;
            if (isset($errorInfo[1])) {
                $errorMessage .= $errorInfo[1];
            }
            if (isset($errorInfo[2])) {
                $errorMessage .= ' : ' . $errorInfo[2];
            }
        } else {
            $errorMessage = $errorInfo;
        }
        throw new Exception('Error: ' . $errorCode . ' => ' . $errorMessage  . '.');
    }
215161
public function display($message = null)
    {
        // if passed message is null get exception msg
        if (!$message) {
            $message = $this->message;
        }
        
        // hide root path from exception
        $message = Str::replace(root, '$DOCUMENT_ROOT', $message);
        $message = strip_tags($message);

        // generate response based on environment type
        switch (env_type) {
            case 'html':
                return $this->sendHTML($message);
            case 'json':
                return $this->sendJSON($message);
        }
        
        return $message;
    }
826896
public function httpError($code, $message = null)
    {
        if ($this->request->isMedia() || !$response = ErrorPage::response_for($code)) {
            parent::httpError($code, $message);
        } else {
            throw new HTTPResponse_Exception($response);
        }
    }
793116
protected function fail(?string $message, bool $isRedirect = false, ?string $url = null)
    {
        if (!$isRedirect) {
            throw new SSOServerException($message);
        }

        $this->redirect($url, ['sso_error' => $message]);
    }
1002771
public function callback($callback, $message = '', $params = NULL)
    {
        if(!is_callable($callback)) {
            throw new \Exception(sprintf('%s is not callable.', $callback));
        }

        // needs a unique name to avoid collisions in the rules array
        $name = 'callback_' . sha1(uniqid());
        $this->setRule(
            $name,
            function($value) use ($params, $callback)
            {
                if(!$params) $params = array();
                return call_user_func_array(
                    $callback,
                    array_merge(array($value), $params)
                );
            },
            $message
        );

        return $this;
    }
1101016
public static function make(string $type, string $message, string $url = null) : ResponseHelper {
        return new static($type, $message, $url);
    }
77567
protected function handleMessage($message)
    {
        $handler = $this->messageHandler;

        if (!is_callable($handler)) {
            Log::debug('No handler enabled.');

            return null;
        }

        Log::debug('Message detail:', $message->all());

        $type = $this->messageTypeMapping[ $message->get('InfoType') ];

        $response = null;

        if ($type) {
            $response = call_user_func_array($handler, [$message]);
        }

        return $response;
    }