Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DI inspection complains about a class suffixes with Factory #1607

Open
an2riy opened this issue May 29, 2023 · 1 comment
Open

DI inspection complains about a class suffixes with Factory #1607

an2riy opened this issue May 29, 2023 · 1 comment
Labels

Comments

@an2riy
Copy link

an2riy commented May 29, 2023

Describe the bug

If you create a class with the suffix Factory and then try to add it as an argument to another class the validation complains about:
The class "..\Model\ItemFactory" does not exist but it exists.
Example:

<type name="...\Model\DataProvider">
      <arguments>
          <argument name="itemFactory" xsi:type="object">...\Model\ItemFactory</argument>
      </arguments>
</type>

image

To Reproduce

  1. Create a new module
  2. Create a model with the suffix Factory
  3. Created another model which can accept the previously created model as an argument
  4. Add configuration to etc/di.xml
<type name="...\Model\DataProvider">
      <arguments>
          <argument name="itemFactory" xsi:type="object">...\Model\ItemFactory</argument>
      </arguments>
</type>
  1. The complaint appears

Expected behavior
No complaint.

Information:

PhpStorm 2023.1.2
Build #PS-231.9011.38, built on May 17, 2023
Runtime version: 17.0.6+10-b829.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.15.0-72-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 5120M
Cores: 12
Registry:
editor.focus.mode.color.light=5b595c
ide.editor.tab.selection.animation=true
debugger.watches.in.variables=false
debugger.new.tool.window.layout=true
editor.caret.width=1
run.processes.with.pty=true
vcs.new.widget=true
ide.new.editor.tabs.vertical.borders=true
ide.experimental.ui=true
ide.balloon.shadow.size=0
editor.focus.mode.color.dark=5b595c

Non-Bundled Plugins:
de.femtopedia.diffplugin (2.1.10)
intellij-awk (0.4.0)
org.toml.lang (231.8109.91)
com.nasller.CodeGlancePro (1.6.3)
com.ultrahob.zerolength.plugin (0.95)
org.elasticsearch4idea (2023.1.6-231)
com.intellij.properties (231.8770.3)
String Manipulation (9.7.1)
ir.msdehghan.plugins.ansible (0.92)
indent-rainbow.indent-rainbow (2.1.0)
com.intellij.grazie.pro (0.3.224)
com.kalessil.phpStorm.phpInspectionsEA (5.0.0.0)
ru.adelf.idea.dotenv (2023.1)
de.espend.idea.php.annotation (9.3.1)
com.virtuslab.git-machete (3.8.0)
izhangzhihao.rainbow.brackets (2023.2.8)
pro.bashsupport (3.2.2.231)
lv.midiana.misc.phpstorm-plugins.deep-keys (2022.08.03.001)
fr.adrienbrault.idea.symfony2plugin (2022.1.250)
com.chrisrm.idea.MaterialThemeUI (8.6.4)
com.intellij.lang.jsgraphql (4.0.1)
com.magento.idea.magento2plugin (5.1.1)
org.sonarlint.idea (8.2.0.68615)
com.mallowigi (90.0.0)
zielu.gittoolbox (500.0.8+213)
mobi.hsz.idea.gitignore (4.5.0)
com.github.blarc.gitlab-template-lint-plugin (1.13.0)

Current Desktop: ubuntu:GNOME

@an2riy an2riy added the bug label May 29, 2023
@m2-assistant
Copy link

m2-assistant bot commented May 29, 2023

Hi @an2riy. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant