-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: bad octal number representation #10369
Comments
Nice catch. |
I do not think apidoc has any chance to detect that the original representation was not decimal but octal... |
If it's |
We can make an exception... |
mode can mean anything depended on the context :) Of course we could hardcode all the places we know in Yii but that could mess up the apidoc generator a bit. |
Could it be exposed in config? |
I am open for ideas on how to solve this, I do not see a good way right now, may reopen it, maybe someone has an idea about it. |
Maybe we can handle it with a special PHPDoc comment? |
This is rough, but it's enough for the problem and suitable for similar situations when you can be sure that this const is used only in special representation. protected static $_specialConsts = [
'509' => '0775',
...
] ;
public function renderConst ($value)
{
if (isset(static::$_specialConsts[(string) $value]) {
return static::$_specialConsts[(string) $value] ;
}
return somedefaultrenderconst($value);
} |
Issue moved to yiisoft/yii2-apidoc#38 |
@hiqsol want to send a PR to apidoc extension? |
That's what we see in docs:
And in the source:
The text was updated successfully, but these errors were encountered: