Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Yii Framework 2 apidoc extension Change Log
- Bug #311: Support `nikic/php-parser` v5 (mspirkov)
- Bug #324: Raise minimum PHP version to 7.4 (mspirkov)
- Bug #325: Fix deprecation errors `The Default value will become of type Expression by default` (mspirkov)
- Bug #327: Fix deprecation errors `The expression value will become of type Expression by default` (mspirkov)


3.0.7 February 13, 2025
Expand Down
11 changes: 10 additions & 1 deletion models/ConstDoc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand All @@ -19,6 +20,9 @@
class ConstDoc extends BaseDoc
{
public $definedBy;
/**
* @var string|null
*/
public $value;


Expand All @@ -36,6 +40,11 @@ public function __construct($reflector = null, $context = null, $config = [], $d
return;
}

$this->value = $reflector->getValue();
if (PHP_VERSION_ID >= 80100) {
$reflectorValue = $reflector->getValue(false);
$this->value = $reflectorValue !== null ? (string) $reflectorValue : null;
} else {
$this->value = $reflector->getValue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ <h1>Abstract Class yiiunit\apidoc\data\api\animal\Animal</h1>
<a href="index">All Classes</a>
| <a>Properties</a>
| <a>Methods</a>
</div>
| <a>Constants</a>
</div>

<table class="summaryTable docClass table table-bordered">
<colgroup>
Expand Down Expand Up @@ -187,6 +188,55 @@ <h2>Public Methods</h2>

<a></a>

<div class="doc-const summary toggle-target-container">
<h2>Constants</h2>

<p><a class="toggle">Hide inherited constants</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
<col class="col-const">
<col class="col-value">
<col class="col-description">
<col class="col-defined">
</colgroup>
<tr>
<th>Constant</th>
<th>Value</th>
<th>Description</th>
<th>Defined By</th>
</tr>

<tr class="">
<td>COLORS</td>
<td>[
self::COLOR_GREY,
self::COLOR_WHITE,
]</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
<tr class="">
<td>COLOR_GREY</td>
<td>'grey'</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
<tr class="">
<td>COLOR_WHITE</td>
<td>'white'</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
</table>
</div>


<h2>Property Details</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ <h1>Class yiiunit\apidoc\data\api\animal\Cat</h1>
<a href="index">All Classes</a>
| <a>Properties</a>
| <a>Methods</a>
</div>
| <a>Constants</a>
</div>

<table class="summaryTable docClass table table-bordered">
<colgroup>
Expand Down Expand Up @@ -187,6 +188,55 @@ <h2>Public Methods</h2>

<a></a>

<div class="doc-const summary toggle-target-container">
<h2>Constants</h2>

<p><a class="toggle">Hide inherited constants</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
<col class="col-const">
<col class="col-value">
<col class="col-description">
<col class="col-defined">
</colgroup>
<tr>
<th>Constant</th>
<th>Value</th>
<th>Description</th>
<th>Defined By</th>
</tr>

<tr class="inherited">
<td>COLORS</td>
<td>[
self::COLOR_GREY,
self::COLOR_WHITE,
]</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
<tr class="inherited">
<td>COLOR_GREY</td>
<td>'grey'</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
<tr class="inherited">
<td>COLOR_WHITE</td>
<td>'white'</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
</table>
</div>


<h2>Method Details</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ <h1>Class yiiunit\apidoc\data\api\animal\Dog</h1>
<a href="index">All Classes</a>
| <a>Properties</a>
| <a>Methods</a>
</div>
| <a>Constants</a>
</div>

<table class="summaryTable docClass table table-bordered">
<colgroup>
Expand Down Expand Up @@ -182,6 +183,55 @@ <h2>Public Methods</h2>

<a></a>

<div class="doc-const summary toggle-target-container">
<h2>Constants</h2>

<p><a class="toggle">Hide inherited constants</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
<col class="col-const">
<col class="col-value">
<col class="col-description">
<col class="col-defined">
</colgroup>
<tr>
<th>Constant</th>
<th>Value</th>
<th>Description</th>
<th>Defined By</th>
</tr>

<tr class="inherited">
<td>COLORS</td>
<td>[
self::COLOR_GREY,
self::COLOR_WHITE,
]</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
<tr class="inherited">
<td>COLOR_GREY</td>
<td>'grey'</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
<tr class="inherited">
<td>COLOR_WHITE</td>
<td>'white'</td>
<td>

</td>
<td><a href="yiiunit-apidoc-data-api-animal-animal.html">yiiunit\apidoc\data\api\animal\Animal</a></td>
</tr>
</table>
</div>


<h2>Method Details</h2>

Expand Down
8 changes: 8 additions & 0 deletions tests/data/api/animal/Animal.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
*/
abstract class Animal extends BaseObject
{
public const COLOR_GREY = 'grey';
public const COLOR_WHITE = 'white';

public const COLORS = [
self::COLOR_GREY,
self::COLOR_WHITE,
];

/**
* @var string animal name.
*/
Expand Down
Loading