Skip to content

Conversation

@joeySchentrup
Copy link

@joeySchentrup joeySchentrup commented Apr 22, 2025

This in reference to this issue: #16

After doing some prototyping and thinking, I don't think this is a bug but a good design choice. Not allowing implicit url parameters makes the location of the parameter in the url clearer. If subdirectories were able to declare url parameters in the url earlier than their location in the url, the location of the path variable then could vary.

For example, for the class

namespace Project\Http\Photo\Edit;

class GetPhotoEdit // parent: GetPhoto
{
    public function __invoke(int $photoId)
    {
        // ...
    }
}

If there was no subclass Project\Http\Photo\GetPhoto, we would not know if $photoID was here GET /photo/$photoID/edit or GET /photo/edit/$photoID or both. Seems like a bad trade off.

Therefore, this PR is just a readme update to make it more clean the "parent" class is required if using an in the middle path variable.

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.

1 participant