You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since PhpStorm 2019.1 there is a feature, which detects unused public code. But there are some places in the shopware plugin code which are not recognized properly. I am not 100% sure if this is a task for this plugin but I try it anyway:
Controller:
class Shopware_Controllers_Frontend_MyController extends \Enlight_Controller_Action {
// some code
}
The controller class name is marked as unused, the methods are recognized correct. This is only the case for "old" plugin controllers without namespaces.
Subscriber:
If you have a subscriber like
use Enlight_Controller_ActionEventArgs as ActionEventArgs;
public static function getSubscribedEvents(): array
{
return [
'Enlight_Controller_Action_PostDispatchSecure_Frontend_Detail' => 'onPostDispatchSecureFrontendDetail',
];
}
public function onPostDispatchSecureFrontendDetail(ActionEventArgs $args)
{
// some code
}
the onPostDispatchSecureFrontendDetail-Method is marked as used, which is awesome. But if you register the subscriber like
the method is marked as unused, and PhpStorm doesn't recognize the connection between the method and the subscriber anymore. The connection between those worked until PhpStorm 2018.3.
The text was updated successfully, but these errors were encountered:
The problem is on the phpstorm side. Certain classes are not called directly but via the framework. This includes controllers and DI-Factories as well as Test-Classes.
PHPStorm calls these classes "EntryPoint".
Since PhpStorm 2019.1 there is a feature, which detects unused public code. But there are some places in the shopware plugin code which are not recognized properly. I am not 100% sure if this is a task for this plugin but I try it anyway:
Controller:
The controller class name is marked as unused, the methods are recognized correct. This is only the case for "old" plugin controllers without namespaces.
Subscriber:
If you have a subscriber like
the onPostDispatchSecureFrontendDetail-Method is marked as used, which is awesome. But if you register the subscriber like
the method is marked as unused, and PhpStorm doesn't recognize the connection between the method and the subscriber anymore. The connection between those worked until PhpStorm 2018.3.
The text was updated successfully, but these errors were encountered: