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);
}
if ($this->post === null) {
if (! $this->post instanceof CastopodPost) {
throw PageNotFoundException::forPageNotFound();
}

View File

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

View File

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

View File

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

View File

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

View File

@ -19,20 +19,20 @@
"adaures/podcast-persons-taxonomy": "^v1.0.0",
"phpseclib/phpseclib": "~2.0.42",
"michalsn/codeigniter4-uuid": "dev-develop",
"essence/essence": "^3.5.4",
"codeigniter4/settings": "^v2.1.0",
"chrisjean/php-ico": "^1.0.4",
"melbahja/seo": "^v2.1.1",
"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": {
"mikey179/vfsstream": "^v1.6.11",
"phpunit/phpunit": "^10.1.0",
"captainhook/captainhook": "^5.16.3",
"phpunit/phpunit": "^10.1.2",
"captainhook/captainhook": "^5.16.4",
"symplify/easy-coding-standard": "^11.3.2",
"phpstan/phpstan": "^1.10.13",
"rector/rector": "^0.15.24",
"rector/rector": "^0.16.0",
"symplify/coding-standard": "^11.3.0"
},
"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",
"This file is @generated automatically"
],
"content-hash": "210cbe161bd78cbdd9a97234896b87cb",
"content-hash": "4d43e58af5e0900789bca63be2c8401e",
"packages": [
{
"name": "adaures/ipcat-php",
@ -120,16 +120,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.263.10",
"version": "3.269.7",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "d5f40cff8fe2fe75a8415618f04c987472184eba"
"reference": "f34afba20e3ad782ed91332a8306b91b06a1de5c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d5f40cff8fe2fe75a8415618f04c987472184eba",
"reference": "d5f40cff8fe2fe75a8415618f04c987472184eba",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f34afba20e3ad782ed91332a8306b91b06a1de5c",
"reference": "f34afba20e3ad782ed91332a8306b91b06a1de5c",
"shasum": ""
},
"require": {
@ -139,9 +139,10 @@
"ext-simplexml": "*",
"guzzlehttp/guzzle": "^6.5.8 || ^7.4.5",
"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",
"php": ">=5.5"
"php": ">=5.5",
"psr/http-message": "^1.0"
},
"require-dev": {
"andrewsville/php-token-reflection": "^1.4",
@ -204,32 +205,31 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"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",
"version": "0.10.2",
"version": "0.11.0",
"source": {
"type": "git",
"url": "https://github.com/brick/math.git",
"reference": "459f2781e1a08d52ee56b0b1444086e038561e3f"
"reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/459f2781e1a08d52ee56b0b1444086e038561e3f",
"reference": "459f2781e1a08d52ee56b0b1444086e038561e3f",
"url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478",
"reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.4 || ^8.0"
"php": "^8.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^9.0",
"vimeo/psalm": "4.25.0"
"vimeo/psalm": "5.0.0"
},
"type": "library",
"autoload": {
@ -252,7 +252,7 @@
],
"support": {
"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": [
{
@ -260,7 +260,7 @@
"type": "github"
}
],
"time": "2022-08-10T22:54:19+00:00"
"time": "2023-01-15T23:15:59+00:00"
},
{
"name": "chrisjean/php-ico",
@ -620,180 +620,6 @@
},
"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",
"version": "v2.13.0",
@ -902,22 +728,22 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.5.0",
"version": "7.5.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba"
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba",
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"reference": "b964ca597e86b752cd994f27293e9fa6b6a95ed9",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.5",
"guzzlehttp/psr7": "^1.9 || ^2.4",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
@ -1006,7 +832,7 @@
],
"support": {
"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": [
{
@ -1022,7 +848,7 @@
"type": "tidelift"
}
],
"time": "2022-08-28T15:39:27+00:00"
"time": "2023-04-17T16:30:08+00:00"
},
{
"name": "guzzlehttp/promises",
@ -1104,22 +930,22 @@
},
{
"name": "guzzlehttp/psr7",
"version": "2.4.4",
"version": "2.5.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf"
"reference": "b635f279edd83fc275f822a1188157ffea568ff6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf",
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6",
"reference": "b635f279edd83fc275f822a1188157ffea568ff6",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
"ralouphie/getallheaders": "^3.0"
},
"provide": {
@ -1139,9 +965,6 @@
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"autoload": {
@ -1201,7 +1024,7 @@
],
"support": {
"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": [
{
@ -1217,7 +1040,7 @@
"type": "tidelift"
}
],
"time": "2023-03-09T13:19:02+00:00"
"time": "2023-04-17T16:11:26+00:00"
},
{
"name": "james-heinrich/getid3",
@ -1884,6 +1707,74 @@
},
"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",
"version": "2.6.1",
@ -2681,20 +2572,20 @@
},
{
"name": "ramsey/uuid",
"version": "4.7.3",
"version": "4.7.4",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "433b2014e3979047db08a17a205f410ba3869cf2"
"reference": "60a4c63ab724854332900504274f6150ff26d286"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/433b2014e3979047db08a17a205f410ba3869cf2",
"reference": "433b2014e3979047db08a17a205f410ba3869cf2",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/60a4c63ab724854332900504274f6150ff26d286",
"reference": "60a4c63ab724854332900504274f6150ff26d286",
"shasum": ""
},
"require": {
"brick/math": "^0.8.8 || ^0.9 || ^0.10",
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11",
"ext-json": "*",
"php": "^8.0",
"ramsey/collection": "^1.2 || ^2.0"
@ -2749,7 +2640,7 @@
"keywords": ["guid", "identifier", "uuid"],
"support": {
"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": [
{
@ -2761,7 +2652,7 @@
"type": "tidelift"
}
],
"time": "2023-01-12T18:13:24+00:00"
"time": "2023-04-15T23:01:58+00:00"
},
{
"name": "symfony/deprecation-contracts",
@ -3180,16 +3071,16 @@
"packages-dev": [
{
"name": "captainhook/captainhook",
"version": "5.16.3",
"version": "5.16.4",
"source": {
"type": "git",
"url": "https://github.com/captainhookphp/captainhook.git",
"reference": "ed0279fd108aa4729b7843633b99326826c6fd76"
"reference": "524c8660551bafe9c7211440a71a35984e8dfc4b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/ed0279fd108aa4729b7843633b99326826c6fd76",
"reference": "ed0279fd108aa4729b7843633b99326826c6fd76",
"url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/524c8660551bafe9c7211440a71a35984e8dfc4b",
"reference": "524c8660551bafe9c7211440a71a35984e8dfc4b",
"shasum": ""
},
"require": {
@ -3247,7 +3138,7 @@
],
"support": {
"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": [
{
@ -3255,7 +3146,7 @@
"type": "github"
}
],
"time": "2023-03-30T16:40:06+00:00"
"time": "2023-04-17T19:48:47+00:00"
},
{
"name": "composer/pcre",
@ -3939,16 +3830,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.10.13",
"version": "1.10.14",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "f07bf8c6980b81bf9e49d44bd0caf2e737614a70"
"reference": "d232901b09e67538e5c86a724be841bea5768a7c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/f07bf8c6980b81bf9e49d44bd0caf2e737614a70",
"reference": "f07bf8c6980b81bf9e49d44bd0caf2e737614a70",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/d232901b09e67538e5c86a724be841bea5768a7c",
"reference": "d232901b09e67538e5c86a724be841bea5768a7c",
"shasum": ""
},
"require": {
@ -3987,20 +3878,20 @@
"type": "tidelift"
}
],
"time": "2023-04-12T19:29:52+00:00"
"time": "2023-04-19T13:47:27+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "10.1.0",
"version": "10.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8"
"reference": "884a0da7f9f46f28b2cb69134217fd810b793974"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fc4f5ee614fa82d50ecf9014b51af0a9561f3df8",
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/884a0da7f9f46f28b2cb69134217fd810b793974",
"reference": "884a0da7f9f46f28b2cb69134217fd810b793974",
"shasum": ""
},
"require": {
@ -4019,7 +3910,7 @@
"theseer/tokenizer": "^1.2.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^10.1"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
@ -4049,7 +3940,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"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": [
{
@ -4057,7 +3948,7 @@
"type": "github"
}
],
"time": "2023-04-13T07:08:27+00:00"
"time": "2023-04-17T12:15:40+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -4277,16 +4168,16 @@
},
{
"name": "phpunit/phpunit",
"version": "10.1.0",
"version": "10.1.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "5a477aea03e61329132935689ae2d73f418f5e25"
"reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5a477aea03e61329132935689ae2d73f418f5e25",
"reference": "5a477aea03e61329132935689ae2d73f418f5e25",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6f0cd95be71add539f8fd2be25b2a4a29789000b",
"reference": "6f0cd95be71add539f8fd2be25b2a4a29789000b",
"shasum": ""
},
"require": {
@ -4300,7 +4191,7 @@
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"php": ">=8.1",
"phpunit/php-code-coverage": "^10.1",
"phpunit/php-code-coverage": "^10.1.1",
"phpunit/php-file-iterator": "^4.0",
"phpunit/php-invoker": "^4.0",
"phpunit/php-text-template": "^3.0",
@ -4346,7 +4237,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"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": [
{
@ -4362,7 +4253,7 @@
"type": "tidelift"
}
],
"time": "2023-04-14T05:15:09+00:00"
"time": "2023-04-22T07:38:19+00:00"
},
{
"name": "psr/container",
@ -4417,21 +4308,21 @@
},
{
"name": "rector/rector",
"version": "0.15.24",
"version": "0.16.0",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59"
"reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/716473919bcfdc27bdd2a32afb72adbf4c224e59",
"reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f",
"reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0",
"phpstan/phpstan": "^1.10.1"
"phpstan/phpstan": "^1.10.14"
},
"conflict": {
"rector/rector-doctrine": "*",
@ -4455,7 +4346,7 @@
"keywords": ["automation", "dev", "migration", "refactoring"],
"support": {
"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": [
{
@ -4463,7 +4354,7 @@
"type": "github"
}
],
"time": "2023-04-05T08:49:11+00:00"
"time": "2023-05-05T12:12:17+00:00"
},
{
"name": "sebastian/cli-parser",
@ -4743,16 +4634,16 @@
},
{
"name": "sebastian/diff",
"version": "5.0.1",
"version": "5.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02"
"reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02",
"reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b",
"reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b",
"shasum": ""
},
"require": {
@ -4789,7 +4680,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
"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": [
{
@ -4797,7 +4688,7 @@
"type": "github"
}
],
"time": "2023-03-23T05:12:41+00:00"
"time": "2023-05-01T07:48:21+00:00"
},
{
"name": "sebastian/environment",
@ -5461,16 +5352,16 @@
},
{
"name": "symfony/console",
"version": "v6.2.8",
"version": "v6.2.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b"
"reference": "12288d9f4500f84a4d02254d4aa968b15488476f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/3582d68a64a86ec25240aaa521ec8bc2342b369b",
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b",
"url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f",
"reference": "12288d9f4500f84a4d02254d4aa968b15488476f",
"shasum": ""
},
"require": {
@ -5528,7 +5419,7 @@
"homepage": "https://symfony.com",
"keywords": ["cli", "command-line", "console", "terminal"],
"support": {
"source": "https://github.com/symfony/console/tree/v6.2.8"
"source": "https://github.com/symfony/console/tree/v6.2.10"
},
"funding": [
{
@ -5544,7 +5435,7 @@
"type": "tidelift"
}
],
"time": "2023-03-29T21:42:15+00:00"
"time": "2023-04-28T13:37:43+00:00"
},
{
"name": "symfony/event-dispatcher",
@ -5704,16 +5595,16 @@
},
{
"name": "symfony/filesystem",
"version": "v6.2.7",
"version": "v6.2.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "82b6c62b959f642d000456f08c6d219d749215b3"
"reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3",
"reference": "82b6c62b959f642d000456f08c6d219d749215b3",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894",
"reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894",
"shasum": ""
},
"require": {
@ -5743,7 +5634,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v6.2.7"
"source": "https://github.com/symfony/filesystem/tree/v6.2.10"
},
"funding": [
{
@ -5759,7 +5650,7 @@
"type": "tidelift"
}
],
"time": "2023-02-14T08:44:56+00:00"
"time": "2023-04-18T13:46:08+00:00"
},
{
"name": "symfony/finder",
@ -6105,16 +5996,16 @@
},
{
"name": "symfony/process",
"version": "v6.2.8",
"version": "v6.2.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416"
"reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/75ed64103df4f6615e15a7fe38b8111099f47416",
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416",
"url": "https://api.github.com/repos/symfony/process/zipball/b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e",
"reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e",
"shasum": ""
},
"require": {
@ -6142,7 +6033,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v6.2.8"
"source": "https://github.com/symfony/process/tree/v6.2.10"
},
"funding": [
{
@ -6158,7 +6049,7 @@
"type": "tidelift"
}
],
"time": "2023-03-09T16:20:02+00:00"
"time": "2023-04-18T13:56:57+00:00"
},
{
"name": "symfony/service-contracts",

View File

@ -32,6 +32,7 @@ use Modules\Analytics\Models\AnalyticsPodcastModel;
use Modules\Analytics\Models\AnalyticsWebsiteByBrowserModel;
use Modules\Analytics\Models\AnalyticsWebsiteByEntryPageModel;
use Modules\Analytics\Models\AnalyticsWebsiteByRefererModel;
use Modules\Media\Entities\Image;
use Modules\Media\FileManagers\FileManagerInterface;
use Modules\Media\Models\MediaModel;
@ -397,7 +398,7 @@ class PodcastController extends BaseController
public function deleteBanner(): RedirectResponse
{
if ($this->podcast->banner === null) {
if (! $this->podcast->banner instanceof Image) {
return redirect()->back();
}
@ -545,7 +546,7 @@ class PodcastController extends BaseController
$mediaModel = new MediaModel();
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();
return redirect()
->back()

View File

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

View File

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

View File

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

View File

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

View File

@ -58,7 +58,7 @@ class Subscription extends Entity
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()
)) ? 'expired' : $this->attributes['status'];
}