Releases: userfrosting/framework
6.0.0-alpha.3
See this post for more info : https://github.com/orgs/userfrosting/discussions/1261#discussioncomment-12363468
Full Changelog: 6.0.0-alpha.2...6.0.0-alpha.3
6.0.0-alpha.2
See this post for more info : https://github.com/orgs/userfrosting/discussions/1261#discussioncomment-11910273
5.1.4
5.1.3
What's changed
- [Config] Fix issue with
getBool,getString,getIntandgetArraywhere a null value could be returned even if a default parameter was provided when the data did in fact returnnull, making the return value not type safe as it should be.
Full Changelog: 5.1.2...5.1.3
5.1.2
5.1.1
What's changed
- Fix InputArray in Fortress (See userfrosting/UserFrosting#1251)
- Update PHPStan config
- Add VSCode config
Full Changelog: 5.1.0...5.1.1
5.1.0
What's changed
- Removed Assets
- Drop PHP 8.1 support, add PHP 8.3 support
- Update to Laravel 10
- Update to PHPUnit 10
- SprinkleManager is a bit more strict on argument types. Recipe classed must be a
class-string. The actual instance of the class will now be rejected (it wasn't a documented feature anyway).
Fortress
Complete refactoring of Fortress. Mostly enforcing strict types, updating PHPDocs, simplifying code logic and making uses of new PHP features and method. Most classes have been deprecated and replaced by new classes with updated implementation. In general, instead of passing the schema in the constructor of Adapters, Transformers and Validators class, you pass it directly to theses class methods. This makes it easier to inject the classes as services and reuse the same instance with different schemas. Checkout the documentation for more information on new class usage.
-
UserFrosting\Fortress\RequestSchemaconstructor 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 makesUserFrosting\Fortress\RequestSchema\RequestSchemaRepositoryobsolete and and such been deprecated. For example:// Before $schemaFromFile = new \UserFrosting\Fortress\RequestSchema('path/to/schema.json'); $schemaFromArray = new \UserFrosting\Fortress\RequestSchema\RequestSchemaRepository([ // ... ]); // After $schemaFromFile = new \UserFrosting\Fortress\RequestSchema('path/to/schema.json'); $schemaFromArray = new \UserFrosting\Fortress\RequestSchema([ // ... ]);
-
UserFrosting\Fortress\RequestSchema\RequestSchemaInterfacenow extends\Illuminate\Contracts\Config\Repository. The interface itself is otherwise unchanged. -
UserFrosting\Fortress\RequestDataTransformeris deprecated and replaced by\UserFrosting\Fortress\Transformer\RequestDataTransformer(notice the difference in the namespace!).\UserFrosting\Fortress\RequestDataTransformerInterfaceis also deprecated and replaced by\UserFrosting\Fortress\Transformer\RequestDataTransformerInterface. When using the new class, instead of passing the schema in the constructor, you pass it directly totransform()ortransformField(). For example :// Before $transformer = new \UserFrosting\Fortress\RequestDataTransformer($schema); $result = $transformer->transform($data, 'skip'); // After $transformer = new \UserFrosting\Fortress\Transformer\RequestDataTransformer(); $result = $transformer->transform($schema, $data, 'skip');
-
\UserFrosting\Fortress\ServerSideValidatoris deprecated and replaced by\UserFrosting\Fortress\Validator\ServerSideValidator(notice the difference in the namespace!).\UserFrosting\Fortress\ServerSideValidatorInterfaceis also deprecated and replaced by\UserFrosting\Fortress\Validator\ServerSideValidatorInterface. When using the new class, instead of passing the schema in the constructor, you pass it directly tovalidate(). For example :// Before $validator = new \UserFrosting\Fortress\ServerSideValidator($schema, $this->translator); $result = $validator->validate($data); // After $adapter = new \UserFrosting\Fortress\Validator\ServerSideValidator($this->translator); $result = $validator->validate($schema, $data);
-
UserFrosting\Fortress\Adapter\FormValidationAdapteris deprecated.
Instead of defining the format in therulesmethod, you simply use of the appropriate class for the associated format.rules(...)Replacement class $format = json&$stringEncode = trueUserFrosting\Fortress\Adapter\FormValidationJsonAdapter$format = json&$stringEncode = falseUserFrosting\Fortress\Adapter\FormValidationArrayAdapter$format = html5UserFrosting\Fortress\Adapter\FormValidationHtml5AdapterUserFrosting\Fortress\Adapter\JqueryValidationAdapteris deprecated.
Instead of defining the format in therulesmethod, you simply use of the appropriate class for the associated format.rules(...)Replacement class $format = json&$stringEncode = trueUserFrosting\Fortress\Adapter\JqueryValidationJsonAdapter$format = json&$stringEncode = falseUserFrosting\Fortress\Adapter\JqueryValidationArrayAdapterAll adapters above now implements
UserFrosting\Fortress\Adapter\ValidationAdapterInterfacefor easier type-hinting.Finally, instead of passing the schema in the constructor, you now pass it directly to
rules().For example :
// Before $adapter = new FormValidationAdapter($schema, $this->translator); $result = $adapter->rules('json', false); // After $adapter = new FormValidationArrayAdapter($this->translator); $result = $adapter->rules($schema);
-
ClientSideValidationAdapterabstract class replaced withFromSchemaTraittrait +ValidationAdapterInterfaceinterface. -
FormValidationHtml5AdapterWill now throw an exception on missing field param, instead of returning null. -
In
FormValidationHtml5Adapter, when usingidenticalrule, the validation used to be applied to the "confirmation" field. It will now be applied to the source field, making it consistent with array|json format. For example, ifpasswordrequires to be identical topasswordc, the validation was added to thepasswordcfield. Now it's applied topassword.
Config
- Methods
getBool,getString,getInt&getArraynow returnnullif key doesn't exist, to make it on par with parentgetmethod.
Alert
- Messages are now translated at read time (#1156, #811). Messages will be translated when using
messagesandgetAndClearMessages.addMessagenow accept the optional placeholders, which will be stored with the alert message.addMessageTranslatedis deprecated. - Translator is not optional anymore.
setTranslatormethod has been removed. addValidationErrorsis deprecated (N.B.: It can't accept the new\UserFrosting\Fortress\Validator\ServerSideValidatorInterface)
UniformResourceLocator
- Two locations cannot have the same name anymore. An
InvalidArgumentExceptionwill be thrown otherwise. (Ref userfrosting/UserFrosting#1243). - [DEPRECATION] Location's
getSlugis deprecated (redundant with the name and not really used).
Full Changelog: 5.0.0...5.1.0
5.0.0
With version 5, this repo can be used as a bare bone Slim & Symfony Console application. It include the necessary routing class, PHP-DI as the Dependency Injection Container, a PSR EventDispatcher, etc. SprinkleManager has also been moved from Core/System Sprinkle and completely rewritten.
It's necessary for the SprinkleManager, Slim and Symfony (Bakery) to be outside of the Core Sprinkle so it can be properly managed. All extra feature (template, database, config, etc.) are left for the Core Sprinkle. The old sprinkle.json has been replace with SprinkleRecipe interface.
Version 5 also requires PHP 8.0 and up. With that in mind, most of the code has been updated to support PHP 8 and make use of it's new features. Code quality has also been stepped up, with PHPStan analysis added to the build process.
Global
Added
- Moved Alert into Framework from Core Sprinkle
- Added Bakery / Symfony Console app :
UserFrosting\Bakery\Bakery - UserFrosting / Slim 4 Web app :
UserFrosting\UserFrosting - Moved
SprinkleManagerfrom main repo. - Added custom Event Dispatcher and Listeners :
UserFrosting\Event\EventDispatcher&UserFrosting\Event\SprinkleListenerProvider
Dependencies
- Drop PHP 7.3 & 7.4 support
- Updated
twig/twigto^3.3
Code Quality
- Updated PHPStan config and added Github Action for automatic code analysis for UniformResourceLocator & Config (with no issues on max level)
- Updated PHP-CS-Fixer & StyleCI config
Assets
Assets module is now deprecated and will be removed in UserFrosting 5.1 !
Removed
UserFrosting\Assets\ServeAsset\SlimServeAssethas been removed. Code has been moved into Core Sprinkle
Bakery
Added
UserFrosting\Bakery\WithSymfonyStylemoved to this repo from Core.
Testing
- Added helper class to test Bakery command, Container, CustomAssertionsTrait, HttpTester, TestCase, etc.
Support
Removed
- These HTTP exceptions have been removed and replace with new system in Core Sprinkle :
BadRequestExceptionForbiddenExceptionHttpExceptionNotFoundException
UserFrosting\Support\Util\Util::normalizePathhas been removed. UseUserFrosting\UniformResourceLocator\Normalizer::normalizePathinstead.
UniformResourceLocator
Changes
- Remove dependency on
rockettheme/toolboxby integrating our ownStreamWrapper\StreamandStreamBuilder findResourceandgetResourcenow returnnullif a resource is not found instead offalse
Added
- Added
readonlyoption for streams. Files accessed using a readonly scheme will be protected against destructive action at the streamwrapper level.
Deprecated
findResourceis deprecated. UsegetResourceinsteadfindResourcesis deprecated. UsegetResourcesinsteadregisterStreamandregisterSharedStreamare deprecated. UseaddStreaminsteadregisterLocationis deprecated. UseaddLocationinstead
Removed
- Scheme Prefix has been removed
- Resource :
setLocation,setPath,setLocatorBasePathandsetStreammethods have been removed - ResourceLocation :
setNameandsetPathmethods have been removed - ResourceStream :
setScheme,setPathandsetSharedmethods have been removed - Deprecated
ResourceLocator::addPathmethod removed ResourceLocator::setBasePathmethod removed
Fortress
Fix
- Fix userfrosting/UserFrosting#1216 - Throw error when RequestSchema path doesn't exist
Removed
- Removed deprecated method
getSchemainRequestSchema
Full Changelog: 4.6.1...5.0.0
Upgrade Guide: https://learn.userfrosting.com/upgrading/46-to-50
5.0.0-rc1
Full Changelog: 5.0.0-beta5...5.0.0-rc1