- Issue created by @bluegeek9
- First commit to issue fork.
- Status changed to Needs review
about 1 year ago 11:39am 7 November 2023 - 🇮🇳India viren18febS
Hi @bluegeek9
i have fixed the issue and added a patch , please review.
Thanks - Merge request !13Issue #3399697 by viren18febS: Issues reported by PHPStan → (Closed) created by bluegeek9
- Status changed to Needs work
12 months ago 11:38pm 17 November 2023 - @bluegeek9 opened merge request.
-
bluegeek9 →
committed cbcd785e on 8.x-1.x
Issue #3399697 by bluegeek9: Issues reported by PHPStan
-
bluegeek9 →
committed cbcd785e on 8.x-1.x
- Status changed to Active
12 months ago 11:57pm 17 November 2023 - 🇨🇦Canada dtarc
Hi,
We are extending MessageController class to get extra functionality. The recent update from 8.x-1.0 to 8.x-1.1 is causing code to break because all the classes have been declared final.
Code changed from
`class MessageController extends ControllerBase implements ContainerInjectionInterface {`
to
`final class MessageController extends ControllerBase implements ContainerInjectionInterface {`
Is there a reason for this API-breaking change? It seems unnecessarily strict to prevent these classes from being overridden.
- 🇺🇸United States bluegeek9
Are you overriding the constructor? I am inclined to leave the change.
- 🇨🇦Canada dtarc
We're extending the class, but we are not overriding the constructor. We're extending the class in order to get more functionality out of it. I think one of the big reasons that Drupal moved to an OO structure is to allow extending classes like this.
I can submit patches to add that functionality to MessageController if you're friendly to that. I've already added one such patch in #3403215.
Is there a good reason to declare these classes final? I don't understand the logic behind that.
- 🇺🇸United States bluegeek9
Hi @dtarc,
I don't understand what functionality you are getting by inheriting MessageController. Why are you not inheriting ControllerBase?
-
bluegeek9 →
committed 3273c236 on 8.x-1.x
Issue #3399697 by bluegeek9, viren18febS: Issues reported by PHPStan
-
bluegeek9 →
committed 3273c236 on 8.x-1.x
- 🇺🇸United States bluegeek9
@dtarc,
I made the constructor final instead of the class.
-
bluegeek9 →
committed 3d722135 on 8.x-1.x
Issue #3399697 by bluegeek9, viren18febs: Issues reported by PHPStan
-
bluegeek9 →
committed 3d722135 on 8.x-1.x
Automatically closed - issue fixed for 2 weeks with no activity.