Skip to content

refactor: add extension point to payload contract handling #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chr-hertel
Copy link
Member

`8.`888b                 ,8'  8 8888 8 888888888o   
 `8.`888b               ,8'   8 8888 8 8888    `88. 
  `8.`888b             ,8'    8 8888 8 8888     `88 
   `8.`888b     .b    ,8'     8 8888 8 8888     ,88 
    `8.`888b    88b  ,8'      8 8888 8 8888.   ,88' 
     `8.`888b .`888b,8'       8 8888 8 888888888P'  
      `8.`888b8.`8888'        8 8888 8 8888         
       `8.`888`8.`88'         8 8888 8 8888         
        `8.`8' `8,`'          8 8888 8 8888         
         `8.`   `8'           8 8888 8 8888         

Trying to address pain of #291 and #297

Copy link
Member Author

Choose a reason for hiding this comment

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

this shouldn't be needed - would be easier if we do it directly in ModelClient, like before

Copy link
Member Author

Choose a reason for hiding this comment

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

same here

Comment on lines -16 to +13
public function supports(Model $model, array|string|object $input): bool;
public function supports(Model $model): bool;
Copy link
Member Author

Choose a reason for hiding this comment

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

separate PR

Copy link
Member Author

Choose a reason for hiding this comment

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

questionable instance handling, would be great tho to decouple from globale NormalizerInterface

@chr-hertel chr-hertel force-pushed the refactor-contract-handling branch from 591474f to c6ba1ce Compare May 4, 2025 22:27
Comment on lines +18 to +23
public function registerTypes(): array
{
return [
'string' => 'handleInput',
];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

couldn't we do this using an attribute like the event listeners do?

];
}

public function handleInput(string $input): array
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public function handleInput(string $input): array
#[AsExtension('string')]
public function handleInput(string $input): array

idea

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.

2 participants