nvlad / yii2support

Yii2 Support for PhpStorm / IntelliJ IDEA
https://plugins.jetbrains.com/idea/plugin/9388-yii2-support
Other
295 stars 54 forks source link

Error on Code Analysis ver 2020.2 #248

Closed johnluxor closed 3 years ago

johnluxor commented 4 years ago

What steps will reproduce the problem?

Run code analysis within commit

What is the expected result?

What do you get instead?

Additional info

Q A
IDE Name PhpStorm
IDE Version 2020.2
Plugin version
Yii App Template advanced

ERROR - vcs.impl.CodeSmellDetectorImpl - This PHP type is immutable java.lang.UnsupportedOperationException: This PHP type is immutable at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:936) at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:915) at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57) at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67) at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:642) at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:501) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:137) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101) at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:556) at com.jetbrains.php.lang.psi.resolve.types.PhpArrayAccessTP.complete(PhpArrayAccessTP.java:132) at com.jetbrains.php.PhpIndexImpl.lambda$completeType$1(PhpIndexImpl.java:128) at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:128) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101) at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:556) at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.lambda$resolveInHierarchy$0(MemberReferenceImpl.java:180) at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:153) at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54) at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235) at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71) at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236) at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43) at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:76) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:150) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:120) at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.resolveInHierarchy(MemberReferenceImpl.java:177) at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.resolveGlobal(MemberReferenceImpl.java:162) at com.jetbrains.php.lang.psi.elements.impl.FieldReferenceImpl.resolveGlobal(FieldReferenceImpl.java:49) at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.lambda$static$0(PhpReferenceImpl.java:157) at com.intellij.psi.impl.source.resolve.ResolveCache$PolyVariantResolver.resolve(ResolveCache.java:70) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolve$1(ResolveCache.java:155) at com.intellij.openapi.util.Computable.get(Computable.java:17) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$3(ResolveCache.java:227) at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:112) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:204) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:155) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:170) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:163) at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.multiResolve(PhpReferenceImpl.java:151) at com.jetbrains.php.lang.inspections.PhpDeprecationInspection.multiResolve(PhpDeprecationInspection.java:82) at com.jetbrains.php.lang.inspections.PhpDeprecationInspection.check(PhpDeprecationInspection.java:60) at com.jetbrains.php.lang.inspections.PhpDeprecationInspection.access$000(PhpDeprecationInspection.java:21) at com.jetbrains.php.lang.inspections.PhpDeprecationInspection$1.visitPhpFieldReference(PhpDeprecationInspection.java:49) at com.jetbrains.php.lang.psi.elements.impl.FieldReferenceImpl.accept(FieldReferenceImpl.java:172) at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26) at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65) at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:56) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:294) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$3(LocalInspectionsPass.java:263) at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:155) at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:147) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$4(LocalInspectionsPass.java:262) at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126) at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$5(LocalInspectionsPass.java:262) at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1105) at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117) at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:99) at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:57) at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:49) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.visitPriorityElementsAndInit(LocalInspectionsPass.java:266) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.inspect(LocalInspectionsPass.java:191) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.collectInformationWithProgress(LocalInspectionsPass.java:113) at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:80) at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.runMainPasses(DaemonCodeAnalyzerImpl.java:270) at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.lambda$runMainPasses$5(CodeSmellDetectorImpl.java:181) at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:103) at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$1(DumbService.java:147) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:869) at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61) at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:140) at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:103) at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.runMainPasses(CodeSmellDetectorImpl.java:181) at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.lambda$findCodeSmells$4(CodeSmellDetectorImpl.java:162) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157) at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.findCodeSmells(CodeSmellDetectorImpl.java:161) at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.findCodeSmells(CodeSmellDetectorImpl.java:139) at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl.access$000(CodeSmellDetectorImpl.java:44) at com.intellij.openapi.vcs.impl.CodeSmellDetectorImpl$1.run(CodeSmellDetectorImpl.java:101) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:935) at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:490) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:79) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) at java.base/java.lang.Thread.run(Thread.java:834)

sedovserge commented 4 years ago

