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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,100 | FlexPress/component-shortcode | src/FlexPress/Components/Shortcode/Helper.php | Helper.registerShortcodes | public function registerShortcodes()
{
if (!function_exists('add_shortcode')) {
return;
}
$this->shortcodes->rewind();
while ($this->shortcodes->valid()) {
$shortcode = $this->shortcodes->current();
add_shortcode($shortcode->getName(), array($sh... | php | public function registerShortcodes()
{
if (!function_exists('add_shortcode')) {
return;
}
$this->shortcodes->rewind();
while ($this->shortcodes->valid()) {
$shortcode = $this->shortcodes->current();
add_shortcode($shortcode->getName(), array($sh... | [
"public",
"function",
"registerShortcodes",
"(",
")",
"{",
"if",
"(",
"!",
"function_exists",
"(",
"'add_shortcode'",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"shortcodes",
"->",
"rewind",
"(",
")",
";",
"while",
"(",
"$",
"this",
"->",
"s... | Registers all shortcodes added
@author Tim Perry | [
"Registers",
"all",
"shortcodes",
"added"
] | 6da0e06f3a60650988e85fe78e562be6a9f8b0c5 | https://github.com/FlexPress/component-shortcode/blob/6da0e06f3a60650988e85fe78e562be6a9f8b0c5/src/FlexPress/Components/Shortcode/Helper.php#L42-L58 |
3,101 | Niirrty/Niirrty.Observer | src/Observable.php | Observable.subscribe | public function subscribe( IObserver $observer ) : IObservable
{
if ( ! \in_array( $observer, $this->_observers, true ) )
{
$this->_observers[] = $observer;
}
return $this;
} | php | public function subscribe( IObserver $observer ) : IObservable
{
if ( ! \in_array( $observer, $this->_observers, true ) )
{
$this->_observers[] = $observer;
}
return $this;
} | [
"public",
"function",
"subscribe",
"(",
"IObserver",
"$",
"observer",
")",
":",
"IObservable",
"{",
"if",
"(",
"!",
"\\",
"in_array",
"(",
"$",
"observer",
",",
"$",
"this",
"->",
"_observers",
",",
"true",
")",
")",
"{",
"$",
"this",
"->",
"_observers... | Subscribe a new observer to this observable implementation.
@param \Niirrty\Observer\IObserver $observer
@return \Niirrty\Observer\IObservable | [
"Subscribe",
"a",
"new",
"observer",
"to",
"this",
"observable",
"implementation",
"."
] | fc019a97b8102b14ae5c5c3302e8828e09940a79 | https://github.com/Niirrty/Niirrty.Observer/blob/fc019a97b8102b14ae5c5c3302e8828e09940a79/src/Observable.php#L70-L80 |
3,102 | Niirrty/Niirrty.Observer | src/Observable.php | Observable.notify | public function notify( $extras = null ) : IObservable
{
if ( 1 < \count( $this->_cache ) )
{
$this->_cache[] = $extras;
}
else
{
$this->_cache = $extras;
}
foreach ( $this->_observers as $ob )
{
$ob->onUpdate( $this, $this->_cache );
... | php | public function notify( $extras = null ) : IObservable
{
if ( 1 < \count( $this->_cache ) )
{
$this->_cache[] = $extras;
}
else
{
$this->_cache = $extras;
}
foreach ( $this->_observers as $ob )
{
$ob->onUpdate( $this, $this->_cache );
... | [
"public",
"function",
"notify",
"(",
"$",
"extras",
"=",
"null",
")",
":",
"IObservable",
"{",
"if",
"(",
"1",
"<",
"\\",
"count",
"(",
"$",
"this",
"->",
"_cache",
")",
")",
"{",
"$",
"this",
"->",
"_cache",
"[",
"]",
"=",
"$",
"extras",
";",
... | Notify all subscribed observers
@param mixed $extras
@return \Niirrty\Observer\IObservable | [
"Notify",
"all",
"subscribed",
"observers"
] | fc019a97b8102b14ae5c5c3302e8828e09940a79 | https://github.com/Niirrty/Niirrty.Observer/blob/fc019a97b8102b14ae5c5c3302e8828e09940a79/src/Observable.php#L113-L134 |
3,103 | WasabiLib/wasabilib | src/WasabiLib/Wizard/Wizard.php | Wizard.isFirstCall | public function isFirstCall() {
if (!$this->stepAction && $this->stepCollection->isFirst($this->stepCollectionIterator->current()))
return true;
else return false;
} | php | public function isFirstCall() {
if (!$this->stepAction && $this->stepCollection->isFirst($this->stepCollectionIterator->current()))
return true;
else return false;
} | [
"public",
"function",
"isFirstCall",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stepAction",
"&&",
"$",
"this",
"->",
"stepCollection",
"->",
"isFirst",
"(",
"$",
"this",
"->",
"stepCollectionIterator",
"->",
"current",
"(",
")",
")",
")",
"retur... | checks if the wizard is first time called
@return bool | [
"checks",
"if",
"the",
"wizard",
"is",
"first",
"time",
"called"
] | 5a55bfbea6b6ee10222c521112d469015db170b7 | https://github.com/WasabiLib/wasabilib/blob/5a55bfbea6b6ee10222c521112d469015db170b7/src/WasabiLib/Wizard/Wizard.php#L207-L211 |
3,104 | WasabiLib/wasabilib | src/WasabiLib/Wizard/Wizard.php | Wizard.process | public function process() {
/* @var $currentStep StepController */
/* @var $ancestorStep StepController */
/* @var $descendantStep StepController */
$currentStep = $this->stepCollectionIterator->current();
if ($this->stepAction == self::WIZARD_STEP_ACTION_PREV && !$this->stepColl... | php | public function process() {
/* @var $currentStep StepController */
/* @var $ancestorStep StepController */
/* @var $descendantStep StepController */
$currentStep = $this->stepCollectionIterator->current();
if ($this->stepAction == self::WIZARD_STEP_ACTION_PREV && !$this->stepColl... | [
"public",
"function",
"process",
"(",
")",
"{",
"/* @var $currentStep StepController */",
"/* @var $ancestorStep StepController */",
"/* @var $descendantStep StepController */",
"$",
"currentStep",
"=",
"$",
"this",
"->",
"stepCollectionIterator",
"->",
"current",
"(",
")",
"... | processing the step | [
"processing",
"the",
"step"
] | 5a55bfbea6b6ee10222c521112d469015db170b7 | https://github.com/WasabiLib/wasabilib/blob/5a55bfbea6b6ee10222c521112d469015db170b7/src/WasabiLib/Wizard/Wizard.php#L216-L246 |
3,105 | WasabiLib/wasabilib | src/WasabiLib/Wizard/Wizard.php | Wizard.createBreadcrumbItems | private function createBreadcrumbItems(StepController $step) {
$viewModel = new ViewModel();
$viewModel->setTemplate($this->breadcrumbTemplatePath);
$viewModel->setVariable("breadcrumbTitle", $step->getBreadCrumbTitle());
$viewModel->setVariable("stepNumber", $step->getBreadCrumbTitle())... | php | private function createBreadcrumbItems(StepController $step) {
$viewModel = new ViewModel();
$viewModel->setTemplate($this->breadcrumbTemplatePath);
$viewModel->setVariable("breadcrumbTitle", $step->getBreadCrumbTitle());
$viewModel->setVariable("stepNumber", $step->getBreadCrumbTitle())... | [
"private",
"function",
"createBreadcrumbItems",
"(",
"StepController",
"$",
"step",
")",
"{",
"$",
"viewModel",
"=",
"new",
"ViewModel",
"(",
")",
";",
"$",
"viewModel",
"->",
"setTemplate",
"(",
"$",
"this",
"->",
"breadcrumbTemplatePath",
")",
";",
"$",
"v... | generate one elementView for the breadcrumb path
@param StepController $step
@return ViewModel | [
"generate",
"one",
"elementView",
"for",
"the",
"breadcrumb",
"path"
] | 5a55bfbea6b6ee10222c521112d469015db170b7 | https://github.com/WasabiLib/wasabilib/blob/5a55bfbea6b6ee10222c521112d469015db170b7/src/WasabiLib/Wizard/Wizard.php#L253-L260 |
3,106 | WasabiLib/wasabilib | src/WasabiLib/Wizard/Wizard.php | Wizard.initStepViewModel | private function initStepViewModel() {
#first start of Wizard
#load template from first step
$currentStep = $this->stepCollectionIterator->current();
$isFirstStep = $this->getSteps()->isFirst($currentStep);
if ($isFirstStep) {
$firstStep = $this->getSteps()->getFirst(... | php | private function initStepViewModel() {
#first start of Wizard
#load template from first step
$currentStep = $this->stepCollectionIterator->current();
$isFirstStep = $this->getSteps()->isFirst($currentStep);
if ($isFirstStep) {
$firstStep = $this->getSteps()->getFirst(... | [
"private",
"function",
"initStepViewModel",
"(",
")",
"{",
"#first start of Wizard",
"#load template from first step",
"$",
"currentStep",
"=",
"$",
"this",
"->",
"stepCollectionIterator",
"->",
"current",
"(",
")",
";",
"$",
"isFirstStep",
"=",
"$",
"this",
"->",
... | init the ViewModel for the wizard
@throws \Exception | [
"init",
"the",
"ViewModel",
"for",
"the",
"wizard"
] | 5a55bfbea6b6ee10222c521112d469015db170b7 | https://github.com/WasabiLib/wasabilib/blob/5a55bfbea6b6ee10222c521112d469015db170b7/src/WasabiLib/Wizard/Wizard.php#L292-L330 |
3,107 | WasabiLib/wasabilib | src/WasabiLib/Wizard/Wizard.php | Wizard.toggleStandardWizardButtons | private function toggleStandardWizardButtons($show = true) {
$this->prevButtonViewModel->setVariable("btnClass_extend", (!$show ? "hide" : ""), true);
$this->nextButtonViewModel->setVariable("btnClass_extend", (!$show ? "hide" : ""), true);
} | php | private function toggleStandardWizardButtons($show = true) {
$this->prevButtonViewModel->setVariable("btnClass_extend", (!$show ? "hide" : ""), true);
$this->nextButtonViewModel->setVariable("btnClass_extend", (!$show ? "hide" : ""), true);
} | [
"private",
"function",
"toggleStandardWizardButtons",
"(",
"$",
"show",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"prevButtonViewModel",
"->",
"setVariable",
"(",
"\"btnClass_extend\"",
",",
"(",
"!",
"$",
"show",
"?",
"\"hide\"",
":",
"\"\"",
")",
",",
"tru... | toggle the visibility of the wizardbutton depending on wether the step is the last one or not
@param bool $show
@return ResponseConfigurator | [
"toggle",
"the",
"visibility",
"of",
"the",
"wizardbutton",
"depending",
"on",
"wether",
"the",
"step",
"is",
"the",
"last",
"one",
"or",
"not"
] | 5a55bfbea6b6ee10222c521112d469015db170b7 | https://github.com/WasabiLib/wasabilib/blob/5a55bfbea6b6ee10222c521112d469015db170b7/src/WasabiLib/Wizard/Wizard.php#L373-L376 |
3,108 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertLooselyEquals | public static function assertLooselyEquals($actual, $expected, Throwable $exception)
{
/** @noinspection TypeUnsafeComparisonInspection This assertion is wanted to be unsafe type. */
static::makeAssertion($actual == $expected, $exception);
return $actual;
} | php | public static function assertLooselyEquals($actual, $expected, Throwable $exception)
{
/** @noinspection TypeUnsafeComparisonInspection This assertion is wanted to be unsafe type. */
static::makeAssertion($actual == $expected, $exception);
return $actual;
} | [
"public",
"static",
"function",
"assertLooselyEquals",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
"{",
"/** @noinspection TypeUnsafeComparisonInspection This assertion is wanted to be unsafe type. */",
"static",
"::",
"makeAssertion",
"... | Asserts that the given values are loosely equals.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return mixed The actual value tested. | [
"Asserts",
"that",
"the",
"given",
"values",
"are",
"loosely",
"equals",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L27-L32 |
3,109 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertEquals | public static function assertEquals($actual, $expected, Throwable $exception)
{
static::makeAssertion($actual === $expected, $exception);
return $actual;
} | php | public static function assertEquals($actual, $expected, Throwable $exception)
{
static::makeAssertion($actual === $expected, $exception);
return $actual;
} | [
"public",
"static",
"function",
"assertEquals",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
"{",
"static",
"::",
"makeAssertion",
"(",
"$",
"actual",
"===",
"$",
"expected",
",",
"$",
"exception",
")",
";",
"return",
... | Asserts that the given values are strictly equals.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return mixed The actual value tested. | [
"Asserts",
"that",
"the",
"given",
"values",
"are",
"strictly",
"equals",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L42-L46 |
3,110 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertLooselyNotEquals | public static function assertLooselyNotEquals($actual, $expected, Throwable $exception)
{
/** @noinspection TypeUnsafeComparisonInspection This assertion is wanted to be unsafe type. */
static::makeAssertion($actual != $expected, $exception);
return $actual;
} | php | public static function assertLooselyNotEquals($actual, $expected, Throwable $exception)
{
/** @noinspection TypeUnsafeComparisonInspection This assertion is wanted to be unsafe type. */
static::makeAssertion($actual != $expected, $exception);
return $actual;
} | [
"public",
"static",
"function",
"assertLooselyNotEquals",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
"{",
"/** @noinspection TypeUnsafeComparisonInspection This assertion is wanted to be unsafe type. */",
"static",
"::",
"makeAssertion",
... | Asserts that the given values are loosely not equals.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return mixed The actual value tested. | [
"Asserts",
"that",
"the",
"given",
"values",
"are",
"loosely",
"not",
"equals",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L56-L61 |
3,111 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertNotEquals | public static function assertNotEquals($actual, $expected, Throwable $exception)
{
static::makeAssertion($actual !== $expected, $exception);
return $actual;
} | php | public static function assertNotEquals($actual, $expected, Throwable $exception)
{
static::makeAssertion($actual !== $expected, $exception);
return $actual;
} | [
"public",
"static",
"function",
"assertNotEquals",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
"{",
"static",
"::",
"makeAssertion",
"(",
"$",
"actual",
"!==",
"$",
"expected",
",",
"$",
"exception",
")",
";",
"return... | Asserts that the given values are strictly not equals.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return mixed The actual value tested. | [
"Asserts",
"that",
"the",
"given",
"values",
"are",
"strictly",
"not",
"equals",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L71-L75 |
3,112 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertGreaterThanOrEquals | public static function assertGreaterThanOrEquals($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual >= $expected, $exception);
return true;
} | php | public static function assertGreaterThanOrEquals($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual >= $expected, $exception);
return true;
} | [
"public",
"static",
"function",
"assertGreaterThanOrEquals",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"$",
"actual",
">=",
"$",
"expected",
",",
"$",
"exception... | Asserts that the given actual value is greater than or equals the expected value.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"actual",
"value",
"is",
"greater",
"than",
"or",
"equals",
"the",
"expected",
"value",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L85-L89 |
3,113 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertGreaterThan | public static function assertGreaterThan($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual > $expected, $exception);
return true;
} | php | public static function assertGreaterThan($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual > $expected, $exception);
return true;
} | [
"public",
"static",
"function",
"assertGreaterThan",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"$",
"actual",
">",
"$",
"expected",
",",
"$",
"exception",
")",... | Asserts that the given actual value is strictly greater than the expected value.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"actual",
"value",
"is",
"strictly",
"greater",
"than",
"the",
"expected",
"value",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L99-L103 |
3,114 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertLessThanOrEquals | public static function assertLessThanOrEquals($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual <= $expected, $exception);
return true;
} | php | public static function assertLessThanOrEquals($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual <= $expected, $exception);
return true;
} | [
"public",
"static",
"function",
"assertLessThanOrEquals",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"$",
"actual",
"<=",
"$",
"expected",
",",
"$",
"exception",
... | Asserts that the given actual value is less than or equals the expected value.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"actual",
"value",
"is",
"less",
"than",
"or",
"equals",
"the",
"expected",
"value",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L113-L117 |
3,115 | niconoe-/asserts | src/Asserts/Categories/AssertComparisonTrait.php | AssertComparisonTrait.assertLessThan | public static function assertLessThan($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual < $expected, $exception);
return true;
} | php | public static function assertLessThan($actual, $expected, Throwable $exception): bool
{
static::makeAssertion($actual < $expected, $exception);
return true;
} | [
"public",
"static",
"function",
"assertLessThan",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"Throwable",
"$",
"exception",
")",
":",
"bool",
"{",
"static",
"::",
"makeAssertion",
"(",
"$",
"actual",
"<",
"$",
"expected",
",",
"$",
"exception",
")",
... | Asserts that the given actual value is strictly less than the expected value.
@param mixed $actual The actual value to test.
@param mixed $expected The expected value.
@param Throwable $exception The exception to throw if the assertion fails.
@return bool | [
"Asserts",
"that",
"the",
"given",
"actual",
"value",
"is",
"strictly",
"less",
"than",
"the",
"expected",
"value",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertComparisonTrait.php#L127-L131 |
3,116 | sios13/simox | src/Flash.php | Flash.output | public function output( $type = null )
{
$session = $this->_di->getService( "session" );
/**
* Get the messages from the session
*/
$messages = $session->get( "__flash__" );
/**
* If there are no messages to output -> exit early
*/
if ( $messages == null )
... | php | public function output( $type = null )
{
$session = $this->_di->getService( "session" );
/**
* Get the messages from the session
*/
$messages = $session->get( "__flash__" );
/**
* If there are no messages to output -> exit early
*/
if ( $messages == null )
... | [
"public",
"function",
"output",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"_di",
"->",
"getService",
"(",
"\"session\"",
")",
";",
"/**\r\n * Get the messages from the session\r\n */",
"$",
"messages",
"=",
... | Returns the messages | [
"Returns",
"the",
"messages"
] | 8be964949ef179aba7eceb3fc6439815a1af2ad2 | https://github.com/sios13/simox/blob/8be964949ef179aba7eceb3fc6439815a1af2ad2/src/Flash.php#L32-L85 |
3,117 | webriq/core | module/Core/src/Grid/Core/Controller/IndexController.php | IndexController.contentUriAction | public function contentUriAction()
{
$actual = $this->getSubDomainModel()
->findActual();
if ( empty( $actual ) )
{
$this->getResponse()
->setStatusCode( 404 );
return;
}
$uri = $this->params()
... | php | public function contentUriAction()
{
$actual = $this->getSubDomainModel()
->findActual();
if ( empty( $actual ) )
{
$this->getResponse()
->setStatusCode( 404 );
return;
}
$uri = $this->params()
... | [
"public",
"function",
"contentUriAction",
"(",
")",
"{",
"$",
"actual",
"=",
"$",
"this",
"->",
"getSubDomainModel",
"(",
")",
"->",
"findActual",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"actual",
")",
")",
"{",
"$",
"this",
"->",
"getResponse",
... | Content-uri action | [
"Content",
"-",
"uri",
"action"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Controller/IndexController.php#L104-L178 |
3,118 | jaswdr/mock | src/Jaschweder/Mock/Object.php | Object.method | public function method($name)
{
$method = new Method($name);
$this->container->put($name, $method);
return $method;
} | php | public function method($name)
{
$method = new Method($name);
$this->container->put($name, $method);
return $method;
} | [
"public",
"function",
"method",
"(",
"$",
"name",
")",
"{",
"$",
"method",
"=",
"new",
"Method",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"container",
"->",
"put",
"(",
"$",
"name",
",",
"$",
"method",
")",
";",
"return",
"$",
"method",
";"... | Define a new mock method.
@param string $name The name of the method
@return Method | [
"Define",
"a",
"new",
"mock",
"method",
"."
] | 869377802d39d6628611f8868a3fc877398ef72d | https://github.com/jaswdr/mock/blob/869377802d39d6628611f8868a3fc877398ef72d/src/Jaschweder/Mock/Object.php#L29-L35 |
3,119 | unyx/console | input/formats/parsers/Argv.php | Argv.parse | public function parse(interfaces\Tokens $input, values\Arguments $arguments, values\Options $options) : void
{
$isParsingOptions = true;
// Grab all tokens. Can't iterate directly over the Collection as we need to easily determine
// which tokens are left to be processed (thus array_shift()... | php | public function parse(interfaces\Tokens $input, values\Arguments $arguments, values\Options $options) : void
{
$isParsingOptions = true;
// Grab all tokens. Can't iterate directly over the Collection as we need to easily determine
// which tokens are left to be processed (thus array_shift()... | [
"public",
"function",
"parse",
"(",
"interfaces",
"\\",
"Tokens",
"$",
"input",
",",
"values",
"\\",
"Arguments",
"$",
"arguments",
",",
"values",
"\\",
"Options",
"$",
"options",
")",
":",
"void",
"{",
"$",
"isParsingOptions",
"=",
"true",
";",
"// Grab a... | Fill the given Input Arguments and Options based on their definitions and the Argv input given.
@param values\Arguments $arguments The Input Arguments to fill.
@param values\Options $options The Input Options to fill.
@param tokens\Argv $input The Argv tokens to be parsed. | [
"Fill",
"the",
"given",
"Input",
"Arguments",
"and",
"Options",
"based",
"on",
"their",
"definitions",
"and",
"the",
"Argv",
"input",
"given",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/input/formats/parsers/Argv.php#L30-L65 |
3,120 | unyx/console | input/formats/parsers/Argv.php | Argv.parseLongOption | protected function parseLongOption(string $token, values\Options $options, array& $input) : void
{
// Remove the two starting hyphens.
$name = substr($token, 2);
$value = null;
// If the token contains a value for the option, we need to split the token accordingly.
if (fals... | php | protected function parseLongOption(string $token, values\Options $options, array& $input) : void
{
// Remove the two starting hyphens.
$name = substr($token, 2);
$value = null;
// If the token contains a value for the option, we need to split the token accordingly.
if (fals... | [
"protected",
"function",
"parseLongOption",
"(",
"string",
"$",
"token",
",",
"values",
"\\",
"Options",
"$",
"options",
",",
"array",
"&",
"$",
"input",
")",
":",
"void",
"{",
"// Remove the two starting hyphens.",
"$",
"name",
"=",
"substr",
"(",
"$",
"tok... | Parses the given token as a long option and adds it to the Options set.
@param string $token The token to parse.
@param values\Options $options The collection of Options being filled.
@param array& $input A reference to the argv input array. | [
"Parses",
"the",
"given",
"token",
"as",
"a",
"long",
"option",
"and",
"adds",
"it",
"to",
"the",
"Options",
"set",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/input/formats/parsers/Argv.php#L74-L101 |
3,121 | unyx/console | input/formats/parsers/Argv.php | Argv.parseShortOption | protected function parseShortOption($token, values\Options $options, array& $input) : void
{
// Remove the starting hyphen.
// If it's just a hyphen and nothing else, ignore it since it's most likely a mistype.
if (empty($shortcut = substr($token, 1))) {
return;
}
... | php | protected function parseShortOption($token, values\Options $options, array& $input) : void
{
// Remove the starting hyphen.
// If it's just a hyphen and nothing else, ignore it since it's most likely a mistype.
if (empty($shortcut = substr($token, 1))) {
return;
}
... | [
"protected",
"function",
"parseShortOption",
"(",
"$",
"token",
",",
"values",
"\\",
"Options",
"$",
"options",
",",
"array",
"&",
"$",
"input",
")",
":",
"void",
"{",
"// Remove the starting hyphen.",
"// If it's just a hyphen and nothing else, ignore it since it's most ... | Parses the given token as a short option and adds it to the Options set.
@param string $token The token to parse.
@param values\Options $options The collection of Options being filled.
@param array& $input A reference to the argv input array. | [
"Parses",
"the",
"given",
"token",
"as",
"a",
"short",
"option",
"and",
"adds",
"it",
"to",
"the",
"Options",
"set",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/input/formats/parsers/Argv.php#L110-L121 |
3,122 | unyx/console | input/formats/parsers/Argv.php | Argv.resolveShortOptionSet | private function resolveShortOptionSet(string $shortcut, definitions\Options $definitions) : array
{
$length = strlen($shortcut);
$result = [];
// Loop through the string, character by character.
for ($i = 0; $i < $length; $i++) {
$definition = $definitions->getByShortcu... | php | private function resolveShortOptionSet(string $shortcut, definitions\Options $definitions) : array
{
$length = strlen($shortcut);
$result = [];
// Loop through the string, character by character.
for ($i = 0; $i < $length; $i++) {
$definition = $definitions->getByShortcu... | [
"private",
"function",
"resolveShortOptionSet",
"(",
"string",
"$",
"shortcut",
",",
"definitions",
"\\",
"Options",
"$",
"definitions",
")",
":",
"array",
"{",
"$",
"length",
"=",
"strlen",
"(",
"$",
"shortcut",
")",
";",
"$",
"result",
"=",
"[",
"]",
"... | Takes a set of short options contained in a string and resolves them to full options and their
values, depending on the Definitions given.
@param string $shortcut The short option(s) to resolve.
@param definitions\Options $definitions The Options Definition.
@return array ... | [
"Takes",
"a",
"set",
"of",
"short",
"options",
"contained",
"in",
"a",
"string",
"and",
"resolves",
"them",
"to",
"full",
"options",
"and",
"their",
"values",
"depending",
"on",
"the",
"Definitions",
"given",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/input/formats/parsers/Argv.php#L162-L181 |
3,123 | mtils/collection | src/Collection/Dictionary.php | Dictionary.update | public function update($other){
if(is_array($other)){
$this->_array = $other;
return $this;
}
$this->_array = array();
foreach($other as $key=>$value){
$this->_array[$key] = $value;
}
return $this;
} | php | public function update($other){
if(is_array($other)){
$this->_array = $other;
return $this;
}
$this->_array = array();
foreach($other as $key=>$value){
$this->_array[$key] = $value;
}
return $this;
} | [
"public",
"function",
"update",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"other",
")",
")",
"{",
"$",
"this",
"->",
"_array",
"=",
"$",
"other",
";",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"_array",
"=",
"array",... | Updates the values of this hash with the values of other.
@param Traversable: $other
@return Dictionary | [
"Updates",
"the",
"values",
"of",
"this",
"hash",
"with",
"the",
"values",
"of",
"other",
"."
] | 186f8a6cc68fef1babc486438aa6d6c643186cc8 | https://github.com/mtils/collection/blob/186f8a6cc68fef1babc486438aa6d6c643186cc8/src/Collection/Dictionary.php#L270-L280 |
3,124 | mtils/collection | src/Collection/Dictionary.php | Dictionary.fromKeys | public static function fromKeys($keys){
$hash = new Dictionary();
foreach($keys as $key){
$hash[$key] = NULL;
}
return $hash;
} | php | public static function fromKeys($keys){
$hash = new Dictionary();
foreach($keys as $key){
$hash[$key] = NULL;
}
return $hash;
} | [
"public",
"static",
"function",
"fromKeys",
"(",
"$",
"keys",
")",
"{",
"$",
"hash",
"=",
"new",
"Dictionary",
"(",
")",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"hash",
"[",
"$",
"key",
"]",
"=",
"NULL",
";",
"}",
"re... | Constructs a Hash with the passed keys
@param Traversable $keys
@return Dictionary | [
"Constructs",
"a",
"Hash",
"with",
"the",
"passed",
"keys"
] | 186f8a6cc68fef1babc486438aa6d6c643186cc8 | https://github.com/mtils/collection/blob/186f8a6cc68fef1babc486438aa6d6c643186cc8/src/Collection/Dictionary.php#L297-L303 |
3,125 | php-rest-server/core | src/Core/General/ActionInfo.php | ActionInfo.getAllowedMethods | public function getAllowedMethods()
{
$result = [];
if ($this->get) {
$result[] = HttpMethods::GET;
}
if ($this->post) {
$result[] = HttpMethods::POST;
}
if ($this->put) {
$result[] = HttpMethods::PUT;
}
if ($this->p... | php | public function getAllowedMethods()
{
$result = [];
if ($this->get) {
$result[] = HttpMethods::GET;
}
if ($this->post) {
$result[] = HttpMethods::POST;
}
if ($this->put) {
$result[] = HttpMethods::PUT;
}
if ($this->p... | [
"public",
"function",
"getAllowedMethods",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"get",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"HttpMethods",
"::",
"GET",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"post",
... | Get array of allowed methods for this action
@return string[] | [
"Get",
"array",
"of",
"allowed",
"methods",
"for",
"this",
"action"
] | 4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888 | https://github.com/php-rest-server/core/blob/4d1ee0d4b6bd7d170cf1ec924a8b743b5d486888/src/Core/General/ActionInfo.php#L122-L148 |
3,126 | interactivesolutions/honeycomb-acl | src/app/http/controllers/HCAuthController.php | HCAuthController.login | public function login(Request $request)
{
$this->validateLogin($request);
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these req... | php | public function login(Request $request)
{
$this->validateLogin($request);
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these req... | [
"public",
"function",
"login",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"validateLogin",
"(",
"$",
"request",
")",
";",
"// If the class is using the ThrottlesLogins trait, we can automatically throttle",
"// the login attempts for this application. We'll ke... | Function which login users
@param Request $request
@return string | [
"Function",
"which",
"login",
"users"
] | 6c73d7d1c5d17ef730593e03386236a746bab12c | https://github.com/interactivesolutions/honeycomb-acl/blob/6c73d7d1c5d17ef730593e03386236a746bab12c/src/app/http/controllers/HCAuthController.php#L69-L108 |
3,127 | interactivesolutions/honeycomb-acl | src/app/http/controllers/HCAuthController.php | HCAuthController.showActivation | public function showActivation(string $token)
{
$message = null;
$tokenRecord = DB::table('hc_users_activations')->where('token', $token)->first();
if( is_null($tokenRecord) ) {
$message = trans('HCACL::users.activation.token_not_exists');
} else {
if( strto... | php | public function showActivation(string $token)
{
$message = null;
$tokenRecord = DB::table('hc_users_activations')->where('token', $token)->first();
if( is_null($tokenRecord) ) {
$message = trans('HCACL::users.activation.token_not_exists');
} else {
if( strto... | [
"public",
"function",
"showActivation",
"(",
"string",
"$",
"token",
")",
"{",
"$",
"message",
"=",
"null",
";",
"$",
"tokenRecord",
"=",
"DB",
"::",
"table",
"(",
"'hc_users_activations'",
")",
"->",
"where",
"(",
"'token'",
",",
"$",
"token",
")",
"->"... | Show activation page
@param $token
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"Show",
"activation",
"page"
] | 6c73d7d1c5d17ef730593e03386236a746bab12c | https://github.com/interactivesolutions/honeycomb-acl/blob/6c73d7d1c5d17ef730593e03386236a746bab12c/src/app/http/controllers/HCAuthController.php#L221-L236 |
3,128 | DripsPHP/HTTP | src/Response.php | Response.send | public function send()
{
if (!static::isSent()) {
static::call('send', $this);
foreach ($this->headers as $header => $value) {
$this->setHttpHeader($header, $value);
}
http_response_code($this->status);
echo $this->body;
... | php | public function send()
{
if (!static::isSent()) {
static::call('send', $this);
foreach ($this->headers as $header => $value) {
$this->setHttpHeader($header, $value);
}
http_response_code($this->status);
echo $this->body;
... | [
"public",
"function",
"send",
"(",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"isSent",
"(",
")",
")",
"{",
"static",
"::",
"call",
"(",
"'send'",
",",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"headers",
"as",
"$",
"header",
"=>",... | Bastelt den Response zusammen und sendet diesen ab, sofern er noch nicht
abgesendet wurde.
@return bool | [
"Bastelt",
"den",
"Response",
"zusammen",
"und",
"sendet",
"diesen",
"ab",
"sofern",
"er",
"noch",
"nicht",
"abgesendet",
"wurde",
"."
] | 6c571427231f95f3a26f4893fc50a251d1a29aba | https://github.com/DripsPHP/HTTP/blob/6c571427231f95f3a26f4893fc50a251d1a29aba/src/Response.php#L97-L110 |
3,129 | webriq/core | module/Core/src/Grid/Core/View/Helper/IsModuleLoaded.php | IsModuleLoaded.isAllModulesLoaded | protected function isAllModulesLoaded( array $modules )
{
foreach ( $modules as $module )
{
if ( ! $this->isModuleLoaded( $module ) )
{
return false;
}
}
return true;
} | php | protected function isAllModulesLoaded( array $modules )
{
foreach ( $modules as $module )
{
if ( ! $this->isModuleLoaded( $module ) )
{
return false;
}
}
return true;
} | [
"protected",
"function",
"isAllModulesLoaded",
"(",
"array",
"$",
"modules",
")",
"{",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"module",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isModuleLoaded",
"(",
"$",
"module",
")",
")",
"{",
"return",
"fal... | Is all modules loaded
@param array $modules
@return bool | [
"Is",
"all",
"modules",
"loaded"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/View/Helper/IsModuleLoaded.php#L72-L83 |
3,130 | webriq/core | module/Core/src/Grid/Core/View/Helper/IsModuleLoaded.php | IsModuleLoaded.isModulesLoaded | public function isModulesLoaded( $modules )
{
if ( $modules instanceof Traversable )
{
$modules = ArrayUtils::iteratorToArray( $modules );
}
if ( ! is_array( $modules ) )
{
$modules = preg_split( '/\|{1,2}/', (string) $modules );
}
fo... | php | public function isModulesLoaded( $modules )
{
if ( $modules instanceof Traversable )
{
$modules = ArrayUtils::iteratorToArray( $modules );
}
if ( ! is_array( $modules ) )
{
$modules = preg_split( '/\|{1,2}/', (string) $modules );
}
fo... | [
"public",
"function",
"isModulesLoaded",
"(",
"$",
"modules",
")",
"{",
"if",
"(",
"$",
"modules",
"instanceof",
"Traversable",
")",
"{",
"$",
"modules",
"=",
"ArrayUtils",
"::",
"iteratorToArray",
"(",
"$",
"modules",
")",
";",
"}",
"if",
"(",
"!",
"is_... | Is any modules loaded
@param string|array $modules
@return bool | [
"Is",
"any",
"modules",
"loaded"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/View/Helper/IsModuleLoaded.php#L91-L117 |
3,131 | yrizos/data-entity | src/Type.php | Type.factory | public static function factory($type)
{
if ($type instanceof TypeInterface) return $type;
if (strpos($type, "\\") === false) {
$type = ucfirst(trim(strval($type)));
if (strripos(strrev($type), strrev('type')) === false) $type .= 'Type';
$type = "DataEntity\\Type... | php | public static function factory($type)
{
if ($type instanceof TypeInterface) return $type;
if (strpos($type, "\\") === false) {
$type = ucfirst(trim(strval($type)));
if (strripos(strrev($type), strrev('type')) === false) $type .= 'Type';
$type = "DataEntity\\Type... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"TypeInterface",
")",
"return",
"$",
"type",
";",
"if",
"(",
"strpos",
"(",
"$",
"type",
",",
"\"\\\\\"",
")",
"===",
"false",
")",
"{",
"$",... | Builds type objects
@param string|TypeInterface $type
@return TypeInterface
@throws \InvalidArgumentException | [
"Builds",
"type",
"objects"
] | 7dd80ff837ee6bb1c1d96d2458fa6a9b1bb31686 | https://github.com/yrizos/data-entity/blob/7dd80ff837ee6bb1c1d96d2458fa6a9b1bb31686/src/Type.php#L28-L45 |
3,132 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/uri.php | Uri.to_assoc | public static function to_assoc($start = 1)
{
$segments = array_slice(static::segments(), ($start - 1));
count($segments) % 2 and $segments[] = null;
return \Arr::to_assoc($segments);
} | php | public static function to_assoc($start = 1)
{
$segments = array_slice(static::segments(), ($start - 1));
count($segments) % 2 and $segments[] = null;
return \Arr::to_assoc($segments);
} | [
"public",
"static",
"function",
"to_assoc",
"(",
"$",
"start",
"=",
"1",
")",
"{",
"$",
"segments",
"=",
"array_slice",
"(",
"static",
"::",
"segments",
"(",
")",
",",
"(",
"$",
"start",
"-",
"1",
")",
")",
";",
"count",
"(",
"$",
"segments",
")",
... | Converts the current URI segments to an associative array. If
the URI has an odd number of segments, an empty value will be added.
@param int segment number to start from. default value is the first segment
@return array the assoc array | [
"Converts",
"the",
"current",
"URI",
"segments",
"to",
"an",
"associative",
"array",
".",
"If",
"the",
"URI",
"has",
"an",
"odd",
"number",
"of",
"segments",
"an",
"empty",
"value",
"will",
"be",
"added",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/uri.php#L120-L126 |
3,133 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/uri.php | Uri.create | public static function create($uri = null, $variables = array(), $get_variables = array(), $secure = null)
{
$url = '';
is_null($uri) and $uri = static::string();
// If the given uri is not a full URL
if( ! preg_match("#^(http|https|ftp)://#i", $uri))
{
$url .= \Config::get('base_url');
if ($index_fi... | php | public static function create($uri = null, $variables = array(), $get_variables = array(), $secure = null)
{
$url = '';
is_null($uri) and $uri = static::string();
// If the given uri is not a full URL
if( ! preg_match("#^(http|https|ftp)://#i", $uri))
{
$url .= \Config::get('base_url');
if ($index_fi... | [
"public",
"static",
"function",
"create",
"(",
"$",
"uri",
"=",
"null",
",",
"$",
"variables",
"=",
"array",
"(",
")",
",",
"$",
"get_variables",
"=",
"array",
"(",
")",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"''",
";",
"is_n... | Creates a url with the given uri, including the base url
@param string $uri The uri to create the URL for
@param array $variables Some variables for the URL
@param array $get_variables Any GET urls to append via a query string
@param bool $secure If false, force http. If true, ... | [
"Creates",
"a",
"url",
"with",
"the",
"given",
"uri",
"including",
"the",
"base",
"url"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/uri.php#L152-L203 |
3,134 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/uri.php | Uri.base | public static function base($include_index = true)
{
$url = \Config::get('base_url');
if ($include_index and \Config::get('index_file'))
{
$url .= \Config::get('index_file').'/';
}
return $url;
} | php | public static function base($include_index = true)
{
$url = \Config::get('base_url');
if ($include_index and \Config::get('index_file'))
{
$url .= \Config::get('index_file').'/';
}
return $url;
} | [
"public",
"static",
"function",
"base",
"(",
"$",
"include_index",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"\\",
"Config",
"::",
"get",
"(",
"'base_url'",
")",
";",
"if",
"(",
"$",
"include_index",
"and",
"\\",
"Config",
"::",
"get",
"(",
"'index_file'... | Gets the base URL, including the index_file if wanted.
@param bool $include_index Whether to include index.php in the URL
@return string | [
"Gets",
"the",
"base",
"URL",
"including",
"the",
"index_file",
"if",
"wanted",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/uri.php#L231-L241 |
3,135 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/uri.php | Uri.build_query_string | public static function build_query_string()
{
$params = array();
foreach (func_get_args() as $arg)
{
$arg = is_array($arg) ? $arg : array($arg => '1');
$params = array_merge($params, $arg);
}
return http_build_query($params);
} | php | public static function build_query_string()
{
$params = array();
foreach (func_get_args() as $arg)
{
$arg = is_array($arg) ? $arg : array($arg => '1');
$params = array_merge($params, $arg);
}
return http_build_query($params);
} | [
"public",
"static",
"function",
"build_query_string",
"(",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"arg",
")",
"{",
"$",
"arg",
"=",
"is_array",
"(",
"$",
"arg",
")",
"?",
"$",
"ar... | Builds a query string by merging all array and string values passed. If
a string is passed, it will be assumed to be a switch, and converted
to "string=1".
@param array|string Array or string to merge
@param array|string ...
@return string | [
"Builds",
"a",
"query",
"string",
"by",
"merging",
"all",
"array",
"and",
"string",
"values",
"passed",
".",
"If",
"a",
"string",
"is",
"passed",
"it",
"will",
"be",
"assumed",
"to",
"be",
"a",
"switch",
"and",
"converted",
"to",
"string",
"=",
"1",
".... | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/uri.php#L253-L265 |
3,136 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/uri.php | Uri.update_query_string | public static function update_query_string($vars = array(), $uri = null, $secure = null)
{
// unify the input data
if ( ! is_array($vars))
{
$vars = array($vars => $uri);
$uri = null;
}
// if we have a custom URI, use that
if ($uri === null)
{
// use the current URI if not is passed
$uri = s... | php | public static function update_query_string($vars = array(), $uri = null, $secure = null)
{
// unify the input data
if ( ! is_array($vars))
{
$vars = array($vars => $uri);
$uri = null;
}
// if we have a custom URI, use that
if ($uri === null)
{
// use the current URI if not is passed
$uri = s... | [
"public",
"static",
"function",
"update_query_string",
"(",
"$",
"vars",
"=",
"array",
"(",
")",
",",
"$",
"uri",
"=",
"null",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"// unify the input data",
"if",
"(",
"!",
"is_array",
"(",
"$",
"vars",
")",
")",... | Updates the query string of the current or passed URL with the data passed
@param array|string $vars Assoc array of GET variables, or a get variable name
@param string|mixed $uri Optional URI to use if $vars is an array, otherwise the get variable name
@param bool $secure If false, force http. If... | [
"Updates",
"the",
"query",
"string",
"of",
"the",
"current",
"or",
"passed",
"URL",
"with",
"the",
"data",
"passed"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/uri.php#L276-L297 |
3,137 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/uri.php | Uri.get_segment | public function get_segment($segment, $default = null)
{
if (isset($this->segments[$segment - 1]))
{
return $this->segments[$segment - 1];
}
return \Fuel::value($default);
} | php | public function get_segment($segment, $default = null)
{
if (isset($this->segments[$segment - 1]))
{
return $this->segments[$segment - 1];
}
return \Fuel::value($default);
} | [
"public",
"function",
"get_segment",
"(",
"$",
"segment",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"segments",
"[",
"$",
"segment",
"-",
"1",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"segments"... | Get the specified URI segment, return default if it doesn't exist.
Segment index is 1 based, not 0 based
@param string $segment The 1-based segment index
@param mixed $default The default value
@return mixed | [
"Get",
"the",
"specified",
"URI",
"segment",
"return",
"default",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/uri.php#L372-L380 |
3,138 | jhorlima/wp-mocabonita | src/tools/MbMigration.php | MbMigration.enablePdoConnection | public static function enablePdoConnection()
{
if (is_null(self::$instance)) {
global $wpdb;
$capsule = new self();
$capsule->addConnection([
'driver' => 'mysql',
'host' => DB_HOST,
'database' => DB_NAME,
... | php | public static function enablePdoConnection()
{
if (is_null(self::$instance)) {
global $wpdb;
$capsule = new self();
$capsule->addConnection([
'driver' => 'mysql',
'host' => DB_HOST,
'database' => DB_NAME,
... | [
"public",
"static",
"function",
"enablePdoConnection",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"global",
"$",
"wpdb",
";",
"$",
"capsule",
"=",
"new",
"self",
"(",
")",
";",
"$",
"capsule",
"->",
"addCo... | Enable PDO for eloquent
@return void | [
"Enable",
"PDO",
"for",
"eloquent"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbMigration.php#L31-L49 |
3,139 | coolms/authentication | src/Mvc/Controller/Plugin/Authentication.php | Authentication.getRequest | public function getRequest()
{
if (null === $this->request) {
$this->setRequest($this->getController()->getRequest());
}
return $this->request;
} | php | public function getRequest()
{
if (null === $this->request) {
$this->setRequest($this->getController()->getRequest());
}
return $this->request;
} | [
"public",
"function",
"getRequest",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"request",
")",
"{",
"$",
"this",
"->",
"setRequest",
"(",
"$",
"this",
"->",
"getController",
"(",
")",
"->",
"getRequest",
"(",
")",
")",
";",
"}",
"r... | Get request to be authenticated
@return RequestInterface | [
"Get",
"request",
"to",
"be",
"authenticated"
] | 4563cc4cc3a4d777db45977bd179cc5bd3f57cd8 | https://github.com/coolms/authentication/blob/4563cc4cc3a4d777db45977bd179cc5bd3f57cd8/src/Mvc/Controller/Plugin/Authentication.php#L60-L67 |
3,140 | coolms/authentication | src/Mvc/Controller/Plugin/Authentication.php | Authentication.getAuthenticationAdapter | public function getAuthenticationAdapter()
{
if (null === $this->authenticationAdapter) {
$authenticationAdapter = $this->getAuthenticationService()->getAdapter();
$this->setAuthenticationAdapter($authenticationAdapter);
}
return $this->authenticationAdapter;
} | php | public function getAuthenticationAdapter()
{
if (null === $this->authenticationAdapter) {
$authenticationAdapter = $this->getAuthenticationService()->getAdapter();
$this->setAuthenticationAdapter($authenticationAdapter);
}
return $this->authenticationAdapter;
} | [
"public",
"function",
"getAuthenticationAdapter",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"authenticationAdapter",
")",
"{",
"$",
"authenticationAdapter",
"=",
"$",
"this",
"->",
"getAuthenticationService",
"(",
")",
"->",
"getAdapter",
"(",
... | Get authentication adapter
@return AdapterInterface | [
"Get",
"authentication",
"adapter"
] | 4563cc4cc3a4d777db45977bd179cc5bd3f57cd8 | https://github.com/coolms/authentication/blob/4563cc4cc3a4d777db45977bd179cc5bd3f57cd8/src/Mvc/Controller/Plugin/Authentication.php#L164-L172 |
3,141 | 51systems/zf2-extensions | src/Http/RequestUtils.php | RequestUtils.toUriString | public static function toUriString(Request $request)
{
$uri = clone $request->getUri();
$uri->setQuery(array_merge($uri->getQueryAsArray(),
$request->getQuery()->toArray()));
return $uri->toString();
} | php | public static function toUriString(Request $request)
{
$uri = clone $request->getUri();
$uri->setQuery(array_merge($uri->getQueryAsArray(),
$request->getQuery()->toArray()));
return $uri->toString();
} | [
"public",
"static",
"function",
"toUriString",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"uri",
"=",
"clone",
"$",
"request",
"->",
"getUri",
"(",
")",
";",
"$",
"uri",
"->",
"setQuery",
"(",
"array_merge",
"(",
"$",
"uri",
"->",
"getQueryAsArray",
... | Converts the request into a url.
This encodes the query parameters associated with the request.
@param Request $request
@return string | [
"Converts",
"the",
"request",
"into",
"a",
"url",
"."
] | 81534327733ce8469e6f50e1ee0e1ae6d0c2f5ff | https://github.com/51systems/zf2-extensions/blob/81534327733ce8469e6f50e1ee0e1ae6d0c2f5ff/src/Http/RequestUtils.php#L19-L27 |
3,142 | synapsestudios/synapse-base | src/Synapse/Config/Config.php | Config.attach | public function attach(ReaderInterface $reader, $last = true)
{
if ($last) {
// Add to the end (i.e. read this last, highest merge priority)
$this->readers[] = $reader;
} else {
// Add to the beginning (i.e. read this first, lowest merge priority)
arra... | php | public function attach(ReaderInterface $reader, $last = true)
{
if ($last) {
// Add to the end (i.e. read this last, highest merge priority)
$this->readers[] = $reader;
} else {
// Add to the beginning (i.e. read this first, lowest merge priority)
arra... | [
"public",
"function",
"attach",
"(",
"ReaderInterface",
"$",
"reader",
",",
"$",
"last",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"last",
")",
"{",
"// Add to the end (i.e. read this last, highest merge priority)",
"$",
"this",
"->",
"readers",
"[",
"]",
"=",
"$... | Attach a new config reader
Readers are accessed in order by their priority. By default, their
priority is the order in which they were attached. Calling
Config::attach($reader) will cause any configs read by it to override any
configs read by previously attached readers.
@param ReaderInterface $reader
@param boolea... | [
"Attach",
"a",
"new",
"config",
"reader"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Config/Config.php#L21-L33 |
3,143 | synapsestudios/synapse-base | src/Synapse/Config/Config.php | Config.detach | public function detach(ReaderInterface $reader)
{
if (($key = array_search($reader, $this->readers)) !== false) {
unset($this->readers[$key]);
}
// Clear any cached groups
$this->groups = [];
} | php | public function detach(ReaderInterface $reader)
{
if (($key = array_search($reader, $this->readers)) !== false) {
unset($this->readers[$key]);
}
// Clear any cached groups
$this->groups = [];
} | [
"public",
"function",
"detach",
"(",
"ReaderInterface",
"$",
"reader",
")",
"{",
"if",
"(",
"(",
"$",
"key",
"=",
"array_search",
"(",
"$",
"reader",
",",
"$",
"this",
"->",
"readers",
")",
")",
"!==",
"false",
")",
"{",
"unset",
"(",
"$",
"this",
... | Detach a config reader
@param ReaderInterface $reader | [
"Detach",
"a",
"config",
"reader"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Config/Config.php#L40-L48 |
3,144 | synapsestudios/synapse-base | src/Synapse/Config/Config.php | Config.load | public function load($groupName)
{
if (! count($this->readers)) {
throw new \RuntimeException('No config readers attached');
}
if (! $groupName) {
throw new \InvalidArgumentException('No config group specified');
}
if (! is_string($groupName)) {
... | php | public function load($groupName)
{
if (! count($this->readers)) {
throw new \RuntimeException('No config readers attached');
}
if (! $groupName) {
throw new \InvalidArgumentException('No config group specified');
}
if (! is_string($groupName)) {
... | [
"public",
"function",
"load",
"(",
"$",
"groupName",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"readers",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'No config readers attached'",
")",
";",
"}",
"if",
"(",
"!",
"$",... | Load configuration for a group
@param string $groupName
@return array | [
"Load",
"configuration",
"for",
"a",
"group"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Config/Config.php#L66-L95 |
3,145 | php-packages/fluent | src/PhpPackages/Fluent/Fluent.php | Fluent.registerCall | public function registerCall($name, array $arguments = [])
{
$name = strtolower(preg_replace("/([A-Z]{1})/", "_$0", $name));
$this->calls = array_merge($this->calls, array_filter(explode("_", $name)));
if (count($arguments) > 0) {
$lastIndex = count($this->calls) - 1;
... | php | public function registerCall($name, array $arguments = [])
{
$name = strtolower(preg_replace("/([A-Z]{1})/", "_$0", $name));
$this->calls = array_merge($this->calls, array_filter(explode("_", $name)));
if (count($arguments) > 0) {
$lastIndex = count($this->calls) - 1;
... | [
"public",
"function",
"registerCall",
"(",
"$",
"name",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"preg_replace",
"(",
"\"/([A-Z]{1})/\"",
",",
"\"_$0\"",
",",
"$",
"name",
")",
")",
";",
"$",
"this",... | Registers a call.
@param string $name
@param array $arguments
@return void | [
"Registers",
"a",
"call",
"."
] | 5dfea85aaa9e8ddc3eddbcb95d6511ac187dbc82 | https://github.com/php-packages/fluent/blob/5dfea85aaa9e8ddc3eddbcb95d6511ac187dbc82/src/PhpPackages/Fluent/Fluent.php#L20-L31 |
3,146 | laasti/views | src/Engines/PlainPhp.php | PlainPhp.findTemplateFile | protected function findTemplateFile($file)
{
//Add missing extension
$ext = pathinfo($file, PATHINFO_EXTENSION);
$file = ($ext === '') ? $file . '.'.$this->getExtension() : $file;
$found = false;
foreach ($this->locations as $location) {
if (is_file($location . '... | php | protected function findTemplateFile($file)
{
//Add missing extension
$ext = pathinfo($file, PATHINFO_EXTENSION);
$file = ($ext === '') ? $file . '.'.$this->getExtension() : $file;
$found = false;
foreach ($this->locations as $location) {
if (is_file($location . '... | [
"protected",
"function",
"findTemplateFile",
"(",
"$",
"file",
")",
"{",
"//Add missing extension",
"$",
"ext",
"=",
"pathinfo",
"(",
"$",
"file",
",",
"PATHINFO_EXTENSION",
")",
";",
"$",
"file",
"=",
"(",
"$",
"ext",
"===",
"''",
")",
"?",
"$",
"file",... | Finds the file by looping through locations
@param string $file
@return string
@throws TemplateNotFoundException | [
"Finds",
"the",
"file",
"by",
"looping",
"through",
"locations"
] | 7b45b81b3bec8c902e241e99a85341c256ecf834 | https://github.com/laasti/views/blob/7b45b81b3bec8c902e241e99a85341c256ecf834/src/Engines/PlainPhp.php#L106-L126 |
3,147 | OpenResourceManager/client-php | src/ORM.php | ORM.validateAuth | public function validateAuth()
{
// Send a get request to the API
$response = $this->uniRequest->get(implode([$this->authURL, 'validate/']), $this->headers);
// Check that we get 20X back
if (in_array($response->code, $this->validCodes)) {
// Return the response
... | php | public function validateAuth()
{
// Send a get request to the API
$response = $this->uniRequest->get(implode([$this->authURL, 'validate/']), $this->headers);
// Check that we get 20X back
if (in_array($response->code, $this->validCodes)) {
// Return the response
... | [
"public",
"function",
"validateAuth",
"(",
")",
"{",
"// Send a get request to the API",
"$",
"response",
"=",
"$",
"this",
"->",
"uniRequest",
"->",
"get",
"(",
"implode",
"(",
"[",
"$",
"this",
"->",
"authURL",
",",
"'validate/'",
"]",
")",
",",
"$",
"th... | Validate Authenticated Session
Validates the current JWT with with the API to determine if the session is still valid.
@return \Unirest\Response
@throws Exception | [
"Validate",
"Authenticated",
"Session"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/ORM.php#L169-L181 |
3,148 | tekton-php/session | src/Segment.php | Segment.all | public function all()
{
$this->resumeOrStartSession();
return isset($_SESSION[$this->name])
? $_SESSION[$this->name]
: [];
} | php | public function all()
{
$this->resumeOrStartSession();
return isset($_SESSION[$this->name])
? $_SESSION[$this->name]
: [];
} | [
"public",
"function",
"all",
"(",
")",
"{",
"$",
"this",
"->",
"resumeOrStartSession",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"name",
"]",
")",
"?",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"name",
"]",
":",... | Get all of the session data.
@return array | [
"Get",
"all",
"of",
"the",
"session",
"data",
"."
] | 5a18f0f33eac9a9297c59649d9ac4f874885f07f | https://github.com/tekton-php/session/blob/5a18f0f33eac9a9297c59649d9ac4f874885f07f/src/Segment.php#L105-L111 |
3,149 | tekton-php/session | src/Segment.php | Segment.remove | public function remove($key)
{
if (isset($_SESSION[$this->name][$key])) {
$value = $_SESSION[$this->name][$key];
unset($_SESSION[$this->name][$key]);
return $value;
}
return null;
} | php | public function remove($key)
{
if (isset($_SESSION[$this->name][$key])) {
$value = $_SESSION[$this->name][$key];
unset($_SESSION[$this->name][$key]);
return $value;
}
return null;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"name",
"]",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"name",
... | Remove an item from the session, returning its value.
@param string $key
@return mixed | [
"Remove",
"an",
"item",
"from",
"the",
"session",
"returning",
"its",
"value",
"."
] | 5a18f0f33eac9a9297c59649d9ac4f874885f07f | https://github.com/tekton-php/session/blob/5a18f0f33eac9a9297c59649d9ac4f874885f07f/src/Segment.php#L163-L172 |
3,150 | cawaphp/db | src/TransactionDatabase.php | TransactionDatabase.rollback | public function rollback() : bool
{
$sql = 'ROLLBACK';
if (!$this->transactionStarted) {
$event = new TimerEvent('db.query');
$this->emitQueryEvent($event, null, $sql);
throw new QueryException(
$this,
$sql,
"Can't... | php | public function rollback() : bool
{
$sql = 'ROLLBACK';
if (!$this->transactionStarted) {
$event = new TimerEvent('db.query');
$this->emitQueryEvent($event, null, $sql);
throw new QueryException(
$this,
$sql,
"Can't... | [
"public",
"function",
"rollback",
"(",
")",
":",
"bool",
"{",
"$",
"sql",
"=",
"'ROLLBACK'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"transactionStarted",
")",
"{",
"$",
"event",
"=",
"new",
"TimerEvent",
"(",
"'db.query'",
")",
";",
"$",
"this",
"->... | Rollback a sql transaction.
@throws QueryException
@return bool | [
"Rollback",
"a",
"sql",
"transaction",
"."
] | b5381b39ecdde3e01435711c9c5be67dc1006b11 | https://github.com/cawaphp/db/blob/b5381b39ecdde3e01435711c9c5be67dc1006b11/src/TransactionDatabase.php#L91-L112 |
3,151 | bkdotcom/Form | src/Form.php | Form.& | public function &__get($property)
{
$getter = 'get'.\ucfirst($property);
if (\in_array($property, array('alerts','cfg','status'))) {
return $this->{$property};
} elseif (\method_exists($this, $getter)) {
$return = $this->{$getter}();
return $return;
... | php | public function &__get($property)
{
$getter = 'get'.\ucfirst($property);
if (\in_array($property, array('alerts','cfg','status'))) {
return $this->{$property};
} elseif (\method_exists($this, $getter)) {
$return = $this->{$getter}();
return $return;
... | [
"public",
"function",
"&",
"__get",
"(",
"$",
"property",
")",
"{",
"$",
"getter",
"=",
"'get'",
".",
"\\",
"ucfirst",
"(",
"$",
"property",
")",
";",
"if",
"(",
"\\",
"in_array",
"(",
"$",
"property",
",",
"array",
"(",
"'alerts'",
",",
"'cfg'",
"... | Get protected properties
@param string $property property name
@return mixed | [
"Get",
"protected",
"properties"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L142-L155 |
3,152 | bkdotcom/Form | src/Form.php | Form.getField | public function getField($fieldName)
{
$this->debug->group(__METHOD__, $fieldName);
$field = false;
if (\preg_match('|^(.*?)[/.](.*)$|', $fieldName, $matches)) {
$pageName = $matches[1];
$fieldName = $matches[2];
} else {
$pageName = $this->status[... | php | public function getField($fieldName)
{
$this->debug->group(__METHOD__, $fieldName);
$field = false;
if (\preg_match('|^(.*?)[/.](.*)$|', $fieldName, $matches)) {
$pageName = $matches[1];
$fieldName = $matches[2];
} else {
$pageName = $this->status[... | [
"public",
"function",
"getField",
"(",
"$",
"fieldName",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"group",
"(",
"__METHOD__",
",",
"$",
"fieldName",
")",
";",
"$",
"field",
"=",
"false",
";",
"if",
"(",
"\\",
"preg_match",
"(",
"'|^(.*?)[/.](.*)$|'",
... | Get form field
@param string $fieldName field's name
@return Field | [
"Get",
"form",
"field"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L164-L204 |
3,153 | bkdotcom/Form | src/Form.php | Form.getInvalidFields | public function getInvalidFields()
{
$invalidFields = array();
foreach ($this->currentFields as $field) {
if (!$field->isValid) {
$invalidFields[] = $field;
}
}
return $invalidFields;
} | php | public function getInvalidFields()
{
$invalidFields = array();
foreach ($this->currentFields as $field) {
if (!$field->isValid) {
$invalidFields[] = $field;
}
}
return $invalidFields;
} | [
"public",
"function",
"getInvalidFields",
"(",
")",
"{",
"$",
"invalidFields",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"currentFields",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"$",
"field",
"->",
"isValid",
")",
"{",
"$"... | Get list of invalid fields
@return Field[] | [
"Get",
"list",
"of",
"invalid",
"fields"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L211-L220 |
3,154 | bkdotcom/Form | src/Form.php | Form.setCurrentFields | public function setCurrentFields($i = null)
{
$this->debug->groupCollapsed(__METHOD__, $i);
$this->debug->groupUncollapse();
$cfg = &$this->cfg;
$status = &$this->status;
if (isset($i)) {
$this->status['submitted'] = false;
$this->persist->s... | php | public function setCurrentFields($i = null)
{
$this->debug->groupCollapsed(__METHOD__, $i);
$this->debug->groupUncollapse();
$cfg = &$this->cfg;
$status = &$this->status;
if (isset($i)) {
$this->status['submitted'] = false;
$this->persist->s... | [
"public",
"function",
"setCurrentFields",
"(",
"$",
"i",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
",",
"$",
"i",
")",
";",
"$",
"this",
"->",
"debug",
"->",
"groupUncollapse",
"(",
")",
";",
"$",
"... | Set current "page"
@param integer $i index of forms/fields to use
@return void | [
"Set",
"current",
"page"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L314-L344 |
3,155 | bkdotcom/Form | src/Form.php | Form.buildField | protected function buildField($fieldProps, $nameDefault = null)
{
$this->debug->group(__METHOD__, $nameDefault);
if (!isset($fieldProps['attribs']['name']) && !isset($fieldProps['name'])) {
$fieldProps['attribs']['name'] = $nameDefault;
}
if (!empty($fieldProps['newPage']... | php | protected function buildField($fieldProps, $nameDefault = null)
{
$this->debug->group(__METHOD__, $nameDefault);
if (!isset($fieldProps['attribs']['name']) && !isset($fieldProps['name'])) {
$fieldProps['attribs']['name'] = $nameDefault;
}
if (!empty($fieldProps['newPage']... | [
"protected",
"function",
"buildField",
"(",
"$",
"fieldProps",
",",
"$",
"nameDefault",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"group",
"(",
"__METHOD__",
",",
"$",
"nameDefault",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"fieldPro... | Build field object
@param array $fieldProps field properties
@param string $nameDefault default name
@return object | [
"Build",
"field",
"object"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L428-L447 |
3,156 | bkdotcom/Form | src/Form.php | Form.buildFields | protected function buildFields()
{
$this->debug->groupCollapsed(__METHOD__);
$status = &$this->status;
$persist = $this->persist;
$pageI = $this->persist->get('i');
$submitFieldCount = 0;
$keys = \array_keys($this->currentFields);
foreach ($keys as $k) {
... | php | protected function buildFields()
{
$this->debug->groupCollapsed(__METHOD__);
$status = &$this->status;
$persist = $this->persist;
$pageI = $this->persist->get('i');
$submitFieldCount = 0;
$keys = \array_keys($this->currentFields);
foreach ($keys as $k) {
... | [
"protected",
"function",
"buildFields",
"(",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"status",
"=",
"&",
"$",
"this",
"->",
"status",
";",
"$",
"persist",
"=",
"$",
"this",
"->",
"persist",
";",
... | Build current fields
@return void | [
"Build",
"current",
"fields"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L454-L504 |
3,157 | bkdotcom/Form | src/Form.php | Form.initPersist | private function initPersist()
{
$this->debug->groupCollapsed(__METHOD__);
$this->persist = new Persist($this->cfg['name'], array(
'persist' => $this->cfg['persist'],
'trashCollectable' => $this->cfg['trashCollectable'],
'userKey' => $this->cfg['verifyK... | php | private function initPersist()
{
$this->debug->groupCollapsed(__METHOD__);
$this->persist = new Persist($this->cfg['name'], array(
'persist' => $this->cfg['persist'],
'trashCollectable' => $this->cfg['trashCollectable'],
'userKey' => $this->cfg['verifyK... | [
"private",
"function",
"initPersist",
"(",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"this",
"->",
"persist",
"=",
"new",
"Persist",
"(",
"$",
"this",
"->",
"cfg",
"[",
"'name'",
"]",
",",
"array",
... | Initialize persist object
@return void | [
"Initialize",
"persist",
"object"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L603-L619 |
3,158 | bkdotcom/Form | src/Form.php | Form.pagesAddEnd | private function pagesAddEnd($pagesEnd = array())
{
$this->debug->groupCollapsed(__METHOD__);
$this->persist->appendPages($pagesEnd);
$this->debug->groupEnd();
} | php | private function pagesAddEnd($pagesEnd = array())
{
$this->debug->groupCollapsed(__METHOD__);
$this->persist->appendPages($pagesEnd);
$this->debug->groupEnd();
} | [
"private",
"function",
"pagesAddEnd",
"(",
"$",
"pagesEnd",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"this",
"->",
"persist",
"->",
"appendPages",
"(",
"$",
"pagesEnd",
")",
... | Add pages to end of form
@param array $pagesEnd list of pagenames
@return void | [
"Add",
"pages",
"to",
"end",
"of",
"form"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L628-L633 |
3,159 | bkdotcom/Form | src/Form.php | Form.pagesAddNext | private function pagesAddNext($pagesNext = array())
{
$this->debug->groupCollapsed(__METHOD__);
$pagesNext = \array_values($pagesNext);
$pages = $this->persist->get('pages');
$iCur = $this->persist->get('i');
$currentPage = $pages[ $iCur ];
// offset is where we will ... | php | private function pagesAddNext($pagesNext = array())
{
$this->debug->groupCollapsed(__METHOD__);
$pagesNext = \array_values($pagesNext);
$pages = $this->persist->get('pages');
$iCur = $this->persist->get('i');
$currentPage = $pages[ $iCur ];
// offset is where we will ... | [
"private",
"function",
"pagesAddNext",
"(",
"$",
"pagesNext",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"pagesNext",
"=",
"\\",
"array_values",
"(",
"$",
"pagesNext",
")",
";",... | Add pages to be seen immediately after current page
@param array $pagesNext list of page names
@return void | [
"Add",
"pages",
"to",
"be",
"seen",
"immediately",
"after",
"current",
"page"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L642-L671 |
3,160 | bkdotcom/Form | src/Form.php | Form.processSubmit | private function processSubmit()
{
$this->debug->group(__METHOD__);
$this->debug->groupUncollapse();
$cfg = &$this->cfg;
$status = &$this->status;
if ($status['submitted']) {
$this->validate();
if (\is_callable($cfg['post'])) {
$return ... | php | private function processSubmit()
{
$this->debug->group(__METHOD__);
$this->debug->groupUncollapse();
$cfg = &$this->cfg;
$status = &$this->status;
if ($status['submitted']) {
$this->validate();
if (\is_callable($cfg['post'])) {
$return ... | [
"private",
"function",
"processSubmit",
"(",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"group",
"(",
"__METHOD__",
")",
";",
"$",
"this",
"->",
"debug",
"->",
"groupUncollapse",
"(",
")",
";",
"$",
"cfg",
"=",
"&",
"$",
"this",
"->",
"cfg",
";",
... | Process submitted values
@return void | [
"Process",
"submitted",
"values"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L725-L784 |
3,161 | bkdotcom/Form | src/Form.php | Form.redirectPost | private function redirectPost()
{
if (!isset($_SERVER['REQUEST_URI'])) {
return;
}
if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'POST') {
return;
}
if (!$this->cfg['prg']) {
return;
}
if (!$this->s... | php | private function redirectPost()
{
if (!isset($_SERVER['REQUEST_URI'])) {
return;
}
if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'POST') {
return;
}
if (!$this->cfg['prg']) {
return;
}
if (!$this->s... | [
"private",
"function",
"redirectPost",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_URI'",
"]",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
"||",
... | Stores submitted values in persistence
Redirects if submoitted via POST
@return void
@throws \Exception Rather than exit. | [
"Stores",
"submitted",
"values",
"in",
"persistence",
"Redirects",
"if",
"submoitted",
"via",
"POST"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L793-L821 |
3,162 | bkdotcom/Form | src/Form.php | Form.resetStatus | private function resetStatus()
{
$this->debug->info('resetStatus');
$this->status = \array_merge($this->status, array(
'currentPageName' => $this->persist->get('currentPage.name'),
// 'keyVerified' => false, // don't reset
// 'submitted' => false, //... | php | private function resetStatus()
{
$this->debug->info('resetStatus');
$this->status = \array_merge($this->status, array(
'currentPageName' => $this->persist->get('currentPage.name'),
// 'keyVerified' => false, // don't reset
// 'submitted' => false, //... | [
"private",
"function",
"resetStatus",
"(",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"info",
"(",
"'resetStatus'",
")",
";",
"$",
"this",
"->",
"status",
"=",
"\\",
"array_merge",
"(",
"$",
"this",
"->",
"status",
",",
"array",
"(",
"'currentPageName'"... | Reset form status
@return void | [
"Reset",
"form",
"status"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L828-L843 |
3,163 | bkdotcom/Form | src/Form.php | Form.storeValues | private function storeValues()
{
$this->debug->groupCollapsed(__METHOD__);
// if (!$this->status['keyVerified']) {
if (!$this->status['submitted']) {
// $this->debug->warn('not submitted');
$this->debug->groupEnd();
return;
}
if (isset($_SE... | php | private function storeValues()
{
$this->debug->groupCollapsed(__METHOD__);
// if (!$this->status['keyVerified']) {
if (!$this->status['submitted']) {
// $this->debug->warn('not submitted');
$this->debug->groupEnd();
return;
}
if (isset($_SE... | [
"private",
"function",
"storeValues",
"(",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"// if (!$this->status['keyVerified']) {",
"if",
"(",
"!",
"$",
"this",
"->",
"status",
"[",
"'submitted'",
"]",
")",
"{",
"... | Copies request params to persist for storage
@return void | [
"Copies",
"request",
"params",
"to",
"persist",
"for",
"storage"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Form.php#L850-L896 |
3,164 | phpservicebus/core | src/Transport/RabbitMq/BrokerModel.php | BrokerModel.produceExchangeInstance | private function produceExchangeInstance($exchangeName)
{
if (isset($this->declaredExchangeInstances[$exchangeName])) {
return $this->declaredExchangeInstances[$exchangeName];
}
if (isset($this->usedExchangeInstances[$exchangeName])) {
return $this->usedExchangeInsta... | php | private function produceExchangeInstance($exchangeName)
{
if (isset($this->declaredExchangeInstances[$exchangeName])) {
return $this->declaredExchangeInstances[$exchangeName];
}
if (isset($this->usedExchangeInstances[$exchangeName])) {
return $this->usedExchangeInsta... | [
"private",
"function",
"produceExchangeInstance",
"(",
"$",
"exchangeName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"declaredExchangeInstances",
"[",
"$",
"exchangeName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"declaredExchangeInstances",... | It returns a cached exchange or a new one if none exists.
@param string $exchangeName
@return AMQPExchange | [
"It",
"returns",
"a",
"cached",
"exchange",
"or",
"a",
"new",
"one",
"if",
"none",
"exists",
"."
] | adbcf94be1e022120ede0c5aafa8a4f7900b0a6c | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/Transport/RabbitMq/BrokerModel.php#L218-L233 |
3,165 | phpservicebus/core | src/Transport/RabbitMq/BrokerModel.php | BrokerModel.produceQueueInstance | private function produceQueueInstance($queueName)
{
if (isset($this->declaredQueueInstances[$queueName])) {
return $this->declaredQueueInstances[$queueName];
}
if (isset($this->usedQueueInstances[$queueName])) {
return $this->usedQueueInstances[$queueName];
}... | php | private function produceQueueInstance($queueName)
{
if (isset($this->declaredQueueInstances[$queueName])) {
return $this->declaredQueueInstances[$queueName];
}
if (isset($this->usedQueueInstances[$queueName])) {
return $this->usedQueueInstances[$queueName];
}... | [
"private",
"function",
"produceQueueInstance",
"(",
"$",
"queueName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"declaredQueueInstances",
"[",
"$",
"queueName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"declaredQueueInstances",
"[",
"$",
... | It returns a cached queue or a new one if none exists.
@param string $queueName
@return AMQPQueue | [
"It",
"returns",
"a",
"cached",
"queue",
"or",
"a",
"new",
"one",
"if",
"none",
"exists",
"."
] | adbcf94be1e022120ede0c5aafa8a4f7900b0a6c | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/Transport/RabbitMq/BrokerModel.php#L242-L257 |
3,166 | bariew/yii2-user-cms-module | controllers/DefaultController.php | DefaultController.actionLogin | public function actionLogin($view = 'login', $partial = false)
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->redirect($this->getLoginRedi... | php | public function actionLogin($view = 'login', $partial = false)
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->redirect($this->getLoginRedi... | [
"public",
"function",
"actionLogin",
"(",
"$",
"view",
"=",
"'login'",
",",
"$",
"partial",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"return",
"$",
"this",
"->",
"goHome",
"(",
... | Renders login form.
@param string $view
@param bool $partial
@return string view. | [
"Renders",
"login",
"form",
"."
] | d9f5658cae45308c0916bc99976272a4ec906490 | https://github.com/bariew/yii2-user-cms-module/blob/d9f5658cae45308c0916bc99976272a4ec906490/controllers/DefaultController.php#L65-L78 |
3,167 | bariew/yii2-user-cms-module | controllers/DefaultController.php | DefaultController.actionRegister | public function actionRegister()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new RegisterForm();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
Yii::$app->session->setFlash("success", Yii::$app->user->isGuest
... | php | public function actionRegister()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new RegisterForm();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
Yii::$app->session->setFlash("success", Yii::$app->user->isGuest
... | [
"public",
"function",
"actionRegister",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"return",
"$",
"this",
"->",
"goHome",
"(",
")",
";",
"}",
"$",
"model",
"=",
"new",
"RegisterForm",
"(",... | Registers user.
@return string view. | [
"Registers",
"user",
"."
] | d9f5658cae45308c0916bc99976272a4ec906490 | https://github.com/bariew/yii2-user-cms-module/blob/d9f5658cae45308c0916bc99976272a4ec906490/controllers/DefaultController.php#L95-L112 |
3,168 | bariew/yii2-user-cms-module | controllers/DefaultController.php | DefaultController.actionConfirm | public function actionConfirm($auth_key)
{
$model = $this->findModel(true);
/**
* @var User $user
*/
if ($auth_key && ($user = $model::findOne(compact('auth_key')))) {
Yii::$app->session->setFlash("success", Yii::t('modules/user',
"You have succe... | php | public function actionConfirm($auth_key)
{
$model = $this->findModel(true);
/**
* @var User $user
*/
if ($auth_key && ($user = $model::findOne(compact('auth_key')))) {
Yii::$app->session->setFlash("success", Yii::t('modules/user',
"You have succe... | [
"public",
"function",
"actionConfirm",
"(",
"$",
"auth_key",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"true",
")",
";",
"/**\n * @var User $user\n */",
"if",
"(",
"$",
"auth_key",
"&&",
"(",
"$",
"user",
"=",
"$",
"... | For registration confirmation by email auth link.
@param string $auth_key user authorization key.
@return string view. | [
"For",
"registration",
"confirmation",
"by",
"email",
"auth",
"link",
"."
] | d9f5658cae45308c0916bc99976272a4ec906490 | https://github.com/bariew/yii2-user-cms-module/blob/d9f5658cae45308c0916bc99976272a4ec906490/controllers/DefaultController.php#L119-L135 |
3,169 | bariew/yii2-user-cms-module | controllers/DefaultController.php | DefaultController.findModel | public function findModel($new = false)
{
$class = \Yii::$app->user->identityClass;
return $new === true ? new $class() : Yii::$app->user->identity;
} | php | public function findModel($new = false)
{
$class = \Yii::$app->user->identityClass;
return $new === true ? new $class() : Yii::$app->user->identity;
} | [
"public",
"function",
"findModel",
"(",
"$",
"new",
"=",
"false",
")",
"{",
"$",
"class",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"identityClass",
";",
"return",
"$",
"new",
"===",
"true",
"?",
"new",
"$",
"class",
"(",
")",
":",
... | Finds user model.
@param boolean $new
@return User | [
"Finds",
"user",
"model",
"."
] | d9f5658cae45308c0916bc99976272a4ec906490 | https://github.com/bariew/yii2-user-cms-module/blob/d9f5658cae45308c0916bc99976272a4ec906490/controllers/DefaultController.php#L163-L167 |
3,170 | soloproyectos-php/array | src/arr/arguments/ArrArguments.php | ArrArguments.fetch | public function fetch()
{
$ret = array();
$pos = 0;
$len = count($this->_arguments);
foreach ($this->_descriptors as $name => $descriptor) {
$value = $descriptor->getDefault();
for ($i = $pos; ; $i++) {
if ($i < $len && $descriptor->match($th... | php | public function fetch()
{
$ret = array();
$pos = 0;
$len = count($this->_arguments);
foreach ($this->_descriptors as $name => $descriptor) {
$value = $descriptor->getDefault();
for ($i = $pos; ; $i++) {
if ($i < $len && $descriptor->match($th... | [
"public",
"function",
"fetch",
"(",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"pos",
"=",
"0",
";",
"$",
"len",
"=",
"count",
"(",
"$",
"this",
"->",
"_arguments",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_descriptors",
"as",
... | Fetches elements from the arguments that matches specific descriptors.
@return array associative array
@throws InvalidArgumentException | [
"Fetches",
"elements",
"from",
"the",
"arguments",
"that",
"matches",
"specific",
"descriptors",
"."
] | de38c800f3388005cbd37e70ab055f22609a5eae | https://github.com/soloproyectos-php/array/blob/de38c800f3388005cbd37e70ab055f22609a5eae/src/arr/arguments/ArrArguments.php#L67-L97 |
3,171 | liverbool/dos-resource-bundle | EventListener/ReplaceSyliusTrans.php | ReplaceSyliusTrans.replaceKeys | public function replaceKeys(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
if ($this->controller !== $event->getRequest()->attributes->get('_controller')) {
return;
}
$response = $event->getResponse();
$content = pr... | php | public function replaceKeys(FilterResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
}
if ($this->controller !== $event->getRequest()->attributes->get('_controller')) {
return;
}
$response = $event->getResponse();
$content = pr... | [
"public",
"function",
"replaceKeys",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"isMasterRequest",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"controller",
"!==",
"$",
"event",
"->... | Replace Sylius translation keys.
@param FilterResponseEvent $event | [
"Replace",
"Sylius",
"translation",
"keys",
"."
] | c8607a46c2cea80cc138994be74f4dea3c197abc | https://github.com/liverbool/dos-resource-bundle/blob/c8607a46c2cea80cc138994be74f4dea3c197abc/EventListener/ReplaceSyliusTrans.php#L25-L38 |
3,172 | jannisfink/yarf | src/request/PageMapper.php | PageMapper.uriKeyExists | private function uriKeyExists($nextUriPart, array $pageMap) {
if (array_key_exists($nextUriPart, $pageMap)) {
return $nextUriPart;
}
$keys = array_keys($pageMap);
$variableParts = array_values(preg_grep('/\{(.*)\}/', $keys));
$variablePartsCount = count($variableParts);
if ($variablePartsC... | php | private function uriKeyExists($nextUriPart, array $pageMap) {
if (array_key_exists($nextUriPart, $pageMap)) {
return $nextUriPart;
}
$keys = array_keys($pageMap);
$variableParts = array_values(preg_grep('/\{(.*)\}/', $keys));
$variablePartsCount = count($variableParts);
if ($variablePartsC... | [
"private",
"function",
"uriKeyExists",
"(",
"$",
"nextUriPart",
",",
"array",
"$",
"pageMap",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"nextUriPart",
",",
"$",
"pageMap",
")",
")",
"{",
"return",
"$",
"nextUriPart",
";",
"}",
"$",
"keys",
"=",
... | Checks, if there is a key in the page map for the given uri part. If there is a wildcard in the url,
it will save the wildcard + it's value
@param string $nextUriPart
@param array $pageMap
@return string|null the key, if there is any, {@code null} else
@throws RoutingException if a variable in the url appears twice on... | [
"Checks",
"if",
"there",
"is",
"a",
"key",
"in",
"the",
"page",
"map",
"for",
"the",
"given",
"uri",
"part",
".",
"If",
"there",
"is",
"a",
"wildcard",
"in",
"the",
"url",
"it",
"will",
"save",
"the",
"wildcard",
"+",
"it",
"s",
"value"
] | 91237dc0f3b724abaaba490f5171f181a92e939f | https://github.com/jannisfink/yarf/blob/91237dc0f3b724abaaba490f5171f181a92e939f/src/request/PageMapper.php#L108-L127 |
3,173 | arvici/framework | src/Arvici/Component/View/View.php | View.getFullPath | public function getFullPath()
{
$key = 'template.templatePath';
if ($this->type === self::PART_BODY) {
$key = 'template.viewPath';
}
$path = Configuration::get($key, null);
if ($path === null) { // @codeCoverageIgnore
throw new ConfigurationException... | php | public function getFullPath()
{
$key = 'template.templatePath';
if ($this->type === self::PART_BODY) {
$key = 'template.viewPath';
}
$path = Configuration::get($key, null);
if ($path === null) { // @codeCoverageIgnore
throw new ConfigurationException... | [
"public",
"function",
"getFullPath",
"(",
")",
"{",
"$",
"key",
"=",
"'template.templatePath'",
";",
"if",
"(",
"$",
"this",
"->",
"type",
"===",
"self",
"::",
"PART_BODY",
")",
"{",
"$",
"key",
"=",
"'template.viewPath'",
";",
"}",
"$",
"path",
"=",
"... | Get full path of view file.
@return string
@throws ConfigurationException
@throws NotFoundException | [
"Get",
"full",
"path",
"of",
"view",
"file",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Component/View/View.php#L168-L199 |
3,174 | calgamo/logger | src/LogManager.php | LogManager.writeMessage | private function writeMessage(string $level, string $message, string $tag, string $file, int $line, array $target_loggers)
{
if ( !$this->logger_config->isLogEnabled() ){
return;
}
// determine log level filter
$log_level_filter = 'E';
foreach($this->logger_confi... | php | private function writeMessage(string $level, string $message, string $tag, string $file, int $line, array $target_loggers)
{
if ( !$this->logger_config->isLogEnabled() ){
return;
}
// determine log level filter
$log_level_filter = 'E';
foreach($this->logger_confi... | [
"private",
"function",
"writeMessage",
"(",
"string",
"$",
"level",
",",
"string",
"$",
"message",
",",
"string",
"$",
"tag",
",",
"string",
"$",
"file",
",",
"int",
"$",
"line",
",",
"array",
"$",
"target_loggers",
")",
"{",
"if",
"(",
"!",
"$",
"th... | write a message
@param string $level log level
@param string $message log message
@param string $tag log tag
@param string $file file path
@param int $line line of file
@param array $target_loggers | [
"write",
"a",
"message"
] | 58aab9ddfe3f383337c61cad1f4742ce5afb9591 | https://github.com/calgamo/logger/blob/58aab9ddfe3f383337c61cad1f4742ce5afb9591/src/LogManager.php#L81-L119 |
3,175 | calgamo/logger | src/LogManager.php | LogManager.terminate | public function terminate()
{
if ( $this->loggers )
{
foreach( $this->loggers as $key => $logger )
{
$logger->writeFooter();
$logger->terminate();
unset($this->loggers[$key]);
}
$this->loggers = NULL;
... | php | public function terminate()
{
if ( $this->loggers )
{
foreach( $this->loggers as $key => $logger )
{
$logger->writeFooter();
$logger->terminate();
unset($this->loggers[$key]);
}
$this->loggers = NULL;
... | [
"public",
"function",
"terminate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loggers",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"loggers",
"as",
"$",
"key",
"=>",
"$",
"logger",
")",
"{",
"$",
"logger",
"->",
"writeFooter",
"(",
")",
";",
... | shutdown all loggers | [
"shutdown",
"all",
"loggers"
] | 58aab9ddfe3f383337c61cad1f4742ce5afb9591 | https://github.com/calgamo/logger/blob/58aab9ddfe3f383337c61cad1f4742ce5afb9591/src/LogManager.php#L124-L136 |
3,176 | calgamo/logger | src/LogManager.php | LogManager.trace | public function trace( string $file, int $line, string $target, string $message, string $tag = NULL )
{
self::log( $file, $line, "T:$target", $message, $tag );
} | php | public function trace( string $file, int $line, string $target, string $message, string $tag = NULL )
{
self::log( $file, $line, "T:$target", $message, $tag );
} | [
"public",
"function",
"trace",
"(",
"string",
"$",
"file",
",",
"int",
"$",
"line",
",",
"string",
"$",
"target",
",",
"string",
"$",
"message",
",",
"string",
"$",
"tag",
"=",
"NULL",
")",
"{",
"self",
"::",
"log",
"(",
"$",
"file",
",",
"$",
"l... | write trace log
@param string $file file path
@param int $line line of file
@param string $target log target
@param string $message log message to write
@param string $tag tag string(optional) | [
"write",
"trace",
"log"
] | 58aab9ddfe3f383337c61cad1f4742ce5afb9591 | https://github.com/calgamo/logger/blob/58aab9ddfe3f383337c61cad1f4742ce5afb9591/src/LogManager.php#L196-L199 |
3,177 | calgamo/logger | src/LogManager.php | LogManager._getLevelAndTargetLoggers | private function _getLevelAndTargetLoggers( $target )
{
$target = strpos($target, ':') !== false ? explode( ':' , $target ) : ['', '*'];
list($level,$target_loggers) = $target;
$target_loggers = explode( ',' , $target_loggers );
$target_loggers = array_map( 'trim', $target_loggers );... | php | private function _getLevelAndTargetLoggers( $target )
{
$target = strpos($target, ':') !== false ? explode( ':' , $target ) : ['', '*'];
list($level,$target_loggers) = $target;
$target_loggers = explode( ',' , $target_loggers );
$target_loggers = array_map( 'trim', $target_loggers );... | [
"private",
"function",
"_getLevelAndTargetLoggers",
"(",
"$",
"target",
")",
"{",
"$",
"target",
"=",
"strpos",
"(",
"$",
"target",
",",
"':'",
")",
"!==",
"false",
"?",
"explode",
"(",
"':'",
",",
"$",
"target",
")",
":",
"[",
"''",
",",
"'*'",
"]",... | Split target loggers and levels from target list
format of parameter '$target_list':
[level]:[logger1],[logger2],...
ex) "I:app,debug,sql"
@param string $target log target
@return array | [
"Split",
"target",
"loggers",
"and",
"levels",
"from",
"target",
"list"
] | 58aab9ddfe3f383337c61cad1f4742ce5afb9591 | https://github.com/calgamo/logger/blob/58aab9ddfe3f383337c61cad1f4742ce5afb9591/src/LogManager.php#L301-L312 |
3,178 | bogdananton/php-class-helper | ClassHelper.php | ClassHelper.instance | public static function instance($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Only objects are allowed to be passed to the helper.');
}
$response = new self();
$response->origin = $object;
$response->target = new ReflectionClass($obje... | php | public static function instance($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException('Only objects are allowed to be passed to the helper.');
}
$response = new self();
$response->origin = $object;
$response->target = new ReflectionClass($obje... | [
"public",
"static",
"function",
"instance",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Only objects are allowed to be passed to the helper.'",
")",
";",
"... | Creates and returns the wrapper.
Only objects are allowed to be passed, else an exception will be thrown.
Store the input object to the created wrapper.
@param $object
@return Helper | [
"Creates",
"and",
"returns",
"the",
"wrapper",
".",
"Only",
"objects",
"are",
"allowed",
"to",
"be",
"passed",
"else",
"an",
"exception",
"will",
"be",
"thrown",
".",
"Store",
"the",
"input",
"object",
"to",
"the",
"created",
"wrapper",
"."
] | 38bf4524e0fcb30730b8226d34159dcb59420ffe | https://github.com/bogdananton/php-class-helper/blob/38bf4524e0fcb30730b8226d34159dcb59420ffe/ClassHelper.php#L18-L28 |
3,179 | mszewcz/php-light-framework | src/Base.php | Base.parsePath | public function parsePath(?string $path = null): ?string
{
if ($path === null) {
return null;
}
$path = \str_replace('%DOCUMENT_ROOT%', $this->documentRoot, $path);
$path = \str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
return $path;
} | php | public function parsePath(?string $path = null): ?string
{
if ($path === null) {
return null;
}
$path = \str_replace('%DOCUMENT_ROOT%', $this->documentRoot, $path);
$path = \str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
return $path;
} | [
"public",
"function",
"parsePath",
"(",
"?",
"string",
"$",
"path",
"=",
"null",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"path",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"path",
"=",
"\\",
"str_replace",
"(",
"'%DOCUMENT_ROOT%'... | Replaces predefined constants in path string to document and framework root
@param null|string $path
@return null|string | [
"Replaces",
"predefined",
"constants",
"in",
"path",
"string",
"to",
"document",
"and",
"framework",
"root"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Base.php#L106-L114 |
3,180 | roydejong/Enlighten | lib/Routing/Filters.php | Filters.register | public function register($eventType, callable $filter)
{
if (!isset($this->handlers[$eventType])) {
$this->handlers[$eventType] = [];
}
$this->handlers[$eventType][] = $filter;
} | php | public function register($eventType, callable $filter)
{
if (!isset($this->handlers[$eventType])) {
$this->handlers[$eventType] = [];
}
$this->handlers[$eventType][] = $filter;
} | [
"public",
"function",
"register",
"(",
"$",
"eventType",
",",
"callable",
"$",
"filter",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$",
"eventType",
"]",
")",
")",
"{",
"$",
"this",
"->",
"handlers",
"[",
"$",
"eve... | Registers a filter function.
@param string $eventType The type of event, see constant values in Filters class. e.g. 'beforeRoute'.
@param callable $filter | [
"Registers",
"a",
"filter",
"function",
"."
] | 67585b061a50f20da23de75ce920c8e26517d900 | https://github.com/roydejong/Enlighten/blob/67585b061a50f20da23de75ce920c8e26517d900/lib/Routing/Filters.php#L61-L68 |
3,181 | issei-m/simple-job-queue | Worker.php | Worker.start | public function start(int $maxRuntimeInSec = 60 * 15): void
{
\pcntl_signal(SIGTERM, function () {
$this->shouldTerminate = true;
$this->logger->debug('Caught SIGTERM, worker goes into termination.');
});
$this->startedTime = \time();
$this->logger->info('Wo... | php | public function start(int $maxRuntimeInSec = 60 * 15): void
{
\pcntl_signal(SIGTERM, function () {
$this->shouldTerminate = true;
$this->logger->debug('Caught SIGTERM, worker goes into termination.');
});
$this->startedTime = \time();
$this->logger->info('Wo... | [
"public",
"function",
"start",
"(",
"int",
"$",
"maxRuntimeInSec",
"=",
"60",
"*",
"15",
")",
":",
"void",
"{",
"\\",
"pcntl_signal",
"(",
"SIGTERM",
",",
"function",
"(",
")",
"{",
"$",
"this",
"->",
"shouldTerminate",
"=",
"true",
";",
"$",
"this",
... | Starts polling to run jobs.
@param int $maxRuntimeInSec The maximum runtime in second, the polling will be terminated after this time was elapsed. | [
"Starts",
"polling",
"to",
"run",
"jobs",
"."
] | 2fcc9f7a123b690664f470aad9b52a991b540d0d | https://github.com/issei-m/simple-job-queue/blob/2fcc9f7a123b690664f470aad9b52a991b540d0d/Worker.php#L90-L119 |
3,182 | gliverphp/database | src/DbException.php | DbeException.show | public function show()
{
//get the global $config array for site title
global $config;
//set the title variable
$title = $config['title'];
//the variable to be populated with the error message
$msg = $this->getCode() . ': Error on line '.$this->getLine().' in '.$this->getFile() .': <b> "'.$this->getMess... | php | public function show()
{
//get the global $config array for site title
global $config;
//set the title variable
$title = $config['title'];
//the variable to be populated with the error message
$msg = $this->getCode() . ': Error on line '.$this->getLine().' in '.$this->getFile() .': <b> "'.$this->getMess... | [
"public",
"function",
"show",
"(",
")",
"{",
"//get the global $config array for site title",
"global",
"$",
"config",
";",
"//set the title variable",
"$",
"title",
"=",
"$",
"config",
"[",
"'title'",
"]",
";",
"//the variable to be populated with the error message",
"$"... | This method displays the error message
@param | [
"This",
"method",
"displays",
"the",
"error",
"message"
] | b998bd3d24cb2f269b9bd54438c7df8751377ba9 | https://github.com/gliverphp/database/blob/b998bd3d24cb2f269b9bd54438c7df8751377ba9/src/DbException.php#L25-L42 |
3,183 | unyx/utils | Arr.php | Arr.add | public static function add(array& $array, string $key, $value, string $delimiter = null)
{
if (null === static::get($array, $key, null, $delimiter)) {
static::set($array, $key, $value, $delimiter);
}
} | php | public static function add(array& $array, string $key, $value, string $delimiter = null)
{
if (null === static::get($array, $key, null, $delimiter)) {
static::set($array, $key, $value, $delimiter);
}
} | [
"public",
"static",
"function",
"add",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"key",
",",
"$",
"value",
",",
"string",
"$",
"delimiter",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"static",
"::",
"get",
"(",
"$",
"array",
",",
... | Adds an element to the given array but only if it does not yet exist.
Note: Null as value of an item is considered a non-existing item for the purposes
of this method.
@param array $array The array to which the element should be added.
@param string $key The key at which the value should be added.
... | [
"Adds",
"an",
"element",
"to",
"the",
"given",
"array",
"but",
"only",
"if",
"it",
"does",
"not",
"yet",
"exist",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L63-L68 |
3,184 | unyx/utils | Arr.php | Arr.collapse | public static function collapse(array $array) : array
{
$results = [];
foreach ($array as $key => $item) {
// Nested arrays will be merged in (non-recursively).
if (is_array($item)) {
$results = array_merge($results, $item); continue;
}
... | php | public static function collapse(array $array) : array
{
$results = [];
foreach ($array as $key => $item) {
// Nested arrays will be merged in (non-recursively).
if (is_array($item)) {
$results = array_merge($results, $item); continue;
}
... | [
"public",
"static",
"function",
"collapse",
"(",
"array",
"$",
"array",
")",
":",
"array",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"// Nested arrays will be merged in (non-recurs... | Collapses an array of arrays into a single array. Not recursive, ie. only the first dimension of arrays
will be collapsed down.
Standard array_merge() rules apply - @link http://php.net/manual/en/function.array-merge.php -
non-array values with numeric keys will be appended to the resulting array in the order they are... | [
"Collapses",
"an",
"array",
"of",
"arrays",
"into",
"a",
"single",
"array",
".",
"Not",
"recursive",
"ie",
".",
"only",
"the",
"first",
"dimension",
"of",
"arrays",
"will",
"be",
"collapsed",
"down",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L146-L171 |
3,185 | unyx/utils | Arr.php | Arr.contains | public static function contains(array $haystack, $needle, bool $strict = true)
{
foreach ($haystack as $value) {
if ((!$strict && $needle == $value) || $needle === $value) {
return true;
}
if (is_array($value) && static::contains($needle, $value, $strict)... | php | public static function contains(array $haystack, $needle, bool $strict = true)
{
foreach ($haystack as $value) {
if ((!$strict && $needle == $value) || $needle === $value) {
return true;
}
if (is_array($value) && static::contains($needle, $value, $strict)... | [
"public",
"static",
"function",
"contains",
"(",
"array",
"$",
"haystack",
",",
"$",
"needle",
",",
"bool",
"$",
"strict",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"haystack",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"(",
"!",
"$",
"strict",
"&&... | Checks whether the given value is contained within the given array. Equivalent of a recursive in_array.
When you are sure you are dealing with a 1-dimensional array, use in_array instead to avoid the overhead.
@param array $haystack The array to search in.
@param mixed $needle The value to search for.
@p... | [
"Checks",
"whether",
"the",
"given",
"value",
"is",
"contained",
"within",
"the",
"given",
"array",
".",
"Equivalent",
"of",
"a",
"recursive",
"in_array",
".",
"When",
"you",
"are",
"sure",
"you",
"are",
"dealing",
"with",
"a",
"1",
"-",
"dimensional",
"ar... | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L182-L195 |
3,186 | unyx/utils | Arr.php | Arr.delimit | public static function delimit(array $array, string $prepend = '', string $delimiter = null)
{
// Results holder.
$results = [];
// Which string delimiter should we use?
if (null === $delimiter) {
$delimiter = static::$delimiter;
}
foreach ($array as $ke... | php | public static function delimit(array $array, string $prepend = '', string $delimiter = null)
{
// Results holder.
$results = [];
// Which string delimiter should we use?
if (null === $delimiter) {
$delimiter = static::$delimiter;
}
foreach ($array as $ke... | [
"public",
"static",
"function",
"delimit",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"prepend",
"=",
"''",
",",
"string",
"$",
"delimiter",
"=",
"null",
")",
"{",
"// Results holder.",
"$",
"results",
"=",
"[",
"]",
";",
"// Which string delimiter shou... | Flattens a multi-dimensional array using the given delimiter.
@param array $array The initial array.
@param string $prepend A string that should be prepended to the keys.
@param string $delimiter The delimiter to use when exploding the key into parts.
@return array The resulting array... | [
"Flattens",
"a",
"multi",
"-",
"dimensional",
"array",
"using",
"the",
"given",
"delimiter",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L205-L224 |
3,187 | unyx/utils | Arr.php | Arr.fetch | public static function fetch(array $array, string $key, string $delimiter = null) : array
{
// Results holder.
$results = [];
// Which string delimiter should we use?
if (null === $delimiter) {
$delimiter = static::$delimiter;
}
foreach (explode($delimit... | php | public static function fetch(array $array, string $key, string $delimiter = null) : array
{
// Results holder.
$results = [];
// Which string delimiter should we use?
if (null === $delimiter) {
$delimiter = static::$delimiter;
}
foreach (explode($delimit... | [
"public",
"static",
"function",
"fetch",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"key",
",",
"string",
"$",
"delimiter",
"=",
"null",
")",
":",
"array",
"{",
"// Results holder.",
"$",
"results",
"=",
"[",
"]",
";",
"// Which string delimiter should ... | Fetches a flattened array of an element nested in the initial array.
@param array $array The initial array.
@param string $key The string delimited key.
@param string $delimiter The delimiter to use when exploding the key into parts.
@return array The resulting array. | [
"Fetches",
"a",
"flattened",
"array",
"of",
"an",
"element",
"nested",
"in",
"the",
"initial",
"array",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L273-L296 |
3,188 | unyx/utils | Arr.php | Arr.find | public static function find(array $array, callable $callback, $default = null)
{
foreach ($array as $key => $value) {
if ($callback($value, $key)) {
return $value;
}
}
return $default;
} | php | public static function find(array $array, callable $callback, $default = null)
{
foreach ($array as $key => $value) {
if ($callback($value, $key)) {
return $value;
}
}
return $default;
} | [
"public",
"static",
"function",
"find",
"(",
"array",
"$",
"array",
",",
"callable",
"$",
"callback",
",",
"$",
"default",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"callbac... | Returns the first value which passes the given truth test.
Aliases:
- @see Arr::detect()
@param array $array The array to traverse.
@param callable $callback The truth test the value should pass.
@param mixed $default The default value to be returned if none of the elements passes the t... | [
"Returns",
"the",
"first",
"value",
"which",
"passes",
"the",
"given",
"truth",
"test",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L309-L318 |
3,189 | unyx/utils | Arr.php | Arr.get | public static function get(array $array, $key = null, $default = null, string $delimiter = null)
{
// Make loops easier for the end-user - return the initial array if the key is null instead of forcing
// a valid value.
if (!isset($key)) {
return $array;
}
// Whi... | php | public static function get(array $array, $key = null, $default = null, string $delimiter = null)
{
// Make loops easier for the end-user - return the initial array if the key is null instead of forcing
// a valid value.
if (!isset($key)) {
return $array;
}
// Whi... | [
"public",
"static",
"function",
"get",
"(",
"array",
"$",
"array",
",",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
",",
"string",
"$",
"delimiter",
"=",
"null",
")",
"{",
"// Make loops easier for the end-user - return the initial array if the key ... | Returns a string delimited key from an array, with a default value if the given key does not exist. If null
is given instead of a key, the whole initial array will be returned.
Note: Nested objects will be accessed as if they were arrays, eg. if "some.nested.object" is an object,
then looking for "some.nested.object.p... | [
"Returns",
"a",
"string",
"delimited",
"key",
"from",
"an",
"array",
"with",
"a",
"default",
"value",
"if",
"the",
"given",
"key",
"does",
"not",
"exist",
".",
"If",
"null",
"is",
"given",
"instead",
"of",
"a",
"key",
"the",
"whole",
"initial",
"array",
... | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L398-L435 |
3,190 | unyx/utils | Arr.php | Arr.has | public static function has(array $array, string $key, string $delimiter = null)
{
// Which string delimiter should we use?
if (null === $delimiter) {
$delimiter = static::$delimiter;
}
foreach (explode($delimiter, $key) as $segment) {
if (!is_array($array) ||... | php | public static function has(array $array, string $key, string $delimiter = null)
{
// Which string delimiter should we use?
if (null === $delimiter) {
$delimiter = static::$delimiter;
}
foreach (explode($delimiter, $key) as $segment) {
if (!is_array($array) ||... | [
"public",
"static",
"function",
"has",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"key",
",",
"string",
"$",
"delimiter",
"=",
"null",
")",
"{",
"// Which string delimiter should we use?",
"if",
"(",
"null",
"===",
"$",
"delimiter",
")",
"{",
"$",
"de... | Checks whether the given string delimited key exists in the array.
Note: Nested objects will not be accessed as if they were arrays, ie. if "some.nested.object" is an object,
not an array, then looking for "some.nested.object.key" will always return false.
@param array $array The array to search in.
@param ... | [
"Checks",
"whether",
"the",
"given",
"string",
"delimited",
"key",
"exists",
"in",
"the",
"array",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L448-L464 |
3,191 | unyx/utils | Arr.php | Arr.pull | public static function pull(&$array, string $key, string $delimiter = null)
{
$value = static::get($array, $key, null, $delimiter);
static::remove($array, $key, $delimiter);
return $value;
} | php | public static function pull(&$array, string $key, string $delimiter = null)
{
$value = static::get($array, $key, null, $delimiter);
static::remove($array, $key, $delimiter);
return $value;
} | [
"public",
"static",
"function",
"pull",
"(",
"&",
"$",
"array",
",",
"string",
"$",
"key",
",",
"string",
"$",
"delimiter",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"static",
"::",
"get",
"(",
"$",
"array",
",",
"$",
"key",
",",
"null",
",",
"$"... | Returns the value for a string delimited key from an array and then removes it.
@param array $array The array to search in.
@param string $key The string delimited key.
@param string $delimiter The delimiter to use when exploding the key into parts.
@return mixed | [
"Returns",
"the",
"value",
"for",
"a",
"string",
"delimited",
"key",
"from",
"an",
"array",
"and",
"then",
"removes",
"it",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L740-L747 |
3,192 | unyx/utils | Arr.php | Arr.remove | public static function remove(array& $array, string $key, string $delimiter = null)
{
// Which string delimiter should we use?
if (!isset($delimiter)) {
$delimiter = static::$delimiter;
}
// Explode the key according to that delimiter.
$keys = explode($delimiter,... | php | public static function remove(array& $array, string $key, string $delimiter = null)
{
// Which string delimiter should we use?
if (!isset($delimiter)) {
$delimiter = static::$delimiter;
}
// Explode the key according to that delimiter.
$keys = explode($delimiter,... | [
"public",
"static",
"function",
"remove",
"(",
"array",
"&",
"$",
"array",
",",
"string",
"$",
"key",
",",
"string",
"$",
"delimiter",
"=",
"null",
")",
"{",
"// Which string delimiter should we use?",
"if",
"(",
"!",
"isset",
"(",
"$",
"delimiter",
")",
"... | Removes a string delimited key from the given array.
@param array& $array The array to search in.
@param string $key The string delimited key.
@param string $delimiter The delimiter to use when exploding the key into parts. | [
"Removes",
"a",
"string",
"delimited",
"key",
"from",
"the",
"given",
"array",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/Arr.php#L756-L775 |
3,193 | Messier-1001/Messier.HttpClient | src/Client.php | Client._sendRequest | protected function _sendRequest( array $parameters )
{
$this->_curlInfo = [];
// Merge defined parameters with default parameters
$parameters = array_merge( static::DEFAULT_REQUEST_PARAMS, $parameters );
// close existing curl handle if defined
$this->_closeCurl();
// Init ... | php | protected function _sendRequest( array $parameters )
{
$this->_curlInfo = [];
// Merge defined parameters with default parameters
$parameters = array_merge( static::DEFAULT_REQUEST_PARAMS, $parameters );
// close existing curl handle if defined
$this->_closeCurl();
// Init ... | [
"protected",
"function",
"_sendRequest",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"this",
"->",
"_curlInfo",
"=",
"[",
"]",
";",
"// Merge defined parameters with default parameters",
"$",
"parameters",
"=",
"array_merge",
"(",
"static",
"::",
"DEFAULT_REQUES... | Runs the request and return the response.
@param array $parameters The request parameters.
@return string|false Returns the response in the usual case, TRUE if result is a file and FALSE on error. | [
"Runs",
"the",
"request",
"and",
"return",
"the",
"response",
"."
] | 27b8edd283fe7e76a25c169668ca41c11f83911c | https://github.com/Messier-1001/Messier.HttpClient/blob/27b8edd283fe7e76a25c169668ca41c11f83911c/src/Client.php#L186-L260 |
3,194 | Messier-1001/Messier.HttpClient | src/Client.php | Client.getCookies | public final function getCookies() : array
{
if ( ! $this->getCookieFile() )
{
return [];
}
unset( $this->_curlHandle );
$text = \file_get_contents( $this->getCookieFile() );
$cookies = [];
foreach ( \explode( "\n", $text ) as $line )
{
$parts = e... | php | public final function getCookies() : array
{
if ( ! $this->getCookieFile() )
{
return [];
}
unset( $this->_curlHandle );
$text = \file_get_contents( $this->getCookieFile() );
$cookies = [];
foreach ( \explode( "\n", $text ) as $line )
{
$parts = e... | [
"public",
"final",
"function",
"getCookies",
"(",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getCookieFile",
"(",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"unset",
"(",
"$",
"this",
"->",
"_curlHandle",
")",
";",
"$",
"text",
... | Gets the current cookies.
@return array | [
"Gets",
"the",
"current",
"cookies",
"."
] | 27b8edd283fe7e76a25c169668ca41c11f83911c | https://github.com/Messier-1001/Messier.HttpClient/blob/27b8edd283fe7e76a25c169668ca41c11f83911c/src/Client.php#L425-L449 |
3,195 | Messier-1001/Messier.HttpClient | src/Client.php | Client.setLastResponseToFile | public function setLastResponseToFile( ?string $lastResponseToFile ) : Client
{
$this->_lastResponseToFile = $lastResponseToFile ?? '';
if ( '' === \trim( $this->_lastResponseToFile ) ) { $this->_lastResponseToFile = null; }
return $this;
} | php | public function setLastResponseToFile( ?string $lastResponseToFile ) : Client
{
$this->_lastResponseToFile = $lastResponseToFile ?? '';
if ( '' === \trim( $this->_lastResponseToFile ) ) { $this->_lastResponseToFile = null; }
return $this;
} | [
"public",
"function",
"setLastResponseToFile",
"(",
"?",
"string",
"$",
"lastResponseToFile",
")",
":",
"Client",
"{",
"$",
"this",
"->",
"_lastResponseToFile",
"=",
"$",
"lastResponseToFile",
"??",
"''",
";",
"if",
"(",
"''",
"===",
"\\",
"trim",
"(",
"$",
... | If here a valid file path is defined, the last response is stored inside the file.
@param null|string $lastResponseToFile
@return Client | [
"If",
"here",
"a",
"valid",
"file",
"path",
"is",
"defined",
"the",
"last",
"response",
"is",
"stored",
"inside",
"the",
"file",
"."
] | 27b8edd283fe7e76a25c169668ca41c11f83911c | https://github.com/Messier-1001/Messier.HttpClient/blob/27b8edd283fe7e76a25c169668ca41c11f83911c/src/Client.php#L526-L535 |
3,196 | Messier-1001/Messier.HttpClient | src/Client.php | Client.sendHead | public function sendHead( string $url, array $parameters = [], array $options = [] )
{
// The request URL
$options[ 'url' ] = $this->_buildUrl( $url, $parameters );
// Getting the headers
$options[ 'header' ] = true;
// Get no body
$options[ 'nobody' ] = true;
return $t... | php | public function sendHead( string $url, array $parameters = [], array $options = [] )
{
// The request URL
$options[ 'url' ] = $this->_buildUrl( $url, $parameters );
// Getting the headers
$options[ 'header' ] = true;
// Get no body
$options[ 'nobody' ] = true;
return $t... | [
"public",
"function",
"sendHead",
"(",
"string",
"$",
"url",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"// The request URL",
"$",
"options",
"[",
"'url'",
"]",
"=",
"$",
"this",
"->",
"_bui... | Executes a HEAD HTTP request to get all response headers.
If no external error handler is defined, on error here an ClientException is thrown
@param string $url The request url.
@param array $parameters Optional GET URL parameters.
@param array $options Known options are: headers, referer, timeout, toFile... | [
"Executes",
"a",
"HEAD",
"HTTP",
"request",
"to",
"get",
"all",
"response",
"headers",
"."
] | 27b8edd283fe7e76a25c169668ca41c11f83911c | https://github.com/Messier-1001/Messier.HttpClient/blob/27b8edd283fe7e76a25c169668ca41c11f83911c/src/Client.php#L567-L579 |
3,197 | Messier-1001/Messier.HttpClient | src/Client.php | Client.sendGet | public function sendGet( string $url, array $parameters = [], array $options = [] )
{
// The request URL
$options[ 'url' ] = $this->_buildUrl( $url, $parameters );
return $this->_sendRequest( $options );
} | php | public function sendGet( string $url, array $parameters = [], array $options = [] )
{
// The request URL
$options[ 'url' ] = $this->_buildUrl( $url, $parameters );
return $this->_sendRequest( $options );
} | [
"public",
"function",
"sendGet",
"(",
"string",
"$",
"url",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"// The request URL",
"$",
"options",
"[",
"'url'",
"]",
"=",
"$",
"this",
"->",
"_buil... | Executes GET HTTP request.
If no external error handler is defined, on error here an ClientException is thrown
@param string $url The request url.
@param array $parameters Optional GET URL parameters.
@param array $options Known options are: headers, referer, timeout, toFile, attemptsMax, attemptsDelay
@r... | [
"Executes",
"GET",
"HTTP",
"request",
"."
] | 27b8edd283fe7e76a25c169668ca41c11f83911c | https://github.com/Messier-1001/Messier.HttpClient/blob/27b8edd283fe7e76a25c169668ca41c11f83911c/src/Client.php#L591-L599 |
3,198 | Messier-1001/Messier.HttpClient | src/Client.php | Client.sendPost | public function sendPost( string $url, array $data = [], array $options = [] )
{
$options[ 'url' ] = $this->_buildUrl( $url );
$options[ 'post' ] = $data;
return $this->_sendRequest( $options );
} | php | public function sendPost( string $url, array $data = [], array $options = [] )
{
$options[ 'url' ] = $this->_buildUrl( $url );
$options[ 'post' ] = $data;
return $this->_sendRequest( $options );
} | [
"public",
"function",
"sendPost",
"(",
"string",
"$",
"url",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"[",
"'url'",
"]",
"=",
"$",
"this",
"->",
"_buildUrl",
"(",
"$",
"url",... | Executes a POST HTTP request.
If no external error handler is defined, on error here an ClientException is thrown
@param string $url The request url.
@param array $data The POST data array.
@param array $options Known options are: headers, referer, timeout, toFile, attemptsMax, attemptsDelay
@return string|b... | [
"Executes",
"a",
"POST",
"HTTP",
"request",
"."
] | 27b8edd283fe7e76a25c169668ca41c11f83911c | https://github.com/Messier-1001/Messier.HttpClient/blob/27b8edd283fe7e76a25c169668ca41c11f83911c/src/Client.php#L611-L619 |
3,199 | Messier-1001/Messier.HttpClient | src/Client.php | Client.sendDownload | public function sendDownload( string $url, string $destinationFile, array $options = [] )
{
$options[ 'url' ] = $this->_buildUrl( $url );
$options[ 'toFile' ] = $destinationFile;
return $this->_sendRequest( $options );
} | php | public function sendDownload( string $url, string $destinationFile, array $options = [] )
{
$options[ 'url' ] = $this->_buildUrl( $url );
$options[ 'toFile' ] = $destinationFile;
return $this->_sendRequest( $options );
} | [
"public",
"function",
"sendDownload",
"(",
"string",
"$",
"url",
",",
"string",
"$",
"destinationFile",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"[",
"'url'",
"]",
"=",
"$",
"this",
"->",
"_buildUrl",
"(",
"$",
"url",
")... | Downloads file to specified destination file.
If no external error handler is defined, on error here an ClientException is thrown
@param string $url The request url.
@param string $destinationFile file destination.
@param array $options Known options are: headers, referer, timeout, attemptsMax, att... | [
"Downloads",
"file",
"to",
"specified",
"destination",
"file",
"."
] | 27b8edd283fe7e76a25c169668ca41c11f83911c | https://github.com/Messier-1001/Messier.HttpClient/blob/27b8edd283fe7e76a25c169668ca41c11f83911c/src/Client.php#L632-L640 |
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.