configFactory = $configFactory; parent::__construct($client); } public function push(Post $post): void { $url = $this->configFactory ->get('opdavies_blog.settings') ->get('post_tweet_webhook_url'); Assert::notNull($url, 'Cannot push the post if there is no URL.'); $this->client->post($url, [ 'form_params' => [ 'value1' => $this->t('Blogged: @text', ['@text' => $post->toTweet()]) ->render(), ], ]); } }