Same problem, but this is fired in inspections 2020-08-01 03:19:04,979 [10056475] ERROR - aemon.impl.PassExecutorService - This PHP type is immutable java.lang.UnsupportedOperationException: This PHP type is immutable at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:936) at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:915) at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57) at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67) at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:642) at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:501) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:137) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101) at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:556) at com.jetbrains.php.lang.inspections.phpdoc.PhpRedundantVariableDocTypeInspection.inferTypeWithoutDocs(PhpRedundantVariableDocTypeInspection.java:55) at com.jetbrains.php.lang.inspections.phpdoc.PhpRedundantVariableDocTypeInspection.access$100(PhpRedundantVariableDocTypeInspection.java:27) at com.jetbrains.php.lang.inspections.phpdoc.PhpRedundantVariableDocTypeInspection$1.visitPhpVariable(PhpRedundantVariableDocTypeInspection.java:39) at com.jetbrains.php.lang.psi.elements.impl.VariableImpl.accept(VariableImpl.java:129) at com.jetbrains.php.lang.psi.elements.impl.PhpPsiElementImpl.accept(PhpPsiElementImpl.java:73) at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$6(LocalInspectionsPass.java:317) at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:168) at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126) at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115) at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:110) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:317) at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149) at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162) at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110) at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117) at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96) at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170) at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182) at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96) at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

alexxxst commented 4 years ago

Same error when open some file for analyze:

2020-08-07 16:27:37,993 [ 137708]   INFO - rationStore.ComponentStoreImpl - Saving appYii2 Support took 11 ms 
2020-08-07 16:27:48,289 [ 148004]  ERROR - aemon.impl.PassExecutorService - This PHP type is immutable 
java.lang.UnsupportedOperationException: This PHP type is immutable
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:936)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:915)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:642)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:501)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:137)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:556)
    at com.jetbrains.php.lang.inspections.type.PhpWrongForeachArgumentTypeInspection$1.visitPhpForeach(PhpWrongForeachArgumentTypeInspection.java:34)
    at com.jetbrains.php.lang.psi.elements.impl.ForeachImpl.accept(ForeachImpl.java:76)
    at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$6(LocalInspectionsPass.java:317)
    at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:168)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:110)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:317)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
2020-08-07 16:27:48,290 [ 148005]  ERROR - aemon.impl.PassExecutorService - PhpStorm 2020.2  Build #PS-202.6397.115 
2020-08-07 16:27:48,290 [ 148005]  ERROR - aemon.impl.PassExecutorService - JDK: 11.0.7; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2020-08-07 16:27:48,290 [ 148005]  ERROR - aemon.impl.PassExecutorService - OS: Mac OS X 
2020-08-07 16:27:48,291 [ 148006]  ERROR - aemon.impl.PassExecutorService - This PHP type is immutable 
java.lang.UnsupportedOperationException: This PHP type is immutable
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:936)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:915)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:642)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:501)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:137)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:556)
    at com.jetbrains.php.lang.inspections.type.PhpWrongForeachArgumentTypeInspection$1.visitPhpForeach(PhpWrongForeachArgumentTypeInspection.java:34)
    at com.jetbrains.php.lang.psi.elements.impl.ForeachImpl.accept(ForeachImpl.java:76)
    at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$6(LocalInspectionsPass.java:317)
    at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:168)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:110)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:317)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
2020-08-07 16:27:48,291 [ 148006]  ERROR - aemon.impl.PassExecutorService - PhpStorm 2020.2  Build #PS-202.6397.115 
2020-08-07 16:27:48,291 [ 148006]  ERROR - aemon.impl.PassExecutorService - JDK: 11.0.7; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2020-08-07 16:27:48,291 [ 148006]  ERROR - aemon.impl.PassExecutorService - OS: Mac OS X 
nvlad commented 4 years ago

Hi! Released plugin version 0.10.57.33. Check for reproduction.

xwz commented 4 years ago

Version 0.10.57.33 seems to work with 2020.2 so far!

johnluxor commented 4 years ago

Thank you for the update, it works now!

alexxxst commented 4 years ago

Doesn't work. Another issue maybe? Same behaviour: infinite code analyzing.

