repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php | HasarSMHP321fFiscalHelper.generalDiscount | public function generalDiscount($porcentaje_descuento = 0){
$comando = "T".$this->cm('FS').
'Descuento'.$this->cm('FS').
$porcentaje_descuento.$this->cm('FS').
'm'.$this->cm('FS').
'0'.$this->cm('FS').
... | php | public function generalDiscount($porcentaje_descuento = 0){
$comando = "T".$this->cm('FS').
'Descuento'.$this->cm('FS').
$porcentaje_descuento.$this->cm('FS').
'm'.$this->cm('FS').
'0'.$this->cm('FS').
... | [
"public",
"function",
"generalDiscount",
"(",
"$",
"porcentaje_descuento",
"=",
"0",
")",
"{",
"$",
"comando",
"=",
"\"T\"",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")",
".",
"'Descuento'",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")",
".",
"$",... | Responde:
a. Imprimiendo una línea donde se muestra: descripción del descuento (o recargo), impuestos y monto del
descuento (o recargo) -con posterioridad a la impresión de la línea con la leyenda “Descuento (o Recargo)
general”-;
b. Restando
EJEMPLO: T∟Pago Efectivo...∟5.0∟m∟0∟T
@param float $porcentaje_descuento
@r... | [
"Responde",
":",
"a",
".",
"Imprimiendo",
"una",
"línea",
"donde",
"se",
"muestra",
":",
"descripción",
"del",
"descuento",
"(",
"o",
"recargo",
")",
"impuestos",
"y",
"monto",
"del",
"descuento",
"(",
"o",
"recargo",
")",
"-",
"con",
"posterioridad",
"a",... | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php#L103-L111 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php | HasarSMHP321fFiscalHelper.dailyClose | public function dailyClose($tipo_cierre = 'X'){
$tipo_cierre = strtoupper($tipo_cierre);
if($tipo_cierre == 'X' || $tipo_cierre == 'Z'){
$comando = "9".$this->cm('FS').$tipo_cierre;
}
else{
$comando = false;
}
return $comando;
} | php | public function dailyClose($tipo_cierre = 'X'){
$tipo_cierre = strtoupper($tipo_cierre);
if($tipo_cierre == 'X' || $tipo_cierre == 'Z'){
$comando = "9".$this->cm('FS').$tipo_cierre;
}
else{
$comando = false;
}
return $comando;
} | [
"public",
"function",
"dailyClose",
"(",
"$",
"tipo_cierre",
"=",
"'X'",
")",
"{",
"$",
"tipo_cierre",
"=",
"strtoupper",
"(",
"$",
"tipo_cierre",
")",
";",
"if",
"(",
"$",
"tipo_cierre",
"==",
"'X'",
"||",
"$",
"tipo_cierre",
"==",
"'Z'",
")",
"{",
"$... | Imprime el comprobante X/Z
@param $tipo_cierre puede ser:
'X': imprime un cierre X
'Z': imprime un cierre Z | [
"Imprime",
"el",
"comprobante",
"X",
"/",
"Z"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php#L160-L169 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php | HasarSMHP321fFiscalHelper.setCustomerData | public function setCustomerData($nombre_cliente = " ",$documento = " ",$respo_iva = 'C', $tipo_documento = " ", $domicilio = '-') {
$nombre_cliente = substr($nombre_cliente,0,45);
$respo_iva = strtoupper($respo_iva);
$tipo_documento = strtoupper($tipo_documento);
if($respo_iva == 'I' || $respo_iva == 'E' ... | php | public function setCustomerData($nombre_cliente = " ",$documento = " ",$respo_iva = 'C', $tipo_documento = " ", $domicilio = '-') {
$nombre_cliente = substr($nombre_cliente,0,45);
$respo_iva = strtoupper($respo_iva);
$tipo_documento = strtoupper($tipo_documento);
if($respo_iva == 'I' || $respo_iva == 'E' ... | [
"public",
"function",
"setCustomerData",
"(",
"$",
"nombre_cliente",
"=",
"\" \"",
",",
"$",
"documento",
"=",
"\" \"",
",",
"$",
"respo_iva",
"=",
"'C'",
",",
"$",
"tipo_documento",
"=",
"\" \"",
",",
"$",
"domicilio",
"=",
"'-'",
")",
"{",
"$",
"nombre... | Setea los datos del Cliente, por lo general se usa para hacer factura A
@param string $nombre_cliente nombre o razon social
@param integer $documento valor del DNI, CIUT, CUIL, etc
@param CHAR $respo_iva
'I' responsable inscripto
'E' Excento
'A' No responsable
'C' Consumidor final
'T' No categorizado
@param CHAR $tipo... | [
"Setea",
"los",
"datos",
"del",
"Cliente",
"por",
"lo",
"general",
"se",
"usa",
"para",
"hacer",
"factura",
"A"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php#L324-L346 |
alevilar/ristorantino-vendor | Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php | HasarSMHP321fFiscalHelper.openDNFH | public function openDNFH($tipoDocumento, $identificacion = ''){
return "Ç" . $this->cm('FS') .
$tipoDocumento . $this->cm('FS') .
"T" . $this->cm('FS') .
$identificacion
;
} | php | public function openDNFH($tipoDocumento, $identificacion = ''){
return "Ç" . $this->cm('FS') .
$tipoDocumento . $this->cm('FS') .
"T" . $this->cm('FS') .
$identificacion
;
} | [
"public",
"function",
"openDNFH",
"(",
"$",
"tipoDocumento",
",",
"$",
"identificacion",
"=",
"''",
")",
"{",
"return",
"\"Ç\" ",
" ",
"t",
"his-",
">c",
"m(",
"'",
"FS')",
" ",
"",
"$",
"tipoDocumento",
".",
"$",
"this",
"->",
"cm",
"(",
"'FS'",
")"... | Tipo de documento
R: Nota de crédito ‘A’
S: Nota de crédito ‘B/C’
x: Tique recibo ‘X’
<: Tique pagaré
,: Tique presupuesto
-: Comp. de entrega
.: Talón Estacionamiento
/: Cobro de Servicios
0: Ingreso de Dinero
1: Retiro de Dinero
2: Talón de Cambio
3: Talón de reparto
4: Talón de regalo
5: Cuenta Corriente
6: Avisode ... | [
"Tipo",
"de",
"documento",
"R",
":",
"Nota",
"de",
"crédito",
"‘A’",
"S",
":",
"Nota",
"de",
"crédito",
"‘B",
"/",
"C’",
"x",
":",
"Tique",
"recibo",
"‘X’",
"<",
":",
"Tique",
"pagaré",
":",
"Tique",
"presupuesto",
"-",
":",
"Comp",
".",
"de",
"ent... | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Lib/DriverView/Helper/HasarSMHP321fFiscalHelper.php#L393-L399 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.getPluralForm | public function getPluralForm($root) {
$pluralForm = $root;
if (!is_string($root)) {
throw new \InvalidArgumentException('The pluralizer expects a string.');
}
if (!in_array(strtolower($root), $this->uncountable)) {
// This check must be run before `checkIrregularForm` call
if (!$this->isAmbiguousPlu... | php | public function getPluralForm($root) {
$pluralForm = $root;
if (!is_string($root)) {
throw new \InvalidArgumentException('The pluralizer expects a string.');
}
if (!in_array(strtolower($root), $this->uncountable)) {
// This check must be run before `checkIrregularForm` call
if (!$this->isAmbiguousPlu... | [
"public",
"function",
"getPluralForm",
"(",
"$",
"root",
")",
"{",
"$",
"pluralForm",
"=",
"$",
"root",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"root",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The pluralizer expects a strin... | Generate a plural name based on the passed in root.
@param string $root The root that needs to be pluralized (e.g. Author)
@return string The plural form of $root (e.g. Authors).
@throws \InvalidArgumentException If the parameter is not a string. | [
"Generate",
"a",
"plural",
"name",
"based",
"on",
"the",
"passed",
"in",
"root",
"."
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L145-L167 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.getSingularForm | public function getSingularForm($root) {
$singularForm = $root;
if (!is_string($root)) {
throw new \InvalidArgumentException('The pluralizer expects a string.');
}
if (!in_array(strtolower($root), $this->uncountable)) {
if (null !== $replacement = $this->checkIrregularForm($root, array_flip($this->irreg... | php | public function getSingularForm($root) {
$singularForm = $root;
if (!is_string($root)) {
throw new \InvalidArgumentException('The pluralizer expects a string.');
}
if (!in_array(strtolower($root), $this->uncountable)) {
if (null !== $replacement = $this->checkIrregularForm($root, array_flip($this->irreg... | [
"public",
"function",
"getSingularForm",
"(",
"$",
"root",
")",
"{",
"$",
"singularForm",
"=",
"$",
"root",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"root",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The pluralizer expects a s... | Generate a singular name based on the passed in root.
@param string $root The root that needs to be pluralized (e.g. Author)
@return string The singular form of $root (e.g. Authors).
@throws \InvalidArgumentException If the parameter is not a string. | [
"Generate",
"a",
"singular",
"name",
"based",
"on",
"the",
"passed",
"in",
"root",
"."
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L176-L195 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.isPlural | public function isPlural($root) {
$out = false;
if ('' !== $root) {
if (in_array(strtolower($root), $this->uncountable)) {
$out = true;
} else {
$out = $this->isIrregular($this->irregular, $root);
if (!$out) {
$out = $this->isIrregular(array_keys($this->singular), $root);
}
if (!$o... | php | public function isPlural($root) {
$out = false;
if ('' !== $root) {
if (in_array(strtolower($root), $this->uncountable)) {
$out = true;
} else {
$out = $this->isIrregular($this->irregular, $root);
if (!$out) {
$out = $this->isIrregular(array_keys($this->singular), $root);
}
if (!$o... | [
"public",
"function",
"isPlural",
"(",
"$",
"root",
")",
"{",
"$",
"out",
"=",
"false",
";",
"if",
"(",
"''",
"!==",
"$",
"root",
")",
"{",
"if",
"(",
"in_array",
"(",
"strtolower",
"(",
"$",
"root",
")",
",",
"$",
"this",
"->",
"uncountable",
")... | Check if $root word is plural.
@param string $root
@return bool | [
"Check",
"if",
"$root",
"word",
"is",
"plural",
"."
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L204-L224 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.isSingular | public function isSingular($root) {
$out = false;
if ('' === $root) {
$out = true;
} elseif (in_array(strtolower($root), $this->uncountable)) {
$out = true;
} elseif (!$this->isAmbiguousPlural($root)) {
$out = $this->isIrregular($this->irregular, $root);
if (!$out) {
$out = $this->isIrregular(... | php | public function isSingular($root) {
$out = false;
if ('' === $root) {
$out = true;
} elseif (in_array(strtolower($root), $this->uncountable)) {
$out = true;
} elseif (!$this->isAmbiguousPlural($root)) {
$out = $this->isIrregular($this->irregular, $root);
if (!$out) {
$out = $this->isIrregular(... | [
"public",
"function",
"isSingular",
"(",
"$",
"root",
")",
"{",
"$",
"out",
"=",
"false",
";",
"if",
"(",
"''",
"===",
"$",
"root",
")",
"{",
"$",
"out",
"=",
"true",
";",
"}",
"elseif",
"(",
"in_array",
"(",
"strtolower",
"(",
"$",
"root",
")",
... | Check if $root word is singular.
@param $root
@return bool | [
"Check",
"if",
"$root",
"word",
"is",
"singular",
"."
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L233-L253 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.checkIrregularForm | private function checkIrregularForm($root, $irregular) {
foreach ($irregular as $pattern => $result) {
$searchPattern = '/' . $pattern . '$/i';
if ($root !== $replacement = preg_replace($searchPattern, $result, $root)) {
// look at the first char and see if it's upper case
// I know it won't handle more... | php | private function checkIrregularForm($root, $irregular) {
foreach ($irregular as $pattern => $result) {
$searchPattern = '/' . $pattern . '$/i';
if ($root !== $replacement = preg_replace($searchPattern, $result, $root)) {
// look at the first char and see if it's upper case
// I know it won't handle more... | [
"private",
"function",
"checkIrregularForm",
"(",
"$",
"root",
",",
"$",
"irregular",
")",
"{",
"foreach",
"(",
"$",
"irregular",
"as",
"$",
"pattern",
"=>",
"$",
"result",
")",
"{",
"$",
"searchPattern",
"=",
"'/'",
".",
"$",
"pattern",
".",
"'$/i'",
... | Pluralize/Singularize irregular forms.
@param string $root The string to pluralize/singularize
@param array $irregular Array of irregular forms
@return null|string | [
"Pluralize",
"/",
"Singularize",
"irregular",
"forms",
"."
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L263-L278 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.checkIrregularSuffix | private function checkIrregularSuffix($root, $irregular) {
foreach ($irregular as $pattern => $result) {
$searchPattern = '/' . $pattern . '$/i';
if ($root !== $replacement = preg_replace($searchPattern, $result, $root)) {
return $replacement;
}
}
return null;
} | php | private function checkIrregularSuffix($root, $irregular) {
foreach ($irregular as $pattern => $result) {
$searchPattern = '/' . $pattern . '$/i';
if ($root !== $replacement = preg_replace($searchPattern, $result, $root)) {
return $replacement;
}
}
return null;
} | [
"private",
"function",
"checkIrregularSuffix",
"(",
"$",
"root",
",",
"$",
"irregular",
")",
"{",
"foreach",
"(",
"$",
"irregular",
"as",
"$",
"pattern",
"=>",
"$",
"result",
")",
"{",
"$",
"searchPattern",
"=",
"'/'",
".",
"$",
"pattern",
".",
"'$/i'",
... | @param string $root
@param array $irregular Array of irregular suffixes
@return null|string | [
"@param",
"string",
"$root",
"@param",
"array",
"$irregular",
"Array",
"of",
"irregular",
"suffixes"
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L286-L295 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.isAmbiguousPlural | private function isAmbiguousPlural($root) {
foreach ($this->ambiguous as $pattern) {
if (preg_match('/' . $pattern . '$/i', $root)) {
return true;
}
}
return false;
} | php | private function isAmbiguousPlural($root) {
foreach ($this->ambiguous as $pattern) {
if (preg_match('/' . $pattern . '$/i', $root)) {
return true;
}
}
return false;
} | [
"private",
"function",
"isAmbiguousPlural",
"(",
"$",
"root",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"ambiguous",
"as",
"$",
"pattern",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/'",
".",
"$",
"pattern",
".",
"'$/i'",
",",
"$",
"root",
")",
")"... | @param $root
@return bool | [
"@param",
"$root"
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L302-L310 |
phootwork/lang | src/text/EnglishPluralizer.php | EnglishPluralizer.isIrregular | private function isIrregular($irregular, $root) {
foreach ($irregular as $pattern) {
if (preg_match('/' . $pattern . '$/i', $root)) {
return true;
}
}
return false;
} | php | private function isIrregular($irregular, $root) {
foreach ($irregular as $pattern) {
if (preg_match('/' . $pattern . '$/i', $root)) {
return true;
}
}
return false;
} | [
"private",
"function",
"isIrregular",
"(",
"$",
"irregular",
",",
"$",
"root",
")",
"{",
"foreach",
"(",
"$",
"irregular",
"as",
"$",
"pattern",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/'",
".",
"$",
"pattern",
".",
"'$/i'",
",",
"$",
"root",
")",
... | @param array $irregular
@param $root
@return bool | [
"@param",
"array",
"$irregular",
"@param",
"$root"
] | train | https://github.com/phootwork/lang/blob/2e5dc084d9102bf6b4c60f3ec2acc2ef49861588/src/text/EnglishPluralizer.php#L318-L326 |
mothership-ec/composer | src/Composer/Repository/WritableArrayRepository.php | WritableArrayRepository.getCanonicalPackages | public function getCanonicalPackages()
{
$packages = $this->getPackages();
// get at most one package of each name, prefering non-aliased ones
$packagesByName = array();
foreach ($packages as $package) {
if (!isset($packagesByName[$package->getName()]) || $packagesByName... | php | public function getCanonicalPackages()
{
$packages = $this->getPackages();
// get at most one package of each name, prefering non-aliased ones
$packagesByName = array();
foreach ($packages as $package) {
if (!isset($packagesByName[$package->getName()]) || $packagesByName... | [
"public",
"function",
"getCanonicalPackages",
"(",
")",
"{",
"$",
"packages",
"=",
"$",
"this",
"->",
"getPackages",
"(",
")",
";",
"// get at most one package of each name, prefering non-aliased ones",
"$",
"packagesByName",
"=",
"array",
"(",
")",
";",
"foreach",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/WritableArrayRepository.php#L41-L65 |
DesignPond/newsletter | src/Http/Controllers/Frontend/InscriptionController.php | InscriptionController.activation | public function activation($token,$newsletter_id)
{
// Activate the email on the website
$user = $this->subscription->activate($token);
if(!$user)
{
alert()->danger('Le jeton ne correspond pas ou à expiré');
return redirect('/');
}
$newslett... | php | public function activation($token,$newsletter_id)
{
// Activate the email on the website
$user = $this->subscription->activate($token);
if(!$user)
{
alert()->danger('Le jeton ne correspond pas ou à expiré');
return redirect('/');
}
$newslett... | [
"public",
"function",
"activation",
"(",
"$",
"token",
",",
"$",
"newsletter_id",
")",
"{",
"// Activate the email on the website",
"$",
"user",
"=",
"$",
"this",
"->",
"subscription",
"->",
"activate",
"(",
"$",
"token",
")",
";",
"if",
"(",
"!",
"$",
"us... | Activate newsletter abo
GET //activation
@return Response | [
"Activate",
"newsletter",
"abo",
"GET",
"//",
"activation"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Frontend/InscriptionController.php#L33-L68 |
DesignPond/newsletter | src/Http/Controllers/Frontend/InscriptionController.php | InscriptionController.subscribe | public function subscribe(SubscribeRequest $request)
{
$subscribe = $this->subscription->findByEmail($request->input('email'));
if($subscribe)
{
if(!$subscribe->activated_at)
{
alert()->warning('Cet email existe déjà');
return redirec... | php | public function subscribe(SubscribeRequest $request)
{
$subscribe = $this->subscription->findByEmail($request->input('email'));
if($subscribe)
{
if(!$subscribe->activated_at)
{
alert()->warning('Cet email existe déjà');
return redirec... | [
"public",
"function",
"subscribe",
"(",
"SubscribeRequest",
"$",
"request",
")",
"{",
"$",
"subscribe",
"=",
"$",
"this",
"->",
"subscription",
"->",
"findByEmail",
"(",
"$",
"request",
"->",
"input",
"(",
"'email'",
")",
")",
";",
"if",
"(",
"$",
"subsc... | Store a newly created resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Store",
"a",
"newly",
"created",
"resource",
"in",
"storage",
"."
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Frontend/InscriptionController.php#L76-L114 |
DesignPond/newsletter | src/Http/Controllers/Frontend/InscriptionController.php | InscriptionController.unsubscribe | public function unsubscribe(SubscribeRequest $request)
{
// find the abo
$abonne = $this->subscription->findByEmail( $request->input('email') );
if(!$abonne){
return redirect('/')->with(['status' => 'danger', 'message' => '<strong>Aucun abonné avec cet email</strong>']);
... | php | public function unsubscribe(SubscribeRequest $request)
{
// find the abo
$abonne = $this->subscription->findByEmail( $request->input('email') );
if(!$abonne){
return redirect('/')->with(['status' => 'danger', 'message' => '<strong>Aucun abonné avec cet email</strong>']);
... | [
"public",
"function",
"unsubscribe",
"(",
"SubscribeRequest",
"$",
"request",
")",
"{",
"// find the abo",
"$",
"abonne",
"=",
"$",
"this",
"->",
"subscription",
"->",
"findByEmail",
"(",
"$",
"request",
"->",
"input",
"(",
"'email'",
")",
")",
";",
"if",
... | Remove the specified resource from storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Remove",
"the",
"specified",
"resource",
"from",
"storage",
"."
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Frontend/InscriptionController.php#L121-L161 |
DesignPond/newsletter | src/Http/Controllers/Frontend/InscriptionController.php | InscriptionController.resend | public function resend(Request $request)
{
$subscribe = $this->subscription->findByEmail($request->input('email'));
\Mail::send('newsletter::Email.confirmation', ['token' => $subscribe->activation_token, 'newsletter_id' => $request->input('newsletter_id')], function($message) use ($subscribe)
... | php | public function resend(Request $request)
{
$subscribe = $this->subscription->findByEmail($request->input('email'));
\Mail::send('newsletter::Email.confirmation', ['token' => $subscribe->activation_token, 'newsletter_id' => $request->input('newsletter_id')], function($message) use ($subscribe)
... | [
"public",
"function",
"resend",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"subscribe",
"=",
"$",
"this",
"->",
"subscription",
"->",
"findByEmail",
"(",
"$",
"request",
"->",
"input",
"(",
"'email'",
")",
")",
";",
"\\",
"Mail",
"::",
"send",
"(",... | Resend activation link email
POST /inscription/resend/email
@return Response | [
"Resend",
"activation",
"link",
"email",
"POST",
"/",
"inscription",
"/",
"resend",
"/",
"email"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Frontend/InscriptionController.php#L169-L181 |
songshenzong/log | src/DataCollector/EventCollector.php | EventCollector.prepareParams | protected function prepareParams($params)
{
$data = [];
foreach ($params as $key => $value) {
if (is_object($value) && Str::is('Illuminate\*\Events\*', get_class($value))) {
$value = $this->prepareParams(get_object_vars($value));
}
$data[$key] = ht... | php | protected function prepareParams($params)
{
$data = [];
foreach ($params as $key => $value) {
if (is_object($value) && Str::is('Illuminate\*\Events\*', get_class($value))) {
$value = $this->prepareParams(get_object_vars($value));
}
$data[$key] = ht... | [
"protected",
"function",
"prepareParams",
"(",
"$",
"params",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
"&&",
"Str",
"... | @param $params
@return array | [
"@param",
"$params"
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/EventCollector.php#L102-L113 |
thecodingmachine/mvc.splash-common | src/Mouf/Mvc/Splash/Routers/NotFoundRouter.php | NotFoundRouter.process | public function process(Request $request, RequestHandlerInterface $handler): ResponseInterface
{
if ($this->log) {
$this->log->info('404 - Page not found on URL: '.$request->getUri()->getPath());
}
$response = SplashUtils::buildControllerResponse(
function () use ($r... | php | public function process(Request $request, RequestHandlerInterface $handler): ResponseInterface
{
if ($this->log) {
$this->log->info('404 - Page not found on URL: '.$request->getUri()->getPath());
}
$response = SplashUtils::buildControllerResponse(
function () use ($r... | [
"public",
"function",
"process",
"(",
"Request",
"$",
"request",
",",
"RequestHandlerInterface",
"$",
"handler",
")",
":",
"ResponseInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"log",
")",
"{",
"$",
"this",
"->",
"log",
"->",
"info",
"(",
"'404 - Page no... | Process an incoming server request and return a response, optionally delegating
to the next middleware component to create the response.
@param Request $request
@param RequestHandlerInterface $handler
@return ResponseInterface | [
"Process",
"an",
"incoming",
"server",
"request",
"and",
"return",
"a",
"response",
"optionally",
"delegating",
"to",
"the",
"next",
"middleware",
"component",
"to",
"create",
"the",
"response",
"."
] | train | https://github.com/thecodingmachine/mvc.splash-common/blob/eed0269ceda4d7d090a330a220490906a7aa60bd/src/Mouf/Mvc/Splash/Routers/NotFoundRouter.php#L49-L62 |
prooph/link-monitor | src/Controller/ProcessViewController.php | ProcessViewController.populateTaskEvents | private function populateTaskEvents(array &$process)
{
foreach ($process['tasks'] as &$task) {
$task['events'] = [];
foreach ($process['events'] as $event) {
if ($event['task_id'] == $task['id']) {
$task['events'][] = $event;
}
... | php | private function populateTaskEvents(array &$process)
{
foreach ($process['tasks'] as &$task) {
$task['events'] = [];
foreach ($process['events'] as $event) {
if ($event['task_id'] == $task['id']) {
$task['events'][] = $event;
}
... | [
"private",
"function",
"populateTaskEvents",
"(",
"array",
"&",
"$",
"process",
")",
"{",
"foreach",
"(",
"$",
"process",
"[",
"'tasks'",
"]",
"as",
"&",
"$",
"task",
")",
"{",
"$",
"task",
"[",
"'events'",
"]",
"=",
"[",
"]",
";",
"foreach",
"(",
... | Copy each task event to its task
@param array $process | [
"Copy",
"each",
"task",
"event",
"to",
"its",
"task"
] | train | https://github.com/prooph/link-monitor/blob/5dd12a4bda48eb05471181bf4dab43938cf39df8/src/Controller/ProcessViewController.php#L185-L195 |
seagoj/devtools | FileLogger.php | FileLogger.write | public function write($content, $result = null)
{
return file_put_contents(
self::$filename,
self::$formatter->format($content, $result) . PHP_EOL,
FILE_APPEND
);
} | php | public function write($content, $result = null)
{
return file_put_contents(
self::$filename,
self::$formatter->format($content, $result) . PHP_EOL,
FILE_APPEND
);
} | [
"public",
"function",
"write",
"(",
"$",
"content",
",",
"$",
"result",
"=",
"null",
")",
"{",
"return",
"file_put_contents",
"(",
"self",
"::",
"$",
"filename",
",",
"self",
"::",
"$",
"formatter",
"->",
"format",
"(",
"$",
"content",
",",
"$",
"resul... | /* } | [
"/",
"*",
"}"
] | train | https://github.com/seagoj/devtools/blob/15dd451a0b00c272d3e1961f114342d5e0f526ba/FileLogger.php#L20-L27 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Statistics.php | Statistics.getDeprecatedCounter | protected function getDeprecatedCounter(ProjectDescriptor $project)
{
$deprecatedCounter = 0;
/** @var DescriptorAbstract $element */
foreach ($project->getIndexes()->get('elements') as $element) {
if ($element->isDeprecated()) {
$deprecatedCounter += 1;
... | php | protected function getDeprecatedCounter(ProjectDescriptor $project)
{
$deprecatedCounter = 0;
/** @var DescriptorAbstract $element */
foreach ($project->getIndexes()->get('elements') as $element) {
if ($element->isDeprecated()) {
$deprecatedCounter += 1;
... | [
"protected",
"function",
"getDeprecatedCounter",
"(",
"ProjectDescriptor",
"$",
"project",
")",
"{",
"$",
"deprecatedCounter",
"=",
"0",
";",
"/** @var DescriptorAbstract $element */",
"foreach",
"(",
"$",
"project",
"->",
"getIndexes",
"(",
")",
"->",
"get",
"(",
... | Get number of deprecated elements.
@param ProjectDescriptor $project
@return int | [
"Get",
"number",
"of",
"deprecated",
"elements",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Statistics.php#L135-L147 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Security/Policy.php | Dwoo_Security_Policy.allowPhpFunction | public function allowPhpFunction($func)
{
if (is_array($func))
foreach ($func as $fname)
$this->allowedPhpFunctions[strtolower($fname)] = true;
else
$this->allowedPhpFunctions[strtolower($func)] = true;
} | php | public function allowPhpFunction($func)
{
if (is_array($func))
foreach ($func as $fname)
$this->allowedPhpFunctions[strtolower($fname)] = true;
else
$this->allowedPhpFunctions[strtolower($func)] = true;
} | [
"public",
"function",
"allowPhpFunction",
"(",
"$",
"func",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"func",
")",
")",
"foreach",
"(",
"$",
"func",
"as",
"$",
"fname",
")",
"$",
"this",
"->",
"allowedPhpFunctions",
"[",
"strtolower",
"(",
"$",
"fname... | adds a php function to the allowed list
@param mixed $func function name or array of function names | [
"adds",
"a",
"php",
"function",
"to",
"the",
"allowed",
"list"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Security/Policy.php#L84-L91 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Security/Policy.php | Dwoo_Security_Policy.allowDirectory | public function allowDirectory($path)
{
if (is_array($path))
foreach ($path as $dir)
$this->allowedDirectories[realpath($dir)] = true;
else
$this->allowedDirectories[realpath($path)] = true;
} | php | public function allowDirectory($path)
{
if (is_array($path))
foreach ($path as $dir)
$this->allowedDirectories[realpath($dir)] = true;
else
$this->allowedDirectories[realpath($path)] = true;
} | [
"public",
"function",
"allowDirectory",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"path",
")",
")",
"foreach",
"(",
"$",
"path",
"as",
"$",
"dir",
")",
"$",
"this",
"->",
"allowedDirectories",
"[",
"realpath",
"(",
"$",
"dir",
")",... | adds a directory to the safelist for includes and other file-access plugins
note that all the includePath directories you provide to the Dwoo_Template_File class
are automatically marked as safe
@param mixed $path a path name or an array of paths | [
"adds",
"a",
"directory",
"to",
"the",
"safelist",
"for",
"includes",
"and",
"other",
"file",
"-",
"access",
"plugins"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Security/Policy.php#L126-L133 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Security/Policy.php | Dwoo_Security_Policy.disallowDirectory | public function disallowDirectory($path)
{
if (is_array($path))
foreach ($path as $dir)
unset($this->allowedDirectories[realpath($dir)]);
else
unset($this->allowedDirectories[realpath($path)]);
} | php | public function disallowDirectory($path)
{
if (is_array($path))
foreach ($path as $dir)
unset($this->allowedDirectories[realpath($dir)]);
else
unset($this->allowedDirectories[realpath($path)]);
} | [
"public",
"function",
"disallowDirectory",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"path",
")",
")",
"foreach",
"(",
"$",
"path",
"as",
"$",
"dir",
")",
"unset",
"(",
"$",
"this",
"->",
"allowedDirectories",
"[",
"realpath",
"(",
... | removes a directory from the safelist
@param mixed $path a path name or an array of paths | [
"removes",
"a",
"directory",
"from",
"the",
"safelist"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Security/Policy.php#L140-L147 |
fkooman/php-lib-http | src/fkooman/Http/Request.php | Request.getHeader | public function getHeader($keyName)
{
$headers = $this->getHeaders();
$keyName = self::normalizeHeaderKeyName($keyName);
if (array_key_exists($keyName, $headers)) {
return $headers[$keyName];
}
return;
} | php | public function getHeader($keyName)
{
$headers = $this->getHeaders();
$keyName = self::normalizeHeaderKeyName($keyName);
if (array_key_exists($keyName, $headers)) {
return $headers[$keyName];
}
return;
} | [
"public",
"function",
"getHeader",
"(",
"$",
"keyName",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"getHeaders",
"(",
")",
";",
"$",
"keyName",
"=",
"self",
"::",
"normalizeHeaderKeyName",
"(",
"$",
"keyName",
")",
";",
"if",
"(",
"array_key_exist... | Get the value of the request header keyname.
@param string $keyName the HTTP header keyname
@return mixed the value of the header keyname as string or null if the
header key is not set | [
"Get",
"the",
"value",
"of",
"the",
"request",
"header",
"keyname",
"."
] | train | https://github.com/fkooman/php-lib-http/blob/94956a480459b7f6b880d61f21ef03e683deb995/src/fkooman/Http/Request.php#L130-L139 |
fkooman/php-lib-http | src/fkooman/Http/Request.php | Request.getHeaders | public function getHeaders()
{
$headers = [];
foreach ($this->srv as $k => $v) {
$headers[self::normalizeHeaderKeyName($k)] = $v;
}
return $headers;
} | php | public function getHeaders()
{
$headers = [];
foreach ($this->srv as $k => $v) {
$headers[self::normalizeHeaderKeyName($k)] = $v;
}
return $headers;
} | [
"public",
"function",
"getHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"srv",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"headers",
"[",
"self",
"::",
"normalizeHeaderKeyName",
"(",
"$",
"k",
... | Get the HTTP headers.
@return array the HTTP headers as a key-value array | [
"Get",
"the",
"HTTP",
"headers",
"."
] | train | https://github.com/fkooman/php-lib-http/blob/94956a480459b7f6b880d61f21ef03e683deb995/src/fkooman/Http/Request.php#L146-L154 |
fkooman/php-lib-http | src/fkooman/Http/Request.php | Request.normalizeHeaderKeyName | public static function normalizeHeaderKeyName($keyName)
{
if (0 === mb_stripos($keyName, 'HTTP_') || 0 === mb_stripos($keyName, 'HTTP-')) {
$keyName = mb_substr($keyName, 5);
}
return str_replace(
' ',
'-',
mb_convert_case(
mb_... | php | public static function normalizeHeaderKeyName($keyName)
{
if (0 === mb_stripos($keyName, 'HTTP_') || 0 === mb_stripos($keyName, 'HTTP-')) {
$keyName = mb_substr($keyName, 5);
}
return str_replace(
' ',
'-',
mb_convert_case(
mb_... | [
"public",
"static",
"function",
"normalizeHeaderKeyName",
"(",
"$",
"keyName",
")",
"{",
"if",
"(",
"0",
"===",
"mb_stripos",
"(",
"$",
"keyName",
",",
"'HTTP_'",
")",
"||",
"0",
"===",
"mb_stripos",
"(",
"$",
"keyName",
",",
"'HTTP-'",
")",
")",
"{",
... | Normalize a HTTP request header keyname. It will remove any HTTP_ or
HTTP- prefix, replace all underscores with dashes and capitalize the
first letter(s). For example:.
HTTP_ACCEPT: Accept
CONTENT_TYPE: Content-Type
@param string $keyName the keyname to normalize
@return string the normalized keyname | [
"Normalize",
"a",
"HTTP",
"request",
"header",
"keyname",
".",
"It",
"will",
"remove",
"any",
"HTTP_",
"or",
"HTTP",
"-",
"prefix",
"replace",
"all",
"underscores",
"with",
"dashes",
"and",
"capitalize",
"the",
"first",
"letter",
"(",
"s",
")",
".",
"For",... | train | https://github.com/fkooman/php-lib-http/blob/94956a480459b7f6b880d61f21ef03e683deb995/src/fkooman/Http/Request.php#L178-L199 |
thelia-modules/CustomerGroup | Model/Map/CustomerCustomerGroupTableMap.php | CustomerCustomerGroupTableMap.addInstanceToPool | public static function addInstanceToPool($obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if (null === $key) {
$key = serialize(array((string) $obj->getCustomerId(), (string) $obj->getCustomerGroupId()));
} // if key === null
self::$instances... | php | public static function addInstanceToPool($obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if (null === $key) {
$key = serialize(array((string) $obj->getCustomerId(), (string) $obj->getCustomerGroupId()));
} // if key === null
self::$instances... | [
"public",
"static",
"function",
"addInstanceToPool",
"(",
"$",
"obj",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"Propel",
"::",
"isInstancePoolingEnabled",
"(",
")",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"key",
")",
"{",
"$",
"key",
"=",
... | Adds an object to the instance pool.
Propel keeps cached copies of objects in an instance pool when they are retrieved
from the database. In some cases you may need to explicitly add objects
to the cache in order to ensure that the same objects are always returned by find*()
and findPk*() calls.
@param \CustomerGroup... | [
"Adds",
"an",
"object",
"to",
"the",
"instance",
"pool",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerCustomerGroupTableMap.php#L159-L167 |
thelia-modules/CustomerGroup | Model/Map/CustomerCustomerGroupTableMap.php | CustomerCustomerGroupTableMap.removeInstanceFromPool | public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \CustomerGroup\Model\CustomerCustomerGroup) {
$key = serialize(array((string) $value->getCustomerId(), (string) $value->... | php | public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \CustomerGroup\Model\CustomerCustomerGroup) {
$key = serialize(array((string) $value->getCustomerId(), (string) $value->... | [
"public",
"static",
"function",
"removeInstanceFromPool",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"Propel",
"::",
"isInstancePoolingEnabled",
"(",
")",
"&&",
"null",
"!==",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
"&&",
"$"... | Removes an object from the instance pool.
Propel keeps cached copies of objects in an instance pool when they are retrieved
from the database. In some cases -- especially when you override doDelete
methods in your stub classes -- you may need to explicitly remove objects
from the cache in order to prevent returning o... | [
"Removes",
"an",
"object",
"from",
"the",
"instance",
"pool",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerCustomerGroupTableMap.php#L179-L199 |
thelia-modules/CustomerGroup | Model/Map/CustomerCustomerGroupTableMap.php | CustomerCustomerGroupTableMap.addSelectColumns | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CustomerCustomerGroupTableMap::CUSTOMER_ID);
$criteria->addSelectColumn(CustomerCustomerGroupTableMap::CUSTOMER_GROUP_ID);
} else {
$crit... | php | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CustomerCustomerGroupTableMap::CUSTOMER_ID);
$criteria->addSelectColumn(CustomerCustomerGroupTableMap::CUSTOMER_GROUP_ID);
} else {
$crit... | [
"public",
"static",
"function",
"addSelectColumns",
"(",
"Criteria",
"$",
"criteria",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"alias",
")",
"{",
"$",
"criteria",
"->",
"addSelectColumn",
"(",
"CustomerCustomerGroupTableMap",
... | Add all the columns needed to create a new object.
Note: any columns that were marked with lazyLoad="true" in the
XML schema will not be added to the select list and only loaded
on demand.
@param Criteria $criteria object containing the columns to add.
@param string $alias optional table alias
@throws PropelExce... | [
"Add",
"all",
"the",
"columns",
"needed",
"to",
"create",
"a",
"new",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerCustomerGroupTableMap.php#L332-L341 |
thelia-modules/CustomerGroup | Model/Map/CustomerCustomerGroupTableMap.php | CustomerCustomerGroupTableMap.buildTableMap | public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CustomerCustomerGroupTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(CustomerCustomerGroupTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new CustomerCustomerGroupTableMap());
}
} | php | public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CustomerCustomerGroupTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(CustomerCustomerGroupTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new CustomerCustomerGroupTableMap());
}
} | [
"public",
"static",
"function",
"buildTableMap",
"(",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getDatabaseMap",
"(",
"CustomerCustomerGroupTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"!",
"$",
"dbMap",
"->... | Add a TableMap instance to the database for this tableMap class. | [
"Add",
"a",
"TableMap",
"instance",
"to",
"the",
"database",
"for",
"this",
"tableMap",
"class",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerCustomerGroupTableMap.php#L358-L364 |
thelia-modules/CustomerGroup | Model/Map/CustomerCustomerGroupTableMap.php | CustomerCustomerGroupTableMap.doDelete | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerCustomerGroupTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
... | php | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CustomerCustomerGroupTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
... | [
"public",
"static",
"function",
"doDelete",
"(",
"$",
"values",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getW... | Performs a DELETE on the database, given a CustomerCustomerGroup or Criteria object OR a primary key value.
@param mixed $values Criteria or CustomerCustomerGroup object or primary key or array of primary keys
which is used to create the DELETE statement
@param ConnectionInterface $con the connection to ... | [
"Performs",
"a",
"DELETE",
"on",
"the",
"database",
"given",
"a",
"CustomerCustomerGroup",
"or",
"Criteria",
"object",
"OR",
"a",
"primary",
"key",
"value",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerCustomerGroupTableMap.php#L377-L413 |
mothership-ec/composer | src/Composer/Factory.php | Factory.getCacheDir | protected static function getCacheDir($home)
{
$cacheDir = getenv('COMPOSER_CACHE_DIR');
if (!$cacheDir) {
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
if ($cacheDir = getenv('LOCALAPPDATA')) {
$cacheDir .= '/Composer';
} else {
... | php | protected static function getCacheDir($home)
{
$cacheDir = getenv('COMPOSER_CACHE_DIR');
if (!$cacheDir) {
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
if ($cacheDir = getenv('LOCALAPPDATA')) {
$cacheDir .= '/Composer';
} else {
... | [
"protected",
"static",
"function",
"getCacheDir",
"(",
"$",
"home",
")",
"{",
"$",
"cacheDir",
"=",
"getenv",
"(",
"'COMPOSER_CACHE_DIR'",
")",
";",
"if",
"(",
"!",
"$",
"cacheDir",
")",
"{",
"if",
"(",
"defined",
"(",
"'PHP_WINDOWS_VERSION_MAJOR'",
")",
"... | @param string $home
@return string | [
"@param",
"string",
"$home"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Factory.php#L67-L84 |
mothership-ec/composer | src/Composer/Factory.php | Factory.createComposer | public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, $cwd = null, $fullLoad = true)
{
$cwd = $cwd ?: getcwd();
// load Composer configuration
if (null === $localConfig) {
$localConfig = static::getComposerFile();
}
if (is... | php | public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, $cwd = null, $fullLoad = true)
{
$cwd = $cwd ?: getcwd();
// load Composer configuration
if (null === $localConfig) {
$localConfig = static::getComposerFile();
}
if (is... | [
"public",
"function",
"createComposer",
"(",
"IOInterface",
"$",
"io",
",",
"$",
"localConfig",
"=",
"null",
",",
"$",
"disablePlugins",
"=",
"false",
",",
"$",
"cwd",
"=",
"null",
",",
"$",
"fullLoad",
"=",
"true",
")",
"{",
"$",
"cwd",
"=",
"$",
"c... | Creates a Composer instance
@param IOInterface $io IO instance
@param array|string|null $localConfig either a configuration array or a filename to read from, if null it will
read from the default filename
@param bool $disablePlugins Whether plugins should no... | [
"Creates",
"a",
"Composer",
"instance"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Factory.php#L198-L314 |
mothership-ec/composer | src/Composer/Factory.php | Factory.createArchiveManager | public function createArchiveManager(Config $config, Downloader\DownloadManager $dm = null)
{
if (null === $dm) {
$io = new IO\NullIO();
$io->loadConfiguration($config);
$dm = $this->createDownloadManager($io, $config);
}
$am = new Archiver\ArchiveManager... | php | public function createArchiveManager(Config $config, Downloader\DownloadManager $dm = null)
{
if (null === $dm) {
$io = new IO\NullIO();
$io->loadConfiguration($config);
$dm = $this->createDownloadManager($io, $config);
}
$am = new Archiver\ArchiveManager... | [
"public",
"function",
"createArchiveManager",
"(",
"Config",
"$",
"config",
",",
"Downloader",
"\\",
"DownloadManager",
"$",
"dm",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"dm",
")",
"{",
"$",
"io",
"=",
"new",
"IO",
"\\",
"NullIO",
"(",
... | @param Config $config The configuration
@param Downloader\DownloadManager $dm Manager use to download sources
@return Archiver\ArchiveManager | [
"@param",
"Config",
"$config",
"The",
"configuration",
"@param",
"Downloader",
"\\",
"DownloadManager",
"$dm",
"Manager",
"use",
"to",
"download",
"sources"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Factory.php#L416-L428 |
fapi-cz/http-client | src/Fapi/HttpClient/Utils/Callback.php | Callback.invokeSafe | public static function invokeSafe(callable $function, array $args, callable $onError)
{
/** @noinspection PhpUnusedLocalVariableInspection */
$prev = \set_error_handler(static function ($severity, $message, $file) use ($onError, & $prev) {
if ($file === __FILE__ && $onError($message, $severity) !== false) {
... | php | public static function invokeSafe(callable $function, array $args, callable $onError)
{
/** @noinspection PhpUnusedLocalVariableInspection */
$prev = \set_error_handler(static function ($severity, $message, $file) use ($onError, & $prev) {
if ($file === __FILE__ && $onError($message, $severity) !== false) {
... | [
"public",
"static",
"function",
"invokeSafe",
"(",
"callable",
"$",
"function",
",",
"array",
"$",
"args",
",",
"callable",
"$",
"onError",
")",
"{",
"/** @noinspection PhpUnusedLocalVariableInspection */",
"$",
"prev",
"=",
"\\",
"set_error_handler",
"(",
"static",... | Invokes internal PHP function with own error handler.
@param callable $function
@param mixed[] $args
@param callable $onError function($message, $severity)
@return mixed
@throws \Throwable | [
"Invokes",
"internal",
"PHP",
"function",
"with",
"own",
"error",
"handler",
"."
] | train | https://github.com/fapi-cz/http-client/blob/5aeed581c5c115fb4d2f72b46e2ce27f91a1c999/src/Fapi/HttpClient/Utils/Callback.php#L25-L50 |
ouropencode/dachi | src/Configuration.php | Configuration.get | public static function get($key, $default = "default") {
if(self::$config == array())
self::load();
$env = Kernel::getEnvironment();
$position = self::$config[$env];
$token = strtok($key, '.');
while($token !== false) {
$nextToken = strtok('.');
if(!isset($position[$token]))
return $default;
... | php | public static function get($key, $default = "default") {
if(self::$config == array())
self::load();
$env = Kernel::getEnvironment();
$position = self::$config[$env];
$token = strtok($key, '.');
while($token !== false) {
$nextToken = strtok('.');
if(!isset($position[$token]))
return $default;
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"\"default\"",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"config",
"==",
"array",
"(",
")",
")",
"self",
"::",
"load",
"(",
")",
";",
"$",
"env",
"=",
"Kernel",
"::",... | Get a configuration entry
@param string $key The configuration key to retrieve (e.g. dachi.siteName or api.twitter.publicKey)
@param string $default The default value to return if the key was not found
@return mixed | [
"Get",
"a",
"configuration",
"entry"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Configuration.php#L51-L71 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/Tags/ThrowsAssembler.php | ThrowsAssembler.create | public function create($data)
{
$descriptor = new ThrowsDescriptor($data->getName());
$descriptor->setDescription($data->getDescription());
$descriptor->setTypes(
$this->builder->buildDescriptor(new Collection($data->getTypes()))
);
return $descriptor;
} | php | public function create($data)
{
$descriptor = new ThrowsDescriptor($data->getName());
$descriptor->setDescription($data->getDescription());
$descriptor->setTypes(
$this->builder->buildDescriptor(new Collection($data->getTypes()))
);
return $descriptor;
} | [
"public",
"function",
"create",
"(",
"$",
"data",
")",
"{",
"$",
"descriptor",
"=",
"new",
"ThrowsDescriptor",
"(",
"$",
"data",
"->",
"getName",
"(",
")",
")",
";",
"$",
"descriptor",
"->",
"setDescription",
"(",
"$",
"data",
"->",
"getDescription",
"("... | Creates a new Descriptor from the given Reflector.
@param ThrowsTag $data
@return ThrowsDescriptor | [
"Creates",
"a",
"new",
"Descriptor",
"from",
"the",
"given",
"Reflector",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/Tags/ThrowsAssembler.php#L34-L43 |
xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Message/RequestFactory.php | RequestFactory.cloneRequestWithMethod | public function cloneRequestWithMethod(RequestInterface $request, $method)
{
// Create the request with the same client if possible
if ($client = $request->getClient()) {
$cloned = $request->getClient()->createRequest($method, $request->getUrl(), $request->getHeaders());
} else {... | php | public function cloneRequestWithMethod(RequestInterface $request, $method)
{
// Create the request with the same client if possible
if ($client = $request->getClient()) {
$cloned = $request->getClient()->createRequest($method, $request->getUrl(), $request->getHeaders());
} else {... | [
"public",
"function",
"cloneRequestWithMethod",
"(",
"RequestInterface",
"$",
"request",
",",
"$",
"method",
")",
"{",
"// Create the request with the same client if possible",
"if",
"(",
"$",
"client",
"=",
"$",
"request",
"->",
"getClient",
"(",
")",
")",
"{",
"... | Clone a request while changing the method. Emulates the behavior of
{@see Guzzle\Http\Message\Request::clone}, but can change the HTTP method.
@param RequestInterface $request Request to clone
@param string $method Method to set
@return RequestInterface | [
"Clone",
"a",
"request",
"while",
"changing",
"the",
"method",
".",
"Emulates",
"the",
"behavior",
"of",
"{",
"@see",
"Guzzle",
"\\",
"Http",
"\\",
"Message",
"\\",
"Request",
"::",
"clone",
"}",
"but",
"can",
"change",
"the",
"HTTP",
"method",
"."
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Message/RequestFactory.php#L139-L160 |
DataDo/data | src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php | DefaultQueryBuilder.build | public function build($tokens, $tableName, $namingConvention, $class)
{
$resultMode = $this->getMode($tokens);
$fields = $this->getFields($tokens, $namingConvention, $class);
$constraints = $this->getConstraints($tokens, $namingConvention, $class);
switch ($resultMode) {
... | php | public function build($tokens, $tableName, $namingConvention, $class)
{
$resultMode = $this->getMode($tokens);
$fields = $this->getFields($tokens, $namingConvention, $class);
$constraints = $this->getConstraints($tokens, $namingConvention, $class);
switch ($resultMode) {
... | [
"public",
"function",
"build",
"(",
"$",
"tokens",
",",
"$",
"tableName",
",",
"$",
"namingConvention",
",",
"$",
"class",
")",
"{",
"$",
"resultMode",
"=",
"$",
"this",
"->",
"getMode",
"(",
"$",
"tokens",
")",
";",
"$",
"fields",
"=",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php#L26-L45 |
DataDo/data | src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php | DefaultQueryBuilder.getMode | private function getMode($tokens)
{
switch ($tokens->getQueryMode()) {
case 'find':
return QueryBuilderResult::RESULT_SELECT_MULTIPLE;
case 'get':
return QueryBuilderResult::RESULT_SELECT_SINGLE;
case 'delete':
return QueryB... | php | private function getMode($tokens)
{
switch ($tokens->getQueryMode()) {
case 'find':
return QueryBuilderResult::RESULT_SELECT_MULTIPLE;
case 'get':
return QueryBuilderResult::RESULT_SELECT_SINGLE;
case 'delete':
return QueryB... | [
"private",
"function",
"getMode",
"(",
"$",
"tokens",
")",
"{",
"switch",
"(",
"$",
"tokens",
"->",
"getQueryMode",
"(",
")",
")",
"{",
"case",
"'find'",
":",
"return",
"QueryBuilderResult",
"::",
"RESULT_SELECT_MULTIPLE",
";",
"case",
"'get'",
":",
"return"... | Get the result type for a MethodNameToken.
@param MethodNameToken $tokens
@return int The result type
@throws DslSyntaxException if no supported mode was found | [
"Get",
"the",
"result",
"type",
"for",
"a",
"MethodNameToken",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php#L55-L67 |
DataDo/data | src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php | DefaultQueryBuilder.getFields | private function getFields($tokens, $namingConvention, $class)
{
$fields = [];
$prefix = '';
foreach ($tokens->getTokens() as $token) {
if ($token instanceof ByToken) {
return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
}
... | php | private function getFields($tokens, $namingConvention, $class)
{
$fields = [];
$prefix = '';
foreach ($tokens->getTokens() as $token) {
if ($token instanceof ByToken) {
return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
}
... | [
"private",
"function",
"getFields",
"(",
"$",
"tokens",
",",
"$",
"namingConvention",
",",
"$",
"class",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"$",
"prefix",
"=",
"''",
";",
"foreach",
"(",
"$",
"tokens",
"->",
"getTokens",
"(",
")",
"as",
"... | Build the SQL string for the fields from a MethodNameToken
@param MethodNameToken $tokens
@param NamingConvention $namingConvention
@param ReflectionClass $class
@return string
@throws DslSyntaxException if an unexpected token is found | [
"Build",
"the",
"SQL",
"string",
"for",
"the",
"fields",
"from",
"a",
"MethodNameToken"
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php#L77-L109 |
DataDo/data | src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php | DefaultQueryBuilder.tokenToColumn | private function tokenToColumn($token, $namingConvention, $class)
{
// Find a matching property
$property = null;
foreach ($class->getProperties() as $prop) {
if (strcasecmp($token->getSource(), $prop->getName()) === 0) {
$property = $prop;
break;
... | php | private function tokenToColumn($token, $namingConvention, $class)
{
// Find a matching property
$property = null;
foreach ($class->getProperties() as $prop) {
if (strcasecmp($token->getSource(), $prop->getName()) === 0) {
$property = $prop;
break;
... | [
"private",
"function",
"tokenToColumn",
"(",
"$",
"token",
",",
"$",
"namingConvention",
",",
"$",
"class",
")",
"{",
"// Find a matching property",
"$",
"property",
"=",
"null",
";",
"foreach",
"(",
"$",
"class",
"->",
"getProperties",
"(",
")",
"as",
"$",
... | Get the column name for a token.
@param ValueToken $token
@param NamingConvention $namingConvention
@param ReflectionClass $class
@return string
@throws DslSyntaxException when no matching property could be found | [
"Get",
"the",
"column",
"name",
"for",
"a",
"token",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Query/DefaultQueryBuilder.php#L206-L222 |
caffeinated/beverage | src/Arr.php | Arr.unflatten | public static function unflatten(array $array, $delimiter = '.')
{
$unflattenedArray = array();
foreach ($array as $key => $value) {
$keyList = explode($delimiter, $key);
$firstKey = array_shift($keyList);
if (sizeof($keyList) > 0) {
$subArray =... | php | public static function unflatten(array $array, $delimiter = '.')
{
$unflattenedArray = array();
foreach ($array as $key => $value) {
$keyList = explode($delimiter, $key);
$firstKey = array_shift($keyList);
if (sizeof($keyList) > 0) {
$subArray =... | [
"public",
"static",
"function",
"unflatten",
"(",
"array",
"$",
"array",
",",
"$",
"delimiter",
"=",
"'.'",
")",
"{",
"$",
"unflattenedArray",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
... | Unflattens a single stacked array back into a multidimensional array.
@param array $array
@param string $delimiter
@return array | [
"Unflattens",
"a",
"single",
"stacked",
"array",
"back",
"into",
"a",
"multidimensional",
"array",
"."
] | train | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Arr.php#L28-L48 |
Speicher210/monsum-api | src/Service/Coupon/CouponService.php | CouponService.getCoupons | public function getCoupons($code = null)
{
$requestData = new Get\RequestData($code);
$request = new Get\Request($requestData);
$apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
/** @var Get\Response $response */
$response = $apiResponse->getResponse();
... | php | public function getCoupons($code = null)
{
$requestData = new Get\RequestData($code);
$request = new Get\Request($requestData);
$apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
/** @var Get\Response $response */
$response = $apiResponse->getResponse();
... | [
"public",
"function",
"getCoupons",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"requestData",
"=",
"new",
"Get",
"\\",
"RequestData",
"(",
"$",
"code",
")",
";",
"$",
"request",
"=",
"new",
"Get",
"\\",
"Request",
"(",
"$",
"requestData",
")",
";"... | Get the coupons.
@param string $code The code to get.
@return Get\ApiResponse | [
"Get",
"the",
"coupons",
"."
] | train | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Coupon/CouponService.php#L18-L39 |
Speicher210/monsum-api | src/Service/Coupon/CouponService.php | CouponService.checkCoupon | public function checkCoupon($code, $articleNumber)
{
$requestData = new Check\RequestData($code, $articleNumber);
$request = new Check\Request($requestData);
return $this->sendRequest($request, Check\ApiResponse::class);
} | php | public function checkCoupon($code, $articleNumber)
{
$requestData = new Check\RequestData($code, $articleNumber);
$request = new Check\Request($requestData);
return $this->sendRequest($request, Check\ApiResponse::class);
} | [
"public",
"function",
"checkCoupon",
"(",
"$",
"code",
",",
"$",
"articleNumber",
")",
"{",
"$",
"requestData",
"=",
"new",
"Check",
"\\",
"RequestData",
"(",
"$",
"code",
",",
"$",
"articleNumber",
")",
";",
"$",
"request",
"=",
"new",
"Check",
"\\",
... | Check a coupon.
@param string $code The code to check.
@param string $articleNumber The article number.
@return Check\ApiResponse | [
"Check",
"a",
"coupon",
"."
] | train | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Coupon/CouponService.php#L48-L54 |
surebert/surebert-framework | src/sb/Socket/Client.php | Client.open | public function open()
{
$this->log('open socket connection');
$this->socket = fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout);
if ($this->socket) {
socket_set_blocking($this->socket, 1);
return true;
} else {
throw(new \Exce... | php | public function open()
{
$this->log('open socket connection');
$this->socket = fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout);
if ($this->socket) {
socket_set_blocking($this->socket, 1);
return true;
} else {
throw(new \Exce... | [
"public",
"function",
"open",
"(",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'open socket connection'",
")",
";",
"$",
"this",
"->",
"socket",
"=",
"fsockopen",
"(",
"$",
"this",
"->",
"host",
",",
"$",
"this",
"->",
"port",
",",
"$",
"errno",
",",
... | Open the connection
@return boolean Throws exception on error | [
"Open",
"the",
"connection"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Socket/Client.php#L74-L86 |
surebert/surebert-framework | src/sb/Socket/Client.php | Client.close | public function close()
{
$this->log('close socket connection');
$state = fclose($this->socket);
if ($state) {
$this->socket = null;
}
return $state;
} | php | public function close()
{
$this->log('close socket connection');
$state = fclose($this->socket);
if ($state) {
$this->socket = null;
}
return $state;
} | [
"public",
"function",
"close",
"(",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'close socket connection'",
")",
";",
"$",
"state",
"=",
"fclose",
"(",
"$",
"this",
"->",
"socket",
")",
";",
"if",
"(",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"sock... | Closes the connection. Automatically is called on __destruct
@return boolean | [
"Closes",
"the",
"connection",
".",
"Automatically",
"is",
"called",
"on",
"__destruct"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Socket/Client.php#L92-L102 |
wplibs/rules | src/Variable.php | Variable.get_property | public function get_property( $name, $value = null ) {
if ( ! array_key_exists( $name, $this->properties ) ) {
$this->properties[ $name ] = new Variable_Property( $this, $name, $value );
}
return $this->properties[ $name ];
} | php | public function get_property( $name, $value = null ) {
if ( ! array_key_exists( $name, $this->properties ) ) {
$this->properties[ $name ] = new Variable_Property( $this, $name, $value );
}
return $this->properties[ $name ];
} | [
"public",
"function",
"get_property",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"properties",
")",
")",
"{",
"$",
"this",
"->",
"properties",
"[",
"$",
... | Get a property (create new if not exists).
@param string $name The property name.
@param mixed $value The default value.
@return \WPLibs\Rules\Variable_Property | [
"Get",
"a",
"property",
"(",
"create",
"new",
"if",
"not",
"exists",
")",
"."
] | train | https://github.com/wplibs/rules/blob/29b4495e2ae87349fd64fcd844f3ba96cc268e3d/src/Variable.php#L102-L108 |
wplibs/rules | src/Variable.php | Variable.set_property | public function set_property( $name, $value ) {
$property = $this->get_property( $name );
$property->setValue( $value );
return $property;
} | php | public function set_property( $name, $value ) {
$property = $this->get_property( $name );
$property->setValue( $value );
return $property;
} | [
"public",
"function",
"set_property",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"property",
"=",
"$",
"this",
"->",
"get_property",
"(",
"$",
"name",
")",
";",
"$",
"property",
"->",
"setValue",
"(",
"$",
"value",
")",
";",
"return",
"$",
... | Set a property value.
@param string $name The property name.
@param mixed $value The property value.
@return \WPLibs\Rules\Variable_Property | [
"Set",
"a",
"property",
"value",
"."
] | train | https://github.com/wplibs/rules/blob/29b4495e2ae87349fd64fcd844f3ba96cc268e3d/src/Variable.php#L117-L123 |
giftcards/Encryption | CipherText/Rotator/RotatorBuilder.php | RotatorBuilder.addStore | public function addStore($storeName, $builderName, array $options = array())
{
$this->storeRegistryBuilder->addStore($storeName, $builderName, $options);
} | php | public function addStore($storeName, $builderName, array $options = array())
{
$this->storeRegistryBuilder->addStore($storeName, $builderName, $options);
} | [
"public",
"function",
"addStore",
"(",
"$",
"storeName",
",",
"$",
"builderName",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"storeRegistryBuilder",
"->",
"addStore",
"(",
"$",
"storeName",
",",
"$",
"builderName",
... | Adds a store to the builder
@param $storeName
@param $builderName
@param array $options | [
"Adds",
"a",
"store",
"to",
"the",
"builder"
] | train | https://github.com/giftcards/Encryption/blob/a48f92408538e2ffe1c8603f168d57803aad7100/CipherText/Rotator/RotatorBuilder.php#L60-L63 |
semibreve/minim | src/Authenticator.php | Authenticator.dispenseToken | private function dispenseToken()
{
$token = bin2hex(random_bytes($this->config->getTokenLength())); // Generate token.
$arr = array(
'token' => $token,
'expires' => time() + $this->config->getTokenTtl()
); // Prepare array containing token and expiry.
$plain... | php | private function dispenseToken()
{
$token = bin2hex(random_bytes($this->config->getTokenLength())); // Generate token.
$arr = array(
'token' => $token,
'expires' => time() + $this->config->getTokenTtl()
); // Prepare array containing token and expiry.
$plain... | [
"private",
"function",
"dispenseToken",
"(",
")",
"{",
"$",
"token",
"=",
"bin2hex",
"(",
"random_bytes",
"(",
"$",
"this",
"->",
"config",
"->",
"getTokenLength",
"(",
")",
")",
")",
";",
"// Generate token.",
"$",
"arr",
"=",
"array",
"(",
"'token'",
"... | Dispenses a randomly generated authentication token.
@return string | [
"Dispenses",
"a",
"randomly",
"generated",
"authentication",
"token",
"."
] | train | https://github.com/semibreve/minim/blob/c74353754f19ef0f3427fb7246b4474a24623cdd/src/Authenticator.php#L35-L50 |
semibreve/minim | src/Authenticator.php | Authenticator.validateToken | private function validateToken($token)
{
// Without a session file, no token will validate.
if (!file_exists($this->config->getSessionFileName()))
{
return false;
}
$encrypted = file_get_contents($this->config->getSessionFileName()); // Read encrypted session fil... | php | private function validateToken($token)
{
// Without a session file, no token will validate.
if (!file_exists($this->config->getSessionFileName()))
{
return false;
}
$encrypted = file_get_contents($this->config->getSessionFileName()); // Read encrypted session fil... | [
"private",
"function",
"validateToken",
"(",
"$",
"token",
")",
"{",
"// Without a session file, no token will validate.",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"config",
"->",
"getSessionFileName",
"(",
")",
")",
")",
"{",
"return",
"false",
";... | Returns true if the given authentication token is valid, otherwise returns false.
@param string $token the authentication token to validate
@return bool | [
"Returns",
"true",
"if",
"the",
"given",
"authentication",
"token",
"is",
"valid",
"otherwise",
"returns",
"false",
"."
] | train | https://github.com/semibreve/minim/blob/c74353754f19ef0f3427fb7246b4474a24623cdd/src/Authenticator.php#L58-L72 |
semibreve/minim | src/Authenticator.php | Authenticator.getCookieToken | public function getCookieToken()
{
// If we have accessed the cookie token this request already.
if ($this->cookieToken !== null) {
return $this->cookieToken;
}
$name = $this->config->getCookieName();
$plain = '';
if (isset($_COOKIE[$name])) {
... | php | public function getCookieToken()
{
// If we have accessed the cookie token this request already.
if ($this->cookieToken !== null) {
return $this->cookieToken;
}
$name = $this->config->getCookieName();
$plain = '';
if (isset($_COOKIE[$name])) {
... | [
"public",
"function",
"getCookieToken",
"(",
")",
"{",
"// If we have accessed the cookie token this request already.",
"if",
"(",
"$",
"this",
"->",
"cookieToken",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"cookieToken",
";",
"}",
"$",
"name",
"=",
... | Decrypts the stored authentication token out of the authentication cookie and returns it.
@return string | [
"Decrypts",
"the",
"stored",
"authentication",
"token",
"out",
"of",
"the",
"authentication",
"cookie",
"and",
"returns",
"it",
"."
] | train | https://github.com/semibreve/minim/blob/c74353754f19ef0f3427fb7246b4474a24623cdd/src/Authenticator.php#L79-L95 |
semibreve/minim | src/Authenticator.php | Authenticator.setCookieToken | public function setCookieToken($token)
{
$this->cookieToken = $token; // Remember this for this request.
$encrypted = Encryption::encrypt($token, $this->config->getSecretKey()); // Encrypt token.
// Set cookie on client.
setcookie($this->config->getCookieName(),
$encrypt... | php | public function setCookieToken($token)
{
$this->cookieToken = $token; // Remember this for this request.
$encrypted = Encryption::encrypt($token, $this->config->getSecretKey()); // Encrypt token.
// Set cookie on client.
setcookie($this->config->getCookieName(),
$encrypt... | [
"public",
"function",
"setCookieToken",
"(",
"$",
"token",
")",
"{",
"$",
"this",
"->",
"cookieToken",
"=",
"$",
"token",
";",
"// Remember this for this request.",
"$",
"encrypted",
"=",
"Encryption",
"::",
"encrypt",
"(",
"$",
"token",
",",
"$",
"this",
"-... | Encrypts an authentication token into the authentication cookie.
@param string $token the token to store in the cookie | [
"Encrypts",
"an",
"authentication",
"token",
"into",
"the",
"authentication",
"cookie",
"."
] | train | https://github.com/semibreve/minim/blob/c74353754f19ef0f3427fb7246b4474a24623cdd/src/Authenticator.php#L102-L115 |
semibreve/minim | src/Authenticator.php | Authenticator.authenticate | public function authenticate($email, $password)
{
// If we're operating in secure-only mode.
if ($this->config->getCookieSslOnly() && !isset($_SERVER['HTTPS'])) {
echo 'Connection is insecure, login cannot proceed.';
die();
}
// Check credentials.
if ... | php | public function authenticate($email, $password)
{
// If we're operating in secure-only mode.
if ($this->config->getCookieSslOnly() && !isset($_SERVER['HTTPS'])) {
echo 'Connection is insecure, login cannot proceed.';
die();
}
// Check credentials.
if ... | [
"public",
"function",
"authenticate",
"(",
"$",
"email",
",",
"$",
"password",
")",
"{",
"// If we're operating in secure-only mode.",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"getCookieSslOnly",
"(",
")",
"&&",
"!",
"isset",
"(",
"$",
"_SERVER",
"[",
"... | Authenticates the given e-mail address password pair.
@param string $email the e-mail address to authenticate
@param string $password the password to authenticate
@return bool | [
"Authenticates",
"the",
"given",
"e",
"-",
"mail",
"address",
"password",
"pair",
"."
] | train | https://github.com/semibreve/minim/blob/c74353754f19ef0f3427fb7246b4474a24623cdd/src/Authenticator.php#L124-L143 |
semibreve/minim | src/Authenticator.php | Authenticator.isAuthenticated | public function isAuthenticated()
{
// Validate token.
$authenticated = $this->validateToken($this->getCookieToken());
if ($authenticated) {
$this->setCookieToken($this->dispenseToken()); // Dispense a new token.
}
return $authenticated;
} | php | public function isAuthenticated()
{
// Validate token.
$authenticated = $this->validateToken($this->getCookieToken());
if ($authenticated) {
$this->setCookieToken($this->dispenseToken()); // Dispense a new token.
}
return $authenticated;
} | [
"public",
"function",
"isAuthenticated",
"(",
")",
"{",
"// Validate token.",
"$",
"authenticated",
"=",
"$",
"this",
"->",
"validateToken",
"(",
"$",
"this",
"->",
"getCookieToken",
"(",
")",
")",
";",
"if",
"(",
"$",
"authenticated",
")",
"{",
"$",
"this... | Checks whether or not the current user is authenticated.
@return bool | [
"Checks",
"whether",
"or",
"not",
"the",
"current",
"user",
"is",
"authenticated",
"."
] | train | https://github.com/semibreve/minim/blob/c74353754f19ef0f3427fb7246b4474a24623cdd/src/Authenticator.php#L150-L158 |
semibreve/minim | src/Authenticator.php | Authenticator.logout | public function logout()
{
setcookie($this->config->getCookieName(), '', time() - 3600); // Remove client-side cookie.
unlink($this->config->getSessionFileName()); // Delete session file.
} | php | public function logout()
{
setcookie($this->config->getCookieName(), '', time() - 3600); // Remove client-side cookie.
unlink($this->config->getSessionFileName()); // Delete session file.
} | [
"public",
"function",
"logout",
"(",
")",
"{",
"setcookie",
"(",
"$",
"this",
"->",
"config",
"->",
"getCookieName",
"(",
")",
",",
"''",
",",
"time",
"(",
")",
"-",
"3600",
")",
";",
"// Remove client-side cookie.",
"unlink",
"(",
"$",
"this",
"->",
"... | Logs the currently authenticated user out. | [
"Logs",
"the",
"currently",
"authenticated",
"user",
"out",
"."
] | train | https://github.com/semibreve/minim/blob/c74353754f19ef0f3427fb7246b4474a24623cdd/src/Authenticator.php#L163-L167 |
yeaha/owl-core | src/Parameter/Validator.php | Validator.is | public function is(array $values, array $rules)
{
try {
$this->execute($values, $rules);
} catch (\Exception $ex) {
return false;
}
return true;
} | php | public function is(array $values, array $rules)
{
try {
$this->execute($values, $rules);
} catch (\Exception $ex) {
return false;
}
return true;
} | [
"public",
"function",
"is",
"(",
"array",
"$",
"values",
",",
"array",
"$",
"rules",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"execute",
"(",
"$",
"values",
",",
"$",
"rules",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"ex",
")",
"{",
... | 数据是否符合检查规则,不抛出异常而是返回boolean.
@param array $values
@param array $rules
@return bool | [
"数据是否符合检查规则,不抛出异常而是返回boolean",
"."
] | train | https://github.com/yeaha/owl-core/blob/fd7531c0a5c0142300a96160bd079f2e2d92fe4c/src/Parameter/Validator.php#L152-L161 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.boot | public static function boot()
{
NodeSource::saving(function (NodeSourceContract $nodeSource)
{
if (empty($nodeSource->getNodeName()) || is_null($nodeSource->getNodeName()))
{
$nodeSource->setNodeNameFromTitle();
}
});
} | php | public static function boot()
{
NodeSource::saving(function (NodeSourceContract $nodeSource)
{
if (empty($nodeSource->getNodeName()) || is_null($nodeSource->getNodeName()))
{
$nodeSource->setNodeNameFromTitle();
}
});
} | [
"public",
"static",
"function",
"boot",
"(",
")",
"{",
"NodeSource",
"::",
"saving",
"(",
"function",
"(",
"NodeSourceContract",
"$",
"nodeSource",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"nodeSource",
"->",
"getNodeName",
"(",
")",
")",
"||",
"is_null",
... | Boot the model | [
"Boot",
"the",
"model"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L45-L54 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.getSourceModelName | public function getSourceModelName($type = null)
{
$type = $type ?: $this->source_type;
return source_model_name($type, true);
} | php | public function getSourceModelName($type = null)
{
$type = $type ?: $this->source_type;
return source_model_name($type, true);
} | [
"public",
"function",
"getSourceModelName",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"$",
"type",
"?",
":",
"$",
"this",
"->",
"source_type",
";",
"return",
"source_model_name",
"(",
"$",
"type",
",",
"true",
")",
";",
"}"
] | Returns the source model name
@param string|null $type
@return string | [
"Returns",
"the",
"source",
"model",
"name"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L85-L90 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.newWithType | public static function newWithType($locale, $type)
{
$nodeSource = new static();
$sourceModel = $nodeSource->getNewSourceModel($type);
// We temporarily cache the model since Eloquent does not
// have a way to attach hasOne relations without saving them.
// So we are provid... | php | public static function newWithType($locale, $type)
{
$nodeSource = new static();
$sourceModel = $nodeSource->getNewSourceModel($type);
// We temporarily cache the model since Eloquent does not
// have a way to attach hasOne relations without saving them.
// So we are provid... | [
"public",
"static",
"function",
"newWithType",
"(",
"$",
"locale",
",",
"$",
"type",
")",
"{",
"$",
"nodeSource",
"=",
"new",
"static",
"(",
")",
";",
"$",
"sourceModel",
"=",
"$",
"nodeSource",
"->",
"getNewSourceModel",
"(",
"$",
"type",
")",
";",
"/... | Create new node source with locale and type
@param string $locale
@param string $type
@return NodeSource | [
"Create",
"new",
"node",
"source",
"with",
"locale",
"and",
"type"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L99-L118 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.getSource | public function getSource()
{
if ( ! is_null($this->tempSource))
{
return $this->tempSource;
}
if ( ! $this->isSourceRelationLoaded())
{
$this->load('source');
}
return $this->relations['source'];
} | php | public function getSource()
{
if ( ! is_null($this->tempSource))
{
return $this->tempSource;
}
if ( ! $this->isSourceRelationLoaded())
{
$this->load('source');
}
return $this->relations['source'];
} | [
"public",
"function",
"getSource",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"tempSource",
")",
")",
"{",
"return",
"$",
"this",
"->",
"tempSource",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"isSourceRelationLoaded",
"(",
"... | Getter for source data
@return mixed | [
"Getter",
"for",
"source",
"data"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L154-L167 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.saveSource | protected function saveSource()
{
// This part is only for the first save
// as we temporarily keep the source model before
// the parent saves.
if ( ! is_null($this->tempSource))
{
$saved = $this->source()->save(
$this->tempSource);
/... | php | protected function saveSource()
{
// This part is only for the first save
// as we temporarily keep the source model before
// the parent saves.
if ( ! is_null($this->tempSource))
{
$saved = $this->source()->save(
$this->tempSource);
/... | [
"protected",
"function",
"saveSource",
"(",
")",
"{",
"// This part is only for the first save",
"// as we temporarily keep the source model before",
"// the parent saves.",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"tempSource",
")",
")",
"{",
"$",
"saved",
"=... | Saves the source model
@return bool | [
"Saves",
"the",
"source",
"model"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L224-L243 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.getAttribute | public function getAttribute($key)
{
if ($this->isBaseAttribute($key))
{
return parent::getAttribute($key);
} else
{
return $this->getSource()->getAttribute($key);
}
} | php | public function getAttribute($key)
{
if ($this->isBaseAttribute($key))
{
return parent::getAttribute($key);
} else
{
return $this->getSource()->getAttribute($key);
}
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isBaseAttribute",
"(",
"$",
"key",
")",
")",
"{",
"return",
"parent",
"::",
"getAttribute",
"(",
"$",
"key",
")",
";",
"}",
"else",
"{",
"return",
"$",
... | Gets a model attribute
@param string $key
@return mixed | [
"Gets",
"a",
"model",
"attribute"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L251-L260 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.getUnmutatedAttribute | public function getUnmutatedAttribute($key)
{
if ($this->isBaseAttribute($key))
{
return parent::getAttribute($key);
} else
{
return $this->getSource()->getAttributeFromArray($key);
}
} | php | public function getUnmutatedAttribute($key)
{
if ($this->isBaseAttribute($key))
{
return parent::getAttribute($key);
} else
{
return $this->getSource()->getAttributeFromArray($key);
}
} | [
"public",
"function",
"getUnmutatedAttribute",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isBaseAttribute",
"(",
"$",
"key",
")",
")",
"{",
"return",
"parent",
"::",
"getAttribute",
"(",
"$",
"key",
")",
";",
"}",
"else",
"{",
"return",
... | Gets a model attribute
@param string $key
@return mixed | [
"Gets",
"a",
"model",
"attribute"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L268-L277 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.setAttribute | public function setAttribute($key, $value)
{
if ($this->isBaseAttribute($key))
{
return parent::setAttribute($key, $value);
} else
{
return $this->getSource()->setAttribute($key, $value);
}
} | php | public function setAttribute($key, $value)
{
if ($this->isBaseAttribute($key))
{
return parent::setAttribute($key, $value);
} else
{
return $this->getSource()->setAttribute($key, $value);
}
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isBaseAttribute",
"(",
"$",
"key",
")",
")",
"{",
"return",
"parent",
"::",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
... | Sets a model attribute
@param string $key
@param mixed $value
@return void | [
"Sets",
"a",
"model",
"attribute"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L286-L295 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.isDirty | public function isDirty($attributes = null)
{
return parent::isDirty($attributes) or
$this->getSource()->isDirty($attributes);
} | php | public function isDirty($attributes = null)
{
return parent::isDirty($attributes) or
$this->getSource()->isDirty($attributes);
} | [
"public",
"function",
"isDirty",
"(",
"$",
"attributes",
"=",
"null",
")",
"{",
"return",
"parent",
"::",
"isDirty",
"(",
"$",
"attributes",
")",
"or",
"$",
"this",
"->",
"getSource",
"(",
")",
"->",
"isDirty",
"(",
"$",
"attributes",
")",
";",
"}"
] | Determine if the model or given attribute(s) have been modified.
@param array|string|null $attributes
@return bool | [
"Determine",
"if",
"the",
"model",
"or",
"given",
"attribute",
"(",
"s",
")",
"have",
"been",
"modified",
"."
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L315-L319 |
NuclearCMS/Hierarchy | src/NodeSource.php | NodeSource.setExtensionNodeId | public function setExtensionNodeId($id, $save = true)
{
$source = $this->getSource()->setNodeId($id);
if ($save)
{
$source->save();
}
} | php | public function setExtensionNodeId($id, $save = true)
{
$source = $this->getSource()->setNodeId($id);
if ($save)
{
$source->save();
}
} | [
"public",
"function",
"setExtensionNodeId",
"(",
"$",
"id",
",",
"$",
"save",
"=",
"true",
")",
"{",
"$",
"source",
"=",
"$",
"this",
"->",
"getSource",
"(",
")",
"->",
"setNodeId",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"save",
")",
"{",
"$",... | Sets the extension node id
@param bool $save
@param int $id | [
"Sets",
"the",
"extension",
"node",
"id"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSource.php#L400-L408 |
colorium/web | src/Colorium/Web/Kernel.php | Kernel.setup | protected function setup()
{
set_error_handler(function($level, $message, $file = null, $line = null) {
$fatal = E_ERROR | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING;
if(($level & $fatal) > 0) {
throw new \ErrorException($message, $l... | php | protected function setup()
{
set_error_handler(function($level, $message, $file = null, $line = null) {
$fatal = E_ERROR | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING;
if(($level & $fatal) > 0) {
throw new \ErrorException($message, $l... | [
"protected",
"function",
"setup",
"(",
")",
"{",
"set_error_handler",
"(",
"function",
"(",
"$",
"level",
",",
"$",
"message",
",",
"$",
"file",
"=",
"null",
",",
"$",
"line",
"=",
"null",
")",
"{",
"$",
"fatal",
"=",
"E_ERROR",
"|",
"E_PARSE",
"|",
... | Setup app | [
"Setup",
"app"
] | train | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Kernel.php#L39-L47 |
colorium/web | src/Colorium/Web/Kernel.php | Kernel.run | public function run(Context $context = null)
{
$start = microtime(true);
try {
try {
$this->logger->debug('kernel: start');
$context = $context ?: $this->context();
$context = $this->before($context);
return $this->proceed(... | php | public function run(Context $context = null)
{
$start = microtime(true);
try {
try {
$this->logger->debug('kernel: start');
$context = $context ?: $this->context();
$context = $this->before($context);
return $this->proceed(... | [
"public",
"function",
"run",
"(",
"Context",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"start",
"=",
"microtime",
"(",
"true",
")",
";",
"try",
"{",
"try",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"'kernel: start'",
")",
";",
"$",
"c... | Run handler
@param Context $context
@return Context
@throws \Exception
@throws HttpException | [
"Run",
"handler"
] | train | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Kernel.php#L59-L81 |
colorium/web | src/Colorium/Web/Kernel.php | Kernel.event | protected function event(HttpException $event, Context $context = null)
{
$code = $event->getCode();
if(isset($this->events[$code])) {
$context->error = $event;
$context->response->code = $event->getCode();
$this->logger->debug('kernel.event: http ' . $code . ' ev... | php | protected function event(HttpException $event, Context $context = null)
{
$code = $event->getCode();
if(isset($this->events[$code])) {
$context->error = $event;
$context->response->code = $event->getCode();
$this->logger->debug('kernel.event: http ' . $code . ' ev... | [
"protected",
"function",
"event",
"(",
"HttpException",
"$",
"event",
",",
"Context",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"code",
"=",
"$",
"event",
"->",
"getCode",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"events",
"[",
... | Handle http event
@param HttpException $event
@param Context $context
@return Context
@throws HttpException | [
"Handle",
"http",
"event"
] | train | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Kernel.php#L125-L137 |
colorium/web | src/Colorium/Web/Kernel.php | Kernel.error | protected function error(\Exception $error, Context $context = null)
{
$exception = get_class($error);
$this->logger->error($error);
if($this->catch) {
foreach($this->errors as $class => $callback) {
if(is_string($class) and $error instanceof $class) {
... | php | protected function error(\Exception $error, Context $context = null)
{
$exception = get_class($error);
$this->logger->error($error);
if($this->catch) {
foreach($this->errors as $class => $callback) {
if(is_string($class) and $error instanceof $class) {
... | [
"protected",
"function",
"error",
"(",
"\\",
"Exception",
"$",
"error",
",",
"Context",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"exception",
"=",
"get_class",
"(",
"$",
"error",
")",
";",
"$",
"this",
"->",
"logger",
"->",
"error",
"(",
"$",
"err... | Handle exception
@param \Exception $error
@param Context $context
@return Context
@throws \Exception | [
"Handle",
"exception"
] | train | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Kernel.php#L149-L166 |
phergie/phergie-irc-plugin-react-autojoin | src/Plugin.php | Plugin.joinChannels | public function joinChannels($dummy, EventQueueInterface $queue)
{
$queue->ircJoin($this->channels, $this->keys);
} | php | public function joinChannels($dummy, EventQueueInterface $queue)
{
$queue->ircJoin($this->channels, $this->keys);
} | [
"public",
"function",
"joinChannels",
"(",
"$",
"dummy",
",",
"EventQueueInterface",
"$",
"queue",
")",
"{",
"$",
"queue",
"->",
"ircJoin",
"(",
"$",
"this",
"->",
"channels",
",",
"$",
"this",
"->",
"keys",
")",
";",
"}"
] | Joins the provided list of channels.
@param mixed $dummy Unused, as it only matters that one of the
subscribed events has occurred, not what it is
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Joins",
"the",
"provided",
"list",
"of",
"channels",
"."
] | train | https://github.com/phergie/phergie-irc-plugin-react-autojoin/blob/b0e98fc2b503ddcdaf199375e9bcdc62e774036b/src/Plugin.php#L112-L115 |
DeprecatedPackages/EventDispatcher | src/DI/NetteEventListFactory.php | NetteEventListFactory.create | public function create()
{
$list = [];
$list = $this->addApplicationEventItems($list);
$list = $this->addPresenterEventItems($list);
return $list;
} | php | public function create()
{
$list = [];
$list = $this->addApplicationEventItems($list);
$list = $this->addPresenterEventItems($list);
return $list;
} | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"$",
"list",
"=",
"$",
"this",
"->",
"addApplicationEventItems",
"(",
"$",
"list",
")",
";",
"$",
"list",
"=",
"$",
"this",
"->",
"addPresenterEventItems",
"(",
"$",
"lis... | {@inheritdoc} | [
"{"
] | train | https://github.com/DeprecatedPackages/EventDispatcher/blob/1359bb86e208626578bd7049b48bfb8a25d57b64/src/DI/NetteEventListFactory.php#L29-L35 |
WellCommerce/StandardEditionBundle | DataFixtures/ORM/LoadDelivererData.php | LoadDelivererData.load | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$fakerGenerator = $this->getFakerGenerator();
$deliverer = new Deliverer();
$name = $fakerGenerator->company;
foreach ($this->getLocales() as $local... | php | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$fakerGenerator = $this->getFakerGenerator();
$deliverer = new Deliverer();
$name = $fakerGenerator->company;
foreach ($this->getLocales() as $local... | [
"public",
"function",
"load",
"(",
"ObjectManager",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"fakerGenerator",
"=",
"$",
"this",
"->",
"getFakerGenerator",
"(",
")",
";",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/WellCommerce/StandardEditionBundle/blob/6367bd20bbb6bde37c710a6ba87ae72b5f05f61e/DataFixtures/ORM/LoadDelivererData.php#L29-L47 |
bobfridley/laravel-vonage | src/VonageFactory.php | VonageFactory.getClient | protected function getClient(array $auth)
{
$this->cookieFile = storage_path() . '/guzzlehttp/cookies/vonage/' . $auth['username'] . '.txt';
$cookieJar = new FileCookieJar($this->cookieFile, true);
$this->client = new Client(array('base_uri' => $this->base_uri, 'cookies' => $cookieJar));
... | php | protected function getClient(array $auth)
{
$this->cookieFile = storage_path() . '/guzzlehttp/cookies/vonage/' . $auth['username'] . '.txt';
$cookieJar = new FileCookieJar($this->cookieFile, true);
$this->client = new Client(array('base_uri' => $this->base_uri, 'cookies' => $cookieJar));
... | [
"protected",
"function",
"getClient",
"(",
"array",
"$",
"auth",
")",
"{",
"$",
"this",
"->",
"cookieFile",
"=",
"storage_path",
"(",
")",
".",
"'/guzzlehttp/cookies/vonage/'",
".",
"$",
"auth",
"[",
"'username'",
"]",
".",
"'.txt'",
";",
"$",
"cookieJar",
... | Get the vonage client.
@param array[] $auth
@return \Vonage\Client | [
"Get",
"the",
"vonage",
"client",
"."
] | train | https://github.com/bobfridley/laravel-vonage/blob/e422af44a449c3147878c317b865508b1afa50e6/src/VonageFactory.php#L88-L106 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php | DwooRenderer.initialize | public function initialize(AgaviContext $context, array $parameters = array())
{
parent::initialize($context, $parameters);
$this->plugin_dir = $this->getParameter('plugin_dir', $this->plugin_dir);
} | php | public function initialize(AgaviContext $context, array $parameters = array())
{
parent::initialize($context, $parameters);
$this->plugin_dir = $this->getParameter('plugin_dir', $this->plugin_dir);
} | [
"public",
"function",
"initialize",
"(",
"AgaviContext",
"$",
"context",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"parent",
"::",
"initialize",
"(",
"$",
"context",
",",
"$",
"parameters",
")",
";",
"$",
"this",
"->",
"plugin_di... | Initialize this Renderer.
@param AgaviContext The current application context.
@param array An associative array of initialization parameters. | [
"Initialize",
"this",
"Renderer",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php#L97-L102 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php | DwooRenderer.compilerFactory | public function compilerFactory()
{
if (class_exists('Dwoo_Compiler', false) === false) {
include DWOO_DIRECTORY . 'Dwoo/Compiler.php';
}
$compiler = Dwoo_Compiler::compilerFactory();
$compiler->setAutoEscape((bool) $this->getParameter('auto_escape', false));
return $compiler;
} | php | public function compilerFactory()
{
if (class_exists('Dwoo_Compiler', false) === false) {
include DWOO_DIRECTORY . 'Dwoo/Compiler.php';
}
$compiler = Dwoo_Compiler::compilerFactory();
$compiler->setAutoEscape((bool) $this->getParameter('auto_escape', false));
return $compiler;
} | [
"public",
"function",
"compilerFactory",
"(",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'Dwoo_Compiler'",
",",
"false",
")",
"===",
"false",
")",
"{",
"include",
"DWOO_DIRECTORY",
".",
"'Dwoo/Compiler.php'",
";",
"}",
"$",
"compiler",
"=",
"Dwoo_Compiler",
":... | provides a custom compiler to the dwoo renderer with optional settings
you can set in the agavi output_types.xml config file
@return Dwoo_Compiler | [
"provides",
"a",
"custom",
"compiler",
"to",
"the",
"dwoo",
"renderer",
"with",
"optional",
"settings",
"you",
"can",
"set",
"in",
"the",
"agavi",
"output_types",
".",
"xml",
"config",
"file"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php#L110-L118 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php | DwooRenderer.getEngine | protected function getEngine()
{
if($this->dwoo) {
return $this->dwoo;
}
if(!class_exists('Dwoo')) {
if (file_exists(dirname(__FILE__).'/../../../dwooAutoload.php')) {
// file was dropped with the entire dwoo package
require dirname(__FILE__).'/../../../dwooAutoload.php';
} else {
// assume... | php | protected function getEngine()
{
if($this->dwoo) {
return $this->dwoo;
}
if(!class_exists('Dwoo')) {
if (file_exists(dirname(__FILE__).'/../../../dwooAutoload.php')) {
// file was dropped with the entire dwoo package
require dirname(__FILE__).'/../../../dwooAutoload.php';
} else {
// assume... | [
"protected",
"function",
"getEngine",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dwoo",
")",
"{",
"return",
"$",
"this",
"->",
"dwoo",
";",
"}",
"if",
"(",
"!",
"class_exists",
"(",
"'Dwoo'",
")",
")",
"{",
"if",
"(",
"file_exists",
"(",
"dirnam... | Grab a cleaned up dwoo instance.
@return Dwoo A Dwoo instance. | [
"Grab",
"a",
"cleaned",
"up",
"dwoo",
"instance",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php#L125-L158 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php | DwooRenderer.render | public function render(AgaviTemplateLayer $layer, array &$attributes = array(), array &$slots = array(), array &$moreAssigns = array())
{
$engine = $this->getEngine();
$data = array();
if($this->extractVars) {
$data = $attributes;
} else {
$data[$this->varName] = &$attributes;
}
$data[$this->slotsV... | php | public function render(AgaviTemplateLayer $layer, array &$attributes = array(), array &$slots = array(), array &$moreAssigns = array())
{
$engine = $this->getEngine();
$data = array();
if($this->extractVars) {
$data = $attributes;
} else {
$data[$this->varName] = &$attributes;
}
$data[$this->slotsV... | [
"public",
"function",
"render",
"(",
"AgaviTemplateLayer",
"$",
"layer",
",",
"array",
"&",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"array",
"&",
"$",
"slots",
"=",
"array",
"(",
")",
",",
"array",
"&",
"$",
"moreAssigns",
"=",
"array",
"(",
... | Render the presentation and return the result.
@param AgaviTemplateLayer The template layer to render.
@param array The template variables.
@param array The slots.
@param array Associative array of additional assigns.
@return string A rendered result. | [
"Render",
"the",
"presentation",
"and",
"return",
"the",
"result",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/Agavi/DwooRenderer.php#L170-L195 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformer.php | Transformer.execute | public function execute(ProjectDescriptor $project)
{
Dispatcher::getInstance()->dispatch(
self::EVENT_PRE_TRANSFORM,
PreTransformEvent::createInstance($this)->setProject($project)
);
$transformations = $this->getTemplates()->getTransformations();
$this->init... | php | public function execute(ProjectDescriptor $project)
{
Dispatcher::getInstance()->dispatch(
self::EVENT_PRE_TRANSFORM,
PreTransformEvent::createInstance($this)->setProject($project)
);
$transformations = $this->getTemplates()->getTransformations();
$this->init... | [
"public",
"function",
"execute",
"(",
"ProjectDescriptor",
"$",
"project",
")",
"{",
"Dispatcher",
"::",
"getInstance",
"(",
")",
"->",
"dispatch",
"(",
"self",
"::",
"EVENT_PRE_TRANSFORM",
",",
"PreTransformEvent",
"::",
"createInstance",
"(",
"$",
"this",
")",... | Transforms the given project into a series of artifacts as provided by the templates.
@param ProjectDescriptor $project
@return void | [
"Transforms",
"the",
"given",
"project",
"into",
"a",
"series",
"of",
"artifacts",
"as",
"provided",
"by",
"the",
"templates",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformer.php#L132-L146 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformer.php | Transformer.generateFilename | public function generateFilename($name)
{
if (substr($name, -4) == '.php') {
$name = substr($name, 0, -4);
}
return trim(str_replace(array(DIRECTORY_SEPARATOR, '\\'), '.', trim($name, DIRECTORY_SEPARATOR . '.')), '.')
. '.html';
} | php | public function generateFilename($name)
{
if (substr($name, -4) == '.php') {
$name = substr($name, 0, -4);
}
return trim(str_replace(array(DIRECTORY_SEPARATOR, '\\'), '.', trim($name, DIRECTORY_SEPARATOR . '.')), '.')
. '.html';
} | [
"public",
"function",
"generateFilename",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"name",
",",
"-",
"4",
")",
"==",
"'.php'",
")",
"{",
"$",
"name",
"=",
"substr",
"(",
"$",
"name",
",",
"0",
",",
"-",
"4",
")",
";",
"}",
"... | Converts a source file name to the name used for generating the end result.
This method strips down the given $name using the following rules:
* if the $name is suffixed with .php then that is removed
* any occurrence of \ or DIRECTORY_SEPARATOR is replaced with .
* any dots that the name starts or ends with is remov... | [
"Converts",
"a",
"source",
"file",
"name",
"to",
"the",
"name",
"used",
"for",
"generating",
"the",
"end",
"result",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformer.php#L162-L170 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformer.php | Transformer.debug | public function debug($message)
{
Dispatcher::getInstance()->dispatch(
'system.debug',
DebugEvent::createInstance($this)
->setMessage($message)
);
} | php | public function debug($message)
{
Dispatcher::getInstance()->dispatch(
'system.debug',
DebugEvent::createInstance($this)
->setMessage($message)
);
} | [
"public",
"function",
"debug",
"(",
"$",
"message",
")",
"{",
"Dispatcher",
"::",
"getInstance",
"(",
")",
"->",
"dispatch",
"(",
"'system.debug'",
",",
"DebugEvent",
"::",
"createInstance",
"(",
"$",
"this",
")",
"->",
"setMessage",
"(",
"$",
"message",
"... | Dispatches a logging request to log a debug message.
@param string $message The message to log.
@return void | [
"Dispatches",
"a",
"logging",
"request",
"to",
"log",
"a",
"debug",
"message",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformer.php#L197-L204 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformer.php | Transformer.initializeWriters | private function initializeWriters(ProjectDescriptor $project, $transformations)
{
$isInitialized = array();
foreach ($transformations as $transformation) {
$writerName = $transformation->getWriter();
if (in_array($writerName, $isInitialized)) {
continue;
... | php | private function initializeWriters(ProjectDescriptor $project, $transformations)
{
$isInitialized = array();
foreach ($transformations as $transformation) {
$writerName = $transformation->getWriter();
if (in_array($writerName, $isInitialized)) {
continue;
... | [
"private",
"function",
"initializeWriters",
"(",
"ProjectDescriptor",
"$",
"project",
",",
"$",
"transformations",
")",
"{",
"$",
"isInitialized",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"transformations",
"as",
"$",
"transformation",
")",
"{",
"$",
... | Initializes all writers that are used during this transformation.
@param ProjectDescriptor $project
@param Transformation[] $transformations
@return void | [
"Initializes",
"all",
"writers",
"that",
"are",
"used",
"during",
"this",
"transformation",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformer.php#L214-L228 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformer.php | Transformer.initializeWriter | private function initializeWriter(WriterAbstract $writer, ProjectDescriptor $project)
{
$event = WriterInitializationEvent::createInstance($this)->setWriter($writer);
Dispatcher::getInstance()->dispatch(self::EVENT_PRE_INITIALIZATION, $event);
if ($writer instanceof Initializable) {
... | php | private function initializeWriter(WriterAbstract $writer, ProjectDescriptor $project)
{
$event = WriterInitializationEvent::createInstance($this)->setWriter($writer);
Dispatcher::getInstance()->dispatch(self::EVENT_PRE_INITIALIZATION, $event);
if ($writer instanceof Initializable) {
... | [
"private",
"function",
"initializeWriter",
"(",
"WriterAbstract",
"$",
"writer",
",",
"ProjectDescriptor",
"$",
"project",
")",
"{",
"$",
"event",
"=",
"WriterInitializationEvent",
"::",
"createInstance",
"(",
"$",
"this",
")",
"->",
"setWriter",
"(",
"$",
"writ... | Initializes the given writer using the provided project meta-data.
This method wil call for the initialization of each writer that supports an initialization routine (as defined by
the `Initializable` interface).
In addition to this, the following events emitted for each writer that is present in the collected list o... | [
"Initializes",
"the",
"given",
"writer",
"using",
"the",
"provided",
"project",
"meta",
"-",
"data",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformer.php#L251-L261 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformer.php | Transformer.transformProject | private function transformProject(ProjectDescriptor $project, $transformations)
{
foreach ($transformations as $transformation) {
$transformation->setTransformer($this);
$this->applyTransformationToProject($transformation, $project);
}
} | php | private function transformProject(ProjectDescriptor $project, $transformations)
{
foreach ($transformations as $transformation) {
$transformation->setTransformer($this);
$this->applyTransformationToProject($transformation, $project);
}
} | [
"private",
"function",
"transformProject",
"(",
"ProjectDescriptor",
"$",
"project",
",",
"$",
"transformations",
")",
"{",
"foreach",
"(",
"$",
"transformations",
"as",
"$",
"transformation",
")",
"{",
"$",
"transformation",
"->",
"setTransformer",
"(",
"$",
"t... | Applies all given transformations to the provided project.
@param ProjectDescriptor $project
@param Transformation[] $transformations
@return void | [
"Applies",
"all",
"given",
"transformations",
"to",
"the",
"provided",
"project",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformer.php#L271-L277 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformer.php | Transformer.applyTransformationToProject | private function applyTransformationToProject(Transformation $transformation, ProjectDescriptor $project)
{
$this->log(
sprintf(
' Writer %s %s on %s',
$transformation->getWriter(),
($transformation->getQuery() ? ' using query "' . $transformation... | php | private function applyTransformationToProject(Transformation $transformation, ProjectDescriptor $project)
{
$this->log(
sprintf(
' Writer %s %s on %s',
$transformation->getWriter(),
($transformation->getQuery() ? ' using query "' . $transformation... | [
"private",
"function",
"applyTransformationToProject",
"(",
"Transformation",
"$",
"transformation",
",",
"ProjectDescriptor",
"$",
"project",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"sprintf",
"(",
"' Writer %s %s on %s'",
",",
"$",
"transformation",
"->",
"getWr... | Applies the given transformation to the provided project.
This method will attempt to find an appropriate writer for the given transformation and invoke that with the
transformation and project so that an artifact can be generated that matches the intended transformation.
In addition this method will emit the followi... | [
"Applies",
"the",
"given",
"transformation",
"to",
"the",
"provided",
"project",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformer.php#L297-L316 |
VincentChalnot/SidusDataGridBundle | Twig/RendererExtension.php | RendererExtension.renderDataGrid | public function renderDataGrid(DataGrid $dataGrid, array $viewParameters = []): string
{
$viewParameters = array_merge($dataGrid->getTemplateVars(), $viewParameters);
$viewParameters['datagrid'] = $dataGrid;
return $this->twig->render($dataGrid->getTemplate(), $viewParameters);
} | php | public function renderDataGrid(DataGrid $dataGrid, array $viewParameters = []): string
{
$viewParameters = array_merge($dataGrid->getTemplateVars(), $viewParameters);
$viewParameters['datagrid'] = $dataGrid;
return $this->twig->render($dataGrid->getTemplate(), $viewParameters);
} | [
"public",
"function",
"renderDataGrid",
"(",
"DataGrid",
"$",
"dataGrid",
",",
"array",
"$",
"viewParameters",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"viewParameters",
"=",
"array_merge",
"(",
"$",
"dataGrid",
"->",
"getTemplateVars",
"(",
")",
",",
... | @param DataGrid $dataGrid
@param array $viewParameters
@throws \Twig_Error_Loader
@throws \Twig_Error_Runtime
@throws \Twig_Error_Syntax
@return string | [
"@param",
"DataGrid",
"$dataGrid",
"@param",
"array",
"$viewParameters"
] | train | https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/Twig/RendererExtension.php#L66-L72 |
VincentChalnot/SidusDataGridBundle | Twig/RendererExtension.php | RendererExtension.getFilterColumns | public function getFilterColumns(FormView $formView, int $numColumns = 3): array
{
$columns = [];
$i = 0;
foreach ($formView as $formItem) {
$columns[$i % $numColumns][] = $formItem;
++$i;
}
return $columns;
} | php | public function getFilterColumns(FormView $formView, int $numColumns = 3): array
{
$columns = [];
$i = 0;
foreach ($formView as $formItem) {
$columns[$i % $numColumns][] = $formItem;
++$i;
}
return $columns;
} | [
"public",
"function",
"getFilterColumns",
"(",
"FormView",
"$",
"formView",
",",
"int",
"$",
"numColumns",
"=",
"3",
")",
":",
"array",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"formView",
"as",
"$",
"f... | Simple function to split form widgets in as many columns as wanted
@param FormView $formView
@param int $numColumns
@return array | [
"Simple",
"function",
"to",
"split",
"form",
"widgets",
"in",
"as",
"many",
"columns",
"as",
"wanted"
] | train | https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/Twig/RendererExtension.php#L82-L92 |
wenbin1989/yii2-curl | Curl.php | Curl.get | public function get($url, $options = [], $body = null, $raw = true)
{
return $this->httpRequest('GET', $this->createUrl($url, $options), $body, $raw);
} | php | public function get($url, $options = [], $body = null, $raw = true)
{
return $this->httpRequest('GET', $this->createUrl($url, $options), $body, $raw);
} | [
"public",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"body",
"=",
"null",
",",
"$",
"raw",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"httpRequest",
"(",
"'GET'",
",",
"$",
"this",
"->",
"createUrl"... | Performs GET HTTP request
@param string $url URL
@param array $options URL options
@param string $body request body
@param boolean $raw if response body contains JSON and should be decoded
@return mixed response | [
"Performs",
"GET",
"HTTP",
"request"
] | train | https://github.com/wenbin1989/yii2-curl/blob/e30730dc685ec10118f982eab518b49761f6cd3a/Curl.php#L48-L51 |
wenbin1989/yii2-curl | Curl.php | Curl.head | public function head($url, $options = [], $body = null)
{
return $this->httpRequest('HEAD', $this->createUrl($url, $options), $body);
} | php | public function head($url, $options = [], $body = null)
{
return $this->httpRequest('HEAD', $this->createUrl($url, $options), $body);
} | [
"public",
"function",
"head",
"(",
"$",
"url",
",",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"body",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"httpRequest",
"(",
"'HEAD'",
",",
"$",
"this",
"->",
"createUrl",
"(",
"$",
"url",
",",
"$",... | Performs HEAD HTTP request
@param string $url URL
@param array $options URL options
@param string $body request body
@return mixed response | [
"Performs",
"HEAD",
"HTTP",
"request"
] | train | https://github.com/wenbin1989/yii2-curl/blob/e30730dc685ec10118f982eab518b49761f6cd3a/Curl.php#L61-L64 |
wenbin1989/yii2-curl | Curl.php | Curl.createUrl | private function createUrl($path, $options = [])
{
if (!is_string($path)) {
$url = implode('/', array_map(function ($a) {
return urlencode(is_array($a) ? implode(',', $a) : $a);
}, $path));
if (!empty($options)) {
$url .= '?' . http_build_q... | php | private function createUrl($path, $options = [])
{
if (!is_string($path)) {
$url = implode('/', array_map(function ($a) {
return urlencode(is_array($a) ? implode(',', $a) : $a);
}, $path));
if (!empty($options)) {
$url .= '?' . http_build_q... | [
"private",
"function",
"createUrl",
"(",
"$",
"path",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"path",
")",
")",
"{",
"$",
"url",
"=",
"implode",
"(",
"'/'",
",",
"array_map",
"(",
"function",
"(",
"$",... | Creates URL
@param mixed $path path
@param array $options URL options
@return string | [
"Creates",
"URL"
] | train | https://github.com/wenbin1989/yii2-curl/blob/e30730dc685ec10118f982eab518b49761f6cd3a/Curl.php#L115-L132 |
wenbin1989/yii2-curl | Curl.php | Curl.httpRequest | protected function httpRequest($method, $url, $requestBody = null, $raw = false)
{
$method = strtoupper($method);
// response body
$body = '';
$options = [
CURLOPT_USERAGENT => 'Yii Framework 2 ' . __CLASS__,
CURLOPT_RETURNTRANSFER => false,
... | php | protected function httpRequest($method, $url, $requestBody = null, $raw = false)
{
$method = strtoupper($method);
// response body
$body = '';
$options = [
CURLOPT_USERAGENT => 'Yii Framework 2 ' . __CLASS__,
CURLOPT_RETURNTRANSFER => false,
... | [
"protected",
"function",
"httpRequest",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"requestBody",
"=",
"null",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"method",
")",
";",
"// response body",
"$",
"body",... | Performs HTTP request
@param string $method method name
@param string $url URL
@param string $requestBody request body
@param boolean $raw if response body contains JSON and should be decoded
@throws Exception if request failed
@throws HttpException
@return mixed if response http code is 404, return false; if http cod... | [
"Performs",
"HTTP",
"request"
] | train | https://github.com/wenbin1989/yii2-curl/blob/e30730dc685ec10118f982eab518b49761f6cd3a/Curl.php#L146-L208 |
LIN3S/Distribution | src/Php/Composer/Symfony.php | Symfony.installRequiredFiles | public static function installRequiredFiles()
{
$htaccess = [
__DIR__ . '/../../../../../../app/.htaccess',
__DIR__ . '/../../../../../../src/.htaccess',
__DIR__ . '/../../../../../../web/.htaccess',
];
$fileSystem = new Filesystem();
try {
... | php | public static function installRequiredFiles()
{
$htaccess = [
__DIR__ . '/../../../../../../app/.htaccess',
__DIR__ . '/../../../../../../src/.htaccess',
__DIR__ . '/../../../../../../web/.htaccess',
];
$fileSystem = new Filesystem();
try {
... | [
"public",
"static",
"function",
"installRequiredFiles",
"(",
")",
"{",
"$",
"htaccess",
"=",
"[",
"__DIR__",
".",
"'/../../../../../../app/.htaccess'",
",",
"__DIR__",
".",
"'/../../../../../../src/.htaccess'",
",",
"__DIR__",
".",
"'/../../../../../../web/.htaccess'",
",... | Static method that creates .htaccess, files if they do not exist. | [
"Static",
"method",
"that",
"creates",
".",
"htaccess",
"files",
"if",
"they",
"do",
"not",
"exist",
"."
] | train | https://github.com/LIN3S/Distribution/blob/294cda1c2128fa967b3b316f01f202e4e46d2e5b/src/Php/Composer/Symfony.php#L26-L44 |
m4grio/bangkok-insurance-php | src/SoapClient/Factory.php | Factory.getClient | public function getClient($wsdl, array $options = [])
{
$defaults = [
'trace' => true,
//'features' => \SOAP_SINGLE_ELEMENT_ARRAYS,
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
'soap_version' => SOAP_1_1,
];
$optio... | php | public function getClient($wsdl, array $options = [])
{
$defaults = [
'trace' => true,
//'features' => \SOAP_SINGLE_ELEMENT_ARRAYS,
'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
'soap_version' => SOAP_1_1,
];
$optio... | [
"public",
"function",
"getClient",
"(",
"$",
"wsdl",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'trace'",
"=>",
"true",
",",
"//'features' => \\SOAP_SINGLE_ELEMENT_ARRAYS,",
"'compression'",
"=>",
"SOAP_COMPRESSION_ACCEPT... | @param $wsdl
@param array $options
@return SoapClient | [
"@param",
"$wsdl",
"@param",
"array",
"$options"
] | train | https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/SoapClient/Factory.php#L21-L33 |
KodiComponents/Support | src/Upload.php | Upload.getAttribute | public function getAttribute($key)
{
$this->findUploadFields();
if ($this->isUploadField($key)) {
list($method, $originalKey) = $this->uploadGetKeys[$key];
$value = $this->getAttribute($originalKey);
if ($this->hasGetMutator($key)) {
return $thi... | php | public function getAttribute($key)
{
$this->findUploadFields();
if ($this->isUploadField($key)) {
list($method, $originalKey) = $this->uploadGetKeys[$key];
$value = $this->getAttribute($originalKey);
if ($this->hasGetMutator($key)) {
return $thi... | [
"public",
"function",
"getAttribute",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"findUploadFields",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isUploadField",
"(",
"$",
"key",
")",
")",
"{",
"list",
"(",
"$",
"method",
",",
"$",
"originalKey",... | Get an attribute from the model.
@param string $key
@return mixed | [
"Get",
"an",
"attribute",
"from",
"the",
"model",
"."
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/Upload.php#L134-L151 |
KodiComponents/Support | src/Upload.php | Upload.mutateAttribute | protected function mutateAttribute($key, $value)
{
$this->findUploadFields();
if ($this->isUploadField($key)) {
return $this->getAttribute($key);
}
return parent::mutateAttribute($key, $value);
} | php | protected function mutateAttribute($key, $value)
{
$this->findUploadFields();
if ($this->isUploadField($key)) {
return $this->getAttribute($key);
}
return parent::mutateAttribute($key, $value);
} | [
"protected",
"function",
"mutateAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"findUploadFields",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isUploadField",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->"... | Get the value of an attribute using its mutator.
@param string $key
@param mixed $value
@return mixed | [
"Get",
"the",
"value",
"of",
"an",
"attribute",
"using",
"its",
"mutator",
"."
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/Upload.php#L161-L170 |
KodiComponents/Support | src/Upload.php | Upload.setAttribute | public function setAttribute($key, $value)
{
$this->findUploadFields();
if ($this->isUploadField($key)) {
list($method, $originalKey) = $this->uploadSetKeys[$key];
if ($this->hasSetMutator($key)) {
$method = 'set'.Str::studly($key).'Attribute';
... | php | public function setAttribute($key, $value)
{
$this->findUploadFields();
if ($this->isUploadField($key)) {
list($method, $originalKey) = $this->uploadSetKeys[$key];
if ($this->hasSetMutator($key)) {
$method = 'set'.Str::studly($key).'Attribute';
... | [
"public",
"function",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"findUploadFields",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isUploadField",
"(",
"$",
"key",
")",
")",
"{",
"list",
"(",
"$",
"method",
","... | Set a given attribute on the model.
@param string $key
@param mixed $value
@return $this | [
"Set",
"a",
"given",
"attribute",
"on",
"the",
"model",
"."
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/Upload.php#L180-L197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.