- Update Behat Context with Attributes
- Fix deprecation into test with PHP 8.4
- To be more understandable, renaming
Coobook
toPlan
.CookbookInterface
andBaseCookbookTrait
are deprecated and will be removed in a next major release.
- Create native editable plan, with
EditablePlanInterface
andEditablePlanTrait
to allow developers to edit some plans without implementing a complex system of additional steps to inject in the constructor, like with Teknoo East PaaS.- Developers can only add more steps to an editable plan or more errors handlers.
- These editable plans can be updated easily with a definition of container of services with a decorated service.
- Add
Step
value object to pass the callable action with the mapping to an editable plan.
- Update dev lib requirements
- Remove deprecations about PHP 8.4
- Drop support of PHP 8.1
- Add sensitive parameter attribute on methods catching throwable to prevent leak.
- Some fix to limit cpu and memory usages.
- Fix support of last PHPStan 1.10.64
- Use State 6.2
- Add
Value
class to use in recipe's steps mapping. With aValue
instance in the mapping definitions, a bowl instance will directly use the value encapsulated in theValue
instance instead of the redirection to another ingredient name. Promise::allowNext
is now by default set to true. (BC Break)- Add to
Promise
, an optioncallOnFailOnException
(set by default) to call the fail action when an uncatched exception is catched by the Promise during the execution ofsuccess
callback. (BC Break) - Inversion behaviors of
Promise::fetchResult
andPromise::fetchResultIfCalled
(a mistake). (BC Break) - Add
Promise::setDefaultResult
to set a default result to return withfetchResult
when the promise is not called, without pass the default value tofetchResult
as argument. Promise::fetchResult
andPromise::setDefaultResult
accepts now a callable as default value. The callable will be executed before returns the result of the callable instead of returns the callable. (BC Break)- Add
PromiseInterface::__invoke
to use promise in any callable function parameter :- On
__invoke
call, theonSuccess
callable will be called.- By default, on a error in this callable, the
onFailure
will be also called. - The
__invoke
will return the value returned byonSuccess
oronFailure
or the default value passed tosetDefaultResult
, like withfetchResult
.
- By default, on a error in this callable, the
- On
- Fix issue with non-mandatory ingredient with a default value
- For Recipe's Ingredient requiring an object instance or an enum value, the name is not mandatory
- The name will be automatically the required class name (or enum name)
- The ingredient validation will search an instance in the workplan if the required name is not found
- If the name is found, aka if a value in the workplan is defined in the workplan with the required type, this value will be selected directly.
- If the name is defined with the required type, this behavior is disable, the ingredient must have the required name in the workplan (old behavior).
- Fix deprecated in test with PHP8.3
- Update dev lib requirements
- Fix issue with valid enum ingredient value can not be normalized with the new behavior
- Ingredient can be non mandatory and provides default value
- Ingredient can support Enum and convert automatically backed enum to enum value
- Fix methods visibilities in
Chef
andRecipe
stated classes - Add
IngredientWithCondition
to create optional tests according to some ingredients
- Update lib requirements
- Improve the documentation
- Update dev lib requirements
- Update copyrights
- Update dev lib requirements
- Support PHPUnit 10.1+
- Migrate phpunit.xml
- Q\A
- Q\A
- Remove phpcpd and upgrade phpunit.xml
- Update dev libs to support PHPUnit 10 and remove unused phploc
- QA Fixes
- Add
bool $autoCall = false
toPromiseInterface::next
to call automatically a next promise if it was already called in the promise (the next promise is wrapped in a proxy promise to allow call only a one time the methodsuccess
). If the promise is automatically called, the result of the current promise is passed to the next promise. - If a promise A is added as next to a promise B, all anothers promises added as next to B will be redirect to A (and recursively to the last added promise). the writing of chains of promises is thus facilitated.
- Fix a bug, if
fetchResult
return the result of last promise instead the first.
- Support of PHPStan 1.8.8+
- Clean code and test thanks to Rector
- Update libs requirements
- Complete errors messages in bowl when missed parameter's value or bad parameter definition to help to debug
- Add templates on
PromiseInterface
to improve QA
- Require Immutable 3.0.1 or later
- Add transformer option to
#[Trasnform]
to use a callable instead an object with the interfaceTransformableInterface
. The callable can also return a Transformable object.
- Fix issue with
RecipeBowl
andFiberRecipeBowl
, workplan was not updated after reserving
- Remove PHP 8.0 support.
- Use readonly properties for immutables objects.
- Constant
BowlInterface::METHOD_NAME
is final. - Support
Fiber
intoPromise
. - Support
Fiber
intoBowl
andDynamicBowl
thanks to dynamics classes :- callable will be automatically wrapped by a fiber,
- the fiber object will be available as parameter for bowls.
- Add
Fiber
support to RecipeBowl, also in a dedicated classFiberRecipeBowl
. The Fiber instance is also passed into workplan. - Add a
CookingSupervisorInterface
and its default implementationCookingSupervisor
to manage Bowls Fibers executions and loop on each active fiber.CookingSupervisor
are also available as parameter for bowls.
- Support Immutable 3.0
- Support State 6.0
- Remove unused QA tool
- Fix some deprecated with PHP 8.1
- QA
- Prevent bug with nullable attribute
- Prevent bug with Reflection
- Update QA tool with PHPStan 1.0
- Update State lib
- Fix QA issues
Coobook Aware
: Cookbook written with theBaseCookbookTrait
add them (if it is not already defined) in the default workplan to help developers to write recipe's step aware of the cookbook.
- Add
Promise::fetchResult
, To get the returned value by the callback on the promise (Can be null if the callback return nothing). (Not east compliant, but useful to integrate east code with an non-east code).
- QA, Fix PHPDoc.
- Import from East Foundation, Next promise behavior in Recipe' promise.
- Promise will also pass as last parameters a promise to chain in the current promise. If any following promise has been defined, an empty promise is passed.
- This new behavior is disabled by default, to enable it, create a promise with parameter $allowNext at true.
- Fix PhpStan
- Update documents and dev libs requirements
- Add
MergeableInterface
andChefInterface::merge()
to allow merge ingredient instead of replace it withupdateWorkplan
without fetch it into step. - Add
TransformableInterface
and attributeTransform
to allow transform an ingredient before to put it into the bowl
- Remove usage of array_merge into BaseCookbookTrait
- Minor version about libs requirements
- Add
stopErrorReporting
method to stop error reporting to top chef - Fix behavior of chef when a recipe is terminated
- Subs chefs call also theirs top chef's callErrors method on error
- Add
interruptCooking
method to stop execution of chef without execute finals steps (dish validation or error handlers)
- Subs chefs executing an embedded recipe inherit also of error handler with the workplan but can be changed without impact the original handler in the main chef.
- Some optimisations on array functions to limit O(n)
- Promise immutable check is performed before var assignment
- Migrate to PHP 8.0
- QA
- Fix license header
- Add
ChefInterface::cleanWorkPlan
to remove some ingredients from workplan
- Bowl will be select parameters, by priority, on mapping, on name, on type (if class name is used as key in workplan), and finaly on instance types
- Add IngredientBag to limit use of array_merge
- Improve Reflection use and cache in Bowl
- Fix recipe compiling lost step's name and allow GoTo.
- Change fix recipe compiling when several steps share the same name in 1.1.1
- Add Chef::error()
- Fix Default Workplan and merge workplans when chef start a subrecipe
- Add BaseCookbookTrait::addToWorkplan
- Add BaseCookbookTrait to implement quickly a cookbook and manage a shared recipe without implement all methods defined in the CookbookInterface
- Official Support of PHP8
- Require Teknoo/States ^4.1.3
- Prepare library to support also PHP8.
- Remove deprecations from PHP8.
- Support Union type in PHP8.
Add CookbookInterface behavior to provide to developer a new way to define recipe to inject into Chef Chef support also Cookbook for new recipe or a new sub recipe Create a base interface BaseRecipeInterface for RecipeInterface and CookingBookInterface Migrate from RecipeInterface to BaseRecipeInterface provide all method needed in execution of recipe (train, prepare and validate) Migrate RecipeBowl to use BaseRecipeInterface instead of RecipeInterface Migrate Chef to use BaseRecipeInterface instead of RecipeInterface Mapping in Bowl can be map to an array of string, instead a string to map several possibilities in the workplan (stop on first found occurence)
Fix BaseRecipeInterface doc
Fix Chef constructor to use BaseRecipeInterface instead of RecipeInterface
Create a base interface BaseRecipeInterface for RecipeInterface and CookingBookInterface Migrate from RecipeInterface to BaseRecipeInterface provide all method needed in execution of recipe (train, prepare and validate) Migrate RecipeBowl to use BaseRecipeInterface instead of RecipeInterface Migrate Chef to use BaseRecipeInterface instead of RecipeInterface Mapping in Bowl can be map to an array of string, instead a string to map several possibilities in the workplan (stop on first found occurence)
Change CookbookInterface to be compliant with RecipeInterface
Add CookbookInterface behavior to provide to developer a new way to define recipe to inject into Chef Chef support also Cookbook for new recipe or a new sub recipe
[2.0.9] - 2020-09-18
- Update QA and CI tools
- Update description
- Update libs and dev libs requirements
- Add travis run also with lowest dependencies.
- Fix error when a recipe is validate without dish.
- Require Teknoo States 4.0.9 to support PHPStan 0.12.26
- Revert Method : Chef::begin() use new static() instead of new self().
- Require State 4.0.7
- Replace initializeProxy by initializeStateProxy to avoid collision with other libs
- Migrate PHPStan extension from src folder to infrastructures folder (namespace stay unchanged)
- Require Teknoo State 4.0.1+
- Update requirement for dev tools
- Update to support last PHPStan 0.12.4
- Update copyright
- Fix Make definitions tools
- Fix QA issues spotted by PHPStan
- Enable PHPStan extension dedicated to support Stated classes
- Enable PHPStan in QA Tools
- Most methods have been updated to include type hints where applicable. Please check your extension points to make sure the function signatures are correct. _ All files use strict typing. Please make sure to not rely on type coercion.
- PHP 7.4 is the minimum required
- Switch to typed properties
- Remove some PHP useless DockBlocks
- Replace array_merge by "..." operators for integer indexed arrays
- Maintenance release, QA and update dev vendors requirements
- Maintenance release, upgrade composer dev requirement and libs
Stable release
- Remove support of PHP 7.2
- Swtich to PHPUnit 8.0
Stable release
- QA - Check technical debt
- Add support to PHP 7.3
Stable release
- When an error handler is defined, exception is not rethrowed automatically, but the recipe remains interrupted.
Stable release
- Recipe method "onError" can now be called several times to add multiple error handler
- Chef can now manage multiple error handler. Interface has been updated to avoid bc break and allow single onError and an array of Bowl.
Stable release
- Fix issue with bowl and optionals arguments not correctly setted when a previous optional argument (following the order of the declaration) was not set.
Stable release
- Fix composer requirement about teknoo/states.
Stable release
- Recipe method "onError" to define a callable or a BowlInterface instance to execute when an exception is occurred during a recipe's cooking. The exception still be rethrown by the chef after.
Stable release
- Bowl and DynamicBowl can pass to the special parameter "_methodName", the name of the current step.
Stable release
- Clean and fix behavior tests, Recipe's dish was not correctly tested.
- Fix Recipe bowl, they have an extra looping because the loop counter had a bug.
- Fix recipe compiling when several steps share the same name, firsts was lost.
Stable release
- Method ChefInterface::setAsideAndBegin() to reserveAndBegin() to follow the culinary vocabulary.
- Subchef are initialized with workplan of the master
- Method Chef::begin() use new static() instead of new self().
- The work plan injected into the RecipeBowl inherits of the original workplan
- DynamicBowl class to allow dynamic step in recipe, with the callable is stored into a variable in the work plan and not directly defined in the recipe. Only the name of the callable as ingredient into the work plan is mandatory. This bowl can throw an exception if no callable has found in the workplan, but it can fail silently.
- Method "cook" of Recipe can accept now BowlInstance as $action value, in addition to callable value
- Update behat tests to support last adds.
- Feature "execute" on RecipeInterface and Recipe to embed recipes in another recipe. A subrecipe can be called severa time, in a loop, defined in parameter
- Feature "reserveAndBegin" on ChefInterface and Chef to support embedded recipe.
- Add RecipeBowl to store in the execution plan a recipe as a bowl to be executed by the chef.
- Update behat tests to support last adds.
- Update Ingredient to support callback feature to normalize a value.
- Update Ingredient to support also scalar type and can normalize ingredient.
- Behat tests
- BowlInterface and Bowl to validate and encapsulate callable before register them into a recipe and map some ingredients available in the work plan with callable's parameters. (Immutable behavior)
- DishInterface and Dish to validate the result of the execution of a recipe. (Immutable behavior)
- Ingredient and IngredientInterface to define conditions to execute a recipe and prepare some ingredient before executing the recipe. (Immutable behavior)
- Promise (back-ported from teknoo/east-foundation) to define the action to perform when an operation success or fail when it is not possible to define exchange between actors via an interface. (Immutable behavior)
- Recipe to define dynamically an ordered set of actions to realize an algorithm. Actions are callable. (Immutable behavior)
- Chef, can be train by learning a recipe and then cook (execute) the recipe several times.