Skip to content
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

Refactoring: Abstrakte Klassen duerfen keine Kenntnis ueber ihre Kinder haben #18

Open
fluxdw opened this issue Sep 19, 2022 · 0 comments
Assignees
Labels

Comments

@fluxdw
Copy link
Contributor

fluxdw commented Sep 19, 2022

vgl.
https://git.fluxlabs.ch/fluxlabs/ilias/plugins/RepositoryObjects/ViMP/-/blob/main/classes/GUI/Abstract/class.xvmpGUI.php#L311

$show_unavailable = ($this instanceof xvmpVideosGUI) || ($this instanceof xvmpContentGUI);
$response->html = $this->renderer_factory->playerModal()->render($playModalDto, $async, $show_unavailable);

ToDo
Abstrackte Klassen pruefen, ob diese Elemente ihrer Kinder kennen. Falls ja jeweils ueberarbeiten und beispielsweise CommandHandler / Delegator einfuehren.

inteface GetResponseHandler {

}


class GetAvailableResponseHandler implements GetResponseHandler {
     /** @param GetResponseHandler[] $nextHandlers **/
     public function handle(GetAvailableResponse $command, array $nextHandlers): string {
         if(xzy === false) {
              $nextHandler = array_shift($nextHandlers);
              return $nextHandler->handle($command, $nextHandlers)
         }
 

         return renderXYZ
     }
}



GetUnAvailableResponseHandler implements GetResponseHandler {
     public function handle(GetAvailableResponse $command, array $nextHandlers): string {

     }
}

siehe auch:
https://docs.laminas.dev/laminas-stratigility/v3/middleware/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: NEW
Development

No branches or pull requests

2 participants