Closed zl939144892 closed 3 years ago
More details. Don't show errors for me.
Try "Invalidate Caches / Restart..." in File menu
Ok, I'll try. And look out for this issue.
I already try "Invalidate Caches / Restart...", still has error. As you see, the mistakes will disappear when deleting and undo.
If disable plugin the error is reproducing? It not looks like as error generated by plugin.
I disabled the plugin as you see. I guess the plugin harasses the PhpStorm code analyses function.
For debug and testing send example of code where the problem is reproducing.
This is my company code, I can't share the code. But I guess maybe the project is too huge because another myself small project didn't have this error.
I don't need the code of a real project only an abstract example on which the error is reproduced. If you can make a similar example, we will try to solve the problem.
I try to copy the code of the screenshot to a single file, not appear this error. So I believe you can reappear this issue when the PHP project was big.
I am not currently developing on Yii2 only personal small projects, so I can hardly repeat the mistake myself.
Maybe @NanakiRus, who created the previous issue with the same description, can help us.
Oh, very grateful.
@nvlad Hi! I finally found this issue of reason!~
This issue will happen when the current file has the long SQL with Yii ActiveRecord
Model function like this:
XXXModel::findBySql('select * from xx_table where id not in (1341,50,2410,2478, 714, 362,1739,2350,2114,1612,2546,1947,1133,1910, 276,1703,1230,1488,2345,1875,2598, 655, 429, 788,2273,2218, 684,1729,2613, 469,2275,1347,2318,2615,2630, 131,1583, 335,2623, 824, 528,2663,2647,2656,2263,2700,2695,2731,1848,1724,2783,2526, 35,2603,2901,2902,2995,3042,3046,2920,3055,1989,2955,3168,3183,3198,3205,1346,2609,3193,1850,3185,3289,2515,3254,3367,3132,3406,3397,3305,3432,3433,3351,3446,3500,3506,2692,3499,3181,3594,3319,3595,3631,3541,3660,2924,3672,3719,3728,3704,3733,3766,3726,3778,3030,3227,3584,3828,3840,3451,3671,3875,3893,3892,3895,3848,3776,3896,3738,3841,3725,3773,4039,3836,4032,4059)')->all();
Hi! Is excellent! Please send the ready code to test the problem (Model, Controller or Service etc.) with highlighted the problem place.
@nvlad You can replay anywhere (Model, Controller or Service, etc.) just use a Yii ActiveRecord Model findBySql
with a long SQL. And then the page has this code will not diff in realtime.
@nvlad Hi, it's can be reproduced, any update on this issue now? :-)
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.type.PhpWrongForeachArgumentTypeInspection$1.visitPhpForeach(PhpWrongForeachArgumentTypeInspection.java:35)
at com.jetbrains.php.lang.psi.elements.impl.ForeachImpl.accept(ForeachImpl.java:82)
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.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$6(LocalInspectionsPass.java:321)
at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:169)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:127)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:116)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:111)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:321)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
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)
Hi! Please update plugin and check reproduce of the error.
What steps will reproduce the problem?
install the plugin and try work
What is the expected result?
PhpStorm doesn't see diffs in realtime (you will see mistakes for everything)
What do you get instead?
you will see mistakes for everything
Additional info