コード例 #1
0
 public function testToArray()
 {
     $testClass = new stdClass();
     $testClass->value1 = 'value one';
     $testClass->array = ['test' => 'test1', 'test'];
     $testClass->nested = new stdClass();
     $testClass->nested->value1 = 'value one';
     $testClass->nested->array = ['test' => 'test1', 'test'];
     $this->assertEquals(['value1' => 'value one', 'array' => ['test' => 'test1', 'test'], 'nested' => ['value1' => 'value one', 'array' => ['test' => 'test1', 'test']]], \Packaged\Helpers\ArrayHelper::toArray($testClass));
 }
コード例 #2
0
ファイル: AbstractApiPayload.php プロジェクト: packaged/api
 /**
  * Retrieve the request data as an array
  *
  * @return array
  */
 public function toArray()
 {
     return ArrayHelper::toArray($this);
 }