repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
39
1.84M
func_code_tokens
sequencelengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
sequencelengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
Badcow/DNS
lib/AlignedBuilder.php
AlignedBuilder.outputLoc
private static function outputLoc(LOC $rdata, int $padding): string { $parts = [ $rdata->getLatitude(LOC::FORMAT_DMS), $rdata->getLongitude(LOC::FORMAT_DMS), sprintf('%.2fm', $rdata->getAltitude()), sprintf('%.2fm', $rdata->getSize()), sprintf('%.2fm', $rdata->getHorizontalPrecision()), sprintf('%.2fm', $rdata->getVerticalPrecision()), ]; $longestVarLength = max(array_map('strlen', $parts)); return self::MULTILINE_BEGIN.PHP_EOL. self::makeLine($rdata->getLatitude(LOC::FORMAT_DMS), 'LATITUDE', $longestVarLength, $padding). self::makeLine($rdata->getLongitude(LOC::FORMAT_DMS), 'LONGITUDE', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getAltitude()), 'ALTITUDE', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getSize()), 'SIZE', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getHorizontalPrecision()), 'HORIZONTAL PRECISION', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getVerticalPrecision()), 'VERTICAL PRECISION', $longestVarLength, $padding). str_repeat(' ', $padding).self::MULTILINE_END; }
php
private static function outputLoc(LOC $rdata, int $padding): string { $parts = [ $rdata->getLatitude(LOC::FORMAT_DMS), $rdata->getLongitude(LOC::FORMAT_DMS), sprintf('%.2fm', $rdata->getAltitude()), sprintf('%.2fm', $rdata->getSize()), sprintf('%.2fm', $rdata->getHorizontalPrecision()), sprintf('%.2fm', $rdata->getVerticalPrecision()), ]; $longestVarLength = max(array_map('strlen', $parts)); return self::MULTILINE_BEGIN.PHP_EOL. self::makeLine($rdata->getLatitude(LOC::FORMAT_DMS), 'LATITUDE', $longestVarLength, $padding). self::makeLine($rdata->getLongitude(LOC::FORMAT_DMS), 'LONGITUDE', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getAltitude()), 'ALTITUDE', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getSize()), 'SIZE', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getHorizontalPrecision()), 'HORIZONTAL PRECISION', $longestVarLength, $padding). self::makeLine(sprintf('%.2fm', $rdata->getVerticalPrecision()), 'VERTICAL PRECISION', $longestVarLength, $padding). str_repeat(' ', $padding).self::MULTILINE_END; }
[ "private", "static", "function", "outputLoc", "(", "LOC", "$", "rdata", ",", "int", "$", "padding", ")", ":", "string", "{", "$", "parts", "=", "[", "$", "rdata", "->", "getLatitude", "(", "LOC", "::", "FORMAT_DMS", ")", ",", "$", "rdata", "->", "getLongitude", "(", "LOC", "::", "FORMAT_DMS", ")", ",", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getAltitude", "(", ")", ")", ",", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getSize", "(", ")", ")", ",", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getHorizontalPrecision", "(", ")", ")", ",", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getVerticalPrecision", "(", ")", ")", ",", "]", ";", "$", "longestVarLength", "=", "max", "(", "array_map", "(", "'strlen'", ",", "$", "parts", ")", ")", ";", "return", "self", "::", "MULTILINE_BEGIN", ".", "PHP_EOL", ".", "self", "::", "makeLine", "(", "$", "rdata", "->", "getLatitude", "(", "LOC", "::", "FORMAT_DMS", ")", ",", "'LATITUDE'", ",", "$", "longestVarLength", ",", "$", "padding", ")", ".", "self", "::", "makeLine", "(", "$", "rdata", "->", "getLongitude", "(", "LOC", "::", "FORMAT_DMS", ")", ",", "'LONGITUDE'", ",", "$", "longestVarLength", ",", "$", "padding", ")", ".", "self", "::", "makeLine", "(", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getAltitude", "(", ")", ")", ",", "'ALTITUDE'", ",", "$", "longestVarLength", ",", "$", "padding", ")", ".", "self", "::", "makeLine", "(", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getSize", "(", ")", ")", ",", "'SIZE'", ",", "$", "longestVarLength", ",", "$", "padding", ")", ".", "self", "::", "makeLine", "(", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getHorizontalPrecision", "(", ")", ")", ",", "'HORIZONTAL PRECISION'", ",", "$", "longestVarLength", ",", "$", "padding", ")", ".", "self", "::", "makeLine", "(", "sprintf", "(", "'%.2fm'", ",", "$", "rdata", "->", "getVerticalPrecision", "(", ")", ")", ",", "'VERTICAL PRECISION'", ",", "$", "longestVarLength", ",", "$", "padding", ")", ".", "str_repeat", "(", "' '", ",", "$", "padding", ")", ".", "self", "::", "MULTILINE_END", ";", "}" ]
@param LOC $rdata @param int $padding @return string
[ "@param", "LOC", "$rdata", "@param", "int", "$padding" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/AlignedBuilder.php#L222-L243
Badcow/DNS
lib/AlignedBuilder.php
AlignedBuilder.makeLine
private static function makeLine(string $text, ?string $comment, int $longestVarLength, int $padding): string { $output = str_repeat(' ', $padding).str_pad($text, $longestVarLength); if (null !== $comment) { $output .= ' '.self::COMMENT_DELIMINATOR.$comment; } return $output.PHP_EOL; }
php
private static function makeLine(string $text, ?string $comment, int $longestVarLength, int $padding): string { $output = str_repeat(' ', $padding).str_pad($text, $longestVarLength); if (null !== $comment) { $output .= ' '.self::COMMENT_DELIMINATOR.$comment; } return $output.PHP_EOL; }
[ "private", "static", "function", "makeLine", "(", "string", "$", "text", ",", "?", "string", "$", "comment", ",", "int", "$", "longestVarLength", ",", "int", "$", "padding", ")", ":", "string", "{", "$", "output", "=", "str_repeat", "(", "' '", ",", "$", "padding", ")", ".", "str_pad", "(", "$", "text", ",", "$", "longestVarLength", ")", ";", "if", "(", "null", "!==", "$", "comment", ")", "{", "$", "output", ".=", "' '", ".", "self", "::", "COMMENT_DELIMINATOR", ".", "$", "comment", ";", "}", "return", "$", "output", ".", "PHP_EOL", ";", "}" ]
Returns a padded line with comment. @param string $text @param string $comment @param int $longestVarLength @param int $padding @return string
[ "Returns", "a", "padded", "line", "with", "comment", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/AlignedBuilder.php#L255-L264
Badcow/DNS
lib/AlignedBuilder.php
AlignedBuilder.getPadding
private static function getPadding(Zone $zone) { $name = $ttl = $type = 0; foreach ($zone as $resourceRecord) { $name = max($name, strlen($resourceRecord->getName())); $ttl = max($ttl, strlen($resourceRecord->getTtl())); $type = max($type, strlen($resourceRecord->getType())); } return [ $name, $ttl, $type, $name + $ttl + $type + 6, ]; }
php
private static function getPadding(Zone $zone) { $name = $ttl = $type = 0; foreach ($zone as $resourceRecord) { $name = max($name, strlen($resourceRecord->getName())); $ttl = max($ttl, strlen($resourceRecord->getTtl())); $type = max($type, strlen($resourceRecord->getType())); } return [ $name, $ttl, $type, $name + $ttl + $type + 6, ]; }
[ "private", "static", "function", "getPadding", "(", "Zone", "$", "zone", ")", "{", "$", "name", "=", "$", "ttl", "=", "$", "type", "=", "0", ";", "foreach", "(", "$", "zone", "as", "$", "resourceRecord", ")", "{", "$", "name", "=", "max", "(", "$", "name", ",", "strlen", "(", "$", "resourceRecord", "->", "getName", "(", ")", ")", ")", ";", "$", "ttl", "=", "max", "(", "$", "ttl", ",", "strlen", "(", "$", "resourceRecord", "->", "getTtl", "(", ")", ")", ")", ";", "$", "type", "=", "max", "(", "$", "type", ",", "strlen", "(", "$", "resourceRecord", "->", "getType", "(", ")", ")", ")", ";", "}", "return", "[", "$", "name", ",", "$", "ttl", ",", "$", "type", ",", "$", "name", "+", "$", "ttl", "+", "$", "type", "+", "6", ",", "]", ";", "}" ]
Get the padding required for a zone. @param Zone $zone @return array Array order: name, ttl, type, rdata
[ "Get", "the", "padding", "required", "for", "a", "zone", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/AlignedBuilder.php#L273-L289
Badcow/DNS
lib/Zone.php
Zone.setName
public function setName(string $name): void { if (!Validator::fullyQualifiedDomainName($name)) { throw new \InvalidArgumentException(sprintf('Zone "%s" is not a fully qualified domain name.', $name)); } $this->name = $name; }
php
public function setName(string $name): void { if (!Validator::fullyQualifiedDomainName($name)) { throw new \InvalidArgumentException(sprintf('Zone "%s" is not a fully qualified domain name.', $name)); } $this->name = $name; }
[ "public", "function", "setName", "(", "string", "$", "name", ")", ":", "void", "{", "if", "(", "!", "Validator", "::", "fullyQualifiedDomainName", "(", "$", "name", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Zone \"%s\" is not a fully qualified domain name.'", ",", "$", "name", ")", ")", ";", "}", "$", "this", "->", "name", "=", "$", "name", ";", "}" ]
@param string $name @throws \InvalidArgumentException
[ "@param", "string", "$name" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Zone.php#L52-L59
Badcow/DNS
lib/Zone.php
Zone.contains
public function contains(ResourceRecord $resourceRecord): bool { foreach ($this->resourceRecords as $_item) { if ($_item === $resourceRecord) { return true; } } return false; }
php
public function contains(ResourceRecord $resourceRecord): bool { foreach ($this->resourceRecords as $_item) { if ($_item === $resourceRecord) { return true; } } return false; }
[ "public", "function", "contains", "(", "ResourceRecord", "$", "resourceRecord", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "resourceRecords", "as", "$", "_item", ")", "{", "if", "(", "$", "_item", "===", "$", "resourceRecord", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
@param ResourceRecord $resourceRecord @return bool
[ "@param", "ResourceRecord", "$resourceRecord" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Zone.php#L148-L157
Badcow/DNS
lib/Zone.php
Zone.remove
public function remove(ResourceRecord $resourceRecord): bool { foreach ($this->resourceRecords as $key => $_item) { if ($_item === $resourceRecord) { unset($this->resourceRecords[$key]); return true; } } return false; }
php
public function remove(ResourceRecord $resourceRecord): bool { foreach ($this->resourceRecords as $key => $_item) { if ($_item === $resourceRecord) { unset($this->resourceRecords[$key]); return true; } } return false; }
[ "public", "function", "remove", "(", "ResourceRecord", "$", "resourceRecord", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "resourceRecords", "as", "$", "key", "=>", "$", "_item", ")", "{", "if", "(", "$", "_item", "===", "$", "resourceRecord", ")", "{", "unset", "(", "$", "this", "->", "resourceRecords", "[", "$", "key", "]", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
@param ResourceRecord $resourceRecord @return bool
[ "@param", "ResourceRecord", "$resourceRecord" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Zone.php#L164-L175
Badcow/DNS
lib/Zone.php
Zone.getClass
public function getClass(): string { foreach ($this->resourceRecords as $resourceRecord) { if (null !== $resourceRecord->getClass()) { return $resourceRecord->getClass(); } } return Classes::INTERNET; }
php
public function getClass(): string { foreach ($this->resourceRecords as $resourceRecord) { if (null !== $resourceRecord->getClass()) { return $resourceRecord->getClass(); } } return Classes::INTERNET; }
[ "public", "function", "getClass", "(", ")", ":", "string", "{", "foreach", "(", "$", "this", "->", "resourceRecords", "as", "$", "resourceRecord", ")", "{", "if", "(", "null", "!==", "$", "resourceRecord", "->", "getClass", "(", ")", ")", "{", "return", "$", "resourceRecord", "->", "getClass", "(", ")", ";", "}", "}", "return", "Classes", "::", "INTERNET", ";", "}" ]
Return the class of the zone, defaults to 'IN'. @return string
[ "Return", "the", "class", "of", "the", "zone", "defaults", "to", "IN", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Zone.php#L182-L191
Badcow/DNS
lib/Rdata/DNSSEC/Algorithms.php
Algorithms.getMnemonic
public static function getMnemonic(int $algorithmId) { if (!array_key_exists($algorithmId, self::$mnemonic)) { throw new \InvalidArgumentException(sprintf('"%d" id not a valid algorithm.', $algorithmId)); } return self::$mnemonic[$algorithmId]; }
php
public static function getMnemonic(int $algorithmId) { if (!array_key_exists($algorithmId, self::$mnemonic)) { throw new \InvalidArgumentException(sprintf('"%d" id not a valid algorithm.', $algorithmId)); } return self::$mnemonic[$algorithmId]; }
[ "public", "static", "function", "getMnemonic", "(", "int", "$", "algorithmId", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "algorithmId", ",", "self", "::", "$", "mnemonic", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'\"%d\" id not a valid algorithm.'", ",", "$", "algorithmId", ")", ")", ";", "}", "return", "self", "::", "$", "mnemonic", "[", "$", "algorithmId", "]", ";", "}" ]
Get the associated mnemonic of an algorithm. @param int $algorithmId @return string @throws \InvalidArgumentException
[ "Get", "the", "associated", "mnemonic", "of", "an", "algorithm", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/DNSSEC/Algorithms.php#L82-L89
Badcow/DNS
lib/Ip/Toolbox.php
Toolbox.expandIpv6
public static function expandIpv6(string $ip): string { if (!Validator::ipv6($ip)) { throw new \InvalidArgumentException(sprintf('"%s" is not a valid IPv6 address.', $ip)); } $hex = unpack('H*hex', inet_pton($ip)); return implode(':', str_split($hex['hex'], 4)); }
php
public static function expandIpv6(string $ip): string { if (!Validator::ipv6($ip)) { throw new \InvalidArgumentException(sprintf('"%s" is not a valid IPv6 address.', $ip)); } $hex = unpack('H*hex', inet_pton($ip)); return implode(':', str_split($hex['hex'], 4)); }
[ "public", "static", "function", "expandIpv6", "(", "string", "$", "ip", ")", ":", "string", "{", "if", "(", "!", "Validator", "::", "ipv6", "(", "$", "ip", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'\"%s\" is not a valid IPv6 address.'", ",", "$", "ip", ")", ")", ";", "}", "$", "hex", "=", "unpack", "(", "'H*hex'", ",", "inet_pton", "(", "$", "ip", ")", ")", ";", "return", "implode", "(", "':'", ",", "str_split", "(", "$", "hex", "[", "'hex'", "]", ",", "4", ")", ")", ";", "}" ]
Expands an IPv6 address to its full, non-shorthand representation. E.g. 2001:db8:9a::42 -> 2001:0db8:009a:0000:0000:0000:0000:0042 @param string $ip IPv6 address @throws \InvalidArgumentException @return string
[ "Expands", "an", "IPv6", "address", "to", "its", "full", "non", "-", "shorthand", "representation", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Ip/Toolbox.php#L29-L38
Badcow/DNS
lib/Ip/Toolbox.php
Toolbox.expandIncompleteIpv6
public static function expandIncompleteIpv6(string $ip): string { $hextets = array_map(function ($hextet) { return str_pad($hextet, 4, '0', STR_PAD_LEFT); }, explode(':', $ip)); return implode(':', $hextets); }
php
public static function expandIncompleteIpv6(string $ip): string { $hextets = array_map(function ($hextet) { return str_pad($hextet, 4, '0', STR_PAD_LEFT); }, explode(':', $ip)); return implode(':', $hextets); }
[ "public", "static", "function", "expandIncompleteIpv6", "(", "string", "$", "ip", ")", ":", "string", "{", "$", "hextets", "=", "array_map", "(", "function", "(", "$", "hextet", ")", "{", "return", "str_pad", "(", "$", "hextet", ",", "4", ",", "'0'", ",", "STR_PAD_LEFT", ")", ";", "}", ",", "explode", "(", "':'", ",", "$", "ip", ")", ")", ";", "return", "implode", "(", "':'", ",", "$", "hextets", ")", ";", "}" ]
This function will expand in incomplete IPv6 address. An incomplete IPv6 address is of the form `2001:db8:ff:abcd` i.e. one where there is less than eight hextets. @param string $ip IPv6 address @return string Expanded incomplete IPv6 address
[ "This", "function", "will", "expand", "in", "incomplete", "IPv6", "address", ".", "An", "incomplete", "IPv6", "address", "is", "of", "the", "form", "2001", ":", "db8", ":", "ff", ":", "abcd", "i", ".", "e", ".", "one", "where", "there", "is", "less", "than", "eight", "hextets", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Ip/Toolbox.php#L49-L56
Badcow/DNS
lib/Ip/Toolbox.php
Toolbox.contractIpv6
public static function contractIpv6(string $ip): string { if (!Validator::ipv6($ip)) { throw new \InvalidArgumentException(sprintf('"%s" is not a valid IPv6 address.', $ip)); } return inet_ntop(inet_pton($ip)); }
php
public static function contractIpv6(string $ip): string { if (!Validator::ipv6($ip)) { throw new \InvalidArgumentException(sprintf('"%s" is not a valid IPv6 address.', $ip)); } return inet_ntop(inet_pton($ip)); }
[ "public", "static", "function", "contractIpv6", "(", "string", "$", "ip", ")", ":", "string", "{", "if", "(", "!", "Validator", "::", "ipv6", "(", "$", "ip", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'\"%s\" is not a valid IPv6 address.'", ",", "$", "ip", ")", ")", ";", "}", "return", "inet_ntop", "(", "inet_pton", "(", "$", "ip", ")", ")", ";", "}" ]
Takes a valid IPv6 address and contracts it to its shorter version. E.g.: 2001:0000:0000:acad:0000:0000:0000:0001 -> 2001:0:0:acad::1 Note: If there is more than one set of consecutive hextets, the function will favour the larger of the sets. If both sets of zeroes are the same the first will be favoured in the omission of zeroes. E.g.: 2001:0000:0000:ab80:2390:0000:0000:000a -> 2001:0:0:ab80:2390::a @param string $ip IPv6 address @throws \InvalidArgumentException @return string Contracted IPv6 address
[ "Takes", "a", "valid", "IPv6", "address", "and", "contracts", "it", "to", "its", "shorter", "version", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Ip/Toolbox.php#L76-L83
Badcow/DNS
lib/Ip/Toolbox.php
Toolbox.reverseIpv4
public static function reverseIpv4(string $ip): string { $octets = array_reverse(explode('.', $ip)); return implode('.', $octets).'.in-addr.arpa.'; }
php
public static function reverseIpv4(string $ip): string { $octets = array_reverse(explode('.', $ip)); return implode('.', $octets).'.in-addr.arpa.'; }
[ "public", "static", "function", "reverseIpv4", "(", "string", "$", "ip", ")", ":", "string", "{", "$", "octets", "=", "array_reverse", "(", "explode", "(", "'.'", ",", "$", "ip", ")", ")", ";", "return", "implode", "(", "'.'", ",", "$", "octets", ")", ".", "'.in-addr.arpa.'", ";", "}" ]
Creates a reverse IPv4 address. E.g. 192.168.1.213 -> 213.1.168.192.in-addr.arpa. @param string $ip Valid IPv4 address @return string Reversed IP address appended with ".in-addr.arpa."
[ "Creates", "a", "reverse", "IPv4", "address", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Ip/Toolbox.php#L94-L99
Badcow/DNS
lib/Ip/Toolbox.php
Toolbox.reverseIpv6
public static function reverseIpv6(string $ip, bool $appendSuffix = true): string { try { $ip = self::expandIpv6($ip); } catch (\InvalidArgumentException $e) { $ip = self::expandIncompleteIpv6($ip); } $ip = str_replace(':', '', $ip); $ip = strrev($ip); $ip = implode('.', str_split($ip)); $ip .= $appendSuffix ? '.ip6.arpa.' : ''; return $ip; }
php
public static function reverseIpv6(string $ip, bool $appendSuffix = true): string { try { $ip = self::expandIpv6($ip); } catch (\InvalidArgumentException $e) { $ip = self::expandIncompleteIpv6($ip); } $ip = str_replace(':', '', $ip); $ip = strrev($ip); $ip = implode('.', str_split($ip)); $ip .= $appendSuffix ? '.ip6.arpa.' : ''; return $ip; }
[ "public", "static", "function", "reverseIpv6", "(", "string", "$", "ip", ",", "bool", "$", "appendSuffix", "=", "true", ")", ":", "string", "{", "try", "{", "$", "ip", "=", "self", "::", "expandIpv6", "(", "$", "ip", ")", ";", "}", "catch", "(", "\\", "InvalidArgumentException", "$", "e", ")", "{", "$", "ip", "=", "self", "::", "expandIncompleteIpv6", "(", "$", "ip", ")", ";", "}", "$", "ip", "=", "str_replace", "(", "':'", ",", "''", ",", "$", "ip", ")", ";", "$", "ip", "=", "strrev", "(", "$", "ip", ")", ";", "$", "ip", "=", "implode", "(", "'.'", ",", "str_split", "(", "$", "ip", ")", ")", ";", "$", "ip", ".=", "$", "appendSuffix", "?", "'.ip6.arpa.'", ":", "''", ";", "return", "$", "ip", ";", "}" ]
Creates a reverse IPv6 address. E.g. 2001:db8::567:89ab -> b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. @param string $ip A full or partial IPv6 address @param bool $appendSuffix Whether or not to append ".ip6.arpa.' suffix. @return string The reversed address appended with ".ip6.arpa."
[ "Creates", "a", "reverse", "IPv6", "address", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Ip/Toolbox.php#L111-L125
Badcow/DNS
lib/Rdata/DNSSEC/DS.php
DS.output
public function output(): string { return sprintf( '%s %s %s %s', $this->keyTag, $this->algorithm, $this->digestType, $this->digest ); }
php
public function output(): string { return sprintf( '%s %s %s %s', $this->keyTag, $this->algorithm, $this->digestType, $this->digest ); }
[ "public", "function", "output", "(", ")", ":", "string", "{", "return", "sprintf", "(", "'%s %s %s %s'", ",", "$", "this", "->", "keyTag", ",", "$", "this", "->", "algorithm", ",", "$", "this", "->", "digestType", ",", "$", "this", "->", "digest", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/DNSSEC/DS.php#L116-L125
Badcow/DNS
lib/Parser/ParseException.php
ParseException.getLineNumber
private function getLineNumber(): int { $pos = $this->stringIterator->key(); $this->stringIterator->rewind(); $lineNo = 1; while ($this->stringIterator->key() < $pos) { if ($this->stringIterator->is(Tokens::LINE_FEED)) { ++$lineNo; } $this->stringIterator->next(); } return $lineNo; }
php
private function getLineNumber(): int { $pos = $this->stringIterator->key(); $this->stringIterator->rewind(); $lineNo = 1; while ($this->stringIterator->key() < $pos) { if ($this->stringIterator->is(Tokens::LINE_FEED)) { ++$lineNo; } $this->stringIterator->next(); } return $lineNo; }
[ "private", "function", "getLineNumber", "(", ")", ":", "int", "{", "$", "pos", "=", "$", "this", "->", "stringIterator", "->", "key", "(", ")", ";", "$", "this", "->", "stringIterator", "->", "rewind", "(", ")", ";", "$", "lineNo", "=", "1", ";", "while", "(", "$", "this", "->", "stringIterator", "->", "key", "(", ")", "<", "$", "pos", ")", "{", "if", "(", "$", "this", "->", "stringIterator", "->", "is", "(", "Tokens", "::", "LINE_FEED", ")", ")", "{", "++", "$", "lineNo", ";", "}", "$", "this", "->", "stringIterator", "->", "next", "(", ")", ";", "}", "return", "$", "lineNo", ";", "}" ]
Get line number of current entry on the StringIterator. @return int
[ "Get", "line", "number", "of", "current", "entry", "on", "the", "StringIterator", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/ParseException.php#L43-L57
Badcow/DNS
lib/Rdata/SOA.php
SOA.output
public function output(): string { return sprintf( '%s %s %s %s %s %s %s', $this->mname, $this->rname, $this->serial, $this->refresh, $this->retry, $this->expire, $this->minimum ); }
php
public function output(): string { return sprintf( '%s %s %s %s %s %s %s', $this->mname, $this->rname, $this->serial, $this->refresh, $this->retry, $this->expire, $this->minimum ); }
[ "public", "function", "output", "(", ")", ":", "string", "{", "return", "sprintf", "(", "'%s %s %s %s %s %s %s'", ",", "$", "this", "->", "mname", ",", "$", "this", "->", "rname", ",", "$", "this", "->", "serial", ",", "$", "this", "->", "refresh", ",", "$", "this", "->", "retry", ",", "$", "this", "->", "expire", ",", "$", "this", "->", "minimum", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/SOA.php#L195-L207
Badcow/DNS
lib/Rdata/DNSSEC/DNSKEY.php
DNSKEY.output
public function output(): string { return sprintf( '%s %s %s %s', $this->flags, $this->protocol, $this->algorithm, $this->publicKey ); }
php
public function output(): string { return sprintf( '%s %s %s %s', $this->flags, $this->protocol, $this->algorithm, $this->publicKey ); }
[ "public", "function", "output", "(", ")", ":", "string", "{", "return", "sprintf", "(", "'%s %s %s %s'", ",", "$", "this", "->", "flags", ",", "$", "this", "->", "protocol", ",", "$", "this", "->", "algorithm", ",", "$", "this", "->", "publicKey", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/DNSSEC/DNSKEY.php#L122-L131
Badcow/DNS
lib/Rdata/SRV.php
SRV.setPriority
public function setPriority(int $priority): void { if ($priority < 0 || $priority > static::MAX_PRIORITY) { throw new \InvalidArgumentException('Priority must be an unsigned integer on the range [0-65535]'); } $this->priority = $priority; }
php
public function setPriority(int $priority): void { if ($priority < 0 || $priority > static::MAX_PRIORITY) { throw new \InvalidArgumentException('Priority must be an unsigned integer on the range [0-65535]'); } $this->priority = $priority; }
[ "public", "function", "setPriority", "(", "int", "$", "priority", ")", ":", "void", "{", "if", "(", "$", "priority", "<", "0", "||", "$", "priority", ">", "static", "::", "MAX_PRIORITY", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Priority must be an unsigned integer on the range [0-65535]'", ")", ";", "}", "$", "this", "->", "priority", "=", "$", "priority", ";", "}" ]
@param int $priority @throws \InvalidArgumentException
[ "@param", "int", "$priority" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/SRV.php#L74-L81
Badcow/DNS
lib/Rdata/SRV.php
SRV.setWeight
public function setWeight(int $weight): void { if ($weight < 0 || $weight > static::MAX_WEIGHT) { throw new \InvalidArgumentException('Weight must be an unsigned integer on the range [0-65535]'); } $this->weight = $weight; }
php
public function setWeight(int $weight): void { if ($weight < 0 || $weight > static::MAX_WEIGHT) { throw new \InvalidArgumentException('Weight must be an unsigned integer on the range [0-65535]'); } $this->weight = $weight; }
[ "public", "function", "setWeight", "(", "int", "$", "weight", ")", ":", "void", "{", "if", "(", "$", "weight", "<", "0", "||", "$", "weight", ">", "static", "::", "MAX_WEIGHT", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Weight must be an unsigned integer on the range [0-65535]'", ")", ";", "}", "$", "this", "->", "weight", "=", "$", "weight", ";", "}" ]
@param int $weight @throws \InvalidArgumentException
[ "@param", "int", "$weight" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/SRV.php#L96-L103
Badcow/DNS
lib/Rdata/SRV.php
SRV.setPort
public function setPort(int $port): void { if ($port < 0 || $port > static::HIGHEST_PORT) { throw new \InvalidArgumentException('Port must be an unsigned integer on the range [0-65535]'); } $this->port = $port; }
php
public function setPort(int $port): void { if ($port < 0 || $port > static::HIGHEST_PORT) { throw new \InvalidArgumentException('Port must be an unsigned integer on the range [0-65535]'); } $this->port = $port; }
[ "public", "function", "setPort", "(", "int", "$", "port", ")", ":", "void", "{", "if", "(", "$", "port", "<", "0", "||", "$", "port", ">", "static", "::", "HIGHEST_PORT", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Port must be an unsigned integer on the range [0-65535]'", ")", ";", "}", "$", "this", "->", "port", "=", "$", "port", ";", "}" ]
@param int $port @throws \InvalidArgumentException
[ "@param", "int", "$port" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/SRV.php#L118-L125
Badcow/DNS
lib/Rdata/SRV.php
SRV.output
public function output(): string { return sprintf('%s %s %s %s', $this->priority, $this->weight, $this->port, $this->target ); }
php
public function output(): string { return sprintf('%s %s %s %s', $this->priority, $this->weight, $this->port, $this->target ); }
[ "public", "function", "output", "(", ")", ":", "string", "{", "return", "sprintf", "(", "'%s %s %s %s'", ",", "$", "this", "->", "priority", ",", "$", "this", "->", "weight", ",", "$", "this", "->", "port", ",", "$", "this", "->", "target", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/SRV.php#L130-L138
Badcow/DNS
lib/Rdata/CAA.php
CAA.setFlag
public function setFlag(int $flag): void { if ($flag < 0 || $flag > static::MAX_FLAG) { throw new \InvalidArgumentException('Flag must be an unsigned integer on the range [0-255]'); } $this->flag = $flag; }
php
public function setFlag(int $flag): void { if ($flag < 0 || $flag > static::MAX_FLAG) { throw new \InvalidArgumentException('Flag must be an unsigned integer on the range [0-255]'); } $this->flag = $flag; }
[ "public", "function", "setFlag", "(", "int", "$", "flag", ")", ":", "void", "{", "if", "(", "$", "flag", "<", "0", "||", "$", "flag", ">", "static", "::", "MAX_FLAG", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Flag must be an unsigned integer on the range [0-255]'", ")", ";", "}", "$", "this", "->", "flag", "=", "$", "flag", ";", "}" ]
@param int $flag @throws \InvalidArgumentException
[ "@param", "int", "$flag" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/CAA.php#L75-L82
Badcow/DNS
lib/Rdata/CAA.php
CAA.setTag
public function setTag(string $tag): void { if (!in_array($tag, static::ALLOWED_TAGS)) { throw new \InvalidArgumentException('Tag can be one of this type '.implode(' ', static::ALLOWED_TAGS)); } $this->tag = $tag; }
php
public function setTag(string $tag): void { if (!in_array($tag, static::ALLOWED_TAGS)) { throw new \InvalidArgumentException('Tag can be one of this type '.implode(' ', static::ALLOWED_TAGS)); } $this->tag = $tag; }
[ "public", "function", "setTag", "(", "string", "$", "tag", ")", ":", "void", "{", "if", "(", "!", "in_array", "(", "$", "tag", ",", "static", "::", "ALLOWED_TAGS", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Tag can be one of this type '", ".", "implode", "(", "' '", ",", "static", "::", "ALLOWED_TAGS", ")", ")", ";", "}", "$", "this", "->", "tag", "=", "$", "tag", ";", "}" ]
@param string $tag @throws \InvalidArgumentException
[ "@param", "string", "$tag" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/CAA.php#L97-L104
Badcow/DNS
lib/Parser/RdataHandlers.php
RdataHandlers.dmsToDecimal
public static function dmsToDecimal(int $deg, int $min, float $sec, string $hemisphere): float { $multiplier = ('S' === $hemisphere || 'W' === $hemisphere) ? -1 : 1; return $multiplier * ($deg + ($min / 60) + ($sec / 3600)); }
php
public static function dmsToDecimal(int $deg, int $min, float $sec, string $hemisphere): float { $multiplier = ('S' === $hemisphere || 'W' === $hemisphere) ? -1 : 1; return $multiplier * ($deg + ($min / 60) + ($sec / 3600)); }
[ "public", "static", "function", "dmsToDecimal", "(", "int", "$", "deg", ",", "int", "$", "min", ",", "float", "$", "sec", ",", "string", "$", "hemisphere", ")", ":", "float", "{", "$", "multiplier", "=", "(", "'S'", "===", "$", "hemisphere", "||", "'W'", "===", "$", "hemisphere", ")", "?", "-", "1", ":", "1", ";", "return", "$", "multiplier", "*", "(", "$", "deg", "+", "(", "$", "min", "/", "60", ")", "+", "(", "$", "sec", "/", "3600", ")", ")", ";", "}" ]
Transform a DMS string to a decimal representation. Used for LOC records. @param int $deg Degrees @param int $min Minutes @param float $sec Seconds @param string $hemisphere Either 'N', 'S', 'E', or 'W' @return float
[ "Transform", "a", "DMS", "string", "to", "a", "decimal", "representation", ".", "Used", "for", "LOC", "records", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/RdataHandlers.php#L48-L53
Badcow/DNS
lib/Parser/RdataHandlers.php
RdataHandlers.handleLocRdata
public static function handleLocRdata(\ArrayIterator $iterator): Rdata\LOC { $lat = self::dmsToDecimal((int) self::pop($iterator), (int) self::pop($iterator), (float) self::pop($iterator), self::pop($iterator)); $lon = self::dmsToDecimal((int) self::pop($iterator), (int) self::pop($iterator), (float) self::pop($iterator), self::pop($iterator)); return Rdata\Factory::Loc( $lat, $lon, (float) self::pop($iterator), (float) self::pop($iterator), (float) self::pop($iterator), (float) self::pop($iterator) ); }
php
public static function handleLocRdata(\ArrayIterator $iterator): Rdata\LOC { $lat = self::dmsToDecimal((int) self::pop($iterator), (int) self::pop($iterator), (float) self::pop($iterator), self::pop($iterator)); $lon = self::dmsToDecimal((int) self::pop($iterator), (int) self::pop($iterator), (float) self::pop($iterator), self::pop($iterator)); return Rdata\Factory::Loc( $lat, $lon, (float) self::pop($iterator), (float) self::pop($iterator), (float) self::pop($iterator), (float) self::pop($iterator) ); }
[ "public", "static", "function", "handleLocRdata", "(", "\\", "ArrayIterator", "$", "iterator", ")", ":", "Rdata", "\\", "LOC", "{", "$", "lat", "=", "self", "::", "dmsToDecimal", "(", "(", "int", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "(", "int", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "(", "float", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "self", "::", "pop", "(", "$", "iterator", ")", ")", ";", "$", "lon", "=", "self", "::", "dmsToDecimal", "(", "(", "int", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "(", "int", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "(", "float", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "self", "::", "pop", "(", "$", "iterator", ")", ")", ";", "return", "Rdata", "\\", "Factory", "::", "Loc", "(", "$", "lat", ",", "$", "lon", ",", "(", "float", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "(", "float", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "(", "float", ")", "self", "::", "pop", "(", "$", "iterator", ")", ",", "(", "float", ")", "self", "::", "pop", "(", "$", "iterator", ")", ")", ";", "}" ]
@param \ArrayIterator $iterator @return Rdata\LOC
[ "@param", "\\", "ArrayIterator", "$iterator" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/RdataHandlers.php#L60-L73
Badcow/DNS
lib/Parser/RdataHandlers.php
RdataHandlers.handleAplRdata
public static function handleAplRdata(\ArrayIterator $iterator): Rdata\APL { $rdata = new Rdata\APL(); while ($iterator->valid()) { $matches = []; if (1 !== preg_match('/^(?<negate>!)?[1-2]:(?<block>.+)$/i', $iterator->current(), $matches)) { throw new ParseException(sprintf('"%s" is not a valid IP range.', $iterator->current())); } $ipBlock = \IPBlock::create($matches['block']); $rdata->addAddressRange($ipBlock, '!' !== $matches['negate']); $iterator->next(); } return $rdata; }
php
public static function handleAplRdata(\ArrayIterator $iterator): Rdata\APL { $rdata = new Rdata\APL(); while ($iterator->valid()) { $matches = []; if (1 !== preg_match('/^(?<negate>!)?[1-2]:(?<block>.+)$/i', $iterator->current(), $matches)) { throw new ParseException(sprintf('"%s" is not a valid IP range.', $iterator->current())); } $ipBlock = \IPBlock::create($matches['block']); $rdata->addAddressRange($ipBlock, '!' !== $matches['negate']); $iterator->next(); } return $rdata; }
[ "public", "static", "function", "handleAplRdata", "(", "\\", "ArrayIterator", "$", "iterator", ")", ":", "Rdata", "\\", "APL", "{", "$", "rdata", "=", "new", "Rdata", "\\", "APL", "(", ")", ";", "while", "(", "$", "iterator", "->", "valid", "(", ")", ")", "{", "$", "matches", "=", "[", "]", ";", "if", "(", "1", "!==", "preg_match", "(", "'/^(?<negate>!)?[1-2]:(?<block>.+)$/i'", ",", "$", "iterator", "->", "current", "(", ")", ",", "$", "matches", ")", ")", "{", "throw", "new", "ParseException", "(", "sprintf", "(", "'\"%s\" is not a valid IP range.'", ",", "$", "iterator", "->", "current", "(", ")", ")", ")", ";", "}", "$", "ipBlock", "=", "\\", "IPBlock", "::", "create", "(", "$", "matches", "[", "'block'", "]", ")", ";", "$", "rdata", "->", "addAddressRange", "(", "$", "ipBlock", ",", "'!'", "!==", "$", "matches", "[", "'negate'", "]", ")", ";", "$", "iterator", "->", "next", "(", ")", ";", "}", "return", "$", "rdata", ";", "}" ]
@param \ArrayIterator $iterator @return Rdata\APL @throws ParseException
[ "@param", "\\", "ArrayIterator", "$iterator" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/RdataHandlers.php#L82-L98
Badcow/DNS
lib/Parser/RdataHandlers.php
RdataHandlers.handleTxtRdata
public static function handleTxtRdata(\ArrayIterator $iterator): Rdata\TXT { $string = new StringIterator(implode(Tokens::SPACE, self::getAllRemaining($iterator))); $txt = new StringIterator(); while ($string->valid()) { self::handleTxt($string, $txt); $string->next(); } return Rdata\Factory::txt((string) $txt); }
php
public static function handleTxtRdata(\ArrayIterator $iterator): Rdata\TXT { $string = new StringIterator(implode(Tokens::SPACE, self::getAllRemaining($iterator))); $txt = new StringIterator(); while ($string->valid()) { self::handleTxt($string, $txt); $string->next(); } return Rdata\Factory::txt((string) $txt); }
[ "public", "static", "function", "handleTxtRdata", "(", "\\", "ArrayIterator", "$", "iterator", ")", ":", "Rdata", "\\", "TXT", "{", "$", "string", "=", "new", "StringIterator", "(", "implode", "(", "Tokens", "::", "SPACE", ",", "self", "::", "getAllRemaining", "(", "$", "iterator", ")", ")", ")", ";", "$", "txt", "=", "new", "StringIterator", "(", ")", ";", "while", "(", "$", "string", "->", "valid", "(", ")", ")", "{", "self", "::", "handleTxt", "(", "$", "string", ",", "$", "txt", ")", ";", "$", "string", "->", "next", "(", ")", ";", "}", "return", "Rdata", "\\", "Factory", "::", "txt", "(", "(", "string", ")", "$", "txt", ")", ";", "}" ]
@param \ArrayIterator $iterator @return Rdata\TXT
[ "@param", "\\", "ArrayIterator", "$iterator" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/RdataHandlers.php#L105-L116
Badcow/DNS
lib/Parser/RdataHandlers.php
RdataHandlers.catchAll
public static function catchAll(string $type, \ArrayIterator $iterator): Rdata\RdataInterface { if (!Rdata\Factory::isTypeImplemented($type)) { return new Rdata\PolymorphicRdata($type, implode(Tokens::SPACE, self::getAllRemaining($iterator))); } return call_user_func_array([Rdata\Factory::class, $type], self::getAllRemaining($iterator)); }
php
public static function catchAll(string $type, \ArrayIterator $iterator): Rdata\RdataInterface { if (!Rdata\Factory::isTypeImplemented($type)) { return new Rdata\PolymorphicRdata($type, implode(Tokens::SPACE, self::getAllRemaining($iterator))); } return call_user_func_array([Rdata\Factory::class, $type], self::getAllRemaining($iterator)); }
[ "public", "static", "function", "catchAll", "(", "string", "$", "type", ",", "\\", "ArrayIterator", "$", "iterator", ")", ":", "Rdata", "\\", "RdataInterface", "{", "if", "(", "!", "Rdata", "\\", "Factory", "::", "isTypeImplemented", "(", "$", "type", ")", ")", "{", "return", "new", "Rdata", "\\", "PolymorphicRdata", "(", "$", "type", ",", "implode", "(", "Tokens", "::", "SPACE", ",", "self", "::", "getAllRemaining", "(", "$", "iterator", ")", ")", ")", ";", "}", "return", "call_user_func_array", "(", "[", "Rdata", "\\", "Factory", "::", "class", ",", "$", "type", "]", ",", "self", "::", "getAllRemaining", "(", "$", "iterator", ")", ")", ";", "}" ]
Returns RData instances for types that do not have explicitly declared handler methods. @param string $type @param \ArrayIterator $iterator @return Rdata\RdataInterface
[ "Returns", "RData", "instances", "for", "types", "that", "do", "not", "have", "explicitly", "declared", "handler", "methods", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/RdataHandlers.php#L141-L148
Badcow/DNS
lib/Parser/RdataHandlers.php
RdataHandlers.pop
private static function pop(\ArrayIterator $iterator): string { $current = $iterator->current(); $iterator->next(); return $current; }
php
private static function pop(\ArrayIterator $iterator): string { $current = $iterator->current(); $iterator->next(); return $current; }
[ "private", "static", "function", "pop", "(", "\\", "ArrayIterator", "$", "iterator", ")", ":", "string", "{", "$", "current", "=", "$", "iterator", "->", "current", "(", ")", ";", "$", "iterator", "->", "next", "(", ")", ";", "return", "$", "current", ";", "}" ]
Return current entry and moves the iterator to the next entry. @param \ArrayIterator $iterator @return string
[ "Return", "current", "entry", "and", "moves", "the", "iterator", "to", "the", "next", "entry", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/RdataHandlers.php#L179-L185
Badcow/DNS
lib/Parser/RdataHandlers.php
RdataHandlers.getAllRemaining
private static function getAllRemaining(\ArrayIterator $iterator): array { $values = []; while ($iterator->valid()) { $values[] = $iterator->current(); $iterator->next(); } return $values; }
php
private static function getAllRemaining(\ArrayIterator $iterator): array { $values = []; while ($iterator->valid()) { $values[] = $iterator->current(); $iterator->next(); } return $values; }
[ "private", "static", "function", "getAllRemaining", "(", "\\", "ArrayIterator", "$", "iterator", ")", ":", "array", "{", "$", "values", "=", "[", "]", ";", "while", "(", "$", "iterator", "->", "valid", "(", ")", ")", "{", "$", "values", "[", "]", "=", "$", "iterator", "->", "current", "(", ")", ";", "$", "iterator", "->", "next", "(", ")", ";", "}", "return", "$", "values", ";", "}" ]
Get all the remaining values of an iterator as an array. @param \ArrayIterator $iterator @return array
[ "Get", "all", "the", "remaining", "values", "of", "an", "iterator", "as", "an", "array", "." ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Parser/RdataHandlers.php#L194-L203
Badcow/DNS
lib/Rdata/APL.php
APL.output
public function output(): string { $string = ''; foreach ($this->includedAddressRanges as $ipBlock) { $string .= (4 === $ipBlock->getVersion()) ? '1:' : '2:'; $string .= (string) $ipBlock.' '; } foreach ($this->excludedAddressRanges as $ipBlock) { $string .= (4 === $ipBlock->getVersion()) ? '!1:' : '!2:'; $string .= (string) $ipBlock.' '; } return rtrim($string, ' '); }
php
public function output(): string { $string = ''; foreach ($this->includedAddressRanges as $ipBlock) { $string .= (4 === $ipBlock->getVersion()) ? '1:' : '2:'; $string .= (string) $ipBlock.' '; } foreach ($this->excludedAddressRanges as $ipBlock) { $string .= (4 === $ipBlock->getVersion()) ? '!1:' : '!2:'; $string .= (string) $ipBlock.' '; } return rtrim($string, ' '); }
[ "public", "function", "output", "(", ")", ":", "string", "{", "$", "string", "=", "''", ";", "foreach", "(", "$", "this", "->", "includedAddressRanges", "as", "$", "ipBlock", ")", "{", "$", "string", ".=", "(", "4", "===", "$", "ipBlock", "->", "getVersion", "(", ")", ")", "?", "'1:'", ":", "'2:'", ";", "$", "string", ".=", "(", "string", ")", "$", "ipBlock", ".", "' '", ";", "}", "foreach", "(", "$", "this", "->", "excludedAddressRanges", "as", "$", "ipBlock", ")", "{", "$", "string", ".=", "(", "4", "===", "$", "ipBlock", "->", "getVersion", "(", ")", ")", "?", "'!1:'", ":", "'!2:'", ";", "$", "string", ".=", "(", "string", ")", "$", "ipBlock", ".", "' '", ";", "}", "return", "rtrim", "(", "$", "string", ",", "' '", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/Badcow/DNS/blob/56e4456993cd92b5fa1dc29656d9e81fc8d4a9b7/lib/Rdata/APL.php#L66-L80
dannyvankooten/AltoRouter
AltoRouter.php
AltoRouter.match
public function match($requestUrl = null, $requestMethod = null) { $params = array(); $match = false; // set Request Url if it isn't passed as parameter if($requestUrl === null) { $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'; } // strip base path from request url $requestUrl = substr($requestUrl, strlen($this->basePath)); // Strip query string (?a=b) from Request Url if (($strpos = strpos($requestUrl, '?')) !== false) { $requestUrl = substr($requestUrl, 0, $strpos); } // set Request Method if it isn't passed as a parameter if($requestMethod === null) { $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; } foreach($this->routes as $handler) { list($methods, $route, $target, $name) = $handler; $method_match = (stripos($methods, $requestMethod) !== false); // Method did not match, continue to next route. if (!$method_match) continue; if ($route === '*') { // * wildcard (matches all) $match = true; } elseif (isset($route[0]) && $route[0] === '@') { // @ regex delimiter $pattern = '`' . substr($route, 1) . '`u'; $match = preg_match($pattern, $requestUrl, $params) === 1; } elseif (($position = strpos($route, '[')) === false) { // No params in url, do string comparison $match = strcmp($requestUrl, $route) === 0; } else { // Compare longest non-param string with url if (strncmp($requestUrl, $route, $position) !== 0) { continue; } $regex = $this->compileRoute($route); $match = preg_match($regex, $requestUrl, $params) === 1; } if ($match) { if ($params) { foreach($params as $key => $value) { if(is_numeric($key)) unset($params[$key]); } } return array( 'target' => $target, 'params' => $params, 'name' => $name ); } } return false; }
php
public function match($requestUrl = null, $requestMethod = null) { $params = array(); $match = false; if($requestUrl === null) { $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'; } $requestUrl = substr($requestUrl, strlen($this->basePath)); if (($strpos = strpos($requestUrl, '?')) !== false) { $requestUrl = substr($requestUrl, 0, $strpos); } if($requestMethod === null) { $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; } foreach($this->routes as $handler) { list($methods, $route, $target, $name) = $handler; $method_match = (stripos($methods, $requestMethod) !== false); if (!$method_match) continue; if ($route === '*') { $match = true; } elseif (isset($route[0]) && $route[0] === '@') { $pattern = '`' . substr($route, 1) . '`u'; $match = preg_match($pattern, $requestUrl, $params) === 1; } elseif (($position = strpos($route, '[')) === false) { $match = strcmp($requestUrl, $route) === 0; } else { if (strncmp($requestUrl, $route, $position) !== 0) { continue; } $regex = $this->compileRoute($route); $match = preg_match($regex, $requestUrl, $params) === 1; } if ($match) { if ($params) { foreach($params as $key => $value) { if(is_numeric($key)) unset($params[$key]); } } return array( 'target' => $target, 'params' => $params, 'name' => $name ); } } return false; }
[ "public", "function", "match", "(", "$", "requestUrl", "=", "null", ",", "$", "requestMethod", "=", "null", ")", "{", "$", "params", "=", "array", "(", ")", ";", "$", "match", "=", "false", ";", "// set Request Url if it isn't passed as parameter", "if", "(", "$", "requestUrl", "===", "null", ")", "{", "$", "requestUrl", "=", "isset", "(", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ")", "?", "$", "_SERVER", "[", "'REQUEST_URI'", "]", ":", "'/'", ";", "}", "// strip base path from request url", "$", "requestUrl", "=", "substr", "(", "$", "requestUrl", ",", "strlen", "(", "$", "this", "->", "basePath", ")", ")", ";", "// Strip query string (?a=b) from Request Url", "if", "(", "(", "$", "strpos", "=", "strpos", "(", "$", "requestUrl", ",", "'?'", ")", ")", "!==", "false", ")", "{", "$", "requestUrl", "=", "substr", "(", "$", "requestUrl", ",", "0", ",", "$", "strpos", ")", ";", "}", "// set Request Method if it isn't passed as a parameter", "if", "(", "$", "requestMethod", "===", "null", ")", "{", "$", "requestMethod", "=", "isset", "(", "$", "_SERVER", "[", "'REQUEST_METHOD'", "]", ")", "?", "$", "_SERVER", "[", "'REQUEST_METHOD'", "]", ":", "'GET'", ";", "}", "foreach", "(", "$", "this", "->", "routes", "as", "$", "handler", ")", "{", "list", "(", "$", "methods", ",", "$", "route", ",", "$", "target", ",", "$", "name", ")", "=", "$", "handler", ";", "$", "method_match", "=", "(", "stripos", "(", "$", "methods", ",", "$", "requestMethod", ")", "!==", "false", ")", ";", "// Method did not match, continue to next route.", "if", "(", "!", "$", "method_match", ")", "continue", ";", "if", "(", "$", "route", "===", "'*'", ")", "{", "// * wildcard (matches all)", "$", "match", "=", "true", ";", "}", "elseif", "(", "isset", "(", "$", "route", "[", "0", "]", ")", "&&", "$", "route", "[", "0", "]", "===", "'@'", ")", "{", "// @ regex delimiter", "$", "pattern", "=", "'`'", ".", "substr", "(", "$", "route", ",", "1", ")", ".", "'`u'", ";", "$", "match", "=", "preg_match", "(", "$", "pattern", ",", "$", "requestUrl", ",", "$", "params", ")", "===", "1", ";", "}", "elseif", "(", "(", "$", "position", "=", "strpos", "(", "$", "route", ",", "'['", ")", ")", "===", "false", ")", "{", "// No params in url, do string comparison", "$", "match", "=", "strcmp", "(", "$", "requestUrl", ",", "$", "route", ")", "===", "0", ";", "}", "else", "{", "// Compare longest non-param string with url", "if", "(", "strncmp", "(", "$", "requestUrl", ",", "$", "route", ",", "$", "position", ")", "!==", "0", ")", "{", "continue", ";", "}", "$", "regex", "=", "$", "this", "->", "compileRoute", "(", "$", "route", ")", ";", "$", "match", "=", "preg_match", "(", "$", "regex", ",", "$", "requestUrl", ",", "$", "params", ")", "===", "1", ";", "}", "if", "(", "$", "match", ")", "{", "if", "(", "$", "params", ")", "{", "foreach", "(", "$", "params", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_numeric", "(", "$", "key", ")", ")", "unset", "(", "$", "params", "[", "$", "key", "]", ")", ";", "}", "}", "return", "array", "(", "'target'", "=>", "$", "target", ",", "'params'", "=>", "$", "params", ",", "'name'", "=>", "$", "name", ")", ";", "}", "}", "return", "false", ";", "}" ]
Match a given Request Url against stored routes @param string $requestUrl @param string $requestMethod @return array|boolean Array with route information on success, false on failure (no match).
[ "Match", "a", "given", "Request", "Url", "against", "stored", "routes" ]
train
https://github.com/dannyvankooten/AltoRouter/blob/dce6efdea27b9a87693a60a158492421fdcc112f/AltoRouter.php#L183-L249
twilio/twilio-php
Twilio/Rest/Video/V1/CompositionHookInstance.php
CompositionHookInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new CompositionHookContext($this->version, $this->solution['sid']); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new CompositionHookContext($this->version, $this->solution['sid']); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "CompositionHookContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Video\V1\CompositionHookContext Context for this CompositionHookInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Video/V1/CompositionHookInstance.php#L80-L86
twilio/twilio-php
Twilio/Jwt/ClientToken.php
ClientToken.allowClientIncoming
public function allowClientIncoming($clientName) { // clientName must be a non-zero length alphanumeric string if (preg_match('/\W/', $clientName)) { throw new \InvalidArgumentException( 'Only alphanumeric characters allowed in client name.'); } if (strlen($clientName) == 0) { throw new \InvalidArgumentException( 'Client name must not be a zero length string.'); } $this->clientName = $clientName; $this->allow('client', 'incoming', array('clientName' => $clientName)); }
php
public function allowClientIncoming($clientName) { if (preg_match('/\W/', $clientName)) { throw new \InvalidArgumentException( 'Only alphanumeric characters allowed in client name.'); } if (strlen($clientName) == 0) { throw new \InvalidArgumentException( 'Client name must not be a zero length string.'); } $this->clientName = $clientName; $this->allow('client', 'incoming', array('clientName' => $clientName)); }
[ "public", "function", "allowClientIncoming", "(", "$", "clientName", ")", "{", "// clientName must be a non-zero length alphanumeric string", "if", "(", "preg_match", "(", "'/\\W/'", ",", "$", "clientName", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Only alphanumeric characters allowed in client name.'", ")", ";", "}", "if", "(", "strlen", "(", "$", "clientName", ")", "==", "0", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Client name must not be a zero length string.'", ")", ";", "}", "$", "this", "->", "clientName", "=", "$", "clientName", ";", "$", "this", "->", "allow", "(", "'client'", ",", "'incoming'", ",", "array", "(", "'clientName'", "=>", "$", "clientName", ")", ")", ";", "}" ]
If the user of this token should be allowed to accept incoming connections then configure the TwilioCapability through this method and specify the client name. @param $clientName @throws \InvalidArgumentException
[ "If", "the", "user", "of", "this", "token", "should", "be", "allowed", "to", "accept", "incoming", "connections", "then", "configure", "the", "TwilioCapability", "through", "this", "method", "and", "specify", "the", "client", "name", "." ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Jwt/ClientToken.php#L45-L61
twilio/twilio-php
Twilio/Jwt/ClientToken.php
ClientToken.generateToken
public function generateToken($ttl = 3600) { $payload = array_merge($this->customClaims, array( 'scope' => array(), 'iss' => $this->accountSid, 'exp' => time() + $ttl, )); $scopeStrings = array(); foreach ($this->scopes as $scope) { if ($scope->privilege == "outgoing" && $this->clientName) $scope->params["clientName"] = $this->clientName; $scopeStrings[] = $scope->toString(); } $payload['scope'] = implode(' ', $scopeStrings); return JWT::encode($payload, $this->authToken, 'HS256'); }
php
public function generateToken($ttl = 3600) { $payload = array_merge($this->customClaims, array( 'scope' => array(), 'iss' => $this->accountSid, 'exp' => time() + $ttl, )); $scopeStrings = array(); foreach ($this->scopes as $scope) { if ($scope->privilege == "outgoing" && $this->clientName) $scope->params["clientName"] = $this->clientName; $scopeStrings[] = $scope->toString(); } $payload['scope'] = implode(' ', $scopeStrings); return JWT::encode($payload, $this->authToken, 'HS256'); }
[ "public", "function", "generateToken", "(", "$", "ttl", "=", "3600", ")", "{", "$", "payload", "=", "array_merge", "(", "$", "this", "->", "customClaims", ",", "array", "(", "'scope'", "=>", "array", "(", ")", ",", "'iss'", "=>", "$", "this", "->", "accountSid", ",", "'exp'", "=>", "time", "(", ")", "+", "$", "ttl", ",", ")", ")", ";", "$", "scopeStrings", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "scopes", "as", "$", "scope", ")", "{", "if", "(", "$", "scope", "->", "privilege", "==", "\"outgoing\"", "&&", "$", "this", "->", "clientName", ")", "$", "scope", "->", "params", "[", "\"clientName\"", "]", "=", "$", "this", "->", "clientName", ";", "$", "scopeStrings", "[", "]", "=", "$", "scope", "->", "toString", "(", ")", ";", "}", "$", "payload", "[", "'scope'", "]", "=", "implode", "(", "' '", ",", "$", "scopeStrings", ")", ";", "return", "JWT", "::", "encode", "(", "$", "payload", ",", "$", "this", "->", "authToken", ",", "'HS256'", ")", ";", "}" ]
Generates a new token based on the credentials and permissions that previously has been granted to this token. @param int $ttl the expiration time of the token (in seconds). Default value is 3600 (1hr) @return ClientToken the newly generated token that is valid for $ttl seconds
[ "Generates", "a", "new", "token", "based", "on", "the", "credentials", "and", "permissions", "that", "previously", "has", "been", "granted", "to", "this", "token", "." ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Jwt/ClientToken.php#L107-L123
twilio/twilio-php
Twilio/Rest/Video/V1/RecordingInstance.php
RecordingInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new RecordingContext($this->version, $this->solution['sid']); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new RecordingContext($this->version, $this->solution['sid']); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "RecordingContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Video\V1\RecordingContext Context for this RecordingInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Video/V1/RecordingInstance.php#L77-L83
twilio/twilio-php
Twilio/Rest/Chat/V1/Service/ChannelInstance.php
ChannelInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "ChannelContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Chat\V1\Service\ChannelContext Context for this ChannelInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V1/Service/ChannelInstance.php#L81-L91
twilio/twilio-php
Twilio/Rest/Fax/V1/Fax/FaxMediaInstance.php
FaxMediaInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new FaxMediaContext( $this->version, $this->solution['faxSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new FaxMediaContext( $this->version, $this->solution['faxSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "FaxMediaContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'faxSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Fax\V1\Fax\FaxMediaContext Context for this FaxMediaInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Fax/V1/Fax/FaxMediaInstance.php#L64-L74
twilio/twilio-php
Twilio/Rest/Verify/V2/Service/VerificationInstance.php
VerificationInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new VerificationContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new VerificationContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "VerificationContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Verify\V2\Service\VerificationContext Context for this VerificationInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Verify/V2/Service/VerificationInstance.php#L76-L86
twilio/twilio-php
Twilio/Security/RequestValidator.php
RequestValidator.compare
public static function compare($a, $b) { $result = true; if (strlen($a) != strlen($b)) { return false; } if (!$a && !$b) { return true; } $limit = strlen($a); for ($i = 0; $i < $limit; ++$i) { if ($a[$i] != $b[$i]) { $result = false; } } return $result; }
php
public static function compare($a, $b) { $result = true; if (strlen($a) != strlen($b)) { return false; } if (!$a && !$b) { return true; } $limit = strlen($a); for ($i = 0; $i < $limit; ++$i) { if ($a[$i] != $b[$i]) { $result = false; } } return $result; }
[ "public", "static", "function", "compare", "(", "$", "a", ",", "$", "b", ")", "{", "$", "result", "=", "true", ";", "if", "(", "strlen", "(", "$", "a", ")", "!=", "strlen", "(", "$", "b", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "$", "a", "&&", "!", "$", "b", ")", "{", "return", "true", ";", "}", "$", "limit", "=", "strlen", "(", "$", "a", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "limit", ";", "++", "$", "i", ")", "{", "if", "(", "$", "a", "[", "$", "i", "]", "!=", "$", "b", "[", "$", "i", "]", ")", "{", "$", "result", "=", "false", ";", "}", "}", "return", "$", "result", ";", "}" ]
Time insensitive compare, function's runtime is governed by the length of the first argument, not the difference between the arguments. @param $a string First part of the comparison pair @param $b string Second part of the comparison pair @return bool True if $a == $b, false otherwise.
[ "Time", "insensitive", "compare", "function", "s", "runtime", "is", "governed", "by", "the", "length", "of", "the", "first", "argument", "not", "the", "difference", "between", "the", "arguments", "." ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Security/RequestValidator.php#L60-L80
twilio/twilio-php
Twilio/Rest/Authy/V1/Service/EntityInstance.php
EntityInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new EntityContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new EntityContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "EntityContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'identity'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Authy\V1\Service\EntityContext Context for this EntityInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Authy/V1/Service/EntityInstance.php#L70-L80
twilio/twilio-php
Twilio/Rest/Messaging/V1/SessionList.php
SessionList.create
public function create($messagingServiceSid, $options = array()) { $options = new Values($options); $data = Values::of(array( 'MessagingServiceSid' => $messagingServiceSid, 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SessionInstance($this->version, $payload); }
php
public function create($messagingServiceSid, $options = array()) { $options = new Values($options); $data = Values::of(array( 'MessagingServiceSid' => $messagingServiceSid, 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SessionInstance($this->version, $payload); }
[ "public", "function", "create", "(", "$", "messagingServiceSid", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'MessagingServiceSid'", "=>", "$", "messagingServiceSid", ",", "'FriendlyName'", "=>", "$", "options", "[", "'friendlyName'", "]", ",", "'Attributes'", "=>", "$", "options", "[", "'attributes'", "]", ",", "'DateCreated'", "=>", "Serialize", "::", "iso8601DateTime", "(", "$", "options", "[", "'dateCreated'", "]", ")", ",", "'DateUpdated'", "=>", "Serialize", "::", "iso8601DateTime", "(", "$", "options", "[", "'dateUpdated'", "]", ")", ",", "'CreatedBy'", "=>", "$", "options", "[", "'createdBy'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "SessionInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ")", ";", "}" ]
Create a new SessionInstance @param string $messagingServiceSid The unique id of the SMS Service this session belongs to. @param array|Options $options Optional Arguments @return SessionInstance Newly created SessionInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "SessionInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Messaging/V1/SessionList.php#L46-L66
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php
MediaInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new MediaContext( $this->version, $this->solution['accountSid'], $this->solution['messageSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new MediaContext( $this->version, $this->solution['accountSid'], $this->solution['messageSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "MediaContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'messageSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Api\V2010\Account\Message\MediaContext Context for this MediaInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php#L66-L77
twilio/twilio-php
Twilio/Rest/Chat/V1/Service/Channel/InviteList.php
InviteList.create
public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); }
php
public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); }
[ "public", "function", "create", "(", "$", "identity", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'Identity'", "=>", "$", "identity", ",", "'RoleSid'", "=>", "$", "options", "[", "'roleSid'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "InviteInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'channelSid'", "]", ")", ";", "}" ]
Create a new InviteInstance @param string $identity A unique string identifier for this User in this Service. @param array|Options $options Optional Arguments @return InviteInstance Newly created InviteInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "InviteInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php#L46-L64
twilio/twilio-php
Twilio/Rest/Chat/V1/Service/Channel/InviteList.php
InviteList.stream
public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); }
php
public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); }
[ "public", "function", "stream", "(", "$", "options", "=", "array", "(", ")", ",", "$", "limit", "=", "null", ",", "$", "pageSize", "=", "null", ")", "{", "$", "limits", "=", "$", "this", "->", "version", "->", "readLimits", "(", "$", "limit", ",", "$", "pageSize", ")", ";", "$", "page", "=", "$", "this", "->", "page", "(", "$", "options", ",", "$", "limits", "[", "'pageSize'", "]", ")", ";", "return", "$", "this", "->", "version", "->", "stream", "(", "$", "page", ",", "$", "limits", "[", "'limit'", "]", ",", "$", "limits", "[", "'pageLimit'", "]", ")", ";", "}" ]
Streams InviteInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. @param array|Options $options Optional Arguments @param int $limit Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @param mixed $pageSize Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) @return \Twilio\Stream stream of results
[ "Streams", "InviteInstance", "records", "from", "the", "API", "as", "a", "generator", "stream", ".", "This", "operation", "lazily", "loads", "records", "as", "efficiently", "as", "possible", "until", "the", "limit", "is", "reached", ".", "The", "results", "are", "returned", "as", "a", "generator", "so", "this", "operation", "is", "memory", "efficient", "." ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php#L85-L91
twilio/twilio-php
Twilio/Rest/Chat/V1/Service/Channel/InviteList.php
InviteList.read
public function read($options = array(), $limit = null, $pageSize = null) { return iterator_to_array($this->stream($options, $limit, $pageSize), false); }
php
public function read($options = array(), $limit = null, $pageSize = null) { return iterator_to_array($this->stream($options, $limit, $pageSize), false); }
[ "public", "function", "read", "(", "$", "options", "=", "array", "(", ")", ",", "$", "limit", "=", "null", ",", "$", "pageSize", "=", "null", ")", "{", "return", "iterator_to_array", "(", "$", "this", "->", "stream", "(", "$", "options", ",", "$", "limit", ",", "$", "pageSize", ")", ",", "false", ")", ";", "}" ]
Reads InviteInstance records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param array|Options $options Optional Arguments @param int $limit Upper limit for the number of records to return. read() guarantees to never return more than limit. Default is no limit @param mixed $pageSize Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, read() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) @return InviteInstance[] Array of results
[ "Reads", "InviteInstance", "records", "from", "the", "API", "as", "a", "list", ".", "Unlike", "stream", "()", "this", "operation", "is", "eager", "and", "will", "load", "limit", "records", "into", "memory", "before", "returning", "." ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php#L109-L111
twilio/twilio-php
Twilio/Rest/Chat/V1/Service/Channel/InviteList.php
InviteList.getContext
public function getContext($sid) { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); }
php
public function getContext($sid) { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); }
[ "public", "function", "getContext", "(", "$", "sid", ")", "{", "return", "new", "InviteContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'channelSid'", "]", ",", "$", "sid", ")", ";", "}" ]
Constructs a InviteContext @param string $sid The sid @return \Twilio\Rest\Chat\V1\Service\Channel\InviteContext
[ "Constructs", "a", "InviteContext" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php#L163-L170
twilio/twilio-php
Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php
InstalledAddOnList.create
public function create($availableAddOnSid, $acceptTermsOfService, $options = array()) { $options = new Values($options); $data = Values::of(array( 'AvailableAddOnSid' => $availableAddOnSid, 'AcceptTermsOfService' => Serialize::booleanToString($acceptTermsOfService), 'Configuration' => Serialize::jsonObject($options['configuration']), 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InstalledAddOnInstance($this->version, $payload); }
php
public function create($availableAddOnSid, $acceptTermsOfService, $options = array()) { $options = new Values($options); $data = Values::of(array( 'AvailableAddOnSid' => $availableAddOnSid, 'AcceptTermsOfService' => Serialize::booleanToString($acceptTermsOfService), 'Configuration' => Serialize::jsonObject($options['configuration']), 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InstalledAddOnInstance($this->version, $payload); }
[ "public", "function", "create", "(", "$", "availableAddOnSid", ",", "$", "acceptTermsOfService", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'AvailableAddOnSid'", "=>", "$", "availableAddOnSid", ",", "'AcceptTermsOfService'", "=>", "Serialize", "::", "booleanToString", "(", "$", "acceptTermsOfService", ")", ",", "'Configuration'", "=>", "Serialize", "::", "jsonObject", "(", "$", "options", "[", "'configuration'", "]", ")", ",", "'UniqueName'", "=>", "$", "options", "[", "'uniqueName'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "InstalledAddOnInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ")", ";", "}" ]
Create a new InstalledAddOnInstance @param string $availableAddOnSid A string that uniquely identifies the Add-on to install @param boolean $acceptTermsOfService A boolean reflecting your acceptance of the Terms of Service @param array|Options $options Optional Arguments @return InstalledAddOnInstance Newly created InstalledAddOnInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "InstalledAddOnInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php#L48-L66
twilio/twilio-php
Twilio/Rest/Studio/V1/Flow/EngagementList.php
EngagementList.create
public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); }
php
public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); }
[ "public", "function", "create", "(", "$", "to", ",", "$", "from", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'To'", "=>", "$", "to", ",", "'From'", "=>", "$", "from", ",", "'Parameters'", "=>", "Serialize", "::", "jsonObject", "(", "$", "options", "[", "'parameters'", "]", ")", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "EngagementInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ",", "$", "this", "->", "solution", "[", "'flowSid'", "]", ")", ";", "}" ]
Create a new EngagementInstance @param string $to The Contact phone number to start a Studio Flow Engagement. @param string $from The Twilio phone number to send messages or initiate calls from during the Flow Engagement. @param array|Options $options Optional Arguments @return EngagementInstance Newly created EngagementInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "EngagementInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Studio/V1/Flow/EngagementList.php#L131-L148
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AddressInstance.php
AddressInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new AddressContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new AddressContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "AddressContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Api\V2010\Account\AddressContext Context for this AddressInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AddressInstance.php#L81-L91
twilio/twilio-php
Twilio/Rest/Accounts/V1/Credential/AwsList.php
AwsList.create
public function create($credentials, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Credentials' => $credentials, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AwsInstance($this->version, $payload); }
php
public function create($credentials, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Credentials' => $credentials, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AwsInstance($this->version, $payload); }
[ "public", "function", "create", "(", "$", "credentials", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'Credentials'", "=>", "$", "credentials", ",", "'FriendlyName'", "=>", "$", "options", "[", "'friendlyName'", "]", ",", "'AccountSid'", "=>", "$", "options", "[", "'accountSid'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "AwsInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ")", ";", "}" ]
Create a new AwsInstance @param string $credentials A string that contains the AWS access credentials in the format <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY> @param array|Options $options Optional Arguments @return AwsInstance Newly created AwsInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "AwsInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Accounts/V1/Credential/AwsList.php#L129-L146
twilio/twilio-php
Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php
ReservationList.getContext
public function getContext($sid) { return new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskSid'], $sid ); }
php
public function getContext($sid) { return new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskSid'], $sid ); }
[ "public", "function", "getContext", "(", "$", "sid", ")", "{", "return", "new", "ReservationContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'workspaceSid'", "]", ",", "$", "this", "->", "solution", "[", "'taskSid'", "]", ",", "$", "sid", ")", ";", "}" ]
Constructs a ReservationContext @param string $sid The sid @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationContext
[ "Constructs", "a", "ReservationContext" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php#L133-L140
twilio/twilio-php
Twilio/Rest/Proxy/V1/ServiceContext.php
ServiceContext.getSessions
protected function getSessions() { if (!$this->_sessions) { $this->_sessions = new SessionList($this->version, $this->solution['sid']); } return $this->_sessions; }
php
protected function getSessions() { if (!$this->_sessions) { $this->_sessions = new SessionList($this->version, $this->solution['sid']); } return $this->_sessions; }
[ "protected", "function", "getSessions", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_sessions", ")", "{", "$", "this", "->", "_sessions", "=", "new", "SessionList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_sessions", ";", "}" ]
Access the sessions @return \Twilio\Rest\Proxy\V1\Service\SessionList
[ "Access", "the", "sessions" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Proxy/V1/ServiceContext.php#L116-L122
twilio/twilio-php
Twilio/Rest/Proxy/V1/ServiceContext.php
ServiceContext.getPhoneNumbers
protected function getPhoneNumbers() { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this->version, $this->solution['sid']); } return $this->_phoneNumbers; }
php
protected function getPhoneNumbers() { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this->version, $this->solution['sid']); } return $this->_phoneNumbers; }
[ "protected", "function", "getPhoneNumbers", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_phoneNumbers", ")", "{", "$", "this", "->", "_phoneNumbers", "=", "new", "PhoneNumberList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_phoneNumbers", ";", "}" ]
Access the phoneNumbers @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberList
[ "Access", "the", "phoneNumbers" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Proxy/V1/ServiceContext.php#L129-L135
twilio/twilio-php
Twilio/Rest/Proxy/V1/ServiceContext.php
ServiceContext.getShortCodes
protected function getShortCodes() { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList($this->version, $this->solution['sid']); } return $this->_shortCodes; }
php
protected function getShortCodes() { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList($this->version, $this->solution['sid']); } return $this->_shortCodes; }
[ "protected", "function", "getShortCodes", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_shortCodes", ")", "{", "$", "this", "->", "_shortCodes", "=", "new", "ShortCodeList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_shortCodes", ";", "}" ]
Access the shortCodes @return \Twilio\Rest\Proxy\V1\Service\ShortCodeList
[ "Access", "the", "shortCodes" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Proxy/V1/ServiceContext.php#L142-L148
twilio/twilio-php
Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php
FieldInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "FieldContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'assistantSid'", "]", ",", "$", "this", "->", "solution", "[", "'taskSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldContext Context for this FieldInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php#L75-L86
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php
IncomingPhoneNumberContext.getAssignedAddOns
protected function getAssignedAddOns() { if (!$this->_assignedAddOns) { $this->_assignedAddOns = new AssignedAddOnList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_assignedAddOns; }
php
protected function getAssignedAddOns() { if (!$this->_assignedAddOns) { $this->_assignedAddOns = new AssignedAddOnList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_assignedAddOns; }
[ "protected", "function", "getAssignedAddOns", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_assignedAddOns", ")", "{", "$", "this", "->", "_assignedAddOns", "=", "new", "AssignedAddOnList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_assignedAddOns", ";", "}" ]
Access the assignedAddOns @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList
[ "Access", "the", "assignedAddOns" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php#L133-L143
twilio/twilio-php
Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php
ExecutionStepContextInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "ExecutionStepContextContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'flowSid'", "]", ",", "$", "this", "->", "solution", "[", "'executionSid'", "]", ",", "$", "this", "->", "solution", "[", "'stepSid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextContext Context for this ExecutionStepContextInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php#L63-L74
twilio/twilio-php
Twilio/Rest/Authy/V1/Service/EntityContext.php
EntityContext.getFactors
protected function getFactors() { if (!$this->_factors) { $this->_factors = new FactorList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_factors; }
php
protected function getFactors() { if (!$this->_factors) { $this->_factors = new FactorList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_factors; }
[ "protected", "function", "getFactors", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_factors", ")", "{", "$", "this", "->", "_factors", "=", "new", "FactorList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'identity'", "]", ")", ";", "}", "return", "$", "this", "->", "_factors", ";", "}" ]
Access the factors @return \Twilio\Rest\Authy\V1\Service\Entity\FactorList
[ "Access", "the", "factors" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Authy/V1/Service/EntityContext.php#L82-L92
twilio/twilio-php
Twilio/Rest/Client.php
Client.request
public function request($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $username = $username ? $username : $this->username; $password = $password ? $password : $this->password; $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . ' (PHP ' . phpversion() . ')'; $headers['Accept-Charset'] = 'utf-8'; if ($method == 'POST' && !array_key_exists('Content-Type', $headers)) { $headers['Content-Type'] = 'application/x-www-form-urlencoded'; } if (!array_key_exists('Accept', $headers)) { $headers['Accept'] = 'application/json'; } if ($this->region) { list($head, $tail) = explode('.', $uri, 2); if (strpos($tail, $this->region) !== 0) { $uri = implode('.', array($head, $this->region, $tail)); } } return $this->getHttpClient()->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); }
php
public function request($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $username = $username ? $username : $this->username; $password = $password ? $password : $this->password; $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . ' (PHP ' . phpversion() . ')'; $headers['Accept-Charset'] = 'utf-8'; if ($method == 'POST' && !array_key_exists('Content-Type', $headers)) { $headers['Content-Type'] = 'application/x-www-form-urlencoded'; } if (!array_key_exists('Accept', $headers)) { $headers['Accept'] = 'application/json'; } if ($this->region) { list($head, $tail) = explode('.', $uri, 2); if (strpos($tail, $this->region) !== 0) { $uri = implode('.', array($head, $this->region, $tail)); } } return $this->getHttpClient()->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); }
[ "public", "function", "request", "(", "$", "method", ",", "$", "uri", ",", "$", "params", "=", "array", "(", ")", ",", "$", "data", "=", "array", "(", ")", ",", "$", "headers", "=", "array", "(", ")", ",", "$", "username", "=", "null", ",", "$", "password", "=", "null", ",", "$", "timeout", "=", "null", ")", "{", "$", "username", "=", "$", "username", "?", "$", "username", ":", "$", "this", "->", "username", ";", "$", "password", "=", "$", "password", "?", "$", "password", ":", "$", "this", "->", "password", ";", "$", "headers", "[", "'User-Agent'", "]", "=", "'twilio-php/'", ".", "VersionInfo", "::", "string", "(", ")", ".", "' (PHP '", ".", "phpversion", "(", ")", ".", "')'", ";", "$", "headers", "[", "'Accept-Charset'", "]", "=", "'utf-8'", ";", "if", "(", "$", "method", "==", "'POST'", "&&", "!", "array_key_exists", "(", "'Content-Type'", ",", "$", "headers", ")", ")", "{", "$", "headers", "[", "'Content-Type'", "]", "=", "'application/x-www-form-urlencoded'", ";", "}", "if", "(", "!", "array_key_exists", "(", "'Accept'", ",", "$", "headers", ")", ")", "{", "$", "headers", "[", "'Accept'", "]", "=", "'application/json'", ";", "}", "if", "(", "$", "this", "->", "region", ")", "{", "list", "(", "$", "head", ",", "$", "tail", ")", "=", "explode", "(", "'.'", ",", "$", "uri", ",", "2", ")", ";", "if", "(", "strpos", "(", "$", "tail", ",", "$", "this", "->", "region", ")", "!==", "0", ")", "{", "$", "uri", "=", "implode", "(", "'.'", ",", "array", "(", "$", "head", ",", "$", "this", "->", "region", ",", "$", "tail", ")", ")", ";", "}", "}", "return", "$", "this", "->", "getHttpClient", "(", ")", "->", "request", "(", "$", "method", ",", "$", "uri", ",", "$", "params", ",", "$", "data", ",", "$", "headers", ",", "$", "username", ",", "$", "password", ",", "$", "timeout", ")", ";", "}" ]
Makes a request to the Twilio API using the configured http client Authentication information is automatically added if none is provided @param string $method HTTP Method @param string $uri Fully qualified url @param string[] $params Query string parameters @param string[] $data POST body data @param string[] $headers HTTP Headers @param string $username User for Authentication @param string $password Password for Authentication @param int $timeout Timeout in seconds @return \Twilio\Http\Response Response from the Twilio API
[ "Makes", "a", "request", "to", "the", "Twilio", "API", "using", "the", "configured", "http", "client", "Authentication", "information", "is", "automatically", "added", "if", "none", "is", "provided" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Client.php#L190-L224
twilio/twilio-php
Twilio/Rest/Client.php
Client.validateSslCertificate
public function validateSslCertificate($client) { $response = $client->request('GET', 'https://api.twilio.com:8443'); if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { throw new TwilioException("Failed to validate SSL certificate"); } }
php
public function validateSslCertificate($client) { $response = $client->request('GET', 'https: if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { throw new TwilioException("Failed to validate SSL certificate"); } }
[ "public", "function", "validateSslCertificate", "(", "$", "client", ")", "{", "$", "response", "=", "$", "client", "->", "request", "(", "'GET'", ",", "'https://api.twilio.com:8443'", ")", ";", "if", "(", "$", "response", "->", "getStatusCode", "(", ")", "<", "200", "||", "$", "response", "->", "getStatusCode", "(", ")", ">", "300", ")", "{", "throw", "new", "TwilioException", "(", "\"Failed to validate SSL certificate\"", ")", ";", "}", "}" ]
Validates connection to new SSL certificate endpoint @param CurlClient $client @throws TwilioException if request fails
[ "Validates", "connection", "to", "new", "SSL", "certificate", "endpoint" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Client.php#L941-L947
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/RecordingContext.php
RecordingContext.getAddOnResults
protected function getAddOnResults() { if (!$this->_addOnResults) { $this->_addOnResults = new AddOnResultList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_addOnResults; }
php
protected function getAddOnResults() { if (!$this->_addOnResults) { $this->_addOnResults = new AddOnResultList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_addOnResults; }
[ "protected", "function", "getAddOnResults", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_addOnResults", ")", "{", "$", "this", "->", "_addOnResults", "=", "new", "AddOnResultList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_addOnResults", ";", "}" ]
Access the addOnResults @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList
[ "Access", "the", "addOnResults" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/RecordingContext.php#L102-L112
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php
AuthTypeRegistrationsList.getCredentialListMappings
protected function getCredentialListMappings() { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new AuthRegistrationsCredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_credentialListMappings; }
php
protected function getCredentialListMappings() { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new AuthRegistrationsCredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_credentialListMappings; }
[ "protected", "function", "getCredentialListMappings", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_credentialListMappings", ")", "{", "$", "this", "->", "_credentialListMappings", "=", "new", "AuthRegistrationsCredentialListMappingList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'domainSid'", "]", ")", ";", "}", "return", "$", "this", "->", "_credentialListMappings", ";", "}" ]
Access the credentialListMappings
[ "Access", "the", "credentialListMappings" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php#L42-L52
twilio/twilio-php
Twilio/Rest/Preview/BulkExports/ExportConfigurationInstance.php
ExportConfigurationInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new ExportConfigurationContext($this->version, $this->solution['resourceType']); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new ExportConfigurationContext($this->version, $this->solution['resourceType']); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "ExportConfigurationContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'resourceType'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationContext Context for this ExportConfigurationInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Preview/BulkExports/ExportConfigurationInstance.php#L59-L65
twilio/twilio-php
Twilio/Rest/Autopilot/V1/Assistant/FieldTypeContext.php
FieldTypeContext.getFieldValues
protected function getFieldValues() { if (!$this->_fieldValues) { $this->_fieldValues = new FieldValueList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fieldValues; }
php
protected function getFieldValues() { if (!$this->_fieldValues) { $this->_fieldValues = new FieldValueList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fieldValues; }
[ "protected", "function", "getFieldValues", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_fieldValues", ")", "{", "$", "this", "->", "_fieldValues", "=", "new", "FieldValueList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'assistantSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_fieldValues", ";", "}" ]
Access the fieldValues @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList
[ "Access", "the", "fieldValues" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeContext.php#L114-L124
twilio/twilio-php
Twilio/Rest/Preview/DeployedDevices/FleetList.php
FleetList.create
public function create($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FleetInstance($this->version, $payload); }
php
public function create($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FleetInstance($this->version, $payload); }
[ "public", "function", "create", "(", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'FriendlyName'", "=>", "$", "options", "[", "'friendlyName'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "FleetInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ")", ";", "}" ]
Create a new FleetInstance @param array|Options $options Optional Arguments @return FleetInstance Newly created FleetInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "FleetInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Preview/DeployedDevices/FleetList.php#L43-L56
twilio/twilio-php
Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php
CountryContext.getHighriskSpecialPrefixes
protected function getHighriskSpecialPrefixes() { if (!$this->_highriskSpecialPrefixes) { $this->_highriskSpecialPrefixes = new HighriskSpecialPrefixList( $this->version, $this->solution['isoCode'] ); } return $this->_highriskSpecialPrefixes; }
php
protected function getHighriskSpecialPrefixes() { if (!$this->_highriskSpecialPrefixes) { $this->_highriskSpecialPrefixes = new HighriskSpecialPrefixList( $this->version, $this->solution['isoCode'] ); } return $this->_highriskSpecialPrefixes; }
[ "protected", "function", "getHighriskSpecialPrefixes", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_highriskSpecialPrefixes", ")", "{", "$", "this", "->", "_highriskSpecialPrefixes", "=", "new", "HighriskSpecialPrefixList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'isoCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_highriskSpecialPrefixes", ";", "}" ]
Access the highriskSpecialPrefixes @return \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList
[ "Access", "the", "highriskSpecialPrefixes" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php#L65-L74
twilio/twilio-php
Twilio/Rest/Studio/V1/Flow/EngagementInstance.php
EngagementInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new EngagementContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new EngagementContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "EngagementContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'flowSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Studio\V1\Flow\EngagementContext Context for this EngagementInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php#L72-L82
twilio/twilio-php
Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php
StepContext.fetch
public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new StepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); }
php
public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new StepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); }
[ "public", "function", "fetch", "(", ")", "{", "$", "params", "=", "Values", "::", "of", "(", "array", "(", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "fetch", "(", "'GET'", ",", "$", "this", "->", "uri", ",", "$", "params", ")", ";", "return", "new", "StepInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ",", "$", "this", "->", "solution", "[", "'flowSid'", "]", ",", "$", "this", "->", "solution", "[", "'engagementSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}" ]
Fetch a StepInstance @return StepInstance Fetched StepInstance @throws TwilioException When an HTTP error occurs.
[ "Fetch", "a", "StepInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php#L49-L65
twilio/twilio-php
Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php
StepContext.getStepContext
protected function getStepContext() { if (!$this->_stepContext) { $this->_stepContext = new StepContextList( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } return $this->_stepContext; }
php
protected function getStepContext() { if (!$this->_stepContext) { $this->_stepContext = new StepContextList( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } return $this->_stepContext; }
[ "protected", "function", "getStepContext", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_stepContext", ")", "{", "$", "this", "->", "_stepContext", "=", "new", "StepContextList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'flowSid'", "]", ",", "$", "this", "->", "solution", "[", "'engagementSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_stepContext", ";", "}" ]
Access the stepContext @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList
[ "Access", "the", "stepContext" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php#L72-L83
twilio/twilio-php
Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php
InviteInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "InviteContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'channelSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Chat\V1\Service\Channel\InviteContext Context for this InviteInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php#L73-L84
twilio/twilio-php
Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php
PublishedTrackList.getContext
public function getContext($sid) { return new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); }
php
public function getContext($sid) { return new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); }
[ "public", "function", "getContext", "(", "$", "sid", ")", "{", "return", "new", "PublishedTrackContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'roomSid'", "]", ",", "$", "this", "->", "solution", "[", "'participantSid'", "]", ",", "$", "sid", ")", ";", "}" ]
Constructs a PublishedTrackContext @param string $sid A 34 character string that uniquely identifies this resource. @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext
[ "Constructs", "a", "PublishedTrackContext" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php#L128-L135
twilio/twilio-php
Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php
WorkerList.create
public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'ActivitySid' => $options['activitySid'], 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WorkerInstance($this->version, $payload, $this->solution['workspaceSid']); }
php
public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'ActivitySid' => $options['activitySid'], 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WorkerInstance($this->version, $payload, $this->solution['workspaceSid']); }
[ "public", "function", "create", "(", "$", "friendlyName", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'FriendlyName'", "=>", "$", "friendlyName", ",", "'ActivitySid'", "=>", "$", "options", "[", "'activitySid'", "]", ",", "'Attributes'", "=>", "$", "options", "[", "'attributes'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "WorkerInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ",", "$", "this", "->", "solution", "[", "'workspaceSid'", "]", ")", ";", "}" ]
Create a new WorkerInstance @param string $friendlyName String representing user-friendly name for the Worker. @param array|Options $options Optional Arguments @return WorkerInstance Newly created WorkerInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "WorkerInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php#L149-L166
twilio/twilio-php
Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php
WorkerList.getStatistics
protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new WorkersStatisticsList($this->version, $this->solution['workspaceSid']); } return $this->_statistics; }
php
protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new WorkersStatisticsList($this->version, $this->solution['workspaceSid']); } return $this->_statistics; }
[ "protected", "function", "getStatistics", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_statistics", ")", "{", "$", "this", "->", "_statistics", "=", "new", "WorkersStatisticsList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'workspaceSid'", "]", ")", ";", "}", "return", "$", "this", "->", "_statistics", ";", "}" ]
Access the statistics
[ "Access", "the", "statistics" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php#L171-L177
twilio/twilio-php
Twilio/Rest/Preview/Sync/Service/SyncListContext.php
SyncListContext.getSyncListItems
protected function getSyncListItems() { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; }
php
protected function getSyncListItems() { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; }
[ "protected", "function", "getSyncListItems", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_syncListItems", ")", "{", "$", "this", "->", "_syncListItems", "=", "new", "SyncListItemList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_syncListItems", ";", "}" ]
Access the syncListItems @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList
[ "Access", "the", "syncListItems" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Preview/Sync/Service/SyncListContext.php#L86-L96
twilio/twilio-php
Twilio/Rest/Preview/Sync/Service/SyncListContext.php
SyncListContext.getSyncListPermissions
protected function getSyncListPermissions() { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; }
php
protected function getSyncListPermissions() { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; }
[ "protected", "function", "getSyncListPermissions", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_syncListPermissions", ")", "{", "$", "this", "->", "_syncListPermissions", "=", "new", "SyncListPermissionList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'serviceSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_syncListPermissions", ";", "}" ]
Access the syncListPermissions @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList
[ "Access", "the", "syncListPermissions" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Preview/Sync/Service/SyncListContext.php#L103-L113
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php
AuthorizedConnectAppInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new AuthorizedConnectAppContext( $this->version, $this->solution['accountSid'], $this->solution['connectAppSid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new AuthorizedConnectAppContext( $this->version, $this->solution['accountSid'], $this->solution['connectAppSid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "AuthorizedConnectAppContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'connectAppSid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext Context for this AuthorizedConnectAppInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php#L71-L81
twilio/twilio-php
Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php
AuthorizationDocumentContext.getDependentHostedNumberOrders
protected function getDependentHostedNumberOrders() { if (!$this->_dependentHostedNumberOrders) { $this->_dependentHostedNumberOrders = new DependentHostedNumberOrderList( $this->version, $this->solution['sid'] ); } return $this->_dependentHostedNumberOrders; }
php
protected function getDependentHostedNumberOrders() { if (!$this->_dependentHostedNumberOrders) { $this->_dependentHostedNumberOrders = new DependentHostedNumberOrderList( $this->version, $this->solution['sid'] ); } return $this->_dependentHostedNumberOrders; }
[ "protected", "function", "getDependentHostedNumberOrders", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_dependentHostedNumberOrders", ")", "{", "$", "this", "->", "_dependentHostedNumberOrders", "=", "new", "DependentHostedNumberOrderList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_dependentHostedNumberOrders", ";", "}" ]
Access the dependentHostedNumberOrders @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList
[ "Access", "the", "dependentHostedNumberOrders" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php#L97-L106
twilio/twilio-php
Twilio/Rest/Fax/V1/FaxList.php
FaxList.create
public function create($to, $mediaUrl, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'MediaUrl' => $mediaUrl, 'Quality' => $options['quality'], 'StatusCallback' => $options['statusCallback'], 'From' => $options['from'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'StoreMedia' => Serialize::booleanToString($options['storeMedia']), 'Ttl' => $options['ttl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FaxInstance($this->version, $payload); }
php
public function create($to, $mediaUrl, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'MediaUrl' => $mediaUrl, 'Quality' => $options['quality'], 'StatusCallback' => $options['statusCallback'], 'From' => $options['from'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'StoreMedia' => Serialize::booleanToString($options['storeMedia']), 'Ttl' => $options['ttl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FaxInstance($this->version, $payload); }
[ "public", "function", "create", "(", "$", "to", ",", "$", "mediaUrl", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'To'", "=>", "$", "to", ",", "'MediaUrl'", "=>", "$", "mediaUrl", ",", "'Quality'", "=>", "$", "options", "[", "'quality'", "]", ",", "'StatusCallback'", "=>", "$", "options", "[", "'statusCallback'", "]", ",", "'From'", "=>", "$", "options", "[", "'from'", "]", ",", "'SipAuthUsername'", "=>", "$", "options", "[", "'sipAuthUsername'", "]", ",", "'SipAuthPassword'", "=>", "$", "options", "[", "'sipAuthPassword'", "]", ",", "'StoreMedia'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'storeMedia'", "]", ")", ",", "'Ttl'", "=>", "$", "options", "[", "'ttl'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "FaxInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ")", ";", "}" ]
Create a new FaxInstance @param string $to The phone number to receive the fax @param string $mediaUrl The Twilio-hosted URL of the PDF that contains the fax @param array|Options $options Optional Arguments @return FaxInstance Newly created FaxInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "FaxInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Fax/V1/FaxList.php#L141-L164
twilio/twilio-php
Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php
SettingsInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new SettingsContext($this->version); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new SettingsContext($this->version); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "SettingsContext", "(", "$", "this", "->", "version", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Voice\V1\DialingPermissions\SettingsContext Context for this SettingsInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php#L52-L58
twilio/twilio-php
Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php
WorkspaceStatisticsInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new WorkspaceStatisticsContext($this->version, $this->solution['workspaceSid']); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new WorkspaceStatisticsContext($this->version, $this->solution['workspaceSid']); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "WorkspaceStatisticsContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'workspaceSid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsContext Context for this WorkspaceStatisticsInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php#L55-L61
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
AvailablePhoneNumberCountryContext.getLocal
protected function getLocal() { if (!$this->_local) { $this->_local = new LocalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_local; }
php
protected function getLocal() { if (!$this->_local) { $this->_local = new LocalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_local; }
[ "protected", "function", "getLocal", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_local", ")", "{", "$", "this", "->", "_local", "=", "new", "LocalList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'countryCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_local", ";", "}" ]
Access the local @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList
[ "Access", "the", "local" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php#L90-L100
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
AvailablePhoneNumberCountryContext.getTollFree
protected function getTollFree() { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_tollFree; }
php
protected function getTollFree() { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_tollFree; }
[ "protected", "function", "getTollFree", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_tollFree", ")", "{", "$", "this", "->", "_tollFree", "=", "new", "TollFreeList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'countryCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_tollFree", ";", "}" ]
Access the tollFree @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList
[ "Access", "the", "tollFree" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php#L107-L117
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
AvailablePhoneNumberCountryContext.getMobile
protected function getMobile() { if (!$this->_mobile) { $this->_mobile = new MobileList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_mobile; }
php
protected function getMobile() { if (!$this->_mobile) { $this->_mobile = new MobileList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_mobile; }
[ "protected", "function", "getMobile", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_mobile", ")", "{", "$", "this", "->", "_mobile", "=", "new", "MobileList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'countryCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_mobile", ";", "}" ]
Access the mobile @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList
[ "Access", "the", "mobile" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php#L124-L134
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
AvailablePhoneNumberCountryContext.getNational
protected function getNational() { if (!$this->_national) { $this->_national = new NationalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_national; }
php
protected function getNational() { if (!$this->_national) { $this->_national = new NationalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_national; }
[ "protected", "function", "getNational", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_national", ")", "{", "$", "this", "->", "_national", "=", "new", "NationalList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'countryCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_national", ";", "}" ]
Access the national @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList
[ "Access", "the", "national" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php#L141-L151
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
AvailablePhoneNumberCountryContext.getVoip
protected function getVoip() { if (!$this->_voip) { $this->_voip = new VoipList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_voip; }
php
protected function getVoip() { if (!$this->_voip) { $this->_voip = new VoipList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_voip; }
[ "protected", "function", "getVoip", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_voip", ")", "{", "$", "this", "->", "_voip", "=", "new", "VoipList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'countryCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_voip", ";", "}" ]
Access the voip @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList
[ "Access", "the", "voip" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php#L158-L168
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
AvailablePhoneNumberCountryContext.getSharedCost
protected function getSharedCost() { if (!$this->_sharedCost) { $this->_sharedCost = new SharedCostList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_sharedCost; }
php
protected function getSharedCost() { if (!$this->_sharedCost) { $this->_sharedCost = new SharedCostList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_sharedCost; }
[ "protected", "function", "getSharedCost", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_sharedCost", ")", "{", "$", "this", "->", "_sharedCost", "=", "new", "SharedCostList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'countryCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_sharedCost", ";", "}" ]
Access the sharedCost @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList
[ "Access", "the", "sharedCost" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php#L175-L185
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
AvailablePhoneNumberCountryContext.getMachineToMachine
protected function getMachineToMachine() { if (!$this->_machineToMachine) { $this->_machineToMachine = new MachineToMachineList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_machineToMachine; }
php
protected function getMachineToMachine() { if (!$this->_machineToMachine) { $this->_machineToMachine = new MachineToMachineList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_machineToMachine; }
[ "protected", "function", "getMachineToMachine", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_machineToMachine", ")", "{", "$", "this", "->", "_machineToMachine", "=", "new", "MachineToMachineList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'countryCode'", "]", ")", ";", "}", "return", "$", "this", "->", "_machineToMachine", ";", "}" ]
Access the machineToMachine @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList
[ "Access", "the", "machineToMachine" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php#L192-L202
twilio/twilio-php
Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php
StepContextInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new StepContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new StepContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "StepContextContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'flowSid'", "]", ",", "$", "this", "->", "solution", "[", "'engagementSid'", "]", ",", "$", "this", "->", "solution", "[", "'stepSid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextContext Context for this StepContextInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php#L62-L73
twilio/twilio-php
Twilio/Rest/Api/V2010/Account/ConferenceInstance.php
ConferenceInstance.proxy
protected function proxy() { if (!$this->context) { $this->context = new ConferenceContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; }
php
protected function proxy() { if (!$this->context) { $this->context = new ConferenceContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; }
[ "protected", "function", "proxy", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", ")", "{", "$", "this", "->", "context", "=", "new", "ConferenceContext", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'accountSid'", "]", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "context", ";", "}" ]
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return \Twilio\Rest\Api\V2010\Account\ConferenceContext Context for this ConferenceInstance
[ "Generate", "an", "instance", "context", "for", "the", "instance", "the", "context", "is", "capable", "of", "performing", "various", "actions", ".", "All", "instance", "actions", "are", "proxied", "to", "the", "context" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php#L71-L81
twilio/twilio-php
Twilio/Rest/Preview/Understand/Assistant/QueryList.php
QueryList.create
public function create($language, $query, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'Query' => $query, 'Tasks' => $options['tasks'], 'ModelBuild' => $options['modelBuild'], 'Field' => $options['field'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); }
php
public function create($language, $query, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'Query' => $query, 'Tasks' => $options['tasks'], 'ModelBuild' => $options['modelBuild'], 'Field' => $options['field'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); }
[ "public", "function", "create", "(", "$", "language", ",", "$", "query", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'Language'", "=>", "$", "language", ",", "'Query'", "=>", "$", "query", ",", "'Tasks'", "=>", "$", "options", "[", "'tasks'", "]", ",", "'ModelBuild'", "=>", "$", "options", "[", "'modelBuild'", "]", ",", "'Field'", "=>", "$", "options", "[", "'field'", "]", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "create", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "QueryInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ",", "$", "this", "->", "solution", "[", "'assistantSid'", "]", ")", ";", "}" ]
Create a new QueryInstance @param string $language An ISO language-country string of the sample. @param string $query A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. @param array|Options $options Optional Arguments @return QueryInstance Newly created QueryInstance @throws TwilioException When an HTTP error occurs.
[ "Create", "a", "new", "QueryInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Preview/Understand/Assistant/QueryList.php#L141-L160
twilio/twilio-php
Twilio/Jwt/Grants/VoiceGrant.php
VoiceGrant.setOutgoingApplication
public function setOutgoingApplication($sid, $params) { $this->outgoingApplicationSid = $sid; $this->outgoingApplicationParams = $params; return $this; }
php
public function setOutgoingApplication($sid, $params) { $this->outgoingApplicationSid = $sid; $this->outgoingApplicationParams = $params; return $this; }
[ "public", "function", "setOutgoingApplication", "(", "$", "sid", ",", "$", "params", ")", "{", "$", "this", "->", "outgoingApplicationSid", "=", "$", "sid", ";", "$", "this", "->", "outgoingApplicationParams", "=", "$", "params", ";", "return", "$", "this", ";", "}" ]
Set the outgoing application of the the grant @param string $sid outgoing application sid of the grant @param string $params params to pass the the application @return $this updated grant
[ "Set", "the", "outgoing", "application", "of", "the", "the", "grant" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Jwt/Grants/VoiceGrant.php#L79-L83
twilio/twilio-php
Twilio/Jwt/Grants/VoiceGrant.php
VoiceGrant.getPayload
public function getPayload() { $payload = array(); if ($this->incomingAllow == true) { $incoming = array(); $incoming['allow'] = true; $payload['incoming'] = $incoming; } if ($this->outgoingApplicationSid) { $outgoing = array(); $outgoing['application_sid'] = $this->outgoingApplicationSid; if ($this->outgoingApplicationParams) { $outgoing['params'] = $this->outgoingApplicationParams; } $payload['outgoing'] = $outgoing; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } return $payload; }
php
public function getPayload() { $payload = array(); if ($this->incomingAllow == true) { $incoming = array(); $incoming['allow'] = true; $payload['incoming'] = $incoming; } if ($this->outgoingApplicationSid) { $outgoing = array(); $outgoing['application_sid'] = $this->outgoingApplicationSid; if ($this->outgoingApplicationParams) { $outgoing['params'] = $this->outgoingApplicationParams; } $payload['outgoing'] = $outgoing; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } return $payload; }
[ "public", "function", "getPayload", "(", ")", "{", "$", "payload", "=", "array", "(", ")", ";", "if", "(", "$", "this", "->", "incomingAllow", "==", "true", ")", "{", "$", "incoming", "=", "array", "(", ")", ";", "$", "incoming", "[", "'allow'", "]", "=", "true", ";", "$", "payload", "[", "'incoming'", "]", "=", "$", "incoming", ";", "}", "if", "(", "$", "this", "->", "outgoingApplicationSid", ")", "{", "$", "outgoing", "=", "array", "(", ")", ";", "$", "outgoing", "[", "'application_sid'", "]", "=", "$", "this", "->", "outgoingApplicationSid", ";", "if", "(", "$", "this", "->", "outgoingApplicationParams", ")", "{", "$", "outgoing", "[", "'params'", "]", "=", "$", "this", "->", "outgoingApplicationParams", ";", "}", "$", "payload", "[", "'outgoing'", "]", "=", "$", "outgoing", ";", "}", "if", "(", "$", "this", "->", "pushCredentialSid", ")", "{", "$", "payload", "[", "'push_credential_sid'", "]", "=", "$", "this", "->", "pushCredentialSid", ";", "}", "if", "(", "$", "this", "->", "endpointId", ")", "{", "$", "payload", "[", "'endpoint_id'", "]", "=", "$", "this", "->", "endpointId", ";", "}", "return", "$", "payload", ";", "}" ]
Returns the grant data @return array data of the grant
[ "Returns", "the", "grant", "data" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Jwt/Grants/VoiceGrant.php#L146-L175
twilio/twilio-php
Twilio/Rest/Chat/V2/ServiceContext.php
ServiceContext.update
public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.NewMessage.Sound' => $options['notificationsNewMessageSound'], 'Notifications.NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.AddedToChannel.Sound' => $options['notificationsAddedToChannelSound'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.RemovedFromChannel.Sound' => $options['notificationsRemovedFromChannelSound'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'Notifications.InvitedToChannel.Sound' => $options['notificationsInvitedToChannelSound'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function($e) { return $e; }), 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], 'Media.CompatibilityMessage' => $options['mediaCompatibilityMessage'], 'PreWebhookRetryCount' => $options['preWebhookRetryCount'], 'PostWebhookRetryCount' => $options['postWebhookRetryCount'], 'Notifications.LogEnabled' => Serialize::booleanToString($options['notificationsLogEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); }
php
public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.NewMessage.Sound' => $options['notificationsNewMessageSound'], 'Notifications.NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.AddedToChannel.Sound' => $options['notificationsAddedToChannelSound'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.RemovedFromChannel.Sound' => $options['notificationsRemovedFromChannelSound'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'Notifications.InvitedToChannel.Sound' => $options['notificationsInvitedToChannelSound'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function($e) { return $e; }), 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], 'Media.CompatibilityMessage' => $options['mediaCompatibilityMessage'], 'PreWebhookRetryCount' => $options['preWebhookRetryCount'], 'PostWebhookRetryCount' => $options['postWebhookRetryCount'], 'Notifications.LogEnabled' => Serialize::booleanToString($options['notificationsLogEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); }
[ "public", "function", "update", "(", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "=", "new", "Values", "(", "$", "options", ")", ";", "$", "data", "=", "Values", "::", "of", "(", "array", "(", "'FriendlyName'", "=>", "$", "options", "[", "'friendlyName'", "]", ",", "'DefaultServiceRoleSid'", "=>", "$", "options", "[", "'defaultServiceRoleSid'", "]", ",", "'DefaultChannelRoleSid'", "=>", "$", "options", "[", "'defaultChannelRoleSid'", "]", ",", "'DefaultChannelCreatorRoleSid'", "=>", "$", "options", "[", "'defaultChannelCreatorRoleSid'", "]", ",", "'ReadStatusEnabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'readStatusEnabled'", "]", ")", ",", "'ReachabilityEnabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'reachabilityEnabled'", "]", ")", ",", "'TypingIndicatorTimeout'", "=>", "$", "options", "[", "'typingIndicatorTimeout'", "]", ",", "'ConsumptionReportInterval'", "=>", "$", "options", "[", "'consumptionReportInterval'", "]", ",", "'Notifications.NewMessage.Enabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'notificationsNewMessageEnabled'", "]", ")", ",", "'Notifications.NewMessage.Template'", "=>", "$", "options", "[", "'notificationsNewMessageTemplate'", "]", ",", "'Notifications.NewMessage.Sound'", "=>", "$", "options", "[", "'notificationsNewMessageSound'", "]", ",", "'Notifications.NewMessage.BadgeCountEnabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'notificationsNewMessageBadgeCountEnabled'", "]", ")", ",", "'Notifications.AddedToChannel.Enabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'notificationsAddedToChannelEnabled'", "]", ")", ",", "'Notifications.AddedToChannel.Template'", "=>", "$", "options", "[", "'notificationsAddedToChannelTemplate'", "]", ",", "'Notifications.AddedToChannel.Sound'", "=>", "$", "options", "[", "'notificationsAddedToChannelSound'", "]", ",", "'Notifications.RemovedFromChannel.Enabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'notificationsRemovedFromChannelEnabled'", "]", ")", ",", "'Notifications.RemovedFromChannel.Template'", "=>", "$", "options", "[", "'notificationsRemovedFromChannelTemplate'", "]", ",", "'Notifications.RemovedFromChannel.Sound'", "=>", "$", "options", "[", "'notificationsRemovedFromChannelSound'", "]", ",", "'Notifications.InvitedToChannel.Enabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'notificationsInvitedToChannelEnabled'", "]", ")", ",", "'Notifications.InvitedToChannel.Template'", "=>", "$", "options", "[", "'notificationsInvitedToChannelTemplate'", "]", ",", "'Notifications.InvitedToChannel.Sound'", "=>", "$", "options", "[", "'notificationsInvitedToChannelSound'", "]", ",", "'PreWebhookUrl'", "=>", "$", "options", "[", "'preWebhookUrl'", "]", ",", "'PostWebhookUrl'", "=>", "$", "options", "[", "'postWebhookUrl'", "]", ",", "'WebhookMethod'", "=>", "$", "options", "[", "'webhookMethod'", "]", ",", "'WebhookFilters'", "=>", "Serialize", "::", "map", "(", "$", "options", "[", "'webhookFilters'", "]", ",", "function", "(", "$", "e", ")", "{", "return", "$", "e", ";", "}", ")", ",", "'Limits.ChannelMembers'", "=>", "$", "options", "[", "'limitsChannelMembers'", "]", ",", "'Limits.UserChannels'", "=>", "$", "options", "[", "'limitsUserChannels'", "]", ",", "'Media.CompatibilityMessage'", "=>", "$", "options", "[", "'mediaCompatibilityMessage'", "]", ",", "'PreWebhookRetryCount'", "=>", "$", "options", "[", "'preWebhookRetryCount'", "]", ",", "'PostWebhookRetryCount'", "=>", "$", "options", "[", "'postWebhookRetryCount'", "]", ",", "'Notifications.LogEnabled'", "=>", "Serialize", "::", "booleanToString", "(", "$", "options", "[", "'notificationsLogEnabled'", "]", ")", ",", ")", ")", ";", "$", "payload", "=", "$", "this", "->", "version", "->", "update", "(", "'POST'", ",", "$", "this", "->", "uri", ",", "array", "(", ")", ",", "$", "data", ")", ";", "return", "new", "ServiceInstance", "(", "$", "this", "->", "version", ",", "$", "payload", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}" ]
Update the ServiceInstance @param array|Options $options Optional Arguments @return ServiceInstance Updated ServiceInstance @throws TwilioException When an HTTP error occurs.
[ "Update", "the", "ServiceInstance" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V2/ServiceContext.php#L90-L135
twilio/twilio-php
Twilio/Rest/Chat/V2/ServiceContext.php
ServiceContext.getChannels
protected function getChannels() { if (!$this->_channels) { $this->_channels = new ChannelList($this->version, $this->solution['sid']); } return $this->_channels; }
php
protected function getChannels() { if (!$this->_channels) { $this->_channels = new ChannelList($this->version, $this->solution['sid']); } return $this->_channels; }
[ "protected", "function", "getChannels", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_channels", ")", "{", "$", "this", "->", "_channels", "=", "new", "ChannelList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_channels", ";", "}" ]
Access the channels @return \Twilio\Rest\Chat\V2\Service\ChannelList
[ "Access", "the", "channels" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V2/ServiceContext.php#L142-L148
twilio/twilio-php
Twilio/Rest/Chat/V2/ServiceContext.php
ServiceContext.getRoles
protected function getRoles() { if (!$this->_roles) { $this->_roles = new RoleList($this->version, $this->solution['sid']); } return $this->_roles; }
php
protected function getRoles() { if (!$this->_roles) { $this->_roles = new RoleList($this->version, $this->solution['sid']); } return $this->_roles; }
[ "protected", "function", "getRoles", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_roles", ")", "{", "$", "this", "->", "_roles", "=", "new", "RoleList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_roles", ";", "}" ]
Access the roles @return \Twilio\Rest\Chat\V2\Service\RoleList
[ "Access", "the", "roles" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V2/ServiceContext.php#L155-L161
twilio/twilio-php
Twilio/Rest/Chat/V2/ServiceContext.php
ServiceContext.getUsers
protected function getUsers() { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; }
php
protected function getUsers() { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; }
[ "protected", "function", "getUsers", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_users", ")", "{", "$", "this", "->", "_users", "=", "new", "UserList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_users", ";", "}" ]
Access the users @return \Twilio\Rest\Chat\V2\Service\UserList
[ "Access", "the", "users" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V2/ServiceContext.php#L168-L174
twilio/twilio-php
Twilio/Rest/Chat/V2/ServiceContext.php
ServiceContext.getBindings
protected function getBindings() { if (!$this->_bindings) { $this->_bindings = new BindingList($this->version, $this->solution['sid']); } return $this->_bindings; }
php
protected function getBindings() { if (!$this->_bindings) { $this->_bindings = new BindingList($this->version, $this->solution['sid']); } return $this->_bindings; }
[ "protected", "function", "getBindings", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_bindings", ")", "{", "$", "this", "->", "_bindings", "=", "new", "BindingList", "(", "$", "this", "->", "version", ",", "$", "this", "->", "solution", "[", "'sid'", "]", ")", ";", "}", "return", "$", "this", "->", "_bindings", ";", "}" ]
Access the bindings @return \Twilio\Rest\Chat\V2\Service\BindingList
[ "Access", "the", "bindings" ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/Rest/Chat/V2/ServiceContext.php#L181-L187
twilio/twilio-php
Twilio/TwiML/VoiceResponse.php
VoiceResponse.dial
public function dial($number = null, $attributes = array()) { return $this->nest(new Voice\Dial($number, $attributes)); }
php
public function dial($number = null, $attributes = array()) { return $this->nest(new Voice\Dial($number, $attributes)); }
[ "public", "function", "dial", "(", "$", "number", "=", "null", ",", "$", "attributes", "=", "array", "(", ")", ")", "{", "return", "$", "this", "->", "nest", "(", "new", "Voice", "\\", "Dial", "(", "$", "number", ",", "$", "attributes", ")", ")", ";", "}" ]
Add Dial child. @param string $number Phone number to dial @param array $attributes Optional attributes @return TwiML Child element.
[ "Add", "Dial", "child", "." ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/TwiML/VoiceResponse.php#L37-L39
twilio/twilio-php
Twilio/TwiML/VoiceResponse.php
VoiceResponse.enqueue
public function enqueue($name = null, $attributes = array()) { return $this->nest(new Voice\Enqueue($name, $attributes)); }
php
public function enqueue($name = null, $attributes = array()) { return $this->nest(new Voice\Enqueue($name, $attributes)); }
[ "public", "function", "enqueue", "(", "$", "name", "=", "null", ",", "$", "attributes", "=", "array", "(", ")", ")", "{", "return", "$", "this", "->", "nest", "(", "new", "Voice", "\\", "Enqueue", "(", "$", "name", ",", "$", "attributes", ")", ")", ";", "}" ]
Add Enqueue child. @param string $name Friendly name @param array $attributes Optional attributes @return TwiML Child element.
[ "Add", "Enqueue", "child", "." ]
train
https://github.com/twilio/twilio-php/blob/58a8322c5a8ce2ff7d68cd16ff56dc8ab44c168f/Twilio/TwiML/VoiceResponse.php#L57-L59