Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Help! Cannot be solved to a type
Help! Cannot be solved to a type [message #1776929] Wed, 22 November 2017 20:28 Go to next message
Fangzheng Song is currently offline Fangzheng SongFriend
Messages: 1
Registered: November 2017
Location: Vancouver
Junior Member
Hello,

I am a PHP noob here, and it's my first time using Eclipse PHP. I installed joomla and used xampp to host. Everthing works very well, I can create project base on the joomla folder and able to run the web application inside the Eclipse. However, the joomla I used is very fresh, I didn't touch anything. But eclipse shows a lot of errors....most of them like "Cannot be solved to a type". I am doing something wrong in building the project???

Thank you,
Fang
Re: Help! Cannot be solved to a type [message #1780699 is a reply to message #1776929] Thu, 25 January 2018 23:04 Go to previous messageGo to next message
George P is currently offline George PFriend
Messages: 2
Registered: January 2018
Junior Member
Did you upgrade from lower v. PHP to a higher v. PHP?
Re: Help! Cannot be REsolved to a type [message #1815682 is a reply to message #1780699] Tue, 08 October 2019 11:23 Go to previous messageGo to next message
DI V is currently offline DI VFriend
Messages: 20
Registered: October 2019
Junior Member
Check the Joomla! version. This appears to be a known problem from version 3.8 of Joomla! onwards.

Symptoms are many hundreds of Error messages in Eclipse of two forms:

  • "The import ******\******\****** cannot be resolved"
  • "****** cannot be resolved to a type"


For advice on how to address this problem see:

[Updated on: Wed, 09 October 2019 03:57]

Report message to a moderator

General guidance for debugging Joomla! in Eclipse [message #1815684 is a reply to message #1815682] Tue, 08 October 2019 11:34 Go to previous messageGo to next message
DI V is currently offline DI VFriend
Messages: 20
Registered: October 2019
Junior Member
For general guidance also see here:
Configuring Eclipse for joomla development - Joomla! Documentation. (Dated June/August 2019.)
Webinar: Using Eclipse for Joomla! Development - Joomla! Documentation. (Dated April/June 2009.)
Joomla! framework classes migrated out of global namespace: unable to infer information about alias [message #1815722 is a reply to message #1815684] Wed, 09 October 2019 04:12 Go to previous message
DI V is currently offline DI VFriend
Messages: 20
Registered: October 2019
Junior Member
There are problems running the file "stubGenerator.php" (version 3.9.2 RC, 2019-01-11) in Eclipse 2019-09 with PHP 7.3.5.

From the command line (outside Eclipse, using the PHP installed with my WAMP) calling "php stubGenerator.php" I get:
Quote:
Fatal error: Class StubGenerator contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Joomla\CMS\Application\CMSApplicationInterface::getName, Joomla\CMS\Application\CMSApplicationInterface::getMenu) in C:\wamp64\www\Joomla_4-0-0-a11\Build\stubGenerator.php on line 52


From Eclipse I got the same Error. I tried the two automated 'fixes' offered by Eclipse, but still couldn't get the file to run correctly.

The "stubGenerator.php" file is supposed to generate a file "stubs.php" in the root of the Joomla! installation (for example, "C:\wamp64\www\myJoom"). Tuan Pham Ngoc uploaded the appropriate "stubs.php" that was generated from an amended version of "stubGenerator.php" in September 2017. (This fixed a problem with the original "stubGenerator.php" creating class names with the wrong capitalisation.)

A further problem noted within the comments of the current "stubGenerator.php" file itself is:
Quote:
Note that this file will raise some IDE errors as it will generate stub classes extending a final class (something not allowed in PHP). Therefore it is suggested that inspections on this file are disabled.


Errors shown for the 2017 "stubs.php" file in Eclipse include:

  • "The type ****** must implement the inherited abstract method ******::***()"
  • "****** cannot be resolved to a type"

It is not clear to me how to disable "inspections" on an individual file (especially given that "stubs.php" is supposed to be placed in the Joomla! root directory, not its own subdirectory).

[Updated on: Wed, 09 October 2019 04:28]

Report message to a moderator

Previous Topic: I want to enable .php_cs.dist
Next Topic: Eclipse PDT IIS 7 and xdebug!!!!!
Goto Forum:
  


Current Time: Thu Oct 03 17:26:45 GMT 2024

Powered by FUDForum. Page generated in 0.03263 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top