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 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
lode/jsonapi | src/response.php | response.add_included_resource | public function add_included_resource(\alsvanzelf\jsonapi\resource $resource) {
if (property_exists($this, 'included_resources') == false) {
throw new \Exception(get_class($this).' can not contain included resources');
}
$resource_array = $resource->get_array();
if (empty($resource_array['data']['id'])) {
ret... | php | public function add_included_resource(\alsvanzelf\jsonapi\resource $resource) {
if (property_exists($this, 'included_resources') == false) {
throw new \Exception(get_class($this).' can not contain included resources');
}
$resource_array = $resource->get_array();
if (empty($resource_array['data']['id'])) {
ret... | [
"public",
"function",
"add_included_resource",
"(",
"\\",
"alsvanzelf",
"\\",
"jsonapi",
"\\",
"resource",
"$",
"resource",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"'included_resources'",
")",
"==",
"false",
")",
"{",
"throw",
"new",
"... | adds an included resource
this will end up in response.included[]
prefer using ->add_relation() instead
a $resource should have its 'id' set
@note this can only be used by resource and collection, not by errors
@param \alsvanzelf\jsonapi\resource $resource | [
"adds",
"an",
"included",
"resource",
"this",
"will",
"end",
"up",
"in",
"response",
".",
"included",
"[]"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/response.php#L359-L397 |
lode/jsonapi | src/response.php | response.fill_included_resources | public function fill_included_resources($resources) {
if ($resources instanceof \alsvanzelf\jsonapi\collection) {
$resources = $resources->get_resources();
}
foreach ($resources as $resource) {
$this->add_included_resource($resource);
}
} | php | public function fill_included_resources($resources) {
if ($resources instanceof \alsvanzelf\jsonapi\collection) {
$resources = $resources->get_resources();
}
foreach ($resources as $resource) {
$this->add_included_resource($resource);
}
} | [
"public",
"function",
"fill_included_resources",
"(",
"$",
"resources",
")",
"{",
"if",
"(",
"$",
"resources",
"instanceof",
"\\",
"alsvanzelf",
"\\",
"jsonapi",
"\\",
"collection",
")",
"{",
"$",
"resources",
"=",
"$",
"resources",
"->",
"get_resources",
"(",... | fills the included resources
this will end up in response.included[]
prefer using ->fill_relations() instead
@param mixed $resources array of \alsvanzelf\jsonapi\resource objects
or \alsvanzelf\jsonapi\collection object
@return void | [
"fills",
"the",
"included",
"resources",
"this",
"will",
"end",
"up",
"in",
"response",
".",
"included",
"[]"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/response.php#L409-L417 |
lode/jsonapi | src/Document.php | Document.addLink | public function addLink($key, $href, array $meta=[], $level=Document::LEVEL_ROOT) {
if ($level === Document::LEVEL_ROOT) {
if ($this->links === null) {
$this->setLinksObject(new LinksObject());
}
$this->links->add($key, $href, $meta);
}
elseif ($level === Document::LEVEL_JSONAPI) {
throw new I... | php | public function addLink($key, $href, array $meta=[], $level=Document::LEVEL_ROOT) {
if ($level === Document::LEVEL_ROOT) {
if ($this->links === null) {
$this->setLinksObject(new LinksObject());
}
$this->links->add($key, $href, $meta);
}
elseif ($level === Document::LEVEL_JSONAPI) {
throw new I... | [
"public",
"function",
"addLink",
"(",
"$",
"key",
",",
"$",
"href",
",",
"array",
"$",
"meta",
"=",
"[",
"]",
",",
"$",
"level",
"=",
"Document",
"::",
"LEVEL_ROOT",
")",
"{",
"if",
"(",
"$",
"level",
"===",
"Document",
"::",
"LEVEL_ROOT",
")",
"{"... | @param string $key
@param string $href
@param array $meta optional, if given a LinkObject is added, otherwise a link string is added
@param string $level one of the Document::LEVEL_* constants, optional, defaults to Document::LEVEL_ROOT
@throws InputException if the $level is Document::LEVEL_JSONAPI, Document::LEVEL_... | [
"@param",
"string",
"$key",
"@param",
"string",
"$href",
"@param",
"array",
"$meta",
"optional",
"if",
"given",
"a",
"LinkObject",
"is",
"added",
"otherwise",
"a",
"link",
"string",
"is",
"added",
"@param",
"string",
"$level",
"one",
"of",
"the",
"Document",
... | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/Document.php#L95-L112 |
lode/jsonapi | src/Document.php | Document.setSelfLink | public function setSelfLink($href, array $meta=[], $level=Document::LEVEL_ROOT) {
$this->addLink('self', $href, $meta, $level);
} | php | public function setSelfLink($href, array $meta=[], $level=Document::LEVEL_ROOT) {
$this->addLink('self', $href, $meta, $level);
} | [
"public",
"function",
"setSelfLink",
"(",
"$",
"href",
",",
"array",
"$",
"meta",
"=",
"[",
"]",
",",
"$",
"level",
"=",
"Document",
"::",
"LEVEL_ROOT",
")",
"{",
"$",
"this",
"->",
"addLink",
"(",
"'self'",
",",
"$",
"href",
",",
"$",
"meta",
",",... | set the self link on the document
@param string $href
@param array $meta optional, if given a LinkObject is added, otherwise a link string is added
@param string $level one of the Document::LEVEL_* constants, optional, defaults to Document::LEVEL_ROOT | [
"set",
"the",
"self",
"link",
"on",
"the",
"document"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/Document.php#L121-L123 |
lode/jsonapi | src/Document.php | Document.addMeta | public function addMeta($key, $value, $level=Document::LEVEL_ROOT) {
if ($level === Document::LEVEL_ROOT) {
if ($this->meta === null) {
$this->setMetaObject(new MetaObject());
}
$this->meta->add($key, $value);
}
elseif ($level === Document::LEVEL_JSONAPI) {
if ($this->jsonapi === null) {
$... | php | public function addMeta($key, $value, $level=Document::LEVEL_ROOT) {
if ($level === Document::LEVEL_ROOT) {
if ($this->meta === null) {
$this->setMetaObject(new MetaObject());
}
$this->meta->add($key, $value);
}
elseif ($level === Document::LEVEL_JSONAPI) {
if ($this->jsonapi === null) {
$... | [
"public",
"function",
"addMeta",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"level",
"=",
"Document",
"::",
"LEVEL_ROOT",
")",
"{",
"if",
"(",
"$",
"level",
"===",
"Document",
"::",
"LEVEL_ROOT",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"meta",
"... | @param string $key
@param mixed $value
@param string $level one of the Document::LEVEL_* constants, optional, defaults to Document::LEVEL_ROOT
@throws InputException if the $level is unknown
@throws InputException if the $level is Document::LEVEL_RESOURCE | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$value",
"@param",
"string",
"$level",
"one",
"of",
"the",
"Document",
"::",
"LEVEL_",
"*",
"constants",
"optional",
"defaults",
"to",
"Document",
"::",
"LEVEL_ROOT"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/Document.php#L133-L154 |
lode/jsonapi | src/Document.php | Document.applyProfile | public function applyProfile(ProfileInterface $profile) {
$this->profiles[] = $profile;
if ($this->links === null) {
$this->setLinksObject(new LinksObject());
}
$link = $profile->getAliasedLink();
if ($link instanceof LinkObject) {
$this->links->appendLinkObject('profile', $link);
}
else {
... | php | public function applyProfile(ProfileInterface $profile) {
$this->profiles[] = $profile;
if ($this->links === null) {
$this->setLinksObject(new LinksObject());
}
$link = $profile->getAliasedLink();
if ($link instanceof LinkObject) {
$this->links->appendLinkObject('profile', $link);
}
else {
... | [
"public",
"function",
"applyProfile",
"(",
"ProfileInterface",
"$",
"profile",
")",
"{",
"$",
"this",
"->",
"profiles",
"[",
"]",
"=",
"$",
"profile",
";",
"if",
"(",
"$",
"this",
"->",
"links",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setLinksObje... | apply a profile which adds the link and sets a correct content-type
note that the rules from the profile are not automatically enforced
applying the rules, and applying them correctly, is manual
however the $profile could have custom methods to help
@see https://jsonapi.org/format/1.1/#profiles
@param ProfileInterfa... | [
"apply",
"a",
"profile",
"which",
"adds",
"the",
"link",
"and",
"sets",
"a",
"correct",
"content",
"-",
"type"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/Document.php#L192-L206 |
nicmart/StringTemplate | src/StringTemplate/Engine.php | Engine.render | public function render($template, $value)
{
$result = $template;
if (!is_array($value))
$value = array('' => $value);
foreach (new NestedKeyIterator(new RecursiveArrayOnlyIterator($value)) as $key => $value) {
$result = str_replace($this->left . $key . $this->right, ... | php | public function render($template, $value)
{
$result = $template;
if (!is_array($value))
$value = array('' => $value);
foreach (new NestedKeyIterator(new RecursiveArrayOnlyIterator($value)) as $key => $value) {
$result = str_replace($this->left . $key . $this->right, ... | [
"public",
"function",
"render",
"(",
"$",
"template",
",",
"$",
"value",
")",
"{",
"$",
"result",
"=",
"$",
"template",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"$",
"value",
"=",
"array",
"(",
"''",
"=>",
"$",
"value",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/nicmart/StringTemplate/blob/612eeb821b33c0b67d3755a5b24471e30d4d737b/src/StringTemplate/Engine.php#L29-L40 |
lode/jsonapi | src/objects/ErrorObject.php | ErrorObject.fromException | public static function fromException($exception, array $options=[]) {
if ($exception instanceof \Exception === false && $exception instanceof \Throwable === false) {
throw new InputException('input is not a real exception in php5 or php7');
}
$options = array_merge(self::$defaults, $options);
$errorObj... | php | public static function fromException($exception, array $options=[]) {
if ($exception instanceof \Exception === false && $exception instanceof \Throwable === false) {
throw new InputException('input is not a real exception in php5 or php7');
}
$options = array_merge(self::$defaults, $options);
$errorObj... | [
"public",
"static",
"function",
"fromException",
"(",
"$",
"exception",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"exception",
"instanceof",
"\\",
"Exception",
"===",
"false",
"&&",
"$",
"exception",
"instanceof",
"\\",
"Throwa... | @param \Exception|\Throwable $exception
@param array $options optional {@see ErrorObject::$defaults}
@return ErrorObject
@throws InputException if $exception is not \Exception or \Throwable | [
"@param",
"\\",
"Exception|",
"\\",
"Throwable",
"$exception",
"@param",
"array",
"$options",
"optional",
"{",
"@see",
"ErrorObject",
"::",
"$defaults",
"}",
"@return",
"ErrorObject"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/ErrorObject.php#L71-L120 |
lode/jsonapi | src/objects/ErrorObject.php | ErrorObject.setHumanExplanation | public function setHumanExplanation($genericTitle, $specificDetails=null, $specificAboutLink=null, $genericTypeLink=null) {
$this->setHumanTitle($genericTitle);
if ($specificDetails !== null) {
$this->setHumanDetails($specificDetails);
}
if ($specificAboutLink !== null) {
$this->setAboutLink($specificA... | php | public function setHumanExplanation($genericTitle, $specificDetails=null, $specificAboutLink=null, $genericTypeLink=null) {
$this->setHumanTitle($genericTitle);
if ($specificDetails !== null) {
$this->setHumanDetails($specificDetails);
}
if ($specificAboutLink !== null) {
$this->setAboutLink($specificA... | [
"public",
"function",
"setHumanExplanation",
"(",
"$",
"genericTitle",
",",
"$",
"specificDetails",
"=",
"null",
",",
"$",
"specificAboutLink",
"=",
"null",
",",
"$",
"genericTypeLink",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setHumanTitle",
"(",
"$",
"ge... | explain this particular occurence of the error in a human-friendly way
@param string $genericTitle title of the generic type of error
@param string $specificDetails optional, explanation of the specific error
@param string $specificAboutLink optional, explanation of the specific error
@param string $genericType... | [
"explain",
"this",
"particular",
"occurence",
"of",
"the",
"error",
"in",
"a",
"human",
"-",
"friendly",
"way"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/ErrorObject.php#L130-L142 |
lode/jsonapi | src/objects/ErrorObject.php | ErrorObject.addSource | public function addSource($key, $value) {
Validator::checkMemberName($key);
$this->source[$key] = $value;
} | php | public function addSource($key, $value) {
Validator::checkMemberName($key);
$this->source[$key] = $value;
} | [
"public",
"function",
"addSource",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"Validator",
"::",
"checkMemberName",
"(",
"$",
"key",
")",
";",
"$",
"this",
"->",
"source",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}"
] | add the source of the error
@param string $key {@see ->blameJsonPointer(), ->blameQueryParameter()}
@param string $value | [
"add",
"the",
"source",
"of",
"the",
"error"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/ErrorObject.php#L225-L229 |
lode/jsonapi | src/objects/ResourceIdentifierObject.php | ResourceIdentifierObject.fromResourceObject | public static function fromResourceObject(ResourceObject $resourceObject) {
$resourceIdentifierObject = new self($resourceObject->type, $resourceObject->id);
if ($resourceObject->meta !== null) {
$resourceIdentifierObject->setMetaObject($resourceObject->meta);
}
return $resourceIdentifierObject;
} | php | public static function fromResourceObject(ResourceObject $resourceObject) {
$resourceIdentifierObject = new self($resourceObject->type, $resourceObject->id);
if ($resourceObject->meta !== null) {
$resourceIdentifierObject->setMetaObject($resourceObject->meta);
}
return $resourceIdentifierObject;
} | [
"public",
"static",
"function",
"fromResourceObject",
"(",
"ResourceObject",
"$",
"resourceObject",
")",
"{",
"$",
"resourceIdentifierObject",
"=",
"new",
"self",
"(",
"$",
"resourceObject",
"->",
"type",
",",
"$",
"resourceObject",
"->",
"id",
")",
";",
"if",
... | @internal
@param ResourceObject $resourceObject
@return ResourceIdentifierObject | [
"@internal"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/ResourceIdentifierObject.php#L98-L106 |
lode/jsonapi | src/objects/ResourceIdentifierObject.php | ResourceIdentifierObject.equals | public function equals(ResourceInterface $resource) {
if ($this->hasIdentification() === false || $resource->getResource()->hasIdentification() === false) {
throw new Exception('can not compare resources if identification is missing');
}
return ($this->getIdentificationKey() === $resource->getResource()->ge... | php | public function equals(ResourceInterface $resource) {
if ($this->hasIdentification() === false || $resource->getResource()->hasIdentification() === false) {
throw new Exception('can not compare resources if identification is missing');
}
return ($this->getIdentificationKey() === $resource->getResource()->ge... | [
"public",
"function",
"equals",
"(",
"ResourceInterface",
"$",
"resource",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasIdentification",
"(",
")",
"===",
"false",
"||",
"$",
"resource",
"->",
"getResource",
"(",
")",
"->",
"hasIdentification",
"(",
")",
"==... | @internal
@param ResourceInterface $resource
@return boolean
@throws Exception if one or both are missing identification | [
"@internal"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/ResourceIdentifierObject.php#L116-L122 |
lode/jsonapi | src/helpers/HttpStatusCodeManager.php | HttpStatusCodeManager.setHttpStatusCode | public function setHttpStatusCode($httpStatusCode) {
if (Validator::checkHttpStatusCode($httpStatusCode) === false) {
throw new InputException('can not use an invalid http status code');
}
$this->httpStatusCode = $httpStatusCode;
} | php | public function setHttpStatusCode($httpStatusCode) {
if (Validator::checkHttpStatusCode($httpStatusCode) === false) {
throw new InputException('can not use an invalid http status code');
}
$this->httpStatusCode = $httpStatusCode;
} | [
"public",
"function",
"setHttpStatusCode",
"(",
"$",
"httpStatusCode",
")",
"{",
"if",
"(",
"Validator",
"::",
"checkHttpStatusCode",
"(",
"$",
"httpStatusCode",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"InputException",
"(",
"'can not use an invalid http stat... | @param int $httpStatusCode
@throws InputException if an invalid code is used | [
"@param",
"int",
"$httpStatusCode"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/helpers/HttpStatusCodeManager.php#L21-L27 |
lode/jsonapi | src/helpers/Validator.php | Validator.claimUsedFields | public function claimUsedFields(array $fieldNames, $objectContainer, array $options=[]) {
$options = array_merge(self::$defaults, $options);
foreach ($fieldNames as $fieldName) {
if (isset($this->usedFields[$fieldName]) === false) {
$this->usedFields[$fieldName] = $objectContainer;
continue;
}
i... | php | public function claimUsedFields(array $fieldNames, $objectContainer, array $options=[]) {
$options = array_merge(self::$defaults, $options);
foreach ($fieldNames as $fieldName) {
if (isset($this->usedFields[$fieldName]) === false) {
$this->usedFields[$fieldName] = $objectContainer;
continue;
}
i... | [
"public",
"function",
"claimUsedFields",
"(",
"array",
"$",
"fieldNames",
",",
"$",
"objectContainer",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"self",
"::",
"$",
"defaults",
",",
"$",
"options",
")"... | block if already existing in another object, otherwise just overwrite
@see https://jsonapi.org/format/1.1/#document-resource-object-fields
@param string[] $fieldName
@param string $objectContainer one of the Validator::OBJECT_CONTAINER_* constants
@param array $options optional {@see Validator::$defau... | [
"block",
"if",
"already",
"existing",
"in",
"another",
"object",
"otherwise",
"just",
"overwrite"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/helpers/Validator.php#L43-L64 |
lode/jsonapi | src/helpers/Validator.php | Validator.claimUsedResourceIdentifier | public function claimUsedResourceIdentifier(ResourceInterface $resource) {
if ($resource->getResource()->hasIdentification() === false) {
throw new InputException('can not validate resource without identifier, set type and id first');
}
$resourceKey = $resource->getResource()->getIdentificationKey();
if (... | php | public function claimUsedResourceIdentifier(ResourceInterface $resource) {
if ($resource->getResource()->hasIdentification() === false) {
throw new InputException('can not validate resource without identifier, set type and id first');
}
$resourceKey = $resource->getResource()->getIdentificationKey();
if (... | [
"public",
"function",
"claimUsedResourceIdentifier",
"(",
"ResourceInterface",
"$",
"resource",
")",
"{",
"if",
"(",
"$",
"resource",
"->",
"getResource",
"(",
")",
"->",
"hasIdentification",
"(",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"InputException",
... | @param ResourceInterface $resource
@throws InputException if no type or id has been set on the resource
@throws DuplicateException if the combination of type and id has been set before | [
"@param",
"ResourceInterface",
"$resource"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/helpers/Validator.php#L85-L97 |
lode/jsonapi | src/helpers/Validator.php | Validator.checkMemberName | public static function checkMemberName($memberName) {
$globallyAllowedCharacters = 'a-zA-Z0-9';
$generallyAllowedCharacters = $globallyAllowedCharacters.'_-';
$regex = '{^
(
['.$globallyAllowedCharacters.']
|
['.$globallyAllowedCharacters.']
['.$generallyAllowedCharacters.']*
... | php | public static function checkMemberName($memberName) {
$globallyAllowedCharacters = 'a-zA-Z0-9';
$generallyAllowedCharacters = $globallyAllowedCharacters.'_-';
$regex = '{^
(
['.$globallyAllowedCharacters.']
|
['.$globallyAllowedCharacters.']
['.$generallyAllowedCharacters.']*
... | [
"public",
"static",
"function",
"checkMemberName",
"(",
"$",
"memberName",
")",
"{",
"$",
"globallyAllowedCharacters",
"=",
"'a-zA-Z0-9'",
";",
"$",
"generallyAllowedCharacters",
"=",
"$",
"globallyAllowedCharacters",
".",
"'_-'",
";",
"$",
"regex",
"=",
"'{^\n\t\t\... | @see https://jsonapi.org/format/1.1/#document-member-names
@todo allow non-url safe chars
@param string $memberName
@throws InputException | [
"@see",
"https",
":",
"//",
"jsonapi",
".",
"org",
"/",
"format",
"/",
"1",
".",
"1",
"/",
"#document",
"-",
"member",
"-",
"names"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/helpers/Validator.php#L108-L129 |
lode/jsonapi | src/objects/AttributesObject.php | AttributesObject.fromArray | public static function fromArray(array $attributes) {
unset($attributes['id']);
$attributesObject = new self();
foreach ($attributes as $key => $value) {
$attributesObject->add($key, $value);
}
return $attributesObject;
} | php | public static function fromArray(array $attributes) {
unset($attributes['id']);
$attributesObject = new self();
foreach ($attributes as $key => $value) {
$attributesObject->add($key, $value);
}
return $attributesObject;
} | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"attributes",
")",
"{",
"unset",
"(",
"$",
"attributes",
"[",
"'id'",
"]",
")",
";",
"$",
"attributesObject",
"=",
"new",
"self",
"(",
")",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$... | @note if an `id` is set inside $attributes, it is removed from there
it is common to find it inside, and not doing so will cause an exception
@param array $attributes
@return AttributesObject | [
"@note",
"if",
"an",
"id",
"is",
"set",
"inside",
"$attributes",
"it",
"is",
"removed",
"from",
"there",
"it",
"is",
"common",
"to",
"find",
"it",
"inside",
"and",
"not",
"doing",
"so",
"will",
"cause",
"an",
"exception"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/AttributesObject.php#L27-L37 |
lode/jsonapi | src/objects/LinksObject.php | LinksObject.append | public function append($key, $href, array $meta=[]) {
Validator::checkMemberName($key);
if (isset($this->links[$key]) === false) {
$this->addLinksArray($key, new LinksArray());
}
elseif ($this->links[$key] instanceof LinksArray === false) {
throw new DuplicateException('can not add to key "'.$key.'", i... | php | public function append($key, $href, array $meta=[]) {
Validator::checkMemberName($key);
if (isset($this->links[$key]) === false) {
$this->addLinksArray($key, new LinksArray());
}
elseif ($this->links[$key] instanceof LinksArray === false) {
throw new DuplicateException('can not add to key "'.$key.'", i... | [
"public",
"function",
"append",
"(",
"$",
"key",
",",
"$",
"href",
",",
"array",
"$",
"meta",
"=",
"[",
"]",
")",
"{",
"Validator",
"::",
"checkMemberName",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",... | appends a link to an array of links under a specific key
@see LinksArray for use cases
@param string $key
@param string $href
@param array $meta optional, if given a LinkObject is added, otherwise a link string is added
@throws DuplicateException if another link is already using that $key but is not an array | [
"appends",
"a",
"link",
"to",
"an",
"array",
"of",
"links",
"under",
"a",
"specific",
"key"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/LinksObject.php#L72-L83 |
lode/jsonapi | src/objects/LinksObject.php | LinksObject.addLinkString | public function addLinkString($key, $href) {
Validator::checkMemberName($key);
if (isset($this->links[$key])) {
throw new DuplicateException('link with key "'.$key.'" already set');
}
$this->links[$key] = $href;
} | php | public function addLinkString($key, $href) {
Validator::checkMemberName($key);
if (isset($this->links[$key])) {
throw new DuplicateException('link with key "'.$key.'" already set');
}
$this->links[$key] = $href;
} | [
"public",
"function",
"addLinkString",
"(",
"$",
"key",
",",
"$",
"href",
")",
"{",
"Validator",
"::",
"checkMemberName",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",
"key",
"]",
")",
")",
"{",
"throw",
... | @param string $key
@param string $href
@throws DuplicateException if another link is already using that $key | [
"@param",
"string",
"$key",
"@param",
"string",
"$href"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/LinksObject.php#L95-L103 |
lode/jsonapi | src/objects/LinksObject.php | LinksObject.addLinkObject | public function addLinkObject($key, LinkObject $linkObject) {
Validator::checkMemberName($key);
if (isset($this->links[$key])) {
throw new DuplicateException('link with key "'.$key.'" already set');
}
$this->links[$key] = $linkObject;
} | php | public function addLinkObject($key, LinkObject $linkObject) {
Validator::checkMemberName($key);
if (isset($this->links[$key])) {
throw new DuplicateException('link with key "'.$key.'" already set');
}
$this->links[$key] = $linkObject;
} | [
"public",
"function",
"addLinkObject",
"(",
"$",
"key",
",",
"LinkObject",
"$",
"linkObject",
")",
"{",
"Validator",
"::",
"checkMemberName",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",
"key",
"]",
")",
"... | @param string $key
@param LinkObject $linkObject
@throws DuplicateException if another link is already using that $key | [
"@param",
"string",
"$key",
"@param",
"LinkObject",
"$linkObject"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/LinksObject.php#L111-L119 |
lode/jsonapi | src/objects/LinksObject.php | LinksObject.addLinksArray | public function addLinksArray($key, LinksArray $linksArray) {
Validator::checkMemberName($key);
if (isset($this->links[$key])) {
throw new DuplicateException('link with key "'.$key.'" already set');
}
$this->links[$key] = $linksArray;
} | php | public function addLinksArray($key, LinksArray $linksArray) {
Validator::checkMemberName($key);
if (isset($this->links[$key])) {
throw new DuplicateException('link with key "'.$key.'" already set');
}
$this->links[$key] = $linksArray;
} | [
"public",
"function",
"addLinksArray",
"(",
"$",
"key",
",",
"LinksArray",
"$",
"linksArray",
")",
"{",
"Validator",
"::",
"checkMemberName",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",
"key",
"]",
")",
"... | @param string $key
@param LinksArray $linksArray
@throws DuplicateException if another link is already using that $key | [
"@param",
"string",
"$key",
"@param",
"LinksArray",
"$linksArray"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/LinksObject.php#L127-L135 |
lode/jsonapi | src/objects/LinksObject.php | LinksObject.appendLinkObject | public function appendLinkObject($key, LinkObject $linkObject) {
Validator::checkMemberName($key);
if (isset($this->links[$key]) === false) {
$this->addLinksArray($key, new LinksArray());
}
elseif ($this->links[$key] instanceof LinksArray === false) {
throw new DuplicateException('can not add to key "'... | php | public function appendLinkObject($key, LinkObject $linkObject) {
Validator::checkMemberName($key);
if (isset($this->links[$key]) === false) {
$this->addLinksArray($key, new LinksArray());
}
elseif ($this->links[$key] instanceof LinksArray === false) {
throw new DuplicateException('can not add to key "'... | [
"public",
"function",
"appendLinkObject",
"(",
"$",
"key",
",",
"LinkObject",
"$",
"linkObject",
")",
"{",
"Validator",
"::",
"checkMemberName",
"(",
"$",
"key",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",
"key",
"]",
")",
... | @param string $key
@param LinkObject $linkObject
@throws DuplicateException if another link is already using that $key but is not an array | [
"@param",
"string",
"$key",
"@param",
"LinkObject",
"$linkObject"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/objects/LinksObject.php#L143-L154 |
lode/jsonapi | src/DataDocument.php | DataDocument.addIncludedResourceObject | public function addIncludedResourceObject(ResourceObject ...$resourceObjects) {
foreach ($resourceObjects as $resourceObject) {
try {
$this->validator->claimUsedResourceIdentifier($resourceObject);
}
catch (DuplicateException $e) {
// silently skip duplicates
continue;
}
$this->included... | php | public function addIncludedResourceObject(ResourceObject ...$resourceObjects) {
foreach ($resourceObjects as $resourceObject) {
try {
$this->validator->claimUsedResourceIdentifier($resourceObject);
}
catch (DuplicateException $e) {
// silently skip duplicates
continue;
}
$this->included... | [
"public",
"function",
"addIncludedResourceObject",
"(",
"ResourceObject",
"...",
"$",
"resourceObjects",
")",
"{",
"foreach",
"(",
"$",
"resourceObjects",
"as",
"$",
"resourceObject",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"validator",
"->",
"claimUsedResourceId... | mainly used when an `included` query parameter is passed
and resources are requested separate from what is standard for a response
@param ResourceObject ...$resourceObjects | [
"mainly",
"used",
"when",
"an",
"included",
"query",
"parameter",
"is",
"passed",
"and",
"resources",
"are",
"requested",
"separate",
"from",
"what",
"is",
"standard",
"for",
"a",
"response"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/DataDocument.php#L39-L51 |
lode/jsonapi | examples/bootstrap_examples.php | ExampleVersionProfile.setVersion | public function setVersion(ResourceInterface $resource, $version) {
if ($resource instanceof ResourceDocument) {
$resource->addMeta($this->getKeyword('version'), $version, $level=Document::LEVEL_RESOURCE);
}
else {
$resource->addMeta($this->getKeyword('version'), $version);
}
} | php | public function setVersion(ResourceInterface $resource, $version) {
if ($resource instanceof ResourceDocument) {
$resource->addMeta($this->getKeyword('version'), $version, $level=Document::LEVEL_RESOURCE);
}
else {
$resource->addMeta($this->getKeyword('version'), $version);
}
} | [
"public",
"function",
"setVersion",
"(",
"ResourceInterface",
"$",
"resource",
",",
"$",
"version",
")",
"{",
"if",
"(",
"$",
"resource",
"instanceof",
"ResourceDocument",
")",
"{",
"$",
"resource",
"->",
"addMeta",
"(",
"$",
"this",
"->",
"getKeyword",
"(",... | optionally helpers for the specific profile | [
"optionally",
"helpers",
"for",
"the",
"specific",
"profile"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/examples/bootstrap_examples.php#L122-L129 |
lode/jsonapi | src/ResourceDocument.php | ResourceDocument.add | public function add($key, $value, array $options=[]) {
$this->ensureResourceObject();
$this->resource->add($key, $value, $options);
} | php | public function add($key, $value, array $options=[]) {
$this->ensureResourceObject();
$this->resource->add($key, $value, $options);
} | [
"public",
"function",
"add",
"(",
"$",
"key",
",",
"$",
"value",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"ensureResourceObject",
"(",
")",
";",
"$",
"this",
"->",
"resource",
"->",
"add",
"(",
"$",
"key",
",",
"$... | add key-value pairs to the resource's attributes
@param string $key
@param mixed $value objects will be converted using `get_object_vars()`
@param array $options optional {@see ResourceDocument::$defaults} | [
"add",
"key",
"-",
"value",
"pairs",
"to",
"the",
"resource",
"s",
"attributes"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/ResourceDocument.php#L87-L91 |
lode/jsonapi | src/ResourceDocument.php | ResourceDocument.addRelationship | public function addRelationship($key, $relation, array $links=[], array $meta=[], array $options=[]) {
$this->ensureResourceObject();
$options = array_merge(self::$defaults, $options);
$relationshipObject = $this->resource->addRelationship($key, $relation, $links, $meta);
if ($options['includeContained... | php | public function addRelationship($key, $relation, array $links=[], array $meta=[], array $options=[]) {
$this->ensureResourceObject();
$options = array_merge(self::$defaults, $options);
$relationshipObject = $this->resource->addRelationship($key, $relation, $links, $meta);
if ($options['includeContained... | [
"public",
"function",
"addRelationship",
"(",
"$",
"key",
",",
"$",
"relation",
",",
"array",
"$",
"links",
"=",
"[",
"]",
",",
"array",
"$",
"meta",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"ensure... | add a relation to the resource
adds included resources if found inside the relation, unless $options['includeContainedResources'] is set to false
@param string $key
@param mixed $relation ResourceInterface | ResourceInterface[] | CollectionDocument
@param array $links optional
@param array $meta optiona... | [
"add",
"a",
"relation",
"to",
"the",
"resource"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/ResourceDocument.php#L104-L114 |
lode/jsonapi | src/ResourceDocument.php | ResourceDocument.setSelfLink | public function setSelfLink($href, array $meta=[], $level=Document::LEVEL_RESOURCE) {
$this->ensureResourceObject();
if ($level === Document::LEVEL_RESOURCE) {
$this->resource->setSelfLink($href, $meta);
}
else {
parent::setSelfLink($href, $meta, $level);
}
} | php | public function setSelfLink($href, array $meta=[], $level=Document::LEVEL_RESOURCE) {
$this->ensureResourceObject();
if ($level === Document::LEVEL_RESOURCE) {
$this->resource->setSelfLink($href, $meta);
}
else {
parent::setSelfLink($href, $meta, $level);
}
} | [
"public",
"function",
"setSelfLink",
"(",
"$",
"href",
",",
"array",
"$",
"meta",
"=",
"[",
"]",
",",
"$",
"level",
"=",
"Document",
"::",
"LEVEL_RESOURCE",
")",
"{",
"$",
"this",
"->",
"ensureResourceObject",
"(",
")",
";",
"if",
"(",
"$",
"level",
... | set the self link on the resource
@param string $href
@param array $meta optional | [
"set",
"the",
"self",
"link",
"on",
"the",
"resource"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/ResourceDocument.php#L139-L148 |
lode/jsonapi | src/ResourceDocument.php | ResourceDocument.addRelationshipObject | public function addRelationshipObject($key, RelationshipObject $relationshipObject, array $options=[]) {
$this->ensureResourceObject();
$options = array_merge(self::$defaults, $options);
$this->resource->addRelationshipObject($key, $relationshipObject);
if ($options['includeContainedResources']) {
$... | php | public function addRelationshipObject($key, RelationshipObject $relationshipObject, array $options=[]) {
$this->ensureResourceObject();
$options = array_merge(self::$defaults, $options);
$this->resource->addRelationshipObject($key, $relationshipObject);
if ($options['includeContainedResources']) {
$... | [
"public",
"function",
"addRelationshipObject",
"(",
"$",
"key",
",",
"RelationshipObject",
"$",
"relationshipObject",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"ensureResourceObject",
"(",
")",
";",
"$",
"options",
"=",
"array... | add a RelationshipObject to the resource
adds included resources if found inside the RelationshipObject, unless $options['includeContainedResources'] is set to false
@param string $key
@param RelationshipObject $relationshipObject
@param array $options optional {@see ResourceDocume... | [
"add",
"a",
"RelationshipObject",
"to",
"the",
"resource"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/ResourceDocument.php#L201-L211 |
lode/jsonapi | src/ResourceDocument.php | ResourceDocument.setRelationshipsObject | public function setRelationshipsObject(RelationshipsObject $relationshipsObject, array $options=[]) {
$this->ensureResourceObject();
$options = array_merge(self::$defaults, $options);
$this->resource->setRelationshipsObject($relationshipsObject);
if ($options['includeContainedResources']) {
$this->a... | php | public function setRelationshipsObject(RelationshipsObject $relationshipsObject, array $options=[]) {
$this->ensureResourceObject();
$options = array_merge(self::$defaults, $options);
$this->resource->setRelationshipsObject($relationshipsObject);
if ($options['includeContainedResources']) {
$this->a... | [
"public",
"function",
"setRelationshipsObject",
"(",
"RelationshipsObject",
"$",
"relationshipsObject",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"ensureResourceObject",
"(",
")",
";",
"$",
"options",
"=",
"array_merge",
"(",
"s... | set the RelationshipsObject to the resource
adds included resources if found inside the RelationshipObjects inside the RelationshipsObject, unless $options['includeContainedResources'] is set to false
@param RelationshipsObject $relationshipsObject
@param array $options optional {@see Resour... | [
"set",
"the",
"RelationshipsObject",
"to",
"the",
"resource"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/ResourceDocument.php#L221-L231 |
lode/jsonapi | src/ResourceDocument.php | ResourceDocument.setPrimaryResource | public function setPrimaryResource(ResourceInterface $resource, array $options=[]) {
if ($resource instanceof ResourceDocument) {
throw new InputException('does not make sense to set a document inside a document, use ResourceObject or ResourceIdentifierObject instead');
}
$options = array_merge(self::$defau... | php | public function setPrimaryResource(ResourceInterface $resource, array $options=[]) {
if ($resource instanceof ResourceDocument) {
throw new InputException('does not make sense to set a document inside a document, use ResourceObject or ResourceIdentifierObject instead');
}
$options = array_merge(self::$defau... | [
"public",
"function",
"setPrimaryResource",
"(",
"ResourceInterface",
"$",
"resource",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"resource",
"instanceof",
"ResourceDocument",
")",
"{",
"throw",
"new",
"InputException",
"(",
"'does ... | overwrites the primary resource
adds included resources if found inside the resource's relationships, unless $options['includeContainedResources'] is set to false
@param ResourceInterface $resource
@param array $options optional {@see ResourceDocument::$defaults}
@throws InputException if the $resource ... | [
"overwrites",
"the",
"primary",
"resource"
] | train | https://github.com/lode/jsonapi/blob/6a96d5e4164338e3bd025058a56b40d53af5b3d1/src/ResourceDocument.php#L247-L259 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.listServers | function listServers($count = 100, $offset = 0, $name = NULL) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
$query['name'] = $name;
return new DynamicResponseModel($this->processRestRequest('GET', '/servers/', $query));
} | php | function listServers($count = 100, $offset = 0, $name = NULL) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
$query['name'] = $name;
return new DynamicResponseModel($this->processRestRequest('GET', '/servers/', $query));
} | [
"function",
"listServers",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"name",
"=",
"NULL",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"'count'",
"]",
"=",
"$",
"count",
";",
"$",
"query",... | Get a list of all servers configured on the account.
@param integer $count The number of servers to retrieve in the request, defaults to 100.
@param integer $offset The number of servers to "skip" when paging through lists of servers.
@param string $name Filter by server name.
@return DynamicResponseModel | [
"Get",
"a",
"list",
"of",
"all",
"servers",
"configured",
"on",
"the",
"account",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L46-L53 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.editServer | function editServer($id, $name = NULL, $color = NULL,
$rawEmailEnabled = NULL, $smtpApiActivated = NULL, $inboundHookUrl = NULL,
$bounceHookUrl = NULL, $openHookUrl = NULL, $postFirstOpenOnly = NULL,
$trackOpens = NULL, $inboundDomain = NULL, $inboundSpamThreshold = NULL,
$trackLinks = NULL, $clickHookUrl = NU... | php | function editServer($id, $name = NULL, $color = NULL,
$rawEmailEnabled = NULL, $smtpApiActivated = NULL, $inboundHookUrl = NULL,
$bounceHookUrl = NULL, $openHookUrl = NULL, $postFirstOpenOnly = NULL,
$trackOpens = NULL, $inboundDomain = NULL, $inboundSpamThreshold = NULL,
$trackLinks = NULL, $clickHookUrl = NU... | [
"function",
"editServer",
"(",
"$",
"id",
",",
"$",
"name",
"=",
"NULL",
",",
"$",
"color",
"=",
"NULL",
",",
"$",
"rawEmailEnabled",
"=",
"NULL",
",",
"$",
"smtpApiActivated",
"=",
"NULL",
",",
"$",
"inboundHookUrl",
"=",
"NULL",
",",
"$",
"bounceHook... | Modify an existing Server. Any parameters passed with NULL will be
ignored (their existing values will not be modified).
@param integer $id The ID of the Server we wish to modify.
@param string $name Set the name of the server.
@param string $color Set the color for the server in the Postmark WebUI (must be: 'purple',... | [
"Modify",
"an",
"existing",
"Server",
".",
"Any",
"parameters",
"passed",
"with",
"NULL",
"will",
"be",
"ignored",
"(",
"their",
"existing",
"values",
"will",
"not",
"be",
"modified",
")",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L89-L116 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.listSenderSignatures | function listSenderSignatures($count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', '/senders/', $query));
} | php | function listSenderSignatures($count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', '/senders/', $query));
} | [
"function",
"listSenderSignatures",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"'count'",
"]",
"=",
"$",
"count",
";",
"$",
"query",
"[",
"'offset'",
"]",
"... | Get a "page" of Sender Signatures.
@param integer $count The number of Sender Signatures to retrieve with this request.
param integer $offset The number of Sender Signatures to 'skip' when 'paging' through them.
@return DynamicResponseModel | [
"Get",
"a",
"page",
"of",
"Sender",
"Signatures",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L173-L180 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.createSenderSignature | function createSenderSignature($fromEmail, $name, $replyToEmail = NULL, $returnPathDomain = NULL) {
$body = array();
$body['fromEmail'] = $fromEmail;
$body['name'] = $name;
$body['replyToEmail'] = $replyToEmail;
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processR... | php | function createSenderSignature($fromEmail, $name, $replyToEmail = NULL, $returnPathDomain = NULL) {
$body = array();
$body['fromEmail'] = $fromEmail;
$body['name'] = $name;
$body['replyToEmail'] = $replyToEmail;
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processR... | [
"function",
"createSenderSignature",
"(",
"$",
"fromEmail",
",",
"$",
"name",
",",
"$",
"replyToEmail",
"=",
"NULL",
",",
"$",
"returnPathDomain",
"=",
"NULL",
")",
"{",
"$",
"body",
"=",
"array",
"(",
")",
";",
"$",
"body",
"[",
"'fromEmail'",
"]",
"=... | Create a new Sender Signature for a given email address. Note that you will need to
"verify" this Sender Signature by following a link that will be emailed to the "fromEmail"
address specified when calling this method.
@param string $fromEmail The email address for the Sender Signature
@param string $name The name o... | [
"Create",
"a",
"new",
"Sender",
"Signature",
"for",
"a",
"given",
"email",
"address",
".",
"Note",
"that",
"you",
"will",
"need",
"to",
"verify",
"this",
"Sender",
"Signature",
"by",
"following",
"a",
"link",
"that",
"will",
"be",
"emailed",
"to",
"the",
... | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L203-L212 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.editSenderSignature | function editSenderSignature($id, $name = NULL, $replyToEmail = NULL, $returnPathDomain = NULL) {
$body = array();
$body['name'] = $name;
$body['replyToEmail'] = $replyToEmail;
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processRestRequest('PUT', "/senders/$id", $bo... | php | function editSenderSignature($id, $name = NULL, $replyToEmail = NULL, $returnPathDomain = NULL) {
$body = array();
$body['name'] = $name;
$body['replyToEmail'] = $replyToEmail;
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processRestRequest('PUT', "/senders/$id", $bo... | [
"function",
"editSenderSignature",
"(",
"$",
"id",
",",
"$",
"name",
"=",
"NULL",
",",
"$",
"replyToEmail",
"=",
"NULL",
",",
"$",
"returnPathDomain",
"=",
"NULL",
")",
"{",
"$",
"body",
"=",
"array",
"(",
")",
";",
"$",
"body",
"[",
"'name'",
"]",
... | Alter the defaults for a Sender Signature.
@param integer $id The ID for the Sender Signature we wish to modify.
@param string $name The name of the Sender Signature.
@param string $replyToEmail The reply-to email address for the Sender Signature.
@param string $returnPathDomain The custom Return-Path domain for t... | [
"Alter",
"the",
"defaults",
"for",
"a",
"Sender",
"Signature",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L223-L231 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.listDomains | function listDomains($count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', '/domains/', $query));
} | php | function listDomains($count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', '/domains/', $query));
} | [
"function",
"listDomains",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"'count'",
"]",
"=",
"$",
"count",
";",
"$",
"query",
"[",
"'offset'",
"]",
"=",
"$"... | Get a "page" of Domains.
@param integer $count The number of Domains to retrieve with this request.
param integer $offset The number of Domains to 'skip' when 'paging' through them.
@return DynamicResponseModel | [
"Get",
"a",
"page",
"of",
"Domains",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L287-L294 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.createDomain | function createDomain($name, $returnPathDomain = NULL) {
$body = array();
$body['name'] = $name;
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processRestRequest('POST', '/domains/', $body));
} | php | function createDomain($name, $returnPathDomain = NULL) {
$body = array();
$body['name'] = $name;
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processRestRequest('POST', '/domains/', $body));
} | [
"function",
"createDomain",
"(",
"$",
"name",
",",
"$",
"returnPathDomain",
"=",
"NULL",
")",
"{",
"$",
"body",
"=",
"array",
"(",
")",
";",
"$",
"body",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"$",
"body",
"[",
"'returnPathDomain'",
"]",
"=",
"... | Create a new Domain with the given Name.
@param string $name The name of the Domain.
@param string $returnPathDomain The custom Return-Path domain for the Sender Signature.
@return DynamicResponseModel | [
"Create",
"a",
"new",
"Domain",
"with",
"the",
"given",
"Name",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L314-L320 |
wildbit/postmark-php | src/Postmark/PostmarkAdminClient.php | PostmarkAdminClient.editDomain | function editDomain($id, $returnPathDomain = NULL) {
$body = array();
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processRestRequest('PUT', "/domains/$id", $body));
} | php | function editDomain($id, $returnPathDomain = NULL) {
$body = array();
$body['returnPathDomain'] = $returnPathDomain;
return new DynamicResponseModel($this->processRestRequest('PUT', "/domains/$id", $body));
} | [
"function",
"editDomain",
"(",
"$",
"id",
",",
"$",
"returnPathDomain",
"=",
"NULL",
")",
"{",
"$",
"body",
"=",
"array",
"(",
")",
";",
"$",
"body",
"[",
"'returnPathDomain'",
"]",
"=",
"$",
"returnPathDomain",
";",
"return",
"new",
"DynamicResponseModel"... | Alter the properties of a Domain.
@param integer $id The ID for the Domain we wish to modify.
@param string $returnPathDomain The custom Return-Path domain for the Domain.
@return DynamicResponseModel | [
"Alter",
"the",
"properties",
"of",
"a",
"Domain",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkAdminClient.php#L329-L335 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.sendEmail | function sendEmail($from, $to, $subject, $htmlBody = NULL, $textBody = NULL,
$tag = NULL, $trackOpens = true, $replyTo = NULL, $cc = NULL, $bcc = NULL,
$headers = NULL, $attachments = NULL, $trackLinks = NULL, $metadata = NULL) {
$body = array();
$body['From'] = $from;
$body['To'] = $to;
$body['Cc'] = $cc;... | php | function sendEmail($from, $to, $subject, $htmlBody = NULL, $textBody = NULL,
$tag = NULL, $trackOpens = true, $replyTo = NULL, $cc = NULL, $bcc = NULL,
$headers = NULL, $attachments = NULL, $trackLinks = NULL, $metadata = NULL) {
$body = array();
$body['From'] = $from;
$body['To'] = $to;
$body['Cc'] = $cc;... | [
"function",
"sendEmail",
"(",
"$",
"from",
",",
"$",
"to",
",",
"$",
"subject",
",",
"$",
"htmlBody",
"=",
"NULL",
",",
"$",
"textBody",
"=",
"NULL",
",",
"$",
"tag",
"=",
"NULL",
",",
"$",
"trackOpens",
"=",
"true",
",",
"$",
"replyTo",
"=",
"NU... | Send an email.
@param string $from The sender of the email. (Your account must have an associated Sender Signature for the address used.)
@param string $to The recipient of the email.
@param string $subject The subject of the email.
@param string $htmlBody The HTML content of the message, optional if Text Body ... | [
"Send",
"an",
"email",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L45-L72 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.sendEmailWithTemplate | function sendEmailWithTemplate($from, $to, $templateId, $templateModel, $inlineCss = true,
$tag = NULL, $trackOpens = true, $replyTo = NULL,
$cc = NULL, $bcc = NULL, $headers = NULL, $attachments = NULL,
$trackLinks = NULL, $metadata = NULL) {
$body = array();
$body['From'] = $from;
$body['To'] = $to;
$... | php | function sendEmailWithTemplate($from, $to, $templateId, $templateModel, $inlineCss = true,
$tag = NULL, $trackOpens = true, $replyTo = NULL,
$cc = NULL, $bcc = NULL, $headers = NULL, $attachments = NULL,
$trackLinks = NULL, $metadata = NULL) {
$body = array();
$body['From'] = $from;
$body['To'] = $to;
$... | [
"function",
"sendEmailWithTemplate",
"(",
"$",
"from",
",",
"$",
"to",
",",
"$",
"templateId",
",",
"$",
"templateModel",
",",
"$",
"inlineCss",
"=",
"true",
",",
"$",
"tag",
"=",
"NULL",
",",
"$",
"trackOpens",
"=",
"true",
",",
"$",
"replyTo",
"=",
... | Send an email using a template.
@param string $from The sender of the email. (Your account must have an associated Sender Signature for the address used.)
@param string $to The recipient of the email.
@param integer $templateId The ID of the template to use to generate the content of this message.
@param array $t... | [
"Send",
"an",
"email",
"using",
"a",
"template",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L93-L123 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.fixHeaders | private function fixHeaders($headers) {
$retval = NULL;
if ($headers != NULL) {
$retval = array();
$index = 0;
foreach ($headers as $key => $value) {
$retval[$index] = array('Name' => $key, 'Value' => $value);
$index++;
}
}
return $retval;
} | php | private function fixHeaders($headers) {
$retval = NULL;
if ($headers != NULL) {
$retval = array();
$index = 0;
foreach ($headers as $key => $value) {
$retval[$index] = array('Name' => $key, 'Value' => $value);
$index++;
}
}
return $retval;
} | [
"private",
"function",
"fixHeaders",
"(",
"$",
"headers",
")",
"{",
"$",
"retval",
"=",
"NULL",
";",
"if",
"(",
"$",
"headers",
"!=",
"NULL",
")",
"{",
"$",
"retval",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"foreach",
"(",
"$",
... | The Postmark API wants an Array of Key-Value pairs, not a dictionary object,
therefore, we need to wrap the elements in an array. | [
"The",
"Postmark",
"API",
"wants",
"an",
"Array",
"of",
"Key",
"-",
"Value",
"pairs",
"not",
"a",
"dictionary",
"object",
"therefore",
"we",
"need",
"to",
"wrap",
"the",
"elements",
"in",
"an",
"array",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L129-L140 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.sendEmailBatch | function sendEmailBatch($emailBatch = array()) {
$final = array();
foreach ($emailBatch as $email) {
foreach ($email as $emailIdx => $emailValue) {
if (strtolower($emailIdx) == 'headers') {
$email[$emailIdx] = $this->fixHeaders($emailValue);
}
}
array_push($final, $email);
}
return new ... | php | function sendEmailBatch($emailBatch = array()) {
$final = array();
foreach ($emailBatch as $email) {
foreach ($email as $emailIdx => $emailValue) {
if (strtolower($emailIdx) == 'headers') {
$email[$emailIdx] = $this->fixHeaders($emailValue);
}
}
array_push($final, $email);
}
return new ... | [
"function",
"sendEmailBatch",
"(",
"$",
"emailBatch",
"=",
"array",
"(",
")",
")",
"{",
"$",
"final",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"emailBatch",
"as",
"$",
"email",
")",
"{",
"foreach",
"(",
"$",
"email",
"as",
"$",
"emailIdx",
... | Send multiple emails as a batch
Each email is an associative array of values, but note that the 'Attachments'
key must be an array of 'PostmarkAttachment' objects if you intend to send
attachments with an email.
@param array $emailBatch An array of emails to be sent in one batch.
@return DynamicResponseModel | [
"Send",
"multiple",
"emails",
"as",
"a",
"batch"
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L153-L167 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.getBounces | function getBounces($count = 100, $offset = 0, $type = NULL,
$inactive = NULL, $emailFilter = NULL, $tag = NULL, $messageID = NULL,
$fromdate = NULL, $todate = NULL) {
$query = array();
$query['type'] = $type;
$query['inactive'] = $inactive;
$query['emailFilter'] = $emailFilter;
$query['tag'] = $... | php | function getBounces($count = 100, $offset = 0, $type = NULL,
$inactive = NULL, $emailFilter = NULL, $tag = NULL, $messageID = NULL,
$fromdate = NULL, $todate = NULL) {
$query = array();
$query['type'] = $type;
$query['inactive'] = $inactive;
$query['emailFilter'] = $emailFilter;
$query['tag'] = $... | [
"function",
"getBounces",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"type",
"=",
"NULL",
",",
"$",
"inactive",
"=",
"NULL",
",",
"$",
"emailFilter",
"=",
"NULL",
",",
"$",
"tag",
"=",
"NULL",
",",
"$",
"messageID",
"=... | Get a batch of bounces to be processed.
@param integer $count Number of bounces to retrieve
@param integer $offset How many bounces to skip (when paging through bounces.)
@param string $type The bounce type. (see http://developer.postmarkapp.com/developer-api-bounce.html#bounce-types)
@param bool $inactive Specifi... | [
"Get",
"a",
"batch",
"of",
"bounces",
"to",
"be",
"processed",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L192-L208 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.getOutboundMessages | function getOutboundMessages($count = 100, $offset = 0, $recipient = NULL,
$fromEmail = NULL, $tag = NULL, $subject = NULL, $status = NULL,
$fromdate = NULL, $todate = NULL, $metadata = NULL) {
$query = array();
$query["recipient"] = $recipient;
$query["fromemail"] = $fromEmail;
$query["tag"] = $tag;
$q... | php | function getOutboundMessages($count = 100, $offset = 0, $recipient = NULL,
$fromEmail = NULL, $tag = NULL, $subject = NULL, $status = NULL,
$fromdate = NULL, $todate = NULL, $metadata = NULL) {
$query = array();
$query["recipient"] = $recipient;
$query["fromemail"] = $fromEmail;
$query["tag"] = $tag;
$q... | [
"function",
"getOutboundMessages",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"recipient",
"=",
"NULL",
",",
"$",
"fromEmail",
"=",
"NULL",
",",
"$",
"tag",
"=",
"NULL",
",",
"$",
"subject",
"=",
"NULL",
",",
"$",
"statu... | Search messages that have been sent using this Server.
@param integer $count How many messages to retrieve at once (defaults to 100)
@param integer $offset How many messages to skip when 'paging' through the massages (defaults to 0)
@param string $recipient Filter by recipient.
@param string $fromEmail Filter by s... | [
"Search",
"messages",
"that",
"have",
"been",
"sent",
"using",
"this",
"Server",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L321-L343 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.getInboundMessages | function getInboundMessages($count = 100, $offset = 0, $recipient = NULL, $fromEmail = NULL,
$tag = NULL, $subject = NULL, $mailboxHash = NULL, $status = NULL, $fromdate = NULL,
$todate = NULL) {
$query = array();
$query['recipient'] = $recipient;
$query['fromemail'] = $fromEmail;
$query['tag'] = $tag;
$... | php | function getInboundMessages($count = 100, $offset = 0, $recipient = NULL, $fromEmail = NULL,
$tag = NULL, $subject = NULL, $mailboxHash = NULL, $status = NULL, $fromdate = NULL,
$todate = NULL) {
$query = array();
$query['recipient'] = $recipient;
$query['fromemail'] = $fromEmail;
$query['tag'] = $tag;
$... | [
"function",
"getInboundMessages",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"recipient",
"=",
"NULL",
",",
"$",
"fromEmail",
"=",
"NULL",
",",
"$",
"tag",
"=",
"NULL",
",",
"$",
"subject",
"=",
"NULL",
",",
"$",
"mailbo... | Get messages sent to the inbound email address associated with this Server.
@param integer $count The number of inbounce messages to retrieve in the request (defaults to 100)
@param integer $offset The number of messages to 'skip' when 'paging' through messages (defaults to 0)
@param string $recipient Filter by the... | [
"Get",
"messages",
"sent",
"to",
"the",
"inbound",
"email",
"address",
"associated",
"with",
"this",
"Server",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L380-L397 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.getOpenStatistics | function getOpenStatistics($count = 100, $offset = 0, $recipient = NULL,
$tag = NULL, $clientName = NULL, $clientCompany = NULL, $clientFamily = NULL,
$osName = NULL, $osFamily = NULL, $osCompany = NULL, $platform = NULL,
$country = NULL, $region = NULL, $city = NULL) {
$query = array();
$query['count'] = $c... | php | function getOpenStatistics($count = 100, $offset = 0, $recipient = NULL,
$tag = NULL, $clientName = NULL, $clientCompany = NULL, $clientFamily = NULL,
$osName = NULL, $osFamily = NULL, $osCompany = NULL, $platform = NULL,
$country = NULL, $region = NULL, $city = NULL) {
$query = array();
$query['count'] = $c... | [
"function",
"getOpenStatistics",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"recipient",
"=",
"NULL",
",",
"$",
"tag",
"=",
"NULL",
",",
"$",
"clientName",
"=",
"NULL",
",",
"$",
"clientCompany",
"=",
"NULL",
",",
"$",
"... | Get statistics for tracked messages, optionally filtering by various open event properties.
@param integer $count The number of open statistics to retrieve in this request.
@param integer $offset The number of statistics to 'skip' when paging through statistics.
@param string $recipient Filter by recipient.
@param ... | [
"Get",
"statistics",
"for",
"tracked",
"messages",
"optionally",
"filtering",
"by",
"various",
"open",
"event",
"properties",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L449-L471 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.getOpenStatisticsForMessage | function getOpenStatisticsForMessage($id, $count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', "/messages/outbound/opens/$id", $query));
} | php | function getOpenStatisticsForMessage($id, $count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', "/messages/outbound/opens/$id", $query));
} | [
"function",
"getOpenStatisticsForMessage",
"(",
"$",
"id",
",",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"'count'",
"]",
"=",
"$",
"count",
";",
"$",
"query",
... | Get information about individual opens for a sent message.
@param integer $id The ID for the message that we want statistics for.
@param integer $count How many statistics should we retrieve?
@param integer $offset How many should we 'skip' when 'paging' through statistics.
@return DynamicResponseModel | [
"Get",
"information",
"about",
"individual",
"opens",
"for",
"a",
"sent",
"message",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L524-L531 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.getClickStatisticsForMessage | function getClickStatisticsForMessage($id, $count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', "/messages/outbound/clicks/$id", $query));
} | php | function getClickStatisticsForMessage($id, $count = 100, $offset = 0) {
$query = array();
$query['count'] = $count;
$query['offset'] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', "/messages/outbound/clicks/$id", $query));
} | [
"function",
"getClickStatisticsForMessage",
"(",
"$",
"id",
",",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"'count'",
"]",
"=",
"$",
"count",
";",
"$",
"query",
... | Get information about individual clicks for a sent message.
@param integer $id The ID for the message that we want statistics for.
@param integer $count How many statistics should we retrieve?
@param integer $offset How many should we 'skip' when 'paging' through statistics.
@return DynamicResponseModel | [
"Get",
"information",
"about",
"individual",
"clicks",
"for",
"a",
"sent",
"message",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L541-L548 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.getOutboundClickStatistics | function getOutboundClickStatistics($tag = NULL, $fromdate = NULL, $todate = NULL) {
$query = array();
$query['tag'] = $tag;
$query['fromdate'] = $fromdate;
$query['todate'] = $todate;
return new DynamicResponseModel($this->processRestRequest('GET', '/stats/outbound/clicks', $query));
} | php | function getOutboundClickStatistics($tag = NULL, $fromdate = NULL, $todate = NULL) {
$query = array();
$query['tag'] = $tag;
$query['fromdate'] = $fromdate;
$query['todate'] = $todate;
return new DynamicResponseModel($this->processRestRequest('GET', '/stats/outbound/clicks', $query));
} | [
"function",
"getOutboundClickStatistics",
"(",
"$",
"tag",
"=",
"NULL",
",",
"$",
"fromdate",
"=",
"NULL",
",",
"$",
"todate",
"=",
"NULL",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"'tag'",
"]",
"=",
"$",
"tag",
";",
... | Get click statistics for the messages sent using this Server,
optionally filtering on message tag, and a to and from date.
@param string $tag Filter by tag.
@param string $fromdate must be of the format 'YYYY-MM-DD'
@param string $todate must be of the format 'YYYY-MM-DD'
@return DynamicResponseModel | [
"Get",
"click",
"statistics",
"for",
"the",
"messages",
"sent",
"using",
"this",
"Server",
"optionally",
"filtering",
"on",
"message",
"tag",
"and",
"a",
"to",
"and",
"from",
"date",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L730-L738 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.createTagTrigger | function createTagTrigger($matchName, $trackOpens = true) {
$body = array();
$body["MatchName"] = $matchName;
$body["TrackOpens"] = $trackOpens;
return new DynamicResponseModel($this->processRestRequest('POST', '/triggers/tags', $body));
} | php | function createTagTrigger($matchName, $trackOpens = true) {
$body = array();
$body["MatchName"] = $matchName;
$body["TrackOpens"] = $trackOpens;
return new DynamicResponseModel($this->processRestRequest('POST', '/triggers/tags', $body));
} | [
"function",
"createTagTrigger",
"(",
"$",
"matchName",
",",
"$",
"trackOpens",
"=",
"true",
")",
"{",
"$",
"body",
"=",
"array",
"(",
")",
";",
"$",
"body",
"[",
"\"MatchName\"",
"]",
"=",
"$",
"matchName",
";",
"$",
"body",
"[",
"\"TrackOpens\"",
"]",... | Create a Tag Trigger.
@param string $matchName Name of the tag that will activate this trigger.
@param boolean $trackOpens Indicates if this trigger activates open tracking.
@return DynamicResponseModel | [
"Create",
"a",
"Tag",
"Trigger",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L806-L812 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.searchTagTriggers | function searchTagTriggers($count = 100, $offset = 0, $matchName = NULL) {
$query = array();
$query["count"] = $count;
$query["offset"] = $offset;
$query["match_name"] = $matchName;
return new DynamicResponseModel($this->processRestRequest('GET', '/triggers/tags', $query));
} | php | function searchTagTriggers($count = 100, $offset = 0, $matchName = NULL) {
$query = array();
$query["count"] = $count;
$query["offset"] = $offset;
$query["match_name"] = $matchName;
return new DynamicResponseModel($this->processRestRequest('GET', '/triggers/tags', $query));
} | [
"function",
"searchTagTriggers",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"matchName",
"=",
"NULL",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"\"count\"",
"]",
"=",
"$",
"count",
";",
"$... | Locate Tag Triggers matching the filter criteria.
@param integer $count The number of triggers to return with this request.
@param integer $offset The number of triggers to 'skip' when 'paging' through tag triggers.
@param string $matchName
@return DynamicResponseModel | [
"Locate",
"Tag",
"Triggers",
"matching",
"the",
"filter",
"criteria",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L832-L840 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.editTagTrigger | function editTagTrigger($id, $matchName, $trackOpens = true) {
$body = array();
$body["MatchName"] = $matchName;
$body["TrackOpens"] = $trackOpens;
return new DynamicResponseModel($this->processRestRequest('PUT', "/triggers/tags/$id", $body));
} | php | function editTagTrigger($id, $matchName, $trackOpens = true) {
$body = array();
$body["MatchName"] = $matchName;
$body["TrackOpens"] = $trackOpens;
return new DynamicResponseModel($this->processRestRequest('PUT', "/triggers/tags/$id", $body));
} | [
"function",
"editTagTrigger",
"(",
"$",
"id",
",",
"$",
"matchName",
",",
"$",
"trackOpens",
"=",
"true",
")",
"{",
"$",
"body",
"=",
"array",
"(",
")",
";",
"$",
"body",
"[",
"\"MatchName\"",
"]",
"=",
"$",
"matchName",
";",
"$",
"body",
"[",
"\"T... | Edit an existing Tag Trigger
@param integer $id The ID of the Tag Trigger we wish to modify.
@param string $matchName Name of the tag that will activate this trigger.
@param boolean $trackOpens Indicates if this trigger activates open tracking.
@return DynamicResponseModel | [
"Edit",
"an",
"existing",
"Tag",
"Trigger"
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L850-L856 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.listInboundRuleTriggers | function listInboundRuleTriggers($count = 100, $offset = 0) {
$query = array();
$query["count"] = $count;
$query["offset"] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', '/triggers/inboundrules', $query));
} | php | function listInboundRuleTriggers($count = 100, $offset = 0) {
$query = array();
$query["count"] = $count;
$query["offset"] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', '/triggers/inboundrules', $query));
} | [
"function",
"listInboundRuleTriggers",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"\"count\"",
"]",
"=",
"$",
"count",
";",
"$",
"query",
"[",
"\"offset\"",
"... | Get a list of all existing Inbound Rule Triggers.
@param integer $count The number of rule triggers to return with this request.
@param integer $offset The number of triggers to 'skip' when 'paging' through rule triggers.
@return DynamicResponseModel | [
"Get",
"a",
"list",
"of",
"all",
"existing",
"Inbound",
"Rule",
"Triggers",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L888-L895 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.createTemplate | function createTemplate($name, $subject, $htmlBody, $textBody) {
$template = array();
$template["name"] = $name;
$template["subject"] = $subject;
$template["htmlBody"] = $htmlBody;
$template["textBody"] = $textBody;
return new DynamicResponseModel($this->processRestRequest('POST', "/templates", $template));... | php | function createTemplate($name, $subject, $htmlBody, $textBody) {
$template = array();
$template["name"] = $name;
$template["subject"] = $subject;
$template["htmlBody"] = $htmlBody;
$template["textBody"] = $textBody;
return new DynamicResponseModel($this->processRestRequest('POST', "/templates", $template));... | [
"function",
"createTemplate",
"(",
"$",
"name",
",",
"$",
"subject",
",",
"$",
"htmlBody",
",",
"$",
"textBody",
")",
"{",
"$",
"template",
"=",
"array",
"(",
")",
";",
"$",
"template",
"[",
"\"name\"",
"]",
"=",
"$",
"name",
";",
"$",
"template",
... | Create a template
@param string $name The friendly name for this template.
@param string $subject The template to be used for the 'subject' of emails sent using this template.
@param string $htmlBody The template to be used for the 'htmlBody' of emails sent using this template, optional if 'textBody' is not NULL.
@par... | [
"Create",
"a",
"template"
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L927-L934 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.editTemplate | function editTemplate($id, $name = NULL, $subject = NULL, $htmlBody = NULL, $textBody = NULL) {
$template = array();
$template["name"] = $name;
$template["subject"] = $subject;
$template["htmlBody"] = $htmlBody;
$template["textBody"] = $textBody;
return new DynamicResponseModel($this->processRestRequest('P... | php | function editTemplate($id, $name = NULL, $subject = NULL, $htmlBody = NULL, $textBody = NULL) {
$template = array();
$template["name"] = $name;
$template["subject"] = $subject;
$template["htmlBody"] = $htmlBody;
$template["textBody"] = $textBody;
return new DynamicResponseModel($this->processRestRequest('P... | [
"function",
"editTemplate",
"(",
"$",
"id",
",",
"$",
"name",
"=",
"NULL",
",",
"$",
"subject",
"=",
"NULL",
",",
"$",
"htmlBody",
"=",
"NULL",
",",
"$",
"textBody",
"=",
"NULL",
")",
"{",
"$",
"template",
"=",
"array",
"(",
")",
";",
"$",
"templ... | Edit a template
@param integer $id The ID of the template you wish to update.
@param string $name The friendly name for this template.
@param string $subject The template to be used for the 'subject' of emails sent using this template.
@param string $htmlBody The template to be used for the 'htmlBody' of emails sent u... | [
"Edit",
"a",
"template"
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L947-L955 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.listTemplates | function listTemplates($count = 100, $offset = 0) {
$query = array();
$query["count"] = $count;
$query["offset"] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', "/templates", $query));
} | php | function listTemplates($count = 100, $offset = 0) {
$query = array();
$query["count"] = $count;
$query["offset"] = $offset;
return new DynamicResponseModel($this->processRestRequest('GET', "/templates", $query));
} | [
"function",
"listTemplates",
"(",
"$",
"count",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"query",
"=",
"array",
"(",
")",
";",
"$",
"query",
"[",
"\"count\"",
"]",
"=",
"$",
"count",
";",
"$",
"query",
"[",
"\"offset\"",
"]",
"=",... | Get all templates associated with the Server.
@param integer $count The total number of templates to get at once (default is 100)
@param integer $offset The number of templates to "Skip" before returning results.
@return DynamicResponseModel | [
"Get",
"all",
"templates",
"associated",
"with",
"the",
"Server",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L975-L982 |
wildbit/postmark-php | src/Postmark/PostmarkClient.php | PostmarkClient.validateTemplate | function validateTemplate($subject = NULL, $htmlBody = NULL, $textBody = NULL, $testRenderModel = NULL, $inlineCssForHtmlTestRender = true) {
$query = array();
$query["subject"] = $subject;
$query["htmlBody"] = $htmlBody;
$query["textBody"] = $textBody;
$query["testRenderModel"] = $testRenderModel;
$query[... | php | function validateTemplate($subject = NULL, $htmlBody = NULL, $textBody = NULL, $testRenderModel = NULL, $inlineCssForHtmlTestRender = true) {
$query = array();
$query["subject"] = $subject;
$query["htmlBody"] = $htmlBody;
$query["textBody"] = $textBody;
$query["testRenderModel"] = $testRenderModel;
$query[... | [
"function",
"validateTemplate",
"(",
"$",
"subject",
"=",
"NULL",
",",
"$",
"htmlBody",
"=",
"NULL",
",",
"$",
"textBody",
"=",
"NULL",
",",
"$",
"testRenderModel",
"=",
"NULL",
",",
"$",
"inlineCssForHtmlTestRender",
"=",
"true",
")",
"{",
"$",
"query",
... | Confirm that your template content can be parsed/rendered, get a test rendering of your template, and a suggested model to use with your templates.
@param string $subject The Subject template you wish to test.
@param string $htmlBody The HTML template you wish to test
@param string $textBody The number of templates to... | [
"Confirm",
"that",
"your",
"template",
"content",
"can",
"be",
"parsed",
"/",
"rendered",
"get",
"a",
"test",
"rendering",
"of",
"your",
"template",
"and",
"a",
"suggested",
"model",
"to",
"use",
"with",
"your",
"templates",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClient.php#L994-L1004 |
wildbit/postmark-php | src/Postmark/Models/DynamicResponseModel.php | DynamicResponseModel.offsetGet | public function offsetGet($offset) {
$result = parent::offsetGet($offset);
if ($result != NULL && is_array($result)) {
$result = new DynamicResponseModel($result);
}
return $result;
} | php | public function offsetGet($offset) {
$result = parent::offsetGet($offset);
if ($result != NULL && is_array($result)) {
$result = new DynamicResponseModel($result);
}
return $result;
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"$",
"result",
"=",
"parent",
"::",
"offsetGet",
"(",
"$",
"offset",
")",
";",
"if",
"(",
"$",
"result",
"!=",
"NULL",
"&&",
"is_array",
"(",
"$",
"result",
")",
")",
"{",
"$",
"resul... | Infrastructure. Allows indexer to return a DynamicResponseModel. | [
"Infrastructure",
".",
"Allows",
"indexer",
"to",
"return",
"a",
"DynamicResponseModel",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/Models/DynamicResponseModel.php#L56-L62 |
wildbit/postmark-php | src/Postmark/PostmarkClientBase.php | PostmarkClientBase.getClient | protected function getClient() {
if(!$this->client) {
$this->client = new Client([
RequestOptions::VERIFY => self::$VERIFY_SSL,
RequestOptions::TIMEOUT => $this->timeout,
]);
}
return $this->client;
} | php | protected function getClient() {
if(!$this->client) {
$this->client = new Client([
RequestOptions::VERIFY => self::$VERIFY_SSL,
RequestOptions::TIMEOUT => $this->timeout,
]);
}
return $this->client;
} | [
"protected",
"function",
"getClient",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"client",
")",
"{",
"$",
"this",
"->",
"client",
"=",
"new",
"Client",
"(",
"[",
"RequestOptions",
"::",
"VERIFY",
"=>",
"self",
"::",
"$",
"VERIFY_SSL",
",",
"Re... | Return the injected GuzzleHttp\Client or create a default instance
@return Client | [
"Return",
"the",
"injected",
"GuzzleHttp",
"\\",
"Client",
"or",
"create",
"a",
"default",
"instance"
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClientBase.php#L68-L76 |
wildbit/postmark-php | src/Postmark/PostmarkClientBase.php | PostmarkClientBase.processRestRequest | protected function processRestRequest($method = NULL, $path = NULL, array $body = []) {
$client = $this->getClient();
$options = [
RequestOptions::HTTP_ERRORS => false,
RequestOptions::HEADERS => [
'User-Agent' => "Postmark-PHP (PHP Version:{$this->version}, OS:{$this->os})",
'Accept' => 'application... | php | protected function processRestRequest($method = NULL, $path = NULL, array $body = []) {
$client = $this->getClient();
$options = [
RequestOptions::HTTP_ERRORS => false,
RequestOptions::HEADERS => [
'User-Agent' => "Postmark-PHP (PHP Version:{$this->version}, OS:{$this->os})",
'Accept' => 'application... | [
"protected",
"function",
"processRestRequest",
"(",
"$",
"method",
"=",
"NULL",
",",
"$",
"path",
"=",
"NULL",
",",
"array",
"$",
"body",
"=",
"[",
"]",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
";",
"$",
"options",
"=... | The base request method for all API access.
@param string $method The request VERB to use (GET, POST, PUT, DELETE)
@param string $path The API path.
@param array $body The content to be used (either as the query, or the json post/put body)
@return object
@throws PostmarkException | [
"The",
"base",
"request",
"method",
"for",
"all",
"API",
"access",
"."
] | train | https://github.com/wildbit/postmark-php/blob/70162fe99ac0a80e599f76ae84e4b6e655081e04/src/Postmark/PostmarkClientBase.php#L105-L172 |
SimpleBus/MessageBus | src/Subscriber/Resolver/NameBasedMessageSubscriberResolver.php | NameBasedMessageSubscriberResolver.resolve | public function resolve($message)
{
$name = $this->messageNameResolver->resolve($message);
return $this->messageSubscribers->filter($name);
} | php | public function resolve($message)
{
$name = $this->messageNameResolver->resolve($message);
return $this->messageSubscribers->filter($name);
} | [
"public",
"function",
"resolve",
"(",
"$",
"message",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"messageNameResolver",
"->",
"resolve",
"(",
"$",
"message",
")",
";",
"return",
"$",
"this",
"->",
"messageSubscribers",
"->",
"filter",
"(",
"$",
"name... | {@inheritdoc} | [
"{"
] | train | https://github.com/SimpleBus/MessageBus/blob/83f90059b286db91a9e73ff17504b8c16b5f042a/src/Subscriber/Resolver/NameBasedMessageSubscriberResolver.php#L29-L34 |
SimpleBus/MessageBus | src/Recorder/AggregatesRecordedMessages.php | AggregatesRecordedMessages.recordedMessages | public function recordedMessages()
{
$allRecordedMessages = [];
foreach ($this->messageRecorders as $messageRecorder) {
$allRecordedMessages = array_merge($allRecordedMessages, $messageRecorder->recordedMessages());
}
return $allRecordedMessages;
} | php | public function recordedMessages()
{
$allRecordedMessages = [];
foreach ($this->messageRecorders as $messageRecorder) {
$allRecordedMessages = array_merge($allRecordedMessages, $messageRecorder->recordedMessages());
}
return $allRecordedMessages;
} | [
"public",
"function",
"recordedMessages",
"(",
")",
"{",
"$",
"allRecordedMessages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"messageRecorders",
"as",
"$",
"messageRecorder",
")",
"{",
"$",
"allRecordedMessages",
"=",
"array_merge",
"(",
"$",
... | Get messages recorded by all known message recorders.
{@inheritdoc} | [
"Get",
"messages",
"recorded",
"by",
"all",
"known",
"message",
"recorders",
"."
] | train | https://github.com/SimpleBus/MessageBus/blob/83f90059b286db91a9e73ff17504b8c16b5f042a/src/Recorder/AggregatesRecordedMessages.php#L24-L33 |
SimpleBus/MessageBus | src/Name/NamedMessageNameResolver.php | NamedMessageNameResolver.resolve | public function resolve($message)
{
if (!($message instanceof NamedMessage)) {
throw CouldNotResolveMessageName::forMessage($message, 'Message should be an instance of NamedMessage');
}
$name = $message::messageName();
if (!is_string($name) || empty($name)) {
... | php | public function resolve($message)
{
if (!($message instanceof NamedMessage)) {
throw CouldNotResolveMessageName::forMessage($message, 'Message should be an instance of NamedMessage');
}
$name = $message::messageName();
if (!is_string($name) || empty($name)) {
... | [
"public",
"function",
"resolve",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"message",
"instanceof",
"NamedMessage",
")",
")",
"{",
"throw",
"CouldNotResolveMessageName",
"::",
"forMessage",
"(",
"$",
"message",
",",
"'Message should be an instance... | {@inheritdoc} | [
"{"
] | train | https://github.com/SimpleBus/MessageBus/blob/83f90059b286db91a9e73ff17504b8c16b5f042a/src/Name/NamedMessageNameResolver.php#L12-L31 |
SimpleBus/MessageBus | src/Bus/Middleware/FinishesHandlingMessageBeforeHandlingNext.php | FinishesHandlingMessageBeforeHandlingNext.handle | public function handle($message, callable $next)
{
$this->queue[] = $message;
if (!$this->isHandling) {
$this->isHandling = true;
while ($message = array_shift($this->queue)) {
try {
$next($message);
} catch (Exception $ex... | php | public function handle($message, callable $next)
{
$this->queue[] = $message;
if (!$this->isHandling) {
$this->isHandling = true;
while ($message = array_shift($this->queue)) {
try {
$next($message);
} catch (Exception $ex... | [
"public",
"function",
"handle",
"(",
"$",
"message",
",",
"callable",
"$",
"next",
")",
"{",
"$",
"this",
"->",
"queue",
"[",
"]",
"=",
"$",
"message",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isHandling",
")",
"{",
"$",
"this",
"->",
"isHandling",... | Completely finishes handling the current message, before allowing other middlewares to start handling new
messages.
{@inheritdoc} | [
"Completely",
"finishes",
"handling",
"the",
"current",
"message",
"before",
"allowing",
"other",
"middlewares",
"to",
"start",
"handling",
"new",
"messages",
"."
] | train | https://github.com/SimpleBus/MessageBus/blob/83f90059b286db91a9e73ff17504b8c16b5f042a/src/Bus/Middleware/FinishesHandlingMessageBeforeHandlingNext.php#L25-L44 |
SimpleBus/MessageBus | src/Handler/Resolver/NameBasedMessageHandlerResolver.php | NameBasedMessageHandlerResolver.resolve | public function resolve($message)
{
$name = $this->messageNameResolver->resolve($message);
return $this->messageHandlers->get($name);
} | php | public function resolve($message)
{
$name = $this->messageNameResolver->resolve($message);
return $this->messageHandlers->get($name);
} | [
"public",
"function",
"resolve",
"(",
"$",
"message",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"messageNameResolver",
"->",
"resolve",
"(",
"$",
"message",
")",
";",
"return",
"$",
"this",
"->",
"messageHandlers",
"->",
"get",
"(",
"$",
"name",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/SimpleBus/MessageBus/blob/83f90059b286db91a9e73ff17504b8c16b5f042a/src/Handler/Resolver/NameBasedMessageHandlerResolver.php#L30-L35 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Handler/Verbose.php | Verbose.getBody | protected function getBody(\Psr\Http\Message\MessageInterface $message)
{
$body = trim($message->getBody());
if ($message->getBody()->getSize() === 0 || empty($body)) {
if ($message instanceof \Psr\Http\Message\ResponseInterface) {
return 'No response body returned';
... | php | protected function getBody(\Psr\Http\Message\MessageInterface $message)
{
$body = trim($message->getBody());
if ($message->getBody()->getSize() === 0 || empty($body)) {
if ($message instanceof \Psr\Http\Message\ResponseInterface) {
return 'No response body returned';
... | [
"protected",
"function",
"getBody",
"(",
"\\",
"Psr",
"\\",
"Http",
"\\",
"Message",
"\\",
"MessageInterface",
"$",
"message",
")",
"{",
"$",
"body",
"=",
"trim",
"(",
"$",
"message",
"->",
"getBody",
"(",
")",
")",
";",
"if",
"(",
"$",
"message",
"-... | Get response body
@param \Psr\Http\Message\MessageInterface $message
@return string | [
"Get",
"response",
"body"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Handler/Verbose.php#L176-L192 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Cli.php | Cli.parseArguments | protected function parseArguments()
{
$args = $this->getNamedArgs();
$this->climate->arguments->add($args);
if ($_SERVER['argc'] === 1) {
$this->help();
return false;
}
if ($this->climate->arguments->defined('help')) {
$this->help();
... | php | protected function parseArguments()
{
$args = $this->getNamedArgs();
$this->climate->arguments->add($args);
if ($_SERVER['argc'] === 1) {
$this->help();
return false;
}
if ($this->climate->arguments->defined('help')) {
$this->help();
... | [
"protected",
"function",
"parseArguments",
"(",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"getNamedArgs",
"(",
")",
";",
"$",
"this",
"->",
"climate",
"->",
"arguments",
"->",
"add",
"(",
"$",
"args",
")",
";",
"if",
"(",
"$",
"_SERVER",
"[",
... | Parse incoming arguments
@return bool|void | [
"Parse",
"incoming",
"arguments"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Cli.php#L48-L88 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Cli.php | Cli.executeCommand | protected function executeCommand()
{
static $methods = [
'HEAD',
'GET',
'POST',
'PUT',
'DELETE'
];
\Akamai\Open\EdgeGrid\Client::setDebug(true);
\Akamai\Open\EdgeGrid\Client::setVerbose(true);
$args = $this->clima... | php | protected function executeCommand()
{
static $methods = [
'HEAD',
'GET',
'POST',
'PUT',
'DELETE'
];
\Akamai\Open\EdgeGrid\Client::setDebug(true);
\Akamai\Open\EdgeGrid\Client::setVerbose(true);
$args = $this->clima... | [
"protected",
"function",
"executeCommand",
"(",
")",
"{",
"static",
"$",
"methods",
"=",
"[",
"'HEAD'",
",",
"'GET'",
",",
"'POST'",
",",
"'PUT'",
",",
"'DELETE'",
"]",
";",
"\\",
"Akamai",
"\\",
"Open",
"\\",
"EdgeGrid",
"\\",
"Client",
"::",
"setDebug"... | Execute the HTTP request
@return mixed|\Psr\Http\Message\ResponseInterface | [
"Execute",
"the",
"HTTP",
"request"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Cli.php#L95-L253 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Cli.php | Cli.help | public function help()
{
$arguments = new \League\CLImate\Argument\Manager();
$arguments->description('Akamai {OPEN} Edgegrid Auth for PHP Client (v' .Client::VERSION. ')');
$arguments->add($this->getNamedArgs());
$arguments->usage($this->climate, $_SERVER['argv']);
} | php | public function help()
{
$arguments = new \League\CLImate\Argument\Manager();
$arguments->description('Akamai {OPEN} Edgegrid Auth for PHP Client (v' .Client::VERSION. ')');
$arguments->add($this->getNamedArgs());
$arguments->usage($this->climate, $_SERVER['argv']);
} | [
"public",
"function",
"help",
"(",
")",
"{",
"$",
"arguments",
"=",
"new",
"\\",
"League",
"\\",
"CLImate",
"\\",
"Argument",
"\\",
"Manager",
"(",
")",
";",
"$",
"arguments",
"->",
"description",
"(",
"'Akamai {OPEN} Edgegrid Auth for PHP Client (v'",
".",
"C... | Display CLI help | [
"Display",
"CLI",
"help"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Cli.php#L258-L264 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Cli.php | Cli.getArgValue | protected function getArgValue($matches)
{
$value = $matches['value'];
if (!empty($matches['file'])) {
if (!file_exists($matches['value']) || !is_readable($matches['value'])) {
$this->climate->error('Unable to read input file: ' . $matches['value']);
retur... | php | protected function getArgValue($matches)
{
$value = $matches['value'];
if (!empty($matches['file'])) {
if (!file_exists($matches['value']) || !is_readable($matches['value'])) {
$this->climate->error('Unable to read input file: ' . $matches['value']);
retur... | [
"protected",
"function",
"getArgValue",
"(",
"$",
"matches",
")",
"{",
"$",
"value",
"=",
"$",
"matches",
"[",
"'value'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"matches",
"[",
"'file'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",... | Get argument values
@param $matches
@return bool|string | [
"Get",
"argument",
"values"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Cli.php#L339-L351 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.requestAsync | public function requestAsync($method, $uri = null, array $options = [])
{
$options = $this->setRequestOptions($options);
$query = parse_url($uri, PHP_URL_QUERY);
if (!empty($query)) {
$uri = substr($uri, 0, (strlen($query)+1) * -1);
parse_str($query, $options['query'... | php | public function requestAsync($method, $uri = null, array $options = [])
{
$options = $this->setRequestOptions($options);
$query = parse_url($uri, PHP_URL_QUERY);
if (!empty($query)) {
$uri = substr($uri, 0, (strlen($query)+1) * -1);
parse_str($query, $options['query'... | [
"public",
"function",
"requestAsync",
"(",
"$",
"method",
",",
"$",
"uri",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"setRequestOptions",
"(",
"$",
"options",
")",
";",
"$",
"query",
... | Make an Asynchronous request
@param string $method
@param string $uri
@param array $options
@return \GuzzleHttp\Promise\PromiseInterface
@throws \GuzzleHttp\Exception\GuzzleException | [
"Make",
"an",
"Asynchronous",
"request"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L126-L137 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.sendAsync | public function sendAsync(\Psr\Http\Message\RequestInterface $request, array $options = [])
{
$options = $this->setRequestOptions($options);
return parent::sendAsync($request, $options);
} | php | public function sendAsync(\Psr\Http\Message\RequestInterface $request, array $options = [])
{
$options = $this->setRequestOptions($options);
return parent::sendAsync($request, $options);
} | [
"public",
"function",
"sendAsync",
"(",
"\\",
"Psr",
"\\",
"Http",
"\\",
"Message",
"\\",
"RequestInterface",
"$",
"request",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"setRequestOptions",
"(",
"$",
... | Send an Asynchronous HTTP request
@param \Psr\Http\Message\RequestInterface $request The HTTP request
@param array $options Request options
@return \GuzzleHttp\Promise\PromiseInterface | [
"Send",
"an",
"Asynchronous",
"HTTP",
"request"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L147-L152 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setAuth | public function setAuth($client_token, $client_secret, $access_token)
{
$this->authentication->setAuth($client_token, $client_secret, $access_token);
return $this;
} | php | public function setAuth($client_token, $client_secret, $access_token)
{
$this->authentication->setAuth($client_token, $client_secret, $access_token);
return $this;
} | [
"public",
"function",
"setAuth",
"(",
"$",
"client_token",
",",
"$",
"client_secret",
",",
"$",
"access_token",
")",
"{",
"$",
"this",
"->",
"authentication",
"->",
"setAuth",
"(",
"$",
"client_token",
",",
"$",
"client_secret",
",",
"$",
"access_token",
")"... | Set Akamai {OPEN} Authentication Credentials
@param string $client_token
@param string $client_secret
@param string $access_token
@return $this | [
"Set",
"Akamai",
"{",
"OPEN",
"}",
"Authentication",
"Credentials"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L162-L167 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setHost | public function setHost($host)
{
if (substr($host, -1) === '/') {
$host = substr($host, 0, -1);
}
$headers = $this->getConfig('headers');
$headers['Host'] = $host;
$this->setConfigOption('headers', $headers);
if (strpos('/', $host) === false) {
... | php | public function setHost($host)
{
if (substr($host, -1) === '/') {
$host = substr($host, 0, -1);
}
$headers = $this->getConfig('headers');
$headers['Host'] = $host;
$this->setConfigOption('headers', $headers);
if (strpos('/', $host) === false) {
... | [
"public",
"function",
"setHost",
"(",
"$",
"host",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"host",
",",
"-",
"1",
")",
"===",
"'/'",
")",
"{",
"$",
"host",
"=",
"substr",
"(",
"$",
"host",
",",
"0",
",",
"-",
"1",
")",
";",
"}",
"$",
"head... | Set Request Host
@param string $host
@return $this | [
"Set",
"Request",
"Host"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L204-L220 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setLogger | public function setLogger(
\Psr\Log\LoggerInterface $logger = null,
$messageFormat = \GuzzleHttp\MessageFormatter::CLF
) {
if ($logger === null) {
$handler = new \Monolog\Handler\ErrorLogHandler(\Monolog\Handler\ErrorLogHandler::SAPI);
$handler->setFormatter(new \Mono... | php | public function setLogger(
\Psr\Log\LoggerInterface $logger = null,
$messageFormat = \GuzzleHttp\MessageFormatter::CLF
) {
if ($logger === null) {
$handler = new \Monolog\Handler\ErrorLogHandler(\Monolog\Handler\ErrorLogHandler::SAPI);
$handler->setFormatter(new \Mono... | [
"public",
"function",
"setLogger",
"(",
"\\",
"Psr",
"\\",
"Log",
"\\",
"LoggerInterface",
"$",
"logger",
"=",
"null",
",",
"$",
"messageFormat",
"=",
"\\",
"GuzzleHttp",
"\\",
"MessageFormatter",
"::",
"CLF",
")",
"{",
"if",
"(",
"$",
"logger",
"===",
"... | Set a PSR-3 compatible logger (or use monolog by default)
@param \Psr\Log\LoggerInterface $logger
@param string $messageFormat Message format
@return $this | [
"Set",
"a",
"PSR",
"-",
"3",
"compatible",
"logger",
"(",
"or",
"use",
"monolog",
"by",
"default",
")"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L268-L287 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setSimpleLog | public function setSimpleLog($filename, $format = '{code}')
{
if ($this->logger && !($this->logger instanceof \Monolog\Logger)) {
return false;
}
$handler = new \Monolog\Handler\StreamHandler($filename);
$handler->setFormatter(new \Monolog\Formatter\LineFormatter('%messa... | php | public function setSimpleLog($filename, $format = '{code}')
{
if ($this->logger && !($this->logger instanceof \Monolog\Logger)) {
return false;
}
$handler = new \Monolog\Handler\StreamHandler($filename);
$handler->setFormatter(new \Monolog\Formatter\LineFormatter('%messa... | [
"public",
"function",
"setSimpleLog",
"(",
"$",
"filename",
",",
"$",
"format",
"=",
"'{code}'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logger",
"&&",
"!",
"(",
"$",
"this",
"->",
"logger",
"instanceof",
"\\",
"Monolog",
"\\",
"Logger",
")",
")",
"... | Add logger using a given filename/format
@param string $filename
@param string $format
@return \Akamai\Open\EdgeGrid\Client|bool | [
"Add",
"logger",
"using",
"a",
"given",
"filename",
"/",
"format"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L296-L307 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.createFromEdgeRcFile | public static function createFromEdgeRcFile($section = 'default', $path = null, array $config = [])
{
$auth = \Akamai\Open\EdgeGrid\Authentication::createFromEdgeRcFile($section, $path);
if ($host = $auth->getHost()) {
$config['base_uri'] = 'https://' . $host;
}
return ... | php | public static function createFromEdgeRcFile($section = 'default', $path = null, array $config = [])
{
$auth = \Akamai\Open\EdgeGrid\Authentication::createFromEdgeRcFile($section, $path);
if ($host = $auth->getHost()) {
$config['base_uri'] = 'https://' . $host;
}
return ... | [
"public",
"static",
"function",
"createFromEdgeRcFile",
"(",
"$",
"section",
"=",
"'default'",
",",
"$",
"path",
"=",
"null",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"auth",
"=",
"\\",
"Akamai",
"\\",
"Open",
"\\",
"EdgeGrid",
"\\",
... | Factory method to create a client using credentials from `.edgerc`
Automatically checks your HOME directory, and the current working
directory for credentials, if no path is supplied.
@param string $section Credential section to use
@param string $path Path to .edgerc credentials file
@param array $config Options to ... | [
"Factory",
"method",
"to",
"create",
"a",
"client",
"using",
"credentials",
"from",
".",
"edgerc"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L350-L359 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.getDebugOption | protected function getDebugOption(array $config)
{
if (isset($config['debug'])) {
return ($config['debug'] === true) ? fopen('php://stderr', 'ab') : $config['debug'];
}
if ($this->debugOverride && $this->debug) {
return ($this->debug === true) ? fopen('php://stderr',... | php | protected function getDebugOption(array $config)
{
if (isset($config['debug'])) {
return ($config['debug'] === true) ? fopen('php://stderr', 'ab') : $config['debug'];
}
if ($this->debugOverride && $this->debug) {
return ($this->debug === true) ? fopen('php://stderr',... | [
"protected",
"function",
"getDebugOption",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'debug'",
"]",
")",
")",
"{",
"return",
"(",
"$",
"config",
"[",
"'debug'",
"]",
"===",
"true",
")",
"?",
"fopen",
"(",
... | Handle debug option
@param array $config
@return bool|resource | [
"Handle",
"debug",
"option"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L387-L400 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.isDebug | protected function isDebug()
{
if (($this->debugOverride && !$this->debug) || (!$this->debugOverride && !static::$staticDebug)) {
return false;
}
if ($this->debugOverride && $this->debug) {
return $this->debug;
}
return static::$staticDebug;
} | php | protected function isDebug()
{
if (($this->debugOverride && !$this->debug) || (!$this->debugOverride && !static::$staticDebug)) {
return false;
}
if ($this->debugOverride && $this->debug) {
return $this->debug;
}
return static::$staticDebug;
} | [
"protected",
"function",
"isDebug",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"debugOverride",
"&&",
"!",
"$",
"this",
"->",
"debug",
")",
"||",
"(",
"!",
"$",
"this",
"->",
"debugOverride",
"&&",
"!",
"static",
"::",
"$",
"staticDebug",
")",... | Debugging status for the current request
@return bool|resource | [
"Debugging",
"status",
"for",
"the",
"current",
"request"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L407-L418 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.isVerbose | protected function isVerbose()
{
if (($this->verboseOverride && !$this->verbose) || (!$this->verboseOverride && !static::$staticVerbose)) {
return false;
}
if ($this->verboseOverride && $this->verbose) {
return $this->verbose;
}
return static::$stati... | php | protected function isVerbose()
{
if (($this->verboseOverride && !$this->verbose) || (!$this->verboseOverride && !static::$staticVerbose)) {
return false;
}
if ($this->verboseOverride && $this->verbose) {
return $this->verbose;
}
return static::$stati... | [
"protected",
"function",
"isVerbose",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"verboseOverride",
"&&",
"!",
"$",
"this",
"->",
"verbose",
")",
"||",
"(",
"!",
"$",
"this",
"->",
"verboseOverride",
"&&",
"!",
"static",
"::",
"$",
"staticVerbos... | Verbose status for the current request
@return array|bool|resource | [
"Verbose",
"status",
"for",
"the",
"current",
"request"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L425-L436 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setAuthentication | protected function setAuthentication(array $config, Authentication $authentication = null)
{
$this->authentication = $authentication;
if ($authentication === null) {
$this->authentication = new Authentication();
}
if (isset($config['timestamp'])) {
$this->aut... | php | protected function setAuthentication(array $config, Authentication $authentication = null)
{
$this->authentication = $authentication;
if ($authentication === null) {
$this->authentication = new Authentication();
}
if (isset($config['timestamp'])) {
$this->aut... | [
"protected",
"function",
"setAuthentication",
"(",
"array",
"$",
"config",
",",
"Authentication",
"$",
"authentication",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"authentication",
"=",
"$",
"authentication",
";",
"if",
"(",
"$",
"authentication",
"===",
"null... | Set the Authentication instance
@param array $config
@param Authentication|null $authentication | [
"Set",
"the",
"Authentication",
"instance"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L444-L458 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setAuthenticationHandler | protected function setAuthenticationHandler(array $config, Authentication $authentication = null)
{
$this->setAuthentication($config, $authentication);
$authenticationHandler = new AuthenticationHandler();
$authenticationHandler->setSigner($this->authentication);
if (!isset($config[... | php | protected function setAuthenticationHandler(array $config, Authentication $authentication = null)
{
$this->setAuthentication($config, $authentication);
$authenticationHandler = new AuthenticationHandler();
$authenticationHandler->setSigner($this->authentication);
if (!isset($config[... | [
"protected",
"function",
"setAuthenticationHandler",
"(",
"array",
"$",
"config",
",",
"Authentication",
"$",
"authentication",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setAuthentication",
"(",
"$",
"config",
",",
"$",
"authentication",
")",
";",
"$",
"authe... | Set the Authentication Handler
@param array $config
@param Authentication|null $authentication
@return array | [
"Set",
"the",
"Authentication",
"Handler"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L467-L486 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setBasicOptions | protected function setBasicOptions(array $config)
{
if (!isset($config['timeout'])) {
$config['timeout'] = static::DEFAULT_REQUEST_TIMEOUT;
}
if (isset($config['base_uri']) && strpos($config['base_uri'], 'http') === false) {
$config['base_uri'] = 'https://' . $config... | php | protected function setBasicOptions(array $config)
{
if (!isset($config['timeout'])) {
$config['timeout'] = static::DEFAULT_REQUEST_TIMEOUT;
}
if (isset($config['base_uri']) && strpos($config['base_uri'], 'http') === false) {
$config['base_uri'] = 'https://' . $config... | [
"protected",
"function",
"setBasicOptions",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'timeout'",
"]",
")",
")",
"{",
"$",
"config",
"[",
"'timeout'",
"]",
"=",
"static",
"::",
"DEFAULT_REQUEST_TIMEOUT",
";... | Set timeout and base_uri options
@param array $config
@return mixed | [
"Set",
"timeout",
"and",
"base_uri",
"options"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L494-L505 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setConfigOption | protected function setConfigOption($what, $value)
{
$closure = function () use ($what, $value) {
/* @var $this \GuzzleHttp\Client */
$this->config[$what] = $value;
};
$closure = $closure->bindTo($this, \GuzzleHttp\Client::class);
$closure();
} | php | protected function setConfigOption($what, $value)
{
$closure = function () use ($what, $value) {
/* @var $this \GuzzleHttp\Client */
$this->config[$what] = $value;
};
$closure = $closure->bindTo($this, \GuzzleHttp\Client::class);
$closure();
} | [
"protected",
"function",
"setConfigOption",
"(",
"$",
"what",
",",
"$",
"value",
")",
"{",
"$",
"closure",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"what",
",",
"$",
"value",
")",
"{",
"/* @var $this \\GuzzleHttp\\Client */",
"$",
"this",
"->",
"config"... | Set values on the private \GuzzleHttp\Client->config
This is a terrible hack, and illustrates why making
anything private makes it difficult to extend, and impossible
when there is no setter.
@param string $what Config option to set
@param mixed $value Value to set the option to
@return void | [
"Set",
"values",
"on",
"the",
"private",
"\\",
"GuzzleHttp",
"\\",
"Client",
"-",
">",
"config"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L518-L527 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setDebugHandler | protected function setDebugHandler($options, $fp = null)
{
try {
if (is_bool($fp)) {
$fp = null;
}
$handler = $this->getConfig('handler');
// if we have a default handler, and we've already created a DebugHandler
// we can bail out... | php | protected function setDebugHandler($options, $fp = null)
{
try {
if (is_bool($fp)) {
$fp = null;
}
$handler = $this->getConfig('handler');
// if we have a default handler, and we've already created a DebugHandler
// we can bail out... | [
"protected",
"function",
"setDebugHandler",
"(",
"$",
"options",
",",
"$",
"fp",
"=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"fp",
")",
")",
"{",
"$",
"fp",
"=",
"null",
";",
"}",
"$",
"handler",
"=",
"$",
"this",
"->",
"... | Add the Debug handler to the HandlerStack
@param array $options Guzzle Options
@param bool|resource|null $fp Stream to write to
@return array | [
"Add",
"the",
"Debug",
"handler",
"to",
"the",
"HandlerStack"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L536-L570 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setLogHandler | protected function setLogHandler(\GuzzleHttp\HandlerStack $handlerStack, callable $logHandler)
{
try {
$handlerStack->after('history', $logHandler, 'logger');
} catch (\InvalidArgumentException $e) {
try {
$handlerStack->before('allow_redirects', $logHandler, ... | php | protected function setLogHandler(\GuzzleHttp\HandlerStack $handlerStack, callable $logHandler)
{
try {
$handlerStack->after('history', $logHandler, 'logger');
} catch (\InvalidArgumentException $e) {
try {
$handlerStack->before('allow_redirects', $logHandler, ... | [
"protected",
"function",
"setLogHandler",
"(",
"\\",
"GuzzleHttp",
"\\",
"HandlerStack",
"$",
"handlerStack",
",",
"callable",
"$",
"logHandler",
")",
"{",
"try",
"{",
"$",
"handlerStack",
"->",
"after",
"(",
"'history'",
",",
"$",
"logHandler",
",",
"'logger'... | Add the Log handler to the HandlerStack
@param \GuzzleHttp\HandlerStack $handlerStack
@param callable $logHandler
@return $this | [
"Add",
"the",
"Log",
"handler",
"to",
"the",
"HandlerStack"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L579-L592 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setVerboseHandler | protected function setVerboseHandler($options, $fp = null)
{
try {
if (is_bool($fp) || $fp === null) {
$fp = ['outputStream' => null, 'errorStream' => null];
} elseif (!is_array($fp)) {
$fp = ['outputStream' => $fp, 'errorStream' => $fp];
}... | php | protected function setVerboseHandler($options, $fp = null)
{
try {
if (is_bool($fp) || $fp === null) {
$fp = ['outputStream' => null, 'errorStream' => null];
} elseif (!is_array($fp)) {
$fp = ['outputStream' => $fp, 'errorStream' => $fp];
}... | [
"protected",
"function",
"setVerboseHandler",
"(",
"$",
"options",
",",
"$",
"fp",
"=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"fp",
")",
"||",
"$",
"fp",
"===",
"null",
")",
"{",
"$",
"fp",
"=",
"[",
"'outputStream'",
"=>",
... | Add the Verbose handler to the HandlerStack
@param array $options Guzzle Options
@param bool|resource|array|null $fp Stream to write to
@return array | [
"Add",
"the",
"Verbose",
"handler",
"to",
"the",
"HandlerStack"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L601-L637 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Client.php | Client.setRequestOptions | protected function setRequestOptions(array $options)
{
if (isset($options['timestamp'])) {
$this->authentication->setTimestamp($options['timestamp']);
} elseif (!$this->getConfig('timestamp')) {
$this->authentication->setTimestamp();
}
if (isset($options['non... | php | protected function setRequestOptions(array $options)
{
if (isset($options['timestamp'])) {
$this->authentication->setTimestamp($options['timestamp']);
} elseif (!$this->getConfig('timestamp')) {
$this->authentication->setTimestamp();
}
if (isset($options['non... | [
"protected",
"function",
"setRequestOptions",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'timestamp'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"authentication",
"->",
"setTimestamp",
"(",
"$",
"options",
"[",
"'... | Set request specific options
@param array $options
@return array | [
"Set",
"request",
"specific",
"options"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Client.php#L645-L676 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Handler/Authentication.php | Authentication.setSigner | public function setSigner(\Akamai\Open\EdgeGrid\Authentication $auth = null)
{
$this->signer = $auth;
if ($this->signer === null) {
$this->signer = new Signer();
}
} | php | public function setSigner(\Akamai\Open\EdgeGrid\Authentication $auth = null)
{
$this->signer = $auth;
if ($this->signer === null) {
$this->signer = new Signer();
}
} | [
"public",
"function",
"setSigner",
"(",
"\\",
"Akamai",
"\\",
"Open",
"\\",
"EdgeGrid",
"\\",
"Authentication",
"$",
"auth",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"signer",
"=",
"$",
"auth",
";",
"if",
"(",
"$",
"this",
"->",
"signer",
"===",
"nu... | Inject signer object
@param Signer|null $auth | [
"Inject",
"signer",
"object"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Handler/Authentication.php#L50-L56 |
akamai/AkamaiOPEN-edgegrid-php-client | src/Handler/Authentication.php | Authentication.createFromEdgeRcFile | public static function createFromEdgeRcFile($section = 'default', $file = null)
{
$signer = Signer::createFromEdgeRcFile($section, $file);
$auth = new static();
$auth->setSigner($signer);
return $auth;
} | php | public static function createFromEdgeRcFile($section = 'default', $file = null)
{
$signer = Signer::createFromEdgeRcFile($section, $file);
$auth = new static();
$auth->setSigner($signer);
return $auth;
} | [
"public",
"static",
"function",
"createFromEdgeRcFile",
"(",
"$",
"section",
"=",
"'default'",
",",
"$",
"file",
"=",
"null",
")",
"{",
"$",
"signer",
"=",
"Signer",
"::",
"createFromEdgeRcFile",
"(",
"$",
"section",
",",
"$",
"file",
")",
";",
"$",
"aut... | Create Handler using an .edgerc file
Automatically create a valid authentication handler using
an .edgerc file
@param string $section
@param null $file
@return static | [
"Create",
"Handler",
"using",
"an",
".",
"edgerc",
"file"
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-php-client/blob/a368473f0f73fab96ffee03ee40d2f18694ff526/src/Handler/Authentication.php#L129-L136 |
edvinaskrucas/notification | src/Krucas/Notification/Collection.php | Collection.add | public function add(Message $message)
{
$this->queue->insert($message, is_null($message->getPosition()) ? null : -$message->getPosition());
$this->copyQueue(clone $this->queue);
return $this;
} | php | public function add(Message $message)
{
$this->queue->insert($message, is_null($message->getPosition()) ? null : -$message->getPosition());
$this->copyQueue(clone $this->queue);
return $this;
} | [
"public",
"function",
"add",
"(",
"Message",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"queue",
"->",
"insert",
"(",
"$",
"message",
",",
"is_null",
"(",
"$",
"message",
"->",
"getPosition",
"(",
")",
")",
"?",
"null",
":",
"-",
"$",
"message",
... | Add message to collection.
@param Message $message
@return \Krucas\Notification\Collection | [
"Add",
"message",
"to",
"collection",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Collection.php#L37-L44 |
edvinaskrucas/notification | src/Krucas/Notification/Collection.php | Collection.copyQueue | protected function copyQueue(\SplPriorityQueue $queue)
{
$this->items = [];
foreach ($queue as $item) {
$this->items[] = $item;
}
} | php | protected function copyQueue(\SplPriorityQueue $queue)
{
$this->items = [];
foreach ($queue as $item) {
$this->items[] = $item;
}
} | [
"protected",
"function",
"copyQueue",
"(",
"\\",
"SplPriorityQueue",
"$",
"queue",
")",
"{",
"$",
"this",
"->",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"queue",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"items",
"[",
"]",
"=",
"$",
... | Copy queue items.
@param \SplPriorityQueue $queue
@return void | [
"Copy",
"queue",
"items",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Collection.php#L52-L59 |
edvinaskrucas/notification | src/Krucas/Notification/Collection.php | Collection.render | public function render()
{
$output = '';
foreach ($this->items as $message) {
$output .= $message->render();
}
return $output;
} | php | public function render()
{
$output = '';
foreach ($this->items as $message) {
$output .= $message->render();
}
return $output;
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"message",
")",
"{",
"$",
"output",
".=",
"$",
"message",
"->",
"render",
"(",
")",
";",
"}",
"return",
"$",
"out... | Get the evaluated contents of the object.
@return string | [
"Get",
"the",
"evaluated",
"contents",
"of",
"the",
"object",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Collection.php#L66-L75 |
edvinaskrucas/notification | src/Krucas/Notification/Message.php | Message.render | public function render()
{
if (is_null($this->getMessage())) {
return '';
}
$message = htmlspecialchars($this->getMessage(), ENT_QUOTES, null, false);
return str_replace([':message', ':type'], [$message, $this->getType()], $this->getFormat());
} | php | public function render()
{
if (is_null($this->getMessage())) {
return '';
}
$message = htmlspecialchars($this->getMessage(), ENT_QUOTES, null, false);
return str_replace([':message', ':type'], [$message, $this->getType()], $this->getFormat());
} | [
"public",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getMessage",
"(",
")",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"message",
"=",
"htmlspecialchars",
"(",
"$",
"this",
"->",
"getMessage",
"(",
")",
"... | Get the evaluated contents of the object.
@return string | [
"Get",
"the",
"evaluated",
"contents",
"of",
"the",
"object",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Message.php#L255-L262 |
edvinaskrucas/notification | src/Krucas/Notification/Subscriber.php | Subscriber.onFlash | public function onFlash($eventName, array $data)
{
$this->validateEventData($data);
list($notification, $notificationBag, $message) = $data;
$key = implode('.', [$this->key, $notificationBag->getName()]);
$this->session->push($key, $message);
return true;
} | php | public function onFlash($eventName, array $data)
{
$this->validateEventData($data);
list($notification, $notificationBag, $message) = $data;
$key = implode('.', [$this->key, $notificationBag->getName()]);
$this->session->push($key, $message);
return true;
} | [
"public",
"function",
"onFlash",
"(",
"$",
"eventName",
",",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"validateEventData",
"(",
"$",
"data",
")",
";",
"list",
"(",
"$",
"notification",
",",
"$",
"notificationBag",
",",
"$",
"message",
")",
"=... | Execute this event to flash messages.
@param string $eventName
@param array $data Event payload. Should be an array containing 3 elements:
[ Notification, NotificationsBag, Message ]
@return bool | [
"Execute",
"this",
"event",
"to",
"flash",
"messages",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Subscriber.php#L61-L72 |
edvinaskrucas/notification | src/Krucas/Notification/Subscriber.php | Subscriber.validateEventData | private function validateEventData(array $data)
{
if ( ! array_key_exists(0, $data) || ! array_key_exists(1, $data) || ! array_key_exists(2, $data)) {
throw new \InvalidArgumentException(sprintf(
'%s expects 3 elements in data array, %s given.',
sprintf('%s::onFla... | php | private function validateEventData(array $data)
{
if ( ! array_key_exists(0, $data) || ! array_key_exists(1, $data) || ! array_key_exists(2, $data)) {
throw new \InvalidArgumentException(sprintf(
'%s expects 3 elements in data array, %s given.',
sprintf('%s::onFla... | [
"private",
"function",
"validateEventData",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"0",
",",
"$",
"data",
")",
"||",
"!",
"array_key_exists",
"(",
"1",
",",
"$",
"data",
")",
"||",
"!",
"array_key_exists",
"(",
"2... | Validates that the correct event data has been passed to self::onFlash()
Data array should have 3 elements with sequential keys: Notification, NotificationsBag and Message
@param array $data
@throws InvalidArgumentException If the event data is invalid. | [
"Validates",
"that",
"the",
"correct",
"event",
"data",
"has",
"been",
"passed",
"to",
"self",
"::",
"onFlash",
"()"
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Subscriber.php#L93-L117 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationServiceProvider.php | NotificationServiceProvider.boot | public function boot(Dispatcher $dispatcher)
{
$this->publishes(array(
__DIR__ . '/../../config/notification.php' => config_path('notification.php'),
), 'config');
$dispatcher->subscribe('Krucas\Notification\Subscriber');
$this->app->afterResolving('blade.compil... | php | public function boot(Dispatcher $dispatcher)
{
$this->publishes(array(
__DIR__ . '/../../config/notification.php' => config_path('notification.php'),
), 'config');
$dispatcher->subscribe('Krucas\Notification\Subscriber');
$this->app->afterResolving('blade.compil... | [
"public",
"function",
"boot",
"(",
"Dispatcher",
"$",
"dispatcher",
")",
"{",
"$",
"this",
"->",
"publishes",
"(",
"array",
"(",
"__DIR__",
".",
"'/../../config/notification.php'",
"=>",
"config_path",
"(",
"'notification.php'",
")",
",",
")",
",",
"'config'",
... | Bootstrap the application events.
@param \Illuminate\Contracts\Events\Dispatcher $dispatcher
@return void | [
"Bootstrap",
"the",
"application",
"events",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationServiceProvider.php#L22-L39 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationServiceProvider.php | NotificationServiceProvider.register | public function register()
{
$this->mergeConfigFrom(__DIR__ . '/../../config/notification.php', 'notification');
$this->app->singleton('notification', function ($app) {
$config = $app['config'];
$notification = new Notification(
$config->get('notific... | php | public function register()
{
$this->mergeConfigFrom(__DIR__ . '/../../config/notification.php', 'notification');
$this->app->singleton('notification', function ($app) {
$config = $app['config'];
$notification = new Notification(
$config->get('notific... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"mergeConfigFrom",
"(",
"__DIR__",
".",
"'/../../config/notification.php'",
",",
"'notification'",
")",
";",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'notification'",
",",
"function",
... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationServiceProvider.php#L46-L81 |
edvinaskrucas/notification | src/Krucas/Notification/Middleware/NotificationMiddleware.php | NotificationMiddleware.handle | public function handle($request, Closure $next)
{
$containers = $this->session->get($this->key, []);
if (count($containers) > 0) {
foreach ($containers as $name => $messages) {
/** @var \Krucas\Notification\Message $message */
foreach ($messages as $messa... | php | public function handle($request, Closure $next)
{
$containers = $this->session->get($this->key, []);
if (count($containers) > 0) {
foreach ($containers as $name => $messages) {
/** @var \Krucas\Notification\Message $message */
foreach ($messages as $messa... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"$",
"containers",
"=",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"$",
"this",
"->",
"key",
",",
"[",
"]",
")",
";",
"if",
"(",
"count",
"(",
"$",
... | Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Middleware/NotificationMiddleware.php#L43-L59 |
edvinaskrucas/notification | src/Krucas/Notification/Notification.php | Notification.getContainerTypes | public function getContainerTypes($container)
{
if (isset($this->types[$container])) {
return $this->types[$container];
}
return $this->defaultTypes;
} | php | public function getContainerTypes($container)
{
if (isset($this->types[$container])) {
return $this->types[$container];
}
return $this->defaultTypes;
} | [
"public",
"function",
"getContainerTypes",
"(",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"container",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"types",
"[",
"$",
"container",
"]",
";",
"}",
... | Return types for a container.
@param $container
@return array | [
"Return",
"types",
"for",
"a",
"container",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Notification.php#L130-L137 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.