@@ -247,7 +247,7 @@ public function renderPropertySignature($property, $context = null)
247247 return '<span class="signature-defs"> ' . implode (' ' , $ definition ) . '</span> '
248248 . '<span class="signature-type"> ' . $ this ->createTypeLink ($ property ->types , $ context ) . '</span> '
249249 . ' ' . $ this ->createSubjectLink ($ property , $ property ->name ) . ' '
250- . ApiMarkdown::highlight ('= ' . ( $ property -> defaultValue === null ? ' null ' : $ property ->defaultValue ), 'php ' );
250+ . ApiMarkdown::highlight ('= ' . $ this -> renderDefaultValue ( $ property ->defaultValue ), 'php ' );
251251 }
252252
253253 /**
@@ -262,7 +262,7 @@ public function renderMethodSignature($method, $context = null)
262262 . ($ param ->isPassedByReference ? '<b>&</b> ' : '' )
263263 . ApiMarkdown::highlight (
264264 $ param ->name
265- . ($ param ->isOptional ? ' = ' . $ param ->defaultValue : '' ),
265+ . ($ param ->isOptional ? ' = ' . $ this -> renderDefaultValue ( $ param ->defaultValue ) : '' ),
266266 'php '
267267 );
268268 }
@@ -283,6 +283,28 @@ public function renderMethodSignature($method, $context = null)
283283 . str_replace (' ' , ' ' , ' ( ' . implode (', ' , $ params ) . ' ) ' );
284284 }
285285
286+ /**
287+ * @param mixed $value
288+ * @return string
289+ */
290+ public function renderDefaultValue ($ value )
291+ {
292+ if ($ value ===null ) {
293+ return 'null ' ;
294+ }
295+
296+ static $ specials = [
297+ '509 ' => '0775 ' ,
298+ '2113696 ' => '0x2040A0 ' ,
299+ '16777215 ' => '0xFFFFFF ' ,
300+ ];
301+ if (isset ($ specials [$ value ])) {
302+ return $ specials [$ value ];
303+ }
304+
305+ return $ value ;
306+ }
307+
286308 /**
287309 * @inheritdoc
288310 */
0 commit comments