PHP Class GraphQL\Utils

Afficher le fichier Open project: webonyx/graphql-php Class Usage Examples

Méthodes publiques

Méthode Description
assign ( object $obj, array $vars, array $requiredKeys = [] ) : array
charCodeAt ( $string, $position ) : mixed Returns UTF-8 char code at given $positing of the $string
chr ( string $ord, string $encoding = 'UTF-8' ) : string UTF-8 compatible chr()
each ( $traversable, callable $fn )
every ( $traversable, callable $predicate ) : boolean
filter ( $traversable, callable $predicate ) : array
find ( array | Traversabl\Traversable $traversable, callable $predicate ) : null
getVariableType ( $var ) : string
groupBy ( $traversable, callable $keyFn ) : array Splits original traversable to several arrays with keys equal to $keyFn return
invariant ( $test, string $message = '' )
keyMap ( $traversable, callable $keyFn ) : array
map ( array | Traversable $traversable, callable $fn ) : array
mapKeyValue ( $traversable, callable $fn ) : array
ord ( string $char, string $encoding = 'UTF-8' ) : mixed UTF-8 compatible ord()
printCharCode ( $code ) : string
printSafe ( $var ) : string
undefined ( )

Method Details

assign() public static méthode

public static assign ( object $obj, array $vars, array $requiredKeys = [] ) : array
$obj object
$vars array
$requiredKeys array
Résultat array

charCodeAt() public static méthode

Returns UTF-8 char code at given $positing of the $string
public static charCodeAt ( $string, $position ) : mixed
$string
$position
Résultat mixed

chr() public static méthode

UTF-8 compatible chr()
public static chr ( string $ord, string $encoding = 'UTF-8' ) : string
$ord string
$encoding string
Résultat string

each() public static méthode

public static each ( $traversable, callable $fn )
$traversable
$fn callable

every() public static méthode

public static every ( $traversable, callable $predicate ) : boolean
$traversable
$predicate callable
Résultat boolean

filter() public static méthode

public static filter ( $traversable, callable $predicate ) : array
$traversable
$predicate callable
Résultat array

find() public static méthode

public static find ( array | Traversabl\Traversable $traversable, callable $predicate ) : null
$traversable array | Traversabl\Traversable
$predicate callable
Résultat null

getVariableType() public static méthode

public static getVariableType ( $var ) : string
$var
Résultat string

groupBy() public static méthode

E.g. Utils::groupBy([1, 2, 3, 4, 5], function($value) {return $value % 3}) will output: [ 1 => [1, 4], 2 => [2, 5], 0 => [3], ] $keyFn is also allowed to return array of keys. Then value will be added to all arrays with given keys
public static groupBy ( $traversable, callable $keyFn ) : array
$traversable
$keyFn callable function($value, $key) => $newKey(s)
Résultat array

invariant() public static méthode

public static invariant ( $test, string $message = '' )
$test
$message string

keyMap() public static méthode

public static keyMap ( $traversable, callable $keyFn ) : array
$traversable
$keyFn callable function($value, $key) => $newKey
Résultat array

map() public static méthode

public static map ( array | Traversable $traversable, callable $fn ) : array
$traversable array | Traversable
$fn callable function($value, $key) => $newValue
Résultat array

mapKeyValue() public static méthode

public static mapKeyValue ( $traversable, callable $fn ) : array
$traversable
$fn callable
Résultat array

ord() public static méthode

UTF-8 compatible ord()
public static ord ( string $char, string $encoding = 'UTF-8' ) : mixed
$char string
$encoding string
Résultat mixed

printCharCode() public static méthode

public static printCharCode ( $code ) : string
$code
Résultat string

printSafe() public static méthode

public static printSafe ( $var ) : string
$var
Résultat string

undefined() public static méthode

public static undefined ( )