2020-11-05 14:55:09,507 [  19824]  ERROR - aemon.impl.PassExecutorService - This PHP type is immutable 
java.lang.UnsupportedOperationException: This PHP type is immutable
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:940)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:919)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:642)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:501)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:137)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:560)
    at com.jetbrains.php.lang.inspections.type.PhpWrongForeachArgumentTypeInspection$1.visitPhpForeach(PhpWrongForeachArgumentTypeInspection.java:34)
    at com.jetbrains.php.lang.psi.elements.impl.ForeachImpl.accept(ForeachImpl.java:76)
    at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$6(LocalInspectionsPass.java:319)
    at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:168)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:110)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:319)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
2020-11-05 14:55:09,508 [  19825]  ERROR - aemon.impl.PassExecutorService - PhpStorm 2020.2.3  Build #PS-202.7660.42 
2020-11-05 14:55:09,508 [  19825]  ERROR - aemon.impl.PassExecutorService - JDK: 11.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2020-11-05 14:55:09,508 [  19825]  ERROR - aemon.impl.PassExecutorService - OS: Mac OS X 
2020-11-05 14:55:09,509 [  19826]  ERROR - aemon.impl.PassExecutorService - Last Action:  
2020-11-05 14:55:09,509 [  19826]  ERROR - aemon.impl.PassExecutorService - This PHP type is immutable 
java.lang.UnsupportedOperationException: This PHP type is immutable
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:940)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:919)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:642)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:501)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:137)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:560)
    at com.jetbrains.php.lang.inspections.type.PhpWrongForeachArgumentTypeInspection$1.visitPhpForeach(PhpWrongForeachArgumentTypeInspection.java:34)
    at com.jetbrains.php.lang.psi.elements.impl.ForeachImpl.accept(ForeachImpl.java:76)
    at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$6(LocalInspectionsPass.java:319)
    at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:168)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:110)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:319)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
2020-11-05 14:55:09,509 [  19826]  ERROR - aemon.impl.PassExecutorService - PhpStorm 2020.2.3  Build #PS-202.7660.42 
2020-11-05 14:55:09,509 [  19826]  ERROR - aemon.impl.PassExecutorService - JDK: 11.0.8; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2020-11-05 14:55:09,509 [  19826]  ERROR - aemon.impl.PassExecutorService - OS: Mac OS X 
2020-11-05 14:55:09,509 [  19826]  ERROR - aemon.impl.PassExecutorService - Last Action:  
2020-11-05 14:55:10,929 [  21246]   INFO - nSession$CountedThreadExecutor - DbSrcWriter stopped 
igor-netFantom commented 3 years ago
Q A
PhpStorm 2020.3
Build PS-203.5981.175
Yii2 Support 0.10.57.33
OS Linux (Manjaro XFCE)
Yii App Template Basic

Steps To Reproduce

1) Use Basic Yii App Template 2) Create ActiveRecord model (Sample.php):

<?php

namespace app\models;

class Sample extends \yii\db\ActiveRecord
{
    public function yiiSupportFatalError()
    {
        self::find()->all(); // Inspection Error java.lang.UnsupportedOperationException: This PHP type is immutable
    }
}

3) When open Sample.php file IDE Internal Error Occured:

java.lang.UnsupportedOperationException: This PHP type is immutable
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:1059)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:1038)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:730)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:602)
    at com.jetbrains.php.PhpIndexImpl.doCompleteType(PhpIndexImpl.java:176)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:122)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:632)
    at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection.analyzeCall(PhpVoidFunctionResultUsedInspection.java:50)
    at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection$1.visitPhpMethodReference(PhpVoidFunctionResultUsedInspection.java:41)
    at com.jetbrains.php.lang.psi.elements.impl.MethodReferenceImpl.accept(MethodReferenceImpl.java:32)
    at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:66)
    at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:57)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:298)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$3(LocalInspectionsPass.java:267)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:156)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:148)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$4(LocalInspectionsPass.java:266)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:127)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:116)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$5(LocalInspectionsPass.java:266)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1137)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:83)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:172)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:83)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Yii2SupportError

ventoh commented 3 years ago

Same problem on 2020.3

stas-bool commented 3 years ago

