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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
237,000 | kuria/enum | src/EnumObject.php | EnumObject.all | static function all(): array
{
$instances = [];
foreach (static::getMap() as $key => $value) {
$instances[$key] = self::$instanceCache[static::class][$key]
?? (self::$instanceCache[static::class][$key] = new static($key, $value));
}
return $instances;
... | php | static function all(): array
{
$instances = [];
foreach (static::getMap() as $key => $value) {
$instances[$key] = self::$instanceCache[static::class][$key]
?? (self::$instanceCache[static::class][$key] = new static($key, $value));
}
return $instances;
... | [
"static",
"function",
"all",
"(",
")",
":",
"array",
"{",
"$",
"instances",
"=",
"[",
"]",
";",
"foreach",
"(",
"static",
"::",
"getMap",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"instances",
"[",
"$",
"key",
"]",
"=",
"se... | Get instance for each defined key-value pair
@return static[] | [
"Get",
"instance",
"for",
"each",
"defined",
"key",
"-",
"value",
"pair"
] | 9d9c1907f8a6910552b50b175398393909028eaa | https://github.com/kuria/enum/blob/9d9c1907f8a6910552b50b175398393909028eaa/src/EnumObject.php#L112-L122 |
237,001 | motamonteiro/helpers | src/Traits/StringHelper.php | StringHelper.numeroFormatoBrParaSql | public function numeroFormatoBrParaSql($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com o ponto
$numero = str_replace(".", "", $numero);
//Substitui separador de decimal de virgula para ponto
$numero = str_replace(",", ".", $nume... | php | public function numeroFormatoBrParaSql($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com o ponto
$numero = str_replace(".", "", $numero);
//Substitui separador de decimal de virgula para ponto
$numero = str_replace(",", ".", $nume... | [
"public",
"function",
"numeroFormatoBrParaSql",
"(",
"$",
"numero",
")",
"{",
"//Retira espaços",
"$",
"numero",
"=",
"trim",
"(",
"$",
"numero",
")",
";",
"//Retira separador de milhar com o ponto",
"$",
"numero",
"=",
"str_replace",
"(",
"\".\"",
",",
"\"\"",
... | Converter um numero de um formato '12.345.678,00' para um formato '12345678.00'.
@param string $numero
@return false|mixed | [
"Converter",
"um",
"numero",
"de",
"um",
"formato",
"12",
".",
"345",
".",
"678",
"00",
"para",
"um",
"formato",
"12345678",
".",
"00",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/StringHelper.php#L127-L143 |
237,002 | motamonteiro/helpers | src/Traits/StringHelper.php | StringHelper.numeroFormatoSqlParaBr | public function numeroFormatoSqlParaBr($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com a virgula
$numero = str_replace(",", "", $numero);
if (!is_numeric($numero)) {
return false;
}
//Se não tiver ponto
... | php | public function numeroFormatoSqlParaBr($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com a virgula
$numero = str_replace(",", "", $numero);
if (!is_numeric($numero)) {
return false;
}
//Se não tiver ponto
... | [
"public",
"function",
"numeroFormatoSqlParaBr",
"(",
"$",
"numero",
")",
"{",
"//Retira espaços",
"$",
"numero",
"=",
"trim",
"(",
"$",
"numero",
")",
";",
"//Retira separador de milhar com a virgula",
"$",
"numero",
"=",
"str_replace",
"(",
"\",\"",
",",
"\"\"",
... | Converter um numero de um formato '12345678.00' para um formato '12.345.678,00' com ou sem casas decimais.
@param $numero
@return false|string | [
"Converter",
"um",
"numero",
"de",
"um",
"formato",
"12345678",
".",
"00",
"para",
"um",
"formato",
"12",
".",
"345",
".",
"678",
"00",
"com",
"ou",
"sem",
"casas",
"decimais",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/StringHelper.php#L151-L169 |
237,003 | motamonteiro/helpers | src/Traits/StringHelper.php | StringHelper.numeroFormatoSqlParaMoedaBr | public function numeroFormatoSqlParaMoedaBr($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com a virgula
$numero = str_replace(",", "", $numero);
if(!is_numeric($numero)){
return false;
}
return number_format($... | php | public function numeroFormatoSqlParaMoedaBr($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com a virgula
$numero = str_replace(",", "", $numero);
if(!is_numeric($numero)){
return false;
}
return number_format($... | [
"public",
"function",
"numeroFormatoSqlParaMoedaBr",
"(",
"$",
"numero",
")",
"{",
"//Retira espaços",
"$",
"numero",
"=",
"trim",
"(",
"$",
"numero",
")",
";",
"//Retira separador de milhar com a virgula",
"$",
"numero",
"=",
"str_replace",
"(",
"\",\"",
",",
"\"... | Converter um numero de um formato '12345678' para um formato '12.345.678,00' sempre com casas decimais.
@param $numero
@return false|string | [
"Converter",
"um",
"numero",
"de",
"um",
"formato",
"12345678",
"para",
"um",
"formato",
"12",
".",
"345",
".",
"678",
"00",
"sempre",
"com",
"casas",
"decimais",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/StringHelper.php#L177-L190 |
237,004 | motamonteiro/helpers | src/Traits/StringHelper.php | StringHelper.numeroFormatoBrParaMoedaBr | public function numeroFormatoBrParaMoedaBr($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com a virgula
$numero = str_replace(".", "", $numero);
//transforma para numero
$numero = str_replace(",", ".", $numero);
if(!is_num... | php | public function numeroFormatoBrParaMoedaBr($numero)
{
//Retira espaços
$numero = trim($numero);
//Retira separador de milhar com a virgula
$numero = str_replace(".", "", $numero);
//transforma para numero
$numero = str_replace(",", ".", $numero);
if(!is_num... | [
"public",
"function",
"numeroFormatoBrParaMoedaBr",
"(",
"$",
"numero",
")",
"{",
"//Retira espaços",
"$",
"numero",
"=",
"trim",
"(",
"$",
"numero",
")",
";",
"//Retira separador de milhar com a virgula",
"$",
"numero",
"=",
"str_replace",
"(",
"\".\"",
",",
"\"\... | Converter um numero de um formato '2345678,00' para um formato '12.345.678,00' sempre com casas decimais.
@param string $numero
@return false|mixed | [
"Converter",
"um",
"numero",
"de",
"um",
"formato",
"2345678",
"00",
"para",
"um",
"formato",
"12",
".",
"345",
".",
"678",
"00",
"sempre",
"com",
"casas",
"decimais",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/StringHelper.php#L198-L213 |
237,005 | motamonteiro/helpers | src/Traits/StringHelper.php | StringHelper.checarValorArrayMultidimensional | public function checarValorArrayMultidimensional($key, $value, array $array)
{
foreach ($array as $a) {
if (isset($a[$key]) && $a[$key] == $value) {
return true;
}
}
return false;
} | php | public function checarValorArrayMultidimensional($key, $value, array $array)
{
foreach ($array as $a) {
if (isset($a[$key]) && $a[$key] == $value) {
return true;
}
}
return false;
} | [
"public",
"function",
"checarValorArrayMultidimensional",
"(",
"$",
"key",
",",
"$",
"value",
",",
"array",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"a",
"[",
"$",
"key",
"]",
")"... | Checar se um valor existe em um array multidimensional
@param string $key
@param string $value
@param array $array
@return bool | [
"Checar",
"se",
"um",
"valor",
"existe",
"em",
"um",
"array",
"multidimensional"
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/StringHelper.php#L223-L231 |
237,006 | motamonteiro/helpers | src/Traits/StringHelper.php | StringHelper.formatarIeCpfCnpj | function formatarIeCpfCnpj($valor)
{
if (strlen($valor) == 9) {
return $this->formatarIe($valor);
}
if (strlen($valor) == 11) {
return $this->formatarCpf($valor);
}
return $this->formatarCnpj($valor);
} | php | function formatarIeCpfCnpj($valor)
{
if (strlen($valor) == 9) {
return $this->formatarIe($valor);
}
if (strlen($valor) == 11) {
return $this->formatarCpf($valor);
}
return $this->formatarCnpj($valor);
} | [
"function",
"formatarIeCpfCnpj",
"(",
"$",
"valor",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"valor",
")",
"==",
"9",
")",
"{",
"return",
"$",
"this",
"->",
"formatarIe",
"(",
"$",
"valor",
")",
";",
"}",
"if",
"(",
"strlen",
"(",
"$",
"valor",
"... | Converter um numero para os formatos de Inscricao Estadual, Cpf ou Cnpj, de acordo com o tamanho do parametro informado.
@param $valor
@return string | [
"Converter",
"um",
"numero",
"para",
"os",
"formatos",
"de",
"Inscricao",
"Estadual",
"Cpf",
"ou",
"Cnpj",
"de",
"acordo",
"com",
"o",
"tamanho",
"do",
"parametro",
"informado",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/StringHelper.php#L314-L325 |
237,007 | motamonteiro/helpers | src/Traits/StringHelper.php | StringHelper.formatarTelefone | function formatarTelefone($valor)
{
if (strlen($valor) < 10) {
return $this->formatarValor($valor, '####-####');
}
if (strlen($valor) == 10) {
return $this->formatarValor($valor, '(##) ####-####');
}
return $this->formatarValor($valor, '(##) #####-##... | php | function formatarTelefone($valor)
{
if (strlen($valor) < 10) {
return $this->formatarValor($valor, '####-####');
}
if (strlen($valor) == 10) {
return $this->formatarValor($valor, '(##) ####-####');
}
return $this->formatarValor($valor, '(##) #####-##... | [
"function",
"formatarTelefone",
"(",
"$",
"valor",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"valor",
")",
"<",
"10",
")",
"{",
"return",
"$",
"this",
"->",
"formatarValor",
"(",
"$",
"valor",
",",
"'####-####'",
")",
";",
"}",
"if",
"(",
"strlen",
... | Converter um numero para os formatos de telefone simples, telefone com ddd ou telefone celular, de acordo com o tamanho do parametro informado.
@param $valor
@return string | [
"Converter",
"um",
"numero",
"para",
"os",
"formatos",
"de",
"telefone",
"simples",
"telefone",
"com",
"ddd",
"ou",
"telefone",
"celular",
"de",
"acordo",
"com",
"o",
"tamanho",
"do",
"parametro",
"informado",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/StringHelper.php#L333-L344 |
237,008 | MadrakIO/extendable-configuration-bundle | Controller/AbstractExtendableConfigurationController.php | AbstractExtendableConfigurationController.indexAction | public function indexAction(Request $request)
{
$form = $this->createForm(new ExtendableConfigurationType($this->get('madrak_io_extendable_configuration.extendable_configuration_chain')->getBuiltConfiguration()));
$form->setData($this->get('madrak_io_extendable_configuration.configuration_service')-... | php | public function indexAction(Request $request)
{
$form = $this->createForm(new ExtendableConfigurationType($this->get('madrak_io_extendable_configuration.extendable_configuration_chain')->getBuiltConfiguration()));
$form->setData($this->get('madrak_io_extendable_configuration.configuration_service')-... | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ExtendableConfigurationType",
"(",
"$",
"this",
"->",
"get",
"(",
"'madrak_io_extendable_configuration.extendable_configura... | Lists all available configurations.
@Route("/")
@Method("GET|POST") | [
"Lists",
"all",
"available",
"configurations",
"."
] | f6fec2913a52ad634852df41b29a0dbbf16eeb47 | https://github.com/MadrakIO/extendable-configuration-bundle/blob/f6fec2913a52ad634852df41b29a0dbbf16eeb47/Controller/AbstractExtendableConfigurationController.php#L23-L63 |
237,009 | juanparati/Emoji | src/Emoji.php | Emoji.char | public static function char($symbol)
{
if (is_string($symbol) && EmojiDictionary::get($symbol))
$symbol = EmojiDictionary::get($symbol);
// In case that multiple unicode sequences are used
if (is_array($symbol))
{
$output = '';
foreach ($symbo... | php | public static function char($symbol)
{
if (is_string($symbol) && EmojiDictionary::get($symbol))
$symbol = EmojiDictionary::get($symbol);
// In case that multiple unicode sequences are used
if (is_array($symbol))
{
$output = '';
foreach ($symbo... | [
"public",
"static",
"function",
"char",
"(",
"$",
"symbol",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"symbol",
")",
"&&",
"EmojiDictionary",
"::",
"get",
"(",
"$",
"symbol",
")",
")",
"$",
"symbol",
"=",
"EmojiDictionary",
"::",
"get",
"(",
"$",
"... | Return an emoji as char
@param $symbol
@return bool|string | [
"Return",
"an",
"emoji",
"as",
"char"
] | 53a34e1d3714f2a11ddc0451030eee06ea2f8f21 | https://github.com/juanparati/Emoji/blob/53a34e1d3714f2a11ddc0451030eee06ea2f8f21/src/Emoji.php#L18-L40 |
237,010 | juanparati/Emoji | src/Emoji.php | Emoji.html | public static function html($symbol)
{
if (is_string($symbol) && EmojiDictionary::get($symbol))
$symbol = EmojiDictionary::get($symbol);
// In case that multiple unicode sequences are used
if (is_array($symbol))
{
$output = '';
foreach ($symbol... | php | public static function html($symbol)
{
if (is_string($symbol) && EmojiDictionary::get($symbol))
$symbol = EmojiDictionary::get($symbol);
// In case that multiple unicode sequences are used
if (is_array($symbol))
{
$output = '';
foreach ($symbol... | [
"public",
"static",
"function",
"html",
"(",
"$",
"symbol",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"symbol",
")",
"&&",
"EmojiDictionary",
"::",
"get",
"(",
"$",
"symbol",
")",
")",
"$",
"symbol",
"=",
"EmojiDictionary",
"::",
"get",
"(",
"$",
"... | Return an emoji as a html entity
@param $symbol
@return string | [
"Return",
"an",
"emoji",
"as",
"a",
"html",
"entity"
] | 53a34e1d3714f2a11ddc0451030eee06ea2f8f21 | https://github.com/juanparati/Emoji/blob/53a34e1d3714f2a11ddc0451030eee06ea2f8f21/src/Emoji.php#L49-L71 |
237,011 | Morannon/Morannon | src/Morannon/Base/Utils/UrlUtils.php | UrlUtils.removeTrainingSlash | public function removeTrainingSlash($url)
{
if (null === $url || strlen($url) <= 2) {
return $url;
}
return (substr($url, -1, 1) == '/')? substr($url, 0, -1) : $url;
} | php | public function removeTrainingSlash($url)
{
if (null === $url || strlen($url) <= 2) {
return $url;
}
return (substr($url, -1, 1) == '/')? substr($url, 0, -1) : $url;
} | [
"public",
"function",
"removeTrainingSlash",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"url",
"||",
"strlen",
"(",
"$",
"url",
")",
"<=",
"2",
")",
"{",
"return",
"$",
"url",
";",
"}",
"return",
"(",
"substr",
"(",
"$",
"url",
","... | Removes a trailing slash from an url string.
@param string $url
@return string | [
"Removes",
"a",
"trailing",
"slash",
"from",
"an",
"url",
"string",
"."
] | 1990d830452625c41eb4c1d1ff3313fb892b12f3 | https://github.com/Morannon/Morannon/blob/1990d830452625c41eb4c1d1ff3313fb892b12f3/src/Morannon/Base/Utils/UrlUtils.php#L14-L21 |
237,012 | Morannon/Morannon | src/Morannon/Base/Utils/UrlUtils.php | UrlUtils.buildUrlString | public function buildUrlString($baseUrl, $resource)
{
if (null === $baseUrl || '' == $baseUrl) {
return null;
}
if (null === $resource || '' == $resource) {
return $baseUrl;
}
$baseUrl = $this->removeTrainingSlash($baseUrl);
if (!substr($reso... | php | public function buildUrlString($baseUrl, $resource)
{
if (null === $baseUrl || '' == $baseUrl) {
return null;
}
if (null === $resource || '' == $resource) {
return $baseUrl;
}
$baseUrl = $this->removeTrainingSlash($baseUrl);
if (!substr($reso... | [
"public",
"function",
"buildUrlString",
"(",
"$",
"baseUrl",
",",
"$",
"resource",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"baseUrl",
"||",
"''",
"==",
"$",
"baseUrl",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"resource",
... | Returns either the concatenated string or null on wrong params.
@param string $baseUrl
@param string $resource
@return string|null Null on invalid {$baseUrl} | [
"Returns",
"either",
"the",
"concatenated",
"string",
"or",
"null",
"on",
"wrong",
"params",
"."
] | 1990d830452625c41eb4c1d1ff3313fb892b12f3 | https://github.com/Morannon/Morannon/blob/1990d830452625c41eb4c1d1ff3313fb892b12f3/src/Morannon/Base/Utils/UrlUtils.php#L30-L46 |
237,013 | Morannon/Morannon | src/Morannon/Base/Utils/UrlUtils.php | UrlUtils.parseNewLineSeparatedBody | public function parseNewLineSeparatedBody($body)
{
$data = array();
if (!$body) {
return $data;
}
$parts = preg_split("/\\r?\\n/", $body);
foreach ($parts as $str) {
if (!$str) {
continue;
}
list ($key, $value... | php | public function parseNewLineSeparatedBody($body)
{
$data = array();
if (!$body) {
return $data;
}
$parts = preg_split("/\\r?\\n/", $body);
foreach ($parts as $str) {
if (!$str) {
continue;
}
list ($key, $value... | [
"public",
"function",
"parseNewLineSeparatedBody",
"(",
"$",
"body",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"$",
"body",
")",
"{",
"return",
"$",
"data",
";",
"}",
"$",
"parts",
"=",
"preg_split",
"(",
"\"/\\\\r?\\\\n/\"",
... | Separates given string in key value parts.
@param string $body
@return array | [
"Separates",
"given",
"string",
"in",
"key",
"value",
"parts",
"."
] | 1990d830452625c41eb4c1d1ff3313fb892b12f3 | https://github.com/Morannon/Morannon/blob/1990d830452625c41eb4c1d1ff3313fb892b12f3/src/Morannon/Base/Utils/UrlUtils.php#L54-L73 |
237,014 | ItalyStrap/debug | src/Debug/Asset_Queued.php | Asset_Queued.make_output | private function make_output( $assets, $type ) {
$output = '';
$output .= '<pre>' . $type . ' trovati in coda'."\r\n";
foreach ( $assets->queue as $asset ) {
if ( ! isset( $assets->registered[ $asset ] ) ) {
continue;
}
$output .= "\r\nHandle: <strong>" . $asset . "</strong>\n";
$output .= "<... | php | private function make_output( $assets, $type ) {
$output = '';
$output .= '<pre>' . $type . ' trovati in coda'."\r\n";
foreach ( $assets->queue as $asset ) {
if ( ! isset( $assets->registered[ $asset ] ) ) {
continue;
}
$output .= "\r\nHandle: <strong>" . $asset . "</strong>\n";
$output .= "<... | [
"private",
"function",
"make_output",
"(",
"$",
"assets",
",",
"$",
"type",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"'<pre>'",
".",
"$",
"type",
".",
"' trovati in coda'",
".",
"\"\\r\\n\"",
";",
"foreach",
"(",
"$",
"assets",
"->... | Make the list assets output.
@param WP_Style|WP_Script $assets WP_Style or WP_Script object.
@return string Return the list of asset enqueued. | [
"Make",
"the",
"list",
"assets",
"output",
"."
] | 955951b3df3a5c91bdc4cba51348645ccca6bddd | https://github.com/ItalyStrap/debug/blob/955951b3df3a5c91bdc4cba51348645ccca6bddd/src/Debug/Asset_Queued.php#L63-L91 |
237,015 | AlcyZ/Alcys-ORM | src/Core/Db/Factory/ExpressionBuilderFactory.php | ExpressionBuilderFactory.create | public function create(ExpressionInterface $expression = null)
{
if($expression instanceof ConditionInterface)
{
return new ConditionBuilder($expression);
}
elseif($expression instanceof JoinInterface)
{
return new JoinBuilder($expression);
}
else
{
return new NullBuilder();
}
} | php | public function create(ExpressionInterface $expression = null)
{
if($expression instanceof ConditionInterface)
{
return new ConditionBuilder($expression);
}
elseif($expression instanceof JoinInterface)
{
return new JoinBuilder($expression);
}
else
{
return new NullBuilder();
}
} | [
"public",
"function",
"create",
"(",
"ExpressionInterface",
"$",
"expression",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"expression",
"instanceof",
"ConditionInterface",
")",
"{",
"return",
"new",
"ConditionBuilder",
"(",
"$",
"expression",
")",
";",
"}",
"elsei... | Create and return an instance of a specific expression builder.
@param ExpressionInterface|JoinInterface|ConditionInterface $expression
@return ConditionBuilder|JoinBuilder|NullBuilder | [
"Create",
"and",
"return",
"an",
"instance",
"of",
"a",
"specific",
"expression",
"builder",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/Factory/ExpressionBuilderFactory.php#L47-L61 |
237,016 | kyoya-de/php-job-runner | src/Kyoya/PhpJobRunner/StorageProvider/PhpSerialize.php | PhpSerialize.persist | public function persist($identifier, ParameterBagInterface $parameterBag)
{
$stateFilename = $this->getStateFilename($identifier);
if (!touch($stateFilename) || (file_exists($stateFilename) && !is_writable($stateFilename))) {
throw new IOException("State isn't writable!");
}
... | php | public function persist($identifier, ParameterBagInterface $parameterBag)
{
$stateFilename = $this->getStateFilename($identifier);
if (!touch($stateFilename) || (file_exists($stateFilename) && !is_writable($stateFilename))) {
throw new IOException("State isn't writable!");
}
... | [
"public",
"function",
"persist",
"(",
"$",
"identifier",
",",
"ParameterBagInterface",
"$",
"parameterBag",
")",
"{",
"$",
"stateFilename",
"=",
"$",
"this",
"->",
"getStateFilename",
"(",
"$",
"identifier",
")",
";",
"if",
"(",
"!",
"touch",
"(",
"$",
"st... | Puts the parameter bag to a persistent storage.
@param string $identifier
@param ParameterBagInterface $parameterBag
@throws IOException If the state file isn't writable.
@return void | [
"Puts",
"the",
"parameter",
"bag",
"to",
"a",
"persistent",
"storage",
"."
] | c161c1e391d857ecd19e256593ced671bc13f5ff | https://github.com/kyoya-de/php-job-runner/blob/c161c1e391d857ecd19e256593ced671bc13f5ff/src/Kyoya/PhpJobRunner/StorageProvider/PhpSerialize.php#L32-L40 |
237,017 | kyoya-de/php-job-runner | src/Kyoya/PhpJobRunner/StorageProvider/PhpSerialize.php | PhpSerialize.load | public function load($identifier, ParameterBagInterface $parameterBag)
{
$stateFilename = $this->getStateFilename($identifier);
if (!file_exists($stateFilename)) {
throw new IOException("State file {$stateFilename} doesn't exist!");
}
$stateFileContent = file_get_content... | php | public function load($identifier, ParameterBagInterface $parameterBag)
{
$stateFilename = $this->getStateFilename($identifier);
if (!file_exists($stateFilename)) {
throw new IOException("State file {$stateFilename} doesn't exist!");
}
$stateFileContent = file_get_content... | [
"public",
"function",
"load",
"(",
"$",
"identifier",
",",
"ParameterBagInterface",
"$",
"parameterBag",
")",
"{",
"$",
"stateFilename",
"=",
"$",
"this",
"->",
"getStateFilename",
"(",
"$",
"identifier",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
... | Loads the parameter bag from a persistent storage.
@param string $identifier
@param ParameterBagInterface $parameterBag
@throws IOException If state file doesn't exist.
@return void | [
"Loads",
"the",
"parameter",
"bag",
"from",
"a",
"persistent",
"storage",
"."
] | c161c1e391d857ecd19e256593ced671bc13f5ff | https://github.com/kyoya-de/php-job-runner/blob/c161c1e391d857ecd19e256593ced671bc13f5ff/src/Kyoya/PhpJobRunner/StorageProvider/PhpSerialize.php#L52-L62 |
237,018 | chemel/addic7ed-cli | src/Scrapper/Addic7edScrapper.php | Addic7edScrapper.parse | protected function parse($url)
{
$html = $this->get($url)->getBody()->getContents();
$parser = $this->getParser($html);
return $parser;
} | php | protected function parse($url)
{
$html = $this->get($url)->getBody()->getContents();
$parser = $this->getParser($html);
return $parser;
} | [
"protected",
"function",
"parse",
"(",
"$",
"url",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"url",
")",
"->",
"getBody",
"(",
")",
"->",
"getContents",
"(",
")",
";",
"$",
"parser",
"=",
"$",
"this",
"->",
"getParser",
"(",... | Parse HTML page
@param string url
@return Crawler parser | [
"Parse",
"HTML",
"page"
] | e10ff6f4a3a37151b9141f15c231ba480aa1c78c | https://github.com/chemel/addic7ed-cli/blob/e10ff6f4a3a37151b9141f15c231ba480aa1c78c/src/Scrapper/Addic7edScrapper.php#L68-L75 |
237,019 | mszewcz/php-light-framework | src/Db/MySQL/Query/Insert.php | Insert.into | public function into($table = null): Insert
{
$this->into = [];
if (!\is_string($table) && !\is_array($table)) {
throw new InvalidArgumentException('$table has to be an array or a string');
}
$this->into = $this->namesClass->parse($table, true);
return $this;
... | php | public function into($table = null): Insert
{
$this->into = [];
if (!\is_string($table) && !\is_array($table)) {
throw new InvalidArgumentException('$table has to be an array or a string');
}
$this->into = $this->namesClass->parse($table, true);
return $this;
... | [
"public",
"function",
"into",
"(",
"$",
"table",
"=",
"null",
")",
":",
"Insert",
"{",
"$",
"this",
"->",
"into",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"table",
")",
"&&",
"!",
"\\",
"is_array",
"(",
"$",
"table",
")"... | Adds table names for insert
@param mixed|null $table
@return Insert | [
"Adds",
"table",
"names",
"for",
"insert"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Db/MySQL/Query/Insert.php#L54-L63 |
237,020 | konservs/brilliant.framework | libraries/Items/BItemsItemRTree.php | BItemsItemRTree.getCollection | public function getCollection() {
$collectionName = $this->collectionName;
if(empty($collectionName)){
return NULL;
}
$collection = $collectionName::getInstance();
return $collection;
} | php | public function getCollection() {
$collectionName = $this->collectionName;
if(empty($collectionName)){
return NULL;
}
$collection = $collectionName::getInstance();
return $collection;
} | [
"public",
"function",
"getCollection",
"(",
")",
"{",
"$",
"collectionName",
"=",
"$",
"this",
"->",
"collectionName",
";",
"if",
"(",
"empty",
"(",
"$",
"collectionName",
")",
")",
"{",
"return",
"NULL",
";",
"}",
"$",
"collection",
"=",
"$",
"collectio... | Get collection of such elements
@return BItemsRTree | [
"Get",
"collection",
"of",
"such",
"elements"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Items/BItemsItemRTree.php#L49-L56 |
237,021 | konservs/brilliant.framework | libraries/Items/BItemsItemRTree.php | BItemsItemRTree.getfieldsvalues | protected function getfieldsvalues(&$qr_fields, &$qr_values) {
$qr_fields = array();
$qr_values = array();
parent::getfieldsvalues($qr_fields, $qr_values);
if (empty($this->{$this->parentKeyName})) {
$qr_fields[] = '`' . $this->parentKeyName . '`';
$qr_values[] = 'NULL';
} else {
$qr_fields[] = '`' ... | php | protected function getfieldsvalues(&$qr_fields, &$qr_values) {
$qr_fields = array();
$qr_values = array();
parent::getfieldsvalues($qr_fields, $qr_values);
if (empty($this->{$this->parentKeyName})) {
$qr_fields[] = '`' . $this->parentKeyName . '`';
$qr_values[] = 'NULL';
} else {
$qr_fields[] = '`' ... | [
"protected",
"function",
"getfieldsvalues",
"(",
"&",
"$",
"qr_fields",
",",
"&",
"$",
"qr_values",
")",
"{",
"$",
"qr_fields",
"=",
"array",
"(",
")",
";",
"$",
"qr_values",
"=",
"array",
"(",
")",
";",
"parent",
"::",
"getfieldsvalues",
"(",
"$",
"qr... | Get values of fields.
@param $qr_fields
@param $qr_values
@return bool | [
"Get",
"values",
"of",
"fields",
"."
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Items/BItemsItemRTree.php#L65-L87 |
237,022 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/InventoryItemController.php | InventoryItemController.newAction | public function newAction(Inventory $inventory)
{
$inventoryitem = new InventoryItem();
$inventoryitem->setInventory($inventory);
$form = $this->createForm(new InventoryItemType(), $inventoryitem);
return array(
'inventoryitem' => $inventoryitem,
'form' => $f... | php | public function newAction(Inventory $inventory)
{
$inventoryitem = new InventoryItem();
$inventoryitem->setInventory($inventory);
$form = $this->createForm(new InventoryItemType(), $inventoryitem);
return array(
'inventoryitem' => $inventoryitem,
'form' => $f... | [
"public",
"function",
"newAction",
"(",
"Inventory",
"$",
"inventory",
")",
"{",
"$",
"inventoryitem",
"=",
"new",
"InventoryItem",
"(",
")",
";",
"$",
"inventoryitem",
"->",
"setInventory",
"(",
"$",
"inventory",
")",
";",
"$",
"form",
"=",
"$",
"this",
... | Displays a form to create a new InventoryItem entity.
@Route("/inventory/{id}/new", name="stock_inventoryitem_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"InventoryItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/InventoryItemController.php#L72-L82 |
237,023 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/InventoryItemController.php | InventoryItemController.createAction | public function createAction(Request $request)
{
$inventoryitem = new InventoryItem();
$form = $this->createForm(new InventoryItemType(), $inventoryitem);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($inventor... | php | public function createAction(Request $request)
{
$inventoryitem = new InventoryItem();
$form = $this->createForm(new InventoryItemType(), $inventoryitem);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($inventor... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"inventoryitem",
"=",
"new",
"InventoryItem",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"InventoryItemType",
"(",
")",
",",
"$",
"inv... | Creates a new InventoryItem entity.
@Route("/create", name="stock_inventoryitem_create")
@Method("POST")
@Template("FlowerStockBundle:InventoryItem:new.html.twig") | [
"Creates",
"a",
"new",
"InventoryItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/InventoryItemController.php#L91-L107 |
237,024 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/InventoryItemController.php | InventoryItemController.editAction | public function editAction(InventoryItem $inventoryitem)
{
$editForm = $this->createForm(new InventoryItemType(), $inventoryitem, array(
'action' => $this->generateUrl('stock_inventoryitem_update', array('id' => $inventoryitem->getid())),
'method' => 'PUT',
));
$delet... | php | public function editAction(InventoryItem $inventoryitem)
{
$editForm = $this->createForm(new InventoryItemType(), $inventoryitem, array(
'action' => $this->generateUrl('stock_inventoryitem_update', array('id' => $inventoryitem->getid())),
'method' => 'PUT',
));
$delet... | [
"public",
"function",
"editAction",
"(",
"InventoryItem",
"$",
"inventoryitem",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"InventoryItemType",
"(",
")",
",",
"$",
"inventoryitem",
",",
"array",
"(",
"'action'",
"=>",
"$",
... | Displays a form to edit an existing InventoryItem entity.
@Route("/{id}/edit", name="stock_inventoryitem_edit", requirements={"id"="\d+"})
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"InventoryItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/InventoryItemController.php#L116-L129 |
237,025 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/InventoryItemController.php | InventoryItemController.updateAction | public function updateAction(InventoryItem $inventoryitem, Request $request)
{
$editForm = $this->createForm(new InventoryItemType(), $inventoryitem, array(
'action' => $this->generateUrl('stock_inventoryitem_update', array('id' => $inventoryitem->getid())),
'method' => 'PUT',
... | php | public function updateAction(InventoryItem $inventoryitem, Request $request)
{
$editForm = $this->createForm(new InventoryItemType(), $inventoryitem, array(
'action' => $this->generateUrl('stock_inventoryitem_update', array('id' => $inventoryitem->getid())),
'method' => 'PUT',
... | [
"public",
"function",
"updateAction",
"(",
"InventoryItem",
"$",
"inventoryitem",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"InventoryItemType",
"(",
")",
",",
"$",
"inventoryitem",
",",
"arr... | Edits an existing InventoryItem entity.
@Route("/{id}/update", name="stock_inventoryitem_update", requirements={"id"="\d+"})
@Method("PUT")
@Template("FlowerStockBundle:InventoryItem:edit.html.twig") | [
"Edits",
"an",
"existing",
"InventoryItem",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/InventoryItemController.php#L138-L156 |
237,026 | asika32764/joomla-framework-console | Descriptor/Text/TextDescriptorHelper.php | TextDescriptorHelper.describe | public function describe(AbstractCommand $command)
{
// Describe Options
$options = $command->getAllOptions();
$optionDescriptor = $this->getOptionDescriptor();
foreach ($options as $option)
{
$optionDescriptor->addItem($option);
}
$render['option'] = count($options) ? "\n\nOptions:\n\n" . ... | php | public function describe(AbstractCommand $command)
{
// Describe Options
$options = $command->getAllOptions();
$optionDescriptor = $this->getOptionDescriptor();
foreach ($options as $option)
{
$optionDescriptor->addItem($option);
}
$render['option'] = count($options) ? "\n\nOptions:\n\n" . ... | [
"public",
"function",
"describe",
"(",
"AbstractCommand",
"$",
"command",
")",
"{",
"// Describe Options",
"$",
"options",
"=",
"$",
"command",
"->",
"getAllOptions",
"(",
")",
";",
"$",
"optionDescriptor",
"=",
"$",
"this",
"->",
"getOptionDescriptor",
"(",
"... | Describe a command detail.
@param AbstractCommand $command The command to described.
@return string Return the described text.
@throws \RuntimeException
@since 1.0 | [
"Describe",
"a",
"command",
"detail",
"."
] | fe28cf9e1c694049e015121e2bd041268e814249 | https://github.com/asika32764/joomla-framework-console/blob/fe28cf9e1c694049e015121e2bd041268e814249/Descriptor/Text/TextDescriptorHelper.php#L55-L122 |
237,027 | matryoshka-model/rest-wrapper | library/Paginator/RestPaginatorAdapter.php | RestPaginatorAdapter.getItems | public function getItems($offset, $itemCountPerPage)
{
$cacheKey = $offset . '-' . $itemCountPerPage;
if (isset($this->preloadCache[$cacheKey])) {
return $this->preloadCache[$cacheKey];
}
return $this->loadItems($offset, $itemCountPerPage);
} | php | public function getItems($offset, $itemCountPerPage)
{
$cacheKey = $offset . '-' . $itemCountPerPage;
if (isset($this->preloadCache[$cacheKey])) {
return $this->preloadCache[$cacheKey];
}
return $this->loadItems($offset, $itemCountPerPage);
} | [
"public",
"function",
"getItems",
"(",
"$",
"offset",
",",
"$",
"itemCountPerPage",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"offset",
".",
"'-'",
".",
"$",
"itemCountPerPage",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"preloadCache",
"[",
"$",
"cac... | Returns an result set of items for a page
@param int $offset Page offset
@param int $itemCountPerPage Number of items per page
@return HydratingResultSet | [
"Returns",
"an",
"result",
"set",
"of",
"items",
"for",
"a",
"page"
] | a612f2a998f37717ac9fbddf3080ce275e4c8ade | https://github.com/matryoshka-model/rest-wrapper/blob/a612f2a998f37717ac9fbddf3080ce275e4c8ade/library/Paginator/RestPaginatorAdapter.php#L175-L184 |
237,028 | aedart/model | src/Traits/Strings/CardNumberTrait.php | CardNumberTrait.getCardNumber | public function getCardNumber() : ?string
{
if ( ! $this->hasCardNumber()) {
$this->setCardNumber($this->getDefaultCardNumber());
}
return $this->cardNumber;
} | php | public function getCardNumber() : ?string
{
if ( ! $this->hasCardNumber()) {
$this->setCardNumber($this->getDefaultCardNumber());
}
return $this->cardNumber;
} | [
"public",
"function",
"getCardNumber",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasCardNumber",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setCardNumber",
"(",
"$",
"this",
"->",
"getDefaultCardNumber",
"(",
")",
")",
";",
... | Get card number
If no "card number" value has been set, this method will
set and return a default "card number" value,
if any such value is available
@see getDefaultCardNumber()
@return string|null card number or null if no card number has been set | [
"Get",
"card",
"number"
] | 9a562c1c53a276d01ace0ab71f5305458bea542f | https://github.com/aedart/model/blob/9a562c1c53a276d01ace0ab71f5305458bea542f/src/Traits/Strings/CardNumberTrait.php#L48-L54 |
237,029 | razielsd/webdriverlib | WebDriver/WebDriver/Element.php | WebDriver_Element.getElementId | public function getElementId()
{
if ($this->elementId === null) {
$param = WebDriver_Util::parseLocator($this->locator);
$commandUri = (null === $this->parent) ? 'element' : "element/{$this->parent->getElementId()}/element";
$command = $this->driver->factoryCommand($comma... | php | public function getElementId()
{
if ($this->elementId === null) {
$param = WebDriver_Util::parseLocator($this->locator);
$commandUri = (null === $this->parent) ? 'element' : "element/{$this->parent->getElementId()}/element";
$command = $this->driver->factoryCommand($comma... | [
"public",
"function",
"getElementId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"elementId",
"===",
"null",
")",
"{",
"$",
"param",
"=",
"WebDriver_Util",
"::",
"parseLocator",
"(",
"$",
"this",
"->",
"locator",
")",
";",
"$",
"commandUri",
"=",
"("... | Get element Id from webdriver
@return int
@throws WebDriver_Exception | [
"Get",
"element",
"Id",
"from",
"webdriver"
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver/Element.php#L84-L104 |
237,030 | razielsd/webdriverlib | WebDriver/WebDriver/Element.php | WebDriver_Element.tagName | public function tagName()
{
if (!$this->state['tagName']) {
$result = $this->sendCommand('element/:id/name', WebDriver_Command::METHOD_GET);
$this->state['tagName'] = strtolower($result['value']);
}
return $this->state['tagName'];
} | php | public function tagName()
{
if (!$this->state['tagName']) {
$result = $this->sendCommand('element/:id/name', WebDriver_Command::METHOD_GET);
$this->state['tagName'] = strtolower($result['value']);
}
return $this->state['tagName'];
} | [
"public",
"function",
"tagName",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"state",
"[",
"'tagName'",
"]",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"sendCommand",
"(",
"'element/:id/name'",
",",
"WebDriver_Command",
"::",
"METHOD_GET",
")... | Get element tag name
@return mixed | [
"Get",
"element",
"tag",
"name"
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver/Element.php#L395-L402 |
237,031 | razielsd/webdriverlib | WebDriver/WebDriver/Element.php | WebDriver_Element.location | public function location()
{
$result = $this->sendCommand('element/:id/location', WebDriver_Command::METHOD_GET);
$value = $result['value'];
return ['x' => $value['x'], 'y' => $value['y']];
} | php | public function location()
{
$result = $this->sendCommand('element/:id/location', WebDriver_Command::METHOD_GET);
$value = $result['value'];
return ['x' => $value['x'], 'y' => $value['y']];
} | [
"public",
"function",
"location",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"sendCommand",
"(",
"'element/:id/location'",
",",
"WebDriver_Command",
"::",
"METHOD_GET",
")",
";",
"$",
"value",
"=",
"$",
"result",
"[",
"'value'",
"]",
";",
"retur... | Get element upper-left corner of the page | [
"Get",
"element",
"upper",
"-",
"left",
"corner",
"of",
"the",
"page"
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver/Element.php#L474-L479 |
237,032 | ricardoh/wurfl-php-api | WURFL/Request/UserAgentNormalizer/Specific/Chrome.php | WURFL_Request_UserAgentNormalizer_Specific_Chrome.chromeWithMajorVersion | private function chromeWithMajorVersion($userAgent) {
$start_idx = strpos($userAgent, 'Chrome');
$end_idx = strpos($userAgent, '.', $start_idx);
if ($end_idx === false) {
return substr($userAgent, $start_idx);
} else {
return substr($userAgent, $start_idx, ($end_idx - $start_idx));
}
} | php | private function chromeWithMajorVersion($userAgent) {
$start_idx = strpos($userAgent, 'Chrome');
$end_idx = strpos($userAgent, '.', $start_idx);
if ($end_idx === false) {
return substr($userAgent, $start_idx);
} else {
return substr($userAgent, $start_idx, ($end_idx - $start_idx));
}
} | [
"private",
"function",
"chromeWithMajorVersion",
"(",
"$",
"userAgent",
")",
"{",
"$",
"start_idx",
"=",
"strpos",
"(",
"$",
"userAgent",
",",
"'Chrome'",
")",
";",
"$",
"end_idx",
"=",
"strpos",
"(",
"$",
"userAgent",
",",
"'.'",
",",
"$",
"start_idx",
... | Returns Google Chrome's Major version number
@param string $userAgent
@return string|int Version number | [
"Returns",
"Google",
"Chrome",
"s",
"Major",
"version",
"number"
] | 1aa6c8af5b4c34ce3b37407c5eeb6fb41e5f3546 | https://github.com/ricardoh/wurfl-php-api/blob/1aa6c8af5b4c34ce3b37407c5eeb6fb41e5f3546/WURFL/Request/UserAgentNormalizer/Specific/Chrome.php#L34-L42 |
237,033 | laravelflare/cms | src/Cms/Tree/TreeManager.php | TreeManager.findOrFail | public function findOrFail($fullslug)
{
if (!$tree = $this->find($fullslug)) {
throw (new ModelNotFoundException)->setModel(Tree::class);
}
return $tree;
} | php | public function findOrFail($fullslug)
{
if (!$tree = $this->find($fullslug)) {
throw (new ModelNotFoundException)->setModel(Tree::class);
}
return $tree;
} | [
"public",
"function",
"findOrFail",
"(",
"$",
"fullslug",
")",
"{",
"if",
"(",
"!",
"$",
"tree",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"fullslug",
")",
")",
"{",
"throw",
"(",
"new",
"ModelNotFoundException",
")",
"->",
"setModel",
"(",
"Tree",
"... | Find a Tree Item by Slug or throw an exception.
@param string $fullslug
@return \LaravelFlare\Cms\Tree\Tree
@throws \Illuminate\Database\Eloquent\ModelNotFoundException | [
"Find",
"a",
"Tree",
"Item",
"by",
"Slug",
"or",
"throw",
"an",
"exception",
"."
] | fe94b922c5b1232ea7ab63abd47dbbe34e47ad2f | https://github.com/laravelflare/cms/blob/fe94b922c5b1232ea7ab63abd47dbbe34e47ad2f/src/Cms/Tree/TreeManager.php#L48-L55 |
237,034 | glynnforrest/speedy-config | src/Processor/ReferenceProcessor.php | ReferenceProcessor.resolveValue | protected function resolveValue(Config $config, $key)
{
$value = $config->getRequired($key);
if (is_array($value)) {
throw new KeyException(sprintf('Referenced configuration key "%s" must not be an array.', $key));
}
if (in_array($key, $this->referenceStack)) {
... | php | protected function resolveValue(Config $config, $key)
{
$value = $config->getRequired($key);
if (is_array($value)) {
throw new KeyException(sprintf('Referenced configuration key "%s" must not be an array.', $key));
}
if (in_array($key, $this->referenceStack)) {
... | [
"protected",
"function",
"resolveValue",
"(",
"Config",
"$",
"config",
",",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"$",
"config",
"->",
"getRequired",
"(",
"$",
"key",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"n... | Resolve a configuration value by replacing any %tokens% with
their substituted values.
@param Config $config
@param string $key | [
"Resolve",
"a",
"configuration",
"value",
"by",
"replacing",
"any",
"%tokens%",
"with",
"their",
"substituted",
"values",
"."
] | 613995cd89b6212f2beca50f646a36a08e4dcaf7 | https://github.com/glynnforrest/speedy-config/blob/613995cd89b6212f2beca50f646a36a08e4dcaf7/src/Processor/ReferenceProcessor.php#L37-L61 |
237,035 | kevindierkx/elicit | src/Connector/BasicAuthConnector.php | BasicAuthConnector.connect | public function connect(array $config)
{
$connection = $this->createConnection($config);
$this->validateCredentials($config);
// For basic authentication we need an Authorization
// header to be set. We add it to the request here.
$this->addHeader(
'Authorizatio... | php | public function connect(array $config)
{
$connection = $this->createConnection($config);
$this->validateCredentials($config);
// For basic authentication we need an Authorization
// header to be set. We add it to the request here.
$this->addHeader(
'Authorizatio... | [
"public",
"function",
"connect",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"createConnection",
"(",
"$",
"config",
")",
";",
"$",
"this",
"->",
"validateCredentials",
"(",
"$",
"config",
")",
";",
"// For basic authe... | Establish an API connection.
@param array $config
@return self | [
"Establish",
"an",
"API",
"connection",
"."
] | c277942f5f5f63b175bc37e9d392faa946888f65 | https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Connector/BasicAuthConnector.php#L15-L31 |
237,036 | nachonerd/silex_finder_provider | src/Extensions/Finder.php | Finder.sortByNameDesc | public function sortByNameDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return strcmp($b->getRealpath(), $a->getRealpath());
}
);
return $this;
} | php | public function sortByNameDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return strcmp($b->getRealpath(), $a->getRealpath());
}
);
return $this;
} | [
"public",
"function",
"sortByNameDesc",
"(",
")",
"{",
"$",
"this",
"->",
"sort",
"(",
"function",
"(",
"SplFileInfo",
"$",
"a",
",",
"SplFileInfo",
"$",
"b",
")",
"{",
"return",
"strcmp",
"(",
"$",
"b",
"->",
"getRealpath",
"(",
")",
",",
"$",
"a",
... | Sorts files and directories by name DESC.
This can be slow as all the matching files and directories must
be retrieved for comparison.
@return Finder The current Finder instance
@see SortableIterator
@api | [
"Sorts",
"files",
"and",
"directories",
"by",
"name",
"DESC",
"."
] | 4956c471a2a63ae3fa29bd035311c6dafba7d0b7 | https://github.com/nachonerd/silex_finder_provider/blob/4956c471a2a63ae3fa29bd035311c6dafba7d0b7/src/Extensions/Finder.php#L58-L66 |
237,037 | nachonerd/silex_finder_provider | src/Extensions/Finder.php | Finder.sortByAccessedTimeDesc | public function sortByAccessedTimeDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return ($b->getATime() - $a->getATime());
}
);
return $this;
} | php | public function sortByAccessedTimeDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return ($b->getATime() - $a->getATime());
}
);
return $this;
} | [
"public",
"function",
"sortByAccessedTimeDesc",
"(",
")",
"{",
"$",
"this",
"->",
"sort",
"(",
"function",
"(",
"SplFileInfo",
"$",
"a",
",",
"SplFileInfo",
"$",
"b",
")",
"{",
"return",
"(",
"$",
"b",
"->",
"getATime",
"(",
")",
"-",
"$",
"a",
"->",... | Sorts files and directories by the last accessed time desc.
This is the time that the file was last accessed, read or written to.
This can be slow as all the matching files and directories must be
retrieved for comparison.
@return Finder The current Finder instance
@see SortableIterator
@api | [
"Sorts",
"files",
"and",
"directories",
"by",
"the",
"last",
"accessed",
"time",
"desc",
"."
] | 4956c471a2a63ae3fa29bd035311c6dafba7d0b7 | https://github.com/nachonerd/silex_finder_provider/blob/4956c471a2a63ae3fa29bd035311c6dafba7d0b7/src/Extensions/Finder.php#L111-L119 |
237,038 | nachonerd/silex_finder_provider | src/Extensions/Finder.php | Finder.sortByChangedTimeDesc | public function sortByChangedTimeDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return ($b->getCTime() - $a->getCTime());
}
);
return $this;
} | php | public function sortByChangedTimeDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return ($b->getCTime() - $a->getCTime());
}
);
return $this;
} | [
"public",
"function",
"sortByChangedTimeDesc",
"(",
")",
"{",
"$",
"this",
"->",
"sort",
"(",
"function",
"(",
"SplFileInfo",
"$",
"a",
",",
"SplFileInfo",
"$",
"b",
")",
"{",
"return",
"(",
"$",
"b",
"->",
"getCTime",
"(",
")",
"-",
"$",
"a",
"->",
... | Sorts files and directories by the last inode changed time Desc.
This is the time that the inode information was last modified
(permissions, owner, group or other metadata).
On Windows, since inode is not available, changed time is actually the
file creation time.
This can be slow as all the matching files and direc... | [
"Sorts",
"files",
"and",
"directories",
"by",
"the",
"last",
"inode",
"changed",
"time",
"Desc",
"."
] | 4956c471a2a63ae3fa29bd035311c6dafba7d0b7 | https://github.com/nachonerd/silex_finder_provider/blob/4956c471a2a63ae3fa29bd035311c6dafba7d0b7/src/Extensions/Finder.php#L139-L147 |
237,039 | nachonerd/silex_finder_provider | src/Extensions/Finder.php | Finder.sortByModifiedTimeDesc | public function sortByModifiedTimeDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return ($b->getMTime() - $a->getMTime());
}
);
return $this;
} | php | public function sortByModifiedTimeDesc()
{
$this->sort(
function (SplFileInfo $a, SplFileInfo $b) {
return ($b->getMTime() - $a->getMTime());
}
);
return $this;
} | [
"public",
"function",
"sortByModifiedTimeDesc",
"(",
")",
"{",
"$",
"this",
"->",
"sort",
"(",
"function",
"(",
"SplFileInfo",
"$",
"a",
",",
"SplFileInfo",
"$",
"b",
")",
"{",
"return",
"(",
"$",
"b",
"->",
"getMTime",
"(",
")",
"-",
"$",
"a",
"->",... | Sorts files and directories by the last modified time Desc.
This is the last time the actual contents of the file were
last modified.
This can be slow as all the matching files and directories must be
retrieved for comparison.
@return Finder The current Finder instance
@see SortableIterator
@api | [
"Sorts",
"files",
"and",
"directories",
"by",
"the",
"last",
"modified",
"time",
"Desc",
"."
] | 4956c471a2a63ae3fa29bd035311c6dafba7d0b7 | https://github.com/nachonerd/silex_finder_provider/blob/4956c471a2a63ae3fa29bd035311c6dafba7d0b7/src/Extensions/Finder.php#L164-L172 |
237,040 | nachonerd/silex_finder_provider | src/Extensions/Finder.php | Finder.getNFirst | public function getNFirst($n)
{
$it = new \ArrayIterator();
$j = 0;
foreach ($this as $file) {
if ($j == $n) {
break;
}
$j++;
$it->append($file);
}
$finder = new static();
$finder->append($it);
... | php | public function getNFirst($n)
{
$it = new \ArrayIterator();
$j = 0;
foreach ($this as $file) {
if ($j == $n) {
break;
}
$j++;
$it->append($file);
}
$finder = new static();
$finder->append($it);
... | [
"public",
"function",
"getNFirst",
"(",
"$",
"n",
")",
"{",
"$",
"it",
"=",
"new",
"\\",
"ArrayIterator",
"(",
")",
";",
"$",
"j",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"j",
"==",
"$",
"n",
... | Get First N Files or Dirs
@param integer $n Umpteenth Number
@return Return a new Finder instance
@see SortableIterator
@api | [
"Get",
"First",
"N",
"Files",
"or",
"Dirs"
] | 4956c471a2a63ae3fa29bd035311c6dafba7d0b7 | https://github.com/nachonerd/silex_finder_provider/blob/4956c471a2a63ae3fa29bd035311c6dafba7d0b7/src/Extensions/Finder.php#L185-L201 |
237,041 | weew/app-monolog | src/Weew/App/Monolog/MonologChannelManager.php | MonologChannelManager.getAllLoggers | public function getAllLoggers() {
// instantiate all loggers
foreach ($this->config->getChannelConfigs() as $name => $config) {
$this->getLogger($name);
}
return $this->getLoggers();
} | php | public function getAllLoggers() {
// instantiate all loggers
foreach ($this->config->getChannelConfigs() as $name => $config) {
$this->getLogger($name);
}
return $this->getLoggers();
} | [
"public",
"function",
"getAllLoggers",
"(",
")",
"{",
"// instantiate all loggers",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"getChannelConfigs",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
"$"... | Get all registered loggers. Instantiate if necessary.
@return Logger[]
@throws UndefinedChannelException | [
"Get",
"all",
"registered",
"loggers",
".",
"Instantiate",
"if",
"necessary",
"."
] | 8bb5c502900736d961b735b664e0f365b87dce3d | https://github.com/weew/app-monolog/blob/8bb5c502900736d961b735b664e0f365b87dce3d/src/Weew/App/Monolog/MonologChannelManager.php#L80-L87 |
237,042 | aedart/model | src/Traits/Strings/InvoiceAddressTrait.php | InvoiceAddressTrait.getInvoiceAddress | public function getInvoiceAddress() : ?string
{
if ( ! $this->hasInvoiceAddress()) {
$this->setInvoiceAddress($this->getDefaultInvoiceAddress());
}
return $this->invoiceAddress;
} | php | public function getInvoiceAddress() : ?string
{
if ( ! $this->hasInvoiceAddress()) {
$this->setInvoiceAddress($this->getDefaultInvoiceAddress());
}
return $this->invoiceAddress;
} | [
"public",
"function",
"getInvoiceAddress",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasInvoiceAddress",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setInvoiceAddress",
"(",
"$",
"this",
"->",
"getDefaultInvoiceAddress",
"(",
")",
... | Get invoice address
If no "invoice address" value has been set, this method will
set and return a default "invoice address" value,
if any such value is available
@see getDefaultInvoiceAddress()
@return string|null invoice address or null if no invoice address has been set | [
"Get",
"invoice",
"address"
] | 9a562c1c53a276d01ace0ab71f5305458bea542f | https://github.com/aedart/model/blob/9a562c1c53a276d01ace0ab71f5305458bea542f/src/Traits/Strings/InvoiceAddressTrait.php#L48-L54 |
237,043 | interactivesolutions/honeycomb-pages | src/app/http/controllers/HCPagesController.php | HCPagesController.options | public function options()
{
if (request()->has('language')) {
$pages = HCPagesTranslations::select('record_id as id', 'title', 'language_code')
->where('language_code', request('language'));
if (request()->has('type')) {
$pages->whereHas('record', fun... | php | public function options()
{
if (request()->has('language')) {
$pages = HCPagesTranslations::select('record_id as id', 'title', 'language_code')
->where('language_code', request('language'));
if (request()->has('type')) {
$pages->whereHas('record', fun... | [
"public",
"function",
"options",
"(",
")",
"{",
"if",
"(",
"request",
"(",
")",
"->",
"has",
"(",
"'language'",
")",
")",
"{",
"$",
"pages",
"=",
"HCPagesTranslations",
"::",
"select",
"(",
"'record_id as id'",
",",
"'title'",
",",
"'language_code'",
")",
... | Get options by request data
@return array | [
"Get",
"options",
"by",
"request",
"data"
] | f628e4df80589f6e86099fb2d4fcf0fc520e8228 | https://github.com/interactivesolutions/honeycomb-pages/blob/f628e4df80589f6e86099fb2d4fcf0fc520e8228/src/app/http/controllers/HCPagesController.php#L310-L330 |
237,044 | crater-framework/crater-php-framework | Error.php | Error.indexAction | public function indexAction()
{
header("HTTP/1.0 404 Not Found");
$data['title'] = '404';
$data['error'] = $this->_error;
$this->view->render('error/404', $data);
} | php | public function indexAction()
{
header("HTTP/1.0 404 Not Found");
$data['title'] = '404';
$data['error'] = $this->_error;
$this->view->render('error/404', $data);
} | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"header",
"(",
"\"HTTP/1.0 404 Not Found\"",
")",
";",
"$",
"data",
"[",
"'title'",
"]",
"=",
"'404'",
";",
"$",
"data",
"[",
"'error'",
"]",
"=",
"$",
"this",
"->",
"_error",
";",
"$",
"this",
"->",
... | 404 page Action
load a 404 page with the error message | [
"404",
"page",
"Action",
"load",
"a",
"404",
"page",
"with",
"the",
"error",
"message"
] | ff7a4f69f8ee7beb37adee348b67d1be84c51ff1 | https://github.com/crater-framework/crater-php-framework/blob/ff7a4f69f8ee7beb37adee348b67d1be84c51ff1/Error.php#L31-L40 |
237,045 | osflab/controller | Request.php | Request.getUri | public function getUri($withBaseUrl = false)
{
$prefix = $withBaseUrl ? $this->getBaseUrl() : '';
$uri = $prefix . $this->uri;
$uri = '/' . ltrim($uri, '/');
return $uri;
} | php | public function getUri($withBaseUrl = false)
{
$prefix = $withBaseUrl ? $this->getBaseUrl() : '';
$uri = $prefix . $this->uri;
$uri = '/' . ltrim($uri, '/');
return $uri;
} | [
"public",
"function",
"getUri",
"(",
"$",
"withBaseUrl",
"=",
"false",
")",
"{",
"$",
"prefix",
"=",
"$",
"withBaseUrl",
"?",
"$",
"this",
"->",
"getBaseUrl",
"(",
")",
":",
"''",
";",
"$",
"uri",
"=",
"$",
"prefix",
".",
"$",
"this",
"->",
"uri",
... | Get URI without baseurl
@return string
@task [URI] Voir comment gérer le baseUrl '/' | [
"Get",
"URI",
"without",
"baseurl"
] | d59344fc204a74995224e3da39b9debd78fdb974 | https://github.com/osflab/controller/blob/d59344fc204a74995224e3da39b9debd78fdb974/Request.php#L36-L42 |
237,046 | osflab/controller | Request.php | Request.getParams | public function getParams($withActionParams = false)
{
return $withActionParams ? array_merge($this->actionParams, $this->params) : $this->params;
} | php | public function getParams($withActionParams = false)
{
return $withActionParams ? array_merge($this->actionParams, $this->params) : $this->params;
} | [
"public",
"function",
"getParams",
"(",
"$",
"withActionParams",
"=",
"false",
")",
"{",
"return",
"$",
"withActionParams",
"?",
"array_merge",
"(",
"$",
"this",
"->",
"actionParams",
",",
"$",
"this",
"->",
"params",
")",
":",
"$",
"this",
"->",
"params",... | Get current params
@return multitype: | [
"Get",
"current",
"params"
] | d59344fc204a74995224e3da39b9debd78fdb974 | https://github.com/osflab/controller/blob/d59344fc204a74995224e3da39b9debd78fdb974/Request.php#L77-L80 |
237,047 | osflab/controller | Request.php | Request.getParam | public function getParam(string $key)
{
$isActionParam = in_array($key, [self::PARAM_CONTROLLER, self::PARAM_ACTION]);
$params = $isActionParam ? $this->actionParams: $this->params;
return array_key_exists($key, $params) ? $params[$key] : null;
} | php | public function getParam(string $key)
{
$isActionParam = in_array($key, [self::PARAM_CONTROLLER, self::PARAM_ACTION]);
$params = $isActionParam ? $this->actionParams: $this->params;
return array_key_exists($key, $params) ? $params[$key] : null;
} | [
"public",
"function",
"getParam",
"(",
"string",
"$",
"key",
")",
"{",
"$",
"isActionParam",
"=",
"in_array",
"(",
"$",
"key",
",",
"[",
"self",
"::",
"PARAM_CONTROLLER",
",",
"self",
"::",
"PARAM_ACTION",
"]",
")",
";",
"$",
"params",
"=",
"$",
"isAct... | Get param value. Get action param if key = controller or action
@param string $key
@return string|null | [
"Get",
"param",
"value",
".",
"Get",
"action",
"param",
"if",
"key",
"=",
"controller",
"or",
"action"
] | d59344fc204a74995224e3da39b9debd78fdb974 | https://github.com/osflab/controller/blob/d59344fc204a74995224e3da39b9debd78fdb974/Request.php#L87-L92 |
237,048 | codebobbly/dvoconnector | Classes/Domain/Filter/GenericFilter.php | GenericFilter.getURLQuery | public function getURLQuery()
{
$qstr = '?';
$params = $this->getParametersArray();
$paramCount = count($params);
$i = 0;
foreach ($params as $key => $value) {
if ($value === null) {
continue;
}
$qstr .= $key . '=' . rawu... | php | public function getURLQuery()
{
$qstr = '?';
$params = $this->getParametersArray();
$paramCount = count($params);
$i = 0;
foreach ($params as $key => $value) {
if ($value === null) {
continue;
}
$qstr .= $key . '=' . rawu... | [
"public",
"function",
"getURLQuery",
"(",
")",
"{",
"$",
"qstr",
"=",
"'?'",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"getParametersArray",
"(",
")",
";",
"$",
"paramCount",
"=",
"count",
"(",
"$",
"params",
")",
";",
"$",
"i",
"=",
"0",
";",
... | Builds a query string from an array and takes care of proper url-encoding
@return string Query string including the '?' | [
"Builds",
"a",
"query",
"string",
"from",
"an",
"array",
"and",
"takes",
"care",
"of",
"proper",
"url",
"-",
"encoding"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Domain/Filter/GenericFilter.php#L26-L49 |
237,049 | marando/phpSOFA | src/Marando/IAU/iauGst06.php | iauGst06.Gst06 | public static function Gst06($uta, $utb, $tta, $ttb, array $rnpb) {
$x;
$y;
$s;
$era;
$eors;
$gst;
/* Extract CIP coordinates. */
IAU::Bpn2xy($rnpb, $x, $y);
/* The CIO locator, s. */
$s = IAU::S06($tta, $ttb, $x, $y);
/* Greenwich apparent sidereal time. */
$era = IA... | php | public static function Gst06($uta, $utb, $tta, $ttb, array $rnpb) {
$x;
$y;
$s;
$era;
$eors;
$gst;
/* Extract CIP coordinates. */
IAU::Bpn2xy($rnpb, $x, $y);
/* The CIO locator, s. */
$s = IAU::S06($tta, $ttb, $x, $y);
/* Greenwich apparent sidereal time. */
$era = IA... | [
"public",
"static",
"function",
"Gst06",
"(",
"$",
"uta",
",",
"$",
"utb",
",",
"$",
"tta",
",",
"$",
"ttb",
",",
"array",
"$",
"rnpb",
")",
"{",
"$",
"x",
";",
"$",
"y",
";",
"$",
"s",
";",
"$",
"era",
";",
"$",
"eors",
";",
"$",
"gst",
... | - - - - - - - - -
i a u G s t 0 6
- - - - - - - - -
Greenwich apparent sidereal time, IAU 2006, given the NPB matrix.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: support function.
Given:
uta,utb double UT1 as a 2-par... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"G",
"s",
"t",
"0",
"6",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauGst06.php#L80-L100 |
237,050 | DevGroup-ru/yii2-admin-utils | src/traits/BackendRedirect.php | BackendRedirect.redirectUser | public function redirectUser(
$id,
$setFlash = true,
$indexAction = ['index'],
$editAction = ['edit'],
$overrideReturnUrl = false
) {
/** @var \yii\web\Controller $this */
if ($setFlash === true) {
Yii::$app->session->setFlash('success', AdminModul... | php | public function redirectUser(
$id,
$setFlash = true,
$indexAction = ['index'],
$editAction = ['edit'],
$overrideReturnUrl = false
) {
/** @var \yii\web\Controller $this */
if ($setFlash === true) {
Yii::$app->session->setFlash('success', AdminModul... | [
"public",
"function",
"redirectUser",
"(",
"$",
"id",
",",
"$",
"setFlash",
"=",
"true",
",",
"$",
"indexAction",
"=",
"[",
"'index'",
"]",
",",
"$",
"editAction",
"=",
"[",
"'edit'",
"]",
",",
"$",
"overrideReturnUrl",
"=",
"false",
")",
"{",
"/** @va... | Redirects user as was specified by his action and returnUrl variable on successful record saving.
@param string|integer $id Id of model
@param bool|string $setFlash True if set standard flash, string for custom flash, false for not setting any flash
@param array $indexAction URL route array to index action, must inclu... | [
"Redirects",
"user",
"as",
"was",
"specified",
"by",
"his",
"action",
"and",
"returnUrl",
"variable",
"on",
"successful",
"record",
"saving",
"."
] | 15c1853a5ec264602de3ad82dbf70f85de66adff | https://github.com/DevGroup-ru/yii2-admin-utils/blob/15c1853a5ec264602de3ad82dbf70f85de66adff/src/traits/BackendRedirect.php#L32-L69 |
237,051 | Kagency/http-replay | src/Kagency/HttpReplay/MessageHandler/Symfony2.php | Symfony2.convertFromRequest | public function convertFromRequest(SimplifiedRequest $request)
{
return Request::create(
$request->path,
$request->method,
array(),
array(),
array(),
$this->mapHeaderKeys($request->headers),
$request->content
);
... | php | public function convertFromRequest(SimplifiedRequest $request)
{
return Request::create(
$request->path,
$request->method,
array(),
array(),
array(),
$this->mapHeaderKeys($request->headers),
$request->content
);
... | [
"public",
"function",
"convertFromRequest",
"(",
"SimplifiedRequest",
"$",
"request",
")",
"{",
"return",
"Request",
"::",
"create",
"(",
"$",
"request",
"->",
"path",
",",
"$",
"request",
"->",
"method",
",",
"array",
"(",
")",
",",
"array",
"(",
")",
"... | Convert from simplified request
Converts a simplified request into the request structure you need for
your current framework.
@param SimplifiedRequest $request
@return mixed | [
"Convert",
"from",
"simplified",
"request"
] | 333bcc553f0e79fc1e21f645f6eda7cc65e4f1e5 | https://github.com/Kagency/http-replay/blob/333bcc553f0e79fc1e21f645f6eda7cc65e4f1e5/src/Kagency/HttpReplay/MessageHandler/Symfony2.php#L23-L34 |
237,052 | Kagency/http-replay | src/Kagency/HttpReplay/MessageHandler/Symfony2.php | Symfony2.mapHeaderKeys | protected function mapHeaderKeys(array $headers)
{
$phpHeaders = array();
foreach ($headers as $key => $value) {
$phpHeaders['HTTP_' . str_replace('-', '_', strtoupper($key))] = $value;
}
return $phpHeaders;
} | php | protected function mapHeaderKeys(array $headers)
{
$phpHeaders = array();
foreach ($headers as $key => $value) {
$phpHeaders['HTTP_' . str_replace('-', '_', strtoupper($key))] = $value;
}
return $phpHeaders;
} | [
"protected",
"function",
"mapHeaderKeys",
"(",
"array",
"$",
"headers",
")",
"{",
"$",
"phpHeaders",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"phpHeaders",
"[",
"'HTTP_'",
".",
... | Map header keys
@param array $headers
@return array | [
"Map",
"header",
"keys"
] | 333bcc553f0e79fc1e21f645f6eda7cc65e4f1e5 | https://github.com/Kagency/http-replay/blob/333bcc553f0e79fc1e21f645f6eda7cc65e4f1e5/src/Kagency/HttpReplay/MessageHandler/Symfony2.php#L42-L50 |
237,053 | Kagency/http-replay | src/Kagency/HttpReplay/MessageHandler/Symfony2.php | Symfony2.convertFromResponse | public function convertFromResponse(SimplifiedResponse $response)
{
return Response::create(
$response->content,
$response->status,
$response->headers
);
} | php | public function convertFromResponse(SimplifiedResponse $response)
{
return Response::create(
$response->content,
$response->status,
$response->headers
);
} | [
"public",
"function",
"convertFromResponse",
"(",
"SimplifiedResponse",
"$",
"response",
")",
"{",
"return",
"Response",
"::",
"create",
"(",
"$",
"response",
"->",
"content",
",",
"$",
"response",
"->",
"status",
",",
"$",
"response",
"->",
"headers",
")",
... | Convert from simplified response
Converts a simplified response into the response structure you need for
your current framework.
@param SimplifiedResponse $response
@return mixed | [
"Convert",
"from",
"simplified",
"response"
] | 333bcc553f0e79fc1e21f645f6eda7cc65e4f1e5 | https://github.com/Kagency/http-replay/blob/333bcc553f0e79fc1e21f645f6eda7cc65e4f1e5/src/Kagency/HttpReplay/MessageHandler/Symfony2.php#L61-L68 |
237,054 | mgufrone/silex-assets-provider | src/Gufy/Service/Provider/AssetsMinifier.php | AssetsMinifier.compress | public function compress($type, $files, $file)
{
// files have been updated so update the minified file
if($this->isUpdated($files))
{
$content = $this->getFileContents($files);
switch($type){
case 'css':
$content = $this->minifyCSS($content);
break;
case 'js':
$content = $this->mini... | php | public function compress($type, $files, $file)
{
// files have been updated so update the minified file
if($this->isUpdated($files))
{
$content = $this->getFileContents($files);
switch($type){
case 'css':
$content = $this->minifyCSS($content);
break;
case 'js':
$content = $this->mini... | [
"public",
"function",
"compress",
"(",
"$",
"type",
",",
"$",
"files",
",",
"$",
"file",
")",
"{",
"// files have been updated so update the minified file",
"if",
"(",
"$",
"this",
"->",
"isUpdated",
"(",
"$",
"files",
")",
")",
"{",
"$",
"content",
"=",
"... | get all contents and process the whole contents
@param string $type compress by type
@param array $files files that will be compressed
@param string $file
@return string return cache url of | [
"get",
"all",
"contents",
"and",
"process",
"the",
"whole",
"contents"
] | 072ca09f997225f1f298ca5f77dc23280dd6aa7a | https://github.com/mgufrone/silex-assets-provider/blob/072ca09f997225f1f298ca5f77dc23280dd6aa7a/src/Gufy/Service/Provider/AssetsMinifier.php#L96-L113 |
237,055 | mgufrone/silex-assets-provider | src/Gufy/Service/Provider/AssetsMinifier.php | AssetsMinifier.getFileContents | private function getFileContents($files)
{
$content = '';
$basePath = $this->basePath;
array_walk($files,function(&$value, $key) use(&$content, $basePath){
if(file_exists($basePath.$value))
$content .= file_get_contents($basePath.$value);
});
return $content;
} | php | private function getFileContents($files)
{
$content = '';
$basePath = $this->basePath;
array_walk($files,function(&$value, $key) use(&$content, $basePath){
if(file_exists($basePath.$value))
$content .= file_get_contents($basePath.$value);
});
return $content;
} | [
"private",
"function",
"getFileContents",
"(",
"$",
"files",
")",
"{",
"$",
"content",
"=",
"''",
";",
"$",
"basePath",
"=",
"$",
"this",
"->",
"basePath",
";",
"array_walk",
"(",
"$",
"files",
",",
"function",
"(",
"&",
"$",
"value",
",",
"$",
"key"... | get contents of all registered files, it is also check whether file is exist or not
@param array $files all files that will be retrieved
@return strign return mixed of all contents | [
"get",
"contents",
"of",
"all",
"registered",
"files",
"it",
"is",
"also",
"check",
"whether",
"file",
"is",
"exist",
"or",
"not"
] | 072ca09f997225f1f298ca5f77dc23280dd6aa7a | https://github.com/mgufrone/silex-assets-provider/blob/072ca09f997225f1f298ca5f77dc23280dd6aa7a/src/Gufy/Service/Provider/AssetsMinifier.php#L154-L164 |
237,056 | douyacun/dyc-pay-supports | src/Traits/HasHttpRequest.php | HasHttpRequest.getBaseOptions | protected function getBaseOptions()
{
$options = [
'base_uri' => property_exists($this, 'baseUri') ? $this->baseUri : '',
'timeout' => property_exists($this, 'timeout') ? $this->timeout : 5.0,
'connect_timeout' => property_exists($this, 'connect_timeout'... | php | protected function getBaseOptions()
{
$options = [
'base_uri' => property_exists($this, 'baseUri') ? $this->baseUri : '',
'timeout' => property_exists($this, 'timeout') ? $this->timeout : 5.0,
'connect_timeout' => property_exists($this, 'connect_timeout'... | [
"protected",
"function",
"getBaseOptions",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"'base_uri'",
"=>",
"property_exists",
"(",
"$",
"this",
",",
"'baseUri'",
")",
"?",
"$",
"this",
"->",
"baseUri",
":",
"''",
",",
"'timeout'",
"=>",
"property_exists",
"("... | Get base options.
@author yansongda <me@yansongda.cn>
@return array | [
"Get",
"base",
"options",
"."
] | d676c7f0b8ac2da2954b4b76448af18c9953381e | https://github.com/douyacun/dyc-pay-supports/blob/d676c7f0b8ac2da2954b4b76448af18c9953381e/src/Traits/HasHttpRequest.php#L74-L83 |
237,057 | slickframework/mvc | src/Controller/EntityCreateMethods.php | EntityCreateMethods.add | public function add()
{
$form = $this->getForm();
$this->set(compact('form'));
if (!$form->wasSubmitted()) {
return;
}
try {
$this->getUpdateService()
->setForm($form)
->update();
;
... | php | public function add()
{
$form = $this->getForm();
$this->set(compact('form'));
if (!$form->wasSubmitted()) {
return;
}
try {
$this->getUpdateService()
->setForm($form)
->update();
;
... | [
"public",
"function",
"add",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"$",
"this",
"->",
"set",
"(",
"compact",
"(",
"'form'",
")",
")",
";",
"if",
"(",
"!",
"$",
"form",
"->",
"wasSubmitted",
"(",
")",
")",... | Handle the add entity request | [
"Handle",
"the",
"add",
"entity",
"request"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller/EntityCreateMethods.php#L33-L66 |
237,058 | rodchyn/elephant-lang | lib/ParserGenerator/ParserGenerator.php | PHP_ParserGenerator.handleflags | function handleflags($i, $argv)
{
if (!isset($argv[1]) || !isset(self::$_options[$argv[$i][1]])) {
throw new Exception('Command line syntax error: undefined option "' . $argv[$i] . '"');
}
$v = self::$_options[$argv[$i][1]] == '-';
if (self::$_options[$argv[$i][1]]['type... | php | function handleflags($i, $argv)
{
if (!isset($argv[1]) || !isset(self::$_options[$argv[$i][1]])) {
throw new Exception('Command line syntax error: undefined option "' . $argv[$i] . '"');
}
$v = self::$_options[$argv[$i][1]] == '-';
if (self::$_options[$argv[$i][1]]['type... | [
"function",
"handleflags",
"(",
"$",
"i",
",",
"$",
"argv",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"argv",
"[",
"1",
"]",
")",
"||",
"!",
"isset",
"(",
"self",
"::",
"$",
"_options",
"[",
"$",
"argv",
"[",
"$",
"i",
"]",
"[",
"1",
"]"... | Process a flag command line argument.
@param int $i
@param array $argv
@return int | [
"Process",
"a",
"flag",
"command",
"line",
"argument",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/ParserGenerator.php#L171-L187 |
237,059 | rodchyn/elephant-lang | lib/ParserGenerator/ParserGenerator.php | PHP_ParserGenerator._argindex | private function _argindex($n, $a)
{
$dashdash = 0;
if (!is_array($a) || !count($a)) {
return -1;
}
for ($i=1; $i < count($a); $i++) {
if ($dashdash || !($a[$i][0] == '-' || $a[$i][0] == '+' || strchr($a[$i], '='))) {
if ($n == 0) {
... | php | private function _argindex($n, $a)
{
$dashdash = 0;
if (!is_array($a) || !count($a)) {
return -1;
}
for ($i=1; $i < count($a); $i++) {
if ($dashdash || !($a[$i][0] == '-' || $a[$i][0] == '+' || strchr($a[$i], '='))) {
if ($n == 0) {
... | [
"private",
"function",
"_argindex",
"(",
"$",
"n",
",",
"$",
"a",
")",
"{",
"$",
"dashdash",
"=",
"0",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"a",
")",
"||",
"!",
"count",
"(",
"$",
"a",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"for... | Return the index of the N-th non-switch argument. Return -1
if N is out of range.
@param int $n
@param int $a
@return int | [
"Return",
"the",
"index",
"of",
"the",
"N",
"-",
"th",
"non",
"-",
"switch",
"argument",
".",
"Return",
"-",
"1",
"if",
"N",
"is",
"out",
"of",
"range",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/ParserGenerator.php#L296-L314 |
237,060 | rodchyn/elephant-lang | lib/ParserGenerator/ParserGenerator.php | PHP_ParserGenerator.OptPrint | function OptPrint()
{
$max = 0;
foreach (self::$_options as $label => $info) {
$len = strlen($label) + 1;
switch ($info['type']) {
case self::OPT_FLAG:
case self::OPT_FFLAG:
break;
case self::OPT_INT:
case self::... | php | function OptPrint()
{
$max = 0;
foreach (self::$_options as $label => $info) {
$len = strlen($label) + 1;
switch ($info['type']) {
case self::OPT_FLAG:
case self::OPT_FFLAG:
break;
case self::OPT_INT:
case self::... | [
"function",
"OptPrint",
"(",
")",
"{",
"$",
"max",
"=",
"0",
";",
"foreach",
"(",
"self",
"::",
"$",
"_options",
"as",
"$",
"label",
"=>",
"$",
"info",
")",
"{",
"$",
"len",
"=",
"strlen",
"(",
"$",
"label",
")",
"+",
"1",
";",
"switch",
"(",
... | Print out command-line options
@return void | [
"Print",
"out",
"command",
"-",
"line",
"options"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/ParserGenerator.php#L360-L411 |
237,061 | rodchyn/elephant-lang | lib/ParserGenerator/ParserGenerator.php | PHP_ParserGenerator._handleDOption | private function _handleDOption($z)
{
if ($a = strstr($z, '=')) {
$z = substr($a, 1); // strip first =
}
$this->azDefine[] = $z;
} | php | private function _handleDOption($z)
{
if ($a = strstr($z, '=')) {
$z = substr($a, 1); // strip first =
}
$this->azDefine[] = $z;
} | [
"private",
"function",
"_handleDOption",
"(",
"$",
"z",
")",
"{",
"if",
"(",
"$",
"a",
"=",
"strstr",
"(",
"$",
"z",
",",
"'='",
")",
")",
"{",
"$",
"z",
"=",
"substr",
"(",
"$",
"a",
",",
"1",
")",
";",
"// strip first =",
"}",
"$",
"this",
... | This routine is called with the argument to each -D command-line option.
Add the macro defined to the azDefine array.
@param string $z
@return void | [
"This",
"routine",
"is",
"called",
"with",
"the",
"argument",
"to",
"each",
"-",
"D",
"command",
"-",
"line",
"option",
".",
"Add",
"the",
"macro",
"defined",
"to",
"the",
"azDefine",
"array",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/ParserGenerator.php#L421-L427 |
237,062 | rodchyn/elephant-lang | lib/ParserGenerator/ParserGenerator.php | PHP_ParserGenerator.merge | static function merge($a, $b, $cmp, $offset)
{
if ($a === 0) {
$head = $b;
} elseif ($b === 0) {
$head = $a;
} else {
if (call_user_func($cmp, $a, $b) < 0) {
$ptr = $a;
$a = $a->$offset;
} else {
... | php | static function merge($a, $b, $cmp, $offset)
{
if ($a === 0) {
$head = $b;
} elseif ($b === 0) {
$head = $a;
} else {
if (call_user_func($cmp, $a, $b) < 0) {
$ptr = $a;
$a = $a->$offset;
} else {
... | [
"static",
"function",
"merge",
"(",
"$",
"a",
",",
"$",
"b",
",",
"$",
"cmp",
",",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"a",
"===",
"0",
")",
"{",
"$",
"head",
"=",
"$",
"b",
";",
"}",
"elseif",
"(",
"$",
"b",
"===",
"0",
")",
"{",
... | Merge in a merge sort for a linked list
Side effects:
The "next" pointers for elements in the lists a and b are
changed.
@param mixed $a A sorted, null-terminated linked list. (May be null).
@param mixed $b A sorted, null-terminated linked list. (May be null).
@param function $cmp A pointer to th... | [
"Merge",
"in",
"a",
"merge",
"sort",
"for",
"a",
"linked",
"list"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/ParserGenerator.php#L611-L644 |
237,063 | rodchyn/elephant-lang | lib/ParserGenerator/ParserGenerator.php | PHP_ParserGenerator.Reprint | function Reprint()
{
printf("// Reprint of input file \"%s\".\n// Symbols:\n", $this->filename);
$maxlen = 10;
for ($i = 0; $i < $this->nsymbol; $i++) {
$sp = $this->symbols[$i];
$len = strlen($sp->name);
if ($len > $maxlen ) {
$maxlen = $l... | php | function Reprint()
{
printf("// Reprint of input file \"%s\".\n// Symbols:\n", $this->filename);
$maxlen = 10;
for ($i = 0; $i < $this->nsymbol; $i++) {
$sp = $this->symbols[$i];
$len = strlen($sp->name);
if ($len > $maxlen ) {
$maxlen = $l... | [
"function",
"Reprint",
"(",
")",
"{",
"printf",
"(",
"\"// Reprint of input file \\\"%s\\\".\\n// Symbols:\\n\"",
",",
"$",
"this",
"->",
"filename",
")",
";",
"$",
"maxlen",
"=",
"10",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this"... | Duplicate the input file without comments and without actions
on rules
@return void | [
"Duplicate",
"the",
"input",
"file",
"without",
"comments",
"and",
"without",
"actions",
"on",
"rules"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/ParserGenerator.php#L758-L810 |
237,064 | rybakdigital/fapi | Component/Framework/Controller/Controller.php | Controller.passRequestData | public function passRequestData()
{
$this
->getValidator()
->setInputData($this
->getRequest()
->query
->all()
);
$this
->getValidator()
->setInputData($th... | php | public function passRequestData()
{
$this
->getValidator()
->setInputData($this
->getRequest()
->query
->all()
);
$this
->getValidator()
->setInputData($th... | [
"public",
"function",
"passRequestData",
"(",
")",
"{",
"$",
"this",
"->",
"getValidator",
"(",
")",
"->",
"setInputData",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"query",
"->",
"all",
"(",
")",
")",
";",
"$",
"this",
"->",
"getValidator"... | Helper method. Passes request data.
@return Controller | [
"Helper",
"method",
".",
"Passes",
"request",
"data",
"."
] | 739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027 | https://github.com/rybakdigital/fapi/blob/739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027/Component/Framework/Controller/Controller.php#L157-L176 |
237,065 | rybakdigital/fapi | Component/Framework/Controller/Controller.php | Controller.getRepository | public function getRepository($name = null)
{
// Resolve repository class name
$repositoryName = $this->resolveRepositoryClassName($name);
return new $repositoryName($this->getValidator(), $this->config);
} | php | public function getRepository($name = null)
{
// Resolve repository class name
$repositoryName = $this->resolveRepositoryClassName($name);
return new $repositoryName($this->getValidator(), $this->config);
} | [
"public",
"function",
"getRepository",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"// Resolve repository class name",
"$",
"repositoryName",
"=",
"$",
"this",
"->",
"resolveRepositoryClassName",
"(",
"$",
"name",
")",
";",
"return",
"new",
"$",
"repositoryName",
"... | Gets repository by name
@param string $name Name of the repository to get | [
"Gets",
"repository",
"by",
"name"
] | 739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027 | https://github.com/rybakdigital/fapi/blob/739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027/Component/Framework/Controller/Controller.php#L183-L189 |
237,066 | rybakdigital/fapi | Component/Framework/Controller/Controller.php | Controller.getRepositoryClassnameByReference | public static function getRepositoryClassnameByReference($reference)
{
$parts = explode(':', $reference);
// Check name is string
if (!is_string($reference) || count($parts) !== 3) {
throw new \Exception("Invalid Repository Class Reference. Repository reference should consist of... | php | public static function getRepositoryClassnameByReference($reference)
{
$parts = explode(':', $reference);
// Check name is string
if (!is_string($reference) || count($parts) !== 3) {
throw new \Exception("Invalid Repository Class Reference. Repository reference should consist of... | [
"public",
"static",
"function",
"getRepositoryClassnameByReference",
"(",
"$",
"reference",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"':'",
",",
"$",
"reference",
")",
";",
"// Check name is string",
"if",
"(",
"!",
"is_string",
"(",
"$",
"reference",
")",... | Gets Repository class name by Reference
@param string $reference Reference to Repository class.
This should be in a form of {version}:{controller}:{repositoryName}
For example: v1:Products:MyRepository
Will resolve to: 'v1\Products\Entity\MyRepository'
@return string | [
"Gets",
"Repository",
"class",
"name",
"by",
"Reference"
] | 739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027 | https://github.com/rybakdigital/fapi/blob/739dfa0fc0b17ab8e8ac8f8e86484f7e62b21027/Component/Framework/Controller/Controller.php#L233-L243 |
237,067 | awjudd/l4-assetprocessor | src/Awjudd/AssetProcessor/Commands/CleanupCommand.php | CleanupCommand.removeFiles | private function removeFiles($files)
{
// Grab the duration
$duration = $this->option('duration');
// Grab the minimum acceptable timestamp
$timestamp = time() - $duration;
// Cycle through the list checking their creation dates
foreach($files as $file)
... | php | private function removeFiles($files)
{
// Grab the duration
$duration = $this->option('duration');
// Grab the minimum acceptable timestamp
$timestamp = time() - $duration;
// Cycle through the list checking their creation dates
foreach($files as $file)
... | [
"private",
"function",
"removeFiles",
"(",
"$",
"files",
")",
"{",
"// Grab the duration",
"$",
"duration",
"=",
"$",
"this",
"->",
"option",
"(",
"'duration'",
")",
";",
"// Grab the minimum acceptable timestamp",
"$",
"timestamp",
"=",
"time",
"(",
")",
"-",
... | Used internally in order to cycle through all of the files and remove them.
@return void | [
"Used",
"internally",
"in",
"order",
"to",
"cycle",
"through",
"all",
"of",
"the",
"files",
"and",
"remove",
"them",
"."
] | 04045197ae1a81d77d0c8879dbc090bbd8a69307 | https://github.com/awjudd/l4-assetprocessor/blob/04045197ae1a81d77d0c8879dbc090bbd8a69307/src/Awjudd/AssetProcessor/Commands/CleanupCommand.php#L66-L91 |
237,068 | awjudd/l4-assetprocessor | src/Awjudd/AssetProcessor/Commands/CleanupCommand.php | CleanupCommand.buildFileList | private function buildFileList($folder)
{
// The list of files to use
$files = array();
// Cycle through all of the files in our storage folder removing
// any files that exceed the cache duration.
$directory = new DirectoryIterator($folder);
foreach ($directory as ... | php | private function buildFileList($folder)
{
// The list of files to use
$files = array();
// Cycle through all of the files in our storage folder removing
// any files that exceed the cache duration.
$directory = new DirectoryIterator($folder);
foreach ($directory as ... | [
"private",
"function",
"buildFileList",
"(",
"$",
"folder",
")",
"{",
"// The list of files to use",
"$",
"files",
"=",
"array",
"(",
")",
";",
"// Cycle through all of the files in our storage folder removing",
"// any files that exceed the cache duration.",
"$",
"directory",
... | Used internally in order to build a full list of all of the files to build.
@param string $folder The folder to scan through
@return array An array of all of the files to check. | [
"Used",
"internally",
"in",
"order",
"to",
"build",
"a",
"full",
"list",
"of",
"all",
"of",
"the",
"files",
"to",
"build",
"."
] | 04045197ae1a81d77d0c8879dbc090bbd8a69307 | https://github.com/awjudd/l4-assetprocessor/blob/04045197ae1a81d77d0c8879dbc090bbd8a69307/src/Awjudd/AssetProcessor/Commands/CleanupCommand.php#L99-L131 |
237,069 | unimatrix/cake | src/Controller/Component/CookieComponent.php | CookieComponent.check | public function check($name) {
// is in cache?
if(isset($this->cache[$name]))
return true;
return $this->cookies->has($name);
} | php | public function check($name) {
// is in cache?
if(isset($this->cache[$name]))
return true;
return $this->cookies->has($name);
} | [
"public",
"function",
"check",
"(",
"$",
"name",
")",
"{",
"// is in cache?",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"name",
"]",
")",
")",
"return",
"true",
";",
"return",
"$",
"this",
"->",
"cookies",
"->",
"has",
"(",
"$"... | Check if the cookie exists
@param string $name The name of the cookie.
@return boolean | [
"Check",
"if",
"the",
"cookie",
"exists"
] | 23003aba497822bd473fdbf60514052dda1874fc | https://github.com/unimatrix/cake/blob/23003aba497822bd473fdbf60514052dda1874fc/src/Controller/Component/CookieComponent.php#L56-L62 |
237,070 | edunola13/enolaphp-framework | src/EnolaContext.php | EnolaContext.init | public function init(){
$file= 'config';
//Seleccion el archivo de configuracion correspondiente segun el MODO y el DOMINIO
if($this->multiDomain && $this->domain){
//Ya no importa el modo, se definio todo antes si busca o no por dominio
//if(ENOLA_MODE == 'HTTP'){
... | php | public function init(){
$file= 'config';
//Seleccion el archivo de configuracion correspondiente segun el MODO y el DOMINIO
if($this->multiDomain && $this->domain){
//Ya no importa el modo, se definio todo antes si busca o no por dominio
//if(ENOLA_MODE == 'HTTP'){
... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"file",
"=",
"'config'",
";",
"//Seleccion el archivo de configuracion correspondiente segun el MODO y el DOMINIO",
"if",
"(",
"$",
"this",
"->",
"multiDomain",
"&&",
"$",
"this",
"->",
"domain",
")",
"{",
"//Ya no i... | Carga la configuracion global de la aplicacion
@param string $path_root
@param string $path_framework
@param string $path_application | [
"Carga",
"la",
"configuracion",
"global",
"de",
"la",
"aplicacion"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/EnolaContext.php#L196-L274 |
237,071 | edunola13/enolaphp-framework | src/EnolaContext.php | EnolaContext.setBasicConstants | private function setBasicConstants(){
//Algunas constantes - La idea es ir sacandolas
//PATHROOT: direccion de la carpeta del framework - definida en index.php
define('PATHROOT', $this->getPathRoot());
//PATHFRA: direccion de la carpeta del framework - definida en index.php
defin... | php | private function setBasicConstants(){
//Algunas constantes - La idea es ir sacandolas
//PATHROOT: direccion de la carpeta del framework - definida en index.php
define('PATHROOT', $this->getPathRoot());
//PATHFRA: direccion de la carpeta del framework - definida en index.php
defin... | [
"private",
"function",
"setBasicConstants",
"(",
")",
"{",
"//Algunas constantes - La idea es ir sacandolas",
"//PATHROOT: direccion de la carpeta del framework - definida en index.php",
"define",
"(",
"'PATHROOT'",
",",
"$",
"this",
"->",
"getPathRoot",
"(",
")",
")",
";",
"... | Establece las constantes basicas del sistema | [
"Establece",
"las",
"constantes",
"basicas",
"del",
"sistema"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/EnolaContext.php#L278-L292 |
237,072 | edunola13/enolaphp-framework | src/EnolaContext.php | EnolaContext.readConfigurationFile | public function readConfigurationFile($name, $cache = TRUE){
//Lee archivo de configuracion principal donde se encuentra toda la configuracion de variables, filtros, controladores, etc.
$config= NULL;
if($this->cacheConfigFiles && $cache && $this->app->cache != NULL){
//Si esta en pr... | php | public function readConfigurationFile($name, $cache = TRUE){
//Lee archivo de configuracion principal donde se encuentra toda la configuracion de variables, filtros, controladores, etc.
$config= NULL;
if($this->cacheConfigFiles && $cache && $this->app->cache != NULL){
//Si esta en pr... | [
"public",
"function",
"readConfigurationFile",
"(",
"$",
"name",
",",
"$",
"cache",
"=",
"TRUE",
")",
"{",
"//Lee archivo de configuracion principal donde se encuentra toda la configuracion de variables, filtros, controladores, etc.",
"$",
"config",
"=",
"NULL",
";",
"if",
"(... | Devuelve un array con los valores del archivo de configuracion
@param string $name
@param boolean $cache
@return array | [
"Devuelve",
"un",
"array",
"con",
"los",
"valores",
"del",
"archivo",
"de",
"configuracion"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/EnolaContext.php#L440-L461 |
237,073 | edunola13/enolaphp-framework | src/EnolaContext.php | EnolaContext.compileConfigurationFile | public function compileConfigurationFile($file){
//CARGAMOS LA DEPENDENCIA POR SI ES NECESARIA
require_once $this->pathFra . 'Support/Spyc.php';
$info= new \SplFileInfo($file);
$path= $info->getPath() . '/';
$name= $info->getBasename('.' . $info->getExtension());
... | php | public function compileConfigurationFile($file){
//CARGAMOS LA DEPENDENCIA POR SI ES NECESARIA
require_once $this->pathFra . 'Support/Spyc.php';
$info= new \SplFileInfo($file);
$path= $info->getPath() . '/';
$name= $info->getBasename('.' . $info->getExtension());
... | [
"public",
"function",
"compileConfigurationFile",
"(",
"$",
"file",
")",
"{",
"//CARGAMOS LA DEPENDENCIA POR SI ES NECESARIA",
"require_once",
"$",
"this",
"->",
"pathFra",
".",
"'Support/Spyc.php'",
";",
"$",
"info",
"=",
"new",
"\\",
"SplFileInfo",
"(",
"$",
"file... | Compila archivos de configuracion. Es necesario indicar path absoluto
@param type $name
@param type $absolute Si es true hay que indicar el path absoluto del archivo | [
"Compila",
"archivos",
"de",
"configuracion",
".",
"Es",
"necesario",
"indicar",
"path",
"absoluto"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/EnolaContext.php#L467-L476 |
237,074 | edunola13/enolaphp-framework | src/EnolaContext.php | EnolaContext.readFile | private function readFile($name, $folder = null){
$realConfig= NULL;
$folder != null ?: $folder= $this->pathApp . $this->configurationFolder;
if($this->configurationType == 'YAML'){
$realConfig = \Spyc::YAMLLoad($folder . $name . '.yml');
}else if($this->configura... | php | private function readFile($name, $folder = null){
$realConfig= NULL;
$folder != null ?: $folder= $this->pathApp . $this->configurationFolder;
if($this->configurationType == 'YAML'){
$realConfig = \Spyc::YAMLLoad($folder . $name . '.yml');
}else if($this->configura... | [
"private",
"function",
"readFile",
"(",
"$",
"name",
",",
"$",
"folder",
"=",
"null",
")",
"{",
"$",
"realConfig",
"=",
"NULL",
";",
"$",
"folder",
"!=",
"null",
"?",
":",
"$",
"folder",
"=",
"$",
"this",
"->",
"pathApp",
".",
"$",
"this",
"->",
... | Lee un archivo y lo carga en un array
@param string $name
@param string $folder Si no se indica $folder se usa la carpeta de configuracion de la app
@return array | [
"Lee",
"un",
"archivo",
"y",
"lo",
"carga",
"en",
"un",
"array"
] | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/EnolaContext.php#L483-L496 |
237,075 | edunola13/enolaphp-framework | src/EnolaContext.php | EnolaContext.readFileSpecific | public function readFileSpecific($path, $extension = 'yml'){
$realConfig= NULL;
if($extension == 'yml'){
$realConfig = \Spyc::YAMLLoad($path);
}else if($extension == 'php'){
include $path;
//La variable $config la define cada archivo incluido
... | php | public function readFileSpecific($path, $extension = 'yml'){
$realConfig= NULL;
if($extension == 'yml'){
$realConfig = \Spyc::YAMLLoad($path);
}else if($extension == 'php'){
include $path;
//La variable $config la define cada archivo incluido
... | [
"public",
"function",
"readFileSpecific",
"(",
"$",
"path",
",",
"$",
"extension",
"=",
"'yml'",
")",
"{",
"$",
"realConfig",
"=",
"NULL",
";",
"if",
"(",
"$",
"extension",
"==",
"'yml'",
")",
"{",
"$",
"realConfig",
"=",
"\\",
"Spyc",
"::",
"YAMLLoad"... | Lee un archivo y lo carga en un array
A defirencia de readFile a este no le importa el tipo de configuracion ni la carpeta de este archivo. Toma un path completo y lo carga
@param string $path
@return array | [
"Lee",
"un",
"archivo",
"y",
"lo",
"carga",
"en",
"un",
"array",
"A",
"defirencia",
"de",
"readFile",
"a",
"este",
"no",
"le",
"importa",
"el",
"tipo",
"de",
"configuracion",
"ni",
"la",
"carpeta",
"de",
"este",
"archivo",
".",
"Toma",
"un",
"path",
"c... | a962bfcd53d7bc129d8c9946aaa71d264285229d | https://github.com/edunola13/enolaphp-framework/blob/a962bfcd53d7bc129d8c9946aaa71d264285229d/src/EnolaContext.php#L503-L515 |
237,076 | wollanup/php-api-rest | src/Service/Request/QueryModifier/Modifier/FilterModifier.php | FilterModifier.hasAllRequiredData | protected function hasAllRequiredData(array $modifier)
{
if (array_key_exists('operator', $modifier)
&& !in_array($modifier['operator'],
self::$allowedFilterOperators)
) {
throw new ModifierException('The filter operator "' . $modifier['operator'] . '" is not ... | php | protected function hasAllRequiredData(array $modifier)
{
if (array_key_exists('operator', $modifier)
&& !in_array($modifier['operator'],
self::$allowedFilterOperators)
) {
throw new ModifierException('The filter operator "' . $modifier['operator'] . '" is not ... | [
"protected",
"function",
"hasAllRequiredData",
"(",
"array",
"$",
"modifier",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'operator'",
",",
"$",
"modifier",
")",
"&&",
"!",
"in_array",
"(",
"$",
"modifier",
"[",
"'operator'",
"]",
",",
"self",
"::",
"$"... | Has the modifier all required data to be applied?
@param array $modifier
@return bool
@throws ModifierException | [
"Has",
"the",
"modifier",
"all",
"required",
"data",
"to",
"be",
"applied?"
] | 185eac8a8412e5997d8e292ebd0e38787ae4b949 | https://github.com/wollanup/php-api-rest/blob/185eac8a8412e5997d8e292ebd0e38787ae4b949/src/Service/Request/QueryModifier/Modifier/FilterModifier.php#L124-L135 |
237,077 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.register | public function register(\Silex\Application $app)
{
parent::register($app);
// Register voters
$app->extend('security.voters', function($voters) {
return array_merge($voters, $this->voters);
});
// Add reference to this in application instance
$this->app... | php | public function register(\Silex\Application $app)
{
parent::register($app);
// Register voters
$app->extend('security.voters', function($voters) {
return array_merge($voters, $this->voters);
});
// Add reference to this in application instance
$this->app... | [
"public",
"function",
"register",
"(",
"\\",
"Silex",
"\\",
"Application",
"$",
"app",
")",
"{",
"parent",
"::",
"register",
"(",
"$",
"app",
")",
";",
"// Register voters",
"$",
"app",
"->",
"extend",
"(",
"'security.voters'",
",",
"function",
"(",
"$",
... | Register with \Silex\Application.
@param \Silex\Application $app | [
"Register",
"with",
"\\",
"Silex",
"\\",
"Application",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L64-L76 |
237,078 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.boot | public function boot(\Silex\Application $app)
{
// Register firewalls
foreach ($this->firewalls as $firewall) {
$firewall->register($this);
}
$i = 0;
$firewalls = array();
foreach ($this->unsecuredPatterns as $pattern => $v) {
$firewal... | php | public function boot(\Silex\Application $app)
{
// Register firewalls
foreach ($this->firewalls as $firewall) {
$firewall->register($this);
}
$i = 0;
$firewalls = array();
foreach ($this->unsecuredPatterns as $pattern => $v) {
$firewal... | [
"public",
"function",
"boot",
"(",
"\\",
"Silex",
"\\",
"Application",
"$",
"app",
")",
"{",
"// Register firewalls",
"foreach",
"(",
"$",
"this",
"->",
"firewalls",
"as",
"$",
"firewall",
")",
"{",
"$",
"firewall",
"->",
"register",
"(",
"$",
"this",
")... | Boot with Silex Application
@param \Silex\Application $app | [
"Boot",
"with",
"Silex",
"Application"
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L82-L99 |
237,079 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.getFirewall | public function getFirewall($path = null)
{
if (!$path) {
$path = $this->getCurrentPathRelativeToBase();
}
foreach ($this->firewalls as $firewall) {
if ($firewall->isPathCovered($path)) {
return $firewall;
}
}
return null;
... | php | public function getFirewall($path = null)
{
if (!$path) {
$path = $this->getCurrentPathRelativeToBase();
}
foreach ($this->firewalls as $firewall) {
if ($firewall->isPathCovered($path)) {
return $firewall;
}
}
return null;
... | [
"public",
"function",
"getFirewall",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getCurrentPathRelativeToBase",
"(",
")",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"firewall... | Get the firewall with the specific path.
@param string $path
@return FirewallInterface | [
"Get",
"the",
"firewall",
"with",
"the",
"specific",
"path",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L119-L130 |
237,080 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.getLoginCheckPath | public function getLoginCheckPath()
{
$login_check = $this->app['request']->getBasePath();
if (($firewall = $this->getFirewall($this->getCurrentPathRelativeToBase()))) {
$login_check .= $firewall->getLoginCheckPath();
}
return $login_check;
} | php | public function getLoginCheckPath()
{
$login_check = $this->app['request']->getBasePath();
if (($firewall = $this->getFirewall($this->getCurrentPathRelativeToBase()))) {
$login_check .= $firewall->getLoginCheckPath();
}
return $login_check;
} | [
"public",
"function",
"getLoginCheckPath",
"(",
")",
"{",
"$",
"login_check",
"=",
"$",
"this",
"->",
"app",
"[",
"'request'",
"]",
"->",
"getBasePath",
"(",
")",
";",
"if",
"(",
"(",
"$",
"firewall",
"=",
"$",
"this",
"->",
"getFirewall",
"(",
"$",
... | Get login check path.
@return string | [
"Get",
"login",
"check",
"path",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L136-L145 |
237,081 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.getLogoutPath | public function getLogoutPath()
{
$logout = $this->app['request']->getBasePath();
if (($firewall = $this->getFirewall($this->getCurrentPathRelativeToBase()))) {
$logout .= $firewall->getLogoutPath();
}
return $logout;
} | php | public function getLogoutPath()
{
$logout = $this->app['request']->getBasePath();
if (($firewall = $this->getFirewall($this->getCurrentPathRelativeToBase()))) {
$logout .= $firewall->getLogoutPath();
}
return $logout;
} | [
"public",
"function",
"getLogoutPath",
"(",
")",
"{",
"$",
"logout",
"=",
"$",
"this",
"->",
"app",
"[",
"'request'",
"]",
"->",
"getBasePath",
"(",
")",
";",
"if",
"(",
"(",
"$",
"firewall",
"=",
"$",
"this",
"->",
"getFirewall",
"(",
"$",
"this",
... | Get logout path.
@return string | [
"Get",
"logout",
"path",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L151-L160 |
237,082 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.prependFirewallConfig | public function prependFirewallConfig($name, $config)
{
$this->firewallConfig = array_merge(
array($name => $config), $this->firewallConfig);
} | php | public function prependFirewallConfig($name, $config)
{
$this->firewallConfig = array_merge(
array($name => $config), $this->firewallConfig);
} | [
"public",
"function",
"prependFirewallConfig",
"(",
"$",
"name",
",",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"firewallConfig",
"=",
"array_merge",
"(",
"array",
"(",
"$",
"name",
"=>",
"$",
"config",
")",
",",
"$",
"this",
"->",
"firewallConfig",
")... | Prepend additional data to firewall configuration.
@param string $name
@param mixed $config | [
"Prepend",
"additional",
"data",
"to",
"firewall",
"configuration",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L185-L189 |
237,083 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.addAuthorizationVoter | public function addAuthorizationVoter(VoterInterface $voter)
{
if (!in_array($voter, $this->voters)) {
$this->voters[] = $voter;
}
} | php | public function addAuthorizationVoter(VoterInterface $voter)
{
if (!in_array($voter, $this->voters)) {
$this->voters[] = $voter;
}
} | [
"public",
"function",
"addAuthorizationVoter",
"(",
"VoterInterface",
"$",
"voter",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"voter",
",",
"$",
"this",
"->",
"voters",
")",
")",
"{",
"$",
"this",
"->",
"voters",
"[",
"]",
"=",
"$",
"voter",
";... | Add additional voter to authorization module.
@param VoterInterface $voter | [
"Add",
"additional",
"voter",
"to",
"authorization",
"module",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L205-L210 |
237,084 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.isGranted | public function isGranted($attributes, $object = null,
$catchException = true)
{
try {
return $this->app['security.authorization_checker']->isGranted($attributes, $object);
} catch (AuthenticationCredentialsNotFoundException $e) {
if ($catchExcep... | php | public function isGranted($attributes, $object = null,
$catchException = true)
{
try {
return $this->app['security.authorization_checker']->isGranted($attributes, $object);
} catch (AuthenticationCredentialsNotFoundException $e) {
if ($catchExcep... | [
"public",
"function",
"isGranted",
"(",
"$",
"attributes",
",",
"$",
"object",
"=",
"null",
",",
"$",
"catchException",
"=",
"true",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"app",
"[",
"'security.authorization_checker'",
"]",
"->",
"isGranted",
... | Check if the attributes are granted against the current authentication token and optionally supplied object.
@param mixed $attributes
@param mixed $object
@param boolean $catchException
@return boolean
@throws AuthenticationCredentialsNotFoundException | [
"Check",
"if",
"the",
"attributes",
"are",
"granted",
"against",
"the",
"current",
"authentication",
"token",
"and",
"optionally",
"supplied",
"object",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L220-L231 |
237,085 | MLukman/Securilex | src/SecurityServiceProvider.php | SecurityServiceProvider.getCurrentPathRelativeToBase | protected function getCurrentPathRelativeToBase($path = null)
{
if (!$path) {
// using $_SERVER instead of using Request method
// to get original request path instead of any forwarded request
$path = $_SERVER['REQUEST_URI'];
}
$base_path = $this->app['req... | php | protected function getCurrentPathRelativeToBase($path = null)
{
if (!$path) {
// using $_SERVER instead of using Request method
// to get original request path instead of any forwarded request
$path = $_SERVER['REQUEST_URI'];
}
$base_path = $this->app['req... | [
"protected",
"function",
"getCurrentPathRelativeToBase",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"path",
")",
"{",
"// using $_SERVER instead of using Request method",
"// to get original request path instead of any forwarded request",
"$",
"path",
"="... | Get current path relative to base path.
@param string $path Path to process. Optional, default to current path
@return string | [
"Get",
"current",
"path",
"relative",
"to",
"base",
"path",
"."
] | d86ccae6df2ff9029a6d033b20e15f7f48fab79d | https://github.com/MLukman/Securilex/blob/d86ccae6df2ff9029a6d033b20e15f7f48fab79d/src/SecurityServiceProvider.php#L238-L247 |
237,086 | erickmcarvalho/likepdo | src/LikePDO/Instances/LikePDOStatement.php | LikePDOStatement.debugDumpParams | public function debugDumpParams()
{
if(!is_resource($this->resource))
{
throw new LikePDOException("There is no active statement");
return false;
}
else
{
$parameters = array();
if(count($this->parametersBound) > 0)
{
foreach($this->parametersBound as $key => $param)
... | php | public function debugDumpParams()
{
if(!is_resource($this->resource))
{
throw new LikePDOException("There is no active statement");
return false;
}
else
{
$parameters = array();
if(count($this->parametersBound) > 0)
{
foreach($this->parametersBound as $key => $param)
... | [
"public",
"function",
"debugDumpParams",
"(",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"resource",
")",
")",
"{",
"throw",
"new",
"LikePDOException",
"(",
"\"There is no active statement\"",
")",
";",
"return",
"false",
";",
"}",
"els... | Dump an SQL prepared command
@return void | [
"Dump",
"an",
"SQL",
"prepared",
"command"
] | 469f82f63d98fbabacdcdc27cb770b112428e4e5 | https://github.com/erickmcarvalho/likepdo/blob/469f82f63d98fbabacdcdc27cb770b112428e4e5/src/LikePDO/Instances/LikePDOStatement.php#L328-L391 |
237,087 | erickmcarvalho/likepdo | src/LikePDO/Instances/LikePDOStatement.php | LikePDOStatement.nextRowset | public function nextRowset()
{
if(!is_resource($this->resource))
{
throw new LikePDOException("There is no active statement");
return false;
}
else
{
return $this->pdo->driver->nextResult($this->resource);
}
} | php | public function nextRowset()
{
if(!is_resource($this->resource))
{
throw new LikePDOException("There is no active statement");
return false;
}
else
{
return $this->pdo->driver->nextResult($this->resource);
}
} | [
"public",
"function",
"nextRowset",
"(",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"resource",
")",
")",
"{",
"throw",
"new",
"LikePDOException",
"(",
"\"There is no active statement\"",
")",
";",
"return",
"false",
";",
"}",
"else",
... | Advances to the next rowset in a multi-rowset statement handle
@return boolean | [
"Advances",
"to",
"the",
"next",
"rowset",
"in",
"a",
"multi",
"-",
"rowset",
"statement",
"handle"
] | 469f82f63d98fbabacdcdc27cb770b112428e4e5 | https://github.com/erickmcarvalho/likepdo/blob/469f82f63d98fbabacdcdc27cb770b112428e4e5/src/LikePDO/Instances/LikePDOStatement.php#L1302-L1313 |
237,088 | samurai-fw/samurai | src/Samurai/Controller/Controller.php | Controller.getFilters | public function getFilters()
{
$filters = [];
$names = explode('_', $this->name);
$base = '';
$filters = [];
while ($name = array_shift($names)) {
$filter = $this->_searchInControllerDir($base, 'filter.yml');
if ($filter) $filters[] = $filter;
... | php | public function getFilters()
{
$filters = [];
$names = explode('_', $this->name);
$base = '';
$filters = [];
while ($name = array_shift($names)) {
$filter = $this->_searchInControllerDir($base, 'filter.yml');
if ($filter) $filters[] = $filter;
... | [
"public",
"function",
"getFilters",
"(",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"$",
"names",
"=",
"explode",
"(",
"'_'",
",",
"$",
"this",
"->",
"name",
")",
";",
"$",
"base",
"=",
"''",
";",
"$",
"filters",
"=",
"[",
"]",
";",
"while",... | Get filter paths
1. Controller/filter.yml
2. Controller/foo.filter.yml | [
"Get",
"filter",
"paths"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Controller/Controller.php#L117-L140 |
237,089 | samurai-fw/samurai | src/Samurai/Controller/Controller.php | Controller.getFilterKey | public function getFilterKey($action = null)
{
// controller.action
$controller = $this->getName();
return $action ? $controller . '.' . $action : $controller;
} | php | public function getFilterKey($action = null)
{
// controller.action
$controller = $this->getName();
return $action ? $controller . '.' . $action : $controller;
} | [
"public",
"function",
"getFilterKey",
"(",
"$",
"action",
"=",
"null",
")",
"{",
"// controller.action",
"$",
"controller",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"return",
"$",
"action",
"?",
"$",
"controller",
".",
"'.'",
".",
"$",
"action",... | Get filter key
@param string $action
@return string | [
"Get",
"filter",
"key"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Controller/Controller.php#L149-L154 |
237,090 | samurai-fw/samurai | src/Samurai/Controller/Controller.php | Controller.task | public function task($name, array $options = [])
{
$this->taskProcessor->setOutput($this);
$this->taskProcessor->execute($name, $options);
} | php | public function task($name, array $options = [])
{
$this->taskProcessor->setOutput($this);
$this->taskProcessor->execute($name, $options);
} | [
"public",
"function",
"task",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"taskProcessor",
"->",
"setOutput",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"taskProcessor",
"->",
"execute",
"(",
"$",
... | get a task.
@access public
@param string $name
@return Samurai\Console\Task\Task | [
"get",
"a",
"task",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Controller/Controller.php#L207-L211 |
237,091 | samurai-fw/samurai | src/Samurai/Controller/Controller.php | Controller._searchInControllerDir | private function _searchInControllerDir($base_dir, $file_name)
{
$dirs = $this->application->getControllerDirectories();
foreach ($dirs as $dir) {
$filter = $this->finder->path($dir . $base_dir)->name($file_name)->find()->first();
if ($filter) return $filter;
}
} | php | private function _searchInControllerDir($base_dir, $file_name)
{
$dirs = $this->application->getControllerDirectories();
foreach ($dirs as $dir) {
$filter = $this->finder->path($dir . $base_dir)->name($file_name)->find()->first();
if ($filter) return $filter;
}
} | [
"private",
"function",
"_searchInControllerDir",
"(",
"$",
"base_dir",
",",
"$",
"file_name",
")",
"{",
"$",
"dirs",
"=",
"$",
"this",
"->",
"application",
"->",
"getControllerDirectories",
"(",
")",
";",
"foreach",
"(",
"$",
"dirs",
"as",
"$",
"dir",
")",... | search in controller dirs
@param string $base_dir
@param string $file_name
@return Samurai\Samurai\Component\FileSystem\Finder\Iterator\Iterator | [
"search",
"in",
"controller",
"dirs"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Controller/Controller.php#L259-L266 |
237,092 | bernardosecades/packagist-security-checker | src/Compiler/Compiler.php | Compiler.addPHPFiles | private function addPHPFiles(Phar $phar)
{
$finder = new Finder();
$finder
->files()
->ignoreVCS(true)
->name('*.php')
->notName('Compiler.php')
->in(realpath(__DIR__.'/../../src'));
foreach ($finder as $file) {
$this->... | php | private function addPHPFiles(Phar $phar)
{
$finder = new Finder();
$finder
->files()
->ignoreVCS(true)
->name('*.php')
->notName('Compiler.php')
->in(realpath(__DIR__.'/../../src'));
foreach ($finder as $file) {
$this->... | [
"private",
"function",
"addPHPFiles",
"(",
"Phar",
"$",
"phar",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
"->",
"files",
"(",
")",
"->",
"ignoreVCS",
"(",
"true",
")",
"->",
"name",
"(",
"'*.php'",
")",
"->",
"not... | Add php files
@param Phar $phar Phar instance
@return Compiler self Object | [
"Add",
"php",
"files"
] | da8212da47f3e0c08ec4a226496788853e9879d9 | https://github.com/bernardosecades/packagist-security-checker/blob/da8212da47f3e0c08ec4a226496788853e9879d9/src/Compiler/Compiler.php#L159-L174 |
237,093 | bernardosecades/packagist-security-checker | src/Compiler/Compiler.php | Compiler.addVendorFiles | private function addVendorFiles(Phar $phar)
{
$vendorPath = __DIR__.'/../../vendor/';
$requiredDependencies = [
realpath($vendorPath.'symfony/'),
realpath($vendorPath.'doctrine/'),
realpath($vendorPath.'guzzlehttp'),
realpath($vendorPath.'psr'),
... | php | private function addVendorFiles(Phar $phar)
{
$vendorPath = __DIR__.'/../../vendor/';
$requiredDependencies = [
realpath($vendorPath.'symfony/'),
realpath($vendorPath.'doctrine/'),
realpath($vendorPath.'guzzlehttp'),
realpath($vendorPath.'psr'),
... | [
"private",
"function",
"addVendorFiles",
"(",
"Phar",
"$",
"phar",
")",
"{",
"$",
"vendorPath",
"=",
"__DIR__",
".",
"'/../../vendor/'",
";",
"$",
"requiredDependencies",
"=",
"[",
"realpath",
"(",
"$",
"vendorPath",
".",
"'symfony/'",
")",
",",
"realpath",
... | Add vendor files
@param Phar $phar Phar instance
@return Compiler self Object | [
"Add",
"vendor",
"files"
] | da8212da47f3e0c08ec4a226496788853e9879d9 | https://github.com/bernardosecades/packagist-security-checker/blob/da8212da47f3e0c08ec4a226496788853e9879d9/src/Compiler/Compiler.php#L183-L207 |
237,094 | bernardosecades/packagist-security-checker | src/Compiler/Compiler.php | Compiler.addComposerVendorFiles | private function addComposerVendorFiles(Phar $phar)
{
$vendorPath = __DIR__.'/../../vendor/';
$this
->addFile($phar, new \SplFileInfo($vendorPath.'autoload.php'))
->addFile($phar, new \SplFileInfo($vendorPath.'composer/autoload_namespaces.php'))
->addFile($phar, ... | php | private function addComposerVendorFiles(Phar $phar)
{
$vendorPath = __DIR__.'/../../vendor/';
$this
->addFile($phar, new \SplFileInfo($vendorPath.'autoload.php'))
->addFile($phar, new \SplFileInfo($vendorPath.'composer/autoload_namespaces.php'))
->addFile($phar, ... | [
"private",
"function",
"addComposerVendorFiles",
"(",
"Phar",
"$",
"phar",
")",
"{",
"$",
"vendorPath",
"=",
"__DIR__",
".",
"'/../../vendor/'",
";",
"$",
"this",
"->",
"addFile",
"(",
"$",
"phar",
",",
"new",
"\\",
"SplFileInfo",
"(",
"$",
"vendorPath",
"... | Add composer vendor files
@param Phar $phar Phar
@return Compiler self Object | [
"Add",
"composer",
"vendor",
"files"
] | da8212da47f3e0c08ec4a226496788853e9879d9 | https://github.com/bernardosecades/packagist-security-checker/blob/da8212da47f3e0c08ec4a226496788853e9879d9/src/Compiler/Compiler.php#L216-L230 |
237,095 | marando/phpSOFA | src/Marando/IAU/iauEe00a.php | iauEe00a.Ee00a | public static function Ee00a($date1, $date2) {
$dpsipr;
$depspr;
$epsa;
$dpsi;
$deps;
$ee;
/* IAU 2000 precession-rate adjustments. */
IAU::Pr00($date1, $date2, $dpsipr, $depspr);
/* Mean obliquity, consistent with IAU 2000 precession-nutation. */
$epsa = IAU::Obl80($date1, $da... | php | public static function Ee00a($date1, $date2) {
$dpsipr;
$depspr;
$epsa;
$dpsi;
$deps;
$ee;
/* IAU 2000 precession-rate adjustments. */
IAU::Pr00($date1, $date2, $dpsipr, $depspr);
/* Mean obliquity, consistent with IAU 2000 precession-nutation. */
$epsa = IAU::Obl80($date1, $da... | [
"public",
"static",
"function",
"Ee00a",
"(",
"$",
"date1",
",",
"$",
"date2",
")",
"{",
"$",
"dpsipr",
";",
"$",
"depspr",
";",
"$",
"epsa",
";",
"$",
"dpsi",
";",
"$",
"deps",
";",
"$",
"ee",
";",
"/* IAU 2000 precession-rate adjustments. */",
"IAU",
... | - - - - - - - - -
i a u E e 0 0 a
- - - - - - - - -
Equation of the equinoxes, compatible with IAU 2000 resolutions.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: support function.
Given:
date1,date2 double TT as a 2-part ... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"E",
"e",
"0",
"0",
"a",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauEe00a.php#L75-L96 |
237,096 | MehrAlsNix/Assumptions | src/Extensions/Network.php | Network.assumeSocket | public static function assumeSocket($address, $port = 0): void
{
$socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
assumeThat($socket, is(not(false)), self::$SOCK_ERR_MSG . socket_last_error($socket));
assumeThat(
@socket_connect($socket, $address, $port),
is(... | php | public static function assumeSocket($address, $port = 0): void
{
$socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
assumeThat($socket, is(not(false)), self::$SOCK_ERR_MSG . socket_last_error($socket));
assumeThat(
@socket_connect($socket, $address, $port),
is(... | [
"public",
"static",
"function",
"assumeSocket",
"(",
"$",
"address",
",",
"$",
"port",
"=",
"0",
")",
":",
"void",
"{",
"$",
"socket",
"=",
"@",
"socket_create",
"(",
"AF_INET",
",",
"SOCK_STREAM",
",",
"SOL_TCP",
")",
";",
"assumeThat",
"(",
"$",
"soc... | Assumes that a specified socket connection could be established.
@param string $address
@param int $port
@return void
@throws AssumptionViolatedException | [
"Assumes",
"that",
"a",
"specified",
"socket",
"connection",
"could",
"be",
"established",
"."
] | 5d28349354bc80409beeac52df79e57d1d52bcf2 | https://github.com/MehrAlsNix/Assumptions/blob/5d28349354bc80409beeac52df79e57d1d52bcf2/src/Extensions/Network.php#L44-L54 |
237,097 | axypro/creator | helpers/PointerFormat.php | PointerFormat.normalize | public static function normalize($pointer, array $context = null)
{
if (is_object($pointer)) {
return ['value' => $pointer];
}
if (is_string($pointer)) {
return ['classname' => $pointer];
}
if ($pointer === null) {
return [];
}
... | php | public static function normalize($pointer, array $context = null)
{
if (is_object($pointer)) {
return ['value' => $pointer];
}
if (is_string($pointer)) {
return ['classname' => $pointer];
}
if ($pointer === null) {
return [];
}
... | [
"public",
"static",
"function",
"normalize",
"(",
"$",
"pointer",
",",
"array",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"pointer",
")",
")",
"{",
"return",
"[",
"'value'",
"=>",
"$",
"pointer",
"]",
";",
"}",
"if",
... | Normalizes the pointer format
@param mixed $pointer
@param array $context [optional]
@return array
@throws \axy\creator\errors\InvalidPointer
@throws \axy\creator\errors\Disabled | [
"Normalizes",
"the",
"pointer",
"format"
] | 3d74e2201cdb93912d32b1d80d1fdc44018f132a | https://github.com/axypro/creator/blob/3d74e2201cdb93912d32b1d80d1fdc44018f132a/helpers/PointerFormat.php#L26-L47 |
237,098 | lasallecrm/lasallecrm-l5-listmanagement-pkg | src/Http/Controllers/FrontendListUnsubscribeController.php | FrontendListUnsubscribeController.unsubscribe | public function unsubscribe($token) {
// Does the token exist in the list_unsubscribe_token database table?
if (!$this->model->isTokenValid($token)) {
return view('lasallecrmlistmanagement::subscribe-unsubscribe-list.token_invalid', [
'title' => 'Invalid Unsubscribe Token... | php | public function unsubscribe($token) {
// Does the token exist in the list_unsubscribe_token database table?
if (!$this->model->isTokenValid($token)) {
return view('lasallecrmlistmanagement::subscribe-unsubscribe-list.token_invalid', [
'title' => 'Invalid Unsubscribe Token... | [
"public",
"function",
"unsubscribe",
"(",
"$",
"token",
")",
"{",
"// Does the token exist in the list_unsubscribe_token database table?",
"if",
"(",
"!",
"$",
"this",
"->",
"model",
"->",
"isTokenValid",
"(",
"$",
"token",
")",
")",
"{",
"return",
"view",
"(",
... | Unsubscribe from a LaSalleCRM email list
@param $token | [
"Unsubscribe",
"from",
"a",
"LaSalleCRM",
"email",
"list"
] | 4b5da1af5d25d5fb4be5199f3cf22da313d475f3 | https://github.com/lasallecrm/lasallecrm-l5-listmanagement-pkg/blob/4b5da1af5d25d5fb4be5199f3cf22da313d475f3/src/Http/Controllers/FrontendListUnsubscribeController.php#L98-L127 |
237,099 | elcodi/Configuration | Services/ConfigurationManager.php | ConfigurationManager.get | public function get($configurationIdentifier, $defaultValue = null)
{
/**
* Checks if the value is defined in the configuration elements.
*/
if (!array_key_exists($configurationIdentifier, $this->configurationElements)) {
if (!is_null($defaultValue)) {
r... | php | public function get($configurationIdentifier, $defaultValue = null)
{
/**
* Checks if the value is defined in the configuration elements.
*/
if (!array_key_exists($configurationIdentifier, $this->configurationElements)) {
if (!is_null($defaultValue)) {
r... | [
"public",
"function",
"get",
"(",
"$",
"configurationIdentifier",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"/**\n * Checks if the value is defined in the configuration elements.\n */",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"configurationIdentif... | Loads a parameter given the format "namespace.key".
@param string $configurationIdentifier Configuration identifier
@param string|null $defaultValue Default value
@return null|string|bool Configuration parameter value
@throws ConfigurationParameterNotFoundException Configuration parameter not found
@... | [
"Loads",
"a",
"parameter",
"given",
"the",
"format",
"namespace",
".",
"key",
"."
] | 1e416269c2e1bd957f98c6b1845dffb218794c55 | https://github.com/elcodi/Configuration/blob/1e416269c2e1bd957f98c6b1845dffb218794c55/Services/ConfigurationManager.php#L171-L234 |
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.