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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readInt24BE | final public function readInt24BE()
{
if ($this->isLittleEndian()) {
return $this->fromInt24(strrev($this->read(3)));
} else {
return $this->fromInt24($this->read(3));
}
} | php | final public function readInt24BE()
{
if ($this->isLittleEndian()) {
return $this->fromInt24(strrev($this->read(3)));
} else {
return $this->fromInt24($this->read(3));
}
} | [
"final",
"public",
"function",
"readInt24BE",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLittleEndian",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromInt24",
"(",
"strrev",
"(",
"$",
"this",
"->",
"read",
"(",
"3",
")",
")",
")",
";",
... | Reads 3 bytes from the stream and returns big-endian ordered binary data
as signed 24-bit integer.
@return integer
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"3",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"big",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"signed",
"24",
"-",
"bit",
"integer",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L348-L355 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.fromUInt24 | private function fromUInt24($value, $order = 0)
{
list(, $int) = unpack(
($order == self::BIG_ENDIAN_ORDER ? 'N' : ($order == self::LITTLE_ENDIAN_ORDER ? 'V' : 'L')) . '*',
$this->isLittleEndian() ? ("\x00" . $value) : ($value . "\x00")
);
return $int;
} | php | private function fromUInt24($value, $order = 0)
{
list(, $int) = unpack(
($order == self::BIG_ENDIAN_ORDER ? 'N' : ($order == self::LITTLE_ENDIAN_ORDER ? 'V' : 'L')) . '*',
$this->isLittleEndian() ? ("\x00" . $value) : ($value . "\x00")
);
return $int;
} | [
"private",
"function",
"fromUInt24",
"(",
"$",
"value",
",",
"$",
"order",
"=",
"0",
")",
"{",
"list",
"(",
",",
"$",
"int",
")",
"=",
"unpack",
"(",
"(",
"$",
"order",
"==",
"self",
"::",
"BIG_ENDIAN_ORDER",
"?",
"'N'",
":",
"(",
"$",
"order",
"... | Returns machine endian ordered binary data as unsigned 24-bit integer.
@param string $value The binary data string.
@param integer $order The byte order of the binary data string.
@return integer | [
"Returns",
"machine",
"endian",
"ordered",
"binary",
"data",
"as",
"unsigned",
"24",
"-",
"bit",
"integer",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L376-L383 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readInt32LE | final public function readInt32LE()
{
if ($this->isBigEndian()) {
return $this->fromInt32(strrev($this->read(4)));
} else {
return $this->fromInt32($this->read(4));
}
} | php | final public function readInt32LE()
{
if ($this->isBigEndian()) {
return $this->fromInt32(strrev($this->read(4)));
} else {
return $this->fromInt32($this->read(4));
}
} | [
"final",
"public",
"function",
"readInt32LE",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isBigEndian",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromInt32",
"(",
"strrev",
"(",
"$",
"this",
"->",
"read",
"(",
"4",
")",
")",
")",
";",
"... | Reads 4 bytes from the stream and returns little-endian ordered binary
data as signed 32-bit integer.
@return integer
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"4",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"little",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"signed",
"32",
"-",
"bit",
"integer",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L440-L447 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readInt32BE | final public function readInt32BE()
{
if ($this->isLittleEndian()) {
return $this->fromInt32(strrev($this->read(4)));
} else {
return $this->fromInt32($this->read(4));
}
} | php | final public function readInt32BE()
{
if ($this->isLittleEndian()) {
return $this->fromInt32(strrev($this->read(4)));
} else {
return $this->fromInt32($this->read(4));
}
} | [
"final",
"public",
"function",
"readInt32BE",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLittleEndian",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromInt32",
"(",
"strrev",
"(",
"$",
"this",
"->",
"read",
"(",
"4",
")",
")",
")",
";",
... | Reads 4 bytes from the stream and returns big-endian ordered binary data
as signed 32-bit integer.
@return integer
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"4",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"big",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"signed",
"32",
"-",
"bit",
"integer",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L456-L463 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readUInt32LE | final public function readUInt32LE()
{
if (PHP_INT_SIZE < 8) {
// @codeCoverageIgnoreStart
list(, $lo, $hi) = unpack('v*', $this->read(4));
return $hi * (0xffff+1) + $lo; // eq $hi << 16 | $lo
// @codeCoverageIgnoreEnd
} else {
list(, $int)... | php | final public function readUInt32LE()
{
if (PHP_INT_SIZE < 8) {
// @codeCoverageIgnoreStart
list(, $lo, $hi) = unpack('v*', $this->read(4));
return $hi * (0xffff+1) + $lo; // eq $hi << 16 | $lo
// @codeCoverageIgnoreEnd
} else {
list(, $int)... | [
"final",
"public",
"function",
"readUInt32LE",
"(",
")",
"{",
"if",
"(",
"PHP_INT_SIZE",
"<",
"8",
")",
"{",
"// @codeCoverageIgnoreStart",
"list",
"(",
",",
"$",
"lo",
",",
"$",
"hi",
")",
"=",
"unpack",
"(",
"'v*'",
",",
"$",
"this",
"->",
"read",
... | Reads 4 bytes from the stream and returns little-endian ordered binary
data as unsigned 32-bit integer.
@return integer
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"4",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"little",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"unsigned",
"32",
"-",
"bit",
"integer",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L484-L495 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readUInt32 | final public function readUInt32()
{
if (PHP_INT_SIZE < 8) {
// @codeCoverageIgnoreStart
if ($this->isLittleEndian()) {
list(, $lo, $hi) = unpack('S*', $this->read(4));
} else {
list(, $hi, $lo) = unpack('S*', $this->read(4));
}... | php | final public function readUInt32()
{
if (PHP_INT_SIZE < 8) {
// @codeCoverageIgnoreStart
if ($this->isLittleEndian()) {
list(, $lo, $hi) = unpack('S*', $this->read(4));
} else {
list(, $hi, $lo) = unpack('S*', $this->read(4));
}... | [
"final",
"public",
"function",
"readUInt32",
"(",
")",
"{",
"if",
"(",
"PHP_INT_SIZE",
"<",
"8",
")",
"{",
"// @codeCoverageIgnoreStart",
"if",
"(",
"$",
"this",
"->",
"isLittleEndian",
"(",
")",
")",
"{",
"list",
"(",
",",
"$",
"lo",
",",
"$",
"hi",
... | Reads 4 bytes from the stream and returns machine ordered binary data
as unsigned 32-bit integer.
@return integer
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"4",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"machine",
"ordered",
"binary",
"data",
"as",
"unsigned",
"32",
"-",
"bit",
"integer",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L524-L539 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readInt64LE | final public function readInt64LE()
{
list(, $lolo, $lohi, $hilo, $hihi) = unpack('v*', $this->read(8));
return ($hihi * (0xffff+1) + $hilo) * (0xffffffff+1) + ($lohi * (0xffff+1) + $lolo);
} | php | final public function readInt64LE()
{
list(, $lolo, $lohi, $hilo, $hihi) = unpack('v*', $this->read(8));
return ($hihi * (0xffff+1) + $hilo) * (0xffffffff+1) + ($lohi * (0xffff+1) + $lolo);
} | [
"final",
"public",
"function",
"readInt64LE",
"(",
")",
"{",
"list",
"(",
",",
"$",
"lolo",
",",
"$",
"lohi",
",",
"$",
"hilo",
",",
"$",
"hihi",
")",
"=",
"unpack",
"(",
"'v*'",
",",
"$",
"this",
"->",
"read",
"(",
"8",
")",
")",
";",
"return"... | Reads 8 bytes from the stream and returns little-endian ordered binary
data as 64-bit float.
{@internal PHP does not support 64-bit integers as the long
integer is of 32-bits but using aritmetic operations it is implicitly
converted into floating point which is of 64-bits long.}}
@return integer
@throws InvalidStream... | [
"Reads",
"8",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"little",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"64",
"-",
"bit",
"float",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L552-L556 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readFloatLE | final public function readFloatLE()
{
if ($this->isBigEndian()) {
return $this->fromFloat(strrev($this->read(4)));
} else {
return $this->fromFloat($this->read(4));
}
} | php | final public function readFloatLE()
{
if ($this->isBigEndian()) {
return $this->fromFloat(strrev($this->read(4)));
} else {
return $this->fromFloat($this->read(4));
}
} | [
"final",
"public",
"function",
"readFloatLE",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isBigEndian",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromFloat",
"(",
"strrev",
"(",
"$",
"this",
"->",
"read",
"(",
"4",
")",
")",
")",
";",
"... | Reads 4 bytes from the stream and returns little-endian ordered binary
data as a 32-bit float point number as defined by IEEE 754.
@return float
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"4",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"little",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"a",
"32",
"-",
"bit",
"float",
"point",
"number",
"as",
"defined",
"by",
"IEEE",
"754",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L595-L602 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readFloatBE | final public function readFloatBE()
{
if ($this->isLittleEndian()) {
return $this->fromFloat(strrev($this->read(4)));
} else {
return $this->fromFloat($this->read(4));
}
} | php | final public function readFloatBE()
{
if ($this->isLittleEndian()) {
return $this->fromFloat(strrev($this->read(4)));
} else {
return $this->fromFloat($this->read(4));
}
} | [
"final",
"public",
"function",
"readFloatBE",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLittleEndian",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromFloat",
"(",
"strrev",
"(",
"$",
"this",
"->",
"read",
"(",
"4",
")",
")",
")",
";",
... | Reads 4 bytes from the stream and returns big-endian ordered binary data
as a 32-bit float point number as defined by IEEE 754.
@return float
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"4",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"big",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"a",
"32",
"-",
"bit",
"float",
"point",
"number",
"as",
"defined",
"by",
"IEEE",
"754",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L611-L618 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readDoubleLE | final public function readDoubleLE()
{
if ($this->isBigEndian()) {
return $this->fromDouble(strrev($this->read(8)));
} else {
return $this->fromDouble($this->read(8));
}
} | php | final public function readDoubleLE()
{
if ($this->isBigEndian()) {
return $this->fromDouble(strrev($this->read(8)));
} else {
return $this->fromDouble($this->read(8));
}
} | [
"final",
"public",
"function",
"readDoubleLE",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isBigEndian",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromDouble",
"(",
"strrev",
"(",
"$",
"this",
"->",
"read",
"(",
"8",
")",
")",
")",
";",
... | Reads 8 bytes from the stream and returns little-endian ordered binary
data as a 64-bit floating point number as defined by IEEE 754.
@return float
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"8",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"little",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"a",
"64",
"-",
"bit",
"floating",
"point",
"number",
"as",
"defined",
"by",
"IEEE",
"754",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L640-L647 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readDoubleBE | final public function readDoubleBE()
{
if ($this->isLittleEndian()) {
return $this->fromDouble(strrev($this->read(8)));
} else {
return $this->fromDouble($this->read(8));
}
} | php | final public function readDoubleBE()
{
if ($this->isLittleEndian()) {
return $this->fromDouble(strrev($this->read(8)));
} else {
return $this->fromDouble($this->read(8));
}
} | [
"final",
"public",
"function",
"readDoubleBE",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLittleEndian",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fromDouble",
"(",
"strrev",
"(",
"$",
"this",
"->",
"read",
"(",
"8",
")",
")",
")",
";"... | Reads 8 bytes from the stream and returns big-endian ordered binary data
as a 64-bit float point number as defined by IEEE 754.
@return float
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"8",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"big",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"a",
"64",
"-",
"bit",
"float",
"point",
"number",
"as",
"defined",
"by",
"IEEE",
"754",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L656-L663 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.readGuid | final public function readGuid()
{
$C = @unpack('V1V/v2v/N2N', $this->read(16));
list($hex) = @unpack('H*0', pack('NnnNN', $C['V'], $C['v1'], $C['v2'], $C['N1'], $C['N2']));
/* Fixes a bug in PHP versions earlier than Jan 25 2006 */
if (implode('', unpack('H*', pack('H*', 'a'))) == ... | php | final public function readGuid()
{
$C = @unpack('V1V/v2v/N2N', $this->read(16));
list($hex) = @unpack('H*0', pack('NnnNN', $C['V'], $C['v1'], $C['v2'], $C['N1'], $C['N2']));
/* Fixes a bug in PHP versions earlier than Jan 25 2006 */
if (implode('', unpack('H*', pack('H*', 'a'))) == ... | [
"final",
"public",
"function",
"readGuid",
"(",
")",
"{",
"$",
"C",
"=",
"@",
"unpack",
"(",
"'V1V/v2v/N2N'",
",",
"$",
"this",
"->",
"read",
"(",
"16",
")",
")",
";",
"list",
"(",
"$",
"hex",
")",
"=",
"@",
"unpack",
"(",
"'H*0'",
",",
"pack",
... | Reads 16 bytes from the stream and returns the little-endian ordered
binary data as mixed-ordered hexadecimal GUID string.
@return string
@throws InvalidStreamException if an I/O error occurs | [
"Reads",
"16",
"bytes",
"from",
"the",
"stream",
"and",
"returns",
"the",
"little",
"-",
"endian",
"ordered",
"binary",
"data",
"as",
"mixed",
"-",
"ordered",
"hexadecimal",
"GUID",
"string",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L758-L771 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.close | public function close()
{
if ($this->fileDescriptor !== null) {
@fclose($this->fileDescriptor);
$this->fileDescriptor = null;
}
} | php | public function close()
{
if ($this->fileDescriptor !== null) {
@fclose($this->fileDescriptor);
$this->fileDescriptor = null;
}
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fileDescriptor",
"!==",
"null",
")",
"{",
"@",
"fclose",
"(",
"$",
"this",
"->",
"fileDescriptor",
")",
";",
"$",
"this",
"->",
"fileDescriptor",
"=",
"null",
";",
"}",
"}"
... | Closes the stream. Once a stream has been closed, further calls to read
methods will throw an exception. Closing a previously-closed stream,
however, has no effect.
@return void | [
"Closes",
"the",
"stream",
".",
"Once",
"a",
"stream",
"has",
"been",
"closed",
"further",
"calls",
"to",
"read",
"methods",
"will",
"throw",
"an",
"exception",
".",
"Closing",
"a",
"previously",
"-",
"closed",
"stream",
"however",
"has",
"no",
"effect",
"... | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L793-L799 | train |
MetaSyntactical/Io | src/MetaSyntactical/Io/Reader.php | Reader.getEndianess | private function getEndianess()
{
if (0 === self::$endianess) {
self::$endianess = $this->fromInt32("\x01\x00\x00\x00") == 1
? self::LITTLE_ENDIAN_ORDER
: self::BIG_ENDIAN_ORDER;
}
return self::$endianess;
} | php | private function getEndianess()
{
if (0 === self::$endianess) {
self::$endianess = $this->fromInt32("\x01\x00\x00\x00") == 1
? self::LITTLE_ENDIAN_ORDER
: self::BIG_ENDIAN_ORDER;
}
return self::$endianess;
} | [
"private",
"function",
"getEndianess",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"self",
"::",
"$",
"endianess",
")",
"{",
"self",
"::",
"$",
"endianess",
"=",
"$",
"this",
"->",
"fromInt32",
"(",
"\"\\x01\\x00\\x00\\x00\"",
")",
"==",
"1",
"?",
"self",
":... | Returns the current machine endian order.
@return integer | [
"Returns",
"the",
"current",
"machine",
"endian",
"order",
"."
] | d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c | https://github.com/MetaSyntactical/Io/blob/d9272c6cf7f3cf24cbd5e4069a6695b26ef0b50c/src/MetaSyntactical/Io/Reader.php#L806-L814 | train |
bkstg/schedule-bundle | Repository/InvitationRepository.php | InvitationRepository.findPendingInvitationsQuery | public function findPendingInvitationsQuery(UserInterface $user)
{
$qb = $this->createQueryBuilder('i');
return $qb
->join('i.event', 'e')
// Add conditions.
->andWhere($qb->expr()->eq('e.active', ':active'))
->andWhere($qb->expr()->gt('e.end', ':now... | php | public function findPendingInvitationsQuery(UserInterface $user)
{
$qb = $this->createQueryBuilder('i');
return $qb
->join('i.event', 'e')
// Add conditions.
->andWhere($qb->expr()->eq('e.active', ':active'))
->andWhere($qb->expr()->gt('e.end', ':now... | [
"public",
"function",
"findPendingInvitationsQuery",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'i'",
")",
";",
"return",
"$",
"qb",
"->",
"join",
"(",
"'i.event'",
",",
"'e'",
")",
"// Add c... | Build query to find pending invitations for a user.
@param UserInterface $user The user to find invitations for.
@return Invitation[] | [
"Build",
"query",
"to",
"find",
"pending",
"invitations",
"for",
"a",
"user",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Repository/InvitationRepository.php#L26-L46 | train |
bkstg/schedule-bundle | Repository/InvitationRepository.php | InvitationRepository.findOtherInvitationsQuery | public function findOtherInvitationsQuery(UserInterface $user)
{
$qb = $this->createQueryBuilder('i');
return $qb
->join('i.event', 'e')
// Add conditions.
->andWhere($qb->expr()->eq('e.active', ':active'))
->andWhere($qb->expr()->orX(
... | php | public function findOtherInvitationsQuery(UserInterface $user)
{
$qb = $this->createQueryBuilder('i');
return $qb
->join('i.event', 'e')
// Add conditions.
->andWhere($qb->expr()->eq('e.active', ':active'))
->andWhere($qb->expr()->orX(
... | [
"public",
"function",
"findOtherInvitationsQuery",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'i'",
")",
";",
"return",
"$",
"qb",
"->",
"join",
"(",
"'i.event'",
",",
"'e'",
")",
"// Add con... | Build query to find other invitations for a user.
@param UserInterface $user The user to find invitations for.
@return Invitation[] | [
"Build",
"query",
"to",
"find",
"other",
"invitations",
"for",
"a",
"user",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Repository/InvitationRepository.php#L67-L92 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.hasReadAccess | public function hasReadAccess() : bool
{
return $this->isOpen()
&& (
$this->access == static::ACCESS_READ
|| $this->access == static::ACCESS_READWRITE
);
} | php | public function hasReadAccess() : bool
{
return $this->isOpen()
&& (
$this->access == static::ACCESS_READ
|| $this->access == static::ACCESS_READWRITE
);
} | [
"public",
"function",
"hasReadAccess",
"(",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"isOpen",
"(",
")",
"&&",
"(",
"$",
"this",
"->",
"access",
"==",
"static",
"::",
"ACCESS_READ",
"||",
"$",
"this",
"->",
"access",
"==",
"static",
"::",
... | Returns if reading is enabled.
@return boolean | [
"Returns",
"if",
"reading",
"is",
"enabled",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L152-L161 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.hasWriteAccess | public function hasWriteAccess() : bool
{
return $this->isOpen()
&& (
$this->access == static::ACCESS_WRITE
|| $this->access == static::ACCESS_READWRITE
);
} | php | public function hasWriteAccess() : bool
{
return $this->isOpen()
&& (
$this->access == static::ACCESS_WRITE
|| $this->access == static::ACCESS_READWRITE
);
} | [
"public",
"function",
"hasWriteAccess",
"(",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"isOpen",
"(",
")",
"&&",
"(",
"$",
"this",
"->",
"access",
"==",
"static",
"::",
"ACCESS_WRITE",
"||",
"$",
"this",
"->",
"access",
"==",
"static",
"::",
... | Returns if writing is enabled.
@return boolean | [
"Returns",
"if",
"writing",
"is",
"enabled",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L168-L177 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.writeCsv | public function writeCsv( array $dataRow, string $delimiter = ',', bool $fast = false ) : bool
{
if ( ! $fast )
{
// No fast (insecure) access = do the required checks
if ( ! $this->isOpen() )
{
return false;
}
if ( ! $this->hasWriteAccess() )
... | php | public function writeCsv( array $dataRow, string $delimiter = ',', bool $fast = false ) : bool
{
if ( ! $fast )
{
// No fast (insecure) access = do the required checks
if ( ! $this->isOpen() )
{
return false;
}
if ( ! $this->hasWriteAccess() )
... | [
"public",
"function",
"writeCsv",
"(",
"array",
"$",
"dataRow",
",",
"string",
"$",
"delimiter",
"=",
"','",
",",
"bool",
"$",
"fast",
"=",
"false",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"fast",
")",
"{",
"// No fast (insecure) access = do the requir... | Write a csv format data row, defined as array.
@param array $dataRow The data row to write (numeric indicated array)
@param string $delimiter The CSV column delimiter char. (default=',')
@param boolean $fast Write fast without some checks? (Defaults to FALSE)
@return boolean
@throw... | [
"Write",
"a",
"csv",
"format",
"data",
"row",
"defined",
"as",
"array",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L578-L613 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.setPointerPosition | public function setPointerPosition( int $offset = 0 ) : bool
{
if ( ! \is_resource( $this->fp ) )
{
return false;
}
return (bool) \fseek( $this->fp, $offset );
} | php | public function setPointerPosition( int $offset = 0 ) : bool
{
if ( ! \is_resource( $this->fp ) )
{
return false;
}
return (bool) \fseek( $this->fp, $offset );
} | [
"public",
"function",
"setPointerPosition",
"(",
"int",
"$",
"offset",
"=",
"0",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"\\",
"is_resource",
"(",
"$",
"this",
"->",
"fp",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"bool",
")",
"\\",... | Sets a new file pointer position.
@param integer $offset
@return boolean | [
"Sets",
"a",
"new",
"file",
"pointer",
"position",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L642-L652 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.setPointerPositionToEndOfFile | public function setPointerPositionToEndOfFile() : bool
{
if ( ! \is_resource( $this->fp ) )
{
return false;
}
return (bool) \fseek( $this->fp, 0, \SEEK_END );
} | php | public function setPointerPositionToEndOfFile() : bool
{
if ( ! \is_resource( $this->fp ) )
{
return false;
}
return (bool) \fseek( $this->fp, 0, \SEEK_END );
} | [
"public",
"function",
"setPointerPositionToEndOfFile",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"\\",
"is_resource",
"(",
"$",
"this",
"->",
"fp",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"bool",
")",
"\\",
"fseek",
"(",
"$",
"th... | Sets the file pointer position to the end of the file.
@return boolean | [
"Sets",
"the",
"file",
"pointer",
"position",
"to",
"the",
"end",
"of",
"the",
"file",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L659-L669 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.Create | public static function Create( string $file, $mode = 0750, bool $overwrite = true, $contents = '' )
{
$f = File::CreateNew( $file, $overwrite, true, true, $mode );
$f->write( $contents );
$f->close();
} | php | public static function Create( string $file, $mode = 0750, bool $overwrite = true, $contents = '' )
{
$f = File::CreateNew( $file, $overwrite, true, true, $mode );
$f->write( $contents );
$f->close();
} | [
"public",
"static",
"function",
"Create",
"(",
"string",
"$",
"file",
",",
"$",
"mode",
"=",
"0750",
",",
"bool",
"$",
"overwrite",
"=",
"true",
",",
"$",
"contents",
"=",
"''",
")",
"{",
"$",
"f",
"=",
"File",
"::",
"CreateNew",
"(",
"$",
"file",
... | Creates a new file with the defined content.
If $overwrite is FALSE and the file already exists, a {@see \Beluga\IO\FileAlreadyExistsException} is thrown.
@param string $file The path of the file to create.
@param integer $mode The file access mode (only used by unixoids) (d... | [
"Creates",
"a",
"new",
"file",
"with",
"the",
"defined",
"content",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L885-L892 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.Zip | public static function Zip( string $sourceFile, string $zipFile, string $workingDir = null )
{
if ( ! \class_exists( '\\ZipArchive' ) )
{
throw new MissingExtensionError( 'ZIP', 'IO', 'Can not ZIP the file "' . $sourceFile . '"!' );
}
// Remember the original used working directory... | php | public static function Zip( string $sourceFile, string $zipFile, string $workingDir = null )
{
if ( ! \class_exists( '\\ZipArchive' ) )
{
throw new MissingExtensionError( 'ZIP', 'IO', 'Can not ZIP the file "' . $sourceFile . '"!' );
}
// Remember the original used working directory... | [
"public",
"static",
"function",
"Zip",
"(",
"string",
"$",
"sourceFile",
",",
"string",
"$",
"zipFile",
",",
"string",
"$",
"workingDir",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"\\",
"class_exists",
"(",
"'\\\\ZipArchive'",
")",
")",
"{",
"throw",
"new",... | Compresses the defined source file to defined ZIP archive file.
@param string $sourceFile This file will be compressed by the zip archive
@param string $zipFile The target/destination ZIP file. (will be created or overwrite a existing)
@param string $workingDir A optional working folder. (Usual its the folder, c... | [
"Compresses",
"the",
"defined",
"source",
"file",
"to",
"defined",
"ZIP",
"archive",
"file",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L1097-L1227 | train |
SagittariusX/Beluga.IO | src/Beluga/IO/File.php | File.GetNameWithoutExtension | public static function GetNameWithoutExtension( string $file, bool $doubleExtension = false )
{
if ( \FALSE === ( $ext = static::GetExtension( $file, $doubleExtension ) ) )
{
return \basename( $file );
}
return \substr( \basename( $file ), 0, -\strlen( $ext ) );
} | php | public static function GetNameWithoutExtension( string $file, bool $doubleExtension = false )
{
if ( \FALSE === ( $ext = static::GetExtension( $file, $doubleExtension ) ) )
{
return \basename( $file );
}
return \substr( \basename( $file ), 0, -\strlen( $ext ) );
} | [
"public",
"static",
"function",
"GetNameWithoutExtension",
"(",
"string",
"$",
"file",
",",
"bool",
"$",
"doubleExtension",
"=",
"false",
")",
"{",
"if",
"(",
"\\",
"FALSE",
"===",
"(",
"$",
"ext",
"=",
"static",
"::",
"GetExtension",
"(",
"$",
"file",
"... | Returns the file name without the file name extension.
@param string $file The file name/path.
@param boolean $doubleExtension If you require extensions, including also a single dot like '.abc.def'
you have to set this parameter to TRUE.
@return string|bool Name or bool FALSE. | [
"Returns",
"the",
"file",
"name",
"without",
"the",
"file",
"name",
"extension",
"."
] | c8af09a1b3cc8a955e43c89b70779d11b30ae29e | https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/File.php#L1526-L1533 | train |
Stinger-Soft/PhpCommons | src/StingerSoft/PhpCommons/Integer/Utils.php | Utils.intcmp | public static function intcmp($a, $b) {
return ($a - $b) ? ($a - $b) / abs($a - $b) : 0;
} | php | public static function intcmp($a, $b) {
return ($a - $b) ? ($a - $b) / abs($a - $b) : 0;
} | [
"public",
"static",
"function",
"intcmp",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"(",
"$",
"a",
"-",
"$",
"b",
")",
"?",
"(",
"$",
"a",
"-",
"$",
"b",
")",
"/",
"abs",
"(",
"$",
"a",
"-",
"$",
"b",
")",
":",
"0",
";",
"}"
] | Returns an integer less than, equal to, or greater than zero if the first argument is considered to be
respectively less than, equal to, or greater than the second.
@param int $a
@param int $b
@return int | [
"Returns",
"an",
"integer",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"zero",
"if",
"the",
"first",
"argument",
"is",
"considered",
"to",
"be",
"respectively",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"the",
"second",
"."
] | e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b | https://github.com/Stinger-Soft/PhpCommons/blob/e1d7e2bb7b384fb9182903d3b6138aa3bbd05d9b/src/StingerSoft/PhpCommons/Integer/Utils.php#L27-L29 | train |
Vectrex/vxPHP | src/File/FilesystemFolder.php | FilesystemFolder.getFolders | public function getFolders() {
$result = [];
$files = glob($this->path . '*', GLOB_ONLYDIR);
if($files) {
foreach($files as $f) {
$result[] = self::getInstance($f);
}
}
return $result;
} | php | public function getFolders() {
$result = [];
$files = glob($this->path . '*', GLOB_ONLYDIR);
if($files) {
foreach($files as $f) {
$result[] = self::getInstance($f);
}
}
return $result;
} | [
"public",
"function",
"getFolders",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"files",
"=",
"glob",
"(",
"$",
"this",
"->",
"path",
".",
"'*'",
",",
"GLOB_ONLYDIR",
")",
";",
"if",
"(",
"$",
"files",
")",
"{",
"foreach",
"(",
"$",
... | returns all FilesystemFolder instances in folder
@return Array | [
"returns",
"all",
"FilesystemFolder",
"instances",
"in",
"folder"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFolder.php#L146-L159 | train |
Vectrex/vxPHP | src/File/FilesystemFolder.php | FilesystemFolder.getParentFolder | public function getParentFolder($force = FALSE) {
if(!isset($this->parentFolder) || $force) {
$parentPath = realpath($this->path . '..');
// flag parentFolder property, when $this is already the root folder
if($parentPath === $this->path) {
$this->parentFolder = FALSE;
}
else {
... | php | public function getParentFolder($force = FALSE) {
if(!isset($this->parentFolder) || $force) {
$parentPath = realpath($this->path . '..');
// flag parentFolder property, when $this is already the root folder
if($parentPath === $this->path) {
$this->parentFolder = FALSE;
}
else {
... | [
"public",
"function",
"getParentFolder",
"(",
"$",
"force",
"=",
"FALSE",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"parentFolder",
")",
"||",
"$",
"force",
")",
"{",
"$",
"parentPath",
"=",
"realpath",
"(",
"$",
"this",
"->",
"path"... | return parent FilesystemFolder of current folder
returns NULL, when current folder is already the root folder
@param boolean $force
@return FilesystemFolder | [
"return",
"parent",
"FilesystemFolder",
"of",
"current",
"folder",
"returns",
"NULL",
"when",
"current",
"folder",
"is",
"already",
"the",
"root",
"folder"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFolder.php#L168-L190 | train |
Vectrex/vxPHP | src/File/FilesystemFolder.php | FilesystemFolder.createFolder | public function createFolder($folderName) {
// prefix folder path, when realpath fails (e.g. does not exist)
if(!($path = realpath($folderName))) {
$path = $this->path . $folderName;
}
// throw exception when $folderName cannot be established as subdirectory of current folder
else if (strpos($p... | php | public function createFolder($folderName) {
// prefix folder path, when realpath fails (e.g. does not exist)
if(!($path = realpath($folderName))) {
$path = $this->path . $folderName;
}
// throw exception when $folderName cannot be established as subdirectory of current folder
else if (strpos($p... | [
"public",
"function",
"createFolder",
"(",
"$",
"folderName",
")",
"{",
"// prefix folder path, when realpath fails (e.g. does not exist)",
"if",
"(",
"!",
"(",
"$",
"path",
"=",
"realpath",
"(",
"$",
"folderName",
")",
")",
")",
"{",
"$",
"path",
"=",
"$",
"t... | create a new subdirectory
returns newly created FilesystemFolder object
@param string $folderName
@return FilesystemFolder
@throws FilesystemFolderException | [
"create",
"a",
"new",
"subdirectory",
"returns",
"newly",
"created",
"FilesystemFolder",
"object"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFolder.php#L231-L265 | train |
Vectrex/vxPHP | src/File/FilesystemFolder.php | FilesystemFolder.purgeCache | public function purgeCache($force = FALSE) {
if(($path = $this->getCachePath($force))) {
foreach(glob($path. '*') as $f) {
if(!unlink($f)) {
throw new FilesystemFolderException(sprintf('Cache folder %s could not be purged!', $this->path . self::CACHE_PATH));
}
}
}
} | php | public function purgeCache($force = FALSE) {
if(($path = $this->getCachePath($force))) {
foreach(glob($path. '*') as $f) {
if(!unlink($f)) {
throw new FilesystemFolderException(sprintf('Cache folder %s could not be purged!', $this->path . self::CACHE_PATH));
}
}
}
} | [
"public",
"function",
"purgeCache",
"(",
"$",
"force",
"=",
"FALSE",
")",
"{",
"if",
"(",
"(",
"$",
"path",
"=",
"$",
"this",
"->",
"getCachePath",
"(",
"$",
"force",
")",
")",
")",
"{",
"foreach",
"(",
"glob",
"(",
"$",
"path",
".",
"'*'",
")",
... | empties the cache when found
@param boolean $force
@throws FilesystemFolderException | [
"empties",
"the",
"cache",
"when",
"found"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/FilesystemFolder.php#L295-L305 | train |
hschletz/NADA | src/Table/Mysql.php | Mysql.setCharset | public function setCharset($charset)
{
$this->_database->exec(
'ALTER TABLE ' .
$this->_database->prepareIdentifier($this->_name) .
' CONVERT TO CHARACTER SET ' .
$this->_database->prepareValue($charset, Column::TYPE_VARCHAR)
);
} | php | public function setCharset($charset)
{
$this->_database->exec(
'ALTER TABLE ' .
$this->_database->prepareIdentifier($this->_name) .
' CONVERT TO CHARACTER SET ' .
$this->_database->prepareValue($charset, Column::TYPE_VARCHAR)
);
} | [
"public",
"function",
"setCharset",
"(",
"$",
"charset",
")",
"{",
"$",
"this",
"->",
"_database",
"->",
"exec",
"(",
"'ALTER TABLE '",
".",
"$",
"this",
"->",
"_database",
"->",
"prepareIdentifier",
"(",
"$",
"this",
"->",
"_name",
")",
".",
"' CONVERT TO... | Set character set and convert data to new character set
@param string $charset Character set known to MySQL server
@return void | [
"Set",
"character",
"set",
"and",
"convert",
"data",
"to",
"new",
"character",
"set"
] | 4ead798354089fd360f917ce64dd1432d5650df0 | https://github.com/hschletz/NADA/blob/4ead798354089fd360f917ce64dd1432d5650df0/src/Table/Mysql.php#L142-L150 | train |
hschletz/NADA | src/Table/Mysql.php | Mysql.getEngine | public function getEngine()
{
if (!$this->_engine) {
$table = $this->_database->query('SHOW TABLE STATUS LIKE ?', $this->_name);
$this->_engine = $table[0]['engine'];
}
return $this->_engine;
} | php | public function getEngine()
{
if (!$this->_engine) {
$table = $this->_database->query('SHOW TABLE STATUS LIKE ?', $this->_name);
$this->_engine = $table[0]['engine'];
}
return $this->_engine;
} | [
"public",
"function",
"getEngine",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_engine",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"_database",
"->",
"query",
"(",
"'SHOW TABLE STATUS LIKE ?'",
",",
"$",
"this",
"->",
"_name",
")",
";",
... | Retrieve table engine
@return string | [
"Retrieve",
"table",
"engine"
] | 4ead798354089fd360f917ce64dd1432d5650df0 | https://github.com/hschletz/NADA/blob/4ead798354089fd360f917ce64dd1432d5650df0/src/Table/Mysql.php#L157-L164 | train |
hschletz/NADA | src/Table/Mysql.php | Mysql.setEngine | public function setEngine($engine)
{
$this->_database->exec(
'ALTER TABLE ' .
$this->_database->prepareIdentifier($this->_name) .
' ENGINE = ' .
$this->_database->prepareValue($engine, Column::TYPE_VARCHAR)
);
// MySQL ignores invalid engine na... | php | public function setEngine($engine)
{
$this->_database->exec(
'ALTER TABLE ' .
$this->_database->prepareIdentifier($this->_name) .
' ENGINE = ' .
$this->_database->prepareValue($engine, Column::TYPE_VARCHAR)
);
// MySQL ignores invalid engine na... | [
"public",
"function",
"setEngine",
"(",
"$",
"engine",
")",
"{",
"$",
"this",
"->",
"_database",
"->",
"exec",
"(",
"'ALTER TABLE '",
".",
"$",
"this",
"->",
"_database",
"->",
"prepareIdentifier",
"(",
"$",
"this",
"->",
"_name",
")",
".",
"' ENGINE = '",... | Set table engine
@param string $engine New table engine (MyISAM, InnoDB etc.)
@throws \RuntimeException if $engine is not recognized by the server | [
"Set",
"table",
"engine"
] | 4ead798354089fd360f917ce64dd1432d5650df0 | https://github.com/hschletz/NADA/blob/4ead798354089fd360f917ce64dd1432d5650df0/src/Table/Mysql.php#L171-L184 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.unload | protected function unload()
{
foreach ($this->ial as $entry) {
if (isset($entry['TIMER'])) {
$this->removeTimer($entry['TIMER']);
}
}
} | php | protected function unload()
{
foreach ($this->ial as $entry) {
if (isset($entry['TIMER'])) {
$this->removeTimer($entry['TIMER']);
}
}
} | [
"protected",
"function",
"unload",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"ial",
"as",
"$",
"entry",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"entry",
"[",
"'TIMER'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"removeTimer",
"(",
"$",
"entr... | Frees the resources associated with this module. | [
"Frees",
"the",
"resources",
"associated",
"with",
"this",
"module",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L173-L180 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.updateUser | protected function updateUser($nick, $ident, $host)
{
$collator = $this->connection->getCollator();
$normNick = $collator->normalizeNick($nick);
$key = array_search($normNick, $this->nicks);
if ($key === false) {
$key = $this->sequence++;
$this->nic... | php | protected function updateUser($nick, $ident, $host)
{
$collator = $this->connection->getCollator();
$normNick = $collator->normalizeNick($nick);
$key = array_search($normNick, $this->nicks);
if ($key === false) {
$key = $this->sequence++;
$this->nic... | [
"protected",
"function",
"updateUser",
"(",
"$",
"nick",
",",
"$",
"ident",
",",
"$",
"host",
")",
"{",
"$",
"collator",
"=",
"$",
"this",
"->",
"connection",
"->",
"getCollator",
"(",
")",
";",
"$",
"normNick",
"=",
"$",
"collator",
"->",
"normalizeNi... | Updates the IAL with new information on some user.
\param string $nick
Some user's nickname whose IAL entry will
be updated.
\param string $ident
Some user's identity, in the IRC sense of the term.
\param string $host
Some user's hostname. | [
"Updates",
"the",
"IAL",
"with",
"new",
"information",
"on",
"some",
"user",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L250-L292 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.realRemoveUser | protected function realRemoveUser($nick)
{
$collator = $this->connection->getCollator();
$nick = $collator->normalizeNick($nick);
$key = array_search($nick, $this->nicks);
if ($key === false) {
return;
}
$this->ial[$key]['TIMER'] = null;
... | php | protected function realRemoveUser($nick)
{
$collator = $this->connection->getCollator();
$nick = $collator->normalizeNick($nick);
$key = array_search($nick, $this->nicks);
if ($key === false) {
return;
}
$this->ial[$key]['TIMER'] = null;
... | [
"protected",
"function",
"realRemoveUser",
"(",
"$",
"nick",
")",
"{",
"$",
"collator",
"=",
"$",
"this",
"->",
"connection",
"->",
"getCollator",
"(",
")",
";",
"$",
"nick",
"=",
"$",
"collator",
"->",
"normalizeNick",
"(",
"$",
"nick",
")",
";",
"$",... | Removes some user from the IAL.
\param string $nick
Nickname of the user that is to be removed
from the IAL. | [
"Removes",
"some",
"user",
"from",
"the",
"IAL",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L301-L318 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.handleNick | public function handleNick(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Nick $event
) {
$oldNick = (string) $event->getSource();
$newNick = (string) $event->getTarget();
$collator = $this->connection->getCollator();
$normOldNick ... | php | public function handleNick(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Nick $event
) {
$oldNick = (string) $event->getSource();
$newNick = (string) $event->getTarget();
$collator = $this->connection->getCollator();
$normOldNick ... | [
"public",
"function",
"handleNick",
"(",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"EventHandler",
"$",
"handler",
",",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"Event",
"\\",
"Nick",
"$",
"event",
")",
"{",
"$",
"oldNick",
"=",
"(",
"string",
")",
"$",... | Handles a nick change.
\param Erebot::Interfaces::EventHandler $handler
Handler that triggered this event.
\param Erebot::Interfaces::Event::Nick $event
Nick change event.
@SuppressWarnings(PHPMD.UnusedFormalParameter) | [
"Handles",
"a",
"nick",
"change",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L378-L396 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.handleLeaving | public function handleLeaving(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Base\Generic $event
) {
if ($event instanceof \Erebot\Interfaces\Event\Kick) {
$nick = (string) $event->getTarget();
} else {
$nick = (string) $event->g... | php | public function handleLeaving(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Base\Generic $event
) {
if ($event instanceof \Erebot\Interfaces\Event\Kick) {
$nick = (string) $event->getTarget();
} else {
$nick = (string) $event->g... | [
"public",
"function",
"handleLeaving",
"(",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"EventHandler",
"$",
"handler",
",",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"Event",
"\\",
"Base",
"\\",
"Generic",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
... | Handles some user leaving an IRC channel.
This may result from either a QUIT or KICK command.
\param Erebot::Interfaces::EventHandler $handler
Handler that triggered this event.
\param Erebot::Interfaces::Event::Base::Generic $event
An event indicating that some user is leaving
an IRC channel the bot is on.
@Suppres... | [
"Handles",
"some",
"user",
"leaving",
"an",
"IRC",
"channel",
".",
"This",
"may",
"result",
"from",
"either",
"a",
"QUIT",
"or",
"KICK",
"command",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L411-L455 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.handleCapabilities | public function handleCapabilities(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Event\ServerCapabilities $event
) {
$module = $event->getModule();
if ($module->hasExtendedNames()) {
$this->sendCommand('PROTOCTL NAMESX');
}
if ($module->hasUser... | php | public function handleCapabilities(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Event\ServerCapabilities $event
) {
$module = $event->getModule();
if ($module->hasExtendedNames()) {
$this->sendCommand('PROTOCTL NAMESX');
}
if ($module->hasUser... | [
"public",
"function",
"handleCapabilities",
"(",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"EventHandler",
"$",
"handler",
",",
"\\",
"Erebot",
"\\",
"Event",
"\\",
"ServerCapabilities",
"$",
"event",
")",
"{",
"$",
"module",
"=",
"$",
"event",
"->",
"getMod... | Handles server capabilities.
\param Erebot::Interfaces::EventHandler $handler
Handler that triggered this event.
\param Erebot::Event::ServerCapabilities $event
An event referencing a module that can determine
the IRC server's capabilities, such as
Erebot::Module::ServerCapabilities.
@SuppressWarnings(PHPMD.UnusedFo... | [
"Handles",
"server",
"capabilities",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L470-L482 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.handleNames | public function handleNames(
\Erebot\Interfaces\NumericHandler $handler,
\Erebot\Interfaces\Event\Numeric $numeric
) {
$text = $numeric->getText();
$chan = $text[1];
$users = new \Erebot\TextWrapper(
ltrim($numeric->getText()->getTokens(2), ':')
... | php | public function handleNames(
\Erebot\Interfaces\NumericHandler $handler,
\Erebot\Interfaces\Event\Numeric $numeric
) {
$text = $numeric->getText();
$chan = $text[1];
$users = new \Erebot\TextWrapper(
ltrim($numeric->getText()->getTokens(2), ':')
... | [
"public",
"function",
"handleNames",
"(",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"NumericHandler",
"$",
"handler",
",",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"Event",
"\\",
"Numeric",
"$",
"numeric",
")",
"{",
"$",
"text",
"=",
"$",
"numeric",
"->",... | Handles a list with the nicknames
of all users in a given IRC channel.
\param Erebot::Interfaces::NumericHandler $handler
Handler that triggered this event.
\param Erebot::Interfaces::Event::Numeric $numeric
A numeric event with the nicknames of users
in an IRC channel the bot just joined.
This is the same type of nu... | [
"Handles",
"a",
"list",
"with",
"the",
"nicknames",
"of",
"all",
"users",
"in",
"a",
"given",
"IRC",
"channel",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L499-L550 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.handleWho | public function handleWho(
\Erebot\Interfaces\NumericHandler $handler,
\Erebot\Interfaces\Event\Numeric $numeric
) {
$text = $numeric->getText();
$this->updateUser($text[4], $text[1], $text[2]);
} | php | public function handleWho(
\Erebot\Interfaces\NumericHandler $handler,
\Erebot\Interfaces\Event\Numeric $numeric
) {
$text = $numeric->getText();
$this->updateUser($text[4], $text[1], $text[2]);
} | [
"public",
"function",
"handleWho",
"(",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"NumericHandler",
"$",
"handler",
",",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"Event",
"\\",
"Numeric",
"$",
"numeric",
")",
"{",
"$",
"text",
"=",
"$",
"numeric",
"->",
... | Handles information about some user.
\param Erebot::Interfaces::NumericHandler $handler
Handler that triggered this event.
\param Erebot::Interfaces::Event::Numeric $numeric
Numeric event containing some user's nickname,
IRC identity and hostname.
@SuppressWarnings(PHPMD.UnusedFormalParameter) | [
"Handles",
"information",
"about",
"some",
"user",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L564-L570 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.handleJoin | public function handleJoin(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Join $event
) {
$user = $event->getSource();
$nick = $user->getNick();
$collator = $this->connection->getCollator();
$normNick = $collator->normalizeNick($... | php | public function handleJoin(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Join $event
) {
$user = $event->getSource();
$nick = $user->getNick();
$collator = $this->connection->getCollator();
$normNick = $collator->normalizeNick($... | [
"public",
"function",
"handleJoin",
"(",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"EventHandler",
"$",
"handler",
",",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"Event",
"\\",
"Join",
"$",
"event",
")",
"{",
"$",
"user",
"=",
"$",
"event",
"->",
"getSou... | Handles some user joining an IRC channel
the bot is currently on.
\param Erebot::Interfaces::EventHandler $handler
Handler that triggered this event.
\param Erebot::Interfaces::Event::Join $event
Event indicating that some user joined
a channel the bot is on.
@SuppressWarnings(PHPMD.UnusedFormalParameter) | [
"Handles",
"some",
"user",
"joining",
"an",
"IRC",
"channel",
"the",
"bot",
"is",
"currently",
"on",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L585-L601 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.handleChanModeAddition | public function handleChanModeAddition(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Base\ChanModeGiven $event
) {
$user = $event->getTarget();
$nick = self::extractNick($user);
$collator = $this->connection->getCollator();
... | php | public function handleChanModeAddition(
\Erebot\Interfaces\EventHandler $handler,
\Erebot\Interfaces\Event\Base\ChanModeGiven $event
) {
$user = $event->getTarget();
$nick = self::extractNick($user);
$collator = $this->connection->getCollator();
... | [
"public",
"function",
"handleChanModeAddition",
"(",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"EventHandler",
"$",
"handler",
",",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"Event",
"\\",
"Base",
"\\",
"ChanModeGiven",
"$",
"event",
")",
"{",
"$",
"user",
"... | Handles someone receiving a new status on an IRC channel,
for example, when someone is OPped.
\param Erebot::Interfaces::EventHandler $handler
Handler that triggered this event.
\param Erebot::Interfaces::Event::Base::ChanModeGiven $event
Event indicating someone's status changed
on an IRC channel the bot is currentl... | [
"Handles",
"someone",
"receiving",
"a",
"new",
"status",
"on",
"an",
"IRC",
"channel",
"for",
"example",
"when",
"someone",
"is",
"OPped",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L617-L632 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.startTracking | public function startTracking($nick, $cls = '\\Erebot\\Module\\IrcTracker\\Token')
{
$identityCls = $this->getFactory('!Identity');
$fmt = $this->getFormatter(null);
if ($nick instanceof \Erebot\Interfaces\Identity) {
$identity = $nick;
} else {
if (!is_string... | php | public function startTracking($nick, $cls = '\\Erebot\\Module\\IrcTracker\\Token')
{
$identityCls = $this->getFactory('!Identity');
$fmt = $this->getFormatter(null);
if ($nick instanceof \Erebot\Interfaces\Identity) {
$identity = $nick;
} else {
if (!is_string... | [
"public",
"function",
"startTracking",
"(",
"$",
"nick",
",",
"$",
"cls",
"=",
"'\\\\Erebot\\\\Module\\\\IrcTracker\\\\Token'",
")",
"{",
"$",
"identityCls",
"=",
"$",
"this",
"->",
"getFactory",
"(",
"'!Identity'",
")",
";",
"$",
"fmt",
"=",
"$",
"this",
"-... | Returns a tracking token for some user.
\param string $nick
The nickname of some user we want to start tracking.
\param string $cls
(optional) Class to use to create the token.
Defaults to Erebot::Module::IrcTracker::Token.
\retval mixed
A token that can later be used to return information
on that user (such as his/... | [
"Returns",
"a",
"tracking",
"token",
"for",
"some",
"user",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L695-L718 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.getInfo | public function getInfo($token, $info, $args = array())
{
if ($token instanceof \Erebot\Module\IrcTracker\Token) {
$methods = array(
self::INFO_ISON => 'isOn',
self::INFO_MASK => 'getMask',
self::INFO_NICK => 'getNick',
... | php | public function getInfo($token, $info, $args = array())
{
if ($token instanceof \Erebot\Module\IrcTracker\Token) {
$methods = array(
self::INFO_ISON => 'isOn',
self::INFO_MASK => 'getMask',
self::INFO_NICK => 'getNick',
... | [
"public",
"function",
"getInfo",
"(",
"$",
"token",
",",
"$",
"info",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"token",
"instanceof",
"\\",
"Erebot",
"\\",
"Module",
"\\",
"IrcTracker",
"\\",
"Token",
")",
"{",
"$",
"meth... | Returns information about some user given a token
associated with that user.
\param opaque $token
Token associated with the user.
\param opaque $info
The type of information we're interested in.
This is one of the INFO_* constants provided
by this class.
\param array $args
(optional) Additional arguments for the que... | [
"Returns",
"information",
"about",
"some",
"user",
"given",
"a",
"token",
"associated",
"with",
"that",
"user",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L761-L812 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.isOn | public function isOn($chan, $nick = null)
{
if ($nick === null) {
return isset($this->chans[$chan]);
}
$nick = self::extractNick($nick);
$collator = $this->connection->getCollator();
$nick = $collator->normalizeNick($nick);
$key = arr... | php | public function isOn($chan, $nick = null)
{
if ($nick === null) {
return isset($this->chans[$chan]);
}
$nick = self::extractNick($nick);
$collator = $this->connection->getCollator();
$nick = $collator->normalizeNick($nick);
$key = arr... | [
"public",
"function",
"isOn",
"(",
"$",
"chan",
",",
"$",
"nick",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"nick",
"===",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"chans",
"[",
"$",
"chan",
"]",
")",
";",
"}",
"$",
"nick",
"... | Indicates whether some user is present
on a given IRC channel.
\param string $chan
IRC channel that user must be on.
\param mixed $nick
(optional) Either some user's nickname
(a string) or \b null. Defaults to \b null.
When this parameter is \b null, this method
tests whether the bot is on the given
IRC channel or no... | [
"Indicates",
"whether",
"some",
"user",
"is",
"present",
"on",
"a",
"given",
"IRC",
"channel",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L832-L846 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.getCommonChans | public function getCommonChans($nick)
{
$nick = self::extractNick($nick);
$collator = $this->connection->getCollator();
$nick = $collator->normalizeNick($nick);
$key = array_search($nick, $this->nicks);
if ($key === false) {
throw new \Erebot\... | php | public function getCommonChans($nick)
{
$nick = self::extractNick($nick);
$collator = $this->connection->getCollator();
$nick = $collator->normalizeNick($nick);
$key = array_search($nick, $this->nicks);
if ($key === false) {
throw new \Erebot\... | [
"public",
"function",
"getCommonChans",
"(",
"$",
"nick",
")",
"{",
"$",
"nick",
"=",
"self",
"::",
"extractNick",
"(",
"$",
"nick",
")",
";",
"$",
"collator",
"=",
"$",
"this",
"->",
"connection",
"->",
"getCollator",
"(",
")",
";",
"$",
"nick",
"="... | Returns a list of IRC channels the bot and some
other user have in common.
\param string $nick
Nickname of the user for which we want to know
what channels (s)he shares with the bot.
\retval list
A list with the names of all IRC channels
that user and the bot have in common.
\throw Erebot::NotFoundException
The give... | [
"Returns",
"a",
"list",
"of",
"IRC",
"channels",
"the",
"bot",
"and",
"some",
"other",
"user",
"have",
"in",
"common",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L863-L880 | train |
Erebot/Module_IrcTracker | src/IrcTracker.php | IrcTracker.userPrivileges | public function userPrivileges($chan, $nick)
{
if (!isset($this->chans[$chan][$nick])) {
throw new \Erebot\NotFoundException('No such channel or user');
}
return $this->chans[$chan][$nick];
} | php | public function userPrivileges($chan, $nick)
{
if (!isset($this->chans[$chan][$nick])) {
throw new \Erebot\NotFoundException('No such channel or user');
}
return $this->chans[$chan][$nick];
} | [
"public",
"function",
"userPrivileges",
"(",
"$",
"chan",
",",
"$",
"nick",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"chans",
"[",
"$",
"chan",
"]",
"[",
"$",
"nick",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"... | Returns channel status associated
with the given user.
\param string $chan
The IRC channel we're interested in.
\param string $nick
Nickname of the user whose status on
the given channel we're interested in.
\retval list
A list with the status/privileges
for that user on the given channel.
Each status is given by th... | [
"Returns",
"channel",
"status",
"associated",
"with",
"the",
"given",
"user",
"."
] | 50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d | https://github.com/Erebot/Module_IrcTracker/blob/50eaf5d3e35cf4bb31259819cd3d4fba3279bc5d/src/IrcTracker.php#L974-L980 | train |
andres-montanez/FragmentCacheBundle | EventListener/FragmentCacheListener.php | FragmentCacheListener.onKernelController | public function onKernelController(FilterControllerEvent $event)
{
if (!is_array($controller = $event->getController())) {
return;
}
// Only for SubRequests
$subRequest = $event->getRequest();
if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {... | php | public function onKernelController(FilterControllerEvent $event)
{
if (!is_array($controller = $event->getController())) {
return;
}
// Only for SubRequests
$subRequest = $event->getRequest();
if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {... | [
"public",
"function",
"onKernelController",
"(",
"FilterControllerEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"controller",
"=",
"$",
"event",
"->",
"getController",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"// Only for SubReque... | Listener for the Controller call
@param \Symfony\Component\HttpKernel\Event\FilterControllerEvent $event
@return void | [
"Listener",
"for",
"the",
"Controller",
"call"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/EventListener/FragmentCacheListener.php#L99-L147 | train |
andres-montanez/FragmentCacheBundle | EventListener/FragmentCacheListener.php | FragmentCacheListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
// Only for Sub Requests
$subRequest = $event->getRequest();
if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {
return;
}
// Check if Annotation is present
if (!$configurat... | php | public function onKernelResponse(FilterResponseEvent $event)
{
// Only for Sub Requests
$subRequest = $event->getRequest();
if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {
return;
}
// Check if Annotation is present
if (!$configurat... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"// Only for Sub Requests",
"$",
"subRequest",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"$",
"event",
"->",
"getRequestType",
"(",
")",
"==",
... | Listener for the Response call
@param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event
@return void | [
"Listener",
"for",
"the",
"Response",
"call"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/EventListener/FragmentCacheListener.php#L155-L207 | train |
andres-montanez/FragmentCacheBundle | EventListener/FragmentCacheListener.php | FragmentCacheListener.getKey | protected function getKey(FragmentCache $configuration, Request $subRequest, Request $masterRequest)
{
$event = new KeyGenerationEvent($configuration, $subRequest, $masterRequest);
$keyRequest = sha1($subRequest->getRequestUri())
. ':'
. sha1($masterRequest->getRequestUri())... | php | protected function getKey(FragmentCache $configuration, Request $subRequest, Request $masterRequest)
{
$event = new KeyGenerationEvent($configuration, $subRequest, $masterRequest);
$keyRequest = sha1($subRequest->getRequestUri())
. ':'
. sha1($masterRequest->getRequestUri())... | [
"protected",
"function",
"getKey",
"(",
"FragmentCache",
"$",
"configuration",
",",
"Request",
"$",
"subRequest",
",",
"Request",
"$",
"masterRequest",
")",
"{",
"$",
"event",
"=",
"new",
"KeyGenerationEvent",
"(",
"$",
"configuration",
",",
"$",
"subRequest",
... | Calculates the cache Key of the Fragment
@param \AndresMontanez\FragmentCacheBundle\Library\Configuration\FragmentCache $configuration
@param \Symfony\Component\HttpFoundation\Request $subRequest
@param \Symfony\Component\HttpFoundation\Request $masterRequest
@return string | [
"Calculates",
"the",
"cache",
"Key",
"of",
"the",
"Fragment"
] | 90f9511e275fd78990f6b90cd52052078c53253a | https://github.com/andres-montanez/FragmentCacheBundle/blob/90f9511e275fd78990f6b90cd52052078c53253a/EventListener/FragmentCacheListener.php#L217-L239 | train |
realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Authentication.php | Authentication.setAuthMode | public function setAuthMode($mode)
{
if (!class_exists($mode)) {
throw new \Exception(sprintf(
"Class %s doesn't exists",
$mode
));
}
$this->authMode = $mode;
$authClass = is_string($mode) ? new $mode() : $mode;
if (!$... | php | public function setAuthMode($mode)
{
if (!class_exists($mode)) {
throw new \Exception(sprintf(
"Class %s doesn't exists",
$mode
));
}
$this->authMode = $mode;
$authClass = is_string($mode) ? new $mode() : $mode;
if (!$... | [
"public",
"function",
"setAuthMode",
"(",
"$",
"mode",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"mode",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"sprintf",
"(",
"\"Class %s doesn't exists\"",
",",
"$",
"mode",
")",
")",
";",
"}... | Set Authentication Mode.
@param string $mode | [
"Set",
"Authentication",
"Mode",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Authentication.php#L45-L71 | train |
realboard/DBInstance | src/Realboard/Component/Database/DBInstance/Authentication.php | Authentication.setAuthDir | public function setAuthDir($dir)
{
if (!file_exists($dir)) {
throw new \Exception('Auth directory is not exists!');
}
if (!is_dir($dir)) {
throw new \Exception('Auth directory is not exists!');
}
if ($this->security && $this->security->getKey()) {
... | php | public function setAuthDir($dir)
{
if (!file_exists($dir)) {
throw new \Exception('Auth directory is not exists!');
}
if (!is_dir($dir)) {
throw new \Exception('Auth directory is not exists!');
}
if ($this->security && $this->security->getKey()) {
... | [
"public",
"function",
"setAuthDir",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"dir",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Auth directory is not exists!'",
")",
";",
"}",
"if",
"(",
"!",
"is_dir",
"(",
"$",
... | Set Authencation Directory.
@param string $dir Directory | [
"Set",
"Authencation",
"Directory",
"."
] | f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35 | https://github.com/realboard/DBInstance/blob/f2cde7fdf480d5eb5a491a5cf81ff7f4b3be0a35/src/Realboard/Component/Database/DBInstance/Authentication.php#L88-L104 | train |
kaiohken1982/Neobazaar | src/Neobazaar/Controller/IndexController.php | IndexController.breadcrumbsAction | public function breadcrumbsAction()
{
$default = 'dashboard';
$id = $this->getRequest()->getQuery('id', $default);
$pos = strpos($id, '/');
$id = false !== $pos ? substr($id, 0, $pos) : $id;
$view = $this->getServiceLocator()->get('Zend\View\Renderer\PhpRenderer');
$navigation = $v... | php | public function breadcrumbsAction()
{
$default = 'dashboard';
$id = $this->getRequest()->getQuery('id', $default);
$pos = strpos($id, '/');
$id = false !== $pos ? substr($id, 0, $pos) : $id;
$view = $this->getServiceLocator()->get('Zend\View\Renderer\PhpRenderer');
$navigation = $v... | [
"public",
"function",
"breadcrumbsAction",
"(",
")",
"{",
"$",
"default",
"=",
"'dashboard'",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getQuery",
"(",
"'id'",
",",
"$",
"default",
")",
";",
"$",
"pos",
"=",
"strpos",
"("... | Web service per la restituzione di un breadcrumbs in base ad un id
@return ViewModel | [
"Web",
"service",
"per",
"la",
"restituzione",
"di",
"un",
"breadcrumbs",
"in",
"base",
"ad",
"un",
"id"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Controller/IndexController.php#L36-L56 | train |
kaiohken1982/Neobazaar | src/Neobazaar/Controller/IndexController.php | IndexController.categoriesAction | public function categoriesAction()
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$categories = $main->getDocumentEntityRepository()
->getCategoryMultioptionsNoSlug($this->getServiceLocator());
return new JsonModel(array('data' => $categories));
} | php | public function categoriesAction()
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$categories = $main->getDocumentEntityRepository()
->getCategoryMultioptionsNoSlug($this->getServiceLocator());
return new JsonModel(array('data' => $categories));
} | [
"public",
"function",
"categoriesAction",
"(",
")",
"{",
"$",
"main",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'neobazaar.service.main'",
")",
";",
"$",
"categories",
"=",
"$",
"main",
"->",
"getDocumentEntityRepository",
"(",
... | Web service per la restituzione delle categorie
@return JsonModel | [
"Web",
"service",
"per",
"la",
"restituzione",
"delle",
"categorie"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Controller/IndexController.php#L63-L70 | train |
kaiohken1982/Neobazaar | src/Neobazaar/Controller/IndexController.php | IndexController.locationsAction | public function locationsAction()
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$locations = $main->getGeonamesEntityRepository()
->getLocationMultioptions($this->getServiceLocator());
return new JsonModel(array('data' => $locations));
} | php | public function locationsAction()
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$locations = $main->getGeonamesEntityRepository()
->getLocationMultioptions($this->getServiceLocator());
return new JsonModel(array('data' => $locations));
} | [
"public",
"function",
"locationsAction",
"(",
")",
"{",
"$",
"main",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'neobazaar.service.main'",
")",
";",
"$",
"locations",
"=",
"$",
"main",
"->",
"getGeonamesEntityRepository",
"(",
... | Web service per la restituzione delle locations
@return JsonModel | [
"Web",
"service",
"per",
"la",
"restituzione",
"delle",
"locations"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Controller/IndexController.php#L77-L84 | train |
kaiohken1982/Neobazaar | src/Neobazaar/Controller/IndexController.php | IndexController.activationEmailResendAction | public function activationEmailResendAction()
{
$classifiedService = $this->getServiceLocator()->get('document.service.classified');
try {
$ids = $classifiedService->activationEmailResend(1);
$data = array(
'status' => 'success',
'message' => implode(", ", $ids)
);
} catch(\Exception $e) ... | php | public function activationEmailResendAction()
{
$classifiedService = $this->getServiceLocator()->get('document.service.classified');
try {
$ids = $classifiedService->activationEmailResend(1);
$data = array(
'status' => 'success',
'message' => implode(", ", $ids)
);
} catch(\Exception $e) ... | [
"public",
"function",
"activationEmailResendAction",
"(",
")",
"{",
"$",
"classifiedService",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'document.service.classified'",
")",
";",
"try",
"{",
"$",
"ids",
"=",
"$",
"classifiedService... | This is needed because of mailserver goes down.
Will resend activation email to those classifieds where date_insert = date_edit and state = 2.
Dispatch a classified created event with data | [
"This",
"is",
"needed",
"because",
"of",
"mailserver",
"goes",
"down",
".",
"Will",
"resend",
"activation",
"email",
"to",
"those",
"classifieds",
"where",
"date_insert",
"=",
"date_edit",
"and",
"state",
"=",
"2",
".",
"Dispatch",
"a",
"classified",
"created"... | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Controller/IndexController.php#L124-L144 | train |
cubicmushroom/valueobjects | src/Number/Real.php | Real.sameValueAs | public function sameValueAs(ValueObjectInterface $real)
{
if (false === Util::classEquals($this, $real)) {
return false;
}
return $this->toNative() === $real->toNative();
} | php | public function sameValueAs(ValueObjectInterface $real)
{
if (false === Util::classEquals($this, $real)) {
return false;
}
return $this->toNative() === $real->toNative();
} | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"real",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"real",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->"... | Tells whether two Real are equal by comparing their values
@param ValueObjectInterface $real
@return bool | [
"Tells",
"whether",
"two",
"Real",
"are",
"equal",
"by",
"comparing",
"their",
"values"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Number/Real.php#L58-L65 | train |
cubicmushroom/valueobjects | src/Number/Real.php | Real.toInteger | public function toInteger(RoundingMode $rounding_mode = null)
{
if (null === $rounding_mode) {
$rounding_mode = RoundingMode::HALF_UP();
}
$value = $this->toNative();
$integerValue = \round($value, 0, $rounding_mode->toNative());
$integer = new Intege... | php | public function toInteger(RoundingMode $rounding_mode = null)
{
if (null === $rounding_mode) {
$rounding_mode = RoundingMode::HALF_UP();
}
$value = $this->toNative();
$integerValue = \round($value, 0, $rounding_mode->toNative());
$integer = new Intege... | [
"public",
"function",
"toInteger",
"(",
"RoundingMode",
"$",
"rounding_mode",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"rounding_mode",
")",
"{",
"$",
"rounding_mode",
"=",
"RoundingMode",
"::",
"HALF_UP",
"(",
")",
";",
"}",
"$",
"value",
"... | Returns the integer part of the Real number as a Integer
@param RoundingMode $rounding_mode Rounding mode of the conversion. Defaults to RoundingMode::HALF_UP.
@return Integer | [
"Returns",
"the",
"integer",
"part",
"of",
"the",
"Real",
"number",
"as",
"a",
"Integer"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Number/Real.php#L73-L84 | train |
cubicmushroom/valueobjects | src/Number/Real.php | Real.toNatural | public function toNatural(RoundingMode $rounding_mode = null)
{
$integerValue = $this->toInteger($rounding_mode)->toNative();
$naturalValue = \abs($integerValue);
$natural = new Natural($naturalValue);
return $natural;
} | php | public function toNatural(RoundingMode $rounding_mode = null)
{
$integerValue = $this->toInteger($rounding_mode)->toNative();
$naturalValue = \abs($integerValue);
$natural = new Natural($naturalValue);
return $natural;
} | [
"public",
"function",
"toNatural",
"(",
"RoundingMode",
"$",
"rounding_mode",
"=",
"null",
")",
"{",
"$",
"integerValue",
"=",
"$",
"this",
"->",
"toInteger",
"(",
"$",
"rounding_mode",
")",
"->",
"toNative",
"(",
")",
";",
"$",
"naturalValue",
"=",
"\\",
... | Returns the absolute integer part of the Real number as a Natural
@param RoundingMode $rounding_mode Rounding mode of the conversion. Defaults to RoundingMode::HALF_UP.
@return Natural | [
"Returns",
"the",
"absolute",
"integer",
"part",
"of",
"the",
"Real",
"number",
"as",
"a",
"Natural"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Number/Real.php#L92-L99 | train |
NukaCode/core | src/NukaCode/Core/View/ViewBuilder.php | ViewBuilder.missingMethod | public function missingMethod($parameters)
{
if (! app()->runningInConsole()) {
$this->viewPath->missingMethod($this->layout->layout, $parameters);
}
return $this;
} | php | public function missingMethod($parameters)
{
if (! app()->runningInConsole()) {
$this->viewPath->missingMethod($this->layout->layout, $parameters);
}
return $this;
} | [
"public",
"function",
"missingMethod",
"(",
"$",
"parameters",
")",
"{",
"if",
"(",
"!",
"app",
"(",
")",
"->",
"runningInConsole",
"(",
")",
")",
"{",
"$",
"this",
"->",
"viewPath",
"->",
"missingMethod",
"(",
"$",
"this",
"->",
"layout",
"->",
"layou... | If a method is not defined, try to find it's view.
@param array $parameters
@return $this | [
"If",
"a",
"method",
"is",
"not",
"defined",
"try",
"to",
"find",
"it",
"s",
"view",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/ViewBuilder.php#L74-L81 | train |
NukaCode/core | src/NukaCode/Core/View/ViewBuilder.php | ViewBuilder.setViewLayout | public function setViewLayout($view)
{
$this->layout = $this->viewLayout->change($view);
$this->layout->layout = $this->viewPath->setUp($this->layout->layout, null);
} | php | public function setViewLayout($view)
{
$this->layout = $this->viewLayout->change($view);
$this->layout->layout = $this->viewPath->setUp($this->layout->layout, null);
} | [
"public",
"function",
"setViewLayout",
"(",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"layout",
"=",
"$",
"this",
"->",
"viewLayout",
"->",
"change",
"(",
"$",
"view",
")",
";",
"$",
"this",
"->",
"layout",
"->",
"layout",
"=",
"$",
"this",
"->",
"... | Set a custom layout for a page.
@param string $view | [
"Set",
"a",
"custom",
"layout",
"for",
"a",
"page",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/ViewBuilder.php#L88-L92 | train |
NukaCode/core | src/NukaCode/Core/View/ViewBuilder.php | ViewBuilder.setViewPath | public function setViewPath($view)
{
$this->layout->layout = $this->viewPath->setUp($this->layout->layout, $view);
return $this;
} | php | public function setViewPath($view)
{
$this->layout->layout = $this->viewPath->setUp($this->layout->layout, $view);
return $this;
} | [
"public",
"function",
"setViewPath",
"(",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"layout",
"->",
"layout",
"=",
"$",
"this",
"->",
"viewPath",
"->",
"setUp",
"(",
"$",
"this",
"->",
"layout",
"->",
"layout",
",",
"$",
"view",
")",
";",
"return",
... | Override the automatically resolved view.
@param string $view
@return $this | [
"Override",
"the",
"automatically",
"resolved",
"view",
"."
] | 75b20903fb068a7df22cdec34ae729279fbaab3c | https://github.com/NukaCode/core/blob/75b20903fb068a7df22cdec34ae729279fbaab3c/src/NukaCode/Core/View/ViewBuilder.php#L101-L106 | train |
Dhii/factory-base | src/FactoryAwareTrait.php | FactoryAwareTrait._setFactory | protected function _setFactory($factory)
{
if ($factory !== null && !($factory instanceof FactoryInterface)) {
throw $this->_createInvalidArgumentException(
$this->__('Argument is not a valid factory instance'),
null,
null,
$factory... | php | protected function _setFactory($factory)
{
if ($factory !== null && !($factory instanceof FactoryInterface)) {
throw $this->_createInvalidArgumentException(
$this->__('Argument is not a valid factory instance'),
null,
null,
$factory... | [
"protected",
"function",
"_setFactory",
"(",
"$",
"factory",
")",
"{",
"if",
"(",
"$",
"factory",
"!==",
"null",
"&&",
"!",
"(",
"$",
"factory",
"instanceof",
"FactoryInterface",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInvalidArgumentException",
"... | Sets the factory for this instance.
@since [*next-version*]
@param FactoryInterface|null $factory The factory instance to set, if any. | [
"Sets",
"the",
"factory",
"for",
"this",
"instance",
"."
] | eb6694178068ec58e0f2de9243f0eb98844511de | https://github.com/Dhii/factory-base/blob/eb6694178068ec58e0f2de9243f0eb98844511de/src/FactoryAwareTrait.php#L44-L55 | train |
railken/lem | src/Repository.php | Repository.findWhereIn | public function findWhereIn(array $parameters)
{
$q = $this->getQuery();
foreach ($parameters as $name => $value) {
$q->whereIn($name, $value);
}
return $q->get();
} | php | public function findWhereIn(array $parameters)
{
$q = $this->getQuery();
foreach ($parameters as $name => $value) {
$q->whereIn($name, $value);
}
return $q->get();
} | [
"public",
"function",
"findWhereIn",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"q",
"->",
"whereI... | Find where in.
@param array $parameters
@return \Illuminate\Support\Collection | [
"Find",
"where",
"in",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Repository.php#L109-L118 | train |
squareproton/Bond | src/Bond/RecordManager/Task/NormalityCollection.php | NormalityCollection.getClassFromCollection | protected static function getClassFromCollection( array $collection )
{
// Make sure everything in this container is of __exactly__ the same type.
// This is a stronger check than the entity container performs (child entities are ok in the container)
$classes = array_unique( array_map( 'get_... | php | protected static function getClassFromCollection( array $collection )
{
// Make sure everything in this container is of __exactly__ the same type.
// This is a stronger check than the entity container performs (child entities are ok in the container)
$classes = array_unique( array_map( 'get_... | [
"protected",
"static",
"function",
"getClassFromCollection",
"(",
"array",
"$",
"collection",
")",
"{",
"// Make sure everything in this container is of __exactly__ the same type.",
"// This is a stronger check than the entity container performs (child entities are ok in the container)",
"$"... | Check a collection only has one class. Determine this and return it.
@param array $collection
@return string | [
"Check",
"a",
"collection",
"only",
"has",
"one",
"class",
".",
"Determine",
"this",
"and",
"return",
"it",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/RecordManager/Task/NormalityCollection.php#L25-L42 | train |
EdwinDayot/shorty-framework | src/Framework/Application.php | Application.addRouteMiddleware | public function addRouteMiddleware(string $name): void
{
if (!array_key_exists($name, $this->getConfigRouteMiddlewares())) {
throw new InvalidArgumentException('The middleware [' . $name . '] does not exists.');
}
$this->routeMiddlewares[] = $this->getConfigRouteMiddlewares()[$n... | php | public function addRouteMiddleware(string $name): void
{
if (!array_key_exists($name, $this->getConfigRouteMiddlewares())) {
throw new InvalidArgumentException('The middleware [' . $name . '] does not exists.');
}
$this->routeMiddlewares[] = $this->getConfigRouteMiddlewares()[$n... | [
"public",
"function",
"addRouteMiddleware",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"getConfigRouteMiddlewares",
"(",
")",
")",
")",
"{",
"throw",
"new",
"InvalidArgum... | Add a route middleware to the list of executed middlewares.
@param string $name | [
"Add",
"a",
"route",
"middleware",
"to",
"the",
"list",
"of",
"executed",
"middlewares",
"."
] | e03c991ea86aedbd87674d1ee2f9041b55b5e578 | https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Application.php#L172-L179 | train |
EdwinDayot/shorty-framework | src/Framework/Application.php | Application.createEnv | private function createEnv(): void
{
if (file_exists(base_dir('.env'))) {
$dotEnv = new Dotenv();
$dotEnv->load(base_dir('.env'));
$this->env = $dotEnv;
}
} | php | private function createEnv(): void
{
if (file_exists(base_dir('.env'))) {
$dotEnv = new Dotenv();
$dotEnv->load(base_dir('.env'));
$this->env = $dotEnv;
}
} | [
"private",
"function",
"createEnv",
"(",
")",
":",
"void",
"{",
"if",
"(",
"file_exists",
"(",
"base_dir",
"(",
"'.env'",
")",
")",
")",
"{",
"$",
"dotEnv",
"=",
"new",
"Dotenv",
"(",
")",
";",
"$",
"dotEnv",
"->",
"load",
"(",
"base_dir",
"(",
"'.... | Create environment. | [
"Create",
"environment",
"."
] | e03c991ea86aedbd87674d1ee2f9041b55b5e578 | https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Application.php#L184-L191 | train |
EdwinDayot/shorty-framework | src/Framework/Application.php | Application.createRequest | private function createRequest(Request $request = null): void
{
if (!$this->request && is_null($request)) {
$request = ServerRequest::fromGlobals()
->withParsedBody(json_decode(file_get_contents('php://input')));
}
$this->container->set(Request::class, $request);... | php | private function createRequest(Request $request = null): void
{
if (!$this->request && is_null($request)) {
$request = ServerRequest::fromGlobals()
->withParsedBody(json_decode(file_get_contents('php://input')));
}
$this->container->set(Request::class, $request);... | [
"private",
"function",
"createRequest",
"(",
"Request",
"$",
"request",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"request",
"&&",
"is_null",
"(",
"$",
"request",
")",
")",
"{",
"$",
"request",
"=",
"ServerRequest",
"::",
... | Create the request object. | [
"Create",
"the",
"request",
"object",
"."
] | e03c991ea86aedbd87674d1ee2f9041b55b5e578 | https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Application.php#L196-L205 | train |
EdwinDayot/shorty-framework | src/Framework/Application.php | Application.registerErrorHandler | private function registerErrorHandler(): void
{
$whoops = new Run();
$whoops->pushHandler(new PrettyPageHandler());
$whoops->register();
$this->errorHandler = $whoops;
} | php | private function registerErrorHandler(): void
{
$whoops = new Run();
$whoops->pushHandler(new PrettyPageHandler());
$whoops->register();
$this->errorHandler = $whoops;
} | [
"private",
"function",
"registerErrorHandler",
"(",
")",
":",
"void",
"{",
"$",
"whoops",
"=",
"new",
"Run",
"(",
")",
";",
"$",
"whoops",
"->",
"pushHandler",
"(",
"new",
"PrettyPageHandler",
"(",
")",
")",
";",
"$",
"whoops",
"->",
"register",
"(",
"... | Register the error handler. | [
"Register",
"the",
"error",
"handler",
"."
] | e03c991ea86aedbd87674d1ee2f9041b55b5e578 | https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Application.php#L233-L240 | train |
EdwinDayot/shorty-framework | src/Framework/Application.php | Application.registerProviders | private function registerProviders(): void
{
$this->providers = array_merge($this->providers, $this->getConfigProviders());
foreach ($this->providers as $provider) {
$provider = $this->container->get($provider);
$provider->boot();
}
} | php | private function registerProviders(): void
{
$this->providers = array_merge($this->providers, $this->getConfigProviders());
foreach ($this->providers as $provider) {
$provider = $this->container->get($provider);
$provider->boot();
}
} | [
"private",
"function",
"registerProviders",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"providers",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"providers",
",",
"$",
"this",
"->",
"getConfigProviders",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"this"... | Registers the providers by booting them. | [
"Registers",
"the",
"providers",
"by",
"booting",
"them",
"."
] | e03c991ea86aedbd87674d1ee2f9041b55b5e578 | https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Application.php#L245-L253 | train |
EdwinDayot/shorty-framework | src/Framework/Application.php | Application.handleRequest | private function handleRequest(array $middlewares): void
{
$requestHandler = new RequestHandler($this->container, $middlewares);
$this->response = $requestHandler->handle($this->request);
} | php | private function handleRequest(array $middlewares): void
{
$requestHandler = new RequestHandler($this->container, $middlewares);
$this->response = $requestHandler->handle($this->request);
} | [
"private",
"function",
"handleRequest",
"(",
"array",
"$",
"middlewares",
")",
":",
"void",
"{",
"$",
"requestHandler",
"=",
"new",
"RequestHandler",
"(",
"$",
"this",
"->",
"container",
",",
"$",
"middlewares",
")",
";",
"$",
"this",
"->",
"response",
"="... | Handles the request and triggers middlewares.
@param array $middlewares | [
"Handles",
"the",
"request",
"and",
"triggers",
"middlewares",
"."
] | e03c991ea86aedbd87674d1ee2f9041b55b5e578 | https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Application.php#L260-L265 | train |
EdwinDayot/shorty-framework | src/Framework/Application.php | Application.prepareResponse | public function prepareResponse()
{
try {
$this->setBaseMiddlewares();
$this->handleRequest($this->middlewares);
$this->router->build();
$this->handleRequest($this->routeMiddlewares);
$this->response = $this->router->run();
} catch (Excepti... | php | public function prepareResponse()
{
try {
$this->setBaseMiddlewares();
$this->handleRequest($this->middlewares);
$this->router->build();
$this->handleRequest($this->routeMiddlewares);
$this->response = $this->router->run();
} catch (Excepti... | [
"public",
"function",
"prepareResponse",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"setBaseMiddlewares",
"(",
")",
";",
"$",
"this",
"->",
"handleRequest",
"(",
"$",
"this",
"->",
"middlewares",
")",
";",
"$",
"this",
"->",
"router",
"->",
"build",
... | Prepare the response object. | [
"Prepare",
"the",
"response",
"object",
"."
] | e03c991ea86aedbd87674d1ee2f9041b55b5e578 | https://github.com/EdwinDayot/shorty-framework/blob/e03c991ea86aedbd87674d1ee2f9041b55b5e578/src/Framework/Application.php#L358-L370 | train |
phpgears/event-async | src/Serializer/JsonEventSerializer.php | JsonEventSerializer.getEventDefinition | private function getEventDefinition(string $serialized): array
{
$definition = $this->getDeserializationDefinition($serialized);
if (!isset($definition['class'], $definition['payload'], $definition['attributes'])
|| \count(\array_diff(\array_keys($definition), ['class', 'payload', 'attr... | php | private function getEventDefinition(string $serialized): array
{
$definition = $this->getDeserializationDefinition($serialized);
if (!isset($definition['class'], $definition['payload'], $definition['attributes'])
|| \count(\array_diff(\array_keys($definition), ['class', 'payload', 'attr... | [
"private",
"function",
"getEventDefinition",
"(",
"string",
"$",
"serialized",
")",
":",
"array",
"{",
"$",
"definition",
"=",
"$",
"this",
"->",
"getDeserializationDefinition",
"(",
"$",
"serialized",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"definition... | Get event definition from serialization.
@param string $serialized
@throws EventSerializationException
@return array<string, mixed> | [
"Get",
"event",
"definition",
"from",
"serialization",
"."
] | e2d72b32e8852ec3926636af1c686a7c582b0bca | https://github.com/phpgears/event-async/blob/e2d72b32e8852ec3926636af1c686a7c582b0bca/src/Serializer/JsonEventSerializer.php#L126-L140 | train |
phpgears/event-async | src/Serializer/JsonEventSerializer.php | JsonEventSerializer.getDeserializationDefinition | private function getDeserializationDefinition(string $serialized): array
{
if (\trim($serialized) === '') {
throw new EventSerializationException('Malformed JSON serialized event: empty string');
}
$definition = \json_decode($serialized, true, 512, static::JSON_DECODE_OPTIONS);
... | php | private function getDeserializationDefinition(string $serialized): array
{
if (\trim($serialized) === '') {
throw new EventSerializationException('Malformed JSON serialized event: empty string');
}
$definition = \json_decode($serialized, true, 512, static::JSON_DECODE_OPTIONS);
... | [
"private",
"function",
"getDeserializationDefinition",
"(",
"string",
"$",
"serialized",
")",
":",
"array",
"{",
"if",
"(",
"\\",
"trim",
"(",
"$",
"serialized",
")",
"===",
"''",
")",
"{",
"throw",
"new",
"EventSerializationException",
"(",
"'Malformed JSON ser... | Get deserialization definition.
@param string $serialized
@return array<string, mixed> | [
"Get",
"deserialization",
"definition",
"."
] | e2d72b32e8852ec3926636af1c686a7c582b0bca | https://github.com/phpgears/event-async/blob/e2d72b32e8852ec3926636af1c686a7c582b0bca/src/Serializer/JsonEventSerializer.php#L149-L168 | train |
itcreator/custom-cmf | Module/Language/src/Cmf/Language/Factory.php | Factory.init | private static function init()
{
if (!self::$defaultLng) {
$config = Application::getConfigManager()->loadForModule('Cmf\Language');
self::$defaultLng = strtolower($config->defaultLanguage);
$currentLng = $config->currentLanguage;
self::$currentLng = $currentL... | php | private static function init()
{
if (!self::$defaultLng) {
$config = Application::getConfigManager()->loadForModule('Cmf\Language');
self::$defaultLng = strtolower($config->defaultLanguage);
$currentLng = $config->currentLanguage;
self::$currentLng = $currentL... | [
"private",
"static",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"defaultLng",
")",
"{",
"$",
"config",
"=",
"Application",
"::",
"getConfigManager",
"(",
")",
"->",
"loadForModule",
"(",
"'Cmf\\Language'",
")",
";",
"self",
"::... | Initialization of language manager
@return void | [
"Initialization",
"of",
"language",
"manager"
] | 42fc0535dfa0f641856f06673f6ab596b2020c40 | https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/Language/src/Cmf/Language/Factory.php#L33-L41 | train |
jyokum/healthgraph | src/HealthGraph/Authorization.php | Authorization.getAuthorizationButton | public static function getAuthorizationButton(
$client_id,
$redirect_url,
$state = '',
$text = 'connect',
$color = 'blue',
$caption = 'white',
$size = 200,
$url = 'https://runkeeper.com/apps/authorize'
) {
$link = self::getAuthorizationLink($cl... | php | public static function getAuthorizationButton(
$client_id,
$redirect_url,
$state = '',
$text = 'connect',
$color = 'blue',
$caption = 'white',
$size = 200,
$url = 'https://runkeeper.com/apps/authorize'
) {
$link = self::getAuthorizationLink($cl... | [
"public",
"static",
"function",
"getAuthorizationButton",
"(",
"$",
"client_id",
",",
"$",
"redirect_url",
",",
"$",
"state",
"=",
"''",
",",
"$",
"text",
"=",
"'connect'",
",",
"$",
"color",
"=",
"'blue'",
",",
"$",
"caption",
"=",
"'white'",
",",
"$",
... | Generates a button for establishing a connection with a RunKeeper account.
@param string $client_id
The unique identifier that your application received upon registration.
@param string $redirect_url
The page on your site where the user will be redirected after accepting
or denying the access request.
@param string $t... | [
"Generates",
"a",
"button",
"for",
"establishing",
"a",
"connection",
"with",
"a",
"RunKeeper",
"account",
"."
] | 6b3b4c4eb797f1fcf056024c8b15a16665bf8758 | https://github.com/jyokum/healthgraph/blob/6b3b4c4eb797f1fcf056024c8b15a16665bf8758/src/HealthGraph/Authorization.php#L27-L61 | train |
jyokum/healthgraph | src/HealthGraph/Authorization.php | Authorization.getAuthorizationLink | public static function getAuthorizationLink(
$client_id,
$redirect_url,
$state = '',
$url = 'https://runkeeper.com/apps/authorize'
) {
$data = array(
'client_id' => $client_id,
'response_type' => 'code',
'redirect_uri' => $redirect_url,
... | php | public static function getAuthorizationLink(
$client_id,
$redirect_url,
$state = '',
$url = 'https://runkeeper.com/apps/authorize'
) {
$data = array(
'client_id' => $client_id,
'response_type' => 'code',
'redirect_uri' => $redirect_url,
... | [
"public",
"static",
"function",
"getAuthorizationLink",
"(",
"$",
"client_id",
",",
"$",
"redirect_url",
",",
"$",
"state",
"=",
"''",
",",
"$",
"url",
"=",
"'https://runkeeper.com/apps/authorize'",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"'client_id'",
"=>"... | Generates a link for establishing a connection with a RunKeeper account.
@param string $client_id
The unique identifier that your application received upon registration.
@param string $redirect_url
The page on your site where the user will be redirected after accepting
or denying the access request.
@param string $url... | [
"Generates",
"a",
"link",
"for",
"establishing",
"a",
"connection",
"with",
"a",
"RunKeeper",
"account",
"."
] | 6b3b4c4eb797f1fcf056024c8b15a16665bf8758 | https://github.com/jyokum/healthgraph/blob/6b3b4c4eb797f1fcf056024c8b15a16665bf8758/src/HealthGraph/Authorization.php#L74-L87 | train |
vperyod/vperyod.session-handler | src/SessionAwareTrait.php | SessionAwareTrait.getSession | protected function getSession(Request $request) : Session\Session
{
$session = $request->getAttribute(SessionHandler::SESSION_ATTRIBUTE);
if (! $session instanceof Session\Session) {
throw new \Exception(
'Session not available in request at: '
. SessionH... | php | protected function getSession(Request $request) : Session\Session
{
$session = $request->getAttribute(SessionHandler::SESSION_ATTRIBUTE);
if (! $session instanceof Session\Session) {
throw new \Exception(
'Session not available in request at: '
. SessionH... | [
"protected",
"function",
"getSession",
"(",
"Request",
"$",
"request",
")",
":",
"Session",
"\\",
"Session",
"{",
"$",
"session",
"=",
"$",
"request",
"->",
"getAttribute",
"(",
"SessionHandler",
"::",
"SESSION_ATTRIBUTE",
")",
";",
"if",
"(",
"!",
"$",
"s... | Get session from request
@param Request $request PSR7 Request
@return Session\Session
@throws Exception if session attribute is invalid
@access protected | [
"Get",
"session",
"from",
"request"
] | 61a607be009296b69bdb328ed3a26940e1b925bb | https://github.com/vperyod/vperyod.session-handler/blob/61a607be009296b69bdb328ed3a26940e1b925bb/src/SessionAwareTrait.php#L50-L61 | train |
itkg/core | src/Itkg/Core/Config.php | Config.load | public function load(array $files = array())
{
$loader = new YamlLoader(new FileLocator, new YamlParser);
foreach ($files as $file) {
$configValues = $loader->load($file);
$configValues = $this->loadImports($loader, $file, $configValues);
$this->params = array_... | php | public function load(array $files = array())
{
$loader = new YamlLoader(new FileLocator, new YamlParser);
foreach ($files as $file) {
$configValues = $loader->load($file);
$configValues = $this->loadImports($loader, $file, $configValues);
$this->params = array_... | [
"public",
"function",
"load",
"(",
"array",
"$",
"files",
"=",
"array",
"(",
")",
")",
"{",
"$",
"loader",
"=",
"new",
"YamlLoader",
"(",
"new",
"FileLocator",
",",
"new",
"YamlParser",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
... | Load config files
@param array $files | [
"Load",
"config",
"files"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Config.php#L45-L56 | train |
itkg/core | src/Itkg/Core/Config.php | Config.get | public function get($key)
{
if ($this->has($key)) {
return $this->params[$key];
}
throw new \InvalidArgumentException(sprintf("Config key %s doest not exist", $key));
} | php | public function get($key)
{
if ($this->has($key)) {
return $this->params[$key];
}
throw new \InvalidArgumentException(sprintf("Config key %s doest not exist", $key));
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"params",
"[",
"$",
"key",
"]",
";",
"}",
"throw",
"new",
"\\",
"InvalidArgumentException",
... | Get a config value for a key
@param $key
@return mixed
@throws \InvalidArgumentException | [
"Get",
"a",
"config",
"value",
"for",
"a",
"key"
] | e5e4efb05feb4d23b0df41f2b21fd095103e593b | https://github.com/itkg/core/blob/e5e4efb05feb4d23b0df41f2b21fd095103e593b/src/Itkg/Core/Config.php#L86-L93 | train |
agentmedia/phine-core | src/Core/Snippets/TreeBranches/Base/ContentBranch.php | ContentBranch.CreateInUrl | final protected function CreateInUrl()
{
$args = $this->EditParams();
$args['parent'] = $this->item->GetID();
return BackendRouter::ModuleUrl(new ModuleForm(), $args);
} | php | final protected function CreateInUrl()
{
$args = $this->EditParams();
$args['parent'] = $this->item->GetID();
return BackendRouter::ModuleUrl(new ModuleForm(), $args);
} | [
"final",
"protected",
"function",
"CreateInUrl",
"(",
")",
"{",
"$",
"args",
"=",
"$",
"this",
"->",
"EditParams",
"(",
")",
";",
"$",
"args",
"[",
"'parent'",
"]",
"=",
"$",
"this",
"->",
"item",
"->",
"GetID",
"(",
")",
";",
"return",
"BackendRoute... | The url for creating content in the current item
@return string | [
"The",
"url",
"for",
"creating",
"content",
"in",
"the",
"current",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/TreeBranches/Base/ContentBranch.php#L119-L124 | train |
agentmedia/phine-core | src/Core/Snippets/TreeBranches/Base/ContentBranch.php | ContentBranch.CanEdit | final protected function CanEdit()
{
$form = $this->module->ContentForm();
return BackendModule::Guard()->Allow(BackendAction::Edit(), $this->content)
&& BackendModule::Guard()->Allow(BackendAction::Read(), $form);
} | php | final protected function CanEdit()
{
$form = $this->module->ContentForm();
return BackendModule::Guard()->Allow(BackendAction::Edit(), $this->content)
&& BackendModule::Guard()->Allow(BackendAction::Read(), $form);
} | [
"final",
"protected",
"function",
"CanEdit",
"(",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"module",
"->",
"ContentForm",
"(",
")",
";",
"return",
"BackendModule",
"::",
"Guard",
"(",
")",
"->",
"Allow",
"(",
"BackendAction",
"::",
"Edit",
"(",
"... | True if the the content can be edited
@return Boolean | [
"True",
"if",
"the",
"the",
"content",
"can",
"be",
"edited"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/TreeBranches/Base/ContentBranch.php#L178-L183 | train |
agentmedia/phine-core | src/Core/Snippets/TreeBranches/Base/ContentBranch.php | ContentBranch.CanCreateIn | final protected function CanCreateIn()
{
return $this->AllowChildren() &&
BackendModule::Guard()->Allow(BackendAction::Create(), $this->content);
} | php | final protected function CanCreateIn()
{
return $this->AllowChildren() &&
BackendModule::Guard()->Allow(BackendAction::Create(), $this->content);
} | [
"final",
"protected",
"function",
"CanCreateIn",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"AllowChildren",
"(",
")",
"&&",
"BackendModule",
"::",
"Guard",
"(",
")",
"->",
"Allow",
"(",
"BackendAction",
"::",
"Create",
"(",
")",
",",
"$",
"this",
"->",... | True if the content can be created in
@return Boolean | [
"True",
"if",
"the",
"content",
"can",
"be",
"created",
"in"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/TreeBranches/Base/ContentBranch.php#L198-L202 | train |
agentmedia/phine-core | src/Core/Snippets/TreeBranches/Base/ContentBranch.php | ContentBranch.CanCreateAfter | final protected function CanCreateAfter()
{
$parentItem = $this->tree->ParentOf($this->item);
if ($parentItem)
{
$parent = $this->tree->ContentByItem($parentItem);
return BackendModule::Guard()->Allow(BackendAction::Create(), $parent);
}
return $this->... | php | final protected function CanCreateAfter()
{
$parentItem = $this->tree->ParentOf($this->item);
if ($parentItem)
{
$parent = $this->tree->ContentByItem($parentItem);
return BackendModule::Guard()->Allow(BackendAction::Create(), $parent);
}
return $this->... | [
"final",
"protected",
"function",
"CanCreateAfter",
"(",
")",
"{",
"$",
"parentItem",
"=",
"$",
"this",
"->",
"tree",
"->",
"ParentOf",
"(",
"$",
"this",
"->",
"item",
")",
";",
"if",
"(",
"$",
"parentItem",
")",
"{",
"$",
"parent",
"=",
"$",
"this",... | True if there can be content created after
@return boolean | [
"True",
"if",
"there",
"can",
"be",
"content",
"created",
"after"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/TreeBranches/Base/ContentBranch.php#L217-L226 | train |
Polosa/shade-framework-core | app/NestedContainer.php | NestedContainer.__isset | public function __isset($name)
{
return isset($this->children[$name]) && !is_null($this->children[$name]->getValue());
} | php | public function __isset($name)
{
return isset($this->children[$name]) && !is_null($this->children[$name]->getValue());
} | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"children",
"[",
"$",
"name",
"]",
")",
"&&",
"!",
"is_null",
"(",
"$",
"this",
"->",
"children",
"[",
"$",
"name",
"]",
"->",
"getValue",
"(",
... | Check if child set
@param string $name Child name
@return bool | [
"Check",
"if",
"child",
"set"
] | d735d3e8e0616fb9cf4ffc25b8425762ed07940f | https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/NestedContainer.php#L118-L121 | train |
Polosa/shade-framework-core | app/NestedContainer.php | NestedContainer.overwrite | public function overwrite($container)
{
$originalValue = $this->getValue();
$newValue = $container->getValue();
if (is_null($newValue)) {
$resultValue = $originalValue;
} elseif (is_array($newValue) && is_array($originalValue)) {
$resultValue = array_replace_... | php | public function overwrite($container)
{
$originalValue = $this->getValue();
$newValue = $container->getValue();
if (is_null($newValue)) {
$resultValue = $originalValue;
} elseif (is_array($newValue) && is_array($originalValue)) {
$resultValue = array_replace_... | [
"public",
"function",
"overwrite",
"(",
"$",
"container",
")",
"{",
"$",
"originalValue",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"$",
"newValue",
"=",
"$",
"container",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"new... | Overwrite Container's data
@param self $container Container to overwrite by
@return self | [
"Overwrite",
"Container",
"s",
"data"
] | d735d3e8e0616fb9cf4ffc25b8425762ed07940f | https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/NestedContainer.php#L154-L170 | train |
freialib/hlin.tools | src/Request.php | Request.input | function input(array $formats, $output = 'array') {
if (in_array('post', $formats)) {
$post = $this->context->web->requestPostData();
if ( ! empty($post)) {
if ($output == 'array') {
return $post;
}
}
}
if (in_array('json', $formats)) {
$input = $this->context->web->requestBody();
if... | php | function input(array $formats, $output = 'array') {
if (in_array('post', $formats)) {
$post = $this->context->web->requestPostData();
if ( ! empty($post)) {
if ($output == 'array') {
return $post;
}
}
}
if (in_array('json', $formats)) {
$input = $this->context->web->requestBody();
if... | [
"function",
"input",
"(",
"array",
"$",
"formats",
",",
"$",
"output",
"=",
"'array'",
")",
"{",
"if",
"(",
"in_array",
"(",
"'post'",
",",
"$",
"formats",
")",
")",
"{",
"$",
"post",
"=",
"$",
"this",
"->",
"context",
"->",
"web",
"->",
"requestPo... | Given a set of acceptable formats the system tries to retrieve the data
format specified and return it in the specified output format. If there
is no input the method will return null.
Supported formats:
- post
- json
- query (alias: get)
- raw-query
- files
Supported output formats:
- array
@return mixed|null input | [
"Given",
"a",
"set",
"of",
"acceptable",
"formats",
"the",
"system",
"tries",
"to",
"retrieve",
"the",
"data",
"format",
"specified",
"and",
"return",
"it",
"in",
"the",
"specified",
"output",
"format",
".",
"If",
"there",
"is",
"no",
"input",
"the",
"meth... | 42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7 | https://github.com/freialib/hlin.tools/blob/42ad9e9fe081918d2ee5d52b72d174ccdcf7cbe7/src/Request.php#L43-L90 | train |
bandama-framework/bandama-framework | src/foundation/router/Route.php | Route.match | public function match($url) {
// Remove the start and end slash of URL
$url = trim($url, '/');
// Replace path parameters (:parameter) by
$path = preg_replace_callback('#:([\w]+)#', [$this, 'paramMatch'], $this->path);
// Define the regex patterb with the new path after replaced the parameters of path
$rege... | php | public function match($url) {
// Remove the start and end slash of URL
$url = trim($url, '/');
// Replace path parameters (:parameter) by
$path = preg_replace_callback('#:([\w]+)#', [$this, 'paramMatch'], $this->path);
// Define the regex patterb with the new path after replaced the parameters of path
$rege... | [
"public",
"function",
"match",
"(",
"$",
"url",
")",
"{",
"// Remove the start and end slash of URL",
"$",
"url",
"=",
"trim",
"(",
"$",
"url",
",",
"'/'",
")",
";",
"// Replace path parameters (:parameter) by",
"$",
"path",
"=",
"preg_replace_callback",
"(",
"'#:... | Test if the current route matches the URL
@param string $url
@return boolean|mixed | [
"Test",
"if",
"the",
"current",
"route",
"matches",
"the",
"URL"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Route.php#L102-L119 | train |
bandama-framework/bandama-framework | src/foundation/router/Route.php | Route.execute | public function execute($matches) {
if (is_string($this->callable)) { // If the callable is a string, call the action of controller
$params = explode('#', $this->callable);
if (count($params) == 2) {
$controllerPrefix = $params[0];
$controllerPrefix = str_replace(':', '... | php | public function execute($matches) {
if (is_string($this->callable)) { // If the callable is a string, call the action of controller
$params = explode('#', $this->callable);
if (count($params) == 2) {
$controllerPrefix = $params[0];
$controllerPrefix = str_replace(':', '... | [
"public",
"function",
"execute",
"(",
"$",
"matches",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"callable",
")",
")",
"{",
"// If the callable is a string, call the action of controller",
"$",
"params",
"=",
"explode",
"(",
"'#'",
",",
"$",
"th... | Execute the callable of route
@param array $matches URL parameters
@return mixed | [
"Execute",
"the",
"callable",
"of",
"route"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Route.php#L128-L153 | train |
bandama-framework/bandama-framework | src/foundation/router/Route.php | Route.getUrl | public function getUrl($params) {
$path = $this->path;
foreach ($params as $k => $v) {
$path = str_replace(":$k", $v, $path);
}
return $path;
} | php | public function getUrl($params) {
$path = $this->path;
foreach ($params as $k => $v) {
$path = str_replace(":$k", $v, $path);
}
return $path;
} | [
"public",
"function",
"getUrl",
"(",
"$",
"params",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"path",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"\":$k\"",
",",
"$",
... | Generate the URL with the parameters
@param array $params Route parameters
@return string | [
"Generate",
"the",
"URL",
"with",
"the",
"parameters"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Route.php#L162-L170 | train |
yuncms/yii2-article | backend/controllers/ArticleController.php | ArticleController.actionAudit | public function actionAudit($id)
{
$model = $this->findModel($id);
$model->setPublished();
Yii::$app->getSession()->setFlash('success', Yii::t('article', 'Update success.'));
return $this->redirect(Url::previous('actions-redirect'));
} | php | public function actionAudit($id)
{
$model = $this->findModel($id);
$model->setPublished();
Yii::$app->getSession()->setFlash('success', Yii::t('article', 'Update success.'));
return $this->redirect(Url::previous('actions-redirect'));
} | [
"public",
"function",
"actionAudit",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"->",
"setPublished",
"(",
")",
";",
"Yii",
"::",
"$",
"app",
"->",
"getSession",
"(",
")",
... | Audit an existing Comment model.
If Audit is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Audit",
"an",
"existing",
"Comment",
"model",
".",
"If",
"Audit",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 177ec4d3d143b2f2a69bce760e873485cf3df192 | https://github.com/yuncms/yii2-article/blob/177ec4d3d143b2f2a69bce760e873485cf3df192/backend/controllers/ArticleController.php#L112-L118 | train |
PenoaksDev/Milky-Framework | src/Milky/Account/AccountManager.php | AccountManager.resolveGuard | public function resolveGuard( $name )
{
$config = Config::get( 'auth.guards.' . $name );
if ( is_null( $config ) )
throw new AccountException( "Auth guard [" . $name . "] is not defined in the configuration" );
$uses = $config['uses'];
$auth = $this->resolveAuth( $config['auth'] ?: $this->getDefaultAuth()... | php | public function resolveGuard( $name )
{
$config = Config::get( 'auth.guards.' . $name );
if ( is_null( $config ) )
throw new AccountException( "Auth guard [" . $name . "] is not defined in the configuration" );
$uses = $config['uses'];
$auth = $this->resolveAuth( $config['auth'] ?: $this->getDefaultAuth()... | [
"public",
"function",
"resolveGuard",
"(",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"get",
"(",
"'auth.guards.'",
".",
"$",
"name",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"config",
")",
")",
"throw",
"new",
"AccountException",
"(",... | Resolve the implemented Account Guard
@param string $name | [
"Resolve",
"the",
"implemented",
"Account",
"Guard"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/AccountManager.php#L64-L100 | train |
PenoaksDev/Milky-Framework | src/Milky/Account/AccountManager.php | AccountManager.resolveAuth | public function resolveAuth( $auth )
{
$config = Config::get( 'auth.auths.' . $auth );
$uses = $config['uses'];
switch ( $uses )
{
case 'database':
{
$auth = new DatabaseAuth( $config['table'] );
break;
}
case 'eloquent':
{
$auth = new EloquentAuth( $config['usrModel'], $config['grp... | php | public function resolveAuth( $auth )
{
$config = Config::get( 'auth.auths.' . $auth );
$uses = $config['uses'];
switch ( $uses )
{
case 'database':
{
$auth = new DatabaseAuth( $config['table'] );
break;
}
case 'eloquent':
{
$auth = new EloquentAuth( $config['usrModel'], $config['grp... | [
"public",
"function",
"resolveAuth",
"(",
"$",
"auth",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"get",
"(",
"'auth.auths.'",
".",
"$",
"auth",
")",
";",
"$",
"uses",
"=",
"$",
"config",
"[",
"'uses'",
"]",
";",
"switch",
"(",
"$",
"uses",
")",... | Resolve the implemented Account Auth
@param string $auth
@return AccountAuth | [
"Resolve",
"the",
"implemented",
"Account",
"Auth"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/AccountManager.php#L108-L138 | train |
PenoaksDev/Milky-Framework | src/Milky/Account/AccountManager.php | AccountManager.viaRequest | public function viaRequest( $name, callable $callback )
{
$this->guards[$name] = new RequestGuard( $callback, Request::i() );
} | php | public function viaRequest( $name, callable $callback )
{
$this->guards[$name] = new RequestGuard( $callback, Request::i() );
} | [
"public",
"function",
"viaRequest",
"(",
"$",
"name",
",",
"callable",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"guards",
"[",
"$",
"name",
"]",
"=",
"new",
"RequestGuard",
"(",
"$",
"callback",
",",
"Request",
"::",
"i",
"(",
")",
")",
";",
"... | Register a callback based guard
@param $name
@param callable $callback | [
"Register",
"a",
"callback",
"based",
"guard"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/AccountManager.php#L166-L169 | train |
CommonApi/Fieldhandler | FieldhandlerUsageTrait.php | FieldhandlerUsageTrait.editFieldhandlerMethod | protected function editFieldhandlerMethod()
{
if (in_array($this->method, array('validate', 'sanitize', 'format'))) {
return $this;
}
throw new InvalidArgumentException(
get_class($this)
. ' passed in invalid Fieldhandler method '
. $this->met... | php | protected function editFieldhandlerMethod()
{
if (in_array($this->method, array('validate', 'sanitize', 'format'))) {
return $this;
}
throw new InvalidArgumentException(
get_class($this)
. ' passed in invalid Fieldhandler method '
. $this->met... | [
"protected",
"function",
"editFieldhandlerMethod",
"(",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"this",
"->",
"method",
",",
"array",
"(",
"'validate'",
",",
"'sanitize'",
",",
"'format'",
")",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"throw",
... | Edit Method for Fieldhandler Method
@return $this
@since 1.0.0
@throws \CommonApi\Exception\InvalidArgumentException | [
"Edit",
"Method",
"for",
"Fieldhandler",
"Method"
] | 38584132ab55cdf45ffa6a10fa7c78fa6f78984b | https://github.com/CommonApi/Fieldhandler/blob/38584132ab55cdf45ffa6a10fa7c78fa6f78984b/FieldhandlerUsageTrait.php#L117-L129 | train |
CommonApi/Fieldhandler | FieldhandlerUsageTrait.php | FieldhandlerUsageTrait.editFieldhandlerAttribute | protected function editFieldhandlerAttribute($attribute)
{
$field_name = 'field_' . $attribute;
$this->$field_name = null;
if (isset($this->field[$attribute])) {
$this->$field_name = $this->field[$attribute];
return $this;
}
if ($attribute === 'val... | php | protected function editFieldhandlerAttribute($attribute)
{
$field_name = 'field_' . $attribute;
$this->$field_name = null;
if (isset($this->field[$attribute])) {
$this->$field_name = $this->field[$attribute];
return $this;
}
if ($attribute === 'val... | [
"protected",
"function",
"editFieldhandlerAttribute",
"(",
"$",
"attribute",
")",
"{",
"$",
"field_name",
"=",
"'field_'",
".",
"$",
"attribute",
";",
"$",
"this",
"->",
"$",
"field_name",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fi... | Edit Fieldhandler Attribute
@param string $attribute
@return $this
@since 1.0.0
@throws \CommonApi\Exception\InvalidArgumentException | [
"Edit",
"Fieldhandler",
"Attribute"
] | 38584132ab55cdf45ffa6a10fa7c78fa6f78984b | https://github.com/CommonApi/Fieldhandler/blob/38584132ab55cdf45ffa6a10fa7c78fa6f78984b/FieldhandlerUsageTrait.php#L140-L162 | train |
CommonApi/Fieldhandler | FieldhandlerUsageTrait.php | FieldhandlerUsageTrait.executeConstraint | protected function executeConstraint(array $options = array())
{
try {
$method = $this->method;
return $this->fieldhandler->$method(
$this->field_name,
$this->field_value,
ucfirst(strtolower($this->field_type)),
$option... | php | protected function executeConstraint(array $options = array())
{
try {
$method = $this->method;
return $this->fieldhandler->$method(
$this->field_name,
$this->field_value,
ucfirst(strtolower($this->field_type)),
$option... | [
"protected",
"function",
"executeConstraint",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"try",
"{",
"$",
"method",
"=",
"$",
"this",
"->",
"method",
";",
"return",
"$",
"this",
"->",
"fieldhandler",
"->",
"$",
"method",
"(",
"$",
... | Execute Fieldhandler Method
@param array $options
@return $this
@since 1.0.0
@throws \CommonApi\Exception\RuntimeException | [
"Execute",
"Fieldhandler",
"Method"
] | 38584132ab55cdf45ffa6a10fa7c78fa6f78984b | https://github.com/CommonApi/Fieldhandler/blob/38584132ab55cdf45ffa6a10fa7c78fa6f78984b/FieldhandlerUsageTrait.php#L173-L195 | train |
t3v/t3v_core | Classes/Domain/Repository/AbstractRepository.php | AbstractRepository.initializeObject | public function initializeObject() {
$querySettings = $this->objectManager->get(Typo3QuerySettings::class);
$querySettings->setIgnoreEnableFields(false);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
} | php | public function initializeObject() {
$querySettings = $this->objectManager->get(Typo3QuerySettings::class);
$querySettings->setIgnoreEnableFields(false);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
} | [
"public",
"function",
"initializeObject",
"(",
")",
"{",
"$",
"querySettings",
"=",
"$",
"this",
"->",
"objectManager",
"->",
"get",
"(",
"Typo3QuerySettings",
"::",
"class",
")",
";",
"$",
"querySettings",
"->",
"setIgnoreEnableFields",
"(",
"false",
")",
";"... | The life cycle method. | [
"The",
"life",
"cycle",
"method",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Domain/Repository/AbstractRepository.php#L40-L46 | train |
t3v/t3v_core | Classes/Domain/Repository/AbstractRepository.php | AbstractRepository.findByUid | public function findByUid($uid, array $querySettings = ['respectSysLanguage' => false]) {
if ($uid && $uid > 0) {
// Create a new query.
$query = $this->createquery();
// Apply the passed query settings.
$query = $this->applyQuerySettings($query, $querySettings);
// Set the query con... | php | public function findByUid($uid, array $querySettings = ['respectSysLanguage' => false]) {
if ($uid && $uid > 0) {
// Create a new query.
$query = $this->createquery();
// Apply the passed query settings.
$query = $this->applyQuerySettings($query, $querySettings);
// Set the query con... | [
"public",
"function",
"findByUid",
"(",
"$",
"uid",
",",
"array",
"$",
"querySettings",
"=",
"[",
"'respectSysLanguage'",
"=>",
"false",
"]",
")",
"{",
"if",
"(",
"$",
"uid",
"&&",
"$",
"uid",
">",
"0",
")",
"{",
"// Create a new query.",
"$",
"query",
... | Finds objects by UID, overrides the default one.
@param int $uid The UID
@param array $querySettings The optional query settings to apply
@return object|null The found object or null if no object was found | [
"Finds",
"objects",
"by",
"UID",
"overrides",
"the",
"default",
"one",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Domain/Repository/AbstractRepository.php#L55-L73 | train |
t3v/t3v_core | Classes/Domain/Repository/AbstractRepository.php | AbstractRepository.findByUids | public function findByUids($uids, array $querySettings = ['respectSysLanguage' => false]) {
if (is_string($uids)) {
$uids = GeneralUtility::intExplode(',', $uids, true);
}
if (!empty($uids)) {
// Create a new query.
$query = $this->createquery();
// Apply the passed query settings.... | php | public function findByUids($uids, array $querySettings = ['respectSysLanguage' => false]) {
if (is_string($uids)) {
$uids = GeneralUtility::intExplode(',', $uids, true);
}
if (!empty($uids)) {
// Create a new query.
$query = $this->createquery();
// Apply the passed query settings.... | [
"public",
"function",
"findByUids",
"(",
"$",
"uids",
",",
"array",
"$",
"querySettings",
"=",
"[",
"'respectSysLanguage'",
"=>",
"false",
"]",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"uids",
")",
")",
"{",
"$",
"uids",
"=",
"GeneralUtility",
"::",
... | Finds objects by multiple UIDs.
@param array|string $uids The UIDs as array or as string, seperated by `,`
@param array $querySettings The optional query settings to apply
@return \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult|null The found objects or null if no objects were found | [
"Finds",
"objects",
"by",
"multiple",
"UIDs",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Domain/Repository/AbstractRepository.php#L82-L104 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.