diff --git a/.env b/.env index 2e97593..c5d19ab 100644 --- a/.env +++ b/.env @@ -16,4 +16,7 @@ ###> symfony/framework-bundle ### APP_ENV=dev -APP_SECRET=930f26d714e6fa9188943d7e037a63fa +APP_SECRET=67f556bf9f5069ec0467e65c0505002c +###< symfony/framework-bundle ### + +ISS_LOCATION_CACHE_TTL=5 diff --git a/.gitignore b/.gitignore index a67f91e..a19e3f1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,13 @@ /var/ /vendor/ ###< symfony/framework-bundle ### + +###> php-cs-fixer/shim ### +/.php-cs-fixer.php +/.php-cs-fixer.cache +###< php-cs-fixer/shim ### + +###> symfony/asset-mapper ### +/public/assets/ +/assets/vendor/ +###< symfony/asset-mapper ### diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..3788194 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,13 @@ +in(__DIR__) + ->exclude('var') +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@Symfony' => true, + ]) + ->setFinder($finder) +; diff --git a/.symfony.local.yaml b/.symfony.local.yaml new file mode 100644 index 0000000..2d234f9 --- /dev/null +++ b/.symfony.local.yaml @@ -0,0 +1,4 @@ +workers: + # ... + tailwind: + cmd: ['symfony', 'console', 'tailwind:build', '--watch'] diff --git a/README.md b/README.md index 7fdbf4f..b17e546 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Symfony, Doctrine Relations & Warp Drive Basics +# Doctrine, Symfony 7 & the Database Well hi there! This repository holds the code and script for the -[Symfony, Doctrine Relations & Warp Drive Basics](https://symfonycasts.com/screencast/symfony7-doctrine-relations) +[Doctrine, Symfony 7 & the Database](https://symfonycasts.com/screencast/symfony7-doctrine) course on SymfonyCasts. ## Setup diff --git a/_tuts/add-fields-first-migration.diff b/_tuts/add-fields-first-migration.diff new file mode 100644 index 0000000..ddc4d3a --- /dev/null +++ b/_tuts/add-fields-first-migration.diff @@ -0,0 +1,44 @@ +diff --git a/migrations/Version20241201203154.php b/migrations/Version20241201203154.php +new file mode 100644 +index 0000000..f96a406 +--- /dev/null ++++ b/migrations/Version20241201203154.php +@@ -0,0 +1,38 @@ ++addSql('ALTER TABLE starship ADD slug VARCHAR(255) DEFAULT NULL'); ++ $this->addSql('ALTER TABLE starship ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); ++ $this->addSql('ALTER TABLE starship ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); ++ $this->addSql('COMMENT ON COLUMN starship.created_at IS \'(DC2Type:datetime_immutable)\''); ++ $this->addSql('COMMENT ON COLUMN starship.updated_at IS \'(DC2Type:datetime_immutable)\''); ++ } ++ ++ public function down(Schema $schema): void ++ { ++ // this down() migration is auto-generated, please modify it to your needs ++ $this->addSql('CREATE SCHEMA public'); ++ $this->addSql('ALTER TABLE starship DROP slug'); ++ $this->addSql('ALTER TABLE starship DROP created_at'); ++ $this->addSql('ALTER TABLE starship DROP updated_at'); ++ } ++} diff --git a/_tuts/add-fields-non-nullable-and-unique.diff b/_tuts/add-fields-non-nullable-and-unique.diff new file mode 100644 index 0000000..697c3fe --- /dev/null +++ b/_tuts/add-fields-non-nullable-and-unique.diff @@ -0,0 +1,21 @@ +diff --git a/src/Entity/Starship.php b/src/Entity/Starship.php +index 9f44868..c783e85 100644 +--- a/src/Entity/Starship.php ++++ b/src/Entity/Starship.php +@@ -28,13 +28,13 @@ class Starship + #[ORM\Column] + private ?\DateTimeImmutable $arrivedAt = null; + +- #[ORM\Column(length: 255, nullable: true)] ++ #[ORM\Column(unique: true)] + private ?string $slug = null; + +- #[ORM\Column(nullable: true)] ++ #[ORM\Column] + private ?\DateTimeImmutable $createdAt = null; + +- #[ORM\Column(nullable: true)] ++ #[ORM\Column] + private ?\DateTimeImmutable $updatedAt = null; + + public function getId(): ?int diff --git a/_tuts/add-fields-second-migration-modify.diff b/_tuts/add-fields-second-migration-modify.diff new file mode 100644 index 0000000..fc81180 --- /dev/null +++ b/_tuts/add-fields-second-migration-modify.diff @@ -0,0 +1,13 @@ +diff --git a/migrations/Version20241201203519.php b/migrations/Version20241201203519.php +index 6fa6b36..a325667 100644 +--- a/migrations/Version20241201203519.php ++++ b/migrations/Version20241201203519.php +@@ -19,6 +19,8 @@ final class Version20241201203519 extends AbstractMigration + + public function up(Schema $schema): void + { ++ $this->addSql('UPDATE starship SET slug = id, created_at = arrived_at, updated_at = arrived_at'); ++ + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE starship ALTER slug SET NOT NULL'); + $this->addSql('ALTER TABLE starship ALTER created_at SET NOT NULL'); diff --git a/_tuts/add-fields-second-migration.diff b/_tuts/add-fields-second-migration.diff new file mode 100644 index 0000000..bd9e52e --- /dev/null +++ b/_tuts/add-fields-second-migration.diff @@ -0,0 +1,44 @@ +diff --git a/migrations/Version20241201203519.php b/migrations/Version20241201203519.php +new file mode 100644 +index 0000000..6fa6b36 +--- /dev/null ++++ b/migrations/Version20241201203519.php +@@ -0,0 +1,38 @@ ++addSql('ALTER TABLE starship ALTER slug SET NOT NULL'); ++ $this->addSql('ALTER TABLE starship ALTER created_at SET NOT NULL'); ++ $this->addSql('ALTER TABLE starship ALTER updated_at SET NOT NULL'); ++ $this->addSql('CREATE UNIQUE INDEX UNIQ_C414E64A989D9B62 ON starship (slug)'); ++ } ++ ++ public function down(Schema $schema): void ++ { ++ // this down() migration is auto-generated, please modify it to your needs ++ $this->addSql('CREATE SCHEMA public'); ++ $this->addSql('DROP INDEX UNIQ_C414E64A989D9B62'); ++ $this->addSql('ALTER TABLE starship ALTER slug DROP NOT NULL'); ++ $this->addSql('ALTER TABLE starship ALTER created_at DROP NOT NULL'); ++ $this->addSql('ALTER TABLE starship ALTER updated_at DROP NOT NULL'); ++ } ++} diff --git a/_tuts/add-fields-slug-and-timestamps.diff b/_tuts/add-fields-slug-and-timestamps.diff new file mode 100644 index 0000000..2232097 --- /dev/null +++ b/_tuts/add-fields-slug-and-timestamps.diff @@ -0,0 +1,61 @@ +diff --git a/src/Entity/Starship.php b/src/Entity/Starship.php +index 5c1adc0..9f44868 100644 +--- a/src/Entity/Starship.php ++++ b/src/Entity/Starship.php +@@ -28,6 +28,15 @@ class Starship + #[ORM\Column] + private ?\DateTimeImmutable $arrivedAt = null; + ++ #[ORM\Column(length: 255, nullable: true)] ++ private ?string $slug = null; ++ ++ #[ORM\Column(nullable: true)] ++ private ?\DateTimeImmutable $createdAt = null; ++ ++ #[ORM\Column(nullable: true)] ++ private ?\DateTimeImmutable $updatedAt = null; ++ + public function getId(): ?int + { + return $this->id; +@@ -106,4 +115,40 @@ class Starship + StarshipStatusEnum::COMPLETED => 'images/status-complete.png', + }; + } ++ ++ public function getSlug(): ?string ++ { ++ return $this->slug; ++ } ++ ++ public function setSlug(?string $slug): static ++ { ++ $this->slug = $slug; ++ ++ return $this; ++ } ++ ++ public function getCreatedAt(): ?\DateTimeImmutable ++ { ++ return $this->createdAt; ++ } ++ ++ public function setCreatedAt(?\DateTimeImmutable $createdAt): static ++ { ++ $this->createdAt = $createdAt; ++ ++ return $this; ++ } ++ ++ public function getUpdatedAt(): ?\DateTimeImmutable ++ { ++ return $this->updatedAt; ++ } ++ ++ public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static ++ { ++ $this->updatedAt = $updatedAt; ++ ++ return $this; ++ } + } diff --git a/_tuts/api-add-starship-class.diff b/_tuts/api-add-starship-class.diff deleted file mode 100644 index f0add22..0000000 --- a/_tuts/api-add-starship-class.diff +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/src/Model/Starship.php b/src/Model/Starship.php -new file mode 100644 -index 0000000..afcd5be ---- /dev/null -+++ b/src/Model/Starship.php -@@ -0,0 +1,40 @@ -+id; -+ } -+ -+ public function getName(): string -+ { -+ return $this->name; -+ } -+ -+ public function getClass(): string -+ { -+ return $this->class; -+ } -+ -+ public function getCaptain(): string -+ { -+ return $this->captain; -+ } -+ -+ public function getStatus(): string -+ { -+ return $this->status; -+ } -+} diff --git a/_tuts/api-change-data-to-objects.diff b/_tuts/api-change-data-to-objects.diff deleted file mode 100644 index 9dc8236..0000000 --- a/_tuts/api-change-data-to-objects.diff +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/src/Controller/StarshipApiController.php b/src/Controller/StarshipApiController.php -index 7edc447..42d1b97 100644 ---- a/src/Controller/StarshipApiController.php -+++ b/src/Controller/StarshipApiController.php -@@ -2,6 +2,7 @@ - - namespace App\Controller; - -+use App\Model\Starship; - use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; - use Symfony\Component\HttpFoundation\Response; - use Symfony\Component\Routing\Attribute\Route; -@@ -12,24 +13,27 @@ class StarshipApiController extends AbstractController - public function getCollection(): Response - { - $starships = [ -- [ -- 'name' => 'USS LeafyCruiser (NCC-0001)', -- 'class' => 'Garden', -- 'captain' => 'Jean-Luc Pickles', -- 'status' => 'taken over by Q', -- ], -- [ -- 'name' => 'USS Espresso (NCC-1234-C)', -- 'class' => 'Latte', -- 'captain' => 'James T. Quick!', -- 'status' => 'repaired', -- ], -- [ -- 'name' => 'USS Wanderlust (NCC-2024-W)', -- 'class' => 'Delta Tourist', -- 'captain' => 'Kathryn Journeyway', -- 'status' => 'under construction', -- ], -+ new Starship( -+ 1, -+ 'USS LeafyCruiser (NCC-0001)', -+ 'Garden', -+ 'Jean-Luc Pickles', -+ 'taken over by Q' -+ ), -+ new Starship( -+ 2, -+ 'USS Espresso (NCC-1234-C)', -+ 'Latte', -+ 'James T. Quick!', -+ 'repaired', -+ ), -+ new Starship( -+ 3, -+ 'USS Wanderlust (NCC-2024-W)', -+ 'Delta Tourist', -+ 'Kathryn Journeyway', -+ 'under construction', -+ ), - ]; - - return $this->json($starships); diff --git a/_tuts/api-create-new-controller-and-return-json.diff b/_tuts/api-create-new-controller-and-return-json.diff deleted file mode 100644 index bcc06d1..0000000 --- a/_tuts/api-create-new-controller-and-return-json.diff +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/src/Controller/StarshipApiController.php b/src/Controller/StarshipApiController.php -new file mode 100644 -index 0000000..7edc447 ---- /dev/null -+++ b/src/Controller/StarshipApiController.php -@@ -0,0 +1,37 @@ -+ 'USS LeafyCruiser (NCC-0001)', -+ 'class' => 'Garden', -+ 'captain' => 'Jean-Luc Pickles', -+ 'status' => 'taken over by Q', -+ ], -+ [ -+ 'name' => 'USS Espresso (NCC-1234-C)', -+ 'class' => 'Latte', -+ 'captain' => 'James T. Quick!', -+ 'status' => 'repaired', -+ ], -+ [ -+ 'name' => 'USS Wanderlust (NCC-2024-W)', -+ 'class' => 'Delta Tourist', -+ 'captain' => 'Kathryn Journeyway', -+ 'status' => 'under construction', -+ ], -+ ]; -+ -+ return $this->json($starships); -+ } -+} diff --git a/_tuts/api-install-serializer.diff b/_tuts/api-install-serializer.diff deleted file mode 100644 index 22f2c78..0000000 --- a/_tuts/api-install-serializer.diff +++ /dev/null @@ -1,638 +0,0 @@ -diff --git a/composer.json b/composer.json -index bd1af62..9be028d 100644 ---- a/composer.json -+++ b/composer.json -@@ -8,12 +8,17 @@ - "ext-ctype": "*", - "ext-iconv": "*", - "php-cs-fixer/shim": "^3.46", -+ "phpdocumentor/reflection-docblock": "^5.3", -+ "phpstan/phpdoc-parser": "^1.25", - "symfony/console": "7.0.*", - "symfony/dotenv": "7.0.*", - "symfony/flex": "^2", - "symfony/framework-bundle": "7.0.*", - "symfony/monolog-bundle": "^3.0", -+ "symfony/property-access": "7.0.*", -+ "symfony/property-info": "7.0.*", - "symfony/runtime": "7.0.*", -+ "symfony/serializer": "7.0.*", - "symfony/twig-bundle": "7.0.*", - "symfony/yaml": "7.0.*", - "twig/extra-bundle": "^2.12|^3.0", -diff --git a/composer.lock b/composer.lock -index d5a18f0..8df0eeb 100644 ---- a/composer.lock -+++ b/composer.lock -@@ -4,8 +4,55 @@ - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], -- "content-hash": "a31c65f2945550bf001ecf0809587a8a", -+ "content-hash": "f7742a3cc85c9638207c6451c3da7428", - "packages": [ -+ { -+ "name": "doctrine/deprecations", -+ "version": "1.1.2", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/doctrine/deprecations.git", -+ "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", -+ "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", -+ "shasum": "" -+ }, -+ "require": { -+ "php": "^7.1 || ^8.0" -+ }, -+ "require-dev": { -+ "doctrine/coding-standard": "^9", -+ "phpstan/phpstan": "1.4.10 || 1.10.15", -+ "phpstan/phpstan-phpunit": "^1.0", -+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", -+ "psalm/plugin-phpunit": "0.18.4", -+ "psr/log": "^1 || ^2 || ^3", -+ "vimeo/psalm": "4.30.0 || 5.12.0" -+ }, -+ "suggest": { -+ "psr/log": "Allows logging deprecations via PSR-3 logger implementation" -+ }, -+ "type": "library", -+ "autoload": { -+ "psr-4": { -+ "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" -+ } -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", -+ "homepage": "https://www.doctrine-project.org/", -+ "support": { -+ "issues": "https://github.com/doctrine/deprecations/issues", -+ "source": "https://github.com/doctrine/deprecations/tree/1.1.2" -+ }, -+ "time": "2023-09-27T20:04:15+00:00" -+ }, - { - "name": "monolog/monolog", - "version": "3.5.0", -@@ -159,6 +206,221 @@ - }, - "time": "2024-01-03T21:39:12+00:00" - }, -+ { -+ "name": "phpdocumentor/reflection-common", -+ "version": "2.2.0", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git", -+ "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", -+ "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", -+ "shasum": "" -+ }, -+ "require": { -+ "php": "^7.2 || ^8.0" -+ }, -+ "type": "library", -+ "extra": { -+ "branch-alias": { -+ "dev-2.x": "2.x-dev" -+ } -+ }, -+ "autoload": { -+ "psr-4": { -+ "phpDocumentor\\Reflection\\": "src/" -+ } -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "authors": [ -+ { -+ "name": "Jaap van Otterdijk", -+ "email": "opensource@ijaap.nl" -+ } -+ ], -+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure", -+ "homepage": "http://www.phpdoc.org/", -+ "keywords": [ -+ "FQSEN", -+ "phpDocumentor", -+ "phpdoc", -+ "reflection", -+ "static analysis" -+ ], -+ "support": { -+ "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", -+ "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" -+ }, -+ "time": "2020-06-27T09:03:43+00:00" -+ }, -+ { -+ "name": "phpdocumentor/reflection-docblock", -+ "version": "5.3.0", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", -+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", -+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", -+ "shasum": "" -+ }, -+ "require": { -+ "ext-filter": "*", -+ "php": "^7.2 || ^8.0", -+ "phpdocumentor/reflection-common": "^2.2", -+ "phpdocumentor/type-resolver": "^1.3", -+ "webmozart/assert": "^1.9.1" -+ }, -+ "require-dev": { -+ "mockery/mockery": "~1.3.2", -+ "psalm/phar": "^4.8" -+ }, -+ "type": "library", -+ "extra": { -+ "branch-alias": { -+ "dev-master": "5.x-dev" -+ } -+ }, -+ "autoload": { -+ "psr-4": { -+ "phpDocumentor\\Reflection\\": "src" -+ } -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "authors": [ -+ { -+ "name": "Mike van Riel", -+ "email": "me@mikevanriel.com" -+ }, -+ { -+ "name": "Jaap van Otterdijk", -+ "email": "account@ijaap.nl" -+ } -+ ], -+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", -+ "support": { -+ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", -+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" -+ }, -+ "time": "2021-10-19T17:43:47+00:00" -+ }, -+ { -+ "name": "phpdocumentor/type-resolver", -+ "version": "1.8.0", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/phpDocumentor/TypeResolver.git", -+ "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fad452781b3d774e3337b0c0b245dd8e5a4455fc", -+ "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc", -+ "shasum": "" -+ }, -+ "require": { -+ "doctrine/deprecations": "^1.0", -+ "php": "^7.4 || ^8.0", -+ "phpdocumentor/reflection-common": "^2.0", -+ "phpstan/phpdoc-parser": "^1.13" -+ }, -+ "require-dev": { -+ "ext-tokenizer": "*", -+ "phpbench/phpbench": "^1.2", -+ "phpstan/extension-installer": "^1.1", -+ "phpstan/phpstan": "^1.8", -+ "phpstan/phpstan-phpunit": "^1.1", -+ "phpunit/phpunit": "^9.5", -+ "rector/rector": "^0.13.9", -+ "vimeo/psalm": "^4.25" -+ }, -+ "type": "library", -+ "extra": { -+ "branch-alias": { -+ "dev-1.x": "1.x-dev" -+ } -+ }, -+ "autoload": { -+ "psr-4": { -+ "phpDocumentor\\Reflection\\": "src" -+ } -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "authors": [ -+ { -+ "name": "Mike van Riel", -+ "email": "me@mikevanriel.com" -+ } -+ ], -+ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", -+ "support": { -+ "issues": "https://github.com/phpDocumentor/TypeResolver/issues", -+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.0" -+ }, -+ "time": "2024-01-11T11:49:22+00:00" -+ }, -+ { -+ "name": "phpstan/phpdoc-parser", -+ "version": "1.25.0", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/phpstan/phpdoc-parser.git", -+ "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bd84b629c8de41aa2ae82c067c955e06f1b00240", -+ "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240", -+ "shasum": "" -+ }, -+ "require": { -+ "php": "^7.2 || ^8.0" -+ }, -+ "require-dev": { -+ "doctrine/annotations": "^2.0", -+ "nikic/php-parser": "^4.15", -+ "php-parallel-lint/php-parallel-lint": "^1.2", -+ "phpstan/extension-installer": "^1.0", -+ "phpstan/phpstan": "^1.5", -+ "phpstan/phpstan-phpunit": "^1.1", -+ "phpstan/phpstan-strict-rules": "^1.0", -+ "phpunit/phpunit": "^9.5", -+ "symfony/process": "^5.2" -+ }, -+ "type": "library", -+ "autoload": { -+ "psr-4": { -+ "PHPStan\\PhpDocParser\\": [ -+ "src/" -+ ] -+ } -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "description": "PHPDoc parser with support for nullable, intersection and generic types", -+ "support": { -+ "issues": "https://github.com/phpstan/phpdoc-parser/issues", -+ "source": "https://github.com/phpstan/phpdoc-parser/tree/1.25.0" -+ }, -+ "time": "2024-01-04T17:06:16+00:00" -+ }, - { - "name": "psr/cache", - "version": "3.0.0", -@@ -2167,6 +2429,165 @@ - ], - "time": "2023-08-16T06:22:46+00:00" - }, -+ { -+ "name": "symfony/property-access", -+ "version": "v7.0.0", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/symfony/property-access.git", -+ "reference": "740e8cb8c54a4f16c82179e8558c29d9fc49901d" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/symfony/property-access/zipball/740e8cb8c54a4f16c82179e8558c29d9fc49901d", -+ "reference": "740e8cb8c54a4f16c82179e8558c29d9fc49901d", -+ "shasum": "" -+ }, -+ "require": { -+ "php": ">=8.2", -+ "symfony/property-info": "^6.4|^7.0" -+ }, -+ "require-dev": { -+ "symfony/cache": "^6.4|^7.0" -+ }, -+ "type": "library", -+ "autoload": { -+ "psr-4": { -+ "Symfony\\Component\\PropertyAccess\\": "" -+ }, -+ "exclude-from-classmap": [ -+ "/Tests/" -+ ] -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "authors": [ -+ { -+ "name": "Fabien Potencier", -+ "email": "fabien@symfony.com" -+ }, -+ { -+ "name": "Symfony Community", -+ "homepage": "https://symfony.com/contributors" -+ } -+ ], -+ "description": "Provides functions to read and write from/to an object or array using a simple string notation", -+ "homepage": "https://symfony.com/", -+ "keywords": [ -+ "access", -+ "array", -+ "extraction", -+ "index", -+ "injection", -+ "object", -+ "property", -+ "property-path", -+ "reflection" -+ ], -+ "support": { -+ "source": "https://github.com/symfony/property-access/tree/v7.0.0" -+ }, -+ "funding": [ -+ { -+ "url": "https://symfony.com/sponsor", -+ "type": "custom" -+ }, -+ { -+ "url": "https://github.com/fabpot", -+ "type": "github" -+ }, -+ { -+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", -+ "type": "tidelift" -+ } -+ ], -+ "time": "2023-09-27T14:05:33+00:00" -+ }, -+ { -+ "name": "symfony/property-info", -+ "version": "v7.0.0", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/symfony/property-info.git", -+ "reference": "ce627df05f5629ce4feec536ee827ad0a12689b6" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/symfony/property-info/zipball/ce627df05f5629ce4feec536ee827ad0a12689b6", -+ "reference": "ce627df05f5629ce4feec536ee827ad0a12689b6", -+ "shasum": "" -+ }, -+ "require": { -+ "php": ">=8.2", -+ "symfony/string": "^6.4|^7.0" -+ }, -+ "conflict": { -+ "phpdocumentor/reflection-docblock": "<5.2", -+ "phpdocumentor/type-resolver": "<1.5.1", -+ "symfony/dependency-injection": "<6.4", -+ "symfony/serializer": "<6.4" -+ }, -+ "require-dev": { -+ "phpdocumentor/reflection-docblock": "^5.2", -+ "phpstan/phpdoc-parser": "^1.0", -+ "symfony/cache": "^6.4|^7.0", -+ "symfony/dependency-injection": "^6.4|^7.0", -+ "symfony/serializer": "^6.4|^7.0" -+ }, -+ "type": "library", -+ "autoload": { -+ "psr-4": { -+ "Symfony\\Component\\PropertyInfo\\": "" -+ }, -+ "exclude-from-classmap": [ -+ "/Tests/" -+ ] -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "authors": [ -+ { -+ "name": "Kévin Dunglas", -+ "email": "dunglas@gmail.com" -+ }, -+ { -+ "name": "Symfony Community", -+ "homepage": "https://symfony.com/contributors" -+ } -+ ], -+ "description": "Extracts information about PHP class' properties using metadata of popular sources", -+ "homepage": "https://symfony.com/", -+ "keywords": [ -+ "doctrine", -+ "phpdoc", -+ "property", -+ "symfony", -+ "type", -+ "validator" -+ ], -+ "support": { -+ "source": "https://github.com/symfony/property-info/tree/v7.0.0" -+ }, -+ "funding": [ -+ { -+ "url": "https://symfony.com/sponsor", -+ "type": "custom" -+ }, -+ { -+ "url": "https://github.com/fabpot", -+ "type": "github" -+ }, -+ { -+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", -+ "type": "tidelift" -+ } -+ ], -+ "time": "2023-11-25T08:38:27+00:00" -+ }, - { - "name": "symfony/routing", - "version": "v7.0.2", -@@ -2327,6 +2748,101 @@ - ], - "time": "2023-10-20T16:35:23+00:00" - }, -+ { -+ "name": "symfony/serializer", -+ "version": "v7.0.2", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/symfony/serializer.git", -+ "reference": "dd7d7612f9ae288889caba4bdff79424ce4ffdf0" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/symfony/serializer/zipball/dd7d7612f9ae288889caba4bdff79424ce4ffdf0", -+ "reference": "dd7d7612f9ae288889caba4bdff79424ce4ffdf0", -+ "shasum": "" -+ }, -+ "require": { -+ "php": ">=8.2", -+ "symfony/polyfill-ctype": "~1.8" -+ }, -+ "conflict": { -+ "phpdocumentor/reflection-docblock": "<3.2.2", -+ "phpdocumentor/type-resolver": "<1.4.0", -+ "symfony/dependency-injection": "<6.4", -+ "symfony/property-access": "<6.4", -+ "symfony/property-info": "<6.4", -+ "symfony/uid": "<6.4", -+ "symfony/validator": "<6.4", -+ "symfony/yaml": "<6.4" -+ }, -+ "require-dev": { -+ "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", -+ "seld/jsonlint": "^1.10", -+ "symfony/cache": "^6.4|^7.0", -+ "symfony/config": "^6.4|^7.0", -+ "symfony/console": "^6.4|^7.0", -+ "symfony/dependency-injection": "^6.4|^7.0", -+ "symfony/error-handler": "^6.4|^7.0", -+ "symfony/filesystem": "^6.4|^7.0", -+ "symfony/form": "^6.4|^7.0", -+ "symfony/http-foundation": "^6.4|^7.0", -+ "symfony/http-kernel": "^6.4|^7.0", -+ "symfony/messenger": "^6.4|^7.0", -+ "symfony/mime": "^6.4|^7.0", -+ "symfony/property-access": "^6.4|^7.0", -+ "symfony/property-info": "^6.4|^7.0", -+ "symfony/translation-contracts": "^2.5|^3", -+ "symfony/uid": "^6.4|^7.0", -+ "symfony/validator": "^6.4|^7.0", -+ "symfony/var-dumper": "^6.4|^7.0", -+ "symfony/var-exporter": "^6.4|^7.0", -+ "symfony/yaml": "^6.4|^7.0" -+ }, -+ "type": "library", -+ "autoload": { -+ "psr-4": { -+ "Symfony\\Component\\Serializer\\": "" -+ }, -+ "exclude-from-classmap": [ -+ "/Tests/" -+ ] -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "authors": [ -+ { -+ "name": "Fabien Potencier", -+ "email": "fabien@symfony.com" -+ }, -+ { -+ "name": "Symfony Community", -+ "homepage": "https://symfony.com/contributors" -+ } -+ ], -+ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", -+ "homepage": "https://symfony.com/", -+ "support": { -+ "source": "https://github.com/symfony/serializer/tree/v7.0.2" -+ }, -+ "funding": [ -+ { -+ "url": "https://symfony.com/sponsor", -+ "type": "custom" -+ }, -+ { -+ "url": "https://github.com/fabpot", -+ "type": "github" -+ }, -+ { -+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", -+ "type": "tidelift" -+ } -+ ], -+ "time": "2023-12-29T15:37:40+00:00" -+ }, - { - "name": "symfony/service-contracts", - "version": "v3.4.1", -@@ -3138,6 +3654,64 @@ - } - ], - "time": "2023-11-21T18:54:41+00:00" -+ }, -+ { -+ "name": "webmozart/assert", -+ "version": "1.11.0", -+ "source": { -+ "type": "git", -+ "url": "https://github.com/webmozarts/assert.git", -+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" -+ }, -+ "dist": { -+ "type": "zip", -+ "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", -+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", -+ "shasum": "" -+ }, -+ "require": { -+ "ext-ctype": "*", -+ "php": "^7.2 || ^8.0" -+ }, -+ "conflict": { -+ "phpstan/phpstan": "<0.12.20", -+ "vimeo/psalm": "<4.6.1 || 4.6.2" -+ }, -+ "require-dev": { -+ "phpunit/phpunit": "^8.5.13" -+ }, -+ "type": "library", -+ "extra": { -+ "branch-alias": { -+ "dev-master": "1.10-dev" -+ } -+ }, -+ "autoload": { -+ "psr-4": { -+ "Webmozart\\Assert\\": "src/" -+ } -+ }, -+ "notification-url": "https://packagist.org/downloads/", -+ "license": [ -+ "MIT" -+ ], -+ "authors": [ -+ { -+ "name": "Bernhard Schussek", -+ "email": "bschussek@gmail.com" -+ } -+ ], -+ "description": "Assertions to validate method input/output with nice error messages.", -+ "keywords": [ -+ "assert", -+ "check", -+ "validate" -+ ], -+ "support": { -+ "issues": "https://github.com/webmozarts/assert/issues", -+ "source": "https://github.com/webmozarts/assert/tree/1.11.0" -+ }, -+ "time": "2022-06-03T18:03:27+00:00" - } - ], - "packages-dev": [ diff --git a/_tuts/assets-add-for-loop.diff b/_tuts/assets-add-for-loop.diff deleted file mode 100644 index 243f3a5..0000000 --- a/_tuts/assets-add-for-loop.diff +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/templates/main/homepage.html.twig b/templates/main/homepage.html.twig -index e5145ba..e2b080a 100644 ---- a/templates/main/homepage.html.twig -+++ b/templates/main/homepage.html.twig -@@ -12,7 +12,7 @@ - - -
-@@ -41,7 +41,7 @@
- diff --git a/_tuts/assets-add-homepage-links.diff b/_tuts/assets-add-homepage-links.diff deleted file mode 100644 index 5cbf3a8..0000000 --- a/_tuts/assets-add-homepage-links.diff +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php -index e8983fc..04a5058 100644 ---- a/src/Controller/MainController.php -+++ b/src/Controller/MainController.php -@@ -9,7 +9,7 @@ use Symfony\Component\Routing\Attribute\Route; - - class MainController extends AbstractController - { -- #[Route('/')] -+ #[Route('/', name: 'app_homepage')] - public function homepage(StarshipRepository $starshipRepository): Response - { - $ships = $starshipRepository->findAll(); -diff --git a/templates/base.html.twig b/templates/base.html.twig -index 57abdf3..a06e168 100644 ---- a/templates/base.html.twig -+++ b/templates/base.html.twig -@@ -15,11 +15,11 @@ -