Exemplo n.º 1
0
 public function readYaml($fullPath)
 {
     if (!file_exists($fullPath)) {
         throw new MaddaException("File {$fullPath} di configurazione inesistente");
     }
     $yaml = new Parser();
     try {
         $parsed = $yaml->parse(file_get_contents($fullPath));
         if (null != $parsed) {
             /* @see https://github.com/bocharsky-bw/Arrayzy#merge*/
             $this->specList = $this->specList->merge($parsed, true);
         }
     } catch (ParseException $e) {
         throw new MaddaException($e->getMessage());
     }
 }
Exemplo n.º 2
0
 /**
  * @dataProvider simpleArrayProvider
  *
  * @param array $array
  */
 public function testMergeRecursively(array $array)
 {
     $secondArray = ['one' => 1, 1 => 'one', 2 => 2];
     $arrayzy = new A($array);
     $resultArrayzy = $arrayzy->merge($secondArray, true);
     $resultArray = array_merge_recursive($array, $secondArray);
     $this->assertImmutable($arrayzy, $resultArrayzy, $array, $resultArray);
 }