url = $url; } /** * This function create new notifier from URL. * * That function create new notifier from URL, but it not use 'new' * keyword, which results in the better look code with chainloading. * It use same constructor as {@see notifier::__construct}. * * @throws TypeError Whem URL is bad formated. * * @param string $url URL for the notifications server. * @return notifier New notification server. */ public static function create(string $url): object { return new self($url); } /** * This function would be use to select a subject. * * This function select a subject to notify in. It return new subject * which is initialized from notifier URL and authorization method. * When authorization method of the subject had been changed, notifier * still use own authorization method for new subjects. * * @param string $subject Name of the subject to use. * * @return subject New subject to send notifications in. */ public function topic(string $subject): subject { return new subject( $this->url, $subject, $this->get_access_method() ); } }