From 9e177891475802319ea96824f4d2a3fab6ce09ee Mon Sep 17 00:00:00 2001 From: archey347 Date: Tue, 16 Jul 2024 03:13:16 +0100 Subject: [PATCH 1/9] Fix typos --- .../22.upgrading/01.46-to-50/02.guide/docs.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pages/22.upgrading/01.46-to-50/02.guide/docs.md b/pages/22.upgrading/01.46-to-50/02.guide/docs.md index 4517134d..f349bd98 100644 --- a/pages/22.upgrading/01.46-to-50/02.guide/docs.md +++ b/pages/22.upgrading/01.46-to-50/02.guide/docs.md @@ -6,33 +6,33 @@ taxonomy: category: docs --- -Upgrading an existing sprinkle from UserFrosting 4 to UserFrosting 5 can unfortunately be a difficult task. It all depends of how must customization of the core code you have done. Very basic sites will be easy to upgrade, very complex one could be a nightmare. However, it's for the greater good. UserFrosting 5 is more modern and uses new techniques +Upgrading an existing sprinkle from UserFrosting 4 to UserFrosting 5 can unfortunately be a difficult task. It all depends of how much customization of the core code you have done. Very basic sites will be easy to upgrade, very complex one could be a nightmare. However, it's for the greater good; UserFrosting 5 is more modern and uses new techniques. -[notice=warning]This guide contains the most important changes and action you need to take to upgrade your UserFrosting 4 Sprinkle. However, **it's far from complete**, as there are too many changes to document. Make sure you have a backup of your existing application and your **development database** before starting. +[notice=warning]This guide contains the most important changes and the actions you need to take to upgrade your UserFrosting 4 Sprinkle. However, **it's far from complete**, as there are too many changes to document. Make sure you have a backup of your existing application and your **development database** before starting. If you spot anything missing, don't hesitate to contribute to this page via the [*edit this page*](https://github.com/userfrosting/learn/blob/5.1/pages/22.upgrading/01.46-to-50/02.guide/docs.md) button at the top.[/notice] ## Before you start -The upgrade path for your UserFrosting 4 sprinkle will depend on how many features you're using. The good new is, the database structure is the same, and the frontend is 90% the same. +The upgrade path for your UserFrosting 4 sprinkle will depend on how many features you're using. The good news is, the database structure is the same, and the frontend is 90% the same. -To begin the upgrade journey, **the first you should do is a [fresh install](/installation) of UserFrosting 5**. This is important, as it will allow you to familiarize yourself with the new structure, as well as validate that your [local development environment](/background/develop-locally-serve-globally) is up to date and meet the [minimum requirements](/installation/requirements). +To begin the upgrade journey, **the first you should do is a [fresh install](/installation) of UserFrosting 5**. This is important, as it will allow you to familiarize yourself with the new structure, as well as validate that your [local development environment](/background/develop-locally-serve-globally) is up to date and meets the [minimum requirements](/installation/requirements). -Once you have a functioning vanilla version of UserFrosting 5, you can begin upgrading your sprinkle. +Once you have a functioning vanilla version of UserFrosting 5, you can begin to upgrade your sprinkle. [notice]While the database structure is mostly the same between V4 and V5, it is highly recommended you keep a backup of your existing application and your **development database**.[/notice] ## Upgrading your sprinkle structure -As seen on the [previous page](/upgrading/46-to-50/changelog), one of the biggest change is the app structure. It's recommended before you start to head over to [Chapter 3 - App Structure](/structure), to learn more about this new structure. +As seen on the [previous page](/upgrading/46-to-50/changelog), one of the biggest changes is the app structure. It's recommended before you start to head over to [Chapter 3 - App Structure](/structure), to learn more about this new structure. -Once you're familiar with the new structure, it's time to move thing around so your sprinkle meet the new structure. There's two options here : You can either start from scratch from the [Skeleton repo](/structure/introduction#the-app-skeleton-your-project-s-template), *or* you can manually upgrade in place. +Once you're familiar with the new structure, it's time to move thing around so your sprinkle meets the new structure. There's two options here: You can either start from scratch from the [Skeleton repo](/structure/introduction#the-app-skeleton-your-project-s-template), *or* you can manually upgrade in place. The first option is easier as the base has been setup for you, and you can start right away moving your code into the skeleton created from the sprinkle template, in a new git repository. However, it's drawback is you'll probably lose your Git History. The second option is harder, but since you're starting from your existing code, you'll keep your git history if your code is saved on Github for example. ### Option 1 - Start over from the Skeleton -To start with this option, the first step is to create a [fresh install](/installation) from the app skeleton. You'll then have an empty sprinkle with the new structure, ready to copy your code into it. However there's some step you need to follow before going further. +To start with this option, the first step is to create a [fresh install](/installation) from the app skeleton. You'll then have an empty sprinkle with the new structure, ready to copy your code into it. However there's some steps you need to follow before going further. #### Update `composer.json` @@ -46,7 +46,7 @@ Once this is done, you can run `composer update` to fetch dependencies. #### Edit the Recipe -Next up you should familiarize yourself with the [Sprinkle Recipe](/sprinkles/recipe#name). Right now, the only thing you must update is the sprinkle name, but we'll come back later to the recipe. +Next up, you should familiarize yourself with the [Sprinkle Recipe](/sprinkles/recipe#name). Right now, the only thing you must update is the sprinkle name, but we'll come back later to the recipe. #### Moving your code @@ -56,7 +56,7 @@ At this point you can skip to [Upgrading components](/upgrading/46-to-50/guide#u ### Option 2 - Upgrade in place -To start with this option, you should already be familiar with UserFrosting 5 directory structure, as it involves moving some directory around and editing some files. It also assume your code (your sprinkle) was located (and not as a community Sprinkle for example) You should have UserFrosting 5 Skeleton repo on hand to copy some files. +To start with this option, you should already be familiar with UserFrosting 5 directory structure, as it involves moving some directories around and editing some files. It also assumes your code (your sprinkle) was located (and not as a community sprinkle for example) You should have a UserFrosting 5 skeleton repo on hand to copy some files. #### Moving files and directory @@ -113,13 +113,13 @@ We'll update the rest of your recipe later. #### The entry files -Finally, you'll need to update both *entry files*, aka `/bakery` and `/public/index.php`, with the correct reference to your recipe. Open both files, and replace `UserFrosting\App\MyApp` and `MyApp` with the correct reference to your recipe. See [this page](/sprinkles/customize#the-entry-files) for more information and example. +Finally, you'll need to update both *entry files*, aka `/bakery` and `/public/index.php`, with the correct reference to your recipe. Open both files, and replace `UserFrosting\App\MyApp` and `MyApp` with the correct reference to your recipe. See [this page](/sprinkles/customize#the-entry-files) for more information and examples. ## Upgrading components -At this point your UserFrosting 5 app is _kind of ready_ to work. You simply need to upgrade every component your use. The following list might contains stuff you're not using, but you should still go through them as they contains links and tip you may need later. +At this point your UserFrosting 5 app is _kind of ready_ to work. You simply need to upgrade every component you use. The following list might contain stuff you're not using, but you should still go through them as they contain links and tips you may need later. -Remember, this guide will give you only the big picture of what changed, pointing you to other part of the guide that goes in details with all the features. +Remember, this guide will give you only the big picture of what changed, but it will point you to the relevant parts of the documentation where more detail can be found. ### Global changes @@ -135,7 +135,7 @@ Keep this in mind, especially if you've extended built-in classes. Not only may ### Services -> Dependency Injection -Services have been updated for UserFrosting 5. While the principle is the same, the way to register service is different. Services are now served by the new dependency injection container, PHP-DI. You should head over to the [Dependency Injection Chapter](/dependency-injection) to learn more about PHP-DI integration in UserFrosting 5 before going further. +Services have been updated for UserFrosting 5. While the principle is the same, the way to register a service is different. Services are now served by the new dependency injection container, PHP-DI. You should head over to the [Dependency Injection Chapter](/dependency-injection) to learn more about PHP-DI integration in UserFrosting 5 before going further. Your services definition must first be updated to implement `UserFrosting\ServicesProvider\ServicesProviderInterface`. For example: @@ -167,7 +167,7 @@ class ServicesProvider implements ServicesProviderInterface You'll also need to **register your service** in your recipe. Checkout [Adding Services](/dependency-injection/adding-services) for more information. -Finally, instead or injecting the whole container and retrieving your service from it, your should inject the service directly into the class using [autowiring](/dependency-injection/the-di-container#autowiring) in the class constructor or thought [route service injection](/routes-and-controllers/controller-classes#service-injection) for example. +Finally, instead of injecting the whole container and retrieving your service from it, you should inject the service directly into the class using [autowiring](/dependency-injection/the-di-container#autowiring) in the class constructor or thought [route service injection](/routes-and-controllers/controller-classes#service-injection) for example. For example: From 891e8c472996afe2a633b01ed8ff2b139b98de2a Mon Sep 17 00:00:00 2001 From: archey347 Date: Tue, 16 Jul 2024 15:04:07 +0100 Subject: [PATCH 2/9] Change implement to extends Implements implies interface, but `Migration` is an abstract class. --- pages/22.upgrading/01.46-to-50/02.guide/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/22.upgrading/01.46-to-50/02.guide/docs.md b/pages/22.upgrading/01.46-to-50/02.guide/docs.md index f349bd98..300e4779 100644 --- a/pages/22.upgrading/01.46-to-50/02.guide/docs.md +++ b/pages/22.upgrading/01.46-to-50/02.guide/docs.md @@ -197,7 +197,7 @@ Migration are mostly the same, only the class structure as changed, as well as t 1. Up/Down return type : The `up()` and `down()` method [must now return `void`](/database/migrations#base-class) -2. Migration must [now implement](/database/migrations#base-class) `UserFrosting\Sprinkle\Core\Database\Migration`. Change `use UserFrosting\System\Bakery\Migration;` to `use UserFrosting\Sprinkle\Core\Database\Migration;` in every one of your migrations. +2. Migration must [now extend](/database/migrations#base-class) `UserFrosting\Sprinkle\Core\Database\Migration`. Change `use UserFrosting\System\Bakery\Migration;` to `use UserFrosting\Sprinkle\Core\Database\Migration;` in every one of your migrations. 3. [Dependencies](/database/migrations#dependencies) must now be declared in a static property. Change `public $dependencies = [];` to `public static $dependencies = [];` in every one of your migrations. From ce5167937f24adfcacd6e159a71107c65a5aa668 Mon Sep 17 00:00:00 2001 From: archey347 Date: Thu, 18 Jul 2024 00:29:15 +0100 Subject: [PATCH 3/9] Fix typos --- pages/22.upgrading/01.46-to-50/02.guide/docs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/22.upgrading/01.46-to-50/02.guide/docs.md b/pages/22.upgrading/01.46-to-50/02.guide/docs.md index 300e4779..111141e6 100644 --- a/pages/22.upgrading/01.46-to-50/02.guide/docs.md +++ b/pages/22.upgrading/01.46-to-50/02.guide/docs.md @@ -193,15 +193,15 @@ The classmapper has been removed in UF5. PHP-DI should be used instead, via the ### Migrations -Migration are mostly the same, only the class structure as changed, as well as the need to register migration in your Sprinkle Recipe. The key points regarding migration are as follow : +Migrations are mostly the same, only the class structure as changed, as well as the need to register migration in your Sprinkle Recipe. The key points regarding migration are as follow: 1. Up/Down return type : The `up()` and `down()` method [must now return `void`](/database/migrations#base-class) -2. Migration must [now extend](/database/migrations#base-class) `UserFrosting\Sprinkle\Core\Database\Migration`. Change `use UserFrosting\System\Bakery\Migration;` to `use UserFrosting\Sprinkle\Core\Database\Migration;` in every one of your migrations. +2. Migrations must [now extend](/database/migrations#base-class) `UserFrosting\Sprinkle\Core\Database\Migration`. Change `use UserFrosting\System\Bakery\Migration;` to `use UserFrosting\Sprinkle\Core\Database\Migration;` in every one of your migrations. 3. [Dependencies](/database/migrations#dependencies) must now be declared in a static property. Change `public $dependencies = [];` to `public static $dependencies = [];` in every one of your migrations. -4. Migration are not auto-discovered anymore. You need to add them to your sprinkle recipe, using `MigrationRecipe`. See [the migration chapter](/database/migrations#sprinkle-recipe) for more information and a detailed guide. +4. Migrations are not auto-discovered anymore. You need to add them to your sprinkle recipe, using `MigrationRecipe`. See [the migration chapter](/database/migrations#sprinkle-recipe) for more information and a detailed guide. ### Models From 513db24867f790e6d1c62ec913ecb159a2ec5615 Mon Sep 17 00:00:00 2001 From: archey347 Date: Thu, 18 Jul 2024 00:33:31 +0100 Subject: [PATCH 4/9] Add section on seeds --- pages/22.upgrading/01.46-to-50/02.guide/docs.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pages/22.upgrading/01.46-to-50/02.guide/docs.md b/pages/22.upgrading/01.46-to-50/02.guide/docs.md index 111141e6..7edcd568 100644 --- a/pages/22.upgrading/01.46-to-50/02.guide/docs.md +++ b/pages/22.upgrading/01.46-to-50/02.guide/docs.md @@ -203,6 +203,12 @@ Migrations are mostly the same, only the class structure as changed, as well as 4. Migrations are not auto-discovered anymore. You need to add them to your sprinkle recipe, using `MigrationRecipe`. See [the migration chapter](/database/migrations#sprinkle-recipe) for more information and a detailed guide. +### Seeds + +Seeds are also mostly the same, they just need to implement `\UserFrosting\Sprinkle\Core\Seeder\SeedInterface`, and have a `run()` function with a return type of `void`. They are also not auto-discovered, so need to be added to your sprinkle recipe using `SeedRecipe`. + +See [the seeding chapter](/database/seeding) for more details. + ### Models The only change in database model is the `$timestamps` property is not `true` by default. It used to be `false`. ` public $timestamps = true;` can be removed from your models, unless you're **not** using timestamps where you should add `public $timestamps = false;`. From 83a641776d137e92a40fcd816773185ba5380f3a Mon Sep 17 00:00:00 2001 From: archey347 Date: Thu, 18 Jul 2024 00:37:06 +0100 Subject: [PATCH 5/9] Add clarification of return type --- pages/22.upgrading/01.46-to-50/02.guide/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/22.upgrading/01.46-to-50/02.guide/docs.md b/pages/22.upgrading/01.46-to-50/02.guide/docs.md index 7edcd568..5fae0d0d 100644 --- a/pages/22.upgrading/01.46-to-50/02.guide/docs.md +++ b/pages/22.upgrading/01.46-to-50/02.guide/docs.md @@ -195,7 +195,7 @@ The classmapper has been removed in UF5. PHP-DI should be used instead, via the Migrations are mostly the same, only the class structure as changed, as well as the need to register migration in your Sprinkle Recipe. The key points regarding migration are as follow: -1. Up/Down return type : The `up()` and `down()` method [must now return `void`](/database/migrations#base-class) +1. Up/Down return type : The `up()` and `down()` method [must now have a return type of `void`](/database/migrations#base-class) 2. Migrations must [now extend](/database/migrations#base-class) `UserFrosting\Sprinkle\Core\Database\Migration`. Change `use UserFrosting\System\Bakery\Migration;` to `use UserFrosting\Sprinkle\Core\Database\Migration;` in every one of your migrations. From 71b2c6629ae36102e95929c3df89d74cddfbd431 Mon Sep 17 00:00:00 2001 From: archey347 Date: Thu, 18 Jul 2024 01:35:06 +0100 Subject: [PATCH 6/9] Fix typos --- pages/14.database/04.seeding/docs.md | 2 +- .../22.upgrading/01.46-to-50/02.guide/docs.md | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pages/14.database/04.seeding/docs.md b/pages/14.database/04.seeding/docs.md index 2cc7e2e3..aef2cc8d 100644 --- a/pages/14.database/04.seeding/docs.md +++ b/pages/14.database/04.seeding/docs.md @@ -42,7 +42,7 @@ class MySeed implements SeedInterface ## Registering Seeds -To be picked up by the `seed` bakery command, a seed class files must first be registered in the the *Sprinkle Recipe*, using the `SeedRecipe` sub-recipe and the `getSeeds():array` method: +To be picked up by the `seed` bakery command, a seed class files must first be registered in the *Sprinkle Recipe*, using the `SeedRecipe` sub-recipe and the `getSeeds():array` method: ```php logs 2. session -> sessions From 3ba60c69265978f097cdc7e1aecea8a249c29156 Mon Sep 17 00:00:00 2001 From: archey347 Date: Thu, 18 Jul 2024 01:45:57 +0100 Subject: [PATCH 7/9] Add use entries for request/response --- .../04.controller-classes/docs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/08.routes-and-controllers/04.controller-classes/docs.md b/pages/08.routes-and-controllers/04.controller-classes/docs.md index 60f38b7e..87687d44 100644 --- a/pages/08.routes-and-controllers/04.controller-classes/docs.md +++ b/pages/08.routes-and-controllers/04.controller-classes/docs.md @@ -22,6 +22,9 @@ namespace UserFrosting\Sprinkle\Site\Controller; use UserFrosting\Sprinkle\Site\Model\Owl; +use Psr\Http\Message\ResponseInterface as Response; +use Psr\Http\Message\ServerRequestInterface as Request; + class OwlController { public function getOwls(string $genus, Request $request, Response $response): Response @@ -74,6 +77,9 @@ namespace UserFrosting\Sprinkle\Site\Controller; use UserFrosting\Sprinkle\Site\Model\Owl; use UserFrosting\Sprinkle\Site\Finder\VoleFinder; +use Psr\Http\Message\ResponseInterface as Response; +use Psr\Http\Message\ServerRequestInterface as Request; + class OwlController { public function getOwls(string $genus, Request $request, Response $response, VoleFinder $voleFinder): Response @@ -97,6 +103,9 @@ namespace UserFrosting\Sprinkle\Site\Controller; use UserFrosting\Sprinkle\Site\Model\Owl; use UserFrosting\Sprinkle\Site\Finder\VoleFinder; +use Psr\Http\Message\ResponseInterface as Response; +use Psr\Http\Message\ServerRequestInterface as Request; + class OwlController { /** @@ -148,6 +157,9 @@ namespace UserFrosting\Sprinkle\Site\Controller; use UserFrosting\Sprinkle\Site\Model\Owl; use UserFrosting\Sprinkle\Site\Finder\VoleFinder; +use Psr\Http\Message\ResponseInterface as Response; +use Psr\Http\Message\ServerRequestInterface as Request; + class GetOwlsAction { public function __invoke(string $genus, Request $request, Response $response, VoleFinder $voleFinder): Response From fcbf24462b9e318b9b21eee493050d5443911211 Mon Sep 17 00:00:00 2001 From: archey347 Date: Thu, 18 Jul 2024 22:58:54 +0100 Subject: [PATCH 8/9] Add note about DI on service creation --- .../04.adding-services/docs.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pages/07.dependency-injection/04.adding-services/docs.md b/pages/07.dependency-injection/04.adding-services/docs.md index 01f79fa5..ccc7c1b7 100644 --- a/pages/07.dependency-injection/04.adding-services/docs.md +++ b/pages/07.dependency-injection/04.adding-services/docs.md @@ -62,6 +62,21 @@ class MapBuilderService implements ServicesProviderInterface [notice=tip]You'll notice that we've added `use UserFrosting\Sprinkle\Site\GoogleMaps\MapBuilder;` to the top of the file. This means that we don't have to use the fully qualified class name (with the entire namespace) every time we want to refer to the `MapBuilder` class.[/notice] +If you need to pull in another service, for example the config to retrieve an API key, you can add them as the parameter, and the dependency injector will automatically pick it up. + +```php +... +MapBuilder::class => function (Config $config) { + $apiKey = $config['api.key']; + + // Now, actually build the object + $mapBuilder = new MapBuilder($apiKey); + + return $mapBuilder; +}, +... +``` + ### Register your service The next step is to tell UserFrosting to load your service in your [Sprinkle Recipe](/sprinkles/recipe#getservices). To do so, you only need to list all the service providers you want to automatically register inside the `$getServices` property of your sprinkle class : From 28a9f1ab476cdc95095641d6e9a7e027836b4a9f Mon Sep 17 00:00:00 2001 From: archey347 Date: Fri, 19 Jul 2024 00:57:19 +0100 Subject: [PATCH 9/9] Add missing throw --- .../22.upgrading/02.50-to-51/02.guide/docs.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pages/22.upgrading/02.50-to-51/02.guide/docs.md b/pages/22.upgrading/02.50-to-51/02.guide/docs.md index 05797b18..08dde2e7 100644 --- a/pages/22.upgrading/02.50-to-51/02.guide/docs.md +++ b/pages/22.upgrading/02.50-to-51/02.guide/docs.md @@ -81,13 +81,13 @@ $ php bakery bake ### Font Awesome -UserFrosting 5.1 now ship with Font Awesome 6 in the AdminLTE theme. While Font Awesome 6 is backward compatible with Font Awesome 5, some icons [have been renamed](https://docs.fontawesome.com/web/setup/upgrade/whats-changed#icons-renamed-in-version-6) and you might need to manually update these in your sprinkle. +UserFrosting 5.1 now ships with Font Awesome 6 in the AdminLTE theme. While Font Awesome 6 is backward compatible with Font Awesome 5, some icons [have been renamed](https://docs.fontawesome.com/web/setup/upgrade/whats-changed#icons-renamed-in-version-6) and you might need to manually update these in your sprinkle. -Checkout Font Awesome guide for more information : [https://docs.fontawesome.com/web/setup/upgrade/whats-changed](https://docs.fontawesome.com/web/setup/upgrade/whats-changed) +Checkout the Font Awesome guide for more information : [https://docs.fontawesome.com/web/setup/upgrade/whats-changed](https://docs.fontawesome.com/web/setup/upgrade/whats-changed) ### Missing default permissions -Some build-in permissions [were missing from the database](https://github.com/userfrosting/UserFrosting/issues/1225) : +Some built-in permissions [were missing from the database](https://github.com/userfrosting/UserFrosting/issues/1225) : - `uri_role` - `uri_roles` - `uri_permissions` @@ -100,28 +100,28 @@ Some build-in permissions [were missing from the database](https://github.com/us - `view_system_info` - `clear_cache` -To add them to the database, run `php bakery seed` and select `UserFrosting\Sprinkle\Account\Database\Seeds\DefaultPermissions`. Theses will also be added to the `site-admin` role when running the seed. +To add them to the database, run `php bakery seed` and select `UserFrosting\Sprinkle\Account\Database\Seeds\DefaultPermissions`. These will also be added to the `site-admin` role when running the seed. -[notice=warning]If your application defines custom permissions to the `site-admin` role or you customized this role, **do not run the seed** unless you want to lose any custom changes. Running the seed will revert back that role to it's default state.[/notice] +[notice=warning]If your application defines custom permissions to the `site-admin` role or you customized this role, **do not run the seed** unless you want to lose any custom changes. Running the seed will revert back the role to it's default state.[/notice] The `site-admin` role is now on par with the root user permission by default, except for the last two permissions added, `view_system_info` & `clear_cache`. Theses can be added to the role if desired using the UI. ### `urlFor` service change -When calling [`urlFor`](/templating-with-twig/filters-and-functions#urlfor) **in PHP** (not Twig) to generate a route from it's name, the service as been replaced. Find and replace the following import to upgrade: +When calling [`urlFor`](/templating-with-twig/filters-and-functions#urlfor) **in PHP** (not Twig) to generate a route from its name, the service has been replaced. Find and replace the following import to upgrade: - Find : `use Slim\Interfaces\RouteParserInterface;` - Replace : `use UserFrosting\Sprinkle\Core\Util\RouteParserInterface;` ### Alerts -When using the [alerts](/advanced/alert-stream) service, replace `addMessageTranslated(...);` with `addMessage(...);`. The old method is still available, but deprecated and will be removed in a future version. +When using the [alerts](/advanced/alert-stream) service, replace `addMessageTranslated(...);` with `addMessage(...);`. The old method is still available, but it is deprecated and will be removed in a future version. ### Fortress -Fortress has been complexly rewritten for UserFrosting 5.1. Most class have been kept and will continue working, but these have been marked deprecated and will be removed in future version. It is recommended to upgrade your code now to avoid issues later. +Fortress has been completely rewritten for UserFrosting 5.1. Most classes have been kept and will continue working, but these have been marked deprecated and will be removed in future version. It is recommended to upgrade your code now to avoid issues later. #### RequestSchema -`UserFrosting\Fortress\RequestSchema` constructor first argument now accept the schema data as an array, as well as a string representing a path to the schema json or yaml file. The argument can still be omitted to create an empty schema. This change makes `UserFrosting\Fortress\RequestSchema\RequestSchemaRepository` obsolete and and such been ***deprecated***. For example: +The `UserFrosting\Fortress\RequestSchema` constructor's first argument now accepts the schema data as an array, as well as a string representing a path to the schema json or yaml file. The argument can still be omitted to create an empty schema. This change makes `UserFrosting\Fortress\RequestSchema\RequestSchemaRepository` obsolete and and such been ***deprecated***. For example: ```php // Before @@ -243,6 +243,8 @@ $errors = $this->validator->validate($schema, $data); if (count($errors) !== 0) { $e = new ValidationException(); $e->addErrors($errors); + + throw $e; } ```