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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
192,600 | devlabmtl/haven-web | Controller/FaqController.php | FaqController.listAction | public function listAction() {
$entities = $this->container->get("haven_web.faq.read_handler")->getAll();
foreach ($entities as $entity) {
$delete_forms[$entity->getId()] = $this->container->get("haven_web.faq.form_handler")->createDeleteForm($entity->getId())->createView();
$r... | php | public function listAction() {
$entities = $this->container->get("haven_web.faq.read_handler")->getAll();
foreach ($entities as $entity) {
$delete_forms[$entity->getId()] = $this->container->get("haven_web.faq.form_handler")->createDeleteForm($entity->getId())->createView();
$r... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"entities",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"\"haven_web.faq.read_handler\"",
")",
"->",
"getAll",
"(",
")",
";",
"foreach",
"(",
"$",
"entities",
"as",
"$",
"entity",
")",
"{... | Finds and displays all faqs for admin.
@Route("/admin/list/faq")
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"all",
"faqs",
"for",
"admin",
"."
] | 0d091bc5a8bda4c78c07a11be3525b88781b993a | https://github.com/devlabmtl/haven-web/blob/0d091bc5a8bda4c78c07a11be3525b88781b993a/Controller/FaqController.php#L78-L91 |
192,601 | gplcart/ga_report | models/Report.php | Report.get | public function get(array $handler, array $settings)
{
$report = null;
$this->hook->attach('module.ga_report.get.before', $handler, $settings, $report, $this);
if (isset($report)) {
return $report;
}
if (empty($settings['ga_profile_id'][$settings['store_id']])) ... | php | public function get(array $handler, array $settings)
{
$report = null;
$this->hook->attach('module.ga_report.get.before', $handler, $settings, $report, $this);
if (isset($report)) {
return $report;
}
if (empty($settings['ga_profile_id'][$settings['store_id']])) ... | [
"public",
"function",
"get",
"(",
"array",
"$",
"handler",
",",
"array",
"$",
"settings",
")",
"{",
"$",
"report",
"=",
"null",
";",
"$",
"this",
"->",
"hook",
"->",
"attach",
"(",
"'module.ga_report.get.before'",
",",
"$",
"handler",
",",
"$",
"settings... | Returns an array of parsed reporting data
@param array $handler
@param array $settings
@return array
@throws OutOfRangeException | [
"Returns",
"an",
"array",
"of",
"parsed",
"reporting",
"data"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L60-L98 |
192,602 | gplcart/ga_report | models/Report.php | Report.clearCache | public function clearCache($handler_id = null, $store_id = null)
{
$pattern = 'ga_report.';
if (isset($handler_id)) {
$pattern .= "$handler_id.";
}
if (isset($store_id)) {
$pattern .= "$store_id";
}
$this->cache->clear('', array('pattern' =>... | php | public function clearCache($handler_id = null, $store_id = null)
{
$pattern = 'ga_report.';
if (isset($handler_id)) {
$pattern .= "$handler_id.";
}
if (isset($store_id)) {
$pattern .= "$store_id";
}
$this->cache->clear('', array('pattern' =>... | [
"public",
"function",
"clearCache",
"(",
"$",
"handler_id",
"=",
"null",
",",
"$",
"store_id",
"=",
"null",
")",
"{",
"$",
"pattern",
"=",
"'ga_report.'",
";",
"if",
"(",
"isset",
"(",
"$",
"handler_id",
")",
")",
"{",
"$",
"pattern",
".=",
"\"$handler... | Clear cached report data
@param string|null $handler_id
@param integer|string|null $store_id | [
"Clear",
"cached",
"report",
"data"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L105-L118 |
192,603 | gplcart/ga_report | models/Report.php | Report.request | public function request(array $settings, array $handler)
{
if (empty($settings['ga_profile_id'])) {
throw new OutOfRangeException('Google Analytics profile ID is empty in the request settings');
}
$service = $this->getService($settings); // Also loads all needed libraries
... | php | public function request(array $settings, array $handler)
{
if (empty($settings['ga_profile_id'])) {
throw new OutOfRangeException('Google Analytics profile ID is empty in the request settings');
}
$service = $this->getService($settings); // Also loads all needed libraries
... | [
"public",
"function",
"request",
"(",
"array",
"$",
"settings",
",",
"array",
"$",
"handler",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"settings",
"[",
"'ga_profile_id'",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfRangeException",
"(",
"'Google Analytics profi... | Returns an object of Google Analytics service response
@param array $settings
@param array $handler
@return \Google_Service_AnalyticsReporting_GetReportsResponse
@throws OutOfRangeException | [
"Returns",
"an",
"object",
"of",
"Google",
"Analytics",
"service",
"response"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L171-L191 |
192,604 | gplcart/ga_report | models/Report.php | Report.setRequestDate | protected function setRequestDate($request, array $handler)
{
if (!empty($handler['query']['date']) && count($handler['query']['date']) == 2) {
list($from, $to) = $handler['query']['date'];
$date = new \Google_Service_AnalyticsReporting_DateRange;
$date->setStartDate($f... | php | protected function setRequestDate($request, array $handler)
{
if (!empty($handler['query']['date']) && count($handler['query']['date']) == 2) {
list($from, $to) = $handler['query']['date'];
$date = new \Google_Service_AnalyticsReporting_DateRange;
$date->setStartDate($f... | [
"protected",
"function",
"setRequestDate",
"(",
"$",
"request",
",",
"array",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"handler",
"[",
"'query'",
"]",
"[",
"'date'",
"]",
")",
"&&",
"count",
"(",
"$",
"handler",
"[",
"'query'",
"]... | Sets request date range
@param \Google_Service_AnalyticsReporting_ReportRequest $request
@param array $handler | [
"Sets",
"request",
"date",
"range"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L198-L210 |
192,605 | gplcart/ga_report | models/Report.php | Report.setRequestMetrics | protected function setRequestMetrics($request, array $handler)
{
if (empty($handler['query']['metrics'])) {
throw new OutOfRangeException('No query metrics data found in the handler');
}
$metrics = array();
foreach ((array) $handler['query']['metrics'] as $i => $name) {... | php | protected function setRequestMetrics($request, array $handler)
{
if (empty($handler['query']['metrics'])) {
throw new OutOfRangeException('No query metrics data found in the handler');
}
$metrics = array();
foreach ((array) $handler['query']['metrics'] as $i => $name) {... | [
"protected",
"function",
"setRequestMetrics",
"(",
"$",
"request",
",",
"array",
"$",
"handler",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"handler",
"[",
"'query'",
"]",
"[",
"'metrics'",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfRangeException",
"(",
"'N... | Sets request metrics from a handler
@param \Google_Service_AnalyticsReporting_ReportRequest $request
@param array $handler | [
"Sets",
"request",
"metrics",
"from",
"a",
"handler"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L217-L232 |
192,606 | gplcart/ga_report | models/Report.php | Report.setRequestSorting | protected function setRequestSorting($request, array $handler)
{
if (!empty($handler['query']['sort'])) {
$orders = array();
foreach ((array) $handler['query']['sort'] as $field => $params) {
$params += array('VALUE', 'ASCENDING');
list($type, $dire... | php | protected function setRequestSorting($request, array $handler)
{
if (!empty($handler['query']['sort'])) {
$orders = array();
foreach ((array) $handler['query']['sort'] as $field => $params) {
$params += array('VALUE', 'ASCENDING');
list($type, $dire... | [
"protected",
"function",
"setRequestSorting",
"(",
"$",
"request",
",",
"array",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"handler",
"[",
"'query'",
"]",
"[",
"'sort'",
"]",
")",
")",
"{",
"$",
"orders",
"=",
"array",
"(",
")",
... | Sets request sorting from a handler
@param \Google_Service_AnalyticsReporting_ReportRequest $request
@param array $handler | [
"Sets",
"request",
"sorting",
"from",
"a",
"handler"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L239-L261 |
192,607 | gplcart/ga_report | models/Report.php | Report.setRequestDimensions | protected function setRequestDimensions($request, array $handler)
{
if (!empty($handler['query']['dimensions'])) {
$dimensions = array();
foreach ((array) $handler['query']['dimensions'] as $name) {
$dimension = new \Google_Service_AnalyticsReporting_Dimension;
... | php | protected function setRequestDimensions($request, array $handler)
{
if (!empty($handler['query']['dimensions'])) {
$dimensions = array();
foreach ((array) $handler['query']['dimensions'] as $name) {
$dimension = new \Google_Service_AnalyticsReporting_Dimension;
... | [
"protected",
"function",
"setRequestDimensions",
"(",
"$",
"request",
",",
"array",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"handler",
"[",
"'query'",
"]",
"[",
"'dimensions'",
"]",
")",
")",
"{",
"$",
"dimensions",
"=",
"array",
"... | Sets request dimensions from a handler
@param \Google_Service_AnalyticsReporting_ReportRequest $request
@param array $handler | [
"Sets",
"request",
"dimensions",
"from",
"a",
"handler"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L268-L282 |
192,608 | gplcart/ga_report | models/Report.php | Report.getResults | public function getResults($response)
{
$results = array('rows' => array());
for ($report_index = 0; $report_index < count($response); $report_index++) {
$report = $response[$report_index];
$header = $report->getColumnHeader();
$dimension_headers = $header->get... | php | public function getResults($response)
{
$results = array('rows' => array());
for ($report_index = 0; $report_index < count($response); $report_index++) {
$report = $response[$report_index];
$header = $report->getColumnHeader();
$dimension_headers = $header->get... | [
"public",
"function",
"getResults",
"(",
"$",
"response",
")",
"{",
"$",
"results",
"=",
"array",
"(",
"'rows'",
"=>",
"array",
"(",
")",
")",
";",
"for",
"(",
"$",
"report_index",
"=",
"0",
";",
"$",
"report_index",
"<",
"count",
"(",
"$",
"response... | Returns an array of results from the response object
@param \Google_Service_AnalyticsReporting_GetReportsResponse $response
@return array | [
"Returns",
"an",
"array",
"of",
"results",
"from",
"the",
"response",
"object"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L289-L323 |
192,609 | gplcart/ga_report | models/Report.php | Report.getClient | protected function getClient(array $settings)
{
if (empty($settings['credential_id'])) {
throw new OutOfRangeException('Credential ID is empty in Google client settings');
}
$client = $this->getApiModule()->getGoogleClient($settings['credential_id']);
$client->setApplica... | php | protected function getClient(array $settings)
{
if (empty($settings['credential_id'])) {
throw new OutOfRangeException('Credential ID is empty in Google client settings');
}
$client = $this->getApiModule()->getGoogleClient($settings['credential_id']);
$client->setApplica... | [
"protected",
"function",
"getClient",
"(",
"array",
"$",
"settings",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"settings",
"[",
"'credential_id'",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfRangeException",
"(",
"'Credential ID is empty in Google client settings'",
"... | Returns Google Client class instance
@param array $settings
@return \Google_Client
@throws OutOfRangeException | [
"Returns",
"Google",
"Client",
"class",
"instance"
] | 856a480e394bb3feaeea4785ccccad56abaac499 | https://github.com/gplcart/ga_report/blob/856a480e394bb3feaeea4785ccccad56abaac499/models/Report.php#L331-L342 |
192,610 | Ydle/HubBundle | Repository/NodeDataRepository.php | NodeDataRepository.deleteNodeData | public function deleteNodeData($nodeId)
{
$query = $this->getEntityManager()->createQuery('DELETE FROM YdleHubBundle:NodeData d WHERE d.node = :node')->setParameter('node', $nodeId);
return $query->execute();
} | php | public function deleteNodeData($nodeId)
{
$query = $this->getEntityManager()->createQuery('DELETE FROM YdleHubBundle:NodeData d WHERE d.node = :node')->setParameter('node', $nodeId);
return $query->execute();
} | [
"public",
"function",
"deleteNodeData",
"(",
"$",
"nodeId",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"createQuery",
"(",
"'DELETE FROM YdleHubBundle:NodeData d WHERE d.node = :node'",
")",
"->",
"setParameter",
"(",
"'node'... | Delete all data for a specific node
@param integer $nodeId
@return integer | [
"Delete",
"all",
"data",
"for",
"a",
"specific",
"node"
] | 7fa423241246bcfd115f2ed3ad3997b4b63adb01 | https://github.com/Ydle/HubBundle/blob/7fa423241246bcfd115f2ed3ad3997b4b63adb01/Repository/NodeDataRepository.php#L103-L108 |
192,611 | agentmedia/phine-core | src/Core/Modules/Backend/UsergroupForm.php | UsergroupForm.OnSuccess | protected function OnSuccess()
{
$action = $this->group->Exists() ? Action::Update() : Action::Create();
$this->group->SetName($this->Value('Name'));
$this->group->SetCreateContainers((bool)$this->Value('CreateContainers'));
$this->group->SetCreateLayouts((bool)$this->Value('CreateLa... | php | protected function OnSuccess()
{
$action = $this->group->Exists() ? Action::Update() : Action::Create();
$this->group->SetName($this->Value('Name'));
$this->group->SetCreateContainers((bool)$this->Value('CreateContainers'));
$this->group->SetCreateLayouts((bool)$this->Value('CreateLa... | [
"protected",
"function",
"OnSuccess",
"(",
")",
"{",
"$",
"action",
"=",
"$",
"this",
"->",
"group",
"->",
"Exists",
"(",
")",
"?",
"Action",
"::",
"Update",
"(",
")",
":",
"Action",
"::",
"Create",
"(",
")",
";",
"$",
"this",
"->",
"group",
"->",
... | Saves the group and redirects to the list | [
"Saves",
"the",
"group",
"and",
"redirects",
"to",
"the",
"list"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/UsergroupForm.php#L78-L90 |
192,612 | rabbitcms/forms | src/ControlCollection.php | ControlCollection.addControl | public function addControl(Control ...$controls): ControlCollection
{
foreach ($controls as $control) {
$control->setForm($this);
$this->controls[$control->getName()] = $control;
}
return $this;
} | php | public function addControl(Control ...$controls): ControlCollection
{
foreach ($controls as $control) {
$control->setForm($this);
$this->controls[$control->getName()] = $control;
}
return $this;
} | [
"public",
"function",
"addControl",
"(",
"Control",
"...",
"$",
"controls",
")",
":",
"ControlCollection",
"{",
"foreach",
"(",
"$",
"controls",
"as",
"$",
"control",
")",
"{",
"$",
"control",
"->",
"setForm",
"(",
"$",
"this",
")",
";",
"$",
"this",
"... | Add controls to form.
@param Control[] ...$controls
@return ControlCollection | [
"Add",
"controls",
"to",
"form",
"."
] | 4dd657d1c8caeb0b87f25239fabf5fa064db29cd | https://github.com/rabbitcms/forms/blob/4dd657d1c8caeb0b87f25239fabf5fa064db29cd/src/ControlCollection.php#L56-L64 |
192,613 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.isSequence | public function isSequence( &$name = null )
{
if( preg_match( "/^nextval\\('([^']+)'::regclass\\)$/", $this->data['default'], $matches ) ) {
$name = $matches[1];
return true;
}
$name = null;
return false;
} | php | public function isSequence( &$name = null )
{
if( preg_match( "/^nextval\\('([^']+)'::regclass\\)$/", $this->data['default'], $matches ) ) {
$name = $matches[1];
return true;
}
$name = null;
return false;
} | [
"public",
"function",
"isSequence",
"(",
"&",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/^nextval\\\\('([^']+)'::regclass\\\\)$/\"",
",",
"$",
"this",
"->",
"data",
"[",
"'default'",
"]",
",",
"$",
"matches",
")",
")",
"{",
"$",
... | Does this datatype link to a sequence
@param $sequenceName
@return bool | [
"Does",
"this",
"datatype",
"link",
"to",
"a",
"sequence"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L125-L133 |
192,614 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.isNormalityEntity | public function isNormalityEntity( &$entity = null )
{
if( $this->getEntity() === 'normality' ){
$entity = $this->data['normality'];
return true;
}
$entity = null;
return false;
} | php | public function isNormalityEntity( &$entity = null )
{
if( $this->getEntity() === 'normality' ){
$entity = $this->data['normality'];
return true;
}
$entity = null;
return false;
} | [
"public",
"function",
"isNormalityEntity",
"(",
"&",
"$",
"entity",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getEntity",
"(",
")",
"===",
"'normality'",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"data",
"[",
"'normality'",
"]",
";... | Does this dataType reference a normality entity?
@param string $entityName
@return bool | [
"Does",
"this",
"dataType",
"reference",
"a",
"normality",
"entity?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L140-L148 |
192,615 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.isEntity | public function isEntity( &$entity = null )
{
if( isset( $this->data['entity'] ) ) {
$entity = $this->data['entity'];
return true;
}
$entity = null;
return false;
} | php | public function isEntity( &$entity = null )
{
if( isset( $this->data['entity'] ) ) {
$entity = $this->data['entity'];
return true;
}
$entity = null;
return false;
} | [
"public",
"function",
"isEntity",
"(",
"&",
"$",
"entity",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'entity'",
"]",
")",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"data",
"[",
"'entity'",
"]",
";",
... | Does this DataType reference a Entity?
@param string $entityName
@return bool | [
"Does",
"this",
"DataType",
"reference",
"a",
"Entity?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L155-L163 |
192,616 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.isEnum | public function isEnum( &$enumName = null )
{
if( isset( $this->data['enumName'] ) ){
$enumName = $this->data['enumName'];
return true;
}
$enumName = null;
return false;
} | php | public function isEnum( &$enumName = null )
{
if( isset( $this->data['enumName'] ) ){
$enumName = $this->data['enumName'];
return true;
}
$enumName = null;
return false;
} | [
"public",
"function",
"isEnum",
"(",
"&",
"$",
"enumName",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'enumName'",
"]",
")",
")",
"{",
"$",
"enumName",
"=",
"$",
"this",
"->",
"data",
"[",
"'enumName'",
"]",
... | Does this dataType reference a enum?
@param string $enumName
@return bool | [
"Does",
"this",
"dataType",
"reference",
"a",
"enum?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L215-L223 |
192,617 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.hasDefault | public function hasDefault( &$default = null)
{
if( empty( $this->data['default']) ) {
$default = null;
return false;
}
$default = $this->data['default'];
return true;
} | php | public function hasDefault( &$default = null)
{
if( empty( $this->data['default']) ) {
$default = null;
return false;
}
$default = $this->data['default'];
return true;
} | [
"public",
"function",
"hasDefault",
"(",
"&",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"data",
"[",
"'default'",
"]",
")",
")",
"{",
"$",
"default",
"=",
"null",
";",
"return",
"false",
";",
"}",
"$",
"de... | Does this dataType have a default value. If so what is it.
@return bool | [
"Does",
"this",
"dataType",
"have",
"a",
"default",
"value",
".",
"If",
"so",
"what",
"is",
"it",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L258-L267 |
192,618 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.serialize | public function serialize()
{
$output = array();
foreach( $this->data as $key => $value ) {
if( !array_key_exists( $key, static::$defaults ) or static::$defaults[$key] !== $value ) {
$output[$key] = $value;
}
}
return json_encode(
a... | php | public function serialize()
{
$output = array();
foreach( $this->data as $key => $value ) {
if( !array_key_exists( $key, static::$defaults ) or static::$defaults[$key] !== $value ) {
$output[$key] = $value;
}
}
return json_encode(
a... | [
"public",
"function",
"serialize",
"(",
")",
"{",
"$",
"output",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"st... | Serialize a dataType
@return string | [
"Serialize",
"a",
"dataType"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L302-L318 |
192,619 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.unserialize | public static function unserialize( $data )
{
$data = json_decode( $data, true );
return new static( $data[0], $data[1], $data[2], $data[3] );
} | php | public static function unserialize( $data )
{
$data = json_decode( $data, true );
return new static( $data[0], $data[1], $data[2], $data[3] );
} | [
"public",
"static",
"function",
"unserialize",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"data",
",",
"true",
")",
";",
"return",
"new",
"static",
"(",
"$",
"data",
"[",
"0",
"]",
",",
"$",
"data",
"[",
"1",
"]",
",",... | Unserialize a dataType
@param string $data
@return DataType | [
"Unserialize",
"a",
"dataType"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L325-L329 |
192,620 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.makeFromAttribute | public static function makeFromAttribute( PgAttribute $attribute )
{
$name = $attribute->name;
$entity = $attribute->getRelation()->getEntityName();
$type = $attribute->getType();
$fullyQualifiedName = $attribute->getFullyQualifiedName();
$data = array(
'isPrima... | php | public static function makeFromAttribute( PgAttribute $attribute )
{
$name = $attribute->name;
$entity = $attribute->getRelation()->getEntityName();
$type = $attribute->getType();
$fullyQualifiedName = $attribute->getFullyQualifiedName();
$data = array(
'isPrima... | [
"public",
"static",
"function",
"makeFromAttribute",
"(",
"PgAttribute",
"$",
"attribute",
")",
"{",
"$",
"name",
"=",
"$",
"attribute",
"->",
"name",
";",
"$",
"entity",
"=",
"$",
"attribute",
"->",
"getRelation",
"(",
")",
"->",
"getEntityName",
"(",
")"... | Generate a dataType from a Bond\Pg\Catalog\PgAttribute
@param Attribute $attribute
@return static | [
"Generate",
"a",
"dataType",
"from",
"a",
"Bond",
"\\",
"Pg",
"\\",
"Catalog",
"\\",
"PgAttribute"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L336-L384 |
192,621 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.makeFromRelation | public static function makeFromRelation( PgClass $relation )
{
$output = array();
foreach( $relation->getAttributes() as $attribute ) {
$dataType = static::makeFromAttribute( $attribute );
$output[$dataType->name] = $dataType;
}
return $output;
} | php | public static function makeFromRelation( PgClass $relation )
{
$output = array();
foreach( $relation->getAttributes() as $attribute ) {
$dataType = static::makeFromAttribute( $attribute );
$output[$dataType->name] = $dataType;
}
return $output;
} | [
"public",
"static",
"function",
"makeFromRelation",
"(",
"PgClass",
"$",
"relation",
")",
"{",
"$",
"output",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"relation",
"->",
"getAttributes",
"(",
")",
"as",
"$",
"attribute",
")",
"{",
"$",
"dataType"... | Generate a array of DataTypes from a Bond\Pg\Catalog\PgClass object
@param Bond\Pg\Catalog\PgRelation $relation
@return array | [
"Generate",
"a",
"array",
"of",
"DataTypes",
"from",
"a",
"Bond",
"\\",
"Pg",
"\\",
"Catalog",
"\\",
"PgClass",
"object"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L391-L403 |
192,622 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.toQueryTag | public function toQueryTag( $cast = false )
{
return sprintf(
'%%%s:%s%s%%',
$this->name,
isset($this->data['enumName']) ? 'text' : $this->data['type'],
$this->data['isNullable'] ? '|null' : '',
$cast ? 'cast' : ''
);
} | php | public function toQueryTag( $cast = false )
{
return sprintf(
'%%%s:%s%s%%',
$this->name,
isset($this->data['enumName']) ? 'text' : $this->data['type'],
$this->data['isNullable'] ? '|null' : '',
$cast ? 'cast' : ''
);
} | [
"public",
"function",
"toQueryTag",
"(",
"$",
"cast",
"=",
"false",
")",
"{",
"return",
"sprintf",
"(",
"'%%%s:%s%s%%'",
",",
"$",
"this",
"->",
"name",
",",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'enumName'",
"]",
")",
"?",
"'text'",
":",
"$... | Return a query tag for use in dynamic sql.
@param string $name The name of the element. Key in db->query( ..., array( $name => ... ) );
@param array $dataType. A element of Entity\Base::dataTypes array. Generated by Bond\Normality\Entity::getTypesArray()
@return string | [
"Return",
"a",
"query",
"tag",
"for",
"use",
"in",
"dynamic",
"sql",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L413-L422 |
192,623 | squareproton/Bond | src/Bond/Entity/DataType.php | DataType.getQueryModifier | public function getQueryModifier( QuoteInterface $quoting, $cast = true )
{
$modifier = new Modifier( $quoting, $this->data['type'], false );
// nullify
if( $this->data['isNullable'] ) {
$modifier->add( 'pre', '\Bond\nullify' );
}
// datatypes which aren't all ... | php | public function getQueryModifier( QuoteInterface $quoting, $cast = true )
{
$modifier = new Modifier( $quoting, $this->data['type'], false );
// nullify
if( $this->data['isNullable'] ) {
$modifier->add( 'pre', '\Bond\nullify' );
}
// datatypes which aren't all ... | [
"public",
"function",
"getQueryModifier",
"(",
"QuoteInterface",
"$",
"quoting",
",",
"$",
"cast",
"=",
"true",
")",
"{",
"$",
"modifier",
"=",
"new",
"Modifier",
"(",
"$",
"quoting",
",",
"$",
"this",
"->",
"data",
"[",
"'type'",
"]",
",",
"false",
")... | Get a modifier customised to work on this datatype | [
"Get",
"a",
"modifier",
"customised",
"to",
"work",
"on",
"this",
"datatype"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/DataType.php#L477-L503 |
192,624 | kynx/template-resolver | src/AggregateResolver.php | AggregateResolver.resolve | public function resolve($template)
{
foreach ($this as $resolver) {
$resource = $resolver->resolve($template);
if (! is_null($resource)) {
return $resource;
}
}
return null;
} | php | public function resolve($template)
{
foreach ($this as $resolver) {
$resource = $resolver->resolve($template);
if (! is_null($resource)) {
return $resource;
}
}
return null;
} | [
"public",
"function",
"resolve",
"(",
"$",
"template",
")",
"{",
"foreach",
"(",
"$",
"this",
"as",
"$",
"resolver",
")",
"{",
"$",
"resource",
"=",
"$",
"resolver",
"->",
"resolve",
"(",
"$",
"template",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"... | Returns result from first resolver that matches
@param string $template
@return Result|null | [
"Returns",
"result",
"from",
"first",
"resolver",
"that",
"matches"
] | e7c2950f5e1d86ba1189539f53b22f2481922057 | https://github.com/kynx/template-resolver/blob/e7c2950f5e1d86ba1189539f53b22f2481922057/src/AggregateResolver.php#L39-L48 |
192,625 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Model.php | Model.forceFill | public function forceFill( array $attributes )
{
// Since some versions of PHP have a bug that prevents it from properly
// binding the late static context in a closure, we will first store
// the model in a variable, which we will then use in the closure.
$model = $this;
return static::unguarded( function ... | php | public function forceFill( array $attributes )
{
// Since some versions of PHP have a bug that prevents it from properly
// binding the late static context in a closure, we will first store
// the model in a variable, which we will then use in the closure.
$model = $this;
return static::unguarded( function ... | [
"public",
"function",
"forceFill",
"(",
"array",
"$",
"attributes",
")",
"{",
"// Since some versions of PHP have a bug that prevents it from properly",
"// binding the late static context in a closure, we will first store",
"// the model in a variable, which we will then use in the closure.",... | Fill the model with an array of attributes. Force mass assignment.
@param array $attributes
@return $this | [
"Fill",
"the",
"model",
"with",
"an",
"array",
"of",
"attributes",
".",
"Force",
"mass",
"assignment",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Model.php#L466-L477 |
192,626 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Model.php | Model.all | public static function all( $columns = ['*'] )
{
$columns = is_array( $columns ) ? $columns : func_get_args();
$instance = new static;
return $instance->newQuery()->get( $columns );
} | php | public static function all( $columns = ['*'] )
{
$columns = is_array( $columns ) ? $columns : func_get_args();
$instance = new static;
return $instance->newQuery()->get( $columns );
} | [
"public",
"static",
"function",
"all",
"(",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"columns",
"=",
"is_array",
"(",
"$",
"columns",
")",
"?",
"$",
"columns",
":",
"func_get_args",
"(",
")",
";",
"$",
"instance",
"=",
"new",
"static",
... | Get all of the models from the database.
@param array|mixed $columns
@return Collection|static[] | [
"Get",
"all",
"of",
"the",
"models",
"from",
"the",
"database",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Model.php#L648-L655 |
192,627 | MinyFramework/Miny-Core | src/Controller/Controller.php | Controller.run | public function run($action, Request $request, Response $response)
{
$this->init();
if (!$this->initCalled) {
throw new IllegalStateException("Controller::init() must be called");
}
$this->response = $response;
$this->headers = $response->getHeaders();
r... | php | public function run($action, Request $request, Response $response)
{
$this->init();
if (!$this->initCalled) {
throw new IllegalStateException("Controller::init() must be called");
}
$this->response = $response;
$this->headers = $response->getHeaders();
r... | [
"public",
"function",
"run",
"(",
"$",
"action",
",",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"initCalled",
")",
"{",
"throw",
"new",
"Illeg... | Runs the controller.
@param string $action
@param Request $request
@param Response $response
@return mixed The return value of the action. | [
"Runs",
"the",
"controller",
"."
] | a1bfe801a44a49cf01f16411cb4663473e9c827c | https://github.com/MinyFramework/Miny-Core/blob/a1bfe801a44a49cf01f16411cb4663473e9c827c/src/Controller/Controller.php#L175-L185 |
192,628 | AdamB7586/menu-builder | src/Builder/Menu.php | Menu.createMenuLevel | protected static function createMenuLevel($array, $level, $elements = [], $currentItems = [], $activeClass = 'active', $startLevel = 0, $numLevels = 2){
$menu = ($level >= $startLevel ? '<ul'.Link::htmlClass($elements['ul_default'].' '.$elements['ul_class'], '').Link::htmlID($elements['ul_id']).'>' : '');
... | php | protected static function createMenuLevel($array, $level, $elements = [], $currentItems = [], $activeClass = 'active', $startLevel = 0, $numLevels = 2){
$menu = ($level >= $startLevel ? '<ul'.Link::htmlClass($elements['ul_default'].' '.$elements['ul_class'], '').Link::htmlID($elements['ul_id']).'>' : '');
... | [
"protected",
"static",
"function",
"createMenuLevel",
"(",
"$",
"array",
",",
"$",
"level",
",",
"$",
"elements",
"=",
"[",
"]",
",",
"$",
"currentItems",
"=",
"[",
"]",
",",
"$",
"activeClass",
"=",
"'active'",
",",
"$",
"startLevel",
"=",
"0",
",",
... | Creates a menu level
@param array $array This should be an array of the menu items
@param int $level
@param array $elements This should be an array containing any attributes to add to the main UL element
@return string Returns the HTML menu string | [
"Creates",
"a",
"menu",
"level"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Menu.php#L16-L25 |
192,629 | AdamB7586/menu-builder | src/Builder/Menu.php | Menu.wrapChildren | protected static function wrapChildren($item, $children){
if((is_string($item['child_wrap']) || is_array($item['child_wrap'])) && !empty($item['child_wrap'])){
return (is_array($item['child_wrap']) ? '<'.$item['child_wrap'][0].' class="'.$item['child_wrap'][1].'">' : '<'.$item['child_wrap'].'>').$ch... | php | protected static function wrapChildren($item, $children){
if((is_string($item['child_wrap']) || is_array($item['child_wrap'])) && !empty($item['child_wrap'])){
return (is_array($item['child_wrap']) ? '<'.$item['child_wrap'][0].' class="'.$item['child_wrap'][1].'">' : '<'.$item['child_wrap'].'>').$ch... | [
"protected",
"static",
"function",
"wrapChildren",
"(",
"$",
"item",
",",
"$",
"children",
")",
"{",
"if",
"(",
"(",
"is_string",
"(",
"$",
"item",
"[",
"'child_wrap'",
"]",
")",
"||",
"is_array",
"(",
"$",
"item",
"[",
"'child_wrap'",
"]",
")",
")",
... | Wrap any child elements in a given element
@param array $item This should be the menu item
@param string $children This should be a string of any child elements
@return string Will return the child elements in the wrapped element if required | [
"Wrap",
"any",
"child",
"elements",
"in",
"a",
"given",
"element"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Menu.php#L33-L38 |
192,630 | AdamB7586/menu-builder | src/Builder/Menu.php | Menu.build | public static function build($array, $elements = [], $currentItems = [], $activeClass = 'active', $startLevel = 0, $numLevels = 2, $caret = false, $linkDDExtras = false) {
if(is_array($elements) && !empty($elements)){Link::$linkDefaults = $elements;}
if($caret !== false && is_string($caret)){Link::$care... | php | public static function build($array, $elements = [], $currentItems = [], $activeClass = 'active', $startLevel = 0, $numLevels = 2, $caret = false, $linkDDExtras = false) {
if(is_array($elements) && !empty($elements)){Link::$linkDefaults = $elements;}
if($caret !== false && is_string($caret)){Link::$care... | [
"public",
"static",
"function",
"build",
"(",
"$",
"array",
",",
"$",
"elements",
"=",
"[",
"]",
",",
"$",
"currentItems",
"=",
"[",
"]",
",",
"$",
"activeClass",
"=",
"'active'",
",",
"$",
"startLevel",
"=",
"0",
",",
"$",
"numLevels",
"=",
"2",
"... | Build the navigation menu item
@param array $array This should be an array of the menu items
@param array $elements This should be an array containing any attributes to add to the main UL element
@return string Returns the HTML menu string | [
"Build",
"the",
"navigation",
"menu",
"item"
] | dbc192bca7d59475068c19d1a07a039e5f997ee4 | https://github.com/AdamB7586/menu-builder/blob/dbc192bca7d59475068c19d1a07a039e5f997ee4/src/Builder/Menu.php#L46-L51 |
192,631 | jbouzekri/SculpinTagCloudBundle | Component/Factory/TagCloudFactory.php | TagCloudFactory.buildTag | public function buildTag($tag, $counter, $permalink)
{
$tagObject = new $this->tagEntity();
$tagObject->setTag($tag);
$tagObject->setCounter($counter);
$tagObject->setPage($permalink);
return $tagObject;
} | php | public function buildTag($tag, $counter, $permalink)
{
$tagObject = new $this->tagEntity();
$tagObject->setTag($tag);
$tagObject->setCounter($counter);
$tagObject->setPage($permalink);
return $tagObject;
} | [
"public",
"function",
"buildTag",
"(",
"$",
"tag",
",",
"$",
"counter",
",",
"$",
"permalink",
")",
"{",
"$",
"tagObject",
"=",
"new",
"$",
"this",
"->",
"tagEntity",
"(",
")",
";",
"$",
"tagObject",
"->",
"setTag",
"(",
"$",
"tag",
")",
";",
"$",
... | Build a Tag entity
@param string $tag
@param int $counter
@param string $permalink
@return \Jb\Bundle\TagCloudBundle\Model\Tag | [
"Build",
"a",
"Tag",
"entity"
] | 936cf34ce60cb8fb4774931b1841fc775a3e9208 | https://github.com/jbouzekri/SculpinTagCloudBundle/blob/936cf34ce60cb8fb4774931b1841fc775a3e9208/Component/Factory/TagCloudFactory.php#L53-L61 |
192,632 | betasyntax/Betasyntax-Framework-Core | src/Betasyntax/Core/Services/ServiceProvider.php | ServiceProvider.setProviders | private function setProviders($providers) {
foreach ($providers as $key => $value) {
$this->provides[] = $value;
$this->app->appProviders[] = [$key=>$value];
}
} | php | private function setProviders($providers) {
foreach ($providers as $key => $value) {
$this->provides[] = $value;
$this->app->appProviders[] = [$key=>$value];
}
} | [
"private",
"function",
"setProviders",
"(",
"$",
"providers",
")",
"{",
"foreach",
"(",
"$",
"providers",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"provides",
"[",
"]",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"app",
"->... | Set the appProviders in the main application object and set the provides array for registering the sevice providers
@param [type] $providers [description] | [
"Set",
"the",
"appProviders",
"in",
"the",
"main",
"application",
"object",
"and",
"set",
"the",
"provides",
"array",
"for",
"registering",
"the",
"sevice",
"providers"
] | 2d135ec1f7dd98e6ef21512a069ac2595f1eb78e | https://github.com/betasyntax/Betasyntax-Framework-Core/blob/2d135ec1f7dd98e6ef21512a069ac2595f1eb78e/src/Betasyntax/Core/Services/ServiceProvider.php#L45-L50 |
192,633 | Wedeto/Util | src/Cache/Pool.php | Pool.deleteItem | public function deleteItem($key)
{
if (!is_string($key))
throw new InvalidArgumentException("Invalid key: " . WF::str($key));
unset($this->cache[$key]);
return true;
} | php | public function deleteItem($key)
{
if (!is_string($key))
throw new InvalidArgumentException("Invalid key: " . WF::str($key));
unset($this->cache[$key]);
return true;
} | [
"public",
"function",
"deleteItem",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Invalid key: \"",
".",
"WF",
"::",
"str",
"(",
"$",
"key",
")",
")",
";",
"unset"... | Remove an item from the pool
@param string $key The item to remove
@return bool True | [
"Remove",
"an",
"item",
"from",
"the",
"pool"
] | 0e080251bbaa8e7d91ae8d02eb79c029c976744a | https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Cache/Pool.php#L165-L172 |
192,634 | Wedeto/Util | src/Cache/Pool.php | Pool.save | public function save(CacheItemInterface $item)
{
$this->cache->set($item->getKey(), $item);
return $this->commit();
} | php | public function save(CacheItemInterface $item)
{
$this->cache->set($item->getKey(), $item);
return $this->commit();
} | [
"public",
"function",
"save",
"(",
"CacheItemInterface",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"set",
"(",
"$",
"item",
"->",
"getKey",
"(",
")",
",",
"$",
"item",
")",
";",
"return",
"$",
"this",
"->",
"commit",
"(",
")",
";",
... | Save item to the pool
@param CacheItemInterface $item The item to save
@return bool True | [
"Save",
"item",
"to",
"the",
"pool"
] | 0e080251bbaa8e7d91ae8d02eb79c029c976744a | https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Cache/Pool.php#L191-L195 |
192,635 | Wedeto/Util | src/Cache/Pool.php | Pool.saveDeferred | public function saveDeferred(CacheItemInterface $item)
{
$this->cache->set($item->getKey(), $item);
return true;
} | php | public function saveDeferred(CacheItemInterface $item)
{
$this->cache->set($item->getKey(), $item);
return true;
} | [
"public",
"function",
"saveDeferred",
"(",
"CacheItemInterface",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"set",
"(",
"$",
"item",
"->",
"getKey",
"(",
")",
",",
"$",
"item",
")",
";",
"return",
"true",
";",
"}"
] | Store but do not save yet
@param CacheItemInterface $item The item to store
@return bool True | [
"Store",
"but",
"do",
"not",
"save",
"yet"
] | 0e080251bbaa8e7d91ae8d02eb79c029c976744a | https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Cache/Pool.php#L202-L206 |
192,636 | holyshared/peridot-temporary-plugin | src/TemporaryFile.php | TemporaryFile.write | public function write($content)
{
$this->openForWrite();
$writtenBytes = $this->file->fwrite($content);
return $writtenBytes;
} | php | public function write($content)
{
$this->openForWrite();
$writtenBytes = $this->file->fwrite($content);
return $writtenBytes;
} | [
"public",
"function",
"write",
"(",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"openForWrite",
"(",
")",
";",
"$",
"writtenBytes",
"=",
"$",
"this",
"->",
"file",
"->",
"fwrite",
"(",
"$",
"content",
")",
";",
"return",
"$",
"writtenBytes",
";",
"}... | Write a text
@param string $content
@return int|null | [
"Write",
"a",
"text"
] | 0d61e7ef8dd0056b9fb4cd118e10295ac0a5456b | https://github.com/holyshared/peridot-temporary-plugin/blob/0d61e7ef8dd0056b9fb4cd118e10295ac0a5456b/src/TemporaryFile.php#L46-L52 |
192,637 | agentmedia/phine-core | src/Core/Logic/Module/JsonModule.php | JsonModule.AttachError | protected final function AttachError($message)
{
$this->result->message = $message;
$this->result->success = false;
} | php | protected final function AttachError($message)
{
$this->result->message = $message;
$this->result->success = false;
} | [
"protected",
"final",
"function",
"AttachError",
"(",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"result",
"->",
"message",
"=",
"$",
"message",
";",
"$",
"this",
"->",
"result",
"->",
"success",
"=",
"false",
";",
"}"
] | Attaches the exception by setting message to the result and the success flag to false
@param string $message | [
"Attaches",
"the",
"exception",
"by",
"setting",
"message",
"to",
"the",
"result",
"and",
"the",
"success",
"flag",
"to",
"false"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/JsonModule.php#L34-L38 |
192,638 | agentmedia/phine-core | src/Core/Logic/Module/JsonModule.php | JsonModule.GatherOutput | protected final function GatherOutput()
{
\header('Content-Type: application/json');
try
{
$this->output = json_encode($this->result);
}
catch (\Exception $ex)
{
$this->AttachException($ex);
}
} | php | protected final function GatherOutput()
{
\header('Content-Type: application/json');
try
{
$this->output = json_encode($this->result);
}
catch (\Exception $ex)
{
$this->AttachException($ex);
}
} | [
"protected",
"final",
"function",
"GatherOutput",
"(",
")",
"{",
"\\",
"header",
"(",
"'Content-Type: application/json'",
")",
";",
"try",
"{",
"$",
"this",
"->",
"output",
"=",
"json_encode",
"(",
"$",
"this",
"->",
"result",
")",
";",
"}",
"catch",
"(",
... | Gathers the output by encoding the result to json | [
"Gathers",
"the",
"output",
"by",
"encoding",
"the",
"result",
"to",
"json"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Module/JsonModule.php#L52-L63 |
192,639 | rafrsr/generic-api | sample/Services/PostsServices.php | PostsServices.delete | public function delete(Post $post)
{
$response = $this->api->process(new DeletePost($post));
if ($response->getStatusCode() == 200) {
return true;
} else {
return false;
}
} | php | public function delete(Post $post)
{
$response = $this->api->process(new DeletePost($post));
if ($response->getStatusCode() == 200) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"delete",
"(",
"Post",
"$",
"post",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"process",
"(",
"new",
"DeletePost",
"(",
"$",
"post",
")",
")",
";",
"if",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
... | Delete a Post
@param Post $post
@return bool | [
"Delete",
"a",
"Post"
] | 2572d3dcc32e03914cf710f0229d72e1c09ea65b | https://github.com/rafrsr/generic-api/blob/2572d3dcc32e03914cf710f0229d72e1c09ea65b/sample/Services/PostsServices.php#L98-L106 |
192,640 | Topolis/FunctionLibrary | src/Bitmask.php | Bitmask.set_xor | public function set_xor(Bitmask $Binary)
{
if(!($Binary instanceof Bitmask)) return;
$data = $Binary->get_raw();
foreach($data as $Pos => $Byte)
$this->data[$Pos] = @$this->data[$Pos] ^ $Byte;
} | php | public function set_xor(Bitmask $Binary)
{
if(!($Binary instanceof Bitmask)) return;
$data = $Binary->get_raw();
foreach($data as $Pos => $Byte)
$this->data[$Pos] = @$this->data[$Pos] ^ $Byte;
} | [
"public",
"function",
"set_xor",
"(",
"Bitmask",
"$",
"Binary",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"Binary",
"instanceof",
"Bitmask",
")",
")",
"return",
";",
"$",
"data",
"=",
"$",
"Binary",
"->",
"get_raw",
"(",
")",
";",
"foreach",
"(",
"$",
"d... | Perform xor operation with another Binary object
@param $Binary | [
"Perform",
"xor",
"operation",
"with",
"another",
"Binary",
"object"
] | bc57f465932fbf297927c2a32765255131b907eb | https://github.com/Topolis/FunctionLibrary/blob/bc57f465932fbf297927c2a32765255131b907eb/src/Bitmask.php#L116-L123 |
192,641 | Topolis/FunctionLibrary | src/Bitmask.php | Bitmask.to_bin | public function to_bin()
{
$out = "";
for ($i=0; $i<$this->dataLength($this->data); $i++)
$out = sprintf("%08b",$this->data[$i]).$out;
return $out;
} | php | public function to_bin()
{
$out = "";
for ($i=0; $i<$this->dataLength($this->data); $i++)
$out = sprintf("%08b",$this->data[$i]).$out;
return $out;
} | [
"public",
"function",
"to_bin",
"(",
")",
"{",
"$",
"out",
"=",
"\"\"",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"dataLength",
"(",
"$",
"this",
"->",
"data",
")",
";",
"$",
"i",
"++",
")",
"$",
"out",
"="... | return value as binary string
@return string | [
"return",
"value",
"as",
"binary",
"string"
] | bc57f465932fbf297927c2a32765255131b907eb | https://github.com/Topolis/FunctionLibrary/blob/bc57f465932fbf297927c2a32765255131b907eb/src/Bitmask.php#L170-L176 |
192,642 | Topolis/FunctionLibrary | src/Bitmask.php | Bitmask.data2hex | protected function data2hex ($temp)
{
$data = "";
for ($i=0; $i<$this->dataLength($temp); $i++)
$data.=sprintf("%02X",$temp[$i]);
return $data;
} | php | protected function data2hex ($temp)
{
$data = "";
for ($i=0; $i<$this->dataLength($temp); $i++)
$data.=sprintf("%02X",$temp[$i]);
return $data;
} | [
"protected",
"function",
"data2hex",
"(",
"$",
"temp",
")",
"{",
"$",
"data",
"=",
"\"\"",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"dataLength",
"(",
"$",
"temp",
")",
";",
"$",
"i",
"++",
")",
"$",
"data",... | convert array of two byte integers to high endian hexadecimal string
@param array $temp
@return string | [
"convert",
"array",
"of",
"two",
"byte",
"integers",
"to",
"high",
"endian",
"hexadecimal",
"string"
] | bc57f465932fbf297927c2a32765255131b907eb | https://github.com/Topolis/FunctionLibrary/blob/bc57f465932fbf297927c2a32765255131b907eb/src/Bitmask.php#L204-L210 |
192,643 | Topolis/FunctionLibrary | src/Bitmask.php | Bitmask.hex2data | protected function hex2data($temp)
{
$data = array();
$len = strlen($temp);
for ($i=0;$i<$len;$i+=2)
$data[(int)($i/2)]= hexdec(substr($temp,$i,2));
return $data;
} | php | protected function hex2data($temp)
{
$data = array();
$len = strlen($temp);
for ($i=0;$i<$len;$i+=2)
$data[(int)($i/2)]= hexdec(substr($temp,$i,2));
return $data;
} | [
"protected",
"function",
"hex2data",
"(",
"$",
"temp",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"len",
"=",
"strlen",
"(",
"$",
"temp",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"len",
";",
"$",
"i",... | convert high endian hexadecimal string to array of two byte integers
@param string $temp
@return array | [
"convert",
"high",
"endian",
"hexadecimal",
"string",
"to",
"array",
"of",
"two",
"byte",
"integers"
] | bc57f465932fbf297927c2a32765255131b907eb | https://github.com/Topolis/FunctionLibrary/blob/bc57f465932fbf297927c2a32765255131b907eb/src/Bitmask.php#L217-L224 |
192,644 | mmethner/engine | src/Tools/Path.php | Path.language | public static function language(string $template): string
{
list ($component, $file) = static::separate($template);
$elements = [
ENGINE_APP_ROOT,
'src',
$component,
'Resources',
'Language',
$file
];
return implo... | php | public static function language(string $template): string
{
list ($component, $file) = static::separate($template);
$elements = [
ENGINE_APP_ROOT,
'src',
$component,
'Resources',
'Language',
$file
];
return implo... | [
"public",
"static",
"function",
"language",
"(",
"string",
"$",
"template",
")",
":",
"string",
"{",
"list",
"(",
"$",
"component",
",",
"$",
"file",
")",
"=",
"static",
"::",
"separate",
"(",
"$",
"template",
")",
";",
"$",
"elements",
"=",
"[",
"EN... | creates the fully qualified include string for a language resource file
@param string $template
@return string | [
"creates",
"the",
"fully",
"qualified",
"include",
"string",
"for",
"a",
"language",
"resource",
"file"
] | 89e1bcc644cf8cc3712a67ef1697da2ca4008f74 | https://github.com/mmethner/engine/blob/89e1bcc644cf8cc3712a67ef1697da2ca4008f74/src/Tools/Path.php#L42-L54 |
192,645 | sokil/CommandBusBundle | src/DependencyInjection/RegisterCommandHandlerCompilerPass.php | RegisterCommandHandlerCompilerPass.getBuses | private function getBuses(ContainerBuilder $container)
{
$buses = [];
$busDefinitions = $container->findTaggedServiceIds('sokil.command_bus');
foreach ($busDefinitions as $busServiceId => $busTags) {
foreach ($busTags as $busTagParams) {
$buses[$busServiceId] = $c... | php | private function getBuses(ContainerBuilder $container)
{
$buses = [];
$busDefinitions = $container->findTaggedServiceIds('sokil.command_bus');
foreach ($busDefinitions as $busServiceId => $busTags) {
foreach ($busTags as $busTagParams) {
$buses[$busServiceId] = $c... | [
"private",
"function",
"getBuses",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"buses",
"=",
"[",
"]",
";",
"$",
"busDefinitions",
"=",
"$",
"container",
"->",
"findTaggedServiceIds",
"(",
"'sokil.command_bus'",
")",
";",
"foreach",
"(",
"$",
"... | Get command buses
@param ContainerBuilder $container
@return array | [
"Get",
"command",
"buses"
] | 7cfdd5f1e8a77f0620b94dd5214091a2159a143d | https://github.com/sokil/CommandBusBundle/blob/7cfdd5f1e8a77f0620b94dd5214091a2159a143d/src/DependencyInjection/RegisterCommandHandlerCompilerPass.php#L25-L36 |
192,646 | sokil/CommandBusBundle | src/DependencyInjection/RegisterCommandHandlerCompilerPass.php | RegisterCommandHandlerCompilerPass.registerHandlersInBuses | private function registerHandlersInBuses(ContainerBuilder $container)
{
// Get command buses
$buses = $this->getBuses($container);
// Add handlers to command buses
$commandHandlerDefinitions = $container->findTaggedServiceIds('sokil.command_bus_handler');
foreach ($commandHa... | php | private function registerHandlersInBuses(ContainerBuilder $container)
{
// Get command buses
$buses = $this->getBuses($container);
// Add handlers to command buses
$commandHandlerDefinitions = $container->findTaggedServiceIds('sokil.command_bus_handler');
foreach ($commandHa... | [
"private",
"function",
"registerHandlersInBuses",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Get command buses",
"$",
"buses",
"=",
"$",
"this",
"->",
"getBuses",
"(",
"$",
"container",
")",
";",
"// Add handlers to command buses",
"$",
"commandHandlerDe... | Add handlers to command buses
@param ContainerBuilder $container | [
"Add",
"handlers",
"to",
"command",
"buses"
] | 7cfdd5f1e8a77f0620b94dd5214091a2159a143d | https://github.com/sokil/CommandBusBundle/blob/7cfdd5f1e8a77f0620b94dd5214091a2159a143d/src/DependencyInjection/RegisterCommandHandlerCompilerPass.php#L43-L86 |
192,647 | pdyn/httpclient | HttpClient.php | HttpClient.post_async | public function post_async($url, $data = array()) {
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
throw new \Exception('Invalid URL received by http\HttpClient', 400);
}
$paramstr = '';
if (!empty($data)) {
if (is_array($data)) {
$paramstr = $this->urlencode_array($data);
} elseif (is_scal... | php | public function post_async($url, $data = array()) {
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
throw new \Exception('Invalid URL received by http\HttpClient', 400);
}
$paramstr = '';
if (!empty($data)) {
if (is_array($data)) {
$paramstr = $this->urlencode_array($data);
} elseif (is_scal... | [
"public",
"function",
"post_async",
"(",
"$",
"url",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_VALIDATE_URL",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'In... | Make an asynchronous POST request.
A fire-and-forget post function to distribute information without waiting for the recipient to respond.
@param string $url The URL to POST to.
@param array|string $data An array or string containing data to send.
@return bool Success/Failure | [
"Make",
"an",
"asynchronous",
"POST",
"request",
"."
] | 9714796945db4908605be6f19c31ded1ee813c70 | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClient.php#L128-L168 |
192,648 | pdyn/httpclient | HttpClient.php | HttpClient.get_remote_filesize | public static function get_remote_filesize($url, $maxredirs = 2) {
$parts = parse_url($url);
if (empty($parts['host'])) {
return false;
}
if ($parts['scheme'] === 'https') {
$host = 'ssl://'.$parts['host'];
$port = (isset($parts['port'])) ? $parts['port'] : 443;
} else {
$host = $parts['host'];
... | php | public static function get_remote_filesize($url, $maxredirs = 2) {
$parts = parse_url($url);
if (empty($parts['host'])) {
return false;
}
if ($parts['scheme'] === 'https') {
$host = 'ssl://'.$parts['host'];
$port = (isset($parts['port'])) ? $parts['port'] : 443;
} else {
$host = $parts['host'];
... | [
"public",
"static",
"function",
"get_remote_filesize",
"(",
"$",
"url",
",",
"$",
"maxredirs",
"=",
"2",
")",
"{",
"$",
"parts",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"parts",
"[",
"'host'",
"]",
")",
")",
"{",
... | Gets the reported filesize of a remote object.
@param string $url The URL to get the filesize of.
@param bool $maxredirs Maximum number of redirects to follow.
@return bool|int The filesize in bytes, or false if fail. | [
"Gets",
"the",
"reported",
"filesize",
"of",
"a",
"remote",
"object",
"."
] | 9714796945db4908605be6f19c31ded1ee813c70 | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClient.php#L177-L238 |
192,649 | pdyn/httpclient | HttpClient.php | HttpClient.urlencode_array | public function urlencode_array(array $ar) {
$datastring = '';
foreach ($ar as $key => $val) {
if (!empty($datastring)) {
$datastring .= '&';
}
$datastring .= urlencode($key).'='.urlencode($val);
}
return $datastring;
} | php | public function urlencode_array(array $ar) {
$datastring = '';
foreach ($ar as $key => $val) {
if (!empty($datastring)) {
$datastring .= '&';
}
$datastring .= urlencode($key).'='.urlencode($val);
}
return $datastring;
} | [
"public",
"function",
"urlencode_array",
"(",
"array",
"$",
"ar",
")",
"{",
"$",
"datastring",
"=",
"''",
";",
"foreach",
"(",
"$",
"ar",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"datastring",
")",
")",
"{"... | Transforms an array of parameters into a urlencoded request string.
@param array $ar An array of key=>val to encode and transform
@return string The urlencoded request string | [
"Transforms",
"an",
"array",
"of",
"parameters",
"into",
"a",
"urlencoded",
"request",
"string",
"."
] | 9714796945db4908605be6f19c31ded1ee813c70 | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClient.php#L246-L255 |
192,650 | pdyn/httpclient | HttpClient.php | HttpClient.set_basic_auth | public function set_basic_auth($username, $password) {
$value = 'Basic '.base64_encode($username.':'.$password);
$this->set_header('Authorization', $value);
return true;
} | php | public function set_basic_auth($username, $password) {
$value = 'Basic '.base64_encode($username.':'.$password);
$this->set_header('Authorization', $value);
return true;
} | [
"public",
"function",
"set_basic_auth",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"value",
"=",
"'Basic '",
".",
"base64_encode",
"(",
"$",
"username",
".",
"':'",
".",
"$",
"password",
")",
";",
"$",
"this",
"->",
"set_header",
"(",
"... | Set a basic auth header.
@param string $username The username to use.
@param string $password The password to use. | [
"Set",
"a",
"basic",
"auth",
"header",
"."
] | 9714796945db4908605be6f19c31ded1ee813c70 | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClient.php#L331-L335 |
192,651 | pdyn/httpclient | HttpClient.php | HttpClient.execute_curl | protected function execute_curl($options) {
$ch = curl_init();
curl_setopt_array($ch, $options);
$returned = curl_exec($ch);
$response = HttpClientResponse::instance_from_curl($ch, $returned);
curl_close($ch);
return $response;
} | php | protected function execute_curl($options) {
$ch = curl_init();
curl_setopt_array($ch, $options);
$returned = curl_exec($ch);
$response = HttpClientResponse::instance_from_curl($ch, $returned);
curl_close($ch);
return $response;
} | [
"protected",
"function",
"execute_curl",
"(",
"$",
"options",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt_array",
"(",
"$",
"ch",
",",
"$",
"options",
")",
";",
"$",
"returned",
"=",
"curl_exec",
"(",
"$",
"ch",
")",
";",
"$",
... | Execute a curl call with the given options.
@param array $options Array of curl options.
@return string Returned strings. | [
"Execute",
"a",
"curl",
"call",
"with",
"the",
"given",
"options",
"."
] | 9714796945db4908605be6f19c31ded1ee813c70 | https://github.com/pdyn/httpclient/blob/9714796945db4908605be6f19c31ded1ee813c70/HttpClient.php#L438-L445 |
192,652 | cubicmushroom/valueobjects | src/Web/Url.php | Url.fromNative | public static function fromNative()
{
$urlString = \func_get_arg(0);
$user = \parse_url($urlString, PHP_URL_USER);
$pass = \parse_url($urlString, PHP_URL_PASS);
$host = \parse_url($urlString, PHP_URL_HOST);
$queryString = \parse_url($urlString, PHP_URL_Q... | php | public static function fromNative()
{
$urlString = \func_get_arg(0);
$user = \parse_url($urlString, PHP_URL_USER);
$pass = \parse_url($urlString, PHP_URL_PASS);
$host = \parse_url($urlString, PHP_URL_HOST);
$queryString = \parse_url($urlString, PHP_URL_Q... | [
"public",
"static",
"function",
"fromNative",
"(",
")",
"{",
"$",
"urlString",
"=",
"\\",
"func_get_arg",
"(",
"0",
")",
";",
"$",
"user",
"=",
"\\",
"parse_url",
"(",
"$",
"urlString",
",",
"PHP_URL_USER",
")",
";",
"$",
"pass",
"=",
"\\",
"parse_url"... | Returns a new Url object from a native url string
@param $url_string
@return Url | [
"Returns",
"a",
"new",
"Url",
"object",
"from",
"a",
"native",
"url",
"string"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Web/Url.php#L41-L62 |
192,653 | cubicmushroom/valueobjects | src/Web/Url.php | Url.sameValueAs | public function sameValueAs(ValueObjectInterface $url)
{
if (false === Util::classEquals($this, $url)) {
return false;
}
return $this->getScheme()->sameValueAs($url->getScheme()) &&
$this->getUser()->sameValueAs($url->getUser()) &&
$this->getPasswor... | php | public function sameValueAs(ValueObjectInterface $url)
{
if (false === Util::classEquals($this, $url)) {
return false;
}
return $this->getScheme()->sameValueAs($url->getScheme()) &&
$this->getUser()->sameValueAs($url->getUser()) &&
$this->getPasswor... | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"url",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"url",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
... | Tells whether two Url are sameValueAs by comparing their components
@param ValueObjectInterface $url
@return bool | [
"Tells",
"whether",
"two",
"Url",
"are",
"sameValueAs",
"by",
"comparing",
"their",
"components"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Web/Url.php#L94-L109 |
192,654 | libreworks/caridea-session | src/FlashPlugin.php | FlashPlugin.clear | public function clear(bool $current = false): void
{
if ($current) {
$this->curr->clear();
}
$this->next->clear();
} | php | public function clear(bool $current = false): void
{
if ($current) {
$this->curr->clear();
}
$this->next->clear();
} | [
"public",
"function",
"clear",
"(",
"bool",
"$",
"current",
"=",
"false",
")",
":",
"void",
"{",
"if",
"(",
"$",
"current",
")",
"{",
"$",
"this",
"->",
"curr",
"->",
"clear",
"(",
")",
";",
"}",
"$",
"this",
"->",
"next",
"->",
"clear",
"(",
"... | Removes any flash values for the _next_ request, optionally also in the _current_.
@param bool $current If true, also clears flash values from the _current_ request. | [
"Removes",
"any",
"flash",
"values",
"for",
"the",
"_next_",
"request",
"optionally",
"also",
"in",
"the",
"_current_",
"."
] | cb2a7c0cdcd172edbf267e5c69b396708b425f47 | https://github.com/libreworks/caridea-session/blob/cb2a7c0cdcd172edbf267e5c69b396708b425f47/src/FlashPlugin.php#L58-L64 |
192,655 | libreworks/caridea-session | src/FlashPlugin.php | FlashPlugin.getCurrent | public function getCurrent(string $name, $alt = null)
{
return $this->curr->get($name, $alt);
} | php | public function getCurrent(string $name, $alt = null)
{
return $this->curr->get($name, $alt);
} | [
"public",
"function",
"getCurrent",
"(",
"string",
"$",
"name",
",",
"$",
"alt",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"curr",
"->",
"get",
"(",
"$",
"name",
",",
"$",
"alt",
")",
";",
"}"
] | Gets the flash value for a key in the _current_ request.
@param string $name The name
@param mixed $alt Optional default value to return
@return mixed The value, or the `$alt` if not found | [
"Gets",
"the",
"flash",
"value",
"for",
"a",
"key",
"in",
"the",
"_current_",
"request",
"."
] | cb2a7c0cdcd172edbf267e5c69b396708b425f47 | https://github.com/libreworks/caridea-session/blob/cb2a7c0cdcd172edbf267e5c69b396708b425f47/src/FlashPlugin.php#L93-L96 |
192,656 | libreworks/caridea-session | src/FlashPlugin.php | FlashPlugin.set | public function set(string $name, $value, bool $current = false): void
{
if ($current) {
$this->curr->offsetSet($name, $value);
}
$this->next->offsetSet($name, $value);
} | php | public function set(string $name, $value, bool $current = false): void
{
if ($current) {
$this->curr->offsetSet($name, $value);
}
$this->next->offsetSet($name, $value);
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"$",
"value",
",",
"bool",
"$",
"current",
"=",
"false",
")",
":",
"void",
"{",
"if",
"(",
"$",
"current",
")",
"{",
"$",
"this",
"->",
"curr",
"->",
"offsetSet",
"(",
"$",
"name",
","... | Sets a flash value for the _next_ request, optionally also in the _current_ request.
@param string $name The name
@param mixed $value The value
@param bool $current If true, also sets flash value for the _current_ request. | [
"Sets",
"a",
"flash",
"value",
"for",
"the",
"_next_",
"request",
"optionally",
"also",
"in",
"the",
"_current_",
"request",
"."
] | cb2a7c0cdcd172edbf267e5c69b396708b425f47 | https://github.com/libreworks/caridea-session/blob/cb2a7c0cdcd172edbf267e5c69b396708b425f47/src/FlashPlugin.php#L125-L131 |
192,657 | libreworks/caridea-session | src/FlashPlugin.php | FlashPlugin.cycle | protected function cycle()
{
if (!$this->moved) {
$this->curr->clear();
$this->curr->merge($this->next);
$this->next->clear();
$this->moved = true;
}
} | php | protected function cycle()
{
if (!$this->moved) {
$this->curr->clear();
$this->curr->merge($this->next);
$this->next->clear();
$this->moved = true;
}
} | [
"protected",
"function",
"cycle",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"moved",
")",
"{",
"$",
"this",
"->",
"curr",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"curr",
"->",
"merge",
"(",
"$",
"this",
"->",
"next",
")",
";",
... | Transitions the values from next to current. | [
"Transitions",
"the",
"values",
"from",
"next",
"to",
"current",
"."
] | cb2a7c0cdcd172edbf267e5c69b396708b425f47 | https://github.com/libreworks/caridea-session/blob/cb2a7c0cdcd172edbf267e5c69b396708b425f47/src/FlashPlugin.php#L146-L154 |
192,658 | teonsystems/php-base | src/Mvc/Controller/Plugin/FlashMessengerNow.php | FlashMessengerNow.getMessagesFromContainer | protected function getMessagesFromContainer()
{
$container = $this->getContainer();
$namespaces = array();
foreach ($container as $namespace => $messages) {
if (isset($this->messages[$namespace])) {
$this->messages[$namespace] = array_merge($this->messages[$names... | php | protected function getMessagesFromContainer()
{
$container = $this->getContainer();
$namespaces = array();
foreach ($container as $namespace => $messages) {
if (isset($this->messages[$namespace])) {
$this->messages[$namespace] = array_merge($this->messages[$names... | [
"protected",
"function",
"getMessagesFromContainer",
"(",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
";",
"$",
"namespaces",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"container",
"as",
"$",
"namespace",
"=>",
"... | Pull messages from the session container, and merge them with current messages
Iterates through the session container, removing messages into the local
scope.
@return void | [
"Pull",
"messages",
"from",
"the",
"session",
"container",
"and",
"merge",
"them",
"with",
"current",
"messages"
] | 010418fd9df3c447a74b36cf0d31e2d38a6527ac | https://github.com/teonsystems/php-base/blob/010418fd9df3c447a74b36cf0d31e2d38a6527ac/src/Mvc/Controller/Plugin/FlashMessengerNow.php#L49-L66 |
192,659 | gplcart/cli | controllers/commands/Field.php | Field.cmdGetField | public function cmdGetField()
{
$result = $this->getListField();
$this->outputFormat($result);
$this->outputFormatTableField($result);
$this->output();
} | php | public function cmdGetField()
{
$result = $this->getListField();
$this->outputFormat($result);
$this->outputFormatTableField($result);
$this->output();
} | [
"public",
"function",
"cmdGetField",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getListField",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
"outputFormatTableField",
"(",
"$",
"result",
... | Callback for "field-get" command | [
"Callback",
"for",
"field",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Field.php#L40-L46 |
192,660 | gplcart/cli | controllers/commands/Field.php | Field.cmdUpdateField | public function cmdUpdateField()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | php | public function cmdUpdateField()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | [
"public",
"function",
"cmdUpdateField",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParam",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"0",
"]",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"2",
")",
"{",
"$"... | Callback for "field-update" command | [
"Callback",
"for",
"field",
"-",
"update",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Field.php#L117-L135 |
192,661 | gplcart/cli | controllers/commands/Field.php | Field.submitAddField | protected function submitAddField()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('field');
$this->addField();
} | php | protected function submitAddField()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('field');
$this->addField();
} | [
"protected",
"function",
"submitAddField",
"(",
")",
"{",
"$",
"this",
"->",
"setSubmitted",
"(",
"null",
",",
"$",
"this",
"->",
"getParam",
"(",
")",
")",
";",
"$",
"this",
"->",
"validateComponent",
"(",
"'field'",
")",
";",
"$",
"this",
"->",
"addF... | Add a new field at once | [
"Add",
"a",
"new",
"field",
"at",
"once"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Field.php#L227-L232 |
192,662 | gplcart/cli | controllers/commands/Field.php | Field.wizardAddField | protected function wizardAddField()
{
// Required
$this->validatePrompt('title', $this->text('Name'), 'field');
$this->validateMenu('type', $this->text('Type'), 'field', $this->field->getTypes());
$this->validateMenu('widget', $this->text('Widget'), 'field', $this->field->getWidgetTy... | php | protected function wizardAddField()
{
// Required
$this->validatePrompt('title', $this->text('Name'), 'field');
$this->validateMenu('type', $this->text('Type'), 'field', $this->field->getTypes());
$this->validateMenu('widget', $this->text('Widget'), 'field', $this->field->getWidgetTy... | [
"protected",
"function",
"wizardAddField",
"(",
")",
"{",
"// Required",
"$",
"this",
"->",
"validatePrompt",
"(",
"'title'",
",",
"$",
"this",
"->",
"text",
"(",
"'Name'",
")",
",",
"'field'",
")",
";",
"$",
"this",
"->",
"validateMenu",
"(",
"'type'",
... | Add a new field step by step | [
"Add",
"a",
"new",
"field",
"step",
"by",
"step"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Field.php#L237-L250 |
192,663 | aVigorousDev/numbers | src/drmyersii/Words.php | Words.GetXX | public function GetXX($number_str, $modifer)
{
$number_int = intval($number_str);
if ($number_int >= 0 && $number_int < 100)
{
if (array_key_exists($number_int, $this->words->xx))
{
return $this->words->xx[$number_int];
}
else
{
throw new Exception('xx: Array index (' . $number_int . ') d... | php | public function GetXX($number_str, $modifer)
{
$number_int = intval($number_str);
if ($number_int >= 0 && $number_int < 100)
{
if (array_key_exists($number_int, $this->words->xx))
{
return $this->words->xx[$number_int];
}
else
{
throw new Exception('xx: Array index (' . $number_int . ') d... | [
"public",
"function",
"GetXX",
"(",
"$",
"number_str",
",",
"$",
"modifer",
")",
"{",
"$",
"number_int",
"=",
"intval",
"(",
"$",
"number_str",
")",
";",
"if",
"(",
"$",
"number_int",
">=",
"0",
"&&",
"$",
"number_int",
"<",
"100",
")",
"{",
"if",
... | Pass in a number that is inclusively between 0 and 99, and it will return the corresponding
words.
@param $number string
@param $modifier string
@return string | [
"Pass",
"in",
"a",
"number",
"that",
"is",
"inclusively",
"between",
"0",
"and",
"99",
"and",
"it",
"will",
"return",
"the",
"corresponding",
"words",
"."
] | 02124e75286758d216a22d1d963946dab9e8582b | https://github.com/aVigorousDev/numbers/blob/02124e75286758d216a22d1d963946dab9e8582b/src/drmyersii/Words.php#L31-L50 |
192,664 | codeblanche/Web | src/Web/Response/Response.php | Response.send | public function send($output, OutputStrategyInterface $outputStrategy = null)
{
if (!($outputStrategy instanceof OutputStrategyInterface)) {
$outputStrategy = $this->defaultOutputStrategy;
}
$contentType = new Header(
Header::CONTENT_TYPE,
$outputStrategy... | php | public function send($output, OutputStrategyInterface $outputStrategy = null)
{
if (!($outputStrategy instanceof OutputStrategyInterface)) {
$outputStrategy = $this->defaultOutputStrategy;
}
$contentType = new Header(
Header::CONTENT_TYPE,
$outputStrategy... | [
"public",
"function",
"send",
"(",
"$",
"output",
",",
"OutputStrategyInterface",
"$",
"outputStrategy",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"outputStrategy",
"instanceof",
"OutputStrategyInterface",
")",
")",
"{",
"$",
"outputStrategy",
"=",
"$",... | Send the given output using the given or default output strategy.
@param string $output
@param OutputStrategyInterface $outputStrategy
@return int | [
"Send",
"the",
"given",
"output",
"using",
"the",
"given",
"or",
"default",
"output",
"strategy",
"."
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Response/Response.php#L125-L139 |
192,665 | codeblanche/Web | src/Web/Response/Response.php | Response.sendFile | public function sendFile($src)
{
$pointer = fopen($src, 'r');
if (!is_resource($pointer)) {
throw new RuntimeException("Unable to load '$src' for sending.");
}
$result = fpassthru($pointer);
fclose($pointer);
return $result;
} | php | public function sendFile($src)
{
$pointer = fopen($src, 'r');
if (!is_resource($pointer)) {
throw new RuntimeException("Unable to load '$src' for sending.");
}
$result = fpassthru($pointer);
fclose($pointer);
return $result;
} | [
"public",
"function",
"sendFile",
"(",
"$",
"src",
")",
"{",
"$",
"pointer",
"=",
"fopen",
"(",
"$",
"src",
",",
"'r'",
")",
";",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"pointer",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Unable to... | Directly output results from a file. This bypasses the output strategy altogether.
@param $src
@throws RuntimeException
@return int|bool | [
"Directly",
"output",
"results",
"from",
"a",
"file",
".",
"This",
"bypasses",
"the",
"output",
"strategy",
"altogether",
"."
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Response/Response.php#L149-L162 |
192,666 | OliverMonneke/pennePHP | src/Mathematic/Calculate.php | Calculate.divide | public function divide($number)
{
if (Number::isZero($number)) {
throw new DivisionByZeroException;
}
$this->number = $this->number / $number;
return $this;
} | php | public function divide($number)
{
if (Number::isZero($number)) {
throw new DivisionByZeroException;
}
$this->number = $this->number / $number;
return $this;
} | [
"public",
"function",
"divide",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"Number",
"::",
"isZero",
"(",
"$",
"number",
")",
")",
"{",
"throw",
"new",
"DivisionByZeroException",
";",
"}",
"$",
"this",
"->",
"number",
"=",
"$",
"this",
"->",
"number",
... | Divide a value
@param int|float $number The number
@throws DivisionByZeroException
@return Calculate | [
"Divide",
"a",
"value"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Mathematic/Calculate.php#L89-L98 |
192,667 | OliverMonneke/pennePHP | src/Mathematic/Calculate.php | Calculate.round | public function round($precision = 0, $mode = PHP_ROUND_HALF_UP)
{
$this->number = round($this->number, $precision, $mode);
return $this;
} | php | public function round($precision = 0, $mode = PHP_ROUND_HALF_UP)
{
$this->number = round($this->number, $precision, $mode);
return $this;
} | [
"public",
"function",
"round",
"(",
"$",
"precision",
"=",
"0",
",",
"$",
"mode",
"=",
"PHP_ROUND_HALF_UP",
")",
"{",
"$",
"this",
"->",
"number",
"=",
"round",
"(",
"$",
"this",
"->",
"number",
",",
"$",
"precision",
",",
"$",
"mode",
")",
";",
"r... | Round the value
@param int $precision The precision
@param int $mode Mode to round
@return Calculate | [
"Round",
"the",
"value"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Mathematic/Calculate.php#L108-L113 |
192,668 | OliverMonneke/pennePHP | src/Mathematic/Calculate.php | Calculate.toTheN | public function toTheN($number)
{
for ($i = 1; $i <= $number; $i++) {
$this->multiply($this->number);
}
return $this;
} | php | public function toTheN($number)
{
for ($i = 1; $i <= $number; $i++) {
$this->multiply($this->number);
}
return $this;
} | [
"public",
"function",
"toTheN",
"(",
"$",
"number",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"1",
";",
"$",
"i",
"<=",
"$",
"number",
";",
"$",
"i",
"++",
")",
"{",
"$",
"this",
"->",
"multiply",
"(",
"$",
"this",
"->",
"number",
")",
";",
"}",
... | To the n expression
@param number $number The number
@return Calculate | [
"To",
"the",
"n",
"expression"
] | dd0de7944685a3f1947157e1254fc54b55ff9942 | https://github.com/OliverMonneke/pennePHP/blob/dd0de7944685a3f1947157e1254fc54b55ff9942/src/Mathematic/Calculate.php#L122-L129 |
192,669 | rollerworks/search-core | Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php | DateTimeToTimestampTransformer.transform | public function transform($dateTime): ?int
{
if (null === $dateTime) {
return null;
}
if (!$dateTime instanceof \DateTimeInterface) {
throw new TransformationFailedException('Expected a \DateTimeInterface.');
}
return $dateTime->getTimestamp();
} | php | public function transform($dateTime): ?int
{
if (null === $dateTime) {
return null;
}
if (!$dateTime instanceof \DateTimeInterface) {
throw new TransformationFailedException('Expected a \DateTimeInterface.');
}
return $dateTime->getTimestamp();
} | [
"public",
"function",
"transform",
"(",
"$",
"dateTime",
")",
":",
"?",
"int",
"{",
"if",
"(",
"null",
"===",
"$",
"dateTime",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"$",
"dateTime",
"instanceof",
"\\",
"DateTimeInterface",
")",
"{",
"... | Transforms a DateTime object into a timestamp in the configured timezone.
@param \DateTimeInterface|null $dateTime
@throws TransformationFailedException If the given value is not a \DateTimeInterface
@return int|null A timestamp | [
"Transforms",
"a",
"DateTime",
"object",
"into",
"a",
"timestamp",
"in",
"the",
"configured",
"timezone",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php#L35-L46 |
192,670 | DaGhostman/codewave | src/Router/ExtendedRouteCollector.php | ExtendedRouteCollector.getData | public function getData()
{
if ($this->cacheProvider !== null &&
$this->cacheProvider->contains('routerCache')) {
return $this->cacheProvider->fetch('routerCache');
}
return parent::getData();
} | php | public function getData()
{
if ($this->cacheProvider !== null &&
$this->cacheProvider->contains('routerCache')) {
return $this->cacheProvider->fetch('routerCache');
}
return parent::getData();
} | [
"public",
"function",
"getData",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cacheProvider",
"!==",
"null",
"&&",
"$",
"this",
"->",
"cacheProvider",
"->",
"contains",
"(",
"'routerCache'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"cacheProvider",
"... | Returns the collected route data, as provided by the data generator.
@return array | [
"Returns",
"the",
"collected",
"route",
"data",
"as",
"provided",
"by",
"the",
"data",
"generator",
"."
] | f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8 | https://github.com/DaGhostman/codewave/blob/f0f58e721699cdaaf87cbfaf8ce589a6b3c473b8/src/Router/ExtendedRouteCollector.php#L63-L71 |
192,671 | pluf/tenant | src/Tenant/SPA/Manager/Simple.php | Tenant_SPA_Manager_Simple.checkUpdate | public static function checkUpdate($request, $object)
{
$repo = new Tenant_Views_SpaRepository();
$spa = $repo->get(new Pluf_HTTP_Request('/'), array(
'modelId' => $object->name
));
$object->last_version = $spa->version;
$object->update();
return $object;
... | php | public static function checkUpdate($request, $object)
{
$repo = new Tenant_Views_SpaRepository();
$spa = $repo->get(new Pluf_HTTP_Request('/'), array(
'modelId' => $object->name
));
$object->last_version = $spa->version;
$object->update();
return $object;
... | [
"public",
"static",
"function",
"checkUpdate",
"(",
"$",
"request",
",",
"$",
"object",
")",
"{",
"$",
"repo",
"=",
"new",
"Tenant_Views_SpaRepository",
"(",
")",
";",
"$",
"spa",
"=",
"$",
"repo",
"->",
"get",
"(",
"new",
"Pluf_HTTP_Request",
"(",
"'/'"... | Check update of an spa
@param Pluf_HTTP_Request $request
@param Tenant_SPA $object | [
"Check",
"update",
"of",
"an",
"spa"
] | a06359c52b9a257b5a0a186264e8770acfc54b73 | https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/SPA/Manager/Simple.php#L152-L161 |
192,672 | pluf/tenant | src/Tenant/SPA/Manager/Simple.php | Tenant_SPA_Manager_Simple.update | public static function update($request, $object)
{
// request param
$backend = Pluf::f('marketplace.backend', 'http://marketplace.webpich.com');
$path = '/api/v2/marketplace/spas/' . $object->name . '/file';
$file = Pluf::f('temp_folder', '/tmp') . '/spa-' . rand();
// Do req... | php | public static function update($request, $object)
{
// request param
$backend = Pluf::f('marketplace.backend', 'http://marketplace.webpich.com');
$path = '/api/v2/marketplace/spas/' . $object->name . '/file';
$file = Pluf::f('temp_folder', '/tmp') . '/spa-' . rand();
// Do req... | [
"public",
"static",
"function",
"update",
"(",
"$",
"request",
",",
"$",
"object",
")",
"{",
"// request param",
"$",
"backend",
"=",
"Pluf",
"::",
"f",
"(",
"'marketplace.backend'",
",",
"'http://marketplace.webpich.com'",
")",
";",
"$",
"path",
"=",
"'/api/v... | Update an spa
@param Pluf_HTTP_Request $request
@param Tenant_SPA $object | [
"Update",
"an",
"spa"
] | a06359c52b9a257b5a0a186264e8770acfc54b73 | https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/SPA/Manager/Simple.php#L169-L181 |
192,673 | GeckoPackages/GeckoMemcacheMock | src/MemcacheMock/MemcachedMock.php | MemcachedMock.storeValueInCache | private function storeValueInCache($key, $value, $expiration = null)
{
$this->cache[$key] = new MemcacheObject($key, serialize($value), $this->normalizeExpirationTime($expiration));
} | php | private function storeValueInCache($key, $value, $expiration = null)
{
$this->cache[$key] = new MemcacheObject($key, serialize($value), $this->normalizeExpirationTime($expiration));
} | [
"private",
"function",
"storeValueInCache",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expiration",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"new",
"MemcacheObject",
"(",
"$",
"key",
",",
"serialize",
"(",
"$"... | Dumb setter, no checks by design.
@param string $key
@param mixed $value
@param int $expiration | [
"Dumb",
"setter",
"no",
"checks",
"by",
"design",
"."
] | 33be1e858de764cf274f9d7c44627fa63cf50856 | https://github.com/GeckoPackages/GeckoMemcacheMock/blob/33be1e858de764cf274f9d7c44627fa63cf50856/src/MemcacheMock/MemcachedMock.php#L1336-L1339 |
192,674 | Innmind/Math | src/Matrix.php | Matrix.initialize | public static function initialize(Dimension $dimension, Number $value): self
{
$rows = [];
$count = $dimension->rows()->value();
for ($i = 0; $i < $count; ++$i) {
$rows[] = new RowVector(
...array_fill(
0,
$dimension->colum... | php | public static function initialize(Dimension $dimension, Number $value): self
{
$rows = [];
$count = $dimension->rows()->value();
for ($i = 0; $i < $count; ++$i) {
$rows[] = new RowVector(
...array_fill(
0,
$dimension->colum... | [
"public",
"static",
"function",
"initialize",
"(",
"Dimension",
"$",
"dimension",
",",
"Number",
"$",
"value",
")",
":",
"self",
"{",
"$",
"rows",
"=",
"[",
"]",
";",
"$",
"count",
"=",
"$",
"dimension",
"->",
"rows",
"(",
")",
"->",
"value",
"(",
... | Initialize a matrix to the wished dimension filled with the specified value | [
"Initialize",
"a",
"matrix",
"to",
"the",
"wished",
"dimension",
"filled",
"with",
"the",
"specified",
"value"
] | ac9ad4dd1852c145e90f5edc0f38a873b125a50b | https://github.com/Innmind/Math/blob/ac9ad4dd1852c145e90f5edc0f38a873b125a50b/src/Matrix.php#L87-L103 |
192,675 | t3v/t3v_core | Classes/Utility/GeneralUtility.php | GeneralUtility.identifier | public static function identifier(string $name, string $separator = '_'): string {
$slugify = new Slugify(['separator' => $separator]);
$identifier = $slugify->slugify($name);
return $identifier;
} | php | public static function identifier(string $name, string $separator = '_'): string {
$slugify = new Slugify(['separator' => $separator]);
$identifier = $slugify->slugify($name);
return $identifier;
} | [
"public",
"static",
"function",
"identifier",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"separator",
"=",
"'_'",
")",
":",
"string",
"{",
"$",
"slugify",
"=",
"new",
"Slugify",
"(",
"[",
"'separator'",
"=>",
"$",
"separator",
"]",
")",
";",
"$",
... | Gets an identifier from a name.
@param string $name The name
@param string $separator The optional separator, defaults to `_`
@return string The identifier | [
"Gets",
"an",
"identifier",
"from",
"a",
"name",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/GeneralUtility.php#L19-L24 |
192,676 | t3v/t3v_core | Classes/Utility/GeneralUtility.php | GeneralUtility.getIdentifier | public static function getIdentifier(string $name, string $separator = '_'): string {
return self::identifier($name, $separator);
} | php | public static function getIdentifier(string $name, string $separator = '_'): string {
return self::identifier($name, $separator);
} | [
"public",
"static",
"function",
"getIdentifier",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"separator",
"=",
"'_'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"identifier",
"(",
"$",
"name",
",",
"$",
"separator",
")",
";",
"}"
] | Alias for the `identifier` function.
@param string $name The name
@param string $separator The optional separator, defaults to `_`
@return string The identifier | [
"Alias",
"for",
"the",
"identifier",
"function",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/GeneralUtility.php#L33-L35 |
192,677 | TuumPHP/Web | src/Stack/DocView.php | DocView.handle | private function handle($request)
{
$found = $this->fileMap->render($request->getPathToMatch());
if (empty($found)) {
return null;
}
if (is_resource($found[0])) {
return $request->respond()->asFileContents($found[0], $found[1]);
}
if (is_string... | php | private function handle($request)
{
$found = $this->fileMap->render($request->getPathToMatch());
if (empty($found)) {
return null;
}
if (is_resource($found[0])) {
return $request->respond()->asFileContents($found[0], $found[1]);
}
if (is_string... | [
"private",
"function",
"handle",
"(",
"$",
"request",
")",
"{",
"$",
"found",
"=",
"$",
"this",
"->",
"fileMap",
"->",
"render",
"(",
"$",
"request",
"->",
"getPathToMatch",
"(",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"found",
")",
")",
"{",
... | do the quick extension check.
@param Request $request
@return null|Response | [
"do",
"the",
"quick",
"extension",
"check",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Stack/DocView.php#L79-L92 |
192,678 | TuumPHP/Web | src/Stack/DocView.php | DocView.options | public function options(array $options)
{
if (array_key_exists('enable_raw', $options)) {
$this->fileMap->enable_raw = (bool) $options['enable_raw'];
}
if (array_key_exists('before', $options)) {
$this->setBeforeFilter($options['before']);
}
if (array_... | php | public function options(array $options)
{
if (array_key_exists('enable_raw', $options)) {
$this->fileMap->enable_raw = (bool) $options['enable_raw'];
}
if (array_key_exists('before', $options)) {
$this->setBeforeFilter($options['before']);
}
if (array_... | [
"public",
"function",
"options",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'enable_raw'",
",",
"$",
"options",
")",
")",
"{",
"$",
"this",
"->",
"fileMap",
"->",
"enable_raw",
"=",
"(",
"bool",
")",
"$",
"options",
"[... | set up optional behavior.
- 'enable_raw' : enables raw view for markdown files.
- 'before' : sets before filters.
- 'after' : sets after release filters.
@param array $options | [
"set",
"up",
"optional",
"behavior",
"."
] | 8f296b6358aa93226ce08d6cc54a309f5b0a9820 | https://github.com/TuumPHP/Web/blob/8f296b6358aa93226ce08d6cc54a309f5b0a9820/src/Stack/DocView.php#L103-L119 |
192,679 | shgysk8zer0/core_api | traits/socket_server.php | Socket_Server.socketRecv | final public function socketRecv(&$buff, $len, $flags)
{
return socket_recv($this->socket, $buff, $len, $flags);
} | php | final public function socketRecv(&$buff, $len, $flags)
{
return socket_recv($this->socket, $buff, $len, $flags);
} | [
"final",
"public",
"function",
"socketRecv",
"(",
"&",
"$",
"buff",
",",
"$",
"len",
",",
"$",
"flags",
")",
"{",
"return",
"socket_recv",
"(",
"$",
"this",
"->",
"socket",
",",
"$",
"buff",
",",
"$",
"len",
",",
"$",
"flags",
")",
";",
"}"
] | Receives data from a connected socket
@param string $buff Data received will be fetched to the variable
@param int $len Up to len bytes will be fetched from remote host
@param int $flags MSG_(OOB|PEEK|WAITALL|DONTWAIT) joined with the binary OR (|) operator | [
"Receives",
"data",
"from",
"a",
"connected",
"socket"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/socket_server.php#L120-L123 |
192,680 | shgysk8zer0/core_api | traits/socket_server.php | Socket_Server.socketRecvfrom | final public function socketRecvfrom(&$buff, $len, $flags, &$name, &$port = null)
{
return socket_recvfrom($this->socket, $buff, $len, $flags, $name, $port);
} | php | final public function socketRecvfrom(&$buff, $len, $flags, &$name, &$port = null)
{
return socket_recvfrom($this->socket, $buff, $len, $flags, $name, $port);
} | [
"final",
"public",
"function",
"socketRecvfrom",
"(",
"&",
"$",
"buff",
",",
"$",
"len",
",",
"$",
"flags",
",",
"&",
"$",
"name",
",",
"&",
"$",
"port",
"=",
"null",
")",
"{",
"return",
"socket_recvfrom",
"(",
"$",
"this",
"->",
"socket",
",",
"$"... | Receives data from a socket whether or not it is connection-oriented
@param string $buff The data received
@param int $len Up to len bytes will be fetched from remote host
@param int $flags MSG_(OOB|PEEK|WAITALL|DONTWAIT) joined with the binary OR (|) operator
@param string $name Path for AF_UNIX, IP address... | [
"Receives",
"data",
"from",
"a",
"socket",
"whether",
"or",
"not",
"it",
"is",
"connection",
"-",
"oriented"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/socket_server.php#L134-L137 |
192,681 | shgysk8zer0/core_api | traits/socket_server.php | Socket_Server.socketStrerror | final public function socketStrerror($errno = null)
{
if (! is_int($errno)) {
$errno = $this->socketLastError();
}
return socket_strerror($errno);
} | php | final public function socketStrerror($errno = null)
{
if (! is_int($errno)) {
$errno = $this->socketLastError();
}
return socket_strerror($errno);
} | [
"final",
"public",
"function",
"socketStrerror",
"(",
"$",
"errno",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"errno",
")",
")",
"{",
"$",
"errno",
"=",
"$",
"this",
"->",
"socketLastError",
"(",
")",
";",
"}",
"return",
"socket_stre... | Return a string describing a socket error
@param int $errno A valid socket error number, likely produced by socket_last_error()
@return string The error message associated with the errno parameter | [
"Return",
"a",
"string",
"describing",
"a",
"socket",
"error"
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/socket_server.php#L156-L163 |
192,682 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.setSource | public function setSource(ChildSource $v = null)
{
if ($v === null) {
$this->setSourceId(NULL);
} else {
$this->setSourceId($v->getId());
}
$this->aSource = $v;
// Add binding for other direction of this n:n relationship.
// If this object ha... | php | public function setSource(ChildSource $v = null)
{
if ($v === null) {
$this->setSourceId(NULL);
} else {
$this->setSourceId($v->getId());
}
$this->aSource = $v;
// Add binding for other direction of this n:n relationship.
// If this object ha... | [
"public",
"function",
"setSource",
"(",
"ChildSource",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setSourceId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setSourceId",
"(",
... | Declares an association between this object and a ChildSource object.
@param ChildSource $v
@return $this|\Attogram\SharedMedia\Orm\Page The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"ChildSource",
"object",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L1734-L1752 |
192,683 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.getSource | public function getSource(ConnectionInterface $con = null)
{
if ($this->aSource === null && ($this->source_id != 0)) {
$this->aSource = ChildSourceQuery::create()->findPk($this->source_id, $con);
/* The following can be used additionally to
guarantee the related objec... | php | public function getSource(ConnectionInterface $con = null)
{
if ($this->aSource === null && ($this->source_id != 0)) {
$this->aSource = ChildSourceQuery::create()->findPk($this->source_id, $con);
/* The following can be used additionally to
guarantee the related objec... | [
"public",
"function",
"getSource",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aSource",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"source_id",
"!=",
"0",
")",
")",
"{",
"$",
"this",
"->",
"aSource... | Get the associated ChildSource object
@param ConnectionInterface $con Optional Connection object.
@return ChildSource The associated ChildSource object.
@throws PropelException | [
"Get",
"the",
"associated",
"ChildSource",
"object"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L1762-L1776 |
192,684 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.initC2Ps | public function initC2Ps($overrideExisting = true)
{
if (null !== $this->collC2Ps && !$overrideExisting) {
return;
}
$collectionClassName = C2PTableMap::getTableMap()->getCollectionClassName();
$this->collC2Ps = new $collectionClassName;
$this->collC2Ps->setMode... | php | public function initC2Ps($overrideExisting = true)
{
if (null !== $this->collC2Ps && !$overrideExisting) {
return;
}
$collectionClassName = C2PTableMap::getTableMap()->getCollectionClassName();
$this->collC2Ps = new $collectionClassName;
$this->collC2Ps->setMode... | [
"public",
"function",
"initC2Ps",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collC2Ps",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"collectionClassName",
"=",
"C2PTableMap"... | Initializes the collC2Ps collection.
By default this just sets the collC2Ps collection to an empty array (like clearcollC2Ps());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values stored in database... | [
"Initializes",
"the",
"collC2Ps",
"collection",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L1833-L1843 |
192,685 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.getC2Ps | public function getC2Ps(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collC2PsPartial && !$this->isNew();
if (null === $this->collC2Ps || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collC2Ps) {
// return empty... | php | public function getC2Ps(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collC2PsPartial && !$this->isNew();
if (null === $this->collC2Ps || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collC2Ps) {
// return empty... | [
"public",
"function",
"getC2Ps",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collC2PsPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
")",
"... | Gets an array of ChildC2P objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $criteria, the ... | [
"Gets",
"an",
"array",
"of",
"ChildC2P",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L1859-L1901 |
192,686 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.addC2P | public function addC2P(ChildC2P $l)
{
if ($this->collC2Ps === null) {
$this->initC2Ps();
$this->collC2PsPartial = true;
}
if (!$this->collC2Ps->contains($l)) {
$this->doAddC2P($l);
if ($this->c2PsScheduledForDeletion and $this->c2PsScheduledF... | php | public function addC2P(ChildC2P $l)
{
if ($this->collC2Ps === null) {
$this->initC2Ps();
$this->collC2PsPartial = true;
}
if (!$this->collC2Ps->contains($l)) {
$this->doAddC2P($l);
if ($this->c2PsScheduledForDeletion and $this->c2PsScheduledF... | [
"public",
"function",
"addC2P",
"(",
"ChildC2P",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collC2Ps",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initC2Ps",
"(",
")",
";",
"$",
"this",
"->",
"collC2PsPartial",
"=",
"true",
";",
"}",
"if",... | Method called to associate a ChildC2P object to this object
through the ChildC2P foreign key attribute.
@param ChildC2P $l ChildC2P
@return $this|\Attogram\SharedMedia\Orm\Page The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildC2P",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildC2P",
"foreign",
"key",
"attribute",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L1980-L1996 |
192,687 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.initM2Ps | public function initM2Ps($overrideExisting = true)
{
if (null !== $this->collM2Ps && !$overrideExisting) {
return;
}
$collectionClassName = M2PTableMap::getTableMap()->getCollectionClassName();
$this->collM2Ps = new $collectionClassName;
$this->collM2Ps->setMode... | php | public function initM2Ps($overrideExisting = true)
{
if (null !== $this->collM2Ps && !$overrideExisting) {
return;
}
$collectionClassName = M2PTableMap::getTableMap()->getCollectionClassName();
$this->collM2Ps = new $collectionClassName;
$this->collM2Ps->setMode... | [
"public",
"function",
"initM2Ps",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collM2Ps",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"collectionClassName",
"=",
"M2PTableMap"... | Initializes the collM2Ps collection.
By default this just sets the collM2Ps collection to an empty array (like clearcollM2Ps());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values stored in database... | [
"Initializes",
"the",
"collM2Ps",
"collection",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L2086-L2096 |
192,688 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.getM2Ps | public function getM2Ps(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collM2PsPartial && !$this->isNew();
if (null === $this->collM2Ps || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collM2Ps) {
// return empty... | php | public function getM2Ps(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collM2PsPartial && !$this->isNew();
if (null === $this->collM2Ps || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collM2Ps) {
// return empty... | [
"public",
"function",
"getM2Ps",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collM2PsPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
")",
"... | Gets an array of ChildM2P objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $criteria, the ... | [
"Gets",
"an",
"array",
"of",
"ChildM2P",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L2112-L2154 |
192,689 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Page.php | Page.addM2P | public function addM2P(ChildM2P $l)
{
if ($this->collM2Ps === null) {
$this->initM2Ps();
$this->collM2PsPartial = true;
}
if (!$this->collM2Ps->contains($l)) {
$this->doAddM2P($l);
if ($this->m2PsScheduledForDeletion and $this->m2PsScheduledF... | php | public function addM2P(ChildM2P $l)
{
if ($this->collM2Ps === null) {
$this->initM2Ps();
$this->collM2PsPartial = true;
}
if (!$this->collM2Ps->contains($l)) {
$this->doAddM2P($l);
if ($this->m2PsScheduledForDeletion and $this->m2PsScheduledF... | [
"public",
"function",
"addM2P",
"(",
"ChildM2P",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collM2Ps",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initM2Ps",
"(",
")",
";",
"$",
"this",
"->",
"collM2PsPartial",
"=",
"true",
";",
"}",
"if",... | Method called to associate a ChildM2P object to this object
through the ChildM2P foreign key attribute.
@param ChildM2P $l ChildM2P
@return $this|\Attogram\SharedMedia\Orm\Page The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildM2P",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildM2P",
"foreign",
"key",
"attribute",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Page.php#L2233-L2249 |
192,690 | Vectrex/vxPHP | src/User/User.php | User.setHashedPassword | public function setHashedPassword($hashedPassword) {
if($hashedPassword !== $this->hashedPassword) {
$this->authenticated = FALSE;
$this->hashedPassword = $hashedPassword;
}
return $this;
} | php | public function setHashedPassword($hashedPassword) {
if($hashedPassword !== $this->hashedPassword) {
$this->authenticated = FALSE;
$this->hashedPassword = $hashedPassword;
}
return $this;
} | [
"public",
"function",
"setHashedPassword",
"(",
"$",
"hashedPassword",
")",
"{",
"if",
"(",
"$",
"hashedPassword",
"!==",
"$",
"this",
"->",
"hashedPassword",
")",
"{",
"$",
"this",
"->",
"authenticated",
"=",
"FALSE",
";",
"$",
"this",
"->",
"hashedPassword... | set password hash; if password hash
differs from previously set hash any previous
authentication result is reset
@param string $hashedPassword
@return \vxPHP\User\User | [
"set",
"password",
"hash",
";",
"if",
"password",
"hash",
"differs",
"from",
"previously",
"set",
"hash",
"any",
"previous",
"authentication",
"result",
"is",
"reset"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/User.php#L125-L134 |
192,691 | Vectrex/vxPHP | src/User/User.php | User.authenticate | public function authenticate($plaintextPassword) {
$encrypter = new PasswordEncrypter();
$this->authenticated = $encrypter->isPasswordValid($plaintextPassword, $this->hashedPassword);
return $this;
} | php | public function authenticate($plaintextPassword) {
$encrypter = new PasswordEncrypter();
$this->authenticated = $encrypter->isPasswordValid($plaintextPassword, $this->hashedPassword);
return $this;
} | [
"public",
"function",
"authenticate",
"(",
"$",
"plaintextPassword",
")",
"{",
"$",
"encrypter",
"=",
"new",
"PasswordEncrypter",
"(",
")",
";",
"$",
"this",
"->",
"authenticated",
"=",
"$",
"encrypter",
"->",
"isPasswordValid",
"(",
"$",
"plaintextPassword",
... | compare passed plain text password with
stored hashed password and store result
@param unknown $plaintextPassword
@return \vxPHP\User\User | [
"compare",
"passed",
"plain",
"text",
"password",
"with",
"stored",
"hashed",
"password",
"and",
"store",
"result"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/User.php#L180-L186 |
192,692 | Vectrex/vxPHP | src/User/User.php | User.setRoles | public function setRoles(array $roles) {
$this->roles = [];
foreach($roles as $role) {
if(!$role instanceof Role) {
throw new \InvalidArgumentException('Role is not a role instance.');
}
if(array_key_exists($role->getRoleName(), $this->roles)) {
throw new \InvalidArgumentException(sprintf("R... | php | public function setRoles(array $roles) {
$this->roles = [];
foreach($roles as $role) {
if(!$role instanceof Role) {
throw new \InvalidArgumentException('Role is not a role instance.');
}
if(array_key_exists($role->getRoleName(), $this->roles)) {
throw new \InvalidArgumentException(sprintf("R... | [
"public",
"function",
"setRoles",
"(",
"array",
"$",
"roles",
")",
"{",
"$",
"this",
"->",
"roles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"roles",
"as",
"$",
"role",
")",
"{",
"if",
"(",
"!",
"$",
"role",
"instanceof",
"Role",
")",
"{",
"throw... | set all roles of user
@param Role[]
@throws \InvalidArgumentException
@return \vxPHP\User\User | [
"set",
"all",
"roles",
"of",
"user"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/User.php#L218-L236 |
192,693 | Vectrex/vxPHP | src/User/User.php | User.getRolesAndSubRoles | public function getRolesAndSubRoles(RoleHierarchy $roleHierarchy) {
$possibleRoles = [];
foreach($this->roles as $role) {
$possibleRoles[] = $role;
$possibleRoles = array_merge($possibleRoles, $roleHierarchy->getSubRoles($role));
return $possibleRoles;
}
} | php | public function getRolesAndSubRoles(RoleHierarchy $roleHierarchy) {
$possibleRoles = [];
foreach($this->roles as $role) {
$possibleRoles[] = $role;
$possibleRoles = array_merge($possibleRoles, $roleHierarchy->getSubRoles($role));
return $possibleRoles;
}
} | [
"public",
"function",
"getRolesAndSubRoles",
"(",
"RoleHierarchy",
"$",
"roleHierarchy",
")",
"{",
"$",
"possibleRoles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"roles",
"as",
"$",
"role",
")",
"{",
"$",
"possibleRoles",
"[",
"]",
"=",
"$"... | return all possible roles and subroles - defined by a role
hierarchy - the user can take
@param RoleHierarchy $roleHierarchy
@return Role[] | [
"return",
"all",
"possible",
"roles",
"and",
"subroles",
"-",
"defined",
"by",
"a",
"role",
"hierarchy",
"-",
"the",
"user",
"can",
"take"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/User.php#L257-L269 |
192,694 | p2made/yii2-p2y2-base | helpers/P2Settings.php | P2Settings.p2mSettings | protected static function p2mSettings()
{
if(isset(self::$_p2mSettings)) {
return self::$_p2mSettings;
}
return self::getSettingsItem(self::$_p2mSettings, Yii::$app->params, 'p2m');
} | php | protected static function p2mSettings()
{
if(isset(self::$_p2mSettings)) {
return self::$_p2mSettings;
}
return self::getSettingsItem(self::$_p2mSettings, Yii::$app->params, 'p2m');
} | [
"protected",
"static",
"function",
"p2mSettings",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"_p2mSettings",
")",
")",
"{",
"return",
"self",
"::",
"$",
"_p2mSettings",
";",
"}",
"return",
"self",
"::",
"getSettingsItem",
"(",
"self",
"::... | Get p2m settings
@return array | false
@default false | [
"Get",
"p2m",
"settings"
] | face3df8794407cdc8178ed64c06cc760c449de2 | https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/helpers/P2Settings.php#L35-L42 |
192,695 | p2made/yii2-p2y2-base | helpers/P2Settings.php | P2Settings.getSettingsBlock | protected static function getSettingsBlock($name)
{
return self::getSettingsItem(
self::$_settingsBlock,
self::p2mSettings(),
$name, false
);
} | php | protected static function getSettingsBlock($name)
{
return self::getSettingsItem(
self::$_settingsBlock,
self::p2mSettings(),
$name, false
);
} | [
"protected",
"static",
"function",
"getSettingsBlock",
"(",
"$",
"name",
")",
"{",
"return",
"self",
"::",
"getSettingsItem",
"(",
"self",
"::",
"$",
"_settingsBlock",
",",
"self",
"::",
"p2mSettings",
"(",
")",
",",
"$",
"name",
",",
"false",
")",
";",
... | Get settings block
@param string $name
@return array | false
@default false | [
"Get",
"settings",
"block"
] | face3df8794407cdc8178ed64c06cc760c449de2 | https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/helpers/P2Settings.php#L50-L57 |
192,696 | p2made/yii2-p2y2-base | helpers/P2Settings.php | P2Settings.getSettingsItem | protected static function getSettingsItem(&$target, $source, $name = '', $default = false)
{
/**
* if $target is already set,
* return it unchanged
*/
if(isset($target)) {
return $target;
}
$useSource = true;
/**
* if $source is false,
* or $source[$name] is not set,
* set $useSource f... | php | protected static function getSettingsItem(&$target, $source, $name = '', $default = false)
{
/**
* if $target is already set,
* return it unchanged
*/
if(isset($target)) {
return $target;
}
$useSource = true;
/**
* if $source is false,
* or $source[$name] is not set,
* set $useSource f... | [
"protected",
"static",
"function",
"getSettingsItem",
"(",
"&",
"$",
"target",
",",
"$",
"source",
",",
"$",
"name",
"=",
"''",
",",
"$",
"default",
"=",
"false",
")",
"{",
"/**\n\t\t * if $target is already set,\n\t\t * return it unchanged\n\t\t */",
"if",
"(",
"... | Get settings item
@param array | false $source
@param object &$target
@param string $name
@param object $default
@return object | false
@default false | [
"Get",
"settings",
"item"
] | face3df8794407cdc8178ed64c06cc760c449de2 | https://github.com/p2made/yii2-p2y2-base/blob/face3df8794407cdc8178ed64c06cc760c449de2/helpers/P2Settings.php#L68-L91 |
192,697 | Rockbeat-Sky/yii | src/helpers/FileExplorer.php | FileExplorer.getTotalFiles | public function getTotalFiles()
{
if (!$this->_files) {
$this->scan;
}
$i = 0;
foreach ($this->_files as $file) {
if ($file->isFile) {
$i++;
}
}
return $i;
} | php | public function getTotalFiles()
{
if (!$this->_files) {
$this->scan;
}
$i = 0;
foreach ($this->_files as $file) {
if ($file->isFile) {
$i++;
}
}
return $i;
} | [
"public",
"function",
"getTotalFiles",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_files",
")",
"{",
"$",
"this",
"->",
"scan",
";",
"}",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_files",
"as",
"$",
"file",
")",
"{",... | count total files
@return int | [
"count",
"total",
"files"
] | 80758d1519162d650ca2d41e00f46e760ee35b92 | https://github.com/Rockbeat-Sky/yii/blob/80758d1519162d650ca2d41e00f46e760ee35b92/src/helpers/FileExplorer.php#L178-L190 |
192,698 | spress/spress-core | ContentManager/Renderizer/TwigRenderizer.php | TwigRenderizer.addLayout | public function addLayout($id, $content, array $attributes = [])
{
$key = $this->getLayoutNameWithNamespace($id);
$this->layouts[$key] = [$id, $content, $attributes];
} | php | public function addLayout($id, $content, array $attributes = [])
{
$key = $this->getLayoutNameWithNamespace($id);
$this->layouts[$key] = [$id, $content, $attributes];
} | [
"public",
"function",
"addLayout",
"(",
"$",
"id",
",",
"$",
"content",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getLayoutNameWithNamespace",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"layouts"... | Add a new layout.
@param string $id The identifier of the layout. e.g: path
@param string $content The content of the layout
@param array $attributes The attributes of the layout.
"layout" attribute has a special meaning | [
"Add",
"a",
"new",
"layout",
"."
] | a61008c4cde3ba990e7faa164462171b019a60bf | https://github.com/spress/spress-core/blob/a61008c4cde3ba990e7faa164462171b019a60bf/ContentManager/Renderizer/TwigRenderizer.php#L55-L59 |
192,699 | alphalemon/BootstrapBundle | Core/Script/Base/BasePostScript.php | BasePostScript.executeActionsFromFile | public function executeActionsFromFile($fileName)
{
$actions = array();
if (file_exists($fileName)) {
$actionsClasses = $this->decode($fileName);
foreach ($actionsClasses as $bundleName => $actionsClass){
$this->actionManagerGenerator->generate($actionsClass)... | php | public function executeActionsFromFile($fileName)
{
$actions = array();
if (file_exists($fileName)) {
$actionsClasses = $this->decode($fileName);
foreach ($actionsClasses as $bundleName => $actionsClass){
$this->actionManagerGenerator->generate($actionsClass)... | [
"public",
"function",
"executeActionsFromFile",
"(",
"$",
"fileName",
")",
"{",
"$",
"actions",
"=",
"array",
"(",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"fileName",
")",
")",
"{",
"$",
"actionsClasses",
"=",
"$",
"this",
"->",
"decode",
"(",
"$... | Execute the actions from a json file
@param string $fileName | [
"Execute",
"the",
"actions",
"from",
"a",
"json",
"file"
] | 27ff5cbc58d58149ec72a974f2a9d765a6fd37a6 | https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Script/Base/BasePostScript.php#L65-L79 |
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.