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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,200 | FrenzelGmbH/appcommon | components/DbFixtureManager.php | DbFixtureManager.checkIntegrity | public function checkIntegrity($check)
{
$db=$this->getDbConnection();
foreach($this->schemas as $schema){
$db->createCommand()->checkIntegrity($check,$schema)->execute();
}
} | php | public function checkIntegrity($check)
{
$db=$this->getDbConnection();
foreach($this->schemas as $schema){
$db->createCommand()->checkIntegrity($check,$schema)->execute();
}
} | [
"public",
"function",
"checkIntegrity",
"(",
"$",
"check",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDbConnection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"schemas",
"as",
"$",
"schema",
")",
"{",
"$",
"db",
"->",
"createCommand",
"... | Enables or disables database integrity check.
This method may be used to temporarily turn off foreign constraints check.
@param boolean $check whether to enable database integrity check | [
"Enables",
"or",
"disables",
"database",
"integrity",
"check",
".",
"This",
"method",
"may",
"be",
"used",
"to",
"temporarily",
"turn",
"off",
"foreign",
"constraints",
"check",
"."
] | d6d137b4c92b53832ce4b2e517644ed9fb545b7a | https://github.com/FrenzelGmbH/appcommon/blob/d6d137b4c92b53832ce4b2e517644ed9fb545b7a/components/DbFixtureManager.php#L243-L249 |
11,201 | FrenzelGmbH/appcommon | components/DbFixtureManager.php | DbFixtureManager.getRows | public function getRows($name)
{
if(isset($this->_rows[$name]))
return $this->_rows[$name];
else
return false;
} | php | public function getRows($name)
{
if(isset($this->_rows[$name]))
return $this->_rows[$name];
else
return false;
} | [
"public",
"function",
"getRows",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_rows",
"[",
"$",
"name",
"]",
")",
")",
"return",
"$",
"this",
"->",
"_rows",
"[",
"$",
"name",
"]",
";",
"else",
"return",
"false",
";",
... | Returns the fixture data rows.
The rows will have updated primary key values if the primary key is auto-incremental.
@param string $name the fixture name
@return array the fixture data rows. False is returned if there is no such fixture data. | [
"Returns",
"the",
"fixture",
"data",
"rows",
".",
"The",
"rows",
"will",
"have",
"updated",
"primary",
"key",
"values",
"if",
"the",
"primary",
"key",
"is",
"auto",
"-",
"incremental",
"."
] | d6d137b4c92b53832ce4b2e517644ed9fb545b7a | https://github.com/FrenzelGmbH/appcommon/blob/d6d137b4c92b53832ce4b2e517644ed9fb545b7a/components/DbFixtureManager.php#L343-L349 |
11,202 | FrenzelGmbH/appcommon | components/DbFixtureManager.php | DbFixtureManager.getRecord | public function getRecord($name,$alias)
{
if(isset($this->_records[$name][$alias]))
{
if(is_string($this->_records[$name][$alias]))
{
$row=$this->_rows[$name][$alias];
$model=ActiveRecord::model($this->_records[$name][$alias]);
$key=$model->getRawTableNameSchema()->primaryK... | php | public function getRecord($name,$alias)
{
if(isset($this->_records[$name][$alias]))
{
if(is_string($this->_records[$name][$alias]))
{
$row=$this->_rows[$name][$alias];
$model=ActiveRecord::model($this->_records[$name][$alias]);
$key=$model->getRawTableNameSchema()->primaryK... | [
"public",
"function",
"getRecord",
"(",
"$",
"name",
",",
"$",
"alias",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_records",
"[",
"$",
"name",
"]",
"[",
"$",
"alias",
"]",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"-... | Returns the specified ActiveRecord instance in the fixture data.
@param string $name the fixture name
@param string $alias the alias for the fixture data row
@return ActiveRecord the ActiveRecord instance. False is returned if there is no such fixture row. | [
"Returns",
"the",
"specified",
"ActiveRecord",
"instance",
"in",
"the",
"fixture",
"data",
"."
] | d6d137b4c92b53832ce4b2e517644ed9fb545b7a | https://github.com/FrenzelGmbH/appcommon/blob/d6d137b4c92b53832ce4b2e517644ed9fb545b7a/components/DbFixtureManager.php#L357-L379 |
11,203 | ciims/cii | models/CiiSettingsForm.php | CiiSettingsForm.init | public function init()
{
// Use Reflection::getProperties(PROTECTED) to get protected properties from the passed model
$reflection = new ReflectionClass($this->model);
$this->properties = $reflection->getProperties(ReflectionProperty::IS_PROTECTED);
return parent::init();
} | php | public function init()
{
// Use Reflection::getProperties(PROTECTED) to get protected properties from the passed model
$reflection = new ReflectionClass($this->model);
$this->properties = $reflection->getProperties(ReflectionProperty::IS_PROTECTED);
return parent::init();
} | [
"public",
"function",
"init",
"(",
")",
"{",
"// Use Reflection::getProperties(PROTECTED) to get protected properties from the passed model",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"this",
"->",
"model",
")",
";",
"$",
"this",
"->",
"properties",
"=... | Widget init function
@see CActiveForm init() | [
"Widget",
"init",
"function"
] | cc8550b9a3a6a0bf0214554679de8743d50dc9ef | https://github.com/ciims/cii/blob/cc8550b9a3a6a0bf0214554679de8743d50dc9ef/models/CiiSettingsForm.php#L49-L56 |
11,204 | ciims/cii | models/CiiSettingsForm.php | CiiSettingsForm.run | public function run()
{
// Setup the form
$form = $this->beginWidget('cii.widgets.CiiActiveForm', array(
'id'=>get_class($this->model),
'enableAjaxValidation'=>true,
'action' => $this->action,
'htmlOptions' => array(
'class' => 'pure-form pure-form-aligned'
)
));
// Main... | php | public function run()
{
// Setup the form
$form = $this->beginWidget('cii.widgets.CiiActiveForm', array(
'id'=>get_class($this->model),
'enableAjaxValidation'=>true,
'action' => $this->action,
'htmlOptions' => array(
'class' => 'pure-form pure-form-aligned'
)
));
// Main... | [
"public",
"function",
"run",
"(",
")",
"{",
"// Setup the form",
"$",
"form",
"=",
"$",
"this",
"->",
"beginWidget",
"(",
"'cii.widgets.CiiActiveForm'",
",",
"array",
"(",
"'id'",
"=>",
"get_class",
"(",
"$",
"this",
"->",
"model",
")",
",",
"'enableAjaxVali... | The following is run when the widget is called | [
"The",
"following",
"is",
"run",
"when",
"the",
"widget",
"is",
"called"
] | cc8550b9a3a6a0bf0214554679de8743d50dc9ef | https://github.com/ciims/cii/blob/cc8550b9a3a6a0bf0214554679de8743d50dc9ef/models/CiiSettingsForm.php#L61-L79 |
11,205 | ciims/cii | models/CiiSettingsForm.php | CiiSettingsForm.renderMain | private function renderMain($form)
{
// #main .content
echo CHtml::openTag('div', array('id' => 'main', 'class' => 'nano'));
echo CHtml::openTag('div', array('class' => 'nano-content'));
echo CHtml::openTag('fieldset');
// If we want a custom form view, render that view instead of the default behavio... | php | private function renderMain($form)
{
// #main .content
echo CHtml::openTag('div', array('id' => 'main', 'class' => 'nano'));
echo CHtml::openTag('div', array('class' => 'nano-content'));
echo CHtml::openTag('fieldset');
// If we want a custom form view, render that view instead of the default behavio... | [
"private",
"function",
"renderMain",
"(",
"$",
"form",
")",
"{",
"// #main .content",
"echo",
"CHtml",
"::",
"openTag",
"(",
"'div'",
",",
"array",
"(",
"'id'",
"=>",
"'main'",
",",
"'class'",
"=>",
"'nano'",
")",
")",
";",
"echo",
"CHtml",
"::",
"openTa... | Renders the main body content
@param CActiveForm $form The Form we're working with | [
"Renders",
"the",
"main",
"body",
"content"
] | cc8550b9a3a6a0bf0214554679de8743d50dc9ef | https://github.com/ciims/cii/blob/cc8550b9a3a6a0bf0214554679de8743d50dc9ef/models/CiiSettingsForm.php#L85-L132 |
11,206 | ciims/cii | models/CiiSettingsForm.php | CiiSettingsForm.renderProperties | private function renderProperties(&$form, $property)
{
$htmlOptions = array(
'class' => 'pure-input-2-3'
);
$validators = $this->model->getValidators($property->name);
$stringValidators = $this->model->getStringValidator($property->name, $validators);
if (in_array('required', $stringValidators))
$htm... | php | private function renderProperties(&$form, $property)
{
$htmlOptions = array(
'class' => 'pure-input-2-3'
);
$validators = $this->model->getValidators($property->name);
$stringValidators = $this->model->getStringValidator($property->name, $validators);
if (in_array('required', $stringValidators))
$htm... | [
"private",
"function",
"renderProperties",
"(",
"&",
"$",
"form",
",",
"$",
"property",
")",
"{",
"$",
"htmlOptions",
"=",
"array",
"(",
"'class'",
"=>",
"'pure-input-2-3'",
")",
";",
"$",
"validators",
"=",
"$",
"this",
"->",
"model",
"->",
"getValidators... | Renders form properties utilizing the appropriate
@param CActiveForm $form The form we're working with
@param Property Name $property The property name from Reflection | [
"Renders",
"form",
"properties",
"utilizing",
"the",
"appropriate"
] | cc8550b9a3a6a0bf0214554679de8743d50dc9ef | https://github.com/ciims/cii/blob/cc8550b9a3a6a0bf0214554679de8743d50dc9ef/models/CiiSettingsForm.php#L139-L165 |
11,207 | academic/VipaImportBundle | Importer/PKP/JournalUserImporter.php | JournalUserImporter.importJournalUsers | public function importJournalUsers($newJournalId, $oldJournalId, $userImporter)
{
$this->em->clear();
$journal = $this->em->getRepository('VipaJournalBundle:Journal')->find($newJournalId);
$roleMap = [
'1' => "ROLE_ADMIN",
'2' => "ROLE_USER",
'1... | php | public function importJournalUsers($newJournalId, $oldJournalId, $userImporter)
{
$this->em->clear();
$journal = $this->em->getRepository('VipaJournalBundle:Journal')->find($newJournalId);
$roleMap = [
'1' => "ROLE_ADMIN",
'2' => "ROLE_USER",
'1... | [
"public",
"function",
"importJournalUsers",
"(",
"$",
"newJournalId",
",",
"$",
"oldJournalId",
",",
"$",
"userImporter",
")",
"{",
"$",
"this",
"->",
"em",
"->",
"clear",
"(",
")",
";",
"$",
"journal",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository"... | Imports users of the given journal
@param int $newJournalId New journal's ID
@param int $oldJournalId Old journal's ID
@param UserImporter $userImporter User importer class
@throws \Doctrine\DBAL\DBALException | [
"Imports",
"users",
"of",
"the",
"given",
"journal"
] | cee7d9e51613706a4fd6e2eade44041ce1af9ad3 | https://github.com/academic/VipaImportBundle/blob/cee7d9e51613706a4fd6e2eade44041ce1af9ad3/Importer/PKP/JournalUserImporter.php#L21-L90 |
11,208 | academic/VipaImportBundle | Importer/PKP/JournalUserImporter.php | JournalUserImporter.getJournalUser | private function getJournalUser(&$cache, $email, $journal)
{
if (!empty($cache[$email]['journal_user'])) {
return $cache[$email]['journal_user'];
}
$journalUser = $this->em
->getRepository('VipaJournalBundle:JournalUser')
->findOneBy(['journal' => $journa... | php | private function getJournalUser(&$cache, $email, $journal)
{
if (!empty($cache[$email]['journal_user'])) {
return $cache[$email]['journal_user'];
}
$journalUser = $this->em
->getRepository('VipaJournalBundle:JournalUser')
->findOneBy(['journal' => $journa... | [
"private",
"function",
"getJournalUser",
"(",
"&",
"$",
"cache",
",",
"$",
"email",
",",
"$",
"journal",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"cache",
"[",
"$",
"email",
"]",
"[",
"'journal_user'",
"]",
")",
")",
"{",
"return",
"$",
"cache"... | Fetches the journal user
@param array $cache User cache
@param String $email User's email
@param Journal $journal Journal
@return JournalUser Imported or retrieved JournalUser | [
"Fetches",
"the",
"journal",
"user"
] | cee7d9e51613706a4fd6e2eade44041ce1af9ad3 | https://github.com/academic/VipaImportBundle/blob/cee7d9e51613706a4fd6e2eade44041ce1af9ad3/Importer/PKP/JournalUserImporter.php#L99-L118 |
11,209 | spipremix/facteur | phpmailer-php5/extras/EasyPeasyICS.php | EasyPeasyICS.addEvent | public function addEvent($start, $end, $summary = '', $description = '', $url = '', $uid = '')
{
if (empty($uid)) {
$uid = md5(uniqid(mt_rand(), true)) . '@EasyPeasyICS';
}
$event = array(
'start' => gmdate('Ymd', $start) . 'T' . gmdate('His', $start) . 'Z',
... | php | public function addEvent($start, $end, $summary = '', $description = '', $url = '', $uid = '')
{
if (empty($uid)) {
$uid = md5(uniqid(mt_rand(), true)) . '@EasyPeasyICS';
}
$event = array(
'start' => gmdate('Ymd', $start) . 'T' . gmdate('His', $start) . 'Z',
... | [
"public",
"function",
"addEvent",
"(",
"$",
"start",
",",
"$",
"end",
",",
"$",
"summary",
"=",
"''",
",",
"$",
"description",
"=",
"''",
",",
"$",
"url",
"=",
"''",
",",
"$",
"uid",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"uid",
"... | Add an event to this calendar.
@param string $start The start date and time as a unix timestamp
@param string $end The end date and time as a unix timestamp
@param string $summary A summary or title for the event
@param string $description A description of the event
@param string $url A URL for the event
@param string ... | [
"Add",
"an",
"event",
"to",
"this",
"calendar",
"."
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/phpmailer-php5/extras/EasyPeasyICS.php#L52-L67 |
11,210 | spipremix/facteur | phpmailer-php5/extras/EasyPeasyICS.php | EasyPeasyICS.render | public function render($output = true)
{
//Add header
$ics = 'BEGIN:VCALENDAR
METHOD:PUBLISH
VERSION:2.0
X-WR-CALNAME:' . $this->calendarName . '
PRODID:-//hacksw/handcal//NONSGML v1.0//EN';
//Add events
foreach ($this->events as $event) {
$ics .= '
BEGIN:VEVENT
UID:' . ... | php | public function render($output = true)
{
//Add header
$ics = 'BEGIN:VCALENDAR
METHOD:PUBLISH
VERSION:2.0
X-WR-CALNAME:' . $this->calendarName . '
PRODID:-//hacksw/handcal//NONSGML v1.0//EN';
//Add events
foreach ($this->events as $event) {
$ics .= '
BEGIN:VEVENT
UID:' . ... | [
"public",
"function",
"render",
"(",
"$",
"output",
"=",
"true",
")",
"{",
"//Add header",
"$",
"ics",
"=",
"'BEGIN:VCALENDAR\nMETHOD:PUBLISH\nVERSION:2.0\nX-WR-CALNAME:'",
".",
"$",
"this",
"->",
"calendarName",
".",
"'\nPRODID:-//hacksw/handcal//NONSGML v1.0//EN'",
";",... | Render and optionally output a vcal string.
@param bool $output Whether to output the calendar data directly (the default).
@return string The complete rendered vlal | [
"Render",
"and",
"optionally",
"output",
"a",
"vcal",
"string",
"."
] | 9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca | https://github.com/spipremix/facteur/blob/9cdca595d1f8f9a66c29e5c74e8666d81ebc65ca/phpmailer-php5/extras/EasyPeasyICS.php#L108-L147 |
11,211 | nsrosenqvist/blade-compiler | src/Compiler.php | Compiler.compile | public function compile(string $path, array $data = [])
{
// If the file can't be found it's probably supplied as a template within
// one of the base directories
$path = $this->find($path);
// Make sure that we use the right resolver for the initial file
$engine = $this->fa... | php | public function compile(string $path, array $data = [])
{
// If the file can't be found it's probably supplied as a template within
// one of the base directories
$path = $this->find($path);
// Make sure that we use the right resolver for the initial file
$engine = $this->fa... | [
"public",
"function",
"compile",
"(",
"string",
"$",
"path",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"// If the file can't be found it's probably supplied as a template within",
"// one of the base directories",
"$",
"path",
"=",
"$",
"this",
"->",
"find",... | Compile a specific Blade file
@param string $path Path to file to compile
@param array $data An associative array of data to be passed to the view
@return \Illuminate\View\View Returns the blade view | [
"Compile",
"a",
"specific",
"Blade",
"file"
] | 3e20deb8eca4e3773f8c26eb3740e442729efb27 | https://github.com/nsrosenqvist/blade-compiler/blob/3e20deb8eca4e3773f8c26eb3740e442729efb27/src/Compiler.php#L128-L145 |
11,212 | nsrosenqvist/blade-compiler | src/Compiler.php | Compiler.find | public function find(string $path)
{
if (! file_exists($path)) {
$path = $this->viewFinder->find($path);
}
return $path;
} | php | public function find(string $path)
{
if (! file_exists($path)) {
$path = $this->viewFinder->find($path);
}
return $path;
} | [
"public",
"function",
"find",
"(",
"string",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"viewFinder",
"->",
"find",
"(",
"$",
"path",
")",
";",
"}",
"return",
"$",
... | Searches the viewFinder for the path provided
@param string $path Path to search for
@return string If absolute provided and exists, return it, otherwise return result from viewFinder | [
"Searches",
"the",
"viewFinder",
"for",
"the",
"path",
"provided"
] | 3e20deb8eca4e3773f8c26eb3740e442729efb27 | https://github.com/nsrosenqvist/blade-compiler/blob/3e20deb8eca4e3773f8c26eb3740e442729efb27/src/Compiler.php#L162-L169 |
11,213 | GrupaZero/core | src/Gzero/Core/Parsers/DateParser.php | DateParser.checkValue | protected function checkValue(): void
{
if ((!is_string($this->value) && !is_numeric($this->value)) || strtotime($this->value) === false) {
throw new InvalidArgumentException('DateParser: Value must be a valid date');
}
} | php | protected function checkValue(): void
{
if ((!is_string($this->value) && !is_numeric($this->value)) || strtotime($this->value) === false) {
throw new InvalidArgumentException('DateParser: Value must be a valid date');
}
} | [
"protected",
"function",
"checkValue",
"(",
")",
":",
"void",
"{",
"if",
"(",
"(",
"!",
"is_string",
"(",
"$",
"this",
"->",
"value",
")",
"&&",
"!",
"is_numeric",
"(",
"$",
"this",
"->",
"value",
")",
")",
"||",
"strtotime",
"(",
"$",
"this",
"->"... | Check if value is a valid date.
@throws InvalidArgumentException
@return void | [
"Check",
"if",
"value",
"is",
"a",
"valid",
"date",
"."
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Parsers/DateParser.php#L149-L154 |
11,214 | jamiehannaford/php-opencloud-zf2 | src/Helper/CloudFiles/DataObject.php | DataObject.render | public function render(array $attrs, $urlType)
{
return HtmlRenderer::factory($this->renderer, $this->dataObject, $urlType, $attrs);
} | php | public function render(array $attrs, $urlType)
{
return HtmlRenderer::factory($this->renderer, $this->dataObject, $urlType, $attrs);
} | [
"public",
"function",
"render",
"(",
"array",
"$",
"attrs",
",",
"$",
"urlType",
")",
"{",
"return",
"HtmlRenderer",
"::",
"factory",
"(",
"$",
"this",
"->",
"renderer",
",",
"$",
"this",
"->",
"dataObject",
",",
"$",
"urlType",
",",
"$",
"attrs",
")",... | Render the data object into valid HTML markup
@param $urlType The connection type
@return mixed | [
"Render",
"the",
"data",
"object",
"into",
"valid",
"HTML",
"markup"
] | 74140adaffc0b46d7bbe1d7b3441c61f2cf6a656 | https://github.com/jamiehannaford/php-opencloud-zf2/blob/74140adaffc0b46d7bbe1d7b3441c61f2cf6a656/src/Helper/CloudFiles/DataObject.php#L38-L41 |
11,215 | praxigento/mobi_mod_wallet | Setup/UpgradeSchema/A/V0_1_1.php | V0_1_1.upgradeTblQuote | private function upgradeTblQuote($setup)
{
$conn = $setup->getConnection();
$table = $setup->getTable(EPartQuote::ENTITY_NAME);
/* add columns */
$conn->addColumn(
$table,
EPartQuote::A_BASE_CURRENCY,
[
'type' => \Magento\Framework... | php | private function upgradeTblQuote($setup)
{
$conn = $setup->getConnection();
$table = $setup->getTable(EPartQuote::ENTITY_NAME);
/* add columns */
$conn->addColumn(
$table,
EPartQuote::A_BASE_CURRENCY,
[
'type' => \Magento\Framework... | [
"private",
"function",
"upgradeTblQuote",
"(",
"$",
"setup",
")",
"{",
"$",
"conn",
"=",
"$",
"setup",
"->",
"getConnection",
"(",
")",
";",
"$",
"table",
"=",
"$",
"setup",
"->",
"getTable",
"(",
"EPartQuote",
"::",
"ENTITY_NAME",
")",
";",
"/* add colu... | Upgrade table "prxgt_wallet_partial_quote". Add currencies fields.
@param \Magento\Framework\Setup\SchemaSetupInterface $setup | [
"Upgrade",
"table",
"prxgt_wallet_partial_quote",
".",
"Add",
"currencies",
"fields",
"."
] | 8f4789645f2e3c95b1323984aa67215b1647fa39 | https://github.com/praxigento/mobi_mod_wallet/blob/8f4789645f2e3c95b1323984aa67215b1647fa39/Setup/UpgradeSchema/A/V0_1_1.php#L30-L58 |
11,216 | praxigento/mobi_mod_wallet | Setup/UpgradeSchema/A/V0_1_1.php | V0_1_1.upgradeTblSale | private function upgradeTblSale($setup)
{
$conn = $setup->getConnection();
$table = $setup->getTable(EPartSale::ENTITY_NAME);
/* add columns */
$conn->addColumn(
$table,
EPartSale::A_TRANS_REF,
[
'type' => \Magento\Framework\DB\Ddl... | php | private function upgradeTblSale($setup)
{
$conn = $setup->getConnection();
$table = $setup->getTable(EPartSale::ENTITY_NAME);
/* add columns */
$conn->addColumn(
$table,
EPartSale::A_TRANS_REF,
[
'type' => \Magento\Framework\DB\Ddl... | [
"private",
"function",
"upgradeTblSale",
"(",
"$",
"setup",
")",
"{",
"$",
"conn",
"=",
"$",
"setup",
"->",
"getConnection",
"(",
")",
";",
"$",
"table",
"=",
"$",
"setup",
"->",
"getTable",
"(",
"EPartSale",
"::",
"ENTITY_NAME",
")",
";",
"/* add column... | Upgrade table "prxgt_wallet_partial_sale".
Add currencies fields and transaction reference.
@param \Magento\Framework\Setup\SchemaSetupInterface $setup | [
"Upgrade",
"table",
"prxgt_wallet_partial_sale",
".",
"Add",
"currencies",
"fields",
"and",
"transaction",
"reference",
"."
] | 8f4789645f2e3c95b1323984aa67215b1647fa39 | https://github.com/praxigento/mobi_mod_wallet/blob/8f4789645f2e3c95b1323984aa67215b1647fa39/Setup/UpgradeSchema/A/V0_1_1.php#L66-L112 |
11,217 | codebobbly/dvoconnector | Classes/Service/Url/AbstractRealUrl.php | AbstractRealUrl.cleanUrl | protected function cleanUrl($alias)
{
if ($this->isOldRealUrlVersion()) {
/** @var \tx_realurl_advanced $realUrl */
$realUrl = GeneralUtility::makeInstance('tx_realurl_advanced');
$configuration = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['pagePath'];
... | php | protected function cleanUrl($alias)
{
if ($this->isOldRealUrlVersion()) {
/** @var \tx_realurl_advanced $realUrl */
$realUrl = GeneralUtility::makeInstance('tx_realurl_advanced');
$configuration = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['pagePath'];
... | [
"protected",
"function",
"cleanUrl",
"(",
"$",
"alias",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isOldRealUrlVersion",
"(",
")",
")",
"{",
"/** @var \\tx_realurl_advanced $realUrl */",
"$",
"realUrl",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"'tx_realurl_... | Generate the realurl part.
@param string $alias
@return string | [
"Generate",
"the",
"realurl",
"part",
"."
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/Url/AbstractRealUrl.php#L103-L123 |
11,218 | encorephp/kernel | src/Composer/Script.php | Script.init | public static function init()
{
// Instantiate the application
$app = Application::fromCwd();
// Give proxies an instance of the application
$app->initializeProxies();
// Boot the app
$app->boot();
static::$appPath = \App::appPath();
static::$vendor... | php | public static function init()
{
// Instantiate the application
$app = Application::fromCwd();
// Give proxies an instance of the application
$app->initializeProxies();
// Boot the app
$app->boot();
static::$appPath = \App::appPath();
static::$vendor... | [
"public",
"static",
"function",
"init",
"(",
")",
"{",
"// Instantiate the application",
"$",
"app",
"=",
"Application",
"::",
"fromCwd",
"(",
")",
";",
"// Give proxies an instance of the application",
"$",
"app",
"->",
"initializeProxies",
"(",
")",
";",
"// Boot ... | Initialise the application
@return void | [
"Initialise",
"the",
"application"
] | 3a1980a8aab0ac6d4298f0368f319620ddb1e644 | https://github.com/encorephp/kernel/blob/3a1980a8aab0ac6d4298f0368f319620ddb1e644/src/Composer/Script.php#L22-L40 |
11,219 | encorephp/kernel | src/Composer/Script.php | Script.postInstall | public static function postInstall(Event $event)
{
static::init();
$event->getIO()->write('<info>Writing resources.lock file</info>');
$installed = json_decode(file_get_contents(static::$vendorPath.'/composer/installed.json'));
$data = [];
$finder = (new Finder)
... | php | public static function postInstall(Event $event)
{
static::init();
$event->getIO()->write('<info>Writing resources.lock file</info>');
$installed = json_decode(file_get_contents(static::$vendorPath.'/composer/installed.json'));
$data = [];
$finder = (new Finder)
... | [
"public",
"static",
"function",
"postInstall",
"(",
"Event",
"$",
"event",
")",
"{",
"static",
"::",
"init",
"(",
")",
";",
"$",
"event",
"->",
"getIO",
"(",
")",
"->",
"write",
"(",
"'<info>Writing resources.lock file</info>'",
")",
";",
"$",
"installed",
... | Run composer post-install script
@param Event $event
@return void | [
"Run",
"composer",
"post",
"-",
"install",
"script"
] | 3a1980a8aab0ac6d4298f0368f319620ddb1e644 | https://github.com/encorephp/kernel/blob/3a1980a8aab0ac6d4298f0368f319620ddb1e644/src/Composer/Script.php#L48-L88 |
11,220 | K-Phoen/NegotiationServiceProvider | src/KPhoen/Provider/NegotiationServiceProvider.php | NegotiationServiceProvider.register | public function register(Application $app)
{
$this->app = $app;
$app['negotiator'] = $app->share(function ($app) {
return new \Negotiation\Negotiator();
});
$app['language.negotiator'] = $app->share(function ($app) {
return new \Negotiation\LanguageNegotiato... | php | public function register(Application $app)
{
$this->app = $app;
$app['negotiator'] = $app->share(function ($app) {
return new \Negotiation\Negotiator();
});
$app['language.negotiator'] = $app->share(function ($app) {
return new \Negotiation\LanguageNegotiato... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"this",
"->",
"app",
"=",
"$",
"app",
";",
"$",
"app",
"[",
"'negotiator'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"function",
"(",
"$",
"app",
")",
"{",
"return",
... | Register the services in the application.
@param Application $app The application. | [
"Register",
"the",
"services",
"in",
"the",
"application",
"."
] | 10789b4041aa593f79f14519c6c7078c570c5fcd | https://github.com/K-Phoen/NegotiationServiceProvider/blob/10789b4041aa593f79f14519c6c7078c570c5fcd/src/KPhoen/Provider/NegotiationServiceProvider.php#L42-L66 |
11,221 | K-Phoen/NegotiationServiceProvider | src/KPhoen/Provider/NegotiationServiceProvider.php | NegotiationServiceProvider.onEarlyKernelRequest | public function onEarlyKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
foreach ($this->customFormats as $name => $mimeTypes) {
$request->setFormat($name, $mimeTypes);
}
} | php | public function onEarlyKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
foreach ($this->customFormats as $name => $mimeTypes) {
$request->setFormat($name, $mimeTypes);
}
} | [
"public",
"function",
"onEarlyKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"customFormats",
"as",
"$",
"name",
"=>",
"$",
"mimeType... | Update the request with the given custom formats.
@param GetResponseEvent $event The event. | [
"Update",
"the",
"request",
"with",
"the",
"given",
"custom",
"formats",
"."
] | 10789b4041aa593f79f14519c6c7078c570c5fcd | https://github.com/K-Phoen/NegotiationServiceProvider/blob/10789b4041aa593f79f14519c6c7078c570c5fcd/src/KPhoen/Provider/NegotiationServiceProvider.php#L84-L90 |
11,222 | quantaphp/exceptions | src/ReturnTypeErrorMessage.php | ReturnTypeErrorMessage.tpl | private function tpl(): string
{
if (interface_exists($this->type)) {
return 'Return value of %s must implement interface %s, %s returned';
}
if (class_exists($this->type)) {
return 'Return value of %s must be an instance of %s, %s returned';
}
if ($... | php | private function tpl(): string
{
if (interface_exists($this->type)) {
return 'Return value of %s must implement interface %s, %s returned';
}
if (class_exists($this->type)) {
return 'Return value of %s must be an instance of %s, %s returned';
}
if ($... | [
"private",
"function",
"tpl",
"(",
")",
":",
"string",
"{",
"if",
"(",
"interface_exists",
"(",
"$",
"this",
"->",
"type",
")",
")",
"{",
"return",
"'Return value of %s must implement interface %s, %s returned'",
";",
"}",
"if",
"(",
"class_exists",
"(",
"$",
... | Return the template of the error message accoring to the expected type.
@return string | [
"Return",
"the",
"template",
"of",
"the",
"error",
"message",
"accoring",
"to",
"the",
"expected",
"type",
"."
] | b1cde0096fe0c31eb550e53dd373820629a521fd | https://github.com/quantaphp/exceptions/blob/b1cde0096fe0c31eb550e53dd373820629a521fd/src/ReturnTypeErrorMessage.php#L63-L78 |
11,223 | budkit/budkit-framework | src/Budkit/Datastore/Model/Graph.php | Graph.getInstance | public static function getInstance($graphUID = NULL, $nodes = array(), $edges = array(), $directed = FALSE)
{
if (is_object(static::$instance[$graphUID]) && is_a(static::$instance[$graphUID], 'Graph'))
return static::$instance[$graphUID];
$graph = new self($nodes, $edges, $directed, $gra... | php | public static function getInstance($graphUID = NULL, $nodes = array(), $edges = array(), $directed = FALSE)
{
if (is_object(static::$instance[$graphUID]) && is_a(static::$instance[$graphUID], 'Graph'))
return static::$instance[$graphUID];
$graph = new self($nodes, $edges, $directed, $gra... | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"graphUID",
"=",
"NULL",
",",
"$",
"nodes",
"=",
"array",
"(",
")",
",",
"$",
"edges",
"=",
"array",
"(",
")",
",",
"$",
"directed",
"=",
"FALSE",
")",
"{",
"if",
"(",
"is_object",
"(",
"stat... | Returns and instantiated Instance of the graph class
NOTE: As of PHP5.3 it is vital that you include constructors in your class
especially if they are defined under a namespace. A method with the same
name as the class is no longer considered to be its constructor
@staticvar object $instance
@property-read object $in... | [
"Returns",
"and",
"instantiated",
"Instance",
"of",
"the",
"graph",
"class"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Graph.php#L105-L114 |
11,224 | budkit/budkit-framework | src/Budkit/Datastore/Model/Graph.php | Graph.getNode | public function getNode($nodeId)
{
static $instance = array();
if (isset($instance[$nodeId]))
return $instance[$nodeId];
$nodes = $this->nodeSet;
if (empty($nodes))
return NULL;
foreach ($nodes as $node):
if ($node->getId() == $nodeId):
... | php | public function getNode($nodeId)
{
static $instance = array();
if (isset($instance[$nodeId]))
return $instance[$nodeId];
$nodes = $this->nodeSet;
if (empty($nodes))
return NULL;
foreach ($nodes as $node):
if ($node->getId() == $nodeId):
... | [
"public",
"function",
"getNode",
"(",
"$",
"nodeId",
")",
"{",
"static",
"$",
"instance",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"instance",
"[",
"$",
"nodeId",
"]",
")",
")",
"return",
"$",
"instance",
"[",
"$",
"nodeId",
"]",
... | Returns a node object if exists in graph
@param type $nodeId case sensitive ID of the node requested
@return object $node if found; | [
"Returns",
"a",
"node",
"object",
"if",
"exists",
"in",
"graph"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Graph.php#L238-L253 |
11,225 | budkit/budkit-framework | src/Budkit/Datastore/Model/Graph.php | Graph.addEdge | public function addEdge(&$nodeA, &$nodeB, $name = NULL, $directed = TRUE, $data = array(), $weight = 0)
{
$edge = new Graph\Edge($nodeA, $name, $nodeB, $data, $directed, $weight); //Will need to decide whether to use nodeAId-nodeBId as edgeId
$edgeId = $edge->getId();
//Directed edges have... | php | public function addEdge(&$nodeA, &$nodeB, $name = NULL, $directed = TRUE, $data = array(), $weight = 0)
{
$edge = new Graph\Edge($nodeA, $name, $nodeB, $data, $directed, $weight); //Will need to decide whether to use nodeAId-nodeBId as edgeId
$edgeId = $edge->getId();
//Directed edges have... | [
"public",
"function",
"addEdge",
"(",
"&",
"$",
"nodeA",
",",
"&",
"$",
"nodeB",
",",
"$",
"name",
"=",
"NULL",
",",
"$",
"directed",
"=",
"TRUE",
",",
"$",
"data",
"=",
"array",
"(",
")",
",",
"$",
"weight",
"=",
"0",
")",
"{",
"$",
"edge",
... | Adds an edge between two node endpoints.
@param type $nodeA
@param type $nodeB
@param type $name
@param type $data
@param type $directed
@param type $weight
@return boolean | [
"Adds",
"an",
"edge",
"between",
"two",
"node",
"endpoints",
"."
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Graph.php#L266-L293 |
11,226 | budkit/budkit-framework | src/Budkit/Datastore/Model/Graph.php | Graph.removeNode | public function removeNode($nodeId)
{
if (isset($this->nodeSet[$nodeId]))
unset($this->nodeSet[$nodeId]);
return true;
} | php | public function removeNode($nodeId)
{
if (isset($this->nodeSet[$nodeId]))
unset($this->nodeSet[$nodeId]);
return true;
} | [
"public",
"function",
"removeNode",
"(",
"$",
"nodeId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"nodeSet",
"[",
"$",
"nodeId",
"]",
")",
")",
"unset",
"(",
"$",
"this",
"->",
"nodeSet",
"[",
"$",
"nodeId",
"]",
")",
";",
"return",
"... | Removes a node from the graph
@param type $nodeId | [
"Removes",
"a",
"node",
"from",
"the",
"graph"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Graph.php#L300-L305 |
11,227 | budkit/budkit-framework | src/Budkit/Datastore/Model/Graph.php | Graph.removeEdge | public function removeEdge(&$head, &$tail, $directed = TRUE)
{
if (!is_a($head, "\Platform\Graph\Node") || !is_a($tail, "\Platform\Graph\Node")) {
throw new \Platform\Exception("Nodes used to create a new Edge must be instances of \Platform\Graph\Node", PLATFORM_ERROR);
}
$_node... | php | public function removeEdge(&$head, &$tail, $directed = TRUE)
{
if (!is_a($head, "\Platform\Graph\Node") || !is_a($tail, "\Platform\Graph\Node")) {
throw new \Platform\Exception("Nodes used to create a new Edge must be instances of \Platform\Graph\Node", PLATFORM_ERROR);
}
$_node... | [
"public",
"function",
"removeEdge",
"(",
"&",
"$",
"head",
",",
"&",
"$",
"tail",
",",
"$",
"directed",
"=",
"TRUE",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"head",
",",
"\"\\Platform\\Graph\\Node\"",
")",
"||",
"!",
"is_a",
"(",
"$",
"tail",
"... | Removes an Edge from the graph. Use removeArc to remove directed edges
@param type $head
@param type $tail
@param type $directed if false, will remove all incident edges of the kind head-tail or tail-head
@return boolean
@throws \Platform\Exception | [
"Removes",
"an",
"Edge",
"from",
"the",
"graph",
".",
"Use",
"removeArc",
"to",
"remove",
"directed",
"edges"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Graph.php#L316-L339 |
11,228 | budkit/budkit-framework | src/Budkit/Datastore/Model/Graph.php | Graph.createNode | public function createNode($nodeId, $data = array())
{
$node = new Graph\Node($nodeId, $data);
$node->setGraph($this);
$this->addNode($node);
return $node;
} | php | public function createNode($nodeId, $data = array())
{
$node = new Graph\Node($nodeId, $data);
$node->setGraph($this);
$this->addNode($node);
return $node;
} | [
"public",
"function",
"createNode",
"(",
"$",
"nodeId",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"node",
"=",
"new",
"Graph",
"\\",
"Node",
"(",
"$",
"nodeId",
",",
"$",
"data",
")",
";",
"$",
"node",
"->",
"setGraph",
"(",
"$",
... | Creates and adds a Node to the graph if none, already exists
@param type $nodeId
@param type $data | [
"Creates",
"and",
"adds",
"a",
"Node",
"to",
"the",
"graph",
"if",
"none",
"already",
"exists"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Graph.php#L361-L369 |
11,229 | budkit/budkit-framework | src/Budkit/Datastore/Model/Graph.php | Graph.addNode | public function addNode(&$node)
{
//Nodes must be an instance graph Node;
if (!$this->isNode($node)) {
throw new \Exception("Node must be an instance of Graph\Node", PLATFORM_ERROR);
}
$nodedId = $node->getId();
if (!empty($nodedId) && !isset($this->nodeSet[$node-... | php | public function addNode(&$node)
{
//Nodes must be an instance graph Node;
if (!$this->isNode($node)) {
throw new \Exception("Node must be an instance of Graph\Node", PLATFORM_ERROR);
}
$nodedId = $node->getId();
if (!empty($nodedId) && !isset($this->nodeSet[$node-... | [
"public",
"function",
"addNode",
"(",
"&",
"$",
"node",
")",
"{",
"//Nodes must be an instance graph Node;",
"if",
"(",
"!",
"$",
"this",
"->",
"isNode",
"(",
"$",
"node",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Node must be an instance of Gr... | Adds a node to the current graph
@param type $node | [
"Adds",
"a",
"node",
"to",
"the",
"current",
"graph"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Graph.php#L376-L387 |
11,230 | fabsgc/framework | Core/Cache/Cache.php | Cache.destroy | public function destroy() {
if (file_exists($this->_fileName)) {
if (unlink($this->_fileName)) {
return true;
}
else {
return false;
}
}
else {
return true;
}
} | php | public function destroy() {
if (file_exists($this->_fileName)) {
if (unlink($this->_fileName)) {
return true;
}
else {
return false;
}
}
else {
return true;
}
} | [
"public",
"function",
"destroy",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"_fileName",
")",
")",
"{",
"if",
"(",
"unlink",
"(",
"$",
"this",
"->",
"_fileName",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"return"... | destroy a cache file
@access public
@return boolean
@since 3.0
@package Gcs\Framework\Core\Cache | [
"destroy",
"a",
"cache",
"file"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Cache/Cache.php#L105-L117 |
11,231 | fabsgc/framework | Core/Cache/Cache.php | Cache.getCache | public function getCache() {
if (!file_exists($this->_fileName)) {
$this->setCache();
}
return unserialize(($this->_uncompress(file_get_contents($this->_fileName))));
} | php | public function getCache() {
if (!file_exists($this->_fileName)) {
$this->setCache();
}
return unserialize(($this->_uncompress(file_get_contents($this->_fileName))));
} | [
"public",
"function",
"getCache",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"_fileName",
")",
")",
"{",
"$",
"this",
"->",
"setCache",
"(",
")",
";",
"}",
"return",
"unserialize",
"(",
"(",
"$",
"this",
"->",
"_uncompress"... | get cache content
@access public
@return mixed
@since 3.0
@package Gcs\Framework\Core\Cache | [
"get",
"cache",
"content"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Cache/Cache.php#L127-L133 |
11,232 | fabsgc/framework | Core/Cache/Cache.php | Cache.setCache | public function setCache() {
if (!file_exists($this->_fileName)) {
file_put_contents($this->_fileName, $this->_compress(serialize($this->_content)));
}
$timeAgo = time() - filemtime($this->_fileName);
if ($timeAgo > $this->_time) {
file_put_contents($this->_file... | php | public function setCache() {
if (!file_exists($this->_fileName)) {
file_put_contents($this->_fileName, $this->_compress(serialize($this->_content)));
}
$timeAgo = time() - filemtime($this->_fileName);
if ($timeAgo > $this->_time) {
file_put_contents($this->_file... | [
"public",
"function",
"setCache",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"_fileName",
")",
")",
"{",
"file_put_contents",
"(",
"$",
"this",
"->",
"_fileName",
",",
"$",
"this",
"->",
"_compress",
"(",
"serialize",
"(",
"$... | create the file cache
@access public
@return void
@since 3.0
@package Gcs\Framework\Core\Cache | [
"create",
"the",
"file",
"cache"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Cache/Cache.php#L156-L166 |
11,233 | fabsgc/framework | Core/Cache/Cache.php | Cache.isDie | public function isDie() {
if ($this->_time > 0) {
$die = false;
if (!file_exists($this->_fileName)) {
$die = true;
}
else {
$timeAgo = time() - filemtime($this->_fileName);
if ($timeAgo > $this->_time) {
... | php | public function isDie() {
if ($this->_time > 0) {
$die = false;
if (!file_exists($this->_fileName)) {
$die = true;
}
else {
$timeAgo = time() - filemtime($this->_fileName);
if ($timeAgo > $this->_time) {
... | [
"public",
"function",
"isDie",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_time",
">",
"0",
")",
"{",
"$",
"die",
"=",
"false",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"_fileName",
")",
")",
"{",
"$",
"die",
"=",
"true",
... | return true if the cache is too old
@access public
@return string
@since 3.0
@package Gcs\Framework\Core\Cache | [
"return",
"true",
"if",
"the",
"cache",
"is",
"too",
"old"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Cache/Cache.php#L189-L208 |
11,234 | osflab/generator | AbstractBuilder.php | AbstractBuilder.get | public static function get(string $name, array $args = [], $persistant = false)
{
if (!is_array(static::$classes)) {
throw new ArchException('A static property $classes with an array of classes must be declared in class [' . __CLASS__ . ']');
}
if (!array_key_exists($name, static... | php | public static function get(string $name, array $args = [], $persistant = false)
{
if (!is_array(static::$classes)) {
throw new ArchException('A static property $classes with an array of classes must be declared in class [' . __CLASS__ . ']');
}
if (!array_key_exists($name, static... | [
"public",
"static",
"function",
"get",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"persistant",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"static",
"::",
"$",
"classes",
")",
")",
"{",
"throw",
... | Return an instance of corresponding object
@param string $name
@param array $args
@param type $persistant
@throws \Osf\Exception\ArchException | [
"Return",
"an",
"instance",
"of",
"corresponding",
"object"
] | 60bc0bcf466898fe3676434f995a18d493c5c31a | https://github.com/osflab/generator/blob/60bc0bcf466898fe3676434f995a18d493c5c31a/AbstractBuilder.php#L52-L61 |
11,235 | osflab/generator | AbstractBuilder.php | AbstractBuilder.getClass | public static function getClass(string $name)
{
if (!isset(static::$classes[$name])) {
throw new ArchException('Unable to find class from key [' . $name . ']');
}
return static::$classes[$name];
} | php | public static function getClass(string $name)
{
if (!isset(static::$classes[$name])) {
throw new ArchException('Unable to find class from key [' . $name . ']');
}
return static::$classes[$name];
} | [
"public",
"static",
"function",
"getClass",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"classes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"ArchException",
"(",
"'Unable to find class from key ['",... | Get full class name from key
@param string $name
@return string
@throws \Osf\Exception\ArchException | [
"Get",
"full",
"class",
"name",
"from",
"key"
] | 60bc0bcf466898fe3676434f995a18d493c5c31a | https://github.com/osflab/generator/blob/60bc0bcf466898fe3676434f995a18d493c5c31a/AbstractBuilder.php#L69-L75 |
11,236 | osflab/generator | AbstractBuilder.php | AbstractBuilder.newObject | public static function newObject(string $class, array $args = [], $callGetClass = false)
{
$class = $callGetClass ? static::getClass($class) : $class;
$rc = new \ReflectionClass($class);
return $rc->newInstanceArgs($args);
} | php | public static function newObject(string $class, array $args = [], $callGetClass = false)
{
$class = $callGetClass ? static::getClass($class) : $class;
$rc = new \ReflectionClass($class);
return $rc->newInstanceArgs($args);
} | [
"public",
"static",
"function",
"newObject",
"(",
"string",
"$",
"class",
",",
"array",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"callGetClass",
"=",
"false",
")",
"{",
"$",
"class",
"=",
"$",
"callGetClass",
"?",
"static",
"::",
"getClass",
"(",
"$",
"... | Instanciate a class dynamically
@param string $class
@param array $args
@return stdClass | [
"Instanciate",
"a",
"class",
"dynamically"
] | 60bc0bcf466898fe3676434f995a18d493c5c31a | https://github.com/osflab/generator/blob/60bc0bcf466898fe3676434f995a18d493c5c31a/AbstractBuilder.php#L83-L88 |
11,237 | jaredtking/jaqb | src/Statement/ValuesStatement.php | ValuesStatement.addValues | public function addValues(array $values)
{
// Check if this is a multi-dimensional array
$isMultiDimensional = 0 == count($values) || (isset($values[0]) && is_array($values[0]));
if ($isMultiDimensional) {
$this->insertRows = array_merge($this->insertRows, $values);
} el... | php | public function addValues(array $values)
{
// Check if this is a multi-dimensional array
$isMultiDimensional = 0 == count($values) || (isset($values[0]) && is_array($values[0]));
if ($isMultiDimensional) {
$this->insertRows = array_merge($this->insertRows, $values);
} el... | [
"public",
"function",
"addValues",
"(",
"array",
"$",
"values",
")",
"{",
"// Check if this is a multi-dimensional array",
"$",
"isMultiDimensional",
"=",
"0",
"==",
"count",
"(",
"$",
"values",
")",
"||",
"(",
"isset",
"(",
"$",
"values",
"[",
"0",
"]",
")"... | Adds values to the statement.
@return self | [
"Adds",
"values",
"to",
"the",
"statement",
"."
] | 04a853b530fcc12a9863349d3d0da6377d1b9995 | https://github.com/jaredtking/jaqb/blob/04a853b530fcc12a9863349d3d0da6377d1b9995/src/Statement/ValuesStatement.php#L26-L46 |
11,238 | PaymentSuite/PaymillBundle | Services/Wrapper/PaymillTransactionWrapper.php | PaymillTransactionWrapper.create | public function create($amount, $currency, $token, $description = "")
{
$service = new Request($this->apiKey);
$transaction = new RequestTransaction();
$transaction
->setAmount($amount)
->setCurrency($currency)
->setToken($token)
->setDescripti... | php | public function create($amount, $currency, $token, $description = "")
{
$service = new Request($this->apiKey);
$transaction = new RequestTransaction();
$transaction
->setAmount($amount)
->setCurrency($currency)
->setToken($token)
->setDescripti... | [
"public",
"function",
"create",
"(",
"$",
"amount",
",",
"$",
"currency",
",",
"$",
"token",
",",
"$",
"description",
"=",
"\"\"",
")",
"{",
"$",
"service",
"=",
"new",
"Request",
"(",
"$",
"this",
"->",
"apiKey",
")",
";",
"$",
"transaction",
"=",
... | Create new Transaction with a set of params
@param string $amount amount as int (ex: 4200 for 42.00)
@param string $currency currency code (EUR, USD...)
@param string $token transaction token
@param string $description transaction description (optional, default "")
@return \Paymill\Models\Response\Base
... | [
"Create",
"new",
"Transaction",
"with",
"a",
"set",
"of",
"params"
] | 78aa85daaab8cf08e4971b10d86abd429ac7f6cd | https://github.com/PaymentSuite/PaymillBundle/blob/78aa85daaab8cf08e4971b10d86abd429ac7f6cd/Services/Wrapper/PaymillTransactionWrapper.php#L52-L68 |
11,239 | joffreydemetz/utilities | src/Xml.php | Xml.populateXml | public static function populateXml($data)
{
$isFile = ( is_file($data) );
libxml_use_internal_errors(true);
if ( $isFile === true ){
$xml = simplexml_load_file($data, '\SimpleXMLElement');
}
else {
$xml = simplexml_load_string($data, '\SimpleXMLElement');
}
if ( ... | php | public static function populateXml($data)
{
$isFile = ( is_file($data) );
libxml_use_internal_errors(true);
if ( $isFile === true ){
$xml = simplexml_load_file($data, '\SimpleXMLElement');
}
else {
$xml = simplexml_load_string($data, '\SimpleXMLElement');
}
if ( ... | [
"public",
"static",
"function",
"populateXml",
"(",
"$",
"data",
")",
"{",
"$",
"isFile",
"=",
"(",
"is_file",
"(",
"$",
"data",
")",
")",
";",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"if",
"(",
"$",
"isFile",
"===",
"true",
")",
"{",
"$... | Reads a XML file
@param string $data XML path or XML string
@return SimpleXMLElement Xml element
@throws Exception
@see SimpleXMLElement | [
"Reads",
"a",
"XML",
"file"
] | aa62a178bc463c10067a2ff2992d39c6f0037b9f | https://github.com/joffreydemetz/utilities/blob/aa62a178bc463c10067a2ff2992d39c6f0037b9f/src/Xml.php#L28-L55 |
11,240 | unclecheese/silverstripe-green | code/Green.php | Green.getDesignModules | public function getDesignModules()
{
$iterator = $this->createFinder()
->in($this->getAbsoluteDesignFolder())
->directories();
$modules = [];
foreach ($iterator as $file) {
if(file_exists($file->getRealPath().'/index.ss')) {
$modules[] = new Des... | php | public function getDesignModules()
{
$iterator = $this->createFinder()
->in($this->getAbsoluteDesignFolder())
->directories();
$modules = [];
foreach ($iterator as $file) {
if(file_exists($file->getRealPath().'/index.ss')) {
$modules[] = new Des... | [
"public",
"function",
"getDesignModules",
"(",
")",
"{",
"$",
"iterator",
"=",
"$",
"this",
"->",
"createFinder",
"(",
")",
"->",
"in",
"(",
"$",
"this",
"->",
"getAbsoluteDesignFolder",
"(",
")",
")",
"->",
"directories",
"(",
")",
";",
"$",
"modules",
... | Gets all of the design modules as objects
@return array | [
"Gets",
"all",
"of",
"the",
"design",
"modules",
"as",
"objects"
] | 4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4 | https://github.com/unclecheese/silverstripe-green/blob/4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4/code/Green.php#L89-L103 |
11,241 | unclecheese/silverstripe-green | code/Green.php | Green.getDesignModule | public function getDesignModule($name)
{
foreach ($this->getDesignModules() as $module) {
if ($module->getName() == $name) {
return $module;
}
}
return false;
} | php | public function getDesignModule($name)
{
foreach ($this->getDesignModules() as $module) {
if ($module->getName() == $name) {
return $module;
}
}
return false;
} | [
"public",
"function",
"getDesignModule",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDesignModules",
"(",
")",
"as",
"$",
"module",
")",
"{",
"if",
"(",
"$",
"module",
"->",
"getName",
"(",
")",
"==",
"$",
"name",
")",
"{",
"... | Gets a specific design module as an object by its name
@param string $name
@return bool|mixed | [
"Gets",
"a",
"specific",
"design",
"module",
"as",
"an",
"object",
"by",
"its",
"name"
] | 4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4 | https://github.com/unclecheese/silverstripe-green/blob/4395dcef5f4efd5a2c67e0bba3ab5cc583e3fdd4/code/Green.php#L111-L120 |
11,242 | pitsolu/strukt-router | src/Strukt/Router/Matcher.php | Matcher.isMatch | public function isMatch($url){
$url = trim($url);
if($url == $this->pattern)
return true;
$parts = explode("/", trim($url, "/"));
$pattern = explode("/", trim($this->pattern, "/"));
if(count($parts) != count($pattern))
return false;
// print_r($pattern);
$regex = array();
foreach($pattern as ... | php | public function isMatch($url){
$url = trim($url);
if($url == $this->pattern)
return true;
$parts = explode("/", trim($url, "/"));
$pattern = explode("/", trim($this->pattern, "/"));
if(count($parts) != count($pattern))
return false;
// print_r($pattern);
$regex = array();
foreach($pattern as ... | [
"public",
"function",
"isMatch",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"trim",
"(",
"$",
"url",
")",
";",
"if",
"(",
"$",
"url",
"==",
"$",
"this",
"->",
"pattern",
")",
"return",
"true",
";",
"$",
"parts",
"=",
"explode",
"(",
"\"/\"",
"... | Match url to specific url pattern
@param string $url route
@return boolean | [
"Match",
"url",
"to",
"specific",
"url",
"pattern"
] | ae6b91b5215edd4598d07b3dec2eed09337283d2 | https://github.com/pitsolu/strukt-router/blob/ae6b91b5215edd4598d07b3dec2eed09337283d2/src/Strukt/Router/Matcher.php#L45-L97 |
11,243 | ItinerisLtd/preflight-command | src/ConfigCollection.php | ConfigCollection.getConfig | public function getConfig(string $id): Config
{
// TODO: Use null coalescing assignment operator.
$this->configs[$id] = $this->configs[$id] ?? $this->registerConfig($id);
return $this->configs[$id];
} | php | public function getConfig(string $id): Config
{
// TODO: Use null coalescing assignment operator.
$this->configs[$id] = $this->configs[$id] ?? $this->registerConfig($id);
return $this->configs[$id];
} | [
"public",
"function",
"getConfig",
"(",
"string",
"$",
"id",
")",
":",
"Config",
"{",
"// TODO: Use null coalescing assignment operator.",
"$",
"this",
"->",
"configs",
"[",
"$",
"id",
"]",
"=",
"$",
"this",
"->",
"configs",
"[",
"$",
"id",
"]",
"??",
"$",... | Returns a Config instance for specific checker.
Instantiate if necessary.
@param string $id Id of the checker.
@return Config | [
"Returns",
"a",
"Config",
"instance",
"for",
"specific",
"checker",
".",
"Instantiate",
"if",
"necessary",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/ConfigCollection.php#L41-L47 |
11,244 | ItinerisLtd/preflight-command | src/ConfigCollection.php | ConfigCollection.registerConfig | protected function registerConfig(string $id): Config
{
$definition = $this->definitions[$id] ?? [];
$config = new Config($definition);
return apply_filters(static::HOOK, $config, $definition, $id);
} | php | protected function registerConfig(string $id): Config
{
$definition = $this->definitions[$id] ?? [];
$config = new Config($definition);
return apply_filters(static::HOOK, $config, $definition, $id);
} | [
"protected",
"function",
"registerConfig",
"(",
"string",
"$",
"id",
")",
":",
"Config",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"definitions",
"[",
"$",
"id",
"]",
"??",
"[",
"]",
";",
"$",
"config",
"=",
"new",
"Config",
"(",
"$",
"definiti... | Instantiate a Config instance for specific checker.
@param string $id Id of the checker.
@return Config | [
"Instantiate",
"a",
"Config",
"instance",
"for",
"specific",
"checker",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/ConfigCollection.php#L56-L62 |
11,245 | agalbourdin/agl-core | src/Url/Url.php | Url.get | public static function get($pUrl, $pParams = array(), $pRelative = true)
{
if (strpos($pUrl, '*/') !== false) {
if (self::$_request === NULL) {
self::setRequest();
}
$pUrl = str_replace('*/*/', self::$_request->getModule() . DS . self::$_request->getView(... | php | public static function get($pUrl, $pParams = array(), $pRelative = true)
{
if (strpos($pUrl, '*/') !== false) {
if (self::$_request === NULL) {
self::setRequest();
}
$pUrl = str_replace('*/*/', self::$_request->getModule() . DS . self::$_request->getView(... | [
"public",
"static",
"function",
"get",
"(",
"$",
"pUrl",
",",
"$",
"pParams",
"=",
"array",
"(",
")",
",",
"$",
"pRelative",
"=",
"true",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"pUrl",
",",
"'*/'",
")",
"!==",
"false",
")",
"{",
"if",
"(",
"s... | Return a formated URL with module, view, action and parameters.
@param string $pUrl URL to get (module/view)
@param string|array $pParams Parameters to include into the request
@param bool $pRelative Create a relative URL
@return string | [
"Return",
"a",
"formated",
"URL",
"with",
"module",
"view",
"action",
"and",
"parameters",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Url/Url.php#L39-L86 |
11,246 | agalbourdin/agl-core | src/Url/Url.php | Url.getCurrent | public static function getCurrent($pRelative = true, array $pNewParams = array())
{
if (self::$_request === NULL) {
self::setRequest();
}
$request = self::$_request;
$module = $request->getModule();
$view = $request->getView();
$params = str_replace($... | php | public static function getCurrent($pRelative = true, array $pNewParams = array())
{
if (self::$_request === NULL) {
self::setRequest();
}
$request = self::$_request;
$module = $request->getModule();
$view = $request->getView();
$params = str_replace($... | [
"public",
"static",
"function",
"getCurrent",
"(",
"$",
"pRelative",
"=",
"true",
",",
"array",
"$",
"pNewParams",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_request",
"===",
"NULL",
")",
"{",
"self",
"::",
"setRequest",
"(",
"... | Return the current URL with optional additional params.
@param bool $pRelative Return a relative URL or a full HTTP URL.
@param array $pNewParams Parameters to add to the request (additional)
@return string | [
"Return",
"the",
"current",
"URL",
"with",
"optional",
"additional",
"params",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Url/Url.php#L95-L123 |
11,247 | agalbourdin/agl-core | src/Url/Url.php | Url.getSkin | public static function getSkin($pUrl, $pRelative = true)
{
$url = Agl::APP_PUBLIC_DIR
. ViewInterface::APP_HTTP_SKIN_DIR
. DS
. $pUrl;
if ($pRelative) {
return ROOT . $url;
}
return self::getHost(ROOT . $url);
} | php | public static function getSkin($pUrl, $pRelative = true)
{
$url = Agl::APP_PUBLIC_DIR
. ViewInterface::APP_HTTP_SKIN_DIR
. DS
. $pUrl;
if ($pRelative) {
return ROOT . $url;
}
return self::getHost(ROOT . $url);
} | [
"public",
"static",
"function",
"getSkin",
"(",
"$",
"pUrl",
",",
"$",
"pRelative",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"Agl",
"::",
"APP_PUBLIC_DIR",
".",
"ViewInterface",
"::",
"APP_HTTP_SKIN_DIR",
".",
"DS",
".",
"$",
"pUrl",
";",
"if",
"(",
"$"... | Get the skin base URL.
@param string $pUrl Relative URL inside the skin directory
@param bool $pRelative Create a relative URL
@return string | [
"Get",
"the",
"skin",
"base",
"URL",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Url/Url.php#L143-L155 |
11,248 | agalbourdin/agl-core | src/Url/Url.php | Url.getPublic | public static function getPublic($pUrl, $pRelative = true)
{
$url = Agl::APP_PUBLIC_DIR
. $pUrl;
if ($pRelative) {
return ROOT . $url;
}
return self::getHost(ROOT . $url);
} | php | public static function getPublic($pUrl, $pRelative = true)
{
$url = Agl::APP_PUBLIC_DIR
. $pUrl;
if ($pRelative) {
return ROOT . $url;
}
return self::getHost(ROOT . $url);
} | [
"public",
"static",
"function",
"getPublic",
"(",
"$",
"pUrl",
",",
"$",
"pRelative",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"Agl",
"::",
"APP_PUBLIC_DIR",
".",
"$",
"pUrl",
";",
"if",
"(",
"$",
"pRelative",
")",
"{",
"return",
"ROOT",
".",
"$",
"... | Get the public base URL.
@param string $pUrl Relative URL inside the public directory
@param bool $pRelative Create a relative URL
@return string | [
"Get",
"the",
"public",
"base",
"URL",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Url/Url.php#L164-L174 |
11,249 | agalbourdin/agl-core | src/Url/Url.php | Url.getHost | public static function getHost($pPath = '', $pHost = '')
{
if (! $pHost) {
$pHost = $_SERVER['HTTP_HOST'];
}
return self::getProtocol() . $pHost . $pPath;
} | php | public static function getHost($pPath = '', $pHost = '')
{
if (! $pHost) {
$pHost = $_SERVER['HTTP_HOST'];
}
return self::getProtocol() . $pHost . $pPath;
} | [
"public",
"static",
"function",
"getHost",
"(",
"$",
"pPath",
"=",
"''",
",",
"$",
"pHost",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"pHost",
")",
"{",
"$",
"pHost",
"=",
"$",
"_SERVER",
"[",
"'HTTP_HOST'",
"]",
";",
"}",
"return",
"self",
"::",... | Get the base URL with host name and protocol.
@return string | [
"Get",
"the",
"base",
"URL",
"with",
"host",
"name",
"and",
"protocol",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Url/Url.php#L181-L188 |
11,250 | cityware/city-wmi | src/Processors/HardDisks.php | HardDisks.get | public function get()
{
$disks = [];
$result = $this->connection->newQuery()->from(Classes::WIN32_LOGICALDISK)->get();
foreach($result as $disk) {
$disks[] = new HardDisk($disk);
}
return $disks;
} | php | public function get()
{
$disks = [];
$result = $this->connection->newQuery()->from(Classes::WIN32_LOGICALDISK)->get();
foreach($result as $disk) {
$disks[] = new HardDisk($disk);
}
return $disks;
} | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"disks",
"=",
"[",
"]",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"connection",
"->",
"newQuery",
"(",
")",
"->",
"from",
"(",
"Classes",
"::",
"WIN32_LOGICALDISK",
")",
"->",
"get",
"(",
")",
";",... | Returns an array of all hard disks on the computer.
@return array | [
"Returns",
"an",
"array",
"of",
"all",
"hard",
"disks",
"on",
"the",
"computer",
"."
] | c7296e6855b6719f537ff5c2dc19d521ce1415d8 | https://github.com/cityware/city-wmi/blob/c7296e6855b6719f537ff5c2dc19d521ce1415d8/src/Processors/HardDisks.php#L15-L26 |
11,251 | sgtlambda/jvwp | src/widgets/StockWidgets.php | StockWidgets.getStockWidgets | private static function getStockWidgets ()
{
$reflectionClass = new \ReflectionClass(get_class());
$classNames = array();
foreach ($reflectionClass->getConstants() as $name => $value)
if (preg_match('/^STOCK_WP/', $name))
$classNames[] = $value;
retur... | php | private static function getStockWidgets ()
{
$reflectionClass = new \ReflectionClass(get_class());
$classNames = array();
foreach ($reflectionClass->getConstants() as $name => $value)
if (preg_match('/^STOCK_WP/', $name))
$classNames[] = $value;
retur... | [
"private",
"static",
"function",
"getStockWidgets",
"(",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"get_class",
"(",
")",
")",
";",
"$",
"classNames",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"reflectionClass",
"-... | By means of class reflection, gets a list of all the classnames of the stock widgets
@return string[] | [
"By",
"means",
"of",
"class",
"reflection",
"gets",
"a",
"list",
"of",
"all",
"the",
"classnames",
"of",
"the",
"stock",
"widgets"
] | 85dba59281216ccb9cff580d26063d304350bbe0 | https://github.com/sgtlambda/jvwp/blob/85dba59281216ccb9cff580d26063d304350bbe0/src/widgets/StockWidgets.php#L30-L38 |
11,252 | AnonymPHP/Anonym-Library | src/Anonym/Cron/Schedule/Schedule.php | Schedule.spliceIntoPosition | protected function spliceIntoPosition($position, $value)
{
$segments = explode(' ', $this->pattern);
$segments[$position - 1] = $value;
return $this->cron(implode(' ', $segments));
} | php | protected function spliceIntoPosition($position, $value)
{
$segments = explode(' ', $this->pattern);
$segments[$position - 1] = $value;
return $this->cron(implode(' ', $segments));
} | [
"protected",
"function",
"spliceIntoPosition",
"(",
"$",
"position",
",",
"$",
"value",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"' '",
",",
"$",
"this",
"->",
"pattern",
")",
";",
"$",
"segments",
"[",
"$",
"position",
"-",
"1",
"]",
"=",
"$"... | Splice the given value into the given position of the expression.
@param int $position
@param string $value
@return $this | [
"Splice",
"the",
"given",
"value",
"into",
"the",
"given",
"position",
"of",
"the",
"expression",
"."
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Cron/Schedule/Schedule.php#L267-L273 |
11,253 | AnonymPHP/Anonym-Library | src/Anonym/Cron/Schedule/Schedule.php | Schedule.createPatternWithVariables | private function createPatternWithVariables()
{
$variables = [
$this->getMinute(),
$this->getHour(),
$this->getDayOfMounth(),
$this->getMounth(),
$this->getDayOfWeek(),
$this->getYear(),
];
return join(' ', $variables);... | php | private function createPatternWithVariables()
{
$variables = [
$this->getMinute(),
$this->getHour(),
$this->getDayOfMounth(),
$this->getMounth(),
$this->getDayOfWeek(),
$this->getYear(),
];
return join(' ', $variables);... | [
"private",
"function",
"createPatternWithVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"[",
"$",
"this",
"->",
"getMinute",
"(",
")",
",",
"$",
"this",
"->",
"getHour",
"(",
")",
",",
"$",
"this",
"->",
"getDayOfMounth",
"(",
")",
",",
"$",
"this",... | if pattern is null, create patten with private variables
@return string | [
"if",
"pattern",
"is",
"null",
"create",
"patten",
"with",
"private",
"variables"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Cron/Schedule/Schedule.php#L530-L542 |
11,254 | vinala/kernel | src/Foundation/Fetcher.php | Fetcher.run | public static function run($routes)
{
self::setAppPath();
self::setFrameworkPath();
//
self::exception();
self::events();
self::model();
self::controller();
self::link();
if (Component::isOn('database')) {
self::seed();
}
... | php | public static function run($routes)
{
self::setAppPath();
self::setFrameworkPath();
//
self::exception();
self::events();
self::model();
self::controller();
self::link();
if (Component::isOn('database')) {
self::seed();
}
... | [
"public",
"static",
"function",
"run",
"(",
"$",
"routes",
")",
"{",
"self",
"::",
"setAppPath",
"(",
")",
";",
"self",
"::",
"setFrameworkPath",
"(",
")",
";",
"//",
"self",
"::",
"exception",
"(",
")",
";",
"self",
"::",
"events",
"(",
")",
";",
... | Get all required App files. | [
"Get",
"all",
"required",
"App",
"files",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Fetcher.php#L30-L50 |
11,255 | vinala/kernel | src/Foundation/Fetcher.php | Fetcher.fetch | protected static function fetch($pattern, $app = true)
{
if ($app) {
return glob(self::$appPath.$pattern.'/*.php');
} else {
return glob(self::$frameworkPath.$pattern.'/*.php');
}
} | php | protected static function fetch($pattern, $app = true)
{
if ($app) {
return glob(self::$appPath.$pattern.'/*.php');
} else {
return glob(self::$frameworkPath.$pattern.'/*.php');
}
} | [
"protected",
"static",
"function",
"fetch",
"(",
"$",
"pattern",
",",
"$",
"app",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"app",
")",
"{",
"return",
"glob",
"(",
"self",
"::",
"$",
"appPath",
".",
"$",
"pattern",
".",
"'/*.php'",
")",
";",
"}",
"e... | Fetch files of folder. | [
"Fetch",
"files",
"of",
"folder",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Fetcher.php#L75-L82 |
11,256 | vinala/kernel | src/Foundation/Fetcher.php | Fetcher.middleware | protected static function middleware()
{
foreach (self::fetch('http/middleware') as $file) {
Bus::need($file);
}
Middleware::ini();
} | php | protected static function middleware()
{
foreach (self::fetch('http/middleware') as $file) {
Bus::need($file);
}
Middleware::ini();
} | [
"protected",
"static",
"function",
"middleware",
"(",
")",
"{",
"foreach",
"(",
"self",
"::",
"fetch",
"(",
"'http/middleware'",
")",
"as",
"$",
"file",
")",
"{",
"Bus",
"::",
"need",
"(",
"$",
"file",
")",
";",
"}",
"Middleware",
"::",
"ini",
"(",
"... | Require and call middleware classes.
@return null | [
"Require",
"and",
"call",
"middleware",
"classes",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Fetcher.php#L160-L167 |
11,257 | vinala/kernel | src/Foundation/Fetcher.php | Fetcher.routes | protected static function routes($routes)
{
if ($routes) {
self::middleware();
Bus::need(self::$appPath.'http/Routes.php');
Routes::run();
}
} | php | protected static function routes($routes)
{
if ($routes) {
self::middleware();
Bus::need(self::$appPath.'http/Routes.php');
Routes::run();
}
} | [
"protected",
"static",
"function",
"routes",
"(",
"$",
"routes",
")",
"{",
"if",
"(",
"$",
"routes",
")",
"{",
"self",
"::",
"middleware",
"(",
")",
";",
"Bus",
"::",
"need",
"(",
"self",
"::",
"$",
"appPath",
".",
"'http/Routes.php'",
")",
";",
"Rou... | Require files of Routes. | [
"Require",
"files",
"of",
"Routes",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Fetcher.php#L172-L180 |
11,258 | vinala/kernel | src/Foundation/Fetcher.php | Fetcher.events | protected static function events()
{
foreach (self::fetch('app/events', false) as $file) {
Bus::need($file);
}
//
Event::register();
} | php | protected static function events()
{
foreach (self::fetch('app/events', false) as $file) {
Bus::need($file);
}
//
Event::register();
} | [
"protected",
"static",
"function",
"events",
"(",
")",
"{",
"foreach",
"(",
"self",
"::",
"fetch",
"(",
"'app/events'",
",",
"false",
")",
"as",
"$",
"file",
")",
"{",
"Bus",
"::",
"need",
"(",
"$",
"file",
")",
";",
"}",
"//",
"Event",
"::",
"regi... | Require files of Console. | [
"Require",
"files",
"of",
"Console",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Fetcher.php#L195-L202 |
11,259 | vinala/kernel | src/Foundation/Fetcher.php | Fetcher.mails | protected static function mails()
{
if (is_dir(root().'app/mails')) {
foreach (self::fetch('app/mails', false) as $file) {
need($file);
}
}
} | php | protected static function mails()
{
if (is_dir(root().'app/mails')) {
foreach (self::fetch('app/mails', false) as $file) {
need($file);
}
}
} | [
"protected",
"static",
"function",
"mails",
"(",
")",
"{",
"if",
"(",
"is_dir",
"(",
"root",
"(",
")",
".",
"'app/mails'",
")",
")",
"{",
"foreach",
"(",
"self",
"::",
"fetch",
"(",
"'app/mails'",
",",
"false",
")",
"as",
"$",
"file",
")",
"{",
"ne... | Require files of Mail if exists.
@return null | [
"Require",
"files",
"of",
"Mail",
"if",
"exists",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Fetcher.php#L209-L216 |
11,260 | mvlabs/MvlabsLumber | src/MvlabsLumber/Service/LoggerFactory.php | LoggerFactory.getOptionalParam | private function getOptionalParam($s_paramName, $am_writerConf) {
$m_paramValue = null;
if (array_key_exists($s_paramName, $am_writerConf)) {
$m_paramValue = $am_writerConf[$s_paramName];
}
return $m_paramValue;
} | php | private function getOptionalParam($s_paramName, $am_writerConf) {
$m_paramValue = null;
if (array_key_exists($s_paramName, $am_writerConf)) {
$m_paramValue = $am_writerConf[$s_paramName];
}
return $m_paramValue;
} | [
"private",
"function",
"getOptionalParam",
"(",
"$",
"s_paramName",
",",
"$",
"am_writerConf",
")",
"{",
"$",
"m_paramValue",
"=",
"null",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"s_paramName",
",",
"$",
"am_writerConf",
")",
")",
"{",
"$",
"m_paramVal... | Returns value of a parameter if present, null otherwise
@param string $s_paramName parameter name
@param array $am_writerConf configuration array
@return mixed parameter value | [
"Returns",
"value",
"of",
"a",
"parameter",
"if",
"present",
"null",
"otherwise"
] | b9491b5b6f3a68ed18018408243cdd594424c5e2 | https://github.com/mvlabs/MvlabsLumber/blob/b9491b5b6f3a68ed18018408243cdd594424c5e2/src/MvlabsLumber/Service/LoggerFactory.php#L286-L296 |
11,261 | sheychen290/inutils | src/Storage/ArrayCollection.php | ArrayCollection.add | public function add(string $key, $value)
{
$current = $this->get($key, []);
$adds = is_array($value) ? $value : [$value];
$this->set($key, array_merge($current, array_values($adds)));
} | php | public function add(string $key, $value)
{
$current = $this->get($key, []);
$adds = is_array($value) ? $value : [$value];
$this->set($key, array_merge($current, array_values($adds)));
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
",",
"[",
"]",
")",
";",
"$",
"adds",
"=",
"is_array",
"(",
"$",
"value",
")",
"?",
"$",
"val... | Add Values To Key Array | [
"Add",
"Values",
"To",
"Key",
"Array"
] | 43cae2967faa1df57ec9bbf9596b45c0762081a6 | https://github.com/sheychen290/inutils/blob/43cae2967faa1df57ec9bbf9596b45c0762081a6/src/Storage/ArrayCollection.php#L18-L23 |
11,262 | flavorzyb/wechat | src/Event/Parser.php | Parser.createLocationEvent | protected function createLocationEvent(array $data)
{
$result = new WxReceiveLocationEvent();
$this->initReceive($result, $data);
$result->setLatitude($data['Latitude']);
$result->setLongitude($data['Longitude']);
$result->setPrecision($data['Precision']);
return $r... | php | protected function createLocationEvent(array $data)
{
$result = new WxReceiveLocationEvent();
$this->initReceive($result, $data);
$result->setLatitude($data['Latitude']);
$result->setLongitude($data['Longitude']);
$result->setPrecision($data['Precision']);
return $r... | [
"protected",
"function",
"createLocationEvent",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveLocationEvent",
"(",
")",
";",
"$",
"this",
"->",
"initReceive",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->"... | create WxReceiveLocationEvent instance
@param array $data
@return WxReceiveLocationEvent | [
"create",
"WxReceiveLocationEvent",
"instance"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Event/Parser.php#L48-L58 |
11,263 | flavorzyb/wechat | src/Event/Parser.php | Parser.createViewEvent | protected function createViewEvent(array $data)
{
$result = new WxReceiveViewEvent();
$this->initReceive($result, $data);
$result->setEventKey($data['EventKey']);
return $result;
} | php | protected function createViewEvent(array $data)
{
$result = new WxReceiveViewEvent();
$this->initReceive($result, $data);
$result->setEventKey($data['EventKey']);
return $result;
} | [
"protected",
"function",
"createViewEvent",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveViewEvent",
"(",
")",
";",
"$",
"this",
"->",
"initReceive",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->",
"set... | create WxReceiveViewEvent instance
@param array $data
@return WxReceiveViewEvent | [
"create",
"WxReceiveViewEvent",
"instance"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Event/Parser.php#L66-L74 |
11,264 | flavorzyb/wechat | src/Event/Parser.php | Parser.createClickEvent | protected function createClickEvent(array $data)
{
$result = new WxReceiveClickEvent();
$this->initReceive($result, $data);
$result->setEventKey($data['EventKey']);
return $result;
} | php | protected function createClickEvent(array $data)
{
$result = new WxReceiveClickEvent();
$this->initReceive($result, $data);
$result->setEventKey($data['EventKey']);
return $result;
} | [
"protected",
"function",
"createClickEvent",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveClickEvent",
"(",
")",
";",
"$",
"this",
"->",
"initReceive",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->",
"s... | create WxReceiveClickEvent instance
@param array $data
@return WxReceiveClickEvent | [
"create",
"WxReceiveClickEvent",
"instance"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Event/Parser.php#L82-L90 |
11,265 | flavorzyb/wechat | src/Event/Parser.php | Parser.createScanEvent | protected function createScanEvent(array $data)
{
$result = new WxReceiveScanEvent();
$this->initReceive($result, $data);
$result->setEvent($data['Event']);
$result->setEventKey($data['EventKey']);
$result->setTicket($data['Ticket']);
return $result;
} | php | protected function createScanEvent(array $data)
{
$result = new WxReceiveScanEvent();
$this->initReceive($result, $data);
$result->setEvent($data['Event']);
$result->setEventKey($data['EventKey']);
$result->setTicket($data['Ticket']);
return $result;
} | [
"protected",
"function",
"createScanEvent",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveScanEvent",
"(",
")",
";",
"$",
"this",
"->",
"initReceive",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->",
"set... | create WxReceiveScanEvent instance
@param array $data
@return WxReceiveScanEvent | [
"create",
"WxReceiveScanEvent",
"instance"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Event/Parser.php#L97-L107 |
11,266 | flavorzyb/wechat | src/Event/Parser.php | Parser.createSubscribeEvent | protected function createSubscribeEvent(array $data)
{
if (isset($data['EventKey']) && isset($data['Ticket']) && (WxReceiveEvent::EVENT_TYPE_SUBSCRIBE == $data['Event'])) {
return $this->createScanEvent($data);
}
$result = new WxReceiveSubscribeEvent();
$this->initReceiv... | php | protected function createSubscribeEvent(array $data)
{
if (isset($data['EventKey']) && isset($data['Ticket']) && (WxReceiveEvent::EVENT_TYPE_SUBSCRIBE == $data['Event'])) {
return $this->createScanEvent($data);
}
$result = new WxReceiveSubscribeEvent();
$this->initReceiv... | [
"protected",
"function",
"createSubscribeEvent",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'EventKey'",
"]",
")",
"&&",
"isset",
"(",
"$",
"data",
"[",
"'Ticket'",
"]",
")",
"&&",
"(",
"WxReceiveEvent",
"::",
"EVE... | create WxReceiveEvent instance
@param array $data
@return WxReceiveEvent | [
"create",
"WxReceiveEvent",
"instance"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Event/Parser.php#L114-L125 |
11,267 | michaelKaefer/user | src/Factory/UserFactory.php | UserFactory.createFromFileOwner | public static function createFromFileOwner($filename)
{
if (!file_exists($filename)) {
throw new \InvalidArgumentException('Invalid file name provided.');
}
if (!function_exists('posix_getuid')) {
throw new PosixNotAvailableException(
'Could not retrie... | php | public static function createFromFileOwner($filename)
{
if (!file_exists($filename)) {
throw new \InvalidArgumentException('Invalid file name provided.');
}
if (!function_exists('posix_getuid')) {
throw new PosixNotAvailableException(
'Could not retrie... | [
"public",
"static",
"function",
"createFromFileOwner",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid file name provided.'",
")",
";",
"}",
"i... | Factory method to get the owner of a file.
@param string $filename
@return User
@throws PosixNotAvailableException
@throws \Exception | [
"Factory",
"method",
"to",
"get",
"the",
"owner",
"of",
"a",
"file",
"."
] | 58f3eb2fcecbdf8c450c9905d9bd6fd03bc23a72 | https://github.com/michaelKaefer/user/blob/58f3eb2fcecbdf8c450c9905d9bd6fd03bc23a72/src/Factory/UserFactory.php#L80-L95 |
11,268 | apnet/AsseticImporterBundle | src/Apnet/AsseticImporterBundle/Factory/Importer/PathImporter.php | PathImporter.load | public function load($sourcePath, $targetPath)
{
$mapper = new AssetMapper();
$mapper->map($sourcePath, $targetPath);
return $mapper;
} | php | public function load($sourcePath, $targetPath)
{
$mapper = new AssetMapper();
$mapper->map($sourcePath, $targetPath);
return $mapper;
} | [
"public",
"function",
"load",
"(",
"$",
"sourcePath",
",",
"$",
"targetPath",
")",
"{",
"$",
"mapper",
"=",
"new",
"AssetMapper",
"(",
")",
";",
"$",
"mapper",
"->",
"map",
"(",
"$",
"sourcePath",
",",
"$",
"targetPath",
")",
";",
"return",
"$",
"map... | Add asset mapper from file or directory path
@param string $sourcePath File or directory path
@param string $targetPath Target path
@return AssetMapper | [
"Add",
"asset",
"mapper",
"from",
"file",
"or",
"directory",
"path"
] | 104ad3593795c016a5b89ecc8c240d4d96d3de45 | https://github.com/apnet/AsseticImporterBundle/blob/104ad3593795c016a5b89ecc8c240d4d96d3de45/src/Apnet/AsseticImporterBundle/Factory/Importer/PathImporter.php#L27-L33 |
11,269 | xloit/xloit-bridge-zend-filter | src/CarriageReturnToHtml.php | CarriageReturnToHtml.filter | public function filter($value)
{
if (!is_string($value)) {
return $value;
}
// Strip unicode bombs, and make sure all newlines are UNIX newlines.
$value = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $value);
$value = preg_replace('{\r\n?}', "\n", $value);
$... | php | public function filter($value)
{
if (!is_string($value)) {
return $value;
}
// Strip unicode bombs, and make sure all newlines are UNIX newlines.
$value = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $value);
$value = preg_replace('{\r\n?}', "\n", $value);
$... | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"// Strip unicode bombs, and make sure all newlines are UNIX newlines.",
"$",
"value",
"=",
"preg_replac... | Convert paragraphs of text into filtered HTML.
@param mixed $value
@return string | [
"Convert",
"paragraphs",
"of",
"text",
"into",
"filtered",
"HTML",
"."
] | 2bce36194cd8636484f1b06ad13f33d953f477e0 | https://github.com/xloit/xloit-bridge-zend-filter/blob/2bce36194cd8636484f1b06ad13f33d953f477e0/src/CarriageReturnToHtml.php#L36-L60 |
11,270 | GovTribe/laravel-kinvey | src/GovTribe/LaravelKinvey/Client/Exception/KinveyResponseExceptionFactory.php | KinveyResponseExceptionFactory.fromResponse | public function fromResponse(RequestInterface $request, Response $response)
{
$message = $response->json();
$parts = array(
'type' => isset($message['error']) ? $message['error'] : null,
'description' => isset($message['description']) ? $message['description'] : null,
'request_id' => $response->getHeader... | php | public function fromResponse(RequestInterface $request, Response $response)
{
$message = $response->json();
$parts = array(
'type' => isset($message['error']) ? $message['error'] : null,
'description' => isset($message['description']) ? $message['description'] : null,
'request_id' => $response->getHeader... | [
"public",
"function",
"fromResponse",
"(",
"RequestInterface",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"message",
"=",
"$",
"response",
"->",
"json",
"(",
")",
";",
"$",
"parts",
"=",
"array",
"(",
"'type'",
"=>",
"isset",
"(",
... | Returns a Kinvey service specific exception
@param RequestInterface $request Unsuccessful request
@param Response $response Unsuccessful response that was encountered
@return Exception | [
"Returns",
"a",
"Kinvey",
"service",
"specific",
"exception"
] | 8a25dafdf80a933384dfcfe8b70b0a7663fe9289 | https://github.com/GovTribe/laravel-kinvey/blob/8a25dafdf80a933384dfcfe8b70b0a7663fe9289/src/GovTribe/LaravelKinvey/Client/Exception/KinveyResponseExceptionFactory.php#L16-L28 |
11,271 | GovTribe/laravel-kinvey | src/GovTribe/LaravelKinvey/Client/Exception/KinveyResponseExceptionFactory.php | KinveyResponseExceptionFactory.createException | protected function createException(RequestInterface $request, Response $response, array $parts)
{
$message = 'Status Code: ' . $response->getStatusCode() . PHP_EOL
. 'Kinvey Request ID: ' . $parts['request_id'] . PHP_EOL
. 'Kinvey Exception Type: ' . $parts['type'] . PHP_EOL
. 'Kinvey Error Message: ' . $pa... | php | protected function createException(RequestInterface $request, Response $response, array $parts)
{
$message = 'Status Code: ' . $response->getStatusCode() . PHP_EOL
. 'Kinvey Request ID: ' . $parts['request_id'] . PHP_EOL
. 'Kinvey Exception Type: ' . $parts['type'] . PHP_EOL
. 'Kinvey Error Message: ' . $pa... | [
"protected",
"function",
"createException",
"(",
"RequestInterface",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"array",
"$",
"parts",
")",
"{",
"$",
"message",
"=",
"'Status Code: '",
".",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
".",
"... | Create an prepare an exception object
@param RequestInterface $request Request
@param Response $response Response received
@param array $parts Parsed exception data
@return \Exception | [
"Create",
"an",
"prepare",
"an",
"exception",
"object"
] | 8a25dafdf80a933384dfcfe8b70b0a7663fe9289 | https://github.com/GovTribe/laravel-kinvey/blob/8a25dafdf80a933384dfcfe8b70b0a7663fe9289/src/GovTribe/LaravelKinvey/Client/Exception/KinveyResponseExceptionFactory.php#L39-L54 |
11,272 | jails/li3_behaviors | data/model/Behaviors.php | Behaviors._init | protected function _init() {
$self = static::_object();
if (!isset($self->_actsAs)) {
$self->_actsAs = [];
}
foreach ($self->_actsAs as $name => $config) {
if (is_string($config)) {
$name = $config;
$config = [];
}
static::actsAs($name, $config);
}
} | php | protected function _init() {
$self = static::_object();
if (!isset($self->_actsAs)) {
$self->_actsAs = [];
}
foreach ($self->_actsAs as $name => $config) {
if (is_string($config)) {
$name = $config;
$config = [];
}
static::actsAs($name, $config);
}
} | [
"protected",
"function",
"_init",
"(",
")",
"{",
"$",
"self",
"=",
"static",
"::",
"_object",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"self",
"->",
"_actsAs",
")",
")",
"{",
"$",
"self",
"->",
"_actsAs",
"=",
"[",
"]",
";",
"}",
"fore... | Initializer function called just after the model instanciation.
Example to disable the `_init()` call use the following before any access to the model:
{{{
Posts::config(['init' => false]);
}}} | [
"Initializer",
"function",
"called",
"just",
"after",
"the",
"model",
"instanciation",
"."
] | 4d2f13c7c893ad1084dfd25f96370afd6238a7e3 | https://github.com/jails/li3_behaviors/blob/4d2f13c7c893ad1084dfd25f96370afd6238a7e3/data/model/Behaviors.php#L56-L68 |
11,273 | jails/li3_behaviors | data/model/Behaviors.php | Behaviors.actsAs | public static function actsAs($name, $config = [], $entry = null) {
$self = static::_object();
$class = Libraries::locate('behavior', $name);
if ($config === true) {
if (isset($self->_behaviors[$class])) {
return $self->_behaviors[$class]->config($entry);
}
throw new RuntimeException("Unexisting Be... | php | public static function actsAs($name, $config = [], $entry = null) {
$self = static::_object();
$class = Libraries::locate('behavior', $name);
if ($config === true) {
if (isset($self->_behaviors[$class])) {
return $self->_behaviors[$class]->config($entry);
}
throw new RuntimeException("Unexisting Be... | [
"public",
"static",
"function",
"actsAs",
"(",
"$",
"name",
",",
"$",
"config",
"=",
"[",
"]",
",",
"$",
"entry",
"=",
"null",
")",
"{",
"$",
"self",
"=",
"static",
"::",
"_object",
"(",
")",
";",
"$",
"class",
"=",
"Libraries",
"::",
"locate",
"... | Bind a behavior class to the current model
@param string $name The name of the behavior
@param string $config If `$config === true` returns some configurations of the behavior,
if `$config === false` unbind the behavior, otherwise `$config` stands for
the configuration array to set for the behavior.
@param string $ent... | [
"Bind",
"a",
"behavior",
"class",
"to",
"the",
"current",
"model"
] | 4d2f13c7c893ad1084dfd25f96370afd6238a7e3 | https://github.com/jails/li3_behaviors/blob/4d2f13c7c893ad1084dfd25f96370afd6238a7e3/data/model/Behaviors.php#L118-L146 |
11,274 | skimia/api-fusion | src/Domain/Traits/CheckableTrait.php | CheckableTrait.runChecks | protected function runChecks($action, $input = [], $original = [])
{
// Perform a basic check to see if the current action is authorised
// to be performed on this resource
$this->checkAuthorisation($action);
// If input data is given
if (! empty($input)) {
// Ru... | php | protected function runChecks($action, $input = [], $original = [])
{
// Perform a basic check to see if the current action is authorised
// to be performed on this resource
$this->checkAuthorisation($action);
// If input data is given
if (! empty($input)) {
// Ru... | [
"protected",
"function",
"runChecks",
"(",
"$",
"action",
",",
"$",
"input",
"=",
"[",
"]",
",",
"$",
"original",
"=",
"[",
"]",
")",
"{",
"// Perform a basic check to see if the current action is authorised",
"// to be performed on this resource",
"$",
"this",
"->",
... | Run required checks for given action.
@param string $action Requested action to check
@param array $input Input data relevant to checks
@param array $original Original data from the model
@return array InputFilteredData if $input is provided | [
"Run",
"required",
"checks",
"for",
"given",
"action",
"."
] | f904a3c171a42a37a2f84ed8c7b74e947f860910 | https://github.com/skimia/api-fusion/blob/f904a3c171a42a37a2f84ed8c7b74e947f860910/src/Domain/Traits/CheckableTrait.php#L35-L51 |
11,275 | skimia/api-fusion | src/Domain/Traits/CheckableTrait.php | CheckableTrait.applyValidationRules | protected function applyValidationRules($action, $input = [])
{
if ($action == 'read' or $action == 'destroy') {
return;
}
if (! $this->inputValidator) {
throw new RequiredInputValidatorException('You must provide an inputValidator to perform a data modification / cr... | php | protected function applyValidationRules($action, $input = [])
{
if ($action == 'read' or $action == 'destroy') {
return;
}
if (! $this->inputValidator) {
throw new RequiredInputValidatorException('You must provide an inputValidator to perform a data modification / cr... | [
"protected",
"function",
"applyValidationRules",
"(",
"$",
"action",
",",
"$",
"input",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"action",
"==",
"'read'",
"or",
"$",
"action",
"==",
"'destroy'",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"t... | Apply validation rules.
@param string $action Requested action to check
@param array $input Input data
@throws ValidationException If input validation fails
@throws RequiredInputValidatorException If inputValidator is not proivide on a data modification / creation
@... | [
"Apply",
"validation",
"rules",
"."
] | f904a3c171a42a37a2f84ed8c7b74e947f860910 | https://github.com/skimia/api-fusion/blob/f904a3c171a42a37a2f84ed8c7b74e947f860910/src/Domain/Traits/CheckableTrait.php#L75-L96 |
11,276 | skimia/api-fusion | src/Domain/Traits/CheckableTrait.php | CheckableTrait.applyDomainRules | protected function applyDomainRules($action, $input = [], $original = [])
{
$domainRulesMethod = 'domainRulesOn'.ucfirst($action);
// Pass in original model if we are updating
if ($action = 'update') {
$this->{ $domainRulesMethod }($input, $original);
} else {
... | php | protected function applyDomainRules($action, $input = [], $original = [])
{
$domainRulesMethod = 'domainRulesOn'.ucfirst($action);
// Pass in original model if we are updating
if ($action = 'update') {
$this->{ $domainRulesMethod }($input, $original);
} else {
... | [
"protected",
"function",
"applyDomainRules",
"(",
"$",
"action",
",",
"$",
"input",
"=",
"[",
"]",
",",
"$",
"original",
"=",
"[",
"]",
")",
"{",
"$",
"domainRulesMethod",
"=",
"'domainRulesOn'",
".",
"ucfirst",
"(",
"$",
"action",
")",
";",
"// Pass in ... | Apply domain rules.
@param string $action Requested action to check
@param array $input Input data
@param array $original Original item before modification | [
"Apply",
"domain",
"rules",
"."
] | f904a3c171a42a37a2f84ed8c7b74e947f860910 | https://github.com/skimia/api-fusion/blob/f904a3c171a42a37a2f84ed8c7b74e947f860910/src/Domain/Traits/CheckableTrait.php#L104-L114 |
11,277 | mszewcz/php-light-framework | src/Db/MySQL/Query/Delete.php | Delete.from | public function from(string $table = null): Delete
{
$this->from = [];
if (!\is_string($table) && !\is_array($table)) {
throw new InvalidArgumentException('$table has to be an array or a string');
}
$this->from = $this->namesClass->parse($table, true);
return $th... | php | public function from(string $table = null): Delete
{
$this->from = [];
if (!\is_string($table) && !\is_array($table)) {
throw new InvalidArgumentException('$table has to be an array or a string');
}
$this->from = $this->namesClass->parse($table, true);
return $th... | [
"public",
"function",
"from",
"(",
"string",
"$",
"table",
"=",
"null",
")",
":",
"Delete",
"{",
"$",
"this",
"->",
"from",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"table",
")",
"&&",
"!",
"\\",
"is_array",
"(",
"$",
"t... | Adds table names for delete
@param string|null $table
@return Delete | [
"Adds",
"table",
"names",
"for",
"delete"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Db/MySQL/Query/Delete.php#L45-L54 |
11,278 | lasallecrm/lasallecrm-l5-lasallecrmcontact-pkg | src/Http/Controllers/LasallecrmcontactController.php | LasallecrmcontactController.show | public function show($id) {
// $id can be an integer -- the actual ID of the PEOPLES table; or,
// $id can be a string, in the format "Firstname@Lastname"
$peopleID = $this->helpers->determinePeopleID($id);
if (!$this->helpers->isAllowedPeopleIdSingleContactDisplay($peopleID)) {
... | php | public function show($id) {
// $id can be an integer -- the actual ID of the PEOPLES table; or,
// $id can be a string, in the format "Firstname@Lastname"
$peopleID = $this->helpers->determinePeopleID($id);
if (!$this->helpers->isAllowedPeopleIdSingleContactDisplay($peopleID)) {
... | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"// $id can be an integer -- the actual ID of the PEOPLES table; or,",
"// $id can be a string, in the format \"Firstname@Lastname\"",
"$",
"peopleID",
"=",
"$",
"this",
"->",
"helpers",
"->",
"determinePeopleID",
"(",
"... | Display a single contact from the LaSalleCRM database
@param mixed $id LaSalleCRM people ID (int) or "Firstname@Lastname" (text)
@return response | [
"Display",
"a",
"single",
"contact",
"from",
"the",
"LaSalleCRM",
"database"
] | d0a66b457a0e544636d82d4f0e71a0859dd85ee6 | https://github.com/lasallecrm/lasallecrm-l5-lasallecrmcontact-pkg/blob/d0a66b457a0e544636d82d4f0e71a0859dd85ee6/src/Http/Controllers/LasallecrmcontactController.php#L78-L99 |
11,279 | lasallecrm/lasallecrm-l5-lasallecrmcontact-pkg | src/Http/Controllers/LasallecrmcontactController.php | LasallecrmcontactController.multipleshow | public function multipleshow() {
$displayTheseIDs = Config::get('lasallecrmcontact.multiple_contact_display_people_ids');
$contacts = [];
$i = 0;
foreach ($displayTheseIDs as $displayThisID) {
$people = $this->peopleRepository->getFind($displayThisID);
$ema... | php | public function multipleshow() {
$displayTheseIDs = Config::get('lasallecrmcontact.multiple_contact_display_people_ids');
$contacts = [];
$i = 0;
foreach ($displayTheseIDs as $displayThisID) {
$people = $this->peopleRepository->getFind($displayThisID);
$ema... | [
"public",
"function",
"multipleshow",
"(",
")",
"{",
"$",
"displayTheseIDs",
"=",
"Config",
"::",
"get",
"(",
"'lasallecrmcontact.multiple_contact_display_people_ids'",
")",
";",
"$",
"contacts",
"=",
"[",
"]",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"... | Display multiple contacts from the LaSalleCRM database
@return response | [
"Display",
"multiple",
"contacts",
"from",
"the",
"LaSalleCRM",
"database"
] | d0a66b457a0e544636d82d4f0e71a0859dd85ee6 | https://github.com/lasallecrm/lasallecrm-l5-lasallecrmcontact-pkg/blob/d0a66b457a0e544636d82d4f0e71a0859dd85ee6/src/Http/Controllers/LasallecrmcontactController.php#L107-L136 |
11,280 | tonjoo/tiga-framework | src/Template/h2o/context.php | H2o_Context.resolve | public function resolve($var)
{
# if $var is array - it contains filters to apply
$filters = array();
if (is_array($var)) {
$name = array_shift($var);
$filters = isset($var['filters']) ? $var['filters'] : array();
} else {
$name = $var;
}
... | php | public function resolve($var)
{
# if $var is array - it contains filters to apply
$filters = array();
if (is_array($var)) {
$name = array_shift($var);
$filters = isset($var['filters']) ? $var['filters'] : array();
} else {
$name = $var;
}
... | [
"public",
"function",
"resolve",
"(",
"$",
"var",
")",
"{",
"# if $var is array - it contains filters to apply",
"$",
"filters",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"var",
")",
")",
"{",
"$",
"name",
"=",
"array_shift",
"(",
"$",
... | Variable name.
@param $var variable name or array(0 => variable name, 'filters' => filters array)
@return unknown_type | [
"Variable",
"name",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Template/h2o/context.php#L118-L157 |
11,281 | slickframework/console | src/CommandFactory.php | CommandFactory.loadCommands | public function loadCommands()
{
$slickModules = $this->filterSlickModules();
$classes = $this->getCommandClasses($slickModules);
foreach ($classes as $class) {
if (is_subclass_of($class, Command::class)) {
$this->application->add(new $class());
}
... | php | public function loadCommands()
{
$slickModules = $this->filterSlickModules();
$classes = $this->getCommandClasses($slickModules);
foreach ($classes as $class) {
if (is_subclass_of($class, Command::class)) {
$this->application->add(new $class());
}
... | [
"public",
"function",
"loadCommands",
"(",
")",
"{",
"$",
"slickModules",
"=",
"$",
"this",
"->",
"filterSlickModules",
"(",
")",
";",
"$",
"classes",
"=",
"$",
"this",
"->",
"getCommandClasses",
"(",
"$",
"slickModules",
")",
";",
"foreach",
"(",
"$",
"... | Load all slick commands | [
"Load",
"all",
"slick",
"commands"
] | d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6 | https://github.com/slickframework/console/blob/d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6/src/CommandFactory.php#L48-L57 |
11,282 | slickframework/console | src/CommandFactory.php | CommandFactory.filterSlickModules | protected function filterSlickModules()
{
$iterator = new \ArrayIterator($this->psr4Data);
$modules = [];
foreach ($iterator as $nameSpace => $path) {
if (preg_match('/^Slick\\\[a-z_]*\\\$/i', $nameSpace)) {
$modules[$nameSpace] = reset($path);
}
... | php | protected function filterSlickModules()
{
$iterator = new \ArrayIterator($this->psr4Data);
$modules = [];
foreach ($iterator as $nameSpace => $path) {
if (preg_match('/^Slick\\\[a-z_]*\\\$/i', $nameSpace)) {
$modules[$nameSpace] = reset($path);
}
... | [
"protected",
"function",
"filterSlickModules",
"(",
")",
"{",
"$",
"iterator",
"=",
"new",
"\\",
"ArrayIterator",
"(",
"$",
"this",
"->",
"psr4Data",
")",
";",
"$",
"modules",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"iterator",
"as",
"$",
"nameSpace",
... | Retrieves all Slick modules installed from composer
@return array | [
"Retrieves",
"all",
"Slick",
"modules",
"installed",
"from",
"composer"
] | d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6 | https://github.com/slickframework/console/blob/d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6/src/CommandFactory.php#L64-L74 |
11,283 | slickframework/console | src/CommandFactory.php | CommandFactory.getCommandClasses | protected function getCommandClasses(array $modules)
{
$classes = [];
foreach ($modules as $nameSpace => $path) {
$classes = array_merge($classes, $this->getClasses($nameSpace, $path));
}
return $classes;
} | php | protected function getCommandClasses(array $modules)
{
$classes = [];
foreach ($modules as $nameSpace => $path) {
$classes = array_merge($classes, $this->getClasses($nameSpace, $path));
}
return $classes;
} | [
"protected",
"function",
"getCommandClasses",
"(",
"array",
"$",
"modules",
")",
"{",
"$",
"classes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"nameSpace",
"=>",
"$",
"path",
")",
"{",
"$",
"classes",
"=",
"array_merge",
"(",
"$",... | Get user defined classes in "Console\Command" name space of each module
@param array $modules
@return array | [
"Get",
"user",
"defined",
"classes",
"in",
"Console",
"\\",
"Command",
"name",
"space",
"of",
"each",
"module"
] | d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6 | https://github.com/slickframework/console/blob/d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6/src/CommandFactory.php#L82-L89 |
11,284 | slickframework/console | src/CommandFactory.php | CommandFactory.getClasses | protected function getClasses($namespace, $path)
{
$classes = [];
$path = "$path/Console/Command";
if (!is_dir($path)) {
return $classes;
}
$dir = new \DirectoryIterator($path);
$classFiles = new \RegexIterator($dir, '/[a-z_]*\.php/i');
foreach ($... | php | protected function getClasses($namespace, $path)
{
$classes = [];
$path = "$path/Console/Command";
if (!is_dir($path)) {
return $classes;
}
$dir = new \DirectoryIterator($path);
$classFiles = new \RegexIterator($dir, '/[a-z_]*\.php/i');
foreach ($... | [
"protected",
"function",
"getClasses",
"(",
"$",
"namespace",
",",
"$",
"path",
")",
"{",
"$",
"classes",
"=",
"[",
"]",
";",
"$",
"path",
"=",
"\"$path/Console/Command\"",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$"... | Get classes that implements the Command interface
@param string $namespace
@param string $path
@return array | [
"Get",
"classes",
"that",
"implements",
"the",
"Command",
"interface"
] | d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6 | https://github.com/slickframework/console/blob/d354a0ab6fd5e8a2d7ad9e2bb03d8423369de2a6/src/CommandFactory.php#L99-L113 |
11,285 | tekkla/core-html | Core/Html/Controls/Group.php | Group.setHeading | public function setHeading($heading_text, $heading_size = 2)
{
$this->heading_text = $heading_text;
$this->heading_size = is_int($heading_size) ? $heading_size : 2;
return $this;
} | php | public function setHeading($heading_text, $heading_size = 2)
{
$this->heading_text = $heading_text;
$this->heading_size = is_int($heading_size) ? $heading_size : 2;
return $this;
} | [
"public",
"function",
"setHeading",
"(",
"$",
"heading_text",
",",
"$",
"heading_size",
"=",
"2",
")",
"{",
"$",
"this",
"->",
"heading_text",
"=",
"$",
"heading_text",
";",
"$",
"this",
"->",
"heading_size",
"=",
"is_int",
"(",
"$",
"heading_size",
")",
... | Set heading text and size
@param string $heading_text
@param number $heading_size
@return \Core\Html\Controls\Group | [
"Set",
"heading",
"text",
"and",
"size"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/Group.php#L91-L97 |
11,286 | wollanup/php-api-rest | src/Service/Router/Route.php | Route.setSuccessStatus | public function setSuccessStatus(int $status, string $description = ""): RouteInterface
{
$this->statuses[$status] = HttpStatus::create()
->setStatus($status)
->setDescription($description)
->setMainSuccess(true);
/**
* This middleware is an "AFTER" midd... | php | public function setSuccessStatus(int $status, string $description = ""): RouteInterface
{
$this->statuses[$status] = HttpStatus::create()
->setStatus($status)
->setDescription($description)
->setMainSuccess(true);
/**
* This middleware is an "AFTER" midd... | [
"public",
"function",
"setSuccessStatus",
"(",
"int",
"$",
"status",
",",
"string",
"$",
"description",
"=",
"\"\"",
")",
":",
"RouteInterface",
"{",
"$",
"this",
"->",
"statuses",
"[",
"$",
"status",
"]",
"=",
"HttpStatus",
"::",
"create",
"(",
")",
"->... | Set status code in case of success response
@param int $status
@param string $description
@return RouteInterface | [
"Set",
"status",
"code",
"in",
"case",
"of",
"success",
"response"
] | 185eac8a8412e5997d8e292ebd0e38787ae4b949 | https://github.com/wollanup/php-api-rest/blob/185eac8a8412e5997d8e292ebd0e38787ae4b949/src/Service/Router/Route.php#L583-L594 |
11,287 | wollanup/php-api-rest | src/Service/Router/Route.php | Route.setSuccessLocationHeader | public function setSuccessLocationHeader(
string $location,
EntityFactoryConfig $config,
int $status = 302
): RouteInterface {
return $this->addFirst(new SuccessHeaderLocationMiddleware($location, $config, $status));
} | php | public function setSuccessLocationHeader(
string $location,
EntityFactoryConfig $config,
int $status = 302
): RouteInterface {
return $this->addFirst(new SuccessHeaderLocationMiddleware($location, $config, $status));
} | [
"public",
"function",
"setSuccessLocationHeader",
"(",
"string",
"$",
"location",
",",
"EntityFactoryConfig",
"$",
"config",
",",
"int",
"$",
"status",
"=",
"302",
")",
":",
"RouteInterface",
"{",
"return",
"$",
"this",
"->",
"addFirst",
"(",
"new",
"SuccessHe... | Add a Location header to the response
Can take a placeholder to replace a variable by an entity getter
e.g.
```php
'/resource/{id}'
```
will be replaced by
```php
'/resource/' . $entity->getId()
```
@param string $location
@param EntityFactoryConfig $config
@param int $status
@return RouteInterface | [
"Add",
"a",
"Location",
"header",
"to",
"the",
"response"
] | 185eac8a8412e5997d8e292ebd0e38787ae4b949 | https://github.com/wollanup/php-api-rest/blob/185eac8a8412e5997d8e292ebd0e38787ae4b949/src/Service/Router/Route.php#L633-L639 |
11,288 | subugoe/typo3-pazpar2 | Classes/Service/Flexform.php | tx_Pazpar2_Service_Flexform.buildMenu | public function buildMenu($config)
{
$rootNodes = $this->queryForChildrenOf('NE');
$options = [['', '']];
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($rootNodes)) {
$optionTitle = $row['descr'];
$optionValue = $row['ppn'];
$options[] = [$optionTit... | php | public function buildMenu($config)
{
$rootNodes = $this->queryForChildrenOf('NE');
$options = [['', '']];
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($rootNodes)) {
$optionTitle = $row['descr'];
$optionValue = $row['ppn'];
$options[] = [$optionTit... | [
"public",
"function",
"buildMenu",
"(",
"$",
"config",
")",
"{",
"$",
"rootNodes",
"=",
"$",
"this",
"->",
"queryForChildrenOf",
"(",
"'NE'",
")",
";",
"$",
"options",
"=",
"[",
"[",
"''",
",",
"''",
"]",
"]",
";",
"while",
"(",
"$",
"row",
"=",
... | Called from Flexform to provide menu items with Neuerwerbungen subjects.
@param array $config
@return array | [
"Called",
"from",
"Flexform",
"to",
"provide",
"menu",
"items",
"with",
"Neuerwerbungen",
"subjects",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Service/Flexform.php#L36-L49 |
11,289 | bishopb/vanilla | library/core/class.module.php | Gdn_Module.FetchView | public function FetchView() {
$ViewPath = $this->FetchViewLocation();
$String = '';
ob_start();
if(is_object($this->_Sender) && isset($this->_Sender->Data)) {
$Data = $this->_Sender->Data;
} else {
$Data = array();
}
include ($ViewPath);
$String = ob_get... | php | public function FetchView() {
$ViewPath = $this->FetchViewLocation();
$String = '';
ob_start();
if(is_object($this->_Sender) && isset($this->_Sender->Data)) {
$Data = $this->_Sender->Data;
} else {
$Data = array();
}
include ($ViewPath);
$String = ob_get... | [
"public",
"function",
"FetchView",
"(",
")",
"{",
"$",
"ViewPath",
"=",
"$",
"this",
"->",
"FetchViewLocation",
"(",
")",
";",
"$",
"String",
"=",
"''",
";",
"ob_start",
"(",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"_Sender",
")",
... | Returns the xhtml for this module as a fully parsed and rendered string.
@return string | [
"Returns",
"the",
"xhtml",
"for",
"this",
"module",
"as",
"a",
"fully",
"parsed",
"and",
"rendered",
"string",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.module.php#L105-L118 |
11,290 | bishopb/vanilla | library/core/class.module.php | Gdn_Module.FetchViewLocation | public function FetchViewLocation($View = '', $ApplicationFolder = '') {
if ($View == '')
$View = strtolower($this->Name());
if (substr($View, -6) == 'module')
$View = substr($View, 0, -6);
if (substr($View, 0, 4) == 'gdn_')
$View = substr($View, 4)... | php | public function FetchViewLocation($View = '', $ApplicationFolder = '') {
if ($View == '')
$View = strtolower($this->Name());
if (substr($View, -6) == 'module')
$View = substr($View, 0, -6);
if (substr($View, 0, 4) == 'gdn_')
$View = substr($View, 4)... | [
"public",
"function",
"FetchViewLocation",
"(",
"$",
"View",
"=",
"''",
",",
"$",
"ApplicationFolder",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"View",
"==",
"''",
")",
"$",
"View",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"Name",
"(",
")",
")",
";",... | Returns the location of the view for this module in the filesystem.
@param string $View
@param string $ApplicationFolder
@return array | [
"Returns",
"the",
"location",
"of",
"the",
"view",
"for",
"this",
"module",
"in",
"the",
"filesystem",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.module.php#L128-L184 |
11,291 | ellipsephp/validation | src/Translator.php | Translator.withLabels | public function withLabels(array $labels = []): Translator
{
$labels = array_merge($this->labels, $labels);
return new Translator($labels, $this->templates);
} | php | public function withLabels(array $labels = []): Translator
{
$labels = array_merge($this->labels, $labels);
return new Translator($labels, $this->templates);
} | [
"public",
"function",
"withLabels",
"(",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"Translator",
"{",
"$",
"labels",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"labels",
",",
"$",
"labels",
")",
";",
"return",
"new",
"Translator",
"(",
"$",
"... | Return a new translator with an additional list of labels.
@param array $labels
@return \Ellipse\Validation\Translator | [
"Return",
"a",
"new",
"translator",
"with",
"an",
"additional",
"list",
"of",
"labels",
"."
] | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Translator.php#L54-L59 |
11,292 | ellipsephp/validation | src/Translator.php | Translator.withTemplates | public function withTemplates(array $templates = []): Translator
{
$templates = array_merge($this->templates, $templates);
return new Translator($this->labels, $templates);
} | php | public function withTemplates(array $templates = []): Translator
{
$templates = array_merge($this->templates, $templates);
return new Translator($this->labels, $templates);
} | [
"public",
"function",
"withTemplates",
"(",
"array",
"$",
"templates",
"=",
"[",
"]",
")",
":",
"Translator",
"{",
"$",
"templates",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"templates",
",",
"$",
"templates",
")",
";",
"return",
"new",
"Translator",
... | Return a new translator with an additional list of templates.
@param array $templates
@return \Ellipse\Validation\Translator | [
"Return",
"a",
"new",
"translator",
"with",
"an",
"additional",
"list",
"of",
"templates",
"."
] | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Translator.php#L67-L72 |
11,293 | ellipsephp/validation | src/Translator.php | Translator.getMessages | public function getMessages(string $key, array $errors = []): array
{
// when there is a template for the given key, return only this message.
if (array_key_exists($key, $this->templates)) {
return [$this->translate($this->templates[$key], ['attribute' => $key])];
}
//... | php | public function getMessages(string $key, array $errors = []): array
{
// when there is a template for the given key, return only this message.
if (array_key_exists($key, $this->templates)) {
return [$this->translate($this->templates[$key], ['attribute' => $key])];
}
//... | [
"public",
"function",
"getMessages",
"(",
"string",
"$",
"key",
",",
"array",
"$",
"errors",
"=",
"[",
"]",
")",
":",
"array",
"{",
"// when there is a template for the given key, return only this message.",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$"... | Return a list of messages from a rule key and its list of errors.
@param string $key
@param array $errors
@return array | [
"Return",
"a",
"list",
"of",
"messages",
"from",
"a",
"rule",
"key",
"and",
"its",
"list",
"of",
"errors",
"."
] | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Translator.php#L81-L105 |
11,294 | ellipsephp/validation | src/Translator.php | Translator.getTemplate | private function getTemplate(string $key, string $rule): string
{
$keyrule = implode('.', [$key, $rule]);
if (array_key_exists($keyrule, $this->templates)) {
return $this->templates[$keyrule];
}
if (array_key_exists($rule, $this->templates)) {
return $thi... | php | private function getTemplate(string $key, string $rule): string
{
$keyrule = implode('.', [$key, $rule]);
if (array_key_exists($keyrule, $this->templates)) {
return $this->templates[$keyrule];
}
if (array_key_exists($rule, $this->templates)) {
return $thi... | [
"private",
"function",
"getTemplate",
"(",
"string",
"$",
"key",
",",
"string",
"$",
"rule",
")",
":",
"string",
"{",
"$",
"keyrule",
"=",
"implode",
"(",
"'.'",
",",
"[",
"$",
"key",
",",
"$",
"rule",
"]",
")",
";",
"if",
"(",
"array_key_exists",
... | Return a template from a rule key and a rule name. First look for a
'key.rule' template, then for a 'rule' template,then for a 'default'
template and finally return the fallback template when none was found.
@param string $key
@param string $rule
@return string | [
"Return",
"a",
"template",
"from",
"a",
"rule",
"key",
"and",
"a",
"rule",
"name",
".",
"First",
"look",
"for",
"a",
"key",
".",
"rule",
"template",
"then",
"for",
"a",
"rule",
"template",
"then",
"for",
"a",
"default",
"template",
"and",
"finally",
"r... | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Translator.php#L116-L139 |
11,295 | ellipsephp/validation | src/Translator.php | Translator.translate | private function translate(string $template, array $parameters): string
{
$placeholders = array_map([$this, 'getPlaceholder'], array_keys($parameters));
$replacements = array_map([$this, 'getTranslatedValue'], array_values($parameters));
return str_replace($placeholders, $replacements, $tem... | php | private function translate(string $template, array $parameters): string
{
$placeholders = array_map([$this, 'getPlaceholder'], array_keys($parameters));
$replacements = array_map([$this, 'getTranslatedValue'], array_values($parameters));
return str_replace($placeholders, $replacements, $tem... | [
"private",
"function",
"translate",
"(",
"string",
"$",
"template",
",",
"array",
"$",
"parameters",
")",
":",
"string",
"{",
"$",
"placeholders",
"=",
"array_map",
"(",
"[",
"$",
"this",
",",
"'getPlaceholder'",
"]",
",",
"array_keys",
"(",
"$",
"paramete... | Return a template with placeholders replaced by translated parameters
values.
@param string $template
@param array $parameters
@return string | [
"Return",
"a",
"template",
"with",
"placeholders",
"replaced",
"by",
"translated",
"parameters",
"values",
"."
] | 5a7e11807099165ff6217bf8c38df4b21d99599d | https://github.com/ellipsephp/validation/blob/5a7e11807099165ff6217bf8c38df4b21d99599d/src/Translator.php#L149-L155 |
11,296 | try-php/predict-is | src/PredictIsTrait.php | PredictIsTrait.is | public function is($actual, $expected)
{
if (!is_scalar($actual) || !is_scalar($expected)) {
throw new \Exception("'try/predict-is' can only compare scalar values. 'try/predict' for complex predictions.");
}
if ($actual !== $expected) {
throw new \Exception("Expected '$expected', but got '$actual'.");
}... | php | public function is($actual, $expected)
{
if (!is_scalar($actual) || !is_scalar($expected)) {
throw new \Exception("'try/predict-is' can only compare scalar values. 'try/predict' for complex predictions.");
}
if ($actual !== $expected) {
throw new \Exception("Expected '$expected', but got '$actual'.");
}... | [
"public",
"function",
"is",
"(",
"$",
"actual",
",",
"$",
"expected",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"actual",
")",
"||",
"!",
"is_scalar",
"(",
"$",
"expected",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"'try/predict... | Method to test scalar values if they equal one another
@param mixed $actual
@param mixed $expected
@throws \Exception | [
"Method",
"to",
"test",
"scalar",
"values",
"if",
"they",
"equal",
"one",
"another"
] | 2c2b0652712b2a62afb8a282b6d90a48493de96d | https://github.com/try-php/predict-is/blob/2c2b0652712b2a62afb8a282b6d90a48493de96d/src/PredictIsTrait.php#L12-L21 |
11,297 | FrenzelGmbH/appcommon | commands/SeedController.php | SeedController.actionSeed | public function actionSeed()
{
$tx = $this->db->beginTransaction();
try
{
$this->seed();
$tx->commit();
}
catch (Exception $e)
{
throw new Exception($e->getMessage());
$tx->rollback();
}
} | php | public function actionSeed()
{
$tx = $this->db->beginTransaction();
try
{
$this->seed();
$tx->commit();
}
catch (Exception $e)
{
throw new Exception($e->getMessage());
$tx->rollback();
}
} | [
"public",
"function",
"actionSeed",
"(",
")",
"{",
"$",
"tx",
"=",
"$",
"this",
"->",
"db",
"->",
"beginTransaction",
"(",
")",
";",
"try",
"{",
"$",
"this",
"->",
"seed",
"(",
")",
";",
"$",
"tx",
"->",
"commit",
"(",
")",
";",
"}",
"catch",
"... | This command is used when typing yiic seed. Demo data should be created here | [
"This",
"command",
"is",
"used",
"when",
"typing",
"yiic",
"seed",
".",
"Demo",
"data",
"should",
"be",
"created",
"here"
] | d6d137b4c92b53832ce4b2e517644ed9fb545b7a | https://github.com/FrenzelGmbH/appcommon/blob/d6d137b4c92b53832ce4b2e517644ed9fb545b7a/commands/SeedController.php#L65-L78 |
11,298 | FiveLab/Resource | src/Serializer/Context/MutableSerializationContext.php | MutableSerializationContext.set | public function set(string $key, $value): MutableSerializationContext
{
$cloned = clone $this;
$cloned->payload[$key] = $value;
return $cloned;
} | php | public function set(string $key, $value): MutableSerializationContext
{
$cloned = clone $this;
$cloned->payload[$key] = $value;
return $cloned;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"MutableSerializationContext",
"{",
"$",
"cloned",
"=",
"clone",
"$",
"this",
";",
"$",
"cloned",
"->",
"payload",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"ret... | Set the new key-value to context
@param string $key
@param mixed $value
@return MutableSerializationContext | [
"Set",
"the",
"new",
"key",
"-",
"value",
"to",
"context"
] | f2864924212dd4e2d1a3e7a1ad8a863d9db26127 | https://github.com/FiveLab/Resource/blob/f2864924212dd4e2d1a3e7a1ad8a863d9db26127/src/Serializer/Context/MutableSerializationContext.php#L31-L38 |
11,299 | FiveLab/Resource | src/Serializer/Context/MutableSerializationContext.php | MutableSerializationContext.merge | public function merge(ResourceSerializationContext $context): MutableSerializationContext
{
$cloned = clone $this;
$cloned->payload = array_merge($cloned->payload, $context->payload);
return $cloned;
} | php | public function merge(ResourceSerializationContext $context): MutableSerializationContext
{
$cloned = clone $this;
$cloned->payload = array_merge($cloned->payload, $context->payload);
return $cloned;
} | [
"public",
"function",
"merge",
"(",
"ResourceSerializationContext",
"$",
"context",
")",
":",
"MutableSerializationContext",
"{",
"$",
"cloned",
"=",
"clone",
"$",
"this",
";",
"$",
"cloned",
"->",
"payload",
"=",
"array_merge",
"(",
"$",
"cloned",
"->",
"payl... | Merge serialization context
@param ResourceSerializationContext $context
@return MutableSerializationContext | [
"Merge",
"serialization",
"context"
] | f2864924212dd4e2d1a3e7a1ad8a863d9db26127 | https://github.com/FiveLab/Resource/blob/f2864924212dd4e2d1a3e7a1ad8a863d9db26127/src/Serializer/Context/MutableSerializationContext.php#L47-L54 |
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.