id int32 0 241k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13,700 | csun-metalab/laravel-directory-authentication | src/Authentication/MetaUser.php | MetaUser.stopMasquerading | public function stopMasquerading() {
if($this->isMasquerading()) {
// become the real user again
Auth::logout();
Auth::login(session('masquerading_user'));
session(['masquerading_user' => null]);
// success!
return true;
}
... | php | public function stopMasquerading() {
if($this->isMasquerading()) {
// become the real user again
Auth::logout();
Auth::login(session('masquerading_user'));
session(['masquerading_user' => null]);
// success!
return true;
}
... | [
"public",
"function",
"stopMasquerading",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMasquerading",
"(",
")",
")",
"{",
"// become the real user again",
"Auth",
"::",
"logout",
"(",
")",
";",
"Auth",
"::",
"login",
"(",
"session",
"(",
"'masquerading_us... | Stops masquerading as another user if we are currently masquerading.
Returns true on success or false otherwise.
@return boolean | [
"Stops",
"masquerading",
"as",
"another",
"user",
"if",
"we",
"are",
"currently",
"masquerading",
".",
"Returns",
"true",
"on",
"success",
"or",
"false",
"otherwise",
"."
] | b8d4fa64dd646566e508cdf838d6a3d03b1d53ea | https://github.com/csun-metalab/laravel-directory-authentication/blob/b8d4fa64dd646566e508cdf838d6a3d03b1d53ea/src/Authentication/MetaUser.php#L150-L162 |
13,701 | cpliakas/search-framework | src/Search/Framework/Indexer.php | Indexer.newCollector | public function newCollector()
{
$collector = new Collector($this->getDispatcher());
// Pass services and settings to collector.
$collector
->setCollections($this->_collections)
->setLogger($this->getLogger())
->setQueue($this->getQueue())
->s... | php | public function newCollector()
{
$collector = new Collector($this->getDispatcher());
// Pass services and settings to collector.
$collector
->setCollections($this->_collections)
->setLogger($this->getLogger())
->setQueue($this->getQueue())
->s... | [
"public",
"function",
"newCollector",
"(",
")",
"{",
"$",
"collector",
"=",
"new",
"Collector",
"(",
"$",
"this",
"->",
"getDispatcher",
"(",
")",
")",
";",
"// Pass services and settings to collector.",
"$",
"collector",
"->",
"setCollections",
"(",
"$",
"this"... | Returns a Collector object that the Indexer class injects itself as a
service into.
@return Collector | [
"Returns",
"a",
"Collector",
"object",
"that",
"the",
"Indexer",
"class",
"injects",
"itself",
"as",
"a",
"service",
"into",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Indexer.php#L87-L100 |
13,702 | cpliakas/search-framework | src/Search/Framework/Indexer.php | Indexer.normalizeField | public function normalizeField(IndexField $field)
{
$id = $field->getId();
$value = $field->getValue();
$log = $this->getLogger();
$context = array('field' => $id);
if (isset($this->_fieldTypes[$id])) {
if ($this->_searchEngine->hasNormalizer($this->_fieldTypes[... | php | public function normalizeField(IndexField $field)
{
$id = $field->getId();
$value = $field->getValue();
$log = $this->getLogger();
$context = array('field' => $id);
if (isset($this->_fieldTypes[$id])) {
if ($this->_searchEngine->hasNormalizer($this->_fieldTypes[... | [
"public",
"function",
"normalizeField",
"(",
"IndexField",
"$",
"field",
")",
"{",
"$",
"id",
"=",
"$",
"field",
"->",
"getId",
"(",
")",
";",
"$",
"value",
"=",
"$",
"field",
"->",
"getValue",
"(",
")",
";",
"$",
"log",
"=",
"$",
"this",
"->",
"... | Apply the serivce specific normalizers to a field's value.
@param IndexField $field
The field being normalized.
@return string|array | [
"Apply",
"the",
"serivce",
"specific",
"normalizers",
"to",
"a",
"field",
"s",
"value",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Indexer.php#L110-L130 |
13,703 | cpliakas/search-framework | src/Search/Framework/Indexer.php | Indexer.indexQueuedItems | public function indexQueuedItems()
{
$dispatcher = $this->getDispatcher();
$log = $this->getLogger();
$context = array('engine' => get_class($this->_searchEngine));
$log->info('Indexing operation started', $context);
try {
// Ensure the schema object is populat... | php | public function indexQueuedItems()
{
$dispatcher = $this->getDispatcher();
$log = $this->getLogger();
$context = array('engine' => get_class($this->_searchEngine));
$log->info('Indexing operation started', $context);
try {
// Ensure the schema object is populat... | [
"public",
"function",
"indexQueuedItems",
"(",
")",
"{",
"$",
"dispatcher",
"=",
"$",
"this",
"->",
"getDispatcher",
"(",
")",
";",
"$",
"log",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"context",
"=",
"array",
"(",
"'engine'",
"=>",
"... | Indexes the items that are queued for indexing into the search engine. | [
"Indexes",
"the",
"items",
"that",
"are",
"queued",
"for",
"indexing",
"into",
"the",
"search",
"engine",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Indexer.php#L156-L202 |
13,704 | cpliakas/search-framework | src/Search/Framework/Indexer.php | Indexer.indexQueuedItem | public function indexQueuedItem(QueueMessage $message)
{
$log = $this->getLogger();
$context = array(
'engine' => get_class($this->_searchEngine),
'item' => $message->getBody(),
);
// Load the source data form the message. The message usually contains a
... | php | public function indexQueuedItem(QueueMessage $message)
{
$log = $this->getLogger();
$context = array(
'engine' => get_class($this->_searchEngine),
'item' => $message->getBody(),
);
// Load the source data form the message. The message usually contains a
... | [
"public",
"function",
"indexQueuedItem",
"(",
"QueueMessage",
"$",
"message",
")",
"{",
"$",
"log",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"context",
"=",
"array",
"(",
"'engine'",
"=>",
"get_class",
"(",
"$",
"this",
"->",
"_searchEngi... | Indexes an item that is queued for indexing into the search engine. | [
"Indexes",
"an",
"item",
"that",
"is",
"queued",
"for",
"indexing",
"into",
"the",
"search",
"engine",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/Indexer.php#L207-L241 |
13,705 | todstoychev/icr | src/Manager/FileManager.php | FileManager.generate | public function generate(FilesystemAdapter $filesystemAdapter, $extension, $path = null)
{
$hash = sha1(time() + microtime());
$exists = $filesystemAdapter->exists($path . '/' . $hash . '.' . $extension);
if ($exists) {
$this->generate($filesystemAdapter, $extension, $path);
... | php | public function generate(FilesystemAdapter $filesystemAdapter, $extension, $path = null)
{
$hash = sha1(time() + microtime());
$exists = $filesystemAdapter->exists($path . '/' . $hash . '.' . $extension);
if ($exists) {
$this->generate($filesystemAdapter, $extension, $path);
... | [
"public",
"function",
"generate",
"(",
"FilesystemAdapter",
"$",
"filesystemAdapter",
",",
"$",
"extension",
",",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"hash",
"=",
"sha1",
"(",
"time",
"(",
")",
"+",
"microtime",
"(",
")",
")",
";",
"$",
"exists",
... | Generates unique filename
@param FilesystemAdapter $filesystemAdapter
@param string $extension File extension
@param null|string $path Directory path
@return string | [
"Generates",
"unique",
"filename"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Manager/FileManager.php#L99-L110 |
13,706 | dphn/ScContent | src/ScContent/Listener/Theme/AbstractThemeStrategy.php | AbstractThemeStrategy.injectContentTemplate | protected function injectContentTemplate(MvcEvent $event)
{
$model = $event->getResult();
if (! $model instanceof ViewModel) {
return $this;
}
if ($model->getTemplate()) {
return $this;
}
$routeMatch = $event->getRouteMatch();
$them... | php | protected function injectContentTemplate(MvcEvent $event)
{
$model = $event->getResult();
if (! $model instanceof ViewModel) {
return $this;
}
if ($model->getTemplate()) {
return $this;
}
$routeMatch = $event->getRouteMatch();
$them... | [
"protected",
"function",
"injectContentTemplate",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"model",
"=",
"$",
"event",
"->",
"getResult",
"(",
")",
";",
"if",
"(",
"!",
"$",
"model",
"instanceof",
"ViewModel",
")",
"{",
"return",
"$",
"this",
";",
... | Inject a template into the content view model, if none present
@param \Zend\Mvc\MvcEvent
@return AbstractThemeStrategy | [
"Inject",
"a",
"template",
"into",
"the",
"content",
"view",
"model",
"if",
"none",
"present"
] | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Listener/Theme/AbstractThemeStrategy.php#L119-L166 |
13,707 | dphn/ScContent | src/ScContent/Listener/Theme/AbstractThemeStrategy.php | AbstractThemeStrategy.injectLayoutTemplate | protected function injectLayoutTemplate(MvcEvent $event)
{
$model = $event->getResult();
if (! $model instanceof ViewModel) {
return $this;
}
if ($model->terminate()) {
return $this;
}
$viewManager = $this->getViewManager();
$rendere... | php | protected function injectLayoutTemplate(MvcEvent $event)
{
$model = $event->getResult();
if (! $model instanceof ViewModel) {
return $this;
}
if ($model->terminate()) {
return $this;
}
$viewManager = $this->getViewManager();
$rendere... | [
"protected",
"function",
"injectLayoutTemplate",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"model",
"=",
"$",
"event",
"->",
"getResult",
"(",
")",
";",
"if",
"(",
"!",
"$",
"model",
"instanceof",
"ViewModel",
")",
"{",
"return",
"$",
"this",
";",
... | Inject a template into the layout view model, if none present
@param \Zend\Mvc\MvcEvent
@return AbstractThemeStrategy | [
"Inject",
"a",
"template",
"into",
"the",
"layout",
"view",
"model",
"if",
"none",
"present"
] | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Listener/Theme/AbstractThemeStrategy.php#L174-L221 |
13,708 | kriskbx/mikado | src/Formatters/Formatter.php | Formatter.formatAble | protected function formatAble(&$object)
{
if (!is_object($object) || is_array($object)) {
throw new InvalidArgumentException('The given argument is not an object/array.');
}
if (!is_object($object) && $object instanceof FormatAble) {
return;
}
$objec... | php | protected function formatAble(&$object)
{
if (!is_object($object) || is_array($object)) {
throw new InvalidArgumentException('The given argument is not an object/array.');
}
if (!is_object($object) && $object instanceof FormatAble) {
return;
}
$objec... | [
"protected",
"function",
"formatAble",
"(",
"&",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
"||",
"is_array",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The given argument is not ... | Make an object formatAble.
@param object|array $object
@return object | [
"Make",
"an",
"object",
"formatAble",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Formatters/Formatter.php#L22-L33 |
13,709 | kriskbx/mikado | src/Formatters/Formatter.php | Formatter.regex | public function regex($array = [])
{
$filtered = [];
foreach ($array as $key => $value) {
if ($this->isRegex($key)) {
$filtered[$key] = $value;
}
}
return $filtered;
} | php | public function regex($array = [])
{
$filtered = [];
foreach ($array as $key => $value) {
if ($this->isRegex($key)) {
$filtered[$key] = $value;
}
}
return $filtered;
} | [
"public",
"function",
"regex",
"(",
"$",
"array",
"=",
"[",
"]",
")",
"{",
"$",
"filtered",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRegex",
"(",
"$",
"... | Filter an array where the key is a regex string.
@param array $array
@return array | [
"Filter",
"an",
"array",
"where",
"the",
"key",
"is",
"a",
"regex",
"string",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Formatters/Formatter.php#L42-L52 |
13,710 | kriskbx/mikado | src/Formatters/Formatter.php | Formatter.getRegexProperty | protected function getRegexProperty($matches, $value)
{
foreach ($matches as $index => $match) {
if (is_numeric($index) && $index != 0) {
$value = str_replace('$'.$index, $match, $value);
}
}
return $value;
} | php | protected function getRegexProperty($matches, $value)
{
foreach ($matches as $index => $match) {
if (is_numeric($index) && $index != 0) {
$value = str_replace('$'.$index, $match, $value);
}
}
return $value;
} | [
"protected",
"function",
"getRegexProperty",
"(",
"$",
"matches",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"matches",
"as",
"$",
"index",
"=>",
"$",
"match",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"index",
")",
"&&",
"$",
"index",
"!="... | Get regex property.
@param array $matches
@param string $value
@return string | [
"Get",
"regex",
"property",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Formatters/Formatter.php#L80-L89 |
13,711 | kriskbx/mikado | src/Formatters/Formatter.php | Formatter.pregMatchArray | protected function pregMatchArray($input, $rules, $flags = 0)
{
if (!is_array($rules)) {
return false;
}
foreach ($rules as $rule => $value) {
if (preg_match($rule, $input, $matches, $flags)) {
return array_merge($matches, ['value' => $value]);
... | php | protected function pregMatchArray($input, $rules, $flags = 0)
{
if (!is_array($rules)) {
return false;
}
foreach ($rules as $rule => $value) {
if (preg_match($rule, $input, $matches, $flags)) {
return array_merge($matches, ['value' => $value]);
... | [
"protected",
"function",
"pregMatchArray",
"(",
"$",
"input",
",",
"$",
"rules",
",",
"$",
"flags",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"rules",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"rules",
"as",
... | Applies the regular expressions stored in the keys of the given array to the given input string.
Returns the first match including the matching value.
@param string $input
@param array $rules
@param int $flags
@return array|bool | [
"Applies",
"the",
"regular",
"expressions",
"stored",
"in",
"the",
"keys",
"of",
"the",
"given",
"array",
"to",
"the",
"given",
"input",
"string",
".",
"Returns",
"the",
"first",
"match",
"including",
"the",
"matching",
"value",
"."
] | f00e566d682a66796f3f8a68b348920fadd9ee87 | https://github.com/kriskbx/mikado/blob/f00e566d682a66796f3f8a68b348920fadd9ee87/src/Formatters/Formatter.php#L101-L114 |
13,712 | cpliakas/search-framework | src/Search/Framework/IndexDocument.php | IndexDocument.addField | public function addField($id, $value, $name = null)
{
$field = $this->_service->newField($id, $value, $name);
return $this->attachField($field);
} | php | public function addField($id, $value, $name = null)
{
$field = $this->_service->newField($id, $value, $name);
return $this->attachField($field);
} | [
"public",
"function",
"addField",
"(",
"$",
"id",
",",
"$",
"value",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"_service",
"->",
"newField",
"(",
"$",
"id",
",",
"$",
"value",
",",
"$",
"name",
")",
";",
"re... | Instantiates and attaches a field to this document.
@return IndexField
@see SearchServiceAbstract::newField() | [
"Instantiates",
"and",
"attaches",
"a",
"field",
"to",
"this",
"document",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/IndexDocument.php#L80-L84 |
13,713 | cpliakas/search-framework | src/Search/Framework/IndexDocument.php | IndexDocument.attachField | public function attachField(IndexField $field)
{
// Enrich the field here, agent will probably do this.
// Throw the SearchEvents::FIELD_ENRICH event, reset the field's value
// with the enriched value.
// $event = new SearchFieldEvent($this->_service, $this, $field);
// $this... | php | public function attachField(IndexField $field)
{
// Enrich the field here, agent will probably do this.
// Throw the SearchEvents::FIELD_ENRICH event, reset the field's value
// with the enriched value.
// $event = new SearchFieldEvent($this->_service, $this, $field);
// $this... | [
"public",
"function",
"attachField",
"(",
"IndexField",
"$",
"field",
")",
"{",
"// Enrich the field here, agent will probably do this.",
"// Throw the SearchEvents::FIELD_ENRICH event, reset the field's value",
"// with the enriched value.",
"// $event = new SearchFieldEvent($this->_... | Adds a field to the document.
This method throws the SearchEvents::FIELD_ENRICH event and stores the
enriched value as the field's value.
@param IndexField $field
The field being added to this document.
@return SearchIndexDocument | [
"Adds",
"a",
"field",
"to",
"the",
"document",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/IndexDocument.php#L97-L111 |
13,714 | cpliakas/search-framework | src/Search/Framework/IndexDocument.php | IndexDocument.getField | public function getField($id)
{
if (!isset($this->_fields[$id])) {
$this->$id = ''; // @see SearchIndexDocument::__set()
}
return $this->_fields[$id];
} | php | public function getField($id)
{
if (!isset($this->_fields[$id])) {
$this->$id = ''; // @see SearchIndexDocument::__set()
}
return $this->_fields[$id];
} | [
"public",
"function",
"getField",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_fields",
"[",
"$",
"id",
"]",
")",
")",
"{",
"$",
"this",
"->",
"$",
"id",
"=",
"''",
";",
"// @see SearchIndexDocument::__set()",
"}",
"... | Returns a field that is attached to this document.
If the field is not attached to this document, a field is attached with
an empty string as it's value.
@param string $id
The unique identifier of the field.
@return IndexField | [
"Returns",
"a",
"field",
"that",
"is",
"attached",
"to",
"this",
"document",
"."
] | 7c5832d38ed998e04837c26e0daef59115563b98 | https://github.com/cpliakas/search-framework/blob/7c5832d38ed998e04837c26e0daef59115563b98/src/Search/Framework/IndexDocument.php#L124-L130 |
13,715 | fuelphp/filesystem | src/Handler.php | Handler.setPermissions | public function setPermissions($permissions)
{
if (is_string($permissions))
{
$permissions = '0'.ltrim($permissions, '0');
$permissions = octdec($permissions);
}
return chmod($this->path, $permissions);
} | php | public function setPermissions($permissions)
{
if (is_string($permissions))
{
$permissions = '0'.ltrim($permissions, '0');
$permissions = octdec($permissions);
}
return chmod($this->path, $permissions);
} | [
"public",
"function",
"setPermissions",
"(",
"$",
"permissions",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"permissions",
")",
")",
"{",
"$",
"permissions",
"=",
"'0'",
".",
"ltrim",
"(",
"$",
"permissions",
",",
"'0'",
")",
";",
"$",
"permissions",
... | Sets the permissions
@return boolean | [
"Sets",
"the",
"permissions"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Handler.php#L168-L177 |
13,716 | chadicus/test-helpers | src/FunctionRegistry.php | FunctionRegistry.reset | public static function reset($namespace = null, array $extensions = array())
{
self::$functions = array();
foreach ($extensions as $extension) {
foreach (\get_extension_funcs($extension) as $name) {
self::evaluate($namespace, $name);
}
}
} | php | public static function reset($namespace = null, array $extensions = array())
{
self::$functions = array();
foreach ($extensions as $extension) {
foreach (\get_extension_funcs($extension) as $name) {
self::evaluate($namespace, $name);
}
}
} | [
"public",
"static",
"function",
"reset",
"(",
"$",
"namespace",
"=",
"null",
",",
"array",
"$",
"extensions",
"=",
"array",
"(",
")",
")",
"{",
"self",
"::",
"$",
"functions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"extensions",
"as",
"$",... | Sets all custom function properties to null.
@param string $namespace The namespace from which the global function will be called.
@param array $extensions Array of PHP extensions whose functions will be mocked.
@return void | [
"Sets",
"all",
"custom",
"function",
"properties",
"to",
"null",
"."
] | e6718f5b62e0f1e0851ad2cd344e44a1fdb0b9bf | https://github.com/chadicus/test-helpers/blob/e6718f5b62e0f1e0851ad2cd344e44a1fdb0b9bf/src/FunctionRegistry.php#L56-L64 |
13,717 | CloudObjects/RDFUtilities | Parser.php | Parser.parseToIndex | public static function parseToIndex($input) {
if (($input[0] == '{' || $input[0] == '[')) {
return Arc2JsonLdConverter::jsonLdToIndex($input);
} else {
$parser = \ARC2::getRDFParser();
$parser->parse('', $input);
return $parser->getSimpleIndex(false);
}
... | php | public static function parseToIndex($input) {
if (($input[0] == '{' || $input[0] == '[')) {
return Arc2JsonLdConverter::jsonLdToIndex($input);
} else {
$parser = \ARC2::getRDFParser();
$parser->parse('', $input);
return $parser->getSimpleIndex(false);
}
... | [
"public",
"static",
"function",
"parseToIndex",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"(",
"$",
"input",
"[",
"0",
"]",
"==",
"'{'",
"||",
"$",
"input",
"[",
"0",
"]",
"==",
"'['",
")",
")",
"{",
"return",
"Arc2JsonLdConverter",
"::",
"jsonLdToInde... | Parses the given input and returns an ARC2 index.
If the input is JsonLD the JsonLD parser is used, otherwise ARC2 is used.
@param string $input | [
"Parses",
"the",
"given",
"input",
"and",
"returns",
"an",
"ARC2",
"index",
".",
"If",
"the",
"input",
"is",
"JsonLD",
"the",
"JsonLD",
"parser",
"is",
"used",
"otherwise",
"ARC2",
"is",
"used",
"."
] | cd086981557352073b18b9e2fec1d99cfaacd285 | https://github.com/CloudObjects/RDFUtilities/blob/cd086981557352073b18b9e2fec1d99cfaacd285/Parser.php#L17-L25 |
13,718 | terdia/legato-framework | src/View/Twig.php | Twig.getExtensions | protected function getExtensions()
{
if (file_exists(realpath(__DIR__.'/../../../../../config/twig.php'))) {
$this->config = require realpath(__DIR__.'/../../../../../config/twig.php');
} else {
$this->config = require realpath(__DIR__.'/../../config/twig.php');
}
... | php | protected function getExtensions()
{
if (file_exists(realpath(__DIR__.'/../../../../../config/twig.php'))) {
$this->config = require realpath(__DIR__.'/../../../../../config/twig.php');
} else {
$this->config = require realpath(__DIR__.'/../../config/twig.php');
}
... | [
"protected",
"function",
"getExtensions",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"realpath",
"(",
"__DIR__",
".",
"'/../../../../../config/twig.php'",
")",
")",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"require",
"realpath",
"(",
"__DIR__",
".",
"'... | Get extensions defined by application developer.
@return array | [
"Get",
"extensions",
"defined",
"by",
"application",
"developer",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/View/Twig.php#L54-L63 |
13,719 | terdia/legato-framework | src/View/Twig.php | Twig.registerExtension | private function registerExtension(\Twig_Environment $twig)
{
$extensions = $this->getExtensions();
if (count($extensions)) {
foreach ($extensions as $key => $extension) {
$this->load($twig, $key, $extension);
}
}
} | php | private function registerExtension(\Twig_Environment $twig)
{
$extensions = $this->getExtensions();
if (count($extensions)) {
foreach ($extensions as $key => $extension) {
$this->load($twig, $key, $extension);
}
}
} | [
"private",
"function",
"registerExtension",
"(",
"\\",
"Twig_Environment",
"$",
"twig",
")",
"{",
"$",
"extensions",
"=",
"$",
"this",
"->",
"getExtensions",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"extensions",
")",
")",
"{",
"foreach",
"(",
"$",
... | Register twig extensions.
@param \Twig_Environment $twig | [
"Register",
"twig",
"extensions",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/View/Twig.php#L70-L78 |
13,720 | Im0rtality/Underscore | src/Functions.php | Functions.once | public static function once($function)
{
$called = false;
$value = null;
return function () use ($function, &$called, &$value) {
if (!$called) {
$args = func_get_args();
$value = call_user_func_array($function, $args);
$called = tr... | php | public static function once($function)
{
$called = false;
$value = null;
return function () use ($function, &$called, &$value) {
if (!$called) {
$args = func_get_args();
$value = call_user_func_array($function, $args);
$called = tr... | [
"public",
"static",
"function",
"once",
"(",
"$",
"function",
")",
"{",
"$",
"called",
"=",
"false",
";",
"$",
"value",
"=",
"null",
";",
"return",
"function",
"(",
")",
"use",
"(",
"$",
"function",
",",
"&",
"$",
"called",
",",
"&",
"$",
"value",
... | Creates a version of the function that can only be called one time.
Repeated calls to the modified function will have no effect, returning
the value from the original call. Useful for initialization functions,
instead of having to set a boolean flag and then check it later.
@param callable $function
@return \Closure | [
"Creates",
"a",
"version",
"of",
"the",
"function",
"that",
"can",
"only",
"be",
"called",
"one",
"time",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Functions.php#L53-L67 |
13,721 | Im0rtality/Underscore | src/Functions.php | Functions.partial | public static function partial($function, $arg)
{
$bound = func_get_args();
array_shift($bound); // remove $function
$placeholder = static::p();
return function () use ($function, $bound, $placeholder) {
$inject = func_get_args();
$args = [];
fo... | php | public static function partial($function, $arg)
{
$bound = func_get_args();
array_shift($bound); // remove $function
$placeholder = static::p();
return function () use ($function, $bound, $placeholder) {
$inject = func_get_args();
$args = [];
fo... | [
"public",
"static",
"function",
"partial",
"(",
"$",
"function",
",",
"$",
"arg",
")",
"{",
"$",
"bound",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"bound",
")",
";",
"// remove $function",
"$",
"placeholder",
"=",
"static",
"::",
"p"... | Partially apply a function by filling in any number of its arguments.
You may pass p() in your list of arguments to specify an argument that
should not be pre-filled, but left open to supply at call-time.
@param callable $function
@param mixed $arg
@param mixed ...
@return \Closure | [
"Partially",
"apply",
"a",
"function",
"by",
"filling",
"in",
"any",
"number",
"of",
"its",
"arguments",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Functions.php#L97-L121 |
13,722 | Im0rtality/Underscore | src/Functions.php | Functions.wrap | public static function wrap($function, $wrapper)
{
return function () use ($function, $wrapper) {
$args = func_get_args();
array_unshift($args, $function); // make $function the first argument
return call_user_func_array($wrapper, $args);
};
} | php | public static function wrap($function, $wrapper)
{
return function () use ($function, $wrapper) {
$args = func_get_args();
array_unshift($args, $function); // make $function the first argument
return call_user_func_array($wrapper, $args);
};
} | [
"public",
"static",
"function",
"wrap",
"(",
"$",
"function",
",",
"$",
"wrapper",
")",
"{",
"return",
"function",
"(",
")",
"use",
"(",
"$",
"function",
",",
"$",
"wrapper",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"array_unshift",
... | Wraps the first function inside of the wrapper function, passing it as the first argument.
This allows the wrapper to execute code before and after the function runs,
adjust the arguments, and execute it conditionally.
@param callable $function
@param callable $wrapper
@return \Closure | [
"Wraps",
"the",
"first",
"function",
"inside",
"of",
"the",
"wrapper",
"function",
"passing",
"it",
"as",
"the",
"first",
"argument",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Functions.php#L156-L163 |
13,723 | Im0rtality/Underscore | src/Functions.php | Functions.throttle | public static function throttle($function, $wait, array $options = [])
{
$options += [
'leading' => true,
]; // @codeCoverageIgnore
$previous = 0;
$callback = function () use ($function, $wait, &$previous) {
$now = floor(microtime(true) * 1000); // convert f... | php | public static function throttle($function, $wait, array $options = [])
{
$options += [
'leading' => true,
]; // @codeCoverageIgnore
$previous = 0;
$callback = function () use ($function, $wait, &$previous) {
$now = floor(microtime(true) * 1000); // convert f... | [
"public",
"static",
"function",
"throttle",
"(",
"$",
"function",
",",
"$",
"wait",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'leading'",
"=>",
"true",
",",
"]",
";",
"// @codeCoverageIgnore",
"$",
"previous",
"... | Creates and returns a new, throttled version of the passed function.
When invoked repeatedly, will only actually call the original function at
most once per every wait milliseconds. Useful for rate-limiting events that
occur faster than you can keep up with.
By default, throttle will execute the function as soon as y... | [
"Creates",
"and",
"returns",
"a",
"new",
"throttled",
"version",
"of",
"the",
"passed",
"function",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Functions.php#L187-L210 |
13,724 | Im0rtality/Underscore | src/Functions.php | Functions.before | public static function before($count, $function)
{
$memo = null;
return function () use ($function, &$count, &$memo) {
if (--$count > 0) {
$args = func_get_args();
$memo = call_user_func_array($function, $args);
}
return $memo;
... | php | public static function before($count, $function)
{
$memo = null;
return function () use ($function, &$count, &$memo) {
if (--$count > 0) {
$args = func_get_args();
$memo = call_user_func_array($function, $args);
}
return $memo;
... | [
"public",
"static",
"function",
"before",
"(",
"$",
"count",
",",
"$",
"function",
")",
"{",
"$",
"memo",
"=",
"null",
";",
"return",
"function",
"(",
")",
"use",
"(",
"$",
"function",
",",
"&",
"$",
"count",
",",
"&",
"$",
"memo",
")",
"{",
"if"... | Creates a version of the function that can be called no more than count times.
The result of the last function call is memoized and returned when count has been reached.
@param integer $count
@param callable $function
@return \Closure | [
"Creates",
"a",
"version",
"of",
"the",
"function",
"that",
"can",
"be",
"called",
"no",
"more",
"than",
"count",
"times",
"."
] | 2deb95cfd340761d00ecd0f033e67ce600f2b535 | https://github.com/Im0rtality/Underscore/blob/2deb95cfd340761d00ecd0f033e67ce600f2b535/src/Functions.php#L242-L254 |
13,725 | todstoychev/icr | src/Handler/OpenImageHandler.php | OpenImageHandler.loadImage | public function loadImage($image)
{
$imageLibrary = ucfirst($this->imageLibrary);
$functionName = 'loadWith' . $imageLibrary;
$this->image = $image;
if (!method_exists($this, $functionName)) {
throw new IcrRuntimeException('Wrong image library name provided!');
}... | php | public function loadImage($image)
{
$imageLibrary = ucfirst($this->imageLibrary);
$functionName = 'loadWith' . $imageLibrary;
$this->image = $image;
if (!method_exists($this, $functionName)) {
throw new IcrRuntimeException('Wrong image library name provided!');
}... | [
"public",
"function",
"loadImage",
"(",
"$",
"image",
")",
"{",
"$",
"imageLibrary",
"=",
"ucfirst",
"(",
"$",
"this",
"->",
"imageLibrary",
")",
";",
"$",
"functionName",
"=",
"'loadWith'",
".",
"$",
"imageLibrary",
";",
"$",
"this",
"->",
"image",
"=",... | Loads image from data string with imagine based on the driver name
@param string $image Image as string
@return AbstractImage | [
"Loads",
"image",
"from",
"data",
"string",
"with",
"imagine",
"based",
"on",
"the",
"driver",
"name"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Handler/OpenImageHandler.php#L61-L72 |
13,726 | todstoychev/icr | src/Handler/OpenImageHandler.php | OpenImageHandler.openImage | public function openImage($path)
{
$imageLibrary = ucfirst($this->imageLibrary);
$functionName = 'openWith' . $imageLibrary;
$this->path = $path;
if (!method_exists($this, $functionName)) {
throw new IcrRuntimeException('Wrong image library name provided!');
}
... | php | public function openImage($path)
{
$imageLibrary = ucfirst($this->imageLibrary);
$functionName = 'openWith' . $imageLibrary;
$this->path = $path;
if (!method_exists($this, $functionName)) {
throw new IcrRuntimeException('Wrong image library name provided!');
}
... | [
"public",
"function",
"openImage",
"(",
"$",
"path",
")",
"{",
"$",
"imageLibrary",
"=",
"ucfirst",
"(",
"$",
"this",
"->",
"imageLibrary",
")",
";",
"$",
"functionName",
"=",
"'openWith'",
".",
"$",
"imageLibrary",
";",
"$",
"this",
"->",
"path",
"=",
... | Open image from path with imagine library
@param string $path
@return AbstractImage | [
"Open",
"image",
"from",
"path",
"with",
"imagine",
"library"
] | 0214c7bc76e44488e98758d55deb707b72e24000 | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Handler/OpenImageHandler.php#L81-L92 |
13,727 | mamuz/MamuzBlog | src/MamuzBlog/Controller/Plugin/ViewModelFactory.php | ViewModelFactory.create | public function create($variables = null, $options = null)
{
$viewModel = new ViewModel($variables, $options);
$viewModel->setTerminal($this->isTerminal());
$viewModel->setVariable('isTerminal', $viewModel->terminate());
return $viewModel;
} | php | public function create($variables = null, $options = null)
{
$viewModel = new ViewModel($variables, $options);
$viewModel->setTerminal($this->isTerminal());
$viewModel->setVariable('isTerminal', $viewModel->terminate());
return $viewModel;
} | [
"public",
"function",
"create",
"(",
"$",
"variables",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"viewModel",
"=",
"new",
"ViewModel",
"(",
"$",
"variables",
",",
"$",
"options",
")",
";",
"$",
"viewModel",
"->",
"setTerminal",
"(",... | Create ViewModel instance
and set terminal mode by HttpRequest
@param null|array|\Traversable $variables
@param null|array|\Traversable $options
@return ModelInterface | [
"Create",
"ViewModel",
"instance",
"and",
"set",
"terminal",
"mode",
"by",
"HttpRequest"
] | cb43be5c39031e3dcc939283e284824c4d07da38 | https://github.com/mamuz/MamuzBlog/blob/cb43be5c39031e3dcc939283e284824c4d07da38/src/MamuzBlog/Controller/Plugin/ViewModelFactory.php#L19-L26 |
13,728 | joomla-projects/jorobo | src/Tasks/Build/Library.php | Library.run | public function run()
{
$this->say("Building library folder " . $this->libName);
if (!file_exists($this->source))
{
$this->say("Folder " . $this->source . " does not exist!");
return true;
}
$this->prepareDirectory();
// Libaries are problematic.. we have libraries/name/libraries/name in the end ... | php | public function run()
{
$this->say("Building library folder " . $this->libName);
if (!file_exists($this->source))
{
$this->say("Folder " . $this->source . " does not exist!");
return true;
}
$this->prepareDirectory();
// Libaries are problematic.. we have libraries/name/libraries/name in the end ... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Building library folder \"",
".",
"$",
"this",
"->",
"libName",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"source",
")",
")",
"{",
"$",
"this",
"->",... | Runs the library build tasks, just copying files currently
@return bool
@since 1.0 | [
"Runs",
"the",
"library",
"build",
"tasks",
"just",
"copying",
"files",
"currently"
] | e72dd0ed15f387739f67cacdbc2c0bd1b427f317 | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Library.php#L67-L112 |
13,729 | joomla-projects/jorobo | src/Tasks/Build/Library.php | Library.createInstaller | private function createInstaller($files)
{
$this->say("Creating library installer");
$xmlFile = $this->target . "/" . $this->libName . ".xml";
// Version & Date Replace
$this->replaceInFile($xmlFile);
// Files and folders
$f = $this->generateFileList($files);
$this->taskReplaceInFile($xmlFile)
->f... | php | private function createInstaller($files)
{
$this->say("Creating library installer");
$xmlFile = $this->target . "/" . $this->libName . ".xml";
// Version & Date Replace
$this->replaceInFile($xmlFile);
// Files and folders
$f = $this->generateFileList($files);
$this->taskReplaceInFile($xmlFile)
->f... | [
"private",
"function",
"createInstaller",
"(",
"$",
"files",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"\"Creating library installer\"",
")",
";",
"$",
"xmlFile",
"=",
"$",
"this",
"->",
"target",
".",
"\"/\"",
".",
"$",
"this",
"->",
"libName",
".",
"\".... | Generate the installer xml file for the library
@param array $files The library files
@return void
@since 1.0 | [
"Generate",
"the",
"installer",
"xml",
"file",
"for",
"the",
"library"
] | e72dd0ed15f387739f67cacdbc2c0bd1b427f317 | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Library.php#L135-L175 |
13,730 | iP1SMS/ip1-php-sdk | src/Core/Communicator.php | Communicator.add | public function add(ProcessableComponentInterface $component)
{
switch (get_class($component)) {
case "IP1\RESTClient\Recipient\Contact":
$response = $this->sendRequest("api/contacts", "POST", json_encode($component));
return RecipientFactory::createProcessedConta... | php | public function add(ProcessableComponentInterface $component)
{
switch (get_class($component)) {
case "IP1\RESTClient\Recipient\Contact":
$response = $this->sendRequest("api/contacts", "POST", json_encode($component));
return RecipientFactory::createProcessedConta... | [
"public",
"function",
"add",
"(",
"ProcessableComponentInterface",
"$",
"component",
")",
"{",
"switch",
"(",
"get_class",
"(",
"$",
"component",
")",
")",
"{",
"case",
"\"IP1\\RESTClient\\Recipient\\Contact\"",
":",
"$",
"response",
"=",
"$",
"this",
"->",
"sen... | Adds the param to the API and returns the response as the corresponding object.
@param ProcessableComponentInterface $component A Contact, Group, Membership or OutGoingSMS.
@return ProcessedComponentInterface ProcessedContact, ProcessedGroup, PrcessedMembership or a ClassValidatinArray
filled with ProcessedOutGoingSMS.... | [
"Adds",
"the",
"param",
"to",
"the",
"API",
"and",
"returns",
"the",
"response",
"as",
"the",
"corresponding",
"object",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/Communicator.php#L60-L86 |
13,731 | iP1SMS/ip1-php-sdk | src/Core/Communicator.php | Communicator.remove | public function remove(ProcessedComponentInterface $component): ProcessedComponentInterface
{
switch (get_class($component)) {
case "IP1\RESTClient\Recipient\ProcessedContact":
$response = $this->sendRequest("api/contacts/".$component->getID(), "DELETE");
return R... | php | public function remove(ProcessedComponentInterface $component): ProcessedComponentInterface
{
switch (get_class($component)) {
case "IP1\RESTClient\Recipient\ProcessedContact":
$response = $this->sendRequest("api/contacts/".$component->getID(), "DELETE");
return R... | [
"public",
"function",
"remove",
"(",
"ProcessedComponentInterface",
"$",
"component",
")",
":",
"ProcessedComponentInterface",
"{",
"switch",
"(",
"get_class",
"(",
"$",
"component",
")",
")",
"{",
"case",
"\"IP1\\RESTClient\\Recipient\\ProcessedContact\"",
":",
"$",
... | Removes the param to the API and returns the response as the corresponding object.
@param ProcessedComponentInterface $component A Contact, Group, Membership.
@return ProcessedComponentInterface ProcessedContact, ProcessedGroup, PrcessedMembership or a ClassValidatinArray
filled with ProcessedOutGoingSMS.
@throws \Inva... | [
"Removes",
"the",
"param",
"to",
"the",
"API",
"and",
"returns",
"the",
"response",
"as",
"the",
"corresponding",
"object",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/Communicator.php#L94-L118 |
13,732 | iP1SMS/ip1-php-sdk | src/Core/Communicator.php | Communicator.edit | public function edit(UpdatableComponentInterface $component): UpdatableComponentInterface
{
switch (get_class($component)) {
case "IP1\RESTClient\Recipient\ProcessedContact":
$response = $this->sendRequest(
"api/contacts/".$component->getID(),
... | php | public function edit(UpdatableComponentInterface $component): UpdatableComponentInterface
{
switch (get_class($component)) {
case "IP1\RESTClient\Recipient\ProcessedContact":
$response = $this->sendRequest(
"api/contacts/".$component->getID(),
... | [
"public",
"function",
"edit",
"(",
"UpdatableComponentInterface",
"$",
"component",
")",
":",
"UpdatableComponentInterface",
"{",
"switch",
"(",
"get_class",
"(",
"$",
"component",
")",
")",
"{",
"case",
"\"IP1\\RESTClient\\Recipient\\ProcessedContact\"",
":",
"$",
"r... | Edits the param to the API and returns the response as the corresponding object.
@param UpdatableComponentInterface $component A Contact, Group, Membership.
@return UpdatableComponentInterface ProcessedContact, ProcessedGroup or PrcessedMembership.
@throws \InvalidArgumentException When param isn't any of the classes l... | [
"Edits",
"the",
"param",
"to",
"the",
"API",
"and",
"returns",
"the",
"response",
"as",
"the",
"corresponding",
"object",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/Communicator.php#L125-L146 |
13,733 | iP1SMS/ip1-php-sdk | src/Core/Communicator.php | Communicator.post | public function post(string $endPoint, \JsonSerializable $content): string
{
$parsedEndPoint = self::parseEndPoint($endPoint);
return $this->sendRequest($parsedEndPoint, "POST", json_encode($content));
} | php | public function post(string $endPoint, \JsonSerializable $content): string
{
$parsedEndPoint = self::parseEndPoint($endPoint);
return $this->sendRequest($parsedEndPoint, "POST", json_encode($content));
} | [
"public",
"function",
"post",
"(",
"string",
"$",
"endPoint",
",",
"\\",
"JsonSerializable",
"$",
"content",
")",
":",
"string",
"{",
"$",
"parsedEndPoint",
"=",
"self",
"::",
"parseEndPoint",
"(",
"$",
"endPoint",
")",
";",
"return",
"$",
"this",
"->",
... | Adds the content object to the endpoint and returns a processed version of given object.
@param string $endPoint API URI.
@param \JsonSerializable $content The ProcessableComponentInterface that is to be posted to the API.
@return string JSON API Response. | [
"Adds",
"the",
"content",
"object",
"to",
"the",
"endpoint",
"and",
"returns",
"a",
"processed",
"version",
"of",
"given",
"object",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/Communicator.php#L164-L168 |
13,734 | iP1SMS/ip1-php-sdk | src/Core/Communicator.php | Communicator.delete | public function delete(string $endPoint): string
{
$parsedEndPoint = self::parseEndPoint($endPoint);
return $this->sendRequest($parsedEndPoint, "DELETE");
} | php | public function delete(string $endPoint): string
{
$parsedEndPoint = self::parseEndPoint($endPoint);
return $this->sendRequest($parsedEndPoint, "DELETE");
} | [
"public",
"function",
"delete",
"(",
"string",
"$",
"endPoint",
")",
":",
"string",
"{",
"$",
"parsedEndPoint",
"=",
"self",
"::",
"parseEndPoint",
"(",
"$",
"endPoint",
")",
";",
"return",
"$",
"this",
"->",
"sendRequest",
"(",
"$",
"parsedEndPoint",
",",... | Deletes the object at the given endpoint
@param string $endPoint API URI.
@return string JSON string of what got deleted. | [
"Deletes",
"the",
"object",
"at",
"the",
"given",
"endpoint"
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/Communicator.php#L174-L178 |
13,735 | iP1SMS/ip1-php-sdk | src/Core/Communicator.php | Communicator.parseEndPoint | private static function parseEndPoint(string $endPoint)
{
$endPoint = trim($endPoint, '/');
$endPointArray = explode('/', $endPoint);
if ($endPointArray[0] == "api") {
return $endPoint;
}
array_unshift($endPointArray, "api");
return implode('/', array_fil... | php | private static function parseEndPoint(string $endPoint)
{
$endPoint = trim($endPoint, '/');
$endPointArray = explode('/', $endPoint);
if ($endPointArray[0] == "api") {
return $endPoint;
}
array_unshift($endPointArray, "api");
return implode('/', array_fil... | [
"private",
"static",
"function",
"parseEndPoint",
"(",
"string",
"$",
"endPoint",
")",
"{",
"$",
"endPoint",
"=",
"trim",
"(",
"$",
"endPoint",
",",
"'/'",
")",
";",
"$",
"endPointArray",
"=",
"explode",
"(",
"'/'",
",",
"$",
"endPoint",
")",
";",
"if"... | Turns the given endPoint string into a usable.
@param string $endPoint API URI.
@return string Fixed endpoint string. | [
"Turns",
"the",
"given",
"endPoint",
"string",
"into",
"a",
"usable",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/Communicator.php#L195-L205 |
13,736 | iP1SMS/ip1-php-sdk | src/Core/Communicator.php | Communicator.sendRequest | private function sendRequest(string $endPoint, string $method, string $content = "", bool $https = true): Response
{
$url = ($https ? "https://" : "http://") . self::DOMAIN . "/" .$endPoint;
$request = \Httpful\Request::init($method, 'application/json');
$request->basicAuth($this->accountTok... | php | private function sendRequest(string $endPoint, string $method, string $content = "", bool $https = true): Response
{
$url = ($https ? "https://" : "http://") . self::DOMAIN . "/" .$endPoint;
$request = \Httpful\Request::init($method, 'application/json');
$request->basicAuth($this->accountTok... | [
"private",
"function",
"sendRequest",
"(",
"string",
"$",
"endPoint",
",",
"string",
"$",
"method",
",",
"string",
"$",
"content",
"=",
"\"\"",
",",
"bool",
"$",
"https",
"=",
"true",
")",
":",
"Response",
"{",
"$",
"url",
"=",
"(",
"$",
"https",
"?"... | Sends a HTTP request to the RESTful API and returns the result as a JSON string.
@param string $endPoint The URI that the function should use.
@param string $method The HTTP method that should be used, valid ones are:
METH_POST, METH_GET, METH_DELETE and METH_PUT.
@param string $content A JSON string containing ... | [
"Sends",
"a",
"HTTP",
"request",
"to",
"the",
"RESTful",
"API",
"and",
"returns",
"the",
"result",
"as",
"a",
"JSON",
"string",
"."
] | 348e6572a279363ba689c9e0f5689b83a25930f5 | https://github.com/iP1SMS/ip1-php-sdk/blob/348e6572a279363ba689c9e0f5689b83a25930f5/src/Core/Communicator.php#L216-L233 |
13,737 | mimmi20/Wurfl | src/CustomDevice.php | CustomDevice.isSpecific | public function isSpecific()
{
foreach ($this->modelDevices as $modelDevice) {
if ($modelDevice->specific === true || $modelDevice->actualDeviceRoot === true) {
return true;
}
}
return false;
} | php | public function isSpecific()
{
foreach ($this->modelDevices as $modelDevice) {
if ($modelDevice->specific === true || $modelDevice->actualDeviceRoot === true) {
return true;
}
}
return false;
} | [
"public",
"function",
"isSpecific",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"modelDevices",
"as",
"$",
"modelDevice",
")",
"{",
"if",
"(",
"$",
"modelDevice",
"->",
"specific",
"===",
"true",
"||",
"$",
"modelDevice",
"->",
"actualDeviceRoot",
"=... | Device is a specific or actual WURFL device as defined by its capabilities
@return bool | [
"Device",
"is",
"a",
"specific",
"or",
"actual",
"WURFL",
"device",
"as",
"defined",
"by",
"its",
"capabilities"
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/CustomDevice.php#L148-L157 |
13,738 | mimmi20/Wurfl | src/CustomDevice.php | CustomDevice.getCapability | public function getCapability($capabilityName)
{
if (empty($capabilityName)) {
throw new \InvalidArgumentException('capability name must not be empty');
}
if (!$this->getRootDevice()->isCapabilityDefined($capabilityName)) {
throw new \InvalidArgumentException('no cap... | php | public function getCapability($capabilityName)
{
if (empty($capabilityName)) {
throw new \InvalidArgumentException('capability name must not be empty');
}
if (!$this->getRootDevice()->isCapabilityDefined($capabilityName)) {
throw new \InvalidArgumentException('no cap... | [
"public",
"function",
"getCapability",
"(",
"$",
"capabilityName",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"capabilityName",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'capability name must not be empty'",
")",
";",
"}",
"if",
"(",
... | Returns the value of a given capability name
for the current device
@param string $capabilityName must be a valid capability name
@throws \InvalidArgumentException The $capabilityName is is not defined in the loaded WURFL.
@return string|null Capability value
@see \Wurfl\Device\ModelDeviceInterface::getCapability() | [
"Returns",
"the",
"value",
"of",
"a",
"given",
"capability",
"name",
"for",
"the",
"current",
"device"
] | 443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/CustomDevice.php#L171-L190 |
13,739 | christophe-brachet/aspi-framework | src/Framework/Form/Element/Input/Datalist.php | Datalist.render | public function render($depth = 0, $indent = null, $inner = false)
{
return parent::render($depth, $indent, $inner) . $this->datalist->render($depth, $indent, $inner);
} | php | public function render($depth = 0, $indent = null, $inner = false)
{
return parent::render($depth, $indent, $inner) . $this->datalist->render($depth, $indent, $inner);
} | [
"public",
"function",
"render",
"(",
"$",
"depth",
"=",
"0",
",",
"$",
"indent",
"=",
"null",
",",
"$",
"inner",
"=",
"false",
")",
"{",
"return",
"parent",
"::",
"render",
"(",
"$",
"depth",
",",
"$",
"indent",
",",
"$",
"inner",
")",
".",
"$",
... | Render the datalist element
@param int $depth
@param string $indent
@param boolean $inner
@return mixed | [
"Render",
"the",
"datalist",
"element"
] | 17a36c8a8582e0b8d8bff7087590c09a9bd4af1e | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/Input/Datalist.php#L61-L64 |
13,740 | incraigulous/contentful-sdk | src/ManagementResources/Assets.php | Assets.process | function process($id, $language = null)
{
if (!$language && defined('CONTENTFUL_DEFAULT_LANGUAGE')) {
$language = CONTENTFUL_DEFAULT_LANGUAGE;
} else {
$language = 'en-US';
}
$this->requestDecorator->setId($id . '/files/' . $language . '/process');
$r... | php | function process($id, $language = null)
{
if (!$language && defined('CONTENTFUL_DEFAULT_LANGUAGE')) {
$language = CONTENTFUL_DEFAULT_LANGUAGE;
} else {
$language = 'en-US';
}
$this->requestDecorator->setId($id . '/files/' . $language . '/process');
$r... | [
"function",
"process",
"(",
"$",
"id",
",",
"$",
"language",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"language",
"&&",
"defined",
"(",
"'CONTENTFUL_DEFAULT_LANGUAGE'",
")",
")",
"{",
"$",
"language",
"=",
"CONTENTFUL_DEFAULT_LANGUAGE",
";",
"}",
"else"... | Process an asset.
@param $id
@param string $language
@return mixed | [
"Process",
"an",
"asset",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/ManagementResources/Assets.php#L18-L29 |
13,741 | PandaPlatform/framework | src/Panda/Http/Request.php | Request.getInputValue | public function getInputValue($key = null, $default = null)
{
$input = $this->getInputSource()->all() + $this->query->all();
return ArrayHelper::get($input, $key, $default);
} | php | public function getInputValue($key = null, $default = null)
{
$input = $this->getInputSource()->all() + $this->query->all();
return ArrayHelper::get($input, $key, $default);
} | [
"public",
"function",
"getInputValue",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"input",
"=",
"$",
"this",
"->",
"getInputSource",
"(",
")",
"->",
"all",
"(",
")",
"+",
"$",
"this",
"->",
"query",
"->",
"all",
... | Get an input item from the request.
@param string $key
@param string|array|null $default
@return array|string
@throws \LogicException | [
"Get",
"an",
"input",
"item",
"from",
"the",
"request",
"."
] | a78cf051b379896b5a4d5df620988e37a0e632f5 | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Http/Request.php#L97-L102 |
13,742 | PandaPlatform/framework | src/Panda/Http/Request.php | Request.get | public function get($key, $default = null, $includeCookies = true)
{
if ($includeCookies) {
if ($this !== $result = $this->cookies->get($key, $this)) {
return $result;
}
}
return parent::get($key, $default);
} | php | public function get($key, $default = null, $includeCookies = true)
{
if ($includeCookies) {
if ($this !== $result = $this->cookies->get($key, $this)) {
return $result;
}
}
return parent::get($key, $default);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
",",
"$",
"includeCookies",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"includeCookies",
")",
"{",
"if",
"(",
"$",
"this",
"!==",
"$",
"result",
"=",
"$",
"this",
"->",
"... | Gets a "parameter" value from any bag.
You can include the cookies bag. It is included by default.
@param string $key
@param null $default
@param bool $includeCookies
@return mixed | [
"Gets",
"a",
"parameter",
"value",
"from",
"any",
"bag",
".",
"You",
"can",
"include",
"the",
"cookies",
"bag",
".",
"It",
"is",
"included",
"by",
"default",
"."
] | a78cf051b379896b5a4d5df620988e37a0e632f5 | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Http/Request.php#L209-L218 |
13,743 | venta/framework | src/Routing/src/UrlGenerator.php | UrlGenerator.addPortToUri | private function addPortToUri(UriInterface $uri): UriInterface
{
$requestPort = $this->request->getUri()->getPort();
if (!in_array($requestPort, [80, 443])) {
$uri = $uri->withPort($requestPort);
}
return $uri;
} | php | private function addPortToUri(UriInterface $uri): UriInterface
{
$requestPort = $this->request->getUri()->getPort();
if (!in_array($requestPort, [80, 443])) {
$uri = $uri->withPort($requestPort);
}
return $uri;
} | [
"private",
"function",
"addPortToUri",
"(",
"UriInterface",
"$",
"uri",
")",
":",
"UriInterface",
"{",
"$",
"requestPort",
"=",
"$",
"this",
"->",
"request",
"->",
"getUri",
"(",
")",
"->",
"getPort",
"(",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$"... | Adds port to URI if it is needed.
@param UriInterface $uri
@return UriInterface | [
"Adds",
"port",
"to",
"URI",
"if",
"it",
"is",
"needed",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Routing/src/UrlGenerator.php#L99-L108 |
13,744 | venta/framework | src/Routing/src/UrlGenerator.php | UrlGenerator.buildRouteUri | private function buildRouteUri(RouteContract $route, array $variables = [], array $query = []): UriInterface
{
$uri = $this->uri
->withScheme($route->scheme() ?: $this->request->getUri()->getScheme())
->withHost($route->host() ?: $this->request->getUri()->getHost())
->wit... | php | private function buildRouteUri(RouteContract $route, array $variables = [], array $query = []): UriInterface
{
$uri = $this->uri
->withScheme($route->scheme() ?: $this->request->getUri()->getScheme())
->withHost($route->host() ?: $this->request->getUri()->getHost())
->wit... | [
"private",
"function",
"buildRouteUri",
"(",
"RouteContract",
"$",
"route",
",",
"array",
"$",
"variables",
"=",
"[",
"]",
",",
"array",
"$",
"query",
"=",
"[",
"]",
")",
":",
"UriInterface",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"uri",
"->",
"wit... | Builds URI for provided route instance.
@param RouteContract $route
@param array $variables
@param array $query
@return UriInterface | [
"Builds",
"URI",
"for",
"provided",
"route",
"instance",
"."
] | 514a7854cc69f84f47e62a58cc55efd68b7c9f83 | https://github.com/venta/framework/blob/514a7854cc69f84f47e62a58cc55efd68b7c9f83/src/Routing/src/UrlGenerator.php#L118-L130 |
13,745 | raphaelstolt/composer-travis-lint | src/Travis.php | Travis.hasStaleCacheFile | protected static function hasStaleCacheFile()
{
$composerTravisLintCache = getcwd()
. DIRECTORY_SEPARATOR
. self::CTL_CACHE;
$travisConfiguration = getcwd()
. DIRECTORY_SEPARATOR
. self::TRAVIS_CONFIGURATION;
if (file_exists($composerTravisLi... | php | protected static function hasStaleCacheFile()
{
$composerTravisLintCache = getcwd()
. DIRECTORY_SEPARATOR
. self::CTL_CACHE;
$travisConfiguration = getcwd()
. DIRECTORY_SEPARATOR
. self::TRAVIS_CONFIGURATION;
if (file_exists($composerTravisLi... | [
"protected",
"static",
"function",
"hasStaleCacheFile",
"(",
")",
"{",
"$",
"composerTravisLintCache",
"=",
"getcwd",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"self",
"::",
"CTL_CACHE",
";",
"$",
"travisConfiguration",
"=",
"getcwd",
"(",
")",
".",
"DIRECTORY_... | Check if composer travis lint cache is stale.
@return boolean | [
"Check",
"if",
"composer",
"travis",
"lint",
"cache",
"is",
"stale",
"."
] | e6e005350b3c8981826aa718bc2282ddfd03caef | https://github.com/raphaelstolt/composer-travis-lint/blob/e6e005350b3c8981826aa718bc2282ddfd03caef/src/Travis.php#L20-L40 |
13,746 | raphaelstolt/composer-travis-lint | src/Travis.php | Travis.lint | public static function lint(Event $event, Api $api = null)
{
$composerTravisLintCache = getcwd()
. DIRECTORY_SEPARATOR
. self::CTL_CACHE;
$io = $event->getIO();
if (!file_exists(self::TRAVIS_CONFIGURATION)) {
$io->writeError("Travis CI configuration doesn... | php | public static function lint(Event $event, Api $api = null)
{
$composerTravisLintCache = getcwd()
. DIRECTORY_SEPARATOR
. self::CTL_CACHE;
$io = $event->getIO();
if (!file_exists(self::TRAVIS_CONFIGURATION)) {
$io->writeError("Travis CI configuration doesn... | [
"public",
"static",
"function",
"lint",
"(",
"Event",
"$",
"event",
",",
"Api",
"$",
"api",
"=",
"null",
")",
"{",
"$",
"composerTravisLintCache",
"=",
"getcwd",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"self",
"::",
"CTL_CACHE",
";",
"$",
"io",
"=",
... | The Composer script to lint a Travis CI configuration file.
@param Event $event
@param Api|null $api
@return boolean | [
"The",
"Composer",
"script",
"to",
"lint",
"a",
"Travis",
"CI",
"configuration",
"file",
"."
] | e6e005350b3c8981826aa718bc2282ddfd03caef | https://github.com/raphaelstolt/composer-travis-lint/blob/e6e005350b3c8981826aa718bc2282ddfd03caef/src/Travis.php#L49-L118 |
13,747 | crysalead/net | src/Http/Auth.php | Auth.header | public static function header($data)
{
if (empty($data['response'])) {
throw new NetException("Can't create Authorization headers from an empty response.");
}
if (!isset($data['nonce'])) {
return "Basic " . $data['response'];
}
$defaults = [
... | php | public static function header($data)
{
if (empty($data['response'])) {
throw new NetException("Can't create Authorization headers from an empty response.");
}
if (!isset($data['nonce'])) {
return "Basic " . $data['response'];
}
$defaults = [
... | [
"public",
"static",
"function",
"header",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'response'",
"]",
")",
")",
"{",
"throw",
"new",
"NetException",
"(",
"\"Can't create Authorization headers from an empty response.\"",
")",
";",
... | Returns the proper header string. Accepts the data from the `encode` method.
@param array $data
@return string | [
"Returns",
"the",
"proper",
"header",
"string",
".",
"Accepts",
"the",
"data",
"from",
"the",
"encode",
"method",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Auth.php#L24-L44 |
13,748 | crysalead/net | src/Http/Auth.php | Auth.encode | public static function encode($username, $password, $data = [])
{
if (!isset($data['nonce'])) {
$response = base64_encode("{$username}:{$password}");
return compact('username', 'response');
}
$defaults = [
'realm' => 'app', 'method' => 'GET', 'uri' => '/',... | php | public static function encode($username, $password, $data = [])
{
if (!isset($data['nonce'])) {
$response = base64_encode("{$username}:{$password}");
return compact('username', 'response');
}
$defaults = [
'realm' => 'app', 'method' => 'GET', 'uri' => '/',... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'nonce'",
"]",
")",
")",
"{",
"$",
"response",
"=",
"base64_encode",
... | Encodes the data with username and password to create the proper response. Returns an array
containing the username and encoded response.
@param string $username Username to authenticate with
@param string $password Password to authenticate with
@param array $data Params needed to hash the response
@return array | [
"Encodes",
"the",
"data",
"with",
"username",
"and",
"password",
"to",
"create",
"the",
"proper",
"response",
".",
"Returns",
"an",
"array",
"containing",
"the",
"username",
"and",
"encoded",
"response",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Auth.php#L55-L71 |
13,749 | crysalead/net | src/Http/Auth.php | Auth.decode | public static function decode($header)
{
$data = [
'realm' => null,
'username' => null,
'uri' => null,
'nonce' => null,
'opaque' => null,
'qop' => null,
'cnonce' => null,
'nc' => null,
... | php | public static function decode($header)
{
$data = [
'realm' => null,
'username' => null,
'uri' => null,
'nonce' => null,
'opaque' => null,
'qop' => null,
'cnonce' => null,
'nc' => null,
... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"header",
")",
"{",
"$",
"data",
"=",
"[",
"'realm'",
"=>",
"null",
",",
"'username'",
"=>",
"null",
",",
"'uri'",
"=>",
"null",
",",
"'nonce'",
"=>",
"null",
",",
"'opaque'",
"=>",
"null",
",",
"'q... | Takes the header string and parses out the params needed for a digest authentication.
@param string $header
@return array | [
"Takes",
"the",
"header",
"string",
"and",
"parses",
"out",
"the",
"params",
"needed",
"for",
"a",
"digest",
"authentication",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Auth.php#L79-L100 |
13,750 | fuelphp/filesystem | src/Finder.php | Finder.setRoot | public function setRoot($root)
{
if ( ! $path = realpath($root))
{
throw new \Exception('Location does not exist: '.$root);
}
$this->root = $path;
} | php | public function setRoot($root)
{
if ( ! $path = realpath($root))
{
throw new \Exception('Location does not exist: '.$root);
}
$this->root = $path;
} | [
"public",
"function",
"setRoot",
"(",
"$",
"root",
")",
"{",
"if",
"(",
"!",
"$",
"path",
"=",
"realpath",
"(",
"$",
"root",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Location does not exist: '",
".",
"$",
"root",
")",
";",
"}",
"$",
... | Sets a root restriction
@param string $root | [
"Sets",
"a",
"root",
"restriction"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L107-L115 |
13,751 | fuelphp/filesystem | src/Finder.php | Finder.addPaths | public function addPaths(array $paths, $clearCache = true, $group = '__DEFAULT__')
{
array_map([$this, 'addPath'], $paths, [[$clearCache, $group]]);
} | php | public function addPaths(array $paths, $clearCache = true, $group = '__DEFAULT__')
{
array_map([$this, 'addPath'], $paths, [[$clearCache, $group]]);
} | [
"public",
"function",
"addPaths",
"(",
"array",
"$",
"paths",
",",
"$",
"clearCache",
"=",
"true",
",",
"$",
"group",
"=",
"'__DEFAULT__'",
")",
"{",
"array_map",
"(",
"[",
"$",
"this",
",",
"'addPath'",
"]",
",",
"$",
"paths",
",",
"[",
"[",
"$",
... | Adds paths to look in
@param array $paths
@param boolean $clearCache | [
"Adds",
"paths",
"to",
"look",
"in"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L123-L126 |
13,752 | fuelphp/filesystem | src/Finder.php | Finder.removePaths | public function removePaths(array $paths, $clearCache = true, $group = '__DEFAULT__')
{
array_map([$this, 'removePath'], $paths, [[$clearCache, $group]]);
} | php | public function removePaths(array $paths, $clearCache = true, $group = '__DEFAULT__')
{
array_map([$this, 'removePath'], $paths, [[$clearCache, $group]]);
} | [
"public",
"function",
"removePaths",
"(",
"array",
"$",
"paths",
",",
"$",
"clearCache",
"=",
"true",
",",
"$",
"group",
"=",
"'__DEFAULT__'",
")",
"{",
"array_map",
"(",
"[",
"$",
"this",
",",
"'removePath'",
"]",
",",
"$",
"paths",
",",
"[",
"[",
"... | Removes paths to look in
@param array $paths | [
"Removes",
"paths",
"to",
"look",
"in"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L154-L157 |
13,753 | fuelphp/filesystem | src/Finder.php | Finder.removePathCache | public function removePathCache($path)
{
foreach ($this->cache as $key => $cache)
{
if (in_array($path, $cache['used']))
{
unset($this->cache[$key]);
}
}
} | php | public function removePathCache($path)
{
foreach ($this->cache as $key => $cache)
{
if (in_array($path, $cache['used']))
{
unset($this->cache[$key]);
}
}
} | [
"public",
"function",
"removePathCache",
"(",
"$",
"path",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"cache",
"as",
"$",
"key",
"=>",
"$",
"cache",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"path",
",",
"$",
"cache",
"[",
"'used'",
"]",
")",
... | Removes path cache
@param string $path | [
"Removes",
"path",
"cache"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L181-L190 |
13,754 | fuelphp/filesystem | src/Finder.php | Finder.normalizePath | public function normalizePath($path)
{
$path = rtrim($path, '/\\').DIRECTORY_SEPARATOR;
$path = realpath($path).DIRECTORY_SEPARATOR;
if ($this->root and strpos($path, $this->root) !== 0)
{
throw new \Exception('Cannot access path outside: '.$this->root.'. Trying to access: '.$path);
}
return $path;
} | php | public function normalizePath($path)
{
$path = rtrim($path, '/\\').DIRECTORY_SEPARATOR;
$path = realpath($path).DIRECTORY_SEPARATOR;
if ($this->root and strpos($path, $this->root) !== 0)
{
throw new \Exception('Cannot access path outside: '.$this->root.'. Trying to access: '.$path);
}
return $path;
} | [
"public",
"function",
"normalizePath",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"'/\\\\'",
")",
".",
"DIRECTORY_SEPARATOR",
";",
"$",
"path",
"=",
"realpath",
"(",
"$",
"path",
")",
".",
"DIRECTORY_SEPARATOR",
";",
... | Normalizes a path
@param string $path
@return string
@throws \Exception | [
"Normalizes",
"a",
"path"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L201-L212 |
13,755 | fuelphp/filesystem | src/Finder.php | Finder.getPaths | public function getPaths($group = '__DEFAULT__')
{
if ( ! isset($this->paths[$group]))
{
return [];
}
return array_values($this->paths[$group]);
} | php | public function getPaths($group = '__DEFAULT__')
{
if ( ! isset($this->paths[$group]))
{
return [];
}
return array_values($this->paths[$group]);
} | [
"public",
"function",
"getPaths",
"(",
"$",
"group",
"=",
"'__DEFAULT__'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"paths",
"[",
"$",
"group",
"]",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"array_values",
"(",
"$",
... | Returns the paths set up to look in
@return array | [
"Returns",
"the",
"paths",
"set",
"up",
"to",
"look",
"in"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L219-L227 |
13,756 | fuelphp/filesystem | src/Finder.php | Finder.setPaths | public function setPaths(array $paths, $clearCache = true, $group = '__DEFAULT__')
{
$this->paths[$group] = [];
$this->addPaths($paths, false, $group);
if ($clearCache)
{
$this->cache = [];
}
} | php | public function setPaths(array $paths, $clearCache = true, $group = '__DEFAULT__')
{
$this->paths[$group] = [];
$this->addPaths($paths, false, $group);
if ($clearCache)
{
$this->cache = [];
}
} | [
"public",
"function",
"setPaths",
"(",
"array",
"$",
"paths",
",",
"$",
"clearCache",
"=",
"true",
",",
"$",
"group",
"=",
"'__DEFAULT__'",
")",
"{",
"$",
"this",
"->",
"paths",
"[",
"$",
"group",
"]",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"addPat... | Replaces all the paths
@param array $paths | [
"Replaces",
"all",
"the",
"paths"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L244-L253 |
13,757 | fuelphp/filesystem | src/Finder.php | Finder.findCached | public function findCached($scope, $name, $reversed)
{
$cacheKey = $this->makeCacheKey($scope, $name, $reversed);
if (isset($this->cache[$cacheKey]))
{
return $this->cache[$cacheKey]['result'];
}
} | php | public function findCached($scope, $name, $reversed)
{
$cacheKey = $this->makeCacheKey($scope, $name, $reversed);
if (isset($this->cache[$cacheKey]))
{
return $this->cache[$cacheKey]['result'];
}
} | [
"public",
"function",
"findCached",
"(",
"$",
"scope",
",",
"$",
"name",
",",
"$",
"reversed",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"makeCacheKey",
"(",
"$",
"scope",
",",
"$",
"name",
",",
"$",
"reversed",
")",
";",
"if",
"(",
"isset... | Retrieves a location from cache
@param string $scope
@param string $name
@param boolean $reversed
@return string|array | [
"Retrieves",
"a",
"location",
"from",
"cache"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L533-L541 |
13,758 | fuelphp/filesystem | src/Finder.php | Finder.cache | public function cache($scope, $name, $reversed, $result, $pathsUsed = [])
{
$cacheKey = $this->makeCacheKey($scope, $name, $reversed);
$this->cache[$cacheKey] = [
'result' => $result,
'used' => $pathsUsed,
];
} | php | public function cache($scope, $name, $reversed, $result, $pathsUsed = [])
{
$cacheKey = $this->makeCacheKey($scope, $name, $reversed);
$this->cache[$cacheKey] = [
'result' => $result,
'used' => $pathsUsed,
];
} | [
"public",
"function",
"cache",
"(",
"$",
"scope",
",",
"$",
"name",
",",
"$",
"reversed",
",",
"$",
"result",
",",
"$",
"pathsUsed",
"=",
"[",
"]",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"makeCacheKey",
"(",
"$",
"scope",
",",
"$",
"n... | Caches a find result
@param string $scope
@param string $name
@param boolean $reversed
@param array $pathsUsed | [
"Caches",
"a",
"find",
"result"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L559-L566 |
13,759 | fuelphp/filesystem | src/Finder.php | Finder.makeCacheKey | public function makeCacheKey($scope, $name, $reversed)
{
$cacheKey = $scope.'::'.$name;
if ($reversed)
{
$cacheKey .= '::reversed';
}
return $cacheKey;
} | php | public function makeCacheKey($scope, $name, $reversed)
{
$cacheKey = $scope.'::'.$name;
if ($reversed)
{
$cacheKey .= '::reversed';
}
return $cacheKey;
} | [
"public",
"function",
"makeCacheKey",
"(",
"$",
"scope",
",",
"$",
"name",
",",
"$",
"reversed",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"scope",
".",
"'::'",
".",
"$",
"name",
";",
"if",
"(",
"$",
"reversed",
")",
"{",
"$",
"cacheKey",
".=",
"'::reve... | Generates a cache key
@param string $scope
@param string $name
@param boolean $reversed
@return string | [
"Generates",
"a",
"cache",
"key"
] | 770a8cb04caca920af8029d7aad7208bc0592743 | https://github.com/fuelphp/filesystem/blob/770a8cb04caca920af8029d7aad7208bc0592743/src/Finder.php#L577-L587 |
13,760 | crysalead/net | src/Http/Response.php | Response.negotiate | public function negotiate($request)
{
$media = $this->_classes['media'];
foreach ($request->accepts() as $mime => $value) {
if ($format = $media::suitable($request, $mime)) {
$this->format($format);
return;
}
}
$mimes = join('",... | php | public function negotiate($request)
{
$media = $this->_classes['media'];
foreach ($request->accepts() as $mime => $value) {
if ($format = $media::suitable($request, $mime)) {
$this->format($format);
return;
}
}
$mimes = join('",... | [
"public",
"function",
"negotiate",
"(",
"$",
"request",
")",
"{",
"$",
"media",
"=",
"$",
"this",
"->",
"_classes",
"[",
"'media'",
"]",
";",
"foreach",
"(",
"$",
"request",
"->",
"accepts",
"(",
")",
"as",
"$",
"mime",
"=>",
"$",
"value",
")",
"{"... | Performs a format negotiation from a `Request` object, by iterating over the accepted
content types in sequence, from most preferred to least.
@param object $request A request instance . | [
"Performs",
"a",
"format",
"negotiation",
"from",
"a",
"Request",
"object",
"by",
"iterating",
"over",
"the",
"accepted",
"content",
"types",
"in",
"sequence",
"from",
"most",
"preferred",
"to",
"least",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L110-L121 |
13,761 | crysalead/net | src/Http/Response.php | Response.dump | public function dump()
{
$this->_setContentLength();
header($this->line());
$headers = $this->headers();
foreach ($headers as $header) {
header($header->to('header'));
}
if ($headers['Transfer-Encoding']->value() === 'chunked') {
return;
... | php | public function dump()
{
$this->_setContentLength();
header($this->line());
$headers = $this->headers();
foreach ($headers as $header) {
header($header->to('header'));
}
if ($headers['Transfer-Encoding']->value() === 'chunked') {
return;
... | [
"public",
"function",
"dump",
"(",
")",
"{",
"$",
"this",
"->",
"_setContentLength",
"(",
")",
";",
"header",
"(",
"$",
"this",
"->",
"line",
"(",
")",
")",
";",
"$",
"headers",
"=",
"$",
"this",
"->",
"headers",
"(",
")",
";",
"foreach",
"(",
"$... | Renders a response by writing headers and output.
@see https://bugs.php.net/bug.php?id=18029 | [
"Renders",
"a",
"response",
"by",
"writing",
"headers",
"and",
"output",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L243-L263 |
13,762 | crysalead/net | src/Http/Response.php | Response.push | public function push($data, $atomic = true, $options = [])
{
$headers = $this->headers();
if ($headers['Transfer-Encoding']->value() !== 'chunked') {
throw new NetException("Pushing is only supported in chunked transfer.");
}
$defaults = [
'cast' => true,
... | php | public function push($data, $atomic = true, $options = [])
{
$headers = $this->headers();
if ($headers['Transfer-Encoding']->value() !== 'chunked') {
throw new NetException("Pushing is only supported in chunked transfer.");
}
$defaults = [
'cast' => true,
... | [
"public",
"function",
"push",
"(",
"$",
"data",
",",
"$",
"atomic",
"=",
"true",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"headers",
"(",
")",
";",
"if",
"(",
"$",
"headers",
"[",
"'Transfer-Encoding'",
... | Push additionnal data to a chunked response.
@param mixed $data The formated data. If the passed data is a stream it'll be closed.
@param boolean $atomic Indicates if the $data can be chunked or must be send as a whole chunk. | [
"Push",
"additionnal",
"data",
"to",
"a",
"chunked",
"response",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L271-L320 |
13,763 | crysalead/net | src/Http/Response.php | Response.applyCookies | public function applyCookies($cookies)
{
$headers = $this->headers();
foreach ($cookies as $cookie) {
$headers['Set-Cookie'][] = $cookie->toString();
}
return $this;
} | php | public function applyCookies($cookies)
{
$headers = $this->headers();
foreach ($cookies as $cookie) {
$headers['Set-Cookie'][] = $cookie->toString();
}
return $this;
} | [
"public",
"function",
"applyCookies",
"(",
"$",
"cookies",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"headers",
"(",
")",
";",
"foreach",
"(",
"$",
"cookies",
"as",
"$",
"cookie",
")",
"{",
"$",
"headers",
"[",
"'Set-Cookie'",
"]",
"[",
"]",
... | Set the Set-Cookie header
@param array $cookies The cookies.
@return self | [
"Set",
"the",
"Set",
"-",
"Cookie",
"header"
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L340-L348 |
13,764 | crysalead/net | src/Http/Response.php | Response.cookies | public function cookies($request)
{
$headers = $response->headers();
if (!isset($headers['Set-Cookie'])) {
return [];
}
$setCookies = [];
foreach ($headers['Set-Cookie'] as $setCookieHeader) {
$setCookie = Cookie::fromString($setCookieHeader);
... | php | public function cookies($request)
{
$headers = $response->headers();
if (!isset($headers['Set-Cookie'])) {
return [];
}
$setCookies = [];
foreach ($headers['Set-Cookie'] as $setCookieHeader) {
$setCookie = Cookie::fromString($setCookieHeader);
... | [
"public",
"function",
"cookies",
"(",
"$",
"request",
")",
"{",
"$",
"headers",
"=",
"$",
"response",
"->",
"headers",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"headers",
"[",
"'Set-Cookie'",
"]",
")",
")",
"{",
"return",
"[",
"]",
";",
... | Extract cookies.
@return array The cookies array. | [
"Extract",
"cookies",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L355-L373 |
13,765 | crysalead/net | src/Http/Response.php | Response.redirect | public function redirect($location, $status = 302)
{
if (!$location) {
return;
}
$this->status($status);
$headers = $this->headers();
$headers['Location'] = $location;
return $this;
} | php | public function redirect($location, $status = 302)
{
if (!$location) {
return;
}
$this->status($status);
$headers = $this->headers();
$headers['Location'] = $location;
return $this;
} | [
"public",
"function",
"redirect",
"(",
"$",
"location",
",",
"$",
"status",
"=",
"302",
")",
"{",
"if",
"(",
"!",
"$",
"location",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"status",
"(",
"$",
"status",
")",
";",
"$",
"headers",
"=",
"$",
... | Set a redirect location.
@param string $location The redirect location.
@param integer $status The redirect HTTP status. | [
"Set",
"a",
"redirect",
"location",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L381-L390 |
13,766 | crysalead/net | src/Http/Response.php | Response.export | public function export($options = [])
{
$this->_setContentLength();
return [
'status' => $this->status(),
'version' => $this->version(),
'headers' => $this->headers(),
'body' => $this->stream()
];
} | php | public function export($options = [])
{
$this->_setContentLength();
return [
'status' => $this->status(),
'version' => $this->version(),
'headers' => $this->headers(),
'body' => $this->stream()
];
} | [
"public",
"function",
"export",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"_setContentLength",
"(",
")",
";",
"return",
"[",
"'status'",
"=>",
"$",
"this",
"->",
"status",
"(",
")",
",",
"'version'",
"=>",
"$",
"this",
"->",
... | Exports a `Response` instance to an array.
@param array $options Options.
@return array The export array. | [
"Exports",
"a",
"Response",
"instance",
"to",
"an",
"array",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L398-L407 |
13,767 | crysalead/net | src/Http/Response.php | Response.parse | public static function parse($message, $options = [])
{
$parts = explode("\r\n\r\n", $message, 2);
if (count($parts) < 2) {
throw new NetException("The CRLFCRLF separator between headers and body is missing.");
}
$response = new static($options + ['format' => null]);
... | php | public static function parse($message, $options = [])
{
$parts = explode("\r\n\r\n", $message, 2);
if (count($parts) < 2) {
throw new NetException("The CRLFCRLF separator between headers and body is missing.");
}
$response = new static($options + ['format' => null]);
... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"message",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"\"\\r\\n\\r\\n\"",
",",
"$",
"message",
",",
"2",
")",
";",
"if",
"(",
"count",
"(",
"$",
"parts",
")",
... | Creates a response instance from an entire HTTP message including HTTP status headers and body.
@param string $message The full HTTP message.
@param string $options Additionnal options.
@return object Returns a request instance. | [
"Creates",
"a",
"response",
"instance",
"from",
"an",
"entire",
"HTTP",
"message",
"including",
"HTTP",
"status",
"headers",
"and",
"body",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Http/Response.php#L416-L452 |
13,768 | crysalead/net | src/Mime/Mime.php | Mime.encode | public static function encode($body, $encoding, $wrapWidth = 76, $le = "\r\n", $cut = false)
{
$encoding = strtolower($encoding);
switch ($encoding) {
case 'quoted-printable':
$body = quoted_printable_encode($body);
return $wrapWidth ? rtrim(chunk_split($b... | php | public static function encode($body, $encoding, $wrapWidth = 76, $le = "\r\n", $cut = false)
{
$encoding = strtolower($encoding);
switch ($encoding) {
case 'quoted-printable':
$body = quoted_printable_encode($body);
return $wrapWidth ? rtrim(chunk_split($b... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"body",
",",
"$",
"encoding",
",",
"$",
"wrapWidth",
"=",
"76",
",",
"$",
"le",
"=",
"\"\\r\\n\"",
",",
"$",
"cut",
"=",
"false",
")",
"{",
"$",
"encoding",
"=",
"strtolower",
"(",
"$",
"encoding",
... | Encoding method.
Note: Not relying on `stream_filter_append()` since not stable.
@param string $body The message to encode.
@param string $encoding The encoding.
@param string $wrapWidth The wrap width.
@param string $le The wrap width line ending.
@return string | [
"Encoding",
"method",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Mime.php#L54-L79 |
13,769 | crysalead/net | src/Mime/Mime.php | Mime.encodeEmail | public static function encodeEmail($email)
{
if (($pos = strpos($email, '@')) === false) {
return;
}
if (!preg_match('~[\x80-\xFF]~', $email)) {
return $email;
}
$domain = substr($email, ++$pos);
return substr($email, 0, $pos) . idn_to_ascii($d... | php | public static function encodeEmail($email)
{
if (($pos = strpos($email, '@')) === false) {
return;
}
if (!preg_match('~[\x80-\xFF]~', $email)) {
return $email;
}
$domain = substr($email, ++$pos);
return substr($email, 0, $pos) . idn_to_ascii($d... | [
"public",
"static",
"function",
"encodeEmail",
"(",
"$",
"email",
")",
"{",
"if",
"(",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"email",
",",
"'@'",
")",
")",
"===",
"false",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"preg_match",
"(",
"'~[\... | Punycode email address to its ASCII form, also known as punycode.
@param string $email The email address to encode
@return string|null The encoded address in ASCII form or `null` on error. | [
"Punycode",
"email",
"address",
"to",
"its",
"ASCII",
"form",
"also",
"known",
"as",
"punycode",
"."
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Mime.php#L87-L97 |
13,770 | crysalead/net | src/Mime/Mime.php | Mime.encodeValue | public static function encodeValue($value, $wrapWidth = 998, $folding = "\r\n ")
{
if (!preg_match('~[^\x00-\x7F]~', $value)) {
$encoding = '7bit';
} elseif (preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $value) > (strlen($value) / 3)) {
$encoding = 'base64';
... | php | public static function encodeValue($value, $wrapWidth = 998, $folding = "\r\n ")
{
if (!preg_match('~[^\x00-\x7F]~', $value)) {
$encoding = '7bit';
} elseif (preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $value) > (strlen($value) / 3)) {
$encoding = 'base64';
... | [
"public",
"static",
"function",
"encodeValue",
"(",
"$",
"value",
",",
"$",
"wrapWidth",
"=",
"998",
",",
"$",
"folding",
"=",
"\"\\r\\n \"",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'~[^\\x00-\\x7F]~'",
",",
"$",
"value",
")",
")",
"{",
"$",
"enc... | MIME-encode a value to its mots suitable format
@param string $value The value to encode.
@return string Returns the encoded value. | [
"MIME",
"-",
"encode",
"a",
"value",
"to",
"its",
"mots",
"suitable",
"format"
] | 4d75abead39e954529b56cbffa3841a9cd3044bb | https://github.com/crysalead/net/blob/4d75abead39e954529b56cbffa3841a9cd3044bb/src/Mime/Mime.php#L105-L130 |
13,771 | incraigulous/contentful-sdk | src/ClientBase.php | ClientBase.getEndpoint | function getEndpoint() {
$endpoint = $this->endpointBase;
if ($this->spaceId) {
$endpoint .= '/' . $this->spaceId;
}
return $endpoint;
} | php | function getEndpoint() {
$endpoint = $this->endpointBase;
if ($this->spaceId) {
$endpoint .= '/' . $this->spaceId;
}
return $endpoint;
} | [
"function",
"getEndpoint",
"(",
")",
"{",
"$",
"endpoint",
"=",
"$",
"this",
"->",
"endpointBase",
";",
"if",
"(",
"$",
"this",
"->",
"spaceId",
")",
"{",
"$",
"endpoint",
".=",
"'/'",
".",
"$",
"this",
"->",
"spaceId",
";",
"}",
"return",
"$",
"en... | Get the endpoint.
@return string | [
"Get",
"the",
"endpoint",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/ClientBase.php#L48-L54 |
13,772 | incraigulous/contentful-sdk | src/ClientBase.php | ClientBase.build_url | function build_url($resource, array $query = array()) {
$url = $this->getEndpoint();
if ($resource && $this->spaceId) $url .= '/';
if ($resource) $url .= $resource;
if (!empty($query)) $url .= '?' . http_build_query($query);
return $url;
} | php | function build_url($resource, array $query = array()) {
$url = $this->getEndpoint();
if ($resource && $this->spaceId) $url .= '/';
if ($resource) $url .= $resource;
if (!empty($query)) $url .= '?' . http_build_query($query);
return $url;
} | [
"function",
"build_url",
"(",
"$",
"resource",
",",
"array",
"$",
"query",
"=",
"array",
"(",
")",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getEndpoint",
"(",
")",
";",
"if",
"(",
"$",
"resource",
"&&",
"$",
"this",
"->",
"spaceId",
")",
"$... | Build the query URL.
@param $resource
@param $query
@return string | [
"Build",
"the",
"query",
"URL",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/ClientBase.php#L82-L88 |
13,773 | incraigulous/contentful-sdk | src/ClientBase.php | ClientBase.buildCacheKey | function buildCacheKey($method, $resource, $url, $headers = array(), $query = array()) {
return md5($method . $resource . $url . json_encode($query) . json_encode($headers));
} | php | function buildCacheKey($method, $resource, $url, $headers = array(), $query = array()) {
return md5($method . $resource . $url . json_encode($query) . json_encode($headers));
} | [
"function",
"buildCacheKey",
"(",
"$",
"method",
",",
"$",
"resource",
",",
"$",
"url",
",",
"$",
"headers",
"=",
"array",
"(",
")",
",",
"$",
"query",
"=",
"array",
"(",
")",
")",
"{",
"return",
"md5",
"(",
"$",
"method",
".",
"$",
"resource",
"... | Return a unique key for the query.
@param $method
@param $resource
@param $url
@param array $query
@param array $headers
@return string | [
"Return",
"a",
"unique",
"key",
"for",
"the",
"query",
"."
] | 29399b11b0e085a06ea5976661378c379fe5a731 | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/ClientBase.php#L99-L101 |
13,774 | DevGroup-ru/yii2-data-structure-tools | src/models/PropertyGroup.php | PropertyGroup.autoAddToObjects | public function autoAddToObjects()
{
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $modelClassName */
$modelClassName = PropertiesHelper::classNameForApplicablePropertyModelId($this->applicable_property_model_id);
$modelIdsWithoutGroup = $modelClassName::find()... | php | public function autoAddToObjects()
{
/** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $modelClassName */
$modelClassName = PropertiesHelper::classNameForApplicablePropertyModelId($this->applicable_property_model_id);
$modelIdsWithoutGroup = $modelClassName::find()... | [
"public",
"function",
"autoAddToObjects",
"(",
")",
"{",
"/** @var \\yii\\db\\ActiveRecord|\\DevGroup\\DataStructure\\traits\\PropertiesTrait $modelClassName */",
"$",
"modelClassName",
"=",
"PropertiesHelper",
"::",
"classNameForApplicablePropertyModelId",
"(",
"$",
"this",
"->",
... | Finds new applicable models and binds this group to them
@throws \yii\db\Exception Database exception is thrown on error | [
"Finds",
"new",
"applicable",
"models",
"and",
"binds",
"this",
"group",
"to",
"them"
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/models/PropertyGroup.php#L185-L217 |
13,775 | DevGroup-ru/yii2-data-structure-tools | src/models/PropertyGroup.php | PropertyGroup.search | public function search($applicablePropertyModelId, $params, $showHidden = false)
{
$query = self::find()
->where([
'applicable_property_model_id' => $applicablePropertyModelId,
]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
... | php | public function search($applicablePropertyModelId, $params, $showHidden = false)
{
$query = self::find()
->where([
'applicable_property_model_id' => $applicablePropertyModelId,
]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
... | [
"public",
"function",
"search",
"(",
"$",
"applicablePropertyModelId",
",",
"$",
"params",
",",
"$",
"showHidden",
"=",
"false",
")",
"{",
"$",
"query",
"=",
"self",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"[",
"'applicable_property_model_id'",
"=>",
"... | Returns ActiveDataProvider for searching PropertyGroup models
@param integer $applicablePropertyModelId Applicable property model id
@param array $params Array of filter params
@return \yii\data\ActiveDataProvider
@codeCoverageIgnore | [
"Returns",
"ActiveDataProvider",
"for",
"searching",
"PropertyGroup",
"models"
] | a5b24d7c0b24d4b0d58cacd91ec7fd876e979097 | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/models/PropertyGroup.php#L294-L329 |
13,776 | markwatkinson/luminous | src/Luminous/Core/Scanners/EmbeddedWebScriptScanner.php | EmbeddedWebScriptScanner.string | public function string($str = null)
{
if ($str !== null) {
foreach ($this->childScanners as $s) {
$s->string($str);
}
}
return parent::string($str);
} | php | public function string($str = null)
{
if ($str !== null) {
foreach ($this->childScanners as $s) {
$s->string($str);
}
}
return parent::string($str);
} | [
"public",
"function",
"string",
"(",
"$",
"str",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"str",
"!==",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"childScanners",
"as",
"$",
"s",
")",
"{",
"$",
"s",
"->",
"string",
"(",
"$",
"str",
")"... | override string to hit the child scanners as well | [
"override",
"string",
"to",
"hit",
"the",
"child",
"scanners",
"as",
"well"
] | 4adc18f414534abe986133d6d38e8e9787d32e69 | https://github.com/markwatkinson/luminous/blob/4adc18f414534abe986133d6d38e8e9787d32e69/src/Luminous/Core/Scanners/EmbeddedWebScriptScanner.php#L115-L123 |
13,777 | dphn/ScContent | src/ScContent/Controller/Installation/RequirementsController.php | RequirementsController.configurationAction | public function configurationAction()
{
$redirect = $this->getRedirect();
$installation = $this->getInstallation();
$step = $installation->getCurrentStep();
$member = $step->getCurrentMember();
$validator = $this->getValidator();
if (! $validator... | php | public function configurationAction()
{
$redirect = $this->getRedirect();
$installation = $this->getInstallation();
$step = $installation->getCurrentStep();
$member = $step->getCurrentMember();
$validator = $this->getValidator();
if (! $validator... | [
"public",
"function",
"configurationAction",
"(",
")",
"{",
"$",
"redirect",
"=",
"$",
"this",
"->",
"getRedirect",
"(",
")",
";",
"$",
"installation",
"=",
"$",
"this",
"->",
"getInstallation",
"(",
")",
";",
"$",
"step",
"=",
"$",
"installation",
"->",... | Checks the settings in the php.ini file in accordance with the
configuration of the module. If the settings are not compatible,
the installation process stops and displays the information message.
@return \Zend\Stdlib\ResponseInterface|\Zend\View\Model\ViewModel | [
"Checks",
"the",
"settings",
"in",
"the",
"php",
".",
"ini",
"file",
"in",
"accordance",
"with",
"the",
"configuration",
"of",
"the",
"module",
".",
"If",
"the",
"settings",
"are",
"not",
"compatible",
"the",
"installation",
"process",
"stops",
"and",
"displ... | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Installation/RequirementsController.php#L33-L89 |
13,778 | terdia/legato-framework | src/Mail/Transport/MailGunClient.php | MailGunClient.combineTo | protected function combineTo(Swift_Mime_SimpleMessage $message)
{
return array_merge(
(array) $message->getTo(), (array) $message->getCc(), (array) $message->getBcc()
);
} | php | protected function combineTo(Swift_Mime_SimpleMessage $message)
{
return array_merge(
(array) $message->getTo(), (array) $message->getCc(), (array) $message->getBcc()
);
} | [
"protected",
"function",
"combineTo",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
")",
"{",
"return",
"array_merge",
"(",
"(",
"array",
")",
"$",
"message",
"->",
"getTo",
"(",
")",
",",
"(",
"array",
")",
"$",
"message",
"->",
"getCc",
"(",
")",
",... | Combine all contacts for the message.
@param \Swift_Mime_SimpleMessage $message
@return array | [
"Combine",
"all",
"contacts",
"for",
"the",
"message",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Mail/Transport/MailGunClient.php#L84-L89 |
13,779 | terdia/legato-framework | src/Mail/Transport/MailGunClient.php | MailGunClient.prepareTo | protected function prepareTo(Swift_Mime_SimpleMessage $message)
{
$to = array_map(function ($name, $address) {
return $name ? $name." <{$address}>" : $address;
}, $this->combineTo($message), array_keys($this->combineTo($message)));
return implode(',', $to);
} | php | protected function prepareTo(Swift_Mime_SimpleMessage $message)
{
$to = array_map(function ($name, $address) {
return $name ? $name." <{$address}>" : $address;
}, $this->combineTo($message), array_keys($this->combineTo($message)));
return implode(',', $to);
} | [
"protected",
"function",
"prepareTo",
"(",
"Swift_Mime_SimpleMessage",
"$",
"message",
")",
"{",
"$",
"to",
"=",
"array_map",
"(",
"function",
"(",
"$",
"name",
",",
"$",
"address",
")",
"{",
"return",
"$",
"name",
"?",
"$",
"name",
".",
"\" <{$address}>\"... | Format the to addresses to match Mailgun message.mime format.
@param Swift_Mime_SimpleMessage $message
@return string | [
"Format",
"the",
"to",
"addresses",
"to",
"match",
"Mailgun",
"message",
".",
"mime",
"format",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Mail/Transport/MailGunClient.php#L98-L105 |
13,780 | terdia/legato-framework | src/Security/CSRFProtection.php | CSRFProtection.extractToken | protected function extractToken()
{
if ($this->request->input('token') === false) {
if (!$this->request->getHeader('X-JS-CLIENTS-TOKEN')) {
return 'token';
}
return $this->request->getHeader('X-JS-CLIENTS-TOKEN');
}
return $this->request-... | php | protected function extractToken()
{
if ($this->request->input('token') === false) {
if (!$this->request->getHeader('X-JS-CLIENTS-TOKEN')) {
return 'token';
}
return $this->request->getHeader('X-JS-CLIENTS-TOKEN');
}
return $this->request-... | [
"protected",
"function",
"extractToken",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"'token'",
")",
"===",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"request",
"->",
"getHeader",
"(",
"'X-JS-CLIENTS-TOKEN'",
... | extract token from form or JavaScript Clients like Axios, Ajax, JQuery.
@return bool|string|string[] | [
"extract",
"token",
"from",
"form",
"or",
"JavaScript",
"Clients",
"like",
"Axios",
"Ajax",
"JQuery",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Security/CSRFProtection.php#L77-L88 |
13,781 | terdia/legato-framework | src/Session/Session.php | Session.getInstance | public static function getInstance()
{
if (!static::$instance instanceof self) {
static::$instance = $session = new self();
if (!$session->isStarted()) {
$session->start();
}
}
return static::$instance;
} | php | public static function getInstance()
{
if (!static::$instance instanceof self) {
static::$instance = $session = new self();
if (!$session->isStarted()) {
$session->start();
}
}
return static::$instance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"$",
"instance",
"instanceof",
"self",
")",
"{",
"static",
"::",
"$",
"instance",
"=",
"$",
"session",
"=",
"new",
"self",
"(",
")",
";",
"if",
"(",
"!",
... | Session singleton.
@return mixed | [
"Session",
"singleton",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Session/Session.php#L26-L36 |
13,782 | terdia/legato-framework | src/Session/Session.php | Session.createFlashMessage | public function createFlashMessage($key, $value)
{
$session = static::getInstance();
$session->getFlashBag()->add($key, $value);
} | php | public function createFlashMessage($key, $value)
{
$session = static::getInstance();
$session->getFlashBag()->add($key, $value);
} | [
"public",
"function",
"createFlashMessage",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"session",
"=",
"static",
"::",
"getInstance",
"(",
")",
";",
"$",
"session",
"->",
"getFlashBag",
"(",
")",
"->",
"add",
"(",
"$",
"key",
",",
"$",
"value... | Add flash message.
@param $key
@param $value | [
"Add",
"flash",
"message",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Session/Session.php#L44-L48 |
13,783 | terdia/legato-framework | src/Session/Session.php | Session.getFlashMessage | public function getFlashMessage($key)
{
$session = static::getInstance();
foreach ($session->getFlashBag()->get($key, []) as $message) {
return $message ?: null;
}
return '';
} | php | public function getFlashMessage($key)
{
$session = static::getInstance();
foreach ($session->getFlashBag()->get($key, []) as $message) {
return $message ?: null;
}
return '';
} | [
"public",
"function",
"getFlashMessage",
"(",
"$",
"key",
")",
"{",
"$",
"session",
"=",
"static",
"::",
"getInstance",
"(",
")",
";",
"foreach",
"(",
"$",
"session",
"->",
"getFlashBag",
"(",
")",
"->",
"get",
"(",
"$",
"key",
",",
"[",
"]",
")",
... | Get message from flash bag.
@param $key
@return null|string | [
"Get",
"message",
"from",
"flash",
"bag",
"."
] | 44057c1c3c6f3e9643e9fade51bd417860fafda8 | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Session/Session.php#L57-L65 |
13,784 | arckinteractive/events_api | classes/Events/API/Event.php | Event.getURL | public function getURL($start_timestamp = 0, $calendar_guid = 0) {
if (!$start_timestamp) {
$start_timestamp = $this->getNextOccurrence();
}
$url = parent::getURL();
return elgg_http_add_url_query_elements($url, array_filter(array(
'ts' => $start_timestamp,
'calendar' => $calendar_guid,
)));
} | php | public function getURL($start_timestamp = 0, $calendar_guid = 0) {
if (!$start_timestamp) {
$start_timestamp = $this->getNextOccurrence();
}
$url = parent::getURL();
return elgg_http_add_url_query_elements($url, array_filter(array(
'ts' => $start_timestamp,
'calendar' => $calendar_guid,
)));
} | [
"public",
"function",
"getURL",
"(",
"$",
"start_timestamp",
"=",
"0",
",",
"$",
"calendar_guid",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"start_timestamp",
")",
"{",
"$",
"start_timestamp",
"=",
"$",
"this",
"->",
"getNextOccurrence",
"(",
")",
";",
... | Returns canonical URL with instance start time added as query element
@param int $start_timestamp Start time of the instance
@param int $calendar_guid GUID of the calendar in context
@return string | [
"Returns",
"canonical",
"URL",
"with",
"instance",
"start",
"time",
"added",
"as",
"query",
"element"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L61-L70 |
13,785 | arckinteractive/events_api | classes/Events/API/Event.php | Event.getCalendars | public function getCalendars($params = array(), $public = false) {
$defaults = array(
'type' => 'object',
'subtype' => 'calendar',
'relationship' => Calendar::EVENT_CALENDAR_RELATIONSHIP,
'relationship_guid' => $this->guid,
'limit' => false
);
$options = array_merge($defaults, $params);
if ($pu... | php | public function getCalendars($params = array(), $public = false) {
$defaults = array(
'type' => 'object',
'subtype' => 'calendar',
'relationship' => Calendar::EVENT_CALENDAR_RELATIONSHIP,
'relationship_guid' => $this->guid,
'limit' => false
);
$options = array_merge($defaults, $params);
if ($pu... | [
"public",
"function",
"getCalendars",
"(",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"public",
"=",
"false",
")",
"{",
"$",
"defaults",
"=",
"array",
"(",
"'type'",
"=>",
"'object'",
",",
"'subtype'",
"=>",
"'calendar'",
",",
"'relationship'",
"=>... | Get all calendars this event is on
@param array custom parameters to override the default egef
@param bool $public - limit to only personal public calendars? | [
"Get",
"all",
"calendars",
"this",
"event",
"is",
"on"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L78-L101 |
13,786 | arckinteractive/events_api | classes/Events/API/Event.php | Event.move | public function move($params) {
//update the event
$this->all_day = elgg_extract('all_day', $params, false);
$this->start_timestamp = $params['new_start_timestamp'];
$this->end_timestamp = $params['new_end_timestamp'];
$this->start_date = $params['new_start_date'];
$this->end_date = $params['new_end_date'];... | php | public function move($params) {
//update the event
$this->all_day = elgg_extract('all_day', $params, false);
$this->start_timestamp = $params['new_start_timestamp'];
$this->end_timestamp = $params['new_end_timestamp'];
$this->start_date = $params['new_start_date'];
$this->end_date = $params['new_end_date'];... | [
"public",
"function",
"move",
"(",
"$",
"params",
")",
"{",
"//update the event",
"$",
"this",
"->",
"all_day",
"=",
"elgg_extract",
"(",
"'all_day'",
",",
"$",
"params",
",",
"false",
")",
";",
"$",
"this",
"->",
"start_timestamp",
"=",
"$",
"params",
"... | Perform a move action with calculated parameters
@param array $params New event parameters
@return boolean | [
"Perform",
"a",
"move",
"action",
"with",
"calculated",
"parameters"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L109-L128 |
13,787 | arckinteractive/events_api | classes/Events/API/Event.php | Event.resize | public function resize($params) {
//update the event
$this->end_timestamp = $params['new_end_timestamp'];
$this->end_date = $params['new_end_date'];
$this->end_time = $params['new_end_time'];
$this->end_delta = $params['new_end_timestamp'] - $this->getStartTimestamp(); // how long this is in seconds
$this-... | php | public function resize($params) {
//update the event
$this->end_timestamp = $params['new_end_timestamp'];
$this->end_date = $params['new_end_date'];
$this->end_time = $params['new_end_time'];
$this->end_delta = $params['new_end_timestamp'] - $this->getStartTimestamp(); // how long this is in seconds
$this-... | [
"public",
"function",
"resize",
"(",
"$",
"params",
")",
"{",
"//update the event",
"$",
"this",
"->",
"end_timestamp",
"=",
"$",
"params",
"[",
"'new_end_timestamp'",
"]",
";",
"$",
"this",
"->",
"end_date",
"=",
"$",
"params",
"[",
"'new_end_date'",
"]",
... | Extends event duration
@param array $params New end parameters
@return boolean | [
"Extends",
"event",
"duration"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L136-L145 |
13,788 | arckinteractive/events_api | classes/Events/API/Event.php | Event.getMoveParams | public function getMoveParams($day_delta, $minute_delta, $all_day = false) {
// calculate new dates
$start_timestamp = $this->getStartTimestamp();
$end_timestamp = $this->getEndTimestamp();
$time_diff = $end_timestamp - $start_timestamp;
$new_start_timestamp = $start_timestamp + ($day_delta * Util::SECONDS_I... | php | public function getMoveParams($day_delta, $minute_delta, $all_day = false) {
// calculate new dates
$start_timestamp = $this->getStartTimestamp();
$end_timestamp = $this->getEndTimestamp();
$time_diff = $end_timestamp - $start_timestamp;
$new_start_timestamp = $start_timestamp + ($day_delta * Util::SECONDS_I... | [
"public",
"function",
"getMoveParams",
"(",
"$",
"day_delta",
",",
"$",
"minute_delta",
",",
"$",
"all_day",
"=",
"false",
")",
"{",
"// calculate new dates",
"$",
"start_timestamp",
"=",
"$",
"this",
"->",
"getStartTimestamp",
"(",
")",
";",
"$",
"end_timesta... | Calculates parameters for a move action
@param int $day_delta Positive or negative number of days from the original event day
@param int $minute_delta Position or negative number of minutes from the origin event time
@param bool $all_day All day event?
@return array | [
"Calculates",
"parameters",
"for",
"a",
"move",
"action"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L235-L256 |
13,789 | arckinteractive/events_api | classes/Events/API/Event.php | Event.getResizeParams | public function getResizeParams($day_delta = 0, $minute_delta = 0) {
// calculate new dates
$end_timestamp = $this->getEndTimestamp();
$new_end_timestamp = $end_timestamp + ($day_delta * Util::SECONDS_IN_A_DAY) + ($minute_delta * Util::SECONDS_IN_A_MINUTE);
$params = array(
'entity' => $this,
'new_end_t... | php | public function getResizeParams($day_delta = 0, $minute_delta = 0) {
// calculate new dates
$end_timestamp = $this->getEndTimestamp();
$new_end_timestamp = $end_timestamp + ($day_delta * Util::SECONDS_IN_A_DAY) + ($minute_delta * Util::SECONDS_IN_A_MINUTE);
$params = array(
'entity' => $this,
'new_end_t... | [
"public",
"function",
"getResizeParams",
"(",
"$",
"day_delta",
"=",
"0",
",",
"$",
"minute_delta",
"=",
"0",
")",
"{",
"// calculate new dates",
"$",
"end_timestamp",
"=",
"$",
"this",
"->",
"getEndTimestamp",
"(",
")",
";",
"$",
"new_end_timestamp",
"=",
"... | Calculates parameters for the resize action
@param int $day_delta Positive or negative number of days from the original event end
@param int $minute_delta Positive or negative number of minutes from the original event end
@return array | [
"Calculates",
"parameters",
"for",
"the",
"resize",
"action"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L265-L279 |
13,790 | arckinteractive/events_api | classes/Events/API/Event.php | Event.calculateRepeatEndTimestamp | public function calculateRepeatEndTimestamp() {
// determine when it actually stops repeating in terms of timestamp
switch ($this->repeat_end_type) {
case Util::REPEAT_END_ON:
$repeat_end_timestamp = strtotime($this->repeat_end_on);
if ($repeat_end_timestamp === false) {
$repeat_end_timestamp = 0;... | php | public function calculateRepeatEndTimestamp() {
// determine when it actually stops repeating in terms of timestamp
switch ($this->repeat_end_type) {
case Util::REPEAT_END_ON:
$repeat_end_timestamp = strtotime($this->repeat_end_on);
if ($repeat_end_timestamp === false) {
$repeat_end_timestamp = 0;... | [
"public",
"function",
"calculateRepeatEndTimestamp",
"(",
")",
"{",
"// determine when it actually stops repeating in terms of timestamp",
"switch",
"(",
"$",
"this",
"->",
"repeat_end_type",
")",
"{",
"case",
"Util",
"::",
"REPEAT_END_ON",
":",
"$",
"repeat_end_timestamp",... | Calculates and returns the last timestamp for event recurrences
@return int | [
"Calculates",
"and",
"returns",
"the",
"last",
"timestamp",
"for",
"event",
"recurrences"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L416-L449 |
13,791 | arckinteractive/events_api | classes/Events/API/Event.php | Event.getNextOccurrence | public function getNextOccurrence($after_timestamp = null) {
if ($after_timestamp === null) {
$after_timestamp = time();
}
$after_timestamp = (int) $after_timestamp;
$next = false;
if ($this->isRecurring()) {
$next = $this->calculateEndAfterTimestamp(1, $after_timestamp, false);
} else if ($after_... | php | public function getNextOccurrence($after_timestamp = null) {
if ($after_timestamp === null) {
$after_timestamp = time();
}
$after_timestamp = (int) $after_timestamp;
$next = false;
if ($this->isRecurring()) {
$next = $this->calculateEndAfterTimestamp(1, $after_timestamp, false);
} else if ($after_... | [
"public",
"function",
"getNextOccurrence",
"(",
"$",
"after_timestamp",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"after_timestamp",
"===",
"null",
")",
"{",
"$",
"after_timestamp",
"=",
"time",
"(",
")",
";",
"}",
"$",
"after_timestamp",
"=",
"(",
"int",
"... | Returns the start timestamp of the next event occurence
Returns false if there are no future occurrences
@param int $after_timestamp Find next occurrence
@return int|false | [
"Returns",
"the",
"start",
"timestamp",
"of",
"the",
"next",
"event",
"occurence",
"Returns",
"false",
"if",
"there",
"are",
"no",
"future",
"occurrences"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L572-L591 |
13,792 | arckinteractive/events_api | classes/Events/API/Event.php | Event.getLastOccurrence | public function getLastOccurrence($before_timestamp = null) {
if ($before_timestamp === null) {
$before_timestamp = time();
}
$before_timestamp = (int) $before_timestamp;
$prev = false;
if ($this->isRecurring()) {
$starttimes = $this->getStartTimes($this->getStartTimestamp(), $before_timestamp);
... | php | public function getLastOccurrence($before_timestamp = null) {
if ($before_timestamp === null) {
$before_timestamp = time();
}
$before_timestamp = (int) $before_timestamp;
$prev = false;
if ($this->isRecurring()) {
$starttimes = $this->getStartTimes($this->getStartTimestamp(), $before_timestamp);
... | [
"public",
"function",
"getLastOccurrence",
"(",
"$",
"before_timestamp",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"before_timestamp",
"===",
"null",
")",
"{",
"$",
"before_timestamp",
"=",
"time",
"(",
")",
";",
"}",
"$",
"before_timestamp",
"=",
"(",
"int",... | Returns the timestamp of the previous event occurence
Returns false if there are no past occurrences
@param int $before_timestamp Find previous occurrence
@return int|false | [
"Returns",
"the",
"timestamp",
"of",
"the",
"previous",
"event",
"occurence",
"Returns",
"false",
"if",
"there",
"are",
"no",
"past",
"occurrences"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L601-L625 |
13,793 | arckinteractive/events_api | classes/Events/API/Event.php | Event.buildReminders | public function buildReminders($starttime, $endtime) {
if (!$this->hasReminders()) {
return true;
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
// first delete any existing reminders for this time period
$this->removeReminders($starttime, $endtime);
$reminders = e... | php | public function buildReminders($starttime, $endtime) {
if (!$this->hasReminders()) {
return true;
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
// first delete any existing reminders for this time period
$this->removeReminders($starttime, $endtime);
$reminders = e... | [
"public",
"function",
"buildReminders",
"(",
"$",
"starttime",
",",
"$",
"endtime",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasReminders",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"starttime",
"=",
"sanitize_int",
"(",
"$",
"starttime... | Creates reminder annotations for this event
@param type $starttime
@param type $endtime
@return boolean | [
"Creates",
"reminder",
"annotations",
"for",
"this",
"event"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Event.php#L652-L682 |
13,794 | dphn/ScContent | src/ScContent/Controller/Installation/InstallationController.php | InstallationController.indexAction | public function indexAction()
{
// To begin the step of installation, the user must click "continue".
if (! $this->params()->fromRoute('process')) {
return new ViewModel();
}
$installation = $this->getInstallation();
$redirect = $this->getRedirect();
... | php | public function indexAction()
{
// To begin the step of installation, the user must click "continue".
if (! $this->params()->fromRoute('process')) {
return new ViewModel();
}
$installation = $this->getInstallation();
$redirect = $this->getRedirect();
... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"// To begin the step of installation, the user must click \"continue\".",
"if",
"(",
"!",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'process'",
")",
")",
"{",
"return",
"new",
"ViewModel",
... | Runs services specified in the configuration.
@throws \ScContent\Exception\DomainException
@return \Zend\Stdlib\ResponseInterface|\Zend\View\Model\ViewModel | [
"Runs",
"services",
"specified",
"in",
"the",
"configuration",
"."
] | 9dd5732490c45fd788b96cedf7b3c7adfacb30d2 | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Controller/Installation/InstallationController.php#L35-L59 |
13,795 | arckinteractive/events_api | classes/Events/API/Calendar.php | Calendar.getAllEvents | public function getAllEvents($starttime = null, $endtime = null) {
if (is_null($starttime)) {
$starttime = time();
}
if (is_null($endtime)) {
$endtime = strtotime('+1 year', $starttime);
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
$relationship_name = sanitize_strin... | php | public function getAllEvents($starttime = null, $endtime = null) {
if (is_null($starttime)) {
$starttime = time();
}
if (is_null($endtime)) {
$endtime = strtotime('+1 year', $starttime);
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
$relationship_name = sanitize_strin... | [
"public",
"function",
"getAllEvents",
"(",
"$",
"starttime",
"=",
"null",
",",
"$",
"endtime",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"starttime",
")",
")",
"{",
"$",
"starttime",
"=",
"time",
"(",
")",
";",
"}",
"if",
"(",
"is_null... | Returns all event objects
@param int $starttime Time range start, default: now
@param int $endtime Time range end, default: 1 year from start time
@return ElggBatch | [
"Returns",
"all",
"event",
"objects"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Calendar.php#L64-L103 |
13,796 | arckinteractive/events_api | classes/Events/API/Calendar.php | Calendar.compareInstancesByStartTime | public static function compareInstancesByStartTime($a, $b) {
$start_a = $a->getStartTimestamp();
$start_b = $b->getStartTimestamp();
if ($start_a == $start_b) {
return 0;
}
return ($start_a < $start_b) ? -1 : 1;
} | php | public static function compareInstancesByStartTime($a, $b) {
$start_a = $a->getStartTimestamp();
$start_b = $b->getStartTimestamp();
if ($start_a == $start_b) {
return 0;
}
return ($start_a < $start_b) ? -1 : 1;
} | [
"public",
"static",
"function",
"compareInstancesByStartTime",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"start_a",
"=",
"$",
"a",
"->",
"getStartTimestamp",
"(",
")",
";",
"$",
"start_b",
"=",
"$",
"b",
"->",
"getStartTimestamp",
"(",
")",
";",
"if... | Compares two event instances by start time
@param EventInstance $a Instance
@param EventInstance $b Instance
@return int | [
"Compares",
"two",
"event",
"instances",
"by",
"start",
"time"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Calendar.php#L174-L181 |
13,797 | arckinteractive/events_api | classes/Events/API/Calendar.php | Calendar.getRecurringEvents | public function getRecurringEvents($starttime = null, $endtime = null) {
if (is_null($starttime)) {
$starttime = time();
}
if (is_null($endtime)) {
$endtime = strtotime('+1 year', $starttime);
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
$relationship_name = sanitize... | php | public function getRecurringEvents($starttime = null, $endtime = null) {
if (is_null($starttime)) {
$starttime = time();
}
if (is_null($endtime)) {
$endtime = strtotime('+1 year', $starttime);
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
$relationship_name = sanitize... | [
"public",
"function",
"getRecurringEvents",
"(",
"$",
"starttime",
"=",
"null",
",",
"$",
"endtime",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"starttime",
")",
")",
"{",
"$",
"starttime",
"=",
"time",
"(",
")",
";",
"}",
"if",
"(",
"i... | Returns a batch of recurring events in a given time range
@param int $starttime Time range start, default: now
@param int $endtime Time range end, default: 1 year from start time
@return array | [
"Returns",
"a",
"batch",
"of",
"recurring",
"events",
"in",
"a",
"given",
"time",
"range"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Calendar.php#L190-L245 |
13,798 | arckinteractive/events_api | classes/Events/API/Calendar.php | Calendar.getOneTimeEvents | public function getOneTimeEvents($starttime = null, $endtime = null) {
if (is_null($starttime)) {
$starttime = time();
}
if (is_null($endtime)) {
$endtime = strtotime('+1 year', $starttime);
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
$relationship_name = sanitize_s... | php | public function getOneTimeEvents($starttime = null, $endtime = null) {
if (is_null($starttime)) {
$starttime = time();
}
if (is_null($endtime)) {
$endtime = strtotime('+1 year', $starttime);
}
$starttime = sanitize_int($starttime);
$endtime = sanitize_int($endtime);
$relationship_name = sanitize_s... | [
"public",
"function",
"getOneTimeEvents",
"(",
"$",
"starttime",
"=",
"null",
",",
"$",
"endtime",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"starttime",
")",
")",
"{",
"$",
"starttime",
"=",
"time",
"(",
")",
";",
"}",
"if",
"(",
"is_... | Returns one-time events
@param int $starttime Time range start, default: now
@param int $endtime Time range end, default: 1 year from start time
@return ElggBatch | [
"Returns",
"one",
"-",
"time",
"events"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Calendar.php#L254-L297 |
13,799 | arckinteractive/events_api | classes/Events/API/Calendar.php | Calendar.hasEvent | public function hasEvent($event) {
return (bool) check_entity_relationship($event->guid, self::EVENT_CALENDAR_RELATIONSHIP, $this->guid);
} | php | public function hasEvent($event) {
return (bool) check_entity_relationship($event->guid, self::EVENT_CALENDAR_RELATIONSHIP, $this->guid);
} | [
"public",
"function",
"hasEvent",
"(",
"$",
"event",
")",
"{",
"return",
"(",
"bool",
")",
"check_entity_relationship",
"(",
"$",
"event",
"->",
"guid",
",",
"self",
"::",
"EVENT_CALENDAR_RELATIONSHIP",
",",
"$",
"this",
"->",
"guid",
")",
";",
"}"
] | Checks if the event is on calendar
@param Event $event Event
@return bool | [
"Checks",
"if",
"the",
"event",
"is",
"on",
"calendar"
] | 56c0f0ae403af1672a913db5dc259db9cb712491 | https://github.com/arckinteractive/events_api/blob/56c0f0ae403af1672a913db5dc259db9cb712491/classes/Events/API/Calendar.php#L316-L318 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.