id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,900 | steeffeen/FancyManiaLinks | FML/Script/Features/ControlScript.php | ControlScript.updateScriptEvents | protected function updateScriptEvents()
{
if (!$this->control || !ScriptLabel::isEventLabel($this->labelName)) {
return $this;
}
if ($this->control instanceof Scriptable) {
$this->control->setScriptEvents(true);
}
return $this;
} | php | protected function updateScriptEvents()
{
if (!$this->control || !ScriptLabel::isEventLabel($this->labelName)) {
return $this;
}
if ($this->control instanceof Scriptable) {
$this->control->setScriptEvents(true);
}
return $this;
} | [
"protected",
"function",
"updateScriptEvents",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"control",
"||",
"!",
"ScriptLabel",
"::",
"isEventLabel",
"(",
"$",
"this",
"->",
"labelName",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
... | Enable Script Events on the Control if needed
@return static | [
"Enable",
"Script",
"Events",
"on",
"the",
"Control",
"if",
"needed"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ControlScript.php#L152-L161 |
19,901 | steeffeen/FancyManiaLinks | FML/Script/Features/ControlScript.php | ControlScript.buildScriptText | protected function buildScriptText()
{
$controlId = Builder::escapeText($this->control->getId());
$scriptText = '';
$closeBlock = false;
if (ScriptLabel::isEventLabel($this->labelName)) {
$scriptText .= "
if (Event.ControlId == {$controlId}) {
declare Control <=> Event.C... | php | protected function buildScriptText()
{
$controlId = Builder::escapeText($this->control->getId());
$scriptText = '';
$closeBlock = false;
if (ScriptLabel::isEventLabel($this->labelName)) {
$scriptText .= "
if (Event.ControlId == {$controlId}) {
declare Control <=> Event.C... | [
"protected",
"function",
"buildScriptText",
"(",
")",
"{",
"$",
"controlId",
"=",
"Builder",
"::",
"escapeText",
"(",
"$",
"this",
"->",
"control",
"->",
"getId",
"(",
")",
")",
";",
"$",
"scriptText",
"=",
"''",
";",
"$",
"closeBlock",
"=",
"false",
"... | Build the script text for the Control
@return string | [
"Build",
"the",
"script",
"text",
"for",
"the",
"Control"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ControlScript.php#L178-L203 |
19,902 | yuncms/framework | src/services/Path.php | Path.getCachePath | public function getCachePath(): string
{
$path = $this->getRuntimePath() . DIRECTORY_SEPARATOR . 'cache';
FileHelper::createDirectory($path);
return $path;
} | php | public function getCachePath(): string
{
$path = $this->getRuntimePath() . DIRECTORY_SEPARATOR . 'cache';
FileHelper::createDirectory($path);
return $path;
} | [
"public",
"function",
"getCachePath",
"(",
")",
":",
"string",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getRuntimePath",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'cache'",
";",
"FileHelper",
"::",
"createDirectory",
"(",
"$",
"path",
")",
";",
"return... | Returns the path to the file cache directory.
This will be located at `@runtime/cache/` by default, but that can be overridden with the 'cachePath'.
@return string
@throws Exception | [
"Returns",
"the",
"path",
"to",
"the",
"file",
"cache",
"directory",
"."
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/services/Path.php#L120-L125 |
19,903 | digitalkaoz/versioneye-php | src/Client.php | Client.api | public function api($name)
{
$this->initializeClient($this->url, $this->client);
$class = 'Rs\\VersionEye\\Api\\' . ucfirst($name);
if (class_exists($class)) {
return new $class($this->client);
} else {
throw new \InvalidArgumentException('unknown api "' . $... | php | public function api($name)
{
$this->initializeClient($this->url, $this->client);
$class = 'Rs\\VersionEye\\Api\\' . ucfirst($name);
if (class_exists($class)) {
return new $class($this->client);
} else {
throw new \InvalidArgumentException('unknown api "' . $... | [
"public",
"function",
"api",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"initializeClient",
"(",
"$",
"this",
"->",
"url",
",",
"$",
"this",
"->",
"client",
")",
";",
"$",
"class",
"=",
"'Rs\\\\VersionEye\\\\Api\\\\'",
".",
"ucfirst",
"(",
"$",
"na... | returns an api.
@param string $name
@throws \InvalidArgumentException
@return Api | [
"returns",
"an",
"api",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Client.php#L46-L57 |
19,904 | digitalkaoz/versioneye-php | src/Client.php | Client.initializeClient | private function initializeClient($url, HttpClient $client = null)
{
if ($client) {
return $this->client = $client;
}
return $this->client = $this->createDefaultHttpClient($url);
} | php | private function initializeClient($url, HttpClient $client = null)
{
if ($client) {
return $this->client = $client;
}
return $this->client = $this->createDefaultHttpClient($url);
} | [
"private",
"function",
"initializeClient",
"(",
"$",
"url",
",",
"HttpClient",
"$",
"client",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"client",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"=",
"$",
"client",
";",
"}",
"return",
"$",
"this",
"->",... | initializes the http client.
@param string $url
@param HttpClient $client
@return HttpClient | [
"initializes",
"the",
"http",
"client",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Client.php#L77-L84 |
19,905 | Lansoweb/LosBase | src/LosBase/Service/Uuid.php | Uuid.generateVersion | private static function generateVersion($namespace, $name, $version)
{
if (!self::isValid($namespace)) {
return false;
}
$nhex = str_replace(array('-', '{', '}'), '', $namespace);
$nstr = '';
$len = strlen($nhex);
for ($i = 0; $i < $len; $i += 2) {
... | php | private static function generateVersion($namespace, $name, $version)
{
if (!self::isValid($namespace)) {
return false;
}
$nhex = str_replace(array('-', '{', '}'), '', $namespace);
$nstr = '';
$len = strlen($nhex);
for ($i = 0; $i < $len; $i += 2) {
... | [
"private",
"static",
"function",
"generateVersion",
"(",
"$",
"namespace",
",",
"$",
"name",
",",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"namespace",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"nhex",
"=",
... | Generates v3 or v5 UUIDs.
@param string $namespace
@param string $name
@param int $version
@return bool|string | [
"Generates",
"v3",
"or",
"v5",
"UUIDs",
"."
] | 90e18a53d29c1bd841c149dca43aa365eecc656d | https://github.com/Lansoweb/LosBase/blob/90e18a53d29c1bd841c149dca43aa365eecc656d/src/LosBase/Service/Uuid.php#L30-L59 |
19,906 | nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/File/Exists.php | Zend_Validate_File_Exists.addDirectory | public function addDirectory($directory)
{
$directories = $this->getDirectory(true);
if (is_string($directory)) {
$directory = explode(',', $directory);
} else if (!is_array($directory)) {
require_once 'Zend/Validate/Exception.php';
throw new Zend_Validat... | php | public function addDirectory($directory)
{
$directories = $this->getDirectory(true);
if (is_string($directory)) {
$directory = explode(',', $directory);
} else if (!is_array($directory)) {
require_once 'Zend/Validate/Exception.php';
throw new Zend_Validat... | [
"public",
"function",
"addDirectory",
"(",
"$",
"directory",
")",
"{",
"$",
"directories",
"=",
"$",
"this",
"->",
"getDirectory",
"(",
"true",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"directory",
")",
")",
"{",
"$",
"directory",
"=",
"explode",
"(... | Adds the file directory which will be checked
@param string|array $directory The directory to add for validation
@return Zend_Validate_File_Extension Provides a fluent interface | [
"Adds",
"the",
"file",
"directory",
"which",
"will",
"be",
"checked"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/File/Exists.php#L118-L148 |
19,907 | limenet/deploy | src/limenet/Deploy/Deploy.php | Deploy.updateCode | protected function updateCode() : array
{
$output = [];
$returnValue = 0;
$updateMaster = 'ls'; // dummy
if ($this->getBranch() !== 'master') {
$updateMaster = ' git checkout master && git pull && git checkout '.$this->getBranch().' ';
}
$commands = [
... | php | protected function updateCode() : array
{
$output = [];
$returnValue = 0;
$updateMaster = 'ls'; // dummy
if ($this->getBranch() !== 'master') {
$updateMaster = ' git checkout master && git pull && git checkout '.$this->getBranch().' ';
}
$commands = [
... | [
"protected",
"function",
"updateCode",
"(",
")",
":",
"array",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"returnValue",
"=",
"0",
";",
"$",
"updateMaster",
"=",
"'ls'",
";",
"// dummy",
"if",
"(",
"$",
"this",
"->",
"getBranch",
"(",
")",
"!==",
... | Executes the actual deployment commands.
@return array | [
"Executes",
"the",
"actual",
"deployment",
"commands",
"."
] | 7c403b69f3221fd159c528f7a6a59f481765a2da | https://github.com/limenet/deploy/blob/7c403b69f3221fd159c528f7a6a59f481765a2da/src/limenet/Deploy/Deploy.php#L178-L205 |
19,908 | periaptio/empress-generator | src/Syntax/AddForeignKeysToTable.php | AddForeignKeysToTable.getItem | protected function getItem($foreignKey)
{
$value = $foreignKey['field'];
if (! empty($foreignKey['name'])) {
$value .= "', '". $foreignKey['name'];
}
$output = sprintf(
"\$table->foreign('%s')->references('%s')->on('%s')",
$value,
$fore... | php | protected function getItem($foreignKey)
{
$value = $foreignKey['field'];
if (! empty($foreignKey['name'])) {
$value .= "', '". $foreignKey['name'];
}
$output = sprintf(
"\$table->foreign('%s')->references('%s')->on('%s')",
$value,
$fore... | [
"protected",
"function",
"getItem",
"(",
"$",
"foreignKey",
")",
"{",
"$",
"value",
"=",
"$",
"foreignKey",
"[",
"'field'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"foreignKey",
"[",
"'name'",
"]",
")",
")",
"{",
"$",
"value",
".=",
"\"', '\"",
... | Return string for adding a foreign key
@param array $foreignKey
@return string | [
"Return",
"string",
"for",
"adding",
"a",
"foreign",
"key"
] | 749fb4b12755819e9c97377ebfb446ee0822168a | https://github.com/periaptio/empress-generator/blob/749fb4b12755819e9c97377ebfb446ee0822168a/src/Syntax/AddForeignKeysToTable.php#L16-L38 |
19,909 | jinexus-framework/jinexus-mvc | src/Application/AbstractApplication.php | AbstractApplication.error | public static function error($number, $string, $file, $line)
{
throw new \ErrorException($string, 0, $number, $file, $line);
} | php | public static function error($number, $string, $file, $line)
{
throw new \ErrorException($string, 0, $number, $file, $line);
} | [
"public",
"static",
"function",
"error",
"(",
"$",
"number",
",",
"$",
"string",
",",
"$",
"file",
",",
"$",
"line",
")",
"{",
"throw",
"new",
"\\",
"ErrorException",
"(",
"$",
"string",
",",
"0",
",",
"$",
"number",
",",
"$",
"file",
",",
"$",
"... | Convert errors to \ErrorException instances
@param int $number
@param string $string
@param string $file
@param int $line
@throws \ErrorException | [
"Convert",
"errors",
"to",
"\\",
"ErrorException",
"instances"
] | 63937fecea4bc927b1ac9669fee5cf50278d28d3 | https://github.com/jinexus-framework/jinexus-mvc/blob/63937fecea4bc927b1ac9669fee5cf50278d28d3/src/Application/AbstractApplication.php#L156-L159 |
19,910 | ClanCats/Core | src/classes/CCTheme.php | CCTheme.create | public static function create( $file = null, $data = null, $encode = false )
{
$view = parent::create( static::view_namespace().'::'.$file, $data, $encode );
// set the asset holder path
\CCAsset::holder( 'theme' )->path = static::public_namespace();
// set the vendor path
\CCAsset::holder( 'vendor' )... | php | public static function create( $file = null, $data = null, $encode = false )
{
$view = parent::create( static::view_namespace().'::'.$file, $data, $encode );
// set the asset holder path
\CCAsset::holder( 'theme' )->path = static::public_namespace();
// set the vendor path
\CCAsset::holder( 'vendor' )... | [
"public",
"static",
"function",
"create",
"(",
"$",
"file",
"=",
"null",
",",
"$",
"data",
"=",
"null",
",",
"$",
"encode",
"=",
"false",
")",
"{",
"$",
"view",
"=",
"parent",
"::",
"create",
"(",
"static",
"::",
"view_namespace",
"(",
")",
".",
"'... | theme creator
returns a new view instance
@param string $file
@param array $data
@param bool $encode
@return CCView | [
"theme",
"creator",
"returns",
"a",
"new",
"view",
"instance"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCTheme.php#L47-L61 |
19,911 | simple-php-mvc/simple-php-mvc | src/MVC/Server/Response.php | Response._parse | protected function _parse($response)
{
$defaults = array(
'body' => '',
'headers' => array('Content-Type: text/html; charset=utf-8'),
'status' => 200
);
if ( is_array($response) ) {
$response += $defaults;
} elseif ( is_string($resp... | php | protected function _parse($response)
{
$defaults = array(
'body' => '',
'headers' => array('Content-Type: text/html; charset=utf-8'),
'status' => 200
);
if ( is_array($response) ) {
$response += $defaults;
} elseif ( is_string($resp... | [
"protected",
"function",
"_parse",
"(",
"$",
"response",
")",
"{",
"$",
"defaults",
"=",
"array",
"(",
"'body'",
"=>",
"''",
",",
"'headers'",
"=>",
"array",
"(",
"'Content-Type: text/html; charset=utf-8'",
")",
",",
"'status'",
"=>",
"200",
")",
";",
"if",
... | Parses a response.
@access protected
@param mixed $response The response to be parsed. Can be an array
containing 'body', 'headers', and/or 'status'
keys, or a string which will be used as the
body of the response. Note that the headers
must be well-formed HTTP headers, and the
status must be an integer (i.e., the... | [
"Parses",
"a",
"response",
"."
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Server/Response.php#L107-L123 |
19,912 | gerritdrost/phenum | src/GerritDrost/Lib/Enum/Enum.php | Enum.byName | public static final function byName($enumName)
{
$instances = self::getInstances(get_called_class());
return isset($instances[$enumName])
? $instances[$enumName]
: null;
} | php | public static final function byName($enumName)
{
$instances = self::getInstances(get_called_class());
return isset($instances[$enumName])
? $instances[$enumName]
: null;
} | [
"public",
"static",
"final",
"function",
"byName",
"(",
"$",
"enumName",
")",
"{",
"$",
"instances",
"=",
"self",
"::",
"getInstances",
"(",
"get_called_class",
"(",
")",
")",
";",
"return",
"isset",
"(",
"$",
"instances",
"[",
"$",
"enumName",
"]",
")",... | Returns the enum value instance representing the provided const name or null when the const name is not present in
the enum.
@param string $enumName
@return Enum | [
"Returns",
"the",
"enum",
"value",
"instance",
"representing",
"the",
"provided",
"const",
"name",
"or",
"null",
"when",
"the",
"const",
"name",
"is",
"not",
"present",
"in",
"the",
"enum",
"."
] | 935ba4911d0591dea9a2c94a1c1ab5babeec92cb | https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/Enum.php#L79-L86 |
19,913 | gerritdrost/phenum | src/GerritDrost/Lib/Enum/Enum.php | Enum.& | private final static function &getInstances($fqcn)
{
if (!isset(self::$instances[$fqcn])) {
self::loadClass($fqcn);
}
return self::$instances[$fqcn];
} | php | private final static function &getInstances($fqcn)
{
if (!isset(self::$instances[$fqcn])) {
self::loadClass($fqcn);
}
return self::$instances[$fqcn];
} | [
"private",
"final",
"static",
"function",
"&",
"getInstances",
"(",
"$",
"fqcn",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instances",
"[",
"$",
"fqcn",
"]",
")",
")",
"{",
"self",
"::",
"loadClass",
"(",
"$",
"fqcn",
")",
";",
... | Returns the array of all value singletons of one Enum class
@param string $fqcn FQCN of the enum
@return Enum[] | [
"Returns",
"the",
"array",
"of",
"all",
"value",
"singletons",
"of",
"one",
"Enum",
"class"
] | 935ba4911d0591dea9a2c94a1c1ab5babeec92cb | https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/Enum.php#L141-L148 |
19,914 | gerritdrost/phenum | src/GerritDrost/Lib/Enum/Enum.php | Enum.loadClass | private final static function loadClass($fqcn)
{
$reflectionClass = new ReflectionClass($fqcn);
$constants = $reflectionClass->getConstants();
foreach ($constants as $name => $value) {
$instance = new $fqcn($fqcn, $name, $value);
/* @var $instance Enum */
... | php | private final static function loadClass($fqcn)
{
$reflectionClass = new ReflectionClass($fqcn);
$constants = $reflectionClass->getConstants();
foreach ($constants as $name => $value) {
$instance = new $fqcn($fqcn, $name, $value);
/* @var $instance Enum */
... | [
"private",
"final",
"static",
"function",
"loadClass",
"(",
"$",
"fqcn",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"fqcn",
")",
";",
"$",
"constants",
"=",
"$",
"reflectionClass",
"->",
"getConstants",
"(",
")",
";",
"forea... | Uses reflection to load and cache all value singletons of the class represented by the fqcn.
@param string $fqcn FQCN of the enum | [
"Uses",
"reflection",
"to",
"load",
"and",
"cache",
"all",
"value",
"singletons",
"of",
"the",
"class",
"represented",
"by",
"the",
"fqcn",
"."
] | 935ba4911d0591dea9a2c94a1c1ab5babeec92cb | https://github.com/gerritdrost/phenum/blob/935ba4911d0591dea9a2c94a1c1ab5babeec92cb/src/GerritDrost/Lib/Enum/Enum.php#L155-L179 |
19,915 | redaigbaria/oauth2 | src/Grant/AbstractGrant.php | AbstractGrant.validateScopes | public function validateScopes($scopeParam = '', ClientEntity $client, $redirectUri = null)
{
$scopesList = explode($this->server->getScopeDelimiter(), $scopeParam);
for ($i = 0; $i < count($scopesList); $i++) {
$scopesList[$i] = trim($scopesList[$i]);
if ($scopesList[$i] ==... | php | public function validateScopes($scopeParam = '', ClientEntity $client, $redirectUri = null)
{
$scopesList = explode($this->server->getScopeDelimiter(), $scopeParam);
for ($i = 0; $i < count($scopesList); $i++) {
$scopesList[$i] = trim($scopesList[$i]);
if ($scopesList[$i] ==... | [
"public",
"function",
"validateScopes",
"(",
"$",
"scopeParam",
"=",
"''",
",",
"ClientEntity",
"$",
"client",
",",
"$",
"redirectUri",
"=",
"null",
")",
"{",
"$",
"scopesList",
"=",
"explode",
"(",
"$",
"this",
"->",
"server",
"->",
"getScopeDelimiter",
"... | Given a list of scopes, validate them and return an array of Scope entities
@param string $scopeParam A string of scopes (e.g. "profile email birthday")
@param \League\OAuth2\Server\Entity\ClientEntity $client Client entity
@param string|null $redi... | [
"Given",
"a",
"list",
"of",
"scopes",
"validate",
"them",
"and",
"return",
"an",
"array",
"of",
"Scope",
"entities"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Grant/AbstractGrant.php#L135-L177 |
19,916 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseSystemSettingsQuery.php | BaseSystemSettingsQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof SystemSettingsQuery) {
return $criteria;
}
$query = new SystemSettingsQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criter... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof SystemSettingsQuery) {
return $criteria;
}
$query = new SystemSettingsQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criter... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"SystemSettingsQuery",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"query",
"=",... | Returns a new SystemSettingsQuery object.
@param string $modelAlias The alias of a model in the query
@param SystemSettingsQuery|Criteria $criteria Optional Criteria to build the query from
@return SystemSettingsQuery | [
"Returns",
"a",
"new",
"SystemSettingsQuery",
"object",
"."
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseSystemSettingsQuery.php#L68-L80 |
19,917 | slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseSystemSettingsQuery.php | BaseSystemSettingsQuery.filterByKey | public function filterByKey($key = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($key)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $key)) {
$key = str_replace('*', '%', $key);
$comparison = Cri... | php | public function filterByKey($key = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($key)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $key)) {
$key = str_replace('*', '%', $key);
$comparison = Cri... | [
"public",
"function",
"filterByKey",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"comparison",
"=",
... | Filter the query on the key column
Example usage:
<code>
$query->filterByKey('fooValue'); // WHERE key = 'fooValue'
$query->filterByKey('%fooValue%'); // WHERE key LIKE '%fooValue%'
</code>
@param string $key The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $comparison Op... | [
"Filter",
"the",
"query",
"on",
"the",
"key",
"column"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseSystemSettingsQuery.php#L290-L302 |
19,918 | monthly-cloud/monthly-sdk-php | src/Builder.php | Builder.buildUrl | public function buildUrl()
{
$url = $this->getApiUrl();
if ($endpoint = $this->getEndpoint()) {
$url .= $endpoint;
}
if ($id = $this->getId()) {
$url .= '/'.$id;
}
$parameters = [];
if ($include = $this->getInclude()) {
if (... | php | public function buildUrl()
{
$url = $this->getApiUrl();
if ($endpoint = $this->getEndpoint()) {
$url .= $endpoint;
}
if ($id = $this->getId()) {
$url .= '/'.$id;
}
$parameters = [];
if ($include = $this->getInclude()) {
if (... | [
"public",
"function",
"buildUrl",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getApiUrl",
"(",
")",
";",
"if",
"(",
"$",
"endpoint",
"=",
"$",
"this",
"->",
"getEndpoint",
"(",
")",
")",
"{",
"$",
"url",
".=",
"$",
"endpoint",
";",
"}",
... | Build api call url.
@return string | [
"Build",
"api",
"call",
"url",
"."
] | 88b9d2bb346344495346a42043108627f648a793 | https://github.com/monthly-cloud/monthly-sdk-php/blob/88b9d2bb346344495346a42043108627f648a793/src/Builder.php#L207-L242 |
19,919 | monthly-cloud/monthly-sdk-php | src/Builder.php | Builder.httpGetRequest | public function httpGetRequest($url)
{
// Check for cache hit.
if ($this->useCache()) {
$cache = $this->getCache();
if ($response = $cache->get($url)) {
return $response;
}
}
if (empty($this->client)) {
$this->client =... | php | public function httpGetRequest($url)
{
// Check for cache hit.
if ($this->useCache()) {
$cache = $this->getCache();
if ($response = $cache->get($url)) {
return $response;
}
}
if (empty($this->client)) {
$this->client =... | [
"public",
"function",
"httpGetRequest",
"(",
"$",
"url",
")",
"{",
"// Check for cache hit.",
"if",
"(",
"$",
"this",
"->",
"useCache",
"(",
")",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"getCache",
"(",
")",
";",
"if",
"(",
"$",
"response",
"... | Make a GET request and respond with json decoded to array.
@param string $url
@return array | [
"Make",
"a",
"GET",
"request",
"and",
"respond",
"with",
"json",
"decoded",
"to",
"array",
"."
] | 88b9d2bb346344495346a42043108627f648a793 | https://github.com/monthly-cloud/monthly-sdk-php/blob/88b9d2bb346344495346a42043108627f648a793/src/Builder.php#L265-L292 |
19,920 | monthly-cloud/monthly-sdk-php | src/Builder.php | Builder.httpPostRequest | public function httpPostRequest($url, $parameters)
{
if (empty($this->client)) {
$this->client = new Client(['verify' => false]);
}
$this->response = $this->client->request(
'POST',
$url,
[
'headers' => $this->getHeaders(),
... | php | public function httpPostRequest($url, $parameters)
{
if (empty($this->client)) {
$this->client = new Client(['verify' => false]);
}
$this->response = $this->client->request(
'POST',
$url,
[
'headers' => $this->getHeaders(),
... | [
"public",
"function",
"httpPostRequest",
"(",
"$",
"url",
",",
"$",
"parameters",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"client",
")",
")",
"{",
"$",
"this",
"->",
"client",
"=",
"new",
"Client",
"(",
"[",
"'verify'",
"=>",
"false",
... | Make a POST request and respond with json decoded to array.
@param string $url
@param array $url
@return array | [
"Make",
"a",
"POST",
"request",
"and",
"respond",
"with",
"json",
"decoded",
"to",
"array",
"."
] | 88b9d2bb346344495346a42043108627f648a793 | https://github.com/monthly-cloud/monthly-sdk-php/blob/88b9d2bb346344495346a42043108627f648a793/src/Builder.php#L301-L318 |
19,921 | monthly-cloud/monthly-sdk-php | src/Builder.php | Builder.get | public function get($fields = null)
{
if (!empty($fields)) {
$this->fields($fields);
}
return $this->httpGetRequest($this->buildUrl());
} | php | public function get($fields = null)
{
if (!empty($fields)) {
$this->fields($fields);
}
return $this->httpGetRequest($this->buildUrl());
} | [
"public",
"function",
"get",
"(",
"$",
"fields",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"fields",
")",
")",
"{",
"$",
"this",
"->",
"fields",
"(",
"$",
"fields",
")",
";",
"}",
"return",
"$",
"this",
"->",
"httpGetRequest",
"("... | Call get request.
@param array|null $fields
@return object | [
"Call",
"get",
"request",
"."
] | 88b9d2bb346344495346a42043108627f648a793 | https://github.com/monthly-cloud/monthly-sdk-php/blob/88b9d2bb346344495346a42043108627f648a793/src/Builder.php#L350-L357 |
19,922 | monthly-cloud/monthly-sdk-php | src/Builder.php | Builder.first | public function first()
{
$response = $this->httpGetRequest($this->buildUrl());
if (empty($response->data[0])) {
return false;
}
return $response->data[0];
} | php | public function first()
{
$response = $this->httpGetRequest($this->buildUrl());
if (empty($response->data[0])) {
return false;
}
return $response->data[0];
} | [
"public",
"function",
"first",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"httpGetRequest",
"(",
"$",
"this",
"->",
"buildUrl",
"(",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"response",
"->",
"data",
"[",
"0",
"]",
")",
")",
"{",... | Get first item from get response.
@return stdClass|false | [
"Get",
"first",
"item",
"from",
"get",
"response",
"."
] | 88b9d2bb346344495346a42043108627f648a793 | https://github.com/monthly-cloud/monthly-sdk-php/blob/88b9d2bb346344495346a42043108627f648a793/src/Builder.php#L364-L373 |
19,923 | monthly-cloud/monthly-sdk-php | src/Builder.php | Builder.flush | public function flush()
{
$this->filters = [];
$this->include = null;
$this->id = null;
$this->endpoint = null;
$this->sort = null;
$this->fields = null;
$this->pageSize = null;
$this->response = null;
} | php | public function flush()
{
$this->filters = [];
$this->include = null;
$this->id = null;
$this->endpoint = null;
$this->sort = null;
$this->fields = null;
$this->pageSize = null;
$this->response = null;
} | [
"public",
"function",
"flush",
"(",
")",
"{",
"$",
"this",
"->",
"filters",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"include",
"=",
"null",
";",
"$",
"this",
"->",
"id",
"=",
"null",
";",
"$",
"this",
"->",
"endpoint",
"=",
"null",
";",
"$",
"th... | Unset all call parameters.
@return void | [
"Unset",
"all",
"call",
"parameters",
"."
] | 88b9d2bb346344495346a42043108627f648a793 | https://github.com/monthly-cloud/monthly-sdk-php/blob/88b9d2bb346344495346a42043108627f648a793/src/Builder.php#L522-L532 |
19,924 | monthly-cloud/monthly-sdk-php | src/Builder.php | Builder.useCache | public function useCache($caching = null)
{
if (is_null($caching)) {
return ($this->useCache && $this->getCache());
}
$this->useCache = (bool) $caching;
return $this;
} | php | public function useCache($caching = null)
{
if (is_null($caching)) {
return ($this->useCache && $this->getCache());
}
$this->useCache = (bool) $caching;
return $this;
} | [
"public",
"function",
"useCache",
"(",
"$",
"caching",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"caching",
")",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"useCache",
"&&",
"$",
"this",
"->",
"getCache",
"(",
")",
")",
";",
"}",
"$... | Check if cache can be used in this request, or set caching for request.
Apply only to get requests.
@param bool|null $caching
@return self|bool | [
"Check",
"if",
"cache",
"can",
"be",
"used",
"in",
"this",
"request",
"or",
"set",
"caching",
"for",
"request",
"."
] | 88b9d2bb346344495346a42043108627f648a793 | https://github.com/monthly-cloud/monthly-sdk-php/blob/88b9d2bb346344495346a42043108627f648a793/src/Builder.php#L542-L551 |
19,925 | dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php | BaseCoverFishOutput.resetJsonResult | protected function resetJsonResult()
{
$this->jsonResult['skipped'] = false;
$this->jsonResult['pass'] = false;
$this->jsonResult['failure'] = false;
$this->jsonResult['error'] = false;
$this->jsonResult['unknown'] = false;
} | php | protected function resetJsonResult()
{
$this->jsonResult['skipped'] = false;
$this->jsonResult['pass'] = false;
$this->jsonResult['failure'] = false;
$this->jsonResult['error'] = false;
$this->jsonResult['unknown'] = false;
} | [
"protected",
"function",
"resetJsonResult",
"(",
")",
"{",
"$",
"this",
"->",
"jsonResult",
"[",
"'skipped'",
"]",
"=",
"false",
";",
"$",
"this",
"->",
"jsonResult",
"[",
"'pass'",
"]",
"=",
"false",
";",
"$",
"this",
"->",
"jsonResult",
"[",
"'failure'... | initializer for json result set in write progress method | [
"initializer",
"for",
"json",
"result",
"set",
"in",
"write",
"progress",
"method"
] | 779bd399ec8f4cadb3b7854200695c5eb3f5a8ad | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php#L139-L146 |
19,926 | dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php | BaseCoverFishOutput.writeScanPassStatistic | protected function writeScanPassStatistic(CoverFishResult $coverFishResult)
{
$passStatistic = '%s file(s) and %s method(s) scanned, scan succeeded, no problems found.%s';
$passStatistic = sprintf($passStatistic,
$coverFishResult->getFileCount(),
$coverFishResult->getTestCoun... | php | protected function writeScanPassStatistic(CoverFishResult $coverFishResult)
{
$passStatistic = '%s file(s) and %s method(s) scanned, scan succeeded, no problems found.%s';
$passStatistic = sprintf($passStatistic,
$coverFishResult->getFileCount(),
$coverFishResult->getTestCoun... | [
"protected",
"function",
"writeScanPassStatistic",
"(",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"$",
"passStatistic",
"=",
"'%s file(s) and %s method(s) scanned, scan succeeded, no problems found.%s'",
";",
"$",
"passStatistic",
"=",
"sprintf",
"(",
"$",
"passSta... | write scan pass results
@param CoverFishResult $coverFishResult | [
"write",
"scan",
"pass",
"results"
] | 779bd399ec8f4cadb3b7854200695c5eb3f5a8ad | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php#L358-L379 |
19,927 | dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php | BaseCoverFishOutput.writeScanFailStatistic | protected function writeScanFailStatistic(CoverFishResult $coverFishResult)
{
$errorStatistic = '%s file(s) and %s method(s) scanned, coverage failed: %s cover annotation problem(s) found!%s';
$errorStatistic = sprintf($errorStatistic,
$coverFishResult->getFileCount(),
$cover... | php | protected function writeScanFailStatistic(CoverFishResult $coverFishResult)
{
$errorStatistic = '%s file(s) and %s method(s) scanned, coverage failed: %s cover annotation problem(s) found!%s';
$errorStatistic = sprintf($errorStatistic,
$coverFishResult->getFileCount(),
$cover... | [
"protected",
"function",
"writeScanFailStatistic",
"(",
"CoverFishResult",
"$",
"coverFishResult",
")",
"{",
"$",
"errorStatistic",
"=",
"'%s file(s) and %s method(s) scanned, coverage failed: %s cover annotation problem(s) found!%s'",
";",
"$",
"errorStatistic",
"=",
"sprintf",
... | write scan fail result
@param CoverFishResult $coverFishResult
@throws CoverFishFailExit | [
"write",
"scan",
"fail",
"result"
] | 779bd399ec8f4cadb3b7854200695c5eb3f5a8ad | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/Base/BaseCoverFishOutput.php#L388-L413 |
19,928 | joseph-walker/vector | src/Lib/Arrays.php | Arrays.__zipWith | protected static function __zipWith(callable $f, array $a, array $b) : array
{
$result = [];
while (($ai = array_shift($a)) !== null && ($bi = array_shift($b)) !== null) {
$result[] = $f($ai, $bi);
}
return $result;
} | php | protected static function __zipWith(callable $f, array $a, array $b) : array
{
$result = [];
while (($ai = array_shift($a)) !== null && ($bi = array_shift($b)) !== null) {
$result[] = $f($ai, $bi);
}
return $result;
} | [
"protected",
"static",
"function",
"__zipWith",
"(",
"callable",
"$",
"f",
",",
"array",
"$",
"a",
",",
"array",
"$",
"b",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"while",
"(",
"(",
"$",
"ai",
"=",
"array_shift",
"(",
"$",
"a",... | Custom Array Zip
Given two arrays a and b, and some combinator f, combine the arrays using the combinator
f(ai, bi) into a new array c. If a and b are not the same length, the resultant array will
always be the same length as the shorter array, i.e. the zip stops when it runs out of pairs.
@example
$combinator = func... | [
"Custom",
"Array",
"Zip"
] | e349aa2e9e0535b1993f9fffc0476e7fd8e113fc | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Arrays.php#L522-L531 |
19,929 | joseph-walker/vector | src/Lib/Arrays.php | Arrays.__dropWhile | protected static function __dropWhile(callable $predicate, array $list) : array
{
foreach ($list as $item) {
if ($predicate($item)) {
array_shift($list);
} else {
break;
}
}
return $list;
} | php | protected static function __dropWhile(callable $predicate, array $list) : array
{
foreach ($list as $item) {
if ($predicate($item)) {
array_shift($list);
} else {
break;
}
}
return $list;
} | [
"protected",
"static",
"function",
"__dropWhile",
"(",
"callable",
"$",
"predicate",
",",
"array",
"$",
"list",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"list",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"predicate",
"(",
"$",
"item",
")",
")",... | Drop Elements with Predicate
Given some function that returns true or false, drop elements from an array starting
at the front, testing each element along the way, until that function returns false.
Return the array without all of those elements.
@example
$greaterThanOne = function($n) { return $n > 1; };
Arrays::dro... | [
"Drop",
"Elements",
"with",
"Predicate"
] | e349aa2e9e0535b1993f9fffc0476e7fd8e113fc | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Arrays.php#L632-L643 |
19,930 | joseph-walker/vector | src/Lib/Arrays.php | Arrays.__takeWhile | protected static function __takeWhile(callable $predicate, array $list) : array
{
$result = [];
foreach ($list as $item) {
if ($predicate($item)) {
$result[] = $item;
} else {
break;
}
}
return $result;
} | php | protected static function __takeWhile(callable $predicate, array $list) : array
{
$result = [];
foreach ($list as $item) {
if ($predicate($item)) {
$result[] = $item;
} else {
break;
}
}
return $result;
} | [
"protected",
"static",
"function",
"__takeWhile",
"(",
"callable",
"$",
"predicate",
",",
"array",
"$",
"list",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"pr... | Take Elements with Predicate
Given some function that returns true or false, return the first elements of the array
that all pass the test, until the test fails.
@example
$greaterThanOne = function($n) { return $n > 1; };
Arrays::takeWhile($greaterThanOne, [5, 5, 5, 1, 5, 5]); // [5, 5, 5]
@type (a -> Bool) -> [a] -... | [
"Take",
"Elements",
"with",
"Predicate"
] | e349aa2e9e0535b1993f9fffc0476e7fd8e113fc | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Lib/Arrays.php#L681-L694 |
19,931 | 2amigos/yiifoundation | helpers/Html.php | Html.thumb | public static function thumb($src, $url = '#', $htmlOptions = array())
{
static::addCssClass($htmlOptions, 'th');
return \CHtml::link(\CHtml::image($src), $url, $htmlOptions);
} | php | public static function thumb($src, $url = '#', $htmlOptions = array())
{
static::addCssClass($htmlOptions, 'th');
return \CHtml::link(\CHtml::image($src), $url, $htmlOptions);
} | [
"public",
"static",
"function",
"thumb",
"(",
"$",
"src",
",",
"$",
"url",
"=",
"'#'",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"static",
"::",
"addCssClass",
"(",
"$",
"htmlOptions",
",",
"'th'",
")",
";",
"return",
"\\",
"CHtml",
... | Renders a Foundation thumbnail
@param $src
@param string $url
@param array $htmlOptions
@return string | [
"Renders",
"a",
"Foundation",
"thumbnail"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Html.php#L161-L165 |
19,932 | 2amigos/yiifoundation | helpers/Html.php | Html.addCssClass | public static function addCssClass(&$options, $class)
{
if (isset($options['class'])) {
$classes = ' ' . $options['class'] . ' ';
if (($pos = strpos($classes, ' ' . $class . ' ')) === false) {
$options['class'] .= ' ' . $class;
}
} else {
... | php | public static function addCssClass(&$options, $class)
{
if (isset($options['class'])) {
$classes = ' ' . $options['class'] . ' ';
if (($pos = strpos($classes, ' ' . $class . ' ')) === false) {
$options['class'] .= ' ' . $class;
}
} else {
... | [
"public",
"static",
"function",
"addCssClass",
"(",
"&",
"$",
"options",
",",
"$",
"class",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'class'",
"]",
")",
")",
"{",
"$",
"classes",
"=",
"' '",
".",
"$",
"options",
"[",
"'class'",
"]",... | Adds a CSS class to the specified options.
If the CSS class is already in the options, it will not be added again.
@param array $options the options to be modified.
@param string $class the CSS class to be added | [
"Adds",
"a",
"CSS",
"class",
"to",
"the",
"specified",
"options",
".",
"If",
"the",
"CSS",
"class",
"is",
"already",
"in",
"the",
"options",
"it",
"will",
"not",
"be",
"added",
"again",
"."
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Html.php#L173-L183 |
19,933 | nyeholt/silverstripe-external-content | remoteclients/WebApiClient.php | WebApiClient.callUrl | public function callUrl($url, $args = array(), $returnType = 'raw', $requestType = 'GET', $cache = 300, $enctype = Zend_Http_Client::ENC_URLENCODED)
{
$body = null;
// use the method params to try caching the results
// need to add in the baseUrl we're connecting to, and any global params
// because the cache ... | php | public function callUrl($url, $args = array(), $returnType = 'raw', $requestType = 'GET', $cache = 300, $enctype = Zend_Http_Client::ENC_URLENCODED)
{
$body = null;
// use the method params to try caching the results
// need to add in the baseUrl we're connecting to, and any global params
// because the cache ... | [
"public",
"function",
"callUrl",
"(",
"$",
"url",
",",
"$",
"args",
"=",
"array",
"(",
")",
",",
"$",
"returnType",
"=",
"'raw'",
",",
"$",
"requestType",
"=",
"'GET'",
",",
"$",
"cache",
"=",
"300",
",",
"$",
"enctype",
"=",
"Zend_Http_Client",
"::"... | Call a URL directly, without it being mapped to a configured web method.
This differs from the above in that the caller already knows what
URL is trying to be called, so we can bypass the business of mapping
arguments all over the place.
We still maintain the globalParams for this client though
@param $url
The URL t... | [
"Call",
"a",
"URL",
"directly",
"without",
"it",
"being",
"mapped",
"to",
"a",
"configured",
"web",
"method",
"."
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/remoteclients/WebApiClient.php#L316-L374 |
19,934 | nyeholt/silverstripe-external-content | remoteclients/WebApiClient.php | WebApiClient.getClient | protected function getClient($uri)
{
// TODO For some reason the Alfresco client goes into an infinite loop when returning
// the children of an item (when you call getChildren on the company home)
// it returns itself as its own child, unless you recreate the client. It seems
// to maintain all the request bo... | php | protected function getClient($uri)
{
// TODO For some reason the Alfresco client goes into an infinite loop when returning
// the children of an item (when you call getChildren on the company home)
// it returns itself as its own child, unless you recreate the client. It seems
// to maintain all the request bo... | [
"protected",
"function",
"getClient",
"(",
"$",
"uri",
")",
"{",
"// TODO For some reason the Alfresco client goes into an infinite loop when returning",
"// the children of an item (when you call getChildren on the company home)",
"// it returns itself as its own child, unless you recreate the ... | Create and return the http client, defined in a separate method
for testing purposes
@return Zend_Http_Client | [
"Create",
"and",
"return",
"the",
"http",
"client",
"defined",
"in",
"a",
"separate",
"method",
"for",
"testing",
"purposes"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/remoteclients/WebApiClient.php#L389-L419 |
19,935 | zircote/AMQP | library/AMQP/Connection.php | Connection.waitFrame | protected function waitFrame()
{
$frameType = $this->input->readOctet();
$channel = $this->input->readShort();
$size = $this->input->readLong();
$payload = $this->input->read($size);
$ch = $this->input->readOctet();
if ($ch != 0xCE) {
throw new \Exception... | php | protected function waitFrame()
{
$frameType = $this->input->readOctet();
$channel = $this->input->readShort();
$size = $this->input->readLong();
$payload = $this->input->read($size);
$ch = $this->input->readOctet();
if ($ch != 0xCE) {
throw new \Exception... | [
"protected",
"function",
"waitFrame",
"(",
")",
"{",
"$",
"frameType",
"=",
"$",
"this",
"->",
"input",
"->",
"readOctet",
"(",
")",
";",
"$",
"channel",
"=",
"$",
"this",
"->",
"input",
"->",
"readShort",
"(",
")",
";",
"$",
"size",
"=",
"$",
"thi... | Wait for a frame from the server
@return array
@throws \Exception | [
"Wait",
"for",
"a",
"frame",
"from",
"the",
"server"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L513-L530 |
19,936 | zircote/AMQP | library/AMQP/Connection.php | Connection.waitChannel | public function waitChannel($channelId)
{
while (true) {
list($frameType, $frameChannel, $payload) = $this->waitFrame();
if ($frameChannel == $channelId) {
return array($frameType, $payload);
}
/**
* Not the channel we were looking... | php | public function waitChannel($channelId)
{
while (true) {
list($frameType, $frameChannel, $payload) = $this->waitFrame();
if ($frameChannel == $channelId) {
return array($frameType, $payload);
}
/**
* Not the channel we were looking... | [
"public",
"function",
"waitChannel",
"(",
"$",
"channelId",
")",
"{",
"while",
"(",
"true",
")",
"{",
"list",
"(",
"$",
"frameType",
",",
"$",
"frameChannel",
",",
"$",
"payload",
")",
"=",
"$",
"this",
"->",
"waitFrame",
"(",
")",
";",
"if",
"(",
... | Wait for a frame from the server destined for a particular channel.
@param $channelId
@return array | [
"Wait",
"for",
"a",
"frame",
"from",
"the",
"server",
"destined",
"for",
"a",
"particular",
"channel",
"."
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L539-L565 |
19,937 | zircote/AMQP | library/AMQP/Connection.php | Connection.channel | public function channel($channelId = null)
{
if (isset($this->channels[$channelId])) {
return $this->channels[$channelId];
} else {
$channelId = $channelId ? : $this->getFreeChannelId();
$ch = new Channel($this->connection, $channelId);
return $this->c... | php | public function channel($channelId = null)
{
if (isset($this->channels[$channelId])) {
return $this->channels[$channelId];
} else {
$channelId = $channelId ? : $this->getFreeChannelId();
$ch = new Channel($this->connection, $channelId);
return $this->c... | [
"public",
"function",
"channel",
"(",
"$",
"channelId",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"channels",
"[",
"$",
"channelId",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"channels",
"[",
"$",
"channelId",
"]",
"... | Fetch a Channel object identified by the numeric channel_id, or
create that object if it doesn't already exist.
@param string|null $channelId
@return \AMQP\Channel | [
"Fetch",
"a",
"Channel",
"object",
"identified",
"by",
"the",
"numeric",
"channel_id",
"or",
"create",
"that",
"object",
"if",
"it",
"doesn",
"t",
"already",
"exist",
"."
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L575-L584 |
19,938 | zircote/AMQP | library/AMQP/Connection.php | Connection.close | public function close($replyCode = 0, $replyText = '', $methodSig = array(0, 0))
{
$args = new Writer();
$args->writeShort($replyCode);
$args->writeShortStr($replyText);
$args->writeShort($methodSig[0]); // class_id
$args->writeShort($methodSig[1]); // method_id
$this... | php | public function close($replyCode = 0, $replyText = '', $methodSig = array(0, 0))
{
$args = new Writer();
$args->writeShort($replyCode);
$args->writeShortStr($replyText);
$args->writeShort($methodSig[0]); // class_id
$args->writeShort($methodSig[1]); // method_id
$this... | [
"public",
"function",
"close",
"(",
"$",
"replyCode",
"=",
"0",
",",
"$",
"replyText",
"=",
"''",
",",
"$",
"methodSig",
"=",
"array",
"(",
"0",
",",
"0",
")",
")",
"{",
"$",
"args",
"=",
"new",
"Writer",
"(",
")",
";",
"$",
"args",
"->",
"writ... | request a connection close
@param int $replyCode
@param string $replyText
@param array $methodSig
@return mixed|null | [
"request",
"a",
"connection",
"close"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L595-L608 |
19,939 | zircote/AMQP | library/AMQP/Connection.php | Connection.openOk | protected function openOk(Reader $args)
{
$this->knownHosts = $args->readShortstr();
if ($this->debug) {
Helper::debugMsg("Open OK! known_hosts: " . $this->knownHosts);
}
return null;
} | php | protected function openOk(Reader $args)
{
$this->knownHosts = $args->readShortstr();
if ($this->debug) {
Helper::debugMsg("Open OK! known_hosts: " . $this->knownHosts);
}
return null;
} | [
"protected",
"function",
"openOk",
"(",
"Reader",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"knownHosts",
"=",
"$",
"args",
"->",
"readShortstr",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"{",
"Helper",
"::",
"debugMsg",
"(",
"\"Open... | signal that the connection is ready | [
"signal",
"that",
"the",
"connection",
"is",
"ready"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L675-L683 |
19,940 | zircote/AMQP | library/AMQP/Connection.php | Connection.redirect | protected function redirect(Reader $args)
{
$host = $args->readShortstr();
$this->knownHosts = $args->readShortstr();
if ($this->debug) {
Helper::debugMsg(
sprintf(
'Redirected to [%s], known_hosts [%s]',
$host, $this->known... | php | protected function redirect(Reader $args)
{
$host = $args->readShortstr();
$this->knownHosts = $args->readShortstr();
if ($this->debug) {
Helper::debugMsg(
sprintf(
'Redirected to [%s], known_hosts [%s]',
$host, $this->known... | [
"protected",
"function",
"redirect",
"(",
"Reader",
"$",
"args",
")",
"{",
"$",
"host",
"=",
"$",
"args",
"->",
"readShortstr",
"(",
")",
";",
"$",
"this",
"->",
"knownHosts",
"=",
"$",
"args",
"->",
"readShortstr",
"(",
")",
";",
"if",
"(",
"$",
"... | asks the client to use a different server
@param \AMQP\Wire\Reader $args
@return string | [
"asks",
"the",
"client",
"to",
"use",
"a",
"different",
"server"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L692-L705 |
19,941 | zircote/AMQP | library/AMQP/Connection.php | Connection._xSecureOk | protected function _xSecureOk($response)
{
$args = new Writer();
$args->writeLongStr($response);
$this->sendMethodFrame(array(10, 21), $args);
} | php | protected function _xSecureOk($response)
{
$args = new Writer();
$args->writeLongStr($response);
$this->sendMethodFrame(array(10, 21), $args);
} | [
"protected",
"function",
"_xSecureOk",
"(",
"$",
"response",
")",
"{",
"$",
"args",
"=",
"new",
"Writer",
"(",
")",
";",
"$",
"args",
"->",
"writeLongStr",
"(",
"$",
"response",
")",
";",
"$",
"this",
"->",
"sendMethodFrame",
"(",
"array",
"(",
"10",
... | security mechanism response
@param string $response | [
"security",
"mechanism",
"response"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L722-L727 |
19,942 | zircote/AMQP | library/AMQP/Connection.php | Connection.start | protected function start(Reader $args)
{
$this->versionMajor = $args->readOctet();
$this->versionMinor = $args->readOctet();
$this->serverProperties = $args->readTable();
$this->mechanisms = explode(" ", $args->readLongstr());
$this->locales = explode(" ", $args->readLongstr(... | php | protected function start(Reader $args)
{
$this->versionMajor = $args->readOctet();
$this->versionMinor = $args->readOctet();
$this->serverProperties = $args->readTable();
$this->mechanisms = explode(" ", $args->readLongstr());
$this->locales = explode(" ", $args->readLongstr(... | [
"protected",
"function",
"start",
"(",
"Reader",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"versionMajor",
"=",
"$",
"args",
"->",
"readOctet",
"(",
")",
";",
"$",
"this",
"->",
"versionMinor",
"=",
"$",
"args",
"->",
"readOctet",
"(",
")",
";",
"$",... | start connection negotiation | [
"start",
"connection",
"negotiation"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L732-L753 |
19,943 | zircote/AMQP | library/AMQP/Connection.php | Connection.tune | protected function tune(Reader $args)
{
$v = $args->readShort();
if ($v) {
$this->channelMax = $v;
}
$v = $args->readLong();
if ($v) {
$this->frameMax = $v;
}
$this->heartbeat = $args->readShort();
$this->xTuneOk($this->chan... | php | protected function tune(Reader $args)
{
$v = $args->readShort();
if ($v) {
$this->channelMax = $v;
}
$v = $args->readLong();
if ($v) {
$this->frameMax = $v;
}
$this->heartbeat = $args->readShort();
$this->xTuneOk($this->chan... | [
"protected",
"function",
"tune",
"(",
"Reader",
"$",
"args",
")",
"{",
"$",
"v",
"=",
"$",
"args",
"->",
"readShort",
"(",
")",
";",
"if",
"(",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"channelMax",
"=",
"$",
"v",
";",
"}",
"$",
"v",
"=",
"$",
... | propose connection tuning parameters
@param \AMQP\Wire\Reader $args | [
"propose",
"connection",
"tuning",
"parameters"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L776-L792 |
19,944 | zircote/AMQP | library/AMQP/Connection.php | Connection.xTuneOk | protected function xTuneOk($channelMax, $frameMax, $heartbeat)
{
$args = new Writer();
$args->writeShort($channelMax);
$args->writeLong($frameMax);
$args->writeShort($heartbeat);
$this->sendMethodFrame(array(10, 31), $args);
$this->waitTuneOk = False;
} | php | protected function xTuneOk($channelMax, $frameMax, $heartbeat)
{
$args = new Writer();
$args->writeShort($channelMax);
$args->writeLong($frameMax);
$args->writeShort($heartbeat);
$this->sendMethodFrame(array(10, 31), $args);
$this->waitTuneOk = False;
} | [
"protected",
"function",
"xTuneOk",
"(",
"$",
"channelMax",
",",
"$",
"frameMax",
",",
"$",
"heartbeat",
")",
"{",
"$",
"args",
"=",
"new",
"Writer",
"(",
")",
";",
"$",
"args",
"->",
"writeShort",
"(",
"$",
"channelMax",
")",
";",
"$",
"args",
"->",... | negotiate connection tuning parameters
@param $channelMax
@param $frameMax
@param $heartbeat | [
"negotiate",
"connection",
"tuning",
"parameters"
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Connection.php#L801-L809 |
19,945 | freearhey/sparql | src/QueryBuilder.php | QueryBuilder.service | public function service( $service, $subject, $predicate = null, $object = null ) {
$this->graphBuilder->service( $service, $subject, $predicate, $object );
return $this;
} | php | public function service( $service, $subject, $predicate = null, $object = null ) {
$this->graphBuilder->service( $service, $subject, $predicate, $object );
return $this;
} | [
"public",
"function",
"service",
"(",
"$",
"service",
",",
"$",
"subject",
",",
"$",
"predicate",
"=",
"null",
",",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"graphBuilder",
"->",
"service",
"(",
"$",
"service",
",",
"$",
"subject",
",... | Adds the given graph or triple as an service condition.
@param string|GraphBuilder $subject
@param string|null $predicate
@param string|null $object
@return self
@throws InvalidArgumentException | [
"Adds",
"the",
"given",
"graph",
"or",
"triple",
"as",
"an",
"service",
"condition",
"."
] | 622a8ea661dc5939122b0e8b430a6a94b3bc49c7 | https://github.com/freearhey/sparql/blob/622a8ea661dc5939122b0e8b430a6a94b3bc49c7/src/QueryBuilder.php#L257-L260 |
19,946 | gries/rcon | src/Message.php | Message.convertToRconData | public function convertToRconData($id)
{
$idAndTypePacked = pack('VV', $id, $this->type);
$endOfMessage = chr(0) . chr(0);
$message = $idAndTypePacked . $this->body . $endOfMessage;
$data = pack("V", strlen($message)) . $message;
return $data;
} | php | public function convertToRconData($id)
{
$idAndTypePacked = pack('VV', $id, $this->type);
$endOfMessage = chr(0) . chr(0);
$message = $idAndTypePacked . $this->body . $endOfMessage;
$data = pack("V", strlen($message)) . $message;
return $data;
} | [
"public",
"function",
"convertToRconData",
"(",
"$",
"id",
")",
"{",
"$",
"idAndTypePacked",
"=",
"pack",
"(",
"'VV'",
",",
"$",
"id",
",",
"$",
"this",
"->",
"type",
")",
";",
"$",
"endOfMessage",
"=",
"chr",
"(",
"0",
")",
".",
"chr",
"(",
"0",
... | The message id used for this message.
This will be encoded in the RconData.
@param int $id
@return string | [
"The",
"message",
"id",
"used",
"for",
"this",
"message",
".",
"This",
"will",
"be",
"encoded",
"in",
"the",
"RconData",
"."
] | 7fada05b329d89542692af00ab80db02ad59d45d | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Message.php#L82-L92 |
19,947 | inc2734/wp-seo | src/App/Controller/Posts.php | Posts._add_meta_boxes | public function _add_meta_boxes( $post_type, $post ) {
$post_type_object = get_post_type_object( $post_type );
if ( empty( $post_type_object ) || empty( $post_type_object->public ) ) {
return;
}
add_meta_box(
'wp-seo',
__( 'SEO', 'inc2734-wp-seo' ),
array( $this, '_wp_seo_meta_box' ),
$post_type... | php | public function _add_meta_boxes( $post_type, $post ) {
$post_type_object = get_post_type_object( $post_type );
if ( empty( $post_type_object ) || empty( $post_type_object->public ) ) {
return;
}
add_meta_box(
'wp-seo',
__( 'SEO', 'inc2734-wp-seo' ),
array( $this, '_wp_seo_meta_box' ),
$post_type... | [
"public",
"function",
"_add_meta_boxes",
"(",
"$",
"post_type",
",",
"$",
"post",
")",
"{",
"$",
"post_type_object",
"=",
"get_post_type_object",
"(",
"$",
"post_type",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"post_type_object",
")",
"||",
"empty",
"(",
"$... | Add meta box in pages of public post type
@param [string] $post_type
@param [WP_Post] $post
@return void | [
"Add",
"meta",
"box",
"in",
"pages",
"of",
"public",
"post",
"type"
] | d08f3fad346751232859c335d289237a82f9eef3 | https://github.com/inc2734/wp-seo/blob/d08f3fad346751232859c335d289237a82f9eef3/src/App/Controller/Posts.php#L25-L38 |
19,948 | inc2734/wp-seo | src/App/Controller/Posts.php | Posts._wp_seo_meta_box | public function _wp_seo_meta_box( $post ) {
?>
<?php wp_nonce_field( 'wp-seo-meta-box-action', 'wp-seo-meta-box-nonce' ); ?>
<p>
<label for="wp-seo-meta-description">
<b><?php esc_html_e( 'Meta description', 'inc2734-wp-seo' ); ?></b>
</label><br />
<input
type="text"
name="wp-seo-meta-descri... | php | public function _wp_seo_meta_box( $post ) {
?>
<?php wp_nonce_field( 'wp-seo-meta-box-action', 'wp-seo-meta-box-nonce' ); ?>
<p>
<label for="wp-seo-meta-description">
<b><?php esc_html_e( 'Meta description', 'inc2734-wp-seo' ); ?></b>
</label><br />
<input
type="text"
name="wp-seo-meta-descri... | [
"public",
"function",
"_wp_seo_meta_box",
"(",
"$",
"post",
")",
"{",
"?>\n\t\t<?php",
"wp_nonce_field",
"(",
"'wp-seo-meta-box-action'",
",",
"'wp-seo-meta-box-nonce'",
")",
";",
"?>\n\t\t<p>\n\t\t\t<label for=\"wp-seo-meta-description\">\n\t\t\t\t<b><?php",
"esc_html_e",
"(",
... | Display meta box
@param [WP_Post] $post
@return void | [
"Display",
"meta",
"box"
] | d08f3fad346751232859c335d289237a82f9eef3 | https://github.com/inc2734/wp-seo/blob/d08f3fad346751232859c335d289237a82f9eef3/src/App/Controller/Posts.php#L46-L84 |
19,949 | inc2734/wp-seo | src/App/Controller/Posts.php | Posts._save_meta_description | public function _save_meta_description( $post_id ) {
if ( empty( $_POST['wp-seo-meta-box-nonce'] ) ) {
return;
}
if ( ! wp_verify_nonce( wp_unslash( filter_input( INPUT_POST, 'wp-seo-meta-box-nonce' ) ), 'wp-seo-meta-box-action' ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
... | php | public function _save_meta_description( $post_id ) {
if ( empty( $_POST['wp-seo-meta-box-nonce'] ) ) {
return;
}
if ( ! wp_verify_nonce( wp_unslash( filter_input( INPUT_POST, 'wp-seo-meta-box-nonce' ) ), 'wp-seo-meta-box-action' ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
... | [
"public",
"function",
"_save_meta_description",
"(",
"$",
"post_id",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"_POST",
"[",
"'wp-seo-meta-box-nonce'",
"]",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"wp_verify_nonce",
"(",
"wp_unslash",
"(",
"filter... | Save meta description
@param [int] $post_id
@return void | [
"Save",
"meta",
"description"
] | d08f3fad346751232859c335d289237a82f9eef3 | https://github.com/inc2734/wp-seo/blob/d08f3fad346751232859c335d289237a82f9eef3/src/App/Controller/Posts.php#L92-L119 |
19,950 | inc2734/wp-seo | src/App/Controller/Posts.php | Posts._save_meta_robots | public function _save_meta_robots( $post_id ) {
if ( empty( $_POST['wp-seo-meta-box-nonce'] ) ) {
return;
}
if ( ! wp_verify_nonce( wp_unslash( filter_input( INPUT_POST, 'wp-seo-meta-box-nonce' ) ), 'wp-seo-meta-box-action' ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
retu... | php | public function _save_meta_robots( $post_id ) {
if ( empty( $_POST['wp-seo-meta-box-nonce'] ) ) {
return;
}
if ( ! wp_verify_nonce( wp_unslash( filter_input( INPUT_POST, 'wp-seo-meta-box-nonce' ) ), 'wp-seo-meta-box-action' ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
retu... | [
"public",
"function",
"_save_meta_robots",
"(",
"$",
"post_id",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"_POST",
"[",
"'wp-seo-meta-box-nonce'",
"]",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"wp_verify_nonce",
"(",
"wp_unslash",
"(",
"filter_inpu... | Save meta robots
@param [int] $post_id
@return void | [
"Save",
"meta",
"robots"
] | d08f3fad346751232859c335d289237a82f9eef3 | https://github.com/inc2734/wp-seo/blob/d08f3fad346751232859c335d289237a82f9eef3/src/App/Controller/Posts.php#L127-L151 |
19,951 | jfusion/org.jfusion.framework | src/Api/Platform.php | Platform.getTypeInstance | public static function getTypeInstance($type)
{
$type = ucfirst(strtolower($type));
if (!isset(self::$instances[$type])) {
$class = 'JFusion\\Api\\Platform\\' . $type;
self::$instances[$type] = new $class();
}
return self::$instances[$type];
} | php | public static function getTypeInstance($type)
{
$type = ucfirst(strtolower($type));
if (!isset(self::$instances[$type])) {
$class = 'JFusion\\Api\\Platform\\' . $type;
self::$instances[$type] = new $class();
}
return self::$instances[$type];
} | [
"public",
"static",
"function",
"getTypeInstance",
"(",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"type",
")",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instances",
"[",
"$",
"type",
"]",
")"... | Get a platform type object.
@param string $type
@return Platform | [
"Get",
"a",
"platform",
"type",
"object",
"."
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Platform.php#L43-L51 |
19,952 | lode/fem | src/text.php | text.generate_token | public static function generate_token($length) {
$byte_length = ($length / 2);
$new_token = bin2hex(openssl_random_pseudo_bytes($byte_length, $strong_enough));
if ($strong_enough == false || empty($new_token)) {
$exception = bootstrap::get_library('exception');
throw new $exception('can not generate cryptographi... | php | public static function generate_token($length) {
$byte_length = ($length / 2);
$new_token = bin2hex(openssl_random_pseudo_bytes($byte_length, $strong_enough));
if ($strong_enough == false || empty($new_token)) {
$exception = bootstrap::get_library('exception');
throw new $exception('can not generate cryptographi... | [
"public",
"static",
"function",
"generate_token",
"(",
"$",
"length",
")",
"{",
"$",
"byte_length",
"=",
"(",
"$",
"length",
"/",
"2",
")",
";",
"$",
"new_token",
"=",
"bin2hex",
"(",
"openssl_random_pseudo_bytes",
"(",
"$",
"byte_length",
",",
"$",
"stron... | generates cryptographically strong tokens
@param int $length of the returned string
@return string | [
"generates",
"cryptographically",
"strong",
"tokens"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/text.php#L13-L22 |
19,953 | factorio-item-browser/export-data | src/Entity/Icon.php | Icon.setLayers | public function setLayers(array $layers)
{
$this->layers = array_values(array_filter($layers, function ($layer): bool {
return $layer instanceof Layer;
}));
return $this;
} | php | public function setLayers(array $layers)
{
$this->layers = array_values(array_filter($layers, function ($layer): bool {
return $layer instanceof Layer;
}));
return $this;
} | [
"public",
"function",
"setLayers",
"(",
"array",
"$",
"layers",
")",
"{",
"$",
"this",
"->",
"layers",
"=",
"array_values",
"(",
"array_filter",
"(",
"$",
"layers",
",",
"function",
"(",
"$",
"layer",
")",
":",
"bool",
"{",
"return",
"$",
"layer",
"ins... | Sets the layers of the icon.
@param array|Layer[] $layers
@return $this Implementing fluent interface. | [
"Sets",
"the",
"layers",
"of",
"the",
"icon",
"."
] | 1413b2eed0fbfed0521457ac7ef0d668ac30c212 | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Icon.php#L98-L104 |
19,954 | askupasoftware/amarkal | Loaders/AssetLoader.php | AssetLoader.register_asset | public function register_asset( \Amarkal\Assets\AbstractAsset $new_asset )
{
if( NULL == $this->assets ) {
$this->assets = array();
$this->assets[] = $new_asset;
}
else {
foreach( $this->assets as $asset ) {
if( $asset->handle == $new_asset... | php | public function register_asset( \Amarkal\Assets\AbstractAsset $new_asset )
{
if( NULL == $this->assets ) {
$this->assets = array();
$this->assets[] = $new_asset;
}
else {
foreach( $this->assets as $asset ) {
if( $asset->handle == $new_asset... | [
"public",
"function",
"register_asset",
"(",
"\\",
"Amarkal",
"\\",
"Assets",
"\\",
"AbstractAsset",
"$",
"new_asset",
")",
"{",
"if",
"(",
"NULL",
"==",
"$",
"this",
"->",
"assets",
")",
"{",
"$",
"this",
"->",
"assets",
"=",
"array",
"(",
")",
";",
... | Register a single asset
@param \Amarkal\Assets\AbstractAsset $new_asset The asset to enqueue
@throws DuplicateAssetException If the a duplicated asset handle exists | [
"Register",
"a",
"single",
"asset"
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Loaders/AssetLoader.php#L79-L93 |
19,955 | webforge-labs/psc-cms | lib/Psc/Code/Code.php | Code.expandNamespace | public static function expandNamespace($classOrClassName, $expandNamespace) {
if (mb_strpos($classOrClassName, '\\') !== 0 && self::getNamespace($classOrClassName) === NULL) {
return $expandNamespace.'\\'.ltrim($classOrClassName,'\\');
}
return $classOrClassName;
} | php | public static function expandNamespace($classOrClassName, $expandNamespace) {
if (mb_strpos($classOrClassName, '\\') !== 0 && self::getNamespace($classOrClassName) === NULL) {
return $expandNamespace.'\\'.ltrim($classOrClassName,'\\');
}
return $classOrClassName;
} | [
"public",
"static",
"function",
"expandNamespace",
"(",
"$",
"classOrClassName",
",",
"$",
"expandNamespace",
")",
"{",
"if",
"(",
"mb_strpos",
"(",
"$",
"classOrClassName",
",",
"'\\\\'",
")",
"!==",
"0",
"&&",
"self",
"::",
"getNamespace",
"(",
"$",
"class... | Erweitert einen nicht qualifzierten Klassenamen mit einem Namespace
nicht qualifizierte Klassenamen sind diese ohne \ am Anfang und ohne self::getNamespace()
wird root als leer übergeben, ist nicht gewährleistet, dass für alle parameter ein \ vor der Klasse steht:
z. B. (blubb\className) wird nicht \blubb\className d... | [
"Erweitert",
"einen",
"nicht",
"qualifzierten",
"Klassenamen",
"mit",
"einem",
"Namespace"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Code.php#L223-L229 |
19,956 | Chill-project/Main | Security/Authorization/AuthorizationHelper.php | AuthorizationHelper.userCanReachCenter | public function userCanReachCenter(User $user, Center $center)
{
foreach ($user->getGroupCenters() as $groupCenter) {
if ($center->getId() === $groupCenter->getCenter()->getId()) {
return true;
}
}
return false;
} | php | public function userCanReachCenter(User $user, Center $center)
{
foreach ($user->getGroupCenters() as $groupCenter) {
if ($center->getId() === $groupCenter->getCenter()->getId()) {
return true;
}
}
return false;
} | [
"public",
"function",
"userCanReachCenter",
"(",
"User",
"$",
"user",
",",
"Center",
"$",
"center",
")",
"{",
"foreach",
"(",
"$",
"user",
"->",
"getGroupCenters",
"(",
")",
"as",
"$",
"groupCenter",
")",
"{",
"if",
"(",
"$",
"center",
"->",
"getId",
"... | Determines if a user is active on this center
@param User $user
@param Center $center
@return bool | [
"Determines",
"if",
"a",
"user",
"is",
"active",
"on",
"this",
"center"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Security/Authorization/AuthorizationHelper.php#L60-L70 |
19,957 | Chill-project/Main | Security/Authorization/AuthorizationHelper.php | AuthorizationHelper.getReachableCenters | public function getReachableCenters(User $user, Role $role, Scope $scope = null)
{
$centers = array();
foreach ($user->getGroupCenters() as $groupCenter){
$permissionGroup = $groupCenter->getPermissionsGroup();
//iterate on roleScopes
foreach($permissionG... | php | public function getReachableCenters(User $user, Role $role, Scope $scope = null)
{
$centers = array();
foreach ($user->getGroupCenters() as $groupCenter){
$permissionGroup = $groupCenter->getPermissionsGroup();
//iterate on roleScopes
foreach($permissionG... | [
"public",
"function",
"getReachableCenters",
"(",
"User",
"$",
"user",
",",
"Role",
"$",
"role",
",",
"Scope",
"$",
"scope",
"=",
"null",
")",
"{",
"$",
"centers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"user",
"->",
"getGroupCenters",
"(",
... | Get reachable Centers for the given user, role,
and optionnaly Scope
@param User $user
@param Role $role
@param null|Scope $scope
@return Center[] | [
"Get",
"reachable",
"Centers",
"for",
"the",
"given",
"user",
"role",
"and",
"optionnaly",
"Scope"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Security/Authorization/AuthorizationHelper.php#L136-L162 |
19,958 | Chill-project/Main | Security/Authorization/AuthorizationHelper.php | AuthorizationHelper.getReachableScopes | public function getReachableScopes(User $user, Role $role, Center $center)
{
return $this->getReachableCircles($user, $role, $center);
} | php | public function getReachableScopes(User $user, Role $role, Center $center)
{
return $this->getReachableCircles($user, $role, $center);
} | [
"public",
"function",
"getReachableScopes",
"(",
"User",
"$",
"user",
",",
"Role",
"$",
"role",
",",
"Center",
"$",
"center",
")",
"{",
"return",
"$",
"this",
"->",
"getReachableCircles",
"(",
"$",
"user",
",",
"$",
"role",
",",
"$",
"center",
")",
";"... | Return all reachable scope for a given user, center and role
@deprecated Use getReachableCircles
@param User $user
@param Role $role
@param Center $center
@return Scope[] | [
"Return",
"all",
"reachable",
"scope",
"for",
"a",
"given",
"user",
"center",
"and",
"role"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Security/Authorization/AuthorizationHelper.php#L174-L177 |
19,959 | Chill-project/Main | Security/Authorization/AuthorizationHelper.php | AuthorizationHelper.getReachableCircles | public function getReachableCircles(User $user, Role $role, Center $center)
{
$scopes = array();
foreach ($user->getGroupCenters() as $groupCenter){
if ($center->getId() === $groupCenter->getCenter()->getId()) {
//iterate on permissionGroup
$permi... | php | public function getReachableCircles(User $user, Role $role, Center $center)
{
$scopes = array();
foreach ($user->getGroupCenters() as $groupCenter){
if ($center->getId() === $groupCenter->getCenter()->getId()) {
//iterate on permissionGroup
$permi... | [
"public",
"function",
"getReachableCircles",
"(",
"User",
"$",
"user",
",",
"Role",
"$",
"role",
",",
"Center",
"$",
"center",
")",
"{",
"$",
"scopes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"user",
"->",
"getGroupCenters",
"(",
")",
"as",
... | Return all reachable circle for a given user, center and role
@param User $user
@param Role $role
@param Center $center
@return Scope[] | [
"Return",
"all",
"reachable",
"circle",
"for",
"a",
"given",
"user",
"center",
"and",
"role"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Security/Authorization/AuthorizationHelper.php#L187-L208 |
19,960 | Chill-project/Main | Security/Authorization/AuthorizationHelper.php | AuthorizationHelper.isRoleReached | protected function isRoleReached(Role $childRole, Role $parentRole)
{
$reachableRoles = $this->roleHierarchy
->getReachableRoles([$parentRole]);
return in_array($childRole, $reachableRoles);
} | php | protected function isRoleReached(Role $childRole, Role $parentRole)
{
$reachableRoles = $this->roleHierarchy
->getReachableRoles([$parentRole]);
return in_array($childRole, $reachableRoles);
} | [
"protected",
"function",
"isRoleReached",
"(",
"Role",
"$",
"childRole",
",",
"Role",
"$",
"parentRole",
")",
"{",
"$",
"reachableRoles",
"=",
"$",
"this",
"->",
"roleHierarchy",
"->",
"getReachableRoles",
"(",
"[",
"$",
"parentRole",
"]",
")",
";",
"return"... | Test if a parent role may give access to a given child role
@param Role $childRole The role we want to test if he is reachable
@param Role $parentRole The role which should give access to $childRole
@return boolean true if the child role is granted by parent role | [
"Test",
"if",
"a",
"parent",
"role",
"may",
"give",
"access",
"to",
"a",
"given",
"child",
"role"
] | 384cb6c793072a4f1047dc5cafc2157ee2419f60 | https://github.com/Chill-project/Main/blob/384cb6c793072a4f1047dc5cafc2157ee2419f60/Security/Authorization/AuthorizationHelper.php#L219-L225 |
19,961 | aedart/laravel-helpers | src/Traits/Cache/CacheStoreTrait.php | CacheStoreTrait.getCacheStore | public function getCacheStore(): ?Store
{
if (!$this->hasCacheStore()) {
$this->setCacheStore($this->getDefaultCacheStore());
}
return $this->cacheStore;
} | php | public function getCacheStore(): ?Store
{
if (!$this->hasCacheStore()) {
$this->setCacheStore($this->getDefaultCacheStore());
}
return $this->cacheStore;
} | [
"public",
"function",
"getCacheStore",
"(",
")",
":",
"?",
"Store",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasCacheStore",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setCacheStore",
"(",
"$",
"this",
"->",
"getDefaultCacheStore",
"(",
")",
")",
";",
"... | Get cache store
If no cache store has been set, this method will
set and return a default cache store, if any such
value is available
@see getDefaultCacheStore()
@return Store|null cache store or null if none cache store has been set | [
"Get",
"cache",
"store"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Cache/CacheStoreTrait.php#L54-L60 |
19,962 | aedart/laravel-helpers | src/Traits/Cache/CacheStoreTrait.php | CacheStoreTrait.getDefaultCacheStore | public function getDefaultCacheStore(): ?Store
{
// We do not know what store is desired. Therefore,
// the safest bet is to obtain the default
$manager = Cache::getFacadeRoot();
if (isset($manager)) {
/** @var Repository $repository */
$repository = $manager-... | php | public function getDefaultCacheStore(): ?Store
{
// We do not know what store is desired. Therefore,
// the safest bet is to obtain the default
$manager = Cache::getFacadeRoot();
if (isset($manager)) {
/** @var Repository $repository */
$repository = $manager-... | [
"public",
"function",
"getDefaultCacheStore",
"(",
")",
":",
"?",
"Store",
"{",
"// We do not know what store is desired. Therefore,",
"// the safest bet is to obtain the default",
"$",
"manager",
"=",
"Cache",
"::",
"getFacadeRoot",
"(",
")",
";",
"if",
"(",
"isset",
"... | Get a default cache store value, if any is available
@return Store|null A default cache store value or Null if no default value is available | [
"Get",
"a",
"default",
"cache",
"store",
"value",
"if",
"any",
"is",
"available"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Cache/CacheStoreTrait.php#L77-L88 |
19,963 | prolic/Concurrent-PHP-Utils | src/ConcurrentPhpUtils/CasThreadedMemberTrait.php | CasThreadedMemberTrait.casMember | public function casMember($member, $oldValue, $newValue)
{
$set = false;
$this->lock();
if ($this[$member] == $oldValue) {
$this[$member] = $newValue;
$set = true;
}
$this->unlock();
return $set;
} | php | public function casMember($member, $oldValue, $newValue)
{
$set = false;
$this->lock();
if ($this[$member] == $oldValue) {
$this[$member] = $newValue;
$set = true;
}
$this->unlock();
return $set;
} | [
"public",
"function",
"casMember",
"(",
"$",
"member",
",",
"$",
"oldValue",
",",
"$",
"newValue",
")",
"{",
"$",
"set",
"=",
"false",
";",
"$",
"this",
"->",
"lock",
"(",
")",
";",
"if",
"(",
"$",
"this",
"[",
"$",
"member",
"]",
"==",
"$",
"o... | Performs a compare and swap operation on a class member
@param string $member
@param mixed $oldValue
@param mixed $newValue
@return bool | [
"Performs",
"a",
"compare",
"and",
"swap",
"operation",
"on",
"a",
"class",
"member"
] | 771b55b3ef79d9a7443c4f6d95373f41b9f34c4a | https://github.com/prolic/Concurrent-PHP-Utils/blob/771b55b3ef79d9a7443c4f6d95373f41b9f34c4a/src/ConcurrentPhpUtils/CasThreadedMemberTrait.php#L20-L33 |
19,964 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/NotificationCenterController.php | NotificationCenterController.indexAction | public function indexAction()
{
$id = $this->getUser()->getId();
/** @var User $oUser */
$oUser = UserQuery::create()->findOneById($id);
$form = $this->createFormBuilder($oUser)
->setAction($this->generateUrl("notification_center_update"))
... | php | public function indexAction()
{
$id = $this->getUser()->getId();
/** @var User $oUser */
$oUser = UserQuery::create()->findOneById($id);
$form = $this->createFormBuilder($oUser)
->setAction($this->generateUrl("notification_center_update"))
... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"getId",
"(",
")",
";",
"/** @var User $oUser */",
"$",
"oUser",
"=",
"UserQuery",
"::",
"create",
"(",
")",
"->",
"findOneById",
"(",
"$"... | Display form for notification settings
@return \Symfony\Component\HttpFoundation\Response | [
"Display",
"form",
"for",
"notification",
"settings"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/NotificationCenterController.php#L41-L61 |
19,965 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/NotificationCenterController.php | NotificationCenterController.updateAction | public function updateAction(Request $request)
{
try {
$id = $this->getUser()->getId();
/** @var User $oUser */
$oUser = UserQuery::create()->findOneById($id);
if ($oUser === null) {
throw $this->createNotFoundExc... | php | public function updateAction(Request $request)
{
try {
$id = $this->getUser()->getId();
/** @var User $oUser */
$oUser = UserQuery::create()->findOneById($id);
if ($oUser === null) {
throw $this->createNotFoundExc... | [
"public",
"function",
"updateAction",
"(",
"Request",
"$",
"request",
")",
"{",
"try",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"getId",
"(",
")",
";",
"/** @var User $oUser */",
"$",
"oUser",
"=",
"UserQuery",
"::",
"create",
... | Update notification settings
@param \Symfony\Component\HttpFoundation\Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"Update",
"notification",
"settings"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/NotificationCenterController.php#L71-L110 |
19,966 | CakeCMS/Core | src/Event/CoreEventHandler.php | CoreEventHandler.onControllerSetup | public function onControllerSetup(Event $event)
{
/** @var AppController $controller */
$controller = $event->getSubject();
$isAdmin = ($controller->request->getParam('prefix') === 'admin');
$plugins = Plugin::loaded();
foreach ($plugins as $plugin) {
$path ... | php | public function onControllerSetup(Event $event)
{
/** @var AppController $controller */
$controller = $event->getSubject();
$isAdmin = ($controller->request->getParam('prefix') === 'admin');
$plugins = Plugin::loaded();
foreach ($plugins as $plugin) {
$path ... | [
"public",
"function",
"onControllerSetup",
"(",
"Event",
"$",
"event",
")",
"{",
"/** @var AppController $controller */",
"$",
"controller",
"=",
"$",
"event",
"->",
"getSubject",
"(",
")",
";",
"$",
"isAdmin",
"=",
"(",
"$",
"controller",
"->",
"request",
"->... | On controller setup.
@param Event $event
@return void | [
"On",
"controller",
"setup",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Event/CoreEventHandler.php#L50-L67 |
19,967 | webforge-labs/psc-cms | lib/Psc/CMS/EntityMeta.php | EntityMeta.getNewFormRequestMeta | public function getNewFormRequestMeta($clone = TRUE) {
if (!isset($this->newFormRequestMeta)) {
$this->newFormRequestMeta = new RequestMeta(\Psc\Net\HTTP\Request::GET,
$this->constructUrl(array($this->getEntityNamePlural(), 'form'))
... | php | public function getNewFormRequestMeta($clone = TRUE) {
if (!isset($this->newFormRequestMeta)) {
$this->newFormRequestMeta = new RequestMeta(\Psc\Net\HTTP\Request::GET,
$this->constructUrl(array($this->getEntityNamePlural(), 'form'))
... | [
"public",
"function",
"getNewFormRequestMeta",
"(",
"$",
"clone",
"=",
"TRUE",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"newFormRequestMeta",
")",
")",
"{",
"$",
"this",
"->",
"newFormRequestMeta",
"=",
"new",
"RequestMeta",
"(",
"\\",
... | Zeigt das "Entity erstellen" Formular an
@return Psc\CMS\RequestMeta | [
"Zeigt",
"das",
"Entity",
"erstellen",
"Formular",
"an"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/EntityMeta.php#L614-L626 |
19,968 | webforge-labs/psc-cms | lib/Psc/CMS/EntityMeta.php | EntityMeta.getSearchRequestMeta | public function getSearchRequestMeta(Array $query = NULL) {
if (!isset($this->searchRequestMeta)) {
$this->searchRequestMeta = new RequestMeta(\Psc\Net\HTTP\Request::GET,
$this->constructUrl(array($this->getEntityNamePlural(), '%s')),
... | php | public function getSearchRequestMeta(Array $query = NULL) {
if (!isset($this->searchRequestMeta)) {
$this->searchRequestMeta = new RequestMeta(\Psc\Net\HTTP\Request::GET,
$this->constructUrl(array($this->getEntityNamePlural(), '%s')),
... | [
"public",
"function",
"getSearchRequestMeta",
"(",
"Array",
"$",
"query",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"searchRequestMeta",
")",
")",
"{",
"$",
"this",
"->",
"searchRequestMeta",
"=",
"new",
"RequestMeta",
"(",
... | Request zum Suchen von Entities und zur LowLevel Ausgabe
@return Psc\CMS\RequestMeta | [
"Request",
"zum",
"Suchen",
"von",
"Entities",
"und",
"zur",
"LowLevel",
"Ausgabe"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/EntityMeta.php#L633-L646 |
19,969 | webforge-labs/psc-cms | lib/Psc/CMS/Controller/GPCController.php | GPCController.initTodo | public function initTodo() {
$todo = $this->getVar(array('todo'),'GP');
$this->assertTodo($todo);
$this->setTodo($todo);
if (!isset($this->todo))
$this->todo = $this->defaultTodo;
} | php | public function initTodo() {
$todo = $this->getVar(array('todo'),'GP');
$this->assertTodo($todo);
$this->setTodo($todo);
if (!isset($this->todo))
$this->todo = $this->defaultTodo;
} | [
"public",
"function",
"initTodo",
"(",
")",
"{",
"$",
"todo",
"=",
"$",
"this",
"->",
"getVar",
"(",
"array",
"(",
"'todo'",
")",
",",
"'GP'",
")",
";",
"$",
"this",
"->",
"assertTodo",
"(",
"$",
"todo",
")",
";",
"$",
"this",
"->",
"setTodo",
"(... | Initialisiert das Todo des Controllers
der Schlüssel 'todo' muss in $this->vars gesetzt sein, damit ein todo aus der Map genommen wird
ist der Schlüssel gesetzt, aber der Wert nicht in der todoMap wird eine Exception geworfen
ist der Schlüssel nicht gesetzt, wird $this->todo auf $this->defaultTodo gessetzt
$_POST['to... | [
"Initialisiert",
"das",
"Todo",
"des",
"Controllers"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/GPCController.php#L52-L59 |
19,970 | webforge-labs/psc-cms | lib/Psc/CMS/Service/MetadataGenerator.php | MetadataGenerator.entity | public function entity(Entity $entity, Array $linkRelations = array()) {
if (!isset($this->meta['links']))
$this->meta['links'] = array();
foreach ($linkRelations as $linkRelation) {
$this->meta['links'][] = (object) array(
'rel'=>$linkRelation->getName(),
'href'=>$linkRelatio... | php | public function entity(Entity $entity, Array $linkRelations = array()) {
if (!isset($this->meta['links']))
$this->meta['links'] = array();
foreach ($linkRelations as $linkRelation) {
$this->meta['links'][] = (object) array(
'rel'=>$linkRelation->getName(),
'href'=>$linkRelatio... | [
"public",
"function",
"entity",
"(",
"Entity",
"$",
"entity",
",",
"Array",
"$",
"linkRelations",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"meta",
"[",
"'links'",
"]",
")",
")",
"$",
"this",
"->",
"meta",
... | Adds metadata for the reponse from an Entity
@param Psc\Net\Service\LinkRelation[] $linkRelations | [
"Adds",
"metadata",
"for",
"the",
"reponse",
"from",
"an",
"Entity"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Service/MetadataGenerator.php#L47-L59 |
19,971 | hametuha/gapiwp | src/Hametuha/GapiWP/Service/Analytics.php | Analytics.get_accounts | public function get_accounts(){
static $ga_accounts = null;
if( !is_null($ga_accounts) ){
return $ga_accounts;
}
$ga_accounts = array();
if( $this->ga ){
try{
$accounts = $this->ga->management_accounts->listManagementAccounts();
if( count($accounts->getItems()) > 0 ){
$ga_accounts = $accoun... | php | public function get_accounts(){
static $ga_accounts = null;
if( !is_null($ga_accounts) ){
return $ga_accounts;
}
$ga_accounts = array();
if( $this->ga ){
try{
$accounts = $this->ga->management_accounts->listManagementAccounts();
if( count($accounts->getItems()) > 0 ){
$ga_accounts = $accoun... | [
"public",
"function",
"get_accounts",
"(",
")",
"{",
"static",
"$",
"ga_accounts",
"=",
"null",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"ga_accounts",
")",
")",
"{",
"return",
"$",
"ga_accounts",
";",
"}",
"$",
"ga_accounts",
"=",
"array",
"(",
")",
... | Get account list
@return array|\Google_Service_Analytics_Accounts | [
"Get",
"account",
"list"
] | 7b9716d0ebd54c4ab79cca94a4c5aef099a54266 | https://github.com/hametuha/gapiwp/blob/7b9716d0ebd54c4ab79cca94a4c5aef099a54266/src/Hametuha/GapiWP/Service/Analytics.php#L127-L145 |
19,972 | hametuha/gapiwp | src/Hametuha/GapiWP/Service/Analytics.php | Analytics.get_properties | public function get_properties($account_id) {
$result = array();
try {
if ( $this->ga ) {
$properties = $this->ga
->management_webproperties
->listManagementWebproperties( $account_id );
$result = $properties->getItems();
}
} catch ( \Exception $e ) {
// Do nothing.
error_log($e-... | php | public function get_properties($account_id) {
$result = array();
try {
if ( $this->ga ) {
$properties = $this->ga
->management_webproperties
->listManagementWebproperties( $account_id );
$result = $properties->getItems();
}
} catch ( \Exception $e ) {
// Do nothing.
error_log($e-... | [
"public",
"function",
"get_properties",
"(",
"$",
"account_id",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"ga",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"ga",
"->",
"management_webprop... | Get Web Properties
@param $account_id
@return array | [
"Get",
"Web",
"Properties"
] | 7b9716d0ebd54c4ab79cca94a4c5aef099a54266 | https://github.com/hametuha/gapiwp/blob/7b9716d0ebd54c4ab79cca94a4c5aef099a54266/src/Hametuha/GapiWP/Service/Analytics.php#L153-L167 |
19,973 | redaigbaria/oauth2 | src/Entity/AccessTokenEntity.php | AccessTokenEntity.getScopes | public function getScopes()
{
if ($this->scopes === null) {
$this->scopes = $this->formatScopes(
$this->server->getAccessTokenStorage()->getScopes($this)
);
}
return $this->scopes;
} | php | public function getScopes()
{
if ($this->scopes === null) {
$this->scopes = $this->formatScopes(
$this->server->getAccessTokenStorage()->getScopes($this)
);
}
return $this->scopes;
} | [
"public",
"function",
"getScopes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"scopes",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"scopes",
"=",
"$",
"this",
"->",
"formatScopes",
"(",
"$",
"this",
"->",
"server",
"->",
"getAccessTokenStorage",
"("... | Return all scopes associated with the access token
@return \League\OAuth2\Server\Entity\ScopeEntity[] | [
"Return",
"all",
"scopes",
"associated",
"with",
"the",
"access",
"token"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Entity/AccessTokenEntity.php#L56-L65 |
19,974 | CakeCMS/Core | src/View/Helper/NavHelper.php | NavHelper.render | public function render($key, array $items = [], array $options = [], $level = 1)
{
$i = 0;
$output = [];
$options = Hash::merge($this->_default, $options);
$sorted = Hash::sort($items, '{s}.weight', 'ASC');
$itemCount = count($sorted);
foreach ($sorted as $it... | php | public function render($key, array $items = [], array $options = [], $level = 1)
{
$i = 0;
$output = [];
$options = Hash::merge($this->_default, $options);
$sorted = Hash::sort($items, '{s}.weight', 'ASC');
$itemCount = count($sorted);
foreach ($sorted as $it... | [
"public",
"function",
"render",
"(",
"$",
"key",
",",
"array",
"$",
"items",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"level",
"=",
"1",
")",
"{",
"$",
"i",
"=",
"0",
";",
"$",
"output",
"=",
"[",
"]",
";",
"$",... | Render menu.
@param string $key
@param array $items
@param array $options
@param int $level
@return string
@SuppressWarnings(PHPMD.ShortVariable) | [
"Render",
"menu",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/NavHelper.php#L73-L113 |
19,975 | CakeCMS/Core | src/View/Helper/NavHelper.php | NavHelper._getCurrentMenuElement | protected function _getCurrentMenuElement(array $options = [], $level = 1)
{
if ($level > 1) {
$levelElement = $this->_getLevelElement($options, $level);
if ($this->_View->elementExists($levelElement)) {
return $levelElement;
}
return $options... | php | protected function _getCurrentMenuElement(array $options = [], $level = 1)
{
if ($level > 1) {
$levelElement = $this->_getLevelElement($options, $level);
if ($this->_View->elementExists($levelElement)) {
return $levelElement;
}
return $options... | [
"protected",
"function",
"_getCurrentMenuElement",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"level",
"=",
"1",
")",
"{",
"if",
"(",
"$",
"level",
">",
"1",
")",
"{",
"$",
"levelElement",
"=",
"$",
"this",
"->",
"_getLevelElement",
"(",
... | Get current menu element.
@param array $options
@param int $level
@return string | [
"Get",
"current",
"menu",
"element",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/NavHelper.php#L122-L134 |
19,976 | CakeCMS/Core | src/View/Helper/NavHelper.php | NavHelper._getLevelElement | protected function _getLevelElement(array $options, $level)
{
$levelElement = 'menu_child_' . $level;
$element = $options['childMenuAttr']['element'];
list($plugin, $path) = $this->_View->pluginSplit($element);
$path = FS::clean($path, '/');
$details = explode('/', $... | php | protected function _getLevelElement(array $options, $level)
{
$levelElement = 'menu_child_' . $level;
$element = $options['childMenuAttr']['element'];
list($plugin, $path) = $this->_View->pluginSplit($element);
$path = FS::clean($path, '/');
$details = explode('/', $... | [
"protected",
"function",
"_getLevelElement",
"(",
"array",
"$",
"options",
",",
"$",
"level",
")",
"{",
"$",
"levelElement",
"=",
"'menu_child_'",
".",
"$",
"level",
";",
"$",
"element",
"=",
"$",
"options",
"[",
"'childMenuAttr'",
"]",
"[",
"'element'",
"... | Get current menu level element.
@param array $options
@param int $level
@return string | [
"Get",
"current",
"menu",
"level",
"element",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/NavHelper.php#L143-L156 |
19,977 | CakeCMS/Core | src/View/Helper/NavHelper.php | NavHelper._setFirstLast | protected function _setFirstLast($i, $itemCount, array $item = [])
{
$item = array_merge(['last' => false, 'first' => false], $item);
if ($i == 1) {
$item['first'] = true;
}
if ($i == $itemCount) {
$item['last'] = true;
}
return $item;
} | php | protected function _setFirstLast($i, $itemCount, array $item = [])
{
$item = array_merge(['last' => false, 'first' => false], $item);
if ($i == 1) {
$item['first'] = true;
}
if ($i == $itemCount) {
$item['last'] = true;
}
return $item;
} | [
"protected",
"function",
"_setFirstLast",
"(",
"$",
"i",
",",
"$",
"itemCount",
",",
"array",
"$",
"item",
"=",
"[",
"]",
")",
"{",
"$",
"item",
"=",
"array_merge",
"(",
"[",
"'last'",
"=>",
"false",
",",
"'first'",
"=>",
"false",
"]",
",",
"$",
"i... | Setup first last item params.
@param int $i
@param int $itemCount
@param array $item
@return array
@SuppressWarnings(PHPMD.ShortVariable) | [
"Setup",
"first",
"last",
"item",
"params",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/NavHelper.php#L167-L179 |
19,978 | CakeCMS/Core | src/View/Helper/NavHelper.php | NavHelper.getLiAttr | public function getLiAttr()
{
$params = self::$_itemParams;
$attr = ['class' => 'li-item'];
if (isset($params['item']['liClass'])) {
$attr = $this->addClass($attr, $params['item']['liClass']);
}
if ($params['item']['last']) {
$attr = $this->addClas... | php | public function getLiAttr()
{
$params = self::$_itemParams;
$attr = ['class' => 'li-item'];
if (isset($params['item']['liClass'])) {
$attr = $this->addClass($attr, $params['item']['liClass']);
}
if ($params['item']['last']) {
$attr = $this->addClas... | [
"public",
"function",
"getLiAttr",
"(",
")",
"{",
"$",
"params",
"=",
"self",
"::",
"$",
"_itemParams",
";",
"$",
"attr",
"=",
"[",
"'class'",
"=>",
"'li-item'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'item'",
"]",
"[",
"'liClass'",
... | Get default li attributes.
@return array | [
"Get",
"default",
"li",
"attributes",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/NavHelper.php#L186-L204 |
19,979 | CakeCMS/Core | src/View/Helper/NavHelper.php | NavHelper._setActive | protected function _setActive(array $attr = [])
{
if ($this->Url->build(self::$_itemParams['item']['url']) == env('REQUEST_URI')) {
$attr = $this->addClass($attr, 'active');
}
return $attr;
} | php | protected function _setActive(array $attr = [])
{
if ($this->Url->build(self::$_itemParams['item']['url']) == env('REQUEST_URI')) {
$attr = $this->addClass($attr, 'active');
}
return $attr;
} | [
"protected",
"function",
"_setActive",
"(",
"array",
"$",
"attr",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Url",
"->",
"build",
"(",
"self",
"::",
"$",
"_itemParams",
"[",
"'item'",
"]",
"[",
"'url'",
"]",
")",
"==",
"env",
"(",
"'... | Set active item link.
@param array $attr
@return array | [
"Set",
"active",
"item",
"link",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/NavHelper.php#L212-L219 |
19,980 | yuncms/framework | src/behaviors/PolymorphicRelation.php | PolymorphicRelation.getPolymorphicRelation | public function getPolymorphicRelation()
{
if ($this->_cached !== null) {
return $this->_cached;
}
$className = $this->owner->getAttribute($this->classAttribute);
if ($className == "") {
return null;
}
if (!class_exists($className)) {
... | php | public function getPolymorphicRelation()
{
if ($this->_cached !== null) {
return $this->_cached;
}
$className = $this->owner->getAttribute($this->classAttribute);
if ($className == "") {
return null;
}
if (!class_exists($className)) {
... | [
"public",
"function",
"getPolymorphicRelation",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_cached",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_cached",
";",
"}",
"$",
"className",
"=",
"$",
"this",
"->",
"owner",
"->",
"getAttribute",
... | Returns the Underlying Object
@return mixed | [
"Returns",
"the",
"Underlying",
"Object"
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/behaviors/PolymorphicRelation.php#L50-L70 |
19,981 | yuncms/framework | src/behaviors/PolymorphicRelation.php | PolymorphicRelation.validateUnderlyingObjectType | private function validateUnderlyingObjectType($object)
{
if (count($this->mustBeInstanceOf) == 0) {
return true;
}
foreach ($this->mustBeInstanceOf as $instance) {
if ($object instanceof $instance) { //|| $object->asa($instance) !== null
return true;
... | php | private function validateUnderlyingObjectType($object)
{
if (count($this->mustBeInstanceOf) == 0) {
return true;
}
foreach ($this->mustBeInstanceOf as $instance) {
if ($object instanceof $instance) { //|| $object->asa($instance) !== null
return true;
... | [
"private",
"function",
"validateUnderlyingObjectType",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"mustBeInstanceOf",
")",
"==",
"0",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"mustBeInstanceOf"... | Validates if given object is of allowed type
@param mixed $object
@return boolean | [
"Validates",
"if",
"given",
"object",
"is",
"of",
"allowed",
"type"
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/behaviors/PolymorphicRelation.php#L98-L110 |
19,982 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Shared/String.php | PHPWord_Shared_String.ConvertEncoding | public static function ConvertEncoding($value, $to, $from)
{
if (self::getIsMbstringEnabled()) {
$value = mb_convert_encoding($value, $to, $from);
return $value;
}
if (self::getIsIconvEnabled()) {
$value = iconv($from, $to, $value);
return $value;
}
// else, no conversion
return $value;
} | php | public static function ConvertEncoding($value, $to, $from)
{
if (self::getIsMbstringEnabled()) {
$value = mb_convert_encoding($value, $to, $from);
return $value;
}
if (self::getIsIconvEnabled()) {
$value = iconv($from, $to, $value);
return $value;
}
// else, no conversion
return $value;
} | [
"public",
"static",
"function",
"ConvertEncoding",
"(",
"$",
"value",
",",
"$",
"to",
",",
"$",
"from",
")",
"{",
"if",
"(",
"self",
"::",
"getIsMbstringEnabled",
"(",
")",
")",
"{",
"$",
"value",
"=",
"mb_convert_encoding",
"(",
"$",
"value",
",",
"$"... | Convert string from one encoding to another. First try mbstring, then iconv, or no convertion
@param string $value
@param string $to Encoding to convert to, e.g. 'UTF-8'
@param string $from Encoding to convert from, e.g. 'UTF-16LE'
@return string | [
"Convert",
"string",
"from",
"one",
"encoding",
"to",
"another",
".",
"First",
"try",
"mbstring",
"then",
"iconv",
"or",
"no",
"convertion"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Shared/String.php#L223-L237 |
19,983 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Shared/String.php | PHPWord_Shared_String.CountCharacters | public static function CountCharacters($value, $enc = 'UTF-8')
{
if (self::getIsMbstringEnabled()) {
$count = mb_strlen($value, $enc);
return $count;
}
if (self::getIsIconvEnabled()) {
$count = iconv_strlen($value, $enc);
return $count;
}
// else strlen
$count = strlen($value);
return $coun... | php | public static function CountCharacters($value, $enc = 'UTF-8')
{
if (self::getIsMbstringEnabled()) {
$count = mb_strlen($value, $enc);
return $count;
}
if (self::getIsIconvEnabled()) {
$count = iconv_strlen($value, $enc);
return $count;
}
// else strlen
$count = strlen($value);
return $coun... | [
"public",
"static",
"function",
"CountCharacters",
"(",
"$",
"value",
",",
"$",
"enc",
"=",
"'UTF-8'",
")",
"{",
"if",
"(",
"self",
"::",
"getIsMbstringEnabled",
"(",
")",
")",
"{",
"$",
"count",
"=",
"mb_strlen",
"(",
"$",
"value",
",",
"$",
"enc",
... | Get character count. First try mbstring, then iconv, finally strlen
@param string $value
@param string $enc Encoding
@return int Character count | [
"Get",
"character",
"count",
".",
"First",
"try",
"mbstring",
"then",
"iconv",
"finally",
"strlen"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Shared/String.php#L246-L261 |
19,984 | Craftsware/scissor | src/Lib/Database.php | Database.max | public function max($table, $inc = null)
{
return $this->select($table, ['MAX(id)'])[0]['MAX(id)'] + (isset($inc) ? $inc : 0);
} | php | public function max($table, $inc = null)
{
return $this->select($table, ['MAX(id)'])[0]['MAX(id)'] + (isset($inc) ? $inc : 0);
} | [
"public",
"function",
"max",
"(",
"$",
"table",
",",
"$",
"inc",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"select",
"(",
"$",
"table",
",",
"[",
"'MAX(id)'",
"]",
")",
"[",
"0",
"]",
"[",
"'MAX(id)'",
"]",
"+",
"(",
"isset",
"(",
"$"... | Get Maximum ID of a table
@param $table String
@param $add Int | [
"Get",
"Maximum",
"ID",
"of",
"a",
"table"
] | 644e4a8ea9859fc30fee36705e54784acd8d43e2 | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Lib/Database.php#L53-L56 |
19,985 | Craftsware/scissor | src/Lib/Database.php | Database.fetch | public function fetch($query)
{
$db = $this->connection();
if(method_exists($result = $db->query(rtrim(preg_replace('/\s\s/', ' ', $query), ' ')), 'rowCount')) {
if($result->rowCount() && $result->setFetchMode($db::FETCH_ASSOC)) {
return $result->fetchAll();
... | php | public function fetch($query)
{
$db = $this->connection();
if(method_exists($result = $db->query(rtrim(preg_replace('/\s\s/', ' ', $query), ' ')), 'rowCount')) {
if($result->rowCount() && $result->setFetchMode($db::FETCH_ASSOC)) {
return $result->fetchAll();
... | [
"public",
"function",
"fetch",
"(",
"$",
"query",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"connection",
"(",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"result",
"=",
"$",
"db",
"->",
"query",
"(",
"rtrim",
"(",
"preg_replace",
"(",
"'/\\... | Get Data from the table
@param $query String | [
"Get",
"Data",
"from",
"the",
"table"
] | 644e4a8ea9859fc30fee36705e54784acd8d43e2 | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Lib/Database.php#L78-L91 |
19,986 | ClanCats/Core | src/classes/CCError/Trace.php | CCError_Trace.file | public function file( $cut = true )
{
if ( empty( $this->file ) )
{
return null;
}
if ( $cut )
{
return str_replace( CCROOT, '', $this->file );
}
return $this->file;
} | php | public function file( $cut = true )
{
if ( empty( $this->file ) )
{
return null;
}
if ( $cut )
{
return str_replace( CCROOT, '', $this->file );
}
return $this->file;
} | [
"public",
"function",
"file",
"(",
"$",
"cut",
"=",
"true",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"cut",
")",
"{",
"return",
"str_replace",
"(",
"CCROOT",
",",
"... | get file path
@param bool $cut Cut
@return string | [
"get",
"file",
"path"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Trace.php#L90-L103 |
19,987 | ClanCats/Core | src/classes/CCError/Trace.php | CCError_Trace.args_string | public function args_string()
{
if ( !isset( $this->args ) || !is_array( $this->args ) )
{
return null;
}
$args = $this->args;
foreach( $args as $key => $arg )
{
if ( is_array( $arg ) )
{
$args[$key] = 'Array';
}
else
{
$args[$key] = var_export( $arg, true );
}
}
... | php | public function args_string()
{
if ( !isset( $this->args ) || !is_array( $this->args ) )
{
return null;
}
$args = $this->args;
foreach( $args as $key => $arg )
{
if ( is_array( $arg ) )
{
$args[$key] = 'Array';
}
else
{
$args[$key] = var_export( $arg, true );
}
}
... | [
"public",
"function",
"args_string",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"args",
")",
"||",
"!",
"is_array",
"(",
"$",
"this",
"->",
"args",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"args",
"=",
"$",
"this",
"... | create an argument string
@return string | [
"create",
"an",
"argument",
"string"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Trace.php#L160-L182 |
19,988 | ClanCats/Core | src/classes/CCError/Trace.php | CCError_Trace.parse_source | private function parse_source()
{
if ( !$this->file() )
{
return null;
}
// get the file
$lines = file( $this->file );
/*
* parse the relevant source
*/
$size = 10;
$start = $this->line - ( $size / 2 );
$end = $this->line + ( $size / 2 );
// check if start is in the middle of a... | php | private function parse_source()
{
if ( !$this->file() )
{
return null;
}
// get the file
$lines = file( $this->file );
/*
* parse the relevant source
*/
$size = 10;
$start = $this->line - ( $size / 2 );
$end = $this->line + ( $size / 2 );
// check if start is in the middle of a... | [
"private",
"function",
"parse_source",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"file",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"// get the file",
"$",
"lines",
"=",
"file",
"(",
"$",
"this",
"->",
"file",
")",
";",
"/*\n\t\t * parse... | parse the source file
@return void | [
"parse",
"the",
"source",
"file"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Trace.php#L189-L224 |
19,989 | ClanCats/Core | src/classes/CCError/Trace.php | CCError_Trace.reflection_file | public function reflection_file()
{
if ( is_null( $this->reflection_file ) )
{
if ( is_null( $reflection = $this->reflection() ) )
{
return null;
}
$this->reflection_file = file( $reflection->getFileName() );
}
return $this->reflection_file;
} | php | public function reflection_file()
{
if ( is_null( $this->reflection_file ) )
{
if ( is_null( $reflection = $this->reflection() ) )
{
return null;
}
$this->reflection_file = file( $reflection->getFileName() );
}
return $this->reflection_file;
} | [
"public",
"function",
"reflection_file",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"reflection_file",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"reflection",
"=",
"$",
"this",
"->",
"reflection",
"(",
")",
")",
")",
"{",
"retu... | get the source code of the reflected file
@return string | [
"get",
"the",
"source",
"code",
"of",
"the",
"reflected",
"file"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Trace.php#L261-L274 |
19,990 | ClanCats/Core | src/classes/CCError/Trace.php | CCError_Trace.reflection_function_info | public function reflection_function_info( $function = null )
{
if ( is_null( $lines = $this->reflection_file() ) )
{
return null;
}
if ( is_null( $function ) )
{
if ( is_null( $function = $this->function_name() ) )
{
return null;
}
}
$info = array(
'message' => '',
);
for... | php | public function reflection_function_info( $function = null )
{
if ( is_null( $lines = $this->reflection_file() ) )
{
return null;
}
if ( is_null( $function ) )
{
if ( is_null( $function = $this->function_name() ) )
{
return null;
}
}
$info = array(
'message' => '',
);
for... | [
"public",
"function",
"reflection_function_info",
"(",
"$",
"function",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"lines",
"=",
"$",
"this",
"->",
"reflection_file",
"(",
")",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"is_null"... | get the source code where the trace happend
@return string | [
"get",
"the",
"source",
"code",
"where",
"the",
"trace",
"happend"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Trace.php#L281-L367 |
19,991 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Builder/Header.php | Zend_Feed_Builder_Header.setEmail | public function setEmail($email)
{
/**
* @see Zend_Validate_EmailAddress
*/
require_once 'Zend/Validate/EmailAddress.php';
$validate = new Zend_Validate_EmailAddress();
if (!$validate->isValid($email)) {
/**
* @see Zend_Feed_Builder_Exceptio... | php | public function setEmail($email)
{
/**
* @see Zend_Validate_EmailAddress
*/
require_once 'Zend/Validate/EmailAddress.php';
$validate = new Zend_Validate_EmailAddress();
if (!$validate->isValid($email)) {
/**
* @see Zend_Feed_Builder_Exceptio... | [
"public",
"function",
"setEmail",
"(",
"$",
"email",
")",
"{",
"/**\n * @see Zend_Validate_EmailAddress\n */",
"require_once",
"'Zend/Validate/EmailAddress.php'",
";",
"$",
"validate",
"=",
"new",
"Zend_Validate_EmailAddress",
"(",
")",
";",
"if",
"(",
"!"... | Sets the author's email
@param string $email
@return Zend_Feed_Builder_Header
@throws Zend_Feed_Builder_Exception | [
"Sets",
"the",
"author",
"s",
"email"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Builder/Header.php#L170-L186 |
19,992 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Builder/Header.php | Zend_Feed_Builder_Header.setWebmaster | public function setWebmaster($webmaster)
{
/**
* @see Zend_Validate_EmailAddress
*/
require_once 'Zend/Validate/EmailAddress.php';
$validate = new Zend_Validate_EmailAddress();
if (!$validate->isValid($webmaster)) {
/**
* @see Zend_Feed_Buil... | php | public function setWebmaster($webmaster)
{
/**
* @see Zend_Validate_EmailAddress
*/
require_once 'Zend/Validate/EmailAddress.php';
$validate = new Zend_Validate_EmailAddress();
if (!$validate->isValid($webmaster)) {
/**
* @see Zend_Feed_Buil... | [
"public",
"function",
"setWebmaster",
"(",
"$",
"webmaster",
")",
"{",
"/**\n * @see Zend_Validate_EmailAddress\n */",
"require_once",
"'Zend/Validate/EmailAddress.php'",
";",
"$",
"validate",
"=",
"new",
"Zend_Validate_EmailAddress",
"(",
")",
";",
"if",
"(... | Email address for person responsible for technical issues
Ignored if atom is used
@param string $webmaster
@return Zend_Feed_Builder_Header
@throws Zend_Feed_Builder_Exception | [
"Email",
"address",
"for",
"person",
"responsible",
"for",
"technical",
"issues",
"Ignored",
"if",
"atom",
"is",
"used"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Builder/Header.php#L244-L260 |
19,993 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Builder/Header.php | Zend_Feed_Builder_Header.setTtl | public function setTtl($ttl)
{
/**
* @see Zend_Validate_Int
*/
require_once 'Zend/Validate/Int.php';
$validate = new Zend_Validate_Int();
if (!$validate->isValid($ttl)) {
/**
* @see Zend_Feed_Builder_Exception
*/
req... | php | public function setTtl($ttl)
{
/**
* @see Zend_Validate_Int
*/
require_once 'Zend/Validate/Int.php';
$validate = new Zend_Validate_Int();
if (!$validate->isValid($ttl)) {
/**
* @see Zend_Feed_Builder_Exception
*/
req... | [
"public",
"function",
"setTtl",
"(",
"$",
"ttl",
")",
"{",
"/**\n * @see Zend_Validate_Int\n */",
"require_once",
"'Zend/Validate/Int.php'",
";",
"$",
"validate",
"=",
"new",
"Zend_Validate_Int",
"(",
")",
";",
"if",
"(",
"!",
"$",
"validate",
"->",
... | How long in minutes a feed can be cached before refreshing
Ignored if atom is used
@param int $ttl
@return Zend_Feed_Builder_Header
@throws Zend_Feed_Builder_Exception | [
"How",
"long",
"in",
"minutes",
"a",
"feed",
"can",
"be",
"cached",
"before",
"refreshing",
"Ignored",
"if",
"atom",
"is",
"used"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Builder/Header.php#L270-L286 |
19,994 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Builder/Header.php | Zend_Feed_Builder_Header.setCloud | public function setCloud($uri, $procedure, $protocol)
{
if (is_string($uri) && Zend_Uri_Http::check($uri)) {
$uri = Zend_Uri::factory($uri);
}
if (!$uri instanceof Zend_Uri_Http) {
/**
* @see Zend_Feed_Builder_Exception
*/
require... | php | public function setCloud($uri, $procedure, $protocol)
{
if (is_string($uri) && Zend_Uri_Http::check($uri)) {
$uri = Zend_Uri::factory($uri);
}
if (!$uri instanceof Zend_Uri_Http) {
/**
* @see Zend_Feed_Builder_Exception
*/
require... | [
"public",
"function",
"setCloud",
"(",
"$",
"uri",
",",
"$",
"procedure",
",",
"$",
"protocol",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"uri",
")",
"&&",
"Zend_Uri_Http",
"::",
"check",
"(",
"$",
"uri",
")",
")",
"{",
"$",
"uri",
"=",
"Zend_Uri... | Cloud to be notified of updates of the feed
Ignored if atom is used
@param string|Zend_Uri_Http $uri
@param string $procedure procedure to call, e.g. myCloud.rssPleaseNotify
@param string $protocol protocol to use, e.g. soap or xml-rpc
@return Zend_Feed_Builder_Header
@throws Zend_Feed_... | [
"Cloud",
"to",
"be",
"notified",
"of",
"updates",
"of",
"the",
"feed",
"Ignored",
"if",
"atom",
"is",
"used"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Builder/Header.php#L311-L330 |
19,995 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Builder/Header.php | Zend_Feed_Builder_Header.setTextInput | public function setTextInput($title, $description, $name, $link)
{
$this->offsetSet('textInput', array('title' => $title,
'description' => $description,
'name' => $name,
'link'... | php | public function setTextInput($title, $description, $name, $link)
{
$this->offsetSet('textInput', array('title' => $title,
'description' => $description,
'name' => $name,
'link'... | [
"public",
"function",
"setTextInput",
"(",
"$",
"title",
",",
"$",
"description",
",",
"$",
"name",
",",
"$",
"link",
")",
"{",
"$",
"this",
"->",
"offsetSet",
"(",
"'textInput'",
",",
"array",
"(",
"'title'",
"=>",
"$",
"title",
",",
"'description'",
... | A text input box that can be displayed with the feed
Ignored if atom is used
@param string $title the label of the Submit button in the text input area
@param string $description explains the text input area
@param string $name the name of the text object in the text input area
@param string $link ... | [
"A",
"text",
"input",
"box",
"that",
"can",
"be",
"displayed",
"with",
"the",
"feed",
"Ignored",
"if",
"atom",
"is",
"used"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Builder/Header.php#L342-L349 |
19,996 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Builder/Header.php | Zend_Feed_Builder_Header.setSkipHours | public function setSkipHours(array $hours)
{
if (count($hours) > 24) {
/**
* @see Zend_Feed_Builder_Exception
*/
require_once 'Zend/Feed/Builder/Exception.php';
throw new Zend_Feed_Builder_Exception("you can not have more than 24 rows in the skip... | php | public function setSkipHours(array $hours)
{
if (count($hours) > 24) {
/**
* @see Zend_Feed_Builder_Exception
*/
require_once 'Zend/Feed/Builder/Exception.php';
throw new Zend_Feed_Builder_Exception("you can not have more than 24 rows in the skip... | [
"public",
"function",
"setSkipHours",
"(",
"array",
"$",
"hours",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"hours",
")",
">",
"24",
")",
"{",
"/**\n * @see Zend_Feed_Builder_Exception\n */",
"require_once",
"'Zend/Feed/Builder/Exception.php'",
";"... | Hint telling aggregators which hours they can skip
Ignored if atom is used
@param array $hours list of hours in 24 format
@return Zend_Feed_Builder_Header
@throws Zend_Feed_Builder_Exception | [
"Hint",
"telling",
"aggregators",
"which",
"hours",
"they",
"can",
"skip",
"Ignored",
"if",
"atom",
"is",
"used"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Builder/Header.php#L359-L379 |
19,997 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Builder/Header.php | Zend_Feed_Builder_Header.setSkipDays | public function setSkipDays(array $days)
{
if (count($days) > 7) {
/**
* @see Zend_Feed_Builder_Exception
*/
require_once 'Zend/Feed/Builder/Exception.php';
throw new Zend_Feed_Builder_Exception("you can not have more than 7 days in the skipDays ... | php | public function setSkipDays(array $days)
{
if (count($days) > 7) {
/**
* @see Zend_Feed_Builder_Exception
*/
require_once 'Zend/Feed/Builder/Exception.php';
throw new Zend_Feed_Builder_Exception("you can not have more than 7 days in the skipDays ... | [
"public",
"function",
"setSkipDays",
"(",
"array",
"$",
"days",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"days",
")",
">",
"7",
")",
"{",
"/**\n * @see Zend_Feed_Builder_Exception\n */",
"require_once",
"'Zend/Feed/Builder/Exception.php'",
";",
... | Hint telling aggregators which days they can skip
Ignored if atom is used
@param array $days list of days to skip, e.g. Monday
@return Zend_Feed_Builder_Header
@throws Zend_Feed_Builder_Exception | [
"Hint",
"telling",
"aggregators",
"which",
"days",
"they",
"can",
"skip",
"Ignored",
"if",
"atom",
"is",
"used"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Builder/Header.php#L389-L410 |
19,998 | nyeholt/silverstripe-external-content | code/cache/CacheService.php | CacheService.store | public function store($key, $value, $expiry=0) {
if ($expiry == 0) {
$expiry = $this->expiry;
}
$entry = new CacheItem();
$entry->value = serialize($value);
$entry->expireAt = time() + $expiry;
$data = serialize($entry);
$this->store->store($key, $data);
$this->items[$key] = $entry;
} | php | public function store($key, $value, $expiry=0) {
if ($expiry == 0) {
$expiry = $this->expiry;
}
$entry = new CacheItem();
$entry->value = serialize($value);
$entry->expireAt = time() + $expiry;
$data = serialize($entry);
$this->store->store($key, $data);
$this->items[$key] = $entry;
} | [
"public",
"function",
"store",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiry",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"expiry",
"==",
"0",
")",
"{",
"$",
"expiry",
"=",
"$",
"this",
"->",
"expiry",
";",
"}",
"$",
"entry",
"=",
"new",
"Ca... | Cache an item
@param string $key
@param mixed $value
@param int $expiry
How many seconds to cache this object for (no value uses the configured default) | [
"Cache",
"an",
"item"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/cache/CacheService.php#L67-L80 |
19,999 | nyeholt/silverstripe-external-content | code/cache/CacheService.php | CacheService.get | public function get($key) {
$entry = null;
if (isset($this->items[$key])) {
$entry = $this->items[$key];
} else {
$data = $this->store->get($key);
if ($data) {
$entry = unserialize($data);
}
}
if (!$entry) {
return $entry;
}
// if the expire time is in the future
if ($entry->expir... | php | public function get($key) {
$entry = null;
if (isset($this->items[$key])) {
$entry = $this->items[$key];
} else {
$data = $this->store->get($key);
if ($data) {
$entry = unserialize($data);
}
}
if (!$entry) {
return $entry;
}
// if the expire time is in the future
if ($entry->expir... | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"entry",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"entry",
"=",
"$",
"this",
"->",
"items",
"[",
"$",
"key",
... | Gets a cached value for a given key
@param String $key
The key to retrieve data for | [
"Gets",
"a",
"cached",
"value",
"for",
"a",
"given",
"key"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/cache/CacheService.php#L87-L113 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.