Skip to content

Commit 1362bf0

Browse files
committed
Add timeout to Twitter oEmbed request and format constructors for consistency
1 parent b3e48b3 commit 1362bf0

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/AltShortcodes/TwitterShortcode.php

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ private static function getOembed(string $url): ?string
3030
curl_setopt_array($curl = curl_init(), [
3131
CURLOPT_URL => "https://publish.twitter.com/oembed?url=$url&omit_script=1",
3232
CURLOPT_RETURNTRANSFER => true,
33+
CURLOPT_TIMEOUT => 5,
3334
]);
3435
$response = curl_exec($curl);
3536
curl_close($curl);

src/LaravelShortcodePlus.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
final class LaravelShortcodePlus
2424
{
25-
public function __construct(protected string $content = '') {}
25+
public function __construct(protected string $content = '')
26+
{
27+
}
2628

2729
public static function source(string $source): LaravelShortcodePlus
2830
{

src/LaravelShortcodePlusServiceProvider.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public function configurePackage(Package $package): void
4343
->hasMigration('create_laravel-shortcode-plus_table');
4444
}
4545

46-
public function packageRegistered() {}
46+
public function packageRegistered()
47+
{
48+
}
4749

4850
public function packageBooted(): void
4951
{

0 commit comments

Comments
 (0)