application
application copied to clipboard
LinkGenerator: extract interface
- feature
- BC break? no
- doc PR: should add note to https://github.com/nette/docs/blob/doc-3.1/en/creating-links.texy?
Since LinkGenerator is final, it would be nice if it had its own interface so that it can be replaced with own implementation.
What is the interface for? Replace it with your own implementation.
Right, I can change service application.linkGenerator to whatever class I want, but it won't solve the problem with 3rd party packages that are typehinted to Nette\Application\LinkGenerator. That leads me to conclusion, that the PR should be reworked to:
- create ILinkGenerator interface
- create alias LinkGenerator for ILinkGenerator to keep BC
- rename current class implementation,
DefaultLinkGeneratoror similar
@PavelJurasek I'll save this as a beautiful argument when someone wonders why I'm removing the letter I from the interface names. :-)