id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
205,400 | malenkiki/bah | src/Malenki/Bah/N.php | N._odd | protected function _odd()
{
if((abs($this->value) - floor(abs($this->value))) != 0){
throw new \RuntimeException(
'Testing if number is odd or even only if it is an integer!'
);
}
return (boolean) ($this->value & 1);
} | php | protected function _odd()
{
if((abs($this->value) - floor(abs($this->value))) != 0){
throw new \RuntimeException(
'Testing if number is odd or even only if it is an integer!'
);
}
return (boolean) ($this->value & 1);
} | [
"protected",
"function",
"_odd",
"(",
")",
"{",
"if",
"(",
"(",
"abs",
"(",
"$",
"this",
"->",
"value",
")",
"-",
"floor",
"(",
"abs",
"(",
"$",
"this",
"->",
"value",
")",
")",
")",
"!=",
"0",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
... | Tests whether current number is odd.
Tests whether current integer number is odd or not. If current number is
not an integer, then raises an `\RuntimeException`.
This is used as runtime part of magic getter `S::$odd`.
Example:
$n = new N(3);
$n->odd; // true
$n = new N(4);
$n->odd; // false
$n = new N(3.14);
$n->od... | [
"Tests",
"whether",
"current",
"number",
"is",
"odd",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1466-L1475 |
205,401 | malenkiki/bah | src/Malenki/Bah/N.php | N.plus | public function plus($number)
{
self::mustBeNumeric($number, 'Value to add');
$number = is_object($number) ? $number->value : $number;
return new self($this->value + $number);
} | php | public function plus($number)
{
self::mustBeNumeric($number, 'Value to add');
$number = is_object($number) ? $number->value : $number;
return new self($this->value + $number);
} | [
"public",
"function",
"plus",
"(",
"$",
"number",
")",
"{",
"self",
"::",
"mustBeNumeric",
"(",
"$",
"number",
",",
"'Value to add'",
")",
";",
"$",
"number",
"=",
"is_object",
"(",
"$",
"number",
")",
"?",
"$",
"number",
"->",
"value",
":",
"$",
"nu... | Adds current number to given argument.
Create new `\Malenki\Bah\N` having the sum of given argument with
current number
@param mixed $number Numeric-like value
@return N
@throws \InvalidArgumentException If argument is not N or numeric value. | [
"Adds",
"current",
"number",
"to",
"given",
"argument",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1583-L1590 |
205,402 | malenkiki/bah | src/Malenki/Bah/N.php | N.minus | public function minus($number)
{
self::mustBeNumeric($number, 'Value to substract');
$number = is_object($number) ? $number->value : $number;
return new self($this->value - $number);
} | php | public function minus($number)
{
self::mustBeNumeric($number, 'Value to substract');
$number = is_object($number) ? $number->value : $number;
return new self($this->value - $number);
} | [
"public",
"function",
"minus",
"(",
"$",
"number",
")",
"{",
"self",
"::",
"mustBeNumeric",
"(",
"$",
"number",
",",
"'Value to substract'",
")",
";",
"$",
"number",
"=",
"is_object",
"(",
"$",
"number",
")",
"?",
"$",
"number",
"->",
"value",
":",
"$"... | Substract current number with other.
Creates new `\Malenki\Bah\N` having the substraction of given argument
with current number
@param mixed $number N or numeric value
@return N
@throws \InvalidArgumentException If argument is not N or numeric value. | [
"Substract",
"current",
"number",
"with",
"other",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1602-L1609 |
205,403 | malenkiki/bah | src/Malenki/Bah/N.php | N.multiply | public function multiply($number)
{
self::mustBeNumeric($number, 'Value to multiply');
$number = is_object($number) ? $number->value : $number;
return new self($this->value * $number);
} | php | public function multiply($number)
{
self::mustBeNumeric($number, 'Value to multiply');
$number = is_object($number) ? $number->value : $number;
return new self($this->value * $number);
} | [
"public",
"function",
"multiply",
"(",
"$",
"number",
")",
"{",
"self",
"::",
"mustBeNumeric",
"(",
"$",
"number",
",",
"'Value to multiply'",
")",
";",
"$",
"number",
"=",
"is_object",
"(",
"$",
"number",
")",
"?",
"$",
"number",
"->",
"value",
":",
"... | Creates new N by multipling the current to the given one
@throw \InvalidArgumentException If argument is not N or numeric value.
@param mixed $number N or numeric value
@return N | [
"Creates",
"new",
"N",
"by",
"multipling",
"the",
"current",
"to",
"the",
"given",
"one"
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1618-L1625 |
205,404 | malenkiki/bah | src/Malenki/Bah/N.php | N.divide | public function divide($number)
{
self::mustBeNumeric($number, 'Value to divide');
$number = is_object($number) ? $number->value : $number;
if ($number == 0) {
throw new \InvalidArgumentException('You cannot divide by zero!');
}
return new self(... | php | public function divide($number)
{
self::mustBeNumeric($number, 'Value to divide');
$number = is_object($number) ? $number->value : $number;
if ($number == 0) {
throw new \InvalidArgumentException('You cannot divide by zero!');
}
return new self(... | [
"public",
"function",
"divide",
"(",
"$",
"number",
")",
"{",
"self",
"::",
"mustBeNumeric",
"(",
"$",
"number",
",",
"'Value to divide'",
")",
";",
"$",
"number",
"=",
"is_object",
"(",
"$",
"number",
")",
"?",
"$",
"number",
"->",
"value",
":",
"$",
... | Divide current number with given argument.
@throw \InvalidArgumentException If given argument is zero
@throw \InvalidArgumentException If given argument is not N or numeric value.
@param mixed $number N or numeric value
@return N | [
"Divide",
"current",
"number",
"with",
"given",
"argument",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1635-L1646 |
205,405 | malenkiki/bah | src/Malenki/Bah/N.php | N._roman | protected function _roman()
{
if(!$this->_decimal()->zero || $this->value < 0){
throw new \RuntimeException(
'Converting into roman numerals uses only positive integers.'
);
}
$arr_numerals = array(
(object) array(
'integer... | php | protected function _roman()
{
if(!$this->_decimal()->zero || $this->value < 0){
throw new \RuntimeException(
'Converting into roman numerals uses only positive integers.'
);
}
$arr_numerals = array(
(object) array(
'integer... | [
"protected",
"function",
"_roman",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_decimal",
"(",
")",
"->",
"zero",
"||",
"$",
"this",
"->",
"value",
"<",
"0",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Converting into roman numerals... | Converts current number to roman number.
This converts current positive integer to roman numerals, returning
`\Malenki\Bah\S` object.
Example:
$n = new N(1979);
echo $n->roman; // 'mcmlxxix'
echo $n->roman->upper; // 'MCMLXXIX'
@return S
@throws \RuntimeException If current number is not an positive integer. | [
"Converts",
"current",
"number",
"to",
"roman",
"number",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L1663-L1740 |
205,406 | malenkiki/bah | src/Malenki/Bah/N.php | N._hex | protected function _hex()
{
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot get hexadecimal numbers from non integer.'
);
}
if($this->value < 0){
return new S('-' . dechex(abs($this->value)));
} else {
... | php | protected function _hex()
{
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot get hexadecimal numbers from non integer.'
);
}
if($this->value < 0){
return new S('-' . dechex(abs($this->value)));
} else {
... | [
"protected",
"function",
"_hex",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_decimal",
"(",
")",
"->",
"zero",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot get hexadecimal numbers from non integer.'",
")",
";",
"}",
"if",
"(",
... | Converts to hexadecimal number.
Returns current integer number converted to hexadecimal as
`\Malenki\Bah\S` object.
Example:
$n = new N(2001);
echo $n->hex; // '7d1'
Negative numbers are allowed too:
$n = new N(-2001);
echo $n->hex; // '-7d1'
This is runtime part of its associated magic getter.
@see N::$hex Mag... | [
"Converts",
"to",
"hexadecimal",
"number",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L2143-L2156 |
205,407 | malenkiki/bah | src/Malenki/Bah/N.php | N._oct | protected function _oct()
{
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot get octal numbers from non integer.'
);
}
if($this->value < 0){
return new S('-' . decoct(abs($this->value)));
} else {
ret... | php | protected function _oct()
{
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot get octal numbers from non integer.'
);
}
if($this->value < 0){
return new S('-' . decoct(abs($this->value)));
} else {
ret... | [
"protected",
"function",
"_oct",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_decimal",
"(",
")",
"->",
"zero",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot get octal numbers from non integer.'",
")",
";",
"}",
"if",
"(",
"$",
... | Converts to octal number.
Returns current integer number converted to octal as `\Malenki\Bah\S`
object.
Example:
$n = new N(2001);
echo $n->oct; // '3721'
Negative numbers are allowed too:
$n = new N(-2001);
echo $n->oct; // '-3721'
This is runtime part of its associated magic getter.
@see N::$oct Magic getter ... | [
"Converts",
"to",
"octal",
"number",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L2182-L2196 |
205,408 | malenkiki/bah | src/Malenki/Bah/N.php | N._bin | protected function _bin()
{
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot get binary numbers from non integer.'
);
}
if($this->value < 0){
return new S('-'.decbin(abs($this->value)));
} else {
retu... | php | protected function _bin()
{
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot get binary numbers from non integer.'
);
}
if($this->value < 0){
return new S('-'.decbin(abs($this->value)));
} else {
retu... | [
"protected",
"function",
"_bin",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_decimal",
"(",
")",
"->",
"zero",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot get binary numbers from non integer.'",
")",
";",
"}",
"if",
"(",
"$",
... | Converts to binary number.
Returns current integer number converted to binary as `\Malenki\Bah\S`
object.
Example:
$n = new N(2001);
echo $n->bin; // '11111010001'
Negative numbers are allowed too:
$n = new N(-2001);
echo $n->bin; // '-11111010001'
This is runtime part of its associated magic getter.
@see N::$b... | [
"Converts",
"to",
"binary",
"number",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L2223-L2237 |
205,409 | malenkiki/bah | src/Malenki/Bah/N.php | N.base | public function base($n)
{
self::mustBeInteger($n, 'Base');
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot convert to another base from non integer value.'
);
}
$n = is_object($n) ? $n->int : $n;
if (!is... | php | public function base($n)
{
self::mustBeInteger($n, 'Base');
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot convert to another base from non integer value.'
);
}
$n = is_object($n) ? $n->int : $n;
if (!is... | [
"public",
"function",
"base",
"(",
"$",
"n",
")",
"{",
"self",
"::",
"mustBeInteger",
"(",
"$",
"n",
",",
"'Base'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_decimal",
"(",
")",
"->",
"zero",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",... | Converts current number into another base.
This converts current number to another base. Alowed bases are into the
range `[2, 36]`.
$n = new N(2001);
echo $n->base(2); // '11111010001'
You can have negative result too:
$n = new N(-2001);
echo $n->base(2); // '-11111010001'
@see S::$bin Shorthand for base 2
@see S... | [
"Converts",
"current",
"number",
"into",
"another",
"base",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L2336-L2359 |
205,410 | malenkiki/bah | src/Malenki/Bah/N.php | N.times | public function times($callback)
{
self::mustBeCallable($callback);
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot iterate given callback when number is not integer.'
);
}
if($this->value == 0){
throw new \Run... | php | public function times($callback)
{
self::mustBeCallable($callback);
if(!$this->_decimal()->zero) {
throw new \RuntimeException(
'Cannot iterate given callback when number is not integer.'
);
}
if($this->value == 0){
throw new \Run... | [
"public",
"function",
"times",
"(",
"$",
"callback",
")",
"{",
"self",
"::",
"mustBeCallable",
"(",
"$",
"callback",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_decimal",
"(",
")",
"->",
"zero",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
... | Repeats given callable param.
Runs N times given callable param. N is current number.
As argument, callable params as current index of iteration as
`\Malenki\Bah\N` object.
If callable param returns content, then each returned result is stored
into an `\Malenki\Bah\A` object.
Example:
$n = new N(7);
$func = funct... | [
"Repeats",
"given",
"callable",
"param",
"."
] | 23495014acec63c2790e8021c75bc97d7e04a9c7 | https://github.com/malenkiki/bah/blob/23495014acec63c2790e8021c75bc97d7e04a9c7/src/Malenki/Bah/N.php#L2395-L2425 |
205,411 | PhoxPHP/Glider | src/Schema/Scheme.php | Scheme.id | public function id(String $name = 'id', int $length = 15, Bool $null = false)
{
return $this->integer($name, $length, $null, true, ['primary' => true]);
} | php | public function id(String $name = 'id', int $length = 15, Bool $null = false)
{
return $this->integer($name, $length, $null, true, ['primary' => true]);
} | [
"public",
"function",
"id",
"(",
"String",
"$",
"name",
"=",
"'id'",
",",
"int",
"$",
"length",
"=",
"15",
",",
"Bool",
"$",
"null",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"integer",
"(",
"$",
"name",
",",
"$",
"length",
",",
"$",
... | Represents an auto incremented field with a primary key index.
@param $name String
@param $length Integer
@param $null Boolean
@access public
@return Object Kit\Glider\Schema\Column\Type\Contract\TypeContract | [
"Represents",
"an",
"auto",
"incremented",
"field",
"with",
"a",
"primary",
"key",
"index",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Schema/Scheme.php#L106-L109 |
205,412 | PhoxPHP/Glider | src/Schema/Scheme.php | Scheme.varchar | public function varchar(String $name, int $length=15, Bool $null=false, Bool $autoIncrement=false, Array $options=[])
{
return $this->setType('Varchar', $name, $length, $null, $autoIncrement, $options);
} | php | public function varchar(String $name, int $length=15, Bool $null=false, Bool $autoIncrement=false, Array $options=[])
{
return $this->setType('Varchar', $name, $length, $null, $autoIncrement, $options);
} | [
"public",
"function",
"varchar",
"(",
"String",
"$",
"name",
",",
"int",
"$",
"length",
"=",
"15",
",",
"Bool",
"$",
"null",
"=",
"false",
",",
"Bool",
"$",
"autoIncrement",
"=",
"false",
",",
"Array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"retu... | Represents a variable-length non-binary string field.
@param $name String
@param $length Integer
@param $null Boolean
@param $autoIncrement Boolean
@param $options Array
@access public
@return Object Kit\Glider\Schema\Column\Type\Contract\TypeContract | [
"Represents",
"a",
"variable",
"-",
"length",
"non",
"-",
"binary",
"string",
"field",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Schema/Scheme.php#L122-L125 |
205,413 | PhoxPHP/Glider | src/Schema/Scheme.php | Scheme.decimal | public function decimal(String $name, $length=15, Bool $null=false, Bool $autoIncrement=false, Array $options=[])
{
return $this->setType('Decimal', $name, $length, $null, $autoIncrement, $options);
} | php | public function decimal(String $name, $length=15, Bool $null=false, Bool $autoIncrement=false, Array $options=[])
{
return $this->setType('Decimal', $name, $length, $null, $autoIncrement, $options);
} | [
"public",
"function",
"decimal",
"(",
"String",
"$",
"name",
",",
"$",
"length",
"=",
"15",
",",
"Bool",
"$",
"null",
"=",
"false",
",",
"Bool",
"$",
"autoIncrement",
"=",
"false",
",",
"Array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$... | Represents a fixed-point number field.
@param $name String
@param $length Integer
@param $null Boolean
@param $autoIncrement Boolean
@param $options Array
@access public
@return Object Kit\Glider\Schema\Column\Type\Contract\TypeContract | [
"Represents",
"a",
"fixed",
"-",
"point",
"number",
"field",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Schema/Scheme.php#L250-L253 |
205,414 | PhoxPHP/Glider | src/Schema/Scheme.php | Scheme.date | public function date(String $name, Bool $null = false, Array $options = [])
{
return $this->setType('Date', $name, null, $null, false, $options);
} | php | public function date(String $name, Bool $null = false, Array $options = [])
{
return $this->setType('Date', $name, null, $null, false, $options);
} | [
"public",
"function",
"date",
"(",
"String",
"$",
"name",
",",
"Bool",
"$",
"null",
"=",
"false",
",",
"Array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"setType",
"(",
"'Date'",
",",
"$",
"name",
",",
"null",
",",
"$... | Represents a date field.
@param $name String
@param $null Boolean
@param $options Array
@access public
@return Object Kit\Glider\Schema\Column\Type\Contract\TypeContract
@since 1.4.6 | [
"Represents",
"a",
"date",
"field",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Schema/Scheme.php#L393-L396 |
205,415 | PhoxPHP/Glider | src/Schema/Scheme.php | Scheme.foreign | public function foreign(String $keyName, Array $options=[], String $onDelete='NO ACTION', String $onUpdate='NO ACTION')
{
$columns = $options['columns'];
$referenceTable = $options['references'];
$refColumns = $options['refColumns'];
$clauseList = ['CASCADE', 'RESTRICT', 'NO ACTION'];
if (is_array(... | php | public function foreign(String $keyName, Array $options=[], String $onDelete='NO ACTION', String $onUpdate='NO ACTION')
{
$columns = $options['columns'];
$referenceTable = $options['references'];
$refColumns = $options['refColumns'];
$clauseList = ['CASCADE', 'RESTRICT', 'NO ACTION'];
if (is_array(... | [
"public",
"function",
"foreign",
"(",
"String",
"$",
"keyName",
",",
"Array",
"$",
"options",
"=",
"[",
"]",
",",
"String",
"$",
"onDelete",
"=",
"'NO ACTION'",
",",
"String",
"$",
"onUpdate",
"=",
"'NO ACTION'",
")",
"{",
"$",
"columns",
"=",
"$",
"op... | Generates a foreign key constraint.
@param $keyName <String>
@param $options <Array>
@param $onDelete <String>
@param $onUpdate <String>
@access public
@return <void> | [
"Generates",
"a",
"foreign",
"key",
"constraint",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Schema/Scheme.php#L517-L552 |
205,416 | PhoxPHP/Glider | src/Schema/Scheme.php | Scheme.getDefinition | public function getDefinition($separator=',')
{
$commands = self::$commands;
if (sizeof($commands) > 0) {
return implode($separator, $commands);
}
return null;
} | php | public function getDefinition($separator=',')
{
$commands = self::$commands;
if (sizeof($commands) > 0) {
return implode($separator, $commands);
}
return null;
} | [
"public",
"function",
"getDefinition",
"(",
"$",
"separator",
"=",
"','",
")",
"{",
"$",
"commands",
"=",
"self",
"::",
"$",
"commands",
";",
"if",
"(",
"sizeof",
"(",
"$",
"commands",
")",
">",
"0",
")",
"{",
"return",
"implode",
"(",
"$",
"separato... | Returns type sql definition.
@access public
@return <Mixed> | [
"Returns",
"type",
"sql",
"definition",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Schema/Scheme.php#L560-L569 |
205,417 | METANETAG/formHandler | lib/ch/metanet/formHandler/field/FileField.php | FileField.convertMultiFileArray | protected function convertMultiFileArray(array $filesArr)
{
$files = array();
$filesCount = count($filesArr[self::VALUE_NAME]);
for($i = 0; $i < $filesCount; ++$i) {
$files[] = array(
self::VALUE_NAME => $filesArr[self::VALUE_NAME][$i],
self::VALUE_TYPE => $filesArr[self::VALUE_TYPE][$i],
self::V... | php | protected function convertMultiFileArray(array $filesArr)
{
$files = array();
$filesCount = count($filesArr[self::VALUE_NAME]);
for($i = 0; $i < $filesCount; ++$i) {
$files[] = array(
self::VALUE_NAME => $filesArr[self::VALUE_NAME][$i],
self::VALUE_TYPE => $filesArr[self::VALUE_TYPE][$i],
self::V... | [
"protected",
"function",
"convertMultiFileArray",
"(",
"array",
"$",
"filesArr",
")",
"{",
"$",
"files",
"=",
"array",
"(",
")",
";",
"$",
"filesCount",
"=",
"count",
"(",
"$",
"filesArr",
"[",
"self",
"::",
"VALUE_NAME",
"]",
")",
";",
"for",
"(",
"$"... | Restructures an input array of multiple files
@param array $filesArr
@return array | [
"Restructures",
"an",
"input",
"array",
"of",
"multiple",
"files"
] | 4f6e556e54e3a683edd7da0d2f72ed64e6bf1580 | https://github.com/METANETAG/formHandler/blob/4f6e556e54e3a683edd7da0d2f72ed64e6bf1580/lib/ch/metanet/formHandler/field/FileField.php#L178-L194 |
205,418 | selikhovleonid/nadir | src/core/AbstractCliCtrl.php | AbstractCliCtrl.printLog | protected function printLog($sMessage)
{
$oDate = new \DateTime();
echo $oDate->format('H:i:s')."\t{$sMessage}".PHP_EOL;
return '('.$oDate->format('H:i:s').') '.preg_replace(
'#(\[[0-9]+m)#',
'',
$sMessage
);
} | php | protected function printLog($sMessage)
{
$oDate = new \DateTime();
echo $oDate->format('H:i:s')."\t{$sMessage}".PHP_EOL;
return '('.$oDate->format('H:i:s').') '.preg_replace(
'#(\[[0-9]+m)#',
'',
$sMessage
);
} | [
"protected",
"function",
"printLog",
"(",
"$",
"sMessage",
")",
"{",
"$",
"oDate",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"echo",
"$",
"oDate",
"->",
"format",
"(",
"'H:i:s'",
")",
".",
"\"\\t{$sMessage}\"",
".",
"PHP_EOL",
";",
"return",
"'('",
... | Print message to console
@param string $sMessage Message to print
@return string Message with time | [
"Print",
"message",
"to",
"console"
] | 47545fccd8516c8f0a20c02ba62f68269c7199da | https://github.com/selikhovleonid/nadir/blob/47545fccd8516c8f0a20c02ba62f68269c7199da/src/core/AbstractCliCtrl.php#L29-L38 |
205,419 | the-kbA-team/sap-datetime | src/SapDateTime.php | SapDateTime.createFromSapWeek | public static function createFromSapWeek($sapWeek, $timezone = null)
{
if (preg_match(static::$sapWeekRegex, $sapWeek, $matches) !== 1) {
return false;
}
$week = sprintf('%sW%s', $matches[1], $matches[2]);
return new parent($week, $timezone);
} | php | public static function createFromSapWeek($sapWeek, $timezone = null)
{
if (preg_match(static::$sapWeekRegex, $sapWeek, $matches) !== 1) {
return false;
}
$week = sprintf('%sW%s', $matches[1], $matches[2]);
return new parent($week, $timezone);
} | [
"public",
"static",
"function",
"createFromSapWeek",
"(",
"$",
"sapWeek",
",",
"$",
"timezone",
"=",
"null",
")",
"{",
"if",
"(",
"preg_match",
"(",
"static",
"::",
"$",
"sapWeekRegex",
",",
"$",
"sapWeek",
",",
"$",
"matches",
")",
"!==",
"1",
")",
"{... | Parse an SAP week string into a new DateTime object.
@param string $sapWeek String representing the SAP week.
@param \DateTimeZone $timezone A DateTimeZone object representing the desired
time zone.
@return \DateTime|boolean
@throws \Exception | [
"Parse",
"an",
"SAP",
"week",
"string",
"into",
"a",
"new",
"DateTime",
"object",
"."
] | 30c1f7549f4848c7626c2832bf57257dc61bd062 | https://github.com/the-kbA-team/sap-datetime/blob/30c1f7549f4848c7626c2832bf57257dc61bd062/src/SapDateTime.php#L55-L62 |
205,420 | slickframework/form | src/Form.php | Form.getElementData | protected function getElementData(
ContainerInterface $container, &$data = []
) {
foreach ($container as $element) {
if ($element instanceof InputInterface) {
$data[$element->getName()] = $element->getValue();
continue;
}
if ... | php | protected function getElementData(
ContainerInterface $container, &$data = []
) {
foreach ($container as $element) {
if ($element instanceof InputInterface) {
$data[$element->getName()] = $element->getValue();
continue;
}
if ... | [
"protected",
"function",
"getElementData",
"(",
"ContainerInterface",
"$",
"container",
",",
"&",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"container",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"instanceof",
"InputInterfa... | Recursively collects all posted data
@param ContainerInterface $container
@param array $data | [
"Recursively",
"collects",
"all",
"posted",
"data"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Form.php#L100-L114 |
205,421 | slickframework/form | src/Form.php | Form.wasSubmitted | public function wasSubmitted()
{
$formMethod = strtoupper($this->getAttribute('method', 'post'));
$formId = $this->getRequest()->getPost('form-id', false);
$formId = $formId
? $formId
: $this->getRequest()->getQuery('form-id', null);
$submitted = $this->reque... | php | public function wasSubmitted()
{
$formMethod = strtoupper($this->getAttribute('method', 'post'));
$formId = $this->getRequest()->getPost('form-id', false);
$formId = $formId
? $formId
: $this->getRequest()->getQuery('form-id', null);
$submitted = $this->reque... | [
"public",
"function",
"wasSubmitted",
"(",
")",
"{",
"$",
"formMethod",
"=",
"strtoupper",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"'method'",
",",
"'post'",
")",
")",
";",
"$",
"formId",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getP... | Check if for was submitted or not
@return boolean | [
"Check",
"if",
"for",
"was",
"submitted",
"or",
"not"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Form.php#L169-L183 |
205,422 | slickframework/form | src/Form.php | Form.updateValuesFromRequest | protected function updateValuesFromRequest()
{
$data = $this->getRequest()->isPost()
? $this->getRequest()->getPost()
: $this->getRequest()->getQuery();
if (isset($_FILES)) {
$data = array_merge($data, $this->request->getUploadedFiles());
}
$this->... | php | protected function updateValuesFromRequest()
{
$data = $this->getRequest()->isPost()
? $this->getRequest()->getPost()
: $this->getRequest()->getQuery();
if (isset($_FILES)) {
$data = array_merge($data, $this->request->getUploadedFiles());
}
$this->... | [
"protected",
"function",
"updateValuesFromRequest",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"isPost",
"(",
")",
"?",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getPost",
"(",
")",
":",
"$",
"this",
"->... | Assign form values from request | [
"Assign",
"form",
"values",
"from",
"request"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Form.php#L201-L211 |
205,423 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Framework/Theme/Zone/Domain/Command/CreateCommand.php | CreateCommand.resolve | public function resolve()
{
$this->zone = new $this->zoneClass();
$this->zone->setZoneType($this->zoneType);
$this->zone->setComponents(
$this->components->buildRanking()
);
$this->assertEntityIsValid($this->zone, array('Zone', 'creation'));
$this->fireE... | php | public function resolve()
{
$this->zone = new $this->zoneClass();
$this->zone->setZoneType($this->zoneType);
$this->zone->setComponents(
$this->components->buildRanking()
);
$this->assertEntityIsValid($this->zone, array('Zone', 'creation'));
$this->fireE... | [
"public",
"function",
"resolve",
"(",
")",
"{",
"$",
"this",
"->",
"zone",
"=",
"new",
"$",
"this",
"->",
"zoneClass",
"(",
")",
";",
"$",
"this",
"->",
"zone",
"->",
"setZoneType",
"(",
"$",
"this",
"->",
"zoneType",
")",
";",
"$",
"this",
"->",
... | Zone creation method.
@return Zone | [
"Zone",
"creation",
"method",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Theme/Zone/Domain/Command/CreateCommand.php#L47-L63 |
205,424 | wigedev/farm | src/DataInterface/Grid.php | Grid.addRow | public function addRow(array $data = []) : int
{
$this->crudEnabled();
$table_name = static::$table_name;
if (0 == count($data)) {
// Insert a blank row
$sql = "INSERT INTO {$table_name} DEFAULT VALUES"; // TODO: Move this to the DAO class
$this->dbc->qu... | php | public function addRow(array $data = []) : int
{
$this->crudEnabled();
$table_name = static::$table_name;
if (0 == count($data)) {
// Insert a blank row
$sql = "INSERT INTO {$table_name} DEFAULT VALUES"; // TODO: Move this to the DAO class
$this->dbc->qu... | [
"public",
"function",
"addRow",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
":",
"int",
"{",
"$",
"this",
"->",
"crudEnabled",
"(",
")",
";",
"$",
"table_name",
"=",
"static",
"::",
"$",
"table_name",
";",
"if",
"(",
"0",
"==",
"count",
"(",
"... | Add a row to the table represented by this grid. If a table name, id column or structure for the table is not
defined above, this function will not work.
@param string[] $data The parameters to be added to the row
@return int The id of the generated row
@throws \Exception If required values have not been set on the ch... | [
"Add",
"a",
"row",
"to",
"the",
"table",
"represented",
"by",
"this",
"grid",
".",
"If",
"a",
"table",
"name",
"id",
"column",
"or",
"structure",
"for",
"the",
"table",
"is",
"not",
"defined",
"above",
"this",
"function",
"will",
"not",
"work",
"."
] | 7a1729ec78628b7e5435e4a42e42d547a07af851 | https://github.com/wigedev/farm/blob/7a1729ec78628b7e5435e4a42e42d547a07af851/src/DataInterface/Grid.php#L43-L66 |
205,425 | wigedev/farm | src/DataInterface/Grid.php | Grid.deleteRow | public function deleteRow(int $id) : void
{
$this->crudEnabled();
// Generate the values
$table_name = static::$table_name;
$id_column = static::$id_column;
$sql = "DELETE FROM {$table_name} WHERE {$id_column} = :key";
$this->dbc->query($sql, ['params' => [':key' =>... | php | public function deleteRow(int $id) : void
{
$this->crudEnabled();
// Generate the values
$table_name = static::$table_name;
$id_column = static::$id_column;
$sql = "DELETE FROM {$table_name} WHERE {$id_column} = :key";
$this->dbc->query($sql, ['params' => [':key' =>... | [
"public",
"function",
"deleteRow",
"(",
"int",
"$",
"id",
")",
":",
"void",
"{",
"$",
"this",
"->",
"crudEnabled",
"(",
")",
";",
"// Generate the values",
"$",
"table_name",
"=",
"static",
"::",
"$",
"table_name",
";",
"$",
"id_column",
"=",
"static",
"... | Delete the row specified by the passed identifier. If the necessary crud fields have not been identified in the
child class, this function will throw an exception.
@param int $id
@throws \Exception | [
"Delete",
"the",
"row",
"specified",
"by",
"the",
"passed",
"identifier",
".",
"If",
"the",
"necessary",
"crud",
"fields",
"have",
"not",
"been",
"identified",
"in",
"the",
"child",
"class",
"this",
"function",
"will",
"throw",
"an",
"exception",
"."
] | 7a1729ec78628b7e5435e4a42e42d547a07af851 | https://github.com/wigedev/farm/blob/7a1729ec78628b7e5435e4a42e42d547a07af851/src/DataInterface/Grid.php#L75-L85 |
205,426 | wigedev/farm | src/DataInterface/Grid.php | Grid.updateRow | public function updateRow($id, array $data) : void
{
$this->crudEnabled();
// Generate the values
$components = $this->dbc->generateParameterizedComponents($data);
$table_name = static::$table_name;
$id_column = static::$id_column;
$fields = $components['update'];
... | php | public function updateRow($id, array $data) : void
{
$this->crudEnabled();
// Generate the values
$components = $this->dbc->generateParameterizedComponents($data);
$table_name = static::$table_name;
$id_column = static::$id_column;
$fields = $components['update'];
... | [
"public",
"function",
"updateRow",
"(",
"$",
"id",
",",
"array",
"$",
"data",
")",
":",
"void",
"{",
"$",
"this",
"->",
"crudEnabled",
"(",
")",
";",
"// Generate the values",
"$",
"components",
"=",
"$",
"this",
"->",
"dbc",
"->",
"generateParameterizedCo... | Updates an existing row, based on the passed identifier. If the necessary crud fields have not been identified
in the child class, this function will throw an exception.
@param mixed $id The id of the row to update
@param array $data The new data to enter
@throws \Exception | [
"Updates",
"an",
"existing",
"row",
"based",
"on",
"the",
"passed",
"identifier",
".",
"If",
"the",
"necessary",
"crud",
"fields",
"have",
"not",
"been",
"identified",
"in",
"the",
"child",
"class",
"this",
"function",
"will",
"throw",
"an",
"exception",
"."... | 7a1729ec78628b7e5435e4a42e42d547a07af851 | https://github.com/wigedev/farm/blob/7a1729ec78628b7e5435e4a42e42d547a07af851/src/DataInterface/Grid.php#L95-L110 |
205,427 | diasbruno/stc | lib/stc/Database.php | Database.store | public function store($key = '', $value = array(), $lock = true)
{
if ($key == '') {
$this->fault('[Error] Cannot store data without a key. Key is "' . $key . '".');
}
if (!$this->has_key($key)) {
$this->create($key, $lock);
$this->store_data($key, $value);
} else {
if (!$this... | php | public function store($key = '', $value = array(), $lock = true)
{
if ($key == '') {
$this->fault('[Error] Cannot store data without a key. Key is "' . $key . '".');
}
if (!$this->has_key($key)) {
$this->create($key, $lock);
$this->store_data($key, $value);
} else {
if (!$this... | [
"public",
"function",
"store",
"(",
"$",
"key",
"=",
"''",
",",
"$",
"value",
"=",
"array",
"(",
")",
",",
"$",
"lock",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"''",
")",
"{",
"$",
"this",
"->",
"fault",
"(",
"'[Error] Cannot store da... | Saves some data by key value.
@param $key string | The key name.
@param $value any | The value. | [
"Saves",
"some",
"data",
"by",
"key",
"value",
"."
] | 43f62c3b28167bff76274f954e235413a9e9c707 | https://github.com/diasbruno/stc/blob/43f62c3b28167bff76274f954e235413a9e9c707/lib/stc/Database.php#L81-L97 |
205,428 | openclerk/users | src/User.php | User.forceLogin | static function forceLogin(\Db\Connection $db, $user_id) {
User::$instance = User::findUser($db, $user_id);
} | php | static function forceLogin(\Db\Connection $db, $user_id) {
User::$instance = User::findUser($db, $user_id);
} | [
"static",
"function",
"forceLogin",
"(",
"\\",
"Db",
"\\",
"Connection",
"$",
"db",
",",
"$",
"user_id",
")",
"{",
"User",
"::",
"$",
"instance",
"=",
"User",
"::",
"findUser",
"(",
"$",
"db",
",",
"$",
"user_id",
")",
";",
"}"
] | Login as the given user_id. | [
"Login",
"as",
"the",
"given",
"user_id",
"."
] | 550c7610c154a2f6655ce65a2df377ccb207bc6d | https://github.com/openclerk/users/blob/550c7610c154a2f6655ce65a2df377ccb207bc6d/src/User.php#L102-L104 |
205,429 | openclerk/users | src/User.php | User.delete | function delete(\Db\Connection $db) {
// delete all possible identities
$q = $db->prepare("DELETE FROM user_passwords WHERE user_id=?");
$q->execute(array($this->getId()));
$q = $db->prepare("DELETE FROM user_openid_identities WHERE user_id=?");
$q->execute(array($this->getId()));
$q = $db->prep... | php | function delete(\Db\Connection $db) {
// delete all possible identities
$q = $db->prepare("DELETE FROM user_passwords WHERE user_id=?");
$q->execute(array($this->getId()));
$q = $db->prepare("DELETE FROM user_openid_identities WHERE user_id=?");
$q->execute(array($this->getId()));
$q = $db->prep... | [
"function",
"delete",
"(",
"\\",
"Db",
"\\",
"Connection",
"$",
"db",
")",
"{",
"// delete all possible identities",
"$",
"q",
"=",
"$",
"db",
"->",
"prepare",
"(",
"\"DELETE FROM user_passwords WHERE user_id=?\"",
")",
";",
"$",
"q",
"->",
"execute",
"(",
"ar... | Delete the given user. Triggers a 'user_deleted' event with the
current user as an argument. | [
"Delete",
"the",
"given",
"user",
".",
"Triggers",
"a",
"user_deleted",
"event",
"with",
"the",
"current",
"user",
"as",
"an",
"argument",
"."
] | 550c7610c154a2f6655ce65a2df377ccb207bc6d | https://github.com/openclerk/users/blob/550c7610c154a2f6655ce65a2df377ccb207bc6d/src/User.php#L155-L169 |
205,430 | tetreum/apache-vhost-processor | src/VirtualHost.php | VirtualHost.toString | public function toString ()
{
$content = "<VirtualHost {$this->address}:{$this->port}>" . PHP_EOL;
foreach ($this->directives as $directive) {
$content .= $directive->toString() . PHP_EOL;
}
$content .= PHP_EOL;
foreach ($this->directories as $directory) {
$content .= $directory->to... | php | public function toString ()
{
$content = "<VirtualHost {$this->address}:{$this->port}>" . PHP_EOL;
foreach ($this->directives as $directive) {
$content .= $directive->toString() . PHP_EOL;
}
$content .= PHP_EOL;
foreach ($this->directories as $directory) {
$content .= $directory->to... | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"content",
"=",
"\"<VirtualHost {$this->address}:{$this->port}>\"",
".",
"PHP_EOL",
";",
"foreach",
"(",
"$",
"this",
"->",
"directives",
"as",
"$",
"directive",
")",
"{",
"$",
"content",
".=",
"$",
"direct... | Converts vh to plain text
@return | [
"Converts",
"vh",
"to",
"plain",
"text"
] | bdf46a3a32126dc9667f0ff4c51b2a39dcc796e2 | https://github.com/tetreum/apache-vhost-processor/blob/bdf46a3a32126dc9667f0ff4c51b2a39dcc796e2/src/VirtualHost.php#L30-L48 |
205,431 | jtallant/skimpy-engine | src/Http/Middleware/ContentCacheHandler.php | ContentCacheHandler.handleRequest | public function handleRequest(Request $request, Application $app)
{
# Rebuild on every request in dev environment
if ($this->isAutoRebuildMode($app)) {
$this->rebuildDatabase();
return;
}
if ($this->dbHasNotBeenBuilt()) {
$this->rebuildDatabase()... | php | public function handleRequest(Request $request, Application $app)
{
# Rebuild on every request in dev environment
if ($this->isAutoRebuildMode($app)) {
$this->rebuildDatabase();
return;
}
if ($this->dbHasNotBeenBuilt()) {
$this->rebuildDatabase()... | [
"public",
"function",
"handleRequest",
"(",
"Request",
"$",
"request",
",",
"Application",
"$",
"app",
")",
"{",
"# Rebuild on every request in dev environment",
"if",
"(",
"$",
"this",
"->",
"isAutoRebuildMode",
"(",
"$",
"app",
")",
")",
"{",
"$",
"this",
"-... | If the request includes an instruction to rebuild the db, do that
@param Request $request
@param Application $app | [
"If",
"the",
"request",
"includes",
"an",
"instruction",
"to",
"rebuild",
"the",
"db",
"do",
"that"
] | 2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2 | https://github.com/jtallant/skimpy-engine/blob/2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2/src/Http/Middleware/ContentCacheHandler.php#L42-L60 |
205,432 | jtallant/skimpy-engine | src/Http/Middleware/ContentCacheHandler.php | ContentCacheHandler.rebuildDatabase | protected function rebuildDatabase()
{
$this->populator->populate();
$path = $this->buildIndicator->getPathname();
$content = 'Initial Build: '.date('Y-m-d H:i:s');
$this->filesystem->remove($path);
$this->filesystem->dumpFile($path, $content);
} | php | protected function rebuildDatabase()
{
$this->populator->populate();
$path = $this->buildIndicator->getPathname();
$content = 'Initial Build: '.date('Y-m-d H:i:s');
$this->filesystem->remove($path);
$this->filesystem->dumpFile($path, $content);
} | [
"protected",
"function",
"rebuildDatabase",
"(",
")",
"{",
"$",
"this",
"->",
"populator",
"->",
"populate",
"(",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"buildIndicator",
"->",
"getPathname",
"(",
")",
";",
"$",
"content",
"=",
"'Initial Build: '",... | Builds the DB and creates a file indicating
that the DB has been built at least once.
@return void | [
"Builds",
"the",
"DB",
"and",
"creates",
"a",
"file",
"indicating",
"that",
"the",
"DB",
"has",
"been",
"built",
"at",
"least",
"once",
"."
] | 2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2 | https://github.com/jtallant/skimpy-engine/blob/2fce5bc16f8745e54fd66a1c291fcea47fc1b4b2/src/Http/Middleware/ContentCacheHandler.php#L78-L87 |
205,433 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/Form/Row.php | Row.renderError | protected function renderError(ElementInterface $element)
{
$messages = $element->getMessages();
if (empty($messages)) {
return null;
}
$errorPlugin = $this->getView()->plugin('sxb_form_errors');
return $errorPlugin($element);
} | php | protected function renderError(ElementInterface $element)
{
$messages = $element->getMessages();
if (empty($messages)) {
return null;
}
$errorPlugin = $this->getView()->plugin('sxb_form_errors');
return $errorPlugin($element);
} | [
"protected",
"function",
"renderError",
"(",
"ElementInterface",
"$",
"element",
")",
"{",
"$",
"messages",
"=",
"$",
"element",
"->",
"getMessages",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"messages",
")",
")",
"{",
"return",
"null",
";",
"}",
"$... | Render errors.
@param ElementInterface $element
@return null|\SxBootstrap\View\Helper\Bootstrap\Form\Errors | [
"Render",
"errors",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/Form/Row.php#L134-L145 |
205,434 | ben-gibson/foursquare-venue-client | src/Factory/Tip/TipGroupFactory.php | TipGroupFactory.getTips | private function getTips(Description $description)
{
return array_map(
function (\stdClass $tipDescription) {
return $this->tipFactory->create(new Description($tipDescription));
},
$description->getOptionalProperty('items', [])
);
} | php | private function getTips(Description $description)
{
return array_map(
function (\stdClass $tipDescription) {
return $this->tipFactory->create(new Description($tipDescription));
},
$description->getOptionalProperty('items', [])
);
} | [
"private",
"function",
"getTips",
"(",
"Description",
"$",
"description",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"\\",
"stdClass",
"$",
"tipDescription",
")",
"{",
"return",
"$",
"this",
"->",
"tipFactory",
"->",
"create",
"(",
"new",
"Descri... | Get the venue tips.
@param Description $description The tip group description.
@return Tip[] | [
"Get",
"the",
"venue",
"tips",
"."
] | ce5e7c308f87d5ccc28ab8d27a9cb51bd106d969 | https://github.com/ben-gibson/foursquare-venue-client/blob/ce5e7c308f87d5ccc28ab8d27a9cb51bd106d969/src/Factory/Tip/TipGroupFactory.php#L49-L57 |
205,435 | imatic/controller-bundle | Resource/ConfigurationProcessor.php | ConfigurationProcessor.arrayMap | public static function arrayMap(callable $callback, array $array)
{
foreach ($array as $key => $value) {
$array[$key] = \call_user_func($callback, $value, $key);
}
return $array;
} | php | public static function arrayMap(callable $callback, array $array)
{
foreach ($array as $key => $value) {
$array[$key] = \call_user_func($callback, $value, $key);
}
return $array;
} | [
"public",
"static",
"function",
"arrayMap",
"(",
"callable",
"$",
"callback",
",",
"array",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"array",
"[",
"$",
"key",
"]",
"=",
"\\",
"call_u... | - array keys are available in callback
- array keys have not been changed | [
"-",
"array",
"keys",
"are",
"available",
"in",
"callback",
"-",
"array",
"keys",
"have",
"not",
"been",
"changed"
] | df71c12166928f9d4f1548d4ee1e09a183a68eb6 | https://github.com/imatic/controller-bundle/blob/df71c12166928f9d4f1548d4ee1e09a183a68eb6/Resource/ConfigurationProcessor.php#L203-L210 |
205,436 | danhanly/signalert | src/Signalert/Config.php | Config.expandConfigDirectories | private function expandConfigDirectories()
{
$newPaths = [];
foreach ($this->configDirectories as $filePath) {
$newPaths[] = __DIR__ . '/../../../../../' . $filePath;
}
$this->configDirectories = $newPaths;
} | php | private function expandConfigDirectories()
{
$newPaths = [];
foreach ($this->configDirectories as $filePath) {
$newPaths[] = __DIR__ . '/../../../../../' . $filePath;
}
$this->configDirectories = $newPaths;
} | [
"private",
"function",
"expandConfigDirectories",
"(",
")",
"{",
"$",
"newPaths",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"configDirectories",
"as",
"$",
"filePath",
")",
"{",
"$",
"newPaths",
"[",
"]",
"=",
"__DIR__",
".",
"'/../../../../..... | Ensures that config directories are relative paths | [
"Ensures",
"that",
"config",
"directories",
"are",
"relative",
"paths"
] | 21ee50e3fc0352306a2966b555984b5c9eada582 | https://github.com/danhanly/signalert/blob/21ee50e3fc0352306a2966b555984b5c9eada582/src/Signalert/Config.php#L114-L121 |
205,437 | neneaX/IoC | src/Container.php | Container.register | public function register($alias, $binding, $shared = false)
{
$this->registry[$alias] = new Resolver(new Builder($binding), $shared);
} | php | public function register($alias, $binding, $shared = false)
{
$this->registry[$alias] = new Resolver(new Builder($binding), $shared);
} | [
"public",
"function",
"register",
"(",
"$",
"alias",
",",
"$",
"binding",
",",
"$",
"shared",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"registry",
"[",
"$",
"alias",
"]",
"=",
"new",
"Resolver",
"(",
"new",
"Builder",
"(",
"$",
"binding",
")",
",... | Register a binding with the registry
@param string $alias The alias used for registering the binding
@param \Closure|object|string|null $binding The binding requested to register
@param boolean $shared The type of the binding: shared (singleton) or not | [
"Register",
"a",
"binding",
"with",
"the",
"registry"
] | 404888c3252880f8bb48253f9aa636cd7c396416 | https://github.com/neneaX/IoC/blob/404888c3252880f8bb48253f9aa636cd7c396416/src/Container.php#L108-L111 |
205,438 | neneaX/IoC | src/Container.php | Container.resolve | public function resolve($alias, array $parameters = array(), $force = false)
{
if ($this->registered($alias)) {
$resolver = $this->registry[$alias];
return $resolver->execute($parameters, $force);
}
throw new \Exception('No class found registered with that name:... | php | public function resolve($alias, array $parameters = array(), $force = false)
{
if ($this->registered($alias)) {
$resolver = $this->registry[$alias];
return $resolver->execute($parameters, $force);
}
throw new \Exception('No class found registered with that name:... | [
"public",
"function",
"resolve",
"(",
"$",
"alias",
",",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"registered",
"(",
"$",
"alias",
")",
")",
"{",
"$",
"resolver",
... | Execute the Resolver and return the requested binding instance
@param string $alias The registered binding's alias
@param array $parameters
@param boolean $force Force the overriding of the "shared" option and return a new instance of the requested binding
@return object
@throws \Exception When no resolver is found f... | [
"Execute",
"the",
"Resolver",
"and",
"return",
"the",
"requested",
"binding",
"instance"
] | 404888c3252880f8bb48253f9aa636cd7c396416 | https://github.com/neneaX/IoC/blob/404888c3252880f8bb48253f9aa636cd7c396416/src/Container.php#L134-L143 |
205,439 | acacha/forge-publish | src/Console/Commands/PublishUpdateAssignment.php | PublishUpdateAssignment.updateAssignment | protected function updateAssignment()
{
$uri = str_replace('{assignment}', $this->assignment, config('forge-publish.update_assignment_uri'));
$url = config('forge-publish.url') . $uri;
try {
$response = $this->http->put($url, [
'form_params' => [
... | php | protected function updateAssignment()
{
$uri = str_replace('{assignment}', $this->assignment, config('forge-publish.update_assignment_uri'));
$url = config('forge-publish.url') . $uri;
try {
$response = $this->http->put($url, [
'form_params' => [
... | [
"protected",
"function",
"updateAssignment",
"(",
")",
"{",
"$",
"uri",
"=",
"str_replace",
"(",
"'{assignment}'",
",",
"$",
"this",
"->",
"assignment",
",",
"config",
"(",
"'forge-publish.update_assignment_uri'",
")",
")",
";",
"$",
"url",
"=",
"config",
"(",... | Update assignment.
@return array|mixed | [
"Update",
"assignment",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/PublishUpdateAssignment.php#L130-L154 |
205,440 | austinkregel/formmodel | src/FormModel/Frameworks/Bootstrap.php | Bootstrap.form | public function form(array $options = [])
{
$method = empty($options['method']) ? $options['method'] : '';
if (in_array(strtolower($method), ['get', 'post'])) {
$real_method = $method;
} else {
$real_method = 'POST';
}
$options['method'] = $real_method... | php | public function form(array $options = [])
{
$method = empty($options['method']) ? $options['method'] : '';
if (in_array(strtolower($method), ['get', 'post'])) {
$real_method = $method;
} else {
$real_method = 'POST';
}
$options['method'] = $real_method... | [
"public",
"function",
"form",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"method",
"=",
"empty",
"(",
"$",
"options",
"[",
"'method'",
"]",
")",
"?",
"$",
"options",
"[",
"'method'",
"]",
":",
"''",
";",
"if",
"(",
"in_array",
"(... | Generate the form.
@param array $options
@return string | [
"Generate",
"the",
"form",
"."
] | 49943a8f563d2e9028f6bc992708e104f9be22e3 | https://github.com/austinkregel/formmodel/blob/49943a8f563d2e9028f6bc992708e104f9be22e3/src/FormModel/Frameworks/Bootstrap.php#L14-L28 |
205,441 | selikhovleonid/nadir | src/core/Headers.php | Headers.add | public function add($sHeader)
{
foreach ($this->headerList as $sTmp) {
if ($sTmp == $sHeader) {
throw new Exception("The '{$sHeader}' header has already been added.");
}
}
$this->headerList[] = $sHeader;
return self::$instance;
} | php | public function add($sHeader)
{
foreach ($this->headerList as $sTmp) {
if ($sTmp == $sHeader) {
throw new Exception("The '{$sHeader}' header has already been added.");
}
}
$this->headerList[] = $sHeader;
return self::$instance;
} | [
"public",
"function",
"add",
"(",
"$",
"sHeader",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"headerList",
"as",
"$",
"sTmp",
")",
"{",
"if",
"(",
"$",
"sTmp",
"==",
"$",
"sHeader",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"The '{$sHeader}' head... | It adds the header to the stack.
@param string $sHeader The page header.
@return self.
@throws \core\Exception It throws if passed header was already added earlier. | [
"It",
"adds",
"the",
"header",
"to",
"the",
"stack",
"."
] | 47545fccd8516c8f0a20c02ba62f68269c7199da | https://github.com/selikhovleonid/nadir/blob/47545fccd8516c8f0a20c02ba62f68269c7199da/src/core/Headers.php#L136-L145 |
205,442 | selikhovleonid/nadir | src/core/Headers.php | Headers.addByHttpCode | public function addByHttpCode($nCode)
{
$sProtocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL']
: 'HTTP/1.1';
$sHeader = "{$sProtocol} {$nCode} "
.self::getHTTPExplanationByCode($nCode);
return $this->add($sHeader);
} | php | public function addByHttpCode($nCode)
{
$sProtocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL']
: 'HTTP/1.1';
$sHeader = "{$sProtocol} {$nCode} "
.self::getHTTPExplanationByCode($nCode);
return $this->add($sHeader);
} | [
"public",
"function",
"addByHttpCode",
"(",
"$",
"nCode",
")",
"{",
"$",
"sProtocol",
"=",
"isset",
"(",
"$",
"_SERVER",
"[",
"'SERVER_PROTOCOL'",
"]",
")",
"?",
"$",
"_SERVER",
"[",
"'SERVER_PROTOCOL'",
"]",
":",
"'HTTP/1.1'",
";",
"$",
"sHeader",
"=",
... | It adds the header to the stack by HTTP code.
@param integer $nCode The code.
@return self. | [
"It",
"adds",
"the",
"header",
"to",
"the",
"stack",
"by",
"HTTP",
"code",
"."
] | 47545fccd8516c8f0a20c02ba62f68269c7199da | https://github.com/selikhovleonid/nadir/blob/47545fccd8516c8f0a20c02ba62f68269c7199da/src/core/Headers.php#L152-L159 |
205,443 | selikhovleonid/nadir | src/core/Headers.php | Headers.run | public function run()
{
$this->isRan = true;
foreach ($this->headerList as $sHeader) {
header($sHeader);
}
} | php | public function run()
{
$this->isRan = true;
foreach ($this->headerList as $sHeader) {
header($sHeader);
}
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"isRan",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"headerList",
"as",
"$",
"sHeader",
")",
"{",
"header",
"(",
"$",
"sHeader",
")",
";",
"}",
"}"
] | The main execution method. It sets all added headers into the page.
@return void. | [
"The",
"main",
"execution",
"method",
".",
"It",
"sets",
"all",
"added",
"headers",
"into",
"the",
"page",
"."
] | 47545fccd8516c8f0a20c02ba62f68269c7199da | https://github.com/selikhovleonid/nadir/blob/47545fccd8516c8f0a20c02ba62f68269c7199da/src/core/Headers.php#L183-L189 |
205,444 | andyburton/Sonic-Framework | src/Controller/Tools.php | Tools.clearcache | public function clearcache ()
{
if ($this->view instanceof \Sonic\View\Smarty)
{
$this->view->clearCompiledTemplate ();
$this->view->clearAllCache ();
}
new \Sonic\Message ('success', 'Cache Cleared');
$this->template = 'tools/index.tpl';
} | php | public function clearcache ()
{
if ($this->view instanceof \Sonic\View\Smarty)
{
$this->view->clearCompiledTemplate ();
$this->view->clearAllCache ();
}
new \Sonic\Message ('success', 'Cache Cleared');
$this->template = 'tools/index.tpl';
} | [
"public",
"function",
"clearcache",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"view",
"instanceof",
"\\",
"Sonic",
"\\",
"View",
"\\",
"Smarty",
")",
"{",
"$",
"this",
"->",
"view",
"->",
"clearCompiledTemplate",
"(",
")",
";",
"$",
"this",
"->",
... | Clear the view cache | [
"Clear",
"the",
"view",
"cache"
] | a5999448a0abab4d542413002a780ede391e7374 | https://github.com/andyburton/Sonic-Framework/blob/a5999448a0abab4d542413002a780ede391e7374/src/Controller/Tools.php#L41-L53 |
205,445 | Phpillip/phpillip | src/Service/Pygments.php | Pygments.highlight | public function highlight($value, $language)
{
$path = tempnam($this->tmp, 'pyg');
if ($language === 'php' && substr($value, 0, 5) !== '<?php') {
$value = '<?php ' . PHP_EOL . $value;
}
$this->files->dumpFile($path, $value);
$value = $this->pygmentize($path, $l... | php | public function highlight($value, $language)
{
$path = tempnam($this->tmp, 'pyg');
if ($language === 'php' && substr($value, 0, 5) !== '<?php') {
$value = '<?php ' . PHP_EOL . $value;
}
$this->files->dumpFile($path, $value);
$value = $this->pygmentize($path, $l... | [
"public",
"function",
"highlight",
"(",
"$",
"value",
",",
"$",
"language",
")",
"{",
"$",
"path",
"=",
"tempnam",
"(",
"$",
"this",
"->",
"tmp",
",",
"'pyg'",
")",
";",
"if",
"(",
"$",
"language",
"===",
"'php'",
"&&",
"substr",
"(",
"$",
"value",... | Highlight a portion of code with pygmentize
@param string $value
@param string $language
@return string | [
"Highlight",
"a",
"portion",
"of",
"code",
"with",
"pygmentize"
] | c37afaafb536361e7e0b564659f1cd5b80b98be9 | https://github.com/Phpillip/phpillip/blob/c37afaafb536361e7e0b564659f1cd5b80b98be9/src/Service/Pygments.php#L47-L66 |
205,446 | Phpillip/phpillip | src/Service/Pygments.php | Pygments.pygmentize | public function pygmentize($path, $language)
{
$process = new Process(sprintf('pygmentize -f html -l %s %s', $language, $path));
$process->run();
if (!$process->isSuccessful()) {
throw new RuntimeException($process->getErrorOutput());
}
return trim($process->ge... | php | public function pygmentize($path, $language)
{
$process = new Process(sprintf('pygmentize -f html -l %s %s', $language, $path));
$process->run();
if (!$process->isSuccessful()) {
throw new RuntimeException($process->getErrorOutput());
}
return trim($process->ge... | [
"public",
"function",
"pygmentize",
"(",
"$",
"path",
",",
"$",
"language",
")",
"{",
"$",
"process",
"=",
"new",
"Process",
"(",
"sprintf",
"(",
"'pygmentize -f html -l %s %s'",
",",
"$",
"language",
",",
"$",
"path",
")",
")",
";",
"$",
"process",
"->"... | Run 'pygmentize' command on the given file
@param string $path
@param string $language
@return string | [
"Run",
"pygmentize",
"command",
"on",
"the",
"given",
"file"
] | c37afaafb536361e7e0b564659f1cd5b80b98be9 | https://github.com/Phpillip/phpillip/blob/c37afaafb536361e7e0b564659f1cd5b80b98be9/src/Service/Pygments.php#L76-L87 |
205,447 | stonedz/pff2 | src/modules/auth/Auth.php | Auth.checkAuth | public function checkAuth() {
if (isset($_SESSION[$this->_sessionVarName]) &&
$_SESSION[$this->_sessionVarName] == 1
) {
return true;
} else {
return false;
}
} | php | public function checkAuth() {
if (isset($_SESSION[$this->_sessionVarName]) &&
$_SESSION[$this->_sessionVarName] == 1
) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"checkAuth",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"_sessionVarName",
"]",
")",
"&&",
"$",
"_SESSION",
"[",
"$",
"this",
"->",
"_sessionVarName",
"]",
"==",
"1",
")",
"{",
"return",
"tr... | Checks if a client is logged-in
@return bool | [
"Checks",
"if",
"a",
"client",
"is",
"logged",
"-",
"in"
] | ec3b087d4d4732816f61ac487f0cb25511e0da88 | https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/modules/auth/Auth.php#L119-L127 |
205,448 | oliwierptak/Everon1 | src/Everon/Helper/Asserts/IsNull.php | IsNull.assertIsNull | public function assertIsNull($value, $message='Unexpected null value: %s', $exception='Asserts')
{
if (is_null($value)) {
$value = 'NULL';
$this->throwException($exception, $message, $value);
}
} | php | public function assertIsNull($value, $message='Unexpected null value: %s', $exception='Asserts')
{
if (is_null($value)) {
$value = 'NULL';
$this->throwException($exception, $message, $value);
}
} | [
"public",
"function",
"assertIsNull",
"(",
"$",
"value",
",",
"$",
"message",
"=",
"'Unexpected null value: %s'",
",",
"$",
"exception",
"=",
"'Asserts'",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"'NULL'",
";",... | Verifies that the specified condition is not null.
The assertion fails if the condition is null.
@param mixed $value
@param string $message
@param string $exception
@throws \Everon\Exception\Asserts | [
"Verifies",
"that",
"the",
"specified",
"condition",
"is",
"not",
"null",
".",
"The",
"assertion",
"fails",
"if",
"the",
"condition",
"is",
"null",
"."
] | ac93793d1fa517a8394db5f00062f1925dc218a3 | https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Helper/Asserts/IsNull.php#L23-L29 |
205,449 | schpill/thin | src/Html/Row.php | Row.row | public function row(array $attributes = array())
{
$row = new self();
if (count($attributes)) {
$row->setAttributes($attributes);
}
return $row;
} | php | public function row(array $attributes = array())
{
$row = new self();
if (count($attributes)) {
$row->setAttributes($attributes);
}
return $row;
} | [
"public",
"function",
"row",
"(",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"row",
"=",
"new",
"self",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"attributes",
")",
")",
"{",
"$",
"row",
"->",
"setAttributes",
"(",
"$",... | Generates a new table row
@param array $attributes
@return Row | [
"Generates",
"a",
"new",
"table",
"row"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Row.php#L38-L47 |
205,450 | schpill/thin | src/Html/Row.php | Row.add | public function add($value, array $attributes = null)
{
$cell = $value;
if (is_string($value)) {
$cell = new Cell($value, $attributes);
}
$this->_cells[] = $cell;
return $this;
} | php | public function add($value, array $attributes = null)
{
$cell = $value;
if (is_string($value)) {
$cell = new Cell($value, $attributes);
}
$this->_cells[] = $cell;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"value",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"cell",
"=",
"$",
"value",
";",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"$",
"cell",
"=",
"new",
"Cell",
"(",
"$",
"v... | Adds a cell to the row
@param string|Cell $cell
@param array $attributes | [
"Adds",
"a",
"cell",
"to",
"the",
"row"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Row.php#L97-L107 |
205,451 | schpill/thin | src/Html/Row.php | Row.isHeader | public function isHeader($isHeader = true)
{
foreach ($this->_cells as $cell) {
$cell->isHeader($isHeader);
}
return $this;
} | php | public function isHeader($isHeader = true)
{
foreach ($this->_cells as $cell) {
$cell->isHeader($isHeader);
}
return $this;
} | [
"public",
"function",
"isHeader",
"(",
"$",
"isHeader",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_cells",
"as",
"$",
"cell",
")",
"{",
"$",
"cell",
"->",
"isHeader",
"(",
"$",
"isHeader",
")",
";",
"}",
"return",
"$",
"this",
";",... | Set whether this row should be a table header or not
@param bool $isHeader
@return Row | [
"Set",
"whether",
"this",
"row",
"should",
"be",
"a",
"table",
"header",
"or",
"not"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Row.php#L116-L123 |
205,452 | schpill/thin | src/Html/Row.php | Row.setState | public function setState($state = null)
{
if (null === $state) {
$this->_state = $state;
return $this;
}
if (in_array($state, array(static::STATE_SUCCESS, static::STATE_ERROR, static::STATE_INFO))) {
$this->_state = $state;
... | php | public function setState($state = null)
{
if (null === $state) {
$this->_state = $state;
return $this;
}
if (in_array($state, array(static::STATE_SUCCESS, static::STATE_ERROR, static::STATE_INFO))) {
$this->_state = $state;
... | [
"public",
"function",
"setState",
"(",
"$",
"state",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"state",
")",
"{",
"$",
"this",
"->",
"_state",
"=",
"$",
"state",
";",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"in_array",
"(",
"$",
... | Sets the row state
@param string $state
@return Row | [
"Sets",
"the",
"row",
"state"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Html/Row.php#L132-L144 |
205,453 | ekyna/AdminBundle | Dashboard/Widget/Registry.php | Registry.hasType | public function hasType($nameOrType)
{
$name = $nameOrType instanceof WidgetTypeInterface ? $nameOrType->getName() : $nameOrType;
return array_key_exists($name, $this->types);
} | php | public function hasType($nameOrType)
{
$name = $nameOrType instanceof WidgetTypeInterface ? $nameOrType->getName() : $nameOrType;
return array_key_exists($name, $this->types);
} | [
"public",
"function",
"hasType",
"(",
"$",
"nameOrType",
")",
"{",
"$",
"name",
"=",
"$",
"nameOrType",
"instanceof",
"WidgetTypeInterface",
"?",
"$",
"nameOrType",
"->",
"getName",
"(",
")",
":",
"$",
"nameOrType",
";",
"return",
"array_key_exists",
"(",
"$... | Returns whether the widget type is registered or not.
@param $nameOrType
@return bool | [
"Returns",
"whether",
"the",
"widget",
"type",
"is",
"registered",
"or",
"not",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Dashboard/Widget/Registry.php#L36-L41 |
205,454 | ekyna/AdminBundle | Dashboard/Widget/Registry.php | Registry.addType | public function addType(WidgetTypeInterface $widget)
{
if (!$this->hasType($widget)) {
$this->types[$widget->getName()] = $widget;
} else {
throw new \InvalidArgumentException(sprintf('Widget type "%s" is already registered.', $widget->getName()));
}
} | php | public function addType(WidgetTypeInterface $widget)
{
if (!$this->hasType($widget)) {
$this->types[$widget->getName()] = $widget;
} else {
throw new \InvalidArgumentException(sprintf('Widget type "%s" is already registered.', $widget->getName()));
}
} | [
"public",
"function",
"addType",
"(",
"WidgetTypeInterface",
"$",
"widget",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasType",
"(",
"$",
"widget",
")",
")",
"{",
"$",
"this",
"->",
"types",
"[",
"$",
"widget",
"->",
"getName",
"(",
")",
"]",
"... | Adds the widget type.
@param WidgetTypeInterface $widget
@throws \InvalidArgumentException | [
"Adds",
"the",
"widget",
"type",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Dashboard/Widget/Registry.php#L49-L56 |
205,455 | ekyna/AdminBundle | Dashboard/Widget/Registry.php | Registry.getType | public function getType($name)
{
if ($this->hasType($name)) {
return $this->types[$name];
} else {
throw new \InvalidArgumentException(sprintf('Widget type "%s" not found.', $name));
}
} | php | public function getType($name)
{
if ($this->hasType($name)) {
return $this->types[$name];
} else {
throw new \InvalidArgumentException(sprintf('Widget type "%s" not found.', $name));
}
} | [
"public",
"function",
"getType",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasType",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"types",
"[",
"$",
"name",
"]",
";",
"}",
"else",
"{",
"throw",
"new",
"\\",
"In... | Returns the widget type by name.
@param string $name
@return WidgetTypeInterface
@throws \InvalidArgumentException | [
"Returns",
"the",
"widget",
"type",
"by",
"name",
"."
] | 3f58e253ae9cf651add7f3d587caec80eaea459a | https://github.com/ekyna/AdminBundle/blob/3f58e253ae9cf651add7f3d587caec80eaea459a/Dashboard/Widget/Registry.php#L65-L72 |
205,456 | mobtexting/php-http-client | src/Client.php | Client.parseResponse | protected function parseResponse($channel, $content)
{
$headerSize = curl_getinfo($channel, CURLINFO_HEADER_SIZE);
$statusCode = curl_getinfo($channel, CURLINFO_HTTP_CODE);
$responseBody = substr($content, $headerSize);
$responseHeaders = substr($content, 0, $headerSize);
$re... | php | protected function parseResponse($channel, $content)
{
$headerSize = curl_getinfo($channel, CURLINFO_HEADER_SIZE);
$statusCode = curl_getinfo($channel, CURLINFO_HTTP_CODE);
$responseBody = substr($content, $headerSize);
$responseHeaders = substr($content, 0, $headerSize);
$re... | [
"protected",
"function",
"parseResponse",
"(",
"$",
"channel",
",",
"$",
"content",
")",
"{",
"$",
"headerSize",
"=",
"curl_getinfo",
"(",
"$",
"channel",
",",
"CURLINFO_HEADER_SIZE",
")",
";",
"$",
"statusCode",
"=",
"curl_getinfo",
"(",
"$",
"channel",
","... | Prepare response object
@param resource $channel the curl resource
@param string $content
@return Response object | [
"Prepare",
"response",
"object"
] | 3925e841cfa0f8fcc35f57a6c0c0935076c7e6e3 | https://github.com/mobtexting/php-http-client/blob/3925e841cfa0f8fcc35f57a6c0c0935076c7e6e3/src/Client.php#L252-L262 |
205,457 | Dhii/output-renderer-abstract | src/ContextAwareTrait.php | ContextAwareTrait._setContext | protected function _setContext($context)
{
$this->context = ($context !== null)
? $this->_normalizeContainer($context)
: null;
} | php | protected function _setContext($context)
{
$this->context = ($context !== null)
? $this->_normalizeContainer($context)
: null;
} | [
"protected",
"function",
"_setContext",
"(",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"context",
"=",
"(",
"$",
"context",
"!==",
"null",
")",
"?",
"$",
"this",
"->",
"_normalizeContainer",
"(",
"$",
"context",
")",
":",
"null",
";",
"}"
] | Sets the context for this instance.
@since 0.1
@param array|ArrayAccess|stdClass|ContainerInterface|null $context The context instance, or null. | [
"Sets",
"the",
"context",
"for",
"this",
"instance",
"."
] | 0f6e5eed940025332dd1986d6c771e10f7197b1a | https://github.com/Dhii/output-renderer-abstract/blob/0f6e5eed940025332dd1986d6c771e10f7197b1a/src/ContextAwareTrait.php#L45-L50 |
205,458 | buse974/Dal | src/Dal/Model/AbstractModel.php | AbstractModel.toArray | public function toArray()
{
$hydrator = new ClassMethods();
$vars = $hydrator->extract($this);
foreach ($vars as $key => &$value) {
if ($value === null) {
unset($vars[$key]);
} elseif (is_object($value) && ! $value instanceof \ArrayObject) {
... | php | public function toArray()
{
$hydrator = new ClassMethods();
$vars = $hydrator->extract($this);
foreach ($vars as $key => &$value) {
if ($value === null) {
unset($vars[$key]);
} elseif (is_object($value) && ! $value instanceof \ArrayObject) {
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"hydrator",
"=",
"new",
"ClassMethods",
"(",
")",
";",
"$",
"vars",
"=",
"$",
"hydrator",
"->",
"extract",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"vars",
"as",
"$",
"key",
"=>",
"&",
... | Convert the model to an array.
@return array | [
"Convert",
"the",
"model",
"to",
"an",
"array",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Model/AbstractModel.php#L108-L135 |
205,459 | buse974/Dal | src/Dal/Model/AbstractModel.php | AbstractModel.isRepeatRelational | protected function isRepeatRelational()
{
$is_repeat = false;
if (array_count_values($this->getParentArray())[$this->prefix] > 1) {
$is_repeat = true;
}
return $is_repeat;
} | php | protected function isRepeatRelational()
{
$is_repeat = false;
if (array_count_values($this->getParentArray())[$this->prefix] > 1) {
$is_repeat = true;
}
return $is_repeat;
} | [
"protected",
"function",
"isRepeatRelational",
"(",
")",
"{",
"$",
"is_repeat",
"=",
"false",
";",
"if",
"(",
"array_count_values",
"(",
"$",
"this",
"->",
"getParentArray",
"(",
")",
")",
"[",
"$",
"this",
"->",
"prefix",
"]",
">",
"1",
")",
"{",
"$",... | Return true if relation is boucle infinie.
@return bool | [
"Return",
"true",
"if",
"relation",
"is",
"boucle",
"infinie",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Model/AbstractModel.php#L209-L218 |
205,460 | buse974/Dal | src/Dal/Model/AbstractModel.php | AbstractModel.requireModel | public function requireModel($model, &$data, $prefix = null)
{
$class = null;
$name = (null !== $prefix) ? $prefix : substr($model, strlen(explode('_', $model)[0]) + 7);
foreach ($this->array_prefix as $k => $ap) {
if (strrpos($ap, $name) === (strlen($ap) - strlen($name)... | php | public function requireModel($model, &$data, $prefix = null)
{
$class = null;
$name = (null !== $prefix) ? $prefix : substr($model, strlen(explode('_', $model)[0]) + 7);
foreach ($this->array_prefix as $k => $ap) {
if (strrpos($ap, $name) === (strlen($ap) - strlen($name)... | [
"public",
"function",
"requireModel",
"(",
"$",
"model",
",",
"&",
"$",
"data",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"null",
";",
"$",
"name",
"=",
"(",
"null",
"!==",
"$",
"prefix",
")",
"?",
"$",
"prefix",
":",
"substr"... | return Model if needed.
@param string $model
@param array $data
@param string $prefix
@return AbstractModel|null | [
"return",
"Model",
"if",
"needed",
"."
] | faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab | https://github.com/buse974/Dal/blob/faeac9e260c5e675bc7ed1fcea77c7ba251bf8ab/src/Dal/Model/AbstractModel.php#L270-L291 |
205,461 | phpcq/autoload-validation | src/AutoloadValidator/Psr0Validator.php | Psr0Validator.checkPearOrNoMatch | private function checkPearOrNoMatch($classNameSpace, $prefixLength, $prefix)
{
// No NS, separator in class namespace.
if (!$classNameSpace) {
return false;
}
if (substr($classNameSpace, 0, $prefixLength) === $prefix) {
return false;
}
return... | php | private function checkPearOrNoMatch($classNameSpace, $prefixLength, $prefix)
{
// No NS, separator in class namespace.
if (!$classNameSpace) {
return false;
}
if (substr($classNameSpace, 0, $prefixLength) === $prefix) {
return false;
}
return... | [
"private",
"function",
"checkPearOrNoMatch",
"(",
"$",
"classNameSpace",
",",
"$",
"prefixLength",
",",
"$",
"prefix",
")",
"{",
"// No NS, separator in class namespace.",
"if",
"(",
"!",
"$",
"classNameSpace",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
... | Check if the class is PEAR style or does not match at all.
Return true if there is some problem, false otherwise.
@param string $classNameSpace The namespace of the class.
@param string $prefixLength The length of the namespace that must match.
@param string $prefix The required namespace prefix.
@return... | [
"Check",
"if",
"the",
"class",
"is",
"PEAR",
"style",
"or",
"does",
"not",
"match",
"at",
"all",
"."
] | c24d331f16034c2096ce0e55492993befbaa687a | https://github.com/phpcq/autoload-validation/blob/c24d331f16034c2096ce0e55492993befbaa687a/src/AutoloadValidator/Psr0Validator.php#L195-L207 |
205,462 | AndyDune/Pipeline | src/Pipeline.php | Pipeline.pipe | public function pipe($pipe, $methodName = '', ...$params): self
{
if ($pipe instanceof Closure) {
$this->pipes[] = $pipe;
return $this;
}
$pipe = [
$pipe,
$methodName,
$params,
false
];
$this->pipes[] = ... | php | public function pipe($pipe, $methodName = '', ...$params): self
{
if ($pipe instanceof Closure) {
$this->pipes[] = $pipe;
return $this;
}
$pipe = [
$pipe,
$methodName,
$params,
false
];
$this->pipes[] = ... | [
"public",
"function",
"pipe",
"(",
"$",
"pipe",
",",
"$",
"methodName",
"=",
"''",
",",
"...",
"$",
"params",
")",
":",
"self",
"{",
"if",
"(",
"$",
"pipe",
"instanceof",
"Closure",
")",
"{",
"$",
"this",
"->",
"pipes",
"[",
"]",
"=",
"$",
"pipe"... | Add stage for workflow.
@param $pipe class name or service name for stage.
@param string $methodName method name for this object
@param string $params additional params
@return $this | [
"Add",
"stage",
"for",
"workflow",
"."
] | 66bcc8ba7a0d74fecdf2f993995c1140c29fd91f | https://github.com/AndyDune/Pipeline/blob/66bcc8ba7a0d74fecdf2f993995c1140c29fd91f/src/Pipeline.php#L137-L152 |
205,463 | AndyDune/Pipeline | src/Pipeline.php | Pipeline.pipeForContainer | public function pipeForContainer($pipe, $methodName = '', ...$params): self
{
if ($pipe instanceof Closure) {
$this->pipes[] = $pipe;
return $this;
}
$pipe = [
$pipe,
$methodName,
$params,
true
];
$this-... | php | public function pipeForContainer($pipe, $methodName = '', ...$params): self
{
if ($pipe instanceof Closure) {
$this->pipes[] = $pipe;
return $this;
}
$pipe = [
$pipe,
$methodName,
$params,
true
];
$this-... | [
"public",
"function",
"pipeForContainer",
"(",
"$",
"pipe",
",",
"$",
"methodName",
"=",
"''",
",",
"...",
"$",
"params",
")",
":",
"self",
"{",
"if",
"(",
"$",
"pipe",
"instanceof",
"Closure",
")",
"{",
"$",
"this",
"->",
"pipes",
"[",
"]",
"=",
"... | Add stage without middleware interface.
@param $pipe description for stage
@param string $methodName
@param array ...$params
@return $this | [
"Add",
"stage",
"without",
"middleware",
"interface",
"."
] | 66bcc8ba7a0d74fecdf2f993995c1140c29fd91f | https://github.com/AndyDune/Pipeline/blob/66bcc8ba7a0d74fecdf2f993995c1140c29fd91f/src/Pipeline.php#L163-L178 |
205,464 | AndyDune/Pipeline | src/Pipeline.php | Pipeline.execute | public function execute()
{
$pipeline = array_reduce(
array_reverse($this->pipes), $this->carry(), function ($passable) {
return $passable;
}
);
return $pipeline($this->passable);
} | php | public function execute()
{
$pipeline = array_reduce(
array_reverse($this->pipes), $this->carry(), function ($passable) {
return $passable;
}
);
return $pipeline($this->passable);
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"pipeline",
"=",
"array_reduce",
"(",
"array_reverse",
"(",
"$",
"this",
"->",
"pipes",
")",
",",
"$",
"this",
"->",
"carry",
"(",
")",
",",
"function",
"(",
"$",
"passable",
")",
"{",
"return",
"$... | Run the pipeline without a final destination callback.
@return mixed | [
"Run",
"the",
"pipeline",
"without",
"a",
"final",
"destination",
"callback",
"."
] | 66bcc8ba7a0d74fecdf2f993995c1140c29fd91f | https://github.com/AndyDune/Pipeline/blob/66bcc8ba7a0d74fecdf2f993995c1140c29fd91f/src/Pipeline.php#L201-L210 |
205,465 | armazon/armazon | src/Armazon/Mvc/Vista.php | Vista.filtrarValor | public function filtrarValor($filtro, $texto)
{
if (isset($this->filtros[$filtro])) {
$texto = $this->filtros[$filtro]($texto);
}
return $texto;
} | php | public function filtrarValor($filtro, $texto)
{
if (isset($this->filtros[$filtro])) {
$texto = $this->filtros[$filtro]($texto);
}
return $texto;
} | [
"public",
"function",
"filtrarValor",
"(",
"$",
"filtro",
",",
"$",
"texto",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"filtros",
"[",
"$",
"filtro",
"]",
")",
")",
"{",
"$",
"texto",
"=",
"$",
"this",
"->",
"filtros",
"[",
"$",
"filt... | Aplica el filtro solicitado al valor.
@param string $filtro
@param string $texto
@return string | [
"Aplica",
"el",
"filtro",
"solicitado",
"al",
"valor",
"."
] | ec76385ff80ce1659d81bc4050ef9483ab0ebe52 | https://github.com/armazon/armazon/blob/ec76385ff80ce1659d81bc4050ef9483ab0ebe52/src/Armazon/Mvc/Vista.php#L125-L132 |
205,466 | SURFnet/yubikey-api-client | src/Crypto/Signer.php | Signer.sign | public function sign(array $data)
{
ksort($data);
$queryString = $this->buildQueryString($data);
$data['h'] = base64_encode(hash_hmac('sha1', $queryString, $this->clientSecret, true));
return $data;
} | php | public function sign(array $data)
{
ksort($data);
$queryString = $this->buildQueryString($data);
$data['h'] = base64_encode(hash_hmac('sha1', $queryString, $this->clientSecret, true));
return $data;
} | [
"public",
"function",
"sign",
"(",
"array",
"$",
"data",
")",
"{",
"ksort",
"(",
"$",
"data",
")",
";",
"$",
"queryString",
"=",
"$",
"this",
"->",
"buildQueryString",
"(",
"$",
"data",
")",
";",
"$",
"data",
"[",
"'h'",
"]",
"=",
"base64_encode",
... | Signs an array by calculating a signature and setting it on the 'h' key.
@param array $data
@return array | [
"Signs",
"an",
"array",
"by",
"calculating",
"a",
"signature",
"and",
"setting",
"it",
"on",
"the",
"h",
"key",
"."
] | bbcb6340c89c5bcecf2f9258390cb9dfe2b87358 | https://github.com/SURFnet/yubikey-api-client/blob/bbcb6340c89c5bcecf2f9258390cb9dfe2b87358/src/Crypto/Signer.php#L67-L75 |
205,467 | SURFnet/yubikey-api-client | src/Crypto/Signer.php | Signer.verifySignature | public function verifySignature(array $data)
{
$signedData = array_intersect_key($data, array_flip(self::$validResponseParams));
ksort($signedData);
$queryString = $this->buildQueryString($signedData);
$signature = base64_encode(hash_hmac('sha1', $queryString, $this->clientSecret, t... | php | public function verifySignature(array $data)
{
$signedData = array_intersect_key($data, array_flip(self::$validResponseParams));
ksort($signedData);
$queryString = $this->buildQueryString($signedData);
$signature = base64_encode(hash_hmac('sha1', $queryString, $this->clientSecret, t... | [
"public",
"function",
"verifySignature",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"signedData",
"=",
"array_intersect_key",
"(",
"$",
"data",
",",
"array_flip",
"(",
"self",
"::",
"$",
"validResponseParams",
")",
")",
";",
"ksort",
"(",
"$",
"signedData",
... | Verifies that the signature in the 'h' key matches the expected signature.
@param array $data
@return bool | [
"Verifies",
"that",
"the",
"signature",
"in",
"the",
"h",
"key",
"matches",
"the",
"expected",
"signature",
"."
] | bbcb6340c89c5bcecf2f9258390cb9dfe2b87358 | https://github.com/SURFnet/yubikey-api-client/blob/bbcb6340c89c5bcecf2f9258390cb9dfe2b87358/src/Crypto/Signer.php#L83-L92 |
205,468 | denostr/stopforumspam | src/Client.php | Client.request | public function request()
{
$data = $this->prepareData();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->apiHost . '/api');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
... | php | public function request()
{
$data = $this->prepareData();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->apiHost . '/api');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
... | [
"public",
"function",
"request",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"prepareData",
"(",
")",
";",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_URL",
",",
"$",
"this",
"->",
"apiHost",
"."... | Run API reauest
@return mixed
@throws \Exception | [
"Run",
"API",
"reauest"
] | afbab3bd33ea9b408ad7c3331e0dafa2f87ff3ca | https://github.com/denostr/stopforumspam/blob/afbab3bd33ea9b408ad7c3331e0dafa2f87ff3ca/src/Client.php#L147-L161 |
205,469 | denostr/stopforumspam | src/Client.php | Client.prepareData | private function prepareData()
{
$data = [];
foreach (get_object_vars($this) as $property => $value) {
if (in_array($property, ['apiHost', 'debug'])) {
continue;
}
if ($property == 'format') {
$data[$value] = '';
} else... | php | private function prepareData()
{
$data = [];
foreach (get_object_vars($this) as $property => $value) {
if (in_array($property, ['apiHost', 'debug'])) {
continue;
}
if ($property == 'format') {
$data[$value] = '';
} else... | [
"private",
"function",
"prepareData",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"get_object_vars",
"(",
"$",
"this",
")",
"as",
"$",
"property",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"property",
",",
"... | Preparing data before request
@return string
@throws \Exception | [
"Preparing",
"data",
"before",
"request"
] | afbab3bd33ea9b408ad7c3331e0dafa2f87ff3ca | https://github.com/denostr/stopforumspam/blob/afbab3bd33ea9b408ad7c3331e0dafa2f87ff3ca/src/Client.php#L169-L201 |
205,470 | denostr/stopforumspam | src/Client.php | Client.checkResult | private function checkResult($result)
{
if ($this->debug) {
if (in_array($this->format, [self::FORMAT_JSON, self::FORMAT_JSONP])) {
$result = json_decode($result, true);
} elseif ($this->format == self::FORMAT_SERIAL) {
$result = unserialize($result);
... | php | private function checkResult($result)
{
if ($this->debug) {
if (in_array($this->format, [self::FORMAT_JSON, self::FORMAT_JSONP])) {
$result = json_decode($result, true);
} elseif ($this->format == self::FORMAT_SERIAL) {
$result = unserialize($result);
... | [
"private",
"function",
"checkResult",
"(",
"$",
"result",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"this",
"->",
"format",
",",
"[",
"self",
"::",
"FORMAT_JSON",
",",
"self",
"::",
"FORMAT_JSONP",
"]... | Check response data
@param $result
@throws \Exception | [
"Check",
"response",
"data"
] | afbab3bd33ea9b408ad7c3331e0dafa2f87ff3ca | https://github.com/denostr/stopforumspam/blob/afbab3bd33ea9b408ad7c3331e0dafa2f87ff3ca/src/Client.php#L209-L224 |
205,471 | YiMAproject/yimaAdminor | src/yimaAdminor/Service/AuthServiceFactory.php | AuthServiceFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$serviceLocator = $serviceLocator->getServiceLocator();
$config = $serviceLocator->get('Config');
$config = (isset($config['yima_adminor']) && is_array($config['yima_adminor']))
? $config['yima_adminor']
... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$serviceLocator = $serviceLocator->getServiceLocator();
$config = $serviceLocator->get('Config');
$config = (isset($config['yima_adminor']) && is_array($config['yima_adminor']))
? $config['yima_adminor']
... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"serviceLocator",
"=",
"$",
"serviceLocator",
"->",
"getServiceLocator",
"(",
")",
";",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'Co... | Create the Authentication Service
@param ServiceLocatorInterface $serviceLocator
@return iAuthenticateAdapter | [
"Create",
"the",
"Authentication",
"Service"
] | 7a6c66e05aedaef8061c8998dfa44ac1ce9cc319 | https://github.com/YiMAproject/yimaAdminor/blob/7a6c66e05aedaef8061c8998dfa44ac1ce9cc319/src/yimaAdminor/Service/AuthServiceFactory.php#L18-L45 |
205,472 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Session.php | Radial_Core_Model_Session._extractQuoteSkuData | protected function _extractQuoteSkuData(Mage_Sales_Model_Quote $quote)
{
$skuData = [];
// use getAllVisibleItems to prevent dupes due to parent config + child used both being included
foreach ($quote->getAllVisibleItems() as $item) {
// before item's have been saved, getAllVisib... | php | protected function _extractQuoteSkuData(Mage_Sales_Model_Quote $quote)
{
$skuData = [];
// use getAllVisibleItems to prevent dupes due to parent config + child used both being included
foreach ($quote->getAllVisibleItems() as $item) {
// before item's have been saved, getAllVisib... | [
"protected",
"function",
"_extractQuoteSkuData",
"(",
"Mage_Sales_Model_Quote",
"$",
"quote",
")",
"{",
"$",
"skuData",
"=",
"[",
"]",
";",
"// use getAllVisibleItems to prevent dupes due to parent config + child used both being included",
"foreach",
"(",
"$",
"quote",
"->",
... | Get sku and qty data for a given quote
@param Mage_Sales_Model_Quote $quote Quote object to extract data from
@return array Array of 'sku' => qty | [
"Get",
"sku",
"and",
"qty",
"data",
"for",
"a",
"given",
"quote"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Session.php#L57-L75 |
205,473 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Session.php | Radial_Core_Model_Session._extractAddressData | protected function _extractAddressData(Mage_Customer_Model_Address_Abstract $address)
{
return array(
'street' => $address->getStreet(),
'city' => $address->getCity(),
'region_code' => $address->getRegionCode(),
'country_id' => $address->getCountryId(),
... | php | protected function _extractAddressData(Mage_Customer_Model_Address_Abstract $address)
{
return array(
'street' => $address->getStreet(),
'city' => $address->getCity(),
'region_code' => $address->getRegionCode(),
'country_id' => $address->getCountryId(),
... | [
"protected",
"function",
"_extractAddressData",
"(",
"Mage_Customer_Model_Address_Abstract",
"$",
"address",
")",
"{",
"return",
"array",
"(",
"'street'",
"=>",
"$",
"address",
"->",
"getStreet",
"(",
")",
",",
"'city'",
"=>",
"$",
"address",
"->",
"getCity",
"(... | Extract array of address data - street, city, region code, etc. from an address object
@param Mage_Customer_Model_Address_Abstract $address Address object to pull data from
@return array Extracted data | [
"Extract",
"array",
"of",
"address",
"data",
"-",
"street",
"city",
"region",
"code",
"etc",
".",
"from",
"an",
"address",
"object"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Session.php#L81-L90 |
205,474 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Session.php | Radial_Core_Model_Session._extractQuoteShippingData | protected function _extractQuoteShippingData(Mage_Sales_Model_Quote $quote)
{
$shippingData = array();
foreach ($quote->getAllShippingAddresses() as $address) {
$shippingData[] = array(
'method' => $address->getShippingMethod(),
'address' => $this->_extrac... | php | protected function _extractQuoteShippingData(Mage_Sales_Model_Quote $quote)
{
$shippingData = array();
foreach ($quote->getAllShippingAddresses() as $address) {
$shippingData[] = array(
'method' => $address->getShippingMethod(),
'address' => $this->_extrac... | [
"protected",
"function",
"_extractQuoteShippingData",
"(",
"Mage_Sales_Model_Quote",
"$",
"quote",
")",
"{",
"$",
"shippingData",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"quote",
"->",
"getAllShippingAddresses",
"(",
")",
"as",
"$",
"address",
")",
"... | Extract shipping data from a quote - the shipping method and address for each shipping address
in the quote.
@param Mage_Sales_Model_Quote $quote The quote to extract the data from
@return array Map of shipping method and address for each shipping address in the quote | [
"Extract",
"shipping",
"data",
"from",
"a",
"quote",
"-",
"the",
"shipping",
"method",
"and",
"address",
"for",
"each",
"shipping",
"address",
"in",
"the",
"quote",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Session.php#L97-L107 |
205,475 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Session.php | Radial_Core_Model_Session._extractQuoteBillingData | protected function _extractQuoteBillingData(Mage_Sales_Model_Quote $quote)
{
$address = $quote->getBillingAddress();
return $address ?
$this->_extractAddressData($address) :
array();
} | php | protected function _extractQuoteBillingData(Mage_Sales_Model_Quote $quote)
{
$address = $quote->getBillingAddress();
return $address ?
$this->_extractAddressData($address) :
array();
} | [
"protected",
"function",
"_extractQuoteBillingData",
"(",
"Mage_Sales_Model_Quote",
"$",
"quote",
")",
"{",
"$",
"address",
"=",
"$",
"quote",
"->",
"getBillingAddress",
"(",
")",
";",
"return",
"$",
"address",
"?",
"$",
"this",
"->",
"_extractAddressData",
"(",... | Return array of billing address data if available, otherwise, an empty array
@param Mage_Sales_Model_Quote $quote Quote object to extract data from
@return array Array of billing address data | [
"Return",
"array",
"of",
"billing",
"address",
"data",
"if",
"available",
"otherwise",
"an",
"empty",
"array"
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Session.php#L122-L128 |
205,476 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Session.php | Radial_Core_Model_Session._extractQuoteAmounts | protected function _extractQuoteAmounts(Mage_Sales_Model_Quote $quote)
{
return array_map(
function ($address) {
return array(
'subtotal' => round($address->getSubtotal(), 4) ?: 0.0000,
'discount' => round($address->getDiscountAmount(), 4) ... | php | protected function _extractQuoteAmounts(Mage_Sales_Model_Quote $quote)
{
return array_map(
function ($address) {
return array(
'subtotal' => round($address->getSubtotal(), 4) ?: 0.0000,
'discount' => round($address->getDiscountAmount(), 4) ... | [
"protected",
"function",
"_extractQuoteAmounts",
"(",
"Mage_Sales_Model_Quote",
"$",
"quote",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"address",
")",
"{",
"return",
"array",
"(",
"'subtotal'",
"=>",
"round",
"(",
"$",
"address",
"->",
"getS... | Extract quote amounts from each address.
@param Mage_Sales_Model_Quote $quote
@return array | [
"Extract",
"quote",
"amounts",
"from",
"each",
"address",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Session.php#L134-L148 |
205,477 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Session.php | Radial_Core_Model_Session._diffQuoteData | protected function _diffQuoteData($oldQuote, $newQuote)
{
if (empty($oldQuote)) {
return $newQuote;
}
return $this->_diffBilling($oldQuote['billing'], $newQuote['billing']) +
$this->_diffCoupon($oldQuote['coupon'], $newQuote['coupon']) +
$this->_diffShippi... | php | protected function _diffQuoteData($oldQuote, $newQuote)
{
if (empty($oldQuote)) {
return $newQuote;
}
return $this->_diffBilling($oldQuote['billing'], $newQuote['billing']) +
$this->_diffCoupon($oldQuote['coupon'], $newQuote['coupon']) +
$this->_diffShippi... | [
"protected",
"function",
"_diffQuoteData",
"(",
"$",
"oldQuote",
",",
"$",
"newQuote",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"oldQuote",
")",
")",
"{",
"return",
"$",
"newQuote",
";",
"}",
"return",
"$",
"this",
"->",
"_diffBilling",
"(",
"$",
"oldQu... | Diff the new quote to the old quote. May contain keys for 'billing', 'coupon', 'shipping'
and 'skus'. For more details on the type of changes detected for each key, see the
responsible methods for diffing those sets of data.
@param array $oldQuote Array of data extracted from a quote
@param array $newQuote Array of... | [
"Diff",
"the",
"new",
"quote",
"to",
"the",
"old",
"quote",
".",
"May",
"contain",
"keys",
"for",
"billing",
"coupon",
"shipping",
"and",
"skus",
".",
"For",
"more",
"details",
"on",
"the",
"type",
"of",
"changes",
"detected",
"for",
"each",
"key",
"see"... | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Session.php#L252-L262 |
205,478 | RadialCorp/magento-core | src/app/code/community/Radial/Core/Model/Session.php | Radial_Core_Model_Session._anyItem | protected function _anyItem($items, $key)
{
foreach ($items as $item) {
if (isset($item[$key]) && $item[$key]) {
return true;
}
}
return false;
} | php | protected function _anyItem($items, $key)
{
foreach ($items as $item) {
if (isset($item[$key]) && $item[$key]) {
return true;
}
}
return false;
} | [
"protected",
"function",
"_anyItem",
"(",
"$",
"items",
",",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"items",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"item",
"[",
"$",
"key",
"]",
")",
"&&",
"$",
"item",
"[",
"$",
"key",
... | Check the set of items to have an item with the given key set to a
truthy value.
@param array $items array of item data
@param string $key array key to check
@return bool true if any item has a truthy value at the given key | [
"Check",
"the",
"set",
"of",
"items",
"to",
"have",
"an",
"item",
"with",
"the",
"given",
"key",
"set",
"to",
"a",
"truthy",
"value",
"."
] | 9bb5f218d9caf79eab8598f4f8447037a0cc6355 | https://github.com/RadialCorp/magento-core/blob/9bb5f218d9caf79eab8598f4f8447037a0cc6355/src/app/code/community/Radial/Core/Model/Session.php#L270-L278 |
205,479 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.keepOpen | public function keepOpen()
{
$stoppedProperty = new \ReflectionProperty(get_parent_class($this), 'stopped');
$stoppedProperty->setAccessible(TRUE);
$stoppedProperty->setValue($this, TRUE);
} | php | public function keepOpen()
{
$stoppedProperty = new \ReflectionProperty(get_parent_class($this), 'stopped');
$stoppedProperty->setAccessible(TRUE);
$stoppedProperty->setValue($this, TRUE);
} | [
"public",
"function",
"keepOpen",
"(",
")",
"{",
"$",
"stoppedProperty",
"=",
"new",
"\\",
"ReflectionProperty",
"(",
"get_parent_class",
"(",
"$",
"this",
")",
",",
"'stopped'",
")",
";",
"$",
"stoppedProperty",
"->",
"setAccessible",
"(",
"TRUE",
")",
";",... | Calling this method avoids destructor to send DELETE session request.
The browser window will close either way, but after some quite long
timeout (at least with ChromeDriver). | [
"Calling",
"this",
"method",
"avoids",
"destructor",
"to",
"send",
"DELETE",
"session",
"request",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L109-L114 |
205,480 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.getLink | public function getLink($presenterName, $parameters = array())
{
$url = new \Nette\Http\UrlScript($this->context->parameters['selenium']['baseUrl']);
$url->scriptPath = $url->path;
$appRequest = new \Nette\Application\Request($presenterName, 'GET', Utils::strToArray($parameters));
return $this->context->router... | php | public function getLink($presenterName, $parameters = array())
{
$url = new \Nette\Http\UrlScript($this->context->parameters['selenium']['baseUrl']);
$url->scriptPath = $url->path;
$appRequest = new \Nette\Application\Request($presenterName, 'GET', Utils::strToArray($parameters));
return $this->context->router... | [
"public",
"function",
"getLink",
"(",
"$",
"presenterName",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"url",
"=",
"new",
"\\",
"Nette",
"\\",
"Http",
"\\",
"UrlScript",
"(",
"$",
"this",
"->",
"context",
"->",
"parameters",
"[",
... | Creates an URL.
Parameters can be either a PHP array, or a Neon array without brackets.
Ie. Instead of `array('a' => 'b', 'c' => 'd')` you can pass `'a=b,c=d'`.
@param string $presenterName
@param array|string $parameters | [
"Creates",
"an",
"URL",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L146-L152 |
205,481 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.getAppRequest | public function getAppRequest($url = NULL)
{
$httpRequest = new \Nette\Http\Request($this->getUrlScriptForUrl($url ? : $this->url()));
return $this->context->router->match($httpRequest);
} | php | public function getAppRequest($url = NULL)
{
$httpRequest = new \Nette\Http\Request($this->getUrlScriptForUrl($url ? : $this->url()));
return $this->context->router->match($httpRequest);
} | [
"public",
"function",
"getAppRequest",
"(",
"$",
"url",
"=",
"NULL",
")",
"{",
"$",
"httpRequest",
"=",
"new",
"\\",
"Nette",
"\\",
"Http",
"\\",
"Request",
"(",
"$",
"this",
"->",
"getUrlScriptForUrl",
"(",
"$",
"url",
"?",
":",
"$",
"this",
"->",
"... | URL back-routed into application request object.
@param string|NULL $url URL or NULL for current URL.
@return \Nette\Application\Request | [
"URL",
"back",
"-",
"routed",
"into",
"application",
"request",
"object",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L160-L164 |
205,482 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.waitForAlert | public function waitForAlert($timeout = 60)
{
$result = FALSE;
$i = 0;
do
{
sleep(1);
try
{
$result = $this->alertText();
}
catch (\RuntimeException $e)
{
;
}
} while (++$i < $timeout && $result === FALSE);
return $result;
} | php | public function waitForAlert($timeout = 60)
{
$result = FALSE;
$i = 0;
do
{
sleep(1);
try
{
$result = $this->alertText();
}
catch (\RuntimeException $e)
{
;
}
} while (++$i < $timeout && $result === FALSE);
return $result;
} | [
"public",
"function",
"waitForAlert",
"(",
"$",
"timeout",
"=",
"60",
")",
"{",
"$",
"result",
"=",
"FALSE",
";",
"$",
"i",
"=",
"0",
";",
"do",
"{",
"sleep",
"(",
"1",
")",
";",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"alertText",
"... | Wait for javascript alert, prompt or confirm dialog.
@param int $timeout Patience in seconds.
@return string|bool Alert text, or FALSE if waiting times out. | [
"Wait",
"for",
"javascript",
"alert",
"prompt",
"or",
"confirm",
"dialog",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L172-L189 |
205,483 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.waitForCondition | public function waitForCondition($jsCondition, $timeout = 60)
{
$i = 0;
do
{
sleep(1);
} while (
!($result = $this->execute(array('script' => 'return ' . $jsCondition, 'args' => array())))
&& $i++ < $timeout
);
return $result;
} | php | public function waitForCondition($jsCondition, $timeout = 60)
{
$i = 0;
do
{
sleep(1);
} while (
!($result = $this->execute(array('script' => 'return ' . $jsCondition, 'args' => array())))
&& $i++ < $timeout
);
return $result;
} | [
"public",
"function",
"waitForCondition",
"(",
"$",
"jsCondition",
",",
"$",
"timeout",
"=",
"60",
")",
"{",
"$",
"i",
"=",
"0",
";",
"do",
"{",
"sleep",
"(",
"1",
")",
";",
"}",
"while",
"(",
"!",
"(",
"$",
"result",
"=",
"$",
"this",
"->",
"e... | Wait for fulfilment of some javascript condition.
@param string $jsCondition Javascript code.
@param int $timeout Amount of patience in seconds.
@return bool Whether the condition was fulfilled. | [
"Wait",
"for",
"fulfilment",
"of",
"some",
"javascript",
"condition",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L220-L231 |
205,484 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.getActiveElement | public function getActiveElement()
{
$response = $this->driver->curl('POST', $this->url->addCommand('element/active'));
return Element::fromResponseValue($response->getValue(), $this->url->descend('element'), $this->driver);
} | php | public function getActiveElement()
{
$response = $this->driver->curl('POST', $this->url->addCommand('element/active'));
return Element::fromResponseValue($response->getValue(), $this->url->descend('element'), $this->driver);
} | [
"public",
"function",
"getActiveElement",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"driver",
"->",
"curl",
"(",
"'POST'",
",",
"$",
"this",
"->",
"url",
"->",
"addCommand",
"(",
"'element/active'",
")",
")",
";",
"return",
"Element",
"::",... | Get the element on the page that currently has focus.
@return Element | [
"Get",
"the",
"element",
"on",
"the",
"page",
"that",
"currently",
"has",
"focus",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L249-L253 |
205,485 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.element | public function element(\PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria)
{
$value = $this->postCommand('element', $criteria);
return Element::fromResponseValue($value, $this->url->descend('element'), $this->driver);
} | php | public function element(\PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria)
{
$value = $this->postCommand('element', $criteria);
return Element::fromResponseValue($value, $this->url->descend('element'), $this->driver);
} | [
"public",
"function",
"element",
"(",
"\\",
"PHPUnit_Extensions_Selenium2TestCase_ElementCriteria",
"$",
"criteria",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"postCommand",
"(",
"'element'",
",",
"$",
"criteria",
")",
";",
"return",
"Element",
"::",
"from... | Finds an element using the criteria.
Criteria are set by this WTF way:
<code>
$session->element($session->using('xpath')->value('//input[type="text"]'));
</code>
@param \PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria
@return Element | [
"Finds",
"an",
"element",
"using",
"the",
"criteria",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L266-L270 |
205,486 | Clevis/Se34 | Se34/BrowserSession.php | BrowserSession.elements | public function elements(\PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria)
{
$values = $this->postCommand('elements', $criteria);
$elements = array();
foreach ($values as $value)
{
$elements[] = Element::fromResponseValue($value, $this->url->descend('element'), $this->driver);
}
return $e... | php | public function elements(\PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria)
{
$values = $this->postCommand('elements', $criteria);
$elements = array();
foreach ($values as $value)
{
$elements[] = Element::fromResponseValue($value, $this->url->descend('element'), $this->driver);
}
return $e... | [
"public",
"function",
"elements",
"(",
"\\",
"PHPUnit_Extensions_Selenium2TestCase_ElementCriteria",
"$",
"criteria",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"postCommand",
"(",
"'elements'",
",",
"$",
"criteria",
")",
";",
"$",
"elements",
"=",
"array"... | Finds elements using given criteria.
Similar to {@see BrowserSession::element()}, only this returns all matched
elements as an array. Also, this doesn't throw an exception if no
element was found.
@param \PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria
@return Element[] array of instances of Se34\Eleme... | [
"Finds",
"elements",
"using",
"given",
"criteria",
"."
] | c52d579a831ba5642dae464882da012b0409ae46 | https://github.com/Clevis/Se34/blob/c52d579a831ba5642dae464882da012b0409ae46/Se34/BrowserSession.php#L282-L291 |
205,487 | stonedz/pff2 | src/Abs/AModule.php | AModule.getRequiredModules | public function getRequiredModules($moduleName) {
$moduleName = strtolower($moduleName);
if (isset($this->_requiredModules[$moduleName])) {
return $this->_requiredModules[$moduleName];
}
else {
return null;
}
} | php | public function getRequiredModules($moduleName) {
$moduleName = strtolower($moduleName);
if (isset($this->_requiredModules[$moduleName])) {
return $this->_requiredModules[$moduleName];
}
else {
return null;
}
} | [
"public",
"function",
"getRequiredModules",
"(",
"$",
"moduleName",
")",
"{",
"$",
"moduleName",
"=",
"strtolower",
"(",
"$",
"moduleName",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_requiredModules",
"[",
"$",
"moduleName",
"]",
")",
")",
"... | Gets a module
@param string $moduleName
@return AModule|null | [
"Gets",
"a",
"module"
] | ec3b087d4d4732816f61ac487f0cb25511e0da88 | https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/Abs/AModule.php#L122-L130 |
205,488 | stonedz/pff2 | src/Abs/AModule.php | AModule.readConfig | public function readConfig($configFile) {
$yamlParser = new \Symfony\Component\Yaml\Parser();
$userConfPath = ROOT . DS . 'app' . DS . 'config' . DS . 'modules' . DS . $configFile;
$userCustomPath = ROOT. DS . 'app'. DS.'modules'.DS.$configFile;
$composerConfPath = ROOT . DS . 'modules... | php | public function readConfig($configFile) {
$yamlParser = new \Symfony\Component\Yaml\Parser();
$userConfPath = ROOT . DS . 'app' . DS . 'config' . DS . 'modules' . DS . $configFile;
$userCustomPath = ROOT. DS . 'app'. DS.'modules'.DS.$configFile;
$composerConfPath = ROOT . DS . 'modules... | [
"public",
"function",
"readConfig",
"(",
"$",
"configFile",
")",
"{",
"$",
"yamlParser",
"=",
"new",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Yaml",
"\\",
"Parser",
"(",
")",
";",
"$",
"userConfPath",
"=",
"ROOT",
".",
"DS",
".",
"'app'",
".",
"DS",
... | Reads the configuration file ad returns a configuration array
@param string $configFile The module filename
@throws ModuleException
@return array | [
"Reads",
"the",
"configuration",
"file",
"ad",
"returns",
"a",
"configuration",
"array"
] | ec3b087d4d4732816f61ac487f0cb25511e0da88 | https://github.com/stonedz/pff2/blob/ec3b087d4d4732816f61ac487f0cb25511e0da88/src/Abs/AModule.php#L195-L220 |
205,489 | schpill/thin | src/Injection/Manager.php | InstanceManager.addSharedInstance | public function addSharedInstance($instance, $classOrAlias)
{
if (!is_object($instance)) {
throw new Exception('This method requires an object to be shared. Class or Alias given: ' . $classOrAlias);
}
$this->sharedInstances[$classOrAlias] = $instance;
... | php | public function addSharedInstance($instance, $classOrAlias)
{
if (!is_object($instance)) {
throw new Exception('This method requires an object to be shared. Class or Alias given: ' . $classOrAlias);
}
$this->sharedInstances[$classOrAlias] = $instance;
... | [
"public",
"function",
"addSharedInstance",
"(",
"$",
"instance",
",",
"$",
"classOrAlias",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"instance",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'This method requires an object to be shared. Class or Alias giv... | Add shared instance
@param object $instance
@param string $classOrAlias
@throws Exception | [
"Add",
"shared",
"instance"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L88-L95 |
205,490 | schpill/thin | src/Injection/Manager.php | InstanceManager.getSharedInstanceWithParameters | public function getSharedInstanceWithParameters($classOrAlias, array $params, $fastHashFromHasLookup = null)
{
if ($fastHashFromHasLookup) {
return $this->sharedInstancesWithParams['hashLong'][$fastHashFromHasLookup];
}
ksort($params);
$hashKey = ... | php | public function getSharedInstanceWithParameters($classOrAlias, array $params, $fastHashFromHasLookup = null)
{
if ($fastHashFromHasLookup) {
return $this->sharedInstancesWithParams['hashLong'][$fastHashFromHasLookup];
}
ksort($params);
$hashKey = ... | [
"public",
"function",
"getSharedInstanceWithParameters",
"(",
"$",
"classOrAlias",
",",
"array",
"$",
"params",
",",
"$",
"fastHashFromHasLookup",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fastHashFromHasLookup",
")",
"{",
"return",
"$",
"this",
"->",
"sharedInsta... | Retrieves an instance by its name and the parameters stored at its instantiation
@param string $classOrAlias
@param array $params
@param bool|null $fastHashFromHasLookup
@return object|bool false if no instance was found | [
"Retrieves",
"an",
"instance",
"by",
"its",
"name",
"and",
"the",
"parameters",
"stored",
"at",
"its",
"instantiation"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L150-L168 |
205,491 | schpill/thin | src/Injection/Manager.php | InstanceManager.hasConfig | public function hasConfig($aliasOrClass)
{
$key = ($this->hasAlias($aliasOrClass)) ? 'alias:' . $this->getBaseAlias($aliasOrClass) : $aliasOrClass;
if (!isset($this->configurations[$key])) {
return false;
}
if ($this->configurations[$key] === $th... | php | public function hasConfig($aliasOrClass)
{
$key = ($this->hasAlias($aliasOrClass)) ? 'alias:' . $this->getBaseAlias($aliasOrClass) : $aliasOrClass;
if (!isset($this->configurations[$key])) {
return false;
}
if ($this->configurations[$key] === $th... | [
"public",
"function",
"hasConfig",
"(",
"$",
"aliasOrClass",
")",
"{",
"$",
"key",
"=",
"(",
"$",
"this",
"->",
"hasAlias",
"(",
"$",
"aliasOrClass",
")",
")",
"?",
"'alias:'",
".",
"$",
"this",
"->",
"getBaseAlias",
"(",
"$",
"aliasOrClass",
")",
":",... | Check for configuration
@param string $aliasOrClass
@return bool | [
"Check",
"for",
"configuration"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L279-L292 |
205,492 | schpill/thin | src/Injection/Manager.php | InstanceManager.hasTypePreferences | public function hasTypePreferences($interfaceOrAbstract)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
return (isset($this->typePreferences[$key]) && $this->typePreferences[$key]);
} | php | public function hasTypePreferences($interfaceOrAbstract)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
return (isset($this->typePreferences[$key]) && $this->typePreferences[$key]);
} | [
"public",
"function",
"hasTypePreferences",
"(",
"$",
"interfaceOrAbstract",
")",
"{",
"$",
"key",
"=",
"(",
"$",
"this",
"->",
"hasAlias",
"(",
"$",
"interfaceOrAbstract",
")",
")",
"?",
"'alias:'",
".",
"$",
"interfaceOrAbstract",
":",
"$",
"interfaceOrAbstr... | Check for type preferences
@param string $interfaceOrAbstract
@return bool | [
"Check",
"for",
"type",
"preferences"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L397-L402 |
205,493 | schpill/thin | src/Injection/Manager.php | InstanceManager.setTypePreference | public function setTypePreference($interfaceOrAbstract, array $preferredImplementations)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
foreach ($preferredImplementations as $preferredImplementation) {
$this->ad... | php | public function setTypePreference($interfaceOrAbstract, array $preferredImplementations)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
foreach ($preferredImplementations as $preferredImplementation) {
$this->ad... | [
"public",
"function",
"setTypePreference",
"(",
"$",
"interfaceOrAbstract",
",",
"array",
"$",
"preferredImplementations",
")",
"{",
"$",
"key",
"=",
"(",
"$",
"this",
"->",
"hasAlias",
"(",
"$",
"interfaceOrAbstract",
")",
")",
"?",
"'alias:'",
".",
"$",
"i... | Set type preference
@param string $interfaceOrAbstract
@param array $preferredImplementations
@return InstanceManager | [
"Set",
"type",
"preference"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L411-L420 |
205,494 | schpill/thin | src/Injection/Manager.php | InstanceManager.getTypePreferences | public function getTypePreferences($interfaceOrAbstract)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
if (isset($this->typePreferences[$key])) {
return $this->typePreferences[$key];
}
... | php | public function getTypePreferences($interfaceOrAbstract)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
if (isset($this->typePreferences[$key])) {
return $this->typePreferences[$key];
}
... | [
"public",
"function",
"getTypePreferences",
"(",
"$",
"interfaceOrAbstract",
")",
"{",
"$",
"key",
"=",
"(",
"$",
"this",
"->",
"hasAlias",
"(",
"$",
"interfaceOrAbstract",
")",
")",
"?",
"'alias:'",
".",
"$",
"interfaceOrAbstract",
":",
"$",
"interfaceOrAbstr... | Get type preferences
@param string $interfaceOrAbstract
@return array | [
"Get",
"type",
"preferences"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L428-L437 |
205,495 | schpill/thin | src/Injection/Manager.php | InstanceManager.unsetTypePreferences | public function unsetTypePreferences($interfaceOrAbstract)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
unset($this->typePreferences[$key]);
} | php | public function unsetTypePreferences($interfaceOrAbstract)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
unset($this->typePreferences[$key]);
} | [
"public",
"function",
"unsetTypePreferences",
"(",
"$",
"interfaceOrAbstract",
")",
"{",
"$",
"key",
"=",
"(",
"$",
"this",
"->",
"hasAlias",
"(",
"$",
"interfaceOrAbstract",
")",
")",
"?",
"'alias:'",
".",
"$",
"interfaceOrAbstract",
":",
"$",
"interfaceOrAbs... | Unset type preferences
@param string $interfaceOrAbstract
@return void | [
"Unset",
"type",
"preferences"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L445-L450 |
205,496 | schpill/thin | src/Injection/Manager.php | InstanceManager.removeTypePreference | public function removeTypePreference($interfaceOrAbstract, $preferredType)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
if (!isset($this->typePreferences[$key]) || !Arrays::in($preferredType, $this->typePreferences[$key])) {
... | php | public function removeTypePreference($interfaceOrAbstract, $preferredType)
{
$key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;
if (!isset($this->typePreferences[$key]) || !Arrays::in($preferredType, $this->typePreferences[$key])) {
... | [
"public",
"function",
"removeTypePreference",
"(",
"$",
"interfaceOrAbstract",
",",
"$",
"preferredType",
")",
"{",
"$",
"key",
"=",
"(",
"$",
"this",
"->",
"hasAlias",
"(",
"$",
"interfaceOrAbstract",
")",
")",
"?",
"'alias:'",
".",
"$",
"interfaceOrAbstract"... | Removes a previously set type preference
@param string $interfaceOrAbstract
@param string $preferredType
@return bool|self | [
"Removes",
"a",
"previously",
"set",
"type",
"preference"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Injection/Manager.php#L480-L491 |
205,497 | jasny/entity | src/EventListener/ToAssocRecursive.php | ToAssocRecursive.toAssocRecursive | protected function toAssocRecursive($input, SplObjectStorage $list): array
{
$values = is_iterable($input)
? i\iterable_to_array($input)
: object_get_properties($input, $input instanceof stdClass || $input instanceof DynamicEntity);
foreach ($values as $key => &$value) {
... | php | protected function toAssocRecursive($input, SplObjectStorage $list): array
{
$values = is_iterable($input)
? i\iterable_to_array($input)
: object_get_properties($input, $input instanceof stdClass || $input instanceof DynamicEntity);
foreach ($values as $key => &$value) {
... | [
"protected",
"function",
"toAssocRecursive",
"(",
"$",
"input",
",",
"SplObjectStorage",
"$",
"list",
")",
":",
"array",
"{",
"$",
"values",
"=",
"is_iterable",
"(",
"$",
"input",
")",
"?",
"i",
"\\",
"iterable_to_array",
"(",
"$",
"input",
")",
":",
"ob... | Recursively cast to associative arrays.
@param iterable|object $input
@param SplObjectStorage $list Entity / assoc map for entities that already have been converted
@return array | [
"Recursively",
"cast",
"to",
"associative",
"arrays",
"."
] | 5af7c94645671a3257d6565ff1891ff61fdcf69b | https://github.com/jasny/entity/blob/5af7c94645671a3257d6565ff1891ff61fdcf69b/src/EventListener/ToAssocRecursive.php#L62-L81 |
205,498 | MovingImage24/VM6ApiClient | lib/Entity/Video.php | Video.getStills | public function getStills()
{
if (!isset($this->stills)) {
$this->stills = [
new Still($this->thumbnail_url, 'default'),
new Still($this->thumbnail_url_lq, 'lq'),
new Still($this->thumbnail_url_mq, 'mq'),
];
}
return $t... | php | public function getStills()
{
if (!isset($this->stills)) {
$this->stills = [
new Still($this->thumbnail_url, 'default'),
new Still($this->thumbnail_url_lq, 'lq'),
new Still($this->thumbnail_url_mq, 'mq'),
];
}
return $t... | [
"public",
"function",
"getStills",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stills",
")",
")",
"{",
"$",
"this",
"->",
"stills",
"=",
"[",
"new",
"Still",
"(",
"$",
"this",
"->",
"thumbnail_url",
",",
"'default'",
")",
",",
... | Generate a list of Still entities based on
other properties that come from VM 6.
@return Still[] | [
"Generate",
"a",
"list",
"of",
"Still",
"entities",
"based",
"on",
"other",
"properties",
"that",
"come",
"from",
"VM",
"6",
"."
] | 84e6510fa0fb71cfbb42ea9f23775f681c266fac | https://github.com/MovingImage24/VM6ApiClient/blob/84e6510fa0fb71cfbb42ea9f23775f681c266fac/lib/Entity/Video.php#L267-L278 |
205,499 | PhoxPHP/Glider | src/Connection/ConnectionManager.php | ConnectionManager.get | private function get(String $id)
{
if (!$id) {
$id = ConnectionManager::DEFAULT_CONNECTION_ID;
}
if (count($this->loadedConnections) < 1) {
return false;
}
if (isset($this->loadedConnections[$id])) {
$this->configuredConnectionId = $id;
$this->platformConnector = [$id => $this->loadedConnection... | php | private function get(String $id)
{
if (!$id) {
$id = ConnectionManager::DEFAULT_CONNECTION_ID;
}
if (count($this->loadedConnections) < 1) {
return false;
}
if (isset($this->loadedConnections[$id])) {
$this->configuredConnectionId = $id;
$this->platformConnector = [$id => $this->loadedConnection... | [
"private",
"function",
"get",
"(",
"String",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"ConnectionManager",
"::",
"DEFAULT_CONNECTION_ID",
";",
"}",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"loadedConnections",
")",
... | Try to connection with this id from the loaded connections in the configuration
file.
@param $id <String>
@access private
@return <Mixed> | [
"Try",
"to",
"connection",
"with",
"this",
"id",
"from",
"the",
"loaded",
"connections",
"in",
"the",
"configuration",
"file",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Connection/ConnectionManager.php#L223-L239 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.