id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,300 | ARCANESOFT/Core | src/CoreServiceProvider.php | CoreServiceProvider.registerArcanesoftDatabase | private function registerArcanesoftDatabase()
{
// Keep it or using a real DBMS ?
$connection = $this->config()->get('core.database.default', 'sqlite');
$this->config()->set(
'database.connections.arcanesoft',
$this->config()->get("core.database.connections.{$connect... | php | private function registerArcanesoftDatabase()
{
// Keep it or using a real DBMS ?
$connection = $this->config()->get('core.database.default', 'sqlite');
$this->config()->set(
'database.connections.arcanesoft',
$this->config()->get("core.database.connections.{$connect... | [
"private",
"function",
"registerArcanesoftDatabase",
"(",
")",
"{",
"// Keep it or using a real DBMS ?",
"$",
"connection",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"get",
"(",
"'core.database.default'",
",",
"'sqlite'",
")",
";",
"$",
"this",
"->",
"co... | Register Foundation database. | [
"Register",
"Foundation",
"database",
"."
] | d0798074d47785cf0a768f51d82c0315363213be | https://github.com/ARCANESOFT/Core/blob/d0798074d47785cf0a768f51d82c0315363213be/src/CoreServiceProvider.php#L84-L93 |
11,301 | tenside/core | src/Config/TensideJsonConfig.php | TensideJsonConfig.addCommandLineArgument | public function addCommandLineArgument($argument)
{
$args = (array) $this->getPhpCliArguments();
$this->setPhpCliArguments(array_merge($args, [$argument]));
return $this;
} | php | public function addCommandLineArgument($argument)
{
$args = (array) $this->getPhpCliArguments();
$this->setPhpCliArguments(array_merge($args, [$argument]));
return $this;
} | [
"public",
"function",
"addCommandLineArgument",
"(",
"$",
"argument",
")",
"{",
"$",
"args",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"getPhpCliArguments",
"(",
")",
";",
"$",
"this",
"->",
"setPhpCliArguments",
"(",
"array_merge",
"(",
"$",
"args",
",",... | Add a command line argument.
@param string $argument The argument to add.
@return TensideJsonConfig | [
"Add",
"a",
"command",
"line",
"argument",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Config/TensideJsonConfig.php#L132-L138 |
11,302 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.fromFloat | public static function fromFloat($float_value, $precision = null)
{
if ($precision === null) {
$precision = static::$PRECISION;
}
// left of decimal point
$rounded_float = intval(round($float_value));
$big_integer_int = (new BigInt($rounded_float))->multiply(self... | php | public static function fromFloat($float_value, $precision = null)
{
if ($precision === null) {
$precision = static::$PRECISION;
}
// left of decimal point
$rounded_float = intval(round($float_value));
$big_integer_int = (new BigInt($rounded_float))->multiply(self... | [
"public",
"static",
"function",
"fromFloat",
"(",
"$",
"float_value",
",",
"$",
"precision",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"precision",
"===",
"null",
")",
"{",
"$",
"precision",
"=",
"static",
"::",
"$",
"PRECISION",
";",
"}",
"// left of decim... | Creates a new quantity from a float value
@param float $float_value The amount as a float
@param integer $precision Number of decimal places of precision
@return CryptoQuantity The new CryptoQuantity object | [
"Creates",
"a",
"new",
"quantity",
"from",
"a",
"float",
"value"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L26-L42 |
11,303 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.fromCryptoQuantity | public static function fromCryptoQuantity(CryptoQuantity $source_quantity, $precision = null)
{
if ($precision === null) {
$precision = static::$PRECISION;
}
$round_up = false;
$source_precision = $source_quantity->getPrecision();
$precision_delta = $precision - ... | php | public static function fromCryptoQuantity(CryptoQuantity $source_quantity, $precision = null)
{
if ($precision === null) {
$precision = static::$PRECISION;
}
$round_up = false;
$source_precision = $source_quantity->getPrecision();
$precision_delta = $precision - ... | [
"public",
"static",
"function",
"fromCryptoQuantity",
"(",
"CryptoQuantity",
"$",
"source_quantity",
",",
"$",
"precision",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"precision",
"===",
"null",
")",
"{",
"$",
"precision",
"=",
"static",
"::",
"$",
"PRECISION",
... | Creates an asset quantity from another cryptoquantity and adjusts the precision
This will round if the new precision is smaller than the previous precision
@param Math_BigInteger $big_integer The amount as a big integer object
@param integer $precision Number of decimal places of precision
@return Crypt... | [
"Creates",
"an",
"asset",
"quantity",
"from",
"another",
"cryptoquantity",
"and",
"adjusts",
"the",
"precision",
"This",
"will",
"round",
"if",
"the",
"new",
"precision",
"is",
"smaller",
"than",
"the",
"previous",
"precision"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L103-L131 |
11,304 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.unserialize | public static function unserialize($serialized_quantity) {
if (is_array($serialized_quantity)) {
$json_array = $serialized_quantity;
} else if (is_object($serialized_quantity)) {
$json_array = json_decode(json_encode($serialized_quantity), true);
} else {
$jso... | php | public static function unserialize($serialized_quantity) {
if (is_array($serialized_quantity)) {
$json_array = $serialized_quantity;
} else if (is_object($serialized_quantity)) {
$json_array = json_decode(json_encode($serialized_quantity), true);
} else {
$jso... | [
"public",
"static",
"function",
"unserialize",
"(",
"$",
"serialized_quantity",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"serialized_quantity",
")",
")",
"{",
"$",
"json_array",
"=",
"$",
"serialized_quantity",
";",
"}",
"else",
"if",
"(",
"is_object",
"("... | Unserialize a quantity object
@param array $serialized_quantity Serialized quantity data
@return CryptoQuantity The quantity class | [
"Unserialize",
"a",
"quantity",
"object"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L139-L152 |
11,305 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.getFloatValue | public function getFloatValue()
{
list($quotient, $remainder) = $this->big_integer->divide(self::precisionUnitsAsBigInt(1, $this->precision));
return floatval($quotient->toString()) + floatval($remainder->toString() / pow(10, $this->precision));
} | php | public function getFloatValue()
{
list($quotient, $remainder) = $this->big_integer->divide(self::precisionUnitsAsBigInt(1, $this->precision));
return floatval($quotient->toString()) + floatval($remainder->toString() / pow(10, $this->precision));
} | [
"public",
"function",
"getFloatValue",
"(",
")",
"{",
"list",
"(",
"$",
"quotient",
",",
"$",
"remainder",
")",
"=",
"$",
"this",
"->",
"big_integer",
"->",
"divide",
"(",
"self",
"::",
"precisionUnitsAsBigInt",
"(",
"1",
",",
"$",
"this",
"->",
"precisi... | Gets the amount as a float
@return float A float representation of the value | [
"Gets",
"the",
"amount",
"as",
"a",
"float"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L189-L193 |
11,306 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.gt | public function gt($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) > 0);
} | php | public function gt($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) > 0);
} | [
"public",
"function",
"gt",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"other",
"instanceof",
"self",
")",
")",
"{",
"$",
"other",
"=",
"new",
"BigInt",
"(",
"$",
"other",
")",
";",
"}",
"return",
"(",
"$",
"this",
"->",
"compare",
... | Returns true if greater than
@param CryptoQuantity|int $other quantity to compare to
@return boolean | [
"Returns",
"true",
"if",
"greater",
"than"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L210-L216 |
11,307 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.gte | public function gte($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) >= 0);
} | php | public function gte($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) >= 0);
} | [
"public",
"function",
"gte",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"other",
"instanceof",
"self",
")",
")",
"{",
"$",
"other",
"=",
"new",
"BigInt",
"(",
"$",
"other",
")",
";",
"}",
"return",
"(",
"$",
"this",
"->",
"compare",
... | Returns true if greater than or equal to
@param CryptoQuantity|int $other quantity to compare to
@return boolean | [
"Returns",
"true",
"if",
"greater",
"than",
"or",
"equal",
"to"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L223-L229 |
11,308 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.lt | public function lt($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) < 0);
} | php | public function lt($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) < 0);
} | [
"public",
"function",
"lt",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"other",
"instanceof",
"self",
")",
")",
"{",
"$",
"other",
"=",
"new",
"BigInt",
"(",
"$",
"other",
")",
";",
"}",
"return",
"(",
"$",
"this",
"->",
"compare",
... | Returns true if less than
@param CryptoQuantity|int $other quantity to compare to
@return boolean | [
"Returns",
"true",
"if",
"less",
"than"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L236-L242 |
11,309 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.lte | public function lte($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) <= 0);
} | php | public function lte($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) <= 0);
} | [
"public",
"function",
"lte",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"other",
"instanceof",
"self",
")",
")",
"{",
"$",
"other",
"=",
"new",
"BigInt",
"(",
"$",
"other",
")",
";",
"}",
"return",
"(",
"$",
"this",
"->",
"compare",
... | Returns true if less than or equal to
@param CryptoQuantity|int $other quantity to compare to
@return boolean | [
"Returns",
"true",
"if",
"less",
"than",
"or",
"equal",
"to"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L249-L255 |
11,310 | tokenly/crypto-quantity | src/CryptoQuantity.php | CryptoQuantity.equals | public function equals($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) === 0);
} | php | public function equals($other)
{
if (!($other instanceof self)) {
$other = new BigInt($other);
}
return ($this->compare($other) === 0);
} | [
"public",
"function",
"equals",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"other",
"instanceof",
"self",
")",
")",
"{",
"$",
"other",
"=",
"new",
"BigInt",
"(",
"$",
"other",
")",
";",
"}",
"return",
"(",
"$",
"this",
"->",
"compare"... | Returns true if exactly equal to
@param CryptoQuantity|int $other quantity to compare to
@return boolean | [
"Returns",
"true",
"if",
"exactly",
"equal",
"to"
] | 81b7412b55c3cae1732de55d8e5118d17fb59900 | https://github.com/tokenly/crypto-quantity/blob/81b7412b55c3cae1732de55d8e5118d17fb59900/src/CryptoQuantity.php#L271-L277 |
11,311 | coolms/common | src/Form/Element/LocaleSelect.php | LocaleSelect.getLocaleList | public function getLocaleList()
{
if (null === $this->localeList) {
$this->setLocaleList(LocaleUtils::getNamedList(Locale::getDefault()));
}
return $this->localeList;
} | php | public function getLocaleList()
{
if (null === $this->localeList) {
$this->setLocaleList(LocaleUtils::getNamedList(Locale::getDefault()));
}
return $this->localeList;
} | [
"public",
"function",
"getLocaleList",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"localeList",
")",
"{",
"$",
"this",
"->",
"setLocaleList",
"(",
"LocaleUtils",
"::",
"getNamedList",
"(",
"Locale",
"::",
"getDefault",
"(",
")",
")",
")"... | Return the locale list for checking allowed locales
Lazy loads one if none set
@return array | [
"Return",
"the",
"locale",
"list",
"for",
"checking",
"allowed",
"locales"
] | 3572993cdcdb2898cdde396a2f1de9864b193660 | https://github.com/coolms/common/blob/3572993cdcdb2898cdde396a2f1de9864b193660/src/Form/Element/LocaleSelect.php#L196-L203 |
11,312 | jasny/application-env | src/ApplicationEnv.php | ApplicationEnv.is | public function is(string $env): bool
{
return $this->env === $env || str_starts_with($this->env, "$env.");
} | php | public function is(string $env): bool
{
return $this->env === $env || str_starts_with($this->env, "$env.");
} | [
"public",
"function",
"is",
"(",
"string",
"$",
"env",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"env",
"===",
"$",
"env",
"||",
"str_starts_with",
"(",
"$",
"this",
"->",
"env",
",",
"\"$env.\"",
")",
";",
"}"
] | Check if environment matches or is a parent.
@param string $env
@return bool | [
"Check",
"if",
"environment",
"matches",
"or",
"is",
"a",
"parent",
"."
] | b4780f6ee81cc3826b2e9acfe207d68a42848a75 | https://github.com/jasny/application-env/blob/b4780f6ee81cc3826b2e9acfe207d68a42848a75/src/ApplicationEnv.php#L45-L48 |
11,313 | jasny/application-env | src/ApplicationEnv.php | ApplicationEnv.getLevels | public function getLevels(int $from = 1, ?int $to = null, ?callable $callback = null): array
{
$parts = explode('.', $this->env);
$n = isset($to) ? min(count($parts), $to) : count($parts);
$levels = [];
for ($i = $from; $i <= $n; $i++) {
$level = join('.', array_slice($... | php | public function getLevels(int $from = 1, ?int $to = null, ?callable $callback = null): array
{
$parts = explode('.', $this->env);
$n = isset($to) ? min(count($parts), $to) : count($parts);
$levels = [];
for ($i = $from; $i <= $n; $i++) {
$level = join('.', array_slice($... | [
"public",
"function",
"getLevels",
"(",
"int",
"$",
"from",
"=",
"1",
",",
"?",
"int",
"$",
"to",
"=",
"null",
",",
"?",
"callable",
"$",
"callback",
"=",
"null",
")",
":",
"array",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",... | Traverse through each level of the application env.
@param int $from
@param int|null $to
@param callable|null $callback
@return array | [
"Traverse",
"through",
"each",
"level",
"of",
"the",
"application",
"env",
"."
] | b4780f6ee81cc3826b2e9acfe207d68a42848a75 | https://github.com/jasny/application-env/blob/b4780f6ee81cc3826b2e9acfe207d68a42848a75/src/ApplicationEnv.php#L58-L71 |
11,314 | adrianyg7/Acl | src/Policies/AclPolicy.php | AclPolicy.defineAbilities | public function defineAbilities()
{
$this->gate->before(function ($user, $ability) {
if ($user->isSuperuser()) return true;
});
foreach ($this->getPermissions() as $permission) {
$this->gate->define($permission->name, function ($user) use ($permission) {
... | php | public function defineAbilities()
{
$this->gate->before(function ($user, $ability) {
if ($user->isSuperuser()) return true;
});
foreach ($this->getPermissions() as $permission) {
$this->gate->define($permission->name, function ($user) use ($permission) {
... | [
"public",
"function",
"defineAbilities",
"(",
")",
"{",
"$",
"this",
"->",
"gate",
"->",
"before",
"(",
"function",
"(",
"$",
"user",
",",
"$",
"ability",
")",
"{",
"if",
"(",
"$",
"user",
"->",
"isSuperuser",
"(",
")",
")",
"return",
"true",
";",
... | Defines the Abilities for the application.
@return void | [
"Defines",
"the",
"Abilities",
"for",
"the",
"application",
"."
] | b3d69199405ca7406b33991884f6bb2e6f85f4e5 | https://github.com/adrianyg7/Acl/blob/b3d69199405ca7406b33991884f6bb2e6f85f4e5/src/Policies/AclPolicy.php#L83-L94 |
11,315 | adrianyg7/Acl | src/Policies/AclPolicy.php | AclPolicy.passesAuthorization | public function passesAuthorization()
{
if ( ! $this->hasToBeAuthorized() ) return true;
return $this->gate->allows($this->route->getName());
} | php | public function passesAuthorization()
{
if ( ! $this->hasToBeAuthorized() ) return true;
return $this->gate->allows($this->route->getName());
} | [
"public",
"function",
"passesAuthorization",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasToBeAuthorized",
"(",
")",
")",
"return",
"true",
";",
"return",
"$",
"this",
"->",
"gate",
"->",
"allows",
"(",
"$",
"this",
"->",
"route",
"->",
"getNa... | Authorizes a given route.
@param Route $route
@return bool | [
"Authorizes",
"a",
"given",
"route",
"."
] | b3d69199405ca7406b33991884f6bb2e6f85f4e5 | https://github.com/adrianyg7/Acl/blob/b3d69199405ca7406b33991884f6bb2e6f85f4e5/src/Policies/AclPolicy.php#L114-L119 |
11,316 | adrianyg7/Acl | src/Policies/AclPolicy.php | AclPolicy.hasToBeAuthorized | protected function hasToBeAuthorized()
{
if ( in_array($this->route->getName(), self::$except) ) return false;
return (bool) $this->route->getName();
} | php | protected function hasToBeAuthorized()
{
if ( in_array($this->route->getName(), self::$except) ) return false;
return (bool) $this->route->getName();
} | [
"protected",
"function",
"hasToBeAuthorized",
"(",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"this",
"->",
"route",
"->",
"getName",
"(",
")",
",",
"self",
"::",
"$",
"except",
")",
")",
"return",
"false",
";",
"return",
"(",
"bool",
")",
"$",
"this... | Determines if routes has to be authorized.
@return bool | [
"Determines",
"if",
"routes",
"has",
"to",
"be",
"authorized",
"."
] | b3d69199405ca7406b33991884f6bb2e6f85f4e5 | https://github.com/adrianyg7/Acl/blob/b3d69199405ca7406b33991884f6bb2e6f85f4e5/src/Policies/AclPolicy.php#L126-L131 |
11,317 | jmpantoja/planb-utils | src/DS/Stack/Stack.php | Stack.typed | public static function typed(string $type, iterable $input = []): Stack
{
$resolver = Resolver::typed($type);
return new static($input, $resolver);
} | php | public static function typed(string $type, iterable $input = []): Stack
{
$resolver = Resolver::typed($type);
return new static($input, $resolver);
} | [
"public",
"static",
"function",
"typed",
"(",
"string",
"$",
"type",
",",
"iterable",
"$",
"input",
"=",
"[",
"]",
")",
":",
"Stack",
"{",
"$",
"resolver",
"=",
"Resolver",
"::",
"typed",
"(",
"$",
"type",
")",
";",
"return",
"new",
"static",
"(",
... | Stack named constructor.
@param string $type
@param mixed[] $input
@return \PlanB\DS\Stack\Stack | [
"Stack",
"named",
"constructor",
"."
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/DS/Stack/Stack.php#L53-L58 |
11,318 | nachonerd/silex-markdown-provider | src/Extensions/Markdown.php | Markdown.parseFile | public function parseFile($fileToParse)
{
$filename = $this->mdPath.$fileToParse;
if (file_exists($filename)) {
return $this->parse(file_get_contents($filename));
}
throw new \NachoNerd\Silex\Markdown\Exceptions\FileNotFound(
sprintf("File %s Not Found", $fil... | php | public function parseFile($fileToParse)
{
$filename = $this->mdPath.$fileToParse;
if (file_exists($filename)) {
return $this->parse(file_get_contents($filename));
}
throw new \NachoNerd\Silex\Markdown\Exceptions\FileNotFound(
sprintf("File %s Not Found", $fil... | [
"public",
"function",
"parseFile",
"(",
"$",
"fileToParse",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"mdPath",
".",
"$",
"fileToParse",
";",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"return",
"$",
"this",
"->",
"parse",
... | Parses the given file
@param string $fileToParse File Name To Parse
@return string
@throws \NachoNerd\Silex\Markdown\Exceptions\FileNotFound | [
"Parses",
"the",
"given",
"file"
] | a2e4528aecfb683766463f6e3e25b27b336c0952 | https://github.com/nachonerd/silex-markdown-provider/blob/a2e4528aecfb683766463f6e3e25b27b336c0952/src/Extensions/Markdown.php#L138-L149 |
11,319 | nachonerd/silex-markdown-provider | src/Extensions/Markdown.php | Markdown.getAllFiles | public function getAllFiles()
{
$finder = new Finder();
return $finder->files()->name($this->filter)->in($this->mdPath);
} | php | public function getAllFiles()
{
$finder = new Finder();
return $finder->files()->name($this->filter)->in($this->mdPath);
} | [
"public",
"function",
"getAllFiles",
"(",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"return",
"$",
"finder",
"->",
"files",
"(",
")",
"->",
"name",
"(",
"$",
"this",
"->",
"filter",
")",
"->",
"in",
"(",
"$",
"this",
"->",
"md... | Give All Files in directory given using filer given
@return Symfony\Component\Finder\Finder | [
"Give",
"All",
"Files",
"in",
"directory",
"given",
"using",
"filer",
"given"
] | a2e4528aecfb683766463f6e3e25b27b336c0952 | https://github.com/nachonerd/silex-markdown-provider/blob/a2e4528aecfb683766463f6e3e25b27b336c0952/src/Extensions/Markdown.php#L156-L160 |
11,320 | nachonerd/silex-markdown-provider | src/Extensions/Markdown.php | Markdown.getNLastFiles | public function getNLastFiles($n)
{
$finder = new Finder();
$finder->files()->name(
$this->filter
)->in(
$this->mdPath
)->sortByModifiedTimeDesc();
return $finder->getNFirst($n);
} | php | public function getNLastFiles($n)
{
$finder = new Finder();
$finder->files()->name(
$this->filter
)->in(
$this->mdPath
)->sortByModifiedTimeDesc();
return $finder->getNFirst($n);
} | [
"public",
"function",
"getNLastFiles",
"(",
"$",
"n",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
"->",
"files",
"(",
")",
"->",
"name",
"(",
"$",
"this",
"->",
"filter",
")",
"->",
"in",
"(",
"$",
"this",
"->",
... | Give N Last Files in directory given using filer given
@param integer $n Umpteenth Number
@return Symfony\Component\Finder\Finder | [
"Give",
"N",
"Last",
"Files",
"in",
"directory",
"given",
"using",
"filer",
"given"
] | a2e4528aecfb683766463f6e3e25b27b336c0952 | https://github.com/nachonerd/silex-markdown-provider/blob/a2e4528aecfb683766463f6e3e25b27b336c0952/src/Extensions/Markdown.php#L169-L178 |
11,321 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php | AdminWarehouseController.transactionsAction | public function transactionsAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$changeLogFilter = $this->createForm(StockChangeLogFilterType::class, null, array(
'action' => $this->generateUrl('admin_warehouse_transactions'),
'method' => 'GET',
));
... | php | public function transactionsAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$changeLogFilter = $this->createForm(StockChangeLogFilterType::class, null, array(
'action' => $this->generateUrl('admin_warehouse_transactions'),
'method' => 'GET',
));
... | [
"public",
"function",
"transactionsAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"changeLogFilter",
"=",
"$",
"this",
"->",
"createForm",
"(",
"Stock... | Lists all Warehouse entities.
@Route("/transactions", name="admin_warehouse_transactions")
@Method("GET")
@Template() | [
"Lists",
"all",
"Warehouse",
"entities",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php#L50-L73 |
11,322 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php | AdminWarehouseController.showAction | public function showAction(Warehouse $warehouse)
{
$editForm = $this->createForm(WarehouseType::class, $warehouse, array(
'action' => $this->generateUrl('admin_warehouse_update', array('id' => $warehouse->getid())),
'method' => 'PUT',
));
$deleteForm = $this->createDe... | php | public function showAction(Warehouse $warehouse)
{
$editForm = $this->createForm(WarehouseType::class, $warehouse, array(
'action' => $this->generateUrl('admin_warehouse_update', array('id' => $warehouse->getid())),
'method' => 'PUT',
));
$deleteForm = $this->createDe... | [
"public",
"function",
"showAction",
"(",
"Warehouse",
"$",
"warehouse",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"WarehouseType",
"::",
"class",
",",
"$",
"warehouse",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"... | Finds and displays a Warehouse entity.
@Route("/{id}/show", name="admin_warehouse_show", requirements={"id"="\d+"})
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"Warehouse",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php#L82-L97 |
11,323 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php | AdminWarehouseController.newAction | public function newAction()
{
$warehouse = new Warehouse();
$form = $this->createForm(WarehouseType::class, $warehouse);
return array(
'warehouse' => $warehouse,
'form' => $form->createView(),
);
} | php | public function newAction()
{
$warehouse = new Warehouse();
$form = $this->createForm(WarehouseType::class, $warehouse);
return array(
'warehouse' => $warehouse,
'form' => $form->createView(),
);
} | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"warehouse",
"=",
"new",
"Warehouse",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"WarehouseType",
"::",
"class",
",",
"$",
"warehouse",
")",
";",
"return",
"array",
"(",... | Displays a form to create a new Warehouse entity.
@Route("/new", name="admin_warehouse_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Warehouse",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php#L106-L115 |
11,324 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php | AdminWarehouseController.createAction | public function createAction(Request $request)
{
$warehouse = new Warehouse();
$form = $this->createForm(WarehouseType::class, $warehouse);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($warehouse);
... | php | public function createAction(Request $request)
{
$warehouse = new Warehouse();
$form = $this->createForm(WarehouseType::class, $warehouse);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($warehouse);
... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"warehouse",
"=",
"new",
"Warehouse",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"WarehouseType",
"::",
"class",
",",
"$",
"warehouse",
")",
... | Creates a new Warehouse entity.
@Route("/create", name="admin_warehouse_create")
@Method("POST")
@Template("FlowcodeShopBundle:AdminWarehouse:new.html.twig") | [
"Creates",
"a",
"new",
"Warehouse",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php#L124-L140 |
11,325 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php | AdminWarehouseController.updateAction | public function updateAction(Warehouse $warehouse, Request $request)
{
$editForm = $this->createForm(new WarehouseType(), $warehouse, array(
'action' => $this->generateUrl('admin_warehouse_update', array('id' => $warehouse->getid())),
'method' => 'PUT',
));
if ($editF... | php | public function updateAction(Warehouse $warehouse, Request $request)
{
$editForm = $this->createForm(new WarehouseType(), $warehouse, array(
'action' => $this->generateUrl('admin_warehouse_update', array('id' => $warehouse->getid())),
'method' => 'PUT',
));
if ($editF... | [
"public",
"function",
"updateAction",
"(",
"Warehouse",
"$",
"warehouse",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"WarehouseType",
"(",
")",
",",
"$",
"warehouse",
",",
"array",
"(",
"'... | Edits an existing Warehouse entity.
@Route("/{id}/update", name="admin_warehouse_update", requirements={"id"="\d+"})
@Method("PUT")
@Template("FlowcodeShopBundle:AdminWarehouse:edit.html.twig") | [
"Edits",
"an",
"existing",
"Warehouse",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/AdminWarehouseController.php#L171-L189 |
11,326 | ArcanSecurity/skeerel-php | Skeerel/Util/Enum.php | Enum.equals | final public function equals(Enum $enum = null)
{
return $enum !== null && $this->getValue() === $enum->getValue() && \get_called_class() === \get_class($enum);
} | php | final public function equals(Enum $enum = null)
{
return $enum !== null && $this->getValue() === $enum->getValue() && \get_called_class() === \get_class($enum);
} | [
"final",
"public",
"function",
"equals",
"(",
"Enum",
"$",
"enum",
"=",
"null",
")",
"{",
"return",
"$",
"enum",
"!==",
"null",
"&&",
"$",
"this",
"->",
"getValue",
"(",
")",
"===",
"$",
"enum",
"->",
"getValue",
"(",
")",
"&&",
"\\",
"get_called_cla... | Compares one Enum with another.
This method is final, for more information read https://github.com/myclabs/php-enum/issues/4
@return bool True if Enums are equal, false if not equal | [
"Compares",
"one",
"Enum",
"with",
"another",
"."
] | 67718734f31599e80e3cac1c4dec54f3836bb652 | https://github.com/ArcanSecurity/skeerel-php/blob/67718734f31599e80e3cac1c4dec54f3836bb652/Skeerel/Util/Enum.php#L81-L84 |
11,327 | ArcanSecurity/skeerel-php | Skeerel/Util/Enum.php | Enum.fromKey | public static function fromKey($name)
{
foreach (static::values() as $key => $enumInstance) {
if ($enumInstance->getKey() === $name) {
return $enumInstance;
}
}
return null;
} | php | public static function fromKey($name)
{
foreach (static::values() as $key => $enumInstance) {
if ($enumInstance->getKey() === $name) {
return $enumInstance;
}
}
return null;
} | [
"public",
"static",
"function",
"fromKey",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"static",
"::",
"values",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"enumInstance",
")",
"{",
"if",
"(",
"$",
"enumInstance",
"->",
"getKey",
"(",
")",
"===",
"$",
... | Returns Enum by key
@return static | [
"Returns",
"Enum",
"by",
"key"
] | 67718734f31599e80e3cac1c4dec54f3836bb652 | https://github.com/ArcanSecurity/skeerel-php/blob/67718734f31599e80e3cac1c4dec54f3836bb652/Skeerel/Util/Enum.php#L246-L255 |
11,328 | JoshuaEstes/Daedalus | src/Daedalus/Configuration/TaskConfiguration.php | TaskConfiguration.addTasksNode | protected function addTasksNode()
{
$builder = new TreeBuilder();
$node = $builder->root('tasks');
$node
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('task')
->prototype('array')
->children()
... | php | protected function addTasksNode()
{
$builder = new TreeBuilder();
$node = $builder->root('tasks');
$node
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('task')
->prototype('array')
->children()
... | [
"protected",
"function",
"addTasksNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'tasks'",
")",
";",
"$",
"node",
"->",
"isRequired",
"(",
")",
"->",
"requiresAtLeas... | Returns the tasks node | [
"Returns",
"the",
"tasks",
"node"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Configuration/TaskConfiguration.php#L30-L51 |
11,329 | JoshuaEstes/Daedalus | src/Daedalus/Configuration/TaskConfiguration.php | TaskConfiguration.addArgumentsNode | protected function addArgumentsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('arguments');
$node
->prototype('variable')
->end();
return $node;
} | php | protected function addArgumentsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('arguments');
$node
->prototype('variable')
->end();
return $node;
} | [
"protected",
"function",
"addArgumentsNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'arguments'",
")",
";",
"$",
"node",
"->",
"prototype",
"(",
"'variable'",
")",
... | Arguments that are passed to a command | [
"Arguments",
"that",
"are",
"passed",
"to",
"a",
"command"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Configuration/TaskConfiguration.php#L79-L89 |
11,330 | JoshuaEstes/Daedalus | src/Daedalus/Configuration/TaskConfiguration.php | TaskConfiguration.addOptionsNode | protected function addOptionsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('options');
$node
->prototype('variable')
->end();
return $node;
} | php | protected function addOptionsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('options');
$node
->prototype('variable')
->end();
return $node;
} | [
"protected",
"function",
"addOptionsNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'options'",
")",
";",
"$",
"node",
"->",
"prototype",
"(",
"'variable'",
")",
"->"... | Options that are passed to a command | [
"Options",
"that",
"are",
"passed",
"to",
"a",
"command"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Configuration/TaskConfiguration.php#L94-L104 |
11,331 | Sowapps/orpheus-publisher | src/Publisher/Transaction/TransactionOperationSet.php | TransactionOperationSet.validateOperations | protected function validateOperations() {
$errors = 0;
foreach( $this->operations as $operation ) {
$operation->setTransactionOperationSet($this);
$operation->validate($errors);
}
} | php | protected function validateOperations() {
$errors = 0;
foreach( $this->operations as $operation ) {
$operation->setTransactionOperationSet($this);
$operation->validate($errors);
}
} | [
"protected",
"function",
"validateOperations",
"(",
")",
"{",
"$",
"errors",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"operations",
"as",
"$",
"operation",
")",
"{",
"$",
"operation",
"->",
"setTransactionOperationSet",
"(",
"$",
"this",
")",
";",... | Validate operations, before applying | [
"Validate",
"operations",
"before",
"applying"
] | e33508538a0aa6f7491d724ca1cb09893203bfba | https://github.com/Sowapps/orpheus-publisher/blob/e33508538a0aa6f7491d724ca1cb09893203bfba/src/Publisher/Transaction/TransactionOperationSet.php#L78-L84 |
11,332 | Sowapps/orpheus-publisher | src/Publisher/Transaction/TransactionOperationSet.php | TransactionOperationSet.runOperations | protected function runOperations() {
foreach( $this->operations as $operation ) {
$operation->setTransactionOperationSet($this);
$operation->runIfValid();
}
} | php | protected function runOperations() {
foreach( $this->operations as $operation ) {
$operation->setTransactionOperationSet($this);
$operation->runIfValid();
}
} | [
"protected",
"function",
"runOperations",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"operations",
"as",
"$",
"operation",
")",
"{",
"$",
"operation",
"->",
"setTransactionOperationSet",
"(",
"$",
"this",
")",
";",
"$",
"operation",
"->",
"runIfValid"... | Run operation, these will be applied into DBMS | [
"Run",
"operation",
"these",
"will",
"be",
"applied",
"into",
"DBMS"
] | e33508538a0aa6f7491d724ca1cb09893203bfba | https://github.com/Sowapps/orpheus-publisher/blob/e33508538a0aa6f7491d724ca1cb09893203bfba/src/Publisher/Transaction/TransactionOperationSet.php#L89-L94 |
11,333 | emaphp/eMapper | lib/eMapper/Result/Mapper/ArrayMapper.php | ArrayMapper.mapResult | public function mapResult(ResultIterator $result, $resultType = ArrayType::BOTH) {
//check numer of rows returned
if ($result->countRows() == 0)
return null;
//get result column types
$this->columnTypes = $result->getColumnTypes($resultType);
//validate result map (if any)
if (isset($this->resultMap)... | php | public function mapResult(ResultIterator $result, $resultType = ArrayType::BOTH) {
//check numer of rows returned
if ($result->countRows() == 0)
return null;
//get result column types
$this->columnTypes = $result->getColumnTypes($resultType);
//validate result map (if any)
if (isset($this->resultMap)... | [
"public",
"function",
"mapResult",
"(",
"ResultIterator",
"$",
"result",
",",
"$",
"resultType",
"=",
"ArrayType",
"::",
"BOTH",
")",
"{",
"//check numer of rows returned",
"if",
"(",
"$",
"result",
"->",
"countRows",
"(",
")",
"==",
"0",
")",
"return",
"nul... | Returns a mapped array from a mysqli_result object
@param \eMapper\Engine\Generic\Result\ResultIterator $result
@param int $resultType | [
"Returns",
"a",
"mapped",
"array",
"from",
"a",
"mysqli_result",
"object"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Result/Mapper/ArrayMapper.php#L42-L56 |
11,334 | DripsPHP/Debugger | src/Handler.php | Handler.handleError | public static function handleError($errno, $errstr, $errfile, $errline, $errcontext, $isException = false)
{
$error = array(
'number' => $errno,
'desc' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext,
'isExc... | php | public static function handleError($errno, $errstr, $errfile, $errline, $errcontext, $isException = false)
{
$error = array(
'number' => $errno,
'desc' => $errstr,
'file' => $errfile,
'line' => $errline,
'context' => $errcontext,
'isExc... | [
"public",
"static",
"function",
"handleError",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
",",
"$",
"errcontext",
",",
"$",
"isException",
"=",
"false",
")",
"{",
"$",
"error",
"=",
"array",
"(",
"'number'",
"=>",
... | Dient zum Handeln von PHP-Fehlern
@param int $errno
@param string $errstr
@param string $errfile
@param int $errline
@param mixed $errcontext
@param bool $isException | [
"Dient",
"zum",
"Handeln",
"von",
"PHP",
"-",
"Fehlern"
] | 750c133ef62861007b63c7fe07f6b32c53c6e96c | https://github.com/DripsPHP/Debugger/blob/750c133ef62861007b63c7fe07f6b32c53c6e96c/src/Handler.php#L40-L57 |
11,335 | DripsPHP/Debugger | src/Handler.php | Handler.handleException | public static function handleException($exception)
{
static::handleError($exception->getCode(), $exception->getMessage(), $exception->getFile(), $exception->getLine(), $exception, true);
} | php | public static function handleException($exception)
{
static::handleError($exception->getCode(), $exception->getMessage(), $exception->getFile(), $exception->getLine(), $exception, true);
} | [
"public",
"static",
"function",
"handleException",
"(",
"$",
"exception",
")",
"{",
"static",
"::",
"handleError",
"(",
"$",
"exception",
"->",
"getCode",
"(",
")",
",",
"$",
"exception",
"->",
"getMessage",
"(",
")",
",",
"$",
"exception",
"->",
"getFile"... | Dient zum Handeln von Exceptions
@param Exception $exception | [
"Dient",
"zum",
"Handeln",
"von",
"Exceptions"
] | 750c133ef62861007b63c7fe07f6b32c53c6e96c | https://github.com/DripsPHP/Debugger/blob/750c133ef62861007b63c7fe07f6b32c53c6e96c/src/Handler.php#L64-L67 |
11,336 | popy-dev/popy-calendar | src/Formatter/SymbolFormatter/Chain.php | Chain.addFormatter | public function addFormatter(SymbolFormatterInterface $formatter)
{
if ($formatter instanceof self) {
// Reducing recursivity
$this->addFormatters($formatter->formatters);
} else {
$this->formatters[] = $formatter;
}
return $this;
} | php | public function addFormatter(SymbolFormatterInterface $formatter)
{
if ($formatter instanceof self) {
// Reducing recursivity
$this->addFormatters($formatter->formatters);
} else {
$this->formatters[] = $formatter;
}
return $this;
} | [
"public",
"function",
"addFormatter",
"(",
"SymbolFormatterInterface",
"$",
"formatter",
")",
"{",
"if",
"(",
"$",
"formatter",
"instanceof",
"self",
")",
"{",
"// Reducing recursivity",
"$",
"this",
"->",
"addFormatters",
"(",
"$",
"formatter",
"->",
"formatters"... | Adds a formatter to the chain.
@param SymbolFormatterInterface $formatter | [
"Adds",
"a",
"formatter",
"to",
"the",
"chain",
"."
] | 989048be18451c813cfce926229c6aaddd1b0639 | https://github.com/popy-dev/popy-calendar/blob/989048be18451c813cfce926229c6aaddd1b0639/src/Formatter/SymbolFormatter/Chain.php#L38-L48 |
11,337 | osflab/view | Helper/Addon/MvcUrl.php | MvcUrl.setMvcUrl | public function setMvcUrl($controller = null, $action = null, array $params = [])
{
$this->mvcUrl = [
'controller' => trim($controller),
'action' => trim($action),
'params' => $params
];
return $this;
} | php | public function setMvcUrl($controller = null, $action = null, array $params = [])
{
$this->mvcUrl = [
'controller' => trim($controller),
'action' => trim($action),
'params' => $params
];
return $this;
} | [
"public",
"function",
"setMvcUrl",
"(",
"$",
"controller",
"=",
"null",
",",
"$",
"action",
"=",
"null",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"mvcUrl",
"=",
"[",
"'controller'",
"=>",
"trim",
"(",
"$",
"controller"... | Define the MVC parameters of the url
@param string $controller
@param string $action
@param array $params
@return $this | [
"Define",
"the",
"MVC",
"parameters",
"of",
"the",
"url"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Addon/MvcUrl.php#L38-L46 |
11,338 | osflab/view | Helper/Addon/MvcUrl.php | MvcUrl.setMvcParam | public function setMvcParam(string $paramName, $value = null)
{
$value = $value === null ? null : trim($value);
switch ($paramName) {
case 'controller' :
case 'action' :
$this->mvcUrl[$paramName] = $value;
break;
default :
... | php | public function setMvcParam(string $paramName, $value = null)
{
$value = $value === null ? null : trim($value);
switch ($paramName) {
case 'controller' :
case 'action' :
$this->mvcUrl[$paramName] = $value;
break;
default :
... | [
"public",
"function",
"setMvcParam",
"(",
"string",
"$",
"paramName",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"value",
"===",
"null",
"?",
"null",
":",
"trim",
"(",
"$",
"value",
")",
";",
"switch",
"(",
"$",
"paramName",
... | Define a MVC parameter individually
@param string $paramName
@param string $value
@return $this | [
"Define",
"a",
"MVC",
"parameter",
"individually"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Addon/MvcUrl.php#L54-L67 |
11,339 | jivoo/http | src/Router.php | Router.addScheme | public function addScheme(Route\Scheme $scheme)
{
foreach ($scheme->getPrefixes() as $prefix) {
$this->schemePrefixes[$prefix] = $scheme;
}
foreach ($scheme->getKeys() as $key) {
$this->schemeKeys[$key] = $scheme;
}
} | php | public function addScheme(Route\Scheme $scheme)
{
foreach ($scheme->getPrefixes() as $prefix) {
$this->schemePrefixes[$prefix] = $scheme;
}
foreach ($scheme->getKeys() as $key) {
$this->schemeKeys[$key] = $scheme;
}
} | [
"public",
"function",
"addScheme",
"(",
"Route",
"\\",
"Scheme",
"$",
"scheme",
")",
"{",
"foreach",
"(",
"$",
"scheme",
"->",
"getPrefixes",
"(",
")",
"as",
"$",
"prefix",
")",
"{",
"$",
"this",
"->",
"schemePrefixes",
"[",
"$",
"prefix",
"]",
"=",
... | Add a route scheme.
@param \Jivoo\Http\Route\Scheme $scheme Scheme. | [
"Add",
"a",
"route",
"scheme",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L84-L92 |
11,340 | jivoo/http | src/Router.php | Router.addPath | public function addPath($route, array $pattern, $arity, $priority = 5)
{
$route = $this->validate($route);
$key = $route->__toString() . '[' . $arity . ']';
if (isset($this->paths[$key])) {
if ($priority < $this->paths[$key]['priority']) {
return;
}
... | php | public function addPath($route, array $pattern, $arity, $priority = 5)
{
$route = $this->validate($route);
$key = $route->__toString() . '[' . $arity . ']';
if (isset($this->paths[$key])) {
if ($priority < $this->paths[$key]['priority']) {
return;
}
... | [
"public",
"function",
"addPath",
"(",
"$",
"route",
",",
"array",
"$",
"pattern",
",",
"$",
"arity",
",",
"$",
"priority",
"=",
"5",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"validate",
"(",
"$",
"route",
")",
";",
"$",
"key",
"=",
"$",
... | Add a path for a route.
@param string|array|Route|HasRoute $route A route.
@param string[] $pattern Path pattern.
@param int|string $arity Pattern arity, i.e. number of variables. '*'
for variadic.
@param int $priority Path priority. | [
"Add",
"a",
"path",
"for",
"a",
"route",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L329-L342 |
11,341 | jivoo/http | src/Router.php | Router.getPathValidated | public function getPathValidated(Route\Route $route)
{
$parameters = $route->getParameters();
if (count($parameters)) {
$arity = '[' . count($parameters) . ']';
} else {
$arity = '[0]';
}
$key = $route->withoutAttributes()->__toString();
$patte... | php | public function getPathValidated(Route\Route $route)
{
$parameters = $route->getParameters();
if (count($parameters)) {
$arity = '[' . count($parameters) . ']';
} else {
$arity = '[0]';
}
$key = $route->withoutAttributes()->__toString();
$patte... | [
"public",
"function",
"getPathValidated",
"(",
"Route",
"\\",
"Route",
"$",
"route",
")",
"{",
"$",
"parameters",
"=",
"$",
"route",
"->",
"getParameters",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"parameters",
")",
")",
"{",
"$",
"arity",
"=",
"... | Get path for a validated route.
@param \Jivoo\Http\Route\Route $route Validated route.
@return string[]|string Path array or absolute path string.
@throws Route\RouteException If the a path could not be found for
the route. | [
"Get",
"path",
"for",
"a",
"validated",
"route",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L352-L372 |
11,342 | jivoo/http | src/Router.php | Router.getUri | public function getUri($route, $full = false)
{
$route = $this->validate($route);
$path = $this->getPathValidated($route);
if (is_string($path)) {
return new Message\Uri($path);
}
if ($full) {
$uri = $this->request->getUri()->withPath($this->request->p... | php | public function getUri($route, $full = false)
{
$route = $this->validate($route);
$path = $this->getPathValidated($route);
if (is_string($path)) {
return new Message\Uri($path);
}
if ($full) {
$uri = $this->request->getUri()->withPath($this->request->p... | [
"public",
"function",
"getUri",
"(",
"$",
"route",
",",
"$",
"full",
"=",
"false",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"validate",
"(",
"$",
"route",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"getPathValidated",
"(",
"$",
"route",
... | Get URI for a route.
@param string|array|Route|HasRoute $route A route.
@return Message\Uri Uri. | [
"Get",
"URI",
"for",
"a",
"route",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L392-L407 |
11,343 | jivoo/http | src/Router.php | Router.applyPattern | public function applyPattern(array $pattern, array $path)
{
$length = count($pattern);
if ($length == 0 and count($path) > 0) {
return null;
}
if ($length < count($path) and $pattern[$length - 1] != '**'
and $pattern[$length - 1] != ':*') {
return ... | php | public function applyPattern(array $pattern, array $path)
{
$length = count($pattern);
if ($length == 0 and count($path) > 0) {
return null;
}
if ($length < count($path) and $pattern[$length - 1] != '**'
and $pattern[$length - 1] != ':*') {
return ... | [
"public",
"function",
"applyPattern",
"(",
"array",
"$",
"pattern",
",",
"array",
"$",
"path",
")",
"{",
"$",
"length",
"=",
"count",
"(",
"$",
"pattern",
")",
";",
"if",
"(",
"$",
"length",
"==",
"0",
"and",
"count",
"(",
"$",
"path",
")",
">",
... | Apply a path pattern to a path.
@param string[] $pattern Path pattern.
@param string[] $path Path.
@return string[]|null An array of path parameters or null if not a match. | [
"Apply",
"a",
"path",
"pattern",
"to",
"a",
"path",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L416-L456 |
11,344 | jivoo/http | src/Router.php | Router.findMatch | public function findMatch(array $path, $method)
{
usort($this->patterns, ['Jivoo\Utilities', 'prioritySorter']);
foreach ($this->patterns as $pattern) {
if ($pattern['method'] != 'ANY' and $pattern['method'] != $method) {
continue;
}
$parameters = ... | php | public function findMatch(array $path, $method)
{
usort($this->patterns, ['Jivoo\Utilities', 'prioritySorter']);
foreach ($this->patterns as $pattern) {
if ($pattern['method'] != 'ANY' and $pattern['method'] != $method) {
continue;
}
$parameters = ... | [
"public",
"function",
"findMatch",
"(",
"array",
"$",
"path",
",",
"$",
"method",
")",
"{",
"usort",
"(",
"$",
"this",
"->",
"patterns",
",",
"[",
"'Jivoo\\Utilities'",
",",
"'prioritySorter'",
"]",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"patterns"... | Find a route for a path.
@param string[] $path Path array.
@param string $method Request method.
@return Route|null A route or null if none found. | [
"Find",
"a",
"route",
"for",
"a",
"path",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L465-L478 |
11,345 | jivoo/http | src/Router.php | Router.redirectPath | public function redirectPath($path, array $query = [], $fragment = '', $permanent = false, $rewrite = false)
{
$location = new Message\Uri($this->request->pathToString($path, $rewrite));
$location = $location->withQuery($this->buildQuery($query))
->withFragment($fragment);
return... | php | public function redirectPath($path, array $query = [], $fragment = '', $permanent = false, $rewrite = false)
{
$location = new Message\Uri($this->request->pathToString($path, $rewrite));
$location = $location->withQuery($this->buildQuery($query))
->withFragment($fragment);
return... | [
"public",
"function",
"redirectPath",
"(",
"$",
"path",
",",
"array",
"$",
"query",
"=",
"[",
"]",
",",
"$",
"fragment",
"=",
"''",
",",
"$",
"permanent",
"=",
"false",
",",
"$",
"rewrite",
"=",
"false",
")",
"{",
"$",
"location",
"=",
"new",
"Mess... | Create a path redirect.
@param string|string[] $path Path array.
@param array $query Query.
@param string $fragment Fragment.
@param bool $permanent Whether redirect is permanent.
@param bool $rewrite Whether to force removal of script name from path.
@return ResponseInterface A redirect response. | [
"Create",
"a",
"path",
"redirect",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L522-L528 |
11,346 | jivoo/http | src/Router.php | Router.redirect | public function redirect($route, $permanent = false)
{
$route = $this->validate($route);
return $this->redirectPath($this->getPath($route), $route->getQuery(), $route->getFragment(), $permanent);
} | php | public function redirect($route, $permanent = false)
{
$route = $this->validate($route);
return $this->redirectPath($this->getPath($route), $route->getQuery(), $route->getFragment(), $permanent);
} | [
"public",
"function",
"redirect",
"(",
"$",
"route",
",",
"$",
"permanent",
"=",
"false",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"validate",
"(",
"$",
"route",
")",
";",
"return",
"$",
"this",
"->",
"redirectPath",
"(",
"$",
"this",
"->",
... | Create a route redirect.
@param string|array|Route|HasRoute $route A route.
@param bool $permanent Whether redirect is permanent.
@return ResponseInterface A redirect response. | [
"Create",
"a",
"route",
"redirect",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L537-L541 |
11,347 | jivoo/http | src/Router.php | Router.refresh | public function refresh($query = null, $fragment = '')
{
if (! isset($query)) {
$query = $this->request->query;
}
return $this->redirectPath($this->request->path, $query, $fragment);
} | php | public function refresh($query = null, $fragment = '')
{
if (! isset($query)) {
$query = $this->request->query;
}
return $this->redirectPath($this->request->path, $query, $fragment);
} | [
"public",
"function",
"refresh",
"(",
"$",
"query",
"=",
"null",
",",
"$",
"fragment",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"query",
")",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"request",
"->",
"query",
";",
"}",
"re... | Create a refresh response.
@param array $query Optional new query parameters.
@param string $fragment Optional fragment.
@return ResponseInterface A refresh response. | [
"Create",
"a",
"refresh",
"response",
"."
] | 3c1d8dba66978bc91fc2b324dd941e5da3b253bc | https://github.com/jivoo/http/blob/3c1d8dba66978bc91fc2b324dd941e5da3b253bc/src/Router.php#L560-L566 |
11,348 | Puzzlout/FrameworkMvcLegacy | src/Security/AuthenticationManager.php | AuthenticationManager.authenticate | public function authenticate(IUser $user) {
//set role
$this->app->user->setAttribute(SessionKeys::UserRole, $user->getRole());
//store user in session
$this->app->user->setAttribute(SessionKeys::UserConnected, $user);
} | php | public function authenticate(IUser $user) {
//set role
$this->app->user->setAttribute(SessionKeys::UserRole, $user->getRole());
//store user in session
$this->app->user->setAttribute(SessionKeys::UserConnected, $user);
} | [
"public",
"function",
"authenticate",
"(",
"IUser",
"$",
"user",
")",
"{",
"//set role",
"$",
"this",
"->",
"app",
"->",
"user",
"->",
"setAttribute",
"(",
"SessionKeys",
"::",
"UserRole",
",",
"$",
"user",
"->",
"getRole",
"(",
")",
")",
";",
"//store u... | Authenticates a user from the given object.
@param \Puzzlout\Framework\Interfaces\IUser $user
User object holding all the values necessary to connect the user. | [
"Authenticates",
"a",
"user",
"from",
"the",
"given",
"object",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Security/AuthenticationManager.php#L26-L31 |
11,349 | Puzzlout/FrameworkMvcLegacy | src/Security/AuthenticationManager.php | AuthenticationManager.HashUserPassword | public function HashUserPassword(\Puzzlout\Framework\BO\F_user $user) {
$user->setF_user_salt($user->F_user_password_is_hashed() ? $user->F_user_salt() : \Puzzlout\Framework\Utility\UUID::v4());
$user->setF_user_password($this->app->security()->HashValue($user->F_user_salt(), $user->F_user_password()));... | php | public function HashUserPassword(\Puzzlout\Framework\BO\F_user $user) {
$user->setF_user_salt($user->F_user_password_is_hashed() ? $user->F_user_salt() : \Puzzlout\Framework\Utility\UUID::v4());
$user->setF_user_password($this->app->security()->HashValue($user->F_user_salt(), $user->F_user_password()));... | [
"public",
"function",
"HashUserPassword",
"(",
"\\",
"Puzzlout",
"\\",
"Framework",
"\\",
"BO",
"\\",
"F_user",
"$",
"user",
")",
"{",
"$",
"user",
"->",
"setF_user_salt",
"(",
"$",
"user",
"->",
"F_user_password_is_hashed",
"(",
")",
"?",
"$",
"user",
"->... | Retrieve the hash of the user password.
@param \Puzzlout\Framework\BO\F_user $user
@return \Puzzlout\Framework\BO\F_user | [
"Retrieve",
"the",
"hash",
"of",
"the",
"user",
"password",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Security/AuthenticationManager.php#L47-L52 |
11,350 | thecodingmachine/utils.package-builder | src/Mouf/Utils/PackageBuilder/Export/ExportService.php | ExportService.getAllAnonymousInstancesList | public function getAllAnonymousInstancesList(SplObjectStorage $instances) {
$anonymousInstances = new SplObjectStorage();
foreach ($instances as $instance) {
$anonymousInstances->addAll($this->getAnonymousAttachedInstances($instance));
}
return $anonymousInstances;
} | php | public function getAllAnonymousInstancesList(SplObjectStorage $instances) {
$anonymousInstances = new SplObjectStorage();
foreach ($instances as $instance) {
$anonymousInstances->addAll($this->getAnonymousAttachedInstances($instance));
}
return $anonymousInstances;
} | [
"public",
"function",
"getAllAnonymousInstancesList",
"(",
"SplObjectStorage",
"$",
"instances",
")",
"{",
"$",
"anonymousInstances",
"=",
"new",
"SplObjectStorage",
"(",
")",
";",
"foreach",
"(",
"$",
"instances",
"as",
"$",
"instance",
")",
"{",
"$",
"anonymou... | This function will browse all instances passed in parameter and will return all anonymous instances
bound to those objects.
@param SplObjectStorage $instances An object storage of MoufInstanceDescriptor
@return \SplObjectStorage | [
"This",
"function",
"will",
"browse",
"all",
"instances",
"passed",
"in",
"parameter",
"and",
"will",
"return",
"all",
"anonymous",
"instances",
"bound",
"to",
"those",
"objects",
"."
] | 14a82a1a0e0fda503e6152d65900623cd73f6202 | https://github.com/thecodingmachine/utils.package-builder/blob/14a82a1a0e0fda503e6152d65900623cd73f6202/src/Mouf/Utils/PackageBuilder/Export/ExportService.php#L122-L131 |
11,351 | zerospam/sdk-framework | src/Client/OAuthClient.php | OAuthClient.registerMiddleware | public function registerMiddleware(IMiddleware $middleware): IOAuthClient
{
$middleware->setClient($this);
foreach ($middleware::statusCode() as $statusCode) {
$this->postRequestMiddlewares[$statusCode][] = $middleware;
}
return $this;
} | php | public function registerMiddleware(IMiddleware $middleware): IOAuthClient
{
$middleware->setClient($this);
foreach ($middleware::statusCode() as $statusCode) {
$this->postRequestMiddlewares[$statusCode][] = $middleware;
}
return $this;
} | [
"public",
"function",
"registerMiddleware",
"(",
"IMiddleware",
"$",
"middleware",
")",
":",
"IOAuthClient",
"{",
"$",
"middleware",
"->",
"setClient",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"middleware",
"::",
"statusCode",
"(",
")",
"as",
"$",
... | Register the given middleware.
@param \ZEROSPAM\Framework\SDK\Client\Middleware\IMiddleware $middleware
@return IOAuthClient | [
"Register",
"the",
"given",
"middleware",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Client/OAuthClient.php#L110-L118 |
11,352 | zerospam/sdk-framework | src/Client/OAuthClient.php | OAuthClient.registerPreRequestMiddleware | public function registerPreRequestMiddleware(IPreRequestMiddleware $middleware): IOAuthClient
{
$this->preRequestMiddlewares[get_class($middleware)] = $middleware;
return $this;
} | php | public function registerPreRequestMiddleware(IPreRequestMiddleware $middleware): IOAuthClient
{
$this->preRequestMiddlewares[get_class($middleware)] = $middleware;
return $this;
} | [
"public",
"function",
"registerPreRequestMiddleware",
"(",
"IPreRequestMiddleware",
"$",
"middleware",
")",
":",
"IOAuthClient",
"{",
"$",
"this",
"->",
"preRequestMiddlewares",
"[",
"get_class",
"(",
"$",
"middleware",
")",
"]",
"=",
"$",
"middleware",
";",
"retu... | Register a pre request middleware
@param IPreRequestMiddleware $middleware
@return IOAuthClient | [
"Register",
"a",
"pre",
"request",
"middleware"
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Client/OAuthClient.php#L127-L132 |
11,353 | zerospam/sdk-framework | src/Client/OAuthClient.php | OAuthClient.registerRefreshTokenMiddleware | public function registerRefreshTokenMiddleware(IRefreshTokenMiddleware $middleware): IOAuthClient
{
$middleware->setClient($this);
$this->refreshTokenMiddlewares[get_class($middleware)] = $middleware;
return $this;
} | php | public function registerRefreshTokenMiddleware(IRefreshTokenMiddleware $middleware): IOAuthClient
{
$middleware->setClient($this);
$this->refreshTokenMiddlewares[get_class($middleware)] = $middleware;
return $this;
} | [
"public",
"function",
"registerRefreshTokenMiddleware",
"(",
"IRefreshTokenMiddleware",
"$",
"middleware",
")",
":",
"IOAuthClient",
"{",
"$",
"middleware",
"->",
"setClient",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"refreshTokenMiddlewares",
"[",
"get_class"... | Register a middleware to take care of refresh token
@param IRefreshTokenMiddleware $middleware
@return IOAuthClient | [
"Register",
"a",
"middleware",
"to",
"take",
"care",
"of",
"refresh",
"token"
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Client/OAuthClient.php#L141-L147 |
11,354 | zerospam/sdk-framework | src/Client/OAuthClient.php | OAuthClient.unregisterMiddleware | public function unregisterMiddleware(IMiddleware $middleware): IOAuthClient
{
$middlewareClass = get_class($middleware);
foreach ($middleware::statusCode() as $statusCode) {
if (!isset($this->postRequestMiddlewares[$statusCode])) {
continue;
}
$res... | php | public function unregisterMiddleware(IMiddleware $middleware): IOAuthClient
{
$middlewareClass = get_class($middleware);
foreach ($middleware::statusCode() as $statusCode) {
if (!isset($this->postRequestMiddlewares[$statusCode])) {
continue;
}
$res... | [
"public",
"function",
"unregisterMiddleware",
"(",
"IMiddleware",
"$",
"middleware",
")",
":",
"IOAuthClient",
"{",
"$",
"middlewareClass",
"=",
"get_class",
"(",
"$",
"middleware",
")",
";",
"foreach",
"(",
"$",
"middleware",
"::",
"statusCode",
"(",
")",
"as... | Unregister the middleware.
In fact, all middleware having the same class
@param \ZEROSPAM\Framework\SDK\Client\Middleware\IMiddleware $middleware
@return IOAuthClient | [
"Unregister",
"the",
"middleware",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Client/OAuthClient.php#L158-L180 |
11,355 | zerospam/sdk-framework | src/Client/OAuthClient.php | OAuthClient.processThrottleData | private function processThrottleData(ResponseInterface $response)
{
if (empty($rateLimit = $response->getHeader('X-RateLimit-Limit'))) {
return;
}
if (empty($remaining = $response->getHeader('X-RateLimit-Remaining'))) {
return;
}
if (!empty($reset = ... | php | private function processThrottleData(ResponseInterface $response)
{
if (empty($rateLimit = $response->getHeader('X-RateLimit-Limit'))) {
return;
}
if (empty($remaining = $response->getHeader('X-RateLimit-Remaining'))) {
return;
}
if (!empty($reset = ... | [
"private",
"function",
"processThrottleData",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"rateLimit",
"=",
"$",
"response",
"->",
"getHeader",
"(",
"'X-RateLimit-Limit'",
")",
")",
")",
"{",
"return",
";",
"}",
"if",
... | Process the rate limit.
@param ResponseInterface $response | [
"Process",
"the",
"rate",
"limit",
"."
] | 6780b81584619cb177d5d5e14fd7e87a9d8e48fd | https://github.com/zerospam/sdk-framework/blob/6780b81584619cb177d5d5e14fd7e87a9d8e48fd/src/Client/OAuthClient.php#L342-L359 |
11,356 | BitWeb/stdlib | src/BitWeb/Stdlib/StringUtil.php | StringUtil.stringLinesLimiter | public static function stringLinesLimiter($string, $linesLimit, $removeEmptyLines = false, $stringLengthLimit = 189, $lineStringLengthLimit = 63)
{
$lines = explode(PHP_EOL, $string);
if ($removeEmptyLines) {
for ($i = 0; $i < count($lines); $i++) {
$element = trim(self::... | php | public static function stringLinesLimiter($string, $linesLimit, $removeEmptyLines = false, $stringLengthLimit = 189, $lineStringLengthLimit = 63)
{
$lines = explode(PHP_EOL, $string);
if ($removeEmptyLines) {
for ($i = 0; $i < count($lines); $i++) {
$element = trim(self::... | [
"public",
"static",
"function",
"stringLinesLimiter",
"(",
"$",
"string",
",",
"$",
"linesLimit",
",",
"$",
"removeEmptyLines",
"=",
"false",
",",
"$",
"stringLengthLimit",
"=",
"189",
",",
"$",
"lineStringLengthLimit",
"=",
"63",
")",
"{",
"$",
"lines",
"="... | Limits string to number of lines, adds "..." to the end
@param string $string
@param int $limit | [
"Limits",
"string",
"to",
"number",
"of",
"lines",
"adds",
"...",
"to",
"the",
"end"
] | e90ac0d25ebb50e6088f14911181cc2c74e9c176 | https://github.com/BitWeb/stdlib/blob/e90ac0d25ebb50e6088f14911181cc2c74e9c176/src/BitWeb/Stdlib/StringUtil.php#L148-L184 |
11,357 | PaymentSuite/PaymillBundle | Services/PaymillManager.php | PaymillManager.processPayment | public function processPayment(PaymillMethod $paymentMethod, $amount)
{
/// first check that amounts are the same
$paymentBridgeAmount = intval($this->paymentBridge->getAmount());
/**
* If both amounts are different, execute Exception
*/
if ($amount != $paymentBrid... | php | public function processPayment(PaymillMethod $paymentMethod, $amount)
{
/// first check that amounts are the same
$paymentBridgeAmount = intval($this->paymentBridge->getAmount());
/**
* If both amounts are different, execute Exception
*/
if ($amount != $paymentBrid... | [
"public",
"function",
"processPayment",
"(",
"PaymillMethod",
"$",
"paymentMethod",
",",
"$",
"amount",
")",
"{",
"/// first check that amounts are the same",
"$",
"paymentBridgeAmount",
"=",
"intval",
"(",
"$",
"this",
"->",
"paymentBridge",
"->",
"getAmount",
"(",
... | Tries to process a payment through Paymill
@param PaymillMethod $paymentMethod Payment method
@param integer $amount Amount
@return PaymillManager Self object
@throws PaymentAmountsNotMatchException
@throws PaymentOrderNotFoundException
@throws PaymentException | [
"Tries",
"to",
"process",
"a",
"payment",
"through",
"Paymill"
] | 78aa85daaab8cf08e4971b10d86abd429ac7f6cd | https://github.com/PaymentSuite/PaymillBundle/blob/78aa85daaab8cf08e4971b10d86abd429ac7f6cd/Services/PaymillManager.php#L83-L149 |
11,358 | PaymentSuite/PaymillBundle | Services/PaymillManager.php | PaymillManager.processTransaction | private function processTransaction(Transaction $transaction, PaymillMethod $paymentMethod)
{
/**
* Payment paid done
*
* Paid process has ended ( No matters result )
*/
$this->paymentEventDispatcher->notifyPaymentOrderDone($this->paymentBridge, $paymentMethod);
... | php | private function processTransaction(Transaction $transaction, PaymillMethod $paymentMethod)
{
/**
* Payment paid done
*
* Paid process has ended ( No matters result )
*/
$this->paymentEventDispatcher->notifyPaymentOrderDone($this->paymentBridge, $paymentMethod);
... | [
"private",
"function",
"processTransaction",
"(",
"Transaction",
"$",
"transaction",
",",
"PaymillMethod",
"$",
"paymentMethod",
")",
"{",
"/**\n * Payment paid done\n *\n * Paid process has ended ( No matters result )\n */",
"$",
"this",
"->",
"paym... | Given a paymillTransaction response, as an array, prform desired operations
@param Transaction $transaction Transaction
@param PaymillMethod $paymentMethod Payment method
@return PaymillManager Self object
@throws PaymentException | [
"Given",
"a",
"paymillTransaction",
"response",
"as",
"an",
"array",
"prform",
"desired",
"operations"
] | 78aa85daaab8cf08e4971b10d86abd429ac7f6cd | https://github.com/PaymentSuite/PaymillBundle/blob/78aa85daaab8cf08e4971b10d86abd429ac7f6cd/Services/PaymillManager.php#L161-L205 |
11,359 | antwebes/ChateaClientBundle | Manager/FactoryManager.php | FactoryManager.get | static public function get($apiManager, $name)
{
if(!array_key_exists($name,self::$managerMap)){
throw new \InvalidArgumentException('Error in Factory Manager. This manager ['.$name.']is not supported');
}
$className = self::$managerMap[$name];
return self::factory($apiManager, $c... | php | static public function get($apiManager, $name)
{
if(!array_key_exists($name,self::$managerMap)){
throw new \InvalidArgumentException('Error in Factory Manager. This manager ['.$name.']is not supported');
}
$className = self::$managerMap[$name];
return self::factory($apiManager, $c... | [
"static",
"public",
"function",
"get",
"(",
"$",
"apiManager",
",",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"managerMap",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | get or create manager | [
"get",
"or",
"create",
"manager"
] | a4deb5f966b6ddcf817068e859787e32d399acf6 | https://github.com/antwebes/ChateaClientBundle/blob/a4deb5f966b6ddcf817068e859787e32d399acf6/Manager/FactoryManager.php#L29-L36 |
11,360 | bearframework/emails-addon | classes/Emails/Email/Content.php | Content.add | public function add(string $content, string $mimeType = null, $encoding = null): void
{
$contentPart = $this->make();
$contentPart->content = $content;
if ($mimeType !== null) {
$contentPart->mimeType = $mimeType;
}
if ($encoding !== null) {
$contentPa... | php | public function add(string $content, string $mimeType = null, $encoding = null): void
{
$contentPart = $this->make();
$contentPart->content = $content;
if ($mimeType !== null) {
$contentPart->mimeType = $mimeType;
}
if ($encoding !== null) {
$contentPa... | [
"public",
"function",
"add",
"(",
"string",
"$",
"content",
",",
"string",
"$",
"mimeType",
"=",
"null",
",",
"$",
"encoding",
"=",
"null",
")",
":",
"void",
"{",
"$",
"contentPart",
"=",
"$",
"this",
"->",
"make",
"(",
")",
";",
"$",
"contentPart",
... | Add a content part.
@param string $content The value of content part.
@param string|null $mimeType The mime type of the content part.
@param string|null $encoding The encoding of the content part. | [
"Add",
"a",
"content",
"part",
"."
] | 43a68c47e2b1d231dc69a324249ff5f6827201ca | https://github.com/bearframework/emails-addon/blob/43a68c47e2b1d231dc69a324249ff5f6827201ca/classes/Emails/Email/Content.php#L35-L46 |
11,361 | kuria/phpunit-extras | src/Traits/ClockTrait.php | ClockTrait.atTime | static function atTime($now, callable $callback)
{
// store time if already overridden
if (Clock::isOverridden()) {
$previousOverride = Clock::microtime();
} else {
$previousOverride = null;
}
try {
// override time
Clock::over... | php | static function atTime($now, callable $callback)
{
// store time if already overridden
if (Clock::isOverridden()) {
$previousOverride = Clock::microtime();
} else {
$previousOverride = null;
}
try {
// override time
Clock::over... | [
"static",
"function",
"atTime",
"(",
"$",
"now",
",",
"callable",
"$",
"callback",
")",
"{",
"// store time if already overridden",
"if",
"(",
"Clock",
"::",
"isOverridden",
"(",
")",
")",
"{",
"$",
"previousOverride",
"=",
"Clock",
"::",
"microtime",
"(",
"... | Override current time for the duration of the callback
@param \DateTimeInterface|int|float $now
@param callable $callback callback to invoke
@return mixed return value of the callback | [
"Override",
"current",
"time",
"for",
"the",
"duration",
"of",
"the",
"callback"
] | fca02d4d6af28d98d312a0830d876293397ce611 | https://github.com/kuria/phpunit-extras/blob/fca02d4d6af28d98d312a0830d876293397ce611/src/Traits/ClockTrait.php#L23-L48 |
11,362 | Holdlang/annotationscanner | src/Helpers/ClassInformationFromFile.php | ClassInformationFromFile.getNamespace | public static function getNamespace($tokens)
{
$count = count($tokens);
$i = 0;
$namespace = '';
$namespace_ok = false;
while ($i < $count) {
$token = $tokens[$i];
if (is_array($token) && $token[0] === T_NAMESPACE) {
// Found namespace ... | php | public static function getNamespace($tokens)
{
$count = count($tokens);
$i = 0;
$namespace = '';
$namespace_ok = false;
while ($i < $count) {
$token = $tokens[$i];
if (is_array($token) && $token[0] === T_NAMESPACE) {
// Found namespace ... | [
"public",
"static",
"function",
"getNamespace",
"(",
"$",
"tokens",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"tokens",
")",
";",
"$",
"i",
"=",
"0",
";",
"$",
"namespace",
"=",
"''",
";",
"$",
"namespace_ok",
"=",
"false",
";",
"while",
"(",... | Look for the namespace declaration.
@param $tokens
@return null|string | [
"Look",
"for",
"the",
"namespace",
"declaration",
"."
] | 7420b8ae1ab4d8bf9e76a448ea3ea749d6a934c6 | https://github.com/Holdlang/annotationscanner/blob/7420b8ae1ab4d8bf9e76a448ea3ea749d6a934c6/src/Helpers/ClassInformationFromFile.php#L56-L83 |
11,363 | binsoul/net-http-message-message | src/ServerRequest.php | ServerRequest.withAttributes | public function withAttributes(array $attributes): self
{
$result = clone $this;
$result->attributes = new ParameterCollection($attributes);
return $result;
} | php | public function withAttributes(array $attributes): self
{
$result = clone $this;
$result->attributes = new ParameterCollection($attributes);
return $result;
} | [
"public",
"function",
"withAttributes",
"(",
"array",
"$",
"attributes",
")",
":",
"self",
"{",
"$",
"result",
"=",
"clone",
"$",
"this",
";",
"$",
"result",
"->",
"attributes",
"=",
"new",
"ParameterCollection",
"(",
"$",
"attributes",
")",
";",
"return",... | Returns a new instance with the specified attributes.
@param mixed $attributes attributes of the new instance
@return self | [
"Returns",
"a",
"new",
"instance",
"with",
"the",
"specified",
"attributes",
"."
] | b367ecdfda28570f849fc7e0723125a951d915a7 | https://github.com/binsoul/net-http-message-message/blob/b367ecdfda28570f849fc7e0723125a951d915a7/src/ServerRequest.php#L159-L165 |
11,364 | ilya-dev/exo | source/Exo/Filesystem.php | Filesystem.overwrite | public function overwrite($file, $content)
{
$written = file_put_contents($file, $content);
// If $content is not empty
// but nothing was written to $file
// throw an exception.
if ($content and ! $written)
{
throw new RuntimeException(
"... | php | public function overwrite($file, $content)
{
$written = file_put_contents($file, $content);
// If $content is not empty
// but nothing was written to $file
// throw an exception.
if ($content and ! $written)
{
throw new RuntimeException(
"... | [
"public",
"function",
"overwrite",
"(",
"$",
"file",
",",
"$",
"content",
")",
"{",
"$",
"written",
"=",
"file_put_contents",
"(",
"$",
"file",
",",
"$",
"content",
")",
";",
"// If $content is not empty",
"// but nothing was written to $file",
"// throw an exceptio... | Overwrite a file.
@throws RuntimeException
@param string $file
@param string $content
@return void | [
"Overwrite",
"a",
"file",
"."
] | 89960a0116513c3172f107041bc9b9fa80ba8e54 | https://github.com/ilya-dev/exo/blob/89960a0116513c3172f107041bc9b9fa80ba8e54/source/Exo/Filesystem.php#L34-L47 |
11,365 | konservs/brilliant.framework | libraries/MVC/BView.php | BView.breadcrumbs_add | public function breadcrumbs_add($url, $name, $active = true, $class = '', $children = array()) {
if (!isset($this->controller)) {
return false;
}
$this->controller->breadcrumbs[] = (object)array('url' => $url, 'name' => $name, 'active' => $active, 'class' => $class, 'children' => $children);
return true;
} | php | public function breadcrumbs_add($url, $name, $active = true, $class = '', $children = array()) {
if (!isset($this->controller)) {
return false;
}
$this->controller->breadcrumbs[] = (object)array('url' => $url, 'name' => $name, 'active' => $active, 'class' => $class, 'children' => $children);
return true;
} | [
"public",
"function",
"breadcrumbs_add",
"(",
"$",
"url",
",",
"$",
"name",
",",
"$",
"active",
"=",
"true",
",",
"$",
"class",
"=",
"''",
",",
"$",
"children",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
... | Add breadcrumbs element.
@param $url
@param $name
@param bool $active
@param string $class
@param array $children
@return bool | [
"Add",
"breadcrumbs",
"element",
"."
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BView.php#L255-L261 |
11,366 | konservs/brilliant.framework | libraries/MVC/BView.php | BView.breadcrumbs_add_userdashboard | public function breadcrumbs_add_userdashboard() {
$brouter = BRouter::getInstance();
return $this->breadcrumbs_add('//' . $brouter->generateurl('users', BLang::$langcode, array('view' => 'dashboard')), BLang::_('USERS_DASHBOARD_HEADING'), true);
} | php | public function breadcrumbs_add_userdashboard() {
$brouter = BRouter::getInstance();
return $this->breadcrumbs_add('//' . $brouter->generateurl('users', BLang::$langcode, array('view' => 'dashboard')), BLang::_('USERS_DASHBOARD_HEADING'), true);
} | [
"public",
"function",
"breadcrumbs_add_userdashboard",
"(",
")",
"{",
"$",
"brouter",
"=",
"BRouter",
"::",
"getInstance",
"(",
")",
";",
"return",
"$",
"this",
"->",
"breadcrumbs_add",
"(",
"'//'",
".",
"$",
"brouter",
"->",
"generateurl",
"(",
"'users'",
"... | Add breadcrumbs user dashboard | [
"Add",
"breadcrumbs",
"user",
"dashboard"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BView.php#L275-L278 |
11,367 | konservs/brilliant.framework | libraries/MVC/BView.php | BView.breadcrumbs_add_region | public function breadcrumbs_add_region($id) {
bimport('regions.general');
$bregions = BRegions::getInstance();
$regions = $bregions->regions_get_all();
$reg = $bregions->region_get($id);
if (empty($reg)) {
return false;
}
$brouter = BRouter::getInstance();
$url = '//' . $brouter->generateURL('regions... | php | public function breadcrumbs_add_region($id) {
bimport('regions.general');
$bregions = BRegions::getInstance();
$regions = $bregions->regions_get_all();
$reg = $bregions->region_get($id);
if (empty($reg)) {
return false;
}
$brouter = BRouter::getInstance();
$url = '//' . $brouter->generateURL('regions... | [
"public",
"function",
"breadcrumbs_add_region",
"(",
"$",
"id",
")",
"{",
"bimport",
"(",
"'regions.general'",
")",
";",
"$",
"bregions",
"=",
"BRegions",
"::",
"getInstance",
"(",
")",
";",
"$",
"regions",
"=",
"$",
"bregions",
"->",
"regions_get_all",
"(",... | Add region breadcrumbs element
@param $id
@return bool | [
"Add",
"region",
"breadcrumbs",
"element"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BView.php#L305-L321 |
11,368 | konservs/brilliant.framework | libraries/MVC/BView.php | BView.breadcrumbs_add_city | public function breadcrumbs_add_city($id) {
bimport('regions.general');
$bregions = BRegions::getInstance();
$city = $bregions->city_get($id);
if (empty($city)) {
return false;
}
$region = $city->getregion();
if (empty($region)) {
return false;
}
$subcities = $region->cities_get_all();
//
$b... | php | public function breadcrumbs_add_city($id) {
bimport('regions.general');
$bregions = BRegions::getInstance();
$city = $bregions->city_get($id);
if (empty($city)) {
return false;
}
$region = $city->getregion();
if (empty($region)) {
return false;
}
$subcities = $region->cities_get_all();
//
$b... | [
"public",
"function",
"breadcrumbs_add_city",
"(",
"$",
"id",
")",
"{",
"bimport",
"(",
"'regions.general'",
")",
";",
"$",
"bregions",
"=",
"BRegions",
"::",
"getInstance",
"(",
")",
";",
"$",
"city",
"=",
"$",
"bregions",
"->",
"city_get",
"(",
"$",
"i... | Add city breadcrumbs element
@param $id
@return bool | [
"Add",
"city",
"breadcrumbs",
"element"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BView.php#L407-L431 |
11,369 | konservs/brilliant.framework | libraries/MVC/BView.php | BView.templateLoad | public function templateLoad($subName = '', $absolute = false) {
$this->addPathes();
$suffix = BBrowserUseragent::getDeviceSuffix();
//
if ($absolute) {
$fNames = array($subName . $suffix . '.php', $subName . '.d.php');
} else {
if (!empty($subName)) {
$subName = '.' . $subName;
}
$fNames = ar... | php | public function templateLoad($subName = '', $absolute = false) {
$this->addPathes();
$suffix = BBrowserUseragent::getDeviceSuffix();
//
if ($absolute) {
$fNames = array($subName . $suffix . '.php', $subName . '.d.php');
} else {
if (!empty($subName)) {
$subName = '.' . $subName;
}
$fNames = ar... | [
"public",
"function",
"templateLoad",
"(",
"$",
"subName",
"=",
"''",
",",
"$",
"absolute",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"addPathes",
"(",
")",
";",
"$",
"suffix",
"=",
"BBrowserUseragent",
"::",
"getDeviceSuffix",
"(",
")",
";",
"//",
"i... | Rendering layout into string
@param string $subName sub name, if absolute or template name ('users.login') if not.
@param bool $absolute true means absolute name
@return string | [
"Rendering",
"layout",
"into",
"string"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BView.php#L524-L567 |
11,370 | Silvestra/Silvestra | src/Silvestra/Component/Sitemap/Render/XmlRender.php | XmlRender.renderSitemap | public function renderSitemap(array $entries)
{
$data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
$data .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
foreach ($entries as $entry) {
$data .= ' <url>' . PHP_EOL;
$data .= ' ... | php | public function renderSitemap(array $entries)
{
$data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
$data .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
foreach ($entries as $entry) {
$data .= ' <url>' . PHP_EOL;
$data .= ' ... | [
"public",
"function",
"renderSitemap",
"(",
"array",
"$",
"entries",
")",
"{",
"$",
"data",
"=",
"'<?xml version=\"1.0\" encoding=\"UTF-8\"?>'",
".",
"PHP_EOL",
";",
"$",
"data",
".=",
"'<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'",
".",
"PHP_EOL",
";"... | Render sitemap xml.
@param array|UrlEntryInterface[] $entries
@return string | [
"Render",
"sitemap",
"xml",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Sitemap/Render/XmlRender.php#L32-L54 |
11,371 | Silvestra/Silvestra | src/Silvestra/Component/Sitemap/Render/XmlRender.php | XmlRender.renderSitemapIndex | public function renderSitemapIndex(array $entries)
{
$data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
$data .= '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
foreach ($entries as $entry) {
$data .= ' <sitemap>' . PHP_EOL;
... | php | public function renderSitemapIndex(array $entries)
{
$data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
$data .= '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;
foreach ($entries as $entry) {
$data .= ' <sitemap>' . PHP_EOL;
... | [
"public",
"function",
"renderSitemapIndex",
"(",
"array",
"$",
"entries",
")",
"{",
"$",
"data",
"=",
"'<?xml version=\"1.0\" encoding=\"UTF-8\"?>'",
".",
"PHP_EOL",
";",
"$",
"data",
".=",
"'<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'",
".",
"PHP_... | Render sitemap index xml.
@param array|SitemapEntryInterface[] $entries
@return string | [
"Render",
"sitemap",
"index",
"xml",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Sitemap/Render/XmlRender.php#L63-L77 |
11,372 | mdzzohrabi/azera-annotation | Annotation.php | Annotation.readClass | public static function readClass( $class , $annotation = null ) {
$ref = $class instanceof ReflectionClass ? $class : new ReflectionClass( $class );
return $annotation ? static::reader()->getClassAnnotation( $ref , $annotation ) : static::reader()->getClassAnnotations( $ref );
} | php | public static function readClass( $class , $annotation = null ) {
$ref = $class instanceof ReflectionClass ? $class : new ReflectionClass( $class );
return $annotation ? static::reader()->getClassAnnotation( $ref , $annotation ) : static::reader()->getClassAnnotations( $ref );
} | [
"public",
"static",
"function",
"readClass",
"(",
"$",
"class",
",",
"$",
"annotation",
"=",
"null",
")",
"{",
"$",
"ref",
"=",
"$",
"class",
"instanceof",
"ReflectionClass",
"?",
"$",
"class",
":",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
... | Retreive class annotations
@param string $class Class
@param string $annotation Specified annotation name
@return mixed | [
"Retreive",
"class",
"annotations"
] | dbf8b66941ff76d69e22ffe61ec93c648cd0aea6 | https://github.com/mdzzohrabi/azera-annotation/blob/dbf8b66941ff76d69e22ffe61ec93c648cd0aea6/Annotation.php#L74-L80 |
11,373 | Vovan-VE/array-dumper | src/helpers/StringHelper.php | StringHelper.isUtf8String | public static function isUtf8String(string $string): bool
{
// Keep calm. Just `mb_check_encoding($string, 'UTF-8')` sucks
// PCRE `/u` is about 10 times faster.
// https://3v4l.org/XYQ2A
if (false !== \preg_match('/\\G/u', $string)) {
return true;
}
if (... | php | public static function isUtf8String(string $string): bool
{
// Keep calm. Just `mb_check_encoding($string, 'UTF-8')` sucks
// PCRE `/u` is about 10 times faster.
// https://3v4l.org/XYQ2A
if (false !== \preg_match('/\\G/u', $string)) {
return true;
}
if (... | [
"public",
"static",
"function",
"isUtf8String",
"(",
"string",
"$",
"string",
")",
":",
"bool",
"{",
"// Keep calm. Just `mb_check_encoding($string, 'UTF-8')` sucks",
"// PCRE `/u` is about 10 times faster.",
"// https://3v4l.org/XYQ2A",
"if",
"(",
"false",
"!==",
"\\",
"preg... | Checks if a string is valid UTF-8 string
@param string $string Input string to test
@return bool Whether the input string is valid UTF-8 data | [
"Checks",
"if",
"a",
"string",
"is",
"valid",
"UTF",
"-",
"8",
"string"
] | 63fe868a7539cdf020851dae7fe1248bd014a1ef | https://github.com/Vovan-VE/array-dumper/blob/63fe868a7539cdf020851dae7fe1248bd014a1ef/src/helpers/StringHelper.php#L15-L28 |
11,374 | Vovan-VE/array-dumper | src/helpers/StringHelper.php | StringHelper.dumpString | public static function dumpString(string $value): string
{
if ('' === $value) {
return "''";
}
// non UTF-8 string will encode "\xFF" and require <">
if (!self::isUtf8String($value)) {
return '"' . \preg_replace_callback(
// ------------------... | php | public static function dumpString(string $value): string
{
if ('' === $value) {
return "''";
}
// non UTF-8 string will encode "\xFF" and require <">
if (!self::isUtf8String($value)) {
return '"' . \preg_replace_callback(
// ------------------... | [
"public",
"static",
"function",
"dumpString",
"(",
"string",
"$",
"value",
")",
":",
"string",
"{",
"if",
"(",
"''",
"===",
"$",
"value",
")",
"{",
"return",
"\"''\"",
";",
"}",
"// non UTF-8 string will encode \"\\xFF\" and require <\">",
"if",
"(",
"!",
"sel... | Dump string to PHP string literal
@param string $value Input string
@return string PHP code of string literal. Doing `eval()` of this
code will return a string identical `===` to input string. | [
"Dump",
"string",
"to",
"PHP",
"string",
"literal"
] | 63fe868a7539cdf020851dae7fe1248bd014a1ef | https://github.com/Vovan-VE/array-dumper/blob/63fe868a7539cdf020851dae7fe1248bd014a1ef/src/helpers/StringHelper.php#L46-L104 |
11,375 | Vovan-VE/array-dumper | src/helpers/StringHelper.php | StringHelper._escapeStringCallback | private static function _escapeStringCallback(array $match): string
{
if (isset($match[2])) {
return self::ESCAPE_SPECIALS[$match[2]]
?? \sprintf('\\x%02X', \ord($match[2]));
}
return '\\' . $match[1];
} | php | private static function _escapeStringCallback(array $match): string
{
if (isset($match[2])) {
return self::ESCAPE_SPECIALS[$match[2]]
?? \sprintf('\\x%02X', \ord($match[2]));
}
return '\\' . $match[1];
} | [
"private",
"static",
"function",
"_escapeStringCallback",
"(",
"array",
"$",
"match",
")",
":",
"string",
"{",
"if",
"(",
"isset",
"(",
"$",
"match",
"[",
"2",
"]",
")",
")",
"{",
"return",
"self",
"::",
"ESCAPE_SPECIALS",
"[",
"$",
"match",
"[",
"2",
... | Internal callback to escape characters
@param array $match A match from `preg_replace_callback()`
@return string | [
"Internal",
"callback",
"to",
"escape",
"characters"
] | 63fe868a7539cdf020851dae7fe1248bd014a1ef | https://github.com/Vovan-VE/array-dumper/blob/63fe868a7539cdf020851dae7fe1248bd014a1ef/src/helpers/StringHelper.php#L118-L125 |
11,376 | fabsgc/framework | Core/Collection/Collection.php | Collection.delete | public function delete($key) {
unset($this->_datas[$key]);
$this->_datas = array_values($this->_datas);
} | php | public function delete($key) {
unset($this->_datas[$key]);
$this->_datas = array_values($this->_datas);
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"_datas",
"[",
"$",
"key",
"]",
")",
";",
"$",
"this",
"->",
"_datas",
"=",
"array_values",
"(",
"$",
"this",
"->",
"_datas",
")",
";",
"}"
] | Delete one element from the collection
@access public
@param $key mixed
@return void
@since 3.0
@package Gcs\Framework\Core\Collecion | [
"Delete",
"one",
"element",
"from",
"the",
"collection"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Collection/Collection.php#L100-L103 |
11,377 | fabsgc/framework | Core/Collection/Collection.php | Collection.deleteRange | public function deleteRange($key, $length) {
$badKeys = [];
for ($i = $key; $i < $key + $length; $i++) {
array_push($badKeys, $i);
}
$this->_datas = array_diff_key($this->_datas, array_flip($badKeys));
$this->_datas = array_values($this->_datas);
} | php | public function deleteRange($key, $length) {
$badKeys = [];
for ($i = $key; $i < $key + $length; $i++) {
array_push($badKeys, $i);
}
$this->_datas = array_diff_key($this->_datas, array_flip($badKeys));
$this->_datas = array_values($this->_datas);
} | [
"public",
"function",
"deleteRange",
"(",
"$",
"key",
",",
"$",
"length",
")",
"{",
"$",
"badKeys",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"$",
"key",
";",
"$",
"i",
"<",
"$",
"key",
"+",
"$",
"length",
";",
"$",
"i",
"++",
")",
"{"... | Delete between 2 keys
@access public
@param $key int
@param $length int
@return void
@since 3.0
@package Gcs\Framework\Core\Collecion | [
"Delete",
"between",
"2",
"keys"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Collection/Collection.php#L115-L124 |
11,378 | fabsgc/framework | Core/Collection/Collection.php | Collection.getRange | public function getRange($key, $length) {
$badKeys = [];
for ($i = 0; $i < $key; $i++) {
array_push($badKeys, $i);
}
for ($i = $key + $length; $i < count($this->_datas); $i++) {
array_push($badKeys, $i);
}
return array_diff_key($this->_datas, ar... | php | public function getRange($key, $length) {
$badKeys = [];
for ($i = 0; $i < $key; $i++) {
array_push($badKeys, $i);
}
for ($i = $key + $length; $i < count($this->_datas); $i++) {
array_push($badKeys, $i);
}
return array_diff_key($this->_datas, ar... | [
"public",
"function",
"getRange",
"(",
"$",
"key",
",",
"$",
"length",
")",
"{",
"$",
"badKeys",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"key",
";",
"$",
"i",
"++",
")",
"{",
"array_push",
"(",
"$",
"bad... | Get between 2 keys
@access public
@param $key int
@param $length int
@return array
@since 3.0
@package Gcs\Framework\Core\Collecion | [
"Get",
"between",
"2",
"keys"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Collection/Collection.php#L136-L148 |
11,379 | fabsgc/framework | Core/Collection/Collection.php | Collection.filter | public function filter($closure) {
$collection = new Collection();
foreach ($this->_datas as $data) {
if ($closure($data)) {
$collection->add($data);
}
}
return $collection;
} | php | public function filter($closure) {
$collection = new Collection();
foreach ($this->_datas as $data) {
if ($closure($data)) {
$collection->add($data);
}
}
return $collection;
} | [
"public",
"function",
"filter",
"(",
"$",
"closure",
")",
"{",
"$",
"collection",
"=",
"new",
"Collection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_datas",
"as",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"closure",
"(",
"$",
"data",
")",
... | Filter the collection with a closure
@access public
@param $closure callable
@return Collection
@since 3.0
@package Gcs\Framework\Core\Collecion | [
"Filter",
"the",
"collection",
"with",
"a",
"closure"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Collection/Collection.php#L159-L169 |
11,380 | fabsgc/framework | Core/Collection/Collection.php | Collection.add | public function add($data) {
if (!array_search($data, $this->_datas, true) && is_object($data)) {
$data = clone $data;
}
if (is_array($data)) {
$this->_datas = array_merge($this->_datas, $data);
}
else {
if (get_class($data) != 'Gcs\Framework\... | php | public function add($data) {
if (!array_search($data, $this->_datas, true) && is_object($data)) {
$data = clone $data;
}
if (is_array($data)) {
$this->_datas = array_merge($this->_datas, $data);
}
else {
if (get_class($data) != 'Gcs\Framework\... | [
"public",
"function",
"add",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"array_search",
"(",
"$",
"data",
",",
"$",
"this",
"->",
"_datas",
",",
"true",
")",
"&&",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"clone",
"$",
"... | Add elements to the collection
@access public
@param $data mixed array[], Collection
@return void
@since 3.0
@package Gcs\Framework\Core\Collecion | [
"Add",
"elements",
"to",
"the",
"collection"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Collection/Collection.php#L180-L196 |
11,381 | eix/core | src/php/main/Eix/Core/Responders/Http.php | Http.getResponse | final public function getResponse()
{
if (empty($this->response)) {
$httpMethod = $this->getRequest()
? strtoupper($this->getRequest()->getMethod())
: 'GET'
;
if ($this->isHttpMethodSupported($httpMethod)) {
$functionName =... | php | final public function getResponse()
{
if (empty($this->response)) {
$httpMethod = $this->getRequest()
? strtoupper($this->getRequest()->getMethod())
: 'GET'
;
if ($this->isHttpMethodSupported($httpMethod)) {
$functionName =... | [
"final",
"public",
"function",
"getResponse",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"response",
")",
")",
"{",
"$",
"httpMethod",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"?",
"strtoupper",
"(",
"$",
"this",
"->",
"getRequ... | The default behaviour consists of executing a function named after the
HTTP method and the eventual action contained in the request, to produce
a Response object.
@return \Eix\Core\Response
@throws \Eix\Core\Exception | [
"The",
"default",
"behaviour",
"consists",
"of",
"executing",
"a",
"function",
"named",
"after",
"the",
"HTTP",
"method",
"and",
"the",
"eventual",
"action",
"contained",
"in",
"the",
"request",
"to",
"produce",
"a",
"Response",
"object",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/Responders/Http.php#L54-L80 |
11,382 | eix/core | src/php/main/Eix/Core/Responders/Http.php | Http.getFunctionName | private function getFunctionName($httpMethod)
{
if ($this->getRequest()) {
$functionName = null;
// Prefix starts with 'http'.
$functionPrefix = 'http';
// The HTTP method is then appended.
$functionPrefix .= ucfirst(strtolower($httpMethod));
... | php | private function getFunctionName($httpMethod)
{
if ($this->getRequest()) {
$functionName = null;
// Prefix starts with 'http'.
$functionPrefix = 'http';
// The HTTP method is then appended.
$functionPrefix .= ucfirst(strtolower($httpMethod));
... | [
"private",
"function",
"getFunctionName",
"(",
"$",
"httpMethod",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
")",
"{",
"$",
"functionName",
"=",
"null",
";",
"// Prefix starts with 'http'.",
"$",
"functionPrefix",
"=",
"'http'",
";",
"//... | Returns a function name that represents the method and response's
expected content type.
e.g. httpGetForHtml represents a GET request expecting HTML back.
e.g. httpPostForJson represents a POST request expecting JSON back.
e.g. httpPutForAll represents a PUT request expecting whatever back. | [
"Returns",
"a",
"function",
"name",
"that",
"represents",
"the",
"method",
"and",
"response",
"s",
"expected",
"content",
"type",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/Responders/Http.php#L90-L138 |
11,383 | eix/core | src/php/main/Eix/Core/Responders/Http.php | Http.isHttpMethodSupported | private function isHttpMethodSupported($requestMethod)
{
$requestMethodName = 'http' . ucfirst(strtolower($requestMethod));
foreach (get_class_methods($this) as $methodName) {
if (strpos($methodName, $requestMethodName) === 0) {
return true;
}
}
... | php | private function isHttpMethodSupported($requestMethod)
{
$requestMethodName = 'http' . ucfirst(strtolower($requestMethod));
foreach (get_class_methods($this) as $methodName) {
if (strpos($methodName, $requestMethodName) === 0) {
return true;
}
}
... | [
"private",
"function",
"isHttpMethodSupported",
"(",
"$",
"requestMethod",
")",
"{",
"$",
"requestMethodName",
"=",
"'http'",
".",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"requestMethod",
")",
")",
";",
"foreach",
"(",
"get_class_methods",
"(",
"$",
"this",
")... | Check whether there is at least one function that implements the
requested HTTP method. | [
"Check",
"whether",
"there",
"is",
"at",
"least",
"one",
"function",
"that",
"implements",
"the",
"requested",
"HTTP",
"method",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/Responders/Http.php#L144-L154 |
11,384 | eix/core | src/php/main/Eix/Core/Responders/Http.php | Http.isBaseFunctionAvailable | private function isBaseFunctionAvailable($functionName)
{
foreach (get_class_methods($this) as $responderMethodName) {
if (strpos($responderMethodName, $functionName) === 0) {
return true;
}
}
return false;
} | php | private function isBaseFunctionAvailable($functionName)
{
foreach (get_class_methods($this) as $responderMethodName) {
if (strpos($responderMethodName, $functionName) === 0) {
return true;
}
}
return false;
} | [
"private",
"function",
"isBaseFunctionAvailable",
"(",
"$",
"functionName",
")",
"{",
"foreach",
"(",
"get_class_methods",
"(",
"$",
"this",
")",
"as",
"$",
"responderMethodName",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"responderMethodName",
",",
"$",
"funct... | Check whether there is at least one function that implements the
requested HTTP method and an eventual action. | [
"Check",
"whether",
"there",
"is",
"at",
"least",
"one",
"function",
"that",
"implements",
"the",
"requested",
"HTTP",
"method",
"and",
"an",
"eventual",
"action",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/Responders/Http.php#L160-L169 |
11,385 | tekkla/core-html | Core/Html/Bootstrap/Navbar/LinkElement.php | LinkElement.isAjax | public function isAjax($ajax=null)
{
if (isset($ajax)) {
$this->ajax = (bool) $ajax;
return $this;
}
else {
return $this->ajax;
}
} | php | public function isAjax($ajax=null)
{
if (isset($ajax)) {
$this->ajax = (bool) $ajax;
return $this;
}
else {
return $this->ajax;
}
} | [
"public",
"function",
"isAjax",
"(",
"$",
"ajax",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"ajax",
")",
")",
"{",
"$",
"this",
"->",
"ajax",
"=",
"(",
"bool",
")",
"$",
"ajax",
";",
"return",
"$",
"this",
";",
"}",
"else",
"{",
"r... | Sets or gets ajax flag.
@param string $ajax
@return <boolean>, <\Core\Html\Bootstrap\Navbar\LinkElement> | [
"Sets",
"or",
"gets",
"ajax",
"flag",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Bootstrap/Navbar/LinkElement.php#L97-L106 |
11,386 | sirgrimorum/crudgenerator | src/CrudGeneratorCommands.php | CrudGeneratorCommands.sendalert | public function sendalert() {
$alertaClass = $this->console->ask("Notification Class?");
if (class_exists($alertaClass)) {
$email = $this->console->anticipate("User email?", ['[email protected]']);
if ($toUser = \App\User::where("email", "=", $email)->first()) {
... | php | public function sendalert() {
$alertaClass = $this->console->ask("Notification Class?");
if (class_exists($alertaClass)) {
$email = $this->console->anticipate("User email?", ['[email protected]']);
if ($toUser = \App\User::where("email", "=", $email)->first()) {
... | [
"public",
"function",
"sendalert",
"(",
")",
"{",
"$",
"alertaClass",
"=",
"$",
"this",
"->",
"console",
"->",
"ask",
"(",
"\"Notification Class?\"",
")",
";",
"if",
"(",
"class_exists",
"(",
"$",
"alertaClass",
")",
")",
"{",
"$",
"email",
"=",
"$",
"... | Broadcast an alert to a user | [
"Broadcast",
"an",
"alert",
"to",
"a",
"user"
] | 4431e9991a705689be50c4367776dc611bffb863 | https://github.com/sirgrimorum/crudgenerator/blob/4431e9991a705689be50c4367776dc611bffb863/src/CrudGeneratorCommands.php#L16-L70 |
11,387 | sirgrimorum/crudgenerator | src/CrudGeneratorCommands.php | CrudGeneratorCommands.createmodel | public function createmodel($table) {
$this->console->line("Preparing model attributes");
$bar = $this->console->output->createProgressBar(4);
$options = $this->console->options('path');
//$modelName = $singular = substr($table, 0, strlen($table) - 1);
$modelName = $singular = st... | php | public function createmodel($table) {
$this->console->line("Preparing model attributes");
$bar = $this->console->output->createProgressBar(4);
$options = $this->console->options('path');
//$modelName = $singular = substr($table, 0, strlen($table) - 1);
$modelName = $singular = st... | [
"public",
"function",
"createmodel",
"(",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"line",
"(",
"\"Preparing model attributes\"",
")",
";",
"$",
"bar",
"=",
"$",
"this",
"->",
"console",
"->",
"output",
"->",
"createProgressBar",
"(",
"4... | Create a Model file based on a database table
@param string $table Table name | [
"Create",
"a",
"Model",
"file",
"based",
"on",
"a",
"database",
"table"
] | 4431e9991a705689be50c4367776dc611bffb863 | https://github.com/sirgrimorum/crudgenerator/blob/4431e9991a705689be50c4367776dc611bffb863/src/CrudGeneratorCommands.php#L76-L130 |
11,388 | sirgrimorum/crudgenerator | src/CrudGeneratorCommands.php | CrudGeneratorCommands.createlang | public function createlang($model) {
$this->console->line("Preparing model attributes");
$bar = $this->console->output->createProgressBar(5);
$options = $this->console->options('path');
if ($options['path'] != "") {
$path = $options['path'];
} else {
$path... | php | public function createlang($model) {
$this->console->line("Preparing model attributes");
$bar = $this->console->output->createProgressBar(5);
$options = $this->console->options('path');
if ($options['path'] != "") {
$path = $options['path'];
} else {
$path... | [
"public",
"function",
"createlang",
"(",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"console",
"->",
"line",
"(",
"\"Preparing model attributes\"",
")",
";",
"$",
"bar",
"=",
"$",
"this",
"->",
"console",
"->",
"output",
"->",
"createProgressBar",
"(",
"5"... | Create a Model Lang file from config array
@param string $model the model name in lowercase | [
"Create",
"a",
"Model",
"Lang",
"file",
"from",
"config",
"array"
] | 4431e9991a705689be50c4367776dc611bffb863 | https://github.com/sirgrimorum/crudgenerator/blob/4431e9991a705689be50c4367776dc611bffb863/src/CrudGeneratorCommands.php#L136-L175 |
11,389 | tekkla/core-html | Core/Html/Controls/UiButton.php | UiButton.setIcon | public function setIcon($icon)
{
$this->icon = $this->factory->create('Fontawesome\Icon');
$this->icon->setIcon($icon);
return $this;
} | php | public function setIcon($icon)
{
$this->icon = $this->factory->create('Fontawesome\Icon');
$this->icon->setIcon($icon);
return $this;
} | [
"public",
"function",
"setIcon",
"(",
"$",
"icon",
")",
"{",
"$",
"this",
"->",
"icon",
"=",
"$",
"this",
"->",
"factory",
"->",
"create",
"(",
"'Fontawesome\\Icon'",
")",
";",
"$",
"this",
"->",
"icon",
"->",
"setIcon",
"(",
"$",
"icon",
")",
";",
... | Set an icon from fontawesome icon.
Use only the name without the leading "fa-"
@param string $icon
@return \Core\Html\controls\UiButton | [
"Set",
"an",
"icon",
"from",
"fontawesome",
"icon",
".",
"Use",
"only",
"the",
"name",
"without",
"the",
"leading",
"fa",
"-"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/UiButton.php#L148-L154 |
11,390 | tekkla/core-html | Core/Html/Controls/UiButton.php | UiButton.build | public function build()
{
if ($this->mode == 'ajax') {
$this->data['ajax'] = 'link';
}
// Set text and set icon means we have a button of type imagebutton
if ($this->text && $this->icon) {
$this->type = 'imgbutton';
}
// icon/image
if... | php | public function build()
{
if ($this->mode == 'ajax') {
$this->data['ajax'] = 'link';
}
// Set text and set icon means we have a button of type imagebutton
if ($this->text && $this->icon) {
$this->type = 'imgbutton';
}
// icon/image
if... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mode",
"==",
"'ajax'",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'ajax'",
"]",
"=",
"'link'",
";",
"}",
"// Set text and set icon means we have a button of type imagebutton",
"if",
... | Builds and returns button html code
@param string $wrapper
@throws Error
@return string | [
"Builds",
"and",
"returns",
"button",
"html",
"code"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/UiButton.php#L241-L295 |
11,391 | diatem-net/jin-com | src/Com/WebService/WSServer.php | WsServer.buildService | public function buildService()
{
require_once($this->classFile);
$wsdl = $this->generateWsdl();
if (isset($_GET['wsdl'])) {
print $wsdl;
} else {
$file = 'data://text/plain;base64,'. base64_encode($wsdl);
$server = new \SoapServer($file);
$server->setClass($this->cla... | php | public function buildService()
{
require_once($this->classFile);
$wsdl = $this->generateWsdl();
if (isset($_GET['wsdl'])) {
print $wsdl;
} else {
$file = 'data://text/plain;base64,'. base64_encode($wsdl);
$server = new \SoapServer($file);
$server->setClass($this->cla... | [
"public",
"function",
"buildService",
"(",
")",
"{",
"require_once",
"(",
"$",
"this",
"->",
"classFile",
")",
";",
"$",
"wsdl",
"=",
"$",
"this",
"->",
"generateWsdl",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"'wsdl'",
"]",
")",
"... | Construction du service
@return void | [
"Construction",
"du",
"service"
] | 7449f555676cc058130377d74c845ff91b6b286f | https://github.com/diatem-net/jin-com/blob/7449f555676cc058130377d74c845ff91b6b286f/src/Com/WebService/WSServer.php#L59-L76 |
11,392 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.getById | public function getById($id, $col = null)
{
$id = (int) $id;
$model = $this->getCacheItem($id);
if (!$model) {
$model = $this->getMapper()->getById($id, $col);
if ($this->useCache) {
$this->setCacheItem($id, $model);
}
}
... | php | public function getById($id, $col = null)
{
$id = (int) $id;
$model = $this->getCacheItem($id);
if (!$model) {
$model = $this->getMapper()->getById($id, $col);
if ($this->useCache) {
$this->setCacheItem($id, $model);
}
}
... | [
"public",
"function",
"getById",
"(",
"$",
"id",
",",
"$",
"col",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"(",
"int",
")",
"$",
"id",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"getCacheItem",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"... | return one or more records from database by id
@param $id
@param null $col
@return array|mixed|ModelInterface | [
"return",
"one",
"or",
"more",
"records",
"from",
"database",
"by",
"id"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L59-L73 |
11,393 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.search | public function search(array $post)
{
$sort = (isset($post['sort'])) ? $post['sort'] : '';
unset($post['sort'], $post['count'], $post['offset'], $post['page']);
$searches = [];
foreach ($post as $key => $value) {
$searches[] = [
'searchString' => $value,... | php | public function search(array $post)
{
$sort = (isset($post['sort'])) ? $post['sort'] : '';
unset($post['sort'], $post['count'], $post['offset'], $post['page']);
$searches = [];
foreach ($post as $key => $value) {
$searches[] = [
'searchString' => $value,... | [
"public",
"function",
"search",
"(",
"array",
"$",
"post",
")",
"{",
"$",
"sort",
"=",
"(",
"isset",
"(",
"$",
"post",
"[",
"'sort'",
"]",
")",
")",
"?",
"$",
"post",
"[",
"'sort'",
"]",
":",
"''",
";",
"unset",
"(",
"$",
"post",
"[",
"'sort'",... | basic search on database
@param array $post
@return ResultSet|Paginator|HydratingResultSet | [
"basic",
"search",
"on",
"database"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L93-L110 |
11,394 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.add | public function add(array $post, Form $form = null)
{
$model = $this->getModel();
$form = ($form instanceof Form) ?
$form->setData($post) :
$this->prepareForm($model, $post, true, true);
$argv = compact('post', 'form');
$argv = $this->prepareEventArgume... | php | public function add(array $post, Form $form = null)
{
$model = $this->getModel();
$form = ($form instanceof Form) ?
$form->setData($post) :
$this->prepareForm($model, $post, true, true);
$argv = compact('post', 'form');
$argv = $this->prepareEventArgume... | [
"public",
"function",
"add",
"(",
"array",
"$",
"post",
",",
"Form",
"$",
"form",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
";",
"$",
"form",
"=",
"(",
"$",
"form",
"instanceof",
"Form",
")",
"?",
"$",
"... | prepare and return form
@param array $post
@param Form $form
@return int|Form
@throws ServiceException | [
"prepare",
"and",
"return",
"form"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L120-L142 |
11,395 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.edit | public function edit(ModelInterface $model, array $post, Form $form = null)
{
$form = ($form instanceof Form) ?
$form->setData($post) :
$this->prepareForm($model, $post, true, true);
$argv = compact('model', 'post', 'form');
$argv = $this->prepareEventArguments($argv)... | php | public function edit(ModelInterface $model, array $post, Form $form = null)
{
$form = ($form instanceof Form) ?
$form->setData($post) :
$this->prepareForm($model, $post, true, true);
$argv = compact('model', 'post', 'form');
$argv = $this->prepareEventArguments($argv)... | [
"public",
"function",
"edit",
"(",
"ModelInterface",
"$",
"model",
",",
"array",
"$",
"post",
",",
"Form",
"$",
"form",
"=",
"null",
")",
"{",
"$",
"form",
"=",
"(",
"$",
"form",
"instanceof",
"Form",
")",
"?",
"$",
"form",
"->",
"setData",
"(",
"$... | prepare data to be updated and saved into database.
@param ModelInterface $model
@param array $post
@param Form $form
@return Form|int results from self::save()
@throws ServiceException | [
"prepare",
"data",
"to",
"be",
"updated",
"and",
"saved",
"into",
"database",
"."
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L153-L176 |
11,396 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.save | public function save($data)
{
$argv = compact('data');
$argv = $this->prepareEventArguments($argv);
$this->getEventManager()->trigger(self::EVENT_PRE_SAVE, $this, $argv);
$data = $argv['data'];
if ($data instanceof ModelInterface) {
$data = $this->getHydrator()... | php | public function save($data)
{
$argv = compact('data');
$argv = $this->prepareEventArguments($argv);
$this->getEventManager()->trigger(self::EVENT_PRE_SAVE, $this, $argv);
$data = $argv['data'];
if ($data instanceof ModelInterface) {
$data = $this->getHydrator()... | [
"public",
"function",
"save",
"(",
"$",
"data",
")",
"{",
"$",
"argv",
"=",
"compact",
"(",
"'data'",
")",
";",
"$",
"argv",
"=",
"$",
"this",
"->",
"prepareEventArguments",
"(",
"$",
"argv",
")",
";",
"$",
"this",
"->",
"getEventManager",
"(",
")",
... | updates a row if id is supplied else insert a new row
@param array|ModelInterface $data
@throws ServiceException
@return int $results number of rows affected or insertId | [
"updates",
"a",
"row",
"if",
"id",
"is",
"supplied",
"else",
"insert",
"a",
"new",
"row"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L185-L221 |
11,397 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.delete | public function delete($id)
{
$model = $this->getById($id);
$argv = compact('id', 'model');
$argv = $this->prepareEventArguments($argv);
$this->getEventManager()->trigger(self::EVENT_PRE_DELETE, $this, $argv);
$result = $this->getMapper()->delete([
$this->getMa... | php | public function delete($id)
{
$model = $this->getById($id);
$argv = compact('id', 'model');
$argv = $this->prepareEventArguments($argv);
$this->getEventManager()->trigger(self::EVENT_PRE_DELETE, $this, $argv);
$result = $this->getMapper()->delete([
$this->getMa... | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getById",
"(",
"$",
"id",
")",
";",
"$",
"argv",
"=",
"compact",
"(",
"'id'",
",",
"'model'",
")",
";",
"$",
"argv",
"=",
"$",
"this",
"->",
"prepa... | delete row from database
@param int $id
@return int $result number of rows affected | [
"delete",
"row",
"from",
"database"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L229-L250 |
11,398 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.getMapper | public function getMapper($mapperClass = null, array $options = [])
{
$mapperClass = $mapperClass ?? $this->mapper ?? $this->serviceAlias;
if (!array_key_exists($mapperClass, $this->mappers)) {
$this->setMapper($mapperClass, $options);
}
return $this->mappers[$mapperCla... | php | public function getMapper($mapperClass = null, array $options = [])
{
$mapperClass = $mapperClass ?? $this->mapper ?? $this->serviceAlias;
if (!array_key_exists($mapperClass, $this->mappers)) {
$this->setMapper($mapperClass, $options);
}
return $this->mappers[$mapperCla... | [
"public",
"function",
"getMapper",
"(",
"$",
"mapperClass",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"mapperClass",
"=",
"$",
"mapperClass",
"??",
"$",
"this",
"->",
"mapper",
"??",
"$",
"this",
"->",
"serviceAlias",
";"... | gets the mapper class for this service
@param null|string $mapperClass
@param array $options
@return MapperInterface | [
"gets",
"the",
"mapper",
"class",
"for",
"this",
"service"
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L259-L268 |
11,399 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractMapperService.php | AbstractMapperService.setMapper | public function setMapper($mapperClass, array $options = [])
{
$sl = $this->getServiceLocator();
$mapperManager = $sl->get(MapperManager::class);
$defaultOptions = [
'model' => $this->model ?? $this->serviceAlias,
'hydrator' => $this->hydrator ?? $this->... | php | public function setMapper($mapperClass, array $options = [])
{
$sl = $this->getServiceLocator();
$mapperManager = $sl->get(MapperManager::class);
$defaultOptions = [
'model' => $this->model ?? $this->serviceAlias,
'hydrator' => $this->hydrator ?? $this->... | [
"public",
"function",
"setMapper",
"(",
"$",
"mapperClass",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"sl",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
";",
"$",
"mapperManager",
"=",
"$",
"sl",
"->",
"get",
"(",
"MapperM... | Sets mapper in mapper array for reuse.
@param string $mapperClass
@param array $options
@return $this | [
"Sets",
"mapper",
"in",
"mapper",
"array",
"for",
"reuse",
"."
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractMapperService.php#L277-L293 |
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.