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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,100 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination.previous | public function previous($marker = null)
{
$html = '';
$marker === null and $marker = $this->template['previous-marker'];
if ($this->config['total_pages'] > 1)
{
if ($this->config['calculated_page'] == 1)
{
$html = str_replace(
'{link}',
str_replace(array('{uri}', '{page}'), array('... | php | public function previous($marker = null)
{
$html = '';
$marker === null and $marker = $this->template['previous-marker'];
if ($this->config['total_pages'] > 1)
{
if ($this->config['calculated_page'] == 1)
{
$html = str_replace(
'{link}',
str_replace(array('{uri}', '{page}'), array('... | [
"public",
"function",
"previous",
"(",
"$",
"marker",
"=",
"null",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"marker",
"===",
"null",
"and",
"$",
"marker",
"=",
"$",
"this",
"->",
"template",
"[",
"'previous-marker'",
"]",
";",
"if",
"(",
"$",
"t... | Pagination "Previous" link
@param string $value optional text to display in the link
@return string Markup for the 'previous' page number link | [
"Pagination",
"Previous",
"link"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L396-L428 |
10,101 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination.next | public function next($marker = null)
{
$html = '';
$marker === null and $marker = $this->template['next-marker'];
if ($this->config['total_pages'] > 1)
{
if ($this->config['calculated_page'] == $this->config['total_pages'])
{
$html = str_replace(
'{link}',
str_replace(array('{uri}',... | php | public function next($marker = null)
{
$html = '';
$marker === null and $marker = $this->template['next-marker'];
if ($this->config['total_pages'] > 1)
{
if ($this->config['calculated_page'] == $this->config['total_pages'])
{
$html = str_replace(
'{link}',
str_replace(array('{uri}',... | [
"public",
"function",
"next",
"(",
"$",
"marker",
"=",
"null",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"marker",
"===",
"null",
"and",
"$",
"marker",
"=",
"$",
"this",
"->",
"template",
"[",
"'next-marker'",
"]",
";",
"if",
"(",
"$",
"this",
... | Pagination "Next" link
@param string $value optional text to display in the link
@return string Markup for the 'next' page number link | [
"Pagination",
"Next",
"link"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L437-L468 |
10,102 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination.last | public function last($marker = null)
{
$html = '';
$marker === null and $marker = $this->template['last-marker'];
if ($this->config['show_last'])
{
if ($this->config['total_pages'] > 1 and $this->config['calculated_page'] != $this->config['total_pages'])
{
$html = str_replace(
'{link}',
s... | php | public function last($marker = null)
{
$html = '';
$marker === null and $marker = $this->template['last-marker'];
if ($this->config['show_last'])
{
if ($this->config['total_pages'] > 1 and $this->config['calculated_page'] != $this->config['total_pages'])
{
$html = str_replace(
'{link}',
s... | [
"public",
"function",
"last",
"(",
"$",
"marker",
"=",
"null",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"marker",
"===",
"null",
"and",
"$",
"marker",
"=",
"$",
"this",
"->",
"template",
"[",
"'last-marker'",
"]",
";",
"if",
"(",
"$",
"this",
... | Pagination "Last" link
@param string $value optional text to display in the link
@return string Markup for the 'last' page number link | [
"Pagination",
"Last",
"link"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L477-L506 |
10,103 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination._recalculate | protected function _recalculate()
{
// calculate the number of pages
$this->config['total_pages'] = (int) ceil($this->config['total_items'] / $this->config['per_page']) ?: 1;
// get the current page number, either from the one set, or from the URI or the query string
if ($this->config['current_page'])
{
... | php | protected function _recalculate()
{
// calculate the number of pages
$this->config['total_pages'] = (int) ceil($this->config['total_items'] / $this->config['per_page']) ?: 1;
// get the current page number, either from the one set, or from the URI or the query string
if ($this->config['current_page'])
{
... | [
"protected",
"function",
"_recalculate",
"(",
")",
"{",
"// calculate the number of pages",
"$",
"this",
"->",
"config",
"[",
"'total_pages'",
"]",
"=",
"(",
"int",
")",
"ceil",
"(",
"$",
"this",
"->",
"config",
"[",
"'total_items'",
"]",
"/",
"$",
"this",
... | Prepares vars for creating links | [
"Prepares",
"vars",
"for",
"creating",
"links"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L511-L545 |
10,104 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/pagination.php | Pagination._validate | protected function _validate($name, $value)
{
switch ($name)
{
case 'offset':
case 'total_items':
// make sure it's an integer
if ($value != intval($value))
{
$value = 0;
}
// and that it's within bounds
$value = max(0, $value);
break;
// integer or string
case 'uri_se... | php | protected function _validate($name, $value)
{
switch ($name)
{
case 'offset':
case 'total_items':
// make sure it's an integer
if ($value != intval($value))
{
$value = 0;
}
// and that it's within bounds
$value = max(0, $value);
break;
// integer or string
case 'uri_se... | [
"protected",
"function",
"_validate",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'offset'",
":",
"case",
"'total_items'",
":",
"// make sure it's an integer",
"if",
"(",
"$",
"value",
"!=",
"intval",
"(",
... | Validate the input configuration | [
"Validate",
"the",
"input",
"configuration"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/pagination.php#L620-L687 |
10,105 | duellsy/pockpack | src/Duellsy/Pockpack/Pockpack.php | Pockpack.send | public function send(PockpackQueue $queue = null)
{
if( is_null($queue) ) {
throw new NoPockpackQueueException();
}
$params = array(
'actions' => json_encode($queue->getActions()),
'consumer_key' => $this->consumer_key,
'access_token' ... | php | public function send(PockpackQueue $queue = null)
{
if( is_null($queue) ) {
throw new NoPockpackQueueException();
}
$params = array(
'actions' => json_encode($queue->getActions()),
'consumer_key' => $this->consumer_key,
'access_token' ... | [
"public",
"function",
"send",
"(",
"PockpackQueue",
"$",
"queue",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"queue",
")",
")",
"{",
"throw",
"new",
"NoPockpackQueueException",
"(",
")",
";",
"}",
"$",
"params",
"=",
"array",
"(",
"'actions... | Responsible for sending the request to the pocket API
@param string $consumer_key
@param string $access_token
@param array $actions | [
"Responsible",
"for",
"sending",
"the",
"request",
"to",
"the",
"pocket",
"API"
] | b38b9942631ae786c6ed953da65f666ea9305f3c | https://github.com/duellsy/pockpack/blob/b38b9942631ae786c6ed953da65f666ea9305f3c/src/Duellsy/Pockpack/Pockpack.php#L36-L57 |
10,106 | duellsy/pockpack | src/Duellsy/Pockpack/Pockpack.php | Pockpack.retrieve | public function retrieve($options = array(), $isArray = false)
{
$params = array(
'consumer_key' => $this->consumer_key,
'access_token' => $this->access_token
);
// combine the creds with any options sent
$params = array_merge($params, $options);
$... | php | public function retrieve($options = array(), $isArray = false)
{
$params = array(
'consumer_key' => $this->consumer_key,
'access_token' => $this->access_token
);
// combine the creds with any options sent
$params = array_merge($params, $options);
$... | [
"public",
"function",
"retrieve",
"(",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"isArray",
"=",
"false",
")",
"{",
"$",
"params",
"=",
"array",
"(",
"'consumer_key'",
"=>",
"$",
"this",
"->",
"consumer_key",
",",
"'access_token'",
"=>",
"$",
"... | Retrieve the data from the pocket API
@param array $options options to filter the data
@param boolean $isArray if decode JSON to array
@return array | [
"Retrieve",
"the",
"data",
"from",
"the",
"pocket",
"API"
] | b38b9942631ae786c6ed953da65f666ea9305f3c | https://github.com/duellsy/pockpack/blob/b38b9942631ae786c6ed953da65f666ea9305f3c/src/Duellsy/Pockpack/Pockpack.php#L67-L85 |
10,107 | Gelembjuk/mail | src/Gelembjuk/Mail/EmailFormat.php | EmailFormat.fetchTemplate | public function fetchTemplate($template,$data = array(),$outtemplate = null) {
// template is required
if (trim($template) == '') {
throw new \Exception('No template to format email');
}
$templatedata = $this->getTemplateData($template);
// use default out template if is not provided
if ($outtempla... | php | public function fetchTemplate($template,$data = array(),$outtemplate = null) {
// template is required
if (trim($template) == '') {
throw new \Exception('No template to format email');
}
$templatedata = $this->getTemplateData($template);
// use default out template if is not provided
if ($outtempla... | [
"public",
"function",
"fetchTemplate",
"(",
"$",
"template",
",",
"$",
"data",
"=",
"array",
"(",
")",
",",
"$",
"outtemplate",
"=",
"null",
")",
"{",
"// template is required",
"if",
"(",
"trim",
"(",
"$",
"template",
")",
"==",
"''",
")",
"{",
"throw... | Generate email body and subject based on templates and options
@param string $template Email template file
@param array $data Template data to fetch (insert in a template)
@param string $outtemplate Out template to use for email. Default is `default` (plus prefix). Set to empty string to skip out template
@return arr... | [
"Generate",
"email",
"body",
"and",
"subject",
"based",
"on",
"templates",
"and",
"options"
] | c2dfa5aee0e49af1ea7803fb056c614b09921a9d | https://github.com/Gelembjuk/mail/blob/c2dfa5aee0e49af1ea7803fb056c614b09921a9d/src/Gelembjuk/Mail/EmailFormat.php#L152-L219 |
10,108 | Gelembjuk/mail | src/Gelembjuk/Mail/EmailFormat.php | EmailFormat.getTemplateData | protected function getTemplateData($template) {
// firstly, check for current locale, if it was set
if ($this->locale != '') {
$tdata = $this->getTemplateDataForLocale($template,$this->locale);
// found for this locale. return
if (is_array($tdata)) {
return $tdata;
}
}
// check for defaul... | php | protected function getTemplateData($template) {
// firstly, check for current locale, if it was set
if ($this->locale != '') {
$tdata = $this->getTemplateDataForLocale($template,$this->locale);
// found for this locale. return
if (is_array($tdata)) {
return $tdata;
}
}
// check for defaul... | [
"protected",
"function",
"getTemplateData",
"(",
"$",
"template",
")",
"{",
"// firstly, check for current locale, if it was set",
"if",
"(",
"$",
"this",
"->",
"locale",
"!=",
"''",
")",
"{",
"$",
"tdata",
"=",
"$",
"this",
"->",
"getTemplateDataForLocale",
"(",
... | Returns template data according to locale settings
@param string $template Template file | [
"Returns",
"template",
"data",
"according",
"to",
"locale",
"settings"
] | c2dfa5aee0e49af1ea7803fb056c614b09921a9d | https://github.com/Gelembjuk/mail/blob/c2dfa5aee0e49af1ea7803fb056c614b09921a9d/src/Gelembjuk/Mail/EmailFormat.php#L225-L252 |
10,109 | Gelembjuk/mail | src/Gelembjuk/Mail/EmailFormat.php | EmailFormat.getTemplateDataForLocale | protected function getTemplateDataForLocale($template,$locale) {
// path to document with subjects
$metafile = $this->templatespath.'/'.$locale.'/subjects.xml';
if (!file_exists($metafile)) {
// file with subjects not found
return null;
}
// load and parse document with subjects
$xml = @file_get... | php | protected function getTemplateDataForLocale($template,$locale) {
// path to document with subjects
$metafile = $this->templatespath.'/'.$locale.'/subjects.xml';
if (!file_exists($metafile)) {
// file with subjects not found
return null;
}
// load and parse document with subjects
$xml = @file_get... | [
"protected",
"function",
"getTemplateDataForLocale",
"(",
"$",
"template",
",",
"$",
"locale",
")",
"{",
"// path to document with subjects",
"$",
"metafile",
"=",
"$",
"this",
"->",
"templatespath",
".",
"'/'",
".",
"$",
"locale",
".",
"'/subjects.xml'",
";",
"... | Get template information for specified locale
@param string $template Template file
@param string $locale Locale or empty string
@return array Template subject and file path | [
"Get",
"template",
"information",
"for",
"specified",
"locale"
] | c2dfa5aee0e49af1ea7803fb056c614b09921a9d | https://github.com/Gelembjuk/mail/blob/c2dfa5aee0e49af1ea7803fb056c614b09921a9d/src/Gelembjuk/Mail/EmailFormat.php#L261-L298 |
10,110 | Gelembjuk/mail | src/Gelembjuk/Mail/EmailFormat.php | EmailFormat.getOutTemplate | protected function getOutTemplate($template = 'default') {
// check for current locale
if ($this->locale != '') {
$templatefile = $this->templatespath.'/'.$this->locale.'/'.$this->outtemplateprefix.$template.'.htm';
if (file_exists($templatefile)) {
return $this->locale.'/'.$this->outtemplateprefix.$t... | php | protected function getOutTemplate($template = 'default') {
// check for current locale
if ($this->locale != '') {
$templatefile = $this->templatespath.'/'.$this->locale.'/'.$this->outtemplateprefix.$template.'.htm';
if (file_exists($templatefile)) {
return $this->locale.'/'.$this->outtemplateprefix.$t... | [
"protected",
"function",
"getOutTemplate",
"(",
"$",
"template",
"=",
"'default'",
")",
"{",
"// check for current locale",
"if",
"(",
"$",
"this",
"->",
"locale",
"!=",
"''",
")",
"{",
"$",
"templatefile",
"=",
"$",
"this",
"->",
"templatespath",
".",
"'/'"... | Return template file for out template
@param string $template Out template name without a prefix
@return string Template file relative path | [
"Return",
"template",
"file",
"for",
"out",
"template"
] | c2dfa5aee0e49af1ea7803fb056c614b09921a9d | https://github.com/Gelembjuk/mail/blob/c2dfa5aee0e49af1ea7803fb056c614b09921a9d/src/Gelembjuk/Mail/EmailFormat.php#L306-L334 |
10,111 | ForceLabsDev/framework | src/Mvc/Controller.php | Controller.view | protected function view($file, array $params = []): TwigRenderer
{
$this->eventHandler->trigger(BeforeLoadView::class, [
'file' => $file,
'params' => $params,
]);
/** @var TwigRenderer $renderer */
$renderer = $this->app->make(TwigRenderer::class);
r... | php | protected function view($file, array $params = []): TwigRenderer
{
$this->eventHandler->trigger(BeforeLoadView::class, [
'file' => $file,
'params' => $params,
]);
/** @var TwigRenderer $renderer */
$renderer = $this->app->make(TwigRenderer::class);
r... | [
"protected",
"function",
"view",
"(",
"$",
"file",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
":",
"TwigRenderer",
"{",
"$",
"this",
"->",
"eventHandler",
"->",
"trigger",
"(",
"BeforeLoadView",
"::",
"class",
",",
"[",
"'file'",
"=>",
"$",
"file... | Loads the given view file with the given parameters.
@param string $file
@param array $params
@return TwigRenderer | [
"Loads",
"the",
"given",
"view",
"file",
"with",
"the",
"given",
"parameters",
"."
] | e2288582432857771e85c9859acd6d32e5f2f9b7 | https://github.com/ForceLabsDev/framework/blob/e2288582432857771e85c9859acd6d32e5f2f9b7/src/Mvc/Controller.php#L45-L56 |
10,112 | douyacun/dyc-pay | src/Gateways/Wechat/Gateway.php | Gateway.preOrder | protected function preOrder($endpoint, $payload): Collection
{
$payload['sign'] = Support::generateSign($payload, $this->config->get('key'));
Log::debug('Pre Order:', [$endpoint, $payload]);
return Support::requestApi($endpoint, $payload, $this->config->get('key'));
} | php | protected function preOrder($endpoint, $payload): Collection
{
$payload['sign'] = Support::generateSign($payload, $this->config->get('key'));
Log::debug('Pre Order:', [$endpoint, $payload]);
return Support::requestApi($endpoint, $payload, $this->config->get('key'));
} | [
"protected",
"function",
"preOrder",
"(",
"$",
"endpoint",
",",
"$",
"payload",
")",
":",
"Collection",
"{",
"$",
"payload",
"[",
"'sign'",
"]",
"=",
"Support",
"::",
"generateSign",
"(",
"$",
"payload",
",",
"$",
"this",
"->",
"config",
"->",
"get",
"... | Preorder an order.
@author yansongda <me@yansongda.cn>
@param string $endpoint
@param array $payload
@return Collection | [
"Preorder",
"an",
"order",
"."
] | 9fac85d375bdd52b872c3fa8174920e40609f6f2 | https://github.com/douyacun/dyc-pay/blob/9fac85d375bdd52b872c3fa8174920e40609f6f2/src/Gateways/Wechat/Gateway.php#L71-L78 |
10,113 | tekkla/core-html | Core/Html/Controls/OptionGroup.php | OptionGroup.& | public function &createOption($text = '', $value = '')
{
$option = $this->factory->create('Form\Checkbox');
if ($text) {
$option->setInner($text);
}
if ($value) {
$option->setValue($value);
}
$this->controls[] = $option;
return $opt... | php | public function &createOption($text = '', $value = '')
{
$option = $this->factory->create('Form\Checkbox');
if ($text) {
$option->setInner($text);
}
if ($value) {
$option->setValue($value);
}
$this->controls[] = $option;
return $opt... | [
"public",
"function",
"&",
"createOption",
"(",
"$",
"text",
"=",
"''",
",",
"$",
"value",
"=",
"''",
")",
"{",
"$",
"option",
"=",
"$",
"this",
"->",
"factory",
"->",
"create",
"(",
"'Form\\Checkbox'",
")",
";",
"if",
"(",
"$",
"text",
")",
"{",
... | Add an option to the optionslist and returns a reference to it.
@return \Core\Html\Form\Checkbox | [
"Add",
"an",
"option",
"to",
"the",
"optionslist",
"and",
"returns",
"a",
"reference",
"to",
"it",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/OptionGroup.php#L28-L43 |
10,114 | gios-asu/nectary | src/daos/sql-query-builder.php | Select_SQL_Query_Builder.limit | public function limit( $new_limit ) {
$this->limit = $new_limit;
if ( false === starts_with( $new_limit . '', ':' ) ) {
$this->limit = (int) $new_limit;
}
} | php | public function limit( $new_limit ) {
$this->limit = $new_limit;
if ( false === starts_with( $new_limit . '', ':' ) ) {
$this->limit = (int) $new_limit;
}
} | [
"public",
"function",
"limit",
"(",
"$",
"new_limit",
")",
"{",
"$",
"this",
"->",
"limit",
"=",
"$",
"new_limit",
";",
"if",
"(",
"false",
"===",
"starts_with",
"(",
"$",
"new_limit",
".",
"''",
",",
"':'",
")",
")",
"{",
"$",
"this",
"->",
"limit... | For setting a limit on the query other than the default
@param int|string $new_limit | [
"For",
"setting",
"a",
"limit",
"on",
"the",
"query",
"other",
"than",
"the",
"default"
] | f972c737a9036a3090652950a1309a62c07d86c0 | https://github.com/gios-asu/nectary/blob/f972c737a9036a3090652950a1309a62c07d86c0/src/daos/sql-query-builder.php#L78-L83 |
10,115 | gios-asu/nectary | src/daos/sql-query-builder.php | Select_SQL_Query_Builder.offset | public function offset( $offset ) {
$this->offset = $offset;
if ( false === starts_with( $offset . '', ':' ) ) {
$this->offset = (int) $offset;
}
} | php | public function offset( $offset ) {
$this->offset = $offset;
if ( false === starts_with( $offset . '', ':' ) ) {
$this->offset = (int) $offset;
}
} | [
"public",
"function",
"offset",
"(",
"$",
"offset",
")",
"{",
"$",
"this",
"->",
"offset",
"=",
"$",
"offset",
";",
"if",
"(",
"false",
"===",
"starts_with",
"(",
"$",
"offset",
".",
"''",
",",
"':'",
")",
")",
"{",
"$",
"this",
"->",
"offset",
"... | For setting a offset on the query other than the default
@param int|string $offset | [
"For",
"setting",
"a",
"offset",
"on",
"the",
"query",
"other",
"than",
"the",
"default"
] | f972c737a9036a3090652950a1309a62c07d86c0 | https://github.com/gios-asu/nectary/blob/f972c737a9036a3090652950a1309a62c07d86c0/src/daos/sql-query-builder.php#L90-L95 |
10,116 | gios-asu/nectary | src/daos/sql-query-builder.php | Select_SQL_Query_Builder.bind_value | public function bind_value( string $name, $value, $data_type = false ) {
$this->values_to_bind[ $name ] = array(
'value' => $value,
'data_type' => $data_type,
);
} | php | public function bind_value( string $name, $value, $data_type = false ) {
$this->values_to_bind[ $name ] = array(
'value' => $value,
'data_type' => $data_type,
);
} | [
"public",
"function",
"bind_value",
"(",
"string",
"$",
"name",
",",
"$",
"value",
",",
"$",
"data_type",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"values_to_bind",
"[",
"$",
"name",
"]",
"=",
"array",
"(",
"'value'",
"=>",
"$",
"value",
",",
"'dat... | Adds a variable to be bound to in the prepared statement
@param string $name
@param mixed $value
@param bool|string $data_type | [
"Adds",
"a",
"variable",
"to",
"be",
"bound",
"to",
"in",
"the",
"prepared",
"statement"
] | f972c737a9036a3090652950a1309a62c07d86c0 | https://github.com/gios-asu/nectary/blob/f972c737a9036a3090652950a1309a62c07d86c0/src/daos/sql-query-builder.php#L150-L155 |
10,117 | gios-asu/nectary | src/daos/sql-query-builder.php | Select_SQL_Query_Builder.get_sql | public function get_sql() : string {
if ( empty( $this->columns_to_select ) ) {
// this should be the default behavior
$this->columns_to_select = [ '*' ];
}
$from = ' FROM ' . implode( ', ', $this->from ) . ' ';
if ( ! empty( $this->joins ) ) {
$from .= $this->joins;
}
$from .= 'WHERE ' . $this... | php | public function get_sql() : string {
if ( empty( $this->columns_to_select ) ) {
// this should be the default behavior
$this->columns_to_select = [ '*' ];
}
$from = ' FROM ' . implode( ', ', $this->from ) . ' ';
if ( ! empty( $this->joins ) ) {
$from .= $this->joins;
}
$from .= 'WHERE ' . $this... | [
"public",
"function",
"get_sql",
"(",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"columns_to_select",
")",
")",
"{",
"// this should be the default behavior",
"$",
"this",
"->",
"columns_to_select",
"=",
"[",
"'*'",
"]",
";",
"}",
... | Uses the current state of the object to build the sql statement
@return string : the sql select statement as a string | [
"Uses",
"the",
"current",
"state",
"of",
"the",
"object",
"to",
"build",
"the",
"sql",
"statement"
] | f972c737a9036a3090652950a1309a62c07d86c0 | https://github.com/gios-asu/nectary/blob/f972c737a9036a3090652950a1309a62c07d86c0/src/daos/sql-query-builder.php#L162-L192 |
10,118 | orkestra/orkestra-transactor | lib/Orkestra/Transactor/AbstractTransactor.php | AbstractTransactor.supportsType | public function supportsType(Transaction\TransactionType $type = null)
{
return in_array((null === $type ? null : $type->getValue()), static::$supportedTypes);
} | php | public function supportsType(Transaction\TransactionType $type = null)
{
return in_array((null === $type ? null : $type->getValue()), static::$supportedTypes);
} | [
"public",
"function",
"supportsType",
"(",
"Transaction",
"\\",
"TransactionType",
"$",
"type",
"=",
"null",
")",
"{",
"return",
"in_array",
"(",
"(",
"null",
"===",
"$",
"type",
"?",
"null",
":",
"$",
"type",
"->",
"getValue",
"(",
")",
")",
",",
"sta... | Returns true if this Transactor supports a given Transaction type
@param \Orkestra\Transactor\Entity\Transaction\TransactionType|null $type
@return boolean True if supported | [
"Returns",
"true",
"if",
"this",
"Transactor",
"supports",
"a",
"given",
"Transaction",
"type"
] | 0edaeb756f22c2d25d6fa2da4793df9b343f8811 | https://github.com/orkestra/orkestra-transactor/blob/0edaeb756f22c2d25d6fa2da4793df9b343f8811/lib/Orkestra/Transactor/AbstractTransactor.php#L136-L139 |
10,119 | orkestra/orkestra-transactor | lib/Orkestra/Transactor/AbstractTransactor.php | AbstractTransactor.supportsNetwork | public function supportsNetwork(Transaction\NetworkType $network = null)
{
return in_array((null === $network ? null : $network->getValue()), static::$supportedNetworks);
} | php | public function supportsNetwork(Transaction\NetworkType $network = null)
{
return in_array((null === $network ? null : $network->getValue()), static::$supportedNetworks);
} | [
"public",
"function",
"supportsNetwork",
"(",
"Transaction",
"\\",
"NetworkType",
"$",
"network",
"=",
"null",
")",
"{",
"return",
"in_array",
"(",
"(",
"null",
"===",
"$",
"network",
"?",
"null",
":",
"$",
"network",
"->",
"getValue",
"(",
")",
")",
","... | Returns true if this Transactor supports a given Network type
@param \Orkestra\Transactor\Entity\Transaction\NetworkType|null $network
@return boolean True if supported | [
"Returns",
"true",
"if",
"this",
"Transactor",
"supports",
"a",
"given",
"Network",
"type"
] | 0edaeb756f22c2d25d6fa2da4793df9b343f8811 | https://github.com/orkestra/orkestra-transactor/blob/0edaeb756f22c2d25d6fa2da4793df9b343f8811/lib/Orkestra/Transactor/AbstractTransactor.php#L148-L151 |
10,120 | the-kbA-team/typecast | src/TypeCastArray.php | TypeCastArray.cast | public function cast($array)
{
if (!is_array($array)) {
throw new \InvalidArgumentException(sprintf('Expected an array, but got %s!', gettype($array)));
}
foreach ($array as $key => $value) {
//is this a repeating array?
$mapKey = $this->mapKey($key);
... | php | public function cast($array)
{
if (!is_array($array)) {
throw new \InvalidArgumentException(sprintf('Expected an array, but got %s!', gettype($array)));
}
foreach ($array as $key => $value) {
//is this a repeating array?
$mapKey = $this->mapKey($key);
... | [
"public",
"function",
"cast",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Expected an array, but got %s!'",
",",
"gettype",
"(",
"$",
"a... | Cast the values of the given array to the typecast information defined in this
class.
@param array $array The raw data to be typecasted.
@return array The same data structure as the input, but casted to the
typecasting information defined in this
class.
@throws \InvalidArgumentException in case the given value does no... | [
"Cast",
"the",
"values",
"of",
"the",
"given",
"array",
"to",
"the",
"typecast",
"information",
"defined",
"in",
"this",
"class",
"."
] | 89939ad0dbf92f6ef09c48764347f473d51e8786 | https://github.com/the-kbA-team/typecast/blob/89939ad0dbf92f6ef09c48764347f473d51e8786/src/TypeCastArray.php#L85-L112 |
10,121 | samurai-fw/samurai | src/Samurai/Component/Migration/Helper.php | Helper.getSchemaFile | public function getSchemaFile($database)
{
$dir = $this->loader->find($this->application->config('directory.database.schema'))->first();
return $dir . DS . $this->schemaFileNameStrategy($database);
} | php | public function getSchemaFile($database)
{
$dir = $this->loader->find($this->application->config('directory.database.schema'))->first();
return $dir . DS . $this->schemaFileNameStrategy($database);
} | [
"public",
"function",
"getSchemaFile",
"(",
"$",
"database",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"loader",
"->",
"find",
"(",
"$",
"this",
"->",
"application",
"->",
"config",
"(",
"'directory.database.schema'",
")",
")",
"->",
"first",
"(",
")... | get schema file
@param string $database
@return string | [
"get",
"schema",
"file"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Migration/Helper.php#L115-L119 |
10,122 | samurai-fw/samurai | src/Samurai/Component/Migration/Helper.php | Helper.getSchemaYAMLFile | public function getSchemaYAMLFile($database)
{
$dir = $this->loader->find($this->application->config('directory.database.schema'))->first();
return $dir . DS . $this->schemaYAMLFileNameStrategy($database);
} | php | public function getSchemaYAMLFile($database)
{
$dir = $this->loader->find($this->application->config('directory.database.schema'))->first();
return $dir . DS . $this->schemaYAMLFileNameStrategy($database);
} | [
"public",
"function",
"getSchemaYAMLFile",
"(",
"$",
"database",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"loader",
"->",
"find",
"(",
"$",
"this",
"->",
"application",
"->",
"config",
"(",
"'directory.database.schema'",
")",
")",
"->",
"first",
"(",
... | get schema yaml file
@param string $database
@return string | [
"get",
"schema",
"yaml",
"file"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Migration/Helper.php#L128-L132 |
10,123 | imsamurai/cakephp-task-plugin | Lib/Task/TaskRunner.php | TaskRunner.start | public function start() {
ConnectionManager::getDataSource($this->_TaskServer->useDbConfig)->reconnect(array('persistent' => false));
$this->_Shell->out("Task #{$this->_task['id']} started");
$this->_task['started'] = $this->_getCurrentDateTime();
$this->_task['stderr'] = '';
$this->_task['stdout'] = '';
$t... | php | public function start() {
ConnectionManager::getDataSource($this->_TaskServer->useDbConfig)->reconnect(array('persistent' => false));
$this->_Shell->out("Task #{$this->_task['id']} started");
$this->_task['started'] = $this->_getCurrentDateTime();
$this->_task['stderr'] = '';
$this->_task['stdout'] = '';
$t... | [
"public",
"function",
"start",
"(",
")",
"{",
"ConnectionManager",
"::",
"getDataSource",
"(",
"$",
"this",
"->",
"_TaskServer",
"->",
"useDbConfig",
")",
"->",
"reconnect",
"(",
"array",
"(",
"'persistent'",
"=>",
"false",
")",
")",
";",
"$",
"this",
"->"... | Notify client about started task and run this task | [
"Notify",
"client",
"about",
"started",
"task",
"and",
"run",
"this",
"task"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/Lib/Task/TaskRunner.php#L87-L96 |
10,124 | imsamurai/cakephp-task-plugin | Lib/Task/TaskRunner.php | TaskRunner._stopped | protected function _stopped($manual = false) {
$this->_task = array(
'stdout' => $this->_Process->getOutput(),
'stderr' => $this->_Process->getErrorOutput(),
'stopped' => $this->_getCurrentDateTime(),
'process_id' => 0,
) + $this->_task;
$this->_TaskServer->stopped($this->_task, $manual);
$this->_... | php | protected function _stopped($manual = false) {
$this->_task = array(
'stdout' => $this->_Process->getOutput(),
'stderr' => $this->_Process->getErrorOutput(),
'stopped' => $this->_getCurrentDateTime(),
'process_id' => 0,
) + $this->_task;
$this->_TaskServer->stopped($this->_task, $manual);
$this->_... | [
"protected",
"function",
"_stopped",
"(",
"$",
"manual",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_task",
"=",
"array",
"(",
"'stdout'",
"=>",
"$",
"this",
"->",
"_Process",
"->",
"getOutput",
"(",
")",
",",
"'stderr'",
"=>",
"$",
"this",
"->",
"_... | Notify client about stopped task
@param bool $manual True means process stopped manually | [
"Notify",
"client",
"about",
"stopped",
"task"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/Lib/Task/TaskRunner.php#L103-L112 |
10,125 | imsamurai/cakephp-task-plugin | Lib/Task/TaskRunner.php | TaskRunner._argsToString | protected function _argsToString(array $arguments) {
$stringArguments = '';
foreach ($arguments as $name => $value) {
if (is_numeric($name)) {
$stringArguments .= ' ' . $value;
} else {
$stringArguments .= ' ' . $name . ' ' . ProcessUtils::escapeArgument($value);
}
}
return $stringArguments;
... | php | protected function _argsToString(array $arguments) {
$stringArguments = '';
foreach ($arguments as $name => $value) {
if (is_numeric($name)) {
$stringArguments .= ' ' . $value;
} else {
$stringArguments .= ' ' . $name . ' ' . ProcessUtils::escapeArgument($value);
}
}
return $stringArguments;
... | [
"protected",
"function",
"_argsToString",
"(",
"array",
"$",
"arguments",
")",
"{",
"$",
"stringArguments",
"=",
"''",
";",
"foreach",
"(",
"$",
"arguments",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"name",
")... | Convert array of arguments into string
@param array $arguments
@return string | [
"Convert",
"array",
"of",
"arguments",
"into",
"string"
] | 9d7bd9fa908abf0ae5c24f27aa829a39ac034961 | https://github.com/imsamurai/cakephp-task-plugin/blob/9d7bd9fa908abf0ae5c24f27aa829a39ac034961/Lib/Task/TaskRunner.php#L161-L172 |
10,126 | GroundSix/password | src/PasswordValidator.php | PasswordValidator.validate | public function validate(string $password): bool
{
foreach ($this->validators as $validator) {
$validator->validate($password);
}
return true;
} | php | public function validate(string $password): bool
{
foreach ($this->validators as $validator) {
$validator->validate($password);
}
return true;
} | [
"public",
"function",
"validate",
"(",
"string",
"$",
"password",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"validators",
"as",
"$",
"validator",
")",
"{",
"$",
"validator",
"->",
"validate",
"(",
"$",
"password",
")",
";",
"}",
"return... | Validates the given password against the current rule set.
@param string $password
@return bool True if the password is valid
@throws PasswordException If the password fails a validation attempt. | [
"Validates",
"the",
"given",
"password",
"against",
"the",
"current",
"rule",
"set",
"."
] | 83241a362051c28f09cd7cdcd0fbd03918ce0a5b | https://github.com/GroundSix/password/blob/83241a362051c28f09cd7cdcd0fbd03918ce0a5b/src/PasswordValidator.php#L45-L52 |
10,127 | jianfengye/hades | src/Hades/Container/Container.php | Container.bind | public function bind($contract, $class, $args = [])
{
$closure = function($class, $args) {
$reflect = new \ReflectionClass($class);
return $reflect->newInstanceArgs($args);
};
$this->bindings[$contract] = [
'type' => 'closure',
'closure' => $c... | php | public function bind($contract, $class, $args = [])
{
$closure = function($class, $args) {
$reflect = new \ReflectionClass($class);
return $reflect->newInstanceArgs($args);
};
$this->bindings[$contract] = [
'type' => 'closure',
'closure' => $c... | [
"public",
"function",
"bind",
"(",
"$",
"contract",
",",
"$",
"class",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"closure",
"=",
"function",
"(",
"$",
"class",
",",
"$",
"args",
")",
"{",
"$",
"reflect",
"=",
"new",
"\\",
"ReflectionClass",
... | the class will have new instance when use | [
"the",
"class",
"will",
"have",
"new",
"instance",
"when",
"use"
] | a0690d96dada070b4cf4b9ff63ab3aa024c34a67 | https://github.com/jianfengye/hades/blob/a0690d96dada070b4cf4b9ff63ab3aa024c34a67/src/Hades/Container/Container.php#L48-L65 |
10,128 | jianfengye/hades | src/Hades/Container/Container.php | Container.singleton | public function singleton($contract, $class, $args = [])
{
$reflect = new \ReflectionClass($class);
$instance = $reflect->newInstanceArgs($args);
$this->bindings[$contract] = [
'type' => 'singleton',
'instance' => $instance,
'class' => $class,
... | php | public function singleton($contract, $class, $args = [])
{
$reflect = new \ReflectionClass($class);
$instance = $reflect->newInstanceArgs($args);
$this->bindings[$contract] = [
'type' => 'singleton',
'instance' => $instance,
'class' => $class,
... | [
"public",
"function",
"singleton",
"(",
"$",
"contract",
",",
"$",
"class",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"reflect",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"instance",
"=",
"$",
"reflect",
"->",
"ne... | the class will instance one time when use | [
"the",
"class",
"will",
"instance",
"one",
"time",
"when",
"use"
] | a0690d96dada070b4cf4b9ff63ab3aa024c34a67 | https://github.com/jianfengye/hades/blob/a0690d96dada070b4cf4b9ff63ab3aa024c34a67/src/Hades/Container/Container.php#L69-L84 |
10,129 | jianfengye/hades | src/Hades/Container/Container.php | Container.make | public function make($contract)
{
if (empty($this->bindings[$contract])) {
throw new \LogicException('Not found contract:' . $contract);
}
$class = $this->bindings[$contract];
if ($class['type'] == 'closure') {
return call_user_func($class['closure'], $class[... | php | public function make($contract)
{
if (empty($this->bindings[$contract])) {
throw new \LogicException('Not found contract:' . $contract);
}
$class = $this->bindings[$contract];
if ($class['type'] == 'closure') {
return call_user_func($class['closure'], $class[... | [
"public",
"function",
"make",
"(",
"$",
"contract",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"bindings",
"[",
"$",
"contract",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Not found contract:'",
".",
"$",
"contract",
... | make some contract | [
"make",
"some",
"contract"
] | a0690d96dada070b4cf4b9ff63ab3aa024c34a67 | https://github.com/jianfengye/hades/blob/a0690d96dada070b4cf4b9ff63ab3aa024c34a67/src/Hades/Container/Container.php#L87-L101 |
10,130 | drmvc/helpers | src/Helpers/Arrays.php | Arrays.orderBy | public static function orderBy(): array
{
$args = \func_get_args();
$data = array_shift($args);
foreach ($args as $n => $field) {
if (\is_string($field)) {
$tmp = [];
foreach ($data as $key => $row) {
$tmp[$key] = $row[$field];
... | php | public static function orderBy(): array
{
$args = \func_get_args();
$data = array_shift($args);
foreach ($args as $n => $field) {
if (\is_string($field)) {
$tmp = [];
foreach ($data as $key => $row) {
$tmp[$key] = $row[$field];
... | [
"public",
"static",
"function",
"orderBy",
"(",
")",
":",
"array",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"$",
"data",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"n",
"=>",
"$",
"... | Order array by arguments
@return array | [
"Order",
"array",
"by",
"arguments"
] | 1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b | https://github.com/drmvc/helpers/blob/1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b/src/Helpers/Arrays.php#L16-L32 |
10,131 | drmvc/helpers | src/Helpers/Arrays.php | Arrays.equal | public static function equal(array $a, array $b): bool
{
// Elements count should be equal
$count_equal = (\count($a) === \count($b));
// Between the keys should not be differences
$difference = (array_diff($a, $b) === array_diff($b, $a));
return ($count_equal && $difference... | php | public static function equal(array $a, array $b): bool
{
// Elements count should be equal
$count_equal = (\count($a) === \count($b));
// Between the keys should not be differences
$difference = (array_diff($a, $b) === array_diff($b, $a));
return ($count_equal && $difference... | [
"public",
"static",
"function",
"equal",
"(",
"array",
"$",
"a",
",",
"array",
"$",
"b",
")",
":",
"bool",
"{",
"// Elements count should be equal",
"$",
"count_equal",
"=",
"(",
"\\",
"count",
"(",
"$",
"a",
")",
"===",
"\\",
"count",
"(",
"$",
"b",
... | Check if two arrays is equal, with same keys
@param array $a
@param array $b
@return bool | [
"Check",
"if",
"two",
"arrays",
"is",
"equal",
"with",
"same",
"keys"
] | 1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b | https://github.com/drmvc/helpers/blob/1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b/src/Helpers/Arrays.php#L58-L66 |
10,132 | drmvc/helpers | src/Helpers/Arrays.php | Arrays.dirToArr | public static function dirToArr($path): array
{
$result = [];
$dirContent = scandir($path, null);
foreach ($dirContent as $key => $value) {
// Exclude system dots folders
if (!\in_array($value, ['.', '..'])) {
if (is_dir($path . DIRECTORY_SEPARATOR . ... | php | public static function dirToArr($path): array
{
$result = [];
$dirContent = scandir($path, null);
foreach ($dirContent as $key => $value) {
// Exclude system dots folders
if (!\in_array($value, ['.', '..'])) {
if (is_dir($path . DIRECTORY_SEPARATOR . ... | [
"public",
"static",
"function",
"dirToArr",
"(",
"$",
"path",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"dirContent",
"=",
"scandir",
"(",
"$",
"path",
",",
"null",
")",
";",
"foreach",
"(",
"$",
"dirContent",
"as",
"$",
"key"... | Read any files and folder into some directory
@param string $path - Source directory with files
@return array | [
"Read",
"any",
"files",
"and",
"folder",
"into",
"some",
"directory"
] | 1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b | https://github.com/drmvc/helpers/blob/1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b/src/Helpers/Arrays.php#L74-L91 |
10,133 | drmvc/helpers | src/Helpers/Arrays.php | Arrays.searchMdObject | private static function searchMdObject($multi, array $target): array
{
return array_map(
function($element) use ($target) {
$exist = true;
foreach ($target as $skey => $svalue) {
$exist = $exist && isset($element->$skey) && ($element->$skey ===... | php | private static function searchMdObject($multi, array $target): array
{
return array_map(
function($element) use ($target) {
$exist = true;
foreach ($target as $skey => $svalue) {
$exist = $exist && isset($element->$skey) && ($element->$skey ===... | [
"private",
"static",
"function",
"searchMdObject",
"(",
"$",
"multi",
",",
"array",
"$",
"target",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"element",
")",
"use",
"(",
"$",
"target",
")",
"{",
"$",
"exist",
"=",
"true",... | Make search in MD object
@param object $multi
@param array $target
@return array | [
"Make",
"search",
"in",
"MD",
"object"
] | 1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b | https://github.com/drmvc/helpers/blob/1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b/src/Helpers/Arrays.php#L100-L112 |
10,134 | drmvc/helpers | src/Helpers/Arrays.php | Arrays.searchMd | public static function searchMd($multi, $target)
{
if (empty($target) || empty($multi)) {
return false;
}
$output = \is_object($multi)
? self::searchMdObject($multi, $target)
: self::searchMdArray($multi, $target);
$output = array_values(array_fi... | php | public static function searchMd($multi, $target)
{
if (empty($target) || empty($multi)) {
return false;
}
$output = \is_object($multi)
? self::searchMdObject($multi, $target)
: self::searchMdArray($multi, $target);
$output = array_values(array_fi... | [
"public",
"static",
"function",
"searchMd",
"(",
"$",
"multi",
",",
"$",
"target",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"target",
")",
"||",
"empty",
"(",
"$",
"multi",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"output",
"=",
"\\",
"is_... | Find nested array inside two-dimensional array
TODO: Not work with objects
@param array|object $multi where need to make search
@param array $target what we want to find
@return bool|array | [
"Find",
"nested",
"array",
"inside",
"two",
"-",
"dimensional",
"array"
] | 1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b | https://github.com/drmvc/helpers/blob/1a9a3f8d4c655b48ddbd61a81eb15688ad207d7b/src/Helpers/Arrays.php#L144-L158 |
10,135 | Happykiller/ODA_FW_SERVER | dist/OdaLibInterface.php | OdaLibInterface.addDataStr | public function addDataStr($p_params){
try {
if(is_object($p_params)){
if(is_object($p_params->value)){
$this->object_retour->strErreur = "The value is not a string.";
$this->object_retour->statut = self::STATE_ERROR;
die();... | php | public function addDataStr($p_params){
try {
if(is_object($p_params)){
if(is_object($p_params->value)){
$this->object_retour->strErreur = "The value is not a string.";
$this->object_retour->statut = self::STATE_ERROR;
die();... | [
"public",
"function",
"addDataStr",
"(",
"$",
"p_params",
")",
"{",
"try",
"{",
"if",
"(",
"is_object",
"(",
"$",
"p_params",
")",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"p_params",
"->",
"value",
")",
")",
"{",
"$",
"this",
"->",
"object_retour... | Attetion, not handle error from the OdaRetourSQL.
$p_params :
- string value
- string label
or
$p_params = string
@param stdClass|string p_params | [
"Attetion",
"not",
"handle",
"error",
"from",
"the",
"OdaRetourSQL",
"."
] | edcede606239063a1baa469db7b46b78f155844a | https://github.com/Happykiller/ODA_FW_SERVER/blob/edcede606239063a1baa469db7b46b78f155844a/dist/OdaLibInterface.php#L428-L448 |
10,136 | Happykiller/ODA_FW_SERVER | dist/OdaLibInterface.php | OdaLibInterface.dieInError | public function dieInError($message, $errorCode = self::STATE_ERROR){
$this->object_retour->strErreur = $message;
$this->object_retour->statut = $errorCode;
die();
} | php | public function dieInError($message, $errorCode = self::STATE_ERROR){
$this->object_retour->strErreur = $message;
$this->object_retour->statut = $errorCode;
die();
} | [
"public",
"function",
"dieInError",
"(",
"$",
"message",
",",
"$",
"errorCode",
"=",
"self",
"::",
"STATE_ERROR",
")",
"{",
"$",
"this",
"->",
"object_retour",
"->",
"strErreur",
"=",
"$",
"message",
";",
"$",
"this",
"->",
"object_retour",
"->",
"statut",... | To die an interface
@param String $message | [
"To",
"die",
"an",
"interface"
] | edcede606239063a1baa469db7b46b78f155844a | https://github.com/Happykiller/ODA_FW_SERVER/blob/edcede606239063a1baa469db7b46b78f155844a/dist/OdaLibInterface.php#L805-L809 |
10,137 | marando/phpSOFA | src/Marando/IAU/iauGmst06.php | iauGmst06.Gmst06 | public static function Gmst06($uta, $utb, $tta, $ttb) {
$t;
$gmst;
/* TT Julian centuries since J2000.0. */
$t = (($tta - DJ00) + $ttb) / DJC;
/* Greenwich mean sidereal time, IAU 2006. */
$gmst = IAU::Anp(IAU::Era00($uta, $utb) +
( 0.014506 +
( 4612.156... | php | public static function Gmst06($uta, $utb, $tta, $ttb) {
$t;
$gmst;
/* TT Julian centuries since J2000.0. */
$t = (($tta - DJ00) + $ttb) / DJC;
/* Greenwich mean sidereal time, IAU 2006. */
$gmst = IAU::Anp(IAU::Era00($uta, $utb) +
( 0.014506 +
( 4612.156... | [
"public",
"static",
"function",
"Gmst06",
"(",
"$",
"uta",
",",
"$",
"utb",
",",
"$",
"tta",
",",
"$",
"ttb",
")",
"{",
"$",
"t",
";",
"$",
"gmst",
";",
"/* TT Julian centuries since J2000.0. */",
"$",
"t",
"=",
"(",
"(",
"$",
"tta",
"-",
"DJ00",
"... | - - - - - - - - - -
i a u G m s t 0 6
- - - - - - - - - -
Greenwich mean sidereal time (consistent with IAU 2006 precession).
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: canonical model.
Given:
uta,utb double UT1 as a ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"G",
"m",
"s",
"t",
"0",
"6",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauGmst06.php#L75-L92 |
10,138 | nano7/Http | src/RedirectResponse.php | RedirectResponse.withStatus | public function withStatus($message, $type = 'success')
{
$status = [
'message' => $message,
'type' => $type,
];
$this->with('status', $status);
return $this;
} | php | public function withStatus($message, $type = 'success')
{
$status = [
'message' => $message,
'type' => $type,
];
$this->with('status', $status);
return $this;
} | [
"public",
"function",
"withStatus",
"(",
"$",
"message",
",",
"$",
"type",
"=",
"'success'",
")",
"{",
"$",
"status",
"=",
"[",
"'message'",
"=>",
"$",
"message",
",",
"'type'",
"=>",
"$",
"type",
",",
"]",
";",
"$",
"this",
"->",
"with",
"(",
"'st... | Flash a container of status to the session.
@param string $message
@param string $type
@return $this | [
"Flash",
"a",
"container",
"of",
"status",
"to",
"the",
"session",
"."
] | 9af795646ceb3cf1364160a71e339cb79d63773f | https://github.com/nano7/Http/blob/9af795646ceb3cf1364160a71e339cb79d63773f/src/RedirectResponse.php#L102-L112 |
10,139 | kreta-plugins/VCS | src/Kreta/Component/VCS/Factory/CommitFactory.php | CommitFactory.create | public function create($sha, $message, BranchInterface $branch, $author, $url)
{
$commit = new $this->className();
return $commit
->setSHA($sha)
->setMessage($message)
->setBranch($branch)
->setAuthor($author)
->setUrl($url);
} | php | public function create($sha, $message, BranchInterface $branch, $author, $url)
{
$commit = new $this->className();
return $commit
->setSHA($sha)
->setMessage($message)
->setBranch($branch)
->setAuthor($author)
->setUrl($url);
} | [
"public",
"function",
"create",
"(",
"$",
"sha",
",",
"$",
"message",
",",
"BranchInterface",
"$",
"branch",
",",
"$",
"author",
",",
"$",
"url",
")",
"{",
"$",
"commit",
"=",
"new",
"$",
"this",
"->",
"className",
"(",
")",
";",
"return",
"$",
"co... | Creates a Commit object with the given response by the VCS provider.
@param string $sha The sha
@param string $message The message
@param \Kreta\Component\VCS\Model\Interfaces\BranchInterface $branch The branch
@param st... | [
"Creates",
"a",
"Commit",
"object",
"with",
"the",
"given",
"response",
"by",
"the",
"VCS",
"provider",
"."
] | 0b6daae2b8044d9250adc8009d03a6745370cd2e | https://github.com/kreta-plugins/VCS/blob/0b6daae2b8044d9250adc8009d03a6745370cd2e/src/Kreta/Component/VCS/Factory/CommitFactory.php#L53-L63 |
10,140 | zerospam/sdk-framework | src/Request/Arguments/Mergeable/Worker/ArgMerger.php | ArgMerger.toPrimitive | public function toPrimitive()
{
if (empty($this->args)) {
throw new \InvalidArgumentException("Args shouldn't be empty");
}
$values = array_keys($this->args);
return implode($this->glue, $values);
} | php | public function toPrimitive()
{
if (empty($this->args)) {
throw new \InvalidArgumentException("Args shouldn't be empty");
}
$values = array_keys($this->args);
return implode($this->glue, $values);
} | [
"public",
"function",
"toPrimitive",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"args",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Args shouldn't be empty\"",
")",
";",
"}",
"$",
"values",
"=",
"array_keys",
"(... | Return a primitive value for this object.
@return int|float|string|float | [
"Return",
"a",
"primitive",
"value",
"for",
"this",
"object",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Request/Arguments/Mergeable/Worker/ArgMerger.php#L78-L87 |
10,141 | crisu83/yii-extension | behaviors/ExtensionBehavior.php | ExtensionBehavior.import | public function import($alias, $forceInclude = false)
{
if (($baseAlias = $this->getAlias()) !== null) {
$alias = $baseAlias . '.' . $alias;
}
return Yii::import($alias, $forceInclude);
} | php | public function import($alias, $forceInclude = false)
{
if (($baseAlias = $this->getAlias()) !== null) {
$alias = $baseAlias . '.' . $alias;
}
return Yii::import($alias, $forceInclude);
} | [
"public",
"function",
"import",
"(",
"$",
"alias",
",",
"$",
"forceInclude",
"=",
"false",
")",
"{",
"if",
"(",
"(",
"$",
"baseAlias",
"=",
"$",
"this",
"->",
"getAlias",
"(",
")",
")",
"!==",
"null",
")",
"{",
"$",
"alias",
"=",
"$",
"baseAlias",
... | Imports the a class or directory.
The path alias is automatically prepended if applicable.
@param string $alias path alias to be imported.
@param boolean $forceInclude whether to include the class file immediately.
@return string the class name or the directory that this alias refers to.
@throws \CException if the alia... | [
"Imports",
"the",
"a",
"class",
"or",
"directory",
".",
"The",
"path",
"alias",
"is",
"automatically",
"prepended",
"if",
"applicable",
"."
] | 1443a4df7bac8f53567074f6e6df86d7ff23337c | https://github.com/crisu83/yii-extension/blob/1443a4df7bac8f53567074f6e6df86d7ff23337c/behaviors/ExtensionBehavior.php#L43-L49 |
10,142 | crisu83/yii-extension | behaviors/ExtensionBehavior.php | ExtensionBehavior.getDbConnection | public function getDbConnection()
{
if (!Yii::app()->hasComponent($this->connectionID)) {
throw new CException(sprintf('Connection component "%s" does not exist.', $this->connectionID));
}
$db = Yii::app()->getComponent($this->connectionID);
if (!$db instanceof CDbConnect... | php | public function getDbConnection()
{
if (!Yii::app()->hasComponent($this->connectionID)) {
throw new CException(sprintf('Connection component "%s" does not exist.', $this->connectionID));
}
$db = Yii::app()->getComponent($this->connectionID);
if (!$db instanceof CDbConnect... | [
"public",
"function",
"getDbConnection",
"(",
")",
"{",
"if",
"(",
"!",
"Yii",
"::",
"app",
"(",
")",
"->",
"hasComponent",
"(",
"$",
"this",
"->",
"connectionID",
")",
")",
"{",
"throw",
"new",
"CException",
"(",
"sprintf",
"(",
"'Connection component \"%... | Returns the database connection for this component.
@return \CDbConnection the connection component.
@throws \CException if the component does not exist or is not an instance of CDbConnection. | [
"Returns",
"the",
"database",
"connection",
"for",
"this",
"component",
"."
] | 1443a4df7bac8f53567074f6e6df86d7ff23337c | https://github.com/crisu83/yii-extension/blob/1443a4df7bac8f53567074f6e6df86d7ff23337c/behaviors/ExtensionBehavior.php#L56-L69 |
10,143 | crisu83/yii-extension | behaviors/ExtensionBehavior.php | ExtensionBehavior.publishAssets | public function publishAssets($path, $forceCopy = false)
{
if (!Yii::app()->hasComponent('assetManager')) {
return false; // ignore this method while ran from the console
}
/* @var CAssetManager $assetManager */
$assetManager = Yii::app()->getComponent('assetManager');
... | php | public function publishAssets($path, $forceCopy = false)
{
if (!Yii::app()->hasComponent('assetManager')) {
return false; // ignore this method while ran from the console
}
/* @var CAssetManager $assetManager */
$assetManager = Yii::app()->getComponent('assetManager');
... | [
"public",
"function",
"publishAssets",
"(",
"$",
"path",
",",
"$",
"forceCopy",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"Yii",
"::",
"app",
"(",
")",
"->",
"hasComponent",
"(",
"'assetManager'",
")",
")",
"{",
"return",
"false",
";",
"// ignore this meth... | Publishes the extension assets.
@param string $path assets path.
@param boolean $forceCopy whether we should copy the asset file or directory
even if it is already published before.
@return string the url. | [
"Publishes",
"the",
"extension",
"assets",
"."
] | 1443a4df7bac8f53567074f6e6df86d7ff23337c | https://github.com/crisu83/yii-extension/blob/1443a4df7bac8f53567074f6e6df86d7ff23337c/behaviors/ExtensionBehavior.php#L78-L90 |
10,144 | crisu83/yii-extension | behaviors/ExtensionBehavior.php | ExtensionBehavior.registerScriptFile | public function registerScriptFile($url, $position = null)
{
if (($cs = $this->getClientScript()) === false) {
return null;
}
if (isset($this->_assetsUrl)) {
$url = $this->_assetsUrl . '/' . ltrim($url, '/');
}
return $cs->registerScriptFile($url, $pos... | php | public function registerScriptFile($url, $position = null)
{
if (($cs = $this->getClientScript()) === false) {
return null;
}
if (isset($this->_assetsUrl)) {
$url = $this->_assetsUrl . '/' . ltrim($url, '/');
}
return $cs->registerScriptFile($url, $pos... | [
"public",
"function",
"registerScriptFile",
"(",
"$",
"url",
",",
"$",
"position",
"=",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"cs",
"=",
"$",
"this",
"->",
"getClientScript",
"(",
")",
")",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"if... | Registers a JavaScript file.
@param string $url URL of the javascript file.
@param integer $position the position of the JavaScript code.
@return CClientScript the client script component. | [
"Registers",
"a",
"JavaScript",
"file",
"."
] | 1443a4df7bac8f53567074f6e6df86d7ff23337c | https://github.com/crisu83/yii-extension/blob/1443a4df7bac8f53567074f6e6df86d7ff23337c/behaviors/ExtensionBehavior.php#L115-L124 |
10,145 | Silvestra/Silvestra | src/Silvestra/Component/Admin/Menu/AdminMenuBuilder.php | AdminMenuBuilder.build | public function build()
{
$event = new AdminMenuEvent();
$this->eventDispatcher->dispatch(Admin::MENU, $event);
return $event->getItems();
} | php | public function build()
{
$event = new AdminMenuEvent();
$this->eventDispatcher->dispatch(Admin::MENU, $event);
return $event->getItems();
} | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"event",
"=",
"new",
"AdminMenuEvent",
"(",
")",
";",
"$",
"this",
"->",
"eventDispatcher",
"->",
"dispatch",
"(",
"Admin",
"::",
"MENU",
",",
"$",
"event",
")",
";",
"return",
"$",
"event",
"->",
"g... | Build admin menu.
@return array|AdminMenuItem[] | [
"Build",
"admin",
"menu",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Admin/Menu/AdminMenuBuilder.php#L45-L52 |
10,146 | zugoripls/laravel-framework | src/Illuminate/Routing/UrlGenerator.php | UrlGenerator.replaceRoutableParameters | protected function replaceRoutableParameters($parameters = array())
{
$parameters = is_array($parameters) ? $parameters : array($parameters);
foreach ($parameters as $key => $parameter)
{
if ($parameter instanceof UrlRoutable)
{
$parameters[$key] = $parameter->getRouteKey();
}
}
return $parame... | php | protected function replaceRoutableParameters($parameters = array())
{
$parameters = is_array($parameters) ? $parameters : array($parameters);
foreach ($parameters as $key => $parameter)
{
if ($parameter instanceof UrlRoutable)
{
$parameters[$key] = $parameter->getRouteKey();
}
}
return $parame... | [
"protected",
"function",
"replaceRoutableParameters",
"(",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"parameters",
"=",
"is_array",
"(",
"$",
"parameters",
")",
"?",
"$",
"parameters",
":",
"array",
"(",
"$",
"parameters",
")",
";",
"foreac... | Replace UrlRoutable parameters with their route parameter.
@param array $parameters
@return array | [
"Replace",
"UrlRoutable",
"parameters",
"with",
"their",
"route",
"parameter",
"."
] | 90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655 | https://github.com/zugoripls/laravel-framework/blob/90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655/src/Illuminate/Routing/UrlGenerator.php#L385-L398 |
10,147 | youthweb/oauth2-youthweb | src/Provider/YouthwebResourceOwner.php | YouthwebResourceOwner.getName | public function getName()
{
$name = null;
if ( isset($this->response['data']['attributes']['first_name']) )
{
$name = $this->response['data']['attributes']['first_name'] . ' ' . $this->response['data']['attributes']['last_name'];
}
return $name;
} | php | public function getName()
{
$name = null;
if ( isset($this->response['data']['attributes']['first_name']) )
{
$name = $this->response['data']['attributes']['first_name'] . ' ' . $this->response['data']['attributes']['last_name'];
}
return $name;
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"$",
"name",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"response",
"[",
"'data'",
"]",
"[",
"'attributes'",
"]",
"[",
"'first_name'",
"]",
")",
")",
"{",
"$",
"name",
"=",
"$",
"... | Get resource owner name
@return string|null | [
"Get",
"resource",
"owner",
"name"
] | e78b35656358af8e257017521aaaad5b5dff6a6e | https://github.com/youthweb/oauth2-youthweb/blob/e78b35656358af8e257017521aaaad5b5dff6a6e/src/Provider/YouthwebResourceOwner.php#L58-L68 |
10,148 | slickframework/orm | src/Repository/QueryObject/SelectEventTriggers.php | SelectEventTriggers.triggerBeforeSelect | public function triggerBeforeSelect(
Select $query, EntityDescriptorInterface $entityDescriptor
) {
$event = new \Slick\Orm\Event\Select(
null,
[
'query' => $query,
'entityDescriptor' => $entityDescriptor
]
);
$event... | php | public function triggerBeforeSelect(
Select $query, EntityDescriptorInterface $entityDescriptor
) {
$event = new \Slick\Orm\Event\Select(
null,
[
'query' => $query,
'entityDescriptor' => $entityDescriptor
]
);
$event... | [
"public",
"function",
"triggerBeforeSelect",
"(",
"Select",
"$",
"query",
",",
"EntityDescriptorInterface",
"$",
"entityDescriptor",
")",
"{",
"$",
"event",
"=",
"new",
"\\",
"Slick",
"\\",
"Orm",
"\\",
"Event",
"\\",
"Select",
"(",
"null",
",",
"[",
"'query... | Emit before select event
@param Select $query
@param EntityDescriptorInterface $entityDescriptor
@return \League\Event\EventInterface|string | [
"Emit",
"before",
"select",
"event"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Repository/QueryObject/SelectEventTriggers.php#L41-L54 |
10,149 | slickframework/orm | src/Repository/QueryObject/SelectEventTriggers.php | SelectEventTriggers.triggerAfterSelect | public function triggerAfterSelect($data, EntityCollection $entities)
{
$event = new \Slick\Orm\Event\Select(
null,
[
'data' => $data,
'entityCollection' => $entities
]
);
$event->setAction(\Slick\Orm\Event\Select::ACTION_AF... | php | public function triggerAfterSelect($data, EntityCollection $entities)
{
$event = new \Slick\Orm\Event\Select(
null,
[
'data' => $data,
'entityCollection' => $entities
]
);
$event->setAction(\Slick\Orm\Event\Select::ACTION_AF... | [
"public",
"function",
"triggerAfterSelect",
"(",
"$",
"data",
",",
"EntityCollection",
"$",
"entities",
")",
"{",
"$",
"event",
"=",
"new",
"\\",
"Slick",
"\\",
"Orm",
"\\",
"Event",
"\\",
"Select",
"(",
"null",
",",
"[",
"'data'",
"=>",
"$",
"data",
"... | Emits the after select event
@param RecordList $data
@param EntityCollection $entities
@return \League\Event\EventInterface|string | [
"Emits",
"the",
"after",
"select",
"event"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Repository/QueryObject/SelectEventTriggers.php#L64-L76 |
10,150 | bazzline/zf_console_helper_debian_6_backport | src/ZfConsoleHelperDebian6Backport/Controller/Console/AbstractConsoleController.php | AbstractConsoleController.getConsole | public function getConsole()
{
if (!($this->console instanceof AdapterInterface)) {
$this->console = Console::getInstance();
}
return $this->console;
} | php | public function getConsole()
{
if (!($this->console instanceof AdapterInterface)) {
$this->console = Console::getInstance();
}
return $this->console;
} | [
"public",
"function",
"getConsole",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"console",
"instanceof",
"AdapterInterface",
")",
")",
"{",
"$",
"this",
"->",
"console",
"=",
"Console",
"::",
"getInstance",
"(",
")",
";",
"}",
"return",
"$",... | Instantiate console if no is set
@return AdapterInterface | [
"Instantiate",
"console",
"if",
"no",
"is",
"set"
] | 9b18b98a71b0c1efdca77d0706781b88924855c1 | https://github.com/bazzline/zf_console_helper_debian_6_backport/blob/9b18b98a71b0c1efdca77d0706781b88924855c1/src/ZfConsoleHelperDebian6Backport/Controller/Console/AbstractConsoleController.php#L27-L34 |
10,151 | tonjoo/tiga-framework | src/Console/BaseCommand.php | BaseCommand.showError | protected function showError($title, $messages = '', $output)
{
$output->writeln("<error>$title</error>");
$output->writeln('');
if (is_array($messages)) {
foreach ($messages as $message) {
$output->writeln("<comment>$message</comment>");
}
... | php | protected function showError($title, $messages = '', $output)
{
$output->writeln("<error>$title</error>");
$output->writeln('');
if (is_array($messages)) {
foreach ($messages as $message) {
$output->writeln("<comment>$message</comment>");
}
... | [
"protected",
"function",
"showError",
"(",
"$",
"title",
",",
"$",
"messages",
"=",
"''",
",",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"writeln",
"(",
"\"<error>$title</error>\"",
")",
";",
"$",
"output",
"->",
"writeln",
"(",
"''",
")",
";",
"if... | Print error message with proper format.
@param string $title
@param string $messages
@param \Symfony\Component\Console\Output\OutputInterface $output | [
"Print",
"error",
"message",
"with",
"proper",
"format",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Console/BaseCommand.php#L33-L46 |
10,152 | tonjoo/tiga-framework | src/Console/BaseCommand.php | BaseCommand.showSuccess | protected function showSuccess($title, $messages = '', $output)
{
$output->writeln("<info>$title</info>");
$output->writeln('');
if (is_array($messages)) {
foreach ($messages as $message) {
$output->writeln("$message");
}
$output->writeln('... | php | protected function showSuccess($title, $messages = '', $output)
{
$output->writeln("<info>$title</info>");
$output->writeln('');
if (is_array($messages)) {
foreach ($messages as $message) {
$output->writeln("$message");
}
$output->writeln('... | [
"protected",
"function",
"showSuccess",
"(",
"$",
"title",
",",
"$",
"messages",
"=",
"''",
",",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"writeln",
"(",
"\"<info>$title</info>\"",
")",
";",
"$",
"output",
"->",
"writeln",
"(",
"''",
")",
";",
"if... | Print success message.
@param string $title
@param string $messages
@param \Symfony\Component\Console\Output\OutputInterface $output | [
"Print",
"success",
"message",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Console/BaseCommand.php#L55-L68 |
10,153 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.header | public function header(string $name, $value): HttpRequest
{
if (!array_key_exists($name, $this->headers)) {
$this->headers[$name] = array();
}
$this->headers[$name][] = $value;
return $this;
} | php | public function header(string $name, $value): HttpRequest
{
if (!array_key_exists($name, $this->headers)) {
$this->headers[$name] = array();
}
$this->headers[$name][] = $value;
return $this;
} | [
"public",
"function",
"header",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"HttpRequest",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"headers",
")",
")",
"{",
"$",
"this",
"->",
"headers",
"[",
... | Adds a header to the request
@param string $name the name of the header
@param mixed $value the value for the header
@return HttpRequest | [
"Adds",
"a",
"header",
"to",
"the",
"request"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L63-L71 |
10,154 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.headers | public function headers(array $headers): HttpRequest
{
foreach ($headers as $name => $value) {
$this->header($name, $value);
}
return $this;
} | php | public function headers(array $headers): HttpRequest
{
foreach ($headers as $name => $value) {
$this->header($name, $value);
}
return $this;
} | [
"public",
"function",
"headers",
"(",
"array",
"$",
"headers",
")",
":",
"HttpRequest",
"{",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"header",
"(",
"$",
"name",
",",
"$",
"value",
")",
";"... | Adds an array of headers to the HttpRequest
@param array $headers An associative array of name->value to add as headers to the HttpRequest
@return HttpRequest | [
"Adds",
"an",
"array",
"of",
"headers",
"to",
"the",
"HttpRequest"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L78-L85 |
10,155 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.contentType | public function contentType(string $contentType): HttpRequest
{
$contentType = trim($contentType);
// If this is a multipart request and boundary was not defined, we define a boundary as this is required for multipart requests:
if (stripos($contentType, "multipart/") !== false) {
... | php | public function contentType(string $contentType): HttpRequest
{
$contentType = trim($contentType);
// If this is a multipart request and boundary was not defined, we define a boundary as this is required for multipart requests:
if (stripos($contentType, "multipart/") !== false) {
... | [
"public",
"function",
"contentType",
"(",
"string",
"$",
"contentType",
")",
":",
"HttpRequest",
"{",
"$",
"contentType",
"=",
"trim",
"(",
"$",
"contentType",
")",
";",
"// If this is a multipart request and boundary was not defined, we define a boundary as this is required ... | Sets the Content-Type header of the HttpRequest
@param string $contentType the value to set for the Content-Type header
@return HttpRequest | [
"Sets",
"the",
"Content",
"-",
"Type",
"header",
"of",
"the",
"HttpRequest"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L92-L105 |
10,156 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.accept | public function accept(string $contentType): HttpRequest
{
$contentType = trim($contentType);
return $this->header("Accept", $contentType);
} | php | public function accept(string $contentType): HttpRequest
{
$contentType = trim($contentType);
return $this->header("Accept", $contentType);
} | [
"public",
"function",
"accept",
"(",
"string",
"$",
"contentType",
")",
":",
"HttpRequest",
"{",
"$",
"contentType",
"=",
"trim",
"(",
"$",
"contentType",
")",
";",
"return",
"$",
"this",
"->",
"header",
"(",
"\"Accept\"",
",",
"$",
"contentType",
")",
"... | Sets the Accept header of the HttpRequest
@param string $contentType the value to set for the Accept header
@return HttpRequest | [
"Sets",
"the",
"Accept",
"header",
"of",
"the",
"HttpRequest"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L112-L117 |
10,157 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.authorization | public function authorization(string $scheme, string $value): HttpRequest
{
if (empty($scheme)) {
throw new \InvalidArgumentException("Scheme was null or empty");
}
if (empty($value)) {
throw new \InvalidArgumentException("Value was null or empty");
}
... | php | public function authorization(string $scheme, string $value): HttpRequest
{
if (empty($scheme)) {
throw new \InvalidArgumentException("Scheme was null or empty");
}
if (empty($value)) {
throw new \InvalidArgumentException("Value was null or empty");
}
... | [
"public",
"function",
"authorization",
"(",
"string",
"$",
"scheme",
",",
"string",
"$",
"value",
")",
":",
"HttpRequest",
"{",
"if",
"(",
"empty",
"(",
"$",
"scheme",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Scheme was null o... | Sets the Authorization header of the HttpRequest
@param string $scheme the scheme to use in the value of the Authorization header (e.g. Bearer)
@param string $value the value to set for the the Authorization header
@return HttpRequest | [
"Sets",
"the",
"Authorization",
"header",
"of",
"the",
"HttpRequest"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L125-L134 |
10,158 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.parameter | public function parameter(string $name, $value): HttpRequest
{
$this->parameters[$name] = $value;
return $this;
} | php | public function parameter(string $name, $value): HttpRequest
{
$this->parameters[$name] = $value;
return $this;
} | [
"public",
"function",
"parameter",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"HttpRequest",
"{",
"$",
"this",
"->",
"parameters",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"return",
"$",
"this",
";",
"}"
] | Adds a query parameter to the HttpRequest.
@param string $name the name of the query parameter to add
@param mixed $value the value of the query parameter to add
@return HttpRequest | [
"Adds",
"a",
"query",
"parameter",
"to",
"the",
"HttpRequest",
"."
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L142-L147 |
10,159 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.parameters | public function parameters(array $parameters): HttpRequest
{
foreach ($parameters as $name => $value) {
$this->parameter($name, $value);
}
return $this;
} | php | public function parameters(array $parameters): HttpRequest
{
foreach ($parameters as $name => $value) {
$this->parameter($name, $value);
}
return $this;
} | [
"public",
"function",
"parameters",
"(",
"array",
"$",
"parameters",
")",
":",
"HttpRequest",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"parameter",
"(",
"$",
"name",
",",
"$",
"value",
... | Adds an array of query parameters to the HttpRequest
@param array $parameters An associative array of name->value to add as query parameters to the HttpRequest
@return HttpRequest | [
"Adds",
"an",
"array",
"of",
"query",
"parameters",
"to",
"the",
"HttpRequest"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L154-L161 |
10,160 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.cookie | public function cookie(string $name, $value): HttpRequest
{
if ($name != 'Array') {
$this->cookies[$name] = $value;
}
return $this;
} | php | public function cookie(string $name, $value): HttpRequest
{
if ($name != 'Array') {
$this->cookies[$name] = $value;
}
return $this;
} | [
"public",
"function",
"cookie",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"HttpRequest",
"{",
"if",
"(",
"$",
"name",
"!=",
"'Array'",
")",
"{",
"$",
"this",
"->",
"cookies",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"}",
"ret... | Adds a cookie to the HttpRequest
@param string $name the name of the cookie to add to the HttpRequest
@param mixed $value the value of the cookie to add to the HttpRequest
@return HttpRequest | [
"Adds",
"a",
"cookie",
"to",
"the",
"HttpRequest"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L169-L175 |
10,161 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.basicAuthentication | public function basicAuthentication(string $username, string $password = ""): HttpRequest
{
$this->username = $username;
$this->password = $password;
return $this;
} | php | public function basicAuthentication(string $username, string $password = ""): HttpRequest
{
$this->username = $username;
$this->password = $password;
return $this;
} | [
"public",
"function",
"basicAuthentication",
"(",
"string",
"$",
"username",
",",
"string",
"$",
"password",
"=",
"\"\"",
")",
":",
"HttpRequest",
"{",
"$",
"this",
"->",
"username",
"=",
"$",
"username",
";",
"$",
"this",
"->",
"password",
"=",
"$",
"pa... | Sets the basic authentication to use on the HttpRequest
@param string $username the username to use with Basic Authentication
@param string $password the password to use with Basic Authentication
@return HttpRequest | [
"Sets",
"the",
"basic",
"authentication",
"to",
"use",
"on",
"the",
"HttpRequest"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L201-L206 |
10,162 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.put | public function put(string $path, $body): HttpResponse
{
return $this->request($path, HttpMethod::PUT, $body);
} | php | public function put(string $path, $body): HttpResponse
{
return $this->request($path, HttpMethod::PUT, $body);
} | [
"public",
"function",
"put",
"(",
"string",
"$",
"path",
",",
"$",
"body",
")",
":",
"HttpResponse",
"{",
"return",
"$",
"this",
"->",
"request",
"(",
"$",
"path",
",",
"HttpMethod",
"::",
"PUT",
",",
"$",
"body",
")",
";",
"}"
] | Executes the HttpRequest as a PUT request to the specified path with the provided body
@param string $path the path to execute the PUT request to
@param mixed body the body to PUT to the specified path
@return HttpResponse The response to the HttpRequest | [
"Executes",
"the",
"HttpRequest",
"as",
"a",
"PUT",
"request",
"to",
"the",
"specified",
"path",
"with",
"the",
"provided",
"body"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L248-L251 |
10,163 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.post | public function post(string $path, $body): HttpResponse
{
return $this->request($path, HttpMethod::POST, $body);
} | php | public function post(string $path, $body): HttpResponse
{
return $this->request($path, HttpMethod::POST, $body);
} | [
"public",
"function",
"post",
"(",
"string",
"$",
"path",
",",
"$",
"body",
")",
":",
"HttpResponse",
"{",
"return",
"$",
"this",
"->",
"request",
"(",
"$",
"path",
",",
"HttpMethod",
"::",
"POST",
",",
"$",
"body",
")",
";",
"}"
] | Executes the HttpRequest as a POST request to the specified path with the provided body
@param string $path the path to execute the POST request to
@param mixed body the body to POST to the specified path
@return HttpResponse The response to the HttpRequest | [
"Executes",
"the",
"HttpRequest",
"as",
"a",
"POST",
"request",
"to",
"the",
"specified",
"path",
"with",
"the",
"provided",
"body"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L259-L262 |
10,164 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.delete | public function delete(string $path, $body): HttpResponse
{
return $this->request($path, HttpMethod::DELETE, $body);
} | php | public function delete(string $path, $body): HttpResponse
{
return $this->request($path, HttpMethod::DELETE, $body);
} | [
"public",
"function",
"delete",
"(",
"string",
"$",
"path",
",",
"$",
"body",
")",
":",
"HttpResponse",
"{",
"return",
"$",
"this",
"->",
"request",
"(",
"$",
"path",
",",
"HttpMethod",
"::",
"DELETE",
",",
"$",
"body",
")",
";",
"}"
] | Executes the HttpRequest as a DELETE request to the specified path with the provided body
@param string $path the path to execute the DELETE request to
@param mixed body the body to DELETE to the specified path
@return HttpResponse The response to the HttpRequest | [
"Executes",
"the",
"HttpRequest",
"as",
"a",
"DELETE",
"request",
"to",
"the",
"specified",
"path",
"with",
"the",
"provided",
"body"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L270-L273 |
10,165 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.request | private function request(string $path, string $method, $body = null): HttpResponse
{
$ch = curl_init();
$this->processUrl($path, $ch);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
$this->processBody($ch, $body); // Do body first as this might add additional headers
$t... | php | private function request(string $path, string $method, $body = null): HttpResponse
{
$ch = curl_init();
$this->processUrl($path, $ch);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
$this->processBody($ch, $body); // Do body first as this might add additional headers
$t... | [
"private",
"function",
"request",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"method",
",",
"$",
"body",
"=",
"null",
")",
":",
"HttpResponse",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"$",
"this",
"->",
"processUrl",
"(",
"$",
"path",
... | Constructs the HTTP request and sends it using the provided method and request body
@param string $path the path to send the request to
@param string $method the HTTP method to use
@param mixed|null $body the body to send
@return HttpResponse the response after sending the HTTP request | [
"Constructs",
"the",
"HTTP",
"request",
"and",
"sends",
"it",
"using",
"the",
"provided",
"method",
"and",
"request",
"body"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L282-L295 |
10,166 | Rehyved/php-http-client | src/rehyved/Http/HttpRequest.php | HttpRequest.send | private function send($ch): HttpResponse
{
$returnHeaders = array();
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$returnHeaders) {
if (strpos($header, ':') !== false) {
list($name, $value) = explode(':', $header);
if (!array_ke... | php | private function send($ch): HttpResponse
{
$returnHeaders = array();
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$returnHeaders) {
if (strpos($header, ':') !== false) {
list($name, $value) = explode(':', $header);
if (!array_ke... | [
"private",
"function",
"send",
"(",
"$",
"ch",
")",
":",
"HttpResponse",
"{",
"$",
"returnHeaders",
"=",
"array",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_HEADERFUNCTION",
",",
"function",
"(",
"$",
"curl",
",",
"$",
"header",
")",
"... | Sends the constructed request
@param mixed $ch the curl handler
@return HttpResponse the HTTP response returned by the request
@throws HttpRequestException If an error occurs when trying to send the request | [
"Sends",
"the",
"constructed",
"request"
] | 1a4a7d3d30d710ce4062c7628010ee4f06d2359c | https://github.com/Rehyved/php-http-client/blob/1a4a7d3d30d710ce4062c7628010ee4f06d2359c/src/rehyved/Http/HttpRequest.php#L303-L346 |
10,167 | bytorsten/graphql-subscriptions | src/GraphQL/Utils.php | Utils.construct | protected static function construct(ExecutionContext $exeContext = null): Executor
{
$executorReflection = new \ReflectionClass(Executor::class);
/** @var Executor $executor */
$executor = $executorReflection->newInstanceWithoutConstructor();
if ($exeContext !== null) {
... | php | protected static function construct(ExecutionContext $exeContext = null): Executor
{
$executorReflection = new \ReflectionClass(Executor::class);
/** @var Executor $executor */
$executor = $executorReflection->newInstanceWithoutConstructor();
if ($exeContext !== null) {
... | [
"protected",
"static",
"function",
"construct",
"(",
"ExecutionContext",
"$",
"exeContext",
"=",
"null",
")",
":",
"Executor",
"{",
"$",
"executorReflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"Executor",
"::",
"class",
")",
";",
"/** @var Executor $execut... | Some crazy stuff to work around a private constructor
@param ExecutionContext $exeContext
@return Executor | [
"Some",
"crazy",
"stuff",
"to",
"work",
"around",
"a",
"private",
"constructor"
] | c47b40c0c1762439573029cfef49fee5a6ca7a08 | https://github.com/bytorsten/graphql-subscriptions/blob/c47b40c0c1762439573029cfef49fee5a6ca7a08/src/GraphQL/Utils.php#L27-L40 |
10,168 | Dachande663/PHP-DB | src/HybridLogic/DB/Driver/PDO.php | PDO.escape | public function escape($val) {
if($this->db === null) $this->connect();
return $this->db->quote($val);
} | php | public function escape($val) {
if($this->db === null) $this->connect();
return $this->db->quote($val);
} | [
"public",
"function",
"escape",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"db",
"===",
"null",
")",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"return",
"$",
"this",
"->",
"db",
"->",
"quote",
"(",
"$",
"val",
")",
";",
"}"
] | Escape a Value
@param string Raw value
@return string Escaped value | [
"Escape",
"a",
"Value"
] | fed6ec6f4612a36ebc3b10f6d06c8d70ba3b6ef9 | https://github.com/Dachande663/PHP-DB/blob/fed6ec6f4612a36ebc3b10f6d06c8d70ba3b6ef9/src/HybridLogic/DB/Driver/PDO.php#L118-L121 |
10,169 | tadcka/Mapper | src/Tadcka/Mapper/Source/Type/SourceTypeRegistry.php | SourceTypeRegistry.add | public function add(SourceTypeInterface $type, $alias)
{
if ($alias !== $type->getName()) {
throw new SourceTypeException(sprintf('Mapper source type %s alias is not valid!', $alias));
}
$this->types[$alias] = $type;
} | php | public function add(SourceTypeInterface $type, $alias)
{
if ($alias !== $type->getName()) {
throw new SourceTypeException(sprintf('Mapper source type %s alias is not valid!', $alias));
}
$this->types[$alias] = $type;
} | [
"public",
"function",
"add",
"(",
"SourceTypeInterface",
"$",
"type",
",",
"$",
"alias",
")",
"{",
"if",
"(",
"$",
"alias",
"!==",
"$",
"type",
"->",
"getName",
"(",
")",
")",
"{",
"throw",
"new",
"SourceTypeException",
"(",
"sprintf",
"(",
"'Mapper sour... | Add mapper source type.
@param SourceTypeInterface $type
@param string $alias
@throws SourceTypeException | [
"Add",
"mapper",
"source",
"type",
"."
] | 6853a2be08dcd35a1013c0a4aba9b71a727ff7da | https://github.com/tadcka/Mapper/blob/6853a2be08dcd35a1013c0a4aba9b71a727ff7da/src/Tadcka/Mapper/Source/Type/SourceTypeRegistry.php#L41-L48 |
10,170 | tadcka/Mapper | src/Tadcka/Mapper/Source/Type/SourceTypeRegistry.php | SourceTypeRegistry.getType | public function getType($name)
{
if (isset($this->types[$name])) {
return $this->types[$name];
}
throw new SourceTypeException(sprintf('Mapper source type %s not found!', $name));
} | php | public function getType($name)
{
if (isset($this->types[$name])) {
return $this->types[$name];
}
throw new SourceTypeException(sprintf('Mapper source type %s not found!', $name));
} | [
"public",
"function",
"getType",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"types",
"[",
"$",
"name",
"]",
";",
"}",
"throw",
"new",
"Sour... | Get mapper source type by name.
@param string $name
@return SourceTypeInterface
@throws SourceTypeException | [
"Get",
"mapper",
"source",
"type",
"by",
"name",
"."
] | 6853a2be08dcd35a1013c0a4aba9b71a727ff7da | https://github.com/tadcka/Mapper/blob/6853a2be08dcd35a1013c0a4aba9b71a727ff7da/src/Tadcka/Mapper/Source/Type/SourceTypeRegistry.php#L59-L66 |
10,171 | bishopb/vanilla | library/core/class.email.php | Gdn_Email.Bcc | public function Bcc($RecipientEmail, $RecipientName = '') {
ob_start();
$this->PhpMailer->AddBCC($RecipientEmail, $RecipientName);
ob_end_clean();
return $this;
} | php | public function Bcc($RecipientEmail, $RecipientName = '') {
ob_start();
$this->PhpMailer->AddBCC($RecipientEmail, $RecipientName);
ob_end_clean();
return $this;
} | [
"public",
"function",
"Bcc",
"(",
"$",
"RecipientEmail",
",",
"$",
"RecipientName",
"=",
"''",
")",
"{",
"ob_start",
"(",
")",
";",
"$",
"this",
"->",
"PhpMailer",
"->",
"AddBCC",
"(",
"$",
"RecipientEmail",
",",
"$",
"RecipientName",
")",
";",
"ob_end_c... | Adds to the "Bcc" recipient collection.
@param mixed $RecipientEmail An email (or array of emails) to add to the "Bcc" recipient collection.
@param string $RecipientName The recipient name associated with $RecipientEmail. If $RecipientEmail is
an array of email addresses, this value will be ignored.
@return Email | [
"Adds",
"to",
"the",
"Bcc",
"recipient",
"collection",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.email.php#L69-L74 |
10,172 | bishopb/vanilla | library/core/class.email.php | Gdn_Email.Cc | public function Cc($RecipientEmail, $RecipientName = '') {
ob_start();
$this->PhpMailer->AddCC($RecipientEmail, $RecipientName);
ob_end_clean();
return $this;
} | php | public function Cc($RecipientEmail, $RecipientName = '') {
ob_start();
$this->PhpMailer->AddCC($RecipientEmail, $RecipientName);
ob_end_clean();
return $this;
} | [
"public",
"function",
"Cc",
"(",
"$",
"RecipientEmail",
",",
"$",
"RecipientName",
"=",
"''",
")",
"{",
"ob_start",
"(",
")",
";",
"$",
"this",
"->",
"PhpMailer",
"->",
"AddCC",
"(",
"$",
"RecipientEmail",
",",
"$",
"RecipientName",
")",
";",
"ob_end_cle... | Adds to the "Cc" recipient collection.
@param mixed $RecipientEmail An email (or array of emails) to add to the "Cc" recipient collection.
@param string $RecipientName The recipient name associated with $RecipientEmail. If $RecipientEmail is
an array of email addresses, this value will be ignored.
@return Email | [
"Adds",
"to",
"the",
"Cc",
"recipient",
"collection",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.email.php#L84-L89 |
10,173 | bishopb/vanilla | library/core/class.email.php | Gdn_Email.Clear | public function Clear() {
$this->PhpMailer->ClearAllRecipients();
$this->PhpMailer->Body = '';
$this->PhpMailer->AltBody = '';
$this->From();
$this->_IsToSet = FALSE;
$this->MimeType(C('Garden.Email.MimeType', 'text/plain'));
$this->_MasterView = 'email.master';
$this->Sk... | php | public function Clear() {
$this->PhpMailer->ClearAllRecipients();
$this->PhpMailer->Body = '';
$this->PhpMailer->AltBody = '';
$this->From();
$this->_IsToSet = FALSE;
$this->MimeType(C('Garden.Email.MimeType', 'text/plain'));
$this->_MasterView = 'email.master';
$this->Sk... | [
"public",
"function",
"Clear",
"(",
")",
"{",
"$",
"this",
"->",
"PhpMailer",
"->",
"ClearAllRecipients",
"(",
")",
";",
"$",
"this",
"->",
"PhpMailer",
"->",
"Body",
"=",
"''",
";",
"$",
"this",
"->",
"PhpMailer",
"->",
"AltBody",
"=",
"''",
";",
"$... | Clears out all previously specified values for this object and restores
it to the state it was in when it was instantiated.
@return Email | [
"Clears",
"out",
"all",
"previously",
"specified",
"values",
"for",
"this",
"object",
"and",
"restores",
"it",
"to",
"the",
"state",
"it",
"was",
"in",
"when",
"it",
"was",
"instantiated",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.email.php#L97-L107 |
10,174 | bishopb/vanilla | library/core/class.email.php | Gdn_Email.From | public function From($SenderEmail = '', $SenderName = '', $bOverrideSender = FALSE) {
if ($SenderEmail == '') {
$SenderEmail = C('Garden.Email.SupportAddress', '');
if (!$SenderEmail) {
$SenderEmail = 'noreply@'.Gdn::Request()->Host();
}
}
if ($SenderName == '')... | php | public function From($SenderEmail = '', $SenderName = '', $bOverrideSender = FALSE) {
if ($SenderEmail == '') {
$SenderEmail = C('Garden.Email.SupportAddress', '');
if (!$SenderEmail) {
$SenderEmail = 'noreply@'.Gdn::Request()->Host();
}
}
if ($SenderName == '')... | [
"public",
"function",
"From",
"(",
"$",
"SenderEmail",
"=",
"''",
",",
"$",
"SenderName",
"=",
"''",
",",
"$",
"bOverrideSender",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"SenderEmail",
"==",
"''",
")",
"{",
"$",
"SenderEmail",
"=",
"C",
"(",
"'Garden... | Allows the explicit definition of the email's sender address & name.
Defaults to the applications Configuration 'SupportEmail' & 'SupportName'
settings respectively.
@param string $SenderEmail
@param string $SenderName
@return Email | [
"Allows",
"the",
"explicit",
"definition",
"of",
"the",
"email",
"s",
"sender",
"address",
"&",
"name",
".",
"Defaults",
"to",
"the",
"applications",
"Configuration",
"SupportEmail",
"&",
"SupportName",
"settings",
"respectively",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.email.php#L118-L135 |
10,175 | bishopb/vanilla | library/core/class.email.php | Gdn_Email.Message | public function Message($Message) {
// htmlspecialchars_decode is being used here to revert any specialchar escaping done by Gdn_Format::Text()
// which, untreated, would result in ' in the message in place of single quotes.
if ($this->PhpMailer->ContentType == 'text/html') {
$Te... | php | public function Message($Message) {
// htmlspecialchars_decode is being used here to revert any specialchar escaping done by Gdn_Format::Text()
// which, untreated, would result in ' in the message in place of single quotes.
if ($this->PhpMailer->ContentType == 'text/html') {
$Te... | [
"public",
"function",
"Message",
"(",
"$",
"Message",
")",
"{",
"// htmlspecialchars_decode is being used here to revert any specialchar escaping done by Gdn_Format::Text()",
"// which, untreated, would result in ' in the message in place of single quotes.",
"if",
"(",
"$",
"this",
... | The message to be sent.
@param string $Message The message to be sent.
@param string $TextVersion Optional plaintext version of the message
@return Email | [
"The",
"message",
"to",
"be",
"sent",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.email.php#L156-L180 |
10,176 | bishopb/vanilla | library/core/class.email.php | Gdn_Email.To | public function To($RecipientEmail, $RecipientName = '') {
if (is_string($RecipientEmail)) {
if (strpos($RecipientEmail, ',') > 0) {
$RecipientEmail = explode(',', $RecipientEmail);
// trim no need, PhpMailer::AddAnAddress() will do it
return $this->To($RecipientEmail... | php | public function To($RecipientEmail, $RecipientName = '') {
if (is_string($RecipientEmail)) {
if (strpos($RecipientEmail, ',') > 0) {
$RecipientEmail = explode(',', $RecipientEmail);
// trim no need, PhpMailer::AddAnAddress() will do it
return $this->To($RecipientEmail... | [
"public",
"function",
"To",
"(",
"$",
"RecipientEmail",
",",
"$",
"RecipientName",
"=",
"''",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"RecipientEmail",
")",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"RecipientEmail",
",",
"','",
")",
">",
"0",
")"... | Adds to the "To" recipient collection.
@param mixed $RecipientEmail An email (or array of emails) to add to the "To" recipient collection.
@param string $RecipientName The recipient name associated with $RecipientEmail. If $RecipientEmail is
an array of email addresses, this value will be ignored. | [
"Adds",
"to",
"the",
"To",
"recipient",
"collection",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.email.php#L290-L342 |
10,177 | wigedev/simple-mvc | src/Event/EventHandlerCollection.php | EventHandlerCollection.execute | public function execute(string $event)
{
foreach ($this->members as $member) {
if ($member->getEvent() === $event) {
$member->execute();
}
}
} | php | public function execute(string $event)
{
foreach ($this->members as $member) {
if ($member->getEvent() === $event) {
$member->execute();
}
}
} | [
"public",
"function",
"execute",
"(",
"string",
"$",
"event",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"members",
"as",
"$",
"member",
")",
"{",
"if",
"(",
"$",
"member",
"->",
"getEvent",
"(",
")",
"===",
"$",
"event",
")",
"{",
"$",
"member",... | Loop through and execute each member of the collection
@param string $event | [
"Loop",
"through",
"and",
"execute",
"each",
"member",
"of",
"the",
"collection"
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Event/EventHandlerCollection.php#L15-L22 |
10,178 | rseyferth/chickenwire | src/ChickenWire/I18n/SimpleBackend.php | SimpleBackend.loadAll | public function loadAll($prefix = '')
{
// Loop through files
foreach ($this->_files as $section => $file) {
// Load it?
if (strlen($prefix) == 0 ||
$prefix == $section ||
(strlen($section) > strlen($prefix) && substr($section, 0, strlen($prefix)) == $prefix) ||
(strlen($section) < str... | php | public function loadAll($prefix = '')
{
// Loop through files
foreach ($this->_files as $section => $file) {
// Load it?
if (strlen($prefix) == 0 ||
$prefix == $section ||
(strlen($section) > strlen($prefix) && substr($section, 0, strlen($prefix)) == $prefix) ||
(strlen($section) < str... | [
"public",
"function",
"loadAll",
"(",
"$",
"prefix",
"=",
"''",
")",
"{",
"// Loop through files",
"foreach",
"(",
"$",
"this",
"->",
"_files",
"as",
"$",
"section",
"=>",
"$",
"file",
")",
"{",
"// Load it?",
"if",
"(",
"strlen",
"(",
"$",
"prefix",
"... | Load all locale files
@return void | [
"Load",
"all",
"locale",
"files"
] | 74921f0a0d489366602e25df43eda894719e43d3 | https://github.com/rseyferth/chickenwire/blob/74921f0a0d489366602e25df43eda894719e43d3/src/ChickenWire/I18n/SimpleBackend.php#L206-L228 |
10,179 | zepi/turbo-base | Zepi/Web/AccessControl/src/EventHandler/RegisterMenuEntries.php | RegisterMenuEntries.execute | public function execute(Framework $framework, WebRequest $request, Response $response)
{
if ($request->hasSession()) {
$profileMenuEntry = new \Zepi\Web\General\Entity\MenuEntry(
'profile',
$this->translate('Profile', '\\Zepi\\Web\\AccessControl'),
... | php | public function execute(Framework $framework, WebRequest $request, Response $response)
{
if ($request->hasSession()) {
$profileMenuEntry = new \Zepi\Web\General\Entity\MenuEntry(
'profile',
$this->translate('Profile', '\\Zepi\\Web\\AccessControl'),
... | [
"public",
"function",
"execute",
"(",
"Framework",
"$",
"framework",
",",
"WebRequest",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"request",
"->",
"hasSession",
"(",
")",
")",
"{",
"$",
"profileMenuEntry",
"=",
"new",
"\... | Registers the menu entries which are only accessable if the user is logged in
or not logged in, in example login or logout menu entry.
@access public
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response | [
"Registers",
"the",
"menu",
"entries",
"which",
"are",
"only",
"accessable",
"if",
"the",
"user",
"is",
"logged",
"in",
"or",
"not",
"logged",
"in",
"in",
"example",
"login",
"or",
"logout",
"menu",
"entry",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/EventHandler/RegisterMenuEntries.php#L62-L114 |
10,180 | petrepatrasc/starcraft-connection-layer | Service/BaseService.php | BaseService.retrieve | protected function retrieve($url)
{
if ($this->curlWrapper->error) {
throw new StarcraftConnectionLayerException($this->curlWrapper->error_message, $this->curlWrapper->error_code);
}
} | php | protected function retrieve($url)
{
if ($this->curlWrapper->error) {
throw new StarcraftConnectionLayerException($this->curlWrapper->error_message, $this->curlWrapper->error_code);
}
} | [
"protected",
"function",
"retrieve",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"curlWrapper",
"->",
"error",
")",
"{",
"throw",
"new",
"StarcraftConnectionLayerException",
"(",
"$",
"this",
"->",
"curlWrapper",
"->",
"error_message",
",",
"$",... | Method that allows for easy retrieval of data from a URL, and triggers a certain type of exception when something goes wrong.
@param string $url The URL that should be accessed.
@throws \petrepatrasc\StarcraftConnectionLayerBundle\Exception\StarcraftConnectionLayerException | [
"Method",
"that",
"allows",
"for",
"easy",
"retrieval",
"of",
"data",
"from",
"a",
"URL",
"and",
"triggers",
"a",
"certain",
"type",
"of",
"exception",
"when",
"something",
"goes",
"wrong",
"."
] | 3e52cd825c58d450e5329ffe6c0871741b99a1ef | https://github.com/petrepatrasc/starcraft-connection-layer/blob/3e52cd825c58d450e5329ffe6c0871741b99a1ef/Service/BaseService.php#L38-L43 |
10,181 | jeronimos/php-adjutants | src/Arrays/Group.php | Group.groupByPropertiesNames | public static function groupByPropertiesNames(GroupData $groupData)
{
self::$data = $groupData->getData();
self::$groupProperties = $groupData->getGroupProperties();
self::$groupCriteriaHigherLevel = $groupData->getGroupCriteriaHigherLevel();
self::$quantityPropertyName = $groupData-... | php | public static function groupByPropertiesNames(GroupData $groupData)
{
self::$data = $groupData->getData();
self::$groupProperties = $groupData->getGroupProperties();
self::$groupCriteriaHigherLevel = $groupData->getGroupCriteriaHigherLevel();
self::$quantityPropertyName = $groupData-... | [
"public",
"static",
"function",
"groupByPropertiesNames",
"(",
"GroupData",
"$",
"groupData",
")",
"{",
"self",
"::",
"$",
"data",
"=",
"$",
"groupData",
"->",
"getData",
"(",
")",
";",
"self",
"::",
"$",
"groupProperties",
"=",
"$",
"groupData",
"->",
"ge... | Allow to group data with same properties by properties names.
@param GroupData $groupData
@return mixed
@throws GroupException | [
"Allow",
"to",
"group",
"data",
"with",
"same",
"properties",
"by",
"properties",
"names",
"."
] | 78b428ed05a9d6029a29a86ac47906adeb9fd41d | https://github.com/jeronimos/php-adjutants/blob/78b428ed05a9d6029a29a86ac47906adeb9fd41d/src/Arrays/Group.php#L34-L66 |
10,182 | netcore/module-translate | Console/FindTranslations.php | FindTranslations.writeToFile | protected function writeToFile(array $translations): void
{
$excel = app('excel');
$filename = config('netcore.module-translate.translations_file');
$excel
->create($filename, function (LaravelExcelWriter $writer) use ($translations) {
$writer->setTitle('Translat... | php | protected function writeToFile(array $translations): void
{
$excel = app('excel');
$filename = config('netcore.module-translate.translations_file');
$excel
->create($filename, function (LaravelExcelWriter $writer) use ($translations) {
$writer->setTitle('Translat... | [
"protected",
"function",
"writeToFile",
"(",
"array",
"$",
"translations",
")",
":",
"void",
"{",
"$",
"excel",
"=",
"app",
"(",
"'excel'",
")",
";",
"$",
"filename",
"=",
"config",
"(",
"'netcore.module-translate.translations_file'",
")",
";",
"$",
"excel",
... | Write translations to the file.
@param array $translations
@return void | [
"Write",
"translations",
"to",
"the",
"file",
"."
] | 7f2b7c60acf316c13830722d38f61e81b6011496 | https://github.com/netcore/module-translate/blob/7f2b7c60acf316c13830722d38f61e81b6011496/Console/FindTranslations.php#L159-L177 |
10,183 | netcore/module-translate | Console/FindTranslations.php | FindTranslations.makeRows | protected function makeRows($group, $key, $value): array
{
$rows = [];
if (is_array($value)) {
foreach ($value as $subKey => $subValue) {
$rows[] = [
'key' => $group . '.' . $key . '.' . $subKey,
'value' => $subValue,
... | php | protected function makeRows($group, $key, $value): array
{
$rows = [];
if (is_array($value)) {
foreach ($value as $subKey => $subValue) {
$rows[] = [
'key' => $group . '.' . $key . '.' . $subKey,
'value' => $subValue,
... | [
"protected",
"function",
"makeRows",
"(",
"$",
"group",
",",
"$",
"key",
",",
"$",
"value",
")",
":",
"array",
"{",
"$",
"rows",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"foreach",
"(",
"$",
"value",
"as",
"$... | Create translations from array.
@param $group
@param $key
@param $value
@return array | [
"Create",
"translations",
"from",
"array",
"."
] | 7f2b7c60acf316c13830722d38f61e81b6011496 | https://github.com/netcore/module-translate/blob/7f2b7c60acf316c13830722d38f61e81b6011496/Console/FindTranslations.php#L187-L206 |
10,184 | netcore/module-translate | Console/FindTranslations.php | FindTranslations.getPaths | protected function getPaths(): array
{
$paths = [
base_path('app'),
base_path('modules'),
base_path('resources'),
base_path('routes'),
];
foreach ($paths as $i => $path) {
if (!File::isDirectory($path)) {
unset($pat... | php | protected function getPaths(): array
{
$paths = [
base_path('app'),
base_path('modules'),
base_path('resources'),
base_path('routes'),
];
foreach ($paths as $i => $path) {
if (!File::isDirectory($path)) {
unset($pat... | [
"protected",
"function",
"getPaths",
"(",
")",
":",
"array",
"{",
"$",
"paths",
"=",
"[",
"base_path",
"(",
"'app'",
")",
",",
"base_path",
"(",
"'modules'",
")",
",",
"base_path",
"(",
"'resources'",
")",
",",
"base_path",
"(",
"'routes'",
")",
",",
"... | Get paths in which to search for translations.
@return array | [
"Get",
"paths",
"in",
"which",
"to",
"search",
"for",
"translations",
"."
] | 7f2b7c60acf316c13830722d38f61e81b6011496 | https://github.com/netcore/module-translate/blob/7f2b7c60acf316c13830722d38f61e81b6011496/Console/FindTranslations.php#L213-L229 |
10,185 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.storeEntity | protected function storeEntity()
{
$request = $this->getRequest();
$id = $request->getParameter('id');
// Try to find an existing instance of the entity.
$entity = NULL;
try {
$entity = $this->getFactory()->findEntity($id);
} catch (NotFoundException $exce... | php | protected function storeEntity()
{
$request = $this->getRequest();
$id = $request->getParameter('id');
// Try to find an existing instance of the entity.
$entity = NULL;
try {
$entity = $this->getFactory()->findEntity($id);
} catch (NotFoundException $exce... | [
"protected",
"function",
"storeEntity",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"$",
"id",
"=",
"$",
"request",
"->",
"getParameter",
"(",
"'id'",
")",
";",
"// Try to find an existing instance of the entity.",
"$",
... | Updates the entity with the new data in the request and stores it.
@return Entity the stored entity | [
"Updates",
"the",
"entity",
"with",
"the",
"new",
"data",
"in",
"the",
"request",
"and",
"stores",
"it",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L121-L155 |
10,186 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.getEntityData | public function getEntityData()
{
$entity = null;
try {
$entity = $this->getEntity(
$this->getRequest()->getParameter('id')
);
} catch (NotFoundException $exception) {
// The entity does not exist, create a new one from the data in the
... | php | public function getEntityData()
{
$entity = null;
try {
$entity = $this->getEntity(
$this->getRequest()->getParameter('id')
);
} catch (NotFoundException $exception) {
// The entity does not exist, create a new one from the data in the
... | [
"public",
"function",
"getEntityData",
"(",
")",
"{",
"$",
"entity",
"=",
"null",
";",
"try",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"getEntity",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParameter",
"(",
"'id'",
")",
")",
";",
... | Gets the current entity's data so that it can be set into the request. | [
"Gets",
"the",
"current",
"entity",
"s",
"data",
"so",
"that",
"it",
"can",
"be",
"set",
"into",
"the",
"request",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L167-L183 |
10,187 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.getBatchActionConfirmationResponse | protected function getBatchActionConfirmationResponse($actionId, array $selectedIds)
{
$response = null;
if (empty($selectedIds)) {
// No IDs, so redirect to the index page.
$response = $this->getIndexRedirectionResponse();
} else {
// There are IDs, so d... | php | protected function getBatchActionConfirmationResponse($actionId, array $selectedIds)
{
$response = null;
if (empty($selectedIds)) {
// No IDs, so redirect to the index page.
$response = $this->getIndexRedirectionResponse();
} else {
// There are IDs, so d... | [
"protected",
"function",
"getBatchActionConfirmationResponse",
"(",
"$",
"actionId",
",",
"array",
"$",
"selectedIds",
")",
"{",
"$",
"response",
"=",
"null",
";",
"if",
"(",
"empty",
"(",
"$",
"selectedIds",
")",
")",
"{",
"// No IDs, so redirect to the index pag... | Returns a response which displays a confirmation page for a batch
process.
@param string $actionId the ID of the action to perform. This will be
part of the URL.
@param array $selectedIds the IDs onto which the action would be
performed.
@return Http | [
"Returns",
"a",
"response",
"which",
"displays",
"a",
"confirmation",
"page",
"for",
"a",
"batch",
"process",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L281-L300 |
10,188 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.getBatchActionResponse | protected function getBatchActionResponse($actionFunction, array $selectedIds)
{
$response = $this->getIndexRedirectionResponse();
$successfullyUsedIds = array();
foreach ($selectedIds as $id) {
try {
call_user_func($actionFunction, $id);
$success... | php | protected function getBatchActionResponse($actionFunction, array $selectedIds)
{
$response = $this->getIndexRedirectionResponse();
$successfullyUsedIds = array();
foreach ($selectedIds as $id) {
try {
call_user_func($actionFunction, $id);
$success... | [
"protected",
"function",
"getBatchActionResponse",
"(",
"$",
"actionFunction",
",",
"array",
"$",
"selectedIds",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getIndexRedirectionResponse",
"(",
")",
";",
"$",
"successfullyUsedIds",
"=",
"array",
"(",
")",
... | Issue a response to a batch action request.
@param callback $actionFunction the function that will be executed for
each of the selected IDs.
@param array $selectedIds the IDs on which the batch process must be
executed. | [
"Issue",
"a",
"response",
"to",
"a",
"batch",
"action",
"request",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L310-L334 |
10,189 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.getIndexRedirectionResponse | private function getIndexRedirectionResponse()
{
$response = new Redirection($this->getRequest());
$url = sprintf('/%s/', $this->getCollectionName());
// If a particular view was being shown, honour it.
$view = $this->getRequest()->getParameter('view');
if (!empty($view)) {
... | php | private function getIndexRedirectionResponse()
{
$response = new Redirection($this->getRequest());
$url = sprintf('/%s/', $this->getCollectionName());
// If a particular view was being shown, honour it.
$view = $this->getRequest()->getParameter('view');
if (!empty($view)) {
... | [
"private",
"function",
"getIndexRedirectionResponse",
"(",
")",
"{",
"$",
"response",
"=",
"new",
"Redirection",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
")",
";",
"$",
"url",
"=",
"sprintf",
"(",
"'/%s/'",
",",
"$",
"this",
"->",
"getCollectionName... | Gets a redirection to the collection's index page, honouring the current
view. | [
"Gets",
"a",
"redirection",
"to",
"the",
"collection",
"s",
"index",
"page",
"honouring",
"the",
"current",
"view",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L362-L374 |
10,190 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.getEditionResponse | protected function getEditionResponse(Entity $entity = null)
{
// Create a new HTML response.
$response = $this->getHtmlResponse();
// Indicate where is the template.
$response->setTemplateId(sprintf(
'%s/edit',
$this->getCollectionName()
));
/... | php | protected function getEditionResponse(Entity $entity = null)
{
// Create a new HTML response.
$response = $this->getHtmlResponse();
// Indicate where is the template.
$response->setTemplateId(sprintf(
'%s/edit',
$this->getCollectionName()
));
/... | [
"protected",
"function",
"getEditionResponse",
"(",
"Entity",
"$",
"entity",
"=",
"null",
")",
"{",
"// Create a new HTML response.",
"$",
"response",
"=",
"$",
"this",
"->",
"getHtmlResponse",
"(",
")",
";",
"// Indicate where is the template.",
"$",
"response",
"-... | Return a response that shows an edition page.
@param type $id the ID of the entity to edit, if any.
@return Html | [
"Return",
"a",
"response",
"that",
"shows",
"an",
"edition",
"page",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L381-L399 |
10,191 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.getUpdatedEntityResponse | private function getUpdatedEntityResponse()
{
$response = $this->getEditionResponse();
try {
// Try to store an entity with the data in the request.
$this->storeEntity();
$response->addNotice(sprintf(
_('%s correctly stored.'),
ucfi... | php | private function getUpdatedEntityResponse()
{
$response = $this->getEditionResponse();
try {
// Try to store an entity with the data in the request.
$this->storeEntity();
$response->addNotice(sprintf(
_('%s correctly stored.'),
ucfi... | [
"private",
"function",
"getUpdatedEntityResponse",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getEditionResponse",
"(",
")",
";",
"try",
"{",
"// Try to store an entity with the data in the request.",
"$",
"this",
"->",
"storeEntity",
"(",
")",
";",
... | Updates an entity with the data in the request, and emits a response to
attest for that. | [
"Updates",
"an",
"entity",
"with",
"the",
"data",
"in",
"the",
"request",
"and",
"emits",
"a",
"response",
"to",
"attest",
"for",
"that",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L405-L433 |
10,192 | eix/core | src/php/main/Eix/Services/Data/Responders/CollectionManager.php | CollectionManager.getSelectedIds | protected function getSelectedIds()
{
$ids = array();
foreach ($_REQUEST as $parameter => $value) {
$matches = array();
preg_match('/select_(.*)/', $parameter, $matches);
if ($matches) {
$ids[] = $matches[1];
}
}
return... | php | protected function getSelectedIds()
{
$ids = array();
foreach ($_REQUEST as $parameter => $value) {
$matches = array();
preg_match('/select_(.*)/', $parameter, $matches);
if ($matches) {
$ids[] = $matches[1];
}
}
return... | [
"protected",
"function",
"getSelectedIds",
"(",
")",
"{",
"$",
"ids",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"_REQUEST",
"as",
"$",
"parameter",
"=>",
"$",
"value",
")",
"{",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"preg_match",
"(",
... | Find the IDs of the selected elements in a list. | [
"Find",
"the",
"IDs",
"of",
"the",
"selected",
"elements",
"in",
"a",
"list",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Data/Responders/CollectionManager.php#L438-L450 |
10,193 | Dragonrun1/event-mediator | src/PimpleContainerMediator.php | PimpleContainerMediator.setServiceContainer | public function setServiceContainer($value = \null): ContainerMediatorInterface
{
if (\null === $value) {
$value = new Container();
}
if (!$value instanceof Container) {
$mess = \sprintf(
'Must be an instance of Pimple Container but given %s',
... | php | public function setServiceContainer($value = \null): ContainerMediatorInterface
{
if (\null === $value) {
$value = new Container();
}
if (!$value instanceof Container) {
$mess = \sprintf(
'Must be an instance of Pimple Container but given %s',
... | [
"public",
"function",
"setServiceContainer",
"(",
"$",
"value",
"=",
"\\",
"null",
")",
":",
"ContainerMediatorInterface",
"{",
"if",
"(",
"\\",
"null",
"===",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"new",
"Container",
"(",
")",
";",
"}",
"if",
"("... | This is used to bring in the service container that will be used.
Though not required it would be considered best practice for this method
to create a new instance of the container when given null. Another good
practice is to call this method from the class constructor to allow
easier testing.
@param Container|null $... | [
"This",
"is",
"used",
"to",
"bring",
"in",
"the",
"service",
"container",
"that",
"will",
"be",
"used",
"."
] | ff6d875440ce4da272ee509f7d47b5050e1eb7f5 | https://github.com/Dragonrun1/event-mediator/blob/ff6d875440ce4da272ee509f7d47b5050e1eb7f5/src/PimpleContainerMediator.php#L91-L105 |
10,194 | rozaverta/cmf | core/Module/ModuleConfig.php | ModuleConfig.listResources | public function listResources()
{
$list = [];
$path = $this->getPath() . "resources";
if( file_exists($path) )
{
$scan = @ scandir($path);
if( !$scan )
{
throw new ReadException("Cannot ready resources directory for the '" . get_class($this) . "' module");
}
$path .= DIRECTORY_SEPARATOR;
... | php | public function listResources()
{
$list = [];
$path = $this->getPath() . "resources";
if( file_exists($path) )
{
$scan = @ scandir($path);
if( !$scan )
{
throw new ReadException("Cannot ready resources directory for the '" . get_class($this) . "' module");
}
$path .= DIRECTORY_SEPARATOR;
... | [
"public",
"function",
"listResources",
"(",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
".",
"\"resources\"",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"scan",
"=... | Get all module resources
@return Collection
@throws ReadException | [
"Get",
"all",
"module",
"resources"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Module/ModuleConfig.php#L104-L127 |
10,195 | phlexible/task-bundle | Controller/TaskController.php | TaskController.listAction | public function listAction(Request $request)
{
$type = $request->request->get('tasks', 'involved');
$sort = $request->request->get('sort', 'createdAt');
$dir = $request->request->get('dir', 'DESC');
$limit = $request->request->get('limit', 20);
$start = $request->request->get... | php | public function listAction(Request $request)
{
$type = $request->request->get('tasks', 'involved');
$sort = $request->request->get('sort', 'createdAt');
$dir = $request->request->get('dir', 'DESC');
$limit = $request->request->get('limit', 20);
$start = $request->request->get... | [
"public",
"function",
"listAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"type",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
"(",
"'tasks'",
",",
"'involved'",
")",
";",
"$",
"sort",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
... | List tasks.
@param Request $request
@return JsonResponse
@Route("/list", name="tasks_list")
@Method({"GET", "POST"})
@ApiDoc(
description="Search",
requirements={
{"name"="query", "dataType"="string", "required"=true, "description"="Search query"}
},
filters={
{"name"="limit", "dataType"="integer", "default"=20, "des... | [
"List",
"tasks",
"."
] | 7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2 | https://github.com/phlexible/task-bundle/blob/7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2/Controller/TaskController.php#L61-L117 |
10,196 | phlexible/task-bundle | Controller/TaskController.php | TaskController.typesAction | public function typesAction(Request $request)
{
$component = $request->request->get('component');
$taskTypes = $this->get('phlexible_task.types');
$types = [];
foreach ($taskTypes->all() as $type) {
/* @var $type TypeInterface */
if ($component && $type->get... | php | public function typesAction(Request $request)
{
$component = $request->request->get('component');
$taskTypes = $this->get('phlexible_task.types');
$types = [];
foreach ($taskTypes->all() as $type) {
/* @var $type TypeInterface */
if ($component && $type->get... | [
"public",
"function",
"typesAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"component",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
"(",
"'component'",
")",
";",
"$",
"taskTypes",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_task.types'"... | List types.
@param Request $request
@return JsonResponse
@Route("/types", name="tasks_types")
@Method({"GET", "POST"})
@ApiDoc(
description="List task types",
filters={
{"name"="component", "dataType"="string", "description"="Component filter"}
}
) | [
"List",
"types",
"."
] | 7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2 | https://github.com/phlexible/task-bundle/blob/7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2/Controller/TaskController.php#L146-L166 |
10,197 | phlexible/task-bundle | Controller/TaskController.php | TaskController.statusAction | public function statusAction(Request $request)
{
$taskManager = $this->get('phlexible_task.task_manager');
$states = $taskManager->getStates();
return new JsonResponse(['states' => $states]);
} | php | public function statusAction(Request $request)
{
$taskManager = $this->get('phlexible_task.task_manager');
$states = $taskManager->getStates();
return new JsonResponse(['states' => $states]);
} | [
"public",
"function",
"statusAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"taskManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_task.task_manager'",
")",
";",
"$",
"states",
"=",
"$",
"taskManager",
"->",
"getStates",
"(",
")",
";",
"re... | List status.
@param Request $request
@return JsonResponse
@Route("/states", name="tasks_states")
@Method({"GET", "POST"})
@ApiDoc(
description="List task states"
) | [
"List",
"status",
"."
] | 7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2 | https://github.com/phlexible/task-bundle/blob/7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2/Controller/TaskController.php#L180-L187 |
10,198 | phlexible/task-bundle | Controller/TaskController.php | TaskController.recipientsAction | public function recipientsAction(Request $request)
{
$taskType = $request->get('type');
$types = $this->get('phlexible_task.types');
$userManager = $this->get('phlexible_user.user_manager');
$authorizationChecker = $this->get('security.authorization_checker');
$type = $type... | php | public function recipientsAction(Request $request)
{
$taskType = $request->get('type');
$types = $this->get('phlexible_task.types');
$userManager = $this->get('phlexible_user.user_manager');
$authorizationChecker = $this->get('security.authorization_checker');
$type = $type... | [
"public",
"function",
"recipientsAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"taskType",
"=",
"$",
"request",
"->",
"get",
"(",
"'type'",
")",
";",
"$",
"types",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_task.types'",
")",
";",
"$",
"... | List recipients.
@param Request $request
@return JsonResponse
@Route("/recipients", name="tasks_recipients")
@Method({"GET", "POST"})
@ApiDoc(
description="List recipients",
requirements={
{"name"="type", "dataType"="string", "required"=true, "description"="Task type"},
}
) | [
"List",
"recipients",
"."
] | 7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2 | https://github.com/phlexible/task-bundle/blob/7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2/Controller/TaskController.php#L204-L234 |
10,199 | phlexible/task-bundle | Controller/TaskController.php | TaskController.createTaskAction | public function createTaskAction(Request $request)
{
$typeName = $request->get('type');
$assignedUserId = $request->get('recipient');
$description = $request->get('description');
$payload = $request->get('payload');
if ($payload) {
$payload = json_decode($payload... | php | public function createTaskAction(Request $request)
{
$typeName = $request->get('type');
$assignedUserId = $request->get('recipient');
$description = $request->get('description');
$payload = $request->get('payload');
if ($payload) {
$payload = json_decode($payload... | [
"public",
"function",
"createTaskAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"typeName",
"=",
"$",
"request",
"->",
"get",
"(",
"'type'",
")",
";",
"$",
"assignedUserId",
"=",
"$",
"request",
"->",
"get",
"(",
"'recipient'",
")",
";",
"$",
... | Create task.
@param Request $request
@return ResultResponse
@Route("/create/task", name="tasks_create_task")
@Method({"GET", "POST"})
@ApiDoc(
description="Create task",
requirements={
{"name"="type", "dataType"="string", "required"=true, "description"="Task type"},
{"name"="recipient", "dataType"="string", "required... | [
"Create",
"task",
"."
] | 7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2 | https://github.com/phlexible/task-bundle/blob/7f111ba992d40b30a1ae99ca4f06bcbed3fc6af2/Controller/TaskController.php#L254-L275 |
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.