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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12,100 | monolyth-php/improse | src/View.php | View.getVariables | protected function getVariables()
{
$reflection = new ReflectionClass($this);
foreach ($reflection->getProperties(
ReflectionProperty::IS_PROTECTED |
ReflectionProperty::IS_PRIVATE |
ReflectionProperty::IS_STATIC
) as $property) {
$ignore[] = $... | php | protected function getVariables()
{
$reflection = new ReflectionClass($this);
foreach ($reflection->getProperties(
ReflectionProperty::IS_PROTECTED |
ReflectionProperty::IS_PRIVATE |
ReflectionProperty::IS_STATIC
) as $property) {
$ignore[] = $... | [
"protected",
"function",
"getVariables",
"(",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"reflection",
"->",
"getProperties",
"(",
"ReflectionProperty",
"::",
"IS_PROTECTED",
"|",
"ReflectionPrope... | Internal method to get all template variables, i.e. the public properties
on the view class.
@return array A hash of key/value pairs. | [
"Internal",
"method",
"to",
"get",
"all",
"template",
"variables",
"i",
".",
"e",
".",
"the",
"public",
"properties",
"on",
"the",
"view",
"class",
"."
] | 14b369c6d67436532c81526fc37531a327157524 | https://github.com/monolyth-php/improse/blob/14b369c6d67436532c81526fc37531a327157524/src/View.php#L113-L137 |
12,101 | zepi/turbo-base | Zepi/Web/AccessControl/src/EventHandler/ProfileChangePassword.php | ProfileChangePassword.execute | public function execute(Framework $framework, WebRequest $request, Response $response)
{
// Set the title for the page
$this->setTitle($this->translate('Profile - Change password', '\\Zepi\\Web\\AccessControl'));
// Get the Form object
$changePasswordForm = $this->createForm... | php | public function execute(Framework $framework, WebRequest $request, Response $response)
{
// Set the title for the page
$this->setTitle($this->translate('Profile - Change password', '\\Zepi\\Web\\AccessControl'));
// Get the Form object
$changePasswordForm = $this->createForm... | [
"public",
"function",
"execute",
"(",
"Framework",
"$",
"framework",
",",
"WebRequest",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"// Set the title for the page",
"$",
"this",
"->",
"setTitle",
"(",
"$",
"this",
"->",
"translate",
"(",
"'Prof... | Displays the change password site for the profile.
@access public
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response | [
"Displays",
"the",
"change",
"password",
"site",
"for",
"the",
"profile",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/EventHandler/ProfileChangePassword.php#L90-L128 |
12,102 | zepi/turbo-base | Zepi/Web/AccessControl/src/EventHandler/ProfileChangePassword.php | ProfileChangePassword.createForm | protected function createForm(Framework $framework, WebRequest $request, Response $response)
{
// Create the form
$form = new Form('change-password', $request->getFullRoute('profile/change-password'), 'post');
// Add the user data group
$errorBox = new ErrorBox(
... | php | protected function createForm(Framework $framework, WebRequest $request, Response $response)
{
// Create the form
$form = new Form('change-password', $request->getFullRoute('profile/change-password'), 'post');
// Add the user data group
$errorBox = new ErrorBox(
... | [
"protected",
"function",
"createForm",
"(",
"Framework",
"$",
"framework",
",",
"WebRequest",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"// Create the form",
"$",
"form",
"=",
"new",
"Form",
"(",
"'change-password'",
",",
"$",
"request",
"->"... | Returns the Form object for the change password form
@access protected
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response
@return \Zepi\Web\UserInterface\Form\Form | [
"Returns",
"the",
"Form",
"object",
"for",
"the",
"change",
"password",
"form"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/EventHandler/ProfileChangePassword.php#L204-L254 |
12,103 | tenside/core | src/Util/FunctionAvailabilityCheck.php | FunctionAvailabilityCheck.isFunctionEnabled | public static function isFunctionEnabled($function, $extension = null)
{
return
(null === $extension || extension_loaded($extension))
&& !static::isFunctionBlacklistedInPhpIni($function)
&& !static::isFunctionBlacklistedInSuhosin($function)
&& static::isFuncti... | php | public static function isFunctionEnabled($function, $extension = null)
{
return
(null === $extension || extension_loaded($extension))
&& !static::isFunctionBlacklistedInPhpIni($function)
&& !static::isFunctionBlacklistedInSuhosin($function)
&& static::isFuncti... | [
"public",
"static",
"function",
"isFunctionEnabled",
"(",
"$",
"function",
",",
"$",
"extension",
"=",
"null",
")",
"{",
"return",
"(",
"null",
"===",
"$",
"extension",
"||",
"extension_loaded",
"(",
"$",
"extension",
")",
")",
"&&",
"!",
"static",
"::",
... | Check if function is defined.
@param string $function The function to test.
@param string|null $extension The optional name of an php extension providing said function.
@return bool | [
"Check",
"if",
"function",
"is",
"defined",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Util/FunctionAvailabilityCheck.php#L52-L59 |
12,104 | tenside/core | src/Util/FunctionAvailabilityCheck.php | FunctionAvailabilityCheck.isFunctionBlacklistedInSuhosin | public static function isFunctionBlacklistedInSuhosin($function)
{
if (!extension_loaded('suhosin')) {
return false;
}
if (!isset(self::$blackListSuhosin)) {
self::$blackListSuhosin = static::prepareList(ini_get('suhosin.executor.func.blacklist'));
}
... | php | public static function isFunctionBlacklistedInSuhosin($function)
{
if (!extension_loaded('suhosin')) {
return false;
}
if (!isset(self::$blackListSuhosin)) {
self::$blackListSuhosin = static::prepareList(ini_get('suhosin.executor.func.blacklist'));
}
... | [
"public",
"static",
"function",
"isFunctionBlacklistedInSuhosin",
"(",
"$",
"function",
")",
"{",
"if",
"(",
"!",
"extension_loaded",
"(",
"'suhosin'",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"blackListS... | Check if function is blacklisted in Suhosin.
@param string $function The function to test.
@return bool | [
"Check",
"if",
"function",
"is",
"blacklisted",
"in",
"Suhosin",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Util/FunctionAvailabilityCheck.php#L80-L91 |
12,105 | tenside/core | src/Util/FunctionAvailabilityCheck.php | FunctionAvailabilityCheck.isFunctionBlacklistedInPhpIni | public static function isFunctionBlacklistedInPhpIni($function)
{
if (!isset(self::$blackListPhpIni)) {
self::$blackListPhpIni = static::prepareList(ini_get('disable_functions'));
}
return static::isFunctionsMentionedInList($function, self::$blackListPhpIni);
} | php | public static function isFunctionBlacklistedInPhpIni($function)
{
if (!isset(self::$blackListPhpIni)) {
self::$blackListPhpIni = static::prepareList(ini_get('disable_functions'));
}
return static::isFunctionsMentionedInList($function, self::$blackListPhpIni);
} | [
"public",
"static",
"function",
"isFunctionBlacklistedInPhpIni",
"(",
"$",
"function",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"blackListPhpIni",
")",
")",
"{",
"self",
"::",
"$",
"blackListPhpIni",
"=",
"static",
"::",
"prepareList",
"(",... | Check if method is blacklisted in Suhosin.
@param string $function The function to test.
@return bool | [
"Check",
"if",
"method",
"is",
"blacklisted",
"in",
"Suhosin",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Util/FunctionAvailabilityCheck.php#L100-L107 |
12,106 | Stratadox/HydrationMapping | src/Property/Relationship/HasManyProxies.php | HasManyProxies.inProperty | public static function inProperty(
string $name,
DeserializesCollections $collection,
ProducesProxies $proxyBuilder
): ExposesDataKey {
return new self($name, $name, $collection, $proxyBuilder);
} | php | public static function inProperty(
string $name,
DeserializesCollections $collection,
ProducesProxies $proxyBuilder
): ExposesDataKey {
return new self($name, $name, $collection, $proxyBuilder);
} | [
"public",
"static",
"function",
"inProperty",
"(",
"string",
"$",
"name",
",",
"DeserializesCollections",
"$",
"collection",
",",
"ProducesProxies",
"$",
"proxyBuilder",
")",
":",
"ExposesDataKey",
"{",
"return",
"new",
"self",
"(",
"$",
"name",
",",
"$",
"nam... | Creates a new lazily loaded has-many mapping.
@param string $name The name of both the key and
the property.
@param DeserializesCollections $collection The deserializer for the
collection.
@param ProducesProxies $proxyBuilder The proxy builder.
@return ExposesDataKey ... | [
"Creates",
"a",
"new",
"lazily",
"loaded",
"has",
"-",
"many",
"mapping",
"."
] | b145deaaf76ab8c8060f0cba1a8c6f73da375982 | https://github.com/Stratadox/HydrationMapping/blob/b145deaaf76ab8c8060f0cba1a8c6f73da375982/src/Property/Relationship/HasManyProxies.php#L48-L54 |
12,107 | Stratadox/HydrationMapping | src/Property/Relationship/HasManyProxies.php | HasManyProxies.inPropertyWithDifferentKey | public static function inPropertyWithDifferentKey(
string $name,
string $key,
DeserializesCollections $collection,
ProducesProxies $proxyBuilder
): ExposesDataKey {
return new self($name, $key, $collection, $proxyBuilder);
} | php | public static function inPropertyWithDifferentKey(
string $name,
string $key,
DeserializesCollections $collection,
ProducesProxies $proxyBuilder
): ExposesDataKey {
return new self($name, $key, $collection, $proxyBuilder);
} | [
"public",
"static",
"function",
"inPropertyWithDifferentKey",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"key",
",",
"DeserializesCollections",
"$",
"collection",
",",
"ProducesProxies",
"$",
"proxyBuilder",
")",
":",
"ExposesDataKey",
"{",
"return",
"new",
"... | Creates a new lazily loading has-many mapping, using the data from a
specific key.
@param string $name The name of the property.
@param string $key The array key to use.
@param DeserializesCollections $collection The deserializer for the
collection.
@param ProducesP... | [
"Creates",
"a",
"new",
"lazily",
"loading",
"has",
"-",
"many",
"mapping",
"using",
"the",
"data",
"from",
"a",
"specific",
"key",
"."
] | b145deaaf76ab8c8060f0cba1a8c6f73da375982 | https://github.com/Stratadox/HydrationMapping/blob/b145deaaf76ab8c8060f0cba1a8c6f73da375982/src/Property/Relationship/HasManyProxies.php#L67-L74 |
12,108 | Stratadox/HydrationMapping | src/Property/Relationship/HasManyProxies.php | HasManyProxies.makeSomeProxies | private function makeSomeProxies(int $amount, ?object $owner): array
{
$proxies = [];
for ($i = 0; $i < $amount; ++$i) {
$proxies[] = $this->proxyBuilder->createFor($owner, $this->name(), $i);
}
return $proxies;
} | php | private function makeSomeProxies(int $amount, ?object $owner): array
{
$proxies = [];
for ($i = 0; $i < $amount; ++$i) {
$proxies[] = $this->proxyBuilder->createFor($owner, $this->name(), $i);
}
return $proxies;
} | [
"private",
"function",
"makeSomeProxies",
"(",
"int",
"$",
"amount",
",",
"?",
"object",
"$",
"owner",
")",
":",
"array",
"{",
"$",
"proxies",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"amount",
";",
"++",
"$"... | Produces the proxies for in the collection.
@param int $amount The amount of proxies to produce.
@param object|null $owner The object that holds a reference to the proxy.
@return array List of proxy objects. | [
"Produces",
"the",
"proxies",
"for",
"in",
"the",
"collection",
"."
] | b145deaaf76ab8c8060f0cba1a8c6f73da375982 | https://github.com/Stratadox/HydrationMapping/blob/b145deaaf76ab8c8060f0cba1a8c6f73da375982/src/Property/Relationship/HasManyProxies.php#L112-L119 |
12,109 | drdplusinfo/drdplus-combat-actions | DrdPlus/CombatActions/CombatActions.php | CombatActions.sanitizeRoundsOfAiming | private function sanitizeRoundsOfAiming($roundsOfAiming): int
{
try {
$roundsOfAiming = ToInteger::toPositiveInteger($roundsOfAiming);
if ($roundsOfAiming > 3) {
return 3;
}
return $roundsOfAiming;
} catch (\Granam\Integer\Tools\Except... | php | private function sanitizeRoundsOfAiming($roundsOfAiming): int
{
try {
$roundsOfAiming = ToInteger::toPositiveInteger($roundsOfAiming);
if ($roundsOfAiming > 3) {
return 3;
}
return $roundsOfAiming;
} catch (\Granam\Integer\Tools\Except... | [
"private",
"function",
"sanitizeRoundsOfAiming",
"(",
"$",
"roundsOfAiming",
")",
":",
"int",
"{",
"try",
"{",
"$",
"roundsOfAiming",
"=",
"ToInteger",
"::",
"toPositiveInteger",
"(",
"$",
"roundsOfAiming",
")",
";",
"if",
"(",
"$",
"roundsOfAiming",
">",
"3",... | Aiming gives bonus up to three rounds of aim, any addition is thrown away.
@param int $roundsOfAiming
@return int
@throws \DrdPlus\CombatActions\Exceptions\InvalidFormatOfRoundsOfAiming | [
"Aiming",
"gives",
"bonus",
"up",
"to",
"three",
"rounds",
"of",
"aim",
"any",
"addition",
"is",
"thrown",
"away",
"."
] | a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0 | https://github.com/drdplusinfo/drdplus-combat-actions/blob/a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0/DrdPlus/CombatActions/CombatActions.php#L152-L164 |
12,110 | drdplusinfo/drdplus-combat-actions | DrdPlus/CombatActions/CombatActions.php | CombatActions.getAttackNumberModifier | public function getAttackNumberModifier(): int
{
$attackNumber = 0;
foreach ($this->combatActionCodes as $combatActionCode) {
if ($combatActionCode->getValue() === MeleeCombatActionCode::HEADLESS_ATTACK) {
$attackNumber += 2;
}
if ($combatActionCod... | php | public function getAttackNumberModifier(): int
{
$attackNumber = 0;
foreach ($this->combatActionCodes as $combatActionCode) {
if ($combatActionCode->getValue() === MeleeCombatActionCode::HEADLESS_ATTACK) {
$attackNumber += 2;
}
if ($combatActionCod... | [
"public",
"function",
"getAttackNumberModifier",
"(",
")",
":",
"int",
"{",
"$",
"attackNumber",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"combatActionCodes",
"as",
"$",
"combatActionCode",
")",
"{",
"if",
"(",
"$",
"combatActionCode",
"->",
"getVal... | Note about AIMED SHOT, you have to provide rounds of aim to get expected attack number.
Maximum counted is +3, more if truncated.
@return int | [
"Note",
"about",
"AIMED",
"SHOT",
"you",
"have",
"to",
"provide",
"rounds",
"of",
"aim",
"to",
"get",
"expected",
"attack",
"number",
".",
"Maximum",
"counted",
"is",
"+",
"3",
"more",
"if",
"truncated",
"."
] | a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0 | https://github.com/drdplusinfo/drdplus-combat-actions/blob/a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0/DrdPlus/CombatActions/CombatActions.php#L253-L288 |
12,111 | drdplusinfo/drdplus-combat-actions | DrdPlus/CombatActions/CombatActions.php | CombatActions.getDefenseNumberModifierAgainstFasterOpponent | public function getDefenseNumberModifierAgainstFasterOpponent(): int
{
$defenseNumberModifier = $this->getDefenseNumberModifier();
foreach ($this->combatActionCodes as $combatActionCode) {
if ($combatActionCode->getValue() === CombatActionCode::RUN) {
$defenseNumberModifi... | php | public function getDefenseNumberModifierAgainstFasterOpponent(): int
{
$defenseNumberModifier = $this->getDefenseNumberModifier();
foreach ($this->combatActionCodes as $combatActionCode) {
if ($combatActionCode->getValue() === CombatActionCode::RUN) {
$defenseNumberModifi... | [
"public",
"function",
"getDefenseNumberModifierAgainstFasterOpponent",
"(",
")",
":",
"int",
"{",
"$",
"defenseNumberModifier",
"=",
"$",
"this",
"->",
"getDefenseNumberModifier",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"combatActionCodes",
"as",
"$",
"c... | Against those opponents acting faster then you, you can have significantly lower defense because they catch you
unprepared.
@return int | [
"Against",
"those",
"opponents",
"acting",
"faster",
"then",
"you",
"you",
"can",
"have",
"significantly",
"lower",
"defense",
"because",
"they",
"catch",
"you",
"unprepared",
"."
] | a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0 | https://github.com/drdplusinfo/drdplus-combat-actions/blob/a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0/DrdPlus/CombatActions/CombatActions.php#L377-L390 |
12,112 | drdplusinfo/drdplus-combat-actions | DrdPlus/CombatActions/CombatActions.php | CombatActions.getSpeedModifier | public function getSpeedModifier(): int
{
$speedBonus = 0;
foreach ($this->combatActionCodes as $combatActionCode) {
/** can not be combined with RUN, but that should be solved in @see validateActionCodesCoWork */
if ($combatActionCode->getValue() === CombatActionCode::MOVE) ... | php | public function getSpeedModifier(): int
{
$speedBonus = 0;
foreach ($this->combatActionCodes as $combatActionCode) {
/** can not be combined with RUN, but that should be solved in @see validateActionCodesCoWork */
if ($combatActionCode->getValue() === CombatActionCode::MOVE) ... | [
"public",
"function",
"getSpeedModifier",
"(",
")",
":",
"int",
"{",
"$",
"speedBonus",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"combatActionCodes",
"as",
"$",
"combatActionCode",
")",
"{",
"/** can not be combined with RUN, but that should be solved in @see... | In case of MOVE or RUN there is significant speed increment.
@return int | [
"In",
"case",
"of",
"MOVE",
"or",
"RUN",
"there",
"is",
"significant",
"speed",
"increment",
"."
] | a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0 | https://github.com/drdplusinfo/drdplus-combat-actions/blob/a12fb21acbe53ac3cebac0f8b38c767ad93b6ae0/DrdPlus/CombatActions/CombatActions.php#L397-L414 |
12,113 | Niirrty/Niirrty.Translation | src/Sources/AbstractSource.php | AbstractSource.setLogger | public final function setLogger( ?LoggerInterface $logger )
{
$this->_options[ 'logger' ] = null === $logger ? new NullLogger() : $logger;
unset( $this->_options[ 'data' ] );
return $this;
} | php | public final function setLogger( ?LoggerInterface $logger )
{
$this->_options[ 'logger' ] = null === $logger ? new NullLogger() : $logger;
unset( $this->_options[ 'data' ] );
return $this;
} | [
"public",
"final",
"function",
"setLogger",
"(",
"?",
"LoggerInterface",
"$",
"logger",
")",
"{",
"$",
"this",
"->",
"_options",
"[",
"'logger'",
"]",
"=",
"null",
"===",
"$",
"logger",
"?",
"new",
"NullLogger",
"(",
")",
":",
"$",
"logger",
";",
"unse... | Sets a new logger or null if no logger should be used.
@param \Psr\Log\LoggerInterface|null $logger
@return \Niirrty\Translation\Sources\ISource | [
"Sets",
"a",
"new",
"logger",
"or",
"null",
"if",
"no",
"logger",
"should",
"be",
"used",
"."
] | 5b1ad27fb87c14435edd2dc03e9af46dd5062de8 | https://github.com/Niirrty/Niirrty.Translation/blob/5b1ad27fb87c14435edd2dc03e9af46dd5062de8/src/Sources/AbstractSource.php#L112-L121 |
12,114 | Niirrty/Niirrty.Translation | src/Sources/AbstractSource.php | AbstractSource.setOption | public function setOption( string $name, $value )
{
$this->_options[ $name ] = $value;
unset( $this->_options[ 'data' ] );
return $this;
} | php | public function setOption( string $name, $value )
{
$this->_options[ $name ] = $value;
unset( $this->_options[ 'data' ] );
return $this;
} | [
"public",
"function",
"setOption",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_options",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"unset",
"(",
"$",
"this",
"->",
"_options",
"[",
"'data'",
"]",
")",
";",
"... | Sets a options value.
@param string $name
@param mixed $value
@return \Niirrty\Translation\Sources\AbstractSource | [
"Sets",
"a",
"options",
"value",
"."
] | 5b1ad27fb87c14435edd2dc03e9af46dd5062de8 | https://github.com/Niirrty/Niirrty.Translation/blob/5b1ad27fb87c14435edd2dc03e9af46dd5062de8/src/Sources/AbstractSource.php#L174-L183 |
12,115 | iRAP-software/package-table-creator | TableEditor.php | TableEditor.addFields | public function addFields(array $fields)
{
foreach ($fields as $field)
{
$name = $field->getName();
$addFields[$name] = $field; # we key by name to prevent duplicates!
}
$keysString = "";
$fieldStrings = array();
foreach ($add... | php | public function addFields(array $fields)
{
foreach ($fields as $field)
{
$name = $field->getName();
$addFields[$name] = $field; # we key by name to prevent duplicates!
}
$keysString = "";
$fieldStrings = array();
foreach ($add... | [
"public",
"function",
"addFields",
"(",
"array",
"$",
"fields",
")",
"{",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"name",
"=",
"$",
"field",
"->",
"getName",
"(",
")",
";",
"$",
"addFields",
"[",
"$",
"name",
"]",
"=",
"... | Adds the specified fields to this table.
@param array $fields - an array of DatabaseField objects | [
"Adds",
"the",
"specified",
"fields",
"to",
"this",
"table",
"."
] | 069dfe5b95ec1bff4acc7d28affabce3e005c69c | https://github.com/iRAP-software/package-table-creator/blob/069dfe5b95ec1bff4acc7d28affabce3e005c69c/TableEditor.php#L49-L103 |
12,116 | iRAP-software/package-table-creator | TableEditor.php | TableEditor.removeKey | public function removeKey($key)
{
if (is_array($key))
{
$keyString = "(" . implode(',', $key) . ")";
}
else
{
$keyString = "`" . $key . "`";
}
$query =
"ALTER TABLE " .
'`' . $this->m_name . '` ' .
... | php | public function removeKey($key)
{
if (is_array($key))
{
$keyString = "(" . implode(',', $key) . ")";
}
else
{
$keyString = "`" . $key . "`";
}
$query =
"ALTER TABLE " .
'`' . $this->m_name . '` ' .
... | [
"public",
"function",
"removeKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"keyString",
"=",
"\"(\"",
".",
"implode",
"(",
"','",
",",
"$",
"key",
")",
".",
"\")\"",
";",
"}",
"else",
"{",
"$",
"ke... | Remove a key from the database. This does not remove the field itself.
@param String $key - the name of the field that is currently a key.
@throws Exception | [
"Remove",
"a",
"key",
"from",
"the",
"database",
".",
"This",
"does",
"not",
"remove",
"the",
"field",
"itself",
"."
] | 069dfe5b95ec1bff4acc7d28affabce3e005c69c | https://github.com/iRAP-software/package-table-creator/blob/069dfe5b95ec1bff4acc7d28affabce3e005c69c/TableEditor.php#L140-L158 |
12,117 | iRAP-software/package-table-creator | TableEditor.php | TableEditor.changeEngine | public function changeEngine($engine)
{
$allowed_engines = array(
self::ENGINE_INNODB,
self::ENGINE_MYISAM
);
if (!in_array($engine, $allowed_engines))
{
throw new \Exception('Unrecognized engine: ' . $engine);
}
$... | php | public function changeEngine($engine)
{
$allowed_engines = array(
self::ENGINE_INNODB,
self::ENGINE_MYISAM
);
if (!in_array($engine, $allowed_engines))
{
throw new \Exception('Unrecognized engine: ' . $engine);
}
$... | [
"public",
"function",
"changeEngine",
"(",
"$",
"engine",
")",
"{",
"$",
"allowed_engines",
"=",
"array",
"(",
"self",
"::",
"ENGINE_INNODB",
",",
"self",
"::",
"ENGINE_MYISAM",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"engine",
",",
"$",
"allowed... | Change the tables engine to something else. Please make use of this classes constants
when providing the engine parameter.
@param String $engine - the name of the engine to change to.
@return type
@throws Exception | [
"Change",
"the",
"tables",
"engine",
"to",
"something",
"else",
".",
"Please",
"make",
"use",
"of",
"this",
"classes",
"constants",
"when",
"providing",
"the",
"engine",
"parameter",
"."
] | 069dfe5b95ec1bff4acc7d28affabce3e005c69c | https://github.com/iRAP-software/package-table-creator/blob/069dfe5b95ec1bff4acc7d28affabce3e005c69c/TableEditor.php#L243-L261 |
12,118 | squire-assistant/process | ProcessBuilder.php | ProcessBuilder.setOption | public function setOption($name, $value)
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
$this->options[$name] = $value;
return $this;
} | php | public function setOption($name, $value)
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
$this->options[$name] = $value;
return $this;
} | [
"public",
"function",
"setOption",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The %s() method is deprecated since version 3.3 and will be removed in 4.0.'",
",",
"__METHOD__",
")",
",",
"E_USER_DEPRECATED",
")",
";",
"$... | Adds a proc_open option.
@param string $name The option name
@param string $value The option value
@return $this
@deprecated since version 3.3, to be removed in 4.0. | [
"Adds",
"a",
"proc_open",
"option",
"."
] | 472d47ef8f312fc0c6c1eb26df1e508550aea243 | https://github.com/squire-assistant/process/blob/472d47ef8f312fc0c6c1eb26df1e508550aea243/ProcessBuilder.php#L227-L234 |
12,119 | anekdotes/support | src/anekdotes/Arr.php | Arr.sortByKey | public static function sortByKey($data, $sortKey, $sort_flags = SORT_ASC)
{
if (empty($data) or empty($sortKey)) {
return $data;
}
$ordered = [];
$i = 0;
foreach ($data as $key => $value) {
++$i;
$ordered[$value[$sortKey].'-'.$i] = $value;
}
sw... | php | public static function sortByKey($data, $sortKey, $sort_flags = SORT_ASC)
{
if (empty($data) or empty($sortKey)) {
return $data;
}
$ordered = [];
$i = 0;
foreach ($data as $key => $value) {
++$i;
$ordered[$value[$sortKey].'-'.$i] = $value;
}
sw... | [
"public",
"static",
"function",
"sortByKey",
"(",
"$",
"data",
",",
"$",
"sortKey",
",",
"$",
"sort_flags",
"=",
"SORT_ASC",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
"or",
"empty",
"(",
"$",
"sortKey",
")",
")",
"{",
"return",
"$",
"dat... | Sort the array by an object's key value.
@param array $data The array to sort
@param string $sortKey On which object's key the array must be sorted
@param \enum $sort_flags Either SORT_ASC or SORT_DESC. Defines if the sort is ascending or descending
@return array The ordered array | [
"Sort",
"the",
"array",
"by",
"an",
"object",
"s",
"key",
"value",
"."
] | 071befb735b6ec464be41dc9be7eeeb4b2a89467 | https://github.com/anekdotes/support/blob/071befb735b6ec464be41dc9be7eeeb4b2a89467/src/anekdotes/Arr.php#L19-L42 |
12,120 | anekdotes/support | src/anekdotes/Arr.php | Arr.getWhere | public static function getWhere($array, $key, $search, $default = null)
{
foreach ($array as $item) {
if (isset($item[$key]) && $item[$key] == $search) {
return $item;
}
}
return $default;
} | php | public static function getWhere($array, $key, $search, $default = null)
{
foreach ($array as $item) {
if (isset($item[$key]) && $item[$key] == $search) {
return $item;
}
}
return $default;
} | [
"public",
"static",
"function",
"getWhere",
"(",
"$",
"array",
",",
"$",
"key",
",",
"$",
"search",
",",
"$",
"default",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"item",
"[",
... | Get an object in the array where its key is the same as the search value.
@param array $array Array to search in
@param string $key Key we're searching on
@param mixed $search Value we're searching in the object
@param mixed $default Default value in case no boject has the matching value for ... | [
"Get",
"an",
"object",
"in",
"the",
"array",
"where",
"its",
"key",
"is",
"the",
"same",
"as",
"the",
"search",
"value",
"."
] | 071befb735b6ec464be41dc9be7eeeb4b2a89467 | https://github.com/anekdotes/support/blob/071befb735b6ec464be41dc9be7eeeb4b2a89467/src/anekdotes/Arr.php#L72-L81 |
12,121 | anekdotes/support | src/anekdotes/Arr.php | Arr.seedShuffle | public static function seedShuffle(&$array, $seed)
{
@mt_srand($seed);
for ($i = count($array) - 1; $i > 0; --$i) {
$j = @mt_rand(0, $i);
$tmp = $array[$i];
$array[$i] = $array[$j];
$array[$j] = $tmp;
}
} | php | public static function seedShuffle(&$array, $seed)
{
@mt_srand($seed);
for ($i = count($array) - 1; $i > 0; --$i) {
$j = @mt_rand(0, $i);
$tmp = $array[$i];
$array[$i] = $array[$j];
$array[$j] = $tmp;
}
} | [
"public",
"static",
"function",
"seedShuffle",
"(",
"&",
"$",
"array",
",",
"$",
"seed",
")",
"{",
"@",
"mt_srand",
"(",
"$",
"seed",
")",
";",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"array",
")",
"-",
"1",
";",
"$",
"i",
">",
"0",
";"... | Shuffles the array using a Seed.
@param array $array Array we're shuffling
@param int $seed Seed we're using to shuffle
@link https://en.wikipedia.org/wiki/Fisher–Yates_shuffle | [
"Shuffles",
"the",
"array",
"using",
"a",
"Seed",
"."
] | 071befb735b6ec464be41dc9be7eeeb4b2a89467 | https://github.com/anekdotes/support/blob/071befb735b6ec464be41dc9be7eeeb4b2a89467/src/anekdotes/Arr.php#L117-L126 |
12,122 | ptorn/bth-anax-user | src/User/UserActiveRecordModel.php | UserActiveRecordModel.setUserData | public function setUserData(User $user)
{
$userVarArray = get_object_vars($user);
foreach ($userVarArray as $key => $value) {
if ($value !== null) {
$this->{$key} = $value;
}
}
} | php | public function setUserData(User $user)
{
$userVarArray = get_object_vars($user);
foreach ($userVarArray as $key => $value) {
if ($value !== null) {
$this->{$key} = $value;
}
}
} | [
"public",
"function",
"setUserData",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"userVarArray",
"=",
"get_object_vars",
"(",
"$",
"user",
")",
";",
"foreach",
"(",
"$",
"userVarArray",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"va... | Dynamicly set user properties to its value.
@param User $user user object | [
"Dynamicly",
"set",
"user",
"properties",
"to",
"its",
"value",
"."
] | 223e569cbebfd3f9302bdef648b13b73cb3f1d19 | https://github.com/ptorn/bth-anax-user/blob/223e569cbebfd3f9302bdef648b13b73cb3f1d19/src/User/UserActiveRecordModel.php#L91-L100 |
12,123 | ptorn/bth-anax-user | src/User/UserActiveRecordModel.php | UserActiveRecordModel.findAllUsers | public function findAllUsers()
{
$this->checkDb();
return $this->db->connect()
->select()
->from($this->tableName)
->where("deleted IS NULL")
->execute()
->fetchAllClass(get_class(... | php | public function findAllUsers()
{
$this->checkDb();
return $this->db->connect()
->select()
->from($this->tableName)
->where("deleted IS NULL")
->execute()
->fetchAllClass(get_class(... | [
"public",
"function",
"findAllUsers",
"(",
")",
"{",
"$",
"this",
"->",
"checkDb",
"(",
")",
";",
"return",
"$",
"this",
"->",
"db",
"->",
"connect",
"(",
")",
"->",
"select",
"(",
")",
"->",
"from",
"(",
"$",
"this",
"->",
"tableName",
")",
"->",
... | Returns all users stored and that are not deleted.
@return array Array with all users. | [
"Returns",
"all",
"users",
"stored",
"and",
"that",
"are",
"not",
"deleted",
"."
] | 223e569cbebfd3f9302bdef648b13b73cb3f1d19 | https://github.com/ptorn/bth-anax-user/blob/223e569cbebfd3f9302bdef648b13b73cb3f1d19/src/User/UserActiveRecordModel.php#L125-L134 |
12,124 | maikovisky/laravel-plus | src/PackagerHelper.php | PackagerHelper.removeDir | public function removeDir($path)
{
if ($path == 'packages' or $path == '/') {
return false;
}
$files = array_diff(scandir($path), ['.', '..']);
foreach ($files as $file) {
if (is_dir("$path/$file")) {
$this->removeDir("$path/$file");
... | php | public function removeDir($path)
{
if ($path == 'packages' or $path == '/') {
return false;
}
$files = array_diff(scandir($path), ['.', '..']);
foreach ($files as $file) {
if (is_dir("$path/$file")) {
$this->removeDir("$path/$file");
... | [
"public",
"function",
"removeDir",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"$",
"path",
"==",
"'packages'",
"or",
"$",
"path",
"==",
"'/'",
")",
"{",
"return",
"false",
";",
"}",
"$",
"files",
"=",
"array_diff",
"(",
"scandir",
"(",
"$",
"path",
")"... | Remove a directory if it exists.
@param string $path Path of the directory to remove.
@return void | [
"Remove",
"a",
"directory",
"if",
"it",
"exists",
"."
] | 554ff8da981aa0b0c521c0c9326edc7569049b0c | https://github.com/maikovisky/laravel-plus/blob/554ff8da981aa0b0c521c0c9326edc7569049b0c/src/PackagerHelper.php#L90-L107 |
12,125 | Softpampa/moip-sdk-php | src/Payments/Resources/Notifications.php | Notifications.delete | public function delete($id = null)
{
if (! $id) {
$id = $this->data->id;
}
return $this->client->delete('/{id}', ['id' => $id]);
} | php | public function delete($id = null)
{
if (! $id) {
$id = $this->data->id;
}
return $this->client->delete('/{id}', ['id' => $id]);
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"data",
"->",
"id",
";",
"}",
"return",
"$",
"this",
"->",
"client",
"->",
"delete",
"(",
"'/{id}'",
... | Delete a notification preference
@param int $id
@return $this | [
"Delete",
"a",
"notification",
"preference"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Payments/Resources/Notifications.php#L48-L55 |
12,126 | Softpampa/moip-sdk-php | src/Payments/Resources/Notifications.php | Notifications.setWebHook | public function setWebHook($url)
{
$this->data->target = $url;
$this->data->media = self::DEFAULT_MEDIA;
return $this;
} | php | public function setWebHook($url)
{
$this->data->target = $url;
$this->data->media = self::DEFAULT_MEDIA;
return $this;
} | [
"public",
"function",
"setWebHook",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"target",
"=",
"$",
"url",
";",
"$",
"this",
"->",
"data",
"->",
"media",
"=",
"self",
"::",
"DEFAULT_MEDIA",
";",
"return",
"$",
"this",
";",
"}"
] | Set WebHook URL
@param string $url
@return $this | [
"Set",
"WebHook",
"URL"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Payments/Resources/Notifications.php#L84-L90 |
12,127 | Softpampa/moip-sdk-php | src/Payments/Resources/Notifications.php | Notifications.setEventsList | public function setEventsList(array $events)
{
$this->data->events = array_merge($this->data->events, $events);
return $this;
} | php | public function setEventsList(array $events)
{
$this->data->events = array_merge($this->data->events, $events);
return $this;
} | [
"public",
"function",
"setEventsList",
"(",
"array",
"$",
"events",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"events",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"data",
"->",
"events",
",",
"$",
"events",
")",
";",
"return",
"$",
"this",
";",
"}"... | Set a list of events name
@param array $events
@return $this | [
"Set",
"a",
"list",
"of",
"events",
"name"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Payments/Resources/Notifications.php#L111-L116 |
12,128 | slickframework/orm | src/Event/AbstractEvent.php | AbstractEvent.getEntityName | public function getEntityName()
{
if (null == $this->entityName) {
$this->setEntityName(get_class($this->getEntity()));
}
return $this->entityName;
} | php | public function getEntityName()
{
if (null == $this->entityName) {
$this->setEntityName(get_class($this->getEntity()));
}
return $this->entityName;
} | [
"public",
"function",
"getEntityName",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"$",
"this",
"->",
"entityName",
")",
"{",
"$",
"this",
"->",
"setEntityName",
"(",
"get_class",
"(",
"$",
"this",
"->",
"getEntity",
"(",
")",
")",
")",
";",
"}",
"return... | Gets the entity class name that triggers the event
@return string | [
"Gets",
"the",
"entity",
"class",
"name",
"that",
"triggers",
"the",
"event"
] | c5c782f5e3a46cdc6c934eda4411cb9edc48f969 | https://github.com/slickframework/orm/blob/c5c782f5e3a46cdc6c934eda4411cb9edc48f969/src/Event/AbstractEvent.php#L73-L79 |
12,129 | phellow/intl | src/IntlService.php | IntlService.replace | protected function replace($text, $replacements)
{
if (is_array($replacements)) {
foreach ($replacements as $var => $replacement) {
$regex = str_replace('key', preg_quote($var, '/'), $this->translateReplaceRegex);
$text = preg_replace($regex, $replacement, $t... | php | protected function replace($text, $replacements)
{
if (is_array($replacements)) {
foreach ($replacements as $var => $replacement) {
$regex = str_replace('key', preg_quote($var, '/'), $this->translateReplaceRegex);
$text = preg_replace($regex, $replacement, $t... | [
"protected",
"function",
"replace",
"(",
"$",
"text",
",",
"$",
"replacements",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"replacements",
")",
")",
"{",
"foreach",
"(",
"$",
"replacements",
"as",
"$",
"var",
"=>",
"$",
"replacement",
")",
"{",
"$",
... | Replace text variables.
@param string $text
@param array|null $replacements
@return string | [
"Replace",
"text",
"variables",
"."
] | 7817f57242a6084ce68ddfb3055191c955ec14f1 | https://github.com/phellow/intl/blob/7817f57242a6084ce68ddfb3055191c955ec14f1/src/IntlService.php#L158-L167 |
12,130 | phellow/intl | src/IntlService.php | IntlService._ | public function _($text, $replacements = null, $locale = null)
{
if (!$locale) {
$locale = $this->getLocale();
}
if ($this->translator !== null) {
$text = $this->translator->translate($text, $locale);
}
return $this->replace($text, $replace... | php | public function _($text, $replacements = null, $locale = null)
{
if (!$locale) {
$locale = $this->getLocale();
}
if ($this->translator !== null) {
$text = $this->translator->translate($text, $locale);
}
return $this->replace($text, $replace... | [
"public",
"function",
"_",
"(",
"$",
"text",
",",
"$",
"replacements",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"locale",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"getLocale",
"(",
")",
";",
"}",
"if"... | Translate a text.
@param string $text The text to translate.
@param array|null $replacements Values that should be replaced.
@param string $locale The locale or null to use the current locale.
@return string Translated text or given text if no translation found. | [
"Translate",
"a",
"text",
"."
] | 7817f57242a6084ce68ddfb3055191c955ec14f1 | https://github.com/phellow/intl/blob/7817f57242a6084ce68ddfb3055191c955ec14f1/src/IntlService.php#L178-L189 |
12,131 | phellow/intl | src/IntlService.php | IntlService._n | public function _n($textSingular, $textPlural, $number, $replacements = null, $locale = null)
{
if (!$locale) {
$locale = $this->getLocale();
}
if ($this->translator !== null) {
$text = $this->translator->translatePlurals($textSingular, $textPlural, $number, $... | php | public function _n($textSingular, $textPlural, $number, $replacements = null, $locale = null)
{
if (!$locale) {
$locale = $this->getLocale();
}
if ($this->translator !== null) {
$text = $this->translator->translatePlurals($textSingular, $textPlural, $number, $... | [
"public",
"function",
"_n",
"(",
"$",
"textSingular",
",",
"$",
"textPlural",
",",
"$",
"number",
",",
"$",
"replacements",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"locale",
")",
"{",
"$",
"locale",
"=",
"$",
... | Translate the given text based on the given number.
@param string $textSingular The text in its singular form.
@param string $textPlural The text in its plural form.
@param int $number The number.
@param array|null $replacements Values that should be replaced.
@param string $locale The... | [
"Translate",
"the",
"given",
"text",
"based",
"on",
"the",
"given",
"number",
"."
] | 7817f57242a6084ce68ddfb3055191c955ec14f1 | https://github.com/phellow/intl/blob/7817f57242a6084ce68ddfb3055191c955ec14f1/src/IntlService.php#L202-L215 |
12,132 | phellow/intl | src/IntlService.php | IntlService.formatDateTime | public function formatDateTime(\DateTime $datetime, $format, $calendar = \IntlDateFormatter::GREGORIAN)
{
$types = array(
\IntlDateFormatter::NONE,
\IntlDateFormatter::NONE,
);
if (is_array($format)) {
if (isset($format[0])) {
$type... | php | public function formatDateTime(\DateTime $datetime, $format, $calendar = \IntlDateFormatter::GREGORIAN)
{
$types = array(
\IntlDateFormatter::NONE,
\IntlDateFormatter::NONE,
);
if (is_array($format)) {
if (isset($format[0])) {
$type... | [
"public",
"function",
"formatDateTime",
"(",
"\\",
"DateTime",
"$",
"datetime",
",",
"$",
"format",
",",
"$",
"calendar",
"=",
"\\",
"IntlDateFormatter",
"::",
"GREGORIAN",
")",
"{",
"$",
"types",
"=",
"array",
"(",
"\\",
"IntlDateFormatter",
"::",
"NONE",
... | Format DateTime to current locale format.
@param \DateTime $datetime DateTime to format.
@param string|array $format Format string or array like [datetype, timetype].
@param int $calendar IntlDateFormatter calendar to use.
@return string | [
"Format",
"DateTime",
"to",
"current",
"locale",
"format",
"."
] | 7817f57242a6084ce68ddfb3055191c955ec14f1 | https://github.com/phellow/intl/blob/7817f57242a6084ce68ddfb3055191c955ec14f1/src/IntlService.php#L226-L252 |
12,133 | xmmedia/XMMailManagerBundle | Component/MailManager.php | MailManager.getSender | public function getSender()
{
$sender = $this->createSender();
$sender->setFrom($this->fromEmail, $this->fromName);
if ($this->replyToEmail) {
$sender->setReplyTo($this->replyToEmail);
}
return $sender;
} | php | public function getSender()
{
$sender = $this->createSender();
$sender->setFrom($this->fromEmail, $this->fromName);
if ($this->replyToEmail) {
$sender->setReplyTo($this->replyToEmail);
}
return $sender;
} | [
"public",
"function",
"getSender",
"(",
")",
"{",
"$",
"sender",
"=",
"$",
"this",
"->",
"createSender",
"(",
")",
";",
"$",
"sender",
"->",
"setFrom",
"(",
"$",
"this",
"->",
"fromEmail",
",",
"$",
"this",
"->",
"fromName",
")",
";",
"if",
"(",
"$... | Creates a sender instance and sets the from email & name
and reply to address.
@return MailSender | [
"Creates",
"a",
"sender",
"instance",
"and",
"sets",
"the",
"from",
"email",
"&",
"name",
"and",
"reply",
"to",
"address",
"."
] | 1fab55b0db1a9c6f22c84c545dd8f9f31191922d | https://github.com/xmmedia/XMMailManagerBundle/blob/1fab55b0db1a9c6f22c84c545dd8f9f31191922d/Component/MailManager.php#L100-L111 |
12,134 | dms-org/package.faqs | src/Core/FaqLoaderService.php | FaqLoaderService.loadFaqs | public function loadFaqs() : array
{
return $this->repository->matching(
$this->repository->criteria()
->orderByAsc(Faq::ORDER_TO_DISPLAY)
);
} | php | public function loadFaqs() : array
{
return $this->repository->matching(
$this->repository->criteria()
->orderByAsc(Faq::ORDER_TO_DISPLAY)
);
} | [
"public",
"function",
"loadFaqs",
"(",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"repository",
"->",
"matching",
"(",
"$",
"this",
"->",
"repository",
"->",
"criteria",
"(",
")",
"->",
"orderByAsc",
"(",
"Faq",
"::",
"ORDER_TO_DISPLAY",
")",
"... | Loads the FAQ's
@return Faq[] | [
"Loads",
"the",
"FAQ",
"s"
] | 90644fd913e4aa1a56f8dd8c172c8369051952bc | https://github.com/dms-org/package.faqs/blob/90644fd913e4aa1a56f8dd8c172c8369051952bc/src/Core/FaqLoaderService.php#L30-L36 |
12,135 | marando/phpSOFA | src/Marando/IAU/iauD2tf.php | iauD2tf.D2tf | public static function D2tf($ndp, $days, &$sign, array &$ihmsf) {
$nrs;
$n;
$rs;
$rm;
$rh;
$a;
$w;
$ah;
$am;
$as;
$af;
/* Handle sign. */
$sign = $days >= 0.0 ? '+' : '-';
/* Interval in seconds. */
$a = DAYSEC * abs($days);
/* Pre-round if resolution c... | php | public static function D2tf($ndp, $days, &$sign, array &$ihmsf) {
$nrs;
$n;
$rs;
$rm;
$rh;
$a;
$w;
$ah;
$am;
$as;
$af;
/* Handle sign. */
$sign = $days >= 0.0 ? '+' : '-';
/* Interval in seconds. */
$a = DAYSEC * abs($days);
/* Pre-round if resolution c... | [
"public",
"static",
"function",
"D2tf",
"(",
"$",
"ndp",
",",
"$",
"days",
",",
"&",
"$",
"sign",
",",
"array",
"&",
"$",
"ihmsf",
")",
"{",
"$",
"nrs",
";",
"$",
"n",
";",
"$",
"rs",
";",
"$",
"rm",
";",
"$",
"rh",
";",
"$",
"a",
";",
"$... | - - - - - - - -
i a u D 2 t f
- - - - - - - -
Decompose days to hours, minutes, seconds, fraction.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: vector/matrix support function.
Given:
ndp int resolution (Note 1)
days ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"D",
"2",
"t",
"f",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauD2tf.php#L65-L125 |
12,136 | phlexible/phlexible | src/Phlexible/Component/MediaCache/Storage/AbstractStorage.php | AbstractStorage.replaceExtension | protected function replaceExtension($filename, $ext)
{
$ext = str_replace('.', '', $ext);
$filename = $this->removeExtension($filename);
return $filename.'.'.$ext;
} | php | protected function replaceExtension($filename, $ext)
{
$ext = str_replace('.', '', $ext);
$filename = $this->removeExtension($filename);
return $filename.'.'.$ext;
} | [
"protected",
"function",
"replaceExtension",
"(",
"$",
"filename",
",",
"$",
"ext",
")",
"{",
"$",
"ext",
"=",
"str_replace",
"(",
"'.'",
",",
"''",
",",
"$",
"ext",
")",
";",
"$",
"filename",
"=",
"$",
"this",
"->",
"removeExtension",
"(",
"$",
"fil... | Remove a filename extension.
@param string $filename
@param string $ext
@return string | [
"Remove",
"a",
"filename",
"extension",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Component/MediaCache/Storage/AbstractStorage.php#L92-L98 |
12,137 | sasedev/extra-tools-bundle | src/Sasedev/ExtraToolsBundle/Util/UnitConverter/ChainUnitConverter.php | ChainUnitConverter.guessConvert | public function guessConvert($value, $destinationUnit, $locale = null)
{
$result = array();
if (preg_match('#([\d,\.\s]+)\s*([^\s]+)#', $value, $result) > 0) {
return $this->convert(\floatval(\str_replace(array(',', ' '), array('.', ''), $result[1])), $result[2], $destinationUnit,
$locale);
}
re... | php | public function guessConvert($value, $destinationUnit, $locale = null)
{
$result = array();
if (preg_match('#([\d,\.\s]+)\s*([^\s]+)#', $value, $result) > 0) {
return $this->convert(\floatval(\str_replace(array(',', ' '), array('.', ''), $result[1])), $result[2], $destinationUnit,
$locale);
}
re... | [
"public",
"function",
"guessConvert",
"(",
"$",
"value",
",",
"$",
"destinationUnit",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"if",
"(",
"preg_match",
"(",
"'#([\\d,\\.\\s]+)\\s*([^\\s]+)#'",
",",
"$",
"value"... | Tries to guess the source unit by parsing the string and then apply a convertion.
Returns null if fails or not supported.
@param string $value
@param string $destinationUnit
@param
string the locale (optional)
@return mixed The converted value | [
"Tries",
"to",
"guess",
"the",
"source",
"unit",
"by",
"parsing",
"the",
"string",
"and",
"then",
"apply",
"a",
"convertion",
".",
"Returns",
"null",
"if",
"fails",
"or",
"not",
"supported",
"."
] | 14037d6b5c8ba9520ffe33f26057e2e53bea7a75 | https://github.com/sasedev/extra-tools-bundle/blob/14037d6b5c8ba9520ffe33f26057e2e53bea7a75/src/Sasedev/ExtraToolsBundle/Util/UnitConverter/ChainUnitConverter.php#L30-L40 |
12,138 | cekurte/component-bundle | src/EventListener/ResponseListener.php | ResponseListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
$response = $event->getResponse();
if ($response instanceof SerializedResponse) {
$acceptableContentTypes = $event->getRequest()->getAcceptableContentTypes();
$format = 'json';
foreach ($acceptableC... | php | public function onKernelResponse(FilterResponseEvent $event)
{
$response = $event->getResponse();
if ($response instanceof SerializedResponse) {
$acceptableContentTypes = $event->getRequest()->getAcceptableContentTypes();
$format = 'json';
foreach ($acceptableC... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"$",
"response",
"=",
"$",
"event",
"->",
"getResponse",
"(",
")",
";",
"if",
"(",
"$",
"response",
"instanceof",
"SerializedResponse",
")",
"{",
"$",
"acceptableCont... | Modify the Response given the Request if the Response is a instance of SerializedResponse.
@param FilterResponseEvent $event | [
"Modify",
"the",
"Response",
"given",
"the",
"Request",
"if",
"the",
"Response",
"is",
"a",
"instance",
"of",
"SerializedResponse",
"."
] | 0c9b802068492095362e29a61180396463ff9904 | https://github.com/cekurte/component-bundle/blob/0c9b802068492095362e29a61180396463ff9904/src/EventListener/ResponseListener.php#L69-L89 |
12,139 | krisanalfa/bono-lang | src/Bono/Lang/Driver/FileDriver.php | FileDriver.buildLists | protected function buildLists()
{
$lists = array();
$langList = array();
$path = $this->config['lang.path'];
$objects = new RII(new RDI($path), RII::SELF_FIRST);
foreach ($objects as $object) {
if ($object->getExtension() === 'php') {
$pat... | php | protected function buildLists()
{
$lists = array();
$langList = array();
$path = $this->config['lang.path'];
$objects = new RII(new RDI($path), RII::SELF_FIRST);
foreach ($objects as $object) {
if ($object->getExtension() === 'php') {
$pat... | [
"protected",
"function",
"buildLists",
"(",
")",
"{",
"$",
"lists",
"=",
"array",
"(",
")",
";",
"$",
"langList",
"=",
"array",
"(",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"config",
"[",
"'lang.path'",
"]",
";",
"$",
"objects",
"=",
"new",
... | Build list of translation and available language in specific folder
@return void | [
"Build",
"list",
"of",
"translation",
"and",
"available",
"language",
"in",
"specific",
"folder"
] | 58a402d23499ff81ce34d061185d7cc514982bfc | https://github.com/krisanalfa/bono-lang/blob/58a402d23499ff81ce34d061185d7cc514982bfc/src/Bono/Lang/Driver/FileDriver.php#L76-L96 |
12,140 | krisanalfa/bono-lang | src/Bono/Lang/Driver/FileDriver.php | FileDriver.getAppBasePath | protected function getAppBasePath()
{
$path = dirname($_SERVER['SCRIPT_FILENAME']);
return (is_link($path)) ? dirname(readlink($path)) : dirname($path);
} | php | protected function getAppBasePath()
{
$path = dirname($_SERVER['SCRIPT_FILENAME']);
return (is_link($path)) ? dirname(readlink($path)) : dirname($path);
} | [
"protected",
"function",
"getAppBasePath",
"(",
")",
"{",
"$",
"path",
"=",
"dirname",
"(",
"$",
"_SERVER",
"[",
"'SCRIPT_FILENAME'",
"]",
")",
";",
"return",
"(",
"is_link",
"(",
"$",
"path",
")",
")",
"?",
"dirname",
"(",
"readlink",
"(",
"$",
"path"... | Get absolute path of working application
@return string | [
"Get",
"absolute",
"path",
"of",
"working",
"application"
] | 58a402d23499ff81ce34d061185d7cc514982bfc | https://github.com/krisanalfa/bono-lang/blob/58a402d23499ff81ce34d061185d7cc514982bfc/src/Bono/Lang/Driver/FileDriver.php#L103-L108 |
12,141 | AnonymPHP/Anonym-Library | src/Anonym/Cron/BasicCron.php | BasicCron.event | public function event(Closure $event)
{
if (null !== $response = $event()) {
$this->resolveEventResponse($response);
}
return $this;
} | php | public function event(Closure $event)
{
if (null !== $response = $event()) {
$this->resolveEventResponse($response);
}
return $this;
} | [
"public",
"function",
"event",
"(",
"Closure",
"$",
"event",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"response",
"=",
"$",
"event",
"(",
")",
")",
"{",
"$",
"this",
"->",
"resolveEventResponse",
"(",
"$",
"response",
")",
";",
"}",
"return",
"$",
... | add a event
@param Closure $event
@return $this | [
"add",
"a",
"event"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Cron/BasicCron.php#L88-L95 |
12,142 | AnonymPHP/Anonym-Library | src/Anonym/Cron/BasicCron.php | BasicCron.resolveEventResponse | private function resolveEventResponse($response)
{
if (is_string($response)) {
$response = new ExecTask($response);
}
if ($response instanceof TaskReposity && !$response instanceof ClosureTask) {
EventReposity::addBasic($response);
} else {
throw ... | php | private function resolveEventResponse($response)
{
if (is_string($response)) {
$response = new ExecTask($response);
}
if ($response instanceof TaskReposity && !$response instanceof ClosureTask) {
EventReposity::addBasic($response);
} else {
throw ... | [
"private",
"function",
"resolveEventResponse",
"(",
"$",
"response",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"response",
")",
")",
"{",
"$",
"response",
"=",
"new",
"ExecTask",
"(",
"$",
"response",
")",
";",
"}",
"if",
"(",
"$",
"response",
"insta... | resolve the response from add event method
@param mixed $response
@throws CronInstanceException | [
"resolve",
"the",
"response",
"from",
"add",
"event",
"method"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Cron/BasicCron.php#L103-L120 |
12,143 | AnonymPHP/Anonym-Library | src/Anonym/Cron/BasicCron.php | BasicCron.removeJob | public function removeJob($job = '')
{
if ($job instanceof TaskReposity) {
$job = $job->buildCommandWithExpression();
}
$refrector = new CronEntry();
$job = $refrector->parse($job);
$this->getManager()->removeJob($job);
return $this;
} | php | public function removeJob($job = '')
{
if ($job instanceof TaskReposity) {
$job = $job->buildCommandWithExpression();
}
$refrector = new CronEntry();
$job = $refrector->parse($job);
$this->getManager()->removeJob($job);
return $this;
} | [
"public",
"function",
"removeJob",
"(",
"$",
"job",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"job",
"instanceof",
"TaskReposity",
")",
"{",
"$",
"job",
"=",
"$",
"job",
"->",
"buildCommandWithExpression",
"(",
")",
";",
"}",
"$",
"refrector",
"=",
"new",
... | remove a job
@param string $job
@return $this | [
"remove",
"a",
"job"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Cron/BasicCron.php#L183-L196 |
12,144 | zepi/turbo-base | Zepi/Core/Utils/src/Helper/CliHelper.php | CliHelper.inputText | public function inputText($text, $defaultValue = '')
{
$defaultValueStr = '';
if ($defaultValue != '') {
$defaultValueStr = '[' . $defaultValue . '] ';
}
echo $text . ' ' . $defaultValueStr;
$handle = fopen('php://stdin', 'r');
$line = fgets(... | php | public function inputText($text, $defaultValue = '')
{
$defaultValueStr = '';
if ($defaultValue != '') {
$defaultValueStr = '[' . $defaultValue . '] ';
}
echo $text . ' ' . $defaultValueStr;
$handle = fopen('php://stdin', 'r');
$line = fgets(... | [
"public",
"function",
"inputText",
"(",
"$",
"text",
",",
"$",
"defaultValue",
"=",
"''",
")",
"{",
"$",
"defaultValueStr",
"=",
"''",
";",
"if",
"(",
"$",
"defaultValue",
"!=",
"''",
")",
"{",
"$",
"defaultValueStr",
"=",
"'['",
".",
"$",
"defaultValu... | Asks the cli user for input text.
@access public
@param string $text
@param string $defaultValue
@return string | [
"Asks",
"the",
"cli",
"user",
"for",
"input",
"text",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Core/Utils/src/Helper/CliHelper.php#L87-L105 |
12,145 | arvici/framework | src/Arvici/Heart/Tools/DebugBarHelper.php | DebugBarHelper.inject | public function inject(Response &$response)
{
$renderer = $this->debugBar->getJavascriptRenderer('/__debug__/');
if (stripos($response->headers->get('Content-Type'), 'text/html') === 0) {
$content = $response->getContent();
$content = self::injectHtml($content, $renderer->re... | php | public function inject(Response &$response)
{
$renderer = $this->debugBar->getJavascriptRenderer('/__debug__/');
if (stripos($response->headers->get('Content-Type'), 'text/html') === 0) {
$content = $response->getContent();
$content = self::injectHtml($content, $renderer->re... | [
"public",
"function",
"inject",
"(",
"Response",
"&",
"$",
"response",
")",
"{",
"$",
"renderer",
"=",
"$",
"this",
"->",
"debugBar",
"->",
"getJavascriptRenderer",
"(",
"'/__debug__/'",
")",
";",
"if",
"(",
"stripos",
"(",
"$",
"response",
"->",
"headers"... | Inject the debug bar.
@param Response $response | [
"Inject",
"the",
"debug",
"bar",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Tools/DebugBarHelper.php#L93-L103 |
12,146 | arvici/framework | src/Arvici/Heart/Tools/DebugBarHelper.php | DebugBarHelper.injectHtml | private static function injectHtml($html, $code, $before)
{
$pos = strripos($html, $before);
if ($pos === false) {
return $html.$code;
}
return substr($html, 0, $pos).$code.substr($html, $pos);
} | php | private static function injectHtml($html, $code, $before)
{
$pos = strripos($html, $before);
if ($pos === false) {
return $html.$code;
}
return substr($html, 0, $pos).$code.substr($html, $pos);
} | [
"private",
"static",
"function",
"injectHtml",
"(",
"$",
"html",
",",
"$",
"code",
",",
"$",
"before",
")",
"{",
"$",
"pos",
"=",
"strripos",
"(",
"$",
"html",
",",
"$",
"before",
")",
";",
"if",
"(",
"$",
"pos",
"===",
"false",
")",
"{",
"return... | Inject html code before a tag.
@param string $html
@param string $code
@param string $before
@return string | [
"Inject",
"html",
"code",
"before",
"a",
"tag",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Tools/DebugBarHelper.php#L141-L148 |
12,147 | jivoo/http | src/SapiServer.php | SapiServer.serve | public function serve(ResponseInterface $response, $cookies = [])
{
if (headers_sent($file, $line)) {
throw new HeadersSentException(
'Headers already sent in ' . $file . ' on line ' . $line
);
}
$this->triggerEvent('serve', new \Jivoo\Event($this, [
... | php | public function serve(ResponseInterface $response, $cookies = [])
{
if (headers_sent($file, $line)) {
throw new HeadersSentException(
'Headers already sent in ' . $file . ' on line ' . $line
);
}
$this->triggerEvent('serve', new \Jivoo\Event($this, [
... | [
"public",
"function",
"serve",
"(",
"ResponseInterface",
"$",
"response",
",",
"$",
"cookies",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"headers_sent",
"(",
"$",
"file",
",",
"$",
"line",
")",
")",
"{",
"throw",
"new",
"HeadersSentException",
"(",
"'Headers a... | Serve a response.
@param ResponseInterface $response The response.
@param Cookie\ResponseCookie[]|\Traversable $cookies
@throws HeadersSentException If the headers have already been sent. | [
"Serve",
"a",
"response",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/SapiServer.php#L141-L160 |
12,148 | jivoo/http | src/SapiServer.php | SapiServer.serveStatus | protected function serveStatus(ResponseInterface $response)
{
$protocol = $response->getProtocolVersion();
$status = $response->getStatusCode();
$reason = $response->getReasonPhrase();
if ($reason != '') {
$reason = ' ' . $reason;
}
header('HTTP/' . $proto... | php | protected function serveStatus(ResponseInterface $response)
{
$protocol = $response->getProtocolVersion();
$status = $response->getStatusCode();
$reason = $response->getReasonPhrase();
if ($reason != '') {
$reason = ' ' . $reason;
}
header('HTTP/' . $proto... | [
"protected",
"function",
"serveStatus",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"protocol",
"=",
"$",
"response",
"->",
"getProtocolVersion",
"(",
")",
";",
"$",
"status",
"=",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
";",
"$",
"... | Set the status line.
@param ResponseInterface $response The response. | [
"Set",
"the",
"status",
"line",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/SapiServer.php#L167-L176 |
12,149 | jivoo/http | src/SapiServer.php | SapiServer.serveCookies | protected function serveCookies($cookies)
{
foreach ($cookies as $cookie) {
if ($cookie->hasChanged()) {
$expiration = $cookie->getExpiration();
if (isset($expiration)) {
$expiration = $expiration->getTimestamp();
} else {
... | php | protected function serveCookies($cookies)
{
foreach ($cookies as $cookie) {
if ($cookie->hasChanged()) {
$expiration = $cookie->getExpiration();
if (isset($expiration)) {
$expiration = $expiration->getTimestamp();
} else {
... | [
"protected",
"function",
"serveCookies",
"(",
"$",
"cookies",
")",
"{",
"foreach",
"(",
"$",
"cookies",
"as",
"$",
"cookie",
")",
"{",
"if",
"(",
"$",
"cookie",
"->",
"hasChanged",
"(",
")",
")",
"{",
"$",
"expiration",
"=",
"$",
"cookie",
"->",
"get... | Set the cookies.
@param Cookie\ResponseCookie[]|\Traversable $cookies | [
"Set",
"the",
"cookies",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/SapiServer.php#L183-L204 |
12,150 | jivoo/http | src/SapiServer.php | SapiServer.serveHeaders | protected function serveHeaders(ResponseInterface $response)
{
header_remove('X-Powered-By');
foreach ($response->getHeaders() as $header => $values) {
header($header . ': ' . array_shift($values), true);
foreach ($values as $value) {
header($header . ': ' . $... | php | protected function serveHeaders(ResponseInterface $response)
{
header_remove('X-Powered-By');
foreach ($response->getHeaders() as $header => $values) {
header($header . ': ' . array_shift($values), true);
foreach ($values as $value) {
header($header . ': ' . $... | [
"protected",
"function",
"serveHeaders",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"header_remove",
"(",
"'X-Powered-By'",
")",
";",
"foreach",
"(",
"$",
"response",
"->",
"getHeaders",
"(",
")",
"as",
"$",
"header",
"=>",
"$",
"values",
")",
"{",... | Set the headers.
@param ResponseInterface $response The response. | [
"Set",
"the",
"headers",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/SapiServer.php#L211-L220 |
12,151 | jivoo/http | src/SapiServer.php | SapiServer.serveBody | protected function serveBody(ResponseInterface $response, $compression = null)
{
$body = $response->getBody();
$body->rewind();
$out = fopen('php://output', 'wb');
if ($compression == 'bzip2') {
fwrite($out, bzcompress($body->getContents()));
} elseif ($compressio... | php | protected function serveBody(ResponseInterface $response, $compression = null)
{
$body = $response->getBody();
$body->rewind();
$out = fopen('php://output', 'wb');
if ($compression == 'bzip2') {
fwrite($out, bzcompress($body->getContents()));
} elseif ($compressio... | [
"protected",
"function",
"serveBody",
"(",
"ResponseInterface",
"$",
"response",
",",
"$",
"compression",
"=",
"null",
")",
"{",
"$",
"body",
"=",
"$",
"response",
"->",
"getBody",
"(",
")",
";",
"$",
"body",
"->",
"rewind",
"(",
")",
";",
"$",
"out",
... | Output the response body.
@param ResponseInterface $response The response.
@param string $compression Compression to use: 'bzip2' or 'gzip'. | [
"Output",
"the",
"response",
"body",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/SapiServer.php#L228-L244 |
12,152 | jivoo/http | src/SapiServer.php | SapiServer.listen | public function listen()
{
$request = $this->request;
$response = new Response(Status::OK);
$first = $this->getNext($this->middleware);
$response = $first($request, $response);
$this->serve($response, $this->getCookies());
} | php | public function listen()
{
$request = $this->request;
$response = new Response(Status::OK);
$first = $this->getNext($this->middleware);
$response = $first($request, $response);
$this->serve($response, $this->getCookies());
} | [
"public",
"function",
"listen",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"request",
";",
"$",
"response",
"=",
"new",
"Response",
"(",
"Status",
"::",
"OK",
")",
";",
"$",
"first",
"=",
"$",
"this",
"->",
"getNext",
"(",
"$",
"this",
... | Start server, i.e. create a response for the current request using the
available middleware and request handler. | [
"Start",
"server",
"i",
".",
"e",
".",
"create",
"a",
"response",
"for",
"the",
"current",
"request",
"using",
"the",
"available",
"middleware",
"and",
"request",
"handler",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/SapiServer.php#L266-L273 |
12,153 | zerospam/sdk-framework | src/Client/Middleware/RefreshToken/RefreshTokenMiddleware.php | RefreshTokenMiddleware.handleRefreshToken | public function handleRefreshToken(AccessToken $previousToken, int $tries): AccessToken
{
return $this->client->getConfiguration()->refreshToken($previousToken->getRefreshToken());
} | php | public function handleRefreshToken(AccessToken $previousToken, int $tries): AccessToken
{
return $this->client->getConfiguration()->refreshToken($previousToken->getRefreshToken());
} | [
"public",
"function",
"handleRefreshToken",
"(",
"AccessToken",
"$",
"previousToken",
",",
"int",
"$",
"tries",
")",
":",
"AccessToken",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"getConfiguration",
"(",
")",
"->",
"refreshToken",
"(",
"$",
"previousTo... | Take care of refreshing the token
@param AccessToken $previousToken
@param int $tries
@return AccessToken | [
"Take",
"care",
"of",
"refreshing",
"the",
"token"
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Client/Middleware/RefreshToken/RefreshTokenMiddleware.php#L46-L49 |
12,154 | indigophp-archive/fuel-core | lib/Fuel/Validation/RuleProvider/ModelProvider.php | ModelProvider.populateValidator | public static function populateValidator(Validator $validator)
{
if (static::$provider === null)
{
static::setProvider(new FromArray(true, 'validation'));
}
return static::$provider->populateValidator($validator);
} | php | public static function populateValidator(Validator $validator)
{
if (static::$provider === null)
{
static::setProvider(new FromArray(true, 'validation'));
}
return static::$provider->populateValidator($validator);
} | [
"public",
"static",
"function",
"populateValidator",
"(",
"Validator",
"$",
"validator",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"provider",
"===",
"null",
")",
"{",
"static",
"::",
"setProvider",
"(",
"new",
"FromArray",
"(",
"true",
",",
"'validation'",
... | Populates the given validator with the needed rules
@param Validator $validator
@return Validator | [
"Populates",
"the",
"given",
"validator",
"with",
"the",
"needed",
"rules"
] | 275462154fb7937f8e1c2c541b31d8e7c5760e39 | https://github.com/indigophp-archive/fuel-core/blob/275462154fb7937f8e1c2c541b31d8e7c5760e39/lib/Fuel/Validation/RuleProvider/ModelProvider.php#L50-L58 |
12,155 | priskz/paylorm | src/Priskz/Paylorm/Data/MySQL/Eloquent/CrudRepository.php | CrudRepository.first | public function first(array $parameter = [])
{
// Merge any base/common query parameters with given parameters taking precedence.
$parameter = array_merge($this->parameter, $parameter);
// Begin building query.
$query = $this->model;
// Add filters to the query.
if(array_key_exists(self::FILTER_KEY, $par... | php | public function first(array $parameter = [])
{
// Merge any base/common query parameters with given parameters taking precedence.
$parameter = array_merge($this->parameter, $parameter);
// Begin building query.
$query = $this->model;
// Add filters to the query.
if(array_key_exists(self::FILTER_KEY, $par... | [
"public",
"function",
"first",
"(",
"array",
"$",
"parameter",
"=",
"[",
"]",
")",
"{",
"// Merge any base/common query parameters with given parameters taking precedence.",
"$",
"parameter",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"parameter",
",",
"$",
"paramete... | Get a single object based on given parameters.
@param array $parameter
@return Payload | [
"Get",
"a",
"single",
"object",
"based",
"on",
"given",
"parameters",
"."
] | ae59eb4d9382f0c6fd361cca8ae465a0da88bc93 | https://github.com/priskz/paylorm/blob/ae59eb4d9382f0c6fd361cca8ae465a0da88bc93/src/Priskz/Paylorm/Data/MySQL/Eloquent/CrudRepository.php#L182-L250 |
12,156 | priskz/paylorm | src/Priskz/Paylorm/Data/MySQL/Eloquent/CrudRepository.php | CrudRepository.retrieve | public function retrieve($selectQuery)
{
// Eager load configured relationships.
$selectQuery = $this->setEagerLoaded($selectQuery);
// Execute the query.
$retrieved = $selectQuery->get();
// Eager load configured relationships.
return $this->setLazyLoaded($retrieved);
} | php | public function retrieve($selectQuery)
{
// Eager load configured relationships.
$selectQuery = $this->setEagerLoaded($selectQuery);
// Execute the query.
$retrieved = $selectQuery->get();
// Eager load configured relationships.
return $this->setLazyLoaded($retrieved);
} | [
"public",
"function",
"retrieve",
"(",
"$",
"selectQuery",
")",
"{",
"// Eager load configured relationships.",
"$",
"selectQuery",
"=",
"$",
"this",
"->",
"setEagerLoaded",
"(",
"$",
"selectQuery",
")",
";",
"// Execute the query.",
"$",
"retrieved",
"=",
"$",
"s... | Retrieve the data.
@param query $selectQuery
@return Collection|Single of Domain\Model | [
"Retrieve",
"the",
"data",
"."
] | ae59eb4d9382f0c6fd361cca8ae465a0da88bc93 | https://github.com/priskz/paylorm/blob/ae59eb4d9382f0c6fd361cca8ae465a0da88bc93/src/Priskz/Paylorm/Data/MySQL/Eloquent/CrudRepository.php#L408-L418 |
12,157 | getmoxy/event | src/Event/Dispatcher.php | Dispatcher.dispatch | public function dispatch($data)
{
$event = new \Moxy\Event($this->_name, $data);
foreach($this->_listeners as $listener) {
$listener->call($event);
}
} | php | public function dispatch($data)
{
$event = new \Moxy\Event($this->_name, $data);
foreach($this->_listeners as $listener) {
$listener->call($event);
}
} | [
"public",
"function",
"dispatch",
"(",
"$",
"data",
")",
"{",
"$",
"event",
"=",
"new",
"\\",
"Moxy",
"\\",
"Event",
"(",
"$",
"this",
"->",
"_name",
",",
"$",
"data",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_listeners",
"as",
"$",
"listener"... | Dispatch an Event
Iterates the list of Event Listeners
and calls each of them sequentially
@author Tom Morton
@param array $data An array of Data | [
"Dispatch",
"an",
"Event"
] | d12b8f15916007151249aa03e3c09f7863a2d29c | https://github.com/getmoxy/event/blob/d12b8f15916007151249aa03e3c09f7863a2d29c/src/Event/Dispatcher.php#L38-L47 |
12,158 | sebardo/ecommerce | EcommerceBundle/Controller/FeatureController.php | FeatureController.createAction | public function createAction(Request $request)
{
$entity = new Feature();
$form = $this->createForm(new FeatureType(), $entity);
$form->bind($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->f... | php | public function createAction(Request $request)
{
$entity = new Feature();
$form = $this->createForm(new FeatureType(), $entity);
$form->bind($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->f... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"entity",
"=",
"new",
"Feature",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"FeatureType",
"(",
")",
",",
"$",
"entity",
")",
";",... | Creates a new Feature entity.
@param Request $request The request
@return array|RedirectResponse
@Route("/")
@Method("POST")
@Template("EcommerceBundle:Feature:new.html.twig") | [
"Creates",
"a",
"new",
"Feature",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/FeatureController.php#L78-L98 |
12,159 | sebardo/ecommerce | EcommerceBundle/Controller/FeatureController.php | FeatureController.newAction | public function newAction()
{
$entity = new Feature();
if ($this->getRequest()->query->has('category')) {
$em = $this->getDoctrine()->getManager();
$category = $em->getRepository('EcommerceBundle:Category')->
find($this->getRequest()->query->get('category'))... | php | public function newAction()
{
$entity = new Feature();
if ($this->getRequest()->query->has('category')) {
$em = $this->getDoctrine()->getManager();
$category = $em->getRepository('EcommerceBundle:Category')->
find($this->getRequest()->query->get('category'))... | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"entity",
"=",
"new",
"Feature",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"query",
"->",
"has",
"(",
"'category'",
")",
")",
"{",
"$",
"em",
"=",
"$",
"this"... | Displays a form to create a new Feature entity.
@return array
@Route("/new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Feature",
"entity",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/FeatureController.php#L109-L128 |
12,160 | sebardo/ecommerce | EcommerceBundle/Controller/FeatureController.php | FeatureController.sortAction | public function sortAction(Request $request, $categoryId)
{
$em = $this->getDoctrine()->getManager();
/** @var Category $category */
$category = $em->getRepository('EcommerceBundle:Category')->find($categoryId);
if (!$category) {
throw $this->createNotFoundException('Un... | php | public function sortAction(Request $request, $categoryId)
{
$em = $this->getDoctrine()->getManager();
/** @var Category $category */
$category = $em->getRepository('EcommerceBundle:Category')->find($categoryId);
if (!$category) {
throw $this->createNotFoundException('Un... | [
"public",
"function",
"sortAction",
"(",
"Request",
"$",
"request",
",",
"$",
"categoryId",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"/** @var Category $category */",
"$",
"category",
"=",
"$"... | Sorts a list of features.
@param Request $request
@param int $categoryId
@throws NotFoundHttpException
@return array|Response
@Route("/category/{categoryId}/sort")
@Method({"GET", "POST"})
@Template | [
"Sorts",
"a",
"list",
"of",
"features",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/FeatureController.php#L286-L312 |
12,161 | sebardo/ecommerce | EcommerceBundle/Controller/FeatureController.php | FeatureController.toggleFiltrableAction | public function toggleFiltrableAction(Request $request, $id)
{
if (false === $request->isXmlHttpRequest()) {
throw $this->createNotFoundException();
}
$isFiltrable = $this->get('admin_manager')->toggleFiltrable('EcommerceBundle:Feature', $id);
return new Response(intval... | php | public function toggleFiltrableAction(Request $request, $id)
{
if (false === $request->isXmlHttpRequest()) {
throw $this->createNotFoundException();
}
$isFiltrable = $this->get('admin_manager')->toggleFiltrable('EcommerceBundle:Feature', $id);
return new Response(intval... | [
"public",
"function",
"toggleFiltrableAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"createNotFoundException",
"(",
")... | Set a list of features as filtrable.
@param Request $request
@param int $id
@throws NotFoundHttpException
@return Response
@Route("/{id}/toggle-filtrable")
@Method("POST")
@Template | [
"Set",
"a",
"list",
"of",
"features",
"as",
"filtrable",
"."
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Controller/FeatureController.php#L327-L336 |
12,162 | jamesmoss/treasure-chest | src/TreasureChest/KeyMapper.php | KeyMapper.getNamespaceKey | protected function getNamespaceKey(array $namespaces, $key)
{
if(empty($namespaces)) {
return $key;
}
$component = '';
$parts = array();
foreach($namespaces as $namespace) {
$component.= $this->delimiter.$namespace;
$parts[] = $this->getVersionNumber(substr($component, 1));
}
// generate th... | php | protected function getNamespaceKey(array $namespaces, $key)
{
if(empty($namespaces)) {
return $key;
}
$component = '';
$parts = array();
foreach($namespaces as $namespace) {
$component.= $this->delimiter.$namespace;
$parts[] = $this->getVersionNumber(substr($component, 1));
}
// generate th... | [
"protected",
"function",
"getNamespaceKey",
"(",
"array",
"$",
"namespaces",
",",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"namespaces",
")",
")",
"{",
"return",
"$",
"key",
";",
"}",
"$",
"component",
"=",
"''",
";",
"$",
"parts",
"=",
... | generates the final cache identifier for the provided namespace and key
@param $namespace
@param $key
@return string The final key name which gets passed to the store | [
"generates",
"the",
"final",
"cache",
"identifier",
"for",
"the",
"provided",
"namespace",
"and",
"key"
] | 2343b14f58ce7aa18d7ea2cfe3be02a4eec2ca52 | https://github.com/jamesmoss/treasure-chest/blob/2343b14f58ce7aa18d7ea2cfe3be02a4eec2ca52/src/TreasureChest/KeyMapper.php#L68-L87 |
12,163 | webriq/core | module/Tag/src/Grid/Tag/Model/Tag/Mapper.php | Mapper.findByName | public function findByName( $name )
{
$platform = $this->getDbAdapter()
->getPlatform();
return $this->findOne( array(
new Sql\Predicate\Expression(
'LOWER(' . $platform->quoteIdentifier( 'name' ) . ') = ?',
mb_strtolower( $name, ... | php | public function findByName( $name )
{
$platform = $this->getDbAdapter()
->getPlatform();
return $this->findOne( array(
new Sql\Predicate\Expression(
'LOWER(' . $platform->quoteIdentifier( 'name' ) . ') = ?',
mb_strtolower( $name, ... | [
"public",
"function",
"findByName",
"(",
"$",
"name",
")",
"{",
"$",
"platform",
"=",
"$",
"this",
"->",
"getDbAdapter",
"(",
")",
"->",
"getPlatform",
"(",
")",
";",
"return",
"$",
"this",
"->",
"findOne",
"(",
"array",
"(",
"new",
"Sql",
"\\",
"Pre... | Get tag by name
@param string $name
@return \Tag\Model\Tag\Structure|null | [
"Get",
"tag",
"by",
"name"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Tag/src/Grid/Tag/Model/Tag/Mapper.php#L103-L114 |
12,164 | webriq/core | module/Tag/src/Grid/Tag/Model/Tag/Mapper.php | Mapper.isNameExists | public function isNameExists( $name, $excludeId = null )
{
$platform = $this->getDbAdapter()
->getPlatform();
$nameEq = new Sql\Predicate\Expression(
'LOWER(' . $platform->quoteIdentifier( 'name' ) . ') = ?',
mb_strtolower( $name, 'UTF-8' )
)... | php | public function isNameExists( $name, $excludeId = null )
{
$platform = $this->getDbAdapter()
->getPlatform();
$nameEq = new Sql\Predicate\Expression(
'LOWER(' . $platform->quoteIdentifier( 'name' ) . ') = ?',
mb_strtolower( $name, 'UTF-8' )
)... | [
"public",
"function",
"isNameExists",
"(",
"$",
"name",
",",
"$",
"excludeId",
"=",
"null",
")",
"{",
"$",
"platform",
"=",
"$",
"this",
"->",
"getDbAdapter",
"(",
")",
"->",
"getPlatform",
"(",
")",
";",
"$",
"nameEq",
"=",
"new",
"Sql",
"\\",
"Pred... | Is name already exists
@param string $name
@param int|null $excludeId
@return bool | [
"Is",
"name",
"already",
"exists"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Tag/src/Grid/Tag/Model/Tag/Mapper.php#L188-L208 |
12,165 | okaufmann/google-movies-client | src/GoogleMoviesClient/HttpClient/HttpClient.php | HttpClient.send | private function send($path, $method, array $parameters = [], array $headers = [], $body = null)
{
$request = $this->createRequest($path, $method, $parameters, $headers, $body);
$event = new RequestEvent($request);
$this->eventDispatcher->dispatch(GoogleMoviesClientEvents::REQUEST, $event);... | php | private function send($path, $method, array $parameters = [], array $headers = [], $body = null)
{
$request = $this->createRequest($path, $method, $parameters, $headers, $body);
$event = new RequestEvent($request);
$this->eventDispatcher->dispatch(GoogleMoviesClientEvents::REQUEST, $event);... | [
"private",
"function",
"send",
"(",
"$",
"path",
",",
"$",
"method",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"body",
"=",
"null",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"... | Create the request object and send it out to listening events.
@param $path
@param $method
@param array $parameters
@param array $headers
@param null $body
@return string | [
"Create",
"the",
"request",
"object",
"and",
"send",
"it",
"out",
"to",
"listening",
"events",
"."
] | 70ad4d3c640016cf24a0fd45ed8509029a6c02c6 | https://github.com/okaufmann/google-movies-client/blob/70ad4d3c640016cf24a0fd45ed8509029a6c02c6/src/GoogleMoviesClient/HttpClient/HttpClient.php#L212-L226 |
12,166 | okaufmann/google-movies-client | src/GoogleMoviesClient/HttpClient/HttpClient.php | HttpClient.registerDefaults | public function registerDefaults()
{
$requestSubscriber = new RequestSubscriber();
$this->addSubscriber($requestSubscriber);
$userAgentHeaderPlugin = new UserAgentHeaderPlugin();
$this->addSubscriber($userAgentHeaderPlugin);
return $this;
} | php | public function registerDefaults()
{
$requestSubscriber = new RequestSubscriber();
$this->addSubscriber($requestSubscriber);
$userAgentHeaderPlugin = new UserAgentHeaderPlugin();
$this->addSubscriber($userAgentHeaderPlugin);
return $this;
} | [
"public",
"function",
"registerDefaults",
"(",
")",
"{",
"$",
"requestSubscriber",
"=",
"new",
"RequestSubscriber",
"(",
")",
";",
"$",
"this",
"->",
"addSubscriber",
"(",
"$",
"requestSubscriber",
")",
";",
"$",
"userAgentHeaderPlugin",
"=",
"new",
"UserAgentHe... | Register the default plugins.
@return $this | [
"Register",
"the",
"default",
"plugins",
"."
] | 70ad4d3c640016cf24a0fd45ed8509029a6c02c6 | https://github.com/okaufmann/google-movies-client/blob/70ad4d3c640016cf24a0fd45ed8509029a6c02c6/src/GoogleMoviesClient/HttpClient/HttpClient.php#L308-L317 |
12,167 | okaufmann/google-movies-client | src/GoogleMoviesClient/HttpClient/HttpClient.php | HttpClient.setDefaultLogging | public function setDefaultLogging(array $parameters)
{
if (! class_exists('\Monolog\Logger')) {
//@codeCoverageIgnoreStart
throw new \RuntimeException(
'Could not find any logger set and the monolog logger library was not found
to provide a default, yo... | php | public function setDefaultLogging(array $parameters)
{
if (! class_exists('\Monolog\Logger')) {
//@codeCoverageIgnoreStart
throw new \RuntimeException(
'Could not find any logger set and the monolog logger library was not found
to provide a default, yo... | [
"public",
"function",
"setDefaultLogging",
"(",
"array",
"$",
"parameters",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'\\Monolog\\Logger'",
")",
")",
"{",
"//@codeCoverageIgnoreStart",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Could not find any logger se... | Enable logging.
@param array $parameters
@throws \RuntimeException
@return $this | [
"Enable",
"logging",
"."
] | 70ad4d3c640016cf24a0fd45ed8509029a6c02c6 | https://github.com/okaufmann/google-movies-client/blob/70ad4d3c640016cf24a0fd45ed8509029a6c02c6/src/GoogleMoviesClient/HttpClient/HttpClient.php#L400-L421 |
12,168 | wasabi-cms/cms | src/Model/Entity/Page.php | Page.getStatus | public function getStatus()
{
if (isset($this->_statuses[(int) $this->status])) {
return $this->_statuses[(int) $this->status];
}
throw new \Exception('Status "' . $this->status . '" not found for Page with id ' . $this->id . '.');
} | php | public function getStatus()
{
if (isset($this->_statuses[(int) $this->status])) {
return $this->_statuses[(int) $this->status];
}
throw new \Exception('Status "' . $this->status . '" not found for Page with id ' . $this->id . '.');
} | [
"public",
"function",
"getStatus",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_statuses",
"[",
"(",
"int",
")",
"$",
"this",
"->",
"status",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_statuses",
"[",
"(",
"int",
")",
"$",... | Retrieve the current status of a page.
@return mixed
@throws \Exception | [
"Retrieve",
"the",
"current",
"status",
"of",
"a",
"page",
"."
] | 2787b6422ea1d719cf49951b3253fd0ac31d22ca | https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Model/Entity/Page.php#L114-L120 |
12,169 | wasabi-cms/cms | src/Model/Entity/Page.php | Page.initializeContentAreas | public function initializeContentAreas()
{
$content = $this->_getContent();
foreach ($content as $contentAreaDefintion)
{
$contentArea = new ContentArea($contentAreaDefintion);
$this->_contentAreas[$contentArea->id] = $contentArea;
}
} | php | public function initializeContentAreas()
{
$content = $this->_getContent();
foreach ($content as $contentAreaDefintion)
{
$contentArea = new ContentArea($contentAreaDefintion);
$this->_contentAreas[$contentArea->id] = $contentArea;
}
} | [
"public",
"function",
"initializeContentAreas",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"_getContent",
"(",
")",
";",
"foreach",
"(",
"$",
"content",
"as",
"$",
"contentAreaDefintion",
")",
"{",
"$",
"contentArea",
"=",
"new",
"ContentArea",
... | Initialize the content areas of this page.
@return void | [
"Initialize",
"the",
"content",
"areas",
"of",
"this",
"page",
"."
] | 2787b6422ea1d719cf49951b3253fd0ac31d22ca | https://github.com/wasabi-cms/cms/blob/2787b6422ea1d719cf49951b3253fd0ac31d22ca/src/Model/Entity/Page.php#L127-L137 |
12,170 | JaredClemence/binn | src/core/BinnFactory.php | BinnFactory.determineSubTypeOfIndexedContainers | private function determineSubTypeOfIndexedContainers($data) {
list( $allNumeric, $inSequence ) = $this->detectContainerKeyFlags( $data );
if( $allNumeric == false ){
return "\xE2";
}else if( $inSequence ){
return "\xE0";
}else{
return "\xE1";
}... | php | private function determineSubTypeOfIndexedContainers($data) {
list( $allNumeric, $inSequence ) = $this->detectContainerKeyFlags( $data );
if( $allNumeric == false ){
return "\xE2";
}else if( $inSequence ){
return "\xE0";
}else{
return "\xE1";
}... | [
"private",
"function",
"determineSubTypeOfIndexedContainers",
"(",
"$",
"data",
")",
"{",
"list",
"(",
"$",
"allNumeric",
",",
"$",
"inSequence",
")",
"=",
"$",
"this",
"->",
"detectContainerKeyFlags",
"(",
"$",
"data",
")",
";",
"if",
"(",
"$",
"allNumeric"... | We select the container subtype that uses the lowest number of bytes to get
the job done.
To do this, we determine:
1. Are ALL indexes numeric? If yes, then the object is a LIST or a MAP; if no, then the object is an OBJECT
2. Are ALL indexes in sequence starting at 0? If yes, then the object is a LIST. If no, the ob... | [
"We",
"select",
"the",
"container",
"subtype",
"that",
"uses",
"the",
"lowest",
"number",
"of",
"bytes",
"to",
"get",
"the",
"job",
"done",
"."
] | 838591e7a92c0f257c09a1df141d80737a20f7d9 | https://github.com/JaredClemence/binn/blob/838591e7a92c0f257c09a1df141d80737a20f7d9/src/core/BinnFactory.php#L138-L147 |
12,171 | JaredClemence/binn | src/core/BinnFactory.php | BinnFactory.detectContainerKeyFlags | private function detectContainerKeyFlags($data) {
$allNumeric = true;
$inSequence = true;
$expectedIndex = 0;
foreach( $data as $key=>$value ){
if( $key == $expectedIndex ){
$expectedIndex++;
}else{
$inSequence = false;
... | php | private function detectContainerKeyFlags($data) {
$allNumeric = true;
$inSequence = true;
$expectedIndex = 0;
foreach( $data as $key=>$value ){
if( $key == $expectedIndex ){
$expectedIndex++;
}else{
$inSequence = false;
... | [
"private",
"function",
"detectContainerKeyFlags",
"(",
"$",
"data",
")",
"{",
"$",
"allNumeric",
"=",
"true",
";",
"$",
"inSequence",
"=",
"true",
";",
"$",
"expectedIndex",
"=",
"0",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"valu... | Detect the status of keys to determine whether they are all numeric and in sequence from zero.
[ 0=>..., 1=>..., 2=>... ] === in sequence from zero
[ 1=>..., 15=>..., 19=>... ] === all numeric
[ "index1"=>..., "index2"=>... ] === neither numeric or in sequence
@param array|object $data
@return array | [
"Detect",
"the",
"status",
"of",
"keys",
"to",
"determine",
"whether",
"they",
"are",
"all",
"numeric",
"and",
"in",
"sequence",
"from",
"zero",
"."
] | 838591e7a92c0f257c09a1df141d80737a20f7d9 | https://github.com/JaredClemence/binn/blob/838591e7a92c0f257c09a1df141d80737a20f7d9/src/core/BinnFactory.php#L159-L174 |
12,172 | cobonto/module | src/Classes/Module.php | Module.checkOnDisk | public static function checkOnDisk()
{
$args = func_get_args();
if (count($args) == 2)
$module = $args[0] . DIRECTORY_SEPARATOR . $args[1];
elseif (count($args) == 1)
$module = $args[1];
else
throw new \Exception();
$module = str_replace('... | php | public static function checkOnDisk()
{
$args = func_get_args();
if (count($args) == 2)
$module = $args[0] . DIRECTORY_SEPARATOR . $args[1];
elseif (count($args) == 1)
$module = $args[1];
else
throw new \Exception();
$module = str_replace('... | [
"public",
"static",
"function",
"checkOnDisk",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"==",
"2",
")",
"$",
"module",
"=",
"$",
"args",
"[",
"0",
"]",
".",
"DIRECTORY_SEPARATOR",
"... | check module is disk or not
@return bool | [
"check",
"module",
"is",
"disk",
"or",
"not"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L221-L232 |
12,173 | cobonto/module | src/Classes/Module.php | Module.isInstalled | public static function isInstalled($author, $name)
{
if (!self::checkOnDisk($author, $name))
return false;
return self::getFromDb($author, $name);
} | php | public static function isInstalled($author, $name)
{
if (!self::checkOnDisk($author, $name))
return false;
return self::getFromDb($author, $name);
} | [
"public",
"static",
"function",
"isInstalled",
"(",
"$",
"author",
",",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"checkOnDisk",
"(",
"$",
"author",
",",
"$",
"name",
")",
")",
"return",
"false",
";",
"return",
"self",
"::",
"getFromDb",
"... | check module is installed
@param $author
@param $name
@return bool | [
"check",
"module",
"is",
"installed"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L254-L259 |
12,174 | cobonto/module | src/Classes/Module.php | Module.getInstance | public static function getInstance()
{
$args = func_get_args();
if (count($args) == 2)
{
$author = $args[0];
$name = $args[1];
}
elseif (count($args) == 1)
{
list($author, $name) = explode('\\', $args[0]);
}
else
... | php | public static function getInstance()
{
$args = func_get_args();
if (count($args) == 2)
{
$author = $args[0];
$name = $args[1];
}
elseif (count($args) == 1)
{
list($author, $name) = explode('\\', $args[0]);
}
else
... | [
"public",
"static",
"function",
"getInstance",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"==",
"2",
")",
"{",
"$",
"author",
"=",
"$",
"args",
"[",
"0",
"]",
";",
"$",
"name",
"=... | get instance of module object
@param $author
@param $name
@return bool|Module | [
"get",
"instance",
"of",
"module",
"object"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L273-L302 |
12,175 | cobonto/module | src/Classes/Module.php | Module.getModulesFromDisk | public static function getModulesFromDisk()
{
// check Modules folder is created or not
if (!app('files')->exists(app_path('Modules')))
app('files')->makeDirectory(app_path('Modules'));
$authors = app('files')->directories(app_path('Modules'));
$results = [];
if (... | php | public static function getModulesFromDisk()
{
// check Modules folder is created or not
if (!app('files')->exists(app_path('Modules')))
app('files')->makeDirectory(app_path('Modules'));
$authors = app('files')->directories(app_path('Modules'));
$results = [];
if (... | [
"public",
"static",
"function",
"getModulesFromDisk",
"(",
")",
"{",
"// check Modules folder is created or not",
"if",
"(",
"!",
"app",
"(",
"'files'",
")",
"->",
"exists",
"(",
"app_path",
"(",
"'Modules'",
")",
")",
")",
"app",
"(",
"'files'",
")",
"->",
... | get from disk | [
"get",
"from",
"disk"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L323-L352 |
12,176 | cobonto/module | src/Classes/Module.php | Module.renderConfigure | protected function renderConfigure()
{
$this->fillValues();
$this->tpl_form = 'admin.helpers.form.form';
$this->generateForm();
// assign some vars
$this->assign->params([
'form_url' => route(config('app.admin_url') . '.modules.save', ['author' => strtolower(camel... | php | protected function renderConfigure()
{
$this->fillValues();
$this->tpl_form = 'admin.helpers.form.form';
$this->generateForm();
// assign some vars
$this->assign->params([
'form_url' => route(config('app.admin_url') . '.modules.save', ['author' => strtolower(camel... | [
"protected",
"function",
"renderConfigure",
"(",
")",
"{",
"$",
"this",
"->",
"fillValues",
"(",
")",
";",
"$",
"this",
"->",
"tpl_form",
"=",
"'admin.helpers.form.form'",
";",
"$",
"this",
"->",
"generateForm",
"(",
")",
";",
"// assign some vars",
"$",
"th... | prepare and render configuration form | [
"prepare",
"and",
"render",
"configuration",
"form"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L365-L376 |
12,177 | cobonto/module | src/Classes/Module.php | Module.addCSS | public function addCSS($files)
{
if (!is_array($files))
$files = [$files];
foreach ($files as $key => $file)
{
$files[$key] = $this->mediaPath . 'css/' . $file;
}
$this->assign->addCSS($files, true);
} | php | public function addCSS($files)
{
if (!is_array($files))
$files = [$files];
foreach ($files as $key => $file)
{
$files[$key] = $this->mediaPath . 'css/' . $file;
}
$this->assign->addCSS($files, true);
} | [
"public",
"function",
"addCSS",
"(",
"$",
"files",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"files",
")",
")",
"$",
"files",
"=",
"[",
"$",
"files",
"]",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"file",
")",
"{",
... | add css file for module
@param $files | [
"add",
"css",
"file",
"for",
"module"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L480-L489 |
12,178 | cobonto/module | src/Classes/Module.php | Module.addPlugin | public function addPlugin($file)
{
$path = $this->mediaPath . 'plugins/';
$this->assign->addJS($path . $file . '/' . $file . '.min.js', true);
$this->assign->addCSS($path . $file . '/' . $file . '.css', true);
} | php | public function addPlugin($file)
{
$path = $this->mediaPath . 'plugins/';
$this->assign->addJS($path . $file . '/' . $file . '.min.js', true);
$this->assign->addCSS($path . $file . '/' . $file . '.css', true);
} | [
"public",
"function",
"addPlugin",
"(",
"$",
"file",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"mediaPath",
".",
"'plugins/'",
";",
"$",
"this",
"->",
"assign",
"->",
"addJS",
"(",
"$",
"path",
".",
"$",
"file",
".",
"'/'",
".",
"$",
"file",
... | add plugin file for module
@param $files | [
"add",
"plugin",
"file",
"for",
"module"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L510-L515 |
12,179 | cobonto/module | src/Classes/Module.php | Module.getModulesByFile | public static function getModulesByFile($file = 'Module.php')
{
$modules = Module::getModules();
$source = app_path('Modules' . DIRECTORY_SEPARATOR . '{author}' . DIRECTORY_SEPARATOR . '{module}' . DIRECTORY_SEPARATOR . $file);
$files = [];
if ($modules && count($modules))
... | php | public static function getModulesByFile($file = 'Module.php')
{
$modules = Module::getModules();
$source = app_path('Modules' . DIRECTORY_SEPARATOR . '{author}' . DIRECTORY_SEPARATOR . '{module}' . DIRECTORY_SEPARATOR . $file);
$files = [];
if ($modules && count($modules))
... | [
"public",
"static",
"function",
"getModulesByFile",
"(",
"$",
"file",
"=",
"'Module.php'",
")",
"{",
"$",
"modules",
"=",
"Module",
"::",
"getModules",
"(",
")",
";",
"$",
"source",
"=",
"app_path",
"(",
"'Modules'",
".",
"DIRECTORY_SEPARATOR",
".",
"'{autho... | Get name of all modules that exists
@param string $file that must be exits
@return array | [
"Get",
"name",
"of",
"all",
"modules",
"that",
"exists"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L562-L586 |
12,180 | cobonto/module | src/Classes/Module.php | Module.updateVersion | public function updateVersion()
{
\DB::table('modules')->where([
['name', '=', $this->name],
['author', '=', $this->author],
])->update(['version' => $this->version]);
} | php | public function updateVersion()
{
\DB::table('modules')->where([
['name', '=', $this->name],
['author', '=', $this->author],
])->update(['version' => $this->version]);
} | [
"public",
"function",
"updateVersion",
"(",
")",
"{",
"\\",
"DB",
"::",
"table",
"(",
"'modules'",
")",
"->",
"where",
"(",
"[",
"[",
"'name'",
",",
"'='",
",",
"$",
"this",
"->",
"name",
"]",
",",
"[",
"'author'",
",",
"'='",
",",
"$",
"this",
"... | Update database version | [
"Update",
"database",
"version"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Module.php#L670-L677 |
12,181 | synapsestudios/synapse-base | src/Synapse/Mapper/AbstractMapper.php | AbstractMapper.persist | public function persist(AbstractEntity $entity)
{
/** @var InserterTrait $this */
if ($entity->isNew()) {
return $this->insert($entity);
}
/** @var UpdaterTrait $this */
return $this->update($entity);
} | php | public function persist(AbstractEntity $entity)
{
/** @var InserterTrait $this */
if ($entity->isNew()) {
return $this->insert($entity);
}
/** @var UpdaterTrait $this */
return $this->update($entity);
} | [
"public",
"function",
"persist",
"(",
"AbstractEntity",
"$",
"entity",
")",
"{",
"/** @var InserterTrait $this */",
"if",
"(",
"$",
"entity",
"->",
"isNew",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"insert",
"(",
"$",
"entity",
")",
";",
"}",
"/*... | Persist this entity, inserting it if new and otherwise updating it
@param AbstractEntity $entity
@return AbstractEntity | [
"Persist",
"this",
"entity",
"inserting",
"it",
"if",
"new",
"and",
"otherwise",
"updating",
"it"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/AbstractMapper.php#L160-L169 |
12,182 | synapsestudios/synapse-base | src/Synapse/Mapper/AbstractMapper.php | AbstractMapper.getPrimaryKeyWheres | protected function getPrimaryKeyWheres(AbstractEntity $entity)
{
$wheres = [];
$arrayCopy = $entity->getArrayCopy();
foreach ($this->primaryKey as $keyColumn) {
$wheres[$keyColumn] = $arrayCopy[$keyColumn];
}
return $wheres;
} | php | protected function getPrimaryKeyWheres(AbstractEntity $entity)
{
$wheres = [];
$arrayCopy = $entity->getArrayCopy();
foreach ($this->primaryKey as $keyColumn) {
$wheres[$keyColumn] = $arrayCopy[$keyColumn];
}
return $wheres;
} | [
"protected",
"function",
"getPrimaryKeyWheres",
"(",
"AbstractEntity",
"$",
"entity",
")",
"{",
"$",
"wheres",
"=",
"[",
"]",
";",
"$",
"arrayCopy",
"=",
"$",
"entity",
"->",
"getArrayCopy",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"primaryKey",
... | Get a wheres array for finding the row that matches an entity
@return array | [
"Get",
"a",
"wheres",
"array",
"for",
"finding",
"the",
"row",
"that",
"matches",
"an",
"entity"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/AbstractMapper.php#L198-L208 |
12,183 | synapsestudios/synapse-base | src/Synapse/Mapper/AbstractMapper.php | AbstractMapper.initialize | protected function initialize()
{
if ($this->initialized) {
return;
}
if (! is_object($this->prototype)) {
$this->prototype = new ArrayObject;
}
if (! $this->hydrator instanceof HydratorInterface) {
$this->hydrator = new ArraySerializable... | php | protected function initialize()
{
if ($this->initialized) {
return;
}
if (! is_object($this->prototype)) {
$this->prototype = new ArrayObject;
}
if (! $this->hydrator instanceof HydratorInterface) {
$this->hydrator = new ArraySerializable... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initialized",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_object",
"(",
"$",
"this",
"->",
"prototype",
")",
")",
"{",
"$",
"this",
"->",
"prototype",
"=",
"... | Set up the hydrator and prototype of this mapper if not yet set | [
"Set",
"up",
"the",
"hydrator",
"and",
"prototype",
"of",
"this",
"mapper",
"if",
"not",
"yet",
"set"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/AbstractMapper.php#L213-L228 |
12,184 | synapsestudios/synapse-base | src/Synapse/Mapper/AbstractMapper.php | AbstractMapper.execute | protected function execute(PreparableSqlInterface $query)
{
$statement = $this->getSqlObject()->prepareStatementForSqlObject($query);
$resultSet = new HydratingResultSet($this->hydrator, $this->prototype);
return $resultSet->initialize($statement->execute());
} | php | protected function execute(PreparableSqlInterface $query)
{
$statement = $this->getSqlObject()->prepareStatementForSqlObject($query);
$resultSet = new HydratingResultSet($this->hydrator, $this->prototype);
return $resultSet->initialize($statement->execute());
} | [
"protected",
"function",
"execute",
"(",
"PreparableSqlInterface",
"$",
"query",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"getSqlObject",
"(",
")",
"->",
"prepareStatementForSqlObject",
"(",
"$",
"query",
")",
";",
"$",
"resultSet",
"=",
"new",
"H... | Execute a given query
@param PreparableSqlInterface $query Query to be executed
@return HydratingResultSet | [
"Execute",
"a",
"given",
"query"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/AbstractMapper.php#L236-L242 |
12,185 | synapsestudios/synapse-base | src/Synapse/Mapper/AbstractMapper.php | AbstractMapper.executeAndGetResultsAsEntity | protected function executeAndGetResultsAsEntity(PreparableSqlInterface $query)
{
$data = $this->execute($query)->current();
if (! $data || count($data) === 0) {
return false;
}
return $data;
} | php | protected function executeAndGetResultsAsEntity(PreparableSqlInterface $query)
{
$data = $this->execute($query)->current();
if (! $data || count($data) === 0) {
return false;
}
return $data;
} | [
"protected",
"function",
"executeAndGetResultsAsEntity",
"(",
"PreparableSqlInterface",
"$",
"query",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"execute",
"(",
"$",
"query",
")",
"->",
"current",
"(",
")",
";",
"if",
"(",
"!",
"$",
"data",
"||",
"co... | Execute a given query and return the result as a single Entity object or
false if no results are returned from the query.
@param PreparableSqlInterface $query Query to be executed
@return AbstractEntity|bool | [
"Execute",
"a",
"given",
"query",
"and",
"return",
"the",
"result",
"as",
"a",
"single",
"Entity",
"object",
"or",
"false",
"if",
"no",
"results",
"are",
"returned",
"from",
"the",
"query",
"."
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/AbstractMapper.php#L251-L260 |
12,186 | synapsestudios/synapse-base | src/Synapse/Mapper/AbstractMapper.php | AbstractMapper.executeAndGetResultsAsEntityIterator | protected function executeAndGetResultsAsEntityIterator(PreparableSqlInterface $query)
{
$entities = $this->execute($query)
->toEntityArray();
return new EntityIterator($entities);
} | php | protected function executeAndGetResultsAsEntityIterator(PreparableSqlInterface $query)
{
$entities = $this->execute($query)
->toEntityArray();
return new EntityIterator($entities);
} | [
"protected",
"function",
"executeAndGetResultsAsEntityIterator",
"(",
"PreparableSqlInterface",
"$",
"query",
")",
"{",
"$",
"entities",
"=",
"$",
"this",
"->",
"execute",
"(",
"$",
"query",
")",
"->",
"toEntityArray",
"(",
")",
";",
"return",
"new",
"EntityIter... | Execute a given query and return the result as an Entity Iterator object
@param PreparableSqlInterface $query Query to be executed
@return EntityIterator | [
"Execute",
"a",
"given",
"query",
"and",
"return",
"the",
"result",
"as",
"an",
"Entity",
"Iterator",
"object"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/AbstractMapper.php#L268-L274 |
12,187 | synapsestudios/synapse-base | src/Synapse/Mapper/AbstractMapper.php | AbstractMapper.executeAndGetResultsAsArray | protected function executeAndGetResultsAsArray(PreparableSqlInterface $query)
{
$statement = $this->getSqlObject()->prepareStatementForSqlObject($query);
$resultSet = new ResultSet();
$resultSet->initialize($statement->execute());
return $resultSet->toArray();
} | php | protected function executeAndGetResultsAsArray(PreparableSqlInterface $query)
{
$statement = $this->getSqlObject()->prepareStatementForSqlObject($query);
$resultSet = new ResultSet();
$resultSet->initialize($statement->execute());
return $resultSet->toArray();
} | [
"protected",
"function",
"executeAndGetResultsAsArray",
"(",
"PreparableSqlInterface",
"$",
"query",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"getSqlObject",
"(",
")",
"->",
"prepareStatementForSqlObject",
"(",
"$",
"query",
")",
";",
"$",
"resultSet",
... | Execute the given query and return the result as an array of arrays
@param PreparableSqlInterface $query Query to be executed
@return array | [
"Execute",
"the",
"given",
"query",
"and",
"return",
"the",
"result",
"as",
"an",
"array",
"of",
"arrays"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/AbstractMapper.php#L282-L290 |
12,188 | rbnvrw/crispus | app/Crispus/Filesystem.php | Filesystem.getFiles | public function getFiles($sDirectory, $sExt = '')
{
$aFiles = array();
if(!is_dir($sDirectory)){
return null;
}
foreach(new \DirectoryIterator($sDirectory) as $oFileInfo){
if($oFileInfo->isFile()){
if(empty($sExt) || $sExt == $oFileInfo->getExtension()){
... | php | public function getFiles($sDirectory, $sExt = '')
{
$aFiles = array();
if(!is_dir($sDirectory)){
return null;
}
foreach(new \DirectoryIterator($sDirectory) as $oFileInfo){
if($oFileInfo->isFile()){
if(empty($sExt) || $sExt == $oFileInfo->getExtension()){
... | [
"public",
"function",
"getFiles",
"(",
"$",
"sDirectory",
",",
"$",
"sExt",
"=",
"''",
")",
"{",
"$",
"aFiles",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"sDirectory",
")",
")",
"{",
"return",
"null",
";",
"}",
"foreach",
"... | Helper function to get all files in a directory
@param string $sDirectory start directory
@param string $sExt optional limit to file extensions
@return array the matched files | [
"Helper",
"function",
"to",
"get",
"all",
"files",
"in",
"a",
"directory"
] | 46a5f71c92b31de56c16540ef5c50a363106f1ff | https://github.com/rbnvrw/crispus/blob/46a5f71c92b31de56c16540ef5c50a363106f1ff/app/Crispus/Filesystem.php#L21-L38 |
12,189 | gintonicweb/websockets | src/Websocket/JwtAuthenticationProvider.php | JwtAuthenticationProvider.processAuthenticate | public function processAuthenticate($token, $extra = null)
{
try {
$token = JWT::decode($token, Security::salt(), Configure::read('Websockets.allowedAlgs'));
} catch (Exception $e) {
if (Configure::read('debug')) {
throw $e;
}
return ["... | php | public function processAuthenticate($token, $extra = null)
{
try {
$token = JWT::decode($token, Security::salt(), Configure::read('Websockets.allowedAlgs'));
} catch (Exception $e) {
if (Configure::read('debug')) {
throw $e;
}
return ["... | [
"public",
"function",
"processAuthenticate",
"(",
"$",
"token",
",",
"$",
"extra",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"token",
"=",
"JWT",
"::",
"decode",
"(",
"$",
"token",
",",
"Security",
"::",
"salt",
"(",
")",
",",
"Configure",
"::",
"read"... | Authenticate users based on their JWT. This is inspired by
the method _findUser in admads JWT plugin
@see https://github.com/ADmad/cakephp-jwt-auth/blob/master/src/Auth/JwtAuthenticate.php
@param string $token The token identifier.
@param mixed $extra Unused
@return array | [
"Authenticate",
"users",
"based",
"on",
"their",
"JWT",
".",
"This",
"is",
"inspired",
"by",
"the",
"method",
"_findUser",
"in",
"admads",
"JWT",
"plugin"
] | bc83550cce73a2fa33265f318f1f081685bf97f6 | https://github.com/gintonicweb/websockets/blob/bc83550cce73a2fa33265f318f1f081685bf97f6/src/Websocket/JwtAuthenticationProvider.php#L32-L62 |
12,190 | chemel/addic7ed-cli | src/Database/Addic7edDatabase.php | Addic7edDatabase.getShowId | public function getShowId($term)
{
$lowerTerm = strtolower($term);
if (isset($this->searches[$lowerTerm])) {
return $this->searches[$lowerTerm];
}
$searchData = $this->scrapper->search($term);
if (!isset($searchData->showId)) {
return;
}
... | php | public function getShowId($term)
{
$lowerTerm = strtolower($term);
if (isset($this->searches[$lowerTerm])) {
return $this->searches[$lowerTerm];
}
$searchData = $this->scrapper->search($term);
if (!isset($searchData->showId)) {
return;
}
... | [
"public",
"function",
"getShowId",
"(",
"$",
"term",
")",
"{",
"$",
"lowerTerm",
"=",
"strtolower",
"(",
"$",
"term",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"searches",
"[",
"$",
"lowerTerm",
"]",
")",
")",
"{",
"return",
"$",
"this"... | Get show id
@param string term
@return int showId | [
"Get",
"show",
"id"
] | e10ff6f4a3a37151b9141f15c231ba480aa1c78c | https://github.com/chemel/addic7ed-cli/blob/e10ff6f4a3a37151b9141f15c231ba480aa1c78c/src/Database/Addic7edDatabase.php#L31-L48 |
12,191 | chemel/addic7ed-cli | src/Database/Addic7edDatabase.php | Addic7edDatabase.getShowData | public function getShowData($showId, $season=1)
{
if (isset($this->shows[$showId][$season])) {
return $this->shows[$showId][$season];
}
$showData = $this->scrapper->show($showId, $season);
return $this->shows[$showId][$season] = $showData;
} | php | public function getShowData($showId, $season=1)
{
if (isset($this->shows[$showId][$season])) {
return $this->shows[$showId][$season];
}
$showData = $this->scrapper->show($showId, $season);
return $this->shows[$showId][$season] = $showData;
} | [
"public",
"function",
"getShowData",
"(",
"$",
"showId",
",",
"$",
"season",
"=",
"1",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"shows",
"[",
"$",
"showId",
"]",
"[",
"$",
"season",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Get show data
@param int showId
@return array showData | [
"Get",
"show",
"data"
] | e10ff6f4a3a37151b9141f15c231ba480aa1c78c | https://github.com/chemel/addic7ed-cli/blob/e10ff6f4a3a37151b9141f15c231ba480aa1c78c/src/Database/Addic7edDatabase.php#L57-L66 |
12,192 | AlexHowansky/ork-base | src/Image/Inline.php | Inline.encode | public function encode()
{
if (empty($this->image) === true) {
throw new \RuntimeException('No source image has been specified.');
}
$str = '<img src="data:' . $this->mimeType . ';base64,' . base64_encode($this->image) . '"';
if (empty($this->extraHtml) === false) {
... | php | public function encode()
{
if (empty($this->image) === true) {
throw new \RuntimeException('No source image has been specified.');
}
$str = '<img src="data:' . $this->mimeType . ';base64,' . base64_encode($this->image) . '"';
if (empty($this->extraHtml) === false) {
... | [
"public",
"function",
"encode",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"image",
")",
"===",
"true",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'No source image has been specified.'",
")",
";",
"}",
"$",
"str",
"=",
"'<i... | Encode the current image as an inline IMG tag.
@return string The image encoded as an inline IMG tag. | [
"Encode",
"the",
"current",
"image",
"as",
"an",
"inline",
"IMG",
"tag",
"."
] | 5f4ab14e63bbc8b17898639fd1fff86ee6659bb0 | https://github.com/AlexHowansky/ork-base/blob/5f4ab14e63bbc8b17898639fd1fff86ee6659bb0/src/Image/Inline.php#L60-L71 |
12,193 | AlexHowansky/ork-base | src/Image/Inline.php | Inline.setImageFromFile | public function setImageFromFile($file)
{
if (preg_match('/\.([^\.]+)$/', $file, $match) === 1) {
$this->setMimeType('image/' . $match[1]);
}
return $this->setImageFromBlob(file_get_contents($file));
} | php | public function setImageFromFile($file)
{
if (preg_match('/\.([^\.]+)$/', $file, $match) === 1) {
$this->setMimeType('image/' . $match[1]);
}
return $this->setImageFromBlob(file_get_contents($file));
} | [
"public",
"function",
"setImageFromFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/\\.([^\\.]+)$/'",
",",
"$",
"file",
",",
"$",
"match",
")",
"===",
"1",
")",
"{",
"$",
"this",
"->",
"setMimeType",
"(",
"'image/'",
".",
"$",
"match... | Set the image source from a file.
@param string $file The image file.
@return \Ork\Image\Inline Allow method chaining. | [
"Set",
"the",
"image",
"source",
"from",
"a",
"file",
"."
] | 5f4ab14e63bbc8b17898639fd1fff86ee6659bb0 | https://github.com/AlexHowansky/ork-base/blob/5f4ab14e63bbc8b17898639fd1fff86ee6659bb0/src/Image/Inline.php#L136-L142 |
12,194 | bishopb/vanilla | library/core/class.autoloader.php | Gdn_Autoloader.Attach | public static function Attach($ExtensionType) {
switch ($ExtensionType) {
case self::CONTEXT_APPLICATION:
if (Gdn::ApplicationManager() instanceof Gdn_ApplicationManager) {
$EnabledApplications = Gdn::ApplicationManager()->EnabledApplicationFolders();
... | php | public static function Attach($ExtensionType) {
switch ($ExtensionType) {
case self::CONTEXT_APPLICATION:
if (Gdn::ApplicationManager() instanceof Gdn_ApplicationManager) {
$EnabledApplications = Gdn::ApplicationManager()->EnabledApplicationFolders();
... | [
"public",
"static",
"function",
"Attach",
"(",
"$",
"ExtensionType",
")",
"{",
"switch",
"(",
"$",
"ExtensionType",
")",
"{",
"case",
"self",
"::",
"CONTEXT_APPLICATION",
":",
"if",
"(",
"Gdn",
"::",
"ApplicationManager",
"(",
")",
"instanceof",
"Gdn_Applicati... | Attach mappings for vanilla extension folders
@param string $ExtensionType type of extension to map. one of: CONTEXT_THEME, CONTEXT_PLUGIN, CONTEXT_APPLICATION | [
"Attach",
"mappings",
"for",
"vanilla",
"extension",
"folders"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.autoloader.php#L77-L129 |
12,195 | bishopb/vanilla | library/core/class.autoloader.php | Gdn_Autoloader.Map | public static function Map($MapHash) {
if (array_key_exists($MapHash, self::$Maps))
return self::$Maps[$MapHash];
if (is_null($MapHash)) return self::$Maps;
return FALSE;
} | php | public static function Map($MapHash) {
if (array_key_exists($MapHash, self::$Maps))
return self::$Maps[$MapHash];
if (is_null($MapHash)) return self::$Maps;
return FALSE;
} | [
"public",
"static",
"function",
"Map",
"(",
"$",
"MapHash",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"MapHash",
",",
"self",
"::",
"$",
"Maps",
")",
")",
"return",
"self",
"::",
"$",
"Maps",
"[",
"$",
"MapHash",
"]",
";",
"if",
"(",
"is_n... | Get an Autoloader Map by hash
@param type $MapHash
@return Gdn_Autoloader_Map | [
"Get",
"an",
"Autoloader",
"Map",
"by",
"hash"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.autoloader.php#L275-L281 |
12,196 | bishopb/vanilla | library/core/class.autoloader.php | Gdn_Autoloader.GetMap | public static function GetMap($MapType, $ContextType, $Extension = self::CONTEXT_CORE, $MapRootLocation = PATH_CACHE) {
$MapHash = self::MakeMapHash($MapType, $ContextType, $Extension, $MapRootLocation);
return self::Map($MapHash);
} | php | public static function GetMap($MapType, $ContextType, $Extension = self::CONTEXT_CORE, $MapRootLocation = PATH_CACHE) {
$MapHash = self::MakeMapHash($MapType, $ContextType, $Extension, $MapRootLocation);
return self::Map($MapHash);
} | [
"public",
"static",
"function",
"GetMap",
"(",
"$",
"MapType",
",",
"$",
"ContextType",
",",
"$",
"Extension",
"=",
"self",
"::",
"CONTEXT_CORE",
",",
"$",
"MapRootLocation",
"=",
"PATH_CACHE",
")",
"{",
"$",
"MapHash",
"=",
"self",
"::",
"MakeMapHash",
"(... | Lookup and return an Autoloader Map
@param type $MapType
@param type $ContextType
@param type $Extension
@param type $MapRootLocation
@return Gdn_Autoloader_Map | [
"Lookup",
"and",
"return",
"an",
"Autoloader",
"Map"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.autoloader.php#L292-L295 |
12,197 | bishopb/vanilla | library/core/class.autoloader.php | Gdn_Autoloader.SmartFree | public static function SmartFree($ContextType = NULL, $MapResourceArray = NULL) {
$CacheFolder = @opendir(PATH_CACHE);
if (!$CacheFolder) return TRUE;
while ($File = readdir($CacheFolder)) {
$Extension = pathinfo($File, PATHINFO_EXTENSION);
if ($Extension == 'ini' && $File != 'local... | php | public static function SmartFree($ContextType = NULL, $MapResourceArray = NULL) {
$CacheFolder = @opendir(PATH_CACHE);
if (!$CacheFolder) return TRUE;
while ($File = readdir($CacheFolder)) {
$Extension = pathinfo($File, PATHINFO_EXTENSION);
if ($Extension == 'ini' && $File != 'local... | [
"public",
"static",
"function",
"SmartFree",
"(",
"$",
"ContextType",
"=",
"NULL",
",",
"$",
"MapResourceArray",
"=",
"NULL",
")",
"{",
"$",
"CacheFolder",
"=",
"@",
"opendir",
"(",
"PATH_CACHE",
")",
";",
"if",
"(",
"!",
"$",
"CacheFolder",
")",
"return... | This method frees the map storing information about the specified resource
Takes a maptype, and an array of information about the resource in question:
a plugininfo array, in the case of a plugin, or
@param string $ContextType type of map to consider (one of the MAP_ constants)
@param array $MapResourceArray array of... | [
"This",
"method",
"frees",
"the",
"map",
"storing",
"information",
"about",
"the",
"specified",
"resource"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.autoloader.php#L470-L480 |
12,198 | bishopb/vanilla | library/core/class.autoloader.php | Gdn_Autoloader.Start | public static function Start() {
self::$Prefixes = array(
self::CONTEXT_CORE => 'c',
self::CONTEXT_APPLICATION => 'a',
self::CONTEXT_PLUGIN => 'p',
self::CONTEXT_THEME => 't'
);
self::$ContextOrder = array(
self::CON... | php | public static function Start() {
self::$Prefixes = array(
self::CONTEXT_CORE => 'c',
self::CONTEXT_APPLICATION => 'a',
self::CONTEXT_PLUGIN => 'p',
self::CONTEXT_THEME => 't'
);
self::$ContextOrder = array(
self::CON... | [
"public",
"static",
"function",
"Start",
"(",
")",
"{",
"self",
"::",
"$",
"Prefixes",
"=",
"array",
"(",
"self",
"::",
"CONTEXT_CORE",
"=>",
"'c'",
",",
"self",
"::",
"CONTEXT_APPLICATION",
"=>",
"'a'",
",",
"self",
"::",
"CONTEXT_PLUGIN",
"=>",
"'p'",
... | Register core mappings
Set up the autoloader with known searchg directories, hook into the SPL autoloader
and load existing caches.
@param void | [
"Register",
"core",
"mappings"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.autoloader.php#L490-L519 |
12,199 | bishopb/vanilla | library/core/class.autoloader.php | Gdn_Autoloader_Map.Load | public static function Load($MapType, $ContextType, $MapRootLocation, $Options) {
return new Gdn_Autoloader_Map($MapType, $ContextType, $MapRootLocation, $Options);
} | php | public static function Load($MapType, $ContextType, $MapRootLocation, $Options) {
return new Gdn_Autoloader_Map($MapType, $ContextType, $MapRootLocation, $Options);
} | [
"public",
"static",
"function",
"Load",
"(",
"$",
"MapType",
",",
"$",
"ContextType",
",",
"$",
"MapRootLocation",
",",
"$",
"Options",
")",
"{",
"return",
"new",
"Gdn_Autoloader_Map",
"(",
"$",
"MapType",
",",
"$",
"ContextType",
",",
"$",
"MapRootLocation"... | Autoloader cache static constructor
@return Gdn_Autoloader_Map | [
"Autoloader",
"cache",
"static",
"constructor"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.autoloader.php#L703-L705 |
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.