Example #1
0
 /**
  * @param mixed                             $node
  * @param JsonPointerInterface|string|array $pointer
  * @param string                            $currentPath
  *
  * @return Accessor\AccessorInterface
  */
 private function getAccessorForNode($node, $pointer, $currentPath)
 {
     try {
         $accessor = $this->factory->findAccessorForNode($node);
     } catch (NoMatchingAccessorException $exception) {
         throw new InvalidPathException(sprintf('The path %s in %s contains an not supported type: %s', $currentPath, is_array($pointer) ? implode('/', $pointer) : $pointer, gettype($node)), 0, $exception);
     }
     return $accessor;
 }
 protected function setUp()
 {
     $factory = new AccessorFactory(array(new ArrayAccessor()));
     $factory->registerAccessor(new PropertyAccessAccessor(PropertyAccess::createPropertyAccessor()));
     $this->facade = new AccessFacade($factory);
 }