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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
200,400 | ARCANESOFT/SEO | src/Providers/PackagesServiceProvider.php | PackagesServiceProvider.registerLaravelSeoPackage | private function registerLaravelSeoPackage()
{
$this->registerProvider(LaravelSeoServiceProvider::class);
$this->app->booting(function () {
Seo::setConfig('database', config('arcanesoft.seo.database'));
Seo::setConfig('metas', config('arcanesoft.seo.metas'));
Seo... | php | private function registerLaravelSeoPackage()
{
$this->registerProvider(LaravelSeoServiceProvider::class);
$this->app->booting(function () {
Seo::setConfig('database', config('arcanesoft.seo.database'));
Seo::setConfig('metas', config('arcanesoft.seo.metas'));
Seo... | [
"private",
"function",
"registerLaravelSeoPackage",
"(",
")",
"{",
"$",
"this",
"->",
"registerProvider",
"(",
"LaravelSeoServiceProvider",
"::",
"class",
")",
";",
"$",
"this",
"->",
"app",
"->",
"booting",
"(",
"function",
"(",
")",
"{",
"Seo",
"::",
"setC... | Register Laravel Seo package. | [
"Register",
"Laravel",
"Seo",
"package",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Providers/PackagesServiceProvider.php#L41-L53 |
200,401 | lasallecms/lasallecms-l5-mailgun-pkg | src/Processing/Validation.php | Validation.verifyWebhookSignature | public function verifyWebhookSignature() {
$timestamp = $this->request->input('timestamp');
$token = $this->request->input('token');
$signature = $this->request->input('signature');
// The Mailgun config param is an array, so grab the full array
$configMailgun = config('se... | php | public function verifyWebhookSignature() {
$timestamp = $this->request->input('timestamp');
$token = $this->request->input('token');
$signature = $this->request->input('signature');
// The Mailgun config param is an array, so grab the full array
$configMailgun = config('se... | [
"public",
"function",
"verifyWebhookSignature",
"(",
")",
"{",
"$",
"timestamp",
"=",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"'timestamp'",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"'token'",
")",
";",
"... | Ensure the authenticity of inbound Mailgun request
https://documentation.mailgun.com/user_manual.html#webhooks
https://github.com/mailgun/mailgun-php/blob/master/src/Mailgun/Mailgun.php
http://php.net/manual/en/function.hash-hmac.php
@param timestamp $timestamp Mailgun's timestamp in the POST request
@param strin... | [
"Ensure",
"the",
"authenticity",
"of",
"inbound",
"Mailgun",
"request"
] | f6c1fb92211b2537db87a1f03c126dc46691ee5e | https://github.com/lasallecms/lasallecms-l5-mailgun-pkg/blob/f6c1fb92211b2537db87a1f03c126dc46691ee5e/src/Processing/Validation.php#L80-L99 |
200,402 | lasallecms/lasallecms-l5-mailgun-pkg | src/Processing/Validation.php | Validation.isInboundEmailToEmailAddressMapToUser | public function isInboundEmailToEmailAddressMapToUser() {
// We map an inbound Mailgun route to a record in the "users" table, by email address
$mappedRoutes = config('lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address');
foreach ($mappedRoutes as $route => $user) {
... | php | public function isInboundEmailToEmailAddressMapToUser() {
// We map an inbound Mailgun route to a record in the "users" table, by email address
$mappedRoutes = config('lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address');
foreach ($mappedRoutes as $route => $user) {
... | [
"public",
"function",
"isInboundEmailToEmailAddressMapToUser",
"(",
")",
"{",
"// We map an inbound Mailgun route to a record in the \"users\" table, by email address",
"$",
"mappedRoutes",
"=",
"config",
"(",
"'lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address'",
")",
... | Does the recipient's email address map to an email address in the "users" database table?
@return bool | [
"Does",
"the",
"recipient",
"s",
"email",
"address",
"map",
"to",
"an",
"email",
"address",
"in",
"the",
"users",
"database",
"table?"
] | f6c1fb92211b2537db87a1f03c126dc46691ee5e | https://github.com/lasallecms/lasallecms-l5-mailgun-pkg/blob/f6c1fb92211b2537db87a1f03c126dc46691ee5e/src/Processing/Validation.php#L106-L120 |
200,403 | lasallecms/lasallecms-l5-mailgun-pkg | src/Processing/Validation.php | Validation.isMappedUserExistInUsersTable | public function isMappedUserExistInUsersTable() {
// get the mapped recipient (valid because $this->isInboundEmailToEmailAddressMapToUser() is already done)
$mappedRoutes = config('lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address');
foreach ($mappedRoutes as $route => $user... | php | public function isMappedUserExistInUsersTable() {
// get the mapped recipient (valid because $this->isInboundEmailToEmailAddressMapToUser() is already done)
$mappedRoutes = config('lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address');
foreach ($mappedRoutes as $route => $user... | [
"public",
"function",
"isMappedUserExistInUsersTable",
"(",
")",
"{",
"// get the mapped recipient (valid because $this->isInboundEmailToEmailAddressMapToUser() is already done)",
"$",
"mappedRoutes",
"=",
"config",
"(",
"'lasallecmsmailgun.inbound_map_mailgun_routes_with_user_email_address'... | Does the mapped user actually exist in the "users" db table?
@return bool | [
"Does",
"the",
"mapped",
"user",
"actually",
"exist",
"in",
"the",
"users",
"db",
"table?"
] | f6c1fb92211b2537db87a1f03c126dc46691ee5e | https://github.com/lasallecms/lasallecms-l5-mailgun-pkg/blob/f6c1fb92211b2537db87a1f03c126dc46691ee5e/src/Processing/Validation.php#L127-L145 |
200,404 | Xsaven/laravel-intelect-admin | src/Addons/GoogleTranslate/TranslateClient.php | TranslateClient.staticTranslate | private static function staticTranslate($source, $target, $string)
{
self::checkStaticInstance();
try {
$result = self::$staticInstance
->setSource($source)
->setTarget($target)
->translate($string);
} catch (Exception $e) {
... | php | private static function staticTranslate($source, $target, $string)
{
self::checkStaticInstance();
try {
$result = self::$staticInstance
->setSource($source)
->setTarget($target)
->translate($string);
} catch (Exception $e) {
... | [
"private",
"static",
"function",
"staticTranslate",
"(",
"$",
"source",
",",
"$",
"target",
",",
"$",
"string",
")",
"{",
"self",
"::",
"checkStaticInstance",
"(",
")",
";",
"try",
"{",
"$",
"result",
"=",
"self",
"::",
"$",
"staticInstance",
"->",
"setS... | Translate text statically.
This can be called from static method translate() using __callStatic() magic method.
Use TranslateClient::translate($source, $target, $string) instead.
@param string $source Source language
@param string $target Target language
@param string $string Text to translate
@throws InvalidArgumen... | [
"Translate",
"text",
"statically",
"."
] | 592574633d12c74cf25b43dd6694fee496abefcb | https://github.com/Xsaven/laravel-intelect-admin/blob/592574633d12c74cf25b43dd6694fee496abefcb/src/Addons/GoogleTranslate/TranslateClient.php#L437-L450 |
200,405 | InnovaLangues/LexiconBundle | Entity/Inflection.php | Inflection.setLemma | public function setLemma(\Innova\LexiconBundle\Entity\Lemma $lemma = null)
{
$this->lemma = $lemma;
return $this;
} | php | public function setLemma(\Innova\LexiconBundle\Entity\Lemma $lemma = null)
{
$this->lemma = $lemma;
return $this;
} | [
"public",
"function",
"setLemma",
"(",
"\\",
"Innova",
"\\",
"LexiconBundle",
"\\",
"Entity",
"\\",
"Lemma",
"$",
"lemma",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"lemma",
"=",
"$",
"lemma",
";",
"return",
"$",
"this",
";",
"}"
] | Set lemma.
@param \Innova\LexiconBundle\Entity\Lemma $lemma
@return Inflection | [
"Set",
"lemma",
"."
] | 38684b8a6c9f4636c7eb4d97f793844c2f703cb7 | https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Inflection.php#L180-L185 |
200,406 | InnovaLangues/LexiconBundle | Entity/Inflection.php | Inflection.setNumber | public function setNumber(\Innova\LexiconBundle\Entity\Number $number = null)
{
$this->number = $number;
return $this;
} | php | public function setNumber(\Innova\LexiconBundle\Entity\Number $number = null)
{
$this->number = $number;
return $this;
} | [
"public",
"function",
"setNumber",
"(",
"\\",
"Innova",
"\\",
"LexiconBundle",
"\\",
"Entity",
"\\",
"Number",
"$",
"number",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"number",
"=",
"$",
"number",
";",
"return",
"$",
"this",
";",
"}"
] | Set number.
@param \Innova\LexiconBundle\Entity\Number $number
@return Inflection | [
"Set",
"number",
"."
] | 38684b8a6c9f4636c7eb4d97f793844c2f703cb7 | https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Inflection.php#L204-L209 |
200,407 | InnovaLangues/LexiconBundle | Entity/Inflection.php | Inflection.setGender | public function setGender(\Innova\LexiconBundle\Entity\Gender $gender = null)
{
$this->gender = $gender;
return $this;
} | php | public function setGender(\Innova\LexiconBundle\Entity\Gender $gender = null)
{
$this->gender = $gender;
return $this;
} | [
"public",
"function",
"setGender",
"(",
"\\",
"Innova",
"\\",
"LexiconBundle",
"\\",
"Entity",
"\\",
"Gender",
"$",
"gender",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"gender",
"=",
"$",
"gender",
";",
"return",
"$",
"this",
";",
"}"
] | Set gender.
@param \Innova\LexiconBundle\Entity\Gender $gender
@return Inflection | [
"Set",
"gender",
"."
] | 38684b8a6c9f4636c7eb4d97f793844c2f703cb7 | https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Inflection.php#L228-L233 |
200,408 | InnovaLangues/LexiconBundle | Entity/Inflection.php | Inflection.setTense | public function setTense(\Innova\LexiconBundle\Entity\Tense $tense = null)
{
$this->tense = $tense;
return $this;
} | php | public function setTense(\Innova\LexiconBundle\Entity\Tense $tense = null)
{
$this->tense = $tense;
return $this;
} | [
"public",
"function",
"setTense",
"(",
"\\",
"Innova",
"\\",
"LexiconBundle",
"\\",
"Entity",
"\\",
"Tense",
"$",
"tense",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"tense",
"=",
"$",
"tense",
";",
"return",
"$",
"this",
";",
"}"
] | Set tense.
@param \Innova\LexiconBundle\Entity\Tense $tense
@return Inflection | [
"Set",
"tense",
"."
] | 38684b8a6c9f4636c7eb4d97f793844c2f703cb7 | https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Inflection.php#L252-L257 |
200,409 | InnovaLangues/LexiconBundle | Entity/Inflection.php | Inflection.setPerson | public function setPerson(\Innova\LexiconBundle\Entity\Person $person = null)
{
$this->person = $person;
return $this;
} | php | public function setPerson(\Innova\LexiconBundle\Entity\Person $person = null)
{
$this->person = $person;
return $this;
} | [
"public",
"function",
"setPerson",
"(",
"\\",
"Innova",
"\\",
"LexiconBundle",
"\\",
"Entity",
"\\",
"Person",
"$",
"person",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"person",
"=",
"$",
"person",
";",
"return",
"$",
"this",
";",
"}"
] | Set person.
@param \Innova\LexiconBundle\Entity\Person $person
@return Inflection | [
"Set",
"person",
"."
] | 38684b8a6c9f4636c7eb4d97f793844c2f703cb7 | https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Inflection.php#L276-L281 |
200,410 | InnovaLangues/LexiconBundle | Entity/Inflection.php | Inflection.setMood | public function setMood(\Innova\LexiconBundle\Entity\Mood $mood = null)
{
$this->mood = $mood;
return $this;
} | php | public function setMood(\Innova\LexiconBundle\Entity\Mood $mood = null)
{
$this->mood = $mood;
return $this;
} | [
"public",
"function",
"setMood",
"(",
"\\",
"Innova",
"\\",
"LexiconBundle",
"\\",
"Entity",
"\\",
"Mood",
"$",
"mood",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"mood",
"=",
"$",
"mood",
";",
"return",
"$",
"this",
";",
"}"
] | Set mood.
@param \Innova\LexiconBundle\Entity\Mood $mood
@return Inflection | [
"Set",
"mood",
"."
] | 38684b8a6c9f4636c7eb4d97f793844c2f703cb7 | https://github.com/InnovaLangues/LexiconBundle/blob/38684b8a6c9f4636c7eb4d97f793844c2f703cb7/Entity/Inflection.php#L300-L305 |
200,411 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/JSONUtils.php | JSONUtils.decode | public static function decode($string, $returnArrays = false)
{
$result = json_decode($string, $returnArrays);
if (function_exists('json_last_error')) {
switch (json_last_error()) {
case JSON_ERROR_NONE:
return $result;
case JSON_ERRO... | php | public static function decode($string, $returnArrays = false)
{
$result = json_decode($string, $returnArrays);
if (function_exists('json_last_error')) {
switch (json_last_error()) {
case JSON_ERROR_NONE:
return $result;
case JSON_ERRO... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"string",
",",
"$",
"returnArrays",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"json_decode",
"(",
"$",
"string",
",",
"$",
"returnArrays",
")",
";",
"if",
"(",
"function_exists",
"(",
"'json_last_error'... | Performs a JSON decode of the string
@param string $string The json string being decoded.
@param boolean $returnArrays When TRUE, returned objects will be converted into associative arrays.
@throws Exception When a json error occurs
@return mixed | [
"Performs",
"a",
"JSON",
"decode",
"of",
"the",
"string"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/JSONUtils.php#L54-L80 |
200,412 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/JSONUtils.php | JSONUtils.encode | public static function encode($obj, $pretty = false, $html = false)
{
$s = json_encode($obj);
if ($pretty) {
return self::format($s, $html);
}
return $s;
} | php | public static function encode($obj, $pretty = false, $html = false)
{
$s = json_encode($obj);
if ($pretty) {
return self::format($s, $html);
}
return $s;
} | [
"public",
"static",
"function",
"encode",
"(",
"$",
"obj",
",",
"$",
"pretty",
"=",
"false",
",",
"$",
"html",
"=",
"false",
")",
"{",
"$",
"s",
"=",
"json_encode",
"(",
"$",
"obj",
")",
";",
"if",
"(",
"$",
"pretty",
")",
"{",
"return",
"self",
... | Encodes the object in json
@param mixed $obj The object to encode
@param boolean $pretty When TRUE, the output is "pretty" with proper indentation
@param boolean $html If true, return the JSON in a format suitable for display in a web browser
Default: false
@return string | [
"Encodes",
"the",
"object",
"in",
"json"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/JSONUtils.php#L92-L101 |
200,413 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/JSONUtils.php | JSONUtils.format | public static function format($json, $html = false)
{
$format = str_replace(
[
' ',
'\/',
], [
' ',
'/',
], json_encode(
json_decode(
str_replace(
... | php | public static function format($json, $html = false)
{
$format = str_replace(
[
' ',
'\/',
], [
' ',
'/',
], json_encode(
json_decode(
str_replace(
... | [
"public",
"static",
"function",
"format",
"(",
"$",
"json",
",",
"$",
"html",
"=",
"false",
")",
"{",
"$",
"format",
"=",
"str_replace",
"(",
"[",
"' '",
",",
"'\\/'",
",",
"]",
",",
"[",
"' '",
",",
"'/'",
",",
"]",
",",
"json_encode",
"(",
... | Indents a flat JSON string to make it more human-readable
Use php function JSON_PRETTY_PRINT. Require php >= 5.4
@param string $json The original JSON string to process
@param boolean $html If true, return the JSON in a format suitable for display in a web browser
Default: false
@return string Indented version of th... | [
"Indents",
"a",
"flat",
"JSON",
"string",
"to",
"make",
"it",
"more",
"human",
"-",
"readable",
"Use",
"php",
"function",
"JSON_PRETTY_PRINT",
".",
"Require",
"php",
">",
"=",
"5",
".",
"4"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/JSONUtils.php#L118-L158 |
200,414 | Polosa/shade-framework-core | app/Router.php | Router.isRequestedUrlClean | public function isRequestedUrlClean(Request\Web $request)
{
$server = $request->getServer();
if (!isset($server['REQUEST_URI'])) {
throw new Exception('REQUEST_URI is not set');
}
return strpos($server['REQUEST_URI'], $this->entryPoint) !== 0;
} | php | public function isRequestedUrlClean(Request\Web $request)
{
$server = $request->getServer();
if (!isset($server['REQUEST_URI'])) {
throw new Exception('REQUEST_URI is not set');
}
return strpos($server['REQUEST_URI'], $this->entryPoint) !== 0;
} | [
"public",
"function",
"isRequestedUrlClean",
"(",
"Request",
"\\",
"Web",
"$",
"request",
")",
"{",
"$",
"server",
"=",
"$",
"request",
"->",
"getServer",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"server",
"[",
"'REQUEST_URI'",
"]",
")",
")",
... | Check that requested URL is clean
@param \Shade\Request\Web $request Request
@throws \Shade\Exception
@return bool | [
"Check",
"that",
"requested",
"URL",
"is",
"clean"
] | d735d3e8e0616fb9cf4ffc25b8425762ed07940f | https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/Router.php#L146-L154 |
200,415 | Polosa/shade-framework-core | app/Router.php | Router.validateRouteMapping | protected function validateRouteMapping(Route\Mapping $mapping)
{
if (!class_exists($mapping->controller())) {
throw new Exception("Controller '{$mapping->controller()}' not found");
}
if (!method_exists($mapping->controller(), $mapping->action())) {
throw new Except... | php | protected function validateRouteMapping(Route\Mapping $mapping)
{
if (!class_exists($mapping->controller())) {
throw new Exception("Controller '{$mapping->controller()}' not found");
}
if (!method_exists($mapping->controller(), $mapping->action())) {
throw new Except... | [
"protected",
"function",
"validateRouteMapping",
"(",
"Route",
"\\",
"Mapping",
"$",
"mapping",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"mapping",
"->",
"controller",
"(",
")",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Controller '{$map... | Validate Route Mapping
@param \Shade\Route\Mapping $mapping Route Mapping
@throws \Shade\Exception | [
"Validate",
"Route",
"Mapping"
] | d735d3e8e0616fb9cf4ffc25b8425762ed07940f | https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/Router.php#L189-L198 |
200,416 | bseddon/XPath20 | Value/TimeValue.php | TimeValue.TimezoneToInterval | public function TimezoneToInterval()
{
// Get the timezone
$timezone = $this->Value->getTimezone()->getName();
// No deviation returns an empty sequence
if ( $timezone == "Z" || $timezone == "+00:00" || $timezone == date_default_timezone_get() )
{
return DayTimeDurationValue::Parse( "PT0S" );
... | php | public function TimezoneToInterval()
{
// Get the timezone
$timezone = $this->Value->getTimezone()->getName();
// No deviation returns an empty sequence
if ( $timezone == "Z" || $timezone == "+00:00" || $timezone == date_default_timezone_get() )
{
return DayTimeDurationValue::Parse( "PT0S" );
... | [
"public",
"function",
"TimezoneToInterval",
"(",
")",
"{",
"// Get the timezone\r",
"$",
"timezone",
"=",
"$",
"this",
"->",
"Value",
"->",
"getTimezone",
"(",
")",
"->",
"getName",
"(",
")",
";",
"// No deviation returns an empty sequence\r",
"if",
"(",
"$",
"t... | Create a DayTimeDurationValue representation of the timezone offset
@return DayTimeDurationValue | [
"Create",
"a",
"DayTimeDurationValue",
"representation",
"of",
"the",
"timezone",
"offset"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/Value/TimeValue.php#L159-L183 |
200,417 | black-lamp/blcms-cart | frontend/components/user/controllers/SecurityController.php | SecurityController.actionLogin | public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
\Yii::$app->getResponse()->redirect(Url::to([\Yii::$app->getHomeUrl()]));
}
/** @var LoginForm $model */
$model = \Yii::createObject(LoginForm::className());
$event = $this->getFormEvent($model);
... | php | public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
\Yii::$app->getResponse()->redirect(Url::to([\Yii::$app->getHomeUrl()]));
}
/** @var LoginForm $model */
$model = \Yii::createObject(LoginForm::className());
$event = $this->getFormEvent($model);
... | [
"public",
"function",
"actionLogin",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"getResponse",
"(",
")",
"->",
"redirect",
"(",
"Url",
"::",
"to",
"(... | Displays the login page.
@return string|Response | [
"Displays",
"the",
"login",
"page",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/frontend/components/user/controllers/SecurityController.php#L19-L59 |
200,418 | black-lamp/blcms-cart | frontend/components/user/controllers/SecurityController.php | SecurityController.actionLogout | public function actionLogout()
{
$event = $this->getUserEvent(\Yii::$app->user->identity);
$this->trigger(self::EVENT_BEFORE_LOGOUT, $event);
\Yii::$app->getUser()->logout();
$this->trigger(self::EVENT_AFTER_LOGOUT, $event);
\Yii::$app->getResponse()->redirect(Url::to([\Y... | php | public function actionLogout()
{
$event = $this->getUserEvent(\Yii::$app->user->identity);
$this->trigger(self::EVENT_BEFORE_LOGOUT, $event);
\Yii::$app->getUser()->logout();
$this->trigger(self::EVENT_AFTER_LOGOUT, $event);
\Yii::$app->getResponse()->redirect(Url::to([\Y... | [
"public",
"function",
"actionLogout",
"(",
")",
"{",
"$",
"event",
"=",
"$",
"this",
"->",
"getUserEvent",
"(",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"identity",
")",
";",
"$",
"this",
"->",
"trigger",
"(",
"self",
"::",
"EVENT_BEFORE_LOGO... | Logs the user out and then redirects to the homepage.
@return Response | [
"Logs",
"the",
"user",
"out",
"and",
"then",
"redirects",
"to",
"the",
"homepage",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/frontend/components/user/controllers/SecurityController.php#L66-L77 |
200,419 | bheisig/cli | src/Command/Init.php | Init.askToSkip | protected function askToSkip() {
$question = 'This part is optional. Do you like to configure it? [y|N]:';
$answer = strtolower(IO::in($question));
switch ($answer) {
case 'yes':
case 'y':
case '1':
case 'true':
return false;
... | php | protected function askToSkip() {
$question = 'This part is optional. Do you like to configure it? [y|N]:';
$answer = strtolower(IO::in($question));
switch ($answer) {
case 'yes':
case 'y':
case '1':
case 'true':
return false;
... | [
"protected",
"function",
"askToSkip",
"(",
")",
"{",
"$",
"question",
"=",
"'This part is optional. Do you like to configure it? [y|N]:'",
";",
"$",
"answer",
"=",
"strtolower",
"(",
"IO",
"::",
"in",
"(",
"$",
"question",
")",
")",
";",
"switch",
"(",
"$",
"a... | Ask to skip optional part
@return bool true means yes, skip it; false means no, configure it
@throws Exception on error | [
"Ask",
"to",
"skip",
"optional",
"part"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Command/Init.php#L249-L270 |
200,420 | bheisig/cli | src/Command/Init.php | Init.askForString | protected function askForString($key, $required = false, $default = null, array $values = [], $minLength = 0) {
$question = sprintf(
'What is the value for configuration setting "%s"',
$key
);
if (count($values) > 0) {
$question .= sprintf(
' ... | php | protected function askForString($key, $required = false, $default = null, array $values = [], $minLength = 0) {
$question = sprintf(
'What is the value for configuration setting "%s"',
$key
);
if (count($values) > 0) {
$question .= sprintf(
' ... | [
"protected",
"function",
"askForString",
"(",
"$",
"key",
",",
"$",
"required",
"=",
"false",
",",
"$",
"default",
"=",
"null",
",",
"array",
"$",
"values",
"=",
"[",
"]",
",",
"$",
"minLength",
"=",
"0",
")",
"{",
"$",
"question",
"=",
"sprintf",
... | Ask user for a value which should be a string
@param string $key Setting
@param bool $required Is this setting required? Defaults to false (no, it isn't)
@param string $default Optional default value which will be used if user doesn't provide a value
@param array $values Optional possible values; no other values are a... | [
"Ask",
"user",
"for",
"a",
"value",
"which",
"should",
"be",
"a",
"string"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Command/Init.php#L285-L328 |
200,421 | bheisig/cli | src/Command/Init.php | Init.askForBoolean | protected function askForBoolean($key, $required = false, $default = null) {
$question = sprintf(
'Enable configuration setting "%s"?',
$key
);
if (isset($default)) {
switch ($default) {
case true:
$question .= ' [Y|n]:';
... | php | protected function askForBoolean($key, $required = false, $default = null) {
$question = sprintf(
'Enable configuration setting "%s"?',
$key
);
if (isset($default)) {
switch ($default) {
case true:
$question .= ' [Y|n]:';
... | [
"protected",
"function",
"askForBoolean",
"(",
"$",
"key",
",",
"$",
"required",
"=",
"false",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"question",
"=",
"sprintf",
"(",
"'Enable configuration setting \"%s\"?'",
",",
"$",
"key",
")",
";",
"if",
"(",... | Ask user for a value which should be a boolean
@param string $key Setting
@param bool $required Is this setting required? Defaults to false (no, it isn't)
@param bool $default Optional default value which will be used if user doesn't provide a value
@return bool|null Value or nothing
@throws Exception on error | [
"Ask",
"user",
"for",
"a",
"value",
"which",
"should",
"be",
"a",
"boolean"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Command/Init.php#L399-L448 |
200,422 | bheisig/cli | src/Command/Init.php | Init.askForMixed | protected function askForMixed($key, $required = false, $default = null, array $values = []) {
$question = sprintf(
'What is the value for configuration setting "%s"',
$key
);
$options = [];
if (count($values) > 0) {
foreach ($values as $value) {
... | php | protected function askForMixed($key, $required = false, $default = null, array $values = []) {
$question = sprintf(
'What is the value for configuration setting "%s"',
$key
);
$options = [];
if (count($values) > 0) {
foreach ($values as $value) {
... | [
"protected",
"function",
"askForMixed",
"(",
"$",
"key",
",",
"$",
"required",
"=",
"false",
",",
"$",
"default",
"=",
"null",
",",
"array",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"$",
"question",
"=",
"sprintf",
"(",
"'What is the value for configuration... | Ask user for a value, but the data type doesn't matter
@param string $key Setting
@param bool $required Is this setting required? Defaults to false (no, it isn't)
@param mixed $default Optional default value which will be used if user doesn't provide a value
@param array $values Optional possible values; no other valu... | [
"Ask",
"user",
"for",
"a",
"value",
"but",
"the",
"data",
"type",
"doesn",
"t",
"matter"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Command/Init.php#L590-L665 |
200,423 | Erebot/Module_TriggerRegistry | src/TriggerRegistry.php | TriggerRegistry.containsRecursive | protected function containsRecursive(&$array, &$value)
{
if (!is_array($array)) {
return false;
}
foreach ($array as $sub) {
if (is_string($sub) && !strcasecmp($sub, $value)) {
return true;
}
if (is_array($sub) && $this->conta... | php | protected function containsRecursive(&$array, &$value)
{
if (!is_array($array)) {
return false;
}
foreach ($array as $sub) {
if (is_string($sub) && !strcasecmp($sub, $value)) {
return true;
}
if (is_array($sub) && $this->conta... | [
"protected",
"function",
"containsRecursive",
"(",
"&",
"$",
"array",
",",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"array",
"as",
"$",
"sub",
")",
... | Checks whether some array contains the given
data, in a recursive fashion.
\param array $array
Array to test.
\param mixed $value
Look for this specific value.
\retval bool
\b true if the given value is contained
in the passed array, \b false otherwise. | [
"Checks",
"whether",
"some",
"array",
"contains",
"the",
"given",
"data",
"in",
"a",
"recursive",
"fashion",
"."
] | 5b981d38ab8c5b6bd03e07deb3adad71303592a0 | https://github.com/Erebot/Module_TriggerRegistry/blob/5b981d38ab8c5b6bd03e07deb3adad71303592a0/src/TriggerRegistry.php#L115-L131 |
200,424 | Erebot/Module_TriggerRegistry | src/TriggerRegistry.php | TriggerRegistry.registerTriggers | public function registerTriggers($triggers, $channel)
{
if (!is_array($triggers)) {
$triggers = array($triggers);
}
$fmt = $this->getFormatter(false);
$translator = $fmt->getTranslator();
if (!is_string($channel)) {
throw new \Erebot\InvalidVal... | php | public function registerTriggers($triggers, $channel)
{
if (!is_array($triggers)) {
$triggers = array($triggers);
}
$fmt = $this->getFormatter(false);
$translator = $fmt->getTranslator();
if (!is_string($channel)) {
throw new \Erebot\InvalidVal... | [
"public",
"function",
"registerTriggers",
"(",
"$",
"triggers",
",",
"$",
"channel",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"triggers",
")",
")",
"{",
"$",
"triggers",
"=",
"array",
"(",
"$",
"triggers",
")",
";",
"}",
"$",
"fmt",
"=",
"$"... | Registers a series of triggers, either globally
or for a specific channel.
\param mixed $triggers
Either a single string or an array of strings
with the names of the triggers to register.
\param string $channel
Either the name of a specific IRC channel
the triggers should be registered for (eg. #Erebot),
or the const... | [
"Registers",
"a",
"series",
"of",
"triggers",
"either",
"globally",
"or",
"for",
"a",
"specific",
"channel",
"."
] | 5b981d38ab8c5b6bd03e07deb3adad71303592a0 | https://github.com/Erebot/Module_TriggerRegistry/blob/5b981d38ab8c5b6bd03e07deb3adad71303592a0/src/TriggerRegistry.php#L161-L206 |
200,425 | Erebot/Module_TriggerRegistry | src/TriggerRegistry.php | TriggerRegistry.getChanTriggers | public function getChanTriggers($channel)
{
if (!isset($this->triggers[$channel])) {
$fmt = $this->getFormatter(false);
throw new \Erebot\NotFoundException(
$fmt->_(
'No triggers found for channel "<var name="chan"/>"',
array('c... | php | public function getChanTriggers($channel)
{
if (!isset($this->triggers[$channel])) {
$fmt = $this->getFormatter(false);
throw new \Erebot\NotFoundException(
$fmt->_(
'No triggers found for channel "<var name="chan"/>"',
array('c... | [
"public",
"function",
"getChanTriggers",
"(",
"$",
"channel",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"triggers",
"[",
"$",
"channel",
"]",
")",
")",
"{",
"$",
"fmt",
"=",
"$",
"this",
"->",
"getFormatter",
"(",
"false",
")",
";"... | Returns a list of all triggers
registered for a given channel.
\param string $channel
Either the name of a specific IRC channel
to return only those triggers that were
specifically registered for use in that channel,
or the constant Erebot::Module::TriggerRegistry::MATCH_ANY
to return triggers that were registered glo... | [
"Returns",
"a",
"list",
"of",
"all",
"triggers",
"registered",
"for",
"a",
"given",
"channel",
"."
] | 5b981d38ab8c5b6bd03e07deb3adad71303592a0 | https://github.com/Erebot/Module_TriggerRegistry/blob/5b981d38ab8c5b6bd03e07deb3adad71303592a0/src/TriggerRegistry.php#L257-L270 |
200,426 | Erebot/Module_TriggerRegistry | src/TriggerRegistry.php | TriggerRegistry.getTriggers | public function getTriggers($token)
{
$fmt = $this->getFormatter(false);
if (!is_string($token) || strpos($token, ' ') === false) {
throw new \Erebot\InvalidValueException($fmt->_('Invalid token'));
}
list($chan, $pos) = explode(' ', $token);
if (!isset($this->... | php | public function getTriggers($token)
{
$fmt = $this->getFormatter(false);
if (!is_string($token) || strpos($token, ' ') === false) {
throw new \Erebot\InvalidValueException($fmt->_('Invalid token'));
}
list($chan, $pos) = explode(' ', $token);
if (!isset($this->... | [
"public",
"function",
"getTriggers",
"(",
"$",
"token",
")",
"{",
"$",
"fmt",
"=",
"$",
"this",
"->",
"getFormatter",
"(",
"false",
")",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"token",
")",
"||",
"strpos",
"(",
"$",
"token",
",",
"' '",
")",
... | Returns a list of all triggers
associated with the given key.
\param string $token
Some key associated with a series
of triggers.
\retval array
A list of all triggers associated
with the given key. | [
"Returns",
"a",
"list",
"of",
"all",
"triggers",
"associated",
"with",
"the",
"given",
"key",
"."
] | 5b981d38ab8c5b6bd03e07deb3adad71303592a0 | https://github.com/Erebot/Module_TriggerRegistry/blob/5b981d38ab8c5b6bd03e07deb3adad71303592a0/src/TriggerRegistry.php#L284-L299 |
200,427 | jdmaymeow/cake-auth | src/Controller/ProfilesController.php | ProfilesController.my | public function my()
{
$profile = $this->Profiles->find()
->where([
'Profiles.user_id' => $this->Auth->user('id')
])->contain('Users')->first();
$this->set('profile', $profile);
$this->set('_serialize', ['profile']);
} | php | public function my()
{
$profile = $this->Profiles->find()
->where([
'Profiles.user_id' => $this->Auth->user('id')
])->contain('Users')->first();
$this->set('profile', $profile);
$this->set('_serialize', ['profile']);
} | [
"public",
"function",
"my",
"(",
")",
"{",
"$",
"profile",
"=",
"$",
"this",
"->",
"Profiles",
"->",
"find",
"(",
")",
"->",
"where",
"(",
"[",
"'Profiles.user_id'",
"=>",
"$",
"this",
"->",
"Auth",
"->",
"user",
"(",
"'id'",
")",
"]",
")",
"->",
... | Shows current user profile | [
"Shows",
"current",
"user",
"profile"
] | e9b498fb28fa8b48c520d08341cfab8c2459afab | https://github.com/jdmaymeow/cake-auth/blob/e9b498fb28fa8b48c520d08341cfab8c2459afab/src/Controller/ProfilesController.php#L50-L59 |
200,428 | bheisig/cli | src/Command/Command.php | Command.tearDown | public function tearDown() {
$seconds = time() - $this->start;
switch ($seconds) {
case 1:
$this->log->debug('This took 1 second.');
break;
default:
$this->log->debug('This took %s seconds.', $seconds);
break;
... | php | public function tearDown() {
$seconds = time() - $this->start;
switch ($seconds) {
case 1:
$this->log->debug('This took 1 second.');
break;
default:
$this->log->debug('This took %s seconds.', $seconds);
break;
... | [
"public",
"function",
"tearDown",
"(",
")",
"{",
"$",
"seconds",
"=",
"time",
"(",
")",
"-",
"$",
"this",
"->",
"start",
";",
"switch",
"(",
"$",
"seconds",
")",
"{",
"case",
"1",
":",
"$",
"this",
"->",
"log",
"->",
"debug",
"(",
"'This took 1 sec... | Process some routines after executing command
@return self Returns itself
@throws Exception on error | [
"Process",
"some",
"routines",
"after",
"executing",
"command"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Command/Command.php#L88-L135 |
200,429 | bheisig/cli | src/Command/Command.php | Command.getQuery | protected function getQuery() {
$query = '';
foreach ($this->config['args'] as $index => $arg) {
if (array_key_exists('command', $this->config) &&
$arg === $this->config['command'] &&
array_key_exists(($index + 1), $this->config['args'])) {
$q... | php | protected function getQuery() {
$query = '';
foreach ($this->config['args'] as $index => $arg) {
if (array_key_exists('command', $this->config) &&
$arg === $this->config['command'] &&
array_key_exists(($index + 1), $this->config['args'])) {
$q... | [
"protected",
"function",
"getQuery",
"(",
")",
"{",
"$",
"query",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'args'",
"]",
"as",
"$",
"index",
"=>",
"$",
"arg",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'command'",
",",
... | Looks for a query from given arguments
@return string
@deprecated Use $this->config['arguments'][0] instead! | [
"Looks",
"for",
"a",
"query",
"from",
"given",
"arguments"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Command/Command.php#L144-L157 |
200,430 | bheisig/cli | src/Command/Command.php | Command.getName | public function getName() {
foreach ($this->config['commands'] as $command => $details) {
if (strpos($details['class'], get_class($this)) !== false) {
return $command;
}
}
return '';
} | php | public function getName() {
foreach ($this->config['commands'] as $command => $details) {
if (strpos($details['class'], get_class($this)) !== false) {
return $command;
}
}
return '';
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'commands'",
"]",
"as",
"$",
"command",
"=>",
"$",
"details",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"details",
"[",
"'class'",
"]",
",",
"get_class"... | Get command name
@return string | [
"Get",
"command",
"name"
] | ee77266e173335950357899cdfe86b43c00a6776 | https://github.com/bheisig/cli/blob/ee77266e173335950357899cdfe86b43c00a6776/src/Command/Command.php#L202-L210 |
200,431 | net-tools/core | src/ExceptionHandlers/Res/StackTrace.php | StackTrace._get | protected function _get(\Throwable $e)
{
$path_to_root = $_SERVER['DOCUMENT_ROOT'];
$rows = array();
// first row : current script with error line
$rows[] = [
// file
str_replace($path_to_root . '/', '', $e->getFile()),
// line
$e->getLine(),
// function
"throw new " . get... | php | protected function _get(\Throwable $e)
{
$path_to_root = $_SERVER['DOCUMENT_ROOT'];
$rows = array();
// first row : current script with error line
$rows[] = [
// file
str_replace($path_to_root . '/', '', $e->getFile()),
// line
$e->getLine(),
// function
"throw new " . get... | [
"protected",
"function",
"_get",
"(",
"\\",
"Throwable",
"$",
"e",
")",
"{",
"$",
"path_to_root",
"=",
"$",
"_SERVER",
"[",
"'DOCUMENT_ROOT'",
"]",
";",
"$",
"rows",
"=",
"array",
"(",
")",
";",
"// first row : current script with error line",
"$",
"rows",
"... | Get a 2-dimensions array with exception stack trace
Each row has 4 0-indexed columns : 0=file, 1=line number, 2=function name, 3=function arguments
@param \Throwable $e Exception object
@return array | [
"Get",
"a",
"2",
"-",
"dimensions",
"array",
"with",
"exception",
"stack",
"trace"
] | 51446641cee22c0cf53d2b409c76cc8bd1a187e7 | https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/ExceptionHandlers/Res/StackTrace.php#L41-L85 |
200,432 | SagittariusX/Beluga.Translation | src/Beluga/Translation/Translator.php | Translator.translateByNumber | public function translateByNumber( int $number, string $defaultTranslation, ...$args ) : string
{
$transStr = $this->_source->getTranslation( $number, $defaultTranslation );
if ( \count( $args ) < 1 )
{
return $transStr;
}
return \sprintf( $transStr, $args );
} | php | public function translateByNumber( int $number, string $defaultTranslation, ...$args ) : string
{
$transStr = $this->_source->getTranslation( $number, $defaultTranslation );
if ( \count( $args ) < 1 )
{
return $transStr;
}
return \sprintf( $transStr, $args );
} | [
"public",
"function",
"translateByNumber",
"(",
"int",
"$",
"number",
",",
"string",
"$",
"defaultTranslation",
",",
"...",
"$",
"args",
")",
":",
"string",
"{",
"$",
"transStr",
"=",
"$",
"this",
"->",
"_source",
"->",
"getTranslation",
"(",
"$",
"number"... | Gets the translation by an numeric identifier.
@param int $number The numeric identifier
@param string $defaultTranslation This text is returned as translation if the source not holds the
translation with the requested identifier.
@param array ...$args If the translation contains sprintf compatible replacements
you ca... | [
"Gets",
"the",
"translation",
"by",
"an",
"numeric",
"identifier",
"."
] | 8f66c4fef6fa4494413972ca56bd8e13f5a7e444 | https://github.com/SagittariusX/Beluga.Translation/blob/8f66c4fef6fa4494413972ca56bd8e13f5a7e444/src/Beluga/Translation/Translator.php#L83-L95 |
200,433 | iRipVanWinkle/codeception-migration | src/Migration.php | Migration.runMigrationByPaths | protected function runMigrationByPaths($migrationPaths, $command)
{
$app = $this->mockApplication();
$this->validateMigrationPaths($migrationPaths);
/* @todo: since version 2.0.12 you may also specify an array of migration paths. */
foreach ($migrationPaths as $migrationPath) {
... | php | protected function runMigrationByPaths($migrationPaths, $command)
{
$app = $this->mockApplication();
$this->validateMigrationPaths($migrationPaths);
/* @todo: since version 2.0.12 you may also specify an array of migration paths. */
foreach ($migrationPaths as $migrationPath) {
... | [
"protected",
"function",
"runMigrationByPaths",
"(",
"$",
"migrationPaths",
",",
"$",
"command",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"mockApplication",
"(",
")",
";",
"$",
"this",
"->",
"validateMigrationPaths",
"(",
"$",
"migrationPaths",
")",
";"... | Run migration by paths
@param array $migrationPaths
@param $command
@throws ExtensionException | [
"Run",
"migration",
"by",
"paths"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L100-L115 |
200,434 | iRipVanWinkle/codeception-migration | src/Migration.php | Migration.validateMigrationPaths | protected function validateMigrationPaths($migrationPaths)
{
foreach ($migrationPaths as $migrationPath) {
$path = \Yii::getAlias($migrationPath, false);
if ($path === false) {
throw new ExtensionException(
__CLASS__,
"Invalid path ... | php | protected function validateMigrationPaths($migrationPaths)
{
foreach ($migrationPaths as $migrationPath) {
$path = \Yii::getAlias($migrationPath, false);
if ($path === false) {
throw new ExtensionException(
__CLASS__,
"Invalid path ... | [
"protected",
"function",
"validateMigrationPaths",
"(",
"$",
"migrationPaths",
")",
"{",
"foreach",
"(",
"$",
"migrationPaths",
"as",
"$",
"migrationPath",
")",
"{",
"$",
"path",
"=",
"\\",
"Yii",
"::",
"getAlias",
"(",
"$",
"migrationPath",
",",
"false",
")... | Validate Migration Path
@param string $migrationPath
@throws ExtensionException | [
"Validate",
"Migration",
"Path"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L122-L140 |
200,435 | iRipVanWinkle/codeception-migration | src/Migration.php | Migration.runMigrationByNamespaces | protected function runMigrationByNamespaces($migrationNamespaces, $command)
{
$app = $this->mockApplication();
$migrateController = $this->buildMigration($app);
$migrateController->migrationNamespaces = $migrationNamespaces;
$this->runMigration($migrateController, $command);
... | php | protected function runMigrationByNamespaces($migrationNamespaces, $command)
{
$app = $this->mockApplication();
$migrateController = $this->buildMigration($app);
$migrateController->migrationNamespaces = $migrationNamespaces;
$this->runMigration($migrateController, $command);
... | [
"protected",
"function",
"runMigrationByNamespaces",
"(",
"$",
"migrationNamespaces",
",",
"$",
"command",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"mockApplication",
"(",
")",
";",
"$",
"migrateController",
"=",
"$",
"this",
"->",
"buildMigration",
"(",
... | Run migration by namespaces
@param array $migrationNamespaces
@param string $command either `up` or `down` | [
"Run",
"migration",
"by",
"namespaces"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L147-L157 |
200,436 | iRipVanWinkle/codeception-migration | src/Migration.php | Migration.runMigrationByApplication | protected function runMigrationByApplication($command)
{
$app = $this->mockApplication();
list($migrateController, $route) = $app->createController('migrate');
if ($migrateController === null) {
throw new ExtensionException(
__CLASS__,
"At least one ... | php | protected function runMigrationByApplication($command)
{
$app = $this->mockApplication();
list($migrateController, $route) = $app->createController('migrate');
if ($migrateController === null) {
throw new ExtensionException(
__CLASS__,
"At least one ... | [
"protected",
"function",
"runMigrationByApplication",
"(",
"$",
"command",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"mockApplication",
"(",
")",
";",
"list",
"(",
"$",
"migrateController",
",",
"$",
"route",
")",
"=",
"$",
"app",
"->",
"createControll... | Run migration from app config
@param string $command either `up` or `down` | [
"Run",
"migration",
"from",
"app",
"config"
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L163-L184 |
200,437 | iRipVanWinkle/codeception-migration | src/Migration.php | Migration.mockApplication | protected function mockApplication()
{
$entryUrl = $this->config['entryUrl'];
$entryFile = $this->config['entryScript'] ?: basename($entryUrl);
$entryScript = $this->config['entryScript'] ?: parse_url($entryUrl, PHP_URL_PATH);
$this->client = new Yii2Connector();
$this->clien... | php | protected function mockApplication()
{
$entryUrl = $this->config['entryUrl'];
$entryFile = $this->config['entryScript'] ?: basename($entryUrl);
$entryScript = $this->config['entryScript'] ?: parse_url($entryUrl, PHP_URL_PATH);
$this->client = new Yii2Connector();
$this->clien... | [
"protected",
"function",
"mockApplication",
"(",
")",
"{",
"$",
"entryUrl",
"=",
"$",
"this",
"->",
"config",
"[",
"'entryUrl'",
"]",
";",
"$",
"entryFile",
"=",
"$",
"this",
"->",
"config",
"[",
"'entryScript'",
"]",
"?",
":",
"basename",
"(",
"$",
"e... | Mocks up the application instance.
@return \yii\web\Application|\yii\console\Application the application instance
@throws InvalidConfigException if the application configuration is invalid | [
"Mocks",
"up",
"the",
"application",
"instance",
"."
] | 1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0 | https://github.com/iRipVanWinkle/codeception-migration/blob/1cc0bf4167ec9b0cf6590b1b687570b323d3f5d0/src/Migration.php#L222-L239 |
200,438 | agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.AddEMailField | private function AddEMailField()
{
$name = 'EMail';
$this->AddField(Input::Text($name, $this->member->GetEMail()));
$this->SetRequired($name);
$this->AddValidator($name, PhpFilter::EMail());
$this->AddValidator($name, DatabaseCount::UniqueField($this->member, $name));
} | php | private function AddEMailField()
{
$name = 'EMail';
$this->AddField(Input::Text($name, $this->member->GetEMail()));
$this->SetRequired($name);
$this->AddValidator($name, PhpFilter::EMail());
$this->AddValidator($name, DatabaseCount::UniqueField($this->member, $name));
} | [
"private",
"function",
"AddEMailField",
"(",
")",
"{",
"$",
"name",
"=",
"'EMail'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"member",
"->",
"GetEMail",
"(",
")",
")",
")",
";",
"$",
... | Adds the email field to the form | [
"Adds",
"the",
"email",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L67-L74 |
200,439 | agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.AddPasswordField | private function AddPasswordField()
{
$name = 'Password';
$this->AddField(Input::Password($name));
if (!$this->member->Exists())
{
$this->SetRequired($name);
}
$this->AddValidator($name, StringLength::MinLength(6));
$this->SetTransAttribut... | php | private function AddPasswordField()
{
$name = 'Password';
$this->AddField(Input::Password($name));
if (!$this->member->Exists())
{
$this->SetRequired($name);
}
$this->AddValidator($name, StringLength::MinLength(6));
$this->SetTransAttribut... | [
"private",
"function",
"AddPasswordField",
"(",
")",
"{",
"$",
"name",
"=",
"'Password'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Password",
"(",
"$",
"name",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"member",
"->",
"Exists"... | Adds the password field to the form | [
"Adds",
"the",
"password",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L79-L90 |
200,440 | agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.OnSuccess | protected function OnSuccess()
{
$action = $this->member->Exists() ? Action::Update() : Action::Create();
$this->member->SetName($this->Value('Name'));
$this->member->SetEMail($this->Value('EMail'));
$this->SetPassword();
$this->member->Save();
$logger = new Logger(se... | php | protected function OnSuccess()
{
$action = $this->member->Exists() ? Action::Update() : Action::Create();
$this->member->SetName($this->Value('Name'));
$this->member->SetEMail($this->Value('EMail'));
$this->SetPassword();
$this->member->Save();
$logger = new Logger(se... | [
"protected",
"function",
"OnSuccess",
"(",
")",
"{",
"$",
"action",
"=",
"$",
"this",
"->",
"member",
"->",
"Exists",
"(",
")",
"?",
"Action",
"::",
"Update",
"(",
")",
":",
"Action",
"::",
"Create",
"(",
")",
";",
"$",
"this",
"->",
"member",
"->"... | Saves the user | [
"Saves",
"the",
"user"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L106-L120 |
200,441 | agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.DeleteOldGroups | private function DeleteOldGroups(array $selGroupIDs)
{
$tblMmg = MemberMembergroup::Schema()->Table();
$sql = Access::SqlBuilder();
$where = $sql->Equals($tblMmg->Field('Member'), $sql->Value($this->member->GetID()));
if (count($selGroupIDs) > 0)
{
$selectedList =... | php | private function DeleteOldGroups(array $selGroupIDs)
{
$tblMmg = MemberMembergroup::Schema()->Table();
$sql = Access::SqlBuilder();
$where = $sql->Equals($tblMmg->Field('Member'), $sql->Value($this->member->GetID()));
if (count($selGroupIDs) > 0)
{
$selectedList =... | [
"private",
"function",
"DeleteOldGroups",
"(",
"array",
"$",
"selGroupIDs",
")",
"{",
"$",
"tblMmg",
"=",
"MemberMembergroup",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"w... | Deletes the unselected group ids
@param array $exGroupIDs Currently assigned group ids
@param array $selGroupIDs Selected group ids | [
"Deletes",
"the",
"unselected",
"group",
"ids"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L159-L170 |
200,442 | agentmedia/phine-core | src/Core/Modules/Backend/MemberForm.php | MemberForm.SaveNewGroups | private function SaveNewGroups(array $exGroupIDs, array $selGroupIDs)
{
foreach ($selGroupIDs as $selGroupID)
{
if (!in_array($selGroupID, $exGroupIDs))
{
$mmg = new MemberMembergroup();
$mmg->SetMember($this->member);
$mmg->Set... | php | private function SaveNewGroups(array $exGroupIDs, array $selGroupIDs)
{
foreach ($selGroupIDs as $selGroupID)
{
if (!in_array($selGroupID, $exGroupIDs))
{
$mmg = new MemberMembergroup();
$mmg->SetMember($this->member);
$mmg->Set... | [
"private",
"function",
"SaveNewGroups",
"(",
"array",
"$",
"exGroupIDs",
",",
"array",
"$",
"selGroupIDs",
")",
"{",
"foreach",
"(",
"$",
"selGroupIDs",
"as",
"$",
"selGroupID",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"selGroupID",
",",
"$",
"exG... | Saves the new groups
@param array $exGroupIDs
@param array $selGroupIDs | [
"Saves",
"the",
"new",
"groups"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/MemberForm.php#L176-L188 |
200,443 | indigoram89/laravel-fields | src/Field.php | Field.setDefaultValue | public function setDefaultValue($value = null)
{
if (! $this->value) {
if ($value = $value ?: config("fields.values.{$this->key}")) {
foreach ((array) $value as $locale => $translation) {
$locale = is_string($locale) ? $locale : $this->getDefaultLocale();
... | php | public function setDefaultValue($value = null)
{
if (! $this->value) {
if ($value = $value ?: config("fields.values.{$this->key}")) {
foreach ((array) $value as $locale => $translation) {
$locale = is_string($locale) ? $locale : $this->getDefaultLocale();
... | [
"public",
"function",
"setDefaultValue",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"=",
"$",
"value",
"?",
":",
"config",
"(",
"\"fields.values.{$this->key}\"",
")",
")",
... | Check if value is not set and set it.
@param string|array|null $value
@return void | [
"Check",
"if",
"value",
"is",
"not",
"set",
"and",
"set",
"it",
"."
] | 1cb34eb4e653b82577531951ed94bd73a1009112 | https://github.com/indigoram89/laravel-fields/blob/1cb34eb4e653b82577531951ed94bd73a1009112/src/Field.php#L39-L50 |
200,444 | indigoram89/laravel-fields | src/Field.php | Field.setDefaultDescription | public function setDefaultDescription($description = null)
{
if (! $this->description) {
$description = $description ?: config("fields.descriptions.{$this->key}", ucfirst($this->key));
foreach ((array) $description as $locale => $translation) {
$locale = is_string($lo... | php | public function setDefaultDescription($description = null)
{
if (! $this->description) {
$description = $description ?: config("fields.descriptions.{$this->key}", ucfirst($this->key));
foreach ((array) $description as $locale => $translation) {
$locale = is_string($lo... | [
"public",
"function",
"setDefaultDescription",
"(",
"$",
"description",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"description",
")",
"{",
"$",
"description",
"=",
"$",
"description",
"?",
":",
"config",
"(",
"\"fields.descriptions.{$this->key}... | Check if description is not set and set it.
@param string|array|null $description
@return void | [
"Check",
"if",
"description",
"is",
"not",
"set",
"and",
"set",
"it",
"."
] | 1cb34eb4e653b82577531951ed94bd73a1009112 | https://github.com/indigoram89/laravel-fields/blob/1cb34eb4e653b82577531951ed94bd73a1009112/src/Field.php#L58-L67 |
200,445 | indigoram89/laravel-fields | src/Field.php | Field.addTranslated | public function addTranslated(string $locale)
{
if ($this->isDefaultLocale($locale)) {
$this->translated = [$locale];
} else {
$translated = $this->getTranslated();
$translated[] = $locale;
$this->translated = array_unique($translated);
}
} | php | public function addTranslated(string $locale)
{
if ($this->isDefaultLocale($locale)) {
$this->translated = [$locale];
} else {
$translated = $this->getTranslated();
$translated[] = $locale;
$this->translated = array_unique($translated);
}
} | [
"public",
"function",
"addTranslated",
"(",
"string",
"$",
"locale",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDefaultLocale",
"(",
"$",
"locale",
")",
")",
"{",
"$",
"this",
"->",
"translated",
"=",
"[",
"$",
"locale",
"]",
";",
"}",
"else",
"{",
... | Set translated locale.
@param string $locale
@return void | [
"Set",
"translated",
"locale",
"."
] | 1cb34eb4e653b82577531951ed94bd73a1009112 | https://github.com/indigoram89/laravel-fields/blob/1cb34eb4e653b82577531951ed94bd73a1009112/src/Field.php#L85-L94 |
200,446 | koolkode/http | src/Http.php | Http.normalizeHeaderName | public static function normalizeHeaderName($name)
{
return preg_replace_callback("'-[a-z]'", function($m) {
return strtoupper($m[0]);
}, ucfirst(strtolower(trim($name))));
} | php | public static function normalizeHeaderName($name)
{
return preg_replace_callback("'-[a-z]'", function($m) {
return strtoupper($m[0]);
}, ucfirst(strtolower(trim($name))));
} | [
"public",
"static",
"function",
"normalizeHeaderName",
"(",
"$",
"name",
")",
"{",
"return",
"preg_replace_callback",
"(",
"\"'-[a-z]'\"",
",",
"function",
"(",
"$",
"m",
")",
"{",
"return",
"strtoupper",
"(",
"$",
"m",
"[",
"0",
"]",
")",
";",
"}",
",",... | Normalize an HTTP header name by capitalizing the first letter and all letters
preceeded by a dash.
@param string $name
@return string | [
"Normalize",
"an",
"HTTP",
"header",
"name",
"by",
"capitalizing",
"the",
"first",
"letter",
"and",
"all",
"letters",
"preceeded",
"by",
"a",
"dash",
"."
] | 3c1626d409d5ce5d71d26f0e8f31ae3683a2a966 | https://github.com/koolkode/http/blob/3c1626d409d5ce5d71d26f0e8f31ae3683a2a966/src/Http.php#L834-L839 |
200,447 | p2made/yii2-p2y2-base | assets/P2AssetBase.php | P2AssetBase.useStatic | protected static function useStatic()
{
if(isset(self::$_useStatic)) {
return self::$_useStatic;
}
self::$_useStatic = AssetsSettings::assetsUseStatic();
return self::$_useStatic;
} | php | protected static function useStatic()
{
if(isset(self::$_useStatic)) {
return self::$_useStatic;
}
self::$_useStatic = AssetsSettings::assetsUseStatic();
return self::$_useStatic;
} | [
"protected",
"static",
"function",
"useStatic",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"_useStatic",
")",
")",
"{",
"return",
"self",
"::",
"$",
"_useStatic",
";",
"}",
"self",
"::",
"$",
"_useStatic",
"=",
"AssetsSettings",
"::",
"... | Get useStatic setting - use static resources
@return boolean
@default false | [
"Get",
"useStatic",
"setting",
"-",
"use",
"static",
"resources"
] | face3df8794407cdc8178ed64c06cc760c449de2 | https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/assets/P2AssetBase.php#L215-L224 |
200,448 | ezra-obiwale/dSCore | src/Core/AController.php | AController.setView | final public function setView(View $view) {
$this->view = $view;
if (!$this->initializedView) {
$this->initializedView = true;
$this->init();
}
return $this;
} | php | final public function setView(View $view) {
$this->view = $view;
if (!$this->initializedView) {
$this->initializedView = true;
$this->init();
}
return $this;
} | [
"final",
"public",
"function",
"setView",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"view",
"=",
"$",
"view",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"initializedView",
")",
"{",
"$",
"this",
"->",
"initializedView",
"=",
"true",
";",
... | Sets the view instance to use
@param View $view
@return AController | [
"Sets",
"the",
"view",
"instance",
"to",
"use"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L44-L51 |
200,449 | ezra-obiwale/dSCore | src/Core/AController.php | AController.resetUserIdentity | final protected function resetUserIdentity(AUser $user = null, $duration = null) {
engine('resetUserIdentity', $user, $duration);
return $this;
} | php | final protected function resetUserIdentity(AUser $user = null, $duration = null) {
engine('resetUserIdentity', $user, $duration);
return $this;
} | [
"final",
"protected",
"function",
"resetUserIdentity",
"(",
"AUser",
"$",
"user",
"=",
"null",
",",
"$",
"duration",
"=",
"null",
")",
"{",
"engine",
"(",
"'resetUserIdentity'",
",",
"$",
"user",
",",
"$",
"duration",
")",
";",
"return",
"$",
"this",
";"... | Resets the user identity to guest
@param AUser $user
@param int $duration Duration for which the identity should be valid
@return AController | [
"Resets",
"the",
"user",
"identity",
"to",
"guest"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L88-L91 |
200,450 | ezra-obiwale/dSCore | src/Core/AController.php | AController.prepareInject | final protected function prepareInject() {
$service = $this->getModule() . '\Services\\' . $this->getClassName() . 'Service';
if (class_exists($service)) {
return array_merge(parent::prepareInject(), $this->getConfigInject('controllers'), array(
'service' => array(
... | php | final protected function prepareInject() {
$service = $this->getModule() . '\Services\\' . $this->getClassName() . 'Service';
if (class_exists($service)) {
return array_merge(parent::prepareInject(), $this->getConfigInject('controllers'), array(
'service' => array(
... | [
"final",
"protected",
"function",
"prepareInject",
"(",
")",
"{",
"$",
"service",
"=",
"$",
"this",
"->",
"getModule",
"(",
")",
".",
"'\\Services\\\\'",
".",
"$",
"this",
"->",
"getClassName",
"(",
")",
".",
"'Service'",
";",
"if",
"(",
"class_exists",
... | Prepares the injection
@return array | [
"Prepares",
"the",
"injection"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L97-L108 |
200,451 | ezra-obiwale/dSCore | src/Core/AController.php | AController.getActions | final public function getActions() {
$return = array();
foreach (get_class_methods($this) as $method) {
if (substr($method, strlen($method) - 6) === 'Action')
$return[] = substr($method, 0, strlen($method) - 6);
}
return $return;
} | php | final public function getActions() {
$return = array();
foreach (get_class_methods($this) as $method) {
if (substr($method, strlen($method) - 6) === 'Action')
$return[] = substr($method, 0, strlen($method) - 6);
}
return $return;
} | [
"final",
"public",
"function",
"getActions",
"(",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"get_class_methods",
"(",
"$",
"this",
")",
"as",
"$",
"method",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"method",
",",
"strlen",... | Fetches all actions in the controller
@return array | [
"Fetches",
"all",
"actions",
"in",
"the",
"controller"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L122-L129 |
200,452 | ezra-obiwale/dSCore | src/Core/AController.php | AController.redirect | final protected function redirect($module, $controller = null, $action = null, array $params = array(), $hash = null) {
header('Location: ' . $this->view->url($module, $controller, $action, $params, $hash));
exit;
} | php | final protected function redirect($module, $controller = null, $action = null, array $params = array(), $hash = null) {
header('Location: ' . $this->view->url($module, $controller, $action, $params, $hash));
exit;
} | [
"final",
"protected",
"function",
"redirect",
"(",
"$",
"module",
",",
"$",
"controller",
"=",
"null",
",",
"$",
"action",
"=",
"null",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"hash",
"=",
"null",
")",
"{",
"header",
"(",
"'L... | Redirects to another resource
@param string $module
@param string|null $controller
@param string|null $action
@param array $params
@param string $hash | [
"Redirects",
"to",
"another",
"resource"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/AController.php#L147-L150 |
200,453 | OliverMonneke/pennePHP | src/Datatype/Resource.php | Resource.isEmpty | public static function isEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return String::isEmpty($resource);
} | php | public static function isEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return String::isEmpty($resource);
} | [
"public",
"static",
"function",
"isEmpty",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"resource",
")",
"&&",
"null",
"!==",
"$",
"resource",
")",
"{",
"return",
"false",
";",
"}",
"return",
"String",
"::",
"isE... | Check if resource is empty
@param resource $resource The resource
@return bool | [
"Check",
"if",
"resource",
"is",
"empty"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Resource.php#L36-L44 |
200,454 | OliverMonneke/pennePHP | src/Datatype/Resource.php | Resource.isNotEmpty | public static function isNotEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return ($resource !== null && $resource !== '');
} | php | public static function isNotEmpty($resource)
{
if (!self::isValid($resource) &&
null !== $resource) {
return false;
}
return ($resource !== null && $resource !== '');
} | [
"public",
"static",
"function",
"isNotEmpty",
"(",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isValid",
"(",
"$",
"resource",
")",
"&&",
"null",
"!==",
"$",
"resource",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"$",
"resour... | Check if resource is note empty
@param resource $resource The resource
@return bool | [
"Check",
"if",
"resource",
"is",
"note",
"empty"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Datatype/Resource.php#L53-L61 |
200,455 | ARCANESOFT/SEO | src/Seeds/PermissionsTableSeeder.php | PermissionsTableSeeder.getPagesSeeds | private function getPagesSeeds()
{
return [
[
'name' => 'Pages - List all pages',
'description' => 'Allow to list all pages.',
'slug' => PagesPolicy::PERMISSION_LIST,
],
[
'name' => 'Page... | php | private function getPagesSeeds()
{
return [
[
'name' => 'Pages - List all pages',
'description' => 'Allow to list all pages.',
'slug' => PagesPolicy::PERMISSION_LIST,
],
[
'name' => 'Page... | [
"private",
"function",
"getPagesSeeds",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Pages - List all pages'",
",",
"'description'",
"=>",
"'Allow to list all pages.'",
",",
"'slug'",
"=>",
"PagesPolicy",
"::",
"PERMISSION_LIST",
",",
"]",
",",
"[",
"'name... | Get the Pages permissions.
@return array | [
"Get",
"the",
"Pages",
"permissions",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Seeds/PermissionsTableSeeder.php#L72-L101 |
200,456 | ARCANESOFT/SEO | src/Seeds/PermissionsTableSeeder.php | PermissionsTableSeeder.getFootersSeeds | private function getFootersSeeds()
{
return [
[
'name' => 'Footers - List all footers',
'description' => 'Allow to list all footers.',
'slug' => FootersPolicy::PERMISSION_LIST,
],
[
'name' ... | php | private function getFootersSeeds()
{
return [
[
'name' => 'Footers - List all footers',
'description' => 'Allow to list all footers.',
'slug' => FootersPolicy::PERMISSION_LIST,
],
[
'name' ... | [
"private",
"function",
"getFootersSeeds",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Footers - List all footers'",
",",
"'description'",
"=>",
"'Allow to list all footers.'",
",",
"'slug'",
"=>",
"FootersPolicy",
"::",
"PERMISSION_LIST",
",",
"]",
",",
"["... | Get the Footers permissions.
@return array | [
"Get",
"the",
"Footers",
"permissions",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Seeds/PermissionsTableSeeder.php#L108-L137 |
200,457 | ARCANESOFT/SEO | src/Seeds/PermissionsTableSeeder.php | PermissionsTableSeeder.getRedirectsSeeds | private function getRedirectsSeeds()
{
return [
[
'name' => 'Redirects - List all redirections',
'description' => 'Allow to list all redirections.',
'slug' => RedirectsPolicy::PERMISSION_LIST,
],
[
... | php | private function getRedirectsSeeds()
{
return [
[
'name' => 'Redirects - List all redirections',
'description' => 'Allow to list all redirections.',
'slug' => RedirectsPolicy::PERMISSION_LIST,
],
[
... | [
"private",
"function",
"getRedirectsSeeds",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Redirects - List all redirections'",
",",
"'description'",
"=>",
"'Allow to list all redirections.'",
",",
"'slug'",
"=>",
"RedirectsPolicy",
"::",
"PERMISSION_LIST",
",",
"... | Get the Redirects permissions.
@return array | [
"Get",
"the",
"Redirects",
"permissions",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Seeds/PermissionsTableSeeder.php#L160-L189 |
200,458 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.render | public function render($tpl, $params = [])
{
$this->setTemplate($tpl);
$this->params = (object) $params;
return $this->retrieve();
} | php | public function render($tpl, $params = [])
{
$this->setTemplate($tpl);
$this->params = (object) $params;
return $this->retrieve();
} | [
"public",
"function",
"render",
"(",
"$",
"tpl",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setTemplate",
"(",
"$",
"tpl",
")",
";",
"$",
"this",
"->",
"params",
"=",
"(",
"object",
")",
"$",
"params",
";",
"return",
"$",
... | Set the template name, assign params array and return rendered output in one method.
Call this function in routes and controllers.
@param string $tpl
@param array $params
@return string | [
"Set",
"the",
"template",
"name",
"assign",
"params",
"array",
"and",
"return",
"rendered",
"output",
"in",
"one",
"method",
".",
"Call",
"this",
"function",
"in",
"routes",
"and",
"controllers",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L102-L107 |
200,459 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setTemplate | public function setTemplate($tpl, $clearParams=true)
{
if ($clearParams) {
$this->clearParams();
}
$this->templateFile = $this->templatesPath.$tpl.'.tpl.php';
} | php | public function setTemplate($tpl, $clearParams=true)
{
if ($clearParams) {
$this->clearParams();
}
$this->templateFile = $this->templatesPath.$tpl.'.tpl.php';
} | [
"public",
"function",
"setTemplate",
"(",
"$",
"tpl",
",",
"$",
"clearParams",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"clearParams",
")",
"{",
"$",
"this",
"->",
"clearParams",
"(",
")",
";",
"}",
"$",
"this",
"->",
"templateFile",
"=",
"$",
"this",
... | Set the name of the template to be used. Should not include file extension.
@param string $tpl
@param boolean $clearParams
@return void | [
"Set",
"the",
"name",
"of",
"the",
"template",
"to",
"be",
"used",
".",
"Should",
"not",
"include",
"file",
"extension",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L116-L122 |
200,460 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setTemplatesPath | private function setTemplatesPath($templatesPath)
{
$this->templatesPath = $templatesPath;
if (!is_readable($this->templatesPath)) {
$this->error("Template Root Path ({$this->templatesPath}) does not exist or not readable.");
}
} | php | private function setTemplatesPath($templatesPath)
{
$this->templatesPath = $templatesPath;
if (!is_readable($this->templatesPath)) {
$this->error("Template Root Path ({$this->templatesPath}) does not exist or not readable.");
}
} | [
"private",
"function",
"setTemplatesPath",
"(",
"$",
"templatesPath",
")",
"{",
"$",
"this",
"->",
"templatesPath",
"=",
"$",
"templatesPath",
";",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"this",
"->",
"templatesPath",
")",
")",
"{",
"$",
"this",
"->",
... | Set the path to the templates directory.
@param string $templatesPath
@return void | [
"Set",
"the",
"path",
"to",
"the",
"templates",
"directory",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L130-L136 |
200,461 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.protectedInclude | private function protectedInclude()
{
$_tpl = $this;
// View Helpers:
// * Include another view into the current view:
$_view = function ($tplName, $params = []) use ($_tpl) {
$tplCopy = clone $_tpl; // Don't want to mess with the calling template's settings.
... | php | private function protectedInclude()
{
$_tpl = $this;
// View Helpers:
// * Include another view into the current view:
$_view = function ($tplName, $params = []) use ($_tpl) {
$tplCopy = clone $_tpl; // Don't want to mess with the calling template's settings.
... | [
"private",
"function",
"protectedInclude",
"(",
")",
"{",
"$",
"_tpl",
"=",
"$",
"this",
";",
"// View Helpers:",
"// * Include another view into the current view:",
"$",
"_view",
"=",
"function",
"(",
"$",
"tplName",
",",
"$",
"params",
"=",
"[",
"]",
")",
"u... | Wrap our template include into a method scope.
This allows our template to have access only to the template params.
It also prevents collisions with the global namespace.
This function also defines some template helpers:
$_ss(string $str) - Safe String. Html encode the string.
$_view(string $tplName, array $params) - ... | [
"Wrap",
"our",
"template",
"include",
"into",
"a",
"method",
"scope",
".",
"This",
"allows",
"our",
"template",
"to",
"have",
"access",
"only",
"to",
"the",
"template",
"params",
".",
"It",
"also",
"prevents",
"collisions",
"with",
"the",
"global",
"namespac... | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L213-L236 |
200,462 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.useCache | protected function useCache()
{
// Should we use a cached version?
if ($this->cache && $this->cacheExists()) {
$this->templateOutput = $this->getCache();
if ($this->templateOutput !== false) {
return true;
}
}
return false;
} | php | protected function useCache()
{
// Should we use a cached version?
if ($this->cache && $this->cacheExists()) {
$this->templateOutput = $this->getCache();
if ($this->templateOutput !== false) {
return true;
}
}
return false;
} | [
"protected",
"function",
"useCache",
"(",
")",
"{",
"// Should we use a cached version?",
"if",
"(",
"$",
"this",
"->",
"cache",
"&&",
"$",
"this",
"->",
"cacheExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"templateOutput",
"=",
"$",
"this",
"->",
"getCa... | Determine if we can use a cached version of the template and if so, fetch it.
@return bool | [
"Determine",
"if",
"we",
"can",
"use",
"a",
"cached",
"version",
"of",
"the",
"template",
"and",
"if",
"so",
"fetch",
"it",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L276-L286 |
200,463 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setCacheKey | public function setCacheKey($key)
{
$key = preg_replace('/[^\da-z]/i', '', $key);
if (!empty($key)) {
$this->cacheKey = $key;
}
} | php | public function setCacheKey($key)
{
$key = preg_replace('/[^\da-z]/i', '', $key);
if (!empty($key)) {
$this->cacheKey = $key;
}
} | [
"public",
"function",
"setCacheKey",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"preg_replace",
"(",
"'/[^\\da-z]/i'",
",",
"''",
",",
"$",
"key",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"cacheKey",
... | Manually set a name for the cached file instead of using the md5 of the template name.
@param string $key
@return void | [
"Manually",
"set",
"a",
"name",
"for",
"the",
"cached",
"file",
"instead",
"of",
"using",
"the",
"md5",
"of",
"the",
"template",
"name",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L294-L300 |
200,464 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.cacheExists | public function cacheExists()
{
$cacheFile = $this->getCacheFile();
if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {
return(true);
} else {
return(false);
}
} | php | public function cacheExists()
{
$cacheFile = $this->getCacheFile();
if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {
return(true);
} else {
return(false);
}
} | [
"public",
"function",
"cacheExists",
"(",
")",
"{",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"getCacheFile",
"(",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"cacheFile",
")",
"&&",
"filemtime",
"(",
"$",
"cacheFile",
")",
">",
"(",
"time",
"(",
"... | Check whether a cache file exists and is not expired.
@return bool | [
"Check",
"whether",
"a",
"cache",
"file",
"exists",
"and",
"is",
"not",
"expired",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L341-L349 |
200,465 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.setCache | protected function setCache()
{
if ($this->cache) {
$cacheFile = $this->getCacheFile();
file_put_contents($cacheFile, $this->templateOutput);
}
} | php | protected function setCache()
{
if ($this->cache) {
$cacheFile = $this->getCacheFile();
file_put_contents($cacheFile, $this->templateOutput);
}
} | [
"protected",
"function",
"setCache",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
")",
"{",
"$",
"cacheFile",
"=",
"$",
"this",
"->",
"getCacheFile",
"(",
")",
";",
"file_put_contents",
"(",
"$",
"cacheFile",
",",
"$",
"this",
"->",
"templateO... | Cache the template if applicable.
@return void | [
"Cache",
"the",
"template",
"if",
"applicable",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L356-L362 |
200,466 | syntaxseed/templateseed | src/TemplateSeed.php | TemplateSeed.getCacheFile | private function getCacheFile()
{
if (is_null($this->cachePath) || !file_exists($this->cachePath)) {
$this->error('Invalid Cache Path. '.$this->cachePath);
return false;
}
$cacheKey = is_null($this->cacheKey) ? md5($this->templateFile) : $this->cacheKey;
retur... | php | private function getCacheFile()
{
if (is_null($this->cachePath) || !file_exists($this->cachePath)) {
$this->error('Invalid Cache Path. '.$this->cachePath);
return false;
}
$cacheKey = is_null($this->cacheKey) ? md5($this->templateFile) : $this->cacheKey;
retur... | [
"private",
"function",
"getCacheFile",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"cachePath",
")",
"||",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"cachePath",
")",
")",
"{",
"$",
"this",
"->",
"error",
"(",
"'Invalid Cache Path. '",... | Get the name of the file this template should be cached to.
Using the supplied key, or the md5 of the template name.
@return string|false | [
"Get",
"the",
"name",
"of",
"the",
"file",
"this",
"template",
"should",
"be",
"cached",
"to",
".",
"Using",
"the",
"supplied",
"key",
"or",
"the",
"md5",
"of",
"the",
"template",
"name",
"."
] | 70e157381fa513e92e566824be18cc4437e7cff9 | https://github.com/syntaxseed/templateseed/blob/70e157381fa513e92e566824be18cc4437e7cff9/src/TemplateSeed.php#L384-L392 |
200,467 | koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.consume | public function consume($type = NULL)
{
if(!$this->valid())
{
throw new \OutOfBoundsException('No more tokens available');
}
$token = $this->current();
if($type !== NULL && !$token->is($type))
{
throw new \UnexpectedValueException(sprintf('Expected token type %s, read "%s" (%d)', $type, $token, $... | php | public function consume($type = NULL)
{
if(!$this->valid())
{
throw new \OutOfBoundsException('No more tokens available');
}
$token = $this->current();
if($type !== NULL && !$token->is($type))
{
throw new \UnexpectedValueException(sprintf('Expected token type %s, read "%s" (%d)', $type, $token, $... | [
"public",
"function",
"consume",
"(",
"$",
"type",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"valid",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
"'No more tokens available'",
")",
";",
"}",
"$",
"token",
"=",... | Consume the next token and return it.
@param integer $type The expected token type...
@return AbstractToken
@throws \OutOfBoundsException When there are no more tokens to be consumed.
@throws \UnexpectedValueException When a token is found but does not match the given type. | [
"Consume",
"the",
"next",
"token",
"and",
"return",
"it",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L113-L130 |
200,468 | koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.moveTo | public function moveTo($mark)
{
if(is_array($mark) || $mark instanceof \Countable)
{
$this->index = count($mark);
}
else
{
$this->index = (int)$mark;
}
return $this;
} | php | public function moveTo($mark)
{
if(is_array($mark) || $mark instanceof \Countable)
{
$this->index = count($mark);
}
else
{
$this->index = (int)$mark;
}
return $this;
} | [
"public",
"function",
"moveTo",
"(",
"$",
"mark",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"mark",
")",
"||",
"$",
"mark",
"instanceof",
"\\",
"Countable",
")",
"{",
"$",
"this",
"->",
"index",
"=",
"count",
"(",
"$",
"mark",
")",
";",
"}",
"el... | Moves the cursor to the given mark.
@param mixed $mark
@return AbstractTokenCursor | [
"Moves",
"the",
"cursor",
"to",
"the",
"given",
"mark",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L161-L173 |
200,469 | koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.move | public function move($steps)
{
if(is_array($steps) || $steps instanceof \Countable)
{
$this->index += count($steps);
}
else
{
$this->index += (int)$steps;
}
return $this;
} | php | public function move($steps)
{
if(is_array($steps) || $steps instanceof \Countable)
{
$this->index += count($steps);
}
else
{
$this->index += (int)$steps;
}
return $this;
} | [
"public",
"function",
"move",
"(",
"$",
"steps",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"steps",
")",
"||",
"$",
"steps",
"instanceof",
"\\",
"Countable",
")",
"{",
"$",
"this",
"->",
"index",
"+=",
"count",
"(",
"$",
"steps",
")",
";",
"}",
... | Move the cursor by the given number of steps.
@param mixed $steps
@return AbstractTokenCursor | [
"Move",
"the",
"cursor",
"by",
"the",
"given",
"number",
"of",
"steps",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L181-L193 |
200,470 | koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.moveToNext | public function moveToNext($type, callable $callback = NULL)
{
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
return $token;
}
if($callback !== NULL)
{
$callback($token);
}
$this->next();
}
} | php | public function moveToNext($type, callable $callback = NULL)
{
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
return $token;
}
if($callback !== NULL)
{
$callback($token);
}
$this->next();
}
} | [
"public",
"function",
"moveToNext",
"(",
"$",
"type",
",",
"callable",
"$",
"callback",
"=",
"NULL",
")",
"{",
"$",
"delim",
"=",
"(",
"array",
")",
"$",
"type",
";",
"while",
"(",
"$",
"this",
"->",
"valid",
"(",
")",
")",
"{",
"$",
"token",
"="... | Move the cursor to the next occurance if the given token type.
@param mixed $type The target token type.
@param callable $callback Is invoked once for every skipped token.
@return AbstractToken or <code>NULL</code> if no token was found. | [
"Move",
"the",
"cursor",
"to",
"the",
"next",
"occurance",
"if",
"the",
"given",
"token",
"type",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L228-L248 |
200,471 | koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.readSequence | public function readSequence(array $allowedTokenTypes)
{
$tokens = [];
while($this->valid())
{
$token = $this->current();
if(!$token->isOneOf($allowedTokenTypes))
{
break;
}
$tokens[] = $token;
$this->next();
}
return $this->createTokenSequence($tokens);
} | php | public function readSequence(array $allowedTokenTypes)
{
$tokens = [];
while($this->valid())
{
$token = $this->current();
if(!$token->isOneOf($allowedTokenTypes))
{
break;
}
$tokens[] = $token;
$this->next();
}
return $this->createTokenSequence($tokens);
} | [
"public",
"function",
"readSequence",
"(",
"array",
"$",
"allowedTokenTypes",
")",
"{",
"$",
"tokens",
"=",
"[",
"]",
";",
"while",
"(",
"$",
"this",
"->",
"valid",
"(",
")",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"current",
"(",
")",
";",... | Get a TokenSequence containing only the allowed token types starting from the
current position of the cursor.
@param array<integer> $allowedTokenTypes
@return AbstractTokenSequence | [
"Get",
"a",
"TokenSequence",
"containing",
"only",
"the",
"allowed",
"token",
"types",
"starting",
"from",
"the",
"current",
"position",
"of",
"the",
"cursor",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L257-L276 |
200,472 | koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.readSequenceToNext | public function readSequenceToNext($type, $skipDelimiter = false)
{
$tokens = [];
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
if(!$skipDelimiter)
{
$tokens[] = $token;
}
break;
}
$tokens[] = $token;
$this->n... | php | public function readSequenceToNext($type, $skipDelimiter = false)
{
$tokens = [];
$delim = (array)$type;
while($this->valid())
{
$token = $this->current();
if($token->isOneOf($delim))
{
if(!$skipDelimiter)
{
$tokens[] = $token;
}
break;
}
$tokens[] = $token;
$this->n... | [
"public",
"function",
"readSequenceToNext",
"(",
"$",
"type",
",",
"$",
"skipDelimiter",
"=",
"false",
")",
"{",
"$",
"tokens",
"=",
"[",
"]",
";",
"$",
"delim",
"=",
"(",
"array",
")",
"$",
"type",
";",
"while",
"(",
"$",
"this",
"->",
"valid",
"(... | Read tokens to the next occurance of the given token type and return a
token sequence containing all found tokens.
@param mixed $type
@param boolean $skipDelimiter
@return AbstractTokenSequence | [
"Read",
"tokens",
"to",
"the",
"next",
"occurance",
"of",
"the",
"given",
"token",
"type",
"and",
"return",
"a",
"token",
"sequence",
"containing",
"all",
"found",
"tokens",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L286-L311 |
200,473 | koolkode/lexer | src/AbstractTokenCursor.php | AbstractTokenCursor.readNextBlock | public function readNextBlock($openingDelimiter, $closingDelimiter, $skipDelimiters = true)
{
$od = (array)$openingDelimiter;
$cd = (array)$closingDelimiter;
$tokens = [];
$level = -1;
while($this->valid() && $level < 0)
{
$token = $this->current();
if($token->isOneOf($od))
{
$level = 0;
... | php | public function readNextBlock($openingDelimiter, $closingDelimiter, $skipDelimiters = true)
{
$od = (array)$openingDelimiter;
$cd = (array)$closingDelimiter;
$tokens = [];
$level = -1;
while($this->valid() && $level < 0)
{
$token = $this->current();
if($token->isOneOf($od))
{
$level = 0;
... | [
"public",
"function",
"readNextBlock",
"(",
"$",
"openingDelimiter",
",",
"$",
"closingDelimiter",
",",
"$",
"skipDelimiters",
"=",
"true",
")",
"{",
"$",
"od",
"=",
"(",
"array",
")",
"$",
"openingDelimiter",
";",
"$",
"cd",
"=",
"(",
"array",
")",
"$",... | Reads the next code block enclosed in the given delimiters, returns an
empty token sequence when no tokens were matched.
@param mixed $openingDelimiter
@param mixed $closingDelimiter
@param boolean $skipDelimiters Skip enclosing delimiters?
@return AbstractTokenSequence | [
"Reads",
"the",
"next",
"code",
"block",
"enclosed",
"in",
"the",
"given",
"delimiters",
"returns",
"an",
"empty",
"token",
"sequence",
"when",
"no",
"tokens",
"were",
"matched",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenCursor.php#L322-L378 |
200,474 | brightnucleus/localization | src/LocalizationTrait.php | LocalizationTrait.loadLocalization | protected function loadLocalization( $domain, $path ) {
if ( is_textdomain_loaded( $domain ) ) {
return;
}
$locale = get_locale();
/**
* Filter the locale of a Bright Nucleus library.
*
* @since v0.1.0
*
* @param string $locale The plugin's current locale.
* @param string $domain Text dom... | php | protected function loadLocalization( $domain, $path ) {
if ( is_textdomain_loaded( $domain ) ) {
return;
}
$locale = get_locale();
/**
* Filter the locale of a Bright Nucleus library.
*
* @since v0.1.0
*
* @param string $locale The plugin's current locale.
* @param string $domain Text dom... | [
"protected",
"function",
"loadLocalization",
"(",
"$",
"domain",
",",
"$",
"path",
")",
"{",
"if",
"(",
"is_textdomain_loaded",
"(",
"$",
"domain",
")",
")",
"{",
"return",
";",
"}",
"$",
"locale",
"=",
"get_locale",
"(",
")",
";",
"/**\n\t\t * Filter the ... | Load localized strings.
@since 0.1.0
@param string $domain Textdomain to load.
@param string $path Path to languages files. | [
"Load",
"localized",
"strings",
"."
] | 8705bcccf54f4b19d50ed871364d6a6c2b8cffcd | https://github.com/brightnucleus/localization/blob/8705bcccf54f4b19d50ed871364d6a6c2b8cffcd/src/LocalizationTrait.php#L34-L84 |
200,475 | andres-montanez/FragmentCacheBundle | Service/FileCacheService.php | FileCacheService.get | public function get($key)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (file_exists($file) && is_readable($file)) {
if (filemtime($file) > time()) {
return file_get_contents($file);
}
}
return false;
} | php | public function get($key)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (file_exists($file) && is_readable($file)) {
if (filemtime($file) > time()) {
return file_get_contents($file);
}
}
return false;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"cacheDir",
".",
"$",
"this",
"->",
"getDir",
"(",
"$",
"key",
")",
".",
"$",
"this",
"->",
"getFile",
"(",
"$",
"key",
")",
";",
"if",
"(",
"file_exis... | Get a stored value by it's key
@param string $key
@return mixed | [
"Get",
"a",
"stored",
"value",
"by",
"it",
"s",
"key"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/Service/FileCacheService.php#L47-L57 |
200,476 | andres-montanez/FragmentCacheBundle | Service/FileCacheService.php | FileCacheService.set | public function set($key, $value, $expiration = 0)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (!file_exists(dirname($file))) {
mkdir(dirname($file), 0755, true);
}
$return = file_put_contents($file, $value);
touch($file, time() + ... | php | public function set($key, $value, $expiration = 0)
{
$file = $this->cacheDir . $this->getDir($key) . $this->getFile($key);
if (!file_exists(dirname($file))) {
mkdir(dirname($file), 0755, true);
}
$return = file_put_contents($file, $value);
touch($file, time() + ... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"0",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"cacheDir",
".",
"$",
"this",
"->",
"getDir",
"(",
"$",
"key",
")",
".",
"$",
"this",
"->",
"getFi... | Stores a value in the cache
@param string $key
@param mixed $value
@param integer $expiration
@return boolean | [
"Stores",
"a",
"value",
"in",
"the",
"cache"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/Service/FileCacheService.php#L68-L80 |
200,477 | andres-montanez/FragmentCacheBundle | Service/FileCacheService.php | FileCacheService.getDir | protected function getDir($key)
{
$dir = sha1($key);
$dir = substr($dir, 0, 3) . '/'
. substr($dir, 3, 3) . '/';
return $dir;
} | php | protected function getDir($key)
{
$dir = sha1($key);
$dir = substr($dir, 0, 3) . '/'
. substr($dir, 3, 3) . '/';
return $dir;
} | [
"protected",
"function",
"getDir",
"(",
"$",
"key",
")",
"{",
"$",
"dir",
"=",
"sha1",
"(",
"$",
"key",
")",
";",
"$",
"dir",
"=",
"substr",
"(",
"$",
"dir",
",",
"0",
",",
"3",
")",
".",
"'/'",
".",
"substr",
"(",
"$",
"dir",
",",
"3",
","... | Calculates the Directory based on a key
@param string $key
@return string | [
"Calculates",
"the",
"Directory",
"based",
"on",
"a",
"key"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/Service/FileCacheService.php#L101-L108 |
200,478 | ringoteam/RingoPhpRedmonBundle | Controller/AdminController.php | AdminController.flushAllAction | public function flushAllAction()
{
try {
$this->getWorker()->execute('flushAll');
$this->get('session')->getFlashBag()->add('success', 'Flush ALL executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('error', 'We h... | php | public function flushAllAction()
{
try {
$this->getWorker()->execute('flushAll');
$this->get('session')->getFlashBag()->add('success', 'Flush ALL executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('error', 'We h... | [
"public",
"function",
"flushAllAction",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getWorker",
"(",
")",
"->",
"execute",
"(",
"'flushAll'",
")",
";",
"$",
"this",
"->",
"get",
"(",
"'session'",
")",
"->",
"getFlashBag",
"(",
")",
"->",
"add",
"(... | Call flush all command for the current instance
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Call",
"flush",
"all",
"command",
"for",
"the",
"current",
"instance"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/AdminController.php#L31-L42 |
200,479 | ringoteam/RingoPhpRedmonBundle | Controller/AdminController.php | AdminController.flushDbAction | public function flushDbAction($id)
{
try {
$this->getWorker()->flushDB($id);
$this->get('session')->getFlashBag()->add('success', 'Flush DB on '.$id.' executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('success'... | php | public function flushDbAction($id)
{
try {
$this->getWorker()->flushDB($id);
$this->get('session')->getFlashBag()->add('success', 'Flush DB on '.$id.' executed successfully');
}catch(\Exception $e) {
$this->get('session')->getFlashBag()->add('success'... | [
"public",
"function",
"flushDbAction",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"getWorker",
"(",
")",
"->",
"flushDB",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"get",
"(",
"'session'",
")",
"->",
"getFlashBag",
"(",
")",
"->",
... | Call flush DB command for the current instance and the current database
@param int $id Database index
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Call",
"flush",
"DB",
"command",
"for",
"the",
"current",
"instance",
"and",
"the",
"current",
"database"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/AdminController.php#L50-L61 |
200,480 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/http/Response.php | Response.setProtocol | protected function setProtocol($statuscode)
{
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1' || $statuscode == Response::SC_CONTINUE || $statuscode == Response::SC_SWITCHING_PROTOCOLS || $statuscode == Response::SC_TEMPORARY_REDIRECT) {
header('HTTP/1.1 ' . $statuscode);
} elseif (empty($_SERVE... | php | protected function setProtocol($statuscode)
{
if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1' || $statuscode == Response::SC_CONTINUE || $statuscode == Response::SC_SWITCHING_PROTOCOLS || $statuscode == Response::SC_TEMPORARY_REDIRECT) {
header('HTTP/1.1 ' . $statuscode);
} elseif (empty($_SERVE... | [
"protected",
"function",
"setProtocol",
"(",
"$",
"statuscode",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'SERVER_PROTOCOL'",
"]",
"==",
"'HTTP/1.1'",
"||",
"$",
"statuscode",
"==",
"Response",
"::",
"SC_CONTINUE",
"||",
"$",
"statuscode",
"==",
"Response",
... | setProtocol
all response protocol decisions made here
handle the exceptions to rules for protocol 1.1 vs 1.0
default to 1.0 when protocol not specified
RFC @ http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10
@param statuscode $statuscode | [
"setProtocol",
"all",
"response",
"protocol",
"decisions",
"made",
"here",
"handle",
"the",
"exceptions",
"to",
"rules",
"for",
"protocol",
"1",
".",
"1",
"vs",
"1",
".",
"0",
"default",
"to",
"1",
".",
"0",
"when",
"protocol",
"not",
"specified",
"RFC"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/http/Response.php#L143-L152 |
200,481 | TuumPHP/Web | src/Middleware/MiddlewareTrait.php | MiddlewareTrait.push | public function push($handler)
{
if (!$handler) {
return $this;
}
if ($this->next) {
return $this->next->push($handler);
}
if (!$handler instanceof MiddlewareInterface) {
$handler = new Middleware($handler);
}
$this->next = ... | php | public function push($handler)
{
if (!$handler) {
return $this;
}
if ($this->next) {
return $this->next->push($handler);
}
if (!$handler instanceof MiddlewareInterface) {
$handler = new Middleware($handler);
}
$this->next = ... | [
"public",
"function",
"push",
"(",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"$",
"handler",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"next",
")",
"{",
"return",
"$",
"this",
"->",
"next",
"->",
"push",
"(",
"$",... | stack up the middleware.
converts normal Application into middleware.
@param ApplicationInterface $handler
@return $this | [
"stack",
"up",
"the",
"middleware",
".",
"converts",
"normal",
"Application",
"into",
"middleware",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Middleware/MiddlewareTrait.php#L31-L44 |
200,482 | kaiohken1982/NeobazaarDocumentModule | src/Document/Controller/ImageController.php | ImageController.getClassifiedImageAddForm | public function getClassifiedImageAddForm()
{
if (null === $this->classifiedImageAddForm) {
$this->classifiedImageAddForm = $this->getServiceLocator()->get('document.form.classifiedimageadd');
}
return $this->classifiedImageAddForm;
} | php | public function getClassifiedImageAddForm()
{
if (null === $this->classifiedImageAddForm) {
$this->classifiedImageAddForm = $this->getServiceLocator()->get('document.form.classifiedimageadd');
}
return $this->classifiedImageAddForm;
} | [
"public",
"function",
"getClassifiedImageAddForm",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"classifiedImageAddForm",
")",
"{",
"$",
"this",
"->",
"classifiedImageAddForm",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
... | Get useradd form
@return \Document\Form\ClassifiedImageAdd | [
"Get",
"useradd",
"form"
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Controller/ImageController.php#L109-L115 |
200,483 | netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.create | public function create(array $parameters, $className, PropertyMapper $propertyMapper)
{
list ($objectStructure, $propertyPaths) = $this->getNestedStructureForDottedNotation($parameters);
$propertyMappingConfiguration = $this->getPropertyMappingConfigurationForPropertyPaths($propertyPaths, $className);
$result =... | php | public function create(array $parameters, $className, PropertyMapper $propertyMapper)
{
list ($objectStructure, $propertyPaths) = $this->getNestedStructureForDottedNotation($parameters);
$propertyMappingConfiguration = $this->getPropertyMappingConfigurationForPropertyPaths($propertyPaths, $className);
$result =... | [
"public",
"function",
"create",
"(",
"array",
"$",
"parameters",
",",
"$",
"className",
",",
"PropertyMapper",
"$",
"propertyMapper",
")",
"{",
"list",
"(",
"$",
"objectStructure",
",",
"$",
"propertyPaths",
")",
"=",
"$",
"this",
"->",
"getNestedStructureForD... | Creates a new object based in input parameters and a class name.
This is basically a wrapper for the PropertyMapper::convert() method that
does not take a hierarchical source array but only a key=>value map of
keys being dot notation property paths.
@param array $parameters
@param string $className
@param PropertyMap... | [
"Creates",
"a",
"new",
"object",
"based",
"in",
"input",
"parameters",
"and",
"a",
"class",
"name",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L88-L98 |
200,484 | netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.getPropertyMappingConfigurationForPropertyPaths | public function getPropertyMappingConfigurationForPropertyPaths(array $propertyPaths, $className = '')
{
$propertyMappingConfiguration = new PropertyMappingConfiguration();
$propertyMappingConfiguration->allowAllProperties();
$propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class,... | php | public function getPropertyMappingConfigurationForPropertyPaths(array $propertyPaths, $className = '')
{
$propertyMappingConfiguration = new PropertyMappingConfiguration();
$propertyMappingConfiguration->allowAllProperties();
$propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class,... | [
"public",
"function",
"getPropertyMappingConfigurationForPropertyPaths",
"(",
"array",
"$",
"propertyPaths",
",",
"$",
"className",
"=",
"''",
")",
"{",
"$",
"propertyMappingConfiguration",
"=",
"new",
"PropertyMappingConfiguration",
"(",
")",
";",
"$",
"propertyMapping... | Creates a "allow all" property mapping configuration for all properties, even recursively.
@param array <string> $propertyPaths
@param string $className
@return PropertyMappingConfiguration | [
"Creates",
"a",
"allow",
"all",
"property",
"mapping",
"configuration",
"for",
"all",
"properties",
"even",
"recursively",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L107-L118 |
200,485 | netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.getNestedStructureForDottedNotation | public function getNestedStructureForDottedNotation(array $row)
{
$propertyPaths = [];
$objectStructure = [];
foreach ($row as $key => $value) {
self::applyValueProcessors($key, $value);
self::traverseObjectStructure($objectStructure, $propertyPaths, $key, $value);
}
return [$objectStructure, array_v... | php | public function getNestedStructureForDottedNotation(array $row)
{
$propertyPaths = [];
$objectStructure = [];
foreach ($row as $key => $value) {
self::applyValueProcessors($key, $value);
self::traverseObjectStructure($objectStructure, $propertyPaths, $key, $value);
}
return [$objectStructure, array_v... | [
"public",
"function",
"getNestedStructureForDottedNotation",
"(",
"array",
"$",
"row",
")",
"{",
"$",
"propertyPaths",
"=",
"[",
"]",
";",
"$",
"objectStructure",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"row",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
... | The input structure needs to be a key=>value map.
Every key should be a dot notation property path, every value the
corresponding value.
Example input in ".feature" file notation:
| foo -> json_encode() | ["bar"] |
| foo.2 | batz |
Example output in PHP code:
$result = ["foo" => [0 => "bar", 2: "bat... | [
"The",
"input",
"structure",
"needs",
"to",
"be",
"a",
"key",
"=",
">",
"value",
"map",
".",
"Every",
"key",
"should",
"be",
"a",
"dot",
"notation",
"property",
"path",
"every",
"value",
"the",
"corresponding",
"value",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L138-L149 |
200,486 | netlogix/Netlogix.BehatCommons | Classes/Netlogix/BehatCommons/ObjectFactory.php | ObjectFactory.rememberLastObjectAs | public function rememberLastObjectAs($identifier)
{
if (array_key_exists($identifier, $this->rememberedObjects)) {
throw new \Exception(sprintf('The identifier "%s" is already taken', $identifier), 1480605866);
}
if (!$this->startObjectTracking) {
throw new \Exception('Object tracking is not started, so re... | php | public function rememberLastObjectAs($identifier)
{
if (array_key_exists($identifier, $this->rememberedObjects)) {
throw new \Exception(sprintf('The identifier "%s" is already taken', $identifier), 1480605866);
}
if (!$this->startObjectTracking) {
throw new \Exception('Object tracking is not started, so re... | [
"public",
"function",
"rememberLastObjectAs",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"identifier",
",",
"$",
"this",
"->",
"rememberedObjects",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"'The i... | The most recent object created gets remembered by a specific identifier
as long as the current scenario runs.
@param string $identifier
@throws \Exception | [
"The",
"most",
"recent",
"object",
"created",
"gets",
"remembered",
"by",
"a",
"specific",
"identifier",
"as",
"long",
"as",
"the",
"current",
"scenario",
"runs",
"."
] | bdac586281fd3ebba4ca3a285df903f790feeee0 | https://github.com/netlogix/Netlogix.BehatCommons/blob/bdac586281fd3ebba4ca3a285df903f790feeee0/Classes/Netlogix/BehatCommons/ObjectFactory.php#L176-L186 |
200,487 | KDF5000/EasyThink | src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource.php | Smarty_Resource.config | public static function config(Smarty_Internal_Config $_config)
{
static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);
$config_resource = $_config->config_resource;
$smarty = $_config->smarty;
// parse resource_name
... | php | public static function config(Smarty_Internal_Config $_config)
{
static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);
$config_resource = $_config->config_resource;
$smarty = $_config->smarty;
// parse resource_name
... | [
"public",
"static",
"function",
"config",
"(",
"Smarty_Internal_Config",
"$",
"_config",
")",
"{",
"static",
"$",
"_incompatible_resources",
"=",
"array",
"(",
"'eval'",
"=>",
"true",
",",
"'string'",
"=>",
"true",
",",
"'extends'",
"=>",
"true",
",",
"'php'",... | initialize Config Source Object for given resource
@param Smarty_Internal_Config $_config config object
@return Smarty_Config_Source Source Object | [
"initialize",
"Config",
"Source",
"Object",
"for",
"given",
"resource"
] | 86efc9c8a0d504e01e2fea55868227fdc8928841 | https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_resource.php#L505-L536 |
200,488 | phpffcms/ffcms-core | src/Managers/BootManager.php | BootManager.parseComposerLoader | private function parseComposerLoader(): void
{
// get composer autoload map
$map = $this->loader->getPrefixes();
if (Any::isArray($map)) {
// get all available apps root dirs by psr loader for apps
if (array_key_exists('Apps\\', $map)) {
foreach ($map[... | php | private function parseComposerLoader(): void
{
// get composer autoload map
$map = $this->loader->getPrefixes();
if (Any::isArray($map)) {
// get all available apps root dirs by psr loader for apps
if (array_key_exists('Apps\\', $map)) {
foreach ($map[... | [
"private",
"function",
"parseComposerLoader",
"(",
")",
":",
"void",
"{",
"// get composer autoload map",
"$",
"map",
"=",
"$",
"this",
"->",
"loader",
"->",
"getPrefixes",
"(",
")",
";",
"if",
"(",
"Any",
"::",
"isArray",
"(",
"$",
"map",
")",
")",
"{",... | Find app's and widgets root directories over composer psr loader | [
"Find",
"app",
"s",
"and",
"widgets",
"root",
"directories",
"over",
"composer",
"psr",
"loader"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/BootManager.php#L63-L92 |
200,489 | phpffcms/ffcms-core | src/Managers/BootManager.php | BootManager.compileBootableClasses | public function compileBootableClasses(): void
{
// list app root's
foreach ($this->appRoots as $app) {
$app .= '/Apps/Controller/' . env_name;
$files = File::listFiles($app, ['.php'], true);
foreach ($files as $file) {
// define full class name wi... | php | public function compileBootableClasses(): void
{
// list app root's
foreach ($this->appRoots as $app) {
$app .= '/Apps/Controller/' . env_name;
$files = File::listFiles($app, ['.php'], true);
foreach ($files as $file) {
// define full class name wi... | [
"public",
"function",
"compileBootableClasses",
"(",
")",
":",
"void",
"{",
"// list app root's",
"foreach",
"(",
"$",
"this",
"->",
"appRoots",
"as",
"$",
"app",
")",
"{",
"$",
"app",
".=",
"'/Apps/Controller/'",
".",
"env_name",
";",
"$",
"files",
"=",
"... | Find all bootatble instances and set it to object map
@return void | [
"Find",
"all",
"bootatble",
"instances",
"and",
"set",
"it",
"to",
"object",
"map"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/BootManager.php#L98-L130 |
200,490 | phpffcms/ffcms-core | src/Managers/BootManager.php | BootManager.run | public function run(): bool
{
$this->startMeasure(__METHOD__);
if (!Any::isArray($this->objects)) {
return false;
}
foreach ($this->objects as $class) {
forward_static_call([$class, 'boot']);
}
$this->stopMeasure(__METHOD__);
return ... | php | public function run(): bool
{
$this->startMeasure(__METHOD__);
if (!Any::isArray($this->objects)) {
return false;
}
foreach ($this->objects as $class) {
forward_static_call([$class, 'boot']);
}
$this->stopMeasure(__METHOD__);
return ... | [
"public",
"function",
"run",
"(",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"startMeasure",
"(",
"__METHOD__",
")",
";",
"if",
"(",
"!",
"Any",
"::",
"isArray",
"(",
"$",
"this",
"->",
"objects",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach... | Call bootable methods in apps and widgets
@return bool | [
"Call",
"bootable",
"methods",
"in",
"apps",
"and",
"widgets"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/BootManager.php#L136-L150 |
200,491 | SahilDude89ss/PyntaxFramework | src/Pyntax/Html/Table/TableFactory.php | TableFactory.generateTable | public function generateTable(BeanInterface $bean, $findCondition = "", $returnString = false)
{
//Load the config
$this->loadConfig();
if((is_array($findCondition) && !isset($findCondition['limit'])) || empty($findCondition))
{
$recordLimitOnOnePage = $this->getConfigFor... | php | public function generateTable(BeanInterface $bean, $findCondition = "", $returnString = false)
{
//Load the config
$this->loadConfig();
if((is_array($findCondition) && !isset($findCondition['limit'])) || empty($findCondition))
{
$recordLimitOnOnePage = $this->getConfigFor... | [
"public",
"function",
"generateTable",
"(",
"BeanInterface",
"$",
"bean",
",",
"$",
"findCondition",
"=",
"\"\"",
",",
"$",
"returnString",
"=",
"false",
")",
"{",
"//Load the config",
"$",
"this",
"->",
"loadConfig",
"(",
")",
";",
"if",
"(",
"(",
"is_arr... | This function generates the table with the Bean and findCondition is passed.
@param BeanInterface $bean
@param string $findCondition
@param bool|false $returnString
@return string | [
"This",
"function",
"generates",
"the",
"table",
"with",
"the",
"Bean",
"and",
"findCondition",
"is",
"passed",
"."
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/Html/Table/TableFactory.php#L49-L70 |
200,492 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Area | protected function Area()
{
if (!$this->area) {
$this->area = new Area(Request::GetData('area'));
}
return $this->area;
} | php | protected function Area()
{
if (!$this->area) {
$this->area = new Area(Request::GetData('area'));
}
return $this->area;
} | [
"protected",
"function",
"Area",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"area",
")",
"{",
"$",
"this",
"->",
"area",
"=",
"new",
"Area",
"(",
"Request",
"::",
"GetData",
"(",
"'area'",
")",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | The area from request
@return Area | [
"The",
"area",
"from",
"request"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L135-L141 |
200,493 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Container | protected function Container()
{
if (!$this->container) {
$this->container = new Container(Request::GetData('container'));
}
return $this->container;
} | php | protected function Container()
{
if (!$this->container) {
$this->container = new Container(Request::GetData('container'));
}
return $this->container;
} | [
"protected",
"function",
"Container",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"new",
"Container",
"(",
"Request",
"::",
"GetData",
"(",
"'container'",
")",
")",
";",
"}",
"return",
... | The container from request
@return Container | [
"The",
"container",
"from",
"request"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L153-L159 |
200,494 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Page | protected function Page()
{
if (!$this->page) {
$this->page = new Page(Request::GetData('page'));
}
return $this->page;
} | php | protected function Page()
{
if (!$this->page) {
$this->page = new Page(Request::GetData('page'));
}
return $this->page;
} | [
"protected",
"function",
"Page",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"page",
")",
"{",
"$",
"this",
"->",
"page",
"=",
"new",
"Page",
"(",
"Request",
"::",
"GetData",
"(",
"'page'",
")",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | The page from request
@return Page | [
"The",
"page",
"from",
"request"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L171-L177 |
200,495 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.ParentItem | private function ParentItem()
{
$this->parent = $this->GetTreeItem('parent');
return $this->parent->Exists() ? $this->parent : null;
} | php | private function ParentItem()
{
$this->parent = $this->GetTreeItem('parent');
return $this->parent->Exists() ? $this->parent : null;
} | [
"private",
"function",
"ParentItem",
"(",
")",
"{",
"$",
"this",
"->",
"parent",
"=",
"$",
"this",
"->",
"GetTreeItem",
"(",
"'parent'",
")",
";",
"return",
"$",
"this",
"->",
"parent",
"->",
"Exists",
"(",
")",
"?",
"$",
"this",
"->",
"parent",
":",... | Gets the parent tree item
@return TableObject Returns either the related page or the layout content | [
"Gets",
"the",
"parent",
"tree",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L185-L189 |
200,496 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.PreviousItem | private function PreviousItem()
{
$this->previous = $this->GetTreeItem('previous');
return $this->previous->Exists() ? $this->previous : null;
} | php | private function PreviousItem()
{
$this->previous = $this->GetTreeItem('previous');
return $this->previous->Exists() ? $this->previous : null;
} | [
"private",
"function",
"PreviousItem",
"(",
")",
"{",
"$",
"this",
"->",
"previous",
"=",
"$",
"this",
"->",
"GetTreeItem",
"(",
"'previous'",
")",
";",
"return",
"$",
"this",
"->",
"previous",
"->",
"Exists",
"(",
")",
"?",
"$",
"this",
"->",
"previou... | The previous item
@return TemplateObject | [
"The",
"previous",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L219-L223 |
200,497 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.Location | protected function Location()
{
if ($this->Container()->Exists()) {
return Enums\ContentLocation::Container();
}
else if ($this->Area()->Exists()) {
if ($this->Page()->Exists()) {
return Enums\ContentLocation::Page();
}
return E... | php | protected function Location()
{
if ($this->Container()->Exists()) {
return Enums\ContentLocation::Container();
}
else if ($this->Area()->Exists()) {
if ($this->Page()->Exists()) {
return Enums\ContentLocation::Page();
}
return E... | [
"protected",
"function",
"Location",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Container",
"(",
")",
"->",
"Exists",
"(",
")",
")",
"{",
"return",
"Enums",
"\\",
"ContentLocation",
"::",
"Container",
"(",
")",
";",
"}",
"else",
"if",
"(",
"$",
... | Gets the content location
@return Enums\ContentLocation | [
"Gets",
"the",
"content",
"location"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L229-L241 |
200,498 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.InitContentRights | private function InitContentRights()
{
$beContentRights = null;
if ($this->Content()->Exists()) {
$beContentRights = $this->Content()->GetUserGroupRights();
}
$this->contentRights = new ContentRights($this->FindParentRights(), $beContentRights);
} | php | private function InitContentRights()
{
$beContentRights = null;
if ($this->Content()->Exists()) {
$beContentRights = $this->Content()->GetUserGroupRights();
}
$this->contentRights = new ContentRights($this->FindParentRights(), $beContentRights);
} | [
"private",
"function",
"InitContentRights",
"(",
")",
"{",
"$",
"beContentRights",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"Exists",
"(",
")",
")",
"{",
"$",
"beContentRights",
"=",
"$",
"this",
"->",
"Content",
"(",
... | Initialize the content rights snippet | [
"Initialize",
"the",
"content",
"rights",
"snippet"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L274-L281 |
200,499 | agentmedia/phine-core | src/Core/Logic/Module/ContentForm.php | ContentForm.FindParentRights | private function FindParentRights()
{
$parentRights = null;
$parentContent = $this->Content()->Exists() ? ContentTreeUtil::ParentOf($this->Content()) : null;
if ($parentContent) {
$parentRights = RightsFinder::FindContentRights($parentContent);
}
if (!$parentRight... | php | private function FindParentRights()
{
$parentRights = null;
$parentContent = $this->Content()->Exists() ? ContentTreeUtil::ParentOf($this->Content()) : null;
if ($parentContent) {
$parentRights = RightsFinder::FindContentRights($parentContent);
}
if (!$parentRight... | [
"private",
"function",
"FindParentRights",
"(",
")",
"{",
"$",
"parentRights",
"=",
"null",
";",
"$",
"parentContent",
"=",
"$",
"this",
"->",
"Content",
"(",
")",
"->",
"Exists",
"(",
")",
"?",
"ContentTreeUtil",
"::",
"ParentOf",
"(",
"$",
"this",
"->"... | Finds the parent rights
@return BackendContentRights | [
"Finds",
"the",
"parent",
"rights"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/ContentForm.php#L316-L342 |
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.