Download the PHP package metisfw/phpstan-nette-links without Composer
On this page you can find all versions of the php package metisfw/phpstan-nette-links. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download metisfw/phpstan-nette-links
More information about metisfw/phpstan-nette-links
Files in metisfw/phpstan-nette-links
Package phpstan-nette-links
Short Description Nette Framework link checking extension for PHPStan
License MIT
Informations about the package phpstan-nette-links
Nette Framework link validation for PHPStan
Check links in your Nette Framework applications using PHPStan.
Features
- Validate parameters passed to
link()
,lazyLink()
,redirect()
,redirectPermanent()
,forward()
,isLinkCurrent()
andcanonicalize()
methods - Works for presenters, components and 'LinkGenerator' service
- Checks if passed destination is valid and points to existing presenter, action or signal
- Checks if passed link parameters are valid and match relevant
action*()
,render*()
orhandle*()
method signature - Checks also links to sub-components of known types (
createComponent*()
method must exists)
Installation
To use this extension, require it in Composer:
If you also install phpstan/extension-installer then you're all set!
Manual installation
If you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config: To perform framework-specific checks, include also this file:Configuration
Either applicationMapping
or containerLoader
(for automatically loading mappings from PresenterFactory
service in your app) must be set for link checking to work.
If you use non-standard PresenterFactory
this feature might not work because logic for mapping presenter name (e.g. MyModule:Homepage
) to presenter class (e.g. \App\Presenters\MyModule\HomepagePresenter
) and vice versa would work differently.
If you use containerLoader
you might solve this by implementing method unformatPresenterClass
in your custom PresenterFactory
class. This method should return presenter name for given presenter class.
Or you can create custom implementation overriding PHPStanNetteLinks\Nette\PresenterResolver
service and replace it in your PHPStan config:
containerLoader
Container loader can be used to create instance of Nette application DI container.
Example:
Example containerLoader.php
:
applicationMapping
Application mapping is used to map presenter identfiers to classes in link checking.
Example:
All versions of phpstan-nette-links with dependencies
phpstan/phpstan Version ^1.10
phpstan/phpstan-nette Version ^1.2.9