Skip to content

Remove Param Sync#178

Merged
alganet merged 1 commit intoRespect:masterfrom
alganet:remove-param-sync
Mar 22, 2026
Merged

Remove Param Sync#178
alganet merged 1 commit intoRespect:masterfrom
alganet:remove-param-sync

Conversation

@alganet
Copy link
Member

@alganet alganet commented Mar 22, 2026

Parameter synchronization has been removed, favoring the usage of PSR7 interfaces for exchange of data between routines and routes if necessary, allowing the same controller splitting technique.

Respect\Rest now uses Respect\Parameter for its Reflection duties, and the main DispatchContext exposes a valid PSR11 container with its injectable dependencies.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the parameter synchronization mechanism and shifts argument injection/resolution to respect/parameter, while updating routines/routes/tests/docs to reflect positional route parameters and PSR-7/PSR-11-based injection.

Changes:

  • Deleted Param Sync abstractions (ParamSynced, AbstractSyncedRoutine, ResolvesCallbackArguments) and updated routines to resolve arguments via Respect\Parameter\Resolver.
  • Updated dispatch/routine execution flow to call routine methods directly and use DispatchContext::resolver() for argument resolution.
  • Updated tests and documentation to reflect positional route params (no name-based sync) and callable-only routine callbacks.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Stubs/AbstractRoutine.php Aligns stub callback typing with callable-only routines.
tests/Routines/ByTest.php Updates coverage references and switches to invokable instance usage.
tests/Routines/AbstractSyncedRoutineTest.php Removes tests tied to deleted Param Sync behavior.
tests/Routines/AbstractRoutineTest.php Updates constructor argument expectations to callable / TypeError behavior.
tests/RouterTest.php Adjusts proxy parameter expectations to positional (non-synced) behavior.
tests/Psr7InjectionTest.php Reorders/keeps PSR-7 injection coverage for through routines.
tests/DispatchContextTest.php Removes Param Sync-specific test coverage and helpers.
src/Routines/When.php Migrates When to AbstractRoutine + Resolver-based argument resolution.
src/Routines/Through.php Migrates Through to AbstractRoutine + Resolver-based argument resolution.
src/Routines/ParamSynced.php Deletes Param Sync interface.
src/Routines/By.php Migrates By to AbstractRoutine + Resolver-based argument resolution.
src/Routines/AuthBasic.php Switches callback reflection/type checks and arg resolution to Resolver.
src/Routines/AbstractSyncedRoutine.php Deletes Param Sync base class.
src/Routines/AbstractRoutine.php Enforces callable-only callbacks (constructor + getter typing).
src/RoutinePipeline.php Calls when/by/through directly (removes DispatchContext::routineCall).
src/Routes/ControllerRoute.php Uses DispatchContext::resolver() for controller method invocation args.
src/Routes/Callback.php Uses Resolver::reflectCallable() and DispatchContext::resolver() for args.
src/Routes/AbstractRoute.php Removes ResolvesCallbackArguments usage and getTargetReflection().
src/ResolvesCallbackArguments.php Deletes legacy PSR-7 argument injection trait.
src/DispatchContext.php Implements ContainerInterface and exposes resolver() for injection.
docs/README.md Updates docs to remove param sync claims and document positional params.
composer.json Adds psr/container and respect/parameter dependencies.
Comments suppressed due to low confidence (1)

src/Routines/AuthBasic.php:26

  • AuthBasic::__construct() accepts mixed $callback, but the parent AbstractRoutine constructor now requires callable. Updating this parameter type to callable would make the public API clearer and surface invalid callbacks earlier (without relying on the parent call’s TypeError).
    public function __construct(public string $realm, mixed $callback)
    {
        parent::__construct($callback);
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.66%. Comparing base (74fd050) to head (fd6436c).

Files with missing lines Patch % Lines
src/DispatchContext.php 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #178      +/-   ##
============================================
- Coverage     96.91%   96.66%   -0.25%     
+ Complexity      437      403      -34     
============================================
  Files            33       31       -2     
  Lines          1101     1020      -81     
============================================
- Hits           1067      986      -81     
  Misses           34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Parameter synchronization has been removed, favoring the usage
of PSR7 interfaces for exchange of data between routines and
routes if necessary, allowing the same controller splitting
technique.

Respect\Rest now uses Respect\Parameter for its Reflection
duties, and the main DispatchContext exposes a valid PSR11
container with its injectable dependencies.
@alganet alganet force-pushed the remove-param-sync branch from 48d1f22 to fd6436c Compare March 22, 2026 22:35
@alganet alganet marked this pull request as ready for review March 22, 2026 22:36
@alganet alganet merged commit 0f1843b into Respect:master Mar 22, 2026
3 checks passed
@alganet alganet deleted the remove-param-sync branch March 22, 2026 22:37
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