Review Request 115299: Add support for trait uses to kdev-php

Heinz Wiesinger pprkut at liwjatan.at
Fri Jan 24 15:38:25 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115299/
-----------------------------------------------------------

Review request for KDevelop.


Bugs: 305779
    http://bugs.kde.org/show_bug.cgi?id=305779


Repository: kdev-php


Description
-------

Add support for trait uses, as introduced in PHP 5.4.
This can be syntax as simple as

class A {
  use B;
}

or as complicated as

class A {
  use B,C,D {
    B::one insteadof C,D;
    C::two as foo;
    D::three as protected bar;
  }
}

allowing changing both function name and visibility. Additionally this syntax allows manual conflict resolution.

The error messages I used are as close as possible to the actual errors given by PHP. We check for
- invalid function modifiers (static, final)
- property name conflicts between traits and main class
- method name conflicts between multiple traits


Diffs
-----

  parser/phplexer.cpp 3a0a57dac6e7ebbe3e2c7d59912dc289bc25f71f 
  parser/php.g df0b5db7766417fe133a30678e2151302c3ddbfa 
  duchain/tests/uses.cpp 8ae049c1a5a96db9ed03eeed24a01e86dbb88ac3 
  duchain/tests/uses.h b97f15b8bfed391b236e92aee3a4efa9d589d451 
  duchain/tests/expressionparser.cpp 67829fec66dd9445ecfb9598028e7da630e2889c 
  duchain/tests/expressionparser.h 0e59aab68c2d8a9c9b8cee84d237f921c29a5c9f 
  duchain/navigation/declarationnavigationcontext.cpp 08d01425a0a94b3a65774141476783f9ce3a304c 
  duchain/navigation/declarationnavigationcontext.h 5ea31346522b2f24f1864b2876da6a3b9ddecba8 
  duchain/builders/usebuilder.cpp 32c2490efe19958d9d9b4ae93796fc6e2fdaf42c 
  duchain/builders/usebuilder.h af10294ea72d6b9ac156e7ca31745d17a5c4c1db 
  duchain/builders/declarationbuilder.cpp 2f4d8554b641ccbe15a375355b723c300172254c 
  duchain/builders/declarationbuilder.h 826bbb5d87cc3408c326cdf34191405907a6e1bf 
  completion/context.cpp 423a0de87ab8cae0986270b296640afd48b21628 

Diff: https://git.reviewboard.kde.org/r/115299/diff/


Testing
-------

Unit tests, parsing local test files


Thanks,

Heinz Wiesinger

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140124/2a76d380/attachment-0001.html>


More information about the KDevelop-devel mailing list