add a record trait, update some tests, work on the EpisodeFileRepository

This commit is contained in:
Dave Smith-Hayes 2025-04-06 22:07:23 -04:00
parent 2d720f990d
commit 3fe372865c
9 changed files with 307 additions and 249 deletions

366
app/composer.lock generated
View File

@ -8,16 +8,16 @@
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
"version": "0.12.1", "version": "0.12.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/brick/math.git", "url": "https://github.com/brick/math.git",
"reference": "f510c0a40911935b77b86859eb5223d58d660df1" "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", "url": "https://api.github.com/repos/brick/math/zipball/866551da34e9a618e64a819ee1e01c20d8a588ba",
"reference": "f510c0a40911935b77b86859eb5223d58d660df1", "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -26,7 +26,7 @@
"require-dev": { "require-dev": {
"php-coveralls/php-coveralls": "^2.2", "php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^10.1", "phpunit/phpunit": "^10.1",
"vimeo/psalm": "5.16.0" "vimeo/psalm": "6.8.8"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -56,7 +56,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.12.1" "source": "https://github.com/brick/math/tree/0.12.3"
}, },
"funding": [ "funding": [
{ {
@ -64,7 +64,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-11-29T23:19:16+00:00" "time": "2025-02-28T13:11:00+00:00"
}, },
{ {
"name": "cakephp/chronos", "name": "cakephp/chronos",
@ -127,20 +127,20 @@
}, },
{ {
"name": "cakephp/core", "name": "cakephp/core",
"version": "5.1.4", "version": "5.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cakephp/core.git", "url": "https://github.com/cakephp/core.git",
"reference": "fdd2ab323284cc8475decaeaad4a3398aa90ff91" "reference": "ba182a1410f1b06e8d1ab4d874b6f9797fbee165"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cakephp/core/zipball/fdd2ab323284cc8475decaeaad4a3398aa90ff91", "url": "https://api.github.com/repos/cakephp/core/zipball/ba182a1410f1b06e8d1ab4d874b6f9797fbee165",
"reference": "fdd2ab323284cc8475decaeaad4a3398aa90ff91", "reference": "ba182a1410f1b06e8d1ab4d874b6f9797fbee165",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"cakephp/utility": "^5.1", "cakephp/utility": "5.2.*@dev",
"league/container": "^4.2", "league/container": "^4.2",
"php": ">=8.1", "php": ">=8.1",
"psr/container": "^1.1 || ^2.0" "psr/container": "^1.1 || ^2.0"
@ -154,6 +154,11 @@
"league/container": "To use Container and ServiceProvider classes" "league/container": "To use Container and ServiceProvider classes"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-5.x": "5.2.x-dev"
}
},
"autoload": { "autoload": {
"files": [ "files": [
"functions.php" "functions.php"
@ -185,38 +190,43 @@
"issues": "https://github.com/cakephp/cakephp/issues", "issues": "https://github.com/cakephp/cakephp/issues",
"source": "https://github.com/cakephp/core" "source": "https://github.com/cakephp/core"
}, },
"time": "2024-11-30T18:47:29+00:00" "time": "2025-04-02T12:02:03+00:00"
}, },
{ {
"name": "cakephp/database", "name": "cakephp/database",
"version": "5.1.4", "version": "5.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cakephp/database.git", "url": "https://github.com/cakephp/database.git",
"reference": "3a872d4ef14424679d30d2045eaca2643c967d64" "reference": "f356a3fc78ff1c746d78786806f67ef22505cd76"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cakephp/database/zipball/3a872d4ef14424679d30d2045eaca2643c967d64", "url": "https://api.github.com/repos/cakephp/database/zipball/f356a3fc78ff1c746d78786806f67ef22505cd76",
"reference": "3a872d4ef14424679d30d2045eaca2643c967d64", "reference": "f356a3fc78ff1c746d78786806f67ef22505cd76",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"cakephp/chronos": "^3.1", "cakephp/chronos": "^3.1",
"cakephp/core": "^5.1", "cakephp/core": "5.2.*@dev",
"cakephp/datasource": "^5.1", "cakephp/datasource": "5.2.*@dev",
"php": ">=8.1", "php": ">=8.1",
"psr/log": "^3.0" "psr/log": "^3.0"
}, },
"require-dev": { "require-dev": {
"cakephp/i18n": "^5.1", "cakephp/i18n": "5.2.*@dev",
"cakephp/log": "^5.1" "cakephp/log": "5.2.*@dev"
}, },
"suggest": { "suggest": {
"cakephp/i18n": "If you are using locale-aware datetime formats.", "cakephp/i18n": "If you are using locale-aware datetime formats.",
"cakephp/log": "If you want to use query logging without providing a logger yourself." "cakephp/log": "If you want to use query logging without providing a logger yourself."
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-5.x": "5.2.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Cake\\Database\\": "." "Cake\\Database\\": "."
@ -247,31 +257,31 @@
"issues": "https://github.com/cakephp/cakephp/issues", "issues": "https://github.com/cakephp/cakephp/issues",
"source": "https://github.com/cakephp/database" "source": "https://github.com/cakephp/database"
}, },
"time": "2024-12-12T13:08:46+00:00" "time": "2025-04-05T04:18:59+00:00"
}, },
{ {
"name": "cakephp/datasource", "name": "cakephp/datasource",
"version": "5.1.4", "version": "5.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cakephp/datasource.git", "url": "https://github.com/cakephp/datasource.git",
"reference": "34b9617febd47649011e8914a4dbb21194a78504" "reference": "2b4f33fcc8c5d13261b851e8299c9fa85ff11b6e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cakephp/datasource/zipball/34b9617febd47649011e8914a4dbb21194a78504", "url": "https://api.github.com/repos/cakephp/datasource/zipball/2b4f33fcc8c5d13261b851e8299c9fa85ff11b6e",
"reference": "34b9617febd47649011e8914a4dbb21194a78504", "reference": "2b4f33fcc8c5d13261b851e8299c9fa85ff11b6e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"cakephp/core": "^5.1", "cakephp/core": "5.2.*@dev",
"php": ">=8.1", "php": ">=8.1",
"psr/simple-cache": "^2.0 || ^3.0" "psr/simple-cache": "^2.0 || ^3.0"
}, },
"require-dev": { "require-dev": {
"cakephp/cache": "^5.1", "cakephp/cache": "5.2.*@dev",
"cakephp/collection": "^5.1", "cakephp/collection": "5.2.*@dev",
"cakephp/utility": "^5.1" "cakephp/utility": "5.2.*@dev"
}, },
"suggest": { "suggest": {
"cakephp/cache": "If you decide to use Query caching.", "cakephp/cache": "If you decide to use Query caching.",
@ -279,6 +289,11 @@
"cakephp/utility": "If you decide to use EntityTrait." "cakephp/utility": "If you decide to use EntityTrait."
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-5.x": "5.2.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Cake\\Datasource\\": "." "Cake\\Datasource\\": "."
@ -309,24 +324,24 @@
"issues": "https://github.com/cakephp/cakephp/issues", "issues": "https://github.com/cakephp/cakephp/issues",
"source": "https://github.com/cakephp/datasource" "source": "https://github.com/cakephp/datasource"
}, },
"time": "2024-12-12T02:27:02+00:00" "time": "2025-04-05T02:12:27+00:00"
}, },
{ {
"name": "cakephp/utility", "name": "cakephp/utility",
"version": "5.1.4", "version": "5.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cakephp/utility.git", "url": "https://github.com/cakephp/utility.git",
"reference": "943342ca3c0fc3cccb9f789340ff7eb5eceb1839" "reference": "8b97361c71d30a9f1df2c8e98469d20af78d6ed6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cakephp/utility/zipball/943342ca3c0fc3cccb9f789340ff7eb5eceb1839", "url": "https://api.github.com/repos/cakephp/utility/zipball/8b97361c71d30a9f1df2c8e98469d20af78d6ed6",
"reference": "943342ca3c0fc3cccb9f789340ff7eb5eceb1839", "reference": "8b97361c71d30a9f1df2c8e98469d20af78d6ed6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"cakephp/core": "^5.1", "cakephp/core": "5.2.*@dev",
"php": ">=8.1" "php": ">=8.1"
}, },
"suggest": { "suggest": {
@ -334,6 +349,11 @@
"lib-ICU": "To use Text::transliterate() or Text::slug()" "lib-ICU": "To use Text::transliterate() or Text::slug()"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-5.x": "5.2.x-dev"
}
},
"autoload": { "autoload": {
"files": [ "files": [
"bootstrap.php" "bootstrap.php"
@ -368,7 +388,7 @@
"issues": "https://github.com/cakephp/cakephp/issues", "issues": "https://github.com/cakephp/cakephp/issues",
"source": "https://github.com/cakephp/utility" "source": "https://github.com/cakephp/utility"
}, },
"time": "2024-11-30T18:47:29+00:00" "time": "2025-04-05T02:12:27+00:00"
}, },
{ {
"name": "dflydev/dot-access-data", "name": "dflydev/dot-access-data",
@ -665,32 +685,32 @@
}, },
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
"version": "v1.3.7", "version": "v2.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/serializable-closure.git", "url": "https://github.com/laravel/serializable-closure.git",
"reference": "4f48ade902b94323ca3be7646db16209ec76be3d" "reference": "b352cf0534aa1ae6b4d825d1e762e35d43f8a841"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/4f48ade902b94323ca3be7646db16209ec76be3d", "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/b352cf0534aa1ae6b4d825d1e762e35d43f8a841",
"reference": "4f48ade902b94323ca3be7646db16209ec76be3d", "reference": "b352cf0534aa1ae6b4d825d1e762e35d43f8a841",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.3|^8.0" "php": "^8.1"
}, },
"require-dev": { "require-dev": {
"illuminate/support": "^8.0|^9.0|^10.0|^11.0", "illuminate/support": "^10.0|^11.0|^12.0",
"nesbot/carbon": "^2.61|^3.0", "nesbot/carbon": "^2.67|^3.0",
"pestphp/pest": "^1.21.3", "pestphp/pest": "^2.36|^3.0",
"phpstan/phpstan": "^1.8.2", "phpstan/phpstan": "^2.0",
"symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" "symfony/var-dumper": "^6.2.0|^7.0.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.x-dev" "dev-master": "2.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -722,7 +742,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues", "issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure" "source": "https://github.com/laravel/serializable-closure"
}, },
"time": "2024-11-14T18:34:49+00:00" "time": "2025-03-19T13:51:03+00:00"
}, },
{ {
"name": "league/config", "name": "league/config",
@ -1078,16 +1098,16 @@
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "3.8.1", "version": "3.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Seldaek/monolog.git", "url": "https://github.com/Seldaek/monolog.git",
"reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4" "reference": "10d85740180ecba7896c87e06a166e0c95a0e3b6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/aef6ee73a77a66e404dd6540934a9ef1b3c855b4", "url": "https://api.github.com/repos/Seldaek/monolog/zipball/10d85740180ecba7896c87e06a166e0c95a0e3b6",
"reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4", "reference": "10d85740180ecba7896c87e06a166e0c95a0e3b6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1165,7 +1185,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/Seldaek/monolog/issues", "issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/3.8.1" "source": "https://github.com/Seldaek/monolog/tree/3.9.0"
}, },
"funding": [ "funding": [
{ {
@ -1177,7 +1197,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-05T17:15:07+00:00" "time": "2025-03-24T10:02:05+00:00"
}, },
{ {
"name": "nette/schema", "name": "nette/schema",
@ -1243,16 +1263,16 @@
}, },
{ {
"name": "nette/utils", "name": "nette/utils",
"version": "v4.0.5", "version": "v4.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nette/utils.git", "url": "https://github.com/nette/utils.git",
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96" "reference": "ce708655043c7050eb050df361c5e313cf708309"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", "url": "https://api.github.com/repos/nette/utils/zipball/ce708655043c7050eb050df361c5e313cf708309",
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", "reference": "ce708655043c7050eb050df361c5e313cf708309",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1323,9 +1343,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nette/utils/issues", "issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v4.0.5" "source": "https://github.com/nette/utils/tree/v4.0.6"
}, },
"time": "2024-08-07T15:39:19+00:00" "time": "2025-03-30T21:06:30+00:00"
}, },
{ {
"name": "nikic/fast-route", "name": "nikic/fast-route",
@ -1429,16 +1449,16 @@
}, },
{ {
"name": "php-di/invoker", "name": "php-di/invoker",
"version": "2.3.4", "version": "2.3.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-DI/Invoker.git", "url": "https://github.com/PHP-DI/Invoker.git",
"reference": "33234b32dafa8eb69202f950a1fc92055ed76a86" "reference": "59f15608528d8a8838d69b422a919fd6b16aa576"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/33234b32dafa8eb69202f950a1fc92055ed76a86", "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/59f15608528d8a8838d69b422a919fd6b16aa576",
"reference": "33234b32dafa8eb69202f950a1fc92055ed76a86", "reference": "59f15608528d8a8838d69b422a919fd6b16aa576",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1472,7 +1492,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-DI/Invoker/issues", "issues": "https://github.com/PHP-DI/Invoker/issues",
"source": "https://github.com/PHP-DI/Invoker/tree/2.3.4" "source": "https://github.com/PHP-DI/Invoker/tree/2.3.6"
}, },
"funding": [ "funding": [
{ {
@ -1480,24 +1500,24 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-09-08T09:24:21+00:00" "time": "2025-01-17T12:49:27+00:00"
}, },
{ {
"name": "php-di/php-di", "name": "php-di/php-di",
"version": "7.0.7", "version": "7.0.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-DI/PHP-DI.git", "url": "https://github.com/PHP-DI/PHP-DI.git",
"reference": "e87435e3c0e8f22977adc5af0d5cdcc467e15cf1" "reference": "d8480267f5cf239650debba704f3ecd15b638cde"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/e87435e3c0e8f22977adc5af0d5cdcc467e15cf1", "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/d8480267f5cf239650debba704f3ecd15b638cde",
"reference": "e87435e3c0e8f22977adc5af0d5cdcc467e15cf1", "reference": "d8480267f5cf239650debba704f3ecd15b638cde",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"laravel/serializable-closure": "^1.0", "laravel/serializable-closure": "^1.0 || ^2.0",
"php": ">=8.0", "php": ">=8.0",
"php-di/invoker": "^2.0", "php-di/invoker": "^2.0",
"psr/container": "^1.1 || ^2.0" "psr/container": "^1.1 || ^2.0"
@ -1509,8 +1529,8 @@
"friendsofphp/php-cs-fixer": "^3", "friendsofphp/php-cs-fixer": "^3",
"friendsofphp/proxy-manager-lts": "^1", "friendsofphp/proxy-manager-lts": "^1",
"mnapoli/phpunit-easymock": "^1.3", "mnapoli/phpunit-easymock": "^1.3",
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.6",
"vimeo/psalm": "^4.6" "vimeo/psalm": "^5|^6"
}, },
"suggest": { "suggest": {
"friendsofphp/proxy-manager-lts": "Install it if you want to use lazy injection (version ^1)" "friendsofphp/proxy-manager-lts": "Install it if you want to use lazy injection (version ^1)"
@ -1541,7 +1561,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-DI/PHP-DI/issues", "issues": "https://github.com/PHP-DI/PHP-DI/issues",
"source": "https://github.com/PHP-DI/PHP-DI/tree/7.0.7" "source": "https://github.com/PHP-DI/PHP-DI/tree/7.0.9"
}, },
"funding": [ "funding": [
{ {
@ -1553,7 +1573,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-21T15:55:45+00:00" "time": "2025-02-28T12:46:35+00:00"
}, },
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
@ -2099,16 +2119,16 @@
}, },
{ {
"name": "ramsey/collection", "name": "ramsey/collection",
"version": "2.0.0", "version": "2.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/ramsey/collection.git", "url": "https://github.com/ramsey/collection.git",
"reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2",
"reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2116,25 +2136,22 @@
}, },
"require-dev": { "require-dev": {
"captainhook/plugin-composer": "^5.3", "captainhook/plugin-composer": "^5.3",
"ergebnis/composer-normalize": "^2.28.3", "ergebnis/composer-normalize": "^2.45",
"fakerphp/faker": "^1.21", "fakerphp/faker": "^1.24",
"hamcrest/hamcrest-php": "^2.0", "hamcrest/hamcrest-php": "^2.0",
"jangregor/phpstan-prophecy": "^1.0", "jangregor/phpstan-prophecy": "^2.1",
"mockery/mockery": "^1.5", "mockery/mockery": "^1.6",
"php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.4",
"phpcsstandards/phpcsutils": "^1.0.0-rc1", "phpspec/prophecy-phpunit": "^2.3",
"phpspec/prophecy-phpunit": "^2.0", "phpstan/extension-installer": "^1.4",
"phpstan/extension-installer": "^1.2", "phpstan/phpstan": "^2.1",
"phpstan/phpstan": "^1.9", "phpstan/phpstan-mockery": "^2.0",
"phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-phpunit": "^1.3", "phpunit/phpunit": "^10.5",
"phpunit/phpunit": "^9.5", "ramsey/coding-standard": "^2.3",
"psalm/plugin-mockery": "^1.1", "ramsey/conventional-commits": "^1.6",
"psalm/plugin-phpunit": "^0.18.4", "roave/security-advisories": "dev-latest"
"ramsey/coding-standard": "^2.0.3",
"ramsey/conventional-commits": "^1.3",
"vimeo/psalm": "^5.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -2172,19 +2189,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/ramsey/collection/issues", "issues": "https://github.com/ramsey/collection/issues",
"source": "https://github.com/ramsey/collection/tree/2.0.0" "source": "https://github.com/ramsey/collection/tree/2.1.1"
}, },
"funding": [ "time": "2025-03-22T05:38:12+00:00"
{
"url": "https://github.com/ramsey",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/ramsey/collection",
"type": "tidelift"
}
],
"time": "2022-12-31T21:50:55+00:00"
}, },
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
@ -3224,16 +3231,16 @@
}, },
{ {
"name": "symfony/config", "name": "symfony/config",
"version": "v7.2.0", "version": "v7.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/config.git", "url": "https://github.com/symfony/config.git",
"reference": "bcd3c4adf0144dee5011bb35454728c38adec055" "reference": "7716594aaae91d9141be080240172a92ecca4d44"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/bcd3c4adf0144dee5011bb35454728c38adec055", "url": "https://api.github.com/repos/symfony/config/zipball/7716594aaae91d9141be080240172a92ecca4d44",
"reference": "bcd3c4adf0144dee5011bb35454728c38adec055", "reference": "7716594aaae91d9141be080240172a92ecca4d44",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3279,7 +3286,7 @@
"description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/config/tree/v7.2.0" "source": "https://github.com/symfony/config/tree/v7.2.3"
}, },
"funding": [ "funding": [
{ {
@ -3295,20 +3302,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-11-04T11:36:24+00:00" "time": "2025-01-22T12:07:01+00:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v7.2.1", "version": "v7.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" "reference": "e51498ea18570c062e7df29d05a7003585b19b88"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88",
"reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "reference": "e51498ea18570c062e7df29d05a7003585b19b88",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3372,7 +3379,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v7.2.1" "source": "https://github.com/symfony/console/tree/v7.2.5"
}, },
"funding": [ "funding": [
{ {
@ -3388,7 +3395,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-11T03:49:26+00:00" "time": "2025-03-12T08:11:12+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@ -4169,24 +4176,23 @@
}, },
{ {
"name": "twig/twig", "name": "twig/twig",
"version": "v3.18.0", "version": "v3.20.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50" "reference": "3468920399451a384bef53cf7996965f7cd40183"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50", "url": "https://api.github.com/repos/twigphp/Twig/zipball/3468920399451a384bef53cf7996965f7cd40183",
"reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50", "reference": "3468920399451a384bef53cf7996965f7cd40183",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.0.2", "php": ">=8.1.0",
"symfony/deprecation-contracts": "^2.5|^3", "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8", "symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3", "symfony/polyfill-mbstring": "^1.3"
"symfony/polyfill-php81": "^1.29"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^2.0", "phpstan/phpstan": "^2.0",
@ -4233,7 +4239,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/twigphp/Twig/issues", "issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.18.0" "source": "https://github.com/twigphp/Twig/tree/v3.20.0"
}, },
"funding": [ "funding": [
{ {
@ -4245,7 +4251,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-29T10:51:50+00:00" "time": "2025-02-13T08:34:43+00:00"
}, },
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
@ -4450,16 +4456,16 @@
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.12.1", "version": "1.13.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" "reference": "024473a478be9df5fdaca2c793f2232fe788e414"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414",
"reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "reference": "024473a478be9df5fdaca2c793f2232fe788e414",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4498,7 +4504,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/myclabs/DeepCopy/issues", "issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0"
}, },
"funding": [ "funding": [
{ {
@ -4506,7 +4512,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-11-08T17:47:46+00:00" "time": "2025-02-12T12:17:51+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
@ -4986,16 +4992,16 @@
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
"version": "2.0.0", "version": "2.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git", "url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68",
"reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5027,29 +5033,29 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types", "description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": { "support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues", "issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" "source": "https://github.com/phpstan/phpdoc-parser/tree/2.1.0"
}, },
"time": "2024-10-13T11:29:49+00:00" "time": "2025-02-19T13:28:12+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "11.0.8", "version": "11.0.9",
"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": "418c59fd080954f8c4aa5631d9502ecda2387118" "reference": "14d63fbcca18457e49c6f8bebaa91a87e8e188d7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/418c59fd080954f8c4aa5631d9502ecda2387118", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/14d63fbcca18457e49c6f8bebaa91a87e8e188d7",
"reference": "418c59fd080954f8c4aa5631d9502ecda2387118", "reference": "14d63fbcca18457e49c6f8bebaa91a87e8e188d7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-dom": "*", "ext-dom": "*",
"ext-libxml": "*", "ext-libxml": "*",
"ext-xmlwriter": "*", "ext-xmlwriter": "*",
"nikic/php-parser": "^5.3.1", "nikic/php-parser": "^5.4.0",
"php": ">=8.2", "php": ">=8.2",
"phpunit/php-file-iterator": "^5.1.0", "phpunit/php-file-iterator": "^5.1.0",
"phpunit/php-text-template": "^4.0.1", "phpunit/php-text-template": "^4.0.1",
@ -5061,7 +5067,7 @@
"theseer/tokenizer": "^1.2.3" "theseer/tokenizer": "^1.2.3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^11.5.0" "phpunit/phpunit": "^11.5.2"
}, },
"suggest": { "suggest": {
"ext-pcov": "PHP extension that provides line coverage", "ext-pcov": "PHP extension that provides line coverage",
@ -5099,7 +5105,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/11.0.8" "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.9"
}, },
"funding": [ "funding": [
{ {
@ -5107,7 +5113,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-12-11T12:34:27+00:00" "time": "2025-02-25T13:26:39+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@ -5356,16 +5362,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "11.5.3", "version": "11.5.15",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "30e319e578a7b5da3543073e30002bf82042f701" "reference": "4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/30e319e578a7b5da3543073e30002bf82042f701", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c",
"reference": "30e319e578a7b5da3543073e30002bf82042f701", "reference": "4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5375,24 +5381,24 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-xml": "*", "ext-xml": "*",
"ext-xmlwriter": "*", "ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.12.1", "myclabs/deep-copy": "^1.13.0",
"phar-io/manifest": "^2.0.4", "phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1", "phar-io/version": "^3.2.1",
"php": ">=8.2", "php": ">=8.2",
"phpunit/php-code-coverage": "^11.0.8", "phpunit/php-code-coverage": "^11.0.9",
"phpunit/php-file-iterator": "^5.1.0", "phpunit/php-file-iterator": "^5.1.0",
"phpunit/php-invoker": "^5.0.1", "phpunit/php-invoker": "^5.0.1",
"phpunit/php-text-template": "^4.0.1", "phpunit/php-text-template": "^4.0.1",
"phpunit/php-timer": "^7.0.1", "phpunit/php-timer": "^7.0.1",
"sebastian/cli-parser": "^3.0.2", "sebastian/cli-parser": "^3.0.2",
"sebastian/code-unit": "^3.0.2", "sebastian/code-unit": "^3.0.3",
"sebastian/comparator": "^6.3.0", "sebastian/comparator": "^6.3.1",
"sebastian/diff": "^6.0.2", "sebastian/diff": "^6.0.2",
"sebastian/environment": "^7.2.0", "sebastian/environment": "^7.2.0",
"sebastian/exporter": "^6.3.0", "sebastian/exporter": "^6.3.0",
"sebastian/global-state": "^7.0.2", "sebastian/global-state": "^7.0.2",
"sebastian/object-enumerator": "^6.0.1", "sebastian/object-enumerator": "^6.0.1",
"sebastian/type": "^5.1.0", "sebastian/type": "^5.1.2",
"sebastian/version": "^5.0.2", "sebastian/version": "^5.0.2",
"staabm/side-effects-detector": "^1.0.5" "staabm/side-effects-detector": "^1.0.5"
}, },
@ -5437,7 +5443,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/11.5.3" "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.15"
}, },
"funding": [ "funding": [
{ {
@ -5453,7 +5459,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-01-13T09:36:00+00:00" "time": "2025-03-23T16:02:11+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -5514,16 +5520,16 @@
}, },
{ {
"name": "sebastian/code-unit", "name": "sebastian/code-unit",
"version": "3.0.2", "version": "3.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/code-unit.git", "url": "https://github.com/sebastianbergmann/code-unit.git",
"reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca" "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64",
"reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5559,7 +5565,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/code-unit/issues", "issues": "https://github.com/sebastianbergmann/code-unit/issues",
"security": "https://github.com/sebastianbergmann/code-unit/security/policy", "security": "https://github.com/sebastianbergmann/code-unit/security/policy",
"source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.2" "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3"
}, },
"funding": [ "funding": [
{ {
@ -5567,7 +5573,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-12-12T09:59:06+00:00" "time": "2025-03-19T07:56:08+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
@ -5627,16 +5633,16 @@
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
"version": "6.3.0", "version": "6.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115" "reference": "24b8fbc2c8e201bb1308e7b05148d6ab393b6959"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d4e47a769525c4dd38cea90e5dcd435ddbbc7115", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/24b8fbc2c8e201bb1308e7b05148d6ab393b6959",
"reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115", "reference": "24b8fbc2c8e201bb1308e7b05148d6ab393b6959",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5655,7 +5661,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-main": "6.2-dev" "dev-main": "6.3-dev"
} }
}, },
"autoload": { "autoload": {
@ -5695,7 +5701,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues", "issues": "https://github.com/sebastianbergmann/comparator/issues",
"security": "https://github.com/sebastianbergmann/comparator/security/policy", "security": "https://github.com/sebastianbergmann/comparator/security/policy",
"source": "https://github.com/sebastianbergmann/comparator/tree/6.3.0" "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.1"
}, },
"funding": [ "funding": [
{ {
@ -5703,7 +5709,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2025-01-06T10:28:19+00:00" "time": "2025-03-07T06:57:01+00:00"
}, },
{ {
"name": "sebastian/complexity", "name": "sebastian/complexity",
@ -6272,16 +6278,16 @@
}, },
{ {
"name": "sebastian/type", "name": "sebastian/type",
"version": "5.1.0", "version": "5.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/type.git", "url": "https://github.com/sebastianbergmann/type.git",
"reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac" "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac", "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/a8a7e30534b0eb0c77cd9d07e82de1a114389f5e",
"reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac", "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6317,7 +6323,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/type/issues", "issues": "https://github.com/sebastianbergmann/type/issues",
"security": "https://github.com/sebastianbergmann/type/security/policy", "security": "https://github.com/sebastianbergmann/type/security/policy",
"source": "https://github.com/sebastianbergmann/type/tree/5.1.0" "source": "https://github.com/sebastianbergmann/type/tree/5.1.2"
}, },
"funding": [ "funding": [
{ {
@ -6325,7 +6331,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-09-17T13:12:04+00:00" "time": "2025-03-18T13:35:50+00:00"
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",

View File

@ -2,64 +2,23 @@
namespace Slovocast\Domain; namespace Slovocast\Domain;
use DateTime;
use DateTimeImmutable;
/** /**
* The Entity Trait is standard record based methods and properties that will * The Entity Trait is standard record based methods and properties that will
* turn any object in a domain into an Entity, by providing it with an ID * turn any object in a domain into an Entity, by providing it with an ID
* property, setter and getter methods. * property, setter and getter methods.
*
* If you don't want to be able to set an ID on an object in the Domain, then
* simply override the setter to do nothing.
*/ */
trait Entity trait Entity
{ {
protected ?int $id; protected mixed $id;
protected ?DateTimeImmutable $createdAt;
protected ?DateTime $updatedAt;
/** public function setId(mixed $id): static
* Functionally if there is no ID, this is a new Entity that had not been
* persisted to a datasource.
*
* @return bool
*/
public function isNew(): bool
{
return (bool) $this->id;
}
public function setId(int $id): static
{ {
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
public function getId(): int public function getId(): mixed
{ {
return $this->id; return $this->id;
} }
public function setCreatedAt(DateTimeImmutable $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getCreatedAt(): DateTimeImmutable
{
return $this->createdAt;
}
public function setUpdatedAt(DateTime $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getUpdatedAt(): DateTime
{
return $this->updatedAt;
}
} }

View File

@ -3,12 +3,15 @@
namespace Slovocast\Domain\Entity\Episode; namespace Slovocast\Domain\Entity\Episode;
use Slovocast\Domain\Entity as EntityTrait; use Slovocast\Domain\Entity as EntityTrait;
use Slovocast\Domain\Record as RecordTrait;
/** /**
* Represents the data about the specific file that is used for the episode. * Represents the data about the specific file that is used for the episode.
*/ */
class File class File
{ {
use EntityTrait; use EntityTrait;
use RecordTrait;
/** /**
* We should also be able to buffer the raw binary data of the buffer to * We should also be able to buffer the raw binary data of the buffer to

View File

@ -5,10 +5,12 @@ namespace Slovocast\Domain\Entity;
use DateTimeImmutable; use DateTimeImmutable;
use DateTime; use DateTime;
use Slovocast\Domain\Entity; use Slovocast\Domain\Entity;
use Slovocast\Domain\Record;
class User class User
{ {
use Entity; use Entity;
use Record;
public function __construct( public function __construct(
private string $email, private string $email,

43
app/src/Domain/Record.php Normal file
View File

@ -0,0 +1,43 @@
<?php
namespace Slovocast\Domain;
use DateTime;
use DateTimeImmutable;
trait Record
{
protected ?DateTimeImmutable $createdAt;
protected ?DateTime $updatedAt;
public function setCreatedAt(DateTimeImmutable $createdAt): void
{
$this->createdAt = $createdAt;
}
public function getCreatedAt(): DateTimeImmutable
{
return $this->createdAt;
}
public function setUpdatedAt(DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
public function getUpdatedAt(): DateTime
{
return $this->updatedAt;
}
public function markUpdated(): void
{
$this->updatedAt = new DateTime();
}
public function markCreated(): void
{
$this->createdAt = new DateTimeImmutable();
$this->updatedAt = new DateTime();
}
}

View File

@ -8,7 +8,8 @@ use Slovocast\Domain\Entity\Episode\File;
/** /**
* The Episode File repository should consist of getting and setting the data * The Episode File repository should consist of getting and setting the data
* about the file stored in the database. The implementation of this class * about the file stored in the database. The implementation of this class
* should concern itself with the data _about_ the file, not the file itself. * should concern itself with the metadata _about_ the file, not the file
* itself.
*/ */
interface EpisodeFileRepositoryInterface interface EpisodeFileRepositoryInterface
{ {

View File

@ -0,0 +1,51 @@
<?php
namespace Slovocast\Domain\Repository\Episode;
use Slovocast\Domain\Entity\Episode;
use Slovocast\Domain\Entity\Episode\File;
use Slovocast\Exception\EntityNotFoundException;
use Slovocast\Infrastructure\Api\Database\DatabaseHandlerInterface;
class EpisodeFileRepository implements EpisodeFileRepositoryInterface
{
public function __construct(
private DatabaseHandlerInterface $db,
) { }
public function get(int $id): File
{
$query = "SELECT * FROM files WHERE id = :id";
$results = $this->db->query($query, [ ':id' => $id ]);
if (!is_array($results) || empty($results)) {
throw new EntityNotFoundException("Unable to file File Metadata");
}
$row = array_shift($results);
return File::fromArray($row);
}
public function getFromEpisode(Episode $episode): File
{
}
public function create(File $file): File
{
}
public function update(File $file): bool
{
}
/**
* @TODO Determine how to soft and fully delete the File data.
*/
public function delete(File $file): bool
{
return true;
}
}

View File

@ -11,18 +11,6 @@ use Slovocast\Infrastructure\Api\Database\DatabaseHandlerInterface;
class UserRepository implements UserRepositoryInterface class UserRepository implements UserRepositoryInterface
{ {
const QUERY_CREATE = "INSERT INTO users (email, password, name)
VALUES (:email, :password, :name)";
const QUERY_UPDATE = "UPDATE users
SET email = :email,
name = :name,
password = :password
WHERE id = :id";
const QUERY_SELECT_BY_ID = "";
const QUERY_SELECT_BY_EMAIL = "";
public function __construct( public function __construct(
private DatabaseHandlerInterface $db, private DatabaseHandlerInterface $db,
private UserAuthorizationInterface $userAuth private UserAuthorizationInterface $userAuth
@ -35,14 +23,7 @@ class UserRepository implements UserRepositoryInterface
*/ */
protected function userFromQueryResults(array $results): User protected function userFromQueryResults(array $results): User
{ {
return User::fromArray([ return User::fromArray($results);
'id' => $results['id'],
'email' => $results['email'],
'password' => $results['password'],
'name' => $results['name'],
'createdAt' => $results['created_at'],
'updatedAt' => $results['updated_at']
]);
} }
/** /**
@ -58,7 +39,8 @@ class UserRepository implements UserRepositoryInterface
throw new EntityNotFoundException("Unable to find User"); throw new EntityNotFoundException("Unable to find User");
} }
return $this->userFromQueryResults(array_shift($results)); $row = array_shift($results);
return User::fromArray($row);
} }
/** /**
@ -76,12 +58,16 @@ class UserRepository implements UserRepositoryInterface
throw new EntityNotFoundException("Unable to find User"); throw new EntityNotFoundException("Unable to find User");
} }
return $this->userFromQueryResults(array_shift($results)); $row = array_shift($results);
return User::fromArray($row);
} }
public function create(User $user): bool public function create(User $user): bool
{ {
$results = $this->db->execute(self::QUERY_CREATE, [ $createQuery = "INSERT INTO users (email, password, name)
VALUES (:email, :password, :name)";
$results = $this->db->execute($createQuery, [
':email' => $user->getEmail(), ':email' => $user->getEmail(),
':password' => $this->userAuth->hash($user->getPassword()), ':password' => $this->userAuth->hash($user->getPassword()),
':name' => $user->getName(), ':name' => $user->getName(),
@ -99,7 +85,13 @@ class UserRepository implements UserRepositoryInterface
public function update(User $user): bool public function update(User $user): bool
{ {
$results = $this->db->execute(self::QUERY_UPDATE, [ $updateQuery = "UPDATE users
SET email = :email,
name = :name,
password = :password
WHERE id = :id";
$results = $this->db->execute($updateQuery, [
':email' => $user->getEmail(), ':email' => $user->getEmail(),
':name' => $user->getName(), ':name' => $user->getName(),
':password' => $this->userAuth->hash($user->getPassword()), ':password' => $this->userAuth->hash($user->getPassword()),

View File

@ -79,6 +79,7 @@ class UserRepositoryTest extends TestCase
$user = $userRepository->get(1); $user = $userRepository->get(1);
$this->assertEquals("Dave Test", $user->getName()); $this->assertEquals("Dave Test", $user->getName());
// Now go get a User that doesn't exist
$this->expectException(EntityNotFoundException::class); $this->expectException(EntityNotFoundException::class);
$userRepository->get(2); $userRepository->get(2);
} }