[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/guzzlehttp/guzzle/src/ -> Utils.php (summary)

Utility methods used throughout Guzzle.

File Size: 215 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 6 functions

  getPath()
  setPath()
  uriTemplate()
  jsonDecode()
  getDefaultUserAgent()
  getDefaultHandler()

Functions
Functions that are not part of a class:

getPath($data, $path)   X-Ref
Gets a value from an array using a path syntax to retrieve nested data.

This method does not allow for keys that contain "/". You must traverse
the array manually or using something more advanced like JMESPath to
work with keys that contain "/".

// Get the bar key of a set of nested arrays.
// This is equivalent to $collection['foo']['baz']['bar'] but won't
// throw warnings for missing keys.
GuzzleHttp\get_path($data, 'foo/baz/bar');

param: array  $data Data to retrieve values from
param: string $path Path to traverse and retrieve a value from
return: mixed|null

setPath(&$data, $path, $value)   X-Ref
Set a value in a nested array key. Keys will be created as needed to set
the value.

This function does not support keys that contain "/" or "[]" characters
because these are special tokens used when traversing the data structure.
A value may be prepended to an existing array by using "[]" as the final
key of a path.

GuzzleHttp\get_path($data, 'foo/baz'); // null
GuzzleHttp\set_path($data, 'foo/baz/[]', 'a');
GuzzleHttp\set_path($data, 'foo/baz/[]', 'b');
GuzzleHttp\get_path($data, 'foo/baz');
// Returns ['a', 'b']

param: array  $data  Data to modify by reference
param: string $path  Path to set
param: mixed  $value Value to set at the key

uriTemplate($template, array $variables)   X-Ref
Expands a URI template

param: string $template  URI template
param: array  $variables Template variables
return: string

jsonDecode($json, $assoc = false, $depth = 512, $options = 0)   X-Ref
Wrapper for JSON decode that implements error detection with helpful
error messages.

param: string $json    JSON data to parse
param: bool $assoc     When true, returned objects will be converted
param: int    $depth   User specified recursion depth.
param: int    $options Bitmask of JSON decode options.
return: mixed

getDefaultUserAgent()   X-Ref
Get the default User-Agent string to use with Guzzle

return: string

getDefaultHandler()   X-Ref
Create a default handler to use based on the environment




Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1