Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/Adapters/Facebook/OEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@

class OEmbed extends Base
{
const ENDPOINT_PAGE = 'https://graph.facebook.com/v11.0/oembed_page';
const ENDPOINT_POST = 'https://graph.facebook.com/v11.0/oembed_post';
const ENDPOINT_VIDEO = 'https://graph.facebook.com/v11.0/oembed_video';
const ENDPOINT_PAGE = 'https://graph.facebook.com/v25.0/oembed_page';
const ENDPOINT_POST = 'https://graph.facebook.com/v25.0/oembed_post';
const ENDPOINT_VIDEO = 'https://graph.facebook.com/v25.0/oembed_video';

protected function detectEndpoint(): ?UriInterface

Check failure on line 15 in src/Adapters/Facebook/OEmbed.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Method Embed\Adapters\Facebook\OEmbed::detectEndpoint() never returns null so it can be removed from the return type.
{
$token = $this->extractor->getSetting('facebook:token');

if (!is_string($token) || $token === '') {
return null;
}

$uri = $this->extractor->getUri();
if (strpos($uri->getPath(), 'login') !== false) {
parse_str($uri->getQuery(), $params);
Expand All @@ -28,7 +24,7 @@
}
}
$queryParameters = $this->getOembedQueryParameters((string) $uri);
$queryParameters['access_token'] = $token;
if($token) $queryParameters['access_token'] = $token;

Check failure on line 27 in src/Adapters/Facebook/OEmbed.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Only booleans are allowed in an if condition, mixed given.

return $this->extractor->getCrawler()
->createUri($this->getEndpointByPath($uri->getPath()))
Expand Down
8 changes: 2 additions & 6 deletions src/Adapters/Instagram/OEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@

class OEmbed extends Base
{
const ENDPOINT = 'https://graph.facebook.com/v8.0/instagram_oembed';
const ENDPOINT = 'https://graph.facebook.com/v25.0/instagram_oembed';

protected function detectEndpoint(): ?UriInterface

Check failure on line 13 in src/Adapters/Instagram/OEmbed.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Method Embed\Adapters\Instagram\OEmbed::detectEndpoint() never returns null so it can be removed from the return type.
{
$token = $this->extractor->getSetting('instagram:token');

if (!is_string($token) || $token === '') {
return null;
}

$uri = $this->extractor->getUri();
if (strpos($uri->getPath(), 'login') !== false) {
$uri = $this->extractor->getRequest()->getUri();
}

$queryParameters = $this->getOembedQueryParameters((string) $uri);
$queryParameters['access_token'] = $token;
if($token) $queryParameters['access_token'] = $token;

Check failure on line 23 in src/Adapters/Instagram/OEmbed.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Only booleans are allowed in an if condition, mixed given.

return $this->extractor->getCrawler()
->createUri(self::ENDPOINT)
Expand Down
Loading