repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
joomla-projects/jorobo | src/Tasks/Build/Extension.php | Extension.run | public function run()
{
$this->say('Building Extension package');
$this->analyze();
// Build component
if ($this->hasComponent)
{
$this->buildComponent($this->params)->run();
}
// Modules
if ($this->hasModules)
{
$path = $this->getSourceFolder() . "/modules";
// Get every module
$hdl ... | php | public function run()
{
$this->say('Building Extension package');
$this->analyze();
// Build component
if ($this->hasComponent)
{
$this->buildComponent($this->params)->run();
}
// Modules
if ($this->hasModules)
{
$path = $this->getSourceFolder() . "/modules";
// Get every module
$hdl ... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"'Building Extension package'",
")",
";",
"$",
"this",
"->",
"analyze",
"(",
")",
";",
"// Build component",
"if",
"(",
"$",
"this",
"->",
"hasComponent",
")",
"{",
"$",
"this",
... | Build the package
@return bool
@since 1.0 | [
"Build",
"the",
"package"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Extension.php#L84-L298 |
joomla-projects/jorobo | src/Tasks/Build/Extension.php | Extension.analyze | private function analyze()
{
// Check if we have component, module, plugin etc.
if (!file_exists($this->getSourceFolder() . "/administrator/components/com_" . $this->getExtensionName())
&& !file_exists($this->getSourceFolder() . "/components/com_" . $this->getExtensionName()))
{
$this->say("Extension has n... | php | private function analyze()
{
// Check if we have component, module, plugin etc.
if (!file_exists($this->getSourceFolder() . "/administrator/components/com_" . $this->getExtensionName())
&& !file_exists($this->getSourceFolder() . "/components/com_" . $this->getExtensionName()))
{
$this->say("Extension has n... | [
"private",
"function",
"analyze",
"(",
")",
"{",
"// Check if we have component, module, plugin etc.",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"getSourceFolder",
"(",
")",
".",
"\"/administrator/components/com_\"",
".",
"$",
"this",
"->",
"getExtensionN... | Analyze the extension structure
@return void
@since 1.0 | [
"Analyze",
"the",
"extension",
"structure"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Extension.php#L307-L346 |
incraigulous/contentful-sdk | src/PayloadBuilders/ContentTypeField.php | ContentTypeField.make | function make()
{
$result = [
'id' => $this->id,
'name' => $this->name,
'type' => $this->type
];
if ($this->linkType) $result['linkType'] = $this->linkType;
if ($this->items) $result['items'] = $this->items;
if ($this->required) $result['re... | php | function make()
{
$result = [
'id' => $this->id,
'name' => $this->name,
'type' => $this->type
];
if ($this->linkType) $result['linkType'] = $this->linkType;
if ($this->items) $result['items'] = $this->items;
if ($this->required) $result['re... | [
"function",
"make",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'name'",
"=>",
"$",
"this",
"->",
"name",
",",
"'type'",
"=>",
"$",
"this",
"->",
"type",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"linkType... | Return the payload builder array part.
@return array | [
"Return",
"the",
"payload",
"builder",
"array",
"part",
"."
] | train | https://github.com/incraigulous/contentful-sdk/blob/29399b11b0e085a06ea5976661378c379fe5a731/src/PayloadBuilders/ContentTypeField.php#L71-L84 |
PandaPlatform/framework | src/Panda/Support/Helpers/UrlHelper.php | UrlHelper.get | public static function get($url, $parameters = [], $host = null, $protocol = null)
{
// Check url arguments
if (empty($url)) {
throw new InvalidArgumentException(__METHOD__ . ': The given url is empty.');
}
// Get current url info
$urlInfo = static::info($url);
... | php | public static function get($url, $parameters = [], $host = null, $protocol = null)
{
// Check url arguments
if (empty($url)) {
throw new InvalidArgumentException(__METHOD__ . ': The given url is empty.');
}
// Get current url info
$urlInfo = static::info($url);
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"host",
"=",
"null",
",",
"$",
"protocol",
"=",
"null",
")",
"{",
"// Check url arguments",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"{",... | Creates and returns a url with parameters in url encoding.
@param string $url The base url.
@param array $parameters An associative array of parameters as key => value.
@param string $host
@param string $protocol
@return string
@throws InvalidArgumentException | [
"Creates",
"and",
"returns",
"a",
"url",
"with",
"parameters",
"in",
"url",
"encoding",
"."
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Helpers/UrlHelper.php#L33-L58 |
PandaPlatform/framework | src/Panda/Support/Helpers/UrlHelper.php | UrlHelper.getDomain | public static function getDomain($url)
{
$urlInfo = static::info($url);
return ArrayHelper::get($urlInfo, 'domain', null, true);
} | php | public static function getDomain($url)
{
$urlInfo = static::info($url);
return ArrayHelper::get($urlInfo, 'domain', null, true);
} | [
"public",
"static",
"function",
"getDomain",
"(",
"$",
"url",
")",
"{",
"$",
"urlInfo",
"=",
"static",
"::",
"info",
"(",
"$",
"url",
")",
";",
"return",
"ArrayHelper",
"::",
"get",
"(",
"$",
"urlInfo",
",",
"'domain'",
",",
"null",
",",
"true",
")",... | @param string $url
@return string|null
@throws InvalidArgumentException | [
"@param",
"string",
"$url"
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Helpers/UrlHelper.php#L77-L82 |
PandaPlatform/framework | src/Panda/Support/Helpers/UrlHelper.php | UrlHelper.getSubDomain | public static function getSubDomain($url)
{
$urlInfo = static::info($url);
return ArrayHelper::get($urlInfo, 'sub', null, true);
} | php | public static function getSubDomain($url)
{
$urlInfo = static::info($url);
return ArrayHelper::get($urlInfo, 'sub', null, true);
} | [
"public",
"static",
"function",
"getSubDomain",
"(",
"$",
"url",
")",
"{",
"$",
"urlInfo",
"=",
"static",
"::",
"info",
"(",
"$",
"url",
")",
";",
"return",
"ArrayHelper",
"::",
"get",
"(",
"$",
"urlInfo",
",",
"'sub'",
",",
"null",
",",
"true",
")",... | @param string $url
@return string|null
@throws InvalidArgumentException | [
"@param",
"string",
"$url"
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Helpers/UrlHelper.php#L90-L95 |
PandaPlatform/framework | src/Panda/Support/Helpers/UrlHelper.php | UrlHelper.getProtocol | public static function getProtocol($url)
{
$urlInfo = static::info($url);
return ArrayHelper::get($urlInfo, 'protocol', null, true);
} | php | public static function getProtocol($url)
{
$urlInfo = static::info($url);
return ArrayHelper::get($urlInfo, 'protocol', null, true);
} | [
"public",
"static",
"function",
"getProtocol",
"(",
"$",
"url",
")",
"{",
"$",
"urlInfo",
"=",
"static",
"::",
"info",
"(",
"$",
"url",
")",
";",
"return",
"ArrayHelper",
"::",
"get",
"(",
"$",
"urlInfo",
",",
"'protocol'",
",",
"null",
",",
"true",
... | @param string $url
@return string|null
@throws InvalidArgumentException | [
"@param",
"string",
"$url"
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Helpers/UrlHelper.php#L103-L108 |
PandaPlatform/framework | src/Panda/Support/Helpers/UrlHelper.php | UrlHelper.getPath | public static function getPath($url, $withParameters = false)
{
$urlInfo = static::info($url);
return $withParameters ? ArrayHelper::get($urlInfo, 'path.with_parameters', null, true) : ArrayHelper::get($urlInfo, 'path.plain', null, true);
} | php | public static function getPath($url, $withParameters = false)
{
$urlInfo = static::info($url);
return $withParameters ? ArrayHelper::get($urlInfo, 'path.with_parameters', null, true) : ArrayHelper::get($urlInfo, 'path.plain', null, true);
} | [
"public",
"static",
"function",
"getPath",
"(",
"$",
"url",
",",
"$",
"withParameters",
"=",
"false",
")",
"{",
"$",
"urlInfo",
"=",
"static",
"::",
"info",
"(",
"$",
"url",
")",
";",
"return",
"$",
"withParameters",
"?",
"ArrayHelper",
"::",
"get",
"(... | @param string $url
@param bool $withParameters
@return string|null
@throws InvalidArgumentException | [
"@param",
"string",
"$url",
"@param",
"bool",
"$withParameters"
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Helpers/UrlHelper.php#L117-L122 |
PandaPlatform/framework | src/Panda/Support/Helpers/UrlHelper.php | UrlHelper.info | public static function info($url, $domain = '')
{
// Initialize url info array
$info = [];
// If no given url, get current
if (empty($url)) {
throw new InvalidArgumentException(__METHOD__ . ': The given url is empty.');
}
// Get protocol
$protoco... | php | public static function info($url, $domain = '')
{
// Initialize url info array
$info = [];
// If no given url, get current
if (empty($url)) {
throw new InvalidArgumentException(__METHOD__ . ': The given url is empty.');
}
// Get protocol
$protoco... | [
"public",
"static",
"function",
"info",
"(",
"$",
"url",
",",
"$",
"domain",
"=",
"''",
")",
"{",
"// Initialize url info array",
"$",
"info",
"=",
"[",
"]",
";",
"// If no given url, get current",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"{",
"thr... | Gets the info of the url in an array.
@param string $url The url to get the information from.
@param string $domain The url domain. This is given to distinguish the sub-domains on the front.
@return array The url info as follows:
['referrer'] = The referrer value, if exists.
['origin'] = The host origin value, if ... | [
"Gets",
"the",
"info",
"of",
"the",
"url",
"in",
"an",
"array",
"."
] | train | https://github.com/PandaPlatform/framework/blob/a78cf051b379896b5a4d5df620988e37a0e632f5/src/Panda/Support/Helpers/UrlHelper.php#L145-L230 |
joomla-projects/jorobo | src/Tasks/Generate/Module.php | Module.run | public function run()
{
$this->say('Building component');
// Analyize extension structure
$this->analyze();
// Prepare directories
$this->prepareDirectories();
if ($this->hasAdmin)
{
$adminFiles = $this->copyTarget($this->adminPath, $this->getBuildFolder() . "/administrator/components/com_" . $this... | php | public function run()
{
$this->say('Building component');
// Analyize extension structure
$this->analyze();
// Prepare directories
$this->prepareDirectories();
if ($this->hasAdmin)
{
$adminFiles = $this->copyTarget($this->adminPath, $this->getBuildFolder() . "/administrator/components/com_" . $this... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"say",
"(",
"'Building component'",
")",
";",
"// Analyize extension structure",
"$",
"this",
"->",
"analyze",
"(",
")",
";",
"// Prepare directories",
"$",
"this",
"->",
"prepareDirectories",
"(",
... | Build the package
@return bool
@since 1.0 | [
"Build",
"the",
"package"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Generate/Module.php#L58-L92 |
joomla-projects/jorobo | src/Tasks/Generate/Module.php | Module.analyze | private function analyze()
{
if (!file_exists($this->adminPath))
{
$this->hasAdmin = false;
}
if (!file_exists($this->frontPath))
{
$this->hasFront = false;
}
} | php | private function analyze()
{
if (!file_exists($this->adminPath))
{
$this->hasAdmin = false;
}
if (!file_exists($this->frontPath))
{
$this->hasFront = false;
}
} | [
"private",
"function",
"analyze",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"adminPath",
")",
")",
"{",
"$",
"this",
"->",
"hasAdmin",
"=",
"false",
";",
"}",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"front... | Analyze the component structure
@return void
@since 1.0 | [
"Analyze",
"the",
"component",
"structure"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Generate/Module.php#L101-L112 |
joomla-projects/jorobo | src/Tasks/Generate/Module.php | Module.prepareDirectories | private function prepareDirectories()
{
if ($this->hasAdmin)
{
$this->_mkdir($this->getBuildFolder() . "/administrator/components/com_" . $this->getExtensionName());
}
if ($this->hasFront)
{
$this->_mkdir($this->getBuildFolder() . "/components/com_" . $this->getExtensionName());
}
} | php | private function prepareDirectories()
{
if ($this->hasAdmin)
{
$this->_mkdir($this->getBuildFolder() . "/administrator/components/com_" . $this->getExtensionName());
}
if ($this->hasFront)
{
$this->_mkdir($this->getBuildFolder() . "/components/com_" . $this->getExtensionName());
}
} | [
"private",
"function",
"prepareDirectories",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasAdmin",
")",
"{",
"$",
"this",
"->",
"_mkdir",
"(",
"$",
"this",
"->",
"getBuildFolder",
"(",
")",
".",
"\"/administrator/components/com_\"",
".",
"$",
"this",
"-... | Prepare the directory structure
@return void
@since 1.0 | [
"Prepare",
"the",
"directory",
"structure"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Generate/Module.php#L121-L132 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.addFiles | public function addFiles($type, $fileArray)
{
$method = 'add' . ucfirst($type) . "Files";
if (method_exists($this, $method))
{
$this->$method($fileArray);
}
else
{
$this->say('Missing method: ' . $method);
}
return true;
} | php | public function addFiles($type, $fileArray)
{
$method = 'add' . ucfirst($type) . "Files";
if (method_exists($this, $method))
{
$this->$method($fileArray);
}
else
{
$this->say('Missing method: ' . $method);
}
return true;
} | [
"public",
"function",
"addFiles",
"(",
"$",
"type",
",",
"$",
"fileArray",
")",
"{",
"$",
"method",
"=",
"'add'",
".",
"ucfirst",
"(",
"$",
"type",
")",
".",
"\"Files\"",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
"... | Add files to array
@param string $type - Type (media, component etc.)
@param array $fileArray - File array
@return bool
@since 1.0 | [
"Add",
"files",
"to",
"array"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L116-L130 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.getFiles | public function getFiles($type)
{
$f = $type . 'Files';
if (property_exists($this, $f))
{
return self::${$f};
}
$this->say('Missing Files: ' . $type);
return "";
} | php | public function getFiles($type)
{
$f = $type . 'Files';
if (property_exists($this, $f))
{
return self::${$f};
}
$this->say('Missing Files: ' . $type);
return "";
} | [
"public",
"function",
"getFiles",
"(",
"$",
"type",
")",
"{",
"$",
"f",
"=",
"$",
"type",
".",
"'Files'",
";",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"f",
")",
")",
"{",
"return",
"self",
"::",
"$",
"{",
"$",
"f",
"}",
";",
... | Retrieve the files
@param string $type Type (media, component etc.)
@return mixed
@since 1.0 | [
"Retrieve",
"the",
"files"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L141-L153 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.copyTarget | protected function copyTarget($path, $tar)
{
$map = array();
$hdl = opendir($path);
while ($entry = readdir($hdl))
{
$p = $path . "/" . $entry;
// Ignore hidden files
if (substr($entry, 0, 1) != '.')
{
if (isset($this->getJConfig()->exclude)
&& in_array($entry, explode(',', $this->getJCo... | php | protected function copyTarget($path, $tar)
{
$map = array();
$hdl = opendir($path);
while ($entry = readdir($hdl))
{
$p = $path . "/" . $entry;
// Ignore hidden files
if (substr($entry, 0, 1) != '.')
{
if (isset($this->getJConfig()->exclude)
&& in_array($entry, explode(',', $this->getJCo... | [
"protected",
"function",
"copyTarget",
"(",
"$",
"path",
",",
"$",
"tar",
")",
"{",
"$",
"map",
"=",
"array",
"(",
")",
";",
"$",
"hdl",
"=",
"opendir",
"(",
"$",
"path",
")",
";",
"while",
"(",
"$",
"entry",
"=",
"readdir",
"(",
"$",
"hdl",
")... | Copies the files and maps them into an array
@param string $path - Folder path
@param string $tar - Target path
@return array
@since 1.0 | [
"Copies",
"the",
"files",
"and",
"maps",
"them",
"into",
"an",
"array"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L236-L270 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.generateFileList | public function generateFileList($files)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $type => $value)
{
$text[] = "<" . $type . ">" . $value . "</" . $type . ">";
}
}
return implode("\n", $text);
} | php | public function generateFileList($files)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $type => $value)
{
$text[] = "<" . $type . ">" . $value . "</" . $type . ">";
}
}
return implode("\n", $text);
} | [
"public",
"function",
"generateFileList",
"(",
"$",
"files",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"files",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"$",
"text",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"f",
... | Generate a list of files
@param array $files Files and Folders array
@return string
@since 1.0 | [
"Generate",
"a",
"list",
"of",
"files"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L319-L337 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.generateLanguageFileList | public function generateLanguageFileList($files)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $tag => $value)
{
$text[] = '<language tag="' . $tag . '">' . $tag . "/" . $value . "</language>";
}
}
return implode("\n", $text);
} | php | public function generateLanguageFileList($files)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $tag => $value)
{
$text[] = '<language tag="' . $tag . '">' . $tag . "/" . $value . "</language>";
}
}
return implode("\n", $text);
} | [
"public",
"function",
"generateLanguageFileList",
"(",
"$",
"files",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"files",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"$",
"text",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",... | Generate a list of files
@param array $files Files and Folders array
@return string
@since 1.0 | [
"Generate",
"a",
"list",
"of",
"files"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L349-L367 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.generatePluginFileList | public function generatePluginFileList($files, $plugin)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $type => $value)
{
$p = "";
if ($value == $plugin . ".php")
{
$p = ' plugin="' . $plugin . '"';
}
$text[] = "<" . $typ... | php | public function generatePluginFileList($files, $plugin)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $type => $value)
{
$p = "";
if ($value == $plugin . ".php")
{
$p = ' plugin="' . $plugin . '"';
}
$text[] = "<" . $typ... | [
"public",
"function",
"generatePluginFileList",
"(",
"$",
"files",
",",
"$",
"plugin",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"files",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"$",
"text",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
... | Generate a list of files for plugins
@param array $files Files and Folders array
@param string $plugin The plugin file
@return string
@since 1.0 | [
"Generate",
"a",
"list",
"of",
"files",
"for",
"plugins"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L379-L405 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.generateModuleFileList | public function generateModuleFileList($files, $module)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $type => $value)
{
$p = "";
if ($value == $module . ".php")
{
$p = ' module="' . $module . '"';
}
$text[] = "<" . $typ... | php | public function generateModuleFileList($files, $module)
{
if (!count($files))
{
return "";
}
$text = array();
foreach ($files as $f)
{
foreach ($f as $type => $value)
{
$p = "";
if ($value == $module . ".php")
{
$p = ' module="' . $module . '"';
}
$text[] = "<" . $typ... | [
"public",
"function",
"generateModuleFileList",
"(",
"$",
"files",
",",
"$",
"module",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"files",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"$",
"text",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
... | Generate a list of files for modules
@param array $files Files and Folders array
@param string $module The module
@return string
@since 1.0 | [
"Generate",
"a",
"list",
"of",
"files",
"for",
"modules"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L417-L443 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.resetFiles | public function resetFiles()
{
self::$backendFiles = array();
self::$backendLanguageFiles = array();
self::$frontendFiles = array();
self::$frontendLanguageFiles = array();
self::$mediaFiles = array();
} | php | public function resetFiles()
{
self::$backendFiles = array();
self::$backendLanguageFiles = array();
self::$frontendFiles = array();
self::$frontendLanguageFiles = array();
self::$mediaFiles = array();
} | [
"public",
"function",
"resetFiles",
"(",
")",
"{",
"self",
"::",
"$",
"backendFiles",
"=",
"array",
"(",
")",
";",
"self",
"::",
"$",
"backendLanguageFiles",
"=",
"array",
"(",
")",
";",
"self",
"::",
"$",
"frontendFiles",
"=",
"array",
"(",
")",
";",
... | Reset the files list, before build another part
@return void
@since 1.0 | [
"Reset",
"the",
"files",
"list",
"before",
"build",
"another",
"part"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L452-L459 |
joomla-projects/jorobo | src/Tasks/Build/Base.php | Base.replaceInFile | protected function replaceInFile($file)
{
if (!file_exists($file))
{
return;
}
$this->taskReplaceInFile($file)
->from(array('##DATE##', '##YEAR##', '##VERSION##'))
->to(array($this->getDate(), date('Y'), $this->getJConfig()->version))
->run();
} | php | protected function replaceInFile($file)
{
if (!file_exists($file))
{
return;
}
$this->taskReplaceInFile($file)
->from(array('##DATE##', '##YEAR##', '##VERSION##'))
->to(array($this->getDate(), date('Y'), $this->getJConfig()->version))
->run();
} | [
"protected",
"function",
"replaceInFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"taskReplaceInFile",
"(",
"$",
"file",
")",
"->",
"from",
"(",
"array",
"(",
... | Replace Basic placeholders in file (Date, year, version)
@param string $file - Path to file
@return void
@since 1.0 | [
"Replace",
"Basic",
"placeholders",
"in",
"file",
"(",
"Date",
"year",
"version",
")"
] | train | https://github.com/joomla-projects/jorobo/blob/e72dd0ed15f387739f67cacdbc2c0bd1b427f317/src/Tasks/Build/Base.php#L471-L482 |
yidas/php-google-api-client-helper | src/services/People.php | People.findByResource | public static function findByResource($resourceName, $optParams=[])
{
$optParams = ($optParams) ? $optParams : [
'personFields' => self::$personFields,
];
self::$person = self::getService()->people->get($resourceName, $optParams);
self::$resource... | php | public static function findByResource($resourceName, $optParams=[])
{
$optParams = ($optParams) ? $optParams : [
'personFields' => self::$personFields,
];
self::$person = self::getService()->people->get($resourceName, $optParams);
self::$resource... | [
"public",
"static",
"function",
"findByResource",
"(",
"$",
"resourceName",
",",
"$",
"optParams",
"=",
"[",
"]",
")",
"{",
"$",
"optParams",
"=",
"(",
"$",
"optParams",
")",
"?",
"$",
"optParams",
":",
"[",
"'personFields'",
"=>",
"self",
"::",
"$",
"... | find a contact to cache
@param string $resourceName The resource name of the contact.
@param array $optParams
@return self | [
"find",
"a",
"contact",
"to",
"cache"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L160-L171 |
yidas/php-google-api-client-helper | src/services/People.php | People.listPeopleConnections | public static function listPeopleConnections($optParams=[])
{
$optParams = ($optParams) ? $optParams : [
'pageSize' => 0,
'personFields' => self::$personFields,
];
return self::getService()->people_connections->listPeopleConnections('people/me', $optParams);
... | php | public static function listPeopleConnections($optParams=[])
{
$optParams = ($optParams) ? $optParams : [
'pageSize' => 0,
'personFields' => self::$personFields,
];
return self::getService()->people_connections->listPeopleConnections('people/me', $optParams);
... | [
"public",
"static",
"function",
"listPeopleConnections",
"(",
"$",
"optParams",
"=",
"[",
"]",
")",
"{",
"$",
"optParams",
"=",
"(",
"$",
"optParams",
")",
"?",
"$",
"optParams",
":",
"[",
"'pageSize'",
"=>",
"0",
",",
"'personFields'",
"=>",
"self",
"::... | list People Connections
@param array $optParams
@return object Google listPeopleConnections() | [
"list",
"People",
"Connections"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L179-L187 |
yidas/php-google-api-client-helper | src/services/People.php | People.getSimpleContacts | public static function getSimpleContacts()
{
$contactObj = self::listPeopleConnections();
// Parser
$contacts = [];
if (count($contactObj->getConnections()) != 0) {
foreach ($contactObj->getConnections() as $person) {
... | php | public static function getSimpleContacts()
{
$contactObj = self::listPeopleConnections();
// Parser
$contacts = [];
if (count($contactObj->getConnections()) != 0) {
foreach ($contactObj->getConnections() as $person) {
... | [
"public",
"static",
"function",
"getSimpleContacts",
"(",
")",
"{",
"$",
"contactObj",
"=",
"self",
"::",
"listPeopleConnections",
"(",
")",
";",
"// Parser\r",
"$",
"contacts",
"=",
"[",
"]",
";",
"if",
"(",
"count",
"(",
"$",
"contactObj",
"->",
"getConn... | Get simple contact data with parser
@return array Contacts | [
"Get",
"simple",
"contact",
"data",
"with",
"parser"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L194-L224 |
yidas/php-google-api-client-helper | src/services/People.php | People.createContact | public static function createContact()
{
$person = self::getPerson();
// New person check
if (isset($person->resourceName)) {
throw new Exception("You should use newPeron() before create", 500);
}
return self::getService()->people->createContact... | php | public static function createContact()
{
$person = self::getPerson();
// New person check
if (isset($person->resourceName)) {
throw new Exception("You should use newPeron() before create", 500);
}
return self::getService()->people->createContact... | [
"public",
"static",
"function",
"createContact",
"(",
")",
"{",
"$",
"person",
"=",
"self",
"::",
"getPerson",
"(",
")",
";",
"// New person check\r",
"if",
"(",
"isset",
"(",
"$",
"person",
"->",
"resourceName",
")",
")",
"{",
"throw",
"new",
"Exception",... | Create a People Contact
@return Google_Service_PeopleService_Person | [
"Create",
"a",
"People",
"Contact"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L231-L241 |
yidas/php-google-api-client-helper | src/services/People.php | People.updateContact | public static function updateContact($optParams=null)
{
self::checkFind();
// Default opt helper
$optParams = (is_null($optParams))
? ['updatePersonFields' => self::$personFields]
: $optParams;
return self::getService()->people->upd... | php | public static function updateContact($optParams=null)
{
self::checkFind();
// Default opt helper
$optParams = (is_null($optParams))
? ['updatePersonFields' => self::$personFields]
: $optParams;
return self::getService()->people->upd... | [
"public",
"static",
"function",
"updateContact",
"(",
"$",
"optParams",
"=",
"null",
")",
"{",
"self",
"::",
"checkFind",
"(",
")",
";",
"// Default opt helper\r",
"$",
"optParams",
"=",
"(",
"is_null",
"(",
"$",
"optParams",
")",
")",
"?",
"[",
"'updatePe... | Update a People Contact
@param array $optParams Optional parameters.
@return Google_Service_PeopleService_PeopleEmpty | [
"Update",
"a",
"People",
"Contact"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L249-L259 |
yidas/php-google-api-client-helper | src/services/People.php | People.deleteContact | public static function deleteContact($resourceName=null, $optParams=[])
{
if (!$resourceName) {
self::checkFind();
$resourceName = self::$resourceName;
}
return self::getService()->people->deleteContact($resourceName, $optParams);
} | php | public static function deleteContact($resourceName=null, $optParams=[])
{
if (!$resourceName) {
self::checkFind();
$resourceName = self::$resourceName;
}
return self::getService()->people->deleteContact($resourceName, $optParams);
} | [
"public",
"static",
"function",
"deleteContact",
"(",
"$",
"resourceName",
"=",
"null",
",",
"$",
"optParams",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"resourceName",
")",
"{",
"self",
"::",
"checkFind",
"(",
")",
";",
"$",
"resourceName",
"=",
... | Delete a People Contact
(people.deleteContact)
@param string $resourceName The resource name of the contact to delete.
@param array $optParams Optional parameters.
@return Google_Service_PeopleService_PeopleEmpty | [
"Delete",
"a",
"People",
"Contact",
"(",
"people",
".",
"deleteContact",
")"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L269-L279 |
yidas/php-google-api-client-helper | src/services/People.php | People.setNames | public static function setNames($input='')
{
// Skip common method parameter
if (is_object($input) || is_array($input)) {
return self::__callStatic($name, [$input]);
}
// Name format helper
$gName = new Google_Service_PeopleService_Name;
... | php | public static function setNames($input='')
{
// Skip common method parameter
if (is_object($input) || is_array($input)) {
return self::__callStatic($name, [$input]);
}
// Name format helper
$gName = new Google_Service_PeopleService_Name;
... | [
"public",
"static",
"function",
"setNames",
"(",
"$",
"input",
"=",
"''",
")",
"{",
"// Skip common method parameter\r",
"if",
"(",
"is_object",
"(",
"$",
"input",
")",
"||",
"is_array",
"(",
"$",
"input",
")",
")",
"{",
"return",
"self",
"::",
"__callStat... | Set Names
@param string|array Simple name or name options
@return self | [
"Set",
"Names"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L287-L301 |
yidas/php-google-api-client-helper | src/services/People.php | People.setBirthdays | public static function setBirthdays($input='')
{
// Skip common method parameter
if (is_object($input) || is_array($input)) {
return self::__callStatic($name, [$input]);
}
// Date format helper
$gDate = new Google_Service_PeopleService_Date;
$i... | php | public static function setBirthdays($input='')
{
// Skip common method parameter
if (is_object($input) || is_array($input)) {
return self::__callStatic($name, [$input]);
}
// Date format helper
$gDate = new Google_Service_PeopleService_Date;
$i... | [
"public",
"static",
"function",
"setBirthdays",
"(",
"$",
"input",
"=",
"''",
")",
"{",
"// Skip common method parameter\r",
"if",
"(",
"is_object",
"(",
"$",
"input",
")",
"||",
"is_array",
"(",
"$",
"input",
")",
")",
"{",
"return",
"self",
"::",
"__call... | Set Birthdays
Suck text recognizing, help by set date.
@param string|array|object Date text string support
@return self
@example For string type
setBirthdays('1989-01-30') | [
"Set",
"Birthdays"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L313-L335 |
yidas/php-google-api-client-helper | src/services/People.php | People.listContactGroups | public static function listContactGroups($optParams=[])
{
$contactGroup = self::getService()->contactGroups->listContactGroups();
if (!$contactGroup) {
return $contactGroup;
}
return json_decode(json_encode($contactGroup->contactGroups), true);
} | php | public static function listContactGroups($optParams=[])
{
$contactGroup = self::getService()->contactGroups->listContactGroups();
if (!$contactGroup) {
return $contactGroup;
}
return json_decode(json_encode($contactGroup->contactGroups), true);
} | [
"public",
"static",
"function",
"listContactGroups",
"(",
"$",
"optParams",
"=",
"[",
"]",
")",
"{",
"$",
"contactGroup",
"=",
"self",
"::",
"getService",
"(",
")",
"->",
"contactGroups",
"->",
"listContactGroups",
"(",
")",
";",
"if",
"(",
"!",
"$",
"co... | List all contact groups owned by the authenticated user. Members of the
contact groups are not populated. (contactGroups.listContactGroups)
@param array $optParams Optional parameters.
@opt_param int pageSize The maximum number of resources to return.
@opt_param string syncToken A sync token, returned by a previous c... | [
"List",
"all",
"contact",
"groups",
"owned",
"by",
"the",
"authenticated",
"user",
".",
"Members",
"of",
"the",
"contact",
"groups",
"are",
"not",
"populated",
".",
"(",
"contactGroups",
".",
"listContactGroups",
")"
] | train | https://github.com/yidas/php-google-api-client-helper/blob/e0edfebc41fb4e55bcf4125af58304894a2863fe/src/services/People.php#L420-L429 |
DevGroup-ru/yii2-data-structure-tools | src/models/StaticValue.php | StaticValue.beforeSave | public function beforeSave($insert)
{
if (!$this->sort_order) {
$property = Property::findById($this->property_id);
$this->sort_order = count(static::valuesForProperty($property));
}
return parent::beforeSave($insert);
} | php | public function beforeSave($insert)
{
if (!$this->sort_order) {
$property = Property::findById($this->property_id);
$this->sort_order = count(static::valuesForProperty($property));
}
return parent::beforeSave($insert);
} | [
"public",
"function",
"beforeSave",
"(",
"$",
"insert",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"sort_order",
")",
"{",
"$",
"property",
"=",
"Property",
"::",
"findById",
"(",
"$",
"this",
"->",
"property_id",
")",
";",
"$",
"this",
"->",
"sort... | Performs beforeSave event
@param bool $insert
@return bool | [
"Performs",
"beforeSave",
"event"
] | train | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/models/StaticValue.php#L127-L134 |
DevGroup-ru/yii2-data-structure-tools | src/models/StaticValue.php | StaticValue.valuesForProperty | public static function valuesForProperty(Property $property)
{
$propertyId = $property->id;
$table = static::tableName();
$translationsTable = StaticValueTranslation::tableName();
$db = static::getDb();
$languageId = Yii::$app->multilingual->language_id;
if (!isset(... | php | public static function valuesForProperty(Property $property)
{
$propertyId = $property->id;
$table = static::tableName();
$translationsTable = StaticValueTranslation::tableName();
$db = static::getDb();
$languageId = Yii::$app->multilingual->language_id;
if (!isset(... | [
"public",
"static",
"function",
"valuesForProperty",
"(",
"Property",
"$",
"property",
")",
"{",
"$",
"propertyId",
"=",
"$",
"property",
"->",
"id",
";",
"$",
"table",
"=",
"static",
"::",
"tableName",
"(",
")",
";",
"$",
"translationsTable",
"=",
"Static... | Returns array of possible values for property.
Array consists of arrays with elements: name, description, slug and key is static_value.id
@param \DevGroup\DataStructure\models\Property $property
@return array | [
"Returns",
"array",
"of",
"possible",
"values",
"for",
"property",
".",
"Array",
"consists",
"of",
"arrays",
"with",
"elements",
":",
"name",
"description",
"slug",
"and",
"key",
"is",
"static_value",
".",
"id"
] | train | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/models/StaticValue.php#L144-L193 |
DevGroup-ru/yii2-data-structure-tools | src/models/StaticValue.php | StaticValue.search | public function search($propertyId = null, $params = [], $showHidden = false)
{
$query = self::find();
if ($propertyId !== null) {
$query->where(['property_id' => $propertyId]);
}
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagin... | php | public function search($propertyId = null, $params = [], $showHidden = false)
{
$query = self::find();
if ($propertyId !== null) {
$query->where(['property_id' => $propertyId]);
}
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagin... | [
"public",
"function",
"search",
"(",
"$",
"propertyId",
"=",
"null",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"showHidden",
"=",
"false",
")",
"{",
"$",
"query",
"=",
"self",
"::",
"find",
"(",
")",
";",
"if",
"(",
"$",
"propertyId",
"!==",
"... | @param int|null $propertyId
@param array $params
@return ActiveDataProvider
@codeCoverageIgnore | [
"@param",
"int|null",
"$propertyId",
"@param",
"array",
"$params"
] | train | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/models/StaticValue.php#L232-L272 |
mimmi20/Wurfl | src/Handlers/BotCrawlerTranscoderHandler.php | BotCrawlerTranscoderHandler.applyConclusiveMatch | public function applyConclusiveMatch($userAgent)
{
if (Utils::checkIfContains($userAgent, 'GoogleImageProxy')) {
return 'google_image_proxy';
}
if (Utils::checkIfStartsWith($userAgent, 'Mozilla')) {
$tolerance = Utils::firstCloseParen($userAgent);
} else {
... | php | public function applyConclusiveMatch($userAgent)
{
if (Utils::checkIfContains($userAgent, 'GoogleImageProxy')) {
return 'google_image_proxy';
}
if (Utils::checkIfStartsWith($userAgent, 'Mozilla')) {
$tolerance = Utils::firstCloseParen($userAgent);
} else {
... | [
"public",
"function",
"applyConclusiveMatch",
"(",
"$",
"userAgent",
")",
"{",
"if",
"(",
"Utils",
"::",
"checkIfContains",
"(",
"$",
"userAgent",
",",
"'GoogleImageProxy'",
")",
")",
"{",
"return",
"'google_image_proxy'",
";",
"}",
"if",
"(",
"Utils",
"::",
... | Attempt to find a conclusive match for the given $userAgent
@param string $userAgent
@return string Matching WURFL deviceID | [
"Attempt",
"to",
"find",
"a",
"conclusive",
"match",
"for",
"the",
"given",
"$userAgent"
] | train | https://github.com/mimmi20/Wurfl/blob/443ed0d73a0b9a21ebd0d6ddf1e32669b9de44ec/src/Handlers/BotCrawlerTranscoderHandler.php#L58-L71 |
DevGroup-ru/yii2-data-structure-tools | src/Properties/controllers/ManageController.php | ManageController.actions | public function actions()
{
return [
'add-model-property-group' => [
'class' => AddModelPropertyGroup::class,
],
'delete-model-property-group' => [
'class' => DeleteModelPropertyGroup::class,
],
'list-property-groups... | php | public function actions()
{
return [
'add-model-property-group' => [
'class' => AddModelPropertyGroup::class,
],
'delete-model-property-group' => [
'class' => DeleteModelPropertyGroup::class,
],
'list-property-groups... | [
"public",
"function",
"actions",
"(",
")",
"{",
"return",
"[",
"'add-model-property-group'",
"=>",
"[",
"'class'",
"=>",
"AddModelPropertyGroup",
"::",
"class",
",",
"]",
",",
"'delete-model-property-group'",
"=>",
"[",
"'class'",
"=>",
"DeleteModelPropertyGroup",
"... | This controller just uses actions in extension
@return array | [
"This",
"controller",
"just",
"uses",
"actions",
"in",
"extension"
] | train | https://github.com/DevGroup-ru/yii2-data-structure-tools/blob/a5b24d7c0b24d4b0d58cacd91ec7fd876e979097/src/Properties/controllers/ManageController.php#L107-L156 |
transfer-framework/transfer | src/Transfer/Adapter/CacheAdapter.php | CacheAdapter.receive | public function receive(Request $request)
{
if (is_callable($this->keyGeneratorCallback)) {
$key = call_user_func_array($this->keyGeneratorCallback, array($request));
} else {
$key = md5(serialize($request->getData()));
}
$item = $this->cachePool->getItem($ke... | php | public function receive(Request $request)
{
if (is_callable($this->keyGeneratorCallback)) {
$key = call_user_func_array($this->keyGeneratorCallback, array($request));
} else {
$key = md5(serialize($request->getData()));
}
$item = $this->cachePool->getItem($ke... | [
"public",
"function",
"receive",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"keyGeneratorCallback",
")",
")",
"{",
"$",
"key",
"=",
"call_user_func_array",
"(",
"$",
"this",
"->",
"keyGeneratorCallback",
",",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Adapter/CacheAdapter.php#L51-L82 |
Webiny/AnalyticsDb | src/Webiny/AnalyticsDb/AnalyticsDb.php | AnalyticsDb.setTimestamp | public function setTimestamp($unixTs)
{
$this->ts = strtotime(date('Y-m-d', $unixTs));
$this->month = date('n', $this->ts);
$this->year = date('Y', $this->ts);
$this->monthTs = strtotime(date('Y-m-01', $unixTs));
} | php | public function setTimestamp($unixTs)
{
$this->ts = strtotime(date('Y-m-d', $unixTs));
$this->month = date('n', $this->ts);
$this->year = date('Y', $this->ts);
$this->monthTs = strtotime(date('Y-m-01', $unixTs));
} | [
"public",
"function",
"setTimestamp",
"(",
"$",
"unixTs",
")",
"{",
"$",
"this",
"->",
"ts",
"=",
"strtotime",
"(",
"date",
"(",
"'Y-m-d'",
",",
"$",
"unixTs",
")",
")",
";",
"$",
"this",
"->",
"month",
"=",
"date",
"(",
"'n'",
",",
"$",
"this",
... | Set the timestamp which will be used to store the data.
By default current time is used.
@param int $unixTs | [
"Set",
"the",
"timestamp",
"which",
"will",
"be",
"used",
"to",
"store",
"the",
"data",
".",
"By",
"default",
"current",
"time",
"is",
"used",
"."
] | train | https://github.com/Webiny/AnalyticsDb/blob/e0b1e920643cd63071406520767243736004052e/src/Webiny/AnalyticsDb/AnalyticsDb.php#L65-L71 |
Webiny/AnalyticsDb | src/Webiny/AnalyticsDb/AnalyticsDb.php | AnalyticsDb.log | public function log($entity, $ref = 0, $increment = 1)
{
if (!preg_match('/^([A-z0-9\/\-\_]+)$/', $entity)) {
throw new AnalyticsDbException('Entity name can only contain ([A-z0-9\/\-]).');
}
if (!preg_match('/^([A-z0-9\/\-\_]+)$/', $ref)) {
throw new AnalyticsDbExce... | php | public function log($entity, $ref = 0, $increment = 1)
{
if (!preg_match('/^([A-z0-9\/\-\_]+)$/', $entity)) {
throw new AnalyticsDbException('Entity name can only contain ([A-z0-9\/\-]).');
}
if (!preg_match('/^([A-z0-9\/\-\_]+)$/', $ref)) {
throw new AnalyticsDbExce... | [
"public",
"function",
"log",
"(",
"$",
"entity",
",",
"$",
"ref",
"=",
"0",
",",
"$",
"increment",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^([A-z0-9\\/\\-\\_]+)$/'",
",",
"$",
"entity",
")",
")",
"{",
"throw",
"new",
"AnalyticsDbExcep... | Add a log to the buffer.
Note: the data is not saved until you call the save method.
@param string $entity Entity name.
@param int $ref
@param int $increment
@return LogEntry
@throws AnalyticsDbException | [
"Add",
"a",
"log",
"to",
"the",
"buffer",
".",
"Note",
":",
"the",
"data",
"is",
"not",
"saved",
"until",
"you",
"call",
"the",
"save",
"method",
"."
] | train | https://github.com/Webiny/AnalyticsDb/blob/e0b1e920643cd63071406520767243736004052e/src/Webiny/AnalyticsDb/AnalyticsDb.php#L99-L116 |
Webiny/AnalyticsDb | src/Webiny/AnalyticsDb/AnalyticsDb.php | AnalyticsDb.save | public function save()
{
$entries = $this->logBuffer->getEntries();
$entrySkeleton = [
'ts' => $this->ts,
'month' => $this->month,
'year' => $this->year
];
$dimensionSkeleton = [
'ts' => $this->ts,
'month' => $this-... | php | public function save()
{
$entries = $this->logBuffer->getEntries();
$entrySkeleton = [
'ts' => $this->ts,
'month' => $this->month,
'year' => $this->year
];
$dimensionSkeleton = [
'ts' => $this->ts,
'month' => $this-... | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"entries",
"=",
"$",
"this",
"->",
"logBuffer",
"->",
"getEntries",
"(",
")",
";",
"$",
"entrySkeleton",
"=",
"[",
"'ts'",
"=>",
"$",
"this",
"->",
"ts",
",",
"'month'",
"=>",
"$",
"this",
"->",
"mo... | Save all the entries from the buffer. | [
"Save",
"all",
"the",
"entries",
"from",
"the",
"buffer",
"."
] | train | https://github.com/Webiny/AnalyticsDb/blob/e0b1e920643cd63071406520767243736004052e/src/Webiny/AnalyticsDb/AnalyticsDb.php#L131-L221 |
Webiny/AnalyticsDb | src/Webiny/AnalyticsDb/AnalyticsDb.php | AnalyticsDb.query | public function query($entity, $ref = 0, array $dateRange)
{
return new Query($this->mongo, $entity, $ref, $dateRange);
} | php | public function query($entity, $ref = 0, array $dateRange)
{
return new Query($this->mongo, $entity, $ref, $dateRange);
} | [
"public",
"function",
"query",
"(",
"$",
"entity",
",",
"$",
"ref",
"=",
"0",
",",
"array",
"$",
"dateRange",
")",
"{",
"return",
"new",
"Query",
"(",
"$",
"this",
"->",
"mongo",
",",
"$",
"entity",
",",
"$",
"ref",
",",
"$",
"dateRange",
")",
";... | Query the analytics data.
@param string $entity
@param string|int $ref
@param array $dateRange [fromTimestamp, toTimestamp]
@return Query | [
"Query",
"the",
"analytics",
"data",
"."
] | train | https://github.com/Webiny/AnalyticsDb/blob/e0b1e920643cd63071406520767243736004052e/src/Webiny/AnalyticsDb/AnalyticsDb.php#L232-L235 |
Webiny/AnalyticsDb | src/Webiny/AnalyticsDb/AnalyticsDb.php | AnalyticsDb.createCollections | private function createCollections()
{
$collections = $this->mongo->listCollections();
$collectionsCreated = false;
foreach ($collections as $collection) {
/* @var $collection CollectionInfo */
if ($collection->getName() == self::ADB_STATS_DAILY) {
$c... | php | private function createCollections()
{
$collections = $this->mongo->listCollections();
$collectionsCreated = false;
foreach ($collections as $collection) {
/* @var $collection CollectionInfo */
if ($collection->getName() == self::ADB_STATS_DAILY) {
$c... | [
"private",
"function",
"createCollections",
"(",
")",
"{",
"$",
"collections",
"=",
"$",
"this",
"->",
"mongo",
"->",
"listCollections",
"(",
")",
";",
"$",
"collectionsCreated",
"=",
"false",
";",
"foreach",
"(",
"$",
"collections",
"as",
"$",
"collection",... | Creates the necessary indexes and collections if they don't exist. | [
"Creates",
"the",
"necessary",
"indexes",
"and",
"collections",
"if",
"they",
"don",
"t",
"exist",
"."
] | train | https://github.com/Webiny/AnalyticsDb/blob/e0b1e920643cd63071406520767243736004052e/src/Webiny/AnalyticsDb/AnalyticsDb.php#L240-L273 |
todstoychev/icr | src/Icr.php | Icr.uploadImage | public static function uploadImage(UploadedFile $uploadedFile, $context, $storage = 'local', $fileName = null)
{
$file = Facades\File::get($uploadedFile);
/** @var Processor $processor */
$processor = app('icr.processor');
return $processor->upload(
$context,
... | php | public static function uploadImage(UploadedFile $uploadedFile, $context, $storage = 'local', $fileName = null)
{
$file = Facades\File::get($uploadedFile);
/** @var Processor $processor */
$processor = app('icr.processor');
return $processor->upload(
$context,
... | [
"public",
"static",
"function",
"uploadImage",
"(",
"UploadedFile",
"$",
"uploadedFile",
",",
"$",
"context",
",",
"$",
"storage",
"=",
"'local'",
",",
"$",
"fileName",
"=",
"null",
")",
"{",
"$",
"file",
"=",
"Facades",
"\\",
"File",
"::",
"get",
"(",
... | Handles upload image. Returns exception instance on error or file name on success.
@param UploadedFile $uploadedFile
@param string $context
@param string $storage
@param null|string $fileName
@return \Exception|string
@throws \Exception | [
"Handles",
"upload",
"image",
".",
"Returns",
"exception",
"instance",
"on",
"error",
"or",
"file",
"name",
"on",
"success",
"."
] | train | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Icr.php#L28-L40 |
todstoychev/icr | src/Icr.php | Icr.deleteImage | public static function deleteImage($fileName, $context, $storage = 'local')
{
/** @var Processor $processor */
$processor = app('icr.processor');
return $processor->delete($fileName, $context, Facades\Storage::disk($storage));
} | php | public static function deleteImage($fileName, $context, $storage = 'local')
{
/** @var Processor $processor */
$processor = app('icr.processor');
return $processor->delete($fileName, $context, Facades\Storage::disk($storage));
} | [
"public",
"static",
"function",
"deleteImage",
"(",
"$",
"fileName",
",",
"$",
"context",
",",
"$",
"storage",
"=",
"'local'",
")",
"{",
"/** @var Processor $processor */",
"$",
"processor",
"=",
"app",
"(",
"'icr.processor'",
")",
";",
"return",
"$",
"process... | Handles delete image. Returns exception instance on error.
@param string $fileName
@param string $context
@param string $storage
@return mixed | [
"Handles",
"delete",
"image",
".",
"Returns",
"exception",
"instance",
"on",
"error",
"."
] | train | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Icr.php#L51-L57 |
todstoychev/icr | src/Icr.php | Icr.renameImage | public static function renameImage($oldFileName, $newFileName, $context, $storage = 'local')
{
/** @var FilesystemAdapter $filesystemAdapter */
$filesystemAdapter = Facades\Storage::disk($storage);
/** @var Processor $processor */
$processor = app('icr.processor');
return $p... | php | public static function renameImage($oldFileName, $newFileName, $context, $storage = 'local')
{
/** @var FilesystemAdapter $filesystemAdapter */
$filesystemAdapter = Facades\Storage::disk($storage);
/** @var Processor $processor */
$processor = app('icr.processor');
return $p... | [
"public",
"static",
"function",
"renameImage",
"(",
"$",
"oldFileName",
",",
"$",
"newFileName",
",",
"$",
"context",
",",
"$",
"storage",
"=",
"'local'",
")",
"{",
"/** @var FilesystemAdapter $filesystemAdapter */",
"$",
"filesystemAdapter",
"=",
"Facades",
"\\",
... | Renames existing image
@param string $oldFileName
@param string $newFileName
@param string $context
@param string $storage
@return boolean | [
"Renames",
"existing",
"image"
] | train | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Icr.php#L69-L77 |
todstoychev/icr | src/Manipulator/Resize.php | Resize.manipulate | public function manipulate(AbstractImage $image, $width, $height)
{
$box = $this->calculateResize($image, $width, $height);
return $image->resize($box);
} | php | public function manipulate(AbstractImage $image, $width, $height)
{
$box = $this->calculateResize($image, $width, $height);
return $image->resize($box);
} | [
"public",
"function",
"manipulate",
"(",
"AbstractImage",
"$",
"image",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"box",
"=",
"$",
"this",
"->",
"calculateResize",
"(",
"$",
"image",
",",
"$",
"width",
",",
"$",
"height",
")",
";",
"retur... | {@inheritdoc}
@return AbstractImage | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/todstoychev/icr/blob/0214c7bc76e44488e98758d55deb707b72e24000/src/Manipulator/Resize.php#L20-L25 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.handleProcedures | protected function handleProcedures(array $procedures)
{
/** @var Procedure $procedure */
foreach ($procedures as $procedure) {
$this->handleProcedureOuter($procedure);
if ($procedure->hasChildren()) {
$this->handleProcedures($procedure->getChildren());
... | php | protected function handleProcedures(array $procedures)
{
/** @var Procedure $procedure */
foreach ($procedures as $procedure) {
$this->handleProcedureOuter($procedure);
if ($procedure->hasChildren()) {
$this->handleProcedures($procedure->getChildren());
... | [
"protected",
"function",
"handleProcedures",
"(",
"array",
"$",
"procedures",
")",
"{",
"/** @var Procedure $procedure */",
"foreach",
"(",
"$",
"procedures",
"as",
"$",
"procedure",
")",
"{",
"$",
"this",
"->",
"handleProcedureOuter",
"(",
"$",
"procedure",
")",
... | Handles procedures.
@param array $procedures Procedures to handle | [
"Handles",
"procedures",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L113-L123 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.handleSource | protected function handleSource(SourceAdapterInterface $adapter, Request $request)
{
$this->injectDependencies($adapter);
$response = $adapter->receive($request);
if ($response === null) {
throw new MissingResponseException($adapter);
}
return $response;
} | php | protected function handleSource(SourceAdapterInterface $adapter, Request $request)
{
$this->injectDependencies($adapter);
$response = $adapter->receive($request);
if ($response === null) {
throw new MissingResponseException($adapter);
}
return $response;
} | [
"protected",
"function",
"handleSource",
"(",
"SourceAdapterInterface",
"$",
"adapter",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"injectDependencies",
"(",
"$",
"adapter",
")",
";",
"$",
"response",
"=",
"$",
"adapter",
"->",
"receive",
"... | Handles source.
@param SourceAdapterInterface $adapter Source adapter
@param Request $request Request to handle
@throws MissingResponseException
@return Response Source adapter response | [
"Handles",
"source",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L135-L146 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.handleSources | protected function handleSources(array $sources)
{
$responses = array();
foreach ($sources as $source) {
list($adapter, $request) = $source;
$responses[] = $this->handleSource($adapter, $request);
}
$iterator = new \AppendIterator();
/** @var Respon... | php | protected function handleSources(array $sources)
{
$responses = array();
foreach ($sources as $source) {
list($adapter, $request) = $source;
$responses[] = $this->handleSource($adapter, $request);
}
$iterator = new \AppendIterator();
/** @var Respon... | [
"protected",
"function",
"handleSources",
"(",
"array",
"$",
"sources",
")",
"{",
"$",
"responses",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"sources",
"as",
"$",
"source",
")",
"{",
"list",
"(",
"$",
"adapter",
",",
"$",
"request",
")",
"="... | Handles sources.
@param array $sources Sources
@return \Iterator Iterator for all source response objects | [
"Handles",
"sources",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L155-L172 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.handleWorker | protected function handleWorker(WorkerInterface $worker, $object, StorageInterface $storage)
{
$this->injectDependencies($worker);
$modifiedObject = $worker->handle($object);
if ($modifiedObject === null && $object !== null) {
$storage->remove($object);
} elseif ($modif... | php | protected function handleWorker(WorkerInterface $worker, $object, StorageInterface $storage)
{
$this->injectDependencies($worker);
$modifiedObject = $worker->handle($object);
if ($modifiedObject === null && $object !== null) {
$storage->remove($object);
} elseif ($modif... | [
"protected",
"function",
"handleWorker",
"(",
"WorkerInterface",
"$",
"worker",
",",
"$",
"object",
",",
"StorageInterface",
"$",
"storage",
")",
"{",
"$",
"this",
"->",
"injectDependencies",
"(",
"$",
"worker",
")",
";",
"$",
"modifiedObject",
"=",
"$",
"wo... | Handles worker.
@param WorkerInterface $worker Worker
@param mixed $object Object to handle
@param StorageInterface $storage Associated storage | [
"Handles",
"worker",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L181-L195 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.handleWorkers | protected function handleWorkers(array $workers, StorageInterface $storage)
{
foreach ($workers as $worker) {
foreach ($storage->all() as $element) {
$this->handleWorker($worker, $element, $storage);
}
}
} | php | protected function handleWorkers(array $workers, StorageInterface $storage)
{
foreach ($workers as $worker) {
foreach ($storage->all() as $element) {
$this->handleWorker($worker, $element, $storage);
}
}
} | [
"protected",
"function",
"handleWorkers",
"(",
"array",
"$",
"workers",
",",
"StorageInterface",
"$",
"storage",
")",
"{",
"foreach",
"(",
"$",
"workers",
"as",
"$",
"worker",
")",
"{",
"foreach",
"(",
"$",
"storage",
"->",
"all",
"(",
")",
"as",
"$",
... | Handles workers.
@param array $workers Workers
@param StorageInterface $storage Associated storage | [
"Handles",
"workers",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L203-L210 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.handleTarget | protected function handleTarget(TargetAdapterInterface $adapter, Request $request)
{
$this->injectDependencies($adapter);
$response = $adapter->send($request);
if ($response === null) {
throw new MissingResponseException($adapter);
}
return $response;
} | php | protected function handleTarget(TargetAdapterInterface $adapter, Request $request)
{
$this->injectDependencies($adapter);
$response = $adapter->send($request);
if ($response === null) {
throw new MissingResponseException($adapter);
}
return $response;
} | [
"protected",
"function",
"handleTarget",
"(",
"TargetAdapterInterface",
"$",
"adapter",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"injectDependencies",
"(",
"$",
"adapter",
")",
";",
"$",
"response",
"=",
"$",
"adapter",
"->",
"send",
"(",... | Handles target.
@param TargetAdapterInterface $adapter Target adapter
@param Request $request Request to handle
@throws MissingResponseException
@return Response Target adapter response | [
"Handles",
"target",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L222-L233 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.handleTargets | protected function handleTargets(array $targets, Request $request)
{
$responses = array();
foreach ($targets as $target) {
$responses[] = $this->handleTarget($target, $request);
}
return $responses;
} | php | protected function handleTargets(array $targets, Request $request)
{
$responses = array();
foreach ($targets as $target) {
$responses[] = $this->handleTarget($target, $request);
}
return $responses;
} | [
"protected",
"function",
"handleTargets",
"(",
"array",
"$",
"targets",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"responses",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"targets",
"as",
"$",
"target",
")",
"{",
"$",
"responses",
"[",
"]",
... | Handles targets.
@param array $targets Targets
@param Request $request Request to handle
@return array Target responses | [
"Handles",
"targets",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L243-L252 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.nextObject | protected function nextObject(\Iterator $iterator)
{
if ($iterator->valid()) {
$object = $iterator->current();
$iterator->next();
return $object;
}
return false;
} | php | protected function nextObject(\Iterator $iterator)
{
if ($iterator->valid()) {
$object = $iterator->current();
$iterator->next();
return $object;
}
return false;
} | [
"protected",
"function",
"nextObject",
"(",
"\\",
"Iterator",
"$",
"iterator",
")",
"{",
"if",
"(",
"$",
"iterator",
"->",
"valid",
"(",
")",
")",
"{",
"$",
"object",
"=",
"$",
"iterator",
"->",
"current",
"(",
")",
";",
"$",
"iterator",
"->",
"next"... | Returns next object for an iterator.
@param \Iterator $iterator Iterator to return the next object for
@return mixed|false Object or false, if no object can be returned | [
"Returns",
"next",
"object",
"for",
"an",
"iterator",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L261-L272 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.createStorage | protected function createStorage($scope)
{
$storage = new InMemoryStorage();
$this->stack->setScope($scope, $storage);
return $storage;
} | php | protected function createStorage($scope)
{
$storage = new InMemoryStorage();
$this->stack->setScope($scope, $storage);
return $storage;
} | [
"protected",
"function",
"createStorage",
"(",
"$",
"scope",
")",
"{",
"$",
"storage",
"=",
"new",
"InMemoryStorage",
"(",
")",
";",
"$",
"this",
"->",
"stack",
"->",
"setScope",
"(",
"$",
"scope",
",",
"$",
"storage",
")",
";",
"return",
"$",
"storage... | Creates scoped storage.
@param string $scope Scope name
@return InMemoryStorage Local storage | [
"Creates",
"scoped",
"storage",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L281-L288 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.injectDependencies | protected function injectDependencies($component)
{
if ($component instanceof StorageStackAwareInterface) {
$component->setStorageStack($this->stack);
}
if ($component instanceof LoggerAwareInterface && $this->logger instanceof LoggerInterface) {
$component->setLogge... | php | protected function injectDependencies($component)
{
if ($component instanceof StorageStackAwareInterface) {
$component->setStorageStack($this->stack);
}
if ($component instanceof LoggerAwareInterface && $this->logger instanceof LoggerInterface) {
$component->setLogge... | [
"protected",
"function",
"injectDependencies",
"(",
"$",
"component",
")",
"{",
"if",
"(",
"$",
"component",
"instanceof",
"StorageStackAwareInterface",
")",
"{",
"$",
"component",
"->",
"setStorageStack",
"(",
"$",
"this",
"->",
"stack",
")",
";",
"}",
"if",
... | Injects dependencies.
@param object $component Component | [
"Injects",
"dependencies",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L295-L304 |
transfer-framework/transfer | src/Transfer/Processor/Processor.php | Processor.mergeStorage | protected function mergeStorage(StorageInterface $storage)
{
foreach ($storage->all() as $id => $object) {
$this->stack->getScope('global')->add($object);
}
} | php | protected function mergeStorage(StorageInterface $storage)
{
foreach ($storage->all() as $id => $object) {
$this->stack->getScope('global')->add($object);
}
} | [
"protected",
"function",
"mergeStorage",
"(",
"StorageInterface",
"$",
"storage",
")",
"{",
"foreach",
"(",
"$",
"storage",
"->",
"all",
"(",
")",
"as",
"$",
"id",
"=>",
"$",
"object",
")",
"{",
"$",
"this",
"->",
"stack",
"->",
"getScope",
"(",
"'glob... | Merges local storage with global storage.
@param StorageInterface $storage Local storage | [
"Merges",
"local",
"storage",
"with",
"global",
"storage",
"."
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Processor/Processor.php#L326-L331 |
dphn/ScContent | src/ScContent/Listener/Back/ContentListClean.php | ContentListClean.process | public function process(EventInterface $event)
{
$events = $this->getEventManager();
$mapper = $this->getMapper();
$optionsProvider = $this->getOptionsProvider();
$translator = $this->getTranslator();
$pane = $event->getParam('pane');
if (! $optionsProvider->hasIdenti... | php | public function process(EventInterface $event)
{
$events = $this->getEventManager();
$mapper = $this->getMapper();
$optionsProvider = $this->getOptionsProvider();
$translator = $this->getTranslator();
$pane = $event->getParam('pane');
if (! $optionsProvider->hasIdenti... | [
"public",
"function",
"process",
"(",
"EventInterface",
"$",
"event",
")",
"{",
"$",
"events",
"=",
"$",
"this",
"->",
"getEventManager",
"(",
")",
";",
"$",
"mapper",
"=",
"$",
"this",
"->",
"getMapper",
"(",
")",
";",
"$",
"optionsProvider",
"=",
"$"... | Emptying the trash
@param \Zend\EventManager\EventInterface $event
@return null|\Zend\Http\Response | [
"Emptying",
"the",
"trash"
] | train | https://github.com/dphn/ScContent/blob/9dd5732490c45fd788b96cedf7b3c7adfacb30d2/src/ScContent/Listener/Back/ContentListClean.php#L50-L90 |
transfer-framework/transfer | src/Transfer/Storage/InMemoryStorage.php | InMemoryStorage.add | public function add($object, $id = null)
{
if ($id === null) {
$id = $this->hashingStrategy->hash($object);
}
$this->data[$id] = $object;
return true;
} | php | public function add($object, $id = null)
{
if ($id === null) {
$id = $this->hashingStrategy->hash($object);
}
$this->data[$id] = $object;
return true;
} | [
"public",
"function",
"add",
"(",
"$",
"object",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"hashingStrategy",
"->",
"hash",
"(",
"$",
"object",
")",
";",
"}",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Storage/InMemoryStorage.php#L27-L36 |
transfer-framework/transfer | src/Transfer/Storage/InMemoryStorage.php | InMemoryStorage.findById | public function findById($id)
{
if (!$this->containsId($id)) {
throw new ObjectNotFoundException($id);
}
return $this->data[$id];
} | php | public function findById($id)
{
if (!$this->containsId($id)) {
throw new ObjectNotFoundException($id);
}
return $this->data[$id];
} | [
"public",
"function",
"findById",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"containsId",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"ObjectNotFoundException",
"(",
"$",
"id",
")",
";",
"}",
"return",
"$",
"this",
"->",
"data... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/transfer/blob/9225ae068d5924982f14ad4446b15f75384a058a/src/Transfer/Storage/InMemoryStorage.php#L57-L64 |
yriveiro/php-fslock | src/FSLock.php | FSLock.acquire | public function acquire(bool $blocker = false): bool
{
if (!is_resource($this->lock)) {
return false;
}
return flock($this->lock, ($blocker) ? LOCK_EX : LOCK_EX | LOCK_NB);
} | php | public function acquire(bool $blocker = false): bool
{
if (!is_resource($this->lock)) {
return false;
}
return flock($this->lock, ($blocker) ? LOCK_EX : LOCK_EX | LOCK_NB);
} | [
"public",
"function",
"acquire",
"(",
"bool",
"$",
"blocker",
"=",
"false",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"lock",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"flock",
"(",
"$",
"this",
"->",... | Acquires the lock.
@param bool $blocker if the lock is acquire by other process before,
and we call acquire as blocker, this call blocks
after previous acquire release the lock
@return bool | [
"Acquires",
"the",
"lock",
"."
] | train | https://github.com/yriveiro/php-fslock/blob/ae12605403294d6f177395192c39baf118dae31c/src/FSLock.php#L69-L76 |
yriveiro/php-fslock | src/FSLock.php | FSLock.release | public function release(): bool
{
if (!is_resource($this->lock)) {
return true;
}
return flock($this->lock, LOCK_UN);
} | php | public function release(): bool
{
if (!is_resource($this->lock)) {
return true;
}
return flock($this->lock, LOCK_UN);
} | [
"public",
"function",
"release",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"lock",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"flock",
"(",
"$",
"this",
"->",
"lock",
",",
"LOCK_UN",
")",
";",
"}... | Releases the lock.
@return bool | [
"Releases",
"the",
"lock",
"."
] | train | https://github.com/yriveiro/php-fslock/blob/ae12605403294d6f177395192c39baf118dae31c/src/FSLock.php#L83-L90 |
christophe-brachet/aspi-framework | src/Framework/Doctrine/Routing/YamlDoctrineLoader.php | YamlDoctrineLoader.load | public function load($domainName, $type = null)
{
$path = 'routing.yml';
if(!$this->container['isCMS'])
{
$site = $this->container['em']->getRepository('\Aspi\Framework\Entity\Site')->getByDomain($domainName);
}
else
{
... | php | public function load($domainName, $type = null)
{
$path = 'routing.yml';
if(!$this->container['isCMS'])
{
$site = $this->container['em']->getRepository('\Aspi\Framework\Entity\Site')->getByDomain($domainName);
}
else
{
... | [
"public",
"function",
"load",
"(",
"$",
"domainName",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"'routing.yml'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"[",
"'isCMS'",
"]",
")",
"{",
"$",
"site",
"=",
"$",
"this",
"... | Loads a Yaml file.
@param string $file A Yaml file path
@param string|null $type The resource type
@return RouteCollection A RouteCollection instance
@throws \InvalidArgumentException When a route can't be parsed because YAML is invalid | [
"Loads",
"a",
"Yaml",
"file",
"."
] | train | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Doctrine/Routing/YamlDoctrineLoader.php#L71-L144 |
christophe-brachet/aspi-framework | src/Framework/Doctrine/Routing/YamlDoctrineLoader.php | YamlDoctrineLoader.parseRoute | protected function parseRoute(RouteCollection $collection, $name, array $config, $path)
{
$defaults = isset($config['defaults']) ? $config['defaults'] : array();
$requirements = isset($config['requirements']) ? $config['requirements'] : array();
$options = isset($config['options']) ? $config... | php | protected function parseRoute(RouteCollection $collection, $name, array $config, $path)
{
$defaults = isset($config['defaults']) ? $config['defaults'] : array();
$requirements = isset($config['requirements']) ? $config['requirements'] : array();
$options = isset($config['options']) ? $config... | [
"protected",
"function",
"parseRoute",
"(",
"RouteCollection",
"$",
"collection",
",",
"$",
"name",
",",
"array",
"$",
"config",
",",
"$",
"path",
")",
"{",
"$",
"defaults",
"=",
"isset",
"(",
"$",
"config",
"[",
"'defaults'",
"]",
")",
"?",
"$",
"conf... | Parses a route and adds it to the RouteCollection.
@param RouteCollection $collection A RouteCollection instance
@param string $name Route name
@param array $config Route definition
@param string $path Full path of the YAML file being processed | [
"Parses",
"a",
"route",
"and",
"adds",
"it",
"to",
"the",
"RouteCollection",
"."
] | train | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Doctrine/Routing/YamlDoctrineLoader.php#L160-L181 |
christophe-brachet/aspi-framework | src/Framework/Doctrine/Routing/YamlDoctrineLoader.php | YamlDoctrineLoader.parseImport | protected function parseImport(RouteCollection $collection, array $config, $path, $file)
{
$type = isset($config['type']) ? $config['type'] : null;
$prefix = isset($config['prefix']) ? $config['prefix'] : '';
$defaults = isset($config['defaults']) ? $config['defaults'] : array();
$re... | php | protected function parseImport(RouteCollection $collection, array $config, $path, $file)
{
$type = isset($config['type']) ? $config['type'] : null;
$prefix = isset($config['prefix']) ? $config['prefix'] : '';
$defaults = isset($config['defaults']) ? $config['defaults'] : array();
$re... | [
"protected",
"function",
"parseImport",
"(",
"RouteCollection",
"$",
"collection",
",",
"array",
"$",
"config",
",",
"$",
"path",
",",
"$",
"file",
")",
"{",
"$",
"type",
"=",
"isset",
"(",
"$",
"config",
"[",
"'type'",
"]",
")",
"?",
"$",
"config",
... | Parses an import and adds the routes in the resource to the RouteCollection.
@param RouteCollection $collection A RouteCollection instance
@param array $config Route definition
@param string $path Full path of the YAML file being processed
@param string $file Loaded file name | [
"Parses",
"an",
"import",
"and",
"adds",
"the",
"routes",
"in",
"the",
"resource",
"to",
"the",
"RouteCollection",
"."
] | train | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Doctrine/Routing/YamlDoctrineLoader.php#L190-L221 |
bariew/yii2-rbac-cms-module | controllers/AuthItemController.php | AuthItemController.actionUpdate | public function actionUpdate($id)
{
$pid = Yii::$app->request->get('pid');
$model = $this->findModel($id);
$parent = $pid ? $this->findModel($pid) : $model;
if ($model->load(\Yii::$app->request->post()) && $model->updateItem()) {
Yii::$app->session->setFlash('success', Yi... | php | public function actionUpdate($id)
{
$pid = Yii::$app->request->get('pid');
$model = $this->findModel($id);
$parent = $pid ? $this->findModel($pid) : $model;
if ($model->load(\Yii::$app->request->post()) && $model->updateItem()) {
Yii::$app->session->setFlash('success', Yi... | [
"public",
"function",
"actionUpdate",
"(",
"$",
"id",
")",
"{",
"$",
"pid",
"=",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"get",
"(",
"'pid'",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"p... | Обновление модели.
@param integer $id mode id
@return mixed | [
"Обновление",
"модели",
"."
] | train | https://github.com/bariew/yii2-rbac-cms-module/blob/c1f0fd05bf6d1951a3fd929d974e6f4cc2b52262/controllers/AuthItemController.php#L56-L66 |
bariew/yii2-rbac-cms-module | controllers/AuthItemController.php | AuthItemController.actionCreate | public function actionCreate($id)
{
$parent = $this->findModel($id);
$model = $this->findModel();
$model->type = Item::TYPE_ROLE;
if ($model->load(\Yii::$app->request->post()) && $parent->addChild($model)) {
Yii::$app->session->setFlash('success', Yii::t('modules/rbac', '... | php | public function actionCreate($id)
{
$parent = $this->findModel($id);
$model = $this->findModel();
$model->type = Item::TYPE_ROLE;
if ($model->load(\Yii::$app->request->post()) && $parent->addChild($model)) {
Yii::$app->session->setFlash('success', Yii::t('modules/rbac', '... | [
"public",
"function",
"actionCreate",
"(",
"$",
"id",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
")",
";",
"$",
"model",
"->",
"type",
"=",
"Item... | Creates new role attached to $id owner.
@param integer $id parent id
@return \yii\web\View action view | [
"Creates",
"new",
"role",
"attached",
"to",
"$id",
"owner",
"."
] | train | https://github.com/bariew/yii2-rbac-cms-module/blob/c1f0fd05bf6d1951a3fd929d974e6f4cc2b52262/controllers/AuthItemController.php#L72-L82 |
bariew/yii2-rbac-cms-module | controllers/AuthItemController.php | AuthItemController.actionTreeMove | public function actionTreeMove($id, $pid)
{
$child = $this->findModel($id);
$oldParent = $this->findModel($pid);
$newParent = $this->findModel(Yii::$app->request->post('pid'));
$child->move($oldParent, $newParent);
echo json_encode($child->nodeAttributes($child, $newParent->i... | php | public function actionTreeMove($id, $pid)
{
$child = $this->findModel($id);
$oldParent = $this->findModel($pid);
$newParent = $this->findModel(Yii::$app->request->post('pid'));
$child->move($oldParent, $newParent);
echo json_encode($child->nodeAttributes($child, $newParent->i... | [
"public",
"function",
"actionTreeMove",
"(",
"$",
"id",
",",
"$",
"pid",
")",
"{",
"$",
"child",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"oldParent",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"pid",
")",
";",
"$",... | Detaches model from old parent.
And attaches to the new one.
@param integer $id mode id
@param integer $pid parent id
@return \yii\web\View action view | [
"Detaches",
"model",
"from",
"old",
"parent",
".",
"And",
"attaches",
"to",
"the",
"new",
"one",
"."
] | train | https://github.com/bariew/yii2-rbac-cms-module/blob/c1f0fd05bf6d1951a3fd929d974e6f4cc2b52262/controllers/AuthItemController.php#L101-L108 |
pantera-digital/yii2-seo | validators/SlugValidator.php | SlugValidator.validateSlug | public function validateSlug(ActiveRecord $model, $value)
{
if ($this->pattern) {
if (preg_match($this->pattern, $value) === 0) {
return false;
}
}
if ($this->validateUnique($model, $value) === false) {
return false;
}
retur... | php | public function validateSlug(ActiveRecord $model, $value)
{
if ($this->pattern) {
if (preg_match($this->pattern, $value) === 0) {
return false;
}
}
if ($this->validateUnique($model, $value) === false) {
return false;
}
retur... | [
"public",
"function",
"validateSlug",
"(",
"ActiveRecord",
"$",
"model",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pattern",
")",
"{",
"if",
"(",
"preg_match",
"(",
"$",
"this",
"->",
"pattern",
",",
"$",
"value",
")",
"===",
"0",
... | Валидация переданного slug
Принимаем модели для которой хотим проверить slug
@param ActiveRecord $model
@param string $value
@return bool | [
"Валидация",
"переданного",
"slug",
"Принимаем",
"модели",
"для",
"которой",
"хотим",
"проверить",
"slug"
] | train | https://github.com/pantera-digital/yii2-seo/blob/7673224ef601bfbccc57c96e7413ceb43d8332b2/validators/SlugValidator.php#L61-L72 |
pantera-digital/yii2-seo | validators/SlugValidator.php | SlugValidator.validateUnique | private function validateUnique($model, $slug)
{
$slug = trim(trim($slug, '/'));
/* @var $model ActiveRecord */
$query = SeoSlug::find()
->where(['=', 'slug', $slug]);
if ($model->isNewRecord === false) {
$query->andWhere([
'OR',
... | php | private function validateUnique($model, $slug)
{
$slug = trim(trim($slug, '/'));
/* @var $model ActiveRecord */
$query = SeoSlug::find()
->where(['=', 'slug', $slug]);
if ($model->isNewRecord === false) {
$query->andWhere([
'OR',
... | [
"private",
"function",
"validateUnique",
"(",
"$",
"model",
",",
"$",
"slug",
")",
"{",
"$",
"slug",
"=",
"trim",
"(",
"trim",
"(",
"$",
"slug",
",",
"'/'",
")",
")",
";",
"/* @var $model ActiveRecord */",
"$",
"query",
"=",
"SeoSlug",
"::",
"find",
"(... | Проверка slug на уникальность
@param Model $model
@param string $slug
@return bool | [
"Проверка",
"slug",
"на",
"уникальность"
] | train | https://github.com/pantera-digital/yii2-seo/blob/7673224ef601bfbccc57c96e7413ceb43d8332b2/validators/SlugValidator.php#L80-L98 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.addToken | public function addToken($name, $position) {
$token = new Token($name, $position);
$this->tokens[] = $token;
// Autoclose opened tokens
switch (substr($name, -4)) {
case AbstractBlockRule::OPEN:
$this->openedTokens[] = substr($name, 0, -5);
br... | php | public function addToken($name, $position) {
$token = new Token($name, $position);
$this->tokens[] = $token;
// Autoclose opened tokens
switch (substr($name, -4)) {
case AbstractBlockRule::OPEN:
$this->openedTokens[] = substr($name, 0, -5);
br... | [
"public",
"function",
"addToken",
"(",
"$",
"name",
",",
"$",
"position",
")",
"{",
"$",
"token",
"=",
"new",
"Token",
"(",
"$",
"name",
",",
"$",
"position",
")",
";",
"$",
"this",
"->",
"tokens",
"[",
"]",
"=",
"$",
"token",
";",
"// Autoclose op... | Add token to token list
@param string $name token name
@param int $position token found at position
@return \ViKon\Parser\Token | [
"Add",
"token",
"to",
"token",
"list"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L30-L51 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.getTokenAt | public function getTokenAt($index) {
// Get token from behind
if ($index < 0) {
$index = count($this->tokens) + $index;
}
return $this->tokens[$index];
} | php | public function getTokenAt($index) {
// Get token from behind
if ($index < 0) {
$index = count($this->tokens) + $index;
}
return $this->tokens[$index];
} | [
"public",
"function",
"getTokenAt",
"(",
"$",
"index",
")",
"{",
"// Get token from behind",
"if",
"(",
"$",
"index",
"<",
"0",
")",
"{",
"$",
"index",
"=",
"count",
"(",
"$",
"this",
"->",
"tokens",
")",
"+",
"$",
"index",
";",
"}",
"return",
"$",
... | Get token at given position
@param int $index token index, if index is negative get token from behind (-1 is last element)
@return \ViKon\Parser\Token | [
"Get",
"token",
"at",
"given",
"position"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L60-L67 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.insertTokenAt | public function insertTokenAt($name, $position, $index) {
array_splice($this->tokens, $index, 0, [$token = new Token($name, $position)]);
return $token;
} | php | public function insertTokenAt($name, $position, $index) {
array_splice($this->tokens, $index, 0, [$token = new Token($name, $position)]);
return $token;
} | [
"public",
"function",
"insertTokenAt",
"(",
"$",
"name",
",",
"$",
"position",
",",
"$",
"index",
")",
"{",
"array_splice",
"(",
"$",
"this",
"->",
"tokens",
",",
"$",
"index",
",",
"0",
",",
"[",
"$",
"token",
"=",
"new",
"Token",
"(",
"$",
"name"... | Add token to specific index position
@param string $name
@param int $position
@param int $index
@return \ViKon\Parser\Token | [
"Add",
"token",
"to",
"specific",
"index",
"position"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L78-L82 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.removeTokenAt | public function removeTokenAt($index) {
// Remove token from behind
if ($index < 0) {
$index = count($this->tokens) + $index;
}
array_splice($this->tokens, $index, 1);
} | php | public function removeTokenAt($index) {
// Remove token from behind
if ($index < 0) {
$index = count($this->tokens) + $index;
}
array_splice($this->tokens, $index, 1);
} | [
"public",
"function",
"removeTokenAt",
"(",
"$",
"index",
")",
"{",
"// Remove token from behind",
"if",
"(",
"$",
"index",
"<",
"0",
")",
"{",
"$",
"index",
"=",
"count",
"(",
"$",
"this",
"->",
"tokens",
")",
"+",
"$",
"index",
";",
"}",
"array_splic... | Remove token at specific index position
@param int $index token index, if index is negative get token from behind (-1 is last element) | [
"Remove",
"token",
"at",
"specific",
"index",
"position"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L89-L95 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.lastByName | public function lastByName($name) {
for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
if ($this->tokens[$i]->getName() === $name) {
return $this->tokens[$i];
}
}
return null;
} | php | public function lastByName($name) {
for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
if ($this->tokens[$i]->getName() === $name) {
return $this->tokens[$i];
}
}
return null;
} | [
"public",
"function",
"lastByName",
"(",
"$",
"name",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"this",
"->",
"tokens",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"$",
"i",
"--",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"tok... | Get last token that match provided name
@param string $name token name
@return \ViKon\Parser\Token|null | [
"Get",
"last",
"token",
"that",
"match",
"provided",
"name"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L163-L171 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.lastIndexByName | public function lastIndexByName($name) {
for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
if ($this->tokens[$i]->getName() === $name) {
return $i;
}
}
return null;
} | php | public function lastIndexByName($name) {
for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
if ($this->tokens[$i]->getName() === $name) {
return $i;
}
}
return null;
} | [
"public",
"function",
"lastIndexByName",
"(",
"$",
"name",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"this",
"->",
"tokens",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"$",
"i",
"--",
")",
"{",
"if",
"(",
"$",
"this",
"->",
... | Get last token index that match provided name
@param string $name token name
@return int|null | [
"Get",
"last",
"token",
"index",
"that",
"match",
"provided",
"name"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L180-L188 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.merge | public function merge(TokenList $tokenList) {
$tokenList->closeOpenTokens();
$lastTokenPosition = $this->last() === null ? 0 : $this->last()
->getPosition();
foreach ($tokenList->getTokens() as $token) {
$token->setPosition($token->getPosition() + $lastTokenPosition);
... | php | public function merge(TokenList $tokenList) {
$tokenList->closeOpenTokens();
$lastTokenPosition = $this->last() === null ? 0 : $this->last()
->getPosition();
foreach ($tokenList->getTokens() as $token) {
$token->setPosition($token->getPosition() + $lastTokenPosition);
... | [
"public",
"function",
"merge",
"(",
"TokenList",
"$",
"tokenList",
")",
"{",
"$",
"tokenList",
"->",
"closeOpenTokens",
"(",
")",
";",
"$",
"lastTokenPosition",
"=",
"$",
"this",
"->",
"last",
"(",
")",
"===",
"null",
"?",
"0",
":",
"$",
"this",
"->",
... | Merge two token list
@param TokenList $tokenList | [
"Merge",
"two",
"token",
"list"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L195-L203 |
vi-kon/laravel-parser | src/ViKon/Parser/TokenList.php | TokenList.closeOpenTokens | public function closeOpenTokens() {
$lastToken = $this->last();
while (count($this->openedTokens) > 0) {
$lastOpenToken = array_pop($this->openedTokens);
$this->tokens[] = new Token($lastOpenToken . AbstractBlockRule::CLOSE, $lastToken->getPosition());
}
} | php | public function closeOpenTokens() {
$lastToken = $this->last();
while (count($this->openedTokens) > 0) {
$lastOpenToken = array_pop($this->openedTokens);
$this->tokens[] = new Token($lastOpenToken . AbstractBlockRule::CLOSE, $lastToken->getPosition());
}
} | [
"public",
"function",
"closeOpenTokens",
"(",
")",
"{",
"$",
"lastToken",
"=",
"$",
"this",
"->",
"last",
"(",
")",
";",
"while",
"(",
"count",
"(",
"$",
"this",
"->",
"openedTokens",
")",
">",
"0",
")",
"{",
"$",
"lastOpenToken",
"=",
"array_pop",
"... | Automatically close unclosed tags | [
"Automatically",
"close",
"unclosed",
"tags"
] | train | https://github.com/vi-kon/laravel-parser/blob/070f0bb9120cb9ca6ff836d4f418e78ee33ee182/src/ViKon/Parser/TokenList.php#L226-L232 |
konsulting/laravel-editor-stamps | src/Schema.php | Schema.connection | public static function connection($name)
{
$schema = static::$app['db']->connection($name)->getSchemaBuilder();
$schema->blueprintResolver(function ($table, $callback) {
return new Blueprint($table, $callback);
});
return $schema;
} | php | public static function connection($name)
{
$schema = static::$app['db']->connection($name)->getSchemaBuilder();
$schema->blueprintResolver(function ($table, $callback) {
return new Blueprint($table, $callback);
});
return $schema;
} | [
"public",
"static",
"function",
"connection",
"(",
"$",
"name",
")",
"{",
"$",
"schema",
"=",
"static",
"::",
"$",
"app",
"[",
"'db'",
"]",
"->",
"connection",
"(",
"$",
"name",
")",
"->",
"getSchemaBuilder",
"(",
")",
";",
"$",
"schema",
"->",
"blue... | Get a schema builder instance for a connection.
@param string $name
@return \Illuminate\Database\Schema\Builder | [
"Get",
"a",
"schema",
"builder",
"instance",
"for",
"a",
"connection",
"."
] | train | https://github.com/konsulting/laravel-editor-stamps/blob/31d36382b55dde960438b5a55bfa7f824bfbd690/src/Schema.php#L18-L26 |
bariew/yii2-rbac-cms-module | models/AuthAssignment.php | AuthAssignment.userAssignments | public static function userAssignments($user)
{
$names = self::find()->where(['user_id' => $user->id])->select('item_name')->column();
return AuthItem::find()->where(['in', 'name', $names]);
} | php | public static function userAssignments($user)
{
$names = self::find()->where(['user_id' => $user->id])->select('item_name')->column();
return AuthItem::find()->where(['in', 'name', $names]);
} | [
"public",
"static",
"function",
"userAssignments",
"(",
"$",
"user",
")",
"{",
"$",
"names",
"=",
"self",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"[",
"'user_id'",
"=>",
"$",
"user",
"->",
"id",
"]",
")",
"->",
"select",
"(",
"'item_name'",
")",
... | Searches all user assignments.
@param object $user user instance
@return \yii\web\Query search object | [
"Searches",
"all",
"user",
"assignments",
"."
] | train | https://github.com/bariew/yii2-rbac-cms-module/blob/c1f0fd05bf6d1951a3fd929d974e6f4cc2b52262/models/AuthAssignment.php#L85-L89 |
vardius/crud-bundle | Actions/Action/ExportAction.php | ExportAction.call | public function call(ActionEvent $event, string $format):Response
{
$controller = $event->getController();
$this->checkRole($controller);
$request = $event->getRequest();
$id = $request->get('id');
if (is_numeric($id)) {
if (!$controller->has('knp_snappy.pdf'))... | php | public function call(ActionEvent $event, string $format):Response
{
$controller = $event->getController();
$this->checkRole($controller);
$request = $event->getRequest();
$id = $request->get('id');
if (is_numeric($id)) {
if (!$controller->has('knp_snappy.pdf'))... | [
"public",
"function",
"call",
"(",
"ActionEvent",
"$",
"event",
",",
"string",
"$",
"format",
")",
":",
"Response",
"{",
"$",
"controller",
"=",
"$",
"event",
"->",
"getController",
"(",
")",
";",
"$",
"this",
"->",
"checkRole",
"(",
"$",
"controller",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/vardius/crud-bundle/blob/dda957e3f8516c3b0d6270ea5a6eb50d98e71444/Actions/Action/ExportAction.php#L33-L131 |
nyeholt/silverstripe-simplewiki | thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Strategy/MakeWellFormed.php | HTMLPurifier_Strategy_MakeWellFormed.processToken | protected function processToken($token, $injector = -1) {
// normalize forms of token
if (is_object($token)) $token = array(1, $token);
if (is_int($token)) $token = array($token);
if ($token === false) $token = array(1);
if (!is_array($token)) throw new HTMLPurifier_Exceptio... | php | protected function processToken($token, $injector = -1) {
// normalize forms of token
if (is_object($token)) $token = array(1, $token);
if (is_int($token)) $token = array($token);
if ($token === false) $token = array(1);
if (!is_array($token)) throw new HTMLPurifier_Exceptio... | [
"protected",
"function",
"processToken",
"(",
"$",
"token",
",",
"$",
"injector",
"=",
"-",
"1",
")",
"{",
"// normalize forms of token",
"if",
"(",
"is_object",
"(",
"$",
"token",
")",
")",
"$",
"token",
"=",
"array",
"(",
"1",
",",
"$",
"token",
")",... | Processes arbitrary token values for complicated substitution patterns.
In general:
If $token is an array, it is a list of tokens to substitute for the
current token. These tokens then get individually processed. If there
is a leading integer in the list, that integer determines how many
tokens from the stream should ... | [
"Processes",
"arbitrary",
"token",
"values",
"for",
"complicated",
"substitution",
"patterns",
".",
"In",
"general",
":"
] | train | https://github.com/nyeholt/silverstripe-simplewiki/blob/ecffed0d75be1454901e1cb24633472b8f67c967/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier/Strategy/MakeWellFormed.php#L406-L431 |
windwork/wf-image | lib/adapter/GD.php | GD.setImage | public function setImage($imageContent)
{
if (!$imageContent || false == ($this->imgInfo = @getimagesizefromstring($imageContent))) {
throw new Exception('错误的图片文件!');;
}
$this->imageContent = $imageContent;
return $this;
} | php | public function setImage($imageContent)
{
if (!$imageContent || false == ($this->imgInfo = @getimagesizefromstring($imageContent))) {
throw new Exception('错误的图片文件!');;
}
$this->imageContent = $imageContent;
return $this;
} | [
"public",
"function",
"setImage",
"(",
"$",
"imageContent",
")",
"{",
"if",
"(",
"!",
"$",
"imageContent",
"||",
"false",
"==",
"(",
"$",
"this",
"->",
"imgInfo",
"=",
"@",
"getimagesizefromstring",
"(",
"$",
"imageContent",
")",
")",
")",
"{",
"throw",
... | {@inheritDoc}
@see \wf\image\ImageInterface::setImage()
@throws \wf\image\Exception | [
"{"
] | train | https://github.com/windwork/wf-image/blob/17d3ac1d77b5f938e516e02fb343cb9a52ccc016/lib/adapter/GD.php#L65-L74 |
windwork/wf-image | lib/adapter/GD.php | GD.thumb | public function thumb($thumbWidth, $thumbHeight, $isCut = true, $cutPlace = 5, $quality = 95, $thumbType = 'jpg')
{
if (!in_array($thumbType, ['jpg', 'png', 'webp'])) {
throw new Exception('thumb image type must be webp|jpg|png');
}
if($isCut) {
return $this->thumb... | php | public function thumb($thumbWidth, $thumbHeight, $isCut = true, $cutPlace = 5, $quality = 95, $thumbType = 'jpg')
{
if (!in_array($thumbType, ['jpg', 'png', 'webp'])) {
throw new Exception('thumb image type must be webp|jpg|png');
}
if($isCut) {
return $this->thumb... | [
"public",
"function",
"thumb",
"(",
"$",
"thumbWidth",
",",
"$",
"thumbHeight",
",",
"$",
"isCut",
"=",
"true",
",",
"$",
"cutPlace",
"=",
"5",
",",
"$",
"quality",
"=",
"95",
",",
"$",
"thumbType",
"=",
"'jpg'",
")",
"{",
"if",
"(",
"!",
"in_array... | {@inheritDoc}
@see \wf\image\ImageInterface::thumb() | [
"{"
] | train | https://github.com/windwork/wf-image/blob/17d3ac1d77b5f938e516e02fb343cb9a52ccc016/lib/adapter/GD.php#L89-L100 |
windwork/wf-image | lib/adapter/GD.php | GD.thumbUnCut | private function thumbUnCut($thumbWidth, $thumbHeight, $quality, $thumbType = 'jpg')
{
list($srcW, $srcH) = $this->imgInfo;
// 宽或高按比例缩放
if ($thumbWidth == 0 || $thumbHeight == 0) {
if ($thumbWidth == 0) {
$thumbHeight = $srcH * ($thumbWidth / $srcW);
... | php | private function thumbUnCut($thumbWidth, $thumbHeight, $quality, $thumbType = 'jpg')
{
list($srcW, $srcH) = $this->imgInfo;
// 宽或高按比例缩放
if ($thumbWidth == 0 || $thumbHeight == 0) {
if ($thumbWidth == 0) {
$thumbHeight = $srcH * ($thumbWidth / $srcW);
... | [
"private",
"function",
"thumbUnCut",
"(",
"$",
"thumbWidth",
",",
"$",
"thumbHeight",
",",
"$",
"quality",
",",
"$",
"thumbType",
"=",
"'jpg'",
")",
"{",
"list",
"(",
"$",
"srcW",
",",
"$",
"srcH",
")",
"=",
"$",
"this",
"->",
"imgInfo",
";",
"// 宽或高... | 不裁剪方式生成缩略图
@param int $thumbWidth
@param int $thumbHeight
@return bool | string
@throws \wf\image\Exception | [
"不裁剪方式生成缩略图"
] | train | https://github.com/windwork/wf-image/blob/17d3ac1d77b5f938e516e02fb343cb9a52ccc016/lib/adapter/GD.php#L110-L172 |
windwork/wf-image | lib/adapter/GD.php | GD.thumbCutOut | private function thumbCutOut($thumbWidth, $thumbHeight, $cutPlace = 5, $quality = 95, $thumbType = 'jpg')
{
list($srcW, $srcH) = $this->imgInfo;
$imgH = $srcH; // 取样图片高
$imgW = $srcW; // 取样图片宽
$srcX = 0; // 取样图片x坐标开始值
$srcY = 0; // 取样图片y坐标开始值
$att... | php | private function thumbCutOut($thumbWidth, $thumbHeight, $cutPlace = 5, $quality = 95, $thumbType = 'jpg')
{
list($srcW, $srcH) = $this->imgInfo;
$imgH = $srcH; // 取样图片高
$imgW = $srcW; // 取样图片宽
$srcX = 0; // 取样图片x坐标开始值
$srcY = 0; // 取样图片y坐标开始值
$att... | [
"private",
"function",
"thumbCutOut",
"(",
"$",
"thumbWidth",
",",
"$",
"thumbHeight",
",",
"$",
"cutPlace",
"=",
"5",
",",
"$",
"quality",
"=",
"95",
",",
"$",
"thumbType",
"=",
"'jpg'",
")",
"{",
"list",
"(",
"$",
"srcW",
",",
"$",
"srcH",
")",
"... | 裁剪方式生成缩略图
@param int $thumbWidth
@param int $thumbHeight
@param int $cutPlace = 5 1:x左y上, 2:x中y上, 3:x右y上, 4:x左y中, 5:x中y中, 6:x右y中,7:x左y下, 8:x中y下,9:x右y下
@return bool | string
@throws \wf\image\Exception | [
"裁剪方式生成缩略图"
] | train | https://github.com/windwork/wf-image/blob/17d3ac1d77b5f938e516e02fb343cb9a52ccc016/lib/adapter/GD.php#L183-L257 |
windwork/wf-image | lib/adapter/GD.php | GD.watermark | public function watermark($watermarkFile = 'static/images/watermark.png', $watermarkPlace = 9, $quality = 95)
{
@list($imgW, $imgH) = $this->imgInfo;
$watermarkInfo = @getimagesize($watermarkFile);
$watermarkLogo = ('image/png' == $watermarkInfo['mime']) ? @imagecreatefrompng... | php | public function watermark($watermarkFile = 'static/images/watermark.png', $watermarkPlace = 9, $quality = 95)
{
@list($imgW, $imgH) = $this->imgInfo;
$watermarkInfo = @getimagesize($watermarkFile);
$watermarkLogo = ('image/png' == $watermarkInfo['mime']) ? @imagecreatefrompng... | [
"public",
"function",
"watermark",
"(",
"$",
"watermarkFile",
"=",
"'static/images/watermark.png'",
",",
"$",
"watermarkPlace",
"=",
"9",
",",
"$",
"quality",
"=",
"95",
")",
"{",
"@",
"list",
"(",
"$",
"imgW",
",",
"$",
"imgH",
")",
"=",
"$",
"this",
... | {@inheritDoc}
@see \wf\image\ImageInterface::watermark() | [
"{"
] | train | https://github.com/windwork/wf-image/blob/17d3ac1d77b5f938e516e02fb343cb9a52ccc016/lib/adapter/GD.php#L263-L331 |
webbuilders-group/silverstripe-gridfield-deleted-items | src/Forms/GridFieldDeletedColumns.php | GridFieldDeletedColumns.getColumnAttributes | public function getColumnAttributes($gridField, $record, $columnName) {
$attributes=parent::getColumnAttributes($gridField, $record, $columnName);
$isDeletedFromDraft=(!$record->hasMethod('isOnDraft') ? $record->isOnLiveOnly():!$record->isOnDraft());
if($gridField->State->ListDisplayMod... | php | public function getColumnAttributes($gridField, $record, $columnName) {
$attributes=parent::getColumnAttributes($gridField, $record, $columnName);
$isDeletedFromDraft=(!$record->hasMethod('isOnDraft') ? $record->isOnLiveOnly():!$record->isOnDraft());
if($gridField->State->ListDisplayMod... | [
"public",
"function",
"getColumnAttributes",
"(",
"$",
"gridField",
",",
"$",
"record",
",",
"$",
"columnName",
")",
"{",
"$",
"attributes",
"=",
"parent",
"::",
"getColumnAttributes",
"(",
"$",
"gridField",
",",
"$",
"record",
",",
"$",
"columnName",
")",
... | Attributes for the element containing the content returned by {@link getColumnContent()}.
@param GridField $gridField
@param DataObject $record displayed in this row
@param string $columnName
@return array | [
"Attributes",
"for",
"the",
"element",
"containing",
"the",
"content",
"returned",
"by",
"{"
] | train | https://github.com/webbuilders-group/silverstripe-gridfield-deleted-items/blob/fd4e90701357de00acf06f4b820b745817f4ce9c/src/Forms/GridFieldDeletedColumns.php#L17-L33 |
christophe-brachet/aspi-framework | src/Framework/Form/Element/CheckboxSet.php | CheckboxSet.setCheckboxAttribute | public function setCheckboxAttribute($a, $v)
{
foreach ($this->checkboxes as $checkbox) {
$checkbox->setAttribute($a, $v);
if ($a == 'tabindex') {
$v++;
}
}
return $this;
} | php | public function setCheckboxAttribute($a, $v)
{
foreach ($this->checkboxes as $checkbox) {
$checkbox->setAttribute($a, $v);
if ($a == 'tabindex') {
$v++;
}
}
return $this;
} | [
"public",
"function",
"setCheckboxAttribute",
"(",
"$",
"a",
",",
"$",
"v",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"checkboxes",
"as",
"$",
"checkbox",
")",
"{",
"$",
"checkbox",
"->",
"setAttribute",
"(",
"$",
"a",
",",
"$",
"v",
")",
";",
"... | Set an attribute for the input checkbox elements
@param string $a
@param string $v
@return Child | [
"Set",
"an",
"attribute",
"for",
"the",
"input",
"checkbox",
"elements"
] | train | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/CheckboxSet.php#L96-L105 |
christophe-brachet/aspi-framework | src/Framework/Form/Element/CheckboxSet.php | CheckboxSet.setCheckboxAttributes | public function setCheckboxAttributes(array $a)
{
foreach ($this->checkboxes as $checkbox) {
$checkbox->setAttributes($a);
if (isset($a['tabindex'])) {
$a['tabindex']++;
}
}
return $this;
} | php | public function setCheckboxAttributes(array $a)
{
foreach ($this->checkboxes as $checkbox) {
$checkbox->setAttributes($a);
if (isset($a['tabindex'])) {
$a['tabindex']++;
}
}
return $this;
} | [
"public",
"function",
"setCheckboxAttributes",
"(",
"array",
"$",
"a",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"checkboxes",
"as",
"$",
"checkbox",
")",
"{",
"$",
"checkbox",
"->",
"setAttributes",
"(",
"$",
"a",
")",
";",
"if",
"(",
"isset",
"(",... | Set an attribute or attributes for the input checkbox elements
@param array $a
@return Child | [
"Set",
"an",
"attribute",
"or",
"attributes",
"for",
"the",
"input",
"checkbox",
"elements"
] | train | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/CheckboxSet.php#L112-L121 |
christophe-brachet/aspi-framework | src/Framework/Form/Element/CheckboxSet.php | CheckboxSet.setValue | public function setValue($value)
{
$this->checked = (!is_array($value)) ? [$value] : $value;
if ((count($this->checked) > 0) && ($this->hasChildren())) {
foreach ($this->childNodes as $child) {
if ($child instanceof Input\Checkbox) {
if (in_array($chil... | php | public function setValue($value)
{
$this->checked = (!is_array($value)) ? [$value] : $value;
if ((count($this->checked) > 0) && ($this->hasChildren())) {
foreach ($this->childNodes as $child) {
if ($child instanceof Input\Checkbox) {
if (in_array($chil... | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"checked",
"=",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"?",
"[",
"$",
"value",
"]",
":",
"$",
"value",
";",
"if",
"(",
"(",
"count",
"(",
"$",
"this",... | Set the checked value of the checkbox form elements
@param $value
@return CheckboxSet | [
"Set",
"the",
"checked",
"value",
"of",
"the",
"checkbox",
"form",
"elements"
] | train | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/CheckboxSet.php#L128-L143 |
christophe-brachet/aspi-framework | src/Framework/Form/Element/CheckboxSet.php | CheckboxSet.render | public function render($depth = 0, $indent = null, $inner = false)
{
if (!empty($this->legend)) {
$this->addChild(new Child('legend', $this->legend));
}
return parent::render($depth, $indent, $inner);
} | php | public function render($depth = 0, $indent = null, $inner = false)
{
if (!empty($this->legend)) {
$this->addChild(new Child('legend', $this->legend));
}
return parent::render($depth, $indent, $inner);
} | [
"public",
"function",
"render",
"(",
"$",
"depth",
"=",
"0",
",",
"$",
"indent",
"=",
"null",
",",
"$",
"inner",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"legend",
")",
")",
"{",
"$",
"this",
"->",
"addChild",
"(... | Render the child and its child nodes
@param int $depth
@param string $indent
@param boolean $inner
@return string | [
"Render",
"the",
"child",
"and",
"its",
"child",
"nodes"
] | train | https://github.com/christophe-brachet/aspi-framework/blob/17a36c8a8582e0b8d8bff7087590c09a9bd4af1e/src/Framework/Form/Element/CheckboxSet.php#L257-L263 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php | DWDHourlyCrawler.getAllStations | public function getAllStations(bool $active=false)
{
$stationsPerService = [];
foreach ($this->services as $var => $hourlyService) {
$stationsPerService[$var] = $this->getStations($hourlyService, $active);
}
return $stationsPerService;
} | php | public function getAllStations(bool $active=false)
{
$stationsPerService = [];
foreach ($this->services as $var => $hourlyService) {
$stationsPerService[$var] = $this->getStations($hourlyService, $active);
}
return $stationsPerService;
} | [
"public",
"function",
"getAllStations",
"(",
"bool",
"$",
"active",
"=",
"false",
")",
"{",
"$",
"stationsPerService",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"services",
"as",
"$",
"var",
"=>",
"$",
"hourlyService",
")",
"{",
"$",
"stat... | Retrieve all (active) Stations for a service.
@param bool $active
@return array | [
"Retrieve",
"all",
"(",
"active",
")",
"Stations",
"for",
"a",
"service",
"."
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php#L41-L48 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php | DWDHourlyCrawler.getDataInInterval | public function getDataInInterval($coordinatesRequest, DateTime $date, $timeMinuteLimit = 30, $sorted = true)
{
$parameters = [];
$queriedStations = [];
$date = Carbon::instance($date)->setTimezone('utc');
foreach ($this->services as $var => $hourlyService) {
$stations ... | php | public function getDataInInterval($coordinatesRequest, DateTime $date, $timeMinuteLimit = 30, $sorted = true)
{
$parameters = [];
$queriedStations = [];
$date = Carbon::instance($date)->setTimezone('utc');
foreach ($this->services as $var => $hourlyService) {
$stations ... | [
"public",
"function",
"getDataInInterval",
"(",
"$",
"coordinatesRequest",
",",
"DateTime",
"$",
"date",
",",
"$",
"timeMinuteLimit",
"=",
"30",
",",
"$",
"sorted",
"=",
"true",
")",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"$",
"queriedStations",
"=",
... | Retrieve data from one of the nearest stations. This method retrieves all stations in a specific diameter around
the location. It then queries the stations one by one until one station's results could be found.
This is important if a station's files are missing on the ftp.
@param array $nearestStations
@param DateTime... | [
"Retrieve",
"data",
"from",
"one",
"of",
"the",
"nearest",
"stations",
".",
"This",
"method",
"retrieves",
"all",
"stations",
"in",
"a",
"specific",
"diameter",
"around",
"the",
"location",
".",
"It",
"then",
"queries",
"the",
"stations",
"one",
"by",
"one",... | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php#L59-L108 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php | DWDHourlyCrawler.getDataByDay | public function getDataByDay(Coordinate $coordinatesRequest, DateTime $day)
{
$parameters = [];
$queriedStations = [];
$day = Carbon::instance($day)->setTimezone('utc');
foreach ($this->services as $var => $hourlyService) {
/* @var AbstractHourlyService $hourlyService */
... | php | public function getDataByDay(Coordinate $coordinatesRequest, DateTime $day)
{
$parameters = [];
$queriedStations = [];
$day = Carbon::instance($day)->setTimezone('utc');
foreach ($this->services as $var => $hourlyService) {
/* @var AbstractHourlyService $hourlyService */
... | [
"public",
"function",
"getDataByDay",
"(",
"Coordinate",
"$",
"coordinatesRequest",
",",
"DateTime",
"$",
"day",
")",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"$",
"queriedStations",
"=",
"[",
"]",
";",
"$",
"day",
"=",
"Carbon",
"::",
"instance",
"("... | Get all data for the given day. The parameter day is converted to UTC!
@param Coordinate $coordinatesRequest
@param DateTime $day
@return array [params, stations] | [
"Get",
"all",
"data",
"for",
"the",
"given",
"day",
".",
"The",
"parameter",
"day",
"is",
"converted",
"to",
"UTC!"
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php#L115-L160 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php | DWDHourlyCrawler.getStations | public function getStations(AbstractHourlyService $controller, bool $activeOnly = false, bool $forceDownloadFile = false)
{
$downloadFile = false || $forceDownloadFile;
$stationsFTPPath = DWDConfiguration::getHourlyConfiguration()->parameters;
$stationsFTPPath = get_object_vars($stationsFTPP... | php | public function getStations(AbstractHourlyService $controller, bool $activeOnly = false, bool $forceDownloadFile = false)
{
$downloadFile = false || $forceDownloadFile;
$stationsFTPPath = DWDConfiguration::getHourlyConfiguration()->parameters;
$stationsFTPPath = get_object_vars($stationsFTPP... | [
"public",
"function",
"getStations",
"(",
"AbstractHourlyService",
"$",
"controller",
",",
"bool",
"$",
"activeOnly",
"=",
"false",
",",
"bool",
"$",
"forceDownloadFile",
"=",
"false",
")",
"{",
"$",
"downloadFile",
"=",
"false",
"||",
"$",
"forceDownloadFile",
... | Retrieves the correct stations file, can be filtered to only show stations that are flagges as active. Conditions
for this can be
@param bool $activeOnly
@return array | [
"Retrieves",
"the",
"correct",
"stations",
"file",
"can",
"be",
"filtered",
"to",
"only",
"show",
"stations",
"that",
"are",
"flagges",
"as",
"active",
".",
"Conditions",
"for",
"this",
"can",
"be"
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php#L168-L203 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php | DWDHourlyCrawler.retrieveFile | public function retrieveFile(AbstractHourlyService $service, DWDStation $nearestStation, $forceDownloadFile = false)
{
$config = DWDConfiguration::getConfiguration();
$ftpConfig = $config->ftp;
$fileName = $service->getFileName($nearestStation->getId());
$ftpPath = $service->getFil... | php | public function retrieveFile(AbstractHourlyService $service, DWDStation $nearestStation, $forceDownloadFile = false)
{
$config = DWDConfiguration::getConfiguration();
$ftpConfig = $config->ftp;
$fileName = $service->getFileName($nearestStation->getId());
$ftpPath = $service->getFil... | [
"public",
"function",
"retrieveFile",
"(",
"AbstractHourlyService",
"$",
"service",
",",
"DWDStation",
"$",
"nearestStation",
",",
"$",
"forceDownloadFile",
"=",
"false",
")",
"{",
"$",
"config",
"=",
"DWDConfiguration",
"::",
"getConfiguration",
"(",
")",
";",
... | Retrieves a file for the controller by querying the nearest station.
@param AbstractHourlyService $service
@param DWDStation $nearestStation
@param bool $forceDownloadFile
@return string filePath | [
"Retrieves",
"a",
"file",
"for",
"the",
"controller",
"by",
"querying",
"the",
"nearest",
"station",
"."
] | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php#L211-L257 |
FWidm/dwd-hourly-crawler | src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php | DWDHourlyCrawler.retrieveData | private function retrieveData($content, DWDStation $nearestStation, Coordinate $coordinate, AbstractHourlyService $hourlyController, DateTime $dateTime, $timeMinuteLimit)
{
//custom time limit
$timeBefore = Carbon::instance($dateTime);
$timeAfter = Carbon::instance($dateTime);
$time... | php | private function retrieveData($content, DWDStation $nearestStation, Coordinate $coordinate, AbstractHourlyService $hourlyController, DateTime $dateTime, $timeMinuteLimit)
{
//custom time limit
$timeBefore = Carbon::instance($dateTime);
$timeAfter = Carbon::instance($dateTime);
$time... | [
"private",
"function",
"retrieveData",
"(",
"$",
"content",
",",
"DWDStation",
"$",
"nearestStation",
",",
"Coordinate",
"$",
"coordinate",
",",
"AbstractHourlyService",
"$",
"hourlyController",
",",
"DateTime",
"$",
"dateTime",
",",
"$",
"timeMinuteLimit",
")",
"... | DWD Hourly data is not really hourly, as such first try to query with the specified limit, then, if the limit is smaller than +-1.5h or +-3.5h
Query those values and return them.
@param $content - of the zip
@param AbstractHourlyService $hourlyController - the controller that should parse the data
@param DateTime $date... | [
"DWD",
"Hourly",
"data",
"is",
"not",
"really",
"hourly",
"as",
"such",
"first",
"try",
"to",
"query",
"with",
"the",
"specified",
"limit",
"then",
"if",
"the",
"limit",
"is",
"smaller",
"than",
"+",
"-",
"1",
".",
"5h",
"or",
"+",
"-",
"3",
".",
"... | train | https://github.com/FWidm/dwd-hourly-crawler/blob/36dec7d84a85af599e9d4fb6a3bcc302378ce4a8/src/fwidm/dwdHourlyCrawler/hourly/DWDHourlyCrawler.php#L269-L291 |
redCOMPONENT-COM/robo | src/RoboFile.dist.php | RoboFile.sendCodeceptionOutputToSlack | public function sendCodeceptionOutputToSlack($slackChannel, $slackToken = null, $codeceptionOutputFolder = null)
{
if (is_null($slackToken)) {
$this->say('we are in Travis environment, getting token from ENV');
// Remind to set the token in repo Travis settings,
// see: ... | php | public function sendCodeceptionOutputToSlack($slackChannel, $slackToken = null, $codeceptionOutputFolder = null)
{
if (is_null($slackToken)) {
$this->say('we are in Travis environment, getting token from ENV');
// Remind to set the token in repo Travis settings,
// see: ... | [
"public",
"function",
"sendCodeceptionOutputToSlack",
"(",
"$",
"slackChannel",
",",
"$",
"slackToken",
"=",
"null",
",",
"$",
"codeceptionOutputFolder",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"slackToken",
")",
")",
"{",
"$",
"this",
"->",
... | Sends Codeception errors to Slack
@param string $slackChannel The Slack Channel ID
@param string $slackToken Your Slack authentication token.
@param string $codeceptionOutputFolder Optional. By default tests/_output
@return mixed | [
"Sends",
"Codeception",
"errors",
"to",
"Slack"
] | train | https://github.com/redCOMPONENT-COM/robo/blob/ee480b13a6e8a28ab72816406f84ce257c5b806a/src/RoboFile.dist.php#L48-L67 |
terdia/legato-framework | src/Request.php | Request.input | public function input($key, $default = false)
{
return $this->getRequestInputByType()->has($key) ?
$this->getRequestInputByType()->get($key) : $default;
} | php | public function input($key, $default = false)
{
return $this->getRequestInputByType()->has($key) ?
$this->getRequestInputByType()->get($key) : $default;
} | [
"public",
"function",
"input",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"getRequestInputByType",
"(",
")",
"->",
"has",
"(",
"$",
"key",
")",
"?",
"$",
"this",
"->",
"getRequestInputByType",
"(",
")",
... | Get a request parameter by key.
@param $key
@param bool $default
@return bool|mixed | [
"Get",
"a",
"request",
"parameter",
"by",
"key",
"."
] | train | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Request.php#L42-L46 |
terdia/legato-framework | src/Request.php | Request.getRequestInputByType | public function getRequestInputByType()
{
$data = $this->instance->getRealMethod() == 'GET' ? HttpFoundation::createFromGlobals()->query :
HttpFoundation::createFromGlobals()->request;
if ($data) {
foreach ($data->all() as $key => $value) {
session()->createF... | php | public function getRequestInputByType()
{
$data = $this->instance->getRealMethod() == 'GET' ? HttpFoundation::createFromGlobals()->query :
HttpFoundation::createFromGlobals()->request;
if ($data) {
foreach ($data->all() as $key => $value) {
session()->createF... | [
"public",
"function",
"getRequestInputByType",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"instance",
"->",
"getRealMethod",
"(",
")",
"==",
"'GET'",
"?",
"HttpFoundation",
"::",
"createFromGlobals",
"(",
")",
"->",
"query",
":",
"HttpFoundation",
"... | get the request data base on request method.
@return \Symfony\Component\HttpFoundation\ParameterBag | [
"get",
"the",
"request",
"data",
"base",
"on",
"request",
"method",
"."
] | train | https://github.com/terdia/legato-framework/blob/44057c1c3c6f3e9643e9fade51bd417860fafda8/src/Request.php#L83-L97 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.