Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@oliwel
Copy link
Collaborator

@oliwel oliwel commented Aug 6, 2023

Description

Enforce conditions to return a class object on evaluate instead of judging on perlish boolean values.

Also removes the GreedyOr and CheckReturn condition as those violate the "boolean return" interface contract.

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project, please see the contribution guidelines.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

You might think, that this is one crazy checklist, but it is just as much written for the maintainer of the involved software :-)

oliwel added 2 commits August 6, 2023 19:25
Conditions are designed to return a boolean value and not
any kind of typed information. Those classes violate this
interface contract and are therefore removed.
A strict type checking on the return value of the evaluate
call will prevent accidential decission errors due to bugs
in the condition classes.
The interface contract for conditions now enforces that an
instance of Workflow::Condition::IsTrue/::IsFalse is returned.
Any other value will cause the workflow to croak with an error
@coveralls
Copy link

Coverage Status

coverage: 92.12% (-0.2%) from 92.329% when pulling c4c7d2c on oliwel:feature/condition-return into cb8e055 on jonasbn:master.

@ehuelsmann ehuelsmann merged commit ce58558 into perl-workflow:master Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants