src/Schema.php
public function getField($path, $default = null) {
        if (is_string($path)) {
            if (strpos($path, '.') !== false && strpos($path, '/') === false) {
                trigger_error('Field selectors must be separated by "/" instead of "."', E_USER_DEPRECATED);
                $path = explode('.', $path);
            } else {
                $path = explode('/', $path);
            }
        }

        $value = $this->schema;
        foreach ($path as $i => $subKey) {
            if (is_array($value) && isset($value[$subKey])) {
                $value = $value[$subKey];
            } elseif ($value instanceof Schema) {
                return $value->getField(array_slice($path, $i), $default);
            } else {
                return $default;
            }
        }
        return $value;
    }
public function getField($path, $default = null) {
        if (is_string($path)) {
            if (strpos($path, '.') !== false && strpos($path, '/') === false) {
                trigger_error('Field selectors must be separated by "/" instead of "."', E_USER_DEPRECATED);
                $path = explode('.', $path);
            } else {
                $path = explode('/', $path);
            }
        }

        $value = $this->schema;
        foreach ($path as $i => $subKey) {
            if (is_array($value) && isset($value[$subKey])) {
                $value = $value[$subKey];
            } elseif ($value instanceof Schema) {
                return $value->getField(array_slice($path, $i), $default);
            } else {
                return $default;
            }
        }
        return $value;
    }
public function getField ( $ path , $ default = null ) { if ( is_string ( $ path ) ) { if ( strpos ( $ path , '.' ) !== false && strpos ( $ path , '/' ) === false ) { trigger_error ( 'Field selectors must be separated by "/" instead of "."' , E_USER_DEPRECATED ) ; $ path = explode ( '.' , $ path ) ; } else { $ path = explode ( '/' , $ path ) ; } } $ value = $ this -> schema ; foreach ( $ path as $ i => $ subKey ) { if ( is_array ( $ value ) && isset ( $ value [ $ subKey ] ) ) { $ value = $ value [ $ subKey ] ; } elseif ( $ value instanceof Schema ) { return $ value -> getField ( array_slice ( $ path , $ i ) , $ default ) ; } else { return $ default ; } } return $ value ; }
Get a schema field.

@param string|array $path The JSON schema path of the field with parts separated by dots.
@param mixed $default The value to return if the field isn't found.
@return mixed Returns the field value or `$default`.
Get a schema field .