Same problem. PhpStorm 2020.3 Plugin version 0.10.57.33 ava.lang.UnsupportedOperationException: This PHP type is immutable at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:1059) at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:1038) at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57) at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67) at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:730) at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:602) at com.jetbrains.php.PhpIndexImpl.doCompleteType(PhpIndexImpl.java:176) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:122) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101) at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:632) at com.jetbrains.php.lang.psi.resolve.types.PhpArrayAccessTP.doComplete(PhpArrayAccessTP.java:129) at com.jetbrains.php.lang.psi.resolve.types.PhpIteratedAccessTP.complete(PhpIteratedAccessTP.java:37) at com.jetbrains.php.PhpIndexImpl.lambda$doCompleteType$1(PhpIndexImpl.java:165) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:42) at com.jetbrains.php.PhpIndexImpl.doCompleteType(PhpIndexImpl.java:165) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:122) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101) at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:632) at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.lambda$resolveInHierarchy$0(MemberReferenceImpl.java:202) at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:153) at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54) at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:42) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68) at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236) at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43) at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:78) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:150) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:120) at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.resolveInHierarchy(MemberReferenceImpl.java:199) at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.resolveGlobal(MemberReferenceImpl.java:184) at com.jetbrains.php.lang.psi.elements.impl.FieldReferenceImpl.resolveGlobal(FieldReferenceImpl.java:52) at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.lambda$static$0(PhpReferenceImpl.java:159) at com.intellij.psi.impl.source.resolve.ResolveCache$PolyVariantResolver.resolve(ResolveCache.java:64) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolve$1(ResolveCache.java:149) at com.intellij.openapi.util.Computable.get(Computable.java:17) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$3(ResolveCache.java:221) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:42) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:198) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:149) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:164) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:157) at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.multiResolve(PhpReferenceImpl.java:153) at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.resolve(PhpReferenceImpl.java:139) at com.jetbrains.php.lang.annotator.PhpAnnotatorVisitor.checkAccessModifiers(PhpAnnotatorVisitor.java:876) at com.jetbrains.php.lang.annotator.PhpAnnotatorVisitor.visitPhpFieldReference(PhpAnnotatorVisitor.java:756) at com.jetbrains.php.lang.psi.elements.impl.FieldReferenceImpl.accept(FieldReferenceImpl.java:184) at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26) at com.jetbrains.php.lang.annotator.PhpAnnotator.annotate(PhpAnnotator.java:17) at com.intellij.codeInsight.daemon.im

igor-netFantom commented 3 years ago

Same error and same code example after update PhpStorm to last version 2020.3.2

Q A
PhpStorm 2020.3.2
Build PS-203.7148.74
Yii2 Support 0.10.57.33
OS Linux (Manjaro XFCE)
Yii App Template Basic

Steps To Reproduce

1) Use Basic Yii App Template 2) Create ActiveRecord model (Sample.php):

<?php

namespace app\models;

class Sample extends \yii\db\ActiveRecord
{
    public function yiiSupportFatalError()
    {
        self::find()->all(); // Inspection Error java.lang.UnsupportedOperationException: This PHP type is immutable
    }
}

3) When open Sample.php file IDE Internal Error Occured:

java.lang.UnsupportedOperationException: This PHP type is immutable
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.getException(PhpType.java:1059)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType$ImmutablePhpType.add(PhpType.java:1038)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:57)
    at com.nvlad.yii2support.typeprovider.ActiveRecordTypeProvider.getBySignature(ActiveRecordTypeProvider.java:67)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:731)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:603)
    at com.jetbrains.php.PhpIndexImpl.doCompleteType(PhpIndexImpl.java:176)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:122)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:101)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:632)
    at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection.analyzeCall(PhpVoidFunctionResultUsedInspection.java:50)
    at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection$1.visitPhpMethodReference(PhpVoidFunctionResultUsedInspection.java:41)
    at com.jetbrains.php.lang.psi.elements.impl.MethodReferenceImpl.accept(MethodReferenceImpl.java:32)
    at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:66)
    at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:57)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:298)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$3(LocalInspectionsPass.java:267)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:156)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:148)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$4(LocalInspectionsPass.java:266)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:127)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:116)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$5(LocalInspectionsPass.java:266)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1137)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
    at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:83)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:172)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:83)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
nvlad commented 3 years ago

Hi! Please update plugin and check reproduce of the error.