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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,000 | pryley/castor-framework | src/Services/Validator.php | Validator.validateAccepted | protected function validateAccepted( $value )
{
$acceptable = ['yes', 'on', '1', 1, true, 'true'];
return $this->validateRequired( $value ) && in_array( $value, $acceptable, true );
} | php | protected function validateAccepted( $value )
{
$acceptable = ['yes', 'on', '1', 1, true, 'true'];
return $this->validateRequired( $value ) && in_array( $value, $acceptable, true );
} | [
"protected",
"function",
"validateAccepted",
"(",
"$",
"value",
")",
"{",
"$",
"acceptable",
"=",
"[",
"'yes'",
",",
"'on'",
",",
"'1'",
",",
"1",
",",
"true",
",",
"'true'",
"]",
";",
"return",
"$",
"this",
"->",
"validateRequired",
"(",
"$",
"value",... | Validate that an attribute was "accepted".
This validation rule implies the attribute is "required".
@param mixed $value
@return bool | [
"Validate",
"that",
"an",
"attribute",
"was",
"accepted",
"."
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Services/Validator.php#L446-L451 |
25,001 | pryley/castor-framework | src/Services/Validator.php | Validator.validateMin | protected function validateMin( $value, $attribute, array $parameters )
{
$this->requireParameterCount( 1, $parameters, 'min' );
return $this->getSize( $attribute, $value ) >= $parameters[0];
} | php | protected function validateMin( $value, $attribute, array $parameters )
{
$this->requireParameterCount( 1, $parameters, 'min' );
return $this->getSize( $attribute, $value ) >= $parameters[0];
} | [
"protected",
"function",
"validateMin",
"(",
"$",
"value",
",",
"$",
"attribute",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"this",
"->",
"requireParameterCount",
"(",
"1",
",",
"$",
"parameters",
",",
"'min'",
")",
";",
"return",
"$",
"this",
"->"... | Validate the size of an attribute is greater than a minimum value.
@param mixed $value
@param string $attribute
@return bool | [
"Validate",
"the",
"size",
"of",
"an",
"attribute",
"is",
"greater",
"than",
"a",
"minimum",
"value",
"."
] | cbc137d02625cd05f4cc96414d6f70e451cb821f | https://github.com/pryley/castor-framework/blob/cbc137d02625cd05f4cc96414d6f70e451cb821f/src/Services/Validator.php#L531-L536 |
25,002 | native5/native5-sdk-client-php | src/Native5/UI/ScriptPathResolver.php | ScriptPathResolver.resolve | public static function resolve($name)
{
$logger = $GLOBALS['logger'];
$app = $GLOBALS['app'];
$staticPath = 'public';
if ($app->getConfiguration()->isLocal()) {
$staticPath = 'views';
}
$session = $app->getSessionManager()->getActiv... | php | public static function resolve($name)
{
$logger = $GLOBALS['logger'];
$app = $GLOBALS['app'];
$staticPath = 'public';
if ($app->getConfiguration()->isLocal()) {
$staticPath = 'views';
}
$session = $app->getSessionManager()->getActiv... | [
"public",
"static",
"function",
"resolve",
"(",
"$",
"name",
")",
"{",
"$",
"logger",
"=",
"$",
"GLOBALS",
"[",
"'logger'",
"]",
";",
"$",
"app",
"=",
"$",
"GLOBALS",
"[",
"'app'",
"]",
";",
"$",
"staticPath",
"=",
"'public'",
";",
"if",
"(",
"$",
... | Resolve Script Path based on name.
@param mixed $name Name of the script to resolve.
@access public
@return void | [
"Resolve",
"Script",
"Path",
"based",
"on",
"name",
"."
] | e1f598cf27654d81bb5facace1990b737242a2f9 | https://github.com/native5/native5-sdk-client-php/blob/e1f598cf27654d81bb5facace1990b737242a2f9/src/Native5/UI/ScriptPathResolver.php#L55-L95 |
25,003 | jonesiscoding/device | src/DetectDefaults.php | DetectDefaults.getDefaults | public function getDefaults()
{
return array(
'android' => false,
'browser' => self::BROWSER,
'cookies' => ( count( $_COOKIE ) > 0 ) ? true : false,
'height' => self::HEIGHT,
'hidpi' => ( array_key_exists( 'HTTP_DPR', $_SERVER ) ) ? $_SERVER[ 'HTTP_DPR' ] > 1 :... | php | public function getDefaults()
{
return array(
'android' => false,
'browser' => self::BROWSER,
'cookies' => ( count( $_COOKIE ) > 0 ) ? true : false,
'height' => self::HEIGHT,
'hidpi' => ( array_key_exists( 'HTTP_DPR', $_SERVER ) ) ? $_SERVER[ 'HTTP_DPR' ] > 1 :... | [
"public",
"function",
"getDefaults",
"(",
")",
"{",
"return",
"array",
"(",
"'android'",
"=>",
"false",
",",
"'browser'",
"=>",
"self",
"::",
"BROWSER",
",",
"'cookies'",
"=>",
"(",
"count",
"(",
"$",
"_COOKIE",
")",
">",
"0",
")",
"?",
"true",
":",
... | These defaults come from an number of places, including client hints. The only values based on a UA string are
the Android & iOS values.
References:
* https://developers.google.com/web/updates/2015/09/automating-resource-selection-with-client-hints
* http://httpwg.org/http-extensions/client-hints.html
* https://devel... | [
"These",
"defaults",
"come",
"from",
"an",
"number",
"of",
"places",
"including",
"client",
"hints",
".",
"The",
"only",
"values",
"based",
"on",
"a",
"UA",
"string",
"are",
"the",
"Android",
"&",
"iOS",
"values",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectDefaults.php#L59-L76 |
25,004 | jonesiscoding/device | src/DetectDefaults.php | DetectDefaults.getMeteredDefault | private function getMeteredDefault()
{
foreach( self::METERED_HEADERS as $header )
{
if( array_key_exists( $header, $_SERVER ) )
{
return true;
}
}
return false;
} | php | private function getMeteredDefault()
{
foreach( self::METERED_HEADERS as $header )
{
if( array_key_exists( $header, $_SERVER ) )
{
return true;
}
}
return false;
} | [
"private",
"function",
"getMeteredDefault",
"(",
")",
"{",
"foreach",
"(",
"self",
"::",
"METERED_HEADERS",
"as",
"$",
"header",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"header",
",",
"$",
"_SERVER",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Uses potential mobile headers & Google's new 'save-data' header to determine if we have a metered connection.
* Reference for 'save-data': https://developers.google.com/web/updates/2016/02/save-data
@return bool | [
"Uses",
"potential",
"mobile",
"headers",
"&",
"Google",
"s",
"new",
"save",
"-",
"data",
"header",
"to",
"determine",
"if",
"we",
"have",
"a",
"metered",
"connection",
"."
] | d3c66f934bcaa8e5e0424cf684c995b1c80cee29 | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DetectDefaults.php#L85-L96 |
25,005 | PenoaksDev/Milky-Framework | src/Milky/Account/Permissions/PermissionManager.php | PermissionManager.policy | public function policy( Policy $policy )
{
$this->loadedPolicies[] = $policy;
// Caches the policy nodes as a nestable tree
foreach ( $policy->getNodes() as $namespace => $callable )
$this->getPermission( $namespace )->addPolicyMethod( $callable );
} | php | public function policy( Policy $policy )
{
$this->loadedPolicies[] = $policy;
// Caches the policy nodes as a nestable tree
foreach ( $policy->getNodes() as $namespace => $callable )
$this->getPermission( $namespace )->addPolicyMethod( $callable );
} | [
"public",
"function",
"policy",
"(",
"Policy",
"$",
"policy",
")",
"{",
"$",
"this",
"->",
"loadedPolicies",
"[",
"]",
"=",
"$",
"policy",
";",
"// Caches the policy nodes as a nestable tree",
"foreach",
"(",
"$",
"policy",
"->",
"getNodes",
"(",
")",
"as",
... | Adds a new policy checker.
Policies are checked for permissions before they are checked by the general permission backend
@param Policy $policy | [
"Adds",
"a",
"new",
"policy",
"checker",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Permissions/PermissionManager.php#L78-L85 |
25,006 | PenoaksDev/Milky-Framework | src/Milky/Account/Permissions/PermissionManager.php | PermissionManager.checkRaw | protected function checkRaw( $namespace, PermissibleEntity $entity = null )
{
if ( $namespace == null || strlen( $namespace ) == 0 || $namespace == "everybody" || $namespace == "-1" )
$namespace = Permission::EVERYBODY;
if ( $namespace == "op" || $namespace == "0" )
$namespace = Permission::OP;
if ( $names... | php | protected function checkRaw( $namespace, PermissibleEntity $entity = null )
{
if ( $namespace == null || strlen( $namespace ) == 0 || $namespace == "everybody" || $namespace == "-1" )
$namespace = Permission::EVERYBODY;
if ( $namespace == "op" || $namespace == "0" )
$namespace = Permission::OP;
if ( $names... | [
"protected",
"function",
"checkRaw",
"(",
"$",
"namespace",
",",
"PermissibleEntity",
"$",
"entity",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"namespace",
"==",
"null",
"||",
"strlen",
"(",
"$",
"namespace",
")",
"==",
"0",
"||",
"$",
"namespace",
"==",
... | Checks a raw singular namespace and returns the unhindered result
@param $namespace
@param PermissibleEntity|null $entity
@return string | [
"Checks",
"a",
"raw",
"singular",
"namespace",
"and",
"returns",
"the",
"unhindered",
"result"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Permissions/PermissionManager.php#L178-L243 |
25,007 | PenoaksDev/Milky-Framework | src/Milky/Account/Permissions/PermissionManager.php | PermissionManager.check | public function check( $namespaces, PermissibleModel $model = null, PermissibleEntity $entity = null )
{
// Allows for static calling
$instance = $this ?: self::i();
if ( !is_array( $namespaces ) )
$namespaces = [$namespaces];
foreach ( $namespaces as &$ns )
{
if ( !is_string( $ns ) )
throw new P... | php | public function check( $namespaces, PermissibleModel $model = null, PermissibleEntity $entity = null )
{
// Allows for static calling
$instance = $this ?: self::i();
if ( !is_array( $namespaces ) )
$namespaces = [$namespaces];
foreach ( $namespaces as &$ns )
{
if ( !is_string( $ns ) )
throw new P... | [
"public",
"function",
"check",
"(",
"$",
"namespaces",
",",
"PermissibleModel",
"$",
"model",
"=",
"null",
",",
"PermissibleEntity",
"$",
"entity",
"=",
"null",
")",
"{",
"// Allows for static calling",
"$",
"instance",
"=",
"$",
"this",
"?",
":",
"self",
":... | Checks a permission for assignment and policy checks
@param string|array $namespace
@param PermissibleEntity|null $entity
@return bool | [
"Checks",
"a",
"permission",
"for",
"assignment",
"and",
"policy",
"checks"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Permissions/PermissionManager.php#L253-L308 |
25,008 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGPwithCDN.php | DomCssAndJavascriptByDanielGPwithCDN.setCssFileCDN | protected function setCssFileCDN($cssFileName)
{
$patternFound = null;
if (strpos(pathinfo($cssFileName)['basename'], 'font-awesome-') !== false) {
$patternFound = $this->setCssFileCDNforFontAwesome($cssFileName);
}
if (is_null($patternFound)) {
$patternFound ... | php | protected function setCssFileCDN($cssFileName)
{
$patternFound = null;
if (strpos(pathinfo($cssFileName)['basename'], 'font-awesome-') !== false) {
$patternFound = $this->setCssFileCDNforFontAwesome($cssFileName);
}
if (is_null($patternFound)) {
$patternFound ... | [
"protected",
"function",
"setCssFileCDN",
"(",
"$",
"cssFileName",
")",
"{",
"$",
"patternFound",
"=",
"null",
";",
"if",
"(",
"strpos",
"(",
"pathinfo",
"(",
"$",
"cssFileName",
")",
"[",
"'basename'",
"]",
",",
"'font-awesome-'",
")",
"!==",
"false",
")"... | Manages all known CSS that can be handled through CDNs
@param string $cssFileName
@return array|string | [
"Manages",
"all",
"known",
"CSS",
"that",
"can",
"be",
"handled",
"through",
"CDNs"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGPwithCDN.php#L78-L88 |
25,009 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGPwithCDN.php | DomCssAndJavascriptByDanielGPwithCDN.setJavascriptFileCDNforHighChartsMain | private function setJavascriptFileCDNforHighChartsMain($jsFileName, $libName)
{
$jsFN = $this->sanitizeString($jsFileName);
$jsVersionlessFN = str_replace([$libName . '-', '.js'], '', pathinfo($jsFileName)['basename'])
. ($libName === 'exporting' ? '/modules' : '');
if... | php | private function setJavascriptFileCDNforHighChartsMain($jsFileName, $libName)
{
$jsFN = $this->sanitizeString($jsFileName);
$jsVersionlessFN = str_replace([$libName . '-', '.js'], '', pathinfo($jsFileName)['basename'])
. ($libName === 'exporting' ? '/modules' : '');
if... | [
"private",
"function",
"setJavascriptFileCDNforHighChartsMain",
"(",
"$",
"jsFileName",
",",
"$",
"libName",
")",
"{",
"$",
"jsFN",
"=",
"$",
"this",
"->",
"sanitizeString",
"(",
"$",
"jsFileName",
")",
";",
"$",
"jsVersionlessFN",
"=",
"str_replace",
"(",
"["... | Returns an array with CDN call of a known Javascript library
and fall-back line that points to local cache of it
specific for HighCharts
@param string $jsFileName
@param string $libName
@return array | [
"Returns",
"an",
"array",
"with",
"CDN",
"call",
"of",
"a",
"known",
"Javascript",
"library",
"and",
"fall",
"-",
"back",
"line",
"that",
"points",
"to",
"local",
"cache",
"of",
"it",
"specific",
"for",
"HighCharts"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGPwithCDN.php#L178-L191 |
25,010 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGPwithCDN.php | DomCssAndJavascriptByDanielGPwithCDN.setJavascriptFileCDNjQuery | private function setJavascriptFileCDNjQuery($jsFileName)
{
$jQueryPosition = strpos($jsFileName, 'jquery-');
$jQueryMajorVersion = substr($jsFileName, 7, 1);
if (($jQueryPosition !== false) && is_numeric($jQueryMajorVersion) && (substr($jsFileName, -7) == '.min.js')) {
return... | php | private function setJavascriptFileCDNjQuery($jsFileName)
{
$jQueryPosition = strpos($jsFileName, 'jquery-');
$jQueryMajorVersion = substr($jsFileName, 7, 1);
if (($jQueryPosition !== false) && is_numeric($jQueryMajorVersion) && (substr($jsFileName, -7) == '.min.js')) {
return... | [
"private",
"function",
"setJavascriptFileCDNjQuery",
"(",
"$",
"jsFileName",
")",
"{",
"$",
"jQueryPosition",
"=",
"strpos",
"(",
"$",
"jsFileName",
",",
"'jquery-'",
")",
";",
"$",
"jQueryMajorVersion",
"=",
"substr",
"(",
"$",
"jsFileName",
",",
"7",
",",
... | Returns an array with CDN call of a known Javascript library
and fall-back line that points to local cache of it
specific for jQuery
@param string $jsFileName
@return array | [
"Returns",
"an",
"array",
"with",
"CDN",
"call",
"of",
"a",
"known",
"Javascript",
"library",
"and",
"fall",
"-",
"back",
"line",
"that",
"points",
"to",
"local",
"cache",
"of",
"it",
"specific",
"for",
"jQuery"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGPwithCDN.php#L201-L214 |
25,011 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGPwithCDN.php | DomCssAndJavascriptByDanielGPwithCDN.setJavascriptFileCDNjQueryLibs | private function setJavascriptFileCDNjQueryLibs($jsFileName)
{
$sFN = $this->sanitizeString($jsFileName);
$eArray = $this->knownCloudFlareJavascript($sFN);
if (!is_null($eArray['version'])) {
return [
true,
$this->sCloundFlareUrl . $eArray['vers... | php | private function setJavascriptFileCDNjQueryLibs($jsFileName)
{
$sFN = $this->sanitizeString($jsFileName);
$eArray = $this->knownCloudFlareJavascript($sFN);
if (!is_null($eArray['version'])) {
return [
true,
$this->sCloundFlareUrl . $eArray['vers... | [
"private",
"function",
"setJavascriptFileCDNjQueryLibs",
"(",
"$",
"jsFileName",
")",
"{",
"$",
"sFN",
"=",
"$",
"this",
"->",
"sanitizeString",
"(",
"$",
"jsFileName",
")",
";",
"$",
"eArray",
"=",
"$",
"this",
"->",
"knownCloudFlareJavascript",
"(",
"$",
"... | Returns an array with CDN call of a known Javascript library
and fall-back line that points to local cache of it
specific for jQuery Libraries
@param string $jsFileName
@return array | [
"Returns",
"an",
"array",
"with",
"CDN",
"call",
"of",
"a",
"known",
"Javascript",
"library",
"and",
"fall",
"-",
"back",
"line",
"that",
"points",
"to",
"local",
"cache",
"of",
"it",
"specific",
"for",
"jQuery",
"Libraries"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGPwithCDN.php#L224-L237 |
25,012 | SysControllers/Admin | src/app/Http/Controllers/Admin/UsersController.php | UsersController.profileData | public function profileData()
{
$user = Auth::user();
$profile = UserProfile::whereUserId($user->id)->first();
$data = Input::all();
$rules = [
'nombre' => 'required',
'apellidos' => 'required'
];
$validator = Validator::make($data, $rules)... | php | public function profileData()
{
$user = Auth::user();
$profile = UserProfile::whereUserId($user->id)->first();
$data = Input::all();
$rules = [
'nombre' => 'required',
'apellidos' => 'required'
];
$validator = Validator::make($data, $rules)... | [
"public",
"function",
"profileData",
"(",
")",
"{",
"$",
"user",
"=",
"Auth",
"::",
"user",
"(",
")",
";",
"$",
"profile",
"=",
"UserProfile",
"::",
"whereUserId",
"(",
"$",
"user",
"->",
"id",
")",
"->",
"first",
"(",
")",
";",
"$",
"data",
"=",
... | Funcion para cambiar datos de Perfil de usuario logeado | [
"Funcion",
"para",
"cambiar",
"datos",
"de",
"Perfil",
"de",
"usuario",
"logeado"
] | 8f1df46aca422b87f2f522fbba610dcfa0c5f7f3 | https://github.com/SysControllers/Admin/blob/8f1df46aca422b87f2f522fbba610dcfa0c5f7f3/src/app/Http/Controllers/Admin/UsersController.php#L197-L224 |
25,013 | koolkode/lexer | src/AbstractTokenSequence.php | AbstractTokenSequence.contains | public function contains($type)
{
foreach($this->tokens as $token)
{
if($token->is($type))
{
return true;
}
}
return false;
} | php | public function contains($type)
{
foreach($this->tokens as $token)
{
if($token->is($type))
{
return true;
}
}
return false;
} | [
"public",
"function",
"contains",
"(",
"$",
"type",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"tokens",
"as",
"$",
"token",
")",
"{",
"if",
"(",
"$",
"token",
"->",
"is",
"(",
"$",
"type",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"ret... | Check if the sequence contains at least one token of the given type.
@param integer $type
@return boolean | [
"Check",
"if",
"the",
"sequence",
"contains",
"at",
"least",
"one",
"token",
"of",
"the",
"given",
"type",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenSequence.php#L42-L53 |
25,014 | koolkode/lexer | src/AbstractTokenSequence.php | AbstractTokenSequence.containsOneOf | public function containsOneOf(array $types)
{
foreach($this->tokens as $token)
{
if($token->isOneOf($types))
{
return true;
}
}
return false;
} | php | public function containsOneOf(array $types)
{
foreach($this->tokens as $token)
{
if($token->isOneOf($types))
{
return true;
}
}
return false;
} | [
"public",
"function",
"containsOneOf",
"(",
"array",
"$",
"types",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"tokens",
"as",
"$",
"token",
")",
"{",
"if",
"(",
"$",
"token",
"->",
"isOneOf",
"(",
"$",
"types",
")",
")",
"{",
"return",
"true",
";... | Check if the sequence contains at least one token of any of the given token types.
@param array<integer> $types
@return boolean | [
"Check",
"if",
"the",
"sequence",
"contains",
"at",
"least",
"one",
"token",
"of",
"any",
"of",
"the",
"given",
"token",
"types",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenSequence.php#L61-L72 |
25,015 | koolkode/lexer | src/AbstractTokenSequence.php | AbstractTokenSequence.endsWith | public function endsWith($type)
{
if(empty($this->tokens))
{
return false;
}
return $this->tokens[count($this->tokens) - 1]->is($type);
} | php | public function endsWith($type)
{
if(empty($this->tokens))
{
return false;
}
return $this->tokens[count($this->tokens) - 1]->is($type);
} | [
"public",
"function",
"endsWith",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"tokens",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"tokens",
"[",
"count",
"(",
"$",
"this",
"->",
"tokens",
... | Check if the sequence ends with a token of the given token type.
@param integer $type
@return boolean | [
"Check",
"if",
"the",
"sequence",
"ends",
"with",
"a",
"token",
"of",
"the",
"given",
"token",
"type",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenSequence.php#L80-L88 |
25,016 | koolkode/http | src/HttpResponse.php | HttpResponse.setStatus | public function setStatus($status)
{
$status = (int)$status;
if($status < 100)
{
throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
}
if($status >= 600)
{
throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
}
$this->... | php | public function setStatus($status)
{
$status = (int)$status;
if($status < 100)
{
throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
}
if($status >= 600)
{
throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
}
$this->... | [
"public",
"function",
"setStatus",
"(",
"$",
"status",
")",
"{",
"$",
"status",
"=",
"(",
"int",
")",
"$",
"status",
";",
"if",
"(",
"$",
"status",
"<",
"100",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Invalid H... | Set the HTTP status of this response.
@param integer $status
@return HttpResponse
@throws \InvalidArgumentException | [
"Set",
"the",
"HTTP",
"status",
"of",
"this",
"response",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpResponse.php#L82-L99 |
25,017 | koolkode/http | src/HttpResponse.php | HttpResponse.removeCookie | public function removeCookie($name)
{
$cookie = new SetCookieHeader($name, '');
$cookie->setExpires(1337);
$this->addHeader($cookie);
return $this;
} | php | public function removeCookie($name)
{
$cookie = new SetCookieHeader($name, '');
$cookie->setExpires(1337);
$this->addHeader($cookie);
return $this;
} | [
"public",
"function",
"removeCookie",
"(",
"$",
"name",
")",
"{",
"$",
"cookie",
"=",
"new",
"SetCookieHeader",
"(",
"$",
"name",
",",
"''",
")",
";",
"$",
"cookie",
"->",
"setExpires",
"(",
"1337",
")",
";",
"$",
"this",
"->",
"addHeader",
"(",
"$",... | Remove a cookie by eliminating a Set-Cookie header for this cookie replacing it with a
header that will cause the client to remove the cookie.
@param string $name Name of the cookie to be removed.
@return HttpResponse | [
"Remove",
"a",
"cookie",
"by",
"eliminating",
"a",
"Set",
"-",
"Cookie",
"header",
"for",
"this",
"cookie",
"replacing",
"it",
"with",
"a",
"header",
"that",
"will",
"cause",
"the",
"client",
"to",
"remove",
"the",
"cookie",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/HttpResponse.php#L194-L202 |
25,018 | shrink0r/monatic | src/Attempt.php | Attempt.get | public function get(callable $codeBlock = null)
{
if (!$this->result) {
$this->result = $this->run(new Success);
}
if ($this->result instanceof Success) {
return is_callable($codeBlock) ? $codeBlock($this->result) : $this->result;
}
return $this->res... | php | public function get(callable $codeBlock = null)
{
if (!$this->result) {
$this->result = $this->run(new Success);
}
if ($this->result instanceof Success) {
return is_callable($codeBlock) ? $codeBlock($this->result) : $this->result;
}
return $this->res... | [
"public",
"function",
"get",
"(",
"callable",
"$",
"codeBlock",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"result",
")",
"{",
"$",
"this",
"->",
"result",
"=",
"$",
"this",
"->",
"run",
"(",
"new",
"Success",
")",
";",
"}",
"if",
... | Returns the result of the code-block execution attempt.
@param callable $codeBlock Is never executed for this type.
@return null | [
"Returns",
"the",
"result",
"of",
"the",
"code",
"-",
"block",
"execution",
"attempt",
"."
] | f39b8b2ef68a397d31d844341487412b335fd107 | https://github.com/shrink0r/monatic/blob/f39b8b2ef68a397d31d844341487412b335fd107/src/Attempt.php#L38-L49 |
25,019 | shrink0r/monatic | src/Attempt.php | Attempt.bind | public function bind(callable $codeBlock)
{
return static::unit(function ($result) use ($codeBlock) {
$result = $this->run($result);
if ($result instanceof Success) {
return $codeBlock($result);
} else {
return $result;
}
... | php | public function bind(callable $codeBlock)
{
return static::unit(function ($result) use ($codeBlock) {
$result = $this->run($result);
if ($result instanceof Success) {
return $codeBlock($result);
} else {
return $result;
}
... | [
"public",
"function",
"bind",
"(",
"callable",
"$",
"codeBlock",
")",
"{",
"return",
"static",
"::",
"unit",
"(",
"function",
"(",
"$",
"result",
")",
"use",
"(",
"$",
"codeBlock",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"run",
"(",
"$",
"... | Returns a new Attempt monad that is bound to the given code-block.
@param callable $codeBlock
@return Attempt | [
"Returns",
"a",
"new",
"Attempt",
"monad",
"that",
"is",
"bound",
"to",
"the",
"given",
"code",
"-",
"block",
"."
] | f39b8b2ef68a397d31d844341487412b335fd107 | https://github.com/shrink0r/monatic/blob/f39b8b2ef68a397d31d844341487412b335fd107/src/Attempt.php#L58-L68 |
25,020 | shrink0r/monatic | src/Attempt.php | Attempt.run | protected function run(MonadInterface $prevResult, callable $next = null)
{
try {
$result = call_user_func($this->codeBlock, $prevResult);
return ($result instanceof MonadInterface) ? $result : Success::unit($result);
} catch (Exception $error) {
return Error::uni... | php | protected function run(MonadInterface $prevResult, callable $next = null)
{
try {
$result = call_user_func($this->codeBlock, $prevResult);
return ($result instanceof MonadInterface) ? $result : Success::unit($result);
} catch (Exception $error) {
return Error::uni... | [
"protected",
"function",
"run",
"(",
"MonadInterface",
"$",
"prevResult",
",",
"callable",
"$",
"next",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"call_user_func",
"(",
"$",
"this",
"->",
"codeBlock",
",",
"$",
"prevResult",
")",
";",
"retur... | Runs the monad's code-block.
@param MonadInterface $prevResult
@param callable $next
@return MonadInterface Either Success or Error in case an exception occured. | [
"Runs",
"the",
"monad",
"s",
"code",
"-",
"block",
"."
] | f39b8b2ef68a397d31d844341487412b335fd107 | https://github.com/shrink0r/monatic/blob/f39b8b2ef68a397d31d844341487412b335fd107/src/Attempt.php#L89-L97 |
25,021 | ciims/ciims-modules-install | models/UserForm.php | UserForm.validateForm | public function validateForm()
{
// Validates the model
if ($this->validate())
{
// Getters and setters don't work in CFormModel? So set them manually
$this->encryptionKey = $this->getEncryptionKey();
$this->encryptedPassword = $this->getEncrypte... | php | public function validateForm()
{
// Validates the model
if ($this->validate())
{
// Getters and setters don't work in CFormModel? So set them manually
$this->encryptionKey = $this->getEncryptionKey();
$this->encryptedPassword = $this->getEncrypte... | [
"public",
"function",
"validateForm",
"(",
")",
"{",
"// Validates the model",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"// Getters and setters don't work in CFormModel? So set them manually",
"$",
"this",
"->",
"encryptionKey",
"=",
"$",
"this",
... | Validates the model, and provides the encrypted data stream for hashing
@return bool If the model validated or not | [
"Validates",
"the",
"model",
"and",
"provides",
"the",
"encrypted",
"data",
"stream",
"for",
"hashing"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/models/UserForm.php#L90-L102 |
25,022 | ciims/ciims-modules-install | models/UserForm.php | UserForm.save | public function save()
{
if (!$this->validateForm())
return false;
try
{
// Store some data in session temporarily
Yii::app()->session['encryptionKey'] = $this->encryptionKey;
Yii::app()->session['siteName'] = $this->siteNam... | php | public function save()
{
if (!$this->validateForm())
return false;
try
{
// Store some data in session temporarily
Yii::app()->session['encryptionKey'] = $this->encryptionKey;
Yii::app()->session['siteName'] = $this->siteNam... | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateForm",
"(",
")",
")",
"return",
"false",
";",
"try",
"{",
"// Store some data in session temporarily",
"Yii",
"::",
"app",
"(",
")",
"->",
"session",
"[",
"'encryption... | This method will save the admin user into the database, | [
"This",
"method",
"will",
"save",
"the",
"admin",
"user",
"into",
"the",
"database"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/models/UserForm.php#L107-L136 |
25,023 | ciims/ciims-modules-install | models/UserForm.php | UserForm.checkConfigDir | public function checkConfigDir()
{
if (is_writable(dirname(__FILE__) . '/../../../config'))
return true;
$this->addError('isConfigDirWritable', Yii::t('Install.main','Configuration directory is not writable. This must be corrected before your settings can be applied.'));
... | php | public function checkConfigDir()
{
if (is_writable(dirname(__FILE__) . '/../../../config'))
return true;
$this->addError('isConfigDirWritable', Yii::t('Install.main','Configuration directory is not writable. This must be corrected before your settings can be applied.'));
... | [
"public",
"function",
"checkConfigDir",
"(",
")",
"{",
"if",
"(",
"is_writable",
"(",
"dirname",
"(",
"__FILE__",
")",
".",
"'/../../../config'",
")",
")",
"return",
"true",
";",
"$",
"this",
"->",
"addError",
"(",
"'isConfigDirWritable'",
",",
"Yii",
"::",
... | Validator for checkConfigDir | [
"Validator",
"for",
"checkConfigDir"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/models/UserForm.php#L141-L148 |
25,024 | frodosghost/AtomLoggerBundle | Connection/Request.php | Request.formatData | public function formatData()
{
$this->formatter->addData($this->data);
try {
$formatted = $this->formatter->format();
} catch (DataException $e) {
throw new FormattingException('The provided data has been incorrectly formatted.');
}
return $formatted... | php | public function formatData()
{
$this->formatter->addData($this->data);
try {
$formatted = $this->formatter->format();
} catch (DataException $e) {
throw new FormattingException('The provided data has been incorrectly formatted.');
}
return $formatted... | [
"public",
"function",
"formatData",
"(",
")",
"{",
"$",
"this",
"->",
"formatter",
"->",
"addData",
"(",
"$",
"this",
"->",
"data",
")",
";",
"try",
"{",
"$",
"formatted",
"=",
"$",
"this",
"->",
"formatter",
"->",
"format",
"(",
")",
";",
"}",
"ca... | Calls the Formatter with the data passed into the Request
@return string | [
"Calls",
"the",
"Formatter",
"with",
"the",
"data",
"passed",
"into",
"the",
"Request"
] | c48823e4b3772e498b366867f27e6581f613f733 | https://github.com/frodosghost/AtomLoggerBundle/blob/c48823e4b3772e498b366867f27e6581f613f733/Connection/Request.php#L57-L68 |
25,025 | freialib/fenrir.system | src/Web.php | Web.send | function send($contents, $status = 200, array $headers = null) {
$this->http_response_code($status);
if ($headers !== null) {
foreach ($headers as $header) {
$this->header($header[0], $header[1], $header[2]);
}
}
if ( ! empty($contents)) {
echo $contents;
}
} | php | function send($contents, $status = 200, array $headers = null) {
$this->http_response_code($status);
if ($headers !== null) {
foreach ($headers as $header) {
$this->header($header[0], $header[1], $header[2]);
}
}
if ( ! empty($contents)) {
echo $contents;
}
} | [
"function",
"send",
"(",
"$",
"contents",
",",
"$",
"status",
"=",
"200",
",",
"array",
"$",
"headers",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"http_response_code",
"(",
"$",
"status",
")",
";",
"if",
"(",
"$",
"headers",
"!==",
"null",
")",
"{"... | Sent content to the client. | [
"Sent",
"content",
"to",
"the",
"client",
"."
] | 388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8 | https://github.com/freialib/fenrir.system/blob/388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8/src/Web.php#L86-L99 |
25,026 | frodosghost/AtomLoggerBundle | Controller/Controller.php | Controller.createNotFoundException | public function createNotFoundException($message = 'Not Found', \Exception $previous = null)
{
if ($this->has('atom.404.logger')) {
$log = $this->get('atom.404.logger');
$log->addRecord(400, $message, array('request' => $this->getRequest()->getUri()));
}
return new N... | php | public function createNotFoundException($message = 'Not Found', \Exception $previous = null)
{
if ($this->has('atom.404.logger')) {
$log = $this->get('atom.404.logger');
$log->addRecord(400, $message, array('request' => $this->getRequest()->getUri()));
}
return new N... | [
"public",
"function",
"createNotFoundException",
"(",
"$",
"message",
"=",
"'Not Found'",
",",
"\\",
"Exception",
"$",
"previous",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"'atom.404.logger'",
")",
")",
"{",
"$",
"log",
"=",
"$",
... | Sends 404 to Page AtomLogger
@param string $message Error Message to be logged
@param \Exception $previous Previous message made prior to 404
@return NotFoundHttpException | [
"Sends",
"404",
"to",
"Page",
"AtomLogger"
] | c48823e4b3772e498b366867f27e6581f613f733 | https://github.com/frodosghost/AtomLoggerBundle/blob/c48823e4b3772e498b366867f27e6581f613f733/Controller/Controller.php#L26-L34 |
25,027 | nicodevs/laito | src/Laito/Controller.php | Controller.index | public function index($params = [])
{
// Set the filters
$params = (!empty($params))? $params : $this->app->request->input();
// Get records
$this->model->params = $params;
$result = $this->model->search($params)->get();
// Get pagination and number of records
... | php | public function index($params = [])
{
// Set the filters
$params = (!empty($params))? $params : $this->app->request->input();
// Get records
$this->model->params = $params;
$result = $this->model->search($params)->get();
// Get pagination and number of records
... | [
"public",
"function",
"index",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"// Set the filters",
"$",
"params",
"=",
"(",
"!",
"empty",
"(",
"$",
"params",
")",
")",
"?",
"$",
"params",
":",
"$",
"this",
"->",
"app",
"->",
"request",
"->",
"input"... | Display a listing of the resource
@param array $params Listing parameters
@return array Response | [
"Display",
"a",
"listing",
"of",
"the",
"resource"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Controller.php#L49-L70 |
25,028 | nicodevs/laito | src/Laito/Controller.php | Controller.show | public function show($id = null)
{
// Check the ID
if (!isset($id)) {
throw new \InvalidArgumentException('Undefined ID', 400);
}
// Get record
$item = $this->model->find($id);
// Abort if the record is not found
if (!$item) {
throw n... | php | public function show($id = null)
{
// Check the ID
if (!isset($id)) {
throw new \InvalidArgumentException('Undefined ID', 400);
}
// Get record
$item = $this->model->find($id);
// Abort if the record is not found
if (!$item) {
throw n... | [
"public",
"function",
"show",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"// Check the ID",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Undefined ID'",
",",
"400",
")",
";",
"}",
"// Get ... | Display the specified resource
@param array $id Resource ID
@return array Response | [
"Display",
"the",
"specified",
"resource"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Controller.php#L78-L98 |
25,029 | nicodevs/laito | src/Laito/Controller.php | Controller.store | public function store($attributes = [])
{
// Set the attributes
$attributes = (!empty($attributes))? $attributes : $this->app->request->input();
// Create the record
$result = $this->model->create($attributes);
// Return results
return [
'success' => tru... | php | public function store($attributes = [])
{
// Set the attributes
$attributes = (!empty($attributes))? $attributes : $this->app->request->input();
// Create the record
$result = $this->model->create($attributes);
// Return results
return [
'success' => tru... | [
"public",
"function",
"store",
"(",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"// Set the attributes",
"$",
"attributes",
"=",
"(",
"!",
"empty",
"(",
"$",
"attributes",
")",
")",
"?",
"$",
"attributes",
":",
"$",
"this",
"->",
"app",
"->",
"request"... | Stores a newly created resource in storage
@param array $params Resource attributes
@return array Response | [
"Stores",
"a",
"newly",
"created",
"resource",
"in",
"storage"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Controller.php#L106-L120 |
25,030 | nicodevs/laito | src/Laito/Controller.php | Controller.update | public function update($id = null, $attributes = [])
{
// Check the ID
if (!isset($id)) {
throw new \InvalidArgumentException('Undefined ID', 400);
}
// Set the attributes
$attributes = (!empty($attributes))? $attributes : $this->app->request->input();
/... | php | public function update($id = null, $attributes = [])
{
// Check the ID
if (!isset($id)) {
throw new \InvalidArgumentException('Undefined ID', 400);
}
// Set the attributes
$attributes = (!empty($attributes))? $attributes : $this->app->request->input();
/... | [
"public",
"function",
"update",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"// Check the ID",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Undefined ... | Update the specified resource in storage
@param array $id Resource ID
@return array Response | [
"Update",
"the",
"specified",
"resource",
"in",
"storage"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Controller.php#L128-L147 |
25,031 | nicodevs/laito | src/Laito/Controller.php | Controller.destroy | public function destroy($id = null)
{
// Check the ID
if (!isset($id)) {
throw new \InvalidArgumentException('Undefined ID', 400);
}
// Delete the record
$result = $this->model->destroy($id);
// Return results
return [
'success' => tr... | php | public function destroy($id = null)
{
// Check the ID
if (!isset($id)) {
throw new \InvalidArgumentException('Undefined ID', 400);
}
// Delete the record
$result = $this->model->destroy($id);
// Return results
return [
'success' => tr... | [
"public",
"function",
"destroy",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"// Check the ID",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Undefined ID'",
",",
"400",
")",
";",
"}",
"// D... | Remove the specified resource from storage
@param array $id Resource ID
@return array Response | [
"Remove",
"the",
"specified",
"resource",
"from",
"storage"
] | d2d28abfcbf981c4decfec28ce94f8849600e9fe | https://github.com/nicodevs/laito/blob/d2d28abfcbf981c4decfec28ce94f8849600e9fe/src/Laito/Controller.php#L155-L170 |
25,032 | Linkvalue-Interne/MobileNotifBundle | DependencyInjection/Configuration.php | Configuration.addApnsClientsNode | private function addApnsClientsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('apns');
$node
->useAttributeAsKey('name')
->prototype('array')
->children()
->arrayNode('services')
->addDefaults... | php | private function addApnsClientsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('apns');
$node
->useAttributeAsKey('name')
->prototype('array')
->children()
->arrayNode('services')
->addDefaults... | [
"private",
"function",
"addApnsClientsNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'apns'",
")",
";",
"$",
"node",
"->",
"useAttributeAsKey",
"(",
"'name'",
")",
"... | Add APNS clients node.
@return \Symfony\Component\Config\Definition\Builder\NodeDefinition | [
"Add",
"APNS",
"clients",
"node",
"."
] | 8124f4132c581516be9928ece81ae2cf9f59763d | https://github.com/Linkvalue-Interne/MobileNotifBundle/blob/8124f4132c581516be9928ece81ae2cf9f59763d/DependencyInjection/Configuration.php#L41-L69 |
25,033 | kkthek/diqa-util | maintenance/runStatistics.php | RunStatistics.getStatisticSites | private function getStatisticSites() {
$result = [ ];
$StatistikQuery = new \SMWPrintRequest ( \SMWPrintRequest::PRINT_PROP, "StatistikQuery",
\SMWPropertyValue::makeUserProperty ( 'StatistikQuery' ) );
$StatistikTemplate = new \SMWPrintRequest ( \SMWPrintRequest::PRINT_PROP, "StatistikTemplate",
\SMWP... | php | private function getStatisticSites() {
$result = [ ];
$StatistikQuery = new \SMWPrintRequest ( \SMWPrintRequest::PRINT_PROP, "StatistikQuery",
\SMWPropertyValue::makeUserProperty ( 'StatistikQuery' ) );
$StatistikTemplate = new \SMWPrintRequest ( \SMWPrintRequest::PRINT_PROP, "StatistikTemplate",
\SMWP... | [
"private",
"function",
"getStatisticSites",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"StatistikQuery",
"=",
"new",
"\\",
"SMWPrintRequest",
"(",
"\\",
"SMWPrintRequest",
"::",
"PRINT_PROP",
",",
"\"StatistikQuery\"",
",",
"\\",
"SMWPropertyValue",
... | Returns array of statistic site with StatistikQuery, StatistikTemplate annotations
@return array of [ title, statistikQuery, statistikTemplate ] | [
"Returns",
"array",
"of",
"statistic",
"site",
"with",
"StatistikQuery",
"StatistikTemplate",
"annotations"
] | df35d16403b5dbf0f7570daded6cfa26814ae7e0 | https://github.com/kkthek/diqa-util/blob/df35d16403b5dbf0f7570daded6cfa26814ae7e0/maintenance/runStatistics.php#L49-L71 |
25,034 | Stinger-Soft/MediaParsingBundle | Parser/ParserCompilerPass.php | ParserCompilerPass.process | public function process(ContainerBuilder $container){
if (!$container->hasDefinition(ParserChainInterface::SERVICE_ID)) {
return;
}
$definition = $container->getDefinition(ParserChainInterface::SERVICE_ID);
$taggedServices = $container->findTaggedServiceIds(MediaParserInterface::SERVICE_TAG);
foreac... | php | public function process(ContainerBuilder $container){
if (!$container->hasDefinition(ParserChainInterface::SERVICE_ID)) {
return;
}
$definition = $container->getDefinition(ParserChainInterface::SERVICE_ID);
$taggedServices = $container->findTaggedServiceIds(MediaParserInterface::SERVICE_TAG);
foreac... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"$",
"container",
"->",
"hasDefinition",
"(",
"ParserChainInterface",
"::",
"SERVICE_ID",
")",
")",
"{",
"return",
";",
"}",
"$",
"definition",
"=",
"$",
... | Searches for all Audio Parsers that are tagged as 'stinger_soft.audioparser' inside all services.yml files
@see Symfony\Component\DependencyInjection\Compiler.CompilerPassInterface::process() | [
"Searches",
"for",
"all",
"Audio",
"Parsers",
"that",
"are",
"tagged",
"as",
"stinger_soft",
".",
"audioparser",
"inside",
"all",
"services",
".",
"yml",
"files"
] | 6f68ddf75c1c4ef4da912643710abc824fd8d3e2 | https://github.com/Stinger-Soft/MediaParsingBundle/blob/6f68ddf75c1c4ef4da912643710abc824fd8d3e2/Parser/ParserCompilerPass.php#L24-L41 |
25,035 | sndsgd/http | src/http/request/Host.php | Host.getDnsName | public function getDnsName(): string
{
$host = $this->environment["HTTP_HOST"] ?? "";
$port = strpos($host, ":");
if ($port !== false) {
return substr($host, 0, $port);
}
return $host;
} | php | public function getDnsName(): string
{
$host = $this->environment["HTTP_HOST"] ?? "";
$port = strpos($host, ":");
if ($port !== false) {
return substr($host, 0, $port);
}
return $host;
} | [
"public",
"function",
"getDnsName",
"(",
")",
":",
"string",
"{",
"$",
"host",
"=",
"$",
"this",
"->",
"environment",
"[",
"\"HTTP_HOST\"",
"]",
"??",
"\"\"",
";",
"$",
"port",
"=",
"strpos",
"(",
"$",
"host",
",",
"\":\"",
")",
";",
"if",
"(",
"$"... | Retrieve the name of the request host
@return string | [
"Retrieve",
"the",
"name",
"of",
"the",
"request",
"host"
] | e7f82010a66c6d3241a24ea82baf4593130c723b | https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/request/Host.php#L45-L53 |
25,036 | gplcart/cli | controllers/commands/Role.php | Role.cmdPermAddRole | public function cmdPermAddRole()
{
list($role_id, $existing, $submitted) = $this->getPermissionsRole();
$data = array('permissions' => array_unique(array_merge($existing, $submitted)));
$this->setSubmitted(null, $data);
$this->setSubmitted('update', $role_id);
$this->valid... | php | public function cmdPermAddRole()
{
list($role_id, $existing, $submitted) = $this->getPermissionsRole();
$data = array('permissions' => array_unique(array_merge($existing, $submitted)));
$this->setSubmitted(null, $data);
$this->setSubmitted('update', $role_id);
$this->valid... | [
"public",
"function",
"cmdPermAddRole",
"(",
")",
"{",
"list",
"(",
"$",
"role_id",
",",
"$",
"existing",
",",
"$",
"submitted",
")",
"=",
"$",
"this",
"->",
"getPermissionsRole",
"(",
")",
";",
"$",
"data",
"=",
"array",
"(",
"'permissions'",
"=>",
"a... | Callback for "role-perm-add" command | [
"Callback",
"for",
"role",
"-",
"perm",
"-",
"add",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L40-L53 |
25,037 | gplcart/cli | controllers/commands/Role.php | Role.cmdPermDeleteRole | public function cmdPermDeleteRole()
{
list($role_id, $existing, $submitted) = $this->getPermissionsRole();
$data = array(
'permissions' => array_unique(array_diff($existing, $submitted))
);
$this->setSubmitted(null, $data);
$this->setSubmitted('update', $role_id... | php | public function cmdPermDeleteRole()
{
list($role_id, $existing, $submitted) = $this->getPermissionsRole();
$data = array(
'permissions' => array_unique(array_diff($existing, $submitted))
);
$this->setSubmitted(null, $data);
$this->setSubmitted('update', $role_id... | [
"public",
"function",
"cmdPermDeleteRole",
"(",
")",
"{",
"list",
"(",
"$",
"role_id",
",",
"$",
"existing",
",",
"$",
"submitted",
")",
"=",
"$",
"this",
"->",
"getPermissionsRole",
"(",
")",
";",
"$",
"data",
"=",
"array",
"(",
"'permissions'",
"=>",
... | Callback for "role-perm-delete" command | [
"Callback",
"for",
"role",
"-",
"perm",
"-",
"delete",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L58-L73 |
25,038 | gplcart/cli | controllers/commands/Role.php | Role.cmdGetRole | public function cmdGetRole()
{
$result = $this->getListRole();
$this->outputFormat($result);
$this->outputFormatTableRole($result);
$this->output();
} | php | public function cmdGetRole()
{
$result = $this->getListRole();
$this->outputFormat($result);
$this->outputFormatTableRole($result);
$this->output();
} | [
"public",
"function",
"cmdGetRole",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getListRole",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
"outputFormatTableRole",
"(",
"$",
"result",
")"... | Callback for "role-get" command | [
"Callback",
"for",
"role",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L78-L84 |
25,039 | gplcart/cli | controllers/commands/Role.php | Role.cmdDeleteRole | public function cmdDeleteRole()
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (!isset($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = false;
if (isset($id)) {
if (empty($id) || !is_num... | php | public function cmdDeleteRole()
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (!isset($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = false;
if (isset($id)) {
if (empty($id) || !is_num... | [
"public",
"function",
"cmdDeleteRole",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"$",
"all",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'all'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"id",
")",
"&&",... | Callback for "role-delete" command | [
"Callback",
"for",
"role",
"-",
"delete",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L89-L124 |
25,040 | gplcart/cli | controllers/commands/Role.php | Role.cmdUpdateRole | public function cmdUpdateRole()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | php | public function cmdUpdateRole()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | [
"public",
"function",
"cmdUpdateRole",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParam",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"0",
"]",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"2",
")",
"{",
"$",... | Callback for "role-update" command | [
"Callback",
"for",
"role",
"-",
"update",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L143-L163 |
25,041 | gplcart/cli | controllers/commands/Role.php | Role.submitAddRole | protected function submitAddRole()
{
$this->setSubmitted(null, $this->getParam());
$this->setSubmittedList('permissions');
$this->validateComponent('user_role');
$this->addRole();
} | php | protected function submitAddRole()
{
$this->setSubmitted(null, $this->getParam());
$this->setSubmittedList('permissions');
$this->validateComponent('user_role');
$this->addRole();
} | [
"protected",
"function",
"submitAddRole",
"(",
")",
"{",
"$",
"this",
"->",
"setSubmitted",
"(",
"null",
",",
"$",
"this",
"->",
"getParam",
"(",
")",
")",
";",
"$",
"this",
"->",
"setSubmittedList",
"(",
"'permissions'",
")",
";",
"$",
"this",
"->",
"... | Add a new user role at once | [
"Add",
"a",
"new",
"user",
"role",
"at",
"once"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L261-L267 |
25,042 | gplcart/cli | controllers/commands/Role.php | Role.addRole | protected function addRole()
{
if (!$this->isError()) {
$id = $this->role->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | php | protected function addRole()
{
if (!$this->isError()) {
$id = $this->role->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | [
"protected",
"function",
"addRole",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isError",
"(",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"role",
"->",
"add",
"(",
"$",
"this",
"->",
"getSubmitted",
"(",
")",
")",
";",
"if",
"(",
... | Add a new user role | [
"Add",
"a",
"new",
"user",
"role"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L272-L281 |
25,043 | gplcart/cli | controllers/commands/Role.php | Role.wizardAddRole | protected function wizardAddRole()
{
$this->validatePrompt('name', $this->text('Name'), 'user_role');
$this->validatePromptList('permissions', $this->text('Permissions'), 'user_role');
$this->validatePrompt('redirect', $this->text('Redirect'), 'user_role', '');
$this->validatePrompt(... | php | protected function wizardAddRole()
{
$this->validatePrompt('name', $this->text('Name'), 'user_role');
$this->validatePromptList('permissions', $this->text('Permissions'), 'user_role');
$this->validatePrompt('redirect', $this->text('Redirect'), 'user_role', '');
$this->validatePrompt(... | [
"protected",
"function",
"wizardAddRole",
"(",
")",
"{",
"$",
"this",
"->",
"validatePrompt",
"(",
"'name'",
",",
"$",
"this",
"->",
"text",
"(",
"'Name'",
")",
",",
"'user_role'",
")",
";",
"$",
"this",
"->",
"validatePromptList",
"(",
"'permissions'",
",... | Add a new user role step by step | [
"Add",
"a",
"new",
"user",
"role",
"step",
"by",
"step"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Role.php#L286-L296 |
25,044 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.All | public function All( $Func )
{
$result = true;
$Func = new Expression( $Func );
foreach ( $this->repository as $item )
$result &= $Func->execute( $item );
return (boolean)$result;
} | php | public function All( $Func )
{
$result = true;
$Func = new Expression( $Func );
foreach ( $this->repository as $item )
$result &= $Func->execute( $item );
return (boolean)$result;
} | [
"public",
"function",
"All",
"(",
"$",
"Func",
")",
"{",
"$",
"result",
"=",
"true",
";",
"$",
"Func",
"=",
"new",
"Expression",
"(",
"$",
"Func",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"repository",
"as",
"$",
"item",
")",
"$",
"result",
"... | Retreive all items with or without condition
@param string|Closure $Func
@return bool | [
"Retreive",
"all",
"items",
"with",
"or",
"without",
"condition"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L72-L84 |
25,045 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Where | public function Where( $Func )
{
if ( $Func != null ){
$repo = array();
$Func = new Expression( $Func );
foreach ( $this->repository as $item )
if ( $Func->execute( $item ) )
$repo[] = $item;
} else {
$repo = $this->repository;
}
return $this->getClone()->setRepository( $repo );
... | php | public function Where( $Func )
{
if ( $Func != null ){
$repo = array();
$Func = new Expression( $Func );
foreach ( $this->repository as $item )
if ( $Func->execute( $item ) )
$repo[] = $item;
} else {
$repo = $this->repository;
}
return $this->getClone()->setRepository( $repo );
... | [
"public",
"function",
"Where",
"(",
"$",
"Func",
")",
"{",
"if",
"(",
"$",
"Func",
"!=",
"null",
")",
"{",
"$",
"repo",
"=",
"array",
"(",
")",
";",
"$",
"Func",
"=",
"new",
"Expression",
"(",
"$",
"Func",
")",
";",
"foreach",
"(",
"$",
"this",... | Filters a sequence of values based on a predicate.
@param string|Closure $Func
@return Queryable | [
"Filters",
"a",
"sequence",
"of",
"values",
"based",
"on",
"a",
"predicate",
"."
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L92-L113 |
25,046 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Any | public function Any( $Func )
{
$result = false;
$Func = new Expression( $Func );
foreach ( $this->repository as $item ) $result |= $Func->execute( $item );
return (boolean)$result;
} | php | public function Any( $Func )
{
$result = false;
$Func = new Expression( $Func );
foreach ( $this->repository as $item ) $result |= $Func->execute( $item );
return (boolean)$result;
} | [
"public",
"function",
"Any",
"(",
"$",
"Func",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"Func",
"=",
"new",
"Expression",
"(",
"$",
"Func",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"repository",
"as",
"$",
"item",
")",
"$",
"result",
... | Determines whether a sequence contains any elements.
@param string|Closure $Func
@return bool | [
"Determines",
"whether",
"a",
"sequence",
"contains",
"any",
"elements",
"."
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L121-L132 |
25,047 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Count | public function Count( $Func = null )
{
return $Func ? $this->Where( $Func )->Count() : count( $this->repository );
} | php | public function Count( $Func = null )
{
return $Func ? $this->Where( $Func )->Count() : count( $this->repository );
} | [
"public",
"function",
"Count",
"(",
"$",
"Func",
"=",
"null",
")",
"{",
"return",
"$",
"Func",
"?",
"$",
"this",
"->",
"Where",
"(",
"$",
"Func",
")",
"->",
"Count",
"(",
")",
":",
"count",
"(",
"$",
"this",
"->",
"repository",
")",
";",
"}"
] | Count repository with or without condition
@param string|Closure $Func
@return int | [
"Count",
"repository",
"with",
"or",
"without",
"condition"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L140-L145 |
25,048 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Average | public function Average( $Func = null )
{
$items = $this->Select( $Func );
$count = $items->Count();
$sum = 0;
foreach ( $items as $item ) $sum += $item;
return $sum / $count;
} | php | public function Average( $Func = null )
{
$items = $this->Select( $Func );
$count = $items->Count();
$sum = 0;
foreach ( $items as $item ) $sum += $item;
return $sum / $count;
} | [
"public",
"function",
"Average",
"(",
"$",
"Func",
"=",
"null",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"Select",
"(",
"$",
"Func",
")",
";",
"$",
"count",
"=",
"$",
"items",
"->",
"Count",
"(",
")",
";",
"$",
"sum",
"=",
"0",
";",
"f... | Get Average of sequence
@param string|Closure $Func
@return double | [
"Get",
"Average",
"of",
"sequence"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L153-L166 |
25,049 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Sum | public function Sum( $Func = null )
{
$items = $this->Select( $Func );
$sum = 0;
foreach ( $items as $item ) $sum += $item;
return $sum;
} | php | public function Sum( $Func = null )
{
$items = $this->Select( $Func );
$sum = 0;
foreach ( $items as $item ) $sum += $item;
return $sum;
} | [
"public",
"function",
"Sum",
"(",
"$",
"Func",
"=",
"null",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"Select",
"(",
"$",
"Func",
")",
";",
"$",
"sum",
"=",
"0",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"item",
")",
"$",
"sum",
"+=... | Get sum of sequence
@param string|Closure $Func
@return double | [
"Get",
"sum",
"of",
"sequence"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L174-L182 |
25,050 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Concat | public function Concat( $source )
{
$source = is_array($source) ? $source : ( $source instanceof Queryable ? $source->toList() : iterator_to_array($source) );
return $this
->getClone()
->setRepository( array_merge( $this->repository , $source ) );
} | php | public function Concat( $source )
{
$source = is_array($source) ? $source : ( $source instanceof Queryable ? $source->toList() : iterator_to_array($source) );
return $this
->getClone()
->setRepository( array_merge( $this->repository , $source ) );
} | [
"public",
"function",
"Concat",
"(",
"$",
"source",
")",
"{",
"$",
"source",
"=",
"is_array",
"(",
"$",
"source",
")",
"?",
"$",
"source",
":",
"(",
"$",
"source",
"instanceof",
"Queryable",
"?",
"$",
"source",
"->",
"toList",
"(",
")",
":",
"iterato... | Concatenates two sequences.
@param array|Queryable|Traversable $source
@return Queryable | [
"Concatenates",
"two",
"sequences",
"."
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L201-L210 |
25,051 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Except | public function Except( $items )
{
return $this
->getClone()
->setRepository( array_diff( $this->repository , $items instanceof Queryable ? $items->toArray() : $items ) );
} | php | public function Except( $items )
{
return $this
->getClone()
->setRepository( array_diff( $this->repository , $items instanceof Queryable ? $items->toArray() : $items ) );
} | [
"public",
"function",
"Except",
"(",
"$",
"items",
")",
"{",
"return",
"$",
"this",
"->",
"getClone",
"(",
")",
"->",
"setRepository",
"(",
"array_diff",
"(",
"$",
"this",
"->",
"repository",
",",
"$",
"items",
"instanceof",
"Queryable",
"?",
"$",
"items... | Produces the set difference of two sequences by using the default equality comparer to compare values.
@param array|Queryable $items Items
@return Queryable | [
"Produces",
"the",
"set",
"difference",
"of",
"two",
"sequences",
"by",
"using",
"the",
"default",
"equality",
"comparer",
"to",
"compare",
"values",
"."
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L232-L239 |
25,052 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.First | public function First( $Func = null , $default = null )
{
$bag = $Func ? $this->Select($Func) : $this->repository;
return current($bag) ?: $default;
} | php | public function First( $Func = null , $default = null )
{
$bag = $Func ? $this->Select($Func) : $this->repository;
return current($bag) ?: $default;
} | [
"public",
"function",
"First",
"(",
"$",
"Func",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"bag",
"=",
"$",
"Func",
"?",
"$",
"this",
"->",
"Select",
"(",
"$",
"Func",
")",
":",
"$",
"this",
"->",
"repository",
";",
"return",
... | Get first element of sequence with or without condition
@param string|Closure $Func Condition
@param null $default
@return mixed
@internal param mixed $defaul Default | [
"Get",
"first",
"element",
"of",
"sequence",
"with",
"or",
"without",
"condition"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L249-L253 |
25,053 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.SelectKeyValue | public function SelectKeyValue( $Key , $Value ) {
$Key = new Expression( $Key );
$Value = new Expression( $Value );
$items = array();
foreach ( $this->repository as $item ) {
$_k = $Key->execute( $item );
$_v = $Value->execute( $item );
$items[$_k] ... | php | public function SelectKeyValue( $Key , $Value ) {
$Key = new Expression( $Key );
$Value = new Expression( $Value );
$items = array();
foreach ( $this->repository as $item ) {
$_k = $Key->execute( $item );
$_v = $Value->execute( $item );
$items[$_k] ... | [
"public",
"function",
"SelectKeyValue",
"(",
"$",
"Key",
",",
"$",
"Value",
")",
"{",
"$",
"Key",
"=",
"new",
"Expression",
"(",
"$",
"Key",
")",
";",
"$",
"Value",
"=",
"new",
"Expression",
"(",
"$",
"Value",
")",
";",
"$",
"items",
"=",
"array",
... | Select key value
@param Closure $Key
@param Closure $Value
@return Queryable | [
"Select",
"key",
"value"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L328-L343 |
25,054 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Intersect | public function Intersect( $items )
{
return $this
->getClone()
->setRepository( array_intersect( $this->repository , $items instanceof Queryable ? $items->toArray() : $items ) );
} | php | public function Intersect( $items )
{
return $this
->getClone()
->setRepository( array_intersect( $this->repository , $items instanceof Queryable ? $items->toArray() : $items ) );
} | [
"public",
"function",
"Intersect",
"(",
"$",
"items",
")",
"{",
"return",
"$",
"this",
"->",
"getClone",
"(",
")",
"->",
"setRepository",
"(",
"array_intersect",
"(",
"$",
"this",
"->",
"repository",
",",
"$",
"items",
"instanceof",
"Queryable",
"?",
"$",
... | Get Intersect of two sequence
@param array|Queryable $items
@return Queryable | [
"Get",
"Intersect",
"of",
"two",
"sequence"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L367-L374 |
25,055 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Cast | public function Cast( $type )
{
$obj = $this->getClone();
foreach ($obj->repository as &$value) {
settype($value, $type);
}
return $obj;
} | php | public function Cast( $type )
{
$obj = $this->getClone();
foreach ($obj->repository as &$value) {
settype($value, $type);
}
return $obj;
} | [
"public",
"function",
"Cast",
"(",
"$",
"type",
")",
"{",
"$",
"obj",
"=",
"$",
"this",
"->",
"getClone",
"(",
")",
";",
"foreach",
"(",
"$",
"obj",
"->",
"repository",
"as",
"&",
"$",
"value",
")",
"{",
"settype",
"(",
"$",
"value",
",",
"$",
... | Casts the elements to the specified type.
@param string $type Type
@return Queryable | [
"Casts",
"the",
"elements",
"to",
"the",
"specified",
"type",
"."
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L382-L393 |
25,056 | mdzzohrabi/Azera-Queryable | Queryable.php | Queryable.Sort | public function Sort( $Func = null )
{
$sorted = $this->repository;
$Func = new Expression( $Func );
usort( $sorted , [ $Func , 'execute' ] );
return $this
->getClone()
->setRepository( $sorted );
} | php | public function Sort( $Func = null )
{
$sorted = $this->repository;
$Func = new Expression( $Func );
usort( $sorted , [ $Func , 'execute' ] );
return $this
->getClone()
->setRepository( $sorted );
} | [
"public",
"function",
"Sort",
"(",
"$",
"Func",
"=",
"null",
")",
"{",
"$",
"sorted",
"=",
"$",
"this",
"->",
"repository",
";",
"$",
"Func",
"=",
"new",
"Expression",
"(",
"$",
"Func",
")",
";",
"usort",
"(",
"$",
"sorted",
",",
"[",
"$",
"Func"... | Sort sequence by given comparator
@param Expression $Func Comparator
@return Queryable | [
"Sort",
"sequence",
"by",
"given",
"comparator"
] | 6b85f335d33f8326c259e623b0c410396789f70b | https://github.com/mdzzohrabi/Azera-Queryable/blob/6b85f335d33f8326c259e623b0c410396789f70b/Queryable.php#L553-L564 |
25,057 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.compare | public static function compare($string, $value, $length = 0) {
$string = (string) $string;
$value = (string) $value;
if ($length > 0) {
return strncasecmp($string, $value, $length);
}
return strcasecmp($string, $value);
} | php | public static function compare($string, $value, $length = 0) {
$string = (string) $string;
$value = (string) $value;
if ($length > 0) {
return strncasecmp($string, $value, $length);
}
return strcasecmp($string, $value);
} | [
"public",
"static",
"function",
"compare",
"(",
"$",
"string",
",",
"$",
"value",
",",
"$",
"length",
"=",
"0",
")",
"{",
"$",
"string",
"=",
"(",
"string",
")",
"$",
"string",
";",
"$",
"value",
"=",
"(",
"string",
")",
"$",
"value",
";",
"if",
... | Compares to strings alphabetically. Returns 0 if they are equal, negative if passed value is greater, or positive if current value is greater.
@param string $string
@param string $value
@param int $length
@return int | [
"Compares",
"to",
"strings",
"alphabetically",
".",
"Returns",
"0",
"if",
"they",
"are",
"equal",
"negative",
"if",
"passed",
"value",
"is",
"greater",
"or",
"positive",
"if",
"current",
"value",
"is",
"greater",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L49-L58 |
25,058 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.contains | public static function contains($string, $needle, $strict = true, $offset = 0) {
return (static::indexOf($string, $needle, $strict, $offset) !== false);
} | php | public static function contains($string, $needle, $strict = true, $offset = 0) {
return (static::indexOf($string, $needle, $strict, $offset) !== false);
} | [
"public",
"static",
"function",
"contains",
"(",
"$",
"string",
",",
"$",
"needle",
",",
"$",
"strict",
"=",
"true",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"return",
"(",
"static",
"::",
"indexOf",
"(",
"$",
"string",
",",
"$",
"needle",
",",
"$",... | Check to see if a string exists within this string.
@param string $string
@param string $needle
@param bool $strict
@param int $offset
@return bool | [
"Check",
"to",
"see",
"if",
"a",
"string",
"exists",
"within",
"this",
"string",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L69-L71 |
25,059 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.endsWith | public static function endsWith($string, $needle, $strict = true) {
$end = static::extract($string, -mb_strlen($needle));
if ($strict) {
return ($end === $needle);
}
return (mb_strtolower($end) === mb_strtolower($needle));
} | php | public static function endsWith($string, $needle, $strict = true) {
$end = static::extract($string, -mb_strlen($needle));
if ($strict) {
return ($end === $needle);
}
return (mb_strtolower($end) === mb_strtolower($needle));
} | [
"public",
"static",
"function",
"endsWith",
"(",
"$",
"string",
",",
"$",
"needle",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"$",
"end",
"=",
"static",
"::",
"extract",
"(",
"$",
"string",
",",
"-",
"mb_strlen",
"(",
"$",
"needle",
")",
")",
";",... | Checks to see if the string ends with a specific value.
@param string $string
@param string $needle
@param bool $strict
@return bool | [
"Checks",
"to",
"see",
"if",
"the",
"string",
"ends",
"with",
"a",
"specific",
"value",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L81-L89 |
25,060 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.extract | public static function extract($string, $offset, $length = null) {
if ($length) {
return mb_substr($string, $offset, $length);
}
return mb_substr($string, $offset);
} | php | public static function extract($string, $offset, $length = null) {
if ($length) {
return mb_substr($string, $offset, $length);
}
return mb_substr($string, $offset);
} | [
"public",
"static",
"function",
"extract",
"(",
"$",
"string",
",",
"$",
"offset",
",",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"length",
")",
"{",
"return",
"mb_substr",
"(",
"$",
"string",
",",
"$",
"offset",
",",
"$",
"length",
")"... | Extracts a portion of a string.
@param string $string
@param int $offset
@param int $length
@return string | [
"Extracts",
"a",
"portion",
"of",
"a",
"string",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L99-L105 |
25,061 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.indexOf | public static function indexOf($string, $needle, $strict = true, $offset = 0) {
if ($strict) {
return mb_strpos($string, $needle, $offset);
}
return mb_stripos($string, $needle, $offset);
} | php | public static function indexOf($string, $needle, $strict = true, $offset = 0) {
if ($strict) {
return mb_strpos($string, $needle, $offset);
}
return mb_stripos($string, $needle, $offset);
} | [
"public",
"static",
"function",
"indexOf",
"(",
"$",
"string",
",",
"$",
"needle",
",",
"$",
"strict",
"=",
"true",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"mb_strpos",
"(",
"$",
"string",
",",
"$",
"... | Grab the index of the first matched character.
@param string $string
@param string $needle
@param bool $strict
@param int $offset
@return int | [
"Grab",
"the",
"index",
"of",
"the",
"first",
"matched",
"character",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L135-L141 |
25,062 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.insert | public static function insert($string, array $data, array $options = array()) {
$options = $options + array(
'before' => '{',
'after' => '}',
'escape' => true
);
foreach ($data as $key => $value) {
$string = str_replace($options['before'] . $key .... | php | public static function insert($string, array $data, array $options = array()) {
$options = $options + array(
'before' => '{',
'after' => '}',
'escape' => true
);
foreach ($data as $key => $value) {
$string = str_replace($options['before'] . $key .... | [
"public",
"static",
"function",
"insert",
"(",
"$",
"string",
",",
"array",
"$",
"data",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"$",
"options",
"+",
"array",
"(",
"'before'",
"=>",
"'{'",
",",
"'after'",
... | Insert values into a string defined by an array of key tokens.
@uses Titon\Utility\Sanitize
@param string $string
@param array $data
@param array $options {
@type string $before Opening variable delimiter
@type string $after Closing variable delimiter
@type bool $escape Escape the string
}
@return string | [
"Insert",
"values",
"into",
"a",
"string",
"defined",
"by",
"an",
"array",
"of",
"key",
"tokens",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L157-L173 |
25,063 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.lastIndexOf | public static function lastIndexOf($string, $needle, $strict = true, $offset = 0) {
if ($strict) {
return mb_strrpos($string, $needle, $offset);
}
return mb_strripos($string, $needle, $offset);
} | php | public static function lastIndexOf($string, $needle, $strict = true, $offset = 0) {
if ($strict) {
return mb_strrpos($string, $needle, $offset);
}
return mb_strripos($string, $needle, $offset);
} | [
"public",
"static",
"function",
"lastIndexOf",
"(",
"$",
"string",
",",
"$",
"needle",
",",
"$",
"strict",
"=",
"true",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"mb_strrpos",
"(",
"$",
"string",
",",
"$"... | Grab the index of the last matched character.
@param string $string
@param string $needle
@param bool $strict
@param int $offset
@return int | [
"Grab",
"the",
"index",
"of",
"the",
"last",
"matched",
"character",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L184-L190 |
25,064 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.listing | public static function listing($items, $glue = ' & ', $sep = ', ') {
if (is_array($items)) {
$lastItem = array_pop($items);
if (count($items) === 0) {
return $lastItem;
}
$items = implode($sep, $items);
$items = $items . $glue . $... | php | public static function listing($items, $glue = ' & ', $sep = ', ') {
if (is_array($items)) {
$lastItem = array_pop($items);
if (count($items) === 0) {
return $lastItem;
}
$items = implode($sep, $items);
$items = $items . $glue . $... | [
"public",
"static",
"function",
"listing",
"(",
"$",
"items",
",",
"$",
"glue",
"=",
"' & '",
",",
"$",
"sep",
"=",
"', '",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"items",
")",
")",
"{",
"$",
"lastItem",
"=",
"array_pop",
"(",
"$",
"items",... | Creates a comma separated list with the last item having an ampersand prefixing it.
@param array $items
@param string $glue
@param string $sep
@return string | [
"Creates",
"a",
"comma",
"separated",
"list",
"with",
"the",
"last",
"item",
"having",
"an",
"ampersand",
"prefixing",
"it",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L200-L213 |
25,065 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.shorten | public static function shorten($string, $limit = 25, $glue = ' … ') {
if (mb_strlen($string) > $limit) {
$width = round($limit / 2);
// prefix
$pre = mb_substr($string, 0, $width);
if (mb_substr($pre, -1) !== ' ' && ($i = static::lastIndexOf($pre, ' '))) ... | php | public static function shorten($string, $limit = 25, $glue = ' … ') {
if (mb_strlen($string) > $limit) {
$width = round($limit / 2);
// prefix
$pre = mb_substr($string, 0, $width);
if (mb_substr($pre, -1) !== ' ' && ($i = static::lastIndexOf($pre, ' '))) ... | [
"public",
"static",
"function",
"shorten",
"(",
"$",
"string",
",",
"$",
"limit",
"=",
"25",
",",
"$",
"glue",
"=",
"' … '",
")",
"{",
"if",
"(",
"mb_strlen",
"(",
"$",
"string",
")",
">",
"$",
"limit",
")",
"{",
"$",
"width",
"=",
"round",
... | If a string is too long, shorten it in the middle while also respecting whitespace and preserving words.
@param string $string
@param int $limit
@param string $glue
@return string | [
"If",
"a",
"string",
"is",
"too",
"long",
"shorten",
"it",
"in",
"the",
"middle",
"while",
"also",
"respecting",
"whitespace",
"and",
"preserving",
"words",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L223-L245 |
25,066 | vpg/titon.utility | src/Titon/Utility/Str.php | Str.startsWith | public static function startsWith($string, $needle, $strict = true) {
$start = static::extract($string, 0, mb_strlen($needle));
if ($strict) {
return ($start === $needle);
}
return (mb_strtolower($start) === mb_strtolower($needle));
} | php | public static function startsWith($string, $needle, $strict = true) {
$start = static::extract($string, 0, mb_strlen($needle));
if ($strict) {
return ($start === $needle);
}
return (mb_strtolower($start) === mb_strtolower($needle));
} | [
"public",
"static",
"function",
"startsWith",
"(",
"$",
"string",
",",
"$",
"needle",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"$",
"start",
"=",
"static",
"::",
"extract",
"(",
"$",
"string",
",",
"0",
",",
"mb_strlen",
"(",
"$",
"needle",
")",
... | Checks to see if the string starts with a specific value.
@param string $string
@param string $needle
@param bool $strict
@return bool | [
"Checks",
"to",
"see",
"if",
"the",
"string",
"starts",
"with",
"a",
"specific",
"value",
"."
] | 8a77eb9e7b8baacf41cc25487289779d8319cd3a | https://github.com/vpg/titon.utility/blob/8a77eb9e7b8baacf41cc25487289779d8319cd3a/src/Titon/Utility/Str.php#L255-L263 |
25,067 | agentmedia/phine-core | src/Core/Logic/Module/BackendForm.php | BackendForm.AddRichTextField | protected function AddRichTextField($name, $value = '')
{
$renderer = new CKEditorRenderer(PathUtil::BackendRTEPath(), PathUtil::BackendRTEUrl(),
PathUtil::UploadPath(), PathUtil::UploadUrl(), self::Guard());
$field = new Custom($renderer);
$field->SetName($name);
$field->... | php | protected function AddRichTextField($name, $value = '')
{
$renderer = new CKEditorRenderer(PathUtil::BackendRTEPath(), PathUtil::BackendRTEUrl(),
PathUtil::UploadPath(), PathUtil::UploadUrl(), self::Guard());
$field = new Custom($renderer);
$field->SetName($name);
$field->... | [
"protected",
"function",
"AddRichTextField",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
")",
"{",
"$",
"renderer",
"=",
"new",
"CKEditorRenderer",
"(",
"PathUtil",
"::",
"BackendRTEPath",
"(",
")",
",",
"PathUtil",
"::",
"BackendRTEUrl",
"(",
")",
","... | Adds a field with the default rich text editor
@param string $name The field name
@param string $value The field value
@return Custom Returns the custom field containing the RT Editor | [
"Adds",
"a",
"field",
"with",
"the",
"default",
"rich",
"text",
"editor"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/BackendForm.php#L16-L25 |
25,068 | freialib/hlin.archetype | src/Trait/Context.php | ContextTrait.addpath | function addpath($name, $fspath, $overwrite = false) {
if ( ! $overwrite && isset($this->registeredpaths[$name])) {
throw new Panic("A path is already registered for $name.");
}
else { // path is not registered yet or overwrite == true
$this->registeredpaths[$name] = $fspath;
}
} | php | function addpath($name, $fspath, $overwrite = false) {
if ( ! $overwrite && isset($this->registeredpaths[$name])) {
throw new Panic("A path is already registered for $name.");
}
else { // path is not registered yet or overwrite == true
$this->registeredpaths[$name] = $fspath;
}
} | [
"function",
"addpath",
"(",
"$",
"name",
",",
"$",
"fspath",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"overwrite",
"&&",
"isset",
"(",
"$",
"this",
"->",
"registeredpaths",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
... | Registers a path under a specified name.
If the path is already registered the method will Panic unless the 3rd
parameter is passed. | [
"Registers",
"a",
"path",
"under",
"a",
"specified",
"name",
"."
] | d8750a9bf4b7efb8063899969e3f39c1915c423a | https://github.com/freialib/hlin.archetype/blob/d8750a9bf4b7efb8063899969e3f39c1915c423a/src/Trait/Context.php#L96-L103 |
25,069 | freialib/hlin.archetype | src/Trait/Context.php | ContextTrait.path | function path($name, $null_on_failure = false) {
if ( ! isset($this->registeredpaths[$name])) {
if ($null_on_failure) {
return null;
}
else { // panic
throw new Panic("There is no path registered for $name.");
}
}
else { //
return $this->registeredpaths[$name];
}
} | php | function path($name, $null_on_failure = false) {
if ( ! isset($this->registeredpaths[$name])) {
if ($null_on_failure) {
return null;
}
else { // panic
throw new Panic("There is no path registered for $name.");
}
}
else { //
return $this->registeredpaths[$name];
}
} | [
"function",
"path",
"(",
"$",
"name",
",",
"$",
"null_on_failure",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"registeredpaths",
"[",
"$",
"name",
"]",
")",
")",
"{",
"if",
"(",
"$",
"null_on_failure",
")",
"{",
"retur... | Retrieves the specified path. If the path is not registered the method
will Panic, unless the second parameter is set, in which case it will
just return null.
@return string|null | [
"Retrieves",
"the",
"specified",
"path",
".",
"If",
"the",
"path",
"is",
"not",
"registered",
"the",
"method",
"will",
"Panic",
"unless",
"the",
"second",
"parameter",
"is",
"set",
"in",
"which",
"case",
"it",
"will",
"just",
"return",
"null",
"."
] | d8750a9bf4b7efb8063899969e3f39c1915c423a | https://github.com/freialib/hlin.archetype/blob/d8750a9bf4b7efb8063899969e3f39c1915c423a/src/Trait/Context.php#L112-L124 |
25,070 | TiMESPLiNTER/tsfw-db | lib/timesplinter/tsfw/db/DB.php | DB.addListener | public function addListener(DBListener $listener, $name = null)
{
if($name !== null)
$this->listeners->offsetSet($name, $listener);
else
$this->listeners->append($listener);
} | php | public function addListener(DBListener $listener, $name = null)
{
if($name !== null)
$this->listeners->offsetSet($name, $listener);
else
$this->listeners->append($listener);
} | [
"public",
"function",
"addListener",
"(",
"DBListener",
"$",
"listener",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"!==",
"null",
")",
"$",
"this",
"->",
"listeners",
"->",
"offsetSet",
"(",
"$",
"name",
",",
"$",
"listener",
"... | Adds a DBListener to listen on some events of the DB class
@param DBListener $listener The listener object to register
@param string $name The name of the listener [optional] | [
"Adds",
"a",
"DBListener",
"to",
"listen",
"on",
"some",
"events",
"of",
"the",
"DB",
"class"
] | d897d3d3a3d761a0f4fc9aa20426429d0aad1d92 | https://github.com/TiMESPLiNTER/tsfw-db/blob/d897d3d3a3d761a0f4fc9aa20426429d0aad1d92/lib/timesplinter/tsfw/db/DB.php#L142-L148 |
25,071 | TiMESPLiNTER/tsfw-db | lib/timesplinter/tsfw/db/DB.php | DB.triggerListeners | protected function triggerListeners($method, array $params = array())
{
if($this->muteListeners === true)
return;
// Mute all the listeners cause we don't want listeners called in listeners
// If we do so: unmute the listeners in the listener method itself
$this->muteListeners = true;
foreach($this->lis... | php | protected function triggerListeners($method, array $params = array())
{
if($this->muteListeners === true)
return;
// Mute all the listeners cause we don't want listeners called in listeners
// If we do so: unmute the listeners in the listener method itself
$this->muteListeners = true;
foreach($this->lis... | [
"protected",
"function",
"triggerListeners",
"(",
"$",
"method",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"muteListeners",
"===",
"true",
")",
"return",
";",
"// Mute all the listeners cause we don't want liste... | Triggers a call of a specific method from all registered listener classes if the listeners are not set to mute
@param string $method The listener method that should be called
@param array $params The parameters for the listener method | [
"Triggers",
"a",
"call",
"of",
"a",
"specific",
"method",
"from",
"all",
"registered",
"listener",
"classes",
"if",
"the",
"listeners",
"are",
"not",
"set",
"to",
"mute"
] | d897d3d3a3d761a0f4fc9aa20426429d0aad1d92 | https://github.com/TiMESPLiNTER/tsfw-db/blob/d897d3d3a3d761a0f4fc9aa20426429d0aad1d92/lib/timesplinter/tsfw/db/DB.php#L208-L224 |
25,072 | linpax/microphp-framework | src/queue/drivers/RabbitMQ.php | RabbitMQ.read | public function read($chat, $route, $nameReader = 'random')
{
$queue = new \AMQPQueue($this->channel);
$queue->setName($nameReader);
/** @noinspection PhpUndefinedMethodInspection */
$queue->declare();
$queue->bind($chat, $route);
$envelop = $queue->get();
if... | php | public function read($chat, $route, $nameReader = 'random')
{
$queue = new \AMQPQueue($this->channel);
$queue->setName($nameReader);
/** @noinspection PhpUndefinedMethodInspection */
$queue->declare();
$queue->bind($chat, $route);
$envelop = $queue->get();
if... | [
"public",
"function",
"read",
"(",
"$",
"chat",
",",
"$",
"route",
",",
"$",
"nameReader",
"=",
"'random'",
")",
"{",
"$",
"queue",
"=",
"new",
"\\",
"AMQPQueue",
"(",
"$",
"this",
"->",
"channel",
")",
";",
"$",
"queue",
"->",
"setName",
"(",
"$",... | Read current message
@access public
@param string $chat name chat room
@param string $route name route
@param string $nameReader name queue
@return \AMQPEnvelope|bool
@throws \AMQPConnectionException
@throws \AMQPChannelException
@throws \AMQPQueueException | [
"Read",
"current",
"message"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/queue/drivers/RabbitMQ.php#L90-L106 |
25,073 | linpax/microphp-framework | src/queue/drivers/RabbitMQ.php | RabbitMQ.readAll | public function readAll($chat, $route, $nameReader)
{
$queue = new \AMQPQueue($this->channel);
$queue->setName($nameReader);
/** @noinspection PhpUndefinedMethodInspection */
$queue->declare();
$queue->bind($chat, $route);
$result = [];
while ($envelop = $que... | php | public function readAll($chat, $route, $nameReader)
{
$queue = new \AMQPQueue($this->channel);
$queue->setName($nameReader);
/** @noinspection PhpUndefinedMethodInspection */
$queue->declare();
$queue->bind($chat, $route);
$result = [];
while ($envelop = $que... | [
"public",
"function",
"readAll",
"(",
"$",
"chat",
",",
"$",
"route",
",",
"$",
"nameReader",
")",
"{",
"$",
"queue",
"=",
"new",
"\\",
"AMQPQueue",
"(",
"$",
"this",
"->",
"channel",
")",
";",
"$",
"queue",
"->",
"setName",
"(",
"$",
"nameReader",
... | Read all messages
@access public
@param string $chat name chat room
@param string $route name route
@param string $nameReader name queue
@return array
@throws \AMQPConnectionException
@throws \AMQPQueueException
@throws \AMQPChannelException | [
"Read",
"all",
"messages"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/queue/drivers/RabbitMQ.php#L122-L137 |
25,074 | shgysk8zer0/core_api | traits/image.php | Image.resizeImage | final public function resizeImage($width = null, $height = null)
{
if (is_int($width) and is_int($height)) {
$new_image = imagecreatetruecolor($width, $height);
imagecopyresampled(
$new_image,
$this->_image_handle,
0,
0,
0,
0,
$width,
$height,
$this->imageWidth(),
$this-... | php | final public function resizeImage($width = null, $height = null)
{
if (is_int($width) and is_int($height)) {
$new_image = imagecreatetruecolor($width, $height);
imagecopyresampled(
$new_image,
$this->_image_handle,
0,
0,
0,
0,
$width,
$height,
$this->imageWidth(),
$this-... | [
"final",
"public",
"function",
"resizeImage",
"(",
"$",
"width",
"=",
"null",
",",
"$",
"height",
"=",
"null",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"width",
")",
"and",
"is_int",
"(",
"$",
"height",
")",
")",
"{",
"$",
"new_image",
"=",
"imagec... | Resize an image to an exact width and height
@param int $width Width in pixels
@param int $height Height in pixels
@return self With $this->_image_handle as resized image | [
"Resize",
"an",
"image",
"to",
"an",
"exact",
"width",
"and",
"height"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L172-L193 |
25,075 | shgysk8zer0/core_api | traits/image.php | Image.rotateImage | final public function rotateImage(
$angle = 0,
array $bgd_color = array(0, 0, 0, 127),
$ignore_transparent = false
)
{
$this->_image_handle = imagerotate(
$this->_image_handle,
$angle,
$this->_createImageColorAlpha($bgd_color),
$ignore_transparent ? 1 : 0
);
} | php | final public function rotateImage(
$angle = 0,
array $bgd_color = array(0, 0, 0, 127),
$ignore_transparent = false
)
{
$this->_image_handle = imagerotate(
$this->_image_handle,
$angle,
$this->_createImageColorAlpha($bgd_color),
$ignore_transparent ? 1 : 0
);
} | [
"final",
"public",
"function",
"rotateImage",
"(",
"$",
"angle",
"=",
"0",
",",
"array",
"$",
"bgd_color",
"=",
"array",
"(",
"0",
",",
"0",
",",
"0",
",",
"127",
")",
",",
"$",
"ignore_transparent",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_ima... | Rotate an image with a given angle
@param int $angle Rotation angle, in degrees.
@param array $bgd_color RGBA array for background color
@param bool $ignore_transparent Ignore transparent colors? | [
"Rotate",
"an",
"image",
"with",
"a",
"given",
"angle"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L221-L233 |
25,076 | shgysk8zer0/core_api | traits/image.php | Image._createImageColorAlpha | final protected function _createImageColorAlpha(array $rgba = array())
{
$keys = array('r', 'g', 'b', 'a');
$rgba = array_filter($rgba, 'is_int');
$rgba = array_map('abs', $rgba);
$rgba = array_pad($rgba, count($keys), 0);
$rgba = array_slice($rgba, 0, count($keys));
$rgba = array_combine($keys, $rgba);
... | php | final protected function _createImageColorAlpha(array $rgba = array())
{
$keys = array('r', 'g', 'b', 'a');
$rgba = array_filter($rgba, 'is_int');
$rgba = array_map('abs', $rgba);
$rgba = array_pad($rgba, count($keys), 0);
$rgba = array_slice($rgba, 0, count($keys));
$rgba = array_combine($keys, $rgba);
... | [
"final",
"protected",
"function",
"_createImageColorAlpha",
"(",
"array",
"$",
"rgba",
"=",
"array",
"(",
")",
")",
"{",
"$",
"keys",
"=",
"array",
"(",
"'r'",
",",
"'g'",
",",
"'b'",
",",
"'a'",
")",
";",
"$",
"rgba",
"=",
"array_filter",
"(",
"$",
... | Allocate a color for an image
@param array $rgba RGBA array for color
@return int A color identifier or FALSE if the allocation failed.
@see https://php.net/manual/en/function.imagecolorallocatealpha.php | [
"Allocate",
"a",
"color",
"for",
"an",
"image"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L242-L260 |
25,077 | shgysk8zer0/core_api | traits/image.php | Image.imagePNG | final public function imagePNG($filename = null, $quality = -1, $filters = PNG_NO_FILTER)
{
return imagepng($this->_image_handle, $filename, $quality, $filters);
} | php | final public function imagePNG($filename = null, $quality = -1, $filters = PNG_NO_FILTER)
{
return imagepng($this->_image_handle, $filename, $quality, $filters);
} | [
"final",
"public",
"function",
"imagePNG",
"(",
"$",
"filename",
"=",
"null",
",",
"$",
"quality",
"=",
"-",
"1",
",",
"$",
"filters",
"=",
"PNG_NO_FILTER",
")",
"{",
"return",
"imagepng",
"(",
"$",
"this",
"->",
"_image_handle",
",",
"$",
"filename",
... | Output a PNG image to either the browser or a file
@param string $filename The path to save the file to. null outputs directly
@param int $quality Compression level: from 0 (no compression) to 9.
@param int $filters Any combination of the PNG_FILTER_XXX constants.
@return bool True on success, f... | [
"Output",
"a",
"PNG",
"image",
"to",
"either",
"the",
"browser",
"or",
"a",
"file"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L295-L298 |
25,078 | shgysk8zer0/core_api | traits/image.php | Image.saveImage | final public function saveImage($filename)
{
$extension = pathinfo($filename, PATHINFO_EXTENSION);
if (! is_string($extension)) {
$extension = image_type_to_extension($this->_image_type);
$filename .= ".{$extension}";
}
switch(strtolower($extension))
{
case 'jpeg':
case 'jpg':
return $this-... | php | final public function saveImage($filename)
{
$extension = pathinfo($filename, PATHINFO_EXTENSION);
if (! is_string($extension)) {
$extension = image_type_to_extension($this->_image_type);
$filename .= ".{$extension}";
}
switch(strtolower($extension))
{
case 'jpeg':
case 'jpg':
return $this-... | [
"final",
"public",
"function",
"saveImage",
"(",
"$",
"filename",
")",
"{",
"$",
"extension",
"=",
"pathinfo",
"(",
"$",
"filename",
",",
"PATHINFO_EXTENSION",
")",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"extension",
")",
")",
"{",
"$",
"extension",... | Generic save funciton, which converts image according to extension
@param string $filename Path and extension to save to
@return bool Success or failure of save | [
"Generic",
"save",
"funciton",
"which",
"converts",
"image",
"according",
"to",
"extension"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L306-L333 |
25,079 | shgysk8zer0/core_api | traits/image.php | Image.imageAsDOMElement | final public function imageAsDOMElement($as = null)
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$image = $dom->appendChild($dom->createElement('img'));
$image->setAttribute('height', $this->imageHeight());
$image->setAttribute('width', $this->imageWidth());
$image->setAttribute('alt', $this->alt_text);
$i... | php | final public function imageAsDOMElement($as = null)
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$image = $dom->appendChild($dom->createElement('img'));
$image->setAttribute('height', $this->imageHeight());
$image->setAttribute('width', $this->imageWidth());
$image->setAttribute('alt', $this->alt_text);
$i... | [
"final",
"public",
"function",
"imageAsDOMElement",
"(",
"$",
"as",
"=",
"null",
")",
"{",
"$",
"dom",
"=",
"new",
"\\",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"image",
"=",
"$",
"dom",
"->",
"appendChild",
"(",
"$",
"dom",
"->",... | Create a DOMElement containing attributes of the image
@param void
@return DOMElement
@uses DOMDocument | [
"Create",
"a",
"DOMElement",
"containing",
"attributes",
"of",
"the",
"image"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L342-L351 |
25,080 | shgysk8zer0/core_api | traits/image.php | Image.imageAsString | final public function imageAsString($as = null)
{
$image = $this->imageAsDOMElement($as);
return $image->ownerDocument->saveHTML($image);
} | php | final public function imageAsString($as = null)
{
$image = $this->imageAsDOMElement($as);
return $image->ownerDocument->saveHTML($image);
} | [
"final",
"public",
"function",
"imageAsString",
"(",
"$",
"as",
"=",
"null",
")",
"{",
"$",
"image",
"=",
"$",
"this",
"->",
"imageAsDOMElement",
"(",
"$",
"as",
")",
";",
"return",
"$",
"image",
"->",
"ownerDocument",
"->",
"saveHTML",
"(",
"$",
"imag... | Uses imageAsDOMElement and returns it as an HTML string
@param void
@return string HTML <img> element | [
"Uses",
"imageAsDOMElement",
"and",
"returns",
"it",
"as",
"an",
"HTML",
"string"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L359-L363 |
25,081 | shgysk8zer0/core_api | traits/image.php | Image.dataURI | final public function dataURI($as = null)
{
$mime = is_int($as) ? image_type_to_mime_type($as) : $this->_image_mime;
return 'data:' . $mime . ';base64,' . base64_encode($this->imageAsBinary($as));
} | php | final public function dataURI($as = null)
{
$mime = is_int($as) ? image_type_to_mime_type($as) : $this->_image_mime;
return 'data:' . $mime . ';base64,' . base64_encode($this->imageAsBinary($as));
} | [
"final",
"public",
"function",
"dataURI",
"(",
"$",
"as",
"=",
"null",
")",
"{",
"$",
"mime",
"=",
"is_int",
"(",
"$",
"as",
")",
"?",
"image_type_to_mime_type",
"(",
"$",
"as",
")",
":",
"$",
"this",
"->",
"_image_mime",
";",
"return",
"'data:'",
".... | Converts image to a base64 encoded string
@param void
@return string "data:image/*;base64,..." | [
"Converts",
"image",
"to",
"a",
"base64",
"encoded",
"string"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/image.php#L371-L375 |
25,082 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.makeStatement | protected static function makeStatement($statement)
{
$self = self::getInstance();
$optionWhere = (!empty($self->optionWhere)) ? " WHERE ". substr(implode("", $self->optionWhere), 4) : null;
$optionJoin = implode("", $self->optionJoin);
$optionOrder = $self->optionOrder;
$... | php | protected static function makeStatement($statement)
{
$self = self::getInstance();
$optionWhere = (!empty($self->optionWhere)) ? " WHERE ". substr(implode("", $self->optionWhere), 4) : null;
$optionJoin = implode("", $self->optionJoin);
$optionOrder = $self->optionOrder;
$... | [
"protected",
"static",
"function",
"makeStatement",
"(",
"$",
"statement",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"optionWhere",
"=",
"(",
"!",
"empty",
"(",
"$",
"self",
"->",
"optionWhere",
")",
")",
"?",
"\" WHE... | Make Query Statement
@param string $statement
@return string | [
"Make",
"Query",
"Statement"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L125-L135 |
25,083 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.makeMultipleInsert | protected static function makeMultipleInsert($table, $data)
{
$insert_values = array();
foreach ($data as $d) {
$insert_values = array_merge($insert_values, array_values($d));
$count = count($d);
$array = array_fill(0, $count, '?');
$placeholder[] =... | php | protected static function makeMultipleInsert($table, $data)
{
$insert_values = array();
foreach ($data as $d) {
$insert_values = array_merge($insert_values, array_values($d));
$count = count($d);
$array = array_fill(0, $count, '?');
$placeholder[] =... | [
"protected",
"static",
"function",
"makeMultipleInsert",
"(",
"$",
"table",
",",
"$",
"data",
")",
"{",
"$",
"insert_values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"d",
")",
"{",
"$",
"insert_values",
"=",
"array_merge",
... | Make Multiple Insert Parameter
@param string $table
@param array $data
@return array | [
"Make",
"Multiple",
"Insert",
"Parameter"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L159-L178 |
25,084 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.makeUpdateParameter | protected static function makeUpdateParameter($data)
{
foreach ($data as $field => $value) {
$newData[] = "{$field}=:{$field}";
}
$newData = implode(",", $newData); // override new data
return $newData;
} | php | protected static function makeUpdateParameter($data)
{
foreach ($data as $field => $value) {
$newData[] = "{$field}=:{$field}";
}
$newData = implode(",", $newData); // override new data
return $newData;
} | [
"protected",
"static",
"function",
"makeUpdateParameter",
"(",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"newData",
"[",
"]",
"=",
"\"{$field}=:{$field}\"",
";",
"}",
"$",
"newData",
"=",
... | Make Update Parameter
@param array $data
@return array | [
"Make",
"Update",
"Parameter"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L186-L195 |
25,085 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.makeSelect | protected static function makeSelect()
{
$self = self::getInstance();
$select = (!empty($self->optionSelect)) ? $self->optionSelect : "*";
return "SELECT {$select} FROM {$self->table_name} ";
} | php | protected static function makeSelect()
{
$self = self::getInstance();
$select = (!empty($self->optionSelect)) ? $self->optionSelect : "*";
return "SELECT {$select} FROM {$self->table_name} ";
} | [
"protected",
"static",
"function",
"makeSelect",
"(",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"select",
"=",
"(",
"!",
"empty",
"(",
"$",
"self",
"->",
"optionSelect",
")",
")",
"?",
"$",
"self",
"->",
"optionSele... | Make Select Query
@return string | [
"Make",
"Select",
"Query"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L202-L208 |
25,086 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.makeEmpty | protected static function makeEmpty()
{
$self = self::getInstance();
$self->optionWhere = [];
$self->optionWhereData = [];
$self->optionJoin = [];
$self->optionLimit = null;
$self->optionSelect = null;
$self->table_name = null;
... | php | protected static function makeEmpty()
{
$self = self::getInstance();
$self->optionWhere = [];
$self->optionWhereData = [];
$self->optionJoin = [];
$self->optionLimit = null;
$self->optionSelect = null;
$self->table_name = null;
... | [
"protected",
"static",
"function",
"makeEmpty",
"(",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"self",
"->",
"optionWhere",
"=",
"[",
"]",
";",
"$",
"self",
"->",
"optionWhereData",
"=",
"[",
"]",
";",
"$",
"self",
... | Empty All Option
@return Instance | [
"Empty",
"All",
"Option"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L215-L227 |
25,087 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.makeArrayOfWhere | protected function makeArrayOfWhere($array, $type)
{
$self = self::getInstance();
if (array_key_exists(0, $array)) :
foreach ($array as $a):
$make = [
'parameter' => str_replace(".", "_", $a[0]),
'column' => $a[0],
... | php | protected function makeArrayOfWhere($array, $type)
{
$self = self::getInstance();
if (array_key_exists(0, $array)) :
foreach ($array as $a):
$make = [
'parameter' => str_replace(".", "_", $a[0]),
'column' => $a[0],
... | [
"protected",
"function",
"makeArrayOfWhere",
"(",
"$",
"array",
",",
"$",
"type",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"0",
",",
"$",
"array",
")",
")",
":",
"foreach",
"(",
"$",
... | Make Where Array
@param array $array
@param string $type
@return Instance | [
"Make",
"Where",
"Array"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L264-L306 |
25,088 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.makeStringOfWhere | protected function makeStringOfWhere($column, $operator = null, $value = null, $type)
{
$self = self::getInstance();
$param = str_replace(".", "_", $column); // remove table seperator for parameter
$where = $self->makeWhere($param, $column, $operator, $value);
$whereData = $... | php | protected function makeStringOfWhere($column, $operator = null, $value = null, $type)
{
$self = self::getInstance();
$param = str_replace(".", "_", $column); // remove table seperator for parameter
$where = $self->makeWhere($param, $column, $operator, $value);
$whereData = $... | [
"protected",
"function",
"makeStringOfWhere",
"(",
"$",
"column",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"value",
"=",
"null",
",",
"$",
"type",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"param",
"=",
"str_rep... | Make String Where
@return Instance | [
"Make",
"String",
"Where"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L313-L325 |
25,089 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.insert | public static function insert($data)
{
$self = self::getInstance();
$table = $self->table_name;
if (isset($data[0])) {
$make = $self->makeMultipleInsert($table, $data);
$statement = $make[0];
$value = $make[1];
} else {
$newD... | php | public static function insert($data)
{
$self = self::getInstance();
$table = $self->table_name;
if (isset($data[0])) {
$make = $self->makeMultipleInsert($table, $data);
$statement = $make[0];
$value = $make[1];
} else {
$newD... | [
"public",
"static",
"function",
"insert",
"(",
"$",
"data",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"table",
"=",
"$",
"self",
"->",
"table_name",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"0",
"]",
")",... | Insert & Multiple Insert
@param array $data
@return boolean | [
"Insert",
"&",
"Multiple",
"Insert"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L389-L409 |
25,090 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.increment | public function increment($column, $value = null, $where = [], $operator = "+")
{
return self::getInstance()->makeIncreDecrement($column, $value, $where, $operator);
} | php | public function increment($column, $value = null, $where = [], $operator = "+")
{
return self::getInstance()->makeIncreDecrement($column, $value, $where, $operator);
} | [
"public",
"function",
"increment",
"(",
"$",
"column",
",",
"$",
"value",
"=",
"null",
",",
"$",
"where",
"=",
"[",
"]",
",",
"$",
"operator",
"=",
"\"+\"",
")",
"{",
"return",
"self",
"::",
"getInstance",
"(",
")",
"->",
"makeIncreDecrement",
"(",
"... | Increment & Decrement
@param string $column
@param string/integer $value
@param array $where
@param string $operator
@return Instance | [
"Increment",
"&",
"Decrement"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L516-L519 |
25,091 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.get | public static function get()
{
$self = self::getInstance();
$statement = $self->makeSelect();
$execute = $self->exec($statement, []);
return $execute->fetchAll(\PDO::FETCH_CLASS);
} | php | public static function get()
{
$self = self::getInstance();
$statement = $self->makeSelect();
$execute = $self->exec($statement, []);
return $execute->fetchAll(\PDO::FETCH_CLASS);
} | [
"public",
"static",
"function",
"get",
"(",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"statement",
"=",
"$",
"self",
"->",
"makeSelect",
"(",
")",
";",
"$",
"execute",
"=",
"$",
"self",
"->",
"exec",
"(",
"$",
"... | Get All Record
@return Array | [
"Get",
"All",
"Record"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L584-L592 |
25,092 | ammarfaizi2/icetea-framework | src/System/Crayner/Database/DB.php | DB.first | public static function first()
{
$self = self::getInstance();
$statement = $self->makeSelect();
$execute = $self->exec($statement, []);
return $execute->fetchObject();
} | php | public static function first()
{
$self = self::getInstance();
$statement = $self->makeSelect();
$execute = $self->exec($statement, []);
return $execute->fetchObject();
} | [
"public",
"static",
"function",
"first",
"(",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"getInstance",
"(",
")",
";",
"$",
"statement",
"=",
"$",
"self",
"->",
"makeSelect",
"(",
")",
";",
"$",
"execute",
"=",
"$",
"self",
"->",
"exec",
"(",
"$",
... | Get First Record
@return Array | [
"Get",
"First",
"Record"
] | dedd832846c3e69b429b18b8612fae50881af180 | https://github.com/ammarfaizi2/icetea-framework/blob/dedd832846c3e69b429b18b8612fae50881af180/src/System/Crayner/Database/DB.php#L607-L615 |
25,093 | mossphp/moss-storage | Moss/Storage/Query/Relation/OneRelation.php | OneRelation.write | public function write(&$result)
{
$entity = $this->accessor->getPropertyValue($result, $this->definition->container());
if (empty($entity)) {
$conditions = [];
foreach ($this->definition->keys() as $local => $foreign) {
$conditions[$foreign][] = $this->accesso... | php | public function write(&$result)
{
$entity = $this->accessor->getPropertyValue($result, $this->definition->container());
if (empty($entity)) {
$conditions = [];
foreach ($this->definition->keys() as $local => $foreign) {
$conditions[$foreign][] = $this->accesso... | [
"public",
"function",
"write",
"(",
"&",
"$",
"result",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"accessor",
"->",
"getPropertyValue",
"(",
"$",
"result",
",",
"$",
"this",
"->",
"definition",
"->",
"container",
"(",
")",
")",
";",
"if",
"(",... | Executes write fro one-to-one relation
@param array|\ArrayAccess $result
@return array|\ArrayAccess
@throws RelationException | [
"Executes",
"write",
"fro",
"one",
"-",
"to",
"-",
"one",
"relation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Relation/OneRelation.php#L68-L91 |
25,094 | fuelphp-storage/session | src/Driver/Cookie.php | Cookie.encrypt | protected function encrypt($string)
{
// only if we want the cookie to be encrypted
if ($this->config['cookie']['encrypt_cookie'])
{
// we require the mcrypt PECL extension for this
if ( ! function_exists('mcrypt_encrypt'))
{
throw new \BadMethodCallException('The Session Cookie driver requires the ... | php | protected function encrypt($string)
{
// only if we want the cookie to be encrypted
if ($this->config['cookie']['encrypt_cookie'])
{
// we require the mcrypt PECL extension for this
if ( ! function_exists('mcrypt_encrypt'))
{
throw new \BadMethodCallException('The Session Cookie driver requires the ... | [
"protected",
"function",
"encrypt",
"(",
"$",
"string",
")",
"{",
"// only if we want the cookie to be encrypted",
"if",
"(",
"$",
"this",
"->",
"config",
"[",
"'cookie'",
"]",
"[",
"'encrypt_cookie'",
"]",
")",
"{",
"// we require the mcrypt PECL extension for this",
... | Encrypts a string using the crypt_key configured in the config
@param string $string
@return string
@throws \BadMethodCallException if the required mcrypt extension is not installed | [
"Encrypts",
"a",
"string",
"using",
"the",
"crypt_key",
"configured",
"in",
"the",
"config"
] | 948fd2b45286e65e7fababf65de89ca6aaca3c4a | https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Driver/Cookie.php#L199-L226 |
25,095 | fuelphp-storage/session | src/Driver/Cookie.php | Cookie.decrypt | protected function decrypt($string)
{
// only if we want the cookie to be encrypted
if ($this->config['cookie']['encrypt_cookie'])
{
// we require the mcrypt PECL extension for this
if ( ! function_exists('mcrypt_decrypt'))
{
throw new \BadMethodCallException('The Session Cookie driver requires the ... | php | protected function decrypt($string)
{
// only if we want the cookie to be encrypted
if ($this->config['cookie']['encrypt_cookie'])
{
// we require the mcrypt PECL extension for this
if ( ! function_exists('mcrypt_decrypt'))
{
throw new \BadMethodCallException('The Session Cookie driver requires the ... | [
"protected",
"function",
"decrypt",
"(",
"$",
"string",
")",
"{",
"// only if we want the cookie to be encrypted",
"if",
"(",
"$",
"this",
"->",
"config",
"[",
"'cookie'",
"]",
"[",
"'encrypt_cookie'",
"]",
")",
"{",
"// we require the mcrypt PECL extension for this",
... | Decrypts a string using the crypt_key configured in the config
@param string $string
@return string
@throws \BadMethodCallException if the required mcrypt extension is not installed | [
"Decrypts",
"a",
"string",
"using",
"the",
"crypt_key",
"configured",
"in",
"the",
"config"
] | 948fd2b45286e65e7fababf65de89ca6aaca3c4a | https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Driver/Cookie.php#L237-L270 |
25,096 | joegreen88/zf1-component-validate | src/Zend/Validate/Db/Abstract.php | Zend_Validate_Db_Abstract.getAdapter | public function getAdapter()
{
/**
* Check for an adapter being defined. if not, fetch the default adapter.
*/
if ($this->_adapter === null) {
$this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
if (null === $this->_adapter) {
thr... | php | public function getAdapter()
{
/**
* Check for an adapter being defined. if not, fetch the default adapter.
*/
if ($this->_adapter === null) {
$this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
if (null === $this->_adapter) {
thr... | [
"public",
"function",
"getAdapter",
"(",
")",
"{",
"/**\n * Check for an adapter being defined. if not, fetch the default adapter.\n */",
"if",
"(",
"$",
"this",
"->",
"_adapter",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_adapter",
"=",
"Zend_Db_Table_... | Returns the set adapter
@return Zend_Db_Adapter | [
"Returns",
"the",
"set",
"adapter"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/Db/Abstract.php#L156-L169 |
25,097 | bytic/http | src/Request/RequestAwareTrait.php | RequestAwareTrait.getRequest | public function getRequest($autoInit = false)
{
$this->setAutoInitRequest($autoInit);
if ($this->request == null && $this->isAutoInitRequest()) {
$this->initRequest();
}
return $this->request;
} | php | public function getRequest($autoInit = false)
{
$this->setAutoInitRequest($autoInit);
if ($this->request == null && $this->isAutoInitRequest()) {
$this->initRequest();
}
return $this->request;
} | [
"public",
"function",
"getRequest",
"(",
"$",
"autoInit",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"setAutoInitRequest",
"(",
"$",
"autoInit",
")",
";",
"if",
"(",
"$",
"this",
"->",
"request",
"==",
"null",
"&&",
"$",
"this",
"->",
"isAutoInitRequest"... | Get the Request.
@param bool $autoInit
@return Request | [
"Get",
"the",
"Request",
"."
] | 0d22507a8bcf05575d3d1d6c6a87c2026778c47c | https://github.com/bytic/http/blob/0d22507a8bcf05575d3d1d6c6a87c2026778c47c/src/Request/RequestAwareTrait.php#L30-L38 |
25,098 | bkstg/schedule-bundle | EventSubscriber/UserMenuSubscriber.php | UserMenuSubscriber.addScheduleMenuItem | public function addScheduleMenuItem(UserMenuCollectionEvent $event): void
{
// Get the menu from the event.
$menu = $event->getMenu();
// Create a separator first.
$separator = $this->factory->createItem('schedule_separator', [
'extras' => [
'separator' =... | php | public function addScheduleMenuItem(UserMenuCollectionEvent $event): void
{
// Get the menu from the event.
$menu = $event->getMenu();
// Create a separator first.
$separator = $this->factory->createItem('schedule_separator', [
'extras' => [
'separator' =... | [
"public",
"function",
"addScheduleMenuItem",
"(",
"UserMenuCollectionEvent",
"$",
"event",
")",
":",
"void",
"{",
"// Get the menu from the event.",
"$",
"menu",
"=",
"$",
"event",
"->",
"getMenu",
"(",
")",
";",
"// Create a separator first.",
"$",
"separator",
"="... | Add the schedule items to the user menu.
@param UserMenuCollectionEvent $event The menu collection event.
@return void | [
"Add",
"the",
"schedule",
"items",
"to",
"the",
"user",
"menu",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/EventSubscriber/UserMenuSubscriber.php#L67-L90 |
25,099 | bkstg/schedule-bundle | EventSubscriber/UserMenuSubscriber.php | UserMenuSubscriber.addInvitationsMenuItem | public function addInvitationsMenuItem(UserMenuCollectionEvent $event): void
{
// Get the menu from the event.
$menu = $event->getMenu();
// Lookup and count pending invitations.
$repo = $this->em->getRepository(Invitation::class);
$user = $this->token_storage->getToken()->g... | php | public function addInvitationsMenuItem(UserMenuCollectionEvent $event): void
{
// Get the menu from the event.
$menu = $event->getMenu();
// Lookup and count pending invitations.
$repo = $this->em->getRepository(Invitation::class);
$user = $this->token_storage->getToken()->g... | [
"public",
"function",
"addInvitationsMenuItem",
"(",
"UserMenuCollectionEvent",
"$",
"event",
")",
":",
"void",
"{",
"// Get the menu from the event.",
"$",
"menu",
"=",
"$",
"event",
"->",
"getMenu",
"(",
")",
";",
"// Lookup and count pending invitations.",
"$",
"re... | Add invitations menu item.
@param UserMenuCollectionEvent $event The menu collection event.
@return void | [
"Add",
"invitations",
"menu",
"item",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/EventSubscriber/UserMenuSubscriber.php#L99-L118 |
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.