Bug 244040

Summary: "use" statement considered a syntax error
Product: [Applications] kdevelop Reporter: Jan Buchar <Teyras>
Component: Language Support: PHPAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: audvare
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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