mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-16 23:48:16 +08:00
27 lines
557 B
PHP
27 lines
557 B
PHP
<?php
|
|
|
|
namespace yiiunit\data\helpers;
|
|
|
|
/**
|
|
* CustomDebugInfo serves for the testing of `__debugInfo()` PHP magic method.
|
|
*
|
|
* @see yiiunit\framework\helpers\VarDumperTest
|
|
*/
|
|
class CustomDebugInfo
|
|
{
|
|
public $volume;
|
|
public $unitPrice;
|
|
|
|
/**
|
|
* @see http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo
|
|
*
|
|
* @return array
|
|
*/
|
|
public function __debugInfo()
|
|
{
|
|
return [
|
|
'volume' => $this->volume,
|
|
'totalPrice' => $this->volume * $this->unitPrice,
|
|
];
|
|
}
|
|
} |