Skip to content

Refactor & code Cleanup in scenario#3346

Merged
Mips2648 merged 6 commits into
developfrom
chore/refacto-scenario-conditions
May 18, 2026
Merged

Refactor & code Cleanup in scenario#3346
Mips2648 merged 6 commits into
developfrom
chore/refacto-scenario-conditions

Conversation

@Mips2648
Copy link
Copy Markdown
Collaborator

Description

This pull request focuses on improving exception handling and code consistency in the scenario and scenarioExpression classes, as well as making minor improvements to type safety and return logic. The main changes involve consolidating exception handling to use \Throwable, refactoring logging calls to use a static method, and ensuring type consistency for timeout values.

Exception Handling Improvements:

  • Replaced multiple catch blocks for Exception and Error with a single catch (\Throwable $ex) in scenario.class.phpandscenarioExpression.class.php`

Logging Refactor & code Cleanup::**

  • Updated all instance calls to $this->setLog to use static method self::setLog in scenarioExpression.class.php,
  • Refactored logging in the wait static method to use the static setLog method, further standardizing logging practices.

Type and Return Consistency:

  • Changed the getTimeout method in scenario.class.php to always return an int and removed the unused $_default parameter.
  • Ensured the setTimeout method casts the timeout value to int before assignment for type safety.

Minor Logic Fixes:

  • Added a missing return $return; statement in the export method to ensure the correct value is returned in all cases.

Suggested changelog entry

Various bugfix & quality improvement

Related issues/external references

Fixes #

Types of changes

  • Code quality
  • Bug fix (non-breaking change which fixes)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

@Mips2648 Mips2648 added the changelog-other Use to generate release notes label May 14, 2026
@Mips2648 Mips2648 requested review from Salvialf and zoic21 May 14, 2026 05:43
@Mips2648 Mips2648 added this to the 4.6 milestone May 14, 2026
Mips2648 added a commit that referenced this pull request May 14, 2026
@Mips2648 Mips2648 requested a review from Sekiro-kost May 18, 2026 07:25
@Mips2648 Mips2648 merged commit b9f0fbb into develop May 18, 2026
9 checks passed
@Mips2648 Mips2648 deleted the chore/refacto-scenario-conditions branch May 18, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-other Use to generate release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants