fix: replace essence with embera to create preview cards

This commit is contained in:
Yassine Doghri 2023-05-09 07:47:54 +00:00
parent fbd1a0cf0d
commit c682f03a67
13 changed files with 214 additions and 325 deletions

View File

@ -73,7 +73,7 @@ class PostController extends FediversePostController
$this->registerPodcastWebpageHit($this->podcast->id); $this->registerPodcastWebpageHit($this->podcast->id);
} }
if ($this->post === null) { if (! $this->post instanceof CastopodPost) {
throw PageNotFoundException::forPageNotFound(); throw PageNotFoundException::forPageNotFound();
} }

View File

@ -43,7 +43,7 @@ use RuntimeException;
* @property string $slug * @property string $slug
* @property string $title * @property string $title
* @property int $audio_id * @property int $audio_id
* @property Audio $audio * @property ?Audio $audio
* @property string $audio_url * @property string $audio_url
* @property string $audio_web_url * @property string $audio_web_url
* @property string $audio_opengraph_url * @property string $audio_opengraph_url

View File

@ -24,7 +24,7 @@ use RuntimeException;
* @property string $unique_name * @property string $unique_name
* @property string|null $information_url * @property string|null $information_url
* @property int $avatar_id * @property int $avatar_id
* @property Image $avatar * @property ?Image $avatar
* @property int $created_by * @property int $created_by
* @property int $updated_by * @property int $updated_by
* @property object[]|null $roles * @property object[]|null $roles

View File

@ -47,9 +47,9 @@ use RuntimeException;
* @property string $description_markdown * @property string $description_markdown
* @property string $description_html * @property string $description_html
* @property int $cover_id * @property int $cover_id
* @property Image $cover * @property ?Image $cover
* @property int|null $banner_id * @property int|null $banner_id
* @property Image $banner * @property ?Image $banner
* @property string $language_code * @property string $language_code
* @property int $category_id * @property int $category_id
* @property Category|null $category * @property Category|null $category

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
use App\Entities\Person; use App\Entities\Person;
use App\Entities\Podcast; use App\Entities\Podcast;
use Modules\Media\Entities\Image;
/** /**
* @copyright 2020 Ad Aures * @copyright 2020 Ad Aures
@ -318,7 +319,7 @@ if (! function_exists('get_site_icon_url')) {
if (! function_exists('get_podcast_banner')) { if (! function_exists('get_podcast_banner')) {
function get_podcast_banner_url(Podcast $podcast, string $size): string function get_podcast_banner_url(Podcast $podcast, string $size): string
{ {
if ($podcast->banner === null) { if (! $podcast->banner instanceof Image) {
$defaultBanner = config('Images') $defaultBanner = config('Images')
->podcastBannerDefaultPaths[service('settings')->get('App.theme')] ?? config( ->podcastBannerDefaultPaths[service('settings')->get('App.theme')] ?? config(
'Images' 'Images'
@ -344,7 +345,7 @@ if (! function_exists('get_podcast_banner')) {
if (! function_exists('get_podcast_banner_mimetype')) { if (! function_exists('get_podcast_banner_mimetype')) {
function get_podcast_banner_mimetype(Podcast $podcast, string $size): string function get_podcast_banner_mimetype(Podcast $podcast, string $size): string
{ {
if ($podcast->banner === null) { if (! $podcast->banner instanceof Image) {
$sizes = config('Images') $sizes = config('Images')
->podcastBannerSizes; ->podcastBannerSizes;
@ -365,7 +366,7 @@ if (! function_exists('get_podcast_banner_mimetype')) {
if (! function_exists('get_avatar_url')) { if (! function_exists('get_avatar_url')) {
function get_avatar_url(Person $person, string $size): string function get_avatar_url(Person $person, string $size): string
{ {
if ($person->avatar === null) { if (! $person->avatar instanceof Image) {
$defaultAvatarPath = config('Images') $defaultAvatarPath = config('Images')
->avatarDefaultPath; ->avatarDefaultPath;

View File

@ -19,20 +19,20 @@
"adaures/podcast-persons-taxonomy": "^v1.0.0", "adaures/podcast-persons-taxonomy": "^v1.0.0",
"phpseclib/phpseclib": "~2.0.42", "phpseclib/phpseclib": "~2.0.42",
"michalsn/codeigniter4-uuid": "dev-develop", "michalsn/codeigniter4-uuid": "dev-develop",
"essence/essence": "^3.5.4",
"codeigniter4/settings": "^v2.1.0", "codeigniter4/settings": "^v2.1.0",
"chrisjean/php-ico": "^1.0.4", "chrisjean/php-ico": "^1.0.4",
"melbahja/seo": "^v2.1.1", "melbahja/seo": "^v2.1.1",
"codeigniter4/shield": "v1.0.0-beta.3", "codeigniter4/shield": "v1.0.0-beta.3",
"aws/aws-sdk-php": "^3.263.10" "aws/aws-sdk-php": "^3.269.7",
"mpratt/embera": "^2.0.32"
}, },
"require-dev": { "require-dev": {
"mikey179/vfsstream": "^v1.6.11", "mikey179/vfsstream": "^v1.6.11",
"phpunit/phpunit": "^10.1.0", "phpunit/phpunit": "^10.1.2",
"captainhook/captainhook": "^5.16.3", "captainhook/captainhook": "^5.16.4",
"symplify/easy-coding-standard": "^11.3.2", "symplify/easy-coding-standard": "^11.3.2",
"phpstan/phpstan": "^1.10.13", "phpstan/phpstan": "^1.10.13",
"rector/rector": "^0.15.24", "rector/rector": "^0.16.0",
"symplify/coding-standard": "^11.3.0" "symplify/coding-standard": "^11.3.0"
}, },
"autoload": { "autoload": {

435
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "210cbe161bd78cbdd9a97234896b87cb", "content-hash": "4d43e58af5e0900789bca63be2c8401e",
"packages": [ "packages": [
{ {
"name": "adaures/ipcat-php", "name": "adaures/ipcat-php",
@ -120,16 +120,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.263.10", "version": "3.269.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "d5f40cff8fe2fe75a8415618f04c987472184eba" "reference": "f34afba20e3ad782ed91332a8306b91b06a1de5c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d5f40cff8fe2fe75a8415618f04c987472184eba", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f34afba20e3ad782ed91332a8306b91b06a1de5c",
"reference": "d5f40cff8fe2fe75a8415618f04c987472184eba", "reference": "f34afba20e3ad782ed91332a8306b91b06a1de5c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -139,9 +139,10 @@
"ext-simplexml": "*", "ext-simplexml": "*",
"guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5",
"guzzlehttp/promises": "^1.4.0", "guzzlehttp/promises": "^1.4.0",
"guzzlehttp/psr7": "^1.8.5 || ^2.3", "guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"mtdowling/jmespath.php": "^2.6", "mtdowling/jmespath.php": "^2.6",
"php": ">=5.5" "php": ">=5.5",
"psr/http-message": "^1.0"
}, },
"require-dev": { "require-dev": {
"andrewsville/php-token-reflection": "^1.4", "andrewsville/php-token-reflection": "^1.4",
@ -204,32 +205,31 @@
"support": { "support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.263.10" "source": "https://github.com/aws/aws-sdk-php/tree/3.269.7"
}, },
"time": "2023-04-13T18:19:56+00:00" "time": "2023-05-05T19:51:13+00:00"
}, },
{ {
"name": "brick/math", "name": "brick/math",
"version": "0.10.2", "version": "0.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/brick/math.git", "url": "https://github.com/brick/math.git",
"reference": "459f2781e1a08d52ee56b0b1444086e038561e3f" "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/459f2781e1a08d52ee56b0b1444086e038561e3f", "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478",
"reference": "459f2781e1a08d52ee56b0b1444086e038561e3f", "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "php": "^8.0"
"php": "^7.4 || ^8.0"
}, },
"require-dev": { "require-dev": {
"php-coveralls/php-coveralls": "^2.2", "php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^9.0", "phpunit/phpunit": "^9.0",
"vimeo/psalm": "4.25.0" "vimeo/psalm": "5.0.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -252,7 +252,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/brick/math/issues", "issues": "https://github.com/brick/math/issues",
"source": "https://github.com/brick/math/tree/0.10.2" "source": "https://github.com/brick/math/tree/0.11.0"
}, },
"funding": [ "funding": [
{ {
@ -260,7 +260,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-08-10T22:54:19+00:00" "time": "2023-01-15T23:15:59+00:00"
}, },
{ {
"name": "chrisjean/php-ico", "name": "chrisjean/php-ico",
@ -620,180 +620,6 @@
}, },
"time": "2022-10-27T11:44:00+00:00" "time": "2022-10-27T11:44:00+00:00"
}, },
{
"name": "essence/dom",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/essence/dom.git",
"reference": "e5776d2286f4ccbd048d160c28ac77ccc6d68f3a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/essence/dom/zipball/e5776d2286f4ccbd048d160c28ac77ccc6d68f3a",
"reference": "e5776d2286f4ccbd048d160c28ac77ccc6d68f3a",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-4": {
"Essence\\Dom\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": ["MIT"],
"authors": [
{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}
],
"description": "Essence's DOM parser.",
"homepage": "http://github.com/essence/dom",
"keywords": ["dom", "parser"],
"support": {
"issues": "https://github.com/essence/dom/issues",
"source": "https://github.com/essence/dom/tree/1.0.0"
},
"time": "2015-07-23T20:33:17+00:00"
},
{
"name": "essence/essence",
"version": "3.5.4",
"source": {
"type": "git",
"url": "https://github.com/essence/essence.git",
"reference": "81e889a87603840dadd04b317a51487df1d45933"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/essence/essence/zipball/81e889a87603840dadd04b317a51487df1d45933",
"reference": "81e889a87603840dadd04b317a51487df1d45933",
"shasum": ""
},
"require": {
"essence/dom": "~1.0.0",
"essence/http": "~1.0.0",
"fg/parkour": "~1.1.0",
"php": ">=5.5.0"
},
"suggest": {
"ext-curl": "*"
},
"type": "library",
"autoload": {
"psr-4": {
"Essence\\": "lib/Essence"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": ["BSD-2-Clause"],
"authors": [
{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}
],
"description": "Extracts information about medias on the web, like youtube videos, twitter statuses or blog articles.",
"homepage": "http://github.com/essence/essence",
"keywords": ["embed", "media", "oembed", "opengraph"],
"support": {
"issues": "https://github.com/essence/essence/issues",
"source": "https://github.com/essence/essence/tree/3.5.4"
},
"time": "2021-01-21T09:58:10+00:00"
},
{
"name": "essence/http",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/essence/http.git",
"reference": "ce0e52e0c0f2ed894ce2922ab2fd598dcaac91d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/essence/http/zipball/ce0e52e0c0f2ed894ce2922ab2fd598dcaac91d2",
"reference": "ce0e52e0c0f2ed894ce2922ab2fd598dcaac91d2",
"shasum": ""
},
"suggest": {
"ext-curl": "*"
},
"type": "library",
"autoload": {
"psr-4": {
"Essence\\Http\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": ["MIT"],
"authors": [
{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}
],
"description": "Essence's HTTP client.",
"homepage": "http://github.com/essence/http",
"keywords": ["client", "http"],
"support": {
"issues": "https://github.com/essence/http/issues",
"source": "https://github.com/essence/http/tree/1.0.0"
},
"time": "2015-07-23T20:33:50+00:00"
},
{
"name": "fg/parkour",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/felixgirault/parkour.git",
"reference": "f837eb640fc4aac81b11fe50d2fa04fb4ec71496"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/felixgirault/parkour/zipball/f837eb640fc4aac81b11fe50d2fa04fb4ec71496",
"reference": "f837eb640fc4aac81b11fe50d2fa04fb4ec71496",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
},
"type": "library",
"autoload": {
"psr-4": {
"Parkour\\": "lib"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": ["BSD-2-Clause"],
"authors": [
{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}
],
"description": "A collection of utilities to manipulate arrays.",
"homepage": "http://github.com/felixgirault/parkour",
"keywords": ["array", "manipulation", "traversing"],
"support": {
"issues": "https://github.com/felixgirault/parkour/issues",
"source": "https://github.com/felixgirault/parkour/tree/1.1.1"
},
"time": "2015-10-03T10:39:22+00:00"
},
{ {
"name": "geoip2/geoip2", "name": "geoip2/geoip2",
"version": "v2.13.0", "version": "v2.13.0",
@ -902,22 +728,22 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.5.0", "version": "7.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", "reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"guzzlehttp/promises": "^1.5", "guzzlehttp/promises": "^1.5",
"guzzlehttp/psr7": "^1.9 || ^2.4", "guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0", "psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0" "symfony/deprecation-contracts": "^2.2 || ^3.0"
@ -1006,7 +832,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/guzzle/issues", "issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.5.0" "source": "https://github.com/guzzle/guzzle/tree/7.5.1"
}, },
"funding": [ "funding": [
{ {
@ -1022,7 +848,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-08-28T15:39:27+00:00" "time": "2023-04-17T16:30:08+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
@ -1104,22 +930,22 @@
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "2.4.4", "version": "2.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf" "reference": "b635f279edd83fc275f822a1188157ffea568ff6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6",
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", "reference": "b635f279edd83fc275f822a1188157ffea568ff6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0", "psr/http-factory": "^1.0",
"psr/http-message": "^1.0", "psr/http-message": "^1.1 || ^2.0",
"ralouphie/getallheaders": "^3.0" "ralouphie/getallheaders": "^3.0"
}, },
"provide": { "provide": {
@ -1139,9 +965,6 @@
"bamarni-bin": { "bamarni-bin": {
"bin-links": true, "bin-links": true,
"forward-command": false "forward-command": false
},
"branch-alias": {
"dev-master": "2.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -1201,7 +1024,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.4.4" "source": "https://github.com/guzzle/psr7/tree/2.5.0"
}, },
"funding": [ "funding": [
{ {
@ -1217,7 +1040,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-09T13:19:02+00:00" "time": "2023-04-17T16:11:26+00:00"
}, },
{ {
"name": "james-heinrich/getid3", "name": "james-heinrich/getid3",
@ -1884,6 +1707,74 @@
}, },
"time": "2021-05-10T16:28:01+00:00" "time": "2021-05-10T16:28:01+00:00"
}, },
{
"name": "mpratt/embera",
"version": "2.0.32",
"source": {
"type": "git",
"url": "https://github.com/mpratt/Embera.git",
"reference": "51f9926e30b051190b6b5398b5652ddd88db8e4a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mpratt/Embera/zipball/51f9926e30b051190b6b5398b5652ddd88db8e4a",
"reference": "51f9926e30b051190b6b5398b5652ddd88db8e4a",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=5.6"
},
"require-dev": {
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": "^9.0"
},
"suggest": {
"ext-curl": "Fetch data using curl instead of using file_get_contents"
},
"type": "library",
"autoload": {
"psr-4": {
"Embera\\": "src/Embera"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": ["MIT"],
"authors": [
{
"name": "Michael Pratt",
"email": "yo@michael-pratt.com",
"homepage": "http://www.michael-pratt.com",
"role": "Author/Developer"
}
],
"description": "Oembed consumer library. Converts urls into their html embed code. Supports 150+ sites, such as Youtube, Twitter, vimeo, Instagram etc.",
"homepage": "https://github.com/mpratt/Embera",
"keywords": [
"Auto embed",
"Embed Text",
"Responsive Embeds",
"Url Embed",
"embed",
"instagram",
"oembed",
"twitter",
"vimeo",
"vine",
"youtube"
],
"support": {
"issues": "https://github.com/mpratt/Embera/issues",
"source": "https://github.com/mpratt/Embera/tree/2.0.32"
},
"funding": [
{
"url": "https://paypal.me/mtpratt",
"type": "paypal"
}
],
"time": "2023-04-14T21:19:05+00:00"
},
{ {
"name": "mtdowling/jmespath.php", "name": "mtdowling/jmespath.php",
"version": "2.6.1", "version": "2.6.1",
@ -2681,20 +2572,20 @@
}, },
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
"version": "4.7.3", "version": "4.7.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/ramsey/uuid.git", "url": "https://github.com/ramsey/uuid.git",
"reference": "433b2014e3979047db08a17a205f410ba3869cf2" "reference": "60a4c63ab724854332900504274f6150ff26d286"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/433b2014e3979047db08a17a205f410ba3869cf2", "url": "https://api.github.com/repos/ramsey/uuid/zipball/60a4c63ab724854332900504274f6150ff26d286",
"reference": "433b2014e3979047db08a17a205f410ba3869cf2", "reference": "60a4c63ab724854332900504274f6150ff26d286",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"brick/math": "^0.8.8 || ^0.9 || ^0.10", "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11",
"ext-json": "*", "ext-json": "*",
"php": "^8.0", "php": "^8.0",
"ramsey/collection": "^1.2 || ^2.0" "ramsey/collection": "^1.2 || ^2.0"
@ -2749,7 +2640,7 @@
"keywords": ["guid", "identifier", "uuid"], "keywords": ["guid", "identifier", "uuid"],
"support": { "support": {
"issues": "https://github.com/ramsey/uuid/issues", "issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.7.3" "source": "https://github.com/ramsey/uuid/tree/4.7.4"
}, },
"funding": [ "funding": [
{ {
@ -2761,7 +2652,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-01-12T18:13:24+00:00" "time": "2023-04-15T23:01:58+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@ -3180,16 +3071,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "captainhook/captainhook", "name": "captainhook/captainhook",
"version": "5.16.3", "version": "5.16.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/captainhookphp/captainhook.git", "url": "https://github.com/captainhookphp/captainhook.git",
"reference": "ed0279fd108aa4729b7843633b99326826c6fd76" "reference": "524c8660551bafe9c7211440a71a35984e8dfc4b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/ed0279fd108aa4729b7843633b99326826c6fd76", "url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/524c8660551bafe9c7211440a71a35984e8dfc4b",
"reference": "ed0279fd108aa4729b7843633b99326826c6fd76", "reference": "524c8660551bafe9c7211440a71a35984e8dfc4b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3247,7 +3138,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/captainhookphp/captainhook/issues", "issues": "https://github.com/captainhookphp/captainhook/issues",
"source": "https://github.com/captainhookphp/captainhook/tree/5.16.3" "source": "https://github.com/captainhookphp/captainhook/tree/5.16.4"
}, },
"funding": [ "funding": [
{ {
@ -3255,7 +3146,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-03-30T16:40:06+00:00" "time": "2023-04-17T19:48:47+00:00"
}, },
{ {
"name": "composer/pcre", "name": "composer/pcre",
@ -3939,16 +3830,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.10.13", "version": "1.10.14",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "f07bf8c6980b81bf9e49d44bd0caf2e737614a70" "reference": "d232901b09e67538e5c86a724be841bea5768a7c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/f07bf8c6980b81bf9e49d44bd0caf2e737614a70", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d232901b09e67538e5c86a724be841bea5768a7c",
"reference": "f07bf8c6980b81bf9e49d44bd0caf2e737614a70", "reference": "d232901b09e67538e5c86a724be841bea5768a7c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3987,20 +3878,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-04-12T19:29:52+00:00" "time": "2023-04-19T13:47:27+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "10.1.0", "version": "10.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8" "reference": "884a0da7f9f46f28b2cb69134217fd810b793974"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fc4f5ee614fa82d50ecf9014b51af0a9561f3df8", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/884a0da7f9f46f28b2cb69134217fd810b793974",
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8", "reference": "884a0da7f9f46f28b2cb69134217fd810b793974",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4019,7 +3910,7 @@
"theseer/tokenizer": "^1.2.0" "theseer/tokenizer": "^1.2.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^10.0" "phpunit/phpunit": "^10.1"
}, },
"suggest": { "suggest": {
"ext-pcov": "PHP extension that provides line coverage", "ext-pcov": "PHP extension that provides line coverage",
@ -4049,7 +3940,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.0" "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.1"
}, },
"funding": [ "funding": [
{ {
@ -4057,7 +3948,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-04-13T07:08:27+00:00" "time": "2023-04-17T12:15:40+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@ -4277,16 +4168,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "10.1.0", "version": "10.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "5a477aea03e61329132935689ae2d73f418f5e25" "reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5a477aea03e61329132935689ae2d73f418f5e25", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6f0cd95be71add539f8fd2be25b2a4a29789000b",
"reference": "5a477aea03e61329132935689ae2d73f418f5e25", "reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4300,7 +4191,7 @@
"phar-io/manifest": "^2.0.3", "phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2", "phar-io/version": "^3.0.2",
"php": ">=8.1", "php": ">=8.1",
"phpunit/php-code-coverage": "^10.1", "phpunit/php-code-coverage": "^10.1.1",
"phpunit/php-file-iterator": "^4.0", "phpunit/php-file-iterator": "^4.0",
"phpunit/php-invoker": "^4.0", "phpunit/php-invoker": "^4.0",
"phpunit/php-text-template": "^3.0", "phpunit/php-text-template": "^3.0",
@ -4346,7 +4237,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.0" "source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.2"
}, },
"funding": [ "funding": [
{ {
@ -4362,7 +4253,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-04-14T05:15:09+00:00" "time": "2023-04-22T07:38:19+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",
@ -4417,21 +4308,21 @@
}, },
{ {
"name": "rector/rector", "name": "rector/rector",
"version": "0.15.24", "version": "0.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/rectorphp/rector.git", "url": "https://github.com/rectorphp/rector.git",
"reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59" "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/716473919bcfdc27bdd2a32afb72adbf4c224e59", "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f",
"reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59", "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2|^8.0", "php": "^7.2|^8.0",
"phpstan/phpstan": "^1.10.1" "phpstan/phpstan": "^1.10.14"
}, },
"conflict": { "conflict": {
"rector/rector-doctrine": "*", "rector/rector-doctrine": "*",
@ -4455,7 +4346,7 @@
"keywords": ["automation", "dev", "migration", "refactoring"], "keywords": ["automation", "dev", "migration", "refactoring"],
"support": { "support": {
"issues": "https://github.com/rectorphp/rector/issues", "issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/0.15.24" "source": "https://github.com/rectorphp/rector/tree/0.16.0"
}, },
"funding": [ "funding": [
{ {
@ -4463,7 +4354,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-04-05T08:49:11+00:00" "time": "2023-05-05T12:12:17+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -4743,16 +4634,16 @@
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
"version": "5.0.1", "version": "5.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b",
"reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4789,7 +4680,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/diff/issues", "issues": "https://github.com/sebastianbergmann/diff/issues",
"security": "https://github.com/sebastianbergmann/diff/security/policy", "security": "https://github.com/sebastianbergmann/diff/security/policy",
"source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3"
}, },
"funding": [ "funding": [
{ {
@ -4797,7 +4688,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-03-23T05:12:41+00:00" "time": "2023-05-01T07:48:21+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
@ -5461,16 +5352,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v6.2.8", "version": "v6.2.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b" "reference": "12288d9f4500f84a4d02254d4aa968b15488476f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/3582d68a64a86ec25240aaa521ec8bc2342b369b", "url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f",
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b", "reference": "12288d9f4500f84a4d02254d4aa968b15488476f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5528,7 +5419,7 @@
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"keywords": ["cli", "command-line", "console", "terminal"], "keywords": ["cli", "command-line", "console", "terminal"],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v6.2.8" "source": "https://github.com/symfony/console/tree/v6.2.10"
}, },
"funding": [ "funding": [
{ {
@ -5544,7 +5435,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-29T21:42:15+00:00" "time": "2023-04-28T13:37:43+00:00"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
@ -5704,16 +5595,16 @@
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v6.2.7", "version": "v6.2.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "82b6c62b959f642d000456f08c6d219d749215b3" "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3", "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894",
"reference": "82b6c62b959f642d000456f08c6d219d749215b3", "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5743,7 +5634,7 @@
"description": "Provides basic utilities for the filesystem", "description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/filesystem/tree/v6.2.7" "source": "https://github.com/symfony/filesystem/tree/v6.2.10"
}, },
"funding": [ "funding": [
{ {
@ -5759,7 +5650,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-14T08:44:56+00:00" "time": "2023-04-18T13:46:08+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
@ -6105,16 +5996,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v6.2.8", "version": "v6.2.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416" "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/75ed64103df4f6615e15a7fe38b8111099f47416", "url": "https://api.github.com/repos/symfony/process/zipball/b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e",
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416", "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6142,7 +6033,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v6.2.8" "source": "https://github.com/symfony/process/tree/v6.2.10"
}, },
"funding": [ "funding": [
{ {
@ -6158,7 +6049,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-09T16:20:02+00:00" "time": "2023-04-18T13:56:57+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",

View File

@ -32,6 +32,7 @@ use Modules\Analytics\Models\AnalyticsPodcastModel;
use Modules\Analytics\Models\AnalyticsWebsiteByBrowserModel; use Modules\Analytics\Models\AnalyticsWebsiteByBrowserModel;
use Modules\Analytics\Models\AnalyticsWebsiteByEntryPageModel; use Modules\Analytics\Models\AnalyticsWebsiteByEntryPageModel;
use Modules\Analytics\Models\AnalyticsWebsiteByRefererModel; use Modules\Analytics\Models\AnalyticsWebsiteByRefererModel;
use Modules\Media\Entities\Image;
use Modules\Media\FileManagers\FileManagerInterface; use Modules\Media\FileManagers\FileManagerInterface;
use Modules\Media\Models\MediaModel; use Modules\Media\Models\MediaModel;
@ -397,7 +398,7 @@ class PodcastController extends BaseController
public function deleteBanner(): RedirectResponse public function deleteBanner(): RedirectResponse
{ {
if ($this->podcast->banner === null) { if (! $this->podcast->banner instanceof Image) {
return redirect()->back(); return redirect()->back();
} }
@ -545,7 +546,7 @@ class PodcastController extends BaseController
$mediaModel = new MediaModel(); $mediaModel = new MediaModel();
foreach ($podcastMediaList as $podcastMedia) { foreach ($podcastMediaList as $podcastMedia) {
if ($podcastMedia['file'] !== null && ! $mediaModel->delete($podcastMedia['file']->id)) { if ($podcastMedia['file'] instanceof Image && ! $mediaModel->delete($podcastMedia['file']->id)) {
$db->transRollback(); $db->transRollback();
return redirect() return redirect()
->back() ->back()

View File

@ -16,11 +16,11 @@ use RuntimeException;
/** /**
* @property string $id * @property string $id
* @property int $actor_id * @property int $actor_id
* @property Actor $actor * @property ?Actor $actor
* @property int|null $target_actor_id * @property int|null $target_actor_id
* @property Actor $target_actor * @property ?Actor $target_actor
* @property string|null $post_id * @property string|null $post_id
* @property Post $post * @property ?Post $post
* @property string $type * @property string $type
* @property object $payload * @property object $payload
* @property string|null $status * @property string|null $status

View File

@ -18,11 +18,11 @@ use RuntimeException;
/** /**
* @property int $id * @property int $id
* @property int $actor_id * @property int $actor_id
* @property Actor $actor * @property ?Actor $actor
* @property int $target_actor_id * @property int $target_actor_id
* @property Actor $target_actor * @property ?Actor $target_actor
* @property string|null $post_id * @property string|null $post_id
* @property Post $post * @property ?Post $post
* @property string $activity_id * @property string $activity_id
* @property Activity $activity * @property Activity $activity
* @property 'like'|'follow'|'share'|'reply' $type * @property 'like'|'follow'|'share'|'reply' $type

View File

@ -18,7 +18,7 @@ use RuntimeException;
* @property string $id * @property string $id
* @property string $uri * @property string $uri
* @property int $actor_id * @property int $actor_id
* @property Actor $actor * @property ?Actor $actor
* @property string|null $in_reply_to_id * @property string|null $in_reply_to_id
* @property Post|null $reply_to_post * @property Post|null $reply_to_post
* @property string|null $reblog_of_id * @property string|null $reblog_of_id

View File

@ -10,8 +10,7 @@ declare(strict_types=1);
use CodeIgniter\HTTP\Exceptions\HTTPException; use CodeIgniter\HTTP\Exceptions\HTTPException;
use CodeIgniter\HTTP\URI; use CodeIgniter\HTTP\URI;
use Config\Database; use Embera\Embera;
use Essence\Essence;
use Modules\Fediverse\Activities\AcceptActivity; use Modules\Fediverse\Activities\AcceptActivity;
use Modules\Fediverse\ActivityRequest; use Modules\Fediverse\ActivityRequest;
use Modules\Fediverse\Entities\Actor; use Modules\Fediverse\Entities\Actor;
@ -149,38 +148,35 @@ if (! function_exists('create_preview_card_from_url')) {
*/ */
function create_preview_card_from_url(URI $url): ?PreviewCard function create_preview_card_from_url(URI $url): ?PreviewCard
{ {
$essence = new Essence([ $embera = new Embera();
'filters' => [ $mediaData = $embera->getUrlData((string) $url);
'OEmbedProvider' => '//',
'OpenGraphProvider' => '//',
'TwitterCardsProvider' => '//',
],
]);
$media = $essence->extract((string) $url);
if ($media) { if ($mediaData !== []) {
$typeMapping = [ $mediaUrl = array_key_first($mediaData);
'photo' => 'image', $media = array_values($mediaData)[0];
'video' => 'video',
'website' => 'link',
'rich' => 'rich',
];
// Check that, at least, the url and title are set if (array_key_exists('title', $media)) {
if ($media->url && $media->title) { $typeMapping = [
'photo' => 'image',
'video' => 'video',
'website' => 'link',
'rich' => 'rich',
];
// Check that, at least, the url and title are set
$newPreviewCard = new PreviewCard([ $newPreviewCard = new PreviewCard([
'url' => (string) $url, 'url' => $mediaUrl,
'title' => $media->title, 'title' => $media['title'] ?? '',
'description' => $media->description, 'description' => $media['description'] ?? '',
'type' => isset($typeMapping[$media->type]) 'type' => isset($typeMapping[$media['type']])
? $typeMapping[$media->type] ? $typeMapping[$media['type']]
: 'link', : 'link',
'author_name' => $media->authorName, 'author_name' => $media['author_name'] ?? null,
'author_url' => $media->authorUrl, 'author_url' => $media['author_url'] ?? null,
'provider_name' => $media->providerName, 'provider_name' => $media['provider_name'] ?? '',
'provider_url' => $media->providerUrl, 'provider_url' => $media['provider_url'] ?? '',
'image' => $media->thumbnailUrl, 'image' => $media['thumbnail_url'] ?? '',
'html' => $media->html, 'html' => $media['html'] ?? '',
]); ]);
if ( if (

View File

@ -58,7 +58,7 @@ class Subscription extends Entity
public function getStatus(): string public function getStatus(): string
{ {
return ($this->expires_at !== null && $this->expires_at->isBefore( return ($this->expires_at instanceof Time && $this->expires_at->isBefore(
Time::now() Time::now()
)) ? 'expired' : $this->attributes['status']; )) ? 'expired' : $this->attributes['status'];
} }