Skip to content

Commit

Permalink
[TASK] Extract display of vendor from component name
Browse files Browse the repository at this point in the history
  • Loading branch information
linawolf committed May 15, 2024
1 parent 46f1af8 commit 7097a01
Show file tree
Hide file tree
Showing 46 changed files with 474 additions and 95 deletions.
11 changes: 11 additions & 0 deletions resources/template/html/body/directive/php/component.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
{% include "body/directive/php/partials/linkToSnippet.html.twig" %}
</dt>
<dd>
{% if node.name.namespaceNode %}
<dl class="field-list simple">
{% if node.name.namespaceNode %}
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
{% set fqn = '\\' ~ node.name.namespaceNode.name ~ '\\' ~ node.name.namespaceNode.name %}
{% include "body/directive/php/partials/codeStyle.html.twig" with {'code': fqn} %}
</dd>
{% endif -%}
</dl>
{% endif -%}
{{ renderNode(node.value) }}
</dd>
</dl>
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% if node.namespaceNode != null %}
<span class="sig-prename descclassname"><span class="pre">\{{ node.namespaceNode.name }}\</span></span>
{% endif %}
<span class="sig-name descname"><span class="pre">{{ node.name }}</span></span>
<span class="sig-name descname">
<span class="pre fqn"
{%- if node.namespaceNode != null %} data-namespace="\{{ node.namespaceNode.name }}" {% endif -%}
title="{% if node.namespaceNode != null %}\{{ node.namespaceNode.name }}\{% endif %}{{ node.name }}">
{{ node.name }}
</span>
</span>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="pre">{{ code|raw }}</span>
12 changes: 10 additions & 2 deletions tests/integration/class-abstract/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>abstract class</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-abstracttest">
<span class="sig-name modifier"><span class="pre">abstract</span></span> <em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">AbstractTest</span></span> <a class="headerlink" href="#typo3-cms-core-abstracttest" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\AbstractTest">
AbstractTest
</span>
</span> <a class="headerlink" href="#typo3-cms-core-abstracttest" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-duplicate/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>final class</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-test">
<span class="sig-name modifier"><span class="pre">final</span></span> <em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-final-abstract/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>abstract final class causes warning</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-test">
<span class="sig-name modifier"><span class="pre">abstract</span></span> <span class="sig-name modifier"><span class="pre">final</span></span> <em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-final/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>final class</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-test">
<span class="sig-name modifier"><span class="pre">final</span></span> <em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
36 changes: 30 additions & 6 deletions tests/integration/class-namespace-directive/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>PHP Class with current namespace from directive</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-testclass">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">TestClass</span></span> <a class="headerlink" href="#typo3-cms-core-testclass" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\TestClass">
TestClass
</span>
</span> <a class="headerlink" href="#typo3-cms-core-testclass" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand All @@ -16,10 +24,18 @@ <h1>PHP Class with current namespace from directive</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-anotherclass">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">AnotherClass</span></span> <a class="headerlink" href="#typo3-cms-core-anotherclass" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\AnotherClass">
AnotherClass
</span>
</span> <a class="headerlink" href="#typo3-cms-core-anotherclass" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor Another!</p>

Expand All @@ -28,10 +44,18 @@ <h1>PHP Class with current namespace from directive</h1>
<dl class="php class">
<dt class="sig sig-object php" id="myvendor-some-namespace-anotherclass">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\MyVendor\Some\Namespace\</span></span>
<span class="sig-name descname"><span class="pre">AnotherClass</span></span> <a class="headerlink" href="#myvendor-some-namespace-anotherclass" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\MyVendor\Some\Namespace" title="\MyVendor\Some\Namespace\AnotherClass">
AnotherClass
</span>
</span> <a class="headerlink" href="#myvendor-some-namespace-anotherclass" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\MyVendor\Some\Namespace\MyVendor\Some\Namespace</span> </dd>
</dl>

<p>Lorem Ipsum Dolor Yet Another!</p>

Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-twice-noindex/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>class listed twice throws warning</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-test">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-twice-noindex/expected/page2.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ <h1>class listed twice throws warning</h1>
<dl class="php class">
<dt class="sig sig-object php">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> </dt>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> </dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-twice-warning/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>class listed twice throws warning</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-test">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-twice-warning/expected/page2.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>class listed twice throws warning</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-test">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>PHP class with constants</h1>
<dl class="php class">
<dt class="sig sig-object php" id="chucklefactory-funclass">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\ChuckleFactory\</span></span>
<span class="sig-name descname"><span class="pre">FunClass</span></span> <a class="headerlink" href="#chucklefactory-funclass" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\ChuckleFactory" title="\ChuckleFactory\FunClass">
FunClass
</span>
</span> <a class="headerlink" href="#chucklefactory-funclass" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\ChuckleFactory\ChuckleFactory</span> </dd>
</dl>

<p>Where Fun Knows No Bounds!</p>
<dl class="php const">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>PHP class with constants</h1>
<dl class="php class">
<dt class="sig sig-object php" id="secretsociety-enigmaticclass">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\SecretSociety\</span></span>
<span class="sig-name descname"><span class="pre">EnigmaticClass</span></span> <a class="headerlink" href="#secretsociety-enigmaticclass" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\SecretSociety" title="\SecretSociety\EnigmaticClass">
EnigmaticClass
</span>
</span> <a class="headerlink" href="#secretsociety-enigmaticclass" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\SecretSociety\SecretSociety</span> </dd>
</dl>

<p>Unveiling the mysteries of constants!</p>
<dl class="php const">
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-with-const-link/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>PHP class with constants</h1>
<dl class="php class">
<dt class="sig sig-object php" id="secretsociety-enigmaticclass">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\SecretSociety\</span></span>
<span class="sig-name descname"><span class="pre">EnigmaticClass</span></span> <a class="headerlink" href="#secretsociety-enigmaticclass" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\SecretSociety" title="\SecretSociety\EnigmaticClass">
EnigmaticClass
</span>
</span> <a class="headerlink" href="#secretsociety-enigmaticclass" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\SecretSociety\SecretSociety</span> </dd>
</dl>

<p>Unveiling the mysteries of constants!</p>
<dl class="php const">
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-with-const/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>PHP class with constants</h1>
<dl class="php class">
<dt class="sig sig-object php" id="secretsociety-enigmaticclass">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\SecretSociety\</span></span>
<span class="sig-name descname"><span class="pre">EnigmaticClass</span></span> <a class="headerlink" href="#secretsociety-enigmaticclass" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\SecretSociety" title="\SecretSociety\EnigmaticClass">
EnigmaticClass
</span>
</span> <a class="headerlink" href="#secretsociety-enigmaticclass" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\SecretSociety\SecretSociety</span> </dd>
</dl>

<p>Unveiling the mysteries of constants!</p>
<dl class="php const">
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/class-with-link/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ <h1>PHP Class with explicit namespace</h1>
<dl class="php class">
<dt class="sig sig-object php" id="typo3-cms-core-test">
<em class="property"><span class="pre">class</span> </em>
<span class="sig-prename descclassname"><span class="pre">\TYPO3\CMS\Core\</span></span>
<span class="sig-name descname"><span class="pre">Test</span></span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
<span class="sig-name descname">
<span class="pre fqn" data-namespace="\TYPO3\CMS\Core" title="\TYPO3\CMS\Core\Test">
Test
</span>
</span> <a class="headerlink" href="#typo3-cms-core-test" title="Permalink to this definition"></a>
</dt>
<dd>
<dl class="field-list simple">
<dt class="field-even">Fully qualified name</dt>
<dd class="field-even">
<span class="pre">\TYPO3\CMS\Core\TYPO3\CMS\Core</span> </dd>
</dl>

<p>Lorem Ipsum Dolor!</p>
<dl class="php method">
Expand Down
Loading

0 comments on commit 7097a01

Please sign in to comment.