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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,800 | jnaxo/country-codes | src/CountryStore.php | CountryStore.administrativeAreas | public function administrativeAreas($country_id, Request $request = null)
{
$query = AdministrativeArea::where('country_id', $country_id)
->with('country');
if ($request) {
$resource = new Collection($query, 'administrative_area', $request);
return $this->respond... | php | public function administrativeAreas($country_id, Request $request = null)
{
$query = AdministrativeArea::where('country_id', $country_id)
->with('country');
if ($request) {
$resource = new Collection($query, 'administrative_area', $request);
return $this->respond... | [
"public",
"function",
"administrativeAreas",
"(",
"$",
"country_id",
",",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"AdministrativeArea",
"::",
"where",
"(",
"'country_id'",
",",
"$",
"country_id",
")",
"->",
"with",
"(",
"'country... | Get Administrative areas collection of a country given
@param int $country_id
@param Illuminate\Http\Request $request
@return mixed Jnaxo\CountryCodes\AdministrativeArea collection | [
"Get",
"Administrative",
"areas",
"collection",
"of",
"a",
"country",
"given"
] | ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9 | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/src/CountryStore.php#L132-L142 |
22,801 | jnaxo/country-codes | src/CountryStore.php | CountryStore.city | public function city($city_id, Request $request = null)
{
$city = City::find($city_id);
if ($request) {
$included = [];
$query = $city->getInlcudeResources($request->include);
if ($query) {
$collection = new Collection($query, $request->include);
... | php | public function city($city_id, Request $request = null)
{
$city = City::find($city_id);
if ($request) {
$included = [];
$query = $city->getInlcudeResources($request->include);
if ($query) {
$collection = new Collection($query, $request->include);
... | [
"public",
"function",
"city",
"(",
"$",
"city_id",
",",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"city",
"=",
"City",
"::",
"find",
"(",
"$",
"city_id",
")",
";",
"if",
"(",
"$",
"request",
")",
"{",
"$",
"included",
"=",
"[",
"]",
... | Get city item, optional include administrative division.
@param int $city_id
@param Illuminate\Http\Request $request
@return mixed Jnaxo\CountryCodes\City item | [
"Get",
"city",
"item",
"optional",
"include",
"administrative",
"division",
"."
] | ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9 | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/src/CountryStore.php#L151-L166 |
22,802 | jnaxo/country-codes | src/CountryStore.php | CountryStore.cities | public function cities($country_id, Request $request = null)
{
$query = City::with([
'administrativeArea' => function ($q) use ($country_id) {
$q->where('country_id', $country_id);
}
])
->with('administrativeArea.country');
... | php | public function cities($country_id, Request $request = null)
{
$query = City::with([
'administrativeArea' => function ($q) use ($country_id) {
$q->where('country_id', $country_id);
}
])
->with('administrativeArea.country');
... | [
"public",
"function",
"cities",
"(",
"$",
"country_id",
",",
"Request",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"City",
"::",
"with",
"(",
"[",
"'administrativeArea'",
"=>",
"function",
"(",
"$",
"q",
")",
"use",
"(",
"$",
"country_id... | Get country cities
@param int $country_id
@param Illuminate\Http\Request $request
@return mixed Jnaxo\CountryCodes\City collection | [
"Get",
"country",
"cities"
] | ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9 | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/src/CountryStore.php#L175-L189 |
22,803 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php | AreAllArgumentsValidValidator.checkArgumentInDocBlock | protected function checkArgumentInDocBlock()
{
$validator = new IsArgumentInDocBlockValidator();
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new IsArgumentInDocBlock);
} | php | protected function checkArgumentInDocBlock()
{
$validator = new IsArgumentInDocBlockValidator();
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new IsArgumentInDocBlock);
} | [
"protected",
"function",
"checkArgumentInDocBlock",
"(",
")",
"{",
"$",
"validator",
"=",
"new",
"IsArgumentInDocBlockValidator",
"(",
")",
";",
"$",
"validator",
"->",
"initialize",
"(",
"$",
"this",
"->",
"context",
")",
";",
"return",
"$",
"validator",
"->"... | Check if argument is inside docblock. | [
"Check",
"if",
"argument",
"is",
"inside",
"docblock",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php#L111-L117 |
22,804 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php | AreAllArgumentsValidValidator.checkArgumentNameMatchParam | protected function checkArgumentNameMatchParam()
{
$validator = new DoesArgumentNameMatchParamValidator;
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new DoesArgumentNameMatchParam);
} | php | protected function checkArgumentNameMatchParam()
{
$validator = new DoesArgumentNameMatchParamValidator;
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new DoesArgumentNameMatchParam);
} | [
"protected",
"function",
"checkArgumentNameMatchParam",
"(",
")",
"{",
"$",
"validator",
"=",
"new",
"DoesArgumentNameMatchParamValidator",
";",
"$",
"validator",
"->",
"initialize",
"(",
"$",
"this",
"->",
"context",
")",
";",
"return",
"$",
"validator",
"->",
... | Check if argument matches parameter. | [
"Check",
"if",
"argument",
"matches",
"parameter",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php#L122-L128 |
22,805 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php | AreAllArgumentsValidValidator.checkArgumentTypehintMatchParam | protected function checkArgumentTypehintMatchParam()
{
$validator = new DoesArgumentTypehintMatchParamValidator;
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new DoesArgumentTypehintMatchParam);
} | php | protected function checkArgumentTypehintMatchParam()
{
$validator = new DoesArgumentTypehintMatchParamValidator;
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new DoesArgumentTypehintMatchParam);
} | [
"protected",
"function",
"checkArgumentTypehintMatchParam",
"(",
")",
"{",
"$",
"validator",
"=",
"new",
"DoesArgumentTypehintMatchParamValidator",
";",
"$",
"validator",
"->",
"initialize",
"(",
"$",
"this",
"->",
"context",
")",
";",
"return",
"$",
"validator",
... | Check if argument typehint matches parameter. | [
"Check",
"if",
"argument",
"typehint",
"matches",
"parameter",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php#L133-L139 |
22,806 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php | AreAllArgumentsValidValidator.checkParamsExists | protected function checkParamsExists()
{
$validator = new DoesParamsExistsValidator();
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new DoesParamsExists);
} | php | protected function checkParamsExists()
{
$validator = new DoesParamsExistsValidator();
$validator->initialize($this->context);
return $validator->validate($this->validationValue, new DoesParamsExists);
} | [
"protected",
"function",
"checkParamsExists",
"(",
")",
"{",
"$",
"validator",
"=",
"new",
"DoesParamsExistsValidator",
"(",
")",
";",
"$",
"validator",
"->",
"initialize",
"(",
"$",
"this",
"->",
"context",
")",
";",
"return",
"$",
"validator",
"->",
"valid... | Check if parameter exists for argument.
@param Collection $params
@param Collection $arguments | [
"Check",
"if",
"parameter",
"exists",
"for",
"argument",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Descriptor/Validator/Constraints/Functions/AreAllArgumentsValidValidator.php#L147-L153 |
22,807 | inhere/php-librarys | src/Components/EnvDetector.php | EnvDetector.getEnvNameByHost | public static function getEnvNameByHost(string $defaultEnv = null, string $hostname = null): string
{
$hostname = $hostname ?: gethostname();
if (!$hostname) {
return $defaultEnv;
}
foreach (self::$host2env as $kw => $env) {
if (false !== strpos($hostname, $... | php | public static function getEnvNameByHost(string $defaultEnv = null, string $hostname = null): string
{
$hostname = $hostname ?: gethostname();
if (!$hostname) {
return $defaultEnv;
}
foreach (self::$host2env as $kw => $env) {
if (false !== strpos($hostname, $... | [
"public",
"static",
"function",
"getEnvNameByHost",
"(",
"string",
"$",
"defaultEnv",
"=",
"null",
",",
"string",
"$",
"hostname",
"=",
"null",
")",
":",
"string",
"{",
"$",
"hostname",
"=",
"$",
"hostname",
"?",
":",
"gethostname",
"(",
")",
";",
"if",
... | get Env Name By Host
@param null|string $hostname
@param string $defaultEnv
@return string | [
"get",
"Env",
"Name",
"By",
"Host"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/EnvDetector.php#L49-L64 |
22,808 | inhere/php-librarys | src/Components/EnvDetector.php | EnvDetector.getEnvNameByDomain | public static function getEnvNameByDomain(string $defaultEnv = null, string $domain = null): string
{
$domain = $domain ?: PhpHelper::serverParam('HTTP_HOST');
if (!$domain) {
return $defaultEnv;
}
foreach (self::$domain2env as $kw => $env) {
if (false !== s... | php | public static function getEnvNameByDomain(string $defaultEnv = null, string $domain = null): string
{
$domain = $domain ?: PhpHelper::serverParam('HTTP_HOST');
if (!$domain) {
return $defaultEnv;
}
foreach (self::$domain2env as $kw => $env) {
if (false !== s... | [
"public",
"static",
"function",
"getEnvNameByDomain",
"(",
"string",
"$",
"defaultEnv",
"=",
"null",
",",
"string",
"$",
"domain",
"=",
"null",
")",
":",
"string",
"{",
"$",
"domain",
"=",
"$",
"domain",
"?",
":",
"PhpHelper",
"::",
"serverParam",
"(",
"... | get Env Name By Domain
@param string $defaultEnv
@param null|string $domain
@return string | [
"get",
"Env",
"Name",
"By",
"Domain"
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Components/EnvDetector.php#L72-L87 |
22,809 | antaresproject/notifications | src/Processor/SidebarProcessor.php | SidebarProcessor.delete | public function delete()
{
try {
if (is_null($id = Input::get('id'))) {
throw new Exception('Invalid notification id provided');
}
$this->stack->deleteById($id);
} catch (Exception $ex) {
Log::alert($ex);
return new JsonResp... | php | public function delete()
{
try {
if (is_null($id = Input::get('id'))) {
throw new Exception('Invalid notification id provided');
}
$this->stack->deleteById($id);
} catch (Exception $ex) {
Log::alert($ex);
return new JsonResp... | [
"public",
"function",
"delete",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"is_null",
"(",
"$",
"id",
"=",
"Input",
"::",
"get",
"(",
"'id'",
")",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Invalid notification id provided'",
")",
";",
"}",
"$",
"... | Deletes item from sidebar
@return JsonResponse | [
"Deletes",
"item",
"from",
"sidebar"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/SidebarProcessor.php#L65-L76 |
22,810 | antaresproject/notifications | src/Processor/SidebarProcessor.php | SidebarProcessor.read | public function read()
{
try {
$this->stack->markAsRead(from_route('type', 'notifications'));
return new JsonResponse('', 200);
} catch (Exception $ex) {
Log::alert($ex);
return new JsonResponse(['message' => trans('antares/notifications::messages.side... | php | public function read()
{
try {
$this->stack->markAsRead(from_route('type', 'notifications'));
return new JsonResponse('', 200);
} catch (Exception $ex) {
Log::alert($ex);
return new JsonResponse(['message' => trans('antares/notifications::messages.side... | [
"public",
"function",
"read",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"stack",
"->",
"markAsRead",
"(",
"from_route",
"(",
"'type'",
",",
"'notifications'",
")",
")",
";",
"return",
"new",
"JsonResponse",
"(",
"''",
",",
"200",
")",
";",
"}",
"... | Marks notification item as read
@return JsonResponse | [
"Marks",
"notification",
"item",
"as",
"read"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/SidebarProcessor.php#L83-L92 |
22,811 | Danzabar/config-builder | src/Files/ConfigFile.php | ConfigFile.init | public function init($file)
{
try {
$this->load($file);
} catch (Exceptions\FileNotExists $e) {
$this->create($file);
}
} | php | public function init($file)
{
try {
$this->load($file);
} catch (Exceptions\FileNotExists $e) {
$this->create($file);
}
} | [
"public",
"function",
"init",
"(",
"$",
"file",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"load",
"(",
"$",
"file",
")",
";",
"}",
"catch",
"(",
"Exceptions",
"\\",
"FileNotExists",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"create",
"(",
"$",
"file"... | Attempts loading a file, if its not there, it create its.
@param String $file
@return ConfigFile
@author Dan Cox | [
"Attempts",
"loading",
"a",
"file",
"if",
"its",
"not",
"there",
"it",
"create",
"its",
"."
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/ConfigFile.php#L96-L106 |
22,812 | Danzabar/config-builder | src/Files/ConfigFile.php | ConfigFile.load | public function load($file)
{
if(!$this->fs->exists($file))
{
throw new Exceptions\FileNotExists($file);
}
$this->file = $file;
$this->info->load($file);
$this->extension = $this->info->extension;
$this->directory = $this->info->directory;
$this->filename = $this->info->filename;
$this->extracte... | php | public function load($file)
{
if(!$this->fs->exists($file))
{
throw new Exceptions\FileNotExists($file);
}
$this->file = $file;
$this->info->load($file);
$this->extension = $this->info->extension;
$this->directory = $this->info->directory;
$this->filename = $this->info->filename;
$this->extracte... | [
"public",
"function",
"load",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fs",
"->",
"exists",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"FileNotExists",
"(",
"$",
"file",
")",
";",
"}",
"$",
"this",... | Loads the file and its details
@param String $file
@return ConfigFile
@author Dan Cox
@throws Exceptions\FileNotExists | [
"Loads",
"the",
"file",
"and",
"its",
"details"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/ConfigFile.php#L131-L148 |
22,813 | Danzabar/config-builder | src/Files/ConfigFile.php | ConfigFile.saveAs | public function saveAs($extension = NULL)
{
$extension = (!is_null($extension) ? $extension : $this->extension);
$converter = $this->extracter->converter();
$converter->setExtension($extension);
$data = $converter->toNative($this->params);
// We need to rename the file's extension
$this->rename(NULL, $e... | php | public function saveAs($extension = NULL)
{
$extension = (!is_null($extension) ? $extension : $this->extension);
$converter = $this->extracter->converter();
$converter->setExtension($extension);
$data = $converter->toNative($this->params);
// We need to rename the file's extension
$this->rename(NULL, $e... | [
"public",
"function",
"saveAs",
"(",
"$",
"extension",
"=",
"NULL",
")",
"{",
"$",
"extension",
"=",
"(",
"!",
"is_null",
"(",
"$",
"extension",
")",
"?",
"$",
"extension",
":",
"$",
"this",
"->",
"extension",
")",
";",
"$",
"converter",
"=",
"$",
... | Save as a different extension
@param String $extension
@return void
@author Dan Cox | [
"Save",
"as",
"a",
"different",
"extension"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/ConfigFile.php#L168-L180 |
22,814 | Danzabar/config-builder | src/Files/ConfigFile.php | ConfigFile.rename | public function rename($file = NULL, $extension = NULL)
{
$target = (!is_null($file) ? $this->filename : $this->extension);
$replacement = (!is_null($file) ? $file .'.'. $this->extension : $extension);
$this->file = str_replace($target, $replacement, $this->file);
} | php | public function rename($file = NULL, $extension = NULL)
{
$target = (!is_null($file) ? $this->filename : $this->extension);
$replacement = (!is_null($file) ? $file .'.'. $this->extension : $extension);
$this->file = str_replace($target, $replacement, $this->file);
} | [
"public",
"function",
"rename",
"(",
"$",
"file",
"=",
"NULL",
",",
"$",
"extension",
"=",
"NULL",
")",
"{",
"$",
"target",
"=",
"(",
"!",
"is_null",
"(",
"$",
"file",
")",
"?",
"$",
"this",
"->",
"filename",
":",
"$",
"this",
"->",
"extension",
... | Renames a file or changes files extension
@param String $file
@param String $extension
@return void
@author Dan Cox | [
"Renames",
"a",
"file",
"or",
"changes",
"files",
"extension"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/ConfigFile.php#L190-L196 |
22,815 | Danzabar/config-builder | src/Files/ConfigFile.php | ConfigFile.save | public function save()
{
$converter = $this->extracter->converter();
$data = $converter->toNative($this->params);
$this->fs->dumpFile($this->file, $data);
} | php | public function save()
{
$converter = $this->extracter->converter();
$data = $converter->toNative($this->params);
$this->fs->dumpFile($this->file, $data);
} | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"converter",
"=",
"$",
"this",
"->",
"extracter",
"->",
"converter",
"(",
")",
";",
"$",
"data",
"=",
"$",
"converter",
"->",
"toNative",
"(",
"$",
"this",
"->",
"params",
")",
";",
"$",
"this",
"->... | Saves the current params to the file
@return void
@author Dan Cox | [
"Saves",
"the",
"current",
"params",
"to",
"the",
"file"
] | 3b237be578172c32498bbcdfb360e69a6243739d | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Files/ConfigFile.php#L204-L210 |
22,816 | hametuha/wpametu | src/WPametu/API/Rest/RestTemplate.php | RestTemplate.wp_title | public function wp_title($title, $sep, $location){
if( !empty($this->title) ){
$array = [$this->title];
$sep = ' '.trim($sep).' ';
if( 'right' == $location ){
$array[] = $sep;
}else{
array_unshift($array, $sep);
}
... | php | public function wp_title($title, $sep, $location){
if( !empty($this->title) ){
$array = [$this->title];
$sep = ' '.trim($sep).' ';
if( 'right' == $location ){
$array[] = $sep;
}else{
array_unshift($array, $sep);
}
... | [
"public",
"function",
"wp_title",
"(",
"$",
"title",
",",
"$",
"sep",
",",
"$",
"location",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"title",
")",
")",
"{",
"$",
"array",
"=",
"[",
"$",
"this",
"->",
"title",
"]",
";",
"$",
... | Filter wp title
@param string $title
@param string $sep
@param string $location
@return string | [
"Filter",
"wp",
"title"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Rest/RestTemplate.php#L85-L97 |
22,817 | dstuecken/notify | src/NotificationCenter.php | NotificationCenter.notify | public function notify(NotificationInterface $notification, $level = self::INFO)
{
if (!$this->handlers)
{
$this->addHandler(new NullHandler());
}
foreach ($this->getHandlers() as $handler)
{
if ($handler->shouldHandle($notification, $level))
... | php | public function notify(NotificationInterface $notification, $level = self::INFO)
{
if (!$this->handlers)
{
$this->addHandler(new NullHandler());
}
foreach ($this->getHandlers() as $handler)
{
if ($handler->shouldHandle($notification, $level))
... | [
"public",
"function",
"notify",
"(",
"NotificationInterface",
"$",
"notification",
",",
"$",
"level",
"=",
"self",
"::",
"INFO",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"handlers",
")",
"{",
"$",
"this",
"->",
"addHandler",
"(",
"new",
"NullHandler"... | Handles notification for every handler
@param NotificationInterface $notification the notification instanceitself
@param int $level Level of this notification
@return bool | [
"Handles",
"notification",
"for",
"every",
"handler"
] | abccf0a6a272caf66baea74323f18e2212c6e11e | https://github.com/dstuecken/notify/blob/abccf0a6a272caf66baea74323f18e2212c6e11e/src/NotificationCenter.php#L157-L176 |
22,818 | dstuecken/notify | src/NotificationCenter.php | NotificationCenter.log | public function log($level, $message, array $context = [])
{
return $this->notify(
new DetailedNotification($message, '', $context),
$level
);
} | php | public function log($level, $message, array $context = [])
{
return $this->notify(
new DetailedNotification($message, '', $context),
$level
);
} | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"notify",
"(",
"new",
"DetailedNotification",
"(",
"$",
"message",
",",
"''",
",",
"$",
"context"... | Adds a new notification message to the queue as an attribute aware notification
@param mixed $level The log level
@param string $message notification message (body)
@param array $context notification parameters
@return bool record processed or not? | [
"Adds",
"a",
"new",
"notification",
"message",
"to",
"the",
"queue",
"as",
"an",
"attribute",
"aware",
"notification"
] | abccf0a6a272caf66baea74323f18e2212c6e11e | https://github.com/dstuecken/notify/blob/abccf0a6a272caf66baea74323f18e2212c6e11e/src/NotificationCenter.php#L187-L193 |
22,819 | ekuiter/feature-php | FeaturePhp/Generator/RuntimeGenerator.php | RuntimeGenerator._generateFiles | protected function _generateFiles() {
if ($this->feature && !$this->isSelectedFeature($this->feature)) {
$this->logFile->log(null, "did not add runtime information because \"$this->feature\" is not selected");
return;
}
$this->files[] = fphp\File\TemplateFile::fr... | php | protected function _generateFiles() {
if ($this->feature && !$this->isSelectedFeature($this->feature)) {
$this->logFile->log(null, "did not add runtime information because \"$this->feature\" is not selected");
return;
}
$this->files[] = fphp\File\TemplateFile::fr... | [
"protected",
"function",
"_generateFiles",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"feature",
"&&",
"!",
"$",
"this",
"->",
"isSelectedFeature",
"(",
"$",
"this",
"->",
"feature",
")",
")",
"{",
"$",
"this",
"->",
"logFile",
"->",
"log",
"(",
"n... | Generates the runtime file.
Internally, this uses a template file and assigns the given variables.
You can override this to add runtime information for other languages.
If a feature was supplied, only generates if that feature is selected. | [
"Generates",
"the",
"runtime",
"file",
".",
"Internally",
"this",
"uses",
"a",
"template",
"file",
"and",
"assigns",
"the",
"given",
"variables",
".",
"You",
"can",
"override",
"this",
"to",
"add",
"runtime",
"information",
"for",
"other",
"languages",
".",
... | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/RuntimeGenerator.php#L87-L106 |
22,820 | ekuiter/feature-php | FeaturePhp/Generator/RuntimeGenerator.php | RuntimeGenerator.traceRuntimeCalls | public function traceRuntimeCalls($files, $productLine) {
$runtimeCalls = array();
foreach ($files as $file) {
$content = $file->getContent();
if ($content instanceof fphp\File\StoredFileContent) {
$fileSource = $content->getFileSource();
... | php | public function traceRuntimeCalls($files, $productLine) {
$runtimeCalls = array();
foreach ($files as $file) {
$content = $file->getContent();
if ($content instanceof fphp\File\StoredFileContent) {
$fileSource = $content->getFileSource();
... | [
"public",
"function",
"traceRuntimeCalls",
"(",
"$",
"files",
",",
"$",
"productLine",
")",
"{",
"$",
"runtimeCalls",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"$",
"content",
"=",
"$",
"file",
"->",
"get... | Returns tracing links for all calls of the runtime class.
@param \FeaturePhp\File\File[] $files
@param \FeaturePhp\ProductLine\ProductLine $productLine
@return \FeaturePhp\Artifact\TracingLink[] | [
"Returns",
"tracing",
"links",
"for",
"all",
"calls",
"of",
"the",
"runtime",
"class",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/RuntimeGenerator.php#L114-L144 |
22,821 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Model/Layout.php | Aoe_Layout_Model_Layout.generateXml | public function generateXml()
{
$xml = $this->getUpdate()->asSimplexml();
$removeInstructions = $xml->xpath("//remove");
if (is_array($removeInstructions)) {
foreach ($removeInstructions as $infoNode) {
/** @var Mage_Core_Model_Layout_Element $infoNode */
... | php | public function generateXml()
{
$xml = $this->getUpdate()->asSimplexml();
$removeInstructions = $xml->xpath("//remove");
if (is_array($removeInstructions)) {
foreach ($removeInstructions as $infoNode) {
/** @var Mage_Core_Model_Layout_Element $infoNode */
... | [
"public",
"function",
"generateXml",
"(",
")",
"{",
"$",
"xml",
"=",
"$",
"this",
"->",
"getUpdate",
"(",
")",
"->",
"asSimplexml",
"(",
")",
";",
"$",
"removeInstructions",
"=",
"$",
"xml",
"->",
"xpath",
"(",
"\"//remove\"",
")",
";",
"if",
"(",
"i... | Layout XML generation
@return Aoe_Layout_Model_Layout | [
"Layout",
"XML",
"generation"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Model/Layout.php#L14-L38 |
22,822 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Model/Layout.php | Aoe_Layout_Model_Layout.generateBlocks | public function generateBlocks($parent = null)
{
if ($parent instanceof Mage_Core_Model_Layout_Element) {
// This prevents processing child blocks if the parent block fails a conditional check
if (!$this->checkConditionals($parent)) {
return;
}
... | php | public function generateBlocks($parent = null)
{
if ($parent instanceof Mage_Core_Model_Layout_Element) {
// This prevents processing child blocks if the parent block fails a conditional check
if (!$this->checkConditionals($parent)) {
return;
}
... | [
"public",
"function",
"generateBlocks",
"(",
"$",
"parent",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"parent",
"instanceof",
"Mage_Core_Model_Layout_Element",
")",
"{",
"// This prevents processing child blocks if the parent block fails a conditional check",
"if",
"(",
"!",
... | Create layout blocks hierarchy from layout xml configuration
@param Mage_Core_Model_Layout_Element|null $parent | [
"Create",
"layout",
"blocks",
"hierarchy",
"from",
"layout",
"xml",
"configuration"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Model/Layout.php#L45-L58 |
22,823 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Model/Layout.php | Aoe_Layout_Model_Layout._generateBlock | protected function _generateBlock($node, $parent)
{
if ($node instanceof Mage_Core_Model_Layout_Element) {
if (!$this->checkConditionals($node)) {
return $this;
}
}
return parent::_generateBlock($node, $parent);
} | php | protected function _generateBlock($node, $parent)
{
if ($node instanceof Mage_Core_Model_Layout_Element) {
if (!$this->checkConditionals($node)) {
return $this;
}
}
return parent::_generateBlock($node, $parent);
} | [
"protected",
"function",
"_generateBlock",
"(",
"$",
"node",
",",
"$",
"parent",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"Mage_Core_Model_Layout_Element",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"checkConditionals",
"(",
"$",
"node",
")",
")",... | Add block object to layout based on xml node data
@param Varien_Simplexml_Element $node
@param Varien_Simplexml_Element $parent
@return Aoe_Layout_Model_Layout | [
"Add",
"block",
"object",
"to",
"layout",
"based",
"on",
"xml",
"node",
"data"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Model/Layout.php#L68-L77 |
22,824 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Model/Layout.php | Aoe_Layout_Model_Layout._generateAction | protected function _generateAction($node, $parent)
{
if ($node instanceof Mage_Core_Model_Layout_Element) {
if (!$this->checkConditionals($node)) {
return $this;
}
}
$method = (string)$node['method'];
if (!empty($node['block'])) {
... | php | protected function _generateAction($node, $parent)
{
if ($node instanceof Mage_Core_Model_Layout_Element) {
if (!$this->checkConditionals($node)) {
return $this;
}
}
$method = (string)$node['method'];
if (!empty($node['block'])) {
... | [
"protected",
"function",
"_generateAction",
"(",
"$",
"node",
",",
"$",
"parent",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"Mage_Core_Model_Layout_Element",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"checkConditionals",
"(",
"$",
"node",
")",
")"... | Convert an action node into a method call on the parent block
@param Varien_Simplexml_Element $node
@param Varien_Simplexml_Element $parent
@return Aoe_Layout_Model_Layout | [
"Convert",
"an",
"action",
"node",
"into",
"a",
"method",
"call",
"on",
"the",
"parent",
"block"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Model/Layout.php#L87-L123 |
22,825 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Model/Layout.php | Aoe_Layout_Model_Layout.getHelperMethodValue | protected function getHelperMethodValue($helperMethodString, $args = null)
{
$helperName = explode('/', (string)$helperMethodString);
$helperMethod = array_pop($helperName);
$helperName = implode('/', $helperName);
$helperArgs = [];
if (!is_array($args)) {
$helpe... | php | protected function getHelperMethodValue($helperMethodString, $args = null)
{
$helperName = explode('/', (string)$helperMethodString);
$helperMethod = array_pop($helperName);
$helperName = implode('/', $helperName);
$helperArgs = [];
if (!is_array($args)) {
$helpe... | [
"protected",
"function",
"getHelperMethodValue",
"(",
"$",
"helperMethodString",
",",
"$",
"args",
"=",
"null",
")",
"{",
"$",
"helperName",
"=",
"explode",
"(",
"'/'",
",",
"(",
"string",
")",
"$",
"helperMethodString",
")",
";",
"$",
"helperMethod",
"=",
... | Gets the value of a helper method from the helper method string
@param $helperMethodString
@param array|string $args
@return mixed | [
"Gets",
"the",
"value",
"of",
"a",
"helper",
"method",
"from",
"the",
"helper",
"method",
"string"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Model/Layout.php#L188-L202 |
22,826 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Model/Layout.php | Aoe_Layout_Model_Layout.processOutputAttribute | protected function processOutputAttribute(Mage_Core_Model_Layout_Element $node)
{
if (isset($node['output'])) {
$blockName = (string)$node['name'];
if (empty($blockName)) {
return;
}
$method = trim((string)$node['output']);
if (empt... | php | protected function processOutputAttribute(Mage_Core_Model_Layout_Element $node)
{
if (isset($node['output'])) {
$blockName = (string)$node['name'];
if (empty($blockName)) {
return;
}
$method = trim((string)$node['output']);
if (empt... | [
"protected",
"function",
"processOutputAttribute",
"(",
"Mage_Core_Model_Layout_Element",
"$",
"node",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"node",
"[",
"'output'",
"]",
")",
")",
"{",
"$",
"blockName",
"=",
"(",
"string",
")",
"$",
"node",
"[",
"'name'... | Process the 'output' attribute of a node
This is an extension that allows the output attribute to be specified on reference elements.
It also adds the ability to disable output of the node by setting the value to an empty string.
@param Mage_Core_Model_Layout_Element $node | [
"Process",
"the",
"output",
"attribute",
"of",
"a",
"node"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Model/Layout.php#L212-L226 |
22,827 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Model/Layout.php | Aoe_Layout_Model_Layout.checkConditionals | protected function checkConditionals(Mage_Core_Model_Layout_Element $node, $aclDefault = true)
{
return $this->checkConfigConditional($node)
&& ($aclDefault ? $this->checkAclConditional($node, $aclDefault) : !$this->checkAclConditional($node, $aclDefault))
&& $this->checkHelper... | php | protected function checkConditionals(Mage_Core_Model_Layout_Element $node, $aclDefault = true)
{
return $this->checkConfigConditional($node)
&& ($aclDefault ? $this->checkAclConditional($node, $aclDefault) : !$this->checkAclConditional($node, $aclDefault))
&& $this->checkHelper... | [
"protected",
"function",
"checkConditionals",
"(",
"Mage_Core_Model_Layout_Element",
"$",
"node",
",",
"$",
"aclDefault",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"checkConfigConditional",
"(",
"$",
"node",
")",
"&&",
"(",
"$",
"aclDefault",
"?",
"$... | Checks all conditionals for a given layout node
@param Mage_Core_Model_Layout_Element $node
@param bool $aclDefault
@return bool | [
"Checks",
"all",
"conditionals",
"for",
"a",
"given",
"layout",
"node"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Model/Layout.php#L236-L241 |
22,828 | phpnfe/tools | src/XML.php | XML.getDup | public function getDup($contador)
{
$dup = $this->getElementsByTagName('dup')->item($contador);
return self::createByXml($dup->C14N());
} | php | public function getDup($contador)
{
$dup = $this->getElementsByTagName('dup')->item($contador);
return self::createByXml($dup->C14N());
} | [
"public",
"function",
"getDup",
"(",
"$",
"contador",
")",
"{",
"$",
"dup",
"=",
"$",
"this",
"->",
"getElementsByTagName",
"(",
"'dup'",
")",
"->",
"item",
"(",
"$",
"contador",
")",
";",
"return",
"self",
"::",
"createByXml",
"(",
"$",
"dup",
"->",
... | Pega a propriedade do Dup.
@param $contador
@return XMLGet
@deprecated | [
"Pega",
"a",
"propriedade",
"do",
"Dup",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/XML.php#L77-L82 |
22,829 | netvlies/NetvliesFormBundle | EventListener/SuccessListener.php | SuccessListener.onFormSuccess | public function onFormSuccess(FormEvent $event)
{
$form = $event->getForm();
$result = $this->createResult($form);
if ($form->getStoreResults()) {
$this->storeResult($form, $result);
}
if ($form->getSendMail()) {
$this->sendMail($form, $result);
... | php | public function onFormSuccess(FormEvent $event)
{
$form = $event->getForm();
$result = $this->createResult($form);
if ($form->getStoreResults()) {
$this->storeResult($form, $result);
}
if ($form->getSendMail()) {
$this->sendMail($form, $result);
... | [
"public",
"function",
"onFormSuccess",
"(",
"FormEvent",
"$",
"event",
")",
"{",
"$",
"form",
"=",
"$",
"event",
"->",
"getForm",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"createResult",
"(",
"$",
"form",
")",
";",
"if",
"(",
"$",
"for... | Default handling for the form success event. This includes storage of
the result, sending a confirmation mail and redirecting to the success
URL, while respecting the form settings.
@param FormEvent $event | [
"Default",
"handling",
"for",
"the",
"form",
"success",
"event",
".",
"This",
"includes",
"storage",
"of",
"the",
"result",
"sending",
"a",
"confirmation",
"mail",
"and",
"redirecting",
"to",
"the",
"success",
"URL",
"while",
"respecting",
"the",
"form",
"sett... | 93f9a3321d9925040111374e7c1014a6400a2d08 | https://github.com/netvlies/NetvliesFormBundle/blob/93f9a3321d9925040111374e7c1014a6400a2d08/EventListener/SuccessListener.php#L30-L50 |
22,830 | netvlies/NetvliesFormBundle | EventListener/SuccessListener.php | SuccessListener.createResult | public function createResult(Form $form)
{
$result = new Result();
$result->setDatetimeAdded(new \DateTime());
$viewData = $form->getSf2Form()->getViewData();
foreach ($form->getFields() as $field) {
$entry = new Entry();
$entry->setField($field);
... | php | public function createResult(Form $form)
{
$result = new Result();
$result->setDatetimeAdded(new \DateTime());
$viewData = $form->getSf2Form()->getViewData();
foreach ($form->getFields() as $field) {
$entry = new Entry();
$entry->setField($field);
... | [
"public",
"function",
"createResult",
"(",
"Form",
"$",
"form",
")",
"{",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"result",
"->",
"setDatetimeAdded",
"(",
"new",
"\\",
"DateTime",
"(",
")",
")",
";",
"$",
"viewData",
"=",
"$",
"form"... | Creates the result object from the user's input.
@param $form
@return Result | [
"Creates",
"the",
"result",
"object",
"from",
"the",
"user",
"s",
"input",
"."
] | 93f9a3321d9925040111374e7c1014a6400a2d08 | https://github.com/netvlies/NetvliesFormBundle/blob/93f9a3321d9925040111374e7c1014a6400a2d08/EventListener/SuccessListener.php#L59-L74 |
22,831 | netvlies/NetvliesFormBundle | EventListener/SuccessListener.php | SuccessListener.storeResult | public function storeResult(Form $form, Result $result)
{
$entityManager = $this->container->get('doctrine')->getManager();
$form->addResult($result);
$entityManager->persist($form);
$entityManager->flush();
} | php | public function storeResult(Form $form, Result $result)
{
$entityManager = $this->container->get('doctrine')->getManager();
$form->addResult($result);
$entityManager->persist($form);
$entityManager->flush();
} | [
"public",
"function",
"storeResult",
"(",
"Form",
"$",
"form",
",",
"Result",
"$",
"result",
")",
"{",
"$",
"entityManager",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'doctrine'",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"form",
"->",... | Stores the user input as a result object.
@param $form
@param $result | [
"Stores",
"the",
"user",
"input",
"as",
"a",
"result",
"object",
"."
] | 93f9a3321d9925040111374e7c1014a6400a2d08 | https://github.com/netvlies/NetvliesFormBundle/blob/93f9a3321d9925040111374e7c1014a6400a2d08/EventListener/SuccessListener.php#L82-L88 |
22,832 | netvlies/NetvliesFormBundle | EventListener/SuccessListener.php | SuccessListener.sendMail | public function sendMail(Form $form, Result $result)
{
$message = \Swift_Message::newInstance()
->setSubject($form->getMailSubject())
->setTo(array($form->getMailRecipientEmail() => $form->getMailRecipientName()))
->setBody($this->container->get('templating')->render('Net... | php | public function sendMail(Form $form, Result $result)
{
$message = \Swift_Message::newInstance()
->setSubject($form->getMailSubject())
->setTo(array($form->getMailRecipientEmail() => $form->getMailRecipientName()))
->setBody($this->container->get('templating')->render('Net... | [
"public",
"function",
"sendMail",
"(",
"Form",
"$",
"form",
",",
"Result",
"$",
"result",
")",
"{",
"$",
"message",
"=",
"\\",
"Swift_Message",
"::",
"newInstance",
"(",
")",
"->",
"setSubject",
"(",
"$",
"form",
"->",
"getMailSubject",
"(",
")",
")",
... | Sends a mail containing the form values to the contact e-mail address
specified.
@param Form $form
@param Result $result | [
"Sends",
"a",
"mail",
"containing",
"the",
"form",
"values",
"to",
"the",
"contact",
"e",
"-",
"mail",
"address",
"specified",
"."
] | 93f9a3321d9925040111374e7c1014a6400a2d08 | https://github.com/netvlies/NetvliesFormBundle/blob/93f9a3321d9925040111374e7c1014a6400a2d08/EventListener/SuccessListener.php#L97-L124 |
22,833 | SporkCode/Spork | src/Log/ServiceFactory.php | ServiceFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$appConfig = $serviceLocator->get('config');
$config = array_key_exists('log', $appConfig) ? $appConfig['log'] : array();
$class = array_key_exists('class', $config) ? $config['class'] : 'Zend\Log\Logger';
$logg... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$appConfig = $serviceLocator->get('config');
$config = array_key_exists('log', $appConfig) ? $appConfig['log'] : array();
$class = array_key_exists('class', $config) ? $config['class'] : 'Zend\Log\Logger';
$logg... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"appConfig",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'config'",
")",
";",
"$",
"config",
"=",
"array_key_exists",
"(",
"'log'",
",",
"$",
"appCo... | Creates a Logger service
@see \Zend\ServiceManager\FactoryInterface::createService()
@param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
@return \Zend\Log\LoggerInterface | [
"Creates",
"a",
"Logger",
"service"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Log/ServiceFactory.php#L34-L41 |
22,834 | opsbears/piccolo | src/Module/ModuleLoader.php | ModuleLoader.processModules | private function processModules(DependencyInjectionContainer $dic, array $modules, array &$config) {
/** @noinspection PhpInternalEntityUsedInspection */
$dependencyGraph = new ModuleDependencyGraph();
$dependencyGraph->addModules($modules);
$modules = $dependencyGraph->getSortedModuleList();
foreach ($modul... | php | private function processModules(DependencyInjectionContainer $dic, array $modules, array &$config) {
/** @noinspection PhpInternalEntityUsedInspection */
$dependencyGraph = new ModuleDependencyGraph();
$dependencyGraph->addModules($modules);
$modules = $dependencyGraph->getSortedModuleList();
foreach ($modul... | [
"private",
"function",
"processModules",
"(",
"DependencyInjectionContainer",
"$",
"dic",
",",
"array",
"$",
"modules",
",",
"array",
"&",
"$",
"config",
")",
"{",
"/** @noinspection PhpInternalEntityUsedInspection */",
"$",
"dependencyGraph",
"=",
"new",
"ModuleDepende... | Process modules after initial loading.
@param DependencyInjectionContainer $dic
@param array $modules
@param array $config | [
"Process",
"modules",
"after",
"initial",
"loading",
"."
] | ebba9f892ed35965140265ba1c61b2c645eab6e0 | https://github.com/opsbears/piccolo/blob/ebba9f892ed35965140265ba1c61b2c645eab6e0/src/Module/ModuleLoader.php#L49-L62 |
22,835 | opsbears/piccolo | src/Module/ModuleLoader.php | ModuleLoader.loadModule | private function loadModule(
$moduleClass,
array &$modules,
array $moduleList,
DependencyInjectionContainer $dic) {
/**
* @var Module $module
*/
$module = $dic->make($moduleClass);
if (!$module instanceof Module) {
throw new ConfigurationException(get_class($module) .
' was configured as a m... | php | private function loadModule(
$moduleClass,
array &$modules,
array $moduleList,
DependencyInjectionContainer $dic) {
/**
* @var Module $module
*/
$module = $dic->make($moduleClass);
if (!$module instanceof Module) {
throw new ConfigurationException(get_class($module) .
' was configured as a m... | [
"private",
"function",
"loadModule",
"(",
"$",
"moduleClass",
",",
"array",
"&",
"$",
"modules",
",",
"array",
"$",
"moduleList",
",",
"DependencyInjectionContainer",
"$",
"dic",
")",
"{",
"/**\n\t\t * @var Module $module\n\t\t */",
"$",
"module",
"=",
"$",
"dic",... | Load a module by class name.
@param string $moduleClass The module class to load.
@param Module[] $modules The list of already loaded modules.
@param array $moduleList The complete module list.
@param DependencyInjectionContainer $dic The de... | [
"Load",
"a",
"module",
"by",
"class",
"name",
"."
] | ebba9f892ed35965140265ba1c61b2c645eab6e0 | https://github.com/opsbears/piccolo/blob/ebba9f892ed35965140265ba1c61b2c645eab6e0/src/Module/ModuleLoader.php#L76-L98 |
22,836 | opsbears/piccolo | src/Module/ModuleLoader.php | ModuleLoader.loadRequiredModules | private function loadRequiredModules(
Module $module,
&$modules,
array $moduleList,
DependencyInjectionContainer $dic) {
foreach ($module->getRequiredModules() as $requiredModule) {
if (!\in_array($requiredModule, $moduleList)) {
$this->loadModule($requiredModule, $modules, $moduleList, $dic);
if (... | php | private function loadRequiredModules(
Module $module,
&$modules,
array $moduleList,
DependencyInjectionContainer $dic) {
foreach ($module->getRequiredModules() as $requiredModule) {
if (!\in_array($requiredModule, $moduleList)) {
$this->loadModule($requiredModule, $modules, $moduleList, $dic);
if (... | [
"private",
"function",
"loadRequiredModules",
"(",
"Module",
"$",
"module",
",",
"&",
"$",
"modules",
",",
"array",
"$",
"moduleList",
",",
"DependencyInjectionContainer",
"$",
"dic",
")",
"{",
"foreach",
"(",
"$",
"module",
"->",
"getRequiredModules",
"(",
")... | Load the modules a certain module requires.
@param Module $module
@param Module[] $modules
@param array $moduleList
@param DependencyInjectionContainer $dic | [
"Load",
"the",
"modules",
"a",
"certain",
"module",
"requires",
"."
] | ebba9f892ed35965140265ba1c61b2c645eab6e0 | https://github.com/opsbears/piccolo/blob/ebba9f892ed35965140265ba1c61b2c645eab6e0/src/Module/ModuleLoader.php#L108-L121 |
22,837 | opsbears/piccolo | src/Module/ModuleLoader.php | ModuleLoader.loadModuleConfiguration | private function loadModuleConfiguration(Module $module, array &$config) {
$key = $module->getModuleKey();
if (!isset($config[$key])) {
$config[$key] = array();
}
$module->loadConfiguration($config[$key], $config);
} | php | private function loadModuleConfiguration(Module $module, array &$config) {
$key = $module->getModuleKey();
if (!isset($config[$key])) {
$config[$key] = array();
}
$module->loadConfiguration($config[$key], $config);
} | [
"private",
"function",
"loadModuleConfiguration",
"(",
"Module",
"$",
"module",
",",
"array",
"&",
"$",
"config",
")",
"{",
"$",
"key",
"=",
"$",
"module",
"->",
"getModuleKey",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"$",
"k... | Load the configuration for a specific module.
@param Module $module
@param array $config
@return void | [
"Load",
"the",
"configuration",
"for",
"a",
"specific",
"module",
"."
] | ebba9f892ed35965140265ba1c61b2c645eab6e0 | https://github.com/opsbears/piccolo/blob/ebba9f892ed35965140265ba1c61b2c645eab6e0/src/Module/ModuleLoader.php#L131-L137 |
22,838 | mothership-ec/composer | src/Composer/DependencyResolver/Problem.php | Problem.addRule | public function addRule(Rule $rule)
{
$this->addReason($rule->getId(), array(
'rule' => $rule,
'job' => $rule->getJob(),
));
} | php | public function addRule(Rule $rule)
{
$this->addReason($rule->getId(), array(
'rule' => $rule,
'job' => $rule->getJob(),
));
} | [
"public",
"function",
"addRule",
"(",
"Rule",
"$",
"rule",
")",
"{",
"$",
"this",
"->",
"addReason",
"(",
"$",
"rule",
"->",
"getId",
"(",
")",
",",
"array",
"(",
"'rule'",
"=>",
"$",
"rule",
",",
"'job'",
"=>",
"$",
"rule",
"->",
"getJob",
"(",
... | Add a rule as a reason
@param Rule $rule A rule which is a reason for this problem | [
"Add",
"a",
"rule",
"as",
"a",
"reason"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/Problem.php#L48-L54 |
22,839 | mothership-ec/composer | src/Composer/DependencyResolver/Problem.php | Problem.jobToText | protected function jobToText($job)
{
switch ($job['cmd']) {
case 'install':
$packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
if (!$packages) {
return 'No package found to satisfy install request for '.$job['packag... | php | protected function jobToText($job)
{
switch ($job['cmd']) {
case 'install':
$packages = $this->pool->whatProvides($job['packageName'], $job['constraint']);
if (!$packages) {
return 'No package found to satisfy install request for '.$job['packag... | [
"protected",
"function",
"jobToText",
"(",
"$",
"job",
")",
"{",
"switch",
"(",
"$",
"job",
"[",
"'cmd'",
"]",
")",
"{",
"case",
"'install'",
":",
"$",
"packages",
"=",
"$",
"this",
"->",
"pool",
"->",
"whatProvides",
"(",
"$",
"job",
"[",
"'packageN... | Turns a job into a human readable description
@param array $job
@return string | [
"Turns",
"a",
"job",
"into",
"a",
"human",
"readable",
"description"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/Problem.php#L179-L202 |
22,840 | ShaoZeMing/laravel-merchant | src/Form/NestedForm.php | NestedForm.getTemplateHtmlAndScript | public function getTemplateHtmlAndScript()
{
$html = '';
$scripts = [];
/* @var Field $field */
foreach ($this->fields() as $field) {
//when field render, will push $script to Merchant
$html .= $field->render();
/*
* Get and remove ... | php | public function getTemplateHtmlAndScript()
{
$html = '';
$scripts = [];
/* @var Field $field */
foreach ($this->fields() as $field) {
//when field render, will push $script to Merchant
$html .= $field->render();
/*
* Get and remove ... | [
"public",
"function",
"getTemplateHtmlAndScript",
"(",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"scripts",
"=",
"[",
"]",
";",
"/* @var Field $field */",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"(",
")",
"as",
"$",
"field",
")",
"{",
"//when fiel... | Get the html and script of template.
@return array | [
"Get",
"the",
"html",
"and",
"script",
"of",
"template",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/NestedForm.php#L307-L327 |
22,841 | ShaoZeMing/laravel-merchant | src/Form/NestedForm.php | NestedForm.formatField | protected function formatField(Field $field)
{
$column = $field->column();
$elementName = $elementClass = $errorKey = [];
$key = $this->key ?: 'new_'.static::DEFAULT_KEY_NAME;
if (is_array($column)) {
foreach ($column as $k => $name) {
$errorKey[$k] = s... | php | protected function formatField(Field $field)
{
$column = $field->column();
$elementName = $elementClass = $errorKey = [];
$key = $this->key ?: 'new_'.static::DEFAULT_KEY_NAME;
if (is_array($column)) {
foreach ($column as $k => $name) {
$errorKey[$k] = s... | [
"protected",
"function",
"formatField",
"(",
"Field",
"$",
"field",
")",
"{",
"$",
"column",
"=",
"$",
"field",
"->",
"column",
"(",
")",
";",
"$",
"elementName",
"=",
"$",
"elementClass",
"=",
"$",
"errorKey",
"=",
"[",
"]",
";",
"$",
"key",
"=",
... | Set `errorKey` `elementName` `elementClass` for fields inside hasmany fields.
@param Field $field
@return Field | [
"Set",
"errorKey",
"elementName",
"elementClass",
"for",
"fields",
"inside",
"hasmany",
"fields",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/NestedForm.php#L336-L359 |
22,842 | nabab/bbn | src/bbn/util/enc.php | enc.encryptOpenssl | public static function encryptOpenssl($textToEncrypt, string $secretHash = null, string $password = ''): ? string
{
if ( !$secretHash ){
$secretHash = self::$salt;
}
if ( $length = openssl_cipher_iv_length(self::$method) ){
$iv = substr(md5(self::$prefix.$password), 0, $length);
return o... | php | public static function encryptOpenssl($textToEncrypt, string $secretHash = null, string $password = ''): ? string
{
if ( !$secretHash ){
$secretHash = self::$salt;
}
if ( $length = openssl_cipher_iv_length(self::$method) ){
$iv = substr(md5(self::$prefix.$password), 0, $length);
return o... | [
"public",
"static",
"function",
"encryptOpenssl",
"(",
"$",
"textToEncrypt",
",",
"string",
"$",
"secretHash",
"=",
"null",
",",
"string",
"$",
"password",
"=",
"''",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"secretHash",
")",
"{",
"$",
"secr... | Encrypt string using openSSL module
@param string $textToEncrypt
@param string $secretHash Any random secure SALT string for your website
@param string $password User's optional password
@return null|string | [
"Encrypt",
"string",
"using",
"openSSL",
"module"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/util/enc.php#L92-L102 |
22,843 | nabab/bbn | src/bbn/util/enc.php | enc.decryptOpenssl | public static function decryptOpenssl($textToDecrypt, string $secretHash = null, string $password = ''): ? string
{
if ( !$secretHash ){
$secretHash = self::$salt;
}
if ( $length = openssl_cipher_iv_length(self::$method) ){
$iv = substr(md5(self::$prefix.$password), 0, $length);
return o... | php | public static function decryptOpenssl($textToDecrypt, string $secretHash = null, string $password = ''): ? string
{
if ( !$secretHash ){
$secretHash = self::$salt;
}
if ( $length = openssl_cipher_iv_length(self::$method) ){
$iv = substr(md5(self::$prefix.$password), 0, $length);
return o... | [
"public",
"static",
"function",
"decryptOpenssl",
"(",
"$",
"textToDecrypt",
",",
"string",
"$",
"secretHash",
"=",
"null",
",",
"string",
"$",
"password",
"=",
"''",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"secretHash",
")",
"{",
"$",
"secr... | Decrypt string using openSSL module
@param string $textToDecrypt
@param string $secretHash Any random secure SALT string for your website
@param string $password User's optional password
@return null|string | [
"Decrypt",
"string",
"using",
"openSSL",
"module"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/util/enc.php#L111-L121 |
22,844 | FriendsOfApi/phraseapp | src/Api/Upload.php | Upload.upload | public function upload(string $projectKey, string $ext, string $filename, array $params)
{
if (!file_exists($filename)) {
throw new Exception\InvalidArgumentException('file '.$filename.' not found');
}
if (!isset($params['locale_id'])) {
throw new Exception\InvalidAr... | php | public function upload(string $projectKey, string $ext, string $filename, array $params)
{
if (!file_exists($filename)) {
throw new Exception\InvalidArgumentException('file '.$filename.' not found');
}
if (!isset($params['locale_id'])) {
throw new Exception\InvalidAr... | [
"public",
"function",
"upload",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"ext",
",",
"string",
"$",
"filename",
",",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"E... | Upload a locale.
@param string $projectKey
@param string $ext
@param string $filename
@param array $params
@throws Exception
@return Uploaded|ResponseInterface | [
"Upload",
"a",
"locale",
"."
] | 1553bf857eb0858f9a7eb905b085864d24f80886 | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Upload.php#L33-L70 |
22,845 | LeaseCloud/leasecloud-php-sdk | src/HttpClient/CurlClient.php | CurlClient.request | public function request($method, $absUrl, $params, $headers)
{
$curl = curl_init();
$method = strtolower($method);
$opts = array();
if ($method == 'get') {
$opts[CURLOPT_HTTPGET] = 1;
if (count($params) > 0) {
$encoded = self::urlEncode($para... | php | public function request($method, $absUrl, $params, $headers)
{
$curl = curl_init();
$method = strtolower($method);
$opts = array();
if ($method == 'get') {
$opts[CURLOPT_HTTPGET] = 1;
if (count($params) > 0) {
$encoded = self::urlEncode($para... | [
"public",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"absUrl",
",",
"$",
"params",
",",
"$",
"headers",
")",
"{",
"$",
"curl",
"=",
"curl_init",
"(",
")",
";",
"$",
"method",
"=",
"strtolower",
"(",
"$",
"method",
")",
";",
"$",
"opts",
... | Make the request
@param string $method
@param string $absUrl
@param array $params
@param array $headers
@return array A zero indexed array.
0 => Response
1 => Response http code
2 => Array of response headers | [
"Make",
"the",
"request"
] | 091b073dd4f79ba915a68c0ed151bd9bfa61e7ca | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/HttpClient/CurlClient.php#L43-L115 |
22,846 | LeaseCloud/leasecloud-php-sdk | src/HttpClient/CurlClient.php | CurlClient.handleCurlError | private function handleCurlError($errno, $message)
{
switch ($errno) {
case CURLE_COULDNT_CONNECT:
case CURLE_COULDNT_RESOLVE_HOST:
case CURLE_OPERATION_TIMEOUTED:
$msg = "Could not connect";
break;
case CURLE_SSL_CACERT:
... | php | private function handleCurlError($errno, $message)
{
switch ($errno) {
case CURLE_COULDNT_CONNECT:
case CURLE_COULDNT_RESOLVE_HOST:
case CURLE_OPERATION_TIMEOUTED:
$msg = "Could not connect";
break;
case CURLE_SSL_CACERT:
... | [
"private",
"function",
"handleCurlError",
"(",
"$",
"errno",
",",
"$",
"message",
")",
"{",
"switch",
"(",
"$",
"errno",
")",
"{",
"case",
"CURLE_COULDNT_CONNECT",
":",
"case",
"CURLE_COULDNT_RESOLVE_HOST",
":",
"case",
"CURLE_OPERATION_TIMEOUTED",
":",
"$",
"ms... | Throw an exception with message indicating type of http error
@param number $errno
@param string $message
@throws Error | [
"Throw",
"an",
"exception",
"with",
"message",
"indicating",
"type",
"of",
"http",
"error"
] | 091b073dd4f79ba915a68c0ed151bd9bfa61e7ca | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/HttpClient/CurlClient.php#L124-L142 |
22,847 | tompedals/radish | src/Broker/QueueCollection.php | QueueCollection.pop | public function pop()
{
$keys = array_keys($this->queues);
for ($this->queueCounter; isset($keys[$this->queueCounter]); $this->queueCounter++) {
$queue = $this->queues[$keys[$this->queueCounter]];
$message = $queue->pop();
if ($message !== null) {
... | php | public function pop()
{
$keys = array_keys($this->queues);
for ($this->queueCounter; isset($keys[$this->queueCounter]); $this->queueCounter++) {
$queue = $this->queues[$keys[$this->queueCounter]];
$message = $queue->pop();
if ($message !== null) {
... | [
"public",
"function",
"pop",
"(",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"queues",
")",
";",
"for",
"(",
"$",
"this",
"->",
"queueCounter",
";",
"isset",
"(",
"$",
"keys",
"[",
"$",
"this",
"->",
"queueCounter",
"]",
")",... | Returns the next message from each queue until all are empty
@return Message|null | [
"Returns",
"the",
"next",
"message",
"from",
"each",
"queue",
"until",
"all",
"are",
"empty"
] | 7728567ae6226a5e3f627116118198b22d1b507d | https://github.com/tompedals/radish/blob/7728567ae6226a5e3f627116118198b22d1b507d/src/Broker/QueueCollection.php#L66-L94 |
22,848 | thelia-modules/CustomerGroup | EventListener/ModuleEventListener.php | ModuleEventListener.loadCustomerGroupConfigFile | public function loadCustomerGroupConfigFile(ModuleToggleActivationEvent $event)
{
$event->setModule(ModuleQuery::create()->findPk($event->getModuleId()));
if ($event->getModule()->getActivate() === BaseModule::IS_NOT_ACTIVATED) {
$this->configurationFileHandler->loadConfigurationFile($e... | php | public function loadCustomerGroupConfigFile(ModuleToggleActivationEvent $event)
{
$event->setModule(ModuleQuery::create()->findPk($event->getModuleId()));
if ($event->getModule()->getActivate() === BaseModule::IS_NOT_ACTIVATED) {
$this->configurationFileHandler->loadConfigurationFile($e... | [
"public",
"function",
"loadCustomerGroupConfigFile",
"(",
"ModuleToggleActivationEvent",
"$",
"event",
")",
"{",
"$",
"event",
"->",
"setModule",
"(",
"ModuleQuery",
"::",
"create",
"(",
")",
"->",
"findPk",
"(",
"$",
"event",
"->",
"getModuleId",
"(",
")",
")... | Load customer group definitions
@param ModuleToggleActivationEvent $event A module toggle activation event | [
"Load",
"customer",
"group",
"definitions"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/EventListener/ModuleEventListener.php#L44-L51 |
22,849 | heidelpay/PhpDoc | src/phpDocumentor/Compiler/Pass/MarkerFromTagsExtractor.php | MarkerFromTagsExtractor.getFileDescriptor | protected function getFileDescriptor($element)
{
$fileDescriptor = $element instanceof FileDescriptor
? $element
: $element->getFile();
if (!$fileDescriptor instanceof FileDescriptor) {
throw new \UnexpectedValueException('An element should always have a file ass... | php | protected function getFileDescriptor($element)
{
$fileDescriptor = $element instanceof FileDescriptor
? $element
: $element->getFile();
if (!$fileDescriptor instanceof FileDescriptor) {
throw new \UnexpectedValueException('An element should always have a file ass... | [
"protected",
"function",
"getFileDescriptor",
"(",
"$",
"element",
")",
"{",
"$",
"fileDescriptor",
"=",
"$",
"element",
"instanceof",
"FileDescriptor",
"?",
"$",
"element",
":",
"$",
"element",
"->",
"getFile",
"(",
")",
";",
"if",
"(",
"!",
"$",
"fileDes... | Retrieves the File Descriptor from the given element.
@param DescriptorAbstract $element
@throws \UnexpectedValueException if the provided element does not have a file associated with it.
@return FileDescriptor | [
"Retrieves",
"the",
"File",
"Descriptor",
"from",
"the",
"given",
"element",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/MarkerFromTagsExtractor.php#L66-L77 |
22,850 | gn36/phpbb-oo-posting-api | src/Gn36/OoPostingApi/post.php | post.reindex | function reindex($mode, $post_id, $message, $subject, $poster_id, $forum_id)
{
global $config, $phpbb_root_path, $phpEx;
// Select the search method and do some additional checks to ensure it can actually be utilised
$search_type = basename($config['search_type']);
if (!file_exists($phpbb_root_path . 'phpbb/... | php | function reindex($mode, $post_id, $message, $subject, $poster_id, $forum_id)
{
global $config, $phpbb_root_path, $phpEx;
// Select the search method and do some additional checks to ensure it can actually be utilised
$search_type = basename($config['search_type']);
if (!file_exists($phpbb_root_path . 'phpbb/... | [
"function",
"reindex",
"(",
"$",
"mode",
",",
"$",
"post_id",
",",
"$",
"message",
",",
"$",
"subject",
",",
"$",
"poster_id",
",",
"$",
"forum_id",
")",
"{",
"global",
"$",
"config",
",",
"$",
"phpbb_root_path",
",",
"$",
"phpEx",
";",
"// Select the ... | Reindex post in search
@param string $mode
@param int $post_id
@param string $message
@param string $subject
@param int $poster_id
@param int $forum_id | [
"Reindex",
"post",
"in",
"search"
] | d0e19482a9e1e93a435c1758a66df9324145381a | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/src/Gn36/OoPostingApi/post.php#L384-L407 |
22,851 | nabab/bbn | src/bbn/appui/imessages.php | imessages.from_notes | private function from_notes(array $messages, $simple = true){
if ( !empty($messages) ){
foreach ( $messages as $idx => $mess ){
if ( empty($mess['id_note']) ){
unset($messages[$idx]);
continue;
}
$note = $this->notes->get($mess['id_note']);
$note = [
... | php | private function from_notes(array $messages, $simple = true){
if ( !empty($messages) ){
foreach ( $messages as $idx => $mess ){
if ( empty($mess['id_note']) ){
unset($messages[$idx]);
continue;
}
$note = $this->notes->get($mess['id_note']);
$note = [
... | [
"private",
"function",
"from_notes",
"(",
"array",
"$",
"messages",
",",
"$",
"simple",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"messages",
")",
")",
"{",
"foreach",
"(",
"$",
"messages",
"as",
"$",
"idx",
"=>",
"$",
"mess",
")",
... | Gets internal messages' info from notes archive
@param array $messages
@param bool $simple
@return array | [
"Gets",
"internal",
"messages",
"info",
"from",
"notes",
"archive"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/imessages.php#L85-L107 |
22,852 | nabab/bbn | src/bbn/appui/imessages.php | imessages.insert | public function insert($imess){
$cfg =& $this->class_cfg;
// Get default page if it isn't set
if ( empty($imess['id_option']) ){
$perm = new \bbn\user\permissions();
$imess['id_option'] = $perm->is(self::BBN_DEFAULT_PERM);
}
if (
!empty($imess['id_option']) &&
!empty($imess['... | php | public function insert($imess){
$cfg =& $this->class_cfg;
// Get default page if it isn't set
if ( empty($imess['id_option']) ){
$perm = new \bbn\user\permissions();
$imess['id_option'] = $perm->is(self::BBN_DEFAULT_PERM);
}
if (
!empty($imess['id_option']) &&
!empty($imess['... | [
"public",
"function",
"insert",
"(",
"$",
"imess",
")",
"{",
"$",
"cfg",
"=",
"&",
"$",
"this",
"->",
"class_cfg",
";",
"// Get default page if it isn't set",
"if",
"(",
"empty",
"(",
"$",
"imess",
"[",
"'id_option'",
"]",
")",
")",
"{",
"$",
"perm",
"... | Inserts a new page's internal message
@param $imess
@return bool|int | [
"Inserts",
"a",
"new",
"page",
"s",
"internal",
"message"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/imessages.php#L126-L153 |
22,853 | nabab/bbn | src/bbn/appui/imessages.php | imessages.get | public function get(string $id_option, string $id_user, $simple = true){
$cfg =& $this->class_cfg;
// Current datetime
$now = date('Y-m-d H:i:s');
// Get the user's group
$id_group = $this->db->select_one('bbn_users', 'id_group', ['id' => $id_user]);
// Get the page's internal messages of the us... | php | public function get(string $id_option, string $id_user, $simple = true){
$cfg =& $this->class_cfg;
// Current datetime
$now = date('Y-m-d H:i:s');
// Get the user's group
$id_group = $this->db->select_one('bbn_users', 'id_group', ['id' => $id_user]);
// Get the page's internal messages of the us... | [
"public",
"function",
"get",
"(",
"string",
"$",
"id_option",
",",
"string",
"$",
"id_user",
",",
"$",
"simple",
"=",
"true",
")",
"{",
"$",
"cfg",
"=",
"&",
"$",
"this",
"->",
"class_cfg",
";",
"// Current datetime",
"$",
"now",
"=",
"date",
"(",
"'... | Gets the page's internal messages of an user
@param string $id_option
@param string $id_user
@param bool $simple
@return array | [
"Gets",
"the",
"page",
"s",
"internal",
"messages",
"of",
"an",
"user"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/imessages.php#L163-L204 |
22,854 | nabab/bbn | src/bbn/appui/imessages.php | imessages.set_hidden | public function set_hidden(string $id_imess, string $id_user){
$cfg =& $this->class_cfg;
if ( !empty($id_imess) && !empty($id_user) ){
return !!$this->db->insert_update($cfg['tables']['users'], [
$cfg['arch']['users']['id_imessage'] => $id_imess,
$cfg['arch']['users']['id_user'] => $id_use... | php | public function set_hidden(string $id_imess, string $id_user){
$cfg =& $this->class_cfg;
if ( !empty($id_imess) && !empty($id_user) ){
return !!$this->db->insert_update($cfg['tables']['users'], [
$cfg['arch']['users']['id_imessage'] => $id_imess,
$cfg['arch']['users']['id_user'] => $id_use... | [
"public",
"function",
"set_hidden",
"(",
"string",
"$",
"id_imess",
",",
"string",
"$",
"id_user",
")",
"{",
"$",
"cfg",
"=",
"&",
"$",
"this",
"->",
"class_cfg",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"id_imess",
")",
"&&",
"!",
"empty",
"(",
"$"... | Sets an user's internal message as visible
@param string $id_imess
@param string $id_user
@return bool | [
"Sets",
"an",
"user",
"s",
"internal",
"message",
"as",
"visible"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/imessages.php#L213-L227 |
22,855 | nabab/bbn | src/bbn/appui/imessages.php | imessages.unset_hidden | public function unset_hidden(string $id_imess, string $id_user){
$cfg =& $this->class_cfg;
if ( !empty($id_imess) && !empty($id_user) ){
return !!$this->db->update_ignore($cfg['tables']['users'], [
$cfg['arch']['users']['id_imessage'] => $id_imess,
$cfg['arch']['users']['id_user'] => $id_u... | php | public function unset_hidden(string $id_imess, string $id_user){
$cfg =& $this->class_cfg;
if ( !empty($id_imess) && !empty($id_user) ){
return !!$this->db->update_ignore($cfg['tables']['users'], [
$cfg['arch']['users']['id_imessage'] => $id_imess,
$cfg['arch']['users']['id_user'] => $id_u... | [
"public",
"function",
"unset_hidden",
"(",
"string",
"$",
"id_imess",
",",
"string",
"$",
"id_user",
")",
"{",
"$",
"cfg",
"=",
"&",
"$",
"this",
"->",
"class_cfg",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"id_imess",
")",
"&&",
"!",
"empty",
"(",
"... | Sets an user's internal message as not visible
@param string $id_imess
@param string $id_user
@return bool | [
"Sets",
"an",
"user",
"s",
"internal",
"message",
"as",
"not",
"visible"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/imessages.php#L236-L250 |
22,856 | nabab/bbn | src/bbn/appui/imessages.php | imessages.get_by_user | public function get_by_user(string $id_user){
$cfg =& $this->class_cfg;
// Current datetime
$now = date('Y-m-d H:i:s');
// Get the user's group
$id_group = $this->db->select_one('bbn_users', 'id_group', ['id' => $id_user]);
// Get all user's internal messages
$messages = $this->db->get_rows(... | php | public function get_by_user(string $id_user){
$cfg =& $this->class_cfg;
// Current datetime
$now = date('Y-m-d H:i:s');
// Get the user's group
$id_group = $this->db->select_one('bbn_users', 'id_group', ['id' => $id_user]);
// Get all user's internal messages
$messages = $this->db->get_rows(... | [
"public",
"function",
"get_by_user",
"(",
"string",
"$",
"id_user",
")",
"{",
"$",
"cfg",
"=",
"&",
"$",
"this",
"->",
"class_cfg",
";",
"// Current datetime",
"$",
"now",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
")",
";",
"// Get the user's group",
"$",
"id_group... | Gets all user's internal messages
@param string $id_user
@return array | [
"Gets",
"all",
"user",
"s",
"internal",
"messages"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/imessages.php#L271-L313 |
22,857 | mr-luke/configuration | src/Schema.php | Schema.check | public function check(array $insert, bool $throw = true): bool
{
foreach ($this->schema as $key => $rules) {
// Check each key by given rules and respond
// due to required flow.
$result = $this->processRules($key, explode('|', $rules), $insert);
if (!$result... | php | public function check(array $insert, bool $throw = true): bool
{
foreach ($this->schema as $key => $rules) {
// Check each key by given rules and respond
// due to required flow.
$result = $this->processRules($key, explode('|', $rules), $insert);
if (!$result... | [
"public",
"function",
"check",
"(",
"array",
"$",
"insert",
",",
"bool",
"$",
"throw",
"=",
"true",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"schema",
"as",
"$",
"key",
"=>",
"$",
"rules",
")",
"{",
"// Check each key by given rules and ... | Check if given array is matching the schema.
@param array $insert
@param bool $throw
@return bool
@throws \InvalidArgumentException | [
"Check",
"if",
"given",
"array",
"is",
"matching",
"the",
"schema",
"."
] | 487c90011dc15556787785ed60c60ea92655beac | https://github.com/mr-luke/configuration/blob/487c90011dc15556787785ed60c60ea92655beac/src/Schema.php#L51-L66 |
22,858 | mr-luke/configuration | src/Schema.php | Schema.createFromFile | public static function createFromFile(string $path, bool $json = false): Schema
{
static::fileExists($path);
$schema = $json ? json_decode(file_get_contents($path), true) : include $path;
if (!is_array($schema)) {
throw new InvalidArgumentException(
'[createFrom... | php | public static function createFromFile(string $path, bool $json = false): Schema
{
static::fileExists($path);
$schema = $json ? json_decode(file_get_contents($path), true) : include $path;
if (!is_array($schema)) {
throw new InvalidArgumentException(
'[createFrom... | [
"public",
"static",
"function",
"createFromFile",
"(",
"string",
"$",
"path",
",",
"bool",
"$",
"json",
"=",
"false",
")",
":",
"Schema",
"{",
"static",
"::",
"fileExists",
"(",
"$",
"path",
")",
";",
"$",
"schema",
"=",
"$",
"json",
"?",
"json_decode"... | Create new Schema instance based on file.
@param string $path
@param bool $json
@return Mrluke\Configuration\Schema | [
"Create",
"new",
"Schema",
"instance",
"based",
"on",
"file",
"."
] | 487c90011dc15556787785ed60c60ea92655beac | https://github.com/mr-luke/configuration/blob/487c90011dc15556787785ed60c60ea92655beac/src/Schema.php#L75-L88 |
22,859 | mr-luke/configuration | src/Schema.php | Schema.processRules | private function processRules(string $key, array $rules, array $insert): array
{
$status = true;
if (!isset($insert[$key])) {
$status = false;
$message = 'Schema key [%s] not present on insert.';
}
do {
$r = array_shift($rules);
$met... | php | private function processRules(string $key, array $rules, array $insert): array
{
$status = true;
if (!isset($insert[$key])) {
$status = false;
$message = 'Schema key [%s] not present on insert.';
}
do {
$r = array_shift($rules);
$met... | [
"private",
"function",
"processRules",
"(",
"string",
"$",
"key",
",",
"array",
"$",
"rules",
",",
"array",
"$",
"insert",
")",
":",
"array",
"{",
"$",
"status",
"=",
"true",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"insert",
"[",
"$",
"key",
"]",
... | Parse each rules for given key of insert.
@param string $key
@param array $rules
@param array $insert
@return array | [
"Parse",
"each",
"rules",
"for",
"given",
"key",
"of",
"insert",
"."
] | 487c90011dc15556787785ed60c60ea92655beac | https://github.com/mr-luke/configuration/blob/487c90011dc15556787785ed60c60ea92655beac/src/Schema.php#L197-L226 |
22,860 | phpnfe/tools | src/XMLGet.php | XMLGet.value | public function value()
{
if (is_null($this->value)) {
if (is_null($this->elem)) {
$this->value = '';
} else {
$this->value = $this->elem->textContent;
}
}
return $this->value;
} | php | public function value()
{
if (is_null($this->value)) {
if (is_null($this->elem)) {
$this->value = '';
} else {
$this->value = $this->elem->textContent;
}
}
return $this->value;
} | [
"public",
"function",
"value",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"elem",
")",
")",
"{",
"$",
"this",
"->",
"value",
"=",
"''",
";",
"}",
"else",
... | Retorna o valor.
@return string | [
"Retorna",
"o",
"valor",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/XMLGet.php#L33-L44 |
22,861 | phpnfe/tools | src/XMLGet.php | XMLGet.pad | public function pad($num, $char = '0', $dir = STR_PAD_LEFT)
{
$this->value = str_pad($this->value(), $num, $char, $dir);
return $this;
} | php | public function pad($num, $char = '0', $dir = STR_PAD_LEFT)
{
$this->value = str_pad($this->value(), $num, $char, $dir);
return $this;
} | [
"public",
"function",
"pad",
"(",
"$",
"num",
",",
"$",
"char",
"=",
"'0'",
",",
"$",
"dir",
"=",
"STR_PAD_LEFT",
")",
"{",
"$",
"this",
"->",
"value",
"=",
"str_pad",
"(",
"$",
"this",
"->",
"value",
"(",
")",
",",
"$",
"num",
",",
"$",
"char"... | Aplicar PAD.
@param $num
@param string $char
@param int $dir
@return $this | [
"Aplicar",
"PAD",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/XMLGet.php#L54-L59 |
22,862 | blast-project/BaseEntitiesBundle | src/Loggable/Mapping/Driver/Xml.php | Xml.inspectElementForVersioned | private function inspectElementForVersioned(\SimpleXMLElement $element, array &$config, $meta)
{
foreach ($element as $mapping) {
$mappingDoctrine = $mapping;
/**
* @var \SimpleXmlElement
*/
$mapping = $mapping->children(self::GEDMO_NAMESPACE_URI... | php | private function inspectElementForVersioned(\SimpleXMLElement $element, array &$config, $meta)
{
foreach ($element as $mapping) {
$mappingDoctrine = $mapping;
/**
* @var \SimpleXmlElement
*/
$mapping = $mapping->children(self::GEDMO_NAMESPACE_URI... | [
"private",
"function",
"inspectElementForVersioned",
"(",
"\\",
"SimpleXMLElement",
"$",
"element",
",",
"array",
"&",
"$",
"config",
",",
"$",
"meta",
")",
"{",
"foreach",
"(",
"$",
"element",
"as",
"$",
"mapping",
")",
"{",
"$",
"mappingDoctrine",
"=",
"... | Searches mappings on element for versioned fields.
@param \SimpleXMLElement $element
@param array $config
@param object $meta | [
"Searches",
"mappings",
"on",
"element",
"for",
"versioned",
"fields",
"."
] | abd06891fc38922225ab7e4fcb437a286ba2c0c4 | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Loggable/Mapping/Driver/Xml.php#L102-L121 |
22,863 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.checkUserClass | protected function checkUserClass()
{
$userClass = $this->userClass;
if (!class_exists($userClass)) {
throw new Exception('User Class Invalid.');
}
if (!((new $userClass()) instanceof User)) {
throw new Exception('User Class(' . $userClass . ') does not inheri... | php | protected function checkUserClass()
{
$userClass = $this->userClass;
if (!class_exists($userClass)) {
throw new Exception('User Class Invalid.');
}
if (!((new $userClass()) instanceof User)) {
throw new Exception('User Class(' . $userClass . ') does not inheri... | [
"protected",
"function",
"checkUserClass",
"(",
")",
"{",
"$",
"userClass",
"=",
"$",
"this",
"->",
"userClass",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"userClass",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'User Class Invalid.'",
")",
";",... | Check and get valid User.
@return User
@throws Exception throw if User is not an instance inherited from `\rhosocial\user\User`. | [
"Check",
"and",
"get",
"valid",
"User",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L41-L51 |
22,864 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.getUser | protected function getUser($user)
{
$userClass = $this->checkUserClass();
if (is_numeric($user)) {
$user = $userClass::find()->id($user)->one();
} elseif (is_string($user) && strlen($user)) {
$user = $userClass::find()->guid($user)->one();
}
if (!$user... | php | protected function getUser($user)
{
$userClass = $this->checkUserClass();
if (is_numeric($user)) {
$user = $userClass::find()->id($user)->one();
} elseif (is_string($user) && strlen($user)) {
$user = $userClass::find()->guid($user)->one();
}
if (!$user... | [
"protected",
"function",
"getUser",
"(",
"$",
"user",
")",
"{",
"$",
"userClass",
"=",
"$",
"this",
"->",
"checkUserClass",
"(",
")",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"user",
")",
")",
"{",
"$",
"user",
"=",
"$",
"userClass",
"::",
"find",
"... | Get user from database.
@param User|string|integer $user User ID.
@return User
@throws Exception | [
"Get",
"user",
"from",
"database",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L59-L71 |
22,865 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionRegister | public function actionRegister($password, $nickname = null, $firstName = null, $lastName = null)
{
$userClass = $this->checkUserClass();
$user = new $userClass(['password' => $password]);
/* @var $user User */
$profile = $user->createProfile([
'nickname' => $nick... | php | public function actionRegister($password, $nickname = null, $firstName = null, $lastName = null)
{
$userClass = $this->checkUserClass();
$user = new $userClass(['password' => $password]);
/* @var $user User */
$profile = $user->createProfile([
'nickname' => $nick... | [
"public",
"function",
"actionRegister",
"(",
"$",
"password",
",",
"$",
"nickname",
"=",
"null",
",",
"$",
"firstName",
"=",
"null",
",",
"$",
"lastName",
"=",
"null",
")",
"{",
"$",
"userClass",
"=",
"$",
"this",
"->",
"checkUserClass",
"(",
")",
";",... | Register new User.
@param string $password Password.
@param string $nickname If profile contains this property, this parameter is required.
@param string $firstName If profile contains this property, this parameter is required.
@param string $lastName If profile contains this propery, this parameter is required.
@retur... | [
"Register",
"new",
"User",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L82-L101 |
22,866 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionDeregister | public function actionDeregister($user)
{
$user = $this->getUser($user);
if ($user->deregister()) {
echo "User (" . $user->getID() . ") Deregistered.\n";
return static::EXIT_CODE_NORMAL;
}
return static::EXIT_CODE_ERROR;
} | php | public function actionDeregister($user)
{
$user = $this->getUser($user);
if ($user->deregister()) {
echo "User (" . $user->getID() . ") Deregistered.\n";
return static::EXIT_CODE_NORMAL;
}
return static::EXIT_CODE_ERROR;
} | [
"public",
"function",
"actionDeregister",
"(",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
"$",
"user",
")",
";",
"if",
"(",
"$",
"user",
"->",
"deregister",
"(",
")",
")",
"{",
"echo",
"\"User (\"",
".",
"$",
"user"... | Deregister user.
@param User|string|integer $user The user to be deregistered.
@return int | [
"Deregister",
"user",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L108-L116 |
22,867 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionShow | public function actionShow($user, $guid = false, $passHash = false, $accessToken = false, $authKey = false)
{
$user = $this->getUser($user);
echo Yii::t('app', 'User') . " (" . $user->getID() . "), " . Yii::t('app', 'registered at') . " (" . $user->getCreatedAt() . ")"
. ($user->getC... | php | public function actionShow($user, $guid = false, $passHash = false, $accessToken = false, $authKey = false)
{
$user = $this->getUser($user);
echo Yii::t('app', 'User') . " (" . $user->getID() . "), " . Yii::t('app', 'registered at') . " (" . $user->getCreatedAt() . ")"
. ($user->getC... | [
"public",
"function",
"actionShow",
"(",
"$",
"user",
",",
"$",
"guid",
"=",
"false",
",",
"$",
"passHash",
"=",
"false",
",",
"$",
"accessToken",
"=",
"false",
",",
"$",
"authKey",
"=",
"false",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getU... | Show User Information.
@param User|string|integer $user User ID.
@param boolean $guid Show GUID?
@param boolean $passHash Show PasswordH Hash?
@param boolean $accessToken Show Access Token?
@param boolean $authKey Show Authentication Key?
@return int | [
"Show",
"User",
"Information",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L127-L145 |
22,868 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionStat | public function actionStat($user = null)
{
if ($user === null) {
$count = User::find()->count();
echo "Total number of user(s): " . $count . "\n";
if ($count == 0) {
return static::EXIT_CODE_NORMAL;
}
$last = User::find()->orderByCr... | php | public function actionStat($user = null)
{
if ($user === null) {
$count = User::find()->count();
echo "Total number of user(s): " . $count . "\n";
if ($count == 0) {
return static::EXIT_CODE_NORMAL;
}
$last = User::find()->orderByCr... | [
"public",
"function",
"actionStat",
"(",
"$",
"user",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"user",
"===",
"null",
")",
"{",
"$",
"count",
"=",
"User",
"::",
"find",
"(",
")",
"->",
"count",
"(",
")",
";",
"echo",
"\"Total number of user(s): \"",
".... | Show statistics.
@param User|string|integer $user User ID.
@return int | [
"Show",
"statistics",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L152-L167 |
22,869 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionRole | public function actionRole($user, $operation, $role)
{
$user = $this->getUser($user);
$role = Yii::$app->authManager->getRole($role);
if ($operation == 'assign') {
try {
$assignment = Yii::$app->authManager->assign($role, $user);
} catch (\yii\db\Integ... | php | public function actionRole($user, $operation, $role)
{
$user = $this->getUser($user);
$role = Yii::$app->authManager->getRole($role);
if ($operation == 'assign') {
try {
$assignment = Yii::$app->authManager->assign($role, $user);
} catch (\yii\db\Integ... | [
"public",
"function",
"actionRole",
"(",
"$",
"user",
",",
"$",
"operation",
",",
"$",
"role",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
"$",
"user",
")",
";",
"$",
"role",
"=",
"Yii",
"::",
"$",
"app",
"->",
"authManager",
"... | Assign a role to user or revoke a role.
@param User|string|integer $user User ID.
@param string $operation Only `assign` and `revoke` are acceptable.
@param string $role Role name.
@return int | [
"Assign",
"a",
"role",
"to",
"user",
"or",
"revoke",
"a",
"role",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L176-L208 |
22,870 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionPermission | public function actionPermission($user, $operation, $permission)
{
$user = $this->getUser($user);
$permission = Yii::$app->authManager->getPermission($permission);
if ($operation == 'assign') {
try {
$assignment = Yii::$app->authManager->assign($permission, $user)... | php | public function actionPermission($user, $operation, $permission)
{
$user = $this->getUser($user);
$permission = Yii::$app->authManager->getPermission($permission);
if ($operation == 'assign') {
try {
$assignment = Yii::$app->authManager->assign($permission, $user)... | [
"public",
"function",
"actionPermission",
"(",
"$",
"user",
",",
"$",
"operation",
",",
"$",
"permission",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
"$",
"user",
")",
";",
"$",
"permission",
"=",
"Yii",
"::",
"$",
"app",
"->",
... | Assign a permission to user or revoke a permission.
@param User|string|integer $user User ID.
@param string $operation Only `assign` and `revoke` are acceptable.
@param string $permission Permission name.
@return int | [
"Assign",
"a",
"permission",
"to",
"user",
"or",
"revoke",
"a",
"permission",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L217-L249 |
22,871 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionPassword | public function actionPassword($user, $password)
{
$user = $this->getUser($user);
$user->applyForNewPassword();
$result = $user->resetPassword($password, $user->getPasswordResetToken());
if ($result) {
echo "Password changed.\n";
} else {
echo "Passwor... | php | public function actionPassword($user, $password)
{
$user = $this->getUser($user);
$user->applyForNewPassword();
$result = $user->resetPassword($password, $user->getPasswordResetToken());
if ($result) {
echo "Password changed.\n";
} else {
echo "Passwor... | [
"public",
"function",
"actionPassword",
"(",
"$",
"user",
",",
"$",
"password",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
"$",
"user",
")",
";",
"$",
"user",
"->",
"applyForNewPassword",
"(",
")",
";",
"$",
"result",
"=",
"$",
... | Change password directly.
@param User|string|integer $user User ID.
@param string $password Password.
@return int | [
"Change",
"password",
"directly",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L275-L286 |
22,872 | rhosocial/yii2-user | console/controllers/UserController.php | UserController.actionConfirmPasswordHistory | public function actionConfirmPasswordHistory($user, $password)
{
$user = $this->getUser($user);
$passwordHistory = $user->passwordHistories;
$passwordInHistory = 0;
foreach ($passwordHistory as $pass) {
if ($pass->validatePassword($password)) {
$passwordIn... | php | public function actionConfirmPasswordHistory($user, $password)
{
$user = $this->getUser($user);
$passwordHistory = $user->passwordHistories;
$passwordInHistory = 0;
foreach ($passwordHistory as $pass) {
if ($pass->validatePassword($password)) {
$passwordIn... | [
"public",
"function",
"actionConfirmPasswordHistory",
"(",
"$",
"user",
",",
"$",
"password",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
"$",
"user",
")",
";",
"$",
"passwordHistory",
"=",
"$",
"user",
"->",
"passwordHistories",
";",
... | Confirm password in history.
This command will list all matching passwords in reverse order.
@param User|string|integer $user User ID.
@param string $password Password.
@return int | [
"Confirm",
"password",
"in",
"history",
".",
"This",
"command",
"will",
"list",
"all",
"matching",
"passwords",
"in",
"reverse",
"order",
"."
] | 96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/console/controllers/UserController.php#L295-L312 |
22,873 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/exifReader.php | phpExifReader.debug | function debug($str, $TYPE = 0, $file = "", $line = 0)
{
if ($this->debug)
{
echo "<br>[$file:$line:" . ($this->getDiffTime()) . "]$str";
flush();
if ($TYPE == 1)
{
exit;
}
}
} | php | function debug($str, $TYPE = 0, $file = "", $line = 0)
{
if ($this->debug)
{
echo "<br>[$file:$line:" . ($this->getDiffTime()) . "]$str";
flush();
if ($TYPE == 1)
{
exit;
}
}
} | [
"function",
"debug",
"(",
"$",
"str",
",",
"$",
"TYPE",
"=",
"0",
",",
"$",
"file",
"=",
"\"\"",
",",
"$",
"line",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"{",
"echo",
"\"<br>[$file:$line:\"",
".",
"(",
"$",
"this",
"->"... | Show Debugging information
@param string $str Debugging message to display
@param int $TYPE Type of error (0 - Warning, 1 - Error)
@param string $file
@param int $line
@return void | [
"Show",
"Debugging",
"information"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/exifReader.php#L430-L441 |
22,874 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/exifReader.php | phpExifReader.Get32s | function Get32s($val1, $val2, $val3, $val4)
{
$val1 = ord($val1);
$val2 = ord($val2);
$val3 = ord($val3);
$val4 = ord($val4);
if ($this->MotorolaOrder)
{
return (($val1 << 24) | ($val2 << 16) | ($val3 << 8) | ($val4 << 0));
}
else
... | php | function Get32s($val1, $val2, $val3, $val4)
{
$val1 = ord($val1);
$val2 = ord($val2);
$val3 = ord($val3);
$val4 = ord($val4);
if ($this->MotorolaOrder)
{
return (($val1 << 24) | ($val2 << 16) | ($val3 << 8) | ($val4 << 0));
}
else
... | [
"function",
"Get32s",
"(",
"$",
"val1",
",",
"$",
"val2",
",",
"$",
"val3",
",",
"$",
"val4",
")",
"{",
"$",
"val1",
"=",
"ord",
"(",
"$",
"val1",
")",
";",
"$",
"val2",
"=",
"ord",
"(",
"$",
"val2",
")",
";",
"$",
"val3",
"=",
"ord",
"(",
... | Converts 4-byte number into its equivalent integer
@param int
@param int
@param int
@param int
@return int | [
"Converts",
"4",
"-",
"byte",
"number",
"into",
"its",
"equivalent",
"integer"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/exifReader.php#L1666-L1681 |
22,875 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/exifReader.php | phpExifReader.get32u | function get32u($val1, $val2, $val3, $val4)
{
return ($this->Get32s($val1, $val2, $val3, $val4) & 0xffffffff);
} | php | function get32u($val1, $val2, $val3, $val4)
{
return ($this->Get32s($val1, $val2, $val3, $val4) & 0xffffffff);
} | [
"function",
"get32u",
"(",
"$",
"val1",
",",
"$",
"val2",
",",
"$",
"val3",
",",
"$",
"val4",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"Get32s",
"(",
"$",
"val1",
",",
"$",
"val2",
",",
"$",
"val3",
",",
"$",
"val4",
")",
"&",
"0xffffffff",
... | Converts 4-byte number into its equivalent integer with the help of Get32s
@param int
@param int
@param int
@param int
@return int | [
"Converts",
"4",
"-",
"byte",
"number",
"into",
"its",
"equivalent",
"integer",
"with",
"the",
"help",
"of",
"Get32s"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/exifReader.php#L1694-L1697 |
22,876 | zhouyl/mellivora | Mellivora/Events/CallQueuedHandler.php | CallQueuedHandler.setJobInstanceIfNecessary | protected function setJobInstanceIfNecessary(Job $job, $instance)
{
if (in_array(InteractsWithQueue::class, class_uses_recursive(get_class($instance)))) {
$instance->setJob($job);
}
return $instance;
} | php | protected function setJobInstanceIfNecessary(Job $job, $instance)
{
if (in_array(InteractsWithQueue::class, class_uses_recursive(get_class($instance)))) {
$instance->setJob($job);
}
return $instance;
} | [
"protected",
"function",
"setJobInstanceIfNecessary",
"(",
"Job",
"$",
"job",
",",
"$",
"instance",
")",
"{",
"if",
"(",
"in_array",
"(",
"InteractsWithQueue",
"::",
"class",
",",
"class_uses_recursive",
"(",
"get_class",
"(",
"$",
"instance",
")",
")",
")",
... | Set the job instance of the given class if necessary.
@param \Mellivora\Support\Contracts\Queue\Job $job
@param mixed $instance
@return mixed | [
"Set",
"the",
"job",
"instance",
"of",
"the",
"given",
"class",
"if",
"necessary",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Events/CallQueuedHandler.php#L63-L70 |
22,877 | WellCommerce/AppBundle | Twig/CurrencyExtension.php | CurrencyExtension.formatPrice | public function formatPrice(float $price, $baseCurrency = null, $targetCurrency = null, $locale = null, $quantity = 1) : string
{
return $this->helper->convertAndFormat($price, $baseCurrency, $targetCurrency, $quantity, $locale);
} | php | public function formatPrice(float $price, $baseCurrency = null, $targetCurrency = null, $locale = null, $quantity = 1) : string
{
return $this->helper->convertAndFormat($price, $baseCurrency, $targetCurrency, $quantity, $locale);
} | [
"public",
"function",
"formatPrice",
"(",
"float",
"$",
"price",
",",
"$",
"baseCurrency",
"=",
"null",
",",
"$",
"targetCurrency",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
",",
"$",
"quantity",
"=",
"1",
")",
":",
"string",
"{",
"return",
"$",
... | Formats the given amount
@param int|float $price
@param null|string $baseCurrency
@param null|string $targetCurrency
@param null|string $locale
@return string | [
"Formats",
"the",
"given",
"amount"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Twig/CurrencyExtension.php#L75-L78 |
22,878 | WellCommerce/AppBundle | Twig/CurrencyExtension.php | CurrencyExtension.convertPrice | public function convertPrice(float $price, $baseCurrency = null, $targetCurrency = null, $quantity = 1) : string
{
return $this->helper->convert($price, $baseCurrency, $targetCurrency, $quantity);
} | php | public function convertPrice(float $price, $baseCurrency = null, $targetCurrency = null, $quantity = 1) : string
{
return $this->helper->convert($price, $baseCurrency, $targetCurrency, $quantity);
} | [
"public",
"function",
"convertPrice",
"(",
"float",
"$",
"price",
",",
"$",
"baseCurrency",
"=",
"null",
",",
"$",
"targetCurrency",
"=",
"null",
",",
"$",
"quantity",
"=",
"1",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"helper",
"->",
"con... | Converts the given amount
@param float $price
@param null|string $baseCurrency
@param null|string $targetCurrency
@param int $quantity
@return string | [
"Converts",
"the",
"given",
"amount"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Twig/CurrencyExtension.php#L90-L93 |
22,879 | tttptd/laravel-responder | src/Transformer.php | Transformer.getRelations | public function getRelations():array
{
$relations = array_unique(array_merge($this->getAvailableIncludes(), $this->relations));
return array_filter($relations, function($relation) {
return $relation !== '*';
});
} | php | public function getRelations():array
{
$relations = array_unique(array_merge($this->getAvailableIncludes(), $this->relations));
return array_filter($relations, function($relation) {
return $relation !== '*';
});
} | [
"public",
"function",
"getRelations",
"(",
")",
":",
"array",
"{",
"$",
"relations",
"=",
"array_unique",
"(",
"array_merge",
"(",
"$",
"this",
"->",
"getAvailableIncludes",
"(",
")",
",",
"$",
"this",
"->",
"relations",
")",
")",
";",
"return",
"array_fil... | Get relations set on the transformer.
@return array | [
"Get",
"relations",
"set",
"on",
"the",
"transformer",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Transformer.php#L32-L39 |
22,880 | tttptd/laravel-responder | src/Transformer.php | Transformer.setRelations | public function setRelations($relations)
{
$this->setAvailableIncludes(array_unique(array_merge($this->availableIncludes, (array) $relations)));
return $this;
} | php | public function setRelations($relations)
{
$this->setAvailableIncludes(array_unique(array_merge($this->availableIncludes, (array) $relations)));
return $this;
} | [
"public",
"function",
"setRelations",
"(",
"$",
"relations",
")",
"{",
"$",
"this",
"->",
"setAvailableIncludes",
"(",
"array_unique",
"(",
"array_merge",
"(",
"$",
"this",
"->",
"availableIncludes",
",",
"(",
"array",
")",
"$",
"relations",
")",
")",
")",
... | Set relations on the transformer.
@param array|string $relations
@return self | [
"Set",
"relations",
"on",
"the",
"transformer",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Transformer.php#L47-L52 |
22,881 | tttptd/laravel-responder | src/Transformer.php | Transformer.includePivot | protected function includePivot(Pivot $pivot)
{
if (! method_exists($this, 'transformPivot')) {
return false;
}
return app(Responder::class)->transform($pivot, function ($pivot) {
return $this->transformPivot($pivot);
})->getResource();
} | php | protected function includePivot(Pivot $pivot)
{
if (! method_exists($this, 'transformPivot')) {
return false;
}
return app(Responder::class)->transform($pivot, function ($pivot) {
return $this->transformPivot($pivot);
})->getResource();
} | [
"protected",
"function",
"includePivot",
"(",
"Pivot",
"$",
"pivot",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"'transformPivot'",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"app",
"(",
"Responder",
"::",
"class",
")",
... | Include pivot table data to the response.
@param Pivot $pivot
@return \League\Fractal\Resource\ResourceInterface|bool | [
"Include",
"pivot",
"table",
"data",
"to",
"the",
"response",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Transformer.php#L101-L110 |
22,882 | nabab/bbn | src/bbn/cdn/config.php | config._set_cfg | private function _set_cfg(){
if ( \is_array($this->cfg) ){
$p =& $this->cfg['params'];
$components = false;
if ( !empty($p['components']) ){
$components = explode(',', $p['components']);
}
$this->cfg = bbn\x::merge_arrays($this->cfg, [
'test' => !empty($p['test']),
... | php | private function _set_cfg(){
if ( \is_array($this->cfg) ){
$p =& $this->cfg['params'];
$components = false;
if ( !empty($p['components']) ){
$components = explode(',', $p['components']);
}
$this->cfg = bbn\x::merge_arrays($this->cfg, [
'test' => !empty($p['test']),
... | [
"private",
"function",
"_set_cfg",
"(",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"cfg",
")",
")",
"{",
"$",
"p",
"=",
"&",
"$",
"this",
"->",
"cfg",
"[",
"'params'",
"]",
";",
"$",
"components",
"=",
"false",
";",
"if",
"(... | Returns an array with all the - default or no - config parameters based on the sent ones | [
"Returns",
"an",
"array",
"with",
"all",
"the",
"-",
"default",
"or",
"no",
"-",
"config",
"parameters",
"based",
"on",
"the",
"sent",
"ones"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/cdn/config.php#L34-L52 |
22,883 | surebert/surebert-framework | src/sb/XMPP/Presence.php | Presence.getPriority | public function getPriority($as_string=true)
{
$nodes = $this->doc->getElementsByTagName('priority');
$node =$nodes->item(0);
if($node){
if($as_string){
return $node->nodeValue;
} else {
return $node;
}
} else {
... | php | public function getPriority($as_string=true)
{
$nodes = $this->doc->getElementsByTagName('priority');
$node =$nodes->item(0);
if($node){
if($as_string){
return $node->nodeValue;
} else {
return $node;
}
} else {
... | [
"public",
"function",
"getPriority",
"(",
"$",
"as_string",
"=",
"true",
")",
"{",
"$",
"nodes",
"=",
"$",
"this",
"->",
"doc",
"->",
"getElementsByTagName",
"(",
"'priority'",
")",
";",
"$",
"node",
"=",
"$",
"nodes",
"->",
"item",
"(",
"0",
")",
";... | Gets the priority value of a presence packet
@param boolean $as_string Determines if node is returned as xml node or string, true by default
@return string | [
"Gets",
"the",
"priority",
"value",
"of",
"a",
"presence",
"packet"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Presence.php#L99-L112 |
22,884 | surebert/surebert-framework | src/sb/XMPP/Presence.php | Presence.setStatus | public function setStatus($status)
{
$node = $this->getStatus(false);
if(!$node){
$node = $this->createElement('status');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($status);
} | php | public function setStatus($status)
{
$node = $this->getStatus(false);
if(!$node){
$node = $this->createElement('status');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($status);
} | [
"public",
"function",
"setStatus",
"(",
"$",
"status",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getStatus",
"(",
"false",
")",
";",
"if",
"(",
"!",
"$",
"node",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"createElement",
"(",
"'status'",... | Set the status of the presence packet
@param string $status The status message to display in human readible format | [
"Set",
"the",
"status",
"of",
"the",
"presence",
"packet"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Presence.php#L119-L129 |
22,885 | surebert/surebert-framework | src/sb/XMPP/Presence.php | Presence.setShow | public function setShow($show)
{
if($show == 'unavailable') {
$this->setType($show);
}
$node = $this->getShow(false);
if(!$node){
$node = $this->createElement('show');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspec... | php | public function setShow($show)
{
if($show == 'unavailable') {
$this->setType($show);
}
$node = $this->getShow(false);
if(!$node){
$node = $this->createElement('show');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspec... | [
"public",
"function",
"setShow",
"(",
"$",
"show",
")",
"{",
"if",
"(",
"$",
"show",
"==",
"'unavailable'",
")",
"{",
"$",
"this",
"->",
"setType",
"(",
"$",
"show",
")",
";",
"}",
"$",
"node",
"=",
"$",
"this",
"->",
"getShow",
"(",
"false",
")"... | Shows the status of the bot
@param string $show A code to describe the state. see http://xmpp.org/rfcs/rfc3921.html
away - The entity or resource is temporarily away.
chat - The entity or resource is actively interested in chatting.
dnd - The entity or resource is busy (dnd = "Do Not Disturb").
xa - The entity or resou... | [
"Shows",
"the",
"status",
"of",
"the",
"bot"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Presence.php#L139-L154 |
22,886 | surebert/surebert-framework | src/sb/XMPP/Presence.php | Presence.setPriority | public function setPriority($priority=1)
{
$node = $this->getPriority(false);
if(!$node){
$node = $this->createElement('priority');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($priority);
} | php | public function setPriority($priority=1)
{
$node = $this->getPriority(false);
if(!$node){
$node = $this->createElement('priority');
$this->doc->appendChild($node);
}
$node->nodeValue = htmlspecialchars($priority);
} | [
"public",
"function",
"setPriority",
"(",
"$",
"priority",
"=",
"1",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getPriority",
"(",
"false",
")",
";",
"if",
"(",
"!",
"$",
"node",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"createElement",
... | Sets the priority of the presence
@param integer $priority | [
"Sets",
"the",
"priority",
"of",
"the",
"presence"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Presence.php#L160-L170 |
22,887 | surebert/surebert-framework | src/sb/XMPP/Presence.php | Presence.setType | public function setType($type)
{
$attr = $this->createAttribute('type');
$this->doc->appendChild($attr);
$attr->appendChild($this->createTextNode($type));
} | php | public function setType($type)
{
$attr = $this->createAttribute('type');
$this->doc->appendChild($attr);
$attr->appendChild($this->createTextNode($type));
} | [
"public",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"$",
"attr",
"=",
"$",
"this",
"->",
"createAttribute",
"(",
"'type'",
")",
";",
"$",
"this",
"->",
"doc",
"->",
"appendChild",
"(",
"$",
"attr",
")",
";",
"$",
"attr",
"->",
"appendChild",... | Sets the presence type
@param string $type see http://xmpp.org/rfcs/rfc3921.html for more info
unavailable -- Signals that the entity is no longer available for communication.
subscribe -- The sender wishes to subscribe to the recipient's presence.
subscribed -- The sender has allowed the recipient to receive their pre... | [
"Sets",
"the",
"presence",
"type"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Presence.php#L184-L189 |
22,888 | eloquent/phony-kahlan | src/AssertionRecorder.php | AssertionRecorder.createFailure | public function createFailure(string $description)
{
$exception = new AssertionException($description);
$suiteClass = $this->suiteClass;
$suiteClass::current()->assert([
'handler' => function () use ($exception) {
throw $exception;
},
'typ... | php | public function createFailure(string $description)
{
$exception = new AssertionException($description);
$suiteClass = $this->suiteClass;
$suiteClass::current()->assert([
'handler' => function () use ($exception) {
throw $exception;
},
'typ... | [
"public",
"function",
"createFailure",
"(",
"string",
"$",
"description",
")",
"{",
"$",
"exception",
"=",
"new",
"AssertionException",
"(",
"$",
"description",
")",
";",
"$",
"suiteClass",
"=",
"$",
"this",
"->",
"suiteClass",
";",
"$",
"suiteClass",
"::",
... | Create a new assertion failure exception.
@param string $description The failure description.
@throws AssertionException The assertion failure. | [
"Create",
"a",
"new",
"assertion",
"failure",
"exception",
"."
] | a4654a7edf58268b492acc751ecbeddded9b176f | https://github.com/eloquent/phony-kahlan/blob/a4654a7edf58268b492acc751ecbeddded9b176f/src/AssertionRecorder.php#L81-L92 |
22,889 | MASNathan/Parser | src/Type/Xml.php | Xml.encode | public static function encode($data, $prettyPrint = false, $xmlVersion = '1.0', $encoding = 'utf-8')
{
$domDocument = new DOMDocument($xmlVersion, $encoding);
$domDocument = self::loopEncode($data, $domDocument);
if ($prettyPrint) {
$domDocument->preserveWhiteSpace = fal... | php | public static function encode($data, $prettyPrint = false, $xmlVersion = '1.0', $encoding = 'utf-8')
{
$domDocument = new DOMDocument($xmlVersion, $encoding);
$domDocument = self::loopEncode($data, $domDocument);
if ($prettyPrint) {
$domDocument->preserveWhiteSpace = fal... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"prettyPrint",
"=",
"false",
",",
"$",
"xmlVersion",
"=",
"'1.0'",
",",
"$",
"encoding",
"=",
"'utf-8'",
")",
"{",
"$",
"domDocument",
"=",
"new",
"DOMDocument",
"(",
"$",
"xmlVersion"... | Encodes an array to xml strutcture
@param mixed $data Data to encode
@param boolean $prettyPrint True to output the encoded data a little bit more readable for the humans
@param string $xmlVersion XML header version
@param string $encoding XML header encoding
@return string | [
"Encodes",
"an",
"array",
"to",
"xml",
"strutcture"
] | 0f55402b99b1e071bdcd6277b9268f783ca25e34 | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Xml.php#L19-L41 |
22,890 | MASNathan/Parser | src/Type/Xml.php | Xml.loopEncode | protected static function loopEncode($data, $domElement)
{
if (is_array($data)) {
foreach ($data as $index => $mixedElement) {
if (is_int($index)) {
if ($index == 0) {
$node = $domElement;
} else {
... | php | protected static function loopEncode($data, $domElement)
{
if (is_array($data)) {
foreach ($data as $index => $mixedElement) {
if (is_int($index)) {
if ($index == 0) {
$node = $domElement;
} else {
... | [
"protected",
"static",
"function",
"loopEncode",
"(",
"$",
"data",
",",
"$",
"domElement",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"index",
"=>",
"$",
"mixedElement",
")",
"{",
"if",
... | Lets loop through our data
@param mixed $data Data to encode
@param DOMDocument|DOMElement $domElement Document to initialize and then it'll call itself with inner Element(s)
@return DOMDocument | [
"Lets",
"loop",
"through",
"our",
"data"
] | 0f55402b99b1e071bdcd6277b9268f783ca25e34 | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Xml.php#L49-L72 |
22,891 | MASNathan/Parser | src/Type/Xml.php | Xml.loopDecode | protected static function loopDecode($data)
{
if (is_array($data)) {
foreach ($data as &$value) {
$value = self::loopDecode($value);
}
} elseif (is_object($data)) {
return self::loopDecode((array) $data);
}
return $data;
} | php | protected static function loopDecode($data)
{
if (is_array($data)) {
foreach ($data as &$value) {
$value = self::loopDecode($value);
}
} elseif (is_object($data)) {
return self::loopDecode((array) $data);
}
return $data;
} | [
"protected",
"static",
"function",
"loopDecode",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"&",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"self",
"::",
"loopDecode",
"(",... | Turns all the objects into arrays
@param mixed $data Data
@return array | [
"Turns",
"all",
"the",
"objects",
"into",
"arrays"
] | 0f55402b99b1e071bdcd6277b9268f783ca25e34 | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Xml.php#L93-L103 |
22,892 | surebert/surebert-framework | src/sb/Socket/StreamingClient.php | StreamingClient.read | public function read($byte_count=null)
{
$this->log('read from socket');
$buffer = '';
if(!is_null($byte_count)) {
//read the specified amount of data
$buffer .= fgets($this->socket, 1024);
} else {
//read all the data
while (!feof($this->so... | php | public function read($byte_count=null)
{
$this->log('read from socket');
$buffer = '';
if(!is_null($byte_count)) {
//read the specified amount of data
$buffer .= fgets($this->socket, 1024);
} else {
//read all the data
while (!feof($this->so... | [
"public",
"function",
"read",
"(",
"$",
"byte_count",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'read from socket'",
")",
";",
"$",
"buffer",
"=",
"''",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"byte_count",
")",
")",
"{",
"//read the ... | Read data from the socket
@param integer $byte_count The amount of data to read, if not set, it reads until feof
@return string The data read from the socket | [
"Read",
"data",
"from",
"the",
"socket"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Socket/StreamingClient.php#L66-L84 |
22,893 | wenbinye/PhalconX | src/Annotation/Annotations.php | Annotations.import | public function import(array $classes)
{
foreach ($classes as $class => $alias) {
if (is_integer($class)) {
$class = $alias;
$alias = ClassHelper::getSimpleName($class);
}
if (isset($this->imports[$alias])) {
throw new \Runt... | php | public function import(array $classes)
{
foreach ($classes as $class => $alias) {
if (is_integer($class)) {
$class = $alias;
$alias = ClassHelper::getSimpleName($class);
}
if (isset($this->imports[$alias])) {
throw new \Runt... | [
"public",
"function",
"import",
"(",
"array",
"$",
"classes",
")",
"{",
"foreach",
"(",
"$",
"classes",
"as",
"$",
"class",
"=>",
"$",
"alias",
")",
"{",
"if",
"(",
"is_integer",
"(",
"$",
"class",
")",
")",
"{",
"$",
"class",
"=",
"$",
"alias",
... | Imports annotation classes | [
"Imports",
"annotation",
"classes"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Annotation/Annotations.php#L55-L69 |
22,894 | wenbinye/PhalconX | src/Annotation/Annotations.php | Annotations.get | public function get($class)
{
$annotations = $this->getCache()->get('_PHX.annotations.' . $class);
if (!isset($annotations)) {
$annotations = $this->getAnnotations($class);
$this->getCache()->save('_PHX.annotations.' . $class, $annotations);
}
return $annotati... | php | public function get($class)
{
$annotations = $this->getCache()->get('_PHX.annotations.' . $class);
if (!isset($annotations)) {
$annotations = $this->getAnnotations($class);
$this->getCache()->save('_PHX.annotations.' . $class, $annotations);
}
return $annotati... | [
"public",
"function",
"get",
"(",
"$",
"class",
")",
"{",
"$",
"annotations",
"=",
"$",
"this",
"->",
"getCache",
"(",
")",
"->",
"get",
"(",
"'_PHX.annotations.'",
".",
"$",
"class",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"annotations",
")",
... | Gets all annotations in the class
@param string $class class name
@return array | [
"Gets",
"all",
"annotations",
"in",
"the",
"class"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Annotation/Annotations.php#L94-L102 |
22,895 | wenbinye/PhalconX | src/Annotation/Annotations.php | Annotations.getAnnotations | private function getAnnotations($class)
{
$parsed = $this->getParser()->parse($class);
if (!is_array($parsed)) {
return [];
}
$context = [
'class' => $class,
'declaringClass' => $class,
'type' => Context::TYPE_CLASS,
'name' ... | php | private function getAnnotations($class)
{
$parsed = $this->getParser()->parse($class);
if (!is_array($parsed)) {
return [];
}
$context = [
'class' => $class,
'declaringClass' => $class,
'type' => Context::TYPE_CLASS,
'name' ... | [
"private",
"function",
"getAnnotations",
"(",
"$",
"class",
")",
"{",
"$",
"parsed",
"=",
"$",
"this",
"->",
"getParser",
"(",
")",
"->",
"parse",
"(",
"$",
"class",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"parsed",
")",
")",
"{",
"return",... | parse all annotations from class | [
"parse",
"all",
"annotations",
"from",
"class"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Annotation/Annotations.php#L129-L173 |
22,896 | wenbinye/PhalconX | src/Annotation/Annotations.php | Annotations.create | private function create($annotation, $context)
{
$logger = $this->getLogger();
$name = $annotation['name'];
if (!$this->isValidName($name)) {
return null;
}
$annotationClass = $this->resolveClassName($name, $context['declaringClass']);
if (!$annotationClas... | php | private function create($annotation, $context)
{
$logger = $this->getLogger();
$name = $annotation['name'];
if (!$this->isValidName($name)) {
return null;
}
$annotationClass = $this->resolveClassName($name, $context['declaringClass']);
if (!$annotationClas... | [
"private",
"function",
"create",
"(",
"$",
"annotation",
",",
"$",
"context",
")",
"{",
"$",
"logger",
"=",
"$",
"this",
"->",
"getLogger",
"(",
")",
";",
"$",
"name",
"=",
"$",
"annotation",
"[",
"'name'",
"]",
";",
"if",
"(",
"!",
"$",
"this",
... | create annotation object | [
"create",
"annotation",
"object"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Annotation/Annotations.php#L178-L208 |
22,897 | juskiewicz/Geolocation | src/Build/AddressBuild.php | AddressBuild.updateAddressFromComponent | private function updateAddressFromComponent(Address $address, $component) : Address
{
foreach ($component->types as $type) {
switch ($type) {
case 'postal_code':
$address->setPostalCode($component->long_name);
break;
case 'l... | php | private function updateAddressFromComponent(Address $address, $component) : Address
{
foreach ($component->types as $type) {
switch ($type) {
case 'postal_code':
$address->setPostalCode($component->long_name);
break;
case 'l... | [
"private",
"function",
"updateAddressFromComponent",
"(",
"Address",
"$",
"address",
",",
"$",
"component",
")",
":",
"Address",
"{",
"foreach",
"(",
"$",
"component",
"->",
"types",
"as",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"cas... | update address from google address component
@param Address $address
@param object $component Google address component object
@return Address | [
"update",
"address",
"from",
"google",
"address",
"component"
] | 5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d | https://github.com/juskiewicz/Geolocation/blob/5d3cd393961b92bdfbe2dfe631fbfb62c72dc36d/src/Build/AddressBuild.php#L60-L112 |
22,898 | surebert/surebert-framework | src/sb/Cache/FileSystem.php | FileSystem.clearDir | protected function clearDir($dir)
{
$iterator = new \DirectoryIterator($dir);
foreach ($iterator as $file) {
if ($file->isDir() && !$file->isDot() && !preg_match("~\.~", $file)) {
$this->clearDir($file->getPathname());
if (!\rmdir($file->getPathname())) {... | php | protected function clearDir($dir)
{
$iterator = new \DirectoryIterator($dir);
foreach ($iterator as $file) {
if ($file->isDir() && !$file->isDot() && !preg_match("~\.~", $file)) {
$this->clearDir($file->getPathname());
if (!\rmdir($file->getPathname())) {... | [
"protected",
"function",
"clearDir",
"(",
"$",
"dir",
")",
"{",
"$",
"iterator",
"=",
"new",
"\\",
"DirectoryIterator",
"(",
"$",
"dir",
")",
";",
"foreach",
"(",
"$",
"iterator",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"file",
"->",
"isDir",
... | Clears out the contents of a cache directory
@param $dir
@return boolean | [
"Clears",
"out",
"the",
"contents",
"of",
"a",
"cache",
"directory"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/FileSystem.php#L177-L195 |
22,899 | surebert/surebert-framework | src/sb/Cache/FileSystem.php | FileSystem.catalogKeyDelete | protected function catalogKeyDelete($key)
{
$catalog = $this->fetch($this->catalog_key);
$catalog = \is_array($catalog) ? $catalog : Array();
if (isset($catalog[$key])) {
unset($catalog[$key]);
};
return $this->store('/sb_Cache_Catalog', $catalog);
} | php | protected function catalogKeyDelete($key)
{
$catalog = $this->fetch($this->catalog_key);
$catalog = \is_array($catalog) ? $catalog : Array();
if (isset($catalog[$key])) {
unset($catalog[$key]);
};
return $this->store('/sb_Cache_Catalog', $catalog);
} | [
"protected",
"function",
"catalogKeyDelete",
"(",
"$",
"key",
")",
"{",
"$",
"catalog",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"this",
"->",
"catalog_key",
")",
";",
"$",
"catalog",
"=",
"\\",
"is_array",
"(",
"$",
"catalog",
")",
"?",
"$",
"cata... | Deletes a key from the catalog
@param string $key The key to delete
@return boolean | [
"Deletes",
"a",
"key",
"from",
"the",
"catalog"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/FileSystem.php#L226-L235 |
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.