<table><tr><td style="">mtijink updated this revision to Diff 15918.<br />mtijink added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6342" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I also added type support for <tt style="background: #ebebeb; font-size: 13px;">iterable</tt> (previous, it only parsed correctly), which either is an array or an object which implements <tt style="background: #ebebeb; font-size: 13px;">Traversable</tt>. Could someone look at this, give some comments and (if okay) merge it?</p>

<p>Also, I still do not know how the issues I mentioned earlier should be handled:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">How should I add support for <tt style="background: #ebebeb; font-size: 13px;">self</tt>? Adding it as a token gave all kinds of problems. <em>Update:</em> adding it by detecting <tt style="background: #ebebeb; font-size: 13px;">self</tt> as a class before assigning the typehint works, but might not be the ideal solution.</li>
<li class="remarkup-list-item">How should the <tt style="background: #ebebeb; font-size: 13px;">callable</tt> type be represented? It should accept any kind of function, but I only saw support for types with known function signatures</li>
<li class="remarkup-list-item">This patch added some tokens, so they cannot be used as class names and constants anymore. This is a problem, I think, since PHP < 7 still allows e.g. <tt style="background: #ebebeb; font-size: 13px;">int</tt> as class name. Another problem is that the newer keywords (e.g. <tt style="background: #ebebeb; font-size: 13px;">iterable</tt>, <tt style="background: #ebebeb; font-size: 13px;">int</tt>) can still be used as names for constants (but not for classes etc.), which is not allowed with this code either.</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R52 KDevelop: PHP Support</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D6342?vs=15757&id=15918" rel="noreferrer">https://phabricator.kde.org/D6342?vs=15757&id=15918</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6342" rel="noreferrer">https://phabricator.kde.org/D6342</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>completion/context.cpp<br />
duchain/builders/typebuilder.cpp<br />
duchain/builders/usebuilder.cpp<br />
duchain/expressionvisitor.cpp<br />
duchain/tests/duchain.cpp<br />
duchain/tests/duchain.h<br />
parser/php.g<br />
parser/phplexer.cpp</div></div></div><br /><div><strong>To: </strong>mtijink, KDevelop, pprkut<br /><strong>Cc: </strong>apol, kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>