repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1 value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
ElfSundae/bearychat | src/Message.php | Message.setAttachmentDefaults | public function setAttachmentDefaults($defaults)
{
if ($this->attachmentDefaults != ($defaults = (array) $defaults)) {
$this->attachmentDefaults = $defaults;
$this->setAttachments($this->attachments);
}
return $this;
} | php | public function setAttachmentDefaults($defaults)
{
if ($this->attachmentDefaults != ($defaults = (array) $defaults)) {
$this->attachmentDefaults = $defaults;
$this->setAttachments($this->attachments);
}
return $this;
} | [
"public",
"function",
"setAttachmentDefaults",
"(",
"$",
"defaults",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attachmentDefaults",
"!=",
"(",
"$",
"defaults",
"=",
"(",
"array",
")",
"$",
"defaults",
")",
")",
"{",
"$",
"this",
"->",
"attachmentDefaults",
... | Set the attachments defaults.
@param array $defaults
@return $this | [
"Set",
"the",
"attachments",
"defaults",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L374-L383 | train |
ElfSundae/bearychat | src/Message.php | Message.getAttachmentPayload | protected function getAttachmentPayload($text = null, $title = null, $images = null, $color = null)
{
$attachment = [];
if ($text) {
$attachment['text'] = $this->stringValue($text);
}
if ($title) {
$attachment['title'] = $this->stringValue($title);
}
if ($images = $this->getImagesPayload($images)) {
$attachment['images'] = $images;
}
if ($color) {
$attachment['color'] = (string) $color;
}
return $attachment;
} | php | protected function getAttachmentPayload($text = null, $title = null, $images = null, $color = null)
{
$attachment = [];
if ($text) {
$attachment['text'] = $this->stringValue($text);
}
if ($title) {
$attachment['title'] = $this->stringValue($title);
}
if ($images = $this->getImagesPayload($images)) {
$attachment['images'] = $images;
}
if ($color) {
$attachment['color'] = (string) $color;
}
return $attachment;
} | [
"protected",
"function",
"getAttachmentPayload",
"(",
"$",
"text",
"=",
"null",
",",
"$",
"title",
"=",
"null",
",",
"$",
"images",
"=",
"null",
",",
"$",
"color",
"=",
"null",
")",
"{",
"$",
"attachment",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"text"... | Get payload for an attachment.
@param mixed $text
@param mixed $title
@param mixed $images
@param mixed $color
@return array | [
"Get",
"payload",
"for",
"an",
"attachment",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L465-L486 | train |
ElfSundae/bearychat | src/Message.php | Message.getImagesPayload | protected function getImagesPayload($value)
{
$images = [];
foreach ((array) $value as $img) {
if (! empty($img['url'])) {
$img = $img['url'];
}
if (is_string($img) && ! empty($img)) {
$images[] = ['url' => $img];
}
}
return $images;
} | php | protected function getImagesPayload($value)
{
$images = [];
foreach ((array) $value as $img) {
if (! empty($img['url'])) {
$img = $img['url'];
}
if (is_string($img) && ! empty($img)) {
$images[] = ['url' => $img];
}
}
return $images;
} | [
"protected",
"function",
"getImagesPayload",
"(",
"$",
"value",
")",
"{",
"$",
"images",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"value",
"as",
"$",
"img",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"img",
"[",
"'url'",
"]",... | Get payload for images.
@param mixed $value
@return array | [
"Get",
"payload",
"for",
"images",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L494-L509 | train |
ElfSundae/bearychat | src/Message.php | Message.stringValue | protected function stringValue($value, $jsonOptions = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)
{
if (is_string($value)) {
return $value;
}
if (method_exists($value, '__toString')) {
return (string) $value;
}
if (method_exists($value, 'toArray')) {
$value = $value->toArray();
}
return json_encode($value, $jsonOptions);
} | php | protected function stringValue($value, $jsonOptions = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)
{
if (is_string($value)) {
return $value;
}
if (method_exists($value, '__toString')) {
return (string) $value;
}
if (method_exists($value, 'toArray')) {
$value = $value->toArray();
}
return json_encode($value, $jsonOptions);
} | [
"protected",
"function",
"stringValue",
"(",
"$",
"value",
",",
"$",
"jsonOptions",
"=",
"JSON_UNESCAPED_UNICODE",
"|",
"JSON_UNESCAPED_SLASHES",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(... | Convert any type to string.
@param mixed $value
@param int $jsonOptions
@return string | [
"Convert",
"any",
"type",
"to",
"string",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L518-L533 | train |
ElfSundae/bearychat | src/Message.php | Message.addImage | public function addImage($image, $desc = null, $title = null)
{
return $this->addAttachment($desc, $title, $image);
} | php | public function addImage($image, $desc = null, $title = null)
{
return $this->addAttachment($desc, $title, $image);
} | [
"public",
"function",
"addImage",
"(",
"$",
"image",
",",
"$",
"desc",
"=",
"null",
",",
"$",
"title",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addAttachment",
"(",
"$",
"desc",
",",
"$",
"title",
",",
"$",
"image",
")",
";",
"}"
] | Add an image attachment to the message.
@param string|string[] $image
@param string $desc
@param string $title
@return $this | [
"Add",
"an",
"image",
"attachment",
"to",
"the",
"message",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L554-L557 | train |
ElfSundae/bearychat | src/Message.php | Message.configureDefaults | public function configureDefaults(array $defaults, $force = false)
{
if ($force || empty($this->toArray())) {
$attachmentDefaults = $this->attachmentDefaults;
foreach (MessageDefaults::allKeys() as $key) {
if (isset($defaults[$key]) && ! is_null($value = $defaults[$key])) {
if (strpos($key, 'attachment_') !== false) {
if ($key = substr($key, strlen('attachment_'))) {
$attachmentDefaults[$key] = $value;
}
} else {
$this->fillDefaults($key, $value);
}
}
}
$this->setAttachmentDefaults($attachmentDefaults);
}
return $this;
} | php | public function configureDefaults(array $defaults, $force = false)
{
if ($force || empty($this->toArray())) {
$attachmentDefaults = $this->attachmentDefaults;
foreach (MessageDefaults::allKeys() as $key) {
if (isset($defaults[$key]) && ! is_null($value = $defaults[$key])) {
if (strpos($key, 'attachment_') !== false) {
if ($key = substr($key, strlen('attachment_'))) {
$attachmentDefaults[$key] = $value;
}
} else {
$this->fillDefaults($key, $value);
}
}
}
$this->setAttachmentDefaults($attachmentDefaults);
}
return $this;
} | [
"public",
"function",
"configureDefaults",
"(",
"array",
"$",
"defaults",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"force",
"||",
"empty",
"(",
"$",
"this",
"->",
"toArray",
"(",
")",
")",
")",
"{",
"$",
"attachmentDefaults",
"=",
"... | Configure message defaults.
@param array $defaults
@param bool $force
@return $this | [
"Configure",
"message",
"defaults",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L599-L620 | train |
ElfSundae/bearychat | src/Message.php | Message.fillDefaults | protected function fillDefaults($key, $value)
{
if (
($key === MessageDefaults::USER || $key === MessageDefaults::CHANNEL) &&
(! is_null($this->getTarget()))
) {
return;
}
if ($suffix = $this->studlyCase($key)) {
$getMethod = 'get'.$suffix;
$setMethod = 'set'.$suffix;
if (
method_exists($this, $getMethod) &&
is_null($this->{$getMethod}()) &&
method_exists($this, $setMethod)
) {
$this->{$setMethod}($value);
}
}
} | php | protected function fillDefaults($key, $value)
{
if (
($key === MessageDefaults::USER || $key === MessageDefaults::CHANNEL) &&
(! is_null($this->getTarget()))
) {
return;
}
if ($suffix = $this->studlyCase($key)) {
$getMethod = 'get'.$suffix;
$setMethod = 'set'.$suffix;
if (
method_exists($this, $getMethod) &&
is_null($this->{$getMethod}()) &&
method_exists($this, $setMethod)
) {
$this->{$setMethod}($value);
}
}
} | [
"protected",
"function",
"fillDefaults",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"(",
"$",
"key",
"===",
"MessageDefaults",
"::",
"USER",
"||",
"$",
"key",
"===",
"MessageDefaults",
"::",
"CHANNEL",
")",
"&&",
"(",
"!",
"is_null",
"(",... | Fill with message defaults.
@param string $key
@param mixed $value
@return void | [
"Fill",
"with",
"message",
"defaults",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L629-L649 | train |
ElfSundae/bearychat | src/Message.php | Message.content | public function content()
{
$arguments = func_get_args();
$count = count($arguments);
if ($count > 0) {
$this->setText($arguments[0]);
}
if ($count > 1) {
if (is_bool($arguments[1])) {
$this->setMarkdown($arguments[1]);
if ($count > 2) {
$this->setNotification($arguments[2]);
}
} else {
call_user_func_array([$this, 'addAttachment'], array_slice($arguments, 1));
}
}
return $this;
} | php | public function content()
{
$arguments = func_get_args();
$count = count($arguments);
if ($count > 0) {
$this->setText($arguments[0]);
}
if ($count > 1) {
if (is_bool($arguments[1])) {
$this->setMarkdown($arguments[1]);
if ($count > 2) {
$this->setNotification($arguments[2]);
}
} else {
call_user_func_array([$this, 'addAttachment'], array_slice($arguments, 1));
}
}
return $this;
} | [
"public",
"function",
"content",
"(",
")",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"arguments",
")",
";",
"if",
"(",
"$",
"count",
">",
"0",
")",
"{",
"$",
"this",
"->",
"setText",
"(",
"$... | Conveniently set message content.
The parameters may be:
`($text, $markdown, $notification)`
or `($text, $attachment_text, $attachment_title, $attachment_images, $attachment_color)`.
@return $this | [
"Conveniently",
"set",
"message",
"content",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L671-L693 | train |
ElfSundae/bearychat | src/Message.php | Message.toArray | public function toArray()
{
return array_filter(
[
'text' => $this->getText(),
'notification' => $this->getNotification(),
'markdown' => $this->getMarkdown(),
'channel' => $this->getChannel(),
'user' => $this->getUser(),
'attachments' => $this->getAttachments(),
],
function ($value, $key) {
return ! (
is_null($value) ||
($key === 'markdown' && $value === true) ||
(is_array($value) && empty($value))
);
},
ARRAY_FILTER_USE_BOTH
);
} | php | public function toArray()
{
return array_filter(
[
'text' => $this->getText(),
'notification' => $this->getNotification(),
'markdown' => $this->getMarkdown(),
'channel' => $this->getChannel(),
'user' => $this->getUser(),
'attachments' => $this->getAttachments(),
],
function ($value, $key) {
return ! (
is_null($value) ||
($key === 'markdown' && $value === true) ||
(is_array($value) && empty($value))
);
},
ARRAY_FILTER_USE_BOTH
);
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"array_filter",
"(",
"[",
"'text'",
"=>",
"$",
"this",
"->",
"getText",
"(",
")",
",",
"'notification'",
"=>",
"$",
"this",
"->",
"getNotification",
"(",
")",
",",
"'markdown'",
"=>",
"$",
"this",... | Convert the message to an array.
@return array | [
"Convert",
"the",
"message",
"to",
"an",
"array",
"."
] | b696c88deae1c90f679edf53ff0760602edba701 | https://github.com/ElfSundae/bearychat/blob/b696c88deae1c90f679edf53ff0760602edba701/src/Message.php#L700-L720 | train |
Speelpenning-nl/laravel-products | src/Repositories/AttributeRepository.php | AttributeRepository.syncWithProductType | public function syncWithProductType(ProductTypeContract $productType, $attributeIds, array $requiredAttributes = [])
{
$attributeIds = is_array($attributeIds) ? $attributeIds : [$attributeIds];
$pivot = [];
foreach ($attributeIds as $id) {
$pivot[$id] = ['required' => in_array($id, $requiredAttributes)];
}
return $productType->attributes()->sync($pivot);
} | php | public function syncWithProductType(ProductTypeContract $productType, $attributeIds, array $requiredAttributes = [])
{
$attributeIds = is_array($attributeIds) ? $attributeIds : [$attributeIds];
$pivot = [];
foreach ($attributeIds as $id) {
$pivot[$id] = ['required' => in_array($id, $requiredAttributes)];
}
return $productType->attributes()->sync($pivot);
} | [
"public",
"function",
"syncWithProductType",
"(",
"ProductTypeContract",
"$",
"productType",
",",
"$",
"attributeIds",
",",
"array",
"$",
"requiredAttributes",
"=",
"[",
"]",
")",
"{",
"$",
"attributeIds",
"=",
"is_array",
"(",
"$",
"attributeIds",
")",
"?",
"... | Relates attributes to a product type.
@param ProductTypeContract $productType
@param int|array $attributeIds
@param array $requiredAttributes
@return array | [
"Relates",
"attributes",
"to",
"a",
"product",
"type",
"."
] | 41522ebbdd41108c1d4532bb42be602cc0c530c4 | https://github.com/Speelpenning-nl/laravel-products/blob/41522ebbdd41108c1d4532bb42be602cc0c530c4/src/Repositories/AttributeRepository.php#L44-L54 | train |
carlosbuenosvinos/php-geckoboard-api | src/CarlosIO/Geckoboard/Widgets/LeaderBoard.php | LeaderBoard.getData | public function getData($order = self::SORT_DESC)
{
return array(
'items' => array_map(
function (Item $item) {
/*
* @var Item $item
*/
return $item->toArray();
},
array_values($this->getItems($order))
),
);
} | php | public function getData($order = self::SORT_DESC)
{
return array(
'items' => array_map(
function (Item $item) {
/*
* @var Item $item
*/
return $item->toArray();
},
array_values($this->getItems($order))
),
);
} | [
"public",
"function",
"getData",
"(",
"$",
"order",
"=",
"self",
"::",
"SORT_DESC",
")",
"{",
"return",
"array",
"(",
"'items'",
"=>",
"array_map",
"(",
"function",
"(",
"Item",
"$",
"item",
")",
"{",
"/*\n * @var Item $item\n ... | Get data in array format.
@param int $order
@return array | [
"Get",
"data",
"in",
"array",
"format",
"."
] | d756e38298e20300f29af5d536b598648f27fe5c | https://github.com/carlosbuenosvinos/php-geckoboard-api/blob/d756e38298e20300f29af5d536b598648f27fe5c/src/CarlosIO/Geckoboard/Widgets/LeaderBoard.php#L53-L66 | train |
EvilFreelancer/openvpn-php | src/Config.php | Config.generate | public function generate(): string
{
// Init the variable
$config = '';
foreach ($this->getParams() as $key => $value) {
$config .= $key . ((\strlen($value) > 0) ? ' ' . $value : '') . "\n";
}
$certs = $this->getCerts();
if (\count($certs) > 0) {
$config .= "\n### Certificates\n";
foreach ($this->getCerts() as $key => $value) {
$config .= isset($value['content'])
? "<$key>\n{$value['content']}\n</$key>\n"
: "$key {$value['path']}\n";
}
}
$pushes = $this->getPushes();
if (\count($pushes) > 0) {
$config .= "\n### Networking\n";
foreach ($this->getPushes() as $push) {
$config .= 'push "' . $push . "\"\n";
}
}
return $config;
} | php | public function generate(): string
{
// Init the variable
$config = '';
foreach ($this->getParams() as $key => $value) {
$config .= $key . ((\strlen($value) > 0) ? ' ' . $value : '') . "\n";
}
$certs = $this->getCerts();
if (\count($certs) > 0) {
$config .= "\n### Certificates\n";
foreach ($this->getCerts() as $key => $value) {
$config .= isset($value['content'])
? "<$key>\n{$value['content']}\n</$key>\n"
: "$key {$value['path']}\n";
}
}
$pushes = $this->getPushes();
if (\count($pushes) > 0) {
$config .= "\n### Networking\n";
foreach ($this->getPushes() as $push) {
$config .= 'push "' . $push . "\"\n";
}
}
return $config;
} | [
"public",
"function",
"generate",
"(",
")",
":",
"string",
"{",
"// Init the variable",
"$",
"config",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"getParams",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"config",
".=",
"$",... | Generate config by parameters in memory
@return string | [
"Generate",
"config",
"by",
"parameters",
"in",
"memory"
] | 29cdc6566d1c97e16ed158e97d34a8bd03045d9a | https://github.com/EvilFreelancer/openvpn-php/blob/29cdc6566d1c97e16ed158e97d34a8bd03045d9a/src/Config.php#L32-L60 | train |
EvilFreelancer/openvpn-php | src/Config.php | Config.addCert | public function addCert(string $type, string $pathOrContent, bool $isContent = false): ConfigInterface
{
$type = mb_strtolower($type);
$this->throwIfNotInArray($type, self::CERTS);
if (true === $isContent) {
$this->_certs[$type]['content'] = $pathOrContent;
} else {
$this->_certs[$type]['path'] = $pathOrContent;
}
return $this;
} | php | public function addCert(string $type, string $pathOrContent, bool $isContent = false): ConfigInterface
{
$type = mb_strtolower($type);
$this->throwIfNotInArray($type, self::CERTS);
if (true === $isContent) {
$this->_certs[$type]['content'] = $pathOrContent;
} else {
$this->_certs[$type]['path'] = $pathOrContent;
}
return $this;
} | [
"public",
"function",
"addCert",
"(",
"string",
"$",
"type",
",",
"string",
"$",
"pathOrContent",
",",
"bool",
"$",
"isContent",
"=",
"false",
")",
":",
"ConfigInterface",
"{",
"$",
"type",
"=",
"mb_strtolower",
"(",
"$",
"type",
")",
";",
"$",
"this",
... | Add new cert into the configuration
@param string $type Type of certificate [ca, cert, key, dh, tls-auth]
@param string $pathOrContent Absolute or relative path to certificate or content of this file
@param bool if content of file is provided
@throws \RuntimeException
@return ConfigInterface | [
"Add",
"new",
"cert",
"into",
"the",
"configuration"
] | 29cdc6566d1c97e16ed158e97d34a8bd03045d9a | https://github.com/EvilFreelancer/openvpn-php/blob/29cdc6566d1c97e16ed158e97d34a8bd03045d9a/src/Config.php#L88-L98 | train |
EvilFreelancer/openvpn-php | src/Config.php | Config.delCert | public function delCert(string $type): ConfigInterface
{
$type = mb_strtolower($type);
$this->throwIfNotInArray($type, self::CERTS);
unset($this->_certs[$type]);
return $this;
} | php | public function delCert(string $type): ConfigInterface
{
$type = mb_strtolower($type);
$this->throwIfNotInArray($type, self::CERTS);
unset($this->_certs[$type]);
return $this;
} | [
"public",
"function",
"delCert",
"(",
"string",
"$",
"type",
")",
":",
"ConfigInterface",
"{",
"$",
"type",
"=",
"mb_strtolower",
"(",
"$",
"type",
")",
";",
"$",
"this",
"->",
"throwIfNotInArray",
"(",
"$",
"type",
",",
"self",
"::",
"CERTS",
")",
";"... | Remove selected certificate from array
@param string $type Type of certificate [ca, cert, key, dh, tls-auth]
@throws \RuntimeException
@return ConfigInterface | [
"Remove",
"selected",
"certificate",
"from",
"array"
] | 29cdc6566d1c97e16ed158e97d34a8bd03045d9a | https://github.com/EvilFreelancer/openvpn-php/blob/29cdc6566d1c97e16ed158e97d34a8bd03045d9a/src/Config.php#L107-L113 | train |
EvilFreelancer/openvpn-php | src/Config.php | Config.getCert | public function getCert(string $type): array
{
$type = mb_strtolower($type);
$this->throwIfNotInArray($type, self::CERTS);
return $this->_certs[$type] ?? [];
} | php | public function getCert(string $type): array
{
$type = mb_strtolower($type);
$this->throwIfNotInArray($type, self::CERTS);
return $this->_certs[$type] ?? [];
} | [
"public",
"function",
"getCert",
"(",
"string",
"$",
"type",
")",
":",
"array",
"{",
"$",
"type",
"=",
"mb_strtolower",
"(",
"$",
"type",
")",
";",
"$",
"this",
"->",
"throwIfNotInArray",
"(",
"$",
"type",
",",
"self",
"::",
"CERTS",
")",
";",
"retur... | Return information about specified certificate
@param string $type
@throws \RuntimeException
@return array | [
"Return",
"information",
"about",
"specified",
"certificate"
] | 29cdc6566d1c97e16ed158e97d34a8bd03045d9a | https://github.com/EvilFreelancer/openvpn-php/blob/29cdc6566d1c97e16ed158e97d34a8bd03045d9a/src/Config.php#L122-L127 | train |
EvilFreelancer/openvpn-php | src/Config.php | Config.add | public function add(string $name, $value = null): ConfigInterface
{
$name = mb_strtolower($name);
// Check if key is certificate or push, or classic parameter
if (\in_array($name, self::CERTS, true)) {
$this->addCert($name, $value);
} elseif ($name === 'push') {
$this->addPush($value);
} else {
$this->_params[$name] = $this->isBool($value);
}
return $this;
} | php | public function add(string $name, $value = null): ConfigInterface
{
$name = mb_strtolower($name);
// Check if key is certificate or push, or classic parameter
if (\in_array($name, self::CERTS, true)) {
$this->addCert($name, $value);
} elseif ($name === 'push') {
$this->addPush($value);
} else {
$this->_params[$name] = $this->isBool($value);
}
return $this;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
":",
"ConfigInterface",
"{",
"$",
"name",
"=",
"mb_strtolower",
"(",
"$",
"name",
")",
";",
"// Check if key is certificate or push, or classic parameter",
"if",
"(",
... | Add some new parameter to the list of parameters
@example $this->add('client')->add('remote', 'vpn.example.com');
@param string $name Name of parameter
@param string|bool|null $value Value of parameter
@return ConfigInterface | [
"Add",
"some",
"new",
"parameter",
"to",
"the",
"list",
"of",
"parameters"
] | 29cdc6566d1c97e16ed158e97d34a8bd03045d9a | https://github.com/EvilFreelancer/openvpn-php/blob/29cdc6566d1c97e16ed158e97d34a8bd03045d9a/src/Config.php#L195-L209 | train |
EvilFreelancer/openvpn-php | src/Config.php | Config.del | public function del(string $name): ConfigInterface
{
// Check if key is certificate or push, or classic parameter
if (\in_array($name, self::CERTS, true)) {
$this->delCert($name);
} elseif ($name === 'push') {
throw new \RuntimeException("Not possible to remove push, use 'delPush' instead");
} else {
$this->_params = array_map(
function($param) use ($name) {
return ($param['name'] === $name) ? null : $param;
},
$this->_params
);
}
return $this;
} | php | public function del(string $name): ConfigInterface
{
// Check if key is certificate or push, or classic parameter
if (\in_array($name, self::CERTS, true)) {
$this->delCert($name);
} elseif ($name === 'push') {
throw new \RuntimeException("Not possible to remove push, use 'delPush' instead");
} else {
$this->_params = array_map(
function($param) use ($name) {
return ($param['name'] === $name) ? null : $param;
},
$this->_params
);
}
return $this;
} | [
"public",
"function",
"del",
"(",
"string",
"$",
"name",
")",
":",
"ConfigInterface",
"{",
"// Check if key is certificate or push, or classic parameter",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"name",
",",
"self",
"::",
"CERTS",
",",
"true",
")",
")",
"{",
"$... | Remove some parameter from array by name
@param string $name Name of parameter
@throws \RuntimeException
@return ConfigInterface | [
"Remove",
"some",
"parameter",
"from",
"array",
"by",
"name"
] | 29cdc6566d1c97e16ed158e97d34a8bd03045d9a | https://github.com/EvilFreelancer/openvpn-php/blob/29cdc6566d1c97e16ed158e97d34a8bd03045d9a/src/Config.php#L239-L256 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getStats | public function getStats(array $options = array())
{
$resolver = new OptionsResolver();
$resolver
->setDefaults(array(
'includeTextInShapes' => 'true',
))
->setDefined(array(
'includeFootnotes', 'includeComments',
))
;
$options = $resolver->resolve($options);
//build URI to get document statistics including resolved parameters
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/statistics?' . http_build_query($options);
AsposeApp::getLogger()->info('WordsDocument getStats call will be made', array(
'call-uri' => $strURI,
));
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->StatData;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getStats(array $options = array())
{
$resolver = new OptionsResolver();
$resolver
->setDefaults(array(
'includeTextInShapes' => 'true',
))
->setDefined(array(
'includeFootnotes', 'includeComments',
))
;
$options = $resolver->resolve($options);
//build URI to get document statistics including resolved parameters
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/statistics?' . http_build_query($options);
AsposeApp::getLogger()->info('WordsDocument getStats call will be made', array(
'call-uri' => $strURI,
));
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->StatData;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getStats",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"resolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"resolver",
"->",
"setDefaults",
"(",
"array",
"(",
"'includeTextInShapes'",
"=>",
"'true'... | Get Document's stats. Add 'includeTextInShapes' or 'includeFootnotes' booleans to determine or these
words should be added to the word count.
Make sure the boolean options are strings, (e.g. true should be 'true').
@link http://www.aspose.com/docs/display/wordscloud/statistics
@param array $options
@return null|object
@throws Exception | [
"Get",
"Document",
"s",
"stats",
".",
"Add",
"includeTextInShapes",
"or",
"includeFootnotes",
"booleans",
"to",
"determine",
"or",
"these",
"words",
"should",
"be",
"added",
"to",
"the",
"word",
"count",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L132-L167 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.appendDocument | public function appendDocument($appendDocs, $importFormatModes, $sourceFolder)
{
//check whether required information is complete
if (count($appendDocs) != count($importFormatModes))
throw new Exception('Please specify complete documents and import format modes');
$post_array = array();
$i = 0;
foreach ($appendDocs as $doc) {
$post_array[] = array("Href" => (($sourceFolder != "" ) ? $sourceFolder . "\\" . $doc : $doc), "ImportFormatMode" => $importFormatModes[$i]);
$i++;
}
$data = array("DocumentEntries" => $post_array);
$json = json_encode($data);
//build URI to merge Docs
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/appendDocument';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save merged docs on server
$folder = new Folder();
$outputStream = $folder->GetFile($sourceFolder . (($sourceFolder == '') ? '' : '/') . $this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
}
AsposeApp::getLogger()->warning('Error occured, output could not be validated.', array(
'v-output' => $v_output,
));
return $v_output;
} | php | public function appendDocument($appendDocs, $importFormatModes, $sourceFolder)
{
//check whether required information is complete
if (count($appendDocs) != count($importFormatModes))
throw new Exception('Please specify complete documents and import format modes');
$post_array = array();
$i = 0;
foreach ($appendDocs as $doc) {
$post_array[] = array("Href" => (($sourceFolder != "" ) ? $sourceFolder . "\\" . $doc : $doc), "ImportFormatMode" => $importFormatModes[$i]);
$i++;
}
$data = array("DocumentEntries" => $post_array);
$json = json_encode($data);
//build URI to merge Docs
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/appendDocument';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save merged docs on server
$folder = new Folder();
$outputStream = $folder->GetFile($sourceFolder . (($sourceFolder == '') ? '' : '/') . $this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
}
AsposeApp::getLogger()->warning('Error occured, output could not be validated.', array(
'v-output' => $v_output,
));
return $v_output;
} | [
"public",
"function",
"appendDocument",
"(",
"$",
"appendDocs",
",",
"$",
"importFormatModes",
",",
"$",
"sourceFolder",
")",
"{",
"//check whether required information is complete",
"if",
"(",
"count",
"(",
"$",
"appendDocs",
")",
"!=",
"count",
"(",
"$",
"import... | Appends a list of documents to this one.
@param string $appendDocs List of documents to append.
@param string $importFormatModes Documents import format modes.
@param string $sourceFolder Name of the folder where documents are present.
@return string Returns the file path.
@throws Exception | [
"Appends",
"a",
"list",
"of",
"documents",
"to",
"this",
"one",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L256-L294 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.unprotectDocument | public function unprotectDocument(array $options)
{
$resolver = new OptionsResolver();
$resolver->setRequired('Password')
->setDefaults(array(
'ProtectionType' => 'AllowOnlyComments'
))
->setAllowedValues('ProtectionType', array(
'AllowOnlyComments',
'AllowOnlyFormFields',
'AllowOnlyRevisions',
'ReadOnly',
'NoProtection',
));
$options = $resolver->resolve($options);
$json = json_encode($options);
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/protection';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$strURI = Product::$baseProductUri . '/storage/file/' . $this->getFileName();
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$outputFile = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($responseStream, $outputFile);
return $outputFile;
} else {
return $v_output;
}
} | php | public function unprotectDocument(array $options)
{
$resolver = new OptionsResolver();
$resolver->setRequired('Password')
->setDefaults(array(
'ProtectionType' => 'AllowOnlyComments'
))
->setAllowedValues('ProtectionType', array(
'AllowOnlyComments',
'AllowOnlyFormFields',
'AllowOnlyRevisions',
'ReadOnly',
'NoProtection',
));
$options = $resolver->resolve($options);
$json = json_encode($options);
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/protection';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$strURI = Product::$baseProductUri . '/storage/file/' . $this->getFileName();
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$outputFile = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($responseStream, $outputFile);
return $outputFile;
} else {
return $v_output;
}
} | [
"public",
"function",
"unprotectDocument",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"resolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"resolver",
"->",
"setRequired",
"(",
"'Password'",
")",
"->",
"setDefaults",
"(",
"array",
"(",
"'Protecti... | Unprotect a document on the Aspose cloud storage.
@param array $options that will get processed using a OptionsResolver
<ul>
<li>'ProtectionType' => (string) Document protection password</li>
<li>'ProtectionType' => (string) Document protection type, one from: AllowOnlyComments, AllowOnlyFormFields, AllowOnlyRevisions, ReadOnly, NoProtection</li>
</ul>
@return string $filePath.
@throws Exception|InvalidOptionsException | [
"Unprotect",
"a",
"document",
"on",
"the",
"Aspose",
"cloud",
"storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L463-L496 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.updateProtection | public function updateProtection($oldPassword, $newPassword, $protectionType = 'AllowOnlyComments')
{
if ($oldPassword == '') {
throw new Exception('Please Specify Old Password');
}
if ($newPassword == '') {
throw new Exception('Please Specify New Password');
}
$fieldsArray = array('Password' => $oldPassword, 'NewPassword' => $newPassword, 'ProtectionType' => $protectionType);
$json = json_encode($fieldsArray);
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/protection';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$strURI = Product::$baseProductUri . '/storage/file/' . $this->getFileName();
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$outputFile = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($responseStream, $outputFile);
return $outputFile;
}
else
return $v_output;
} | php | public function updateProtection($oldPassword, $newPassword, $protectionType = 'AllowOnlyComments')
{
if ($oldPassword == '') {
throw new Exception('Please Specify Old Password');
}
if ($newPassword == '') {
throw new Exception('Please Specify New Password');
}
$fieldsArray = array('Password' => $oldPassword, 'NewPassword' => $newPassword, 'ProtectionType' => $protectionType);
$json = json_encode($fieldsArray);
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/protection';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$strURI = Product::$baseProductUri . '/storage/file/' . $this->getFileName();
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$outputFile = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($responseStream, $outputFile);
return $outputFile;
}
else
return $v_output;
} | [
"public",
"function",
"updateProtection",
"(",
"$",
"oldPassword",
",",
"$",
"newPassword",
",",
"$",
"protectionType",
"=",
"'AllowOnlyComments'",
")",
"{",
"if",
"(",
"$",
"oldPassword",
"==",
"''",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Please Specif... | Update document protection.
@param string $oldPassword Current document protection password.
@param string $newPassword New document protection password.
@param string $protectionType Document protection type.
@return string Returns the file path.
@throws Exception | [
"Update",
"document",
"protection",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L508-L532 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getPageSetup | public function getPageSetup($sectionid = '')
{
if ($sectionid == '')
throw new Exception('No Section Id specified');
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/sections/'.$sectionid.'/pageSetup';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET','');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->PageSetup;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getPageSetup($sectionid = '')
{
if ($sectionid == '')
throw new Exception('No Section Id specified');
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/sections/'.$sectionid.'/pageSetup';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET','');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->PageSetup;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getPageSetup",
"(",
"$",
"sectionid",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"sectionid",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'No Section Id specified'",
")",
";",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductU... | get page setup information from any section of a Word document.
$param string $filename.
$param string $sectionid.
@return Object of page setup information.
@throws Exception | [
"get",
"page",
"setup",
"information",
"from",
"any",
"section",
"of",
"a",
"Word",
"document",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L783-L803 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getAllParagraphs | public function getAllParagraphs()
{
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET','');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Paragraphs->ParagraphLinkList;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getAllParagraphs()
{
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET','');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Paragraphs->ParagraphLinkList;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getAllParagraphs",
"(",
")",
"{",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/words/'",
".",
"$",
"this",
"->",
"getFileName",
"(",
")",
".",
"'/paragraphs'",
";",
"$",
"signedURI",
"=",
"Utils",
"::",
"sign",... | get a list of all paragraphs present in a Word document.
$param string $filename.
@return Object of All Paragraphs.
@throws Exception | [
"get",
"a",
"list",
"of",
"all",
"paragraphs",
"present",
"in",
"a",
"Word",
"document",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L874-L891 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getParagraph | public function getParagraph($paragraphid = '')
{
if ($paragraphid == '')
throw new Exception('No Paragraph Id specified');
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs/'.$paragraphid.'';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET','');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Paragraph;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getParagraph($paragraphid = '')
{
if ($paragraphid == '')
throw new Exception('No Paragraph Id specified');
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs/'.$paragraphid.'';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET','');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Paragraph;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getParagraph",
"(",
"$",
"paragraphid",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"paragraphid",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'No Paragraph Id specified'",
")",
";",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"basePr... | get specefic paragraphs present in a Word document.
$param string $filename.
$param string $paragraphid.
@return Object of Specefic Paragraphs.
@throws Exception | [
"get",
"specefic",
"paragraphs",
"present",
"in",
"a",
"Word",
"document",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L902-L922 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.updateParagraphRunFont | public function updateParagraphRunFont($options_xml = '', $paragraphid = '', $runid = '')
{
if ($options_xml == '')
throw new Exception('Options not specified.');
if ($paragraphid == '')
throw new Exception('No Paragraph Id specified');
if ($runid == '')
throw new Exception('No Run Id specified');
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs/'.$paragraphid.'/runs/'.$runid.'/font';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'XML', $options_xml,'json');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Font;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function updateParagraphRunFont($options_xml = '', $paragraphid = '', $runid = '')
{
if ($options_xml == '')
throw new Exception('Options not specified.');
if ($paragraphid == '')
throw new Exception('No Paragraph Id specified');
if ($runid == '')
throw new Exception('No Run Id specified');
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs/'.$paragraphid.'/runs/'.$runid.'/font';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'XML', $options_xml,'json');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Font;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"updateParagraphRunFont",
"(",
"$",
"options_xml",
"=",
"''",
",",
"$",
"paragraphid",
"=",
"''",
",",
"$",
"runid",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"options_xml",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Options no... | update font information from any run of a paragraph.
$param string $options_xml.
$param string $paragraphid.
$param string $runid.
@return Object of Font.
@throws Exception | [
"update",
"font",
"information",
"from",
"any",
"run",
"of",
"a",
"paragraph",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L1003-L1029 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getHyperlinks | public function getHyperlinks()
{
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/hyperlinks';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Hyperlinks->HyperlinkList;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getHyperlinks()
{
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/hyperlinks';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Hyperlinks->HyperlinkList;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getHyperlinks",
"(",
")",
"{",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/words/'",
".",
"$",
"this",
"->",
"getFileName",
"(",
")",
".",
"'/hyperlinks'",
";",
"//sign URI",
"$",
"signedURI",
"="... | Get all Hyperlinks from a Word
@return array|boolean
@throws Exception | [
"Get",
"all",
"Hyperlinks",
"from",
"a",
"Word"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L1037-L1057 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getHyperlink | public function getHyperlink($hyperlinkIndex)
{
if ($hyperlinkIndex == '')
throw new Exception('Hyperlink index not specified');
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/hyperlinks/' . $hyperlinkIndex;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Hyperlink;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getHyperlink($hyperlinkIndex)
{
if ($hyperlinkIndex == '')
throw new Exception('Hyperlink index not specified');
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/hyperlinks/' . $hyperlinkIndex;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Hyperlink;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getHyperlink",
"(",
"$",
"hyperlinkIndex",
")",
"{",
"if",
"(",
"$",
"hyperlinkIndex",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Hyperlink index not specified'",
")",
";",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$... | Get a Particular Hyperlink from a Word
@param int $hyperlinkIndex The index of hyperlink.
@return object|boolean
@throws Exception | [
"Get",
"a",
"Particular",
"Hyperlink",
"from",
"a",
"Word"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L1067-L1090 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getBookmarks | public function getBookmarks()
{
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Bookmarks->BookmarkList;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getBookmarks()
{
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Bookmarks->BookmarkList;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getBookmarks",
"(",
")",
"{",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/words/'",
".",
"$",
"this",
"->",
"getFileName",
"(",
")",
".",
"'/bookmarks'",
";",
"//sign URI",
"$",
"signedURI",
"=",
... | Get all Bookmarks from a Word
@return array|boolean
@throws Exception | [
"Get",
"all",
"Bookmarks",
"from",
"a",
"Word"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L1126-L1146 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.getBookmark | public function getBookmark($bookmarkName)
{
if ($bookmarkName == '')
throw new Exception('Bookmark name not specified');
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks/' . $bookmarkName;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Bookmark;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function getBookmark($bookmarkName)
{
if ($bookmarkName == '')
throw new Exception('Bookmark name not specified');
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks/' . $bookmarkName;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200) {
return $json->Bookmark;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"getBookmark",
"(",
"$",
"bookmarkName",
")",
"{",
"if",
"(",
"$",
"bookmarkName",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Bookmark name not specified'",
")",
";",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"b... | Get a Specific Bookmark from a Word
@param string $bookmarkName Name of the Bookmark.
@return object|boolean
@throws Exception | [
"Get",
"a",
"Specific",
"Bookmark",
"from",
"a",
"Word"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L1156-L1179 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/Document.php | Document.updateBookmark | public function updateBookmark($bookmarkName, $bookmarkText)
{
if ($bookmarkName == '')
throw new Exception('Bookmark name not specified');
if ($bookmarkText == '')
throw new Exception('Bookmark text not specified');
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks/' . $bookmarkName;
//sign URI
$signedURI = Utils::sign($strURI);
$post_data_arr['Text'] = $bookmarkText;
$postData = json_encode($post_data_arr);
$responseStream = Utils::processCommand($signedURI, 'POST', 'JSON', $postData);
$json = json_decode($responseStream);
if ($json->Code == 200) {
return true;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | php | public function updateBookmark($bookmarkName, $bookmarkText)
{
if ($bookmarkName == '')
throw new Exception('Bookmark name not specified');
if ($bookmarkText == '')
throw new Exception('Bookmark text not specified');
//build URI
$strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks/' . $bookmarkName;
//sign URI
$signedURI = Utils::sign($strURI);
$post_data_arr['Text'] = $bookmarkText;
$postData = json_encode($post_data_arr);
$responseStream = Utils::processCommand($signedURI, 'POST', 'JSON', $postData);
$json = json_decode($responseStream);
if ($json->Code == 200) {
return true;
}
AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
'json-code' => $json->Code,
));
return false;
} | [
"public",
"function",
"updateBookmark",
"(",
"$",
"bookmarkName",
",",
"$",
"bookmarkText",
")",
"{",
"if",
"(",
"$",
"bookmarkName",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Bookmark name not specified'",
")",
";",
"if",
"(",
"$",
"bookmarkText",
... | Update Bookmark Text of a Word
@return boolean
@throws Exception | [
"Update",
"Bookmark",
"Text",
"of",
"a",
"Word"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/Document.php#L1215-L1243 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getComments | public function getComments($slideNo = '', $storageName = '', $folder = '')
{
//check whether file is set or not
if ($slideNo == '')
throw new Exception('Missing required parameter slideNo');
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNo . '/comments';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Status == 'OK')
return $json->SlideComments;
else
return false;
} | php | public function getComments($slideNo = '', $storageName = '', $folder = '')
{
//check whether file is set or not
if ($slideNo == '')
throw new Exception('Missing required parameter slideNo');
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNo . '/comments';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Status == 'OK')
return $json->SlideComments;
else
return false;
} | [
"public",
"function",
"getComments",
"(",
"$",
"slideNo",
"=",
"''",
",",
"$",
"storageName",
"=",
"''",
",",
"$",
"folder",
"=",
"''",
")",
"{",
"//check whether file is set or not",
"if",
"(",
"$",
"slideNo",
"==",
"''",
")",
"throw",
"new",
"Exception",... | Get comments from a slide.
@param integer $slideNo The number of slide.
@param string $storageName The presentation storage name.
@param string $folderName The presentation folder name.
@return object|boolean
@throws Exception | [
"Get",
"comments",
"from",
"a",
"slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L32-L55 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getImageCount | public function getImageCount($storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/images';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return count($json->Images->List);
} | php | public function getImageCount($storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/images';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return count($json->Images->List);
} | [
"public",
"function",
"getImageCount",
"(",
"$",
"storageName",
"=",
"''",
",",
"$",
"folder",
"=",
"''",
")",
"{",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
"$",
"this",
"->",
"getFileName",
"(",
")",
".",
"'/... | Gets total number of images in a presentation.
@param string $storageName The presentation storage name.
@param string $folderName The presentation folder name.
@return integer Returns the presentation image count.
@throws Exception | [
"Gets",
"total",
"number",
"of",
"images",
"in",
"a",
"presentation",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L66-L84 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getShapes | public function getShapes($slidenumber, $storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slidenumber . '/shapes';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
$shapes = array();
foreach ($json->ShapeList->ShapesLinks as $shape) {
$signedURI = Utils::sign($shape->Uri->Href);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
$shapes[] = $json;
}
return $shapes;
} | php | public function getShapes($slidenumber, $storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slidenumber . '/shapes';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
$shapes = array();
foreach ($json->ShapeList->ShapesLinks as $shape) {
$signedURI = Utils::sign($shape->Uri->Href);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
$shapes[] = $json;
}
return $shapes;
} | [
"public",
"function",
"getShapes",
"(",
"$",
"slidenumber",
",",
"$",
"storageName",
"=",
"''",
",",
"$",
"folder",
"=",
"''",
")",
"{",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
"$",
"this",
"->",
"getFileName",... | Gets all shapes from the specified slide.
@param integer $slidenumber The number of slide.
@param string $storageName The presentation storage name.
@param string $folderName The presentation folder name.
@return array
@throws Exception | [
"Gets",
"all",
"shapes",
"from",
"the",
"specified",
"slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L126-L157 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getShape | public function getShape($slideNumber, $shapeIndex, $storageName = '', $folderName = '') {
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/shapes/' . $shapeIndex;
if ($folderName != '') {
$strURI .= '?folder=' . $folderName;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Shape;
else
return false;
} | php | public function getShape($slideNumber, $shapeIndex, $storageName = '', $folderName = '') {
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/shapes/' . $shapeIndex;
if ($folderName != '') {
$strURI .= '?folder=' . $folderName;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Shape;
else
return false;
} | [
"public",
"function",
"getShape",
"(",
"$",
"slideNumber",
",",
"$",
"shapeIndex",
",",
"$",
"storageName",
"=",
"''",
",",
"$",
"folderName",
"=",
"''",
")",
"{",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
"$",
... | Get a Particular Shape from the Slide.
@param integer $slideNumber The number of slide.
@param integer $shapeIndex The index of shape.
@param string $storageName The presentation storage name.
@param string $folderName The presentation folder name.
@return array|boolean
@throws Exception | [
"Get",
"a",
"Particular",
"Shape",
"from",
"the",
"Slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L170-L189 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getColorScheme | public function getColorScheme($slideNumber, $storageName = '')
{
//Build URI to get color scheme
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/colorScheme';
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->ColorScheme;
} | php | public function getColorScheme($slideNumber, $storageName = '')
{
//Build URI to get color scheme
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/colorScheme';
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->ColorScheme;
} | [
"public",
"function",
"getColorScheme",
"(",
"$",
"slideNumber",
",",
"$",
"storageName",
"=",
"''",
")",
"{",
"//Build URI to get color scheme",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
"$",
"this",
"->",
"getFileName"... | Get color scheme from the specified slide.
@param integer $slideNumber The number of slide.
@param string $storageName The presentation storage name.
@return object
@throws Exception | [
"Get",
"color",
"scheme",
"from",
"the",
"specified",
"slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L200-L216 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getFontScheme | public function getFontScheme($slideNumber, $storageName = '')
{
//Build URI to get font scheme
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/fontScheme';
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->FontScheme;
} | php | public function getFontScheme($slideNumber, $storageName = '')
{
//Build URI to get font scheme
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/fontScheme';
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->FontScheme;
} | [
"public",
"function",
"getFontScheme",
"(",
"$",
"slideNumber",
",",
"$",
"storageName",
"=",
"''",
")",
"{",
"//Build URI to get font scheme",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
"$",
"this",
"->",
"getFileName",
... | Get font scheme from the specified slide.
@param integer $slideNumber The number of slide.
@param string $storageName The presentation storage name.
@return object
@throws Exception | [
"Get",
"font",
"scheme",
"from",
"the",
"specified",
"slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L227-L243 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getFormatScheme | public function getFormatScheme($slideNumber, $storageName = '')
{
//Build URI to get format scheme
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/formatScheme';
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->FormatScheme;
} | php | public function getFormatScheme($slideNumber, $storageName = '')
{
//Build URI to get format scheme
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/formatScheme';
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->FormatScheme;
} | [
"public",
"function",
"getFormatScheme",
"(",
"$",
"slideNumber",
",",
"$",
"storageName",
"=",
"''",
")",
"{",
"//Build URI to get format scheme",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
"$",
"this",
"->",
"getFileNam... | Get format scheme from the specified slide.
@param integer $slideNumber The number of slide.
@param string $storageName The presentation storage name.
@return object
@throws Exception | [
"Get",
"format",
"scheme",
"from",
"the",
"specified",
"slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L254-L270 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getPlaceholderCount | public function getPlaceholderCount($slideNumber, $storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/placeholders';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
//Build URI to get placeholders
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return count($json->Placeholders->PlaceholderLinks);
} | php | public function getPlaceholderCount($slideNumber, $storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/placeholders';
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
//Build URI to get placeholders
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return count($json->Placeholders->PlaceholderLinks);
} | [
"public",
"function",
"getPlaceholderCount",
"(",
"$",
"slideNumber",
",",
"$",
"storageName",
"=",
"''",
",",
"$",
"folder",
"=",
"''",
")",
"{",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
"$",
"this",
"->",
"get... | Gets placeholder count from a particular slide.
@param integer $slideNumber The number of slide.
@param string $storageName The presentation storage name.
@param string $folderName The presentation folder name.
@return integer
@throws Exception | [
"Gets",
"placeholder",
"count",
"from",
"a",
"particular",
"slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L282-L301 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Slides/Extractor.php | Extractor.getPlaceholder | public function getPlaceholder($slideNumber, $placeholderIndex, $storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/placeholders/' . $placeholderIndex;
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
//Build URI to get placeholders
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->Placeholder;
} | php | public function getPlaceholder($slideNumber, $placeholderIndex, $storageName = '', $folder = '')
{
$strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/placeholders/' . $placeholderIndex;
if ($folder != '') {
$strURI .= '?folder=' . $folder;
}
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
//Build URI to get placeholders
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->Placeholder;
} | [
"public",
"function",
"getPlaceholder",
"(",
"$",
"slideNumber",
",",
"$",
"placeholderIndex",
",",
"$",
"storageName",
"=",
"''",
",",
"$",
"folder",
"=",
"''",
")",
"{",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/slides/'",
".",
... | Gets a placeholder from a particular slide.
@param integer $slideNumber The number of slide.
@param integer $placeholderIndex The index of placeholder.
@param string $storageName The presentation storage name.
@param string $folderName The presentation folder name.
@return object
@throws Exception | [
"Gets",
"a",
"placeholder",
"from",
"a",
"particular",
"slide",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Slides/Extractor.php#L314-L333 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Assignment.php | Assignment.getAssignments | public function getAssignments()
{
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments/';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Assignments->AssignmentItem;
else
return false;
} | php | public function getAssignments()
{
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments/';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Assignments->AssignmentItem;
else
return false;
} | [
"public",
"function",
"getAssignments",
"(",
")",
"{",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/tasks/'",
".",
"$",
"this",
"->",
"getFileName",
"(",
")",
".",
"'/assignments/'",
";",
"//sign URI",
"$",
"signedURI",
... | Get project assignment items. Each assignment item has a link to get
full assignment representation in the project.
@return array Returns the assignments.
@throws Exception | [
"Get",
"project",
"assignment",
"items",
".",
"Each",
"assignment",
"item",
"has",
"a",
"link",
"to",
"get",
"full",
"assignment",
"representation",
"in",
"the",
"project",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Assignment.php#L30-L46 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Assignment.php | Assignment.getAssignment | public function getAssignment($assignmentId)
{
if ($assignmentId == '')
throw new Exception('Assignment ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments/' . $assignmentId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Assignment;
else
return false;
} | php | public function getAssignment($assignmentId)
{
if ($assignmentId == '')
throw new Exception('Assignment ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments/' . $assignmentId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Assignment;
else
return false;
} | [
"public",
"function",
"getAssignment",
"(",
"$",
"assignmentId",
")",
"{",
"if",
"(",
"$",
"assignmentId",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Assignment ID not specified'",
")",
";",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$",
... | Get project assignment.
@param integer $assignmentId The id of assignment.
@return array Returns the assignment.
@throws Exception | [
"Get",
"project",
"assignment",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Assignment.php#L56-L75 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Assignment.php | Assignment.addAssignment | public function addAssignment($taskUid, $resourceUid, $units, $changedFileName = '')
{
if ($taskUid == '')
throw new Exception('Task Uid not specified');
if ($resourceUid == '')
throw new Exception('Resource Uid not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments?taskUid=' . $taskUid . '&resourceUid=' . $resourceUid . '&units' . $units;
if ($changedFileName != '') {
$strURI .= '&fileName=' . $changedFileName;
$this->setFileName($changedFileName);
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function addAssignment($taskUid, $resourceUid, $units, $changedFileName = '')
{
if ($taskUid == '')
throw new Exception('Task Uid not specified');
if ($resourceUid == '')
throw new Exception('Resource Uid not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments?taskUid=' . $taskUid . '&resourceUid=' . $resourceUid . '&units' . $units;
if ($changedFileName != '') {
$strURI .= '&fileName=' . $changedFileName;
$this->setFileName($changedFileName);
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"addAssignment",
"(",
"$",
"taskUid",
",",
"$",
"resourceUid",
",",
"$",
"units",
",",
"$",
"changedFileName",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"taskUid",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Task Uid not specified... | Adds a new assignment to a project.
@param integer $taskUid The unique id of the task to be assigned.
@param integer $resourceUid The unique id of the resource to be assigned.
@param double $units The units for the new assignment. Default value is 1.
@param string $changedFileName The name of the project document to save changes to. If this parameter is omitted then the changes will be saved to the source project document.
@return string Returns the file path.
@throws Exception | [
"Adds",
"a",
"new",
"assignment",
"to",
"a",
"project",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Assignment.php#L88-L118 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Document.php | Document.getTasks | public function getTasks()
{
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/tasks';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Tasks->TaskItem;
else
return false;
} | php | public function getTasks()
{
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/tasks';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Tasks->TaskItem;
else
return false;
} | [
"public",
"function",
"getTasks",
"(",
")",
"{",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/tasks/'",
".",
"$",
"this",
"->",
"getFileName",
"(",
")",
".",
"'/tasks'",
";",
"//sign URI",
"$",
"signedURI",
"=",
"Utils... | Get project task items. Each task item has a link to get full task representation in the project.
@return string Returns the file path.
@throws Exception | [
"Get",
"project",
"task",
"items",
".",
"Each",
"task",
"item",
"has",
"a",
"link",
"to",
"get",
"full",
"task",
"representation",
"in",
"the",
"project",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Document.php#L54-L71 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Document.php | Document.getTask | public function getTask($taskId)
{
if ($taskId == '')
throw new Exception('Task ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/tasks/' . $taskId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Task;
else
return false;
} | php | public function getTask($taskId)
{
if ($taskId == '')
throw new Exception('Task ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/tasks/' . $taskId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->Task;
else
return false;
} | [
"public",
"function",
"getTask",
"(",
"$",
"taskId",
")",
"{",
"if",
"(",
"$",
"taskId",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Task ID not specified'",
")",
";",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",... | Get task information.
@param integer $taskId The id of the task.
@return array Returns the task.
@throws Exception | [
"Get",
"task",
"information",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Document.php#L81-L102 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Document.php | Document.addLink | public function addLink($link, $index, $predecessorUid, $successorUid, $linkType, $lag, $lagFormat)
{
if ($link == '')
throw new Exception('Link not specified');
if ($index == '')
throw new Exception('Index not specified');
if ($predecessorUid == '')
throw new Exception('Predecessor UID not specified');
if ($successorUid == '')
throw new Exception('Successor UID not specified');
if ($linkType == '')
throw new Exception('Link Type not specified');
if (!isset($lag))
throw new Exception('Lag not specified');
if ($lagFormat == '')
throw new Exception('Lag Format not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/taskLinks';
//sign URI
$signedURI = Utils::sign($strURI);
$data = array('Link' => $link, 'Index' => $index, 'PredecessorUid' => $predecessorUid,
'SuccessorUid' => $successorUid, 'LinkType' => $linkType, 'Lag' => $lag,
'LagFormat' => $lagFormat);
$jsonData = json_encode($data);
$response = Utils::processCommand($signedURI, 'POST', 'json', $jsonData);
$json = json_decode($response);
if ($json->Code == 200)
return true;
else
return false;
} | php | public function addLink($link, $index, $predecessorUid, $successorUid, $linkType, $lag, $lagFormat)
{
if ($link == '')
throw new Exception('Link not specified');
if ($index == '')
throw new Exception('Index not specified');
if ($predecessorUid == '')
throw new Exception('Predecessor UID not specified');
if ($successorUid == '')
throw new Exception('Successor UID not specified');
if ($linkType == '')
throw new Exception('Link Type not specified');
if (!isset($lag))
throw new Exception('Lag not specified');
if ($lagFormat == '')
throw new Exception('Lag Format not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/taskLinks';
//sign URI
$signedURI = Utils::sign($strURI);
$data = array('Link' => $link, 'Index' => $index, 'PredecessorUid' => $predecessorUid,
'SuccessorUid' => $successorUid, 'LinkType' => $linkType, 'Lag' => $lag,
'LagFormat' => $lagFormat);
$jsonData = json_encode($data);
$response = Utils::processCommand($signedURI, 'POST', 'json', $jsonData);
$json = json_decode($response);
if ($json->Code == 200)
return true;
else
return false;
} | [
"public",
"function",
"addLink",
"(",
"$",
"link",
",",
"$",
"index",
",",
"$",
"predecessorUid",
",",
"$",
"successorUid",
",",
"$",
"linkType",
",",
"$",
"lag",
",",
"$",
"lagFormat",
")",
"{",
"if",
"(",
"$",
"link",
"==",
"''",
")",
"throw",
"n... | Add a Task Link to Project
@param string $link URL of the link.
@param integer $index
@param integer $predecessorUid Predecessor UID.
@param integer $successorUid Successor UID.
@param string $linkType Type of the link.
@param integer $lag
@param string $lagFormat
@return boolean
@throws Exception | [
"Add",
"a",
"Task",
"Link",
"to",
"Project"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Document.php#L224-L266 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Document.php | Document.getOutlineCode | public function getOutlineCode($outlineCodeId)
{
if ($outlineCodeId == '')
throw new Exception('Outline Code ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/outlineCodes/' . $outlineCodeId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->OutlineCode;
else
return false;
} | php | public function getOutlineCode($outlineCodeId)
{
if ($outlineCodeId == '')
throw new Exception('Outline Code ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/outlineCodes/' . $outlineCodeId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->OutlineCode;
else
return false;
} | [
"public",
"function",
"getOutlineCode",
"(",
"$",
"outlineCodeId",
")",
"{",
"if",
"(",
"$",
"outlineCodeId",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Outline Code ID not specified'",
")",
";",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"$... | Get Outline Code
@param integer $outlineCodeId The id of the outline code.
@return array Returns the outline code.
@throws Exception | [
"Get",
"Outline",
"Code"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Document.php#L341-L361 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Document.php | Document.getExtendedAttribute | public function getExtendedAttribute($extendedAttributeId)
{
if ($extendedAttributeId == '')
throw new Exception('Extended Attribute ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/extendedAttributes/' . $extendedAttributeId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->ExtendedAttribute;
else
return false;
} | php | public function getExtendedAttribute($extendedAttributeId)
{
if ($extendedAttributeId == '')
throw new Exception('Extended Attribute ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/extendedAttributes/' . $extendedAttributeId;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
if ($json->Code == 200)
return $json->ExtendedAttribute;
else
return false;
} | [
"public",
"function",
"getExtendedAttribute",
"(",
"$",
"extendedAttributeId",
")",
"{",
"if",
"(",
"$",
"extendedAttributeId",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Extended Attribute ID not specified'",
")",
";",
"//build URI",
"$",
"strURI",
"=",
... | Get project extended attribute definition.
@param integer $extendedAttributeId
@return array Returns the extended attribute.
@throws Exception | [
"Get",
"project",
"extended",
"attribute",
"definition",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Document.php#L434-L454 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Tasks/Document.php | Document.deleteExtendedAttribute | public function deleteExtendedAttribute($extendedAttributeId, $changedFileName)
{
if ($extendedAttributeId == '')
throw new Exception('Extended Attribute ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/extendedAttributes/' . $extendedAttributeId;
if ($changedFileName != '') {
$strURI .= '?fileName=' . $changedFileName;
$this->setFileName($changedFileName);
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function deleteExtendedAttribute($extendedAttributeId, $changedFileName)
{
if ($extendedAttributeId == '')
throw new Exception('Extended Attribute ID not specified');
//build URI
$strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/extendedAttributes/' . $extendedAttributeId;
if ($changedFileName != '') {
$strURI .= '?fileName=' . $changedFileName;
$this->setFileName($changedFileName);
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"deleteExtendedAttribute",
"(",
"$",
"extendedAttributeId",
",",
"$",
"changedFileName",
")",
"{",
"if",
"(",
"$",
"extendedAttributeId",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Extended Attribute ID not specified'",
")",
";",
"//b... | Delete a project extended attribute.
@param integer $extendedAttributeId The id of the extended attribute.
@param string $changedFileName The name of the project document to save changes to. If this parameter is omitted then the changes will be saved to the source project document.
@return string Returns the file path.
@throws Exception | [
"Delete",
"a",
"project",
"extended",
"attribute",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Tasks/Document.php#L465-L493 | train |
Vovan-VE/parser | src/common/BaseRule.php | BaseRule.compareTag | public static function compareTag(?string $a, ?string $b): int
{
if (null === $a) {
return null === $b ? 0 : -1;
}
return null === $b ? 1 : strcmp($a, $b);
} | php | public static function compareTag(?string $a, ?string $b): int
{
if (null === $a) {
return null === $b ? 0 : -1;
}
return null === $b ? 1 : strcmp($a, $b);
} | [
"public",
"static",
"function",
"compareTag",
"(",
"?",
"string",
"$",
"a",
",",
"?",
"string",
"$",
"b",
")",
":",
"int",
"{",
"if",
"(",
"null",
"===",
"$",
"a",
")",
"{",
"return",
"null",
"===",
"$",
"b",
"?",
"0",
":",
"-",
"1",
";",
"}"... | Compares two tags
Two tags are equals if both are the same string or both are `null`.
When only one tag is null, it is less then other.
When both tags are string, string comparison is used.
@param string|null $a One tag to compare
@param string|null $b Another tag to compare
@return int Negative integer when tag `$a` is less then tag `$b`,
positive integer when tag `$a` is great then tag `$b`
and zero when tags are equal.
@since 1.3.0 | [
"Compares",
"two",
"tags"
] | 2aaf29054129bb70167c0cc278a401ef933e87ce | https://github.com/Vovan-VE/parser/blob/2aaf29054129bb70167c0cc278a401ef933e87ce/src/common/BaseRule.php#L34-L40 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Imaging/Document.php | Document.updateBMPPropertiesFromLocalFile | public function updateBMPPropertiesFromLocalFile($inputPath, $bitsPerPixel, $horizontalResolution, $verticalResolution, $outPath)
{
//check whether files are set or not
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($bitsPerPixel == '')
throw new Exception('Color Depth not specified');
if ($horizontalResolution == '')
throw new Exception('Horizontal Resolution not specified');
if ($verticalResolution == '')
throw new Exception('Vertical Resolution not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/bmp?bitsPerPixel=' . $bitsPerPixel . '&horizontalResolution=' . $horizontalResolution . '&verticalResolution=' . $verticalResolution;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
return $outPath;
} else {
return $v_output;
}
} | php | public function updateBMPPropertiesFromLocalFile($inputPath, $bitsPerPixel, $horizontalResolution, $verticalResolution, $outPath)
{
//check whether files are set or not
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($bitsPerPixel == '')
throw new Exception('Color Depth not specified');
if ($horizontalResolution == '')
throw new Exception('Horizontal Resolution not specified');
if ($verticalResolution == '')
throw new Exception('Vertical Resolution not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/bmp?bitsPerPixel=' . $bitsPerPixel . '&horizontalResolution=' . $horizontalResolution . '&verticalResolution=' . $verticalResolution;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
return $outPath;
} else {
return $v_output;
}
} | [
"public",
"function",
"updateBMPPropertiesFromLocalFile",
"(",
"$",
"inputPath",
",",
"$",
"bitsPerPixel",
",",
"$",
"horizontalResolution",
",",
"$",
"verticalResolution",
",",
"$",
"outPath",
")",
"{",
"//check whether files are set or not",
"if",
"(",
"$",
"inputPa... | Update BMP Image Properties Without Storage.
@param integer $bitsPerPixel Color depth.
@param integer $horizontalResolution New horizontal resolution.
@param integer $verticalResolution New vertical resolution.
@param string $outPath Name of the output file.
@return string Returns the file path.
@throws Exception | [
"Update",
"BMP",
"Image",
"Properties",
"Without",
"Storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Imaging/Document.php#L103-L137 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Imaging/Document.php | Document.updateGIFProperties | public function updateGIFProperties($backgroundColorIndex, $pixelAspectRatio, $interlaced, $outPath)
{
if ($backgroundColorIndex == '')
throw new Exception('Background color index not specified');
if ($pixelAspectRatio == '')
throw new Exception('Pixel aspect ratio not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/' . $this->getFileName() . '/gif?backgroundColorIndex=' . $backgroundColorIndex . '&pixelAspectRatio=' . $pixelAspectRatio . '&interlaced=' . $interlaced . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($outPath);
$outputPath = AsposeApp::$outPutLocation . $outPath;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function updateGIFProperties($backgroundColorIndex, $pixelAspectRatio, $interlaced, $outPath)
{
if ($backgroundColorIndex == '')
throw new Exception('Background color index not specified');
if ($pixelAspectRatio == '')
throw new Exception('Pixel aspect ratio not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/' . $this->getFileName() . '/gif?backgroundColorIndex=' . $backgroundColorIndex . '&pixelAspectRatio=' . $pixelAspectRatio . '&interlaced=' . $interlaced . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($outPath);
$outputPath = AsposeApp::$outPutLocation . $outPath;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"updateGIFProperties",
"(",
"$",
"backgroundColorIndex",
",",
"$",
"pixelAspectRatio",
",",
"$",
"interlaced",
",",
"$",
"outPath",
")",
"{",
"if",
"(",
"$",
"backgroundColorIndex",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Bac... | Update GIF Image Properties on Aspose cloud storage.
@param integer $backgroundColorIndex Index of the background color.
@param integer $pixelAspectRatio Pixel aspect ratio.
@param boolean $interlaced Specifies if image is interlaced.
@param string $outPath Name of the output file.
@return string Returns the file path.
@throws Exception | [
"Update",
"GIF",
"Image",
"Properties",
"on",
"Aspose",
"cloud",
"storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Imaging/Document.php#L150-L180 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Imaging/Document.php | Document.updateGIFPropertiesFromLocalFile | public function updateGIFPropertiesFromLocalFile($inputPath, $backgroundColorIndex, $pixelAspectRatio, $interlaced, $outPath)
{
//check whether files are set or not
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($backgroundColorIndex == '')
throw new Exception('Background color index not specified');
if ($pixelAspectRatio == '')
throw new Exception('Pixel aspect ratio not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/gif?backgroundColorIndex=' . $backgroundColorIndex . '&pixelAspectRatio=' . $pixelAspectRatio;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
return $outPath;
} else {
return $v_output;
}
} | php | public function updateGIFPropertiesFromLocalFile($inputPath, $backgroundColorIndex, $pixelAspectRatio, $interlaced, $outPath)
{
//check whether files are set or not
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($backgroundColorIndex == '')
throw new Exception('Background color index not specified');
if ($pixelAspectRatio == '')
throw new Exception('Pixel aspect ratio not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/gif?backgroundColorIndex=' . $backgroundColorIndex . '&pixelAspectRatio=' . $pixelAspectRatio;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
return $outPath;
} else {
return $v_output;
}
} | [
"public",
"function",
"updateGIFPropertiesFromLocalFile",
"(",
"$",
"inputPath",
",",
"$",
"backgroundColorIndex",
",",
"$",
"pixelAspectRatio",
",",
"$",
"interlaced",
",",
"$",
"outPath",
")",
"{",
"//check whether files are set or not",
"if",
"(",
"$",
"inputPath",... | Update GIF Image Properties without storage.
@param integer $backgroundColorIndex Index of the background color.
@param integer $pixelAspectRatio Pixel aspect ratio.
@param boolean $interlaced Specifies if image is interlaced.
@param string $outPath Name of the output file.
@return string Returns the file path.
@throws Exception | [
"Update",
"GIF",
"Image",
"Properties",
"without",
"storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Imaging/Document.php#L193-L224 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Imaging/Document.php | Document.updateJPGPropertiesFromLocalFile | public function updateJPGPropertiesFromLocalFile($inputPath, $quality, $compressionType, $outPath)
{
//check whether files are set or not
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($quality == '')
throw new Exception('Quality not specified');
if ($compressionType == '')
throw new Exception('Compression Type not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/jpg?quality=' . $quality . '&compressionType=' . $compressionType . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
return $outPath;
} else {
return $v_output;
}
} | php | public function updateJPGPropertiesFromLocalFile($inputPath, $quality, $compressionType, $outPath)
{
//check whether files are set or not
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($quality == '')
throw new Exception('Quality not specified');
if ($compressionType == '')
throw new Exception('Compression Type not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/jpg?quality=' . $quality . '&compressionType=' . $compressionType . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
return $outPath;
} else {
return $v_output;
}
} | [
"public",
"function",
"updateJPGPropertiesFromLocalFile",
"(",
"$",
"inputPath",
",",
"$",
"quality",
",",
"$",
"compressionType",
",",
"$",
"outPath",
")",
"{",
"//check whether files are set or not",
"if",
"(",
"$",
"inputPath",
"==",
"''",
")",
"throw",
"new",
... | Update JPG Image Properties on Aspose cloud storage.
@param integer $backgroundColorIndex Index of the background color.
@param integer $pixelAspectRatio Pixel aspect ratio.
@param boolean $interlaced Specifies if image is interlaced.
@param string $outPath Name of the output file.
@return array|boolean Returns the file path.
@throws Exception | [
"Update",
"JPG",
"Image",
"Properties",
"on",
"Aspose",
"cloud",
"storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Imaging/Document.php#L279-L310 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Imaging/Document.php | Document.updateTIFFPropertiesFromLocalFile | public function updateTIFFPropertiesFromLocalFile($inputPath, $compression, $resolutionUnit, $newWidth, $newHeight, $horizontalResolution, $verticalResolution, $outPath)
{
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($compression == '')
throw new Exception('Compression not specified');
if ($resolutionUnit == '')
throw new Exception('Resolution unit not specified');
if ($newWidth == '')
throw new Exception('New image width not specified');
if ($newHeight == '')
throw new Exception('New image height not specified');
if ($horizontalResolution == '')
throw new Exception('Horizontal resolution not specified');
if ($verticalResolution == '')
throw new Exception('Vertical resolution not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/tiff?compression=' . $compression . '&resolutionUnit=' . $resolutionUnit . '&newWidth=' . $newWidth . '&newHeight=' . $newHeight . '&horizontalResolution=' . $horizontalResolution . '&verticalResolution=' . $verticalResolution . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($outPath);
$outputPath = AsposeApp::$outPutLocation . $outPath;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function updateTIFFPropertiesFromLocalFile($inputPath, $compression, $resolutionUnit, $newWidth, $newHeight, $horizontalResolution, $verticalResolution, $outPath)
{
if ($inputPath == '')
throw new Exception('Input file not specified');
if ($compression == '')
throw new Exception('Compression not specified');
if ($resolutionUnit == '')
throw new Exception('Resolution unit not specified');
if ($newWidth == '')
throw new Exception('New image width not specified');
if ($newHeight == '')
throw new Exception('New image height not specified');
if ($horizontalResolution == '')
throw new Exception('Horizontal resolution not specified');
if ($verticalResolution == '')
throw new Exception('Vertical resolution not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/tiff?compression=' . $compression . '&resolutionUnit=' . $resolutionUnit . '&newWidth=' . $newWidth . '&newHeight=' . $newHeight . '&horizontalResolution=' . $horizontalResolution . '&verticalResolution=' . $verticalResolution . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($outPath);
$outputPath = AsposeApp::$outPutLocation . $outPath;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"updateTIFFPropertiesFromLocalFile",
"(",
"$",
"inputPath",
",",
"$",
"compression",
",",
"$",
"resolutionUnit",
",",
"$",
"newWidth",
",",
"$",
"newHeight",
",",
"$",
"horizontalResolution",
",",
"$",
"verticalResolution",
",",
"$",
"outPath... | Update TIFF Image Properties Without Storage.
@param string $inputPath Input file path.
@param string $compression Tiff compression.
@param integer $backgroundColorIndex Index of the background color.
@param integer $pixelAspectRatio Pixel aspect ratio.
@param boolean $interlaced Specifies if image is interlaced.
@param string $outPath Name of the output file.
@return string Returns the file path.
@throws Exception | [
"Update",
"TIFF",
"Image",
"Properties",
"Without",
"Storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Imaging/Document.php#L377-L420 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Imaging/Document.php | Document.updatePSDPropertiesFromLocalFile | public function updatePSDPropertiesFromLocalFile($inputPath, $channelsCount, $compression, $outPath)
{
if ($channelsCount == '')
throw new Exception('Channels count not specified');
if ($compression == '')
throw new Exception('Compression method not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/psd?channelsCount=' . $channelsCount . '&compression=' . $compression . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($outPath);
$outputPath = AsposeApp::$outPutLocation . $outPath;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function updatePSDPropertiesFromLocalFile($inputPath, $channelsCount, $compression, $outPath)
{
if ($channelsCount == '')
throw new Exception('Channels count not specified');
if ($compression == '')
throw new Exception('Compression method not specified');
if ($outPath == '')
throw new Exception('Output file name not specified');
//build URI
$strURI = Product::$baseProductUri . '/imaging/psd?channelsCount=' . $channelsCount . '&compression=' . $compression . '&outPath=' . $outPath;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::uploadFileBinary($signedURI, $inputPath, 'xml', 'POST');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$folder = new Folder();
$outputStream = $folder->GetFile($outPath);
$outputPath = AsposeApp::$outPutLocation . $outPath;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"updatePSDPropertiesFromLocalFile",
"(",
"$",
"inputPath",
",",
"$",
"channelsCount",
",",
"$",
"compression",
",",
"$",
"outPath",
")",
"{",
"if",
"(",
"$",
"channelsCount",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Channels c... | Update PSD Image Properties without storage.
@param integer $channelsCount Count of channels.
@param string $compression Compression method.
@param string $outPath Name of the output file.
@return string Returns the file path.
@throws Exception | [
"Update",
"PSD",
"Image",
"Properties",
"without",
"storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Imaging/Document.php#L473-L502 | train |
ordermind/symfony-logical-authorization-bundle | Twig/LogicalAuthorizationExtension.php | LogicalAuthorizationExtension.checkRouteAccess | public function checkRouteAccess(string $routeName, $user = null): bool
{
return $this->laRoute->checkRouteAccess($routeName, $user);
} | php | public function checkRouteAccess(string $routeName, $user = null): bool
{
return $this->laRoute->checkRouteAccess($routeName, $user);
} | [
"public",
"function",
"checkRouteAccess",
"(",
"string",
"$",
"routeName",
",",
"$",
"user",
"=",
"null",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"laRoute",
"->",
"checkRouteAccess",
"(",
"$",
"routeName",
",",
"$",
"user",
")",
";",
"}"
] | Twig extension callback for checking route access
If something goes wrong an error will be logged and the method will return FALSE. If no permissions are defined for the provided route it will return TRUE.
@param string $routeName The name of the route
@param object|string $user (optional) Either a user object or a string to signify an anonymous user. If no user is supplied, the current user will be used.
@return bool TRUE if access is granted or FALSE if access is denied. | [
"Twig",
"extension",
"callback",
"for",
"checking",
"route",
"access"
] | 3b051f0984dcf3527024b64040bfc4b2b0855f3b | https://github.com/ordermind/symfony-logical-authorization-bundle/blob/3b051f0984dcf3527024b64040bfc4b2b0855f3b/Twig/LogicalAuthorizationExtension.php#L58-L61 | train |
ordermind/symfony-logical-authorization-bundle | Twig/LogicalAuthorizationExtension.php | LogicalAuthorizationExtension.checkModelAccess | public function checkModelAccess($model, string $action, $user = null): bool
{
return $this->laModel->checkModelAccess($model, $action, $user);
} | php | public function checkModelAccess($model, string $action, $user = null): bool
{
return $this->laModel->checkModelAccess($model, $action, $user);
} | [
"public",
"function",
"checkModelAccess",
"(",
"$",
"model",
",",
"string",
"$",
"action",
",",
"$",
"user",
"=",
"null",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"laModel",
"->",
"checkModelAccess",
"(",
"$",
"model",
",",
"$",
"action",
",... | Twig extension callback for checking model access
If something goes wrong an error will be logged and the method will return FALSE. If no permissions are defined for this action on the provided model it will return TRUE.
@param object|string $model A model object or class string.
@param string $action Examples of model actions are "create", "read", "update" and "delete".
@param object|string $user (optional) Either a user object or a string to signify an anonymous user. If no user is supplied, the current user will be used.
@return bool TRUE if access is granted or FALSE if access is denied. | [
"Twig",
"extension",
"callback",
"for",
"checking",
"model",
"access"
] | 3b051f0984dcf3527024b64040bfc4b2b0855f3b | https://github.com/ordermind/symfony-logical-authorization-bundle/blob/3b051f0984dcf3527024b64040bfc4b2b0855f3b/Twig/LogicalAuthorizationExtension.php#L74-L77 | train |
ordermind/symfony-logical-authorization-bundle | Twig/LogicalAuthorizationExtension.php | LogicalAuthorizationExtension.checkFieldAccess | public function checkFieldAccess($model, string $fieldName, string $action, $user = null): bool
{
return $this->laModel->checkFieldAccess($model, $fieldName, $action, $user);
} | php | public function checkFieldAccess($model, string $fieldName, string $action, $user = null): bool
{
return $this->laModel->checkFieldAccess($model, $fieldName, $action, $user);
} | [
"public",
"function",
"checkFieldAccess",
"(",
"$",
"model",
",",
"string",
"$",
"fieldName",
",",
"string",
"$",
"action",
",",
"$",
"user",
"=",
"null",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"laModel",
"->",
"checkFieldAccess",
"(",
"$",
... | Twig extension callback for checking field access
If something goes wrong an error will be logged and the method will return FALSE. If no permissions are defined for this action on the provided field and model it will return TRUE.
@param object|string $model A model object or class string.
@param string $fieldName The name of the field.
@param string $action Examples of field actions are "get" and "set".
@param object|string $user (optional) Either a user object or a string to signify an anonymous user. If no user is supplied, the current user will be used.
@return bool TRUE if access is granted or FALSE if access is denied. | [
"Twig",
"extension",
"callback",
"for",
"checking",
"field",
"access"
] | 3b051f0984dcf3527024b64040bfc4b2b0855f3b | https://github.com/ordermind/symfony-logical-authorization-bundle/blob/3b051f0984dcf3527024b64040bfc4b2b0855f3b/Twig/LogicalAuthorizationExtension.php#L91-L94 | train |
Vovan-VE/parser | src/grammar/Grammar.php | Grammar.getRulesFor | public function getRulesFor(Symbol $subject): array
{
$rules = [];
if (!$subject->isTerminal()) {
foreach ($this->rules as $rule) {
if (0 === Symbol::compare($rule->getSubject(), $subject)) {
$rules[] = $rule;
}
}
}
return $rules;
} | php | public function getRulesFor(Symbol $subject): array
{
$rules = [];
if (!$subject->isTerminal()) {
foreach ($this->rules as $rule) {
if (0 === Symbol::compare($rule->getSubject(), $subject)) {
$rules[] = $rule;
}
}
}
return $rules;
} | [
"public",
"function",
"getRulesFor",
"(",
"Symbol",
"$",
"subject",
")",
":",
"array",
"{",
"$",
"rules",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"subject",
"->",
"isTerminal",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
... | Get rules defining a subject Symbol
@param Symbol $subject Symbol to search
@return Rule[] | [
"Get",
"rules",
"defining",
"a",
"subject",
"Symbol"
] | 2aaf29054129bb70167c0cc278a401ef933e87ce | https://github.com/Vovan-VE/parser/blob/2aaf29054129bb70167c0cc278a401ef933e87ce/src/grammar/Grammar.php#L260-L271 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Email/Document.php | Document.getAttachment | public function getAttachment($attachmentName)
{
if ($attachmentName == '')
throw new Exception('Attachment Name not specified');
//build URI
$strURI = Product::$baseProductUri . '/email/' . $this->getFileName() . '/attachments/' . $attachmentName;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$outputFilename = $attachmentName;
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outputFilename);
return $outputFilename;
} else {
return $v_output;
}
} | php | public function getAttachment($attachmentName)
{
if ($attachmentName == '')
throw new Exception('Attachment Name not specified');
//build URI
$strURI = Product::$baseProductUri . '/email/' . $this->getFileName() . '/attachments/' . $attachmentName;
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
$outputFilename = $attachmentName;
Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outputFilename);
return $outputFilename;
} else {
return $v_output;
}
} | [
"public",
"function",
"getAttachment",
"(",
"$",
"attachmentName",
")",
"{",
"if",
"(",
"$",
"attachmentName",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Attachment Name not specified'",
")",
";",
"//build URI",
"$",
"strURI",
"=",
"Product",
"::",
"... | Get email attachment.
@param string $attachmentName The name of attached file.
@return string Return path of the attached file.
@throws Exception | [
"Get",
"email",
"attachment",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Email/Document.php#L97-L119 | train |
carlosbuenosvinos/php-geckoboard-api | src/CarlosIO/Geckoboard/Widgets/LineChart.php | LineChart.addItem | public function addItem($item)
{
if (!is_numeric($item)) {
throw new \InvalidArgumentException(sprintf("Value '%s' must be a numeric value", $item));
}
$this->items[] = $item;
return $this;
} | php | public function addItem($item)
{
if (!is_numeric($item)) {
throw new \InvalidArgumentException(sprintf("Value '%s' must be a numeric value", $item));
}
$this->items[] = $item;
return $this;
} | [
"public",
"function",
"addItem",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"item",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"\"Value '%s' must be a numeric value\"",
",",
"$",
"item",
")"... | Add an item to the item list.
@param \CarlosIO\Geckoboard\Data\Text\Item $item Item to be added
@return $this | [
"Add",
"an",
"item",
"to",
"the",
"item",
"list",
"."
] | d756e38298e20300f29af5d536b598648f27fe5c | https://github.com/carlosbuenosvinos/php-geckoboard-api/blob/d756e38298e20300f29af5d536b598648f27fe5c/src/CarlosIO/Geckoboard/Widgets/LineChart.php#L67-L76 | train |
carlosbuenosvinos/php-geckoboard-api | src/CarlosIO/Geckoboard/Widgets/LineChart.php | LineChart.setColour | public function setColour($colour)
{
if (!preg_match('/^[a-f0-9]{6}$/i', $colour)) {
throw new \InvalidArgumentException(sprintf('Value %s must be a valid hex colour', $colour));
}
$this->colour = $colour;
return $this;
} | php | public function setColour($colour)
{
if (!preg_match('/^[a-f0-9]{6}$/i', $colour)) {
throw new \InvalidArgumentException(sprintf('Value %s must be a valid hex colour', $colour));
}
$this->colour = $colour;
return $this;
} | [
"public",
"function",
"setColour",
"(",
"$",
"colour",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[a-f0-9]{6}$/i'",
",",
"$",
"colour",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Value %s must be a valid hex col... | Set the colour of the line in the widget.
@param string $colour Colour of the line in the widget in hexadecimal format
@return $this | [
"Set",
"the",
"colour",
"of",
"the",
"line",
"in",
"the",
"widget",
"."
] | d756e38298e20300f29af5d536b598648f27fe5c | https://github.com/carlosbuenosvinos/php-geckoboard-api/blob/d756e38298e20300f29af5d536b598648f27fe5c/src/CarlosIO/Geckoboard/Widgets/LineChart.php#L85-L94 | train |
carlosbuenosvinos/php-geckoboard-api | src/CarlosIO/Geckoboard/Widgets/LineChart.php | LineChart.getColour | public function getColour()
{
if (null === $this->colour) {
$this->colour = self::DEFAULT_COLOUR;
}
return $this->colour;
} | php | public function getColour()
{
if (null === $this->colour) {
$this->colour = self::DEFAULT_COLOUR;
}
return $this->colour;
} | [
"public",
"function",
"getColour",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"colour",
")",
"{",
"$",
"this",
"->",
"colour",
"=",
"self",
"::",
"DEFAULT_COLOUR",
";",
"}",
"return",
"$",
"this",
"->",
"colour",
";",
"}"
] | Return the colour of the line in the widget.
@return string | [
"Return",
"the",
"colour",
"of",
"the",
"line",
"in",
"the",
"widget",
"."
] | d756e38298e20300f29af5d536b598648f27fe5c | https://github.com/carlosbuenosvinos/php-geckoboard-api/blob/d756e38298e20300f29af5d536b598648f27fe5c/src/CarlosIO/Geckoboard/Widgets/LineChart.php#L101-L108 | train |
carlosbuenosvinos/php-geckoboard-api | src/CarlosIO/Geckoboard/Widgets/LineChart.php | LineChart.setAxis | public function setAxis($dimension, $labels)
{
foreach ($labels as $label) {
$this->addLabel($dimension, $label);
}
return $this;
} | php | public function setAxis($dimension, $labels)
{
foreach ($labels as $label) {
$this->addLabel($dimension, $label);
}
return $this;
} | [
"public",
"function",
"setAxis",
"(",
"$",
"dimension",
",",
"$",
"labels",
")",
"{",
"foreach",
"(",
"$",
"labels",
"as",
"$",
"label",
")",
"{",
"$",
"this",
"->",
"addLabel",
"(",
"$",
"dimension",
",",
"$",
"label",
")",
";",
"}",
"return",
"$"... | Set the elements to appear evenly spread along dimension.
@param string $dimension The dimension where labels will be displayed
@param array $labels Labels displayed in this axis
@return $this | [
"Set",
"the",
"elements",
"to",
"appear",
"evenly",
"spread",
"along",
"dimension",
"."
] | d756e38298e20300f29af5d536b598648f27fe5c | https://github.com/carlosbuenosvinos/php-geckoboard-api/blob/d756e38298e20300f29af5d536b598648f27fe5c/src/CarlosIO/Geckoboard/Widgets/LineChart.php#L118-L125 | train |
carlosbuenosvinos/php-geckoboard-api | src/CarlosIO/Geckoboard/Widgets/LineChart.php | LineChart.addLabel | protected function addLabel($dimension, $label)
{
if (!in_array($dimension, array(self::DIMENSION_X, self::DIMENSION_Y))) {
throw new \InvalidArgumentException(sprintf("Value '%s' is not a valid dimension", $dimension));
}
$this->axis[$dimension][] = $label;
} | php | protected function addLabel($dimension, $label)
{
if (!in_array($dimension, array(self::DIMENSION_X, self::DIMENSION_Y))) {
throw new \InvalidArgumentException(sprintf("Value '%s' is not a valid dimension", $dimension));
}
$this->axis[$dimension][] = $label;
} | [
"protected",
"function",
"addLabel",
"(",
"$",
"dimension",
",",
"$",
"label",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"dimension",
",",
"array",
"(",
"self",
"::",
"DIMENSION_X",
",",
"self",
"::",
"DIMENSION_Y",
")",
")",
")",
"{",
"throw",
... | Add a new label to an specific axis.
@param string $dimension The dimension where labels will be displayed
@param mix $label Label displayed in this axis | [
"Add",
"a",
"new",
"label",
"to",
"an",
"specific",
"axis",
"."
] | d756e38298e20300f29af5d536b598648f27fe5c | https://github.com/carlosbuenosvinos/php-geckoboard-api/blob/d756e38298e20300f29af5d536b598648f27fe5c/src/CarlosIO/Geckoboard/Widgets/LineChart.php#L133-L140 | train |
carlosbuenosvinos/php-geckoboard-api | src/CarlosIO/Geckoboard/Widgets/LineChart.php | LineChart.getAxis | public function getAxis()
{
if (null === $this->axis) {
$this->axis[self::DIMENSION_X] = array();
$this->axis[self::DIMENSION_Y] = array();
}
return $this->axis;
} | php | public function getAxis()
{
if (null === $this->axis) {
$this->axis[self::DIMENSION_X] = array();
$this->axis[self::DIMENSION_Y] = array();
}
return $this->axis;
} | [
"public",
"function",
"getAxis",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"axis",
")",
"{",
"$",
"this",
"->",
"axis",
"[",
"self",
"::",
"DIMENSION_X",
"]",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"axis",
"[",
"self",
... | Return axises in a 2D array. | [
"Return",
"axises",
"in",
"a",
"2D",
"array",
"."
] | d756e38298e20300f29af5d536b598648f27fe5c | https://github.com/carlosbuenosvinos/php-geckoboard-api/blob/d756e38298e20300f29af5d536b598648f27fe5c/src/CarlosIO/Geckoboard/Widgets/LineChart.php#L145-L153 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/DocumentBuilder.php | DocumentBuilder.removeWatermark | public function removeWatermark($fileName)
{
//check whether files are set or not
if ($fileName == '')
throw new Exception('File not specified');
//build URI to insert watermark image
$strURI = Product::$baseProductUri . '/words/' . $fileName .
'/watermark';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save doc on server
$folder = new Folder();
$outputStream = $folder->GetFile($fileName);
$outputPath = AsposeApp::$outPutLocation . $fileName;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function removeWatermark($fileName)
{
//check whether files are set or not
if ($fileName == '')
throw new Exception('File not specified');
//build URI to insert watermark image
$strURI = Product::$baseProductUri . '/words/' . $fileName .
'/watermark';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save doc on server
$folder = new Folder();
$outputStream = $folder->GetFile($fileName);
$outputPath = AsposeApp::$outPutLocation . $fileName;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"removeWatermark",
"(",
"$",
"fileName",
")",
"{",
"//check whether files are set or not",
"if",
"(",
"$",
"fileName",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'File not specified'",
")",
";",
"//build URI to insert watermark image",
"... | Remove watermark from document.
@param string $fileName The name of source file.
@return string Returns the file path.
@throws Exception | [
"Remove",
"watermark",
"from",
"document",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/DocumentBuilder.php#L25-L51 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/DocumentBuilder.php | DocumentBuilder.insertWatermarkText | public function insertWatermarkText($fileName, $text, $rotationAngle)
{
//check whether files are set or not
if ($fileName == '')
throw new Exception('File not specified');
//Build JSON to post
$fieldsArray = array('Text' => $text, 'RotationAngle' => $rotationAngle);
$json = json_encode($fieldsArray);
//build URI to insert watermark text
$strURI = Product::$baseProductUri . '/words/' . $fileName . '/watermark/insertText';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save docs on server
$folder = new Folder();
$outputStream = $folder->GetFile($fileName);
$outputPath = AsposeApp::$outPutLocation . $fileName;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function insertWatermarkText($fileName, $text, $rotationAngle)
{
//check whether files are set or not
if ($fileName == '')
throw new Exception('File not specified');
//Build JSON to post
$fieldsArray = array('Text' => $text, 'RotationAngle' => $rotationAngle);
$json = json_encode($fieldsArray);
//build URI to insert watermark text
$strURI = Product::$baseProductUri . '/words/' . $fileName . '/watermark/insertText';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save docs on server
$folder = new Folder();
$outputStream = $folder->GetFile($fileName);
$outputPath = AsposeApp::$outPutLocation . $fileName;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"insertWatermarkText",
"(",
"$",
"fileName",
",",
"$",
"text",
",",
"$",
"rotationAngle",
")",
"{",
"//check whether files are set or not",
"if",
"(",
"$",
"fileName",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'File not specified'",... | Inserts water mark text into the document.
@param string $fileName The name of source file.
@param string $text Watermark text.
@param string $rotationAngle Watermark rotation angle in degrees.
@return string Returns the file path.
@throws Exception | [
"Inserts",
"water",
"mark",
"text",
"into",
"the",
"document",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/DocumentBuilder.php#L63-L92 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Words/DocumentBuilder.php | DocumentBuilder.replaceText | public function replaceText($fileName, $oldValue, $newValue, $isMatchCase, $isMatchWholeWord)
{
//check whether files are set or not
if ($fileName == '')
throw new Exception('File not specified');
//Build JSON to post
$fieldsArray = array('OldValue' => $oldValue, 'NewValue' => $newValue,
'IsMatchCase' => $isMatchCase, 'IsMatchWholeWord' => $isMatchWholeWord);
$json = json_encode($fieldsArray);
//build URI to replace text
$strURI = Product::$baseProductUri . '/words/' . $fileName . '/replaceText';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save docs on server
$folder = new Folder();
$outputStream = $folder->GetFile($fileName);
$outputPath = AsposeApp::$outPutLocation . $fileName;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function replaceText($fileName, $oldValue, $newValue, $isMatchCase, $isMatchWholeWord)
{
//check whether files are set or not
if ($fileName == '')
throw new Exception('File not specified');
//Build JSON to post
$fieldsArray = array('OldValue' => $oldValue, 'NewValue' => $newValue,
'IsMatchCase' => $isMatchCase, 'IsMatchWholeWord' => $isMatchWholeWord);
$json = json_encode($fieldsArray);
//build URI to replace text
$strURI = Product::$baseProductUri . '/words/' . $fileName . '/replaceText';
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save docs on server
$folder = new Folder();
$outputStream = $folder->GetFile($fileName);
$outputPath = AsposeApp::$outPutLocation . $fileName;
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"replaceText",
"(",
"$",
"fileName",
",",
"$",
"oldValue",
",",
"$",
"newValue",
",",
"$",
"isMatchCase",
",",
"$",
"isMatchWholeWord",
")",
"{",
"//check whether files are set or not",
"if",
"(",
"$",
"fileName",
"==",
"''",
")",
"throw"... | Replace a text with the new value in the document.
@param string $fileName The source file path.
@param string $oldValue The old text.
@param string $newValue The new text that replace old text.
@param string $isMatchCase Either True or False.
@param string $isMatchWholeWord Either True or False.
@return string Returns the file path.
@throws Exception | [
"Replace",
"a",
"text",
"with",
"the",
"new",
"value",
"in",
"the",
"document",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Words/DocumentBuilder.php#L144-L174 | train |
Speelpenning-nl/laravel-products | src/Jobs/DestroyAttributeValue.php | DestroyAttributeValue.handle | public function handle(AttributeValueRepository $attributeValueRepository, Dispatcher $event)
{
$attributeValue = $attributeValueRepository->find($this->id);
$attributeValueRepository->destroy($attributeValue);
$event->fire(new AttributeValueWasDestroyed($attributeValue));
return $attributeValue;
} | php | public function handle(AttributeValueRepository $attributeValueRepository, Dispatcher $event)
{
$attributeValue = $attributeValueRepository->find($this->id);
$attributeValueRepository->destroy($attributeValue);
$event->fire(new AttributeValueWasDestroyed($attributeValue));
return $attributeValue;
} | [
"public",
"function",
"handle",
"(",
"AttributeValueRepository",
"$",
"attributeValueRepository",
",",
"Dispatcher",
"$",
"event",
")",
"{",
"$",
"attributeValue",
"=",
"$",
"attributeValueRepository",
"->",
"find",
"(",
"$",
"this",
"->",
"id",
")",
";",
"$",
... | Handles destruction of the attribute value.
@param AttributeValueRepository $attributeValueRepository
@param Dispatcher $event
@return Attribute | [
"Handles",
"destruction",
"of",
"the",
"attribute",
"value",
"."
] | 41522ebbdd41108c1d4532bb42be602cc0c530c4 | https://github.com/Speelpenning-nl/laravel-products/blob/41522ebbdd41108c1d4532bb42be602cc0c530c4/src/Jobs/DestroyAttributeValue.php#L34-L43 | train |
wikimedia/utfnormal | src/Validator.php | Validator.cleanUp | static function cleanUp( $string ) {
if ( NORMALIZE_INTL ) {
$string = self::replaceForNativeNormalize( $string );
$norm = normalizer_normalize( $string, Normalizer::FORM_C );
if ( $norm === null || $norm === false ) {
# normalizer_normalize will either return false or null
# (depending on which doc you read) if invalid utf8 string.
# quickIsNFCVerify cleans up invalid sequences.
if ( self::quickIsNFCVerify( $string ) ) {
# if that's true, the string is actually already normal.
return $string;
} else {
# Now we are valid but non-normal
return normalizer_normalize( $string, Normalizer::FORM_C );
}
} else {
return $norm;
}
} elseif ( self::quickIsNFCVerify( $string ) ) {
# Side effect -- $string has had UTF-8 errors cleaned up.
return $string;
} else {
return self::NFC( $string );
}
} | php | static function cleanUp( $string ) {
if ( NORMALIZE_INTL ) {
$string = self::replaceForNativeNormalize( $string );
$norm = normalizer_normalize( $string, Normalizer::FORM_C );
if ( $norm === null || $norm === false ) {
# normalizer_normalize will either return false or null
# (depending on which doc you read) if invalid utf8 string.
# quickIsNFCVerify cleans up invalid sequences.
if ( self::quickIsNFCVerify( $string ) ) {
# if that's true, the string is actually already normal.
return $string;
} else {
# Now we are valid but non-normal
return normalizer_normalize( $string, Normalizer::FORM_C );
}
} else {
return $norm;
}
} elseif ( self::quickIsNFCVerify( $string ) ) {
# Side effect -- $string has had UTF-8 errors cleaned up.
return $string;
} else {
return self::NFC( $string );
}
} | [
"static",
"function",
"cleanUp",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"NORMALIZE_INTL",
")",
"{",
"$",
"string",
"=",
"self",
"::",
"replaceForNativeNormalize",
"(",
"$",
"string",
")",
";",
"$",
"norm",
"=",
"normalizer_normalize",
"(",
"$",
"string",... | The ultimate convenience function! Clean up invalid UTF-8 sequences,
and convert to normal form C, canonical composition.
Fast return for pure ASCII strings; some lesser optimizations for
strings containing only known-good characters. Not as fast as toNFC().
@param string $string a UTF-8 string
@return string a clean, shiny, normalized UTF-8 string | [
"The",
"ultimate",
"convenience",
"function!",
"Clean",
"up",
"invalid",
"UTF",
"-",
"8",
"sequences",
"and",
"convert",
"to",
"normal",
"form",
"C",
"canonical",
"composition",
"."
] | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L69-L94 | train |
wikimedia/utfnormal | src/Validator.php | Validator.toNFC | static function toNFC( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_C );
} elseif ( self::quickIsNFC( $string ) ) {
return $string;
} else {
return self::NFC( $string );
}
} | php | static function toNFC( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_C );
} elseif ( self::quickIsNFC( $string ) ) {
return $string;
} else {
return self::NFC( $string );
}
} | [
"static",
"function",
"toNFC",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"NORMALIZE_INTL",
")",
"{",
"return",
"normalizer_normalize",
"(",
"$",
"string",
",",
"Normalizer",
"::",
"FORM_C",
")",
";",
"}",
"elseif",
"(",
"self",
"::",
"quickIsNFC",
"(",
"$... | Convert a UTF-8 string to normal form C, canonical composition.
Fast return for pure ASCII strings; some lesser optimizations for
strings containing only known-good characters.
@param string $string a valid UTF-8 string. Input is not validated.
@return string a UTF-8 string in normal form C | [
"Convert",
"a",
"UTF",
"-",
"8",
"string",
"to",
"normal",
"form",
"C",
"canonical",
"composition",
".",
"Fast",
"return",
"for",
"pure",
"ASCII",
"strings",
";",
"some",
"lesser",
"optimizations",
"for",
"strings",
"containing",
"only",
"known",
"-",
"good"... | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L104-L112 | train |
wikimedia/utfnormal | src/Validator.php | Validator.toNFD | static function toNFD( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_D );
} elseif ( preg_match( '/[\x80-\xff]/', $string ) ) {
return self::NFD( $string );
} else {
return $string;
}
} | php | static function toNFD( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_D );
} elseif ( preg_match( '/[\x80-\xff]/', $string ) ) {
return self::NFD( $string );
} else {
return $string;
}
} | [
"static",
"function",
"toNFD",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"NORMALIZE_INTL",
")",
"{",
"return",
"normalizer_normalize",
"(",
"$",
"string",
",",
"Normalizer",
"::",
"FORM_D",
")",
";",
"}",
"elseif",
"(",
"preg_match",
"(",
"'/[\\x80-\\xff]/'",... | Convert a UTF-8 string to normal form D, canonical decomposition.
Fast return for pure ASCII strings.
@param string $string A valid UTF-8 string. Input is not validated.
@return string A UTF-8 string in normal form D | [
"Convert",
"a",
"UTF",
"-",
"8",
"string",
"to",
"normal",
"form",
"D",
"canonical",
"decomposition",
".",
"Fast",
"return",
"for",
"pure",
"ASCII",
"strings",
"."
] | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L121-L129 | train |
wikimedia/utfnormal | src/Validator.php | Validator.toNFKC | static function toNFKC( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_KC );
} elseif ( preg_match( '/[\x80-\xff]/', $string ) ) {
return self::NFKC( $string );
} else {
return $string;
}
} | php | static function toNFKC( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_KC );
} elseif ( preg_match( '/[\x80-\xff]/', $string ) ) {
return self::NFKC( $string );
} else {
return $string;
}
} | [
"static",
"function",
"toNFKC",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"NORMALIZE_INTL",
")",
"{",
"return",
"normalizer_normalize",
"(",
"$",
"string",
",",
"Normalizer",
"::",
"FORM_KC",
")",
";",
"}",
"elseif",
"(",
"preg_match",
"(",
"'/[\\x80-\\xff]/'... | Convert a UTF-8 string to normal form KC, compatibility composition.
This may cause irreversible information loss, use judiciously.
Fast return for pure ASCII strings.
@param string $string A valid UTF-8 string. Input is not validated.
@return string A UTF-8 string in normal form KC | [
"Convert",
"a",
"UTF",
"-",
"8",
"string",
"to",
"normal",
"form",
"KC",
"compatibility",
"composition",
".",
"This",
"may",
"cause",
"irreversible",
"information",
"loss",
"use",
"judiciously",
".",
"Fast",
"return",
"for",
"pure",
"ASCII",
"strings",
"."
] | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L139-L147 | train |
wikimedia/utfnormal | src/Validator.php | Validator.toNFKD | static function toNFKD( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_KD );
} elseif ( preg_match( '/[\x80-\xff]/', $string ) ) {
return self::NFKD( $string );
} else {
return $string;
}
} | php | static function toNFKD( $string ) {
if ( NORMALIZE_INTL ) {
return normalizer_normalize( $string, Normalizer::FORM_KD );
} elseif ( preg_match( '/[\x80-\xff]/', $string ) ) {
return self::NFKD( $string );
} else {
return $string;
}
} | [
"static",
"function",
"toNFKD",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"NORMALIZE_INTL",
")",
"{",
"return",
"normalizer_normalize",
"(",
"$",
"string",
",",
"Normalizer",
"::",
"FORM_KD",
")",
";",
"}",
"elseif",
"(",
"preg_match",
"(",
"'/[\\x80-\\xff]/'... | Convert a UTF-8 string to normal form KD, compatibility decomposition.
This may cause irreversible information loss, use judiciously.
Fast return for pure ASCII strings.
@param string $string a valid UTF-8 string. Input is not validated.
@return string a UTF-8 string in normal form KD | [
"Convert",
"a",
"UTF",
"-",
"8",
"string",
"to",
"normal",
"form",
"KD",
"compatibility",
"decomposition",
".",
"This",
"may",
"cause",
"irreversible",
"information",
"loss",
"use",
"judiciously",
".",
"Fast",
"return",
"for",
"pure",
"ASCII",
"strings",
"."
] | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L157-L165 | train |
wikimedia/utfnormal | src/Validator.php | Validator.fastCombiningSort | static function fastCombiningSort( $string ) {
self::loadData();
$len = strlen( $string );
$out = '';
$combiners = [];
$lastClass = -1;
for ( $i = 0; $i < $len; $i++ ) {
$c = $string[$i];
$n = ord( $c );
if ( $n >= 0x80 ) {
if ( $n >= 0xf0 ) {
$c = substr( $string, $i, 4 );
$i += 3;
} elseif ( $n >= 0xe0 ) {
$c = substr( $string, $i, 3 );
$i += 2;
} elseif ( $n >= 0xc0 ) {
$c = substr( $string, $i, 2 );
$i++;
}
if ( isset( self::$utfCombiningClass[$c] ) ) {
$lastClass = self::$utfCombiningClass[$c];
if ( isset( $combiners[$lastClass] ) ) {
$combiners[$lastClass] .= $c;
} else {
$combiners[$lastClass] = $c;
}
continue;
}
}
if ( $lastClass ) {
ksort( $combiners );
$out .= implode( '', $combiners );
$combiners = [];
}
$out .= $c;
$lastClass = 0;
}
if ( $lastClass ) {
ksort( $combiners );
$out .= implode( '', $combiners );
}
return $out;
} | php | static function fastCombiningSort( $string ) {
self::loadData();
$len = strlen( $string );
$out = '';
$combiners = [];
$lastClass = -1;
for ( $i = 0; $i < $len; $i++ ) {
$c = $string[$i];
$n = ord( $c );
if ( $n >= 0x80 ) {
if ( $n >= 0xf0 ) {
$c = substr( $string, $i, 4 );
$i += 3;
} elseif ( $n >= 0xe0 ) {
$c = substr( $string, $i, 3 );
$i += 2;
} elseif ( $n >= 0xc0 ) {
$c = substr( $string, $i, 2 );
$i++;
}
if ( isset( self::$utfCombiningClass[$c] ) ) {
$lastClass = self::$utfCombiningClass[$c];
if ( isset( $combiners[$lastClass] ) ) {
$combiners[$lastClass] .= $c;
} else {
$combiners[$lastClass] = $c;
}
continue;
}
}
if ( $lastClass ) {
ksort( $combiners );
$out .= implode( '', $combiners );
$combiners = [];
}
$out .= $c;
$lastClass = 0;
}
if ( $lastClass ) {
ksort( $combiners );
$out .= implode( '', $combiners );
}
return $out;
} | [
"static",
"function",
"fastCombiningSort",
"(",
"$",
"string",
")",
"{",
"self",
"::",
"loadData",
"(",
")",
";",
"$",
"len",
"=",
"strlen",
"(",
"$",
"string",
")",
";",
"$",
"out",
"=",
"''",
";",
"$",
"combiners",
"=",
"[",
"]",
";",
"$",
"las... | Sorts combining characters into canonical order. This is the
final step in creating decomposed normal forms D and KD.
@private
@param string $string a valid, decomposed UTF-8 string. Input is not validated.
@return string a UTF-8 string with combining characters sorted in canonical order | [
"Sorts",
"combining",
"characters",
"into",
"canonical",
"order",
".",
"This",
"is",
"the",
"final",
"step",
"in",
"creating",
"decomposed",
"normal",
"forms",
"D",
"and",
"KD",
"."
] | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L561-L605 | train |
wikimedia/utfnormal | src/Validator.php | Validator.placebo | static function placebo( $string ) {
$len = strlen( $string );
$out = '';
for ( $i = 0; $i < $len; $i++ ) {
$out .= $string[$i];
}
return $out;
} | php | static function placebo( $string ) {
$len = strlen( $string );
$out = '';
for ( $i = 0; $i < $len; $i++ ) {
$out .= $string[$i];
}
return $out;
} | [
"static",
"function",
"placebo",
"(",
"$",
"string",
")",
"{",
"$",
"len",
"=",
"strlen",
"(",
"$",
"string",
")",
";",
"$",
"out",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"len",
";",
"$",
"i",
"++",
")",
... | This is just used for the benchmark, comparing how long it takes to
interate through a string without really doing anything of substance.
@param string $string
@return string | [
"This",
"is",
"just",
"used",
"for",
"the",
"benchmark",
"comparing",
"how",
"long",
"it",
"takes",
"to",
"interate",
"through",
"a",
"string",
"without",
"really",
"doing",
"anything",
"of",
"substance",
"."
] | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L750-L758 | train |
wikimedia/utfnormal | src/Validator.php | Validator.replaceForNativeNormalize | private static function replaceForNativeNormalize( $string ) {
$string = preg_replace(
'/[\x00-\x08\x0b\x0c\x0e-\x1f]/',
Constants::UTF8_REPLACEMENT,
$string );
$string = str_replace( Constants::UTF8_FFFE, Constants::UTF8_REPLACEMENT, $string );
$string = str_replace( Constants::UTF8_FFFF, Constants::UTF8_REPLACEMENT, $string );
return $string;
} | php | private static function replaceForNativeNormalize( $string ) {
$string = preg_replace(
'/[\x00-\x08\x0b\x0c\x0e-\x1f]/',
Constants::UTF8_REPLACEMENT,
$string );
$string = str_replace( Constants::UTF8_FFFE, Constants::UTF8_REPLACEMENT, $string );
$string = str_replace( Constants::UTF8_FFFF, Constants::UTF8_REPLACEMENT, $string );
return $string;
} | [
"private",
"static",
"function",
"replaceForNativeNormalize",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"preg_replace",
"(",
"'/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/'",
",",
"Constants",
"::",
"UTF8_REPLACEMENT",
",",
"$",
"string",
")",
";",
"$",
"string",
... | Function to replace some characters that we don't want
but most of the native normalize functions keep.
@param string $string The string
@return string String with the character codes replaced. | [
"Function",
"to",
"replace",
"some",
"characters",
"that",
"we",
"don",
"t",
"want",
"but",
"most",
"of",
"the",
"native",
"normalize",
"functions",
"keep",
"."
] | 8dc487748268bc374f7d134478b53baf6252553f | https://github.com/wikimedia/utfnormal/blob/8dc487748268bc374f7d134478b53baf6252553f/src/Validator.php#L767-L776 | train |
gamajo/codeception-redirects | src/Redirects.php | Redirects.seeRedirectBetween | public function seeRedirectBetween($oldUrl, $newUrl, $statusCode)
{
// We must not follow all redirects, so save current situation,
// force disable follow redirects, and revert at the end.
$followsRedirects = $this->isFollowingRedirects();
$this->followRedirects(false);
$response = $this->sendHeadAndGetResponse($oldUrl);
if (null !== $response) {
$responseCode = $response->getStatus();
$locationHeader = $response->getHeader('Location', true);
// Check for correct response code.
$this->assertEquals($statusCode, $responseCode, 'Response code was not ' . $statusCode . '.');
// Check location header URL contains submitted URL.
$this->assertContains($newUrl, $locationHeader, 'Redirect destination not found in Location header.');
}
$this->followRedirects($followsRedirects);
} | php | public function seeRedirectBetween($oldUrl, $newUrl, $statusCode)
{
// We must not follow all redirects, so save current situation,
// force disable follow redirects, and revert at the end.
$followsRedirects = $this->isFollowingRedirects();
$this->followRedirects(false);
$response = $this->sendHeadAndGetResponse($oldUrl);
if (null !== $response) {
$responseCode = $response->getStatus();
$locationHeader = $response->getHeader('Location', true);
// Check for correct response code.
$this->assertEquals($statusCode, $responseCode, 'Response code was not ' . $statusCode . '.');
// Check location header URL contains submitted URL.
$this->assertContains($newUrl, $locationHeader, 'Redirect destination not found in Location header.');
}
$this->followRedirects($followsRedirects);
} | [
"public",
"function",
"seeRedirectBetween",
"(",
"$",
"oldUrl",
",",
"$",
"newUrl",
",",
"$",
"statusCode",
")",
"{",
"// We must not follow all redirects, so save current situation,",
"// force disable follow redirects, and revert at the end.",
"$",
"followsRedirects",
"=",
"$... | Check that a redirection occurs.
@since 0.2.0
@param string $oldUrl Relative or absolute URL that should be redirected.
@param string $newUrl Relative or absolute URL of redirect destination.
@param integer $statusCode Status code to check for. | [
"Check",
"that",
"a",
"redirection",
"occurs",
"."
] | aebbae2f2a5f65648ea196e0c932efc949445efb | https://github.com/gamajo/codeception-redirects/blob/aebbae2f2a5f65648ea196e0c932efc949445efb/src/Redirects.php#L72-L94 | train |
gamajo/codeception-redirects | src/Redirects.php | Redirects.urlDoesNotRedirect | public function urlDoesNotRedirect($url)
{
if ('/' === $url) {
$url = '';
}
// We must not follow all redirects, so save current situation,
// force disable follow redirects, and revert at the end.
$followsRedirects = $this->isFollowingRedirects();
$this->followRedirects(false);
$response = $this->sendHeadAndGetResponse($url);
if (null !== $response) {
$responseCode = $response->getStatus();
$locationHeader = $response->getHeader('Location', true);
// Check for 200 response code.
$this->assertEquals(200, $responseCode, 'Response code was not 200.');
// Check that destination URL does not try to redirect.
// Somewhat redundant, as this should never appear with a 200 HTTP Status code anyway.
$this->assertNull($locationHeader, 'Location header was found when it should not exist.');
}
$this->followRedirects($followsRedirects);
} | php | public function urlDoesNotRedirect($url)
{
if ('/' === $url) {
$url = '';
}
// We must not follow all redirects, so save current situation,
// force disable follow redirects, and revert at the end.
$followsRedirects = $this->isFollowingRedirects();
$this->followRedirects(false);
$response = $this->sendHeadAndGetResponse($url);
if (null !== $response) {
$responseCode = $response->getStatus();
$locationHeader = $response->getHeader('Location', true);
// Check for 200 response code.
$this->assertEquals(200, $responseCode, 'Response code was not 200.');
// Check that destination URL does not try to redirect.
// Somewhat redundant, as this should never appear with a 200 HTTP Status code anyway.
$this->assertNull($locationHeader, 'Location header was found when it should not exist.');
}
$this->followRedirects($followsRedirects);
} | [
"public",
"function",
"urlDoesNotRedirect",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"'/'",
"===",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"''",
";",
"}",
"// We must not follow all redirects, so save current situation,",
"// force disable follow redirects, and revert at th... | Check that a 200 HTTP Status is returned and the URL has no redirects.
@since 0.1.3
@since 0.2.0 Renamed method, made public.
@param string $url Relative or absolute URL of redirect destination. | [
"Check",
"that",
"a",
"200",
"HTTP",
"Status",
"is",
"returned",
"and",
"the",
"URL",
"has",
"no",
"redirects",
"."
] | aebbae2f2a5f65648ea196e0c932efc949445efb | https://github.com/gamajo/codeception-redirects/blob/aebbae2f2a5f65648ea196e0c932efc949445efb/src/Redirects.php#L130-L156 | train |
gamajo/codeception-redirects | src/Redirects.php | Redirects.sendHeadAndGetResponse | protected function sendHeadAndGetResponse($url)
{
/** @var REST $rest */
$rest = $this->getModule('REST');
$rest->sendHEAD($url);
return $rest->client->getInternalResponse();
} | php | protected function sendHeadAndGetResponse($url)
{
/** @var REST $rest */
$rest = $this->getModule('REST');
$rest->sendHEAD($url);
return $rest->client->getInternalResponse();
} | [
"protected",
"function",
"sendHeadAndGetResponse",
"(",
"$",
"url",
")",
"{",
"/** @var REST $rest */",
"$",
"rest",
"=",
"$",
"this",
"->",
"getModule",
"(",
"'REST'",
")",
";",
"$",
"rest",
"->",
"sendHEAD",
"(",
"$",
"url",
")",
";",
"return",
"$",
"r... | Use REST Module to send HEAD request and return the response.
@since 0.2.0
@param string $url
@return null|Response | [
"Use",
"REST",
"Module",
"to",
"send",
"HEAD",
"request",
"and",
"return",
"the",
"response",
"."
] | aebbae2f2a5f65648ea196e0c932efc949445efb | https://github.com/gamajo/codeception-redirects/blob/aebbae2f2a5f65648ea196e0c932efc949445efb/src/Redirects.php#L167-L174 | train |
praxisnetau/silverware-calendar | src/Extensions/FormFieldExtension.php | FormFieldExtension.setCalendarConfig | public function setCalendarConfig($arg1, $arg2 = null)
{
if (is_array($arg1)) {
$this->calendarConfig = $arg1;
} else {
$this->calendarConfig[$arg1] = $arg2;
}
return $this;
} | php | public function setCalendarConfig($arg1, $arg2 = null)
{
if (is_array($arg1)) {
$this->calendarConfig = $arg1;
} else {
$this->calendarConfig[$arg1] = $arg2;
}
return $this;
} | [
"public",
"function",
"setCalendarConfig",
"(",
"$",
"arg1",
",",
"$",
"arg2",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"arg1",
")",
")",
"{",
"$",
"this",
"->",
"calendarConfig",
"=",
"$",
"arg1",
";",
"}",
"else",
"{",
"$",
"this",... | Defines either the named calendar config value, or the calendar config array.
@param string|array $arg1
@param string $arg2
@return $this | [
"Defines",
"either",
"the",
"named",
"calendar",
"config",
"value",
"or",
"the",
"calendar",
"config",
"array",
"."
] | 71060ec362447e284609f5a8678a38d0206cd2c1 | https://github.com/praxisnetau/silverware-calendar/blob/71060ec362447e284609f5a8678a38d0206cd2c1/src/Extensions/FormFieldExtension.php#L57-L66 | train |
praxisnetau/silverware-calendar | src/Extensions/FormFieldExtension.php | FormFieldExtension.getCalendarConfig | public function getCalendarConfig($name = null)
{
if (!is_null($name)) {
return isset($this->calendarConfig[$name]) ? $this->calendarConfig[$name] : null;
}
return $this->calendarConfig;
} | php | public function getCalendarConfig($name = null)
{
if (!is_null($name)) {
return isset($this->calendarConfig[$name]) ? $this->calendarConfig[$name] : null;
}
return $this->calendarConfig;
} | [
"public",
"function",
"getCalendarConfig",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"calendarConfig",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this... | Answers either the named calendar config value, or the calendar config array.
@param string $name
@return mixed | [
"Answers",
"either",
"the",
"named",
"calendar",
"config",
"value",
"or",
"the",
"calendar",
"config",
"array",
"."
] | 71060ec362447e284609f5a8678a38d0206cd2c1 | https://github.com/praxisnetau/silverware-calendar/blob/71060ec362447e284609f5a8678a38d0206cd2c1/src/Extensions/FormFieldExtension.php#L75-L82 | train |
praxisnetau/silverware-calendar | src/Extensions/FormFieldExtension.php | FormFieldExtension.updateAttributes | public function updateAttributes(&$attributes)
{
$attributes['data-calendar-config'] = $this->owner->getCalendarConfigJSON();
$attributes['data-calendar-enabled'] = $this->owner->getCalendarEnabled();
} | php | public function updateAttributes(&$attributes)
{
$attributes['data-calendar-config'] = $this->owner->getCalendarConfigJSON();
$attributes['data-calendar-enabled'] = $this->owner->getCalendarEnabled();
} | [
"public",
"function",
"updateAttributes",
"(",
"&",
"$",
"attributes",
")",
"{",
"$",
"attributes",
"[",
"'data-calendar-config'",
"]",
"=",
"$",
"this",
"->",
"owner",
"->",
"getCalendarConfigJSON",
"(",
")",
";",
"$",
"attributes",
"[",
"'data-calendar-enabled... | Updates the given array of HTML attributes from the extended object.
@param array $attributes
@return void | [
"Updates",
"the",
"given",
"array",
"of",
"HTML",
"attributes",
"from",
"the",
"extended",
"object",
"."
] | 71060ec362447e284609f5a8678a38d0206cd2c1 | https://github.com/praxisnetau/silverware-calendar/blob/71060ec362447e284609f5a8678a38d0206cd2c1/src/Extensions/FormFieldExtension.php#L129-L133 | train |
praxisnetau/silverware-calendar | src/Extensions/FormFieldExtension.php | FormFieldExtension.getCalendarEnabled | public function getCalendarEnabled()
{
if ($this->owner->isReadonly() || $this->owner->isDisabled()) {
return 'false';
}
return ($this->calendarDisabled || $this->owner->config()->calendar_disabled) ? 'false' : 'true';
} | php | public function getCalendarEnabled()
{
if ($this->owner->isReadonly() || $this->owner->isDisabled()) {
return 'false';
}
return ($this->calendarDisabled || $this->owner->config()->calendar_disabled) ? 'false' : 'true';
} | [
"public",
"function",
"getCalendarEnabled",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"isReadonly",
"(",
")",
"||",
"$",
"this",
"->",
"owner",
"->",
"isDisabled",
"(",
")",
")",
"{",
"return",
"'false'",
";",
"}",
"return",
"(",
"$... | Answers 'true' if the calendar is enabled for the extended object.
@return string | [
"Answers",
"true",
"if",
"the",
"calendar",
"is",
"enabled",
"for",
"the",
"extended",
"object",
"."
] | 71060ec362447e284609f5a8678a38d0206cd2c1 | https://github.com/praxisnetau/silverware-calendar/blob/71060ec362447e284609f5a8678a38d0206cd2c1/src/Extensions/FormFieldExtension.php#L140-L147 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Pdf/Extractor.php | Extractor.getImageCount | public function getImageCount($pageNumber)
{
$strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/images';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return count($json->Images->List);
} | php | public function getImageCount($pageNumber)
{
$strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/images';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return count($json->Images->List);
} | [
"public",
"function",
"getImageCount",
"(",
"$",
"pageNumber",
")",
"{",
"$",
"strURI",
"=",
"Product",
"::",
"$",
"baseProductUri",
".",
"'/pdf/'",
".",
"$",
"this",
"->",
"getFileName",
"(",
")",
".",
"'/pages/'",
".",
"$",
"pageNumber",
".",
"'/images'"... | Gets number of images in a specified page.
@param string $pageNumber Number of the page.
@return integer
@throws Exception | [
"Gets",
"number",
"of",
"images",
"in",
"a",
"specified",
"page",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Pdf/Extractor.php#L30-L43 | train |
Vovan-VE/parser | src/table/Item.php | Item.compare | public static function compare(Item $a, Item $b): int
{
return Symbol::compare($a->subject, $b->subject)
?: Symbol::compareList($a->passed, $b->passed)
?: Symbol::compareList($a->further, $b->further)
?: ($b->eof - $a->eof);
} | php | public static function compare(Item $a, Item $b): int
{
return Symbol::compare($a->subject, $b->subject)
?: Symbol::compareList($a->passed, $b->passed)
?: Symbol::compareList($a->further, $b->further)
?: ($b->eof - $a->eof);
} | [
"public",
"static",
"function",
"compare",
"(",
"Item",
"$",
"a",
",",
"Item",
"$",
"b",
")",
":",
"int",
"{",
"return",
"Symbol",
"::",
"compare",
"(",
"$",
"a",
"->",
"subject",
",",
"$",
"b",
"->",
"subject",
")",
"?",
":",
"Symbol",
"::",
"co... | Compare two items
Two items are equal when its both has equal subjects, passed and further symbols
and EOF marker.
@param Item $a
@param Item $b
@return int Returns 0 when items are equal | [
"Compare",
"two",
"items"
] | 2aaf29054129bb70167c0cc278a401ef933e87ce | https://github.com/Vovan-VE/parser/blob/2aaf29054129bb70167c0cc278a401ef933e87ce/src/table/Item.php#L33-L39 | train |
Vovan-VE/parser | src/table/Item.php | Item.createFromRule | public static function createFromRule(Rule $rule): self
{
return new static(
$rule->getSubject(),
[],
$rule->getDefinition(),
$rule->hasEofMark(),
$rule->getTag()
);
} | php | public static function createFromRule(Rule $rule): self
{
return new static(
$rule->getSubject(),
[],
$rule->getDefinition(),
$rule->hasEofMark(),
$rule->getTag()
);
} | [
"public",
"static",
"function",
"createFromRule",
"(",
"Rule",
"$",
"rule",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"$",
"rule",
"->",
"getSubject",
"(",
")",
",",
"[",
"]",
",",
"$",
"rule",
"->",
"getDefinition",
"(",
")",
",",
"$",
... | Create Item from a Rule
Current position is placed in the start of rule body.
@param Rule $rule Source rule
@return static Returns new Item | [
"Create",
"Item",
"from",
"a",
"Rule"
] | 2aaf29054129bb70167c0cc278a401ef933e87ce | https://github.com/Vovan-VE/parser/blob/2aaf29054129bb70167c0cc278a401ef933e87ce/src/table/Item.php#L48-L57 | train |
Vovan-VE/parser | src/table/Item.php | Item.shift | public function shift(): ?self
{
$further = $this->further;
if (!$further) {
return null;
}
$passed = $this->passed;
$passed[] = array_shift($further);
return new static($this->subject, $passed, $further, $this->eof, $this->tag);
} | php | public function shift(): ?self
{
$further = $this->further;
if (!$further) {
return null;
}
$passed = $this->passed;
$passed[] = array_shift($further);
return new static($this->subject, $passed, $further, $this->eof, $this->tag);
} | [
"public",
"function",
"shift",
"(",
")",
":",
"?",
"self",
"{",
"$",
"further",
"=",
"$",
"this",
"->",
"further",
";",
"if",
"(",
"!",
"$",
"further",
")",
"{",
"return",
"null",
";",
"}",
"$",
"passed",
"=",
"$",
"this",
"->",
"passed",
";",
... | Create new Item by shifting current position to the next symbol
@return static|null Returns new Item with current position shifted to the next symbol.
Returns `null` then there is not next expected symbol. | [
"Create",
"new",
"Item",
"by",
"shifting",
"current",
"position",
"to",
"the",
"next",
"symbol"
] | 2aaf29054129bb70167c0cc278a401ef933e87ce | https://github.com/Vovan-VE/parser/blob/2aaf29054129bb70167c0cc278a401ef933e87ce/src/table/Item.php#L114-L124 | train |
Vovan-VE/parser | src/table/Item.php | Item.getAsRule | public function getAsRule(): Rule
{
return new Rule(
$this->subject,
array_merge($this->passed, $this->further),
$this->eof,
$this->tag
);
} | php | public function getAsRule(): Rule
{
return new Rule(
$this->subject,
array_merge($this->passed, $this->further),
$this->eof,
$this->tag
);
} | [
"public",
"function",
"getAsRule",
"(",
")",
":",
"Rule",
"{",
"return",
"new",
"Rule",
"(",
"$",
"this",
"->",
"subject",
",",
"array_merge",
"(",
"$",
"this",
"->",
"passed",
",",
"$",
"this",
"->",
"further",
")",
",",
"$",
"this",
"->",
"eof",
... | Reconstruct a source rule
@return Rule New rule object which is equal to source one | [
"Reconstruct",
"a",
"source",
"rule"
] | 2aaf29054129bb70167c0cc278a401ef933e87ce | https://github.com/Vovan-VE/parser/blob/2aaf29054129bb70167c0cc278a401ef933e87ce/src/table/Item.php#L130-L138 | train |
botman/driver-wechat | src/WeChatAudioDriver.php | WeChatAudioDriver.getAudio | private function getAudio()
{
$audioUrl = 'http://file.api.wechat.com/cgi-bin/media/get?access_token='.$this->getAccessToken().'&media_id='.$this->event->get('MediaId');
return [new Audio($audioUrl, $this->event)];
} | php | private function getAudio()
{
$audioUrl = 'http://file.api.wechat.com/cgi-bin/media/get?access_token='.$this->getAccessToken().'&media_id='.$this->event->get('MediaId');
return [new Audio($audioUrl, $this->event)];
} | [
"private",
"function",
"getAudio",
"(",
")",
"{",
"$",
"audioUrl",
"=",
"'http://file.api.wechat.com/cgi-bin/media/get?access_token='",
".",
"$",
"this",
"->",
"getAccessToken",
"(",
")",
".",
"'&media_id='",
".",
"$",
"this",
"->",
"event",
"->",
"get",
"(",
"'... | Retrieve audio url from an incoming message.
@return array | [
"Retrieve",
"audio",
"url",
"from",
"an",
"incoming",
"message",
"."
] | 8b621f2fc4b79f556fa936a78acf247307c040a2 | https://github.com/botman/driver-wechat/blob/8b621f2fc4b79f556fa936a78acf247307c040a2/src/WeChatAudioDriver.php#L50-L55 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Storage/File.php | File.getFile | public function getFile($fileName, $storageName = '')
{
//check whether file is set or not
if ($fileName == '') {
AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME);
throw new Exception(Exception::MSG_NO_FILENAME);
}
//build URI
$strURI = $this->strURIFile . $fileName;
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$outputPath = AsposeApp::$outPutLocation . basename($fileName);
Utils::saveFile($responseStream, $outputPath);
return $outputPath;
} | php | public function getFile($fileName, $storageName = '')
{
//check whether file is set or not
if ($fileName == '') {
AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME);
throw new Exception(Exception::MSG_NO_FILENAME);
}
//build URI
$strURI = $this->strURIFile . $fileName;
if ($storageName != '') {
$strURI .= '?storage=' . $storageName;
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$outputPath = AsposeApp::$outPutLocation . basename($fileName);
Utils::saveFile($responseStream, $outputPath);
return $outputPath;
} | [
"public",
"function",
"getFile",
"(",
"$",
"fileName",
",",
"$",
"storageName",
"=",
"''",
")",
"{",
"//check whether file is set or not\r",
"if",
"(",
"$",
"fileName",
"==",
"''",
")",
"{",
"AsposeApp",
"::",
"getLogger",
"(",
")",
"->",
"error",
"(",
"Ex... | Gets a file from Aspose storage.
@param string $fileName The name of file.
@param string $storageName The name of storage.
@return array
@throws Exception | [
"Gets",
"a",
"file",
"from",
"Aspose",
"storage",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Storage/File.php#L29-L51 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Storage/File.php | File.copyFile | public function copyFile($fileName, $storageName = '', $newDest)
{
//check whether file is set or not
if ($fileName == '' || $newDest == '') {
AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME);
throw new Exception(Exception::MSG_NO_FILENAME);
}
//build URI
$strURI = $this->strURIFile . $fileName . '?newdest=' . $newDest;
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'PUT', '', '');
$json = json_decode($responseStream);
if ($json->Code === 200) {
return true;
}
return false;
} | php | public function copyFile($fileName, $storageName = '', $newDest)
{
//check whether file is set or not
if ($fileName == '' || $newDest == '') {
AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME);
throw new Exception(Exception::MSG_NO_FILENAME);
}
//build URI
$strURI = $this->strURIFile . $fileName . '?newdest=' . $newDest;
if ($storageName != '') {
$strURI .= '&storage=' . $storageName;
}
//sign URI
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'PUT', '', '');
$json = json_decode($responseStream);
if ($json->Code === 200) {
return true;
}
return false;
} | [
"public",
"function",
"copyFile",
"(",
"$",
"fileName",
",",
"$",
"storageName",
"=",
"''",
",",
"$",
"newDest",
")",
"{",
"//check whether file is set or not\r",
"if",
"(",
"$",
"fileName",
"==",
"''",
"||",
"$",
"newDest",
"==",
"''",
")",
"{",
"AsposeAp... | Copies a file in Aspose storage to a new destination
@param string $fileName The name of file.
@param string $storageName The name of storage.
@return bool
@throws Exception | [
"Copies",
"a",
"file",
"in",
"Aspose",
"storage",
"to",
"a",
"new",
"destination"
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Storage/File.php#L61-L86 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Cells/TextEditor.php | TextEditor.findText | public function findText()
{
$parameters = func_get_args();
//set parameter values
if (count($parameters) == 1) {
$text = $parameters[0];
} else if (count($parameters) == 2) {
$WorkSheetName = $parameters[0];
$text = $parameters[1];
} else {
throw new Exception('Invalid number of arguments');
}
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . ((count($parameters) == 2) ? '/worksheets/' . $WorkSheetName : '') . '/findText?text=' . $text;
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', '', '');
$json = json_decode($responseStream);
return $json->TextItems->TextItemList;
} | php | public function findText()
{
$parameters = func_get_args();
//set parameter values
if (count($parameters) == 1) {
$text = $parameters[0];
} else if (count($parameters) == 2) {
$WorkSheetName = $parameters[0];
$text = $parameters[1];
} else {
throw new Exception('Invalid number of arguments');
}
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . ((count($parameters) == 2) ? '/worksheets/' . $WorkSheetName : '') . '/findText?text=' . $text;
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'POST', '', '');
$json = json_decode($responseStream);
return $json->TextItems->TextItemList;
} | [
"public",
"function",
"findText",
"(",
")",
"{",
"$",
"parameters",
"=",
"func_get_args",
"(",
")",
";",
"//set parameter values",
"if",
"(",
"count",
"(",
"$",
"parameters",
")",
"==",
"1",
")",
"{",
"$",
"text",
"=",
"$",
"parameters",
"[",
"0",
"]",... | Finds a speicif text from Excel document or a worksheet.
@param string $WorkSheetName Name of the sheet.
@param string $text Text to be find.
@return array
@throws Exception | [
"Finds",
"a",
"speicif",
"text",
"from",
"Excel",
"document",
"or",
"a",
"worksheet",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Cells/TextEditor.php#L32-L51 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Cells/TextEditor.php | TextEditor.getTextItems | public function getTextItems()
{
$parameters = func_get_args();
//set parameter values
if (count($parameters) > 0) {
$worksheetName = $parameters[0];
}
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . ((isset($parameters[0])) ? '/worksheets/' . $worksheetName . '/textItems' : '/textItems');
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->TextItems->TextItemList;
} | php | public function getTextItems()
{
$parameters = func_get_args();
//set parameter values
if (count($parameters) > 0) {
$worksheetName = $parameters[0];
}
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . ((isset($parameters[0])) ? '/worksheets/' . $worksheetName . '/textItems' : '/textItems');
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', '', '');
$json = json_decode($responseStream);
return $json->TextItems->TextItemList;
} | [
"public",
"function",
"getTextItems",
"(",
")",
"{",
"$",
"parameters",
"=",
"func_get_args",
"(",
")",
";",
"//set parameter values",
"if",
"(",
"count",
"(",
"$",
"parameters",
")",
">",
"0",
")",
"{",
"$",
"worksheetName",
"=",
"$",
"parameters",
"[",
... | Gets text items from the whole Excel file or a specific worksheet.
@param string $WorkSheetName Name of the sheet.
@return array
@throws Exception | [
"Gets",
"text",
"items",
"from",
"the",
"whole",
"Excel",
"file",
"or",
"a",
"specific",
"worksheet",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Cells/TextEditor.php#L61-L73 | train |
gabrielqs/Magento2-Installments | Block/MaximumInstallments/Product.php | Product.getMaximumInstallmentQuantity | public function getMaximumInstallmentQuantity()
{
$product = $this->getProduct() ? $this->getProduct() : $this->getParentBlock()->getProduct();
$maximumInstallment = $this->getMaximumInstallment($product);
return $maximumInstallment->getMaximumInstallmentsQuantity();
} | php | public function getMaximumInstallmentQuantity()
{
$product = $this->getProduct() ? $this->getProduct() : $this->getParentBlock()->getProduct();
$maximumInstallment = $this->getMaximumInstallment($product);
return $maximumInstallment->getMaximumInstallmentsQuantity();
} | [
"public",
"function",
"getMaximumInstallmentQuantity",
"(",
")",
"{",
"$",
"product",
"=",
"$",
"this",
"->",
"getProduct",
"(",
")",
"?",
"$",
"this",
"->",
"getProduct",
"(",
")",
":",
"$",
"this",
"->",
"getParentBlock",
"(",
")",
"->",
"getProduct",
... | Gets maximum installment quantity for current product
@return int | [
"Gets",
"maximum",
"installment",
"quantity",
"for",
"current",
"product"
] | cee656c8e48c852f7bc658916ec2e5e74f999157 | https://github.com/gabrielqs/Magento2-Installments/blob/cee656c8e48c852f7bc658916ec2e5e74f999157/Block/MaximumInstallments/Product.php#L95-L100 | train |
Vovan-VE/parser | src/Parser.php | Parser.parse | public function parse(string $input, $actions = []): TreeNodeInterface
{
if ($actions instanceof ActionsMap) {
$actions_map = $actions;
} elseif ($actions) {
$actions_map = new ActionsMap($actions);
} else {
$actions_map = null;
}
$stack = new Stack($this->table, $actions_map);
$pos = 0;
$token = null;
try {
while (true) {
while ($stack->getStateRow()->isReduceOnly()) {
$stack->reduce();
}
$expected_terms = array_keys($stack->getStateRow()->terminalActions);
$match = $this->grammar->parseOne($input, $pos, $expected_terms);
if ($match) {
/** @var Token $token */
$token = $match->token;
$pos = $match->nextOffset;
$symbol_name = $token->getType();
} else {
$token = null;
$symbol_name = null;
}
while (true) {
if ($token) {
$terminal_actions = $stack->getStateRow()->terminalActions;
if (isset($terminal_actions[$symbol_name])) {
$stack->shift($token, $terminal_actions[$symbol_name]);
goto NEXT_SYMBOL;
}
}
if ($stack->getStateRow()->eofAction) {
if ($token) {
throw new UnexpectedInputAfterEndException(
$this->dumpTokenForError($token),
$token->getOffset()
);
}
goto DONE;
}
$stack->reduce();
}
NEXT_SYMBOL:
}
DONE:
} catch (AbortParsingException $e) {
throw new AbortedException($e->getMessage(), $e->getOffset(), $e->getPrevious());
} catch (NoReduceException $e) {
// This unexpected reduce (no rule to reduce) may happen only
// when current terminal is not expected. So, some terminals
// are expected here.
$expected_terminals = [];
foreach ($stack->getStateRow()->terminalActions as $name => $_) {
$expected_terminals[] = Symbol::dumpType($name);
}
throw new UnexpectedTokenException(
$this->dumpTokenForError($token),
$expected_terminals,
$token ? $token->getOffset() : strlen($input)
);
} catch (StateException $e) {
throw new InternalException('Unexpected state fail', 0, $e);
}
$tokens_gen = null;
return $stack->done();
} | php | public function parse(string $input, $actions = []): TreeNodeInterface
{
if ($actions instanceof ActionsMap) {
$actions_map = $actions;
} elseif ($actions) {
$actions_map = new ActionsMap($actions);
} else {
$actions_map = null;
}
$stack = new Stack($this->table, $actions_map);
$pos = 0;
$token = null;
try {
while (true) {
while ($stack->getStateRow()->isReduceOnly()) {
$stack->reduce();
}
$expected_terms = array_keys($stack->getStateRow()->terminalActions);
$match = $this->grammar->parseOne($input, $pos, $expected_terms);
if ($match) {
/** @var Token $token */
$token = $match->token;
$pos = $match->nextOffset;
$symbol_name = $token->getType();
} else {
$token = null;
$symbol_name = null;
}
while (true) {
if ($token) {
$terminal_actions = $stack->getStateRow()->terminalActions;
if (isset($terminal_actions[$symbol_name])) {
$stack->shift($token, $terminal_actions[$symbol_name]);
goto NEXT_SYMBOL;
}
}
if ($stack->getStateRow()->eofAction) {
if ($token) {
throw new UnexpectedInputAfterEndException(
$this->dumpTokenForError($token),
$token->getOffset()
);
}
goto DONE;
}
$stack->reduce();
}
NEXT_SYMBOL:
}
DONE:
} catch (AbortParsingException $e) {
throw new AbortedException($e->getMessage(), $e->getOffset(), $e->getPrevious());
} catch (NoReduceException $e) {
// This unexpected reduce (no rule to reduce) may happen only
// when current terminal is not expected. So, some terminals
// are expected here.
$expected_terminals = [];
foreach ($stack->getStateRow()->terminalActions as $name => $_) {
$expected_terminals[] = Symbol::dumpType($name);
}
throw new UnexpectedTokenException(
$this->dumpTokenForError($token),
$expected_terminals,
$token ? $token->getOffset() : strlen($input)
);
} catch (StateException $e) {
throw new InternalException('Unexpected state fail', 0, $e);
}
$tokens_gen = null;
return $stack->done();
} | [
"public",
"function",
"parse",
"(",
"string",
"$",
"input",
",",
"$",
"actions",
"=",
"[",
"]",
")",
":",
"TreeNodeInterface",
"{",
"if",
"(",
"$",
"actions",
"instanceof",
"ActionsMap",
")",
"{",
"$",
"actions_map",
"=",
"$",
"actions",
";",
"}",
"els... | Parse input text into nodes tree
Actions map can be used to evaluate node values on tree construction phase.
Without action you will need dive into a tree manually.
Key in actions map is a subject node name with optional tag in parenses
without spaces (`Foo` or `Foo(bar)`). Action will be applied to nodes with
given name and tag. So `Foo` would be applied either to terminals `Foo` or
Non-terminals `Foo` built by rules without a tag. And so `Foo(bar)` would be applied
to non-terminals `Foo` built by rules with tag `(bar)` (since terminals cannot have tags).
Value in actions map is either shortcut action name (since 1.4.0) or a callable
with signature (since 1.3.0):
```php
function (TreeNodeInterface $subject, TreeNodeInterface ...$children): mixed`
```
Arguments is not required to be variadic `...$children`. It would be much better
to declare exact amount of arguments with respect to corresponding rule(s).
Return value of a callback (unless it's `null`) will be used in `make()` method
on a node. Callback itself should to use children nodes' `made()` values to
evaluate the result. To apply `null` value to a node you need to call `make(null)`
manually in action callback, but it is not necessary since default `made()` value is `null`.
Since 1.5.0 an instance of `ActionsMap` can be passed directly to `$actions`.
@param string $input Input text to parse
@param ActionsMap|callable[]|string[] $actions [since 1.3.0] Actions map.
Accepts `ActionsMap` since 1.5.0.
@return TreeNodeInterface
@throws UnknownCharacterException
@throws UnexpectedTokenException
@throws UnexpectedInputAfterEndException
@throws AbortedException
@see \VovanVE\parser\actions\ActionsMadeMap | [
"Parse",
"input",
"text",
"into",
"nodes",
"tree"
] | 2aaf29054129bb70167c0cc278a401ef933e87ce | https://github.com/Vovan-VE/parser/blob/2aaf29054129bb70167c0cc278a401ef933e87ce/src/Parser.php#L100-L179 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Cells/ChartEditor.php | ChartEditor.addChart | public function addChart($chartType, $upperLeftRow, $upperLeftColumn, $lowerRightRow, $lowerRightColumn)
{
//check whether workshett name is set or not
if ($this->worksheetName == '')
throw new Exception('Worksheet name not specified');
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/charts?chartType=' . $chartType . '&upperLeftRow=' . $upperLeftRow . '&upperLeftColumn=' . $upperLeftColumn . '&lowerRightRow=' . $lowerRightRow . '&lowerRightColumn=' . $lowerRightColumn;
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'PUT', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save doc on server
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function addChart($chartType, $upperLeftRow, $upperLeftColumn, $lowerRightRow, $lowerRightColumn)
{
//check whether workshett name is set or not
if ($this->worksheetName == '')
throw new Exception('Worksheet name not specified');
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/charts?chartType=' . $chartType . '&upperLeftRow=' . $upperLeftRow . '&upperLeftColumn=' . $upperLeftColumn . '&lowerRightRow=' . $lowerRightRow . '&lowerRightColumn=' . $lowerRightColumn;
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'PUT', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save doc on server
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"addChart",
"(",
"$",
"chartType",
",",
"$",
"upperLeftRow",
",",
"$",
"upperLeftColumn",
",",
"$",
"lowerRightRow",
",",
"$",
"lowerRightColumn",
")",
"{",
"//check whether workshett name is set or not",
"if",
"(",
"$",
"this",
"->",
"worksh... | Adds a new chart.
@param string $chartType Type of the chart.
@param integer $upperLeftRow Number of the upper left row.
@param integer $upperLeftColumn Number of the upper left column.
@param integer $lowerRightRow Number of the lower right row.
@param integer $lowerRightColumn Number of the lower right column.
@return string Returns the file path.
@throws Exception | [
"Adds",
"a",
"new",
"chart",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Cells/ChartEditor.php#L37-L55 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Cells/ChartEditor.php | ChartEditor.deleteCharts | public function deleteCharts()
{
//check whether workshett name is set or not
if ($this->worksheetName == '')
throw new Exception('Worksheet name not specified');
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/charts/';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save doc on server
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | php | public function deleteCharts()
{
//check whether workshett name is set or not
if ($this->worksheetName == '')
throw new Exception('Worksheet name not specified');
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/charts/';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'DELETE', '', '');
$v_output = Utils::validateOutput($responseStream);
if ($v_output === '') {
//Save doc on server
$folder = new Folder();
$outputStream = $folder->GetFile($this->getFileName());
$outputPath = AsposeApp::$outPutLocation . $this->getFileName();
Utils::saveFile($outputStream, $outputPath);
return $outputPath;
} else
return $v_output;
} | [
"public",
"function",
"deleteCharts",
"(",
")",
"{",
"//check whether workshett name is set or not",
"if",
"(",
"$",
"this",
"->",
"worksheetName",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Worksheet name not specified'",
")",
";",
"$",
"strURI",
"=",
"... | Deletes all charts.
@return string Returns the file path.
@throws Exception | [
"Deletes",
"all",
"charts",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Cells/ChartEditor.php#L63-L81 | train |
asposeforcloud/Aspose_Cloud_SDK_For_PHP | src/Aspose/Cloud/Cells/ChartEditor.php | ChartEditor.readChartLegend | public function readChartLegend($chartIndex)
{
//check whether workshett name is set or not
if ($this->worksheetName == '')
throw new Exception('Worksheet name not specified');
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/charts/' . $chartIndex . '/legend';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', 'json', '');
$json = json_decode($responseStream);
return $json->Legend;
} | php | public function readChartLegend($chartIndex)
{
//check whether workshett name is set or not
if ($this->worksheetName == '')
throw new Exception('Worksheet name not specified');
$strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/charts/' . $chartIndex . '/legend';
$signedURI = Utils::sign($strURI);
$responseStream = Utils::processCommand($signedURI, 'GET', 'json', '');
$json = json_decode($responseStream);
return $json->Legend;
} | [
"public",
"function",
"readChartLegend",
"(",
"$",
"chartIndex",
")",
"{",
"//check whether workshett name is set or not",
"if",
"(",
"$",
"this",
"->",
"worksheetName",
"==",
"''",
")",
"throw",
"new",
"Exception",
"(",
"'Worksheet name not specified'",
")",
";",
"... | Get chart legend.
@param integer $chartIndex Index of the chart.
@return object
@throws Exception | [
"Get",
"chart",
"legend",
"."
] | 4950f2f2d24c9a101bf8e0a552d3801c251adac0 | https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_PHP/blob/4950f2f2d24c9a101bf8e0a552d3801c251adac0/src/Aspose/Cloud/Cells/ChartEditor.php#L204-L214 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.