What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello, I might have a little stupid question but when I've switched from IDEA to PhpStorm, all class

U01E6Q6AMHC
U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello, I might have a little stupid question but when I've switched from IDEA to PhpStorm, all classes like Facades, Repositories and so on are shown as unused cause there is no direct implementation of such class in PHP when code inspection runs. In IDEA I had not such problem and I've checked the plugins which are the same related with PHP. Am I missing some specific PhpStorm configuration here? Thank you.

Comments

  • HI @U01E6Q6AMHC! I think it’s because those classes are not used directly. They are available and used via Locator and resolved automatically for each module.

  • Unknown
    edited December 2020

    Probably IDEA is not analizing PHP code deeply as PhpStorm does

  • U01E6Q6AMHC
    U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi Aleksey, thank you for your answer. So it means that when IDEA doesn't consider that class as unused it's wrong? And I should see all such classes as unsued in PhpStorm? I don't recall on trainings that these classes were shown as unused and in the presentation the PhpStorm was used.

  • I think you can add @method \Pyz\Zed\Module\Business\ModuleFacadeInterface getFacade() annotation in place where it’s used. For example in Plugins.

  • It might help

  • U01E6Q6AMHC
    U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet

    Unfortunately not, it didn't help

  • U01E6Q6AMHC
    U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet

    I see there is a Spryker plugin available but it looks outdated and probably not official

  • U01E6Q6AMHC
    U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet

    latest update 2017

  • Yeah it’s not official and not fully supported

  • U01E6Q6AMHC
    U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ok I see there is an option to supress this if the class itself is annotated by @method , maybe this is the cause

  • BTW what do you expect from Spryker PhpStorm plugin? It would be nice to have some feedback from the community what is needed so maybe we can add this to the future roadmap

  • U01E6Q6AMHC
    U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2020

    For instance the plugin will know that such classes are used not unused, tools for generating folder structure (I know console commands can do it as well) therefore maybe integration PhpStorm with Docker/Vagrant console, so you can use some shortcuts like generate ide autocompletion files and reload files from disc (if project is in samba share), same for propel install, transfer generate and other most uses commands. Better integration of code completion with twig templates (currently these templates doesn't autocomplete functions, variables). Symfony plugin is for such reason to connect twig templates with controller therefore it's more friendly to use. But only for Symfony code structure ofc so not applicable here. Tools to generate test classes/structure from the class you are currently on (e.g. I am on Facade and I want to create tests for that facade so I will use some shortcuts and I can write tests directly without manually creation the structure, configuration file for codeception etc.

  • Thanks for the feedback!

  • U01E6Q6AMHC
    U01E6Q6AMHC Posts: 48 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2020

    Glad to help! So I do understand you are working on that plugin? πŸ™‚ Or you have some another one in plans?

  • No, I’m not working on this plugin. But we gather ideas from community.

  • BTW you can your points right here
    https://spryker.ideas.aha.io/ideas