Releases: romm/configuration_object
2.0.0
1.10.1
1.10.0
-
[38635d1] [FEATURE] Introduce
FileExistsValidatorThis new validator allows checking if a file exists (the syntax
EXT:my_extension/Path/To/My/File.txtcan be used). -
[91caefe] [FEATURE] Introduce
IconExistsValidatorThis new validator allows checking if an icon identifier has been registered in the TYPO3 icon registry.
-
[bd6e1ff] [BUGFIX] Check for invalid class name in data pre-processor handler
-
[3fd01de] [BUGFIX] Handle mixed types for properties with single object
Object properties that used the "mixed types" feature were not checked if the property was filled with a single instance. Only composite types (means the properties contains several object instances) were actually checked.
This commit patches the validator resolver (in a 💩 way) to allow it to handle single instances. A new internal validator has been introduced: it will wait for the actual object instance to be validated, in order to create an up to date validator conjunction.
-
[9250e3e] [BUGFIX] Handle
nullin source values during mappingIf a value that should be mapped to an object is
null, no type converter will be found and an exception will be thrown. To prevent this, we must handle this specific situation in the mapper, before the type converter is fetched.
1.9.0
-
[2baae53] [FEATURE] Introduce alias method for converting an array to an object
The static method
ConfigurationObjectFactory::convert()has been added.This is a simple alias for:
\Romm\ConfigurationObject\ConfigurationObjectFactory::getInstance()->get(...) -
[2baae53] [FEATURE] Introduce configuration object factory
isRunningmethodA new method has been added:
ConfigurationObjectFactory::isRunning().With this method, you can check at any moment if the configuration object factory is currently processing (an object is being created). This can be useful for instance if you want to allow magic methods for an object only when it is being converted.
-
[2baae53] [FEATURE] Introduce silent exceptions for getter methods
This commit introduces the support of a new kind of exceptions: "silent exceptions".
This type of exception can be thrown by an object getter methods, and they will be catch during Configuration Object API early processes, while still being thrown when the getter method is actually called from an implementation process.
To make an exception become silent, the class must implement the interface
SilentExceptionInterface.See documentation for more information.
1.8.0
This version mainly affects the ParentsTrait, but also improves the errors handling of a configuration object validation result:
-
[fef1c9c] [FEATURE] Introduce
ParentsTrait::alongParents()functionThis function allows to call a callback function for each parent of an object that uses
ParentsTrait.The callback function has a single parameter which is the current parent object. If
falseis returned by the callback, the loop on the parents stops.This new function is now used by the following functions of
ParentsTrait:hasParent,withFirstParentandgetFirstParent. -
[4c34e94] [FEATURE] Introduce parent "attach" functions
This commit introduces the functions
attachParent()andattachParents()in theParentsTrait. These new functions must be used to attach parents to an object.These function have more security and flexibility than the
setParents()function which will be deprecated. -
[d4be3b5] [BUGFIX] Check parents type correctly
This commit changes how the
ParentsTraitfetches a parent from a given class name.For instance, when searching for an interface class, the old way of checking the parents would not have work, now it does.
-
[8a05605] [TASK] Return error when required constructor argument is missing
When an object is built with the object converter, if a required argument for the constructor is missing, it will now return an error instead of throwing an exception.
This way, it will be added to the mapping result, and will let the user have more information about why the object is not valid.
-
[a4f41ad] [TASK] Return mapping result if it contains errors
When the mapping result given as constructor argument of a configuration object instance contains errors, it will always be returned when the validation result is accessed (function
getValidationResult()).This is done because if the mapper did not succeed to build a proper object and its sub-objects, then it makes no sense in many cases to launch a whole validation process on an unfinished object.
This commit leads to more consistency in an object validation result messages.
1.7.0
1.6.1
1.6.0
Two new features are introduced:
-
[#17] [FEATURE] Introduce support for common array object annotation
Previously, when a property would be filled by an array of object, only two annotations were supported:
\ArrayObject<\Some\Class>andarray<\Some\Class>They are not user-friendly, and most of the time the array is a basic array (not an
ObjectStoragefor instance). The common annotation for this would be:\Some\Class[]- which provides better IDE auto-completion, and has better readability.This commit introduces support for this annotation, enjoy!
-
[#19] [FEATURE] Introduce
@mixedTypesResolvertag annotationThis tag can be given to properties that need a mixed type resolver to detect their dynamic types. This allows the
@vartag to be filled with the real type(s) of the values, making the getter/setter methods annotations coherent.