Freelancer PHP since Version 3, Symfony since 1.0 Skipped 2.0 release while being in nodejs land For 12 years VBA by day, Web by night Since 2016 Full time/stack Freelancer Since 2022 in training to become a therapist (Gestalttherapie) Why am I here?
if it was yours – even more so! Acknowledge Become aware of better solution Discuss (guidelines?) Improve Refactoring should be a daily practice
on purpose People do things because it is the only way the know … being hurt, scared, insecure, attacked, disregarded If you knew a better way to behave, you would do it Changing your „inner programming“ is hard work as it is deeply written into your firmware
„bad feelings“ • We dont‘ want to feel bad • → If you experience a „bad feeling“, your body/mind tries to protect you in the future $state = $self->checkState(); $need = $state->getNeed(); $feedback = $self->express($need); $experience = $self->validate($need, $feedback); • Stop checking state • Stop feeling your needs • Stop expressing your needs • Stop validation
to your body, stop feeling (anger, ..) • Stop feeling your needs → Go on, drain your battery, exhaust yourself • Stop expressing your needs → „I‘m not worth it“ / „I am too much“ • Stop objective validation → „It‘s my fault“ / „I must not do this“ These mechanisms are being incorporated into your code base
intercept your main code Unconcious High-Priority EventListeners that kick in before/during the „main“ process (concious decissions) High performance, impressive response time (react before you think) Hard to debug
{ $request = $event->getRequest(); $requestor = $request->getRequestor(); if ($requestor->isFemale()) { // skip validation, mum would not like it and be sad, see logs1978.tar.gz to logs1983.tar.gz $response = new YesSureIllDoItResponse('Sure'); $event->setResponse($response); } } public static function getSubscribedEvents(): array {…} }
{ $exception = $event->getThrowable(); if ($exception instanceof NoIDontWantThisException) { $request = $event->getRequest(); $requestor = $request->getRequestor(); if ($requestor->mightNotLike($exception)) { // stop handling exception, do not hurt their feelings, they will stop loving you continue_execution_after_validation(); // magic method I invented myself } } } public static function getSubscribedEvents(): array {…} }
{} public function onExpressNeedEvent(ExpressNeedEvent $event): void { $need = $event->getNeed(); if ($need->isThirsty()) { // dont bother asking for a glass of water, you're not worth anyone's trouble $this->dispatcher->dispatch(new GetUpEvent()); // get it yourself $this->dispatcher->dispatch(new GetWaterEvent()); } }
breakpoint – become aware when your EventListeners kick in Acknowledge, don‘t blame (yourself, parents, partner, colleagues, …) Become aware of better solution Discuss – get in contact and show yourself Improve says:
Conditions Who is your contact (spouse, parents, manager, people in need) Validation Is this really good for me? Am I worth it? Is this a valid need? Response / Action Say „yes“ even if you should not
… Conditions Who is your contact (spouse, parents, manager, people in need) … Validation Is this really good for me? Am I worth it? Is this a valid need? … Response / Action Say „yes“ even if you should not … • Find a class name for the listener • Define event / event class • Draft code Where does it come from? Purpose? Fix?