예제 #1
0
파일: Array.php 프로젝트: nicmart/building
<?php

/**
 * This file is part of library-template
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author Nicolò Martini <*****@*****.**>
 */
include '../vendor/autoload.php';
use NicMart\Building\Native\ArrayBuilder;
$b = new ArrayBuilder();
$ary = $b->push('a')->push('b')->push()->push('a')->set('foo', 'bar')->set('moo', 'ok')->end()->set('foonode')->set('thomas', 'recording')->push()->push('ciao')->set('foo', 'bar')->end()->end()->end();
var_dump($ary);
예제 #2
0
 public function testSetScope()
 {
     $builder = new ArrayBuilder();
     $ary = $builder->set('foo')->push("fooval")->end()->end();
     $this->assertSame(["foo" => ["fooval"]], $ary);
 }