Jump to content

Featured Replies

Posted

I've seen this error in my IDE for a while now but forgot to report it earlier. It is caused by the newly added \IPS\Node\DelayedCount trait.

 

I see this error even in several classes, even inside Application.php for applications that don't implement the trait. 🤷‍♂️

When I tell the IDE to fix the issue automatically this function gets added to the file (Application.php in this case):

	/**
	 * Count all comments, items, etc
	 *
	 * @return mixed
	 */
	protected function recount()
	{
		// TODO: Implement recount() method.
	}

I have no comments, items, or anything else that needs recounting in this specific application or others, though.

Solved by Daniel F

Go to solution

Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.

 

I can't reproduce this in my IDE ( phpStorm  2024.2.1 Build #PS-242.21829.154, built on August 29, 2024 )

What are the exact steps to reproduce this? Which Application.php class will show this?

  • Author

Just creating a simple application is enough. I can reproduce it even on v5.

 

I create a new application:

  • Name: Hello World
  • Directory: hello

 

Here's what I see in my IDE, that error is on line 19 (red arrow):

k0pwia1.png

 

 

Weird, nothing in my IDE and I really don't see how this could happen because Application isn't using it at all.
 

Could contain: Computer Hardware, Electronics, Hardware, Monitor, Screen, File

 

 

Same with v4 

Could contain: File, Computer, Electronics, Pc, Page, Text, Computer Hardware, Hardware, Monitor, Screen

Not seeing it here, latest alpha, PHPStorm 2022.2.5, language level PHP 8.1

What language levels are you others at?

  • Author

I'm using phpStorm 2021.2.3, language level PHP 8.1.

 

Maybe it's a bug in this old version of the IDE then. 🙄

  • 2 months later...
  • Solution

I've run into this too few times in the last weeks and have finally found the reason

 

So, @Matt created a fancy tool to insert all the traits as @mixins into the Model class,

CleanShot 2024-11-18 at 19.53.48.png

 

The weird side effect in phpStorm is, that it expects now the abstract method from DelayedCount too.

And when you use phpStorms "Add Method Stubs/fix it" feature, it will also add these methods / show all the not implemented abstract methods from the used mixins and at least I just selected them all, because why not.. I expected they were required in my class

So to avoid this, we have just to be more careful with using all the automatically suggested methods by phpStorm.

 

CleanShot 2024-11-18 at 20.00.42.png

 

  • Author

Good to know. I've removed that mixin line from the Model class for now. 🙂

Edited by teraßyte

Recently Browsing 0

  • No registered users viewing this page.