Bug 244040 - "use" statement considered a syntax error
Summary: "use" statement considered a syntax error
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (show other bugs)
Version: git master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 305778 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-09 15:26 UTC by Jan Buchar
Modified: 2014-07-11 12:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Buchar 2010-07-09 15:26:35 UTC
Version:           SVN (using KDE 4.4.4) 
OS:                Linux

The "use" statement related to namespaces in PHP is currently not interpreted correctly - it's considered a syntax error. It's possible that this makes the class browser ignore classes whose files also contain the use statement.

Reproducible: Always
Comment 1 Jan Buchar 2010-07-09 21:28:28 UTC
An example:

<?php
namespace A {
	class B {
		public static function foo ()
		{
			return "bar";
		}
	}
}
A\B::foo(); // Works properly 
use A\B; //Syntax error - should make A\B accessible through B
B::foo(); // like this
?>
Comment 2 Heinz Wiesinger 2014-01-19 10:52:51 UTC
*** Bug 305778 has been marked as a duplicate of this bug. ***
Comment 3 Heinz Wiesinger 2014-01-20 18:52:03 UTC
Git commit 536a3a186bd937642095fd99079e24a2a98939c7 by Heinz Wiesinger.
Committed on 19/01/2014 at 16:21.
Pushed by wiesinger into branch 'master'.

Fix support for PHP namespaces.

Make sure use declarations actually find their original declarations
and implement lookup for definitions within the same namespace but
in a different file.
Also handle name conflicts.
Related: bug 255537
REVIEW: 115158

M  +34   -9    duchain/builders/declarationbuilder.cpp
M  +110  -62   duchain/helper.cpp
M  +9    -0    duchain/helper.h
M  +11   -0    duchain/tests/expressionparser.cpp
M  +1    -0    duchain/tests/expressionparser.h
M  +26   -15   duchain/tests/uses.cpp

http://commits.kde.org/kdev-php/536a3a186bd937642095fd99079e24a2a98939c7