-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Introduce typed PHP constants (#24)
* [BUGFIX] Keyword for PHP constant is "const" We should also output it like that * [FEATURE] Introduce typed PHP constants Depends on #23
- Loading branch information
Showing
5 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tests/integration/class-with-typed-const/expected/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!-- content start --> | ||
<div class="section" id="php-class-with-constants"> | ||
<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> | ||
|
||
</dt> | ||
<dd> | ||
<p>Unveiling the mysteries of constants!</p><dl class="php const"> | ||
<dt class="sig sig-object php" id="pi"> | ||
<span class="sig-name modifier"><span class="pre">public</span></span> | ||
<span class="pre">double</span> <em class="property"><span class="pre">const</span></em> | ||
<span class="sig-name descname"><span class="pre">PI</span></span> | ||
|
||
</dt> | ||
<dd><p>The eternal symbol representing the ratio of a circle's circumference | ||
to its diameter. Also used as the secret handshake among mathematicians.</p></dd> | ||
</dl> | ||
<dl class="php const"> | ||
<dt class="sig sig-object php" id="secret-number"> | ||
<span class="sig-name modifier"><span class="pre">protected</span></span> | ||
<span class="pre">int</span> <em class="property"><span class="pre">const</span></em> | ||
<span class="sig-name descname"><span class="pre">SECRET_NUMBER</span></span> | ||
|
||
</dt> | ||
<dd><p>This constant holds the secret number known only to members of the | ||
EnigmaticClass. Rumor has it, it's the combination to the ultimate | ||
treasure chest.</p></dd> | ||
</dl> | ||
<dl class="php const"> | ||
<dt class="sig sig-object php" id="eternal-flame"> | ||
<span class="sig-name modifier"><span class="pre">private</span></span> | ||
<span class="pre">string</span> <em class="property"><span class="pre">const</span></em> | ||
<span class="sig-name descname"><span class="pre">ETERNAL_FLAME</span></span> | ||
|
||
</dt> | ||
<dd><p>The eternal flame, kept alight by the power of mystical constants. Its | ||
warmth is known only to those who dare to delve into the deepest realms | ||
of code and cryptography.</p></dd> | ||
</dl> | ||
|
||
</dd> | ||
</dl> | ||
|
||
</div> | ||
|
||
<!-- content end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
======================== | ||
PHP class with constants | ||
======================== | ||
|
||
.. php:class:: SecretSociety\EnigmaticClass | ||
Unveiling the mysteries of constants! | ||
|
||
.. php:const:: PI | ||
:public: | ||
:type: double | ||
|
||
The eternal symbol representing the ratio of a circle's circumference | ||
to its diameter. Also used as the secret handshake among mathematicians. | ||
|
||
.. php:const:: SECRET_NUMBER | ||
:protected: | ||
:type: int | ||
|
||
This constant holds the secret number known only to members of the | ||
EnigmaticClass. Rumor has it, it's the combination to the ultimate | ||
treasure chest. | ||
|
||
.. php:const:: ETERNAL_FLAME | ||
:private: | ||
:type: string | ||
|
||
The eternal flame, kept alight by the power of mystical constants. Its | ||
warmth is known only to those who dare to delve into the deepest realms | ||
of code and cryptography. |