Simplify hook patterns using *MARK
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3536949. --> Reported by: [ghost of drupal past](https://www.drupal.org/user/3619592) Related to !70 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The Lexer class in phpstan/phpdoc-parser uses this <code>$pattern = '(?:' . $pattern . ')(*MARK:' . $type . ')';</code>. This might come as a surprise because up until yesterday support for *MARK in PHP was almost entirely undocumented, only the PHP 5.6 changelog mentions it briefly, I have now added it to the PCRE documentation. We totally could and should follow. It majorly simplifies the entire hook pattern mechanism: some 50 lines can be deleted including a runtime query. Also, the restriction of 65536 dynamic hooks is removed. (Phew, I was getting worried.)</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Look at <a href="https://github.com/phpstan/phpdoc-parser/blob/b9e61a61e39e02dd90944e9115241c7f7e76bfd8/src/Lexer/Lexer.php#L193">Lexer</a> </li><li>Go hmmm </li></ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Delete, delete, delete.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Ain't much.</p> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <p>DocBlockInterface::getHookFunction is gone. We hardly knew ya.</p> <h3 id="summary-data-model-changes">Data model changes</h3>
issue