Get a property value by a path of property names or key names.

@param mixed $subject
@param array $path
@param bool $notFoundIsError
@return null

@throws \InvalidArgumentException
513829
public static function getByPath($subject, array $path, $notFoundIsError = true)
    {
        $ptr = & $subject;
        foreach ($path as $key) {
            if (is_object($ptr) && property_exists($ptr, $key)) {
                $ptr = & $ptr->$key;
            } elseif (is_array($ptr) && array_key_exists($key, $ptr)) {
                $ptr = & $ptr[$key];
            } else {
                if ($notFoundIsError === true) {
                    throw new \OutOfBoundsException("Path not found: " . implode('.', $path) . ", key {$key} did not resolve");
                }
                return null;
            }
        }
        return $ptr;
    }
615167
function authorize($subject='',$ondeny=NULL) {
        $f3=\Base::instance();
        if (!$this->granted($route=$f3->VERB.' '.$f3->PATH,$subject) &&
            (!isset($ondeny) || FALSE===$f3->call($ondeny,array($route,$subject)))) {
            $f3->error($subject?403:401);
            return FALSE;
        }
        return TRUE;
    }
178817
public static function getValue($object, $propertyName)
    {
        /**
         * The error container
         *
         * @var \InvalidArgumentException|null $error
         */
        $error = null;

        foreach (self::$providers as $provider) {
            $error = null;
            $value = self::tryGetValue($provider, $object, $propertyName, $error);
            if (is_null($error)) {
                return $value;
            }
        }

        throw $error;
    }
462313
public function normalizeField(
        string $path,
        $object,
        NormalizerContextInterface $context,
        NormalizerInterface $normalizer = null
    ) {
        if (null === $relatedObject = $this->accessor->getValue($object)) {
            return null;
        }

        return $this->identifierAccessor->getValue($relatedObject);
    }
529767
protected function buildIdentificationCriteria(array $subject)
    {
        $criteria = [];

        foreach ($this->identificationFields as $dbField => $subjectField) {
            if (empty($subject[$subjectField])) {
                throw new \InvalidArgumentException(sprintf('Subject must contain a(n) "%s" field', $subjectField));
            }

            if (is_numeric($dbField)) {
                $dbField = $subjectField;
            }

            $criteria[$dbField] = $subject[$subjectField];
        }

        return $criteria;
    }
59777
public function initialize($subject, $callback=null)
    {
        $class = is_string($subject) ? ltrim($subject,'\\') : $subject::className();

        // initialize the object if needed
        if (!isset($this->_schema[$class])) {
            $builder = new \Pheasant\SchemaBuilder($this);
            $initializer = $callback ? $callback : $class.'::initialize';

            $this->events()->trigger('beforeInitialize', $builder);
            call_user_func($initializer, $builder, $this);
            $schema = $builder->build($class);

            $this->_schema[$class] = $schema;
            $this->events()->trigger('afterInitialize', $schema);
        }

        return $class;
    }
211024
protected function getClaimsArray(JWTSubject $subject)
    {
        return array_merge(
            $this->getClaimsForSubject($subject),
            $subject->getJWTCustomClaims(), // custom claims from JWTSubject method
            $this->customClaims // custom claims from inline setter
        );
    }
577070
public function handleArray($path, $subject)
    {
        $set = [];
        foreach ($subject as $subj) {
            $result = $this->resolve($path, $subj);
            if (is_array($result)) {
                $set = array_merge($set, $result);
            } else {
                $set = $result;
            }
        }
        return $set;
    }
1083720
public function getValue(array $array, string $path)
    {
        // If the $path value is empty, return the entire array graph
        if ($this->isRoot($path)) {
            return $array;
        }

        // If $path doesn't exist returns null. It is not possible to distinghuish between a path that exists and has a
        // null value and a path that doesn't exist at all.
        return $this->pa->getValue($array, $path);
    }
949276
public function get(string $path): SplFileInfo
    {
        $path = ltrim($path, '\\/');
        foreach ($this->assets as $asset) {
            if ($asset->getRelativePathname() === $path) {
                return $asset;
            }
        }
        throw new NotFoundHttpException(sprintf('Unknown asset: %s', $path));
    }
1157004
protected function containsObject($subject)
    {
        if (is_object($subject)) {
            return true;
        }
        if (!is_array($subject)) {
            return false;
        }
        foreach ($subject as $value) {
            if ($this->containsObject($value)) {
                return true;
            }
        }
        return false;
    }
1132781
public function childAt($path)
    {
        if (!array_key_exists($path, $this->children)) {
            throw new NotFoundException(sprintf('Could not find child %s in %s', $path, $this->path()));
        }

        return $this->children[$path];
    }
744187
private function removePropertiesFromSubject(array $subject, array $schema): array
    {
        if (isset($schema['properties']) && \is_array($schema['properties'])) {
            $propertyNames = \array_keys($schema['properties']);
            foreach ($propertyNames as $propertyName) {
                if (isset($subject[$propertyName])) {
                    unset($subject[$propertyName]);
                }
            }
        }
        return $subject;
    }
1024131
protected function _notFound($id, Subject $subject)
    {
        $subject->set(['success' => false]);
        $this->_trigger('recordNotFound', $subject);

        $message = $this->message('recordNotFound', compact('id'));
        $exceptionClass = $message['class'];
        throw new $exceptionClass($message['text'], $message['code']);
    }
1259659
public static function getClassAndField($subject, $optional = false)
    {
        /** @var null|SubjectIdentityInterface $subject */
        list($subject, $field) = static::getSubjectAndField($subject, $optional);

        $class = null !== $subject
            ? $subject->getType()
            : null;

        return [$class, $field];
    }
933366
public function normalizeField(
        string $path,
        $object,
        NormalizerContextInterface $context,
        NormalizerInterface $normalizer = null
    ) {
        if (null === $relatedObjects = $this->accessor->getValue($object)) {
            return null;
        }

        $values = [];
        foreach ($relatedObjects as $i => $relatedObject) {
            $values[$i] = $this->identifierAccessor->getValue($relatedObject);
        }

        return $values;
    }
1207109
public function serialize($subject, &$data = array(), SerializerInterface $serializer = null)
    {
        $context = $this->serializer();
        $context($subject, $data, $serializer);
        return $data;
    }