repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Bacon/BaconQrCode | src/Common/BitMatrix.php | BitMatrix.getBottomRightOnBit | public function getBottomRightOnBit() : ?array
{
$bitsOffset = count($this->bits) - 1;
while ($bitsOffset >= 0 && 0 === $this->bits[$bitsOffset]) {
--$bitsOffset;
}
if ($bitsOffset < 0) {
return null;
}
$x = intdiv($bitsOffset, $this->rowSiz... | php | public function getBottomRightOnBit() : ?array
{
$bitsOffset = count($this->bits) - 1;
while ($bitsOffset >= 0 && 0 === $this->bits[$bitsOffset]) {
--$bitsOffset;
}
if ($bitsOffset < 0) {
return null;
}
$x = intdiv($bitsOffset, $this->rowSiz... | [
"public",
"function",
"getBottomRightOnBit",
"(",
")",
":",
"?",
"array",
"{",
"$",
"bitsOffset",
"=",
"count",
"(",
"$",
"this",
"->",
"bits",
")",
"-",
"1",
";",
"while",
"(",
"$",
"bitsOffset",
">=",
"0",
"&&",
"0",
"===",
"$",
"this",
"->",
"bi... | Gets the most bottom right set bit.
This is useful in detecting a corner of a 'pure' barcode.
@return int[]|null | [
"Gets",
"the",
"most",
"bottom",
"right",
"set",
"bit",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Common/BitMatrix.php#L271-L296 |
Bacon/BaconQrCode | src/Common/ReedSolomonCodec.php | ReedSolomonCodec.encode | public function encode(SplFixedArray $data, SplFixedArray $parity) : void
{
for ($i = 0; $i < $this->numRoots; ++$i) {
$parity[$i] = 0;
}
$iterations = $this->blockSize - $this->numRoots - $this->padding;
for ($i = 0; $i < $iterations; ++$i) {
$feedback = $t... | php | public function encode(SplFixedArray $data, SplFixedArray $parity) : void
{
for ($i = 0; $i < $this->numRoots; ++$i) {
$parity[$i] = 0;
}
$iterations = $this->blockSize - $this->numRoots - $this->padding;
for ($i = 0; $i < $iterations; ++$i) {
$feedback = $t... | [
"public",
"function",
"encode",
"(",
"SplFixedArray",
"$",
"data",
",",
"SplFixedArray",
"$",
"parity",
")",
":",
"void",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"numRoots",
";",
"++",
"$",
"i",
")",
"{",
"$",
... | Encodes data and writes result back into parity array. | [
"Encodes",
"data",
"and",
"writes",
"result",
"back",
"into",
"parity",
"array",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Common/ReedSolomonCodec.php#L188-L220 |
Bacon/BaconQrCode | src/Common/ReedSolomonCodec.php | ReedSolomonCodec.decode | public function decode(SplFixedArray $data, SplFixedArray $erasures = null) : ?int
{
// This speeds up the initialization a bit.
$numRootsPlusOne = SplFixedArray::fromArray(array_fill(0, $this->numRoots + 1, 0), false);
$numRoots = SplFixedArray::fromArray(array_fill(0, $this->numRoots, 0), ... | php | public function decode(SplFixedArray $data, SplFixedArray $erasures = null) : ?int
{
// This speeds up the initialization a bit.
$numRootsPlusOne = SplFixedArray::fromArray(array_fill(0, $this->numRoots + 1, 0), false);
$numRoots = SplFixedArray::fromArray(array_fill(0, $this->numRoots, 0), ... | [
"public",
"function",
"decode",
"(",
"SplFixedArray",
"$",
"data",
",",
"SplFixedArray",
"$",
"erasures",
"=",
"null",
")",
":",
"?",
"int",
"{",
"// This speeds up the initialization a bit.",
"$",
"numRootsPlusOne",
"=",
"SplFixedArray",
"::",
"fromArray",
"(",
"... | Decodes received data. | [
"Decodes",
"received",
"data",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Common/ReedSolomonCodec.php#L225-L454 |
Bacon/BaconQrCode | src/Common/ReedSolomonCodec.php | ReedSolomonCodec.modNn | private function modNn(int $x) : int
{
while ($x >= $this->blockSize) {
$x -= $this->blockSize;
$x = ($x >> $this->symbolSize) + ($x & $this->blockSize);
}
return $x;
} | php | private function modNn(int $x) : int
{
while ($x >= $this->blockSize) {
$x -= $this->blockSize;
$x = ($x >> $this->symbolSize) + ($x & $this->blockSize);
}
return $x;
} | [
"private",
"function",
"modNn",
"(",
"int",
"$",
"x",
")",
":",
"int",
"{",
"while",
"(",
"$",
"x",
">=",
"$",
"this",
"->",
"blockSize",
")",
"{",
"$",
"x",
"-=",
"$",
"this",
"->",
"blockSize",
";",
"$",
"x",
"=",
"(",
"$",
"x",
">>",
"$",
... | Computes $x % GF_SIZE, where GF_SIZE is 2**GF_BITS - 1, without a slow divide. | [
"Computes",
"$x",
"%",
"GF_SIZE",
"where",
"GF_SIZE",
"is",
"2",
"**",
"GF_BITS",
"-",
"1",
"without",
"a",
"slow",
"divide",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Common/ReedSolomonCodec.php#L459-L467 |
Bacon/BaconQrCode | src/Renderer/Path/Path.php | Path.move | public function move(float $x, float $y) : self
{
$path = clone $this;
$path->operations[] = new Move($x, $y);
return $path;
} | php | public function move(float $x, float $y) : self
{
$path = clone $this;
$path->operations[] = new Move($x, $y);
return $path;
} | [
"public",
"function",
"move",
"(",
"float",
"$",
"x",
",",
"float",
"$",
"y",
")",
":",
"self",
"{",
"$",
"path",
"=",
"clone",
"$",
"this",
";",
"$",
"path",
"->",
"operations",
"[",
"]",
"=",
"new",
"Move",
"(",
"$",
"x",
",",
"$",
"y",
")"... | Moves the drawing operation to a certain position. | [
"Moves",
"the",
"drawing",
"operation",
"to",
"a",
"certain",
"position",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Renderer/Path/Path.php#L22-L27 |
Bacon/BaconQrCode | src/Renderer/Path/Path.php | Path.line | public function line(float $x, float $y) : self
{
$path = clone $this;
$path->operations[] = new Line($x, $y);
return $path;
} | php | public function line(float $x, float $y) : self
{
$path = clone $this;
$path->operations[] = new Line($x, $y);
return $path;
} | [
"public",
"function",
"line",
"(",
"float",
"$",
"x",
",",
"float",
"$",
"y",
")",
":",
"self",
"{",
"$",
"path",
"=",
"clone",
"$",
"this",
";",
"$",
"path",
"->",
"operations",
"[",
"]",
"=",
"new",
"Line",
"(",
"$",
"x",
",",
"$",
"y",
")"... | Draws a line from the current position to another position. | [
"Draws",
"a",
"line",
"from",
"the",
"current",
"position",
"to",
"another",
"position",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Renderer/Path/Path.php#L32-L37 |
Bacon/BaconQrCode | src/Renderer/Path/Path.php | Path.ellipticArc | public function ellipticArc(
float $xRadius,
float $yRadius,
float $xAxisRotation,
bool $largeArc,
bool $sweep,
float $x,
float $y
) : self {
$path = clone $this;
$path->operations[] = new EllipticArc($xRadius, $yRadius, $xAxisRotation, $largeA... | php | public function ellipticArc(
float $xRadius,
float $yRadius,
float $xAxisRotation,
bool $largeArc,
bool $sweep,
float $x,
float $y
) : self {
$path = clone $this;
$path->operations[] = new EllipticArc($xRadius, $yRadius, $xAxisRotation, $largeA... | [
"public",
"function",
"ellipticArc",
"(",
"float",
"$",
"xRadius",
",",
"float",
"$",
"yRadius",
",",
"float",
"$",
"xAxisRotation",
",",
"bool",
"$",
"largeArc",
",",
"bool",
"$",
"sweep",
",",
"float",
"$",
"x",
",",
"float",
"$",
"y",
")",
":",
"s... | Draws an elliptic arc from the current position to another position. | [
"Draws",
"an",
"elliptic",
"arc",
"from",
"the",
"current",
"position",
"to",
"another",
"position",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Renderer/Path/Path.php#L42-L54 |
Bacon/BaconQrCode | src/Renderer/Path/Path.php | Path.curve | public function curve(float $x1, float $y1, float $x2, float $y2, float $x3, float $y3) : self
{
$path = clone $this;
$path->operations[] = new Curve($x1, $y1, $x2, $y2, $x3, $y3);
return $path;
} | php | public function curve(float $x1, float $y1, float $x2, float $y2, float $x3, float $y3) : self
{
$path = clone $this;
$path->operations[] = new Curve($x1, $y1, $x2, $y2, $x3, $y3);
return $path;
} | [
"public",
"function",
"curve",
"(",
"float",
"$",
"x1",
",",
"float",
"$",
"y1",
",",
"float",
"$",
"x2",
",",
"float",
"$",
"y2",
",",
"float",
"$",
"x3",
",",
"float",
"$",
"y3",
")",
":",
"self",
"{",
"$",
"path",
"=",
"clone",
"$",
"this",
... | Draws a curve from the current position to another position. | [
"Draws",
"a",
"curve",
"from",
"the",
"current",
"position",
"to",
"another",
"position",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Renderer/Path/Path.php#L59-L64 |
Bacon/BaconQrCode | src/Renderer/Path/Path.php | Path.append | public function append(self $other) : self
{
$path = clone $this;
$path->operations = array_merge($this->operations, $other->operations);
return $path;
} | php | public function append(self $other) : self
{
$path = clone $this;
$path->operations = array_merge($this->operations, $other->operations);
return $path;
} | [
"public",
"function",
"append",
"(",
"self",
"$",
"other",
")",
":",
"self",
"{",
"$",
"path",
"=",
"clone",
"$",
"this",
";",
"$",
"path",
"->",
"operations",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"operations",
",",
"$",
"other",
"->",
"operat... | Appends another path to this one. | [
"Appends",
"another",
"path",
"to",
"this",
"one",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Renderer/Path/Path.php#L79-L84 |
Bacon/BaconQrCode | src/Encoder/ByteMatrix.php | ByteMatrix.get | public function get(int $x, int $y) : int
{
return $this->bytes[$y][$x];
} | php | public function get(int $x, int $y) : int
{
return $this->bytes[$y][$x];
} | [
"public",
"function",
"get",
"(",
"int",
"$",
"x",
",",
"int",
"$",
"y",
")",
":",
"int",
"{",
"return",
"$",
"this",
"->",
"bytes",
"[",
"$",
"y",
"]",
"[",
"$",
"x",
"]",
";",
"}"
] | Gets the byte for a specific position. | [
"Gets",
"the",
"byte",
"for",
"a",
"specific",
"position",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Encoder/ByteMatrix.php#L87-L90 |
Bacon/BaconQrCode | src/Encoder/ByteMatrix.php | ByteMatrix.set | public function set(int $x, int $y, int $value) : void
{
$this->bytes[$y][$x] = $value;
} | php | public function set(int $x, int $y, int $value) : void
{
$this->bytes[$y][$x] = $value;
} | [
"public",
"function",
"set",
"(",
"int",
"$",
"x",
",",
"int",
"$",
"y",
",",
"int",
"$",
"value",
")",
":",
"void",
"{",
"$",
"this",
"->",
"bytes",
"[",
"$",
"y",
"]",
"[",
"$",
"x",
"]",
"=",
"$",
"value",
";",
"}"
] | Sets the byte for a specific position. | [
"Sets",
"the",
"byte",
"for",
"a",
"specific",
"position",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Encoder/ByteMatrix.php#L95-L98 |
Bacon/BaconQrCode | src/Encoder/ByteMatrix.php | ByteMatrix.clear | public function clear(int $value) : void
{
for ($y = 0; $y < $this->height; ++$y) {
for ($x = 0; $x < $this->width; ++$x) {
$this->bytes[$y][$x] = $value;
}
}
} | php | public function clear(int $value) : void
{
for ($y = 0; $y < $this->height; ++$y) {
for ($x = 0; $x < $this->width; ++$x) {
$this->bytes[$y][$x] = $value;
}
}
} | [
"public",
"function",
"clear",
"(",
"int",
"$",
"value",
")",
":",
"void",
"{",
"for",
"(",
"$",
"y",
"=",
"0",
";",
"$",
"y",
"<",
"$",
"this",
"->",
"height",
";",
"++",
"$",
"y",
")",
"{",
"for",
"(",
"$",
"x",
"=",
"0",
";",
"$",
"x",... | Clears the matrix with a specific value. | [
"Clears",
"the",
"matrix",
"with",
"a",
"specific",
"value",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Encoder/ByteMatrix.php#L103-L110 |
Bacon/BaconQrCode | src/Common/Mode.php | Mode.getCharacterCountBits | public function getCharacterCountBits(Version $version) : int
{
$number = $version->getVersionNumber();
if ($number <= 9) {
$offset = 0;
} elseif ($number <= 26) {
$offset = 1;
} else {
$offset = 2;
}
return $this->characterCountB... | php | public function getCharacterCountBits(Version $version) : int
{
$number = $version->getVersionNumber();
if ($number <= 9) {
$offset = 0;
} elseif ($number <= 26) {
$offset = 1;
} else {
$offset = 2;
}
return $this->characterCountB... | [
"public",
"function",
"getCharacterCountBits",
"(",
"Version",
"$",
"version",
")",
":",
"int",
"{",
"$",
"number",
"=",
"$",
"version",
"->",
"getVersionNumber",
"(",
")",
";",
"if",
"(",
"$",
"number",
"<=",
"9",
")",
"{",
"$",
"offset",
"=",
"0",
... | Returns the number of bits used in a specific QR code version. | [
"Returns",
"the",
"number",
"of",
"bits",
"used",
"in",
"a",
"specific",
"QR",
"code",
"version",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Common/Mode.php#L54-L67 |
Bacon/BaconQrCode | src/Renderer/Path/EllipticArc.php | EllipticArc.toCurves | public function toCurves(float $fromX, float $fromY) : array
{
if (sqrt(($fromX - $this->x) ** 2 + ($fromY - $this->y) ** 2) < self::ZERO_TOLERANCE) {
return [];
}
if ($this->xRadius < self::ZERO_TOLERANCE || $this->yRadius < self::ZERO_TOLERANCE) {
return [new Line(... | php | public function toCurves(float $fromX, float $fromY) : array
{
if (sqrt(($fromX - $this->x) ** 2 + ($fromY - $this->y) ** 2) < self::ZERO_TOLERANCE) {
return [];
}
if ($this->xRadius < self::ZERO_TOLERANCE || $this->yRadius < self::ZERO_TOLERANCE) {
return [new Line(... | [
"public",
"function",
"toCurves",
"(",
"float",
"$",
"fromX",
",",
"float",
"$",
"fromY",
")",
":",
"array",
"{",
"if",
"(",
"sqrt",
"(",
"(",
"$",
"fromX",
"-",
"$",
"this",
"->",
"x",
")",
"**",
"2",
"+",
"(",
"$",
"fromY",
"-",
"$",
"this",
... | Converts the elliptic arc to multiple curves.
Since not all image back ends support elliptic arcs, this method allows to convert the arc into multiple curves
resembling the same result.
@see https://mortoray.com/2017/02/16/rendering-an-svg-elliptical-arc-as-bezier-curves/
@return array<Curve|Line> | [
"Converts",
"the",
"elliptic",
"arc",
"to",
"multiple",
"curves",
"."
] | train | https://github.com/Bacon/BaconQrCode/blob/b08c713191f3c824c0db3b2fc5d8561e98fb1da4/src/Renderer/Path/EllipticArc.php#L123-L134 |
symfony/psr-http-message-bridge | Factory/DiactorosFactory.php | DiactorosFactory.createRequest | public function createRequest(Request $symfonyRequest)
{
$server = method_exists('Zend\Diactoros\ServerRequestFactory', 'normalizeServer')
? DiactorosRequestFactory::normalizeServer($symfonyRequest->server->all())
: \Zend\Diactoros\normalizeServer($symfonyRequest->server->all());
... | php | public function createRequest(Request $symfonyRequest)
{
$server = method_exists('Zend\Diactoros\ServerRequestFactory', 'normalizeServer')
? DiactorosRequestFactory::normalizeServer($symfonyRequest->server->all())
: \Zend\Diactoros\normalizeServer($symfonyRequest->server->all());
... | [
"public",
"function",
"createRequest",
"(",
"Request",
"$",
"symfonyRequest",
")",
"{",
"$",
"server",
"=",
"method_exists",
"(",
"'Zend\\Diactoros\\ServerRequestFactory'",
",",
"'normalizeServer'",
")",
"?",
"DiactorosRequestFactory",
"::",
"normalizeServer",
"(",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/DiactorosFactory.php#L48-L82 |
symfony/psr-http-message-bridge | Factory/DiactorosFactory.php | DiactorosFactory.getFiles | private function getFiles(array $uploadedFiles)
{
$files = [];
foreach ($uploadedFiles as $key => $value) {
if (null === $value) {
$files[$key] = new DiactorosUploadedFile(null, 0, UPLOAD_ERR_NO_FILE, null, null);
continue;
}
if ($... | php | private function getFiles(array $uploadedFiles)
{
$files = [];
foreach ($uploadedFiles as $key => $value) {
if (null === $value) {
$files[$key] = new DiactorosUploadedFile(null, 0, UPLOAD_ERR_NO_FILE, null, null);
continue;
}
if ($... | [
"private",
"function",
"getFiles",
"(",
"array",
"$",
"uploadedFiles",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"uploadedFiles",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{... | Converts Symfony uploaded files array to the PSR one.
@param array $uploadedFiles
@return array | [
"Converts",
"Symfony",
"uploaded",
"files",
"array",
"to",
"the",
"PSR",
"one",
"."
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/DiactorosFactory.php#L91-L108 |
symfony/psr-http-message-bridge | Factory/DiactorosFactory.php | DiactorosFactory.createUploadedFile | private function createUploadedFile(UploadedFile $symfonyUploadedFile)
{
return new DiactorosUploadedFile(
$symfonyUploadedFile->getRealPath(),
(int) $symfonyUploadedFile->getSize(),
$symfonyUploadedFile->getError(),
$symfonyUploadedFile->getClientOriginalName... | php | private function createUploadedFile(UploadedFile $symfonyUploadedFile)
{
return new DiactorosUploadedFile(
$symfonyUploadedFile->getRealPath(),
(int) $symfonyUploadedFile->getSize(),
$symfonyUploadedFile->getError(),
$symfonyUploadedFile->getClientOriginalName... | [
"private",
"function",
"createUploadedFile",
"(",
"UploadedFile",
"$",
"symfonyUploadedFile",
")",
"{",
"return",
"new",
"DiactorosUploadedFile",
"(",
"$",
"symfonyUploadedFile",
"->",
"getRealPath",
"(",
")",
",",
"(",
"int",
")",
"$",
"symfonyUploadedFile",
"->",
... | Creates a PSR-7 UploadedFile instance from a Symfony one.
@param UploadedFile $symfonyUploadedFile
@return UploadedFileInterface | [
"Creates",
"a",
"PSR",
"-",
"7",
"UploadedFile",
"instance",
"from",
"a",
"Symfony",
"one",
"."
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/DiactorosFactory.php#L117-L126 |
symfony/psr-http-message-bridge | Factory/DiactorosFactory.php | DiactorosFactory.createResponse | public function createResponse(Response $symfonyResponse)
{
if ($symfonyResponse instanceof BinaryFileResponse) {
$stream = new DiactorosStream($symfonyResponse->getFile()->getPathname(), 'r');
} else {
$stream = new DiactorosStream('php://temp', 'wb+');
if ($symf... | php | public function createResponse(Response $symfonyResponse)
{
if ($symfonyResponse instanceof BinaryFileResponse) {
$stream = new DiactorosStream($symfonyResponse->getFile()->getPathname(), 'r');
} else {
$stream = new DiactorosStream('php://temp', 'wb+');
if ($symf... | [
"public",
"function",
"createResponse",
"(",
"Response",
"$",
"symfonyResponse",
")",
"{",
"if",
"(",
"$",
"symfonyResponse",
"instanceof",
"BinaryFileResponse",
")",
"{",
"$",
"stream",
"=",
"new",
"DiactorosStream",
"(",
"$",
"symfonyResponse",
"->",
"getFile",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/DiactorosFactory.php#L131-L174 |
symfony/psr-http-message-bridge | Factory/PsrHttpFactory.php | PsrHttpFactory.createRequest | public function createRequest(Request $symfonyRequest)
{
$request = $this->serverRequestFactory->createServerRequest(
$symfonyRequest->getMethod(),
$symfonyRequest->getUri(),
$symfonyRequest->server->all()
);
foreach ($symfonyRequest->headers->all() as $n... | php | public function createRequest(Request $symfonyRequest)
{
$request = $this->serverRequestFactory->createServerRequest(
$symfonyRequest->getMethod(),
$symfonyRequest->getUri(),
$symfonyRequest->server->all()
);
foreach ($symfonyRequest->headers->all() as $n... | [
"public",
"function",
"createRequest",
"(",
"Request",
"$",
"symfonyRequest",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"serverRequestFactory",
"->",
"createServerRequest",
"(",
"$",
"symfonyRequest",
"->",
"getMethod",
"(",
")",
",",
"$",
"symfonyReques... | {@inheritdoc} | [
"{"
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/PsrHttpFactory.php#L49-L76 |
symfony/psr-http-message-bridge | Factory/PsrHttpFactory.php | PsrHttpFactory.getFiles | private function getFiles(array $uploadedFiles)
{
$files = [];
foreach ($uploadedFiles as $key => $value) {
if (null === $value) {
$files[$key] = $this->uploadedFileFactory->createUploadedFile($this->streamFactory->createStream(), 0, UPLOAD_ERR_NO_FILE);
... | php | private function getFiles(array $uploadedFiles)
{
$files = [];
foreach ($uploadedFiles as $key => $value) {
if (null === $value) {
$files[$key] = $this->uploadedFileFactory->createUploadedFile($this->streamFactory->createStream(), 0, UPLOAD_ERR_NO_FILE);
... | [
"private",
"function",
"getFiles",
"(",
"array",
"$",
"uploadedFiles",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"uploadedFiles",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{... | Converts Symfony uploaded files array to the PSR one.
@param array $uploadedFiles
@return array | [
"Converts",
"Symfony",
"uploaded",
"files",
"array",
"to",
"the",
"PSR",
"one",
"."
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/PsrHttpFactory.php#L85-L102 |
symfony/psr-http-message-bridge | Factory/PsrHttpFactory.php | PsrHttpFactory.createUploadedFile | private function createUploadedFile(UploadedFile $symfonyUploadedFile)
{
return $this->uploadedFileFactory->createUploadedFile(
$this->streamFactory->createStreamFromFile(
$symfonyUploadedFile->getRealPath()
),
(int) $symfonyUploadedFile->getSize(),
... | php | private function createUploadedFile(UploadedFile $symfonyUploadedFile)
{
return $this->uploadedFileFactory->createUploadedFile(
$this->streamFactory->createStreamFromFile(
$symfonyUploadedFile->getRealPath()
),
(int) $symfonyUploadedFile->getSize(),
... | [
"private",
"function",
"createUploadedFile",
"(",
"UploadedFile",
"$",
"symfonyUploadedFile",
")",
"{",
"return",
"$",
"this",
"->",
"uploadedFileFactory",
"->",
"createUploadedFile",
"(",
"$",
"this",
"->",
"streamFactory",
"->",
"createStreamFromFile",
"(",
"$",
"... | Creates a PSR-7 UploadedFile instance from a Symfony one.
@param UploadedFile $symfonyUploadedFile
@return UploadedFileInterface | [
"Creates",
"a",
"PSR",
"-",
"7",
"UploadedFile",
"instance",
"from",
"a",
"Symfony",
"one",
"."
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/PsrHttpFactory.php#L111-L122 |
symfony/psr-http-message-bridge | Factory/PsrHttpFactory.php | PsrHttpFactory.createResponse | public function createResponse(Response $symfonyResponse)
{
$response = $this->responseFactory->createResponse($symfonyResponse->getStatusCode(), Response::$statusTexts[$symfonyResponse->getStatusCode()] ?? '');
if ($symfonyResponse instanceof BinaryFileResponse) {
$stream = $this->stre... | php | public function createResponse(Response $symfonyResponse)
{
$response = $this->responseFactory->createResponse($symfonyResponse->getStatusCode(), Response::$statusTexts[$symfonyResponse->getStatusCode()] ?? '');
if ($symfonyResponse instanceof BinaryFileResponse) {
$stream = $this->stre... | [
"public",
"function",
"createResponse",
"(",
"Response",
"$",
"symfonyResponse",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"responseFactory",
"->",
"createResponse",
"(",
"$",
"symfonyResponse",
"->",
"getStatusCode",
"(",
")",
",",
"Response",
"::",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/PsrHttpFactory.php#L127-L171 |
symfony/psr-http-message-bridge | Factory/HttpFoundationFactory.php | HttpFoundationFactory.createRequest | public function createRequest(ServerRequestInterface $psrRequest)
{
$server = [];
$uri = $psrRequest->getUri();
if ($uri instanceof UriInterface) {
$server['SERVER_NAME'] = $uri->getHost();
$server['SERVER_PORT'] = $uri->getPort();
$server['REQUEST_URI'] ... | php | public function createRequest(ServerRequestInterface $psrRequest)
{
$server = [];
$uri = $psrRequest->getUri();
if ($uri instanceof UriInterface) {
$server['SERVER_NAME'] = $uri->getHost();
$server['SERVER_PORT'] = $uri->getPort();
$server['REQUEST_URI'] ... | [
"public",
"function",
"createRequest",
"(",
"ServerRequestInterface",
"$",
"psrRequest",
")",
"{",
"$",
"server",
"=",
"[",
"]",
";",
"$",
"uri",
"=",
"$",
"psrRequest",
"->",
"getUri",
"(",
")",
";",
"if",
"(",
"$",
"uri",
"instanceof",
"UriInterface",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/HttpFoundationFactory.php#L46-L77 |
symfony/psr-http-message-bridge | Factory/HttpFoundationFactory.php | HttpFoundationFactory.getFiles | private function getFiles(array $uploadedFiles)
{
$files = [];
foreach ($uploadedFiles as $key => $value) {
if ($value instanceof UploadedFileInterface) {
$files[$key] = $this->createUploadedFile($value);
} else {
$files[$key] = $this->getFile... | php | private function getFiles(array $uploadedFiles)
{
$files = [];
foreach ($uploadedFiles as $key => $value) {
if ($value instanceof UploadedFileInterface) {
$files[$key] = $this->createUploadedFile($value);
} else {
$files[$key] = $this->getFile... | [
"private",
"function",
"getFiles",
"(",
"array",
"$",
"uploadedFiles",
")",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"uploadedFiles",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"UploadedFil... | Converts to the input array to $_FILES structure.
@param array $uploadedFiles
@return array | [
"Converts",
"to",
"the",
"input",
"array",
"to",
"$_FILES",
"structure",
"."
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/HttpFoundationFactory.php#L86-L99 |
symfony/psr-http-message-bridge | Factory/HttpFoundationFactory.php | HttpFoundationFactory.createUploadedFile | private function createUploadedFile(UploadedFileInterface $psrUploadedFile)
{
$temporaryPath = '';
$clientFileName = '';
if (UPLOAD_ERR_NO_FILE !== $psrUploadedFile->getError()) {
$temporaryPath = $this->getTemporaryPath();
$psrUploadedFile->moveTo($temporaryPath);
... | php | private function createUploadedFile(UploadedFileInterface $psrUploadedFile)
{
$temporaryPath = '';
$clientFileName = '';
if (UPLOAD_ERR_NO_FILE !== $psrUploadedFile->getError()) {
$temporaryPath = $this->getTemporaryPath();
$psrUploadedFile->moveTo($temporaryPath);
... | [
"private",
"function",
"createUploadedFile",
"(",
"UploadedFileInterface",
"$",
"psrUploadedFile",
")",
"{",
"$",
"temporaryPath",
"=",
"''",
";",
"$",
"clientFileName",
"=",
"''",
";",
"if",
"(",
"UPLOAD_ERR_NO_FILE",
"!==",
"$",
"psrUploadedFile",
"->",
"getErro... | Creates Symfony UploadedFile instance from PSR-7 ones.
@param UploadedFileInterface $psrUploadedFile
@return UploadedFile | [
"Creates",
"Symfony",
"UploadedFile",
"instance",
"from",
"PSR",
"-",
"7",
"ones",
"."
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/HttpFoundationFactory.php#L108-L138 |
symfony/psr-http-message-bridge | Factory/HttpFoundationFactory.php | HttpFoundationFactory.createResponse | public function createResponse(ResponseInterface $psrResponse, bool $streamed = false)
{
$cookies = $psrResponse->getHeader('Set-Cookie');
$psrResponse = $psrResponse->withoutHeader('Set-Cookie');
if ($streamed) {
$response = new StreamedResponse(
$this->createSt... | php | public function createResponse(ResponseInterface $psrResponse, bool $streamed = false)
{
$cookies = $psrResponse->getHeader('Set-Cookie');
$psrResponse = $psrResponse->withoutHeader('Set-Cookie');
if ($streamed) {
$response = new StreamedResponse(
$this->createSt... | [
"public",
"function",
"createResponse",
"(",
"ResponseInterface",
"$",
"psrResponse",
",",
"bool",
"$",
"streamed",
"=",
"false",
")",
"{",
"$",
"cookies",
"=",
"$",
"psrResponse",
"->",
"getHeader",
"(",
"'Set-Cookie'",
")",
";",
"$",
"psrResponse",
"=",
"$... | {@inheritdoc} | [
"{"
] | train | https://github.com/symfony/psr-http-message-bridge/blob/81ae86d3394c994bbff10c6ebcade4fb3fba4e9d/Factory/HttpFoundationFactory.php#L153-L179 |
laravel-admin-extensions/redis-manager | src/DataType/DataType.php | DataType.setTtl | public function setTtl($key, $expire)
{
if (is_null($expire)) {
return;
}
$expire = (int) $expire;
if ($expire > 0) {
$this->getConnection()->expire($key, $expire);
} else {
$this->getConnection()->persist($key);
}
} | php | public function setTtl($key, $expire)
{
if (is_null($expire)) {
return;
}
$expire = (int) $expire;
if ($expire > 0) {
$this->getConnection()->expire($key, $expire);
} else {
$this->getConnection()->persist($key);
}
} | [
"public",
"function",
"setTtl",
"(",
"$",
"key",
",",
"$",
"expire",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"expire",
")",
")",
"{",
"return",
";",
"}",
"$",
"expire",
"=",
"(",
"int",
")",
"$",
"expire",
";",
"if",
"(",
"$",
"expire",
">",
... | Set a timeout on key.
@param string $key
@param int $expire
@return void | [
"Set",
"a",
"timeout",
"on",
"key",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/DataType.php#L75-L88 |
laravel-admin-extensions/redis-manager | src/DataType/Sets.php | Sets.update | public function update(array $params)
{
$key = array_get($params, 'key');
if (array_has($params, 'member')) {
$member = array_get($params, 'member');
$this->getConnection()->sadd($key, $member);
}
if (array_has($params, '_editable')) {
$new = arr... | php | public function update(array $params)
{
$key = array_get($params, 'key');
if (array_has($params, 'member')) {
$member = array_get($params, 'member');
$this->getConnection()->sadd($key, $member);
}
if (array_has($params, '_editable')) {
$new = arr... | [
"public",
"function",
"update",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"if",
"(",
"array_has",
"(",
"$",
"params",
",",
"'member'",
")",
")",
"{",
"$",
"member",
"=",
"array_... | {@inheritdoc} | [
"{"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Sets.php#L18-L36 |
laravel-admin-extensions/redis-manager | src/DataType/Sets.php | Sets.store | public function store(array $params)
{
$key = array_get($params, 'key');
$ttl = array_get($params, 'ttl');
$members = array_get($params, 'members');
$this->getConnection()->sadd($key, $members);
if ($ttl > 0) {
$this->getConnection()->expire($key, $ttl);
... | php | public function store(array $params)
{
$key = array_get($params, 'key');
$ttl = array_get($params, 'ttl');
$members = array_get($params, 'members');
$this->getConnection()->sadd($key, $members);
if ($ttl > 0) {
$this->getConnection()->expire($key, $ttl);
... | [
"public",
"function",
"store",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"ttl",
"=",
"array_get",
"(",
"$",
"params",
",",
"'ttl'",
")",
";",
"$",
"members",
"=",
"array_ge... | {@inheritdoc} | [
"{"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Sets.php#L41-L57 |
laravel-admin-extensions/redis-manager | src/DataType/Sets.php | Sets.remove | public function remove(array $params)
{
$key = array_get($params, 'key');
$member = array_get($params, 'member');
return $this->getConnection()->srem($key, $member);
} | php | public function remove(array $params)
{
$key = array_get($params, 'key');
$member = array_get($params, 'member');
return $this->getConnection()->srem($key, $member);
} | [
"public",
"function",
"remove",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"member",
"=",
"array_get",
"(",
"$",
"params",
",",
"'member'",
")",
";",
"return",
"$",
"this",
... | Remove a member from a set.
@param array $params
@return int | [
"Remove",
"a",
"member",
"from",
"a",
"set",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Sets.php#L66-L72 |
laravel-admin-extensions/redis-manager | src/BootExtension.php | BootExtension.registerRoutes | protected static function registerRoutes()
{
parent::routes(function ($router) {
/* @var \Illuminate\Routing\Router $router */
$router->get('redis', 'Encore\Admin\RedisManager\RedisController@index')->name('redis-index');
$router->delete('redis/key', 'Encore\Admin\RedisMa... | php | protected static function registerRoutes()
{
parent::routes(function ($router) {
/* @var \Illuminate\Routing\Router $router */
$router->get('redis', 'Encore\Admin\RedisManager\RedisController@index')->name('redis-index');
$router->delete('redis/key', 'Encore\Admin\RedisMa... | [
"protected",
"static",
"function",
"registerRoutes",
"(",
")",
"{",
"parent",
"::",
"routes",
"(",
"function",
"(",
"$",
"router",
")",
"{",
"/* @var \\Illuminate\\Routing\\Router $router */",
"$",
"router",
"->",
"get",
"(",
"'redis'",
",",
"'Encore\\Admin\\RedisMa... | Register routes for laravel-admin.
@return void | [
"Register",
"routes",
"for",
"laravel",
"-",
"admin",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/BootExtension.php#L21-L37 |
laravel-admin-extensions/redis-manager | src/RedisController.php | RedisController.index | public function index()
{
return Admin::content(function (Content $content) {
$content->header('Redis manager');
$content->description('Connections');
$content->breadcrumb(['text' => 'Redis manager']);
$connection = request('conn', 'default');
$m... | php | public function index()
{
return Admin::content(function (Content $content) {
$content->header('Redis manager');
$content->description('Connections');
$content->breadcrumb(['text' => 'Redis manager']);
$connection = request('conn', 'default');
$m... | [
"public",
"function",
"index",
"(",
")",
"{",
"return",
"Admin",
"::",
"content",
"(",
"function",
"(",
"Content",
"$",
"content",
")",
"{",
"$",
"content",
"->",
"header",
"(",
"'Redis manager'",
")",
";",
"$",
"content",
"->",
"description",
"(",
"'Con... | Index page.
@return Content | [
"Index",
"page",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisController.php#L18-L41 |
laravel-admin-extensions/redis-manager | src/RedisController.php | RedisController.edit | public function edit(Request $request)
{
return Admin::content(function (Content $content) use ($request) {
$connection = $request->get('conn', 'default');
$manager = $this->manager();
$variables = [
'conn' => $connection,
'info' ... | php | public function edit(Request $request)
{
return Admin::content(function (Content $content) use ($request) {
$connection = $request->get('conn', 'default');
$manager = $this->manager();
$variables = [
'conn' => $connection,
'info' ... | [
"public",
"function",
"edit",
"(",
"Request",
"$",
"request",
")",
"{",
"return",
"Admin",
"::",
"content",
"(",
"function",
"(",
"Content",
"$",
"content",
")",
"use",
"(",
"$",
"request",
")",
"{",
"$",
"connection",
"=",
"$",
"request",
"->",
"get",... | Edit page.
@param Request $request
@return Content | [
"Edit",
"page",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisController.php#L50-L78 |
laravel-admin-extensions/redis-manager | src/RedisController.php | RedisController.store | public function store(Request $request)
{
$type = $request->get('type');
return $this->manager()->{$type}()->store($request->all());
} | php | public function store(Request $request)
{
$type = $request->get('type');
return $this->manager()->{$type}()->store($request->all());
} | [
"public",
"function",
"store",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"type",
"=",
"$",
"request",
"->",
"get",
"(",
"'type'",
")",
";",
"return",
"$",
"this",
"->",
"manager",
"(",
")",
"->",
"{",
"$",
"type",
"}",
"(",
")",
"->",
"store... | @param Request $request
@return mixed | [
"@param",
"Request",
"$request"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisController.php#L118-L123 |
laravel-admin-extensions/redis-manager | src/RedisController.php | RedisController.remove | public function remove(Request $request)
{
$type = $request->get('type');
return $this->manager()->{$type}()->remove($request->all());
} | php | public function remove(Request $request)
{
$type = $request->get('type');
return $this->manager()->{$type}()->remove($request->all());
} | [
"public",
"function",
"remove",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"type",
"=",
"$",
"request",
"->",
"get",
"(",
"'type'",
")",
";",
"return",
"$",
"this",
"->",
"manager",
"(",
")",
"->",
"{",
"$",
"type",
"}",
"(",
")",
"->",
"remo... | @param Request $request
@return mixed | [
"@param",
"Request",
"$request"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisController.php#L150-L155 |
laravel-admin-extensions/redis-manager | src/RedisController.php | RedisController.console | public function console(Request $request)
{
return Admin::content(function (Content $content) use ($request) {
$connection = $request->get('conn', 'default');
$manager = $this->manager();
$vars = [
'conn' => $connection,
'info' ... | php | public function console(Request $request)
{
return Admin::content(function (Content $content) use ($request) {
$connection = $request->get('conn', 'default');
$manager = $this->manager();
$vars = [
'conn' => $connection,
'info' ... | [
"public",
"function",
"console",
"(",
"Request",
"$",
"request",
")",
"{",
"return",
"Admin",
"::",
"content",
"(",
"function",
"(",
"Content",
"$",
"content",
")",
"use",
"(",
"$",
"request",
")",
"{",
"$",
"connection",
"=",
"$",
"request",
"->",
"ge... | Redis console interface.
@param Request $request
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | [
"Redis",
"console",
"interface",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisController.php#L174-L197 |
laravel-admin-extensions/redis-manager | src/RedisController.php | RedisController.execute | public function execute(Request $request)
{
$command = $request->get('command');
try {
$result = $this->manager()->execute($command);
} catch (\Exception $exception) {
return $this->renderException($exception);
}
if (is_string($result) && Str::starts... | php | public function execute(Request $request)
{
$command = $request->get('command');
try {
$result = $this->manager()->execute($command);
} catch (\Exception $exception) {
return $this->renderException($exception);
}
if (is_string($result) && Str::starts... | [
"public",
"function",
"execute",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"command",
"=",
"$",
"request",
"->",
"get",
"(",
"'command'",
")",
";",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"manager",
"(",
")",
"->",
"execute",
"(",
"... | Execute a redis command.
@param Request $request
@return bool|string | [
"Execute",
"a",
"redis",
"command",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisController.php#L206-L221 |
laravel-admin-extensions/redis-manager | src/RedisController.php | RedisController.getDumpedHtml | protected function getDumpedHtml($var)
{
ob_start();
dump($var);
$content = ob_get_contents();
ob_get_clean();
return substr($content, strpos($content, '<pre '));
} | php | protected function getDumpedHtml($var)
{
ob_start();
dump($var);
$content = ob_get_contents();
ob_get_clean();
return substr($content, strpos($content, '<pre '));
} | [
"protected",
"function",
"getDumpedHtml",
"(",
"$",
"var",
")",
"{",
"ob_start",
"(",
")",
";",
"dump",
"(",
"$",
"var",
")",
";",
"$",
"content",
"=",
"ob_get_contents",
"(",
")",
";",
"ob_get_clean",
"(",
")",
";",
"return",
"substr",
"(",
"$",
"co... | Get html of dumped variable.
@param mixed $var
@return bool|string | [
"Get",
"html",
"of",
"dumped",
"variable",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisController.php#L245-L256 |
laravel-admin-extensions/redis-manager | src/RedisManager.php | RedisManager.getConnection | public function getConnection($connection = null)
{
if ($connection) {
$this->connection = $connection;
}
return Redis::connection($this->connection);
} | php | public function getConnection($connection = null)
{
if ($connection) {
$this->connection = $connection;
}
return Redis::connection($this->connection);
} | [
"public",
"function",
"getConnection",
"(",
"$",
"connection",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"connection",
")",
"{",
"$",
"this",
"->",
"connection",
"=",
"$",
"connection",
";",
"}",
"return",
"Redis",
"::",
"connection",
"(",
"$",
"this",
"-... | Get a registered connection instance.
@param string $connection
@return Connection | [
"Get",
"a",
"registered",
"connection",
"instance",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisManager.php#L143-L150 |
laravel-admin-extensions/redis-manager | src/RedisManager.php | RedisManager.scan | public function scan($pattern = '*', $count = 100)
{
$client = $this->getConnection();
$keys = [];
foreach (new Keyspace($client->client(), $pattern) as $item) {
$keys[] = $item;
if (count($keys) == $count) {
break;
}
}
$... | php | public function scan($pattern = '*', $count = 100)
{
$client = $this->getConnection();
$keys = [];
foreach (new Keyspace($client->client(), $pattern) as $item) {
$keys[] = $item;
if (count($keys) == $count) {
break;
}
}
$... | [
"public",
"function",
"scan",
"(",
"$",
"pattern",
"=",
"'*'",
",",
"$",
"count",
"=",
"100",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"keys",
"=",
"[",
"]",
";",
"foreach",
"(",
"new",
"Keyspace",
"("... | Scan keys in redis by giving pattern.
@param string $pattern
@param int $count
@return array|\Predis\Pipeline\Pipeline | [
"Scan",
"keys",
"in",
"redis",
"by",
"giving",
"pattern",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisManager.php#L170-L195 |
laravel-admin-extensions/redis-manager | src/RedisManager.php | RedisManager.fetch | public function fetch($key)
{
if (!$this->getConnection()->exists($key)) {
return [];
}
$type = $this->getConnection()->type($key)->__toString();
/** @var DataType $class */
$class = $this->{$type}();
$value = $class->fetch($key);
$ttl = $class-... | php | public function fetch($key)
{
if (!$this->getConnection()->exists($key)) {
return [];
}
$type = $this->getConnection()->type($key)->__toString();
/** @var DataType $class */
$class = $this->{$type}();
$value = $class->fetch($key);
$ttl = $class-... | [
"public",
"function",
"fetch",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"exists",
"(",
"$",
"key",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"type",
"=",
"$",
"this",
"->",
"getConne... | Fetch value of a giving key.
@param string $key
@return array | [
"Fetch",
"value",
"of",
"a",
"giving",
"key",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisManager.php#L204-L219 |
laravel-admin-extensions/redis-manager | src/RedisManager.php | RedisManager.update | public function update(Request $request)
{
$key = $request->get('key');
$type = $request->get('type');
/** @var DataType $class */
$class = $this->{$type}();
$class->update($request->all());
$class->setTtl($key, $request->get('ttl'));
} | php | public function update(Request $request)
{
$key = $request->get('key');
$type = $request->get('type');
/** @var DataType $class */
$class = $this->{$type}();
$class->update($request->all());
$class->setTtl($key, $request->get('ttl'));
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"key",
"=",
"$",
"request",
"->",
"get",
"(",
"'key'",
")",
";",
"$",
"type",
"=",
"$",
"request",
"->",
"get",
"(",
"'type'",
")",
";",
"/** @var DataType $class */",
"$",
... | Update a specified key.
@param Request $request
@return bool | [
"Update",
"a",
"specified",
"key",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisManager.php#L228-L239 |
laravel-admin-extensions/redis-manager | src/RedisManager.php | RedisManager.del | public function del($key)
{
if (is_string($key)) {
$key = [$key];
}
return $this->getConnection()->del($key);
} | php | public function del($key)
{
if (is_string($key)) {
$key = [$key];
}
return $this->getConnection()->del($key);
} | [
"public",
"function",
"del",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"$",
"key",
"=",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"del",
"(",
"$",
"k... | Remove the specified key.
@param string $key
@return int | [
"Remove",
"the",
"specified",
"key",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/RedisManager.php#L248-L255 |
laravel-admin-extensions/redis-manager | src/DataType/SortedSets.php | SortedSets.store | public function store(array $params)
{
$key = array_get($params, 'key');
$ttl = array_get($params, 'ttl');
$score = array_get($params, 'score');
$member = array_get($params, 'member');
$this->getConnection()->zadd($key, [$member => $score]);
if ($ttl > 0) {
... | php | public function store(array $params)
{
$key = array_get($params, 'key');
$ttl = array_get($params, 'ttl');
$score = array_get($params, 'score');
$member = array_get($params, 'member');
$this->getConnection()->zadd($key, [$member => $score]);
if ($ttl > 0) {
... | [
"public",
"function",
"store",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"ttl",
"=",
"array_get",
"(",
"$",
"params",
",",
"'ttl'",
")",
";",
"$",
"score",
"=",
"array_get"... | {@inheritdoc} | [
"{"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/SortedSets.php#L36-L53 |
laravel-admin-extensions/redis-manager | src/DataType/SortedSets.php | SortedSets.remove | public function remove(array $params)
{
$key = array_get($params, 'key');
$member = array_get($params, 'member');
return $this->getConnection()->zrem($key, $member);
} | php | public function remove(array $params)
{
$key = array_get($params, 'key');
$member = array_get($params, 'member');
return $this->getConnection()->zrem($key, $member);
} | [
"public",
"function",
"remove",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"member",
"=",
"array_get",
"(",
"$",
"params",
",",
"'member'",
")",
";",
"return",
"$",
"this",
... | Remove a member from a sorted set.
@param array $params
@return int | [
"Remove",
"a",
"member",
"from",
"a",
"sorted",
"set",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/SortedSets.php#L62-L68 |
laravel-admin-extensions/redis-manager | src/DataType/Lists.php | Lists.update | public function update(array $params)
{
$key = array_get($params, 'key');
if (array_has($params, 'push')) {
$item = array_get($params, 'item');
$command = $params['push'] == 'left' ? 'lpush' : 'rpush';
$this->getConnection()->{$command}($key, $item);
}
... | php | public function update(array $params)
{
$key = array_get($params, 'key');
if (array_has($params, 'push')) {
$item = array_get($params, 'item');
$command = $params['push'] == 'left' ? 'lpush' : 'rpush';
$this->getConnection()->{$command}($key, $item);
}
... | [
"public",
"function",
"update",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"if",
"(",
"array_has",
"(",
"$",
"params",
",",
"'push'",
")",
")",
"{",
"$",
"item",
"=",
"array_get"... | {@inheritdoc} | [
"{"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Lists.php#L18-L35 |
laravel-admin-extensions/redis-manager | src/DataType/Lists.php | Lists.store | public function store(array $params)
{
$key = array_get($params, 'key');
$item = array_get($params, 'item');
$ttl = array_get($params, 'ttl');
$this->getConnection()->rpush($key, [$item]);
if ($ttl > 0) {
$this->getConnection()->expire($key, $ttl);
}
... | php | public function store(array $params)
{
$key = array_get($params, 'key');
$item = array_get($params, 'item');
$ttl = array_get($params, 'ttl');
$this->getConnection()->rpush($key, [$item]);
if ($ttl > 0) {
$this->getConnection()->expire($key, $ttl);
}
... | [
"public",
"function",
"store",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"item",
"=",
"array_get",
"(",
"$",
"params",
",",
"'item'",
")",
";",
"$",
"ttl",
"=",
"array_get"... | {@inheritdoc} | [
"{"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Lists.php#L40-L56 |
laravel-admin-extensions/redis-manager | src/DataType/Lists.php | Lists.remove | public function remove(array $params)
{
$key = array_get($params, 'key');
$index = array_get($params, 'index');
$lua = <<<'LUA'
redis.call('lset', KEYS[1], ARGV[1], '__DELETED__');
redis.call('lrem', KEYS[1], 1, '__DELETED__');
LUA;
return $this->getConnection()->eval($lua, 1, $key... | php | public function remove(array $params)
{
$key = array_get($params, 'key');
$index = array_get($params, 'index');
$lua = <<<'LUA'
redis.call('lset', KEYS[1], ARGV[1], '__DELETED__');
redis.call('lrem', KEYS[1], 1, '__DELETED__');
LUA;
return $this->getConnection()->eval($lua, 1, $key... | [
"public",
"function",
"remove",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"index",
"=",
"array_get",
"(",
"$",
"params",
",",
"'index'",
")",
";",
"$",
"lua",
"=",
" <<<'LU... | Remove a member from list by index.
@param array $params
@return mixed | [
"Remove",
"a",
"member",
"from",
"list",
"by",
"index",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Lists.php#L65-L76 |
laravel-admin-extensions/redis-manager | src/DataType/Hashes.php | Hashes.update | public function update(array $params)
{
$key = array_get($params, 'key');
if (array_has($params, 'field')) {
$field = array_get($params, 'field');
$value = array_get($params, 'value');
$this->getConnection()->hset($key, $field, $value);
}
if (ar... | php | public function update(array $params)
{
$key = array_get($params, 'key');
if (array_has($params, 'field')) {
$field = array_get($params, 'field');
$value = array_get($params, 'value');
$this->getConnection()->hset($key, $field, $value);
}
if (ar... | [
"public",
"function",
"update",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"if",
"(",
"array_has",
"(",
"$",
"params",
",",
"'field'",
")",
")",
"{",
"$",
"field",
"=",
"array_ge... | {@inheritdoc} | [
"{"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Hashes.php#L18-L35 |
laravel-admin-extensions/redis-manager | src/DataType/Hashes.php | Hashes.store | public function store(array $params)
{
$key = array_get($params, 'key');
$ttl = array_get($params, 'ttl');
$field = array_get($params, 'field');
$value = array_get($params, 'value');
$this->getConnection()->hset($key, $field, $value);
if ($ttl > 0) {
$th... | php | public function store(array $params)
{
$key = array_get($params, 'key');
$ttl = array_get($params, 'ttl');
$field = array_get($params, 'field');
$value = array_get($params, 'value');
$this->getConnection()->hset($key, $field, $value);
if ($ttl > 0) {
$th... | [
"public",
"function",
"store",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"ttl",
"=",
"array_get",
"(",
"$",
"params",
",",
"'ttl'",
")",
";",
"$",
"field",
"=",
"array_get"... | {@inheritdoc} | [
"{"
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Hashes.php#L40-L57 |
laravel-admin-extensions/redis-manager | src/DataType/Hashes.php | Hashes.remove | public function remove(array $params)
{
$key = array_get($params, 'key');
$field = array_get($params, 'field');
return $this->getConnection()->hdel($key, [$field]);
} | php | public function remove(array $params)
{
$key = array_get($params, 'key');
$field = array_get($params, 'field');
return $this->getConnection()->hdel($key, [$field]);
} | [
"public",
"function",
"remove",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"key",
"=",
"array_get",
"(",
"$",
"params",
",",
"'key'",
")",
";",
"$",
"field",
"=",
"array_get",
"(",
"$",
"params",
",",
"'field'",
")",
";",
"return",
"$",
"this",
"-... | Remove a field from a hash.
@param array $params
@return int | [
"Remove",
"a",
"field",
"from",
"a",
"hash",
"."
] | train | https://github.com/laravel-admin-extensions/redis-manager/blob/ef2bee838e8c6b8744ce9cfa6308958f726e5061/src/DataType/Hashes.php#L66-L72 |
excelwebzone/EWZRecaptchaBundle | src/Extension/ReCaptcha/RequestMethod/Post.php | Post.submit | public function submit(RequestParameters $params)
{
/**
* PHP 5.6.0 changed the way you specify the peer name for SSL context options.
* Using "CN_name" will still work, but it will raise deprecated errors.
*/
$peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_na... | php | public function submit(RequestParameters $params)
{
/**
* PHP 5.6.0 changed the way you specify the peer name for SSL context options.
* Using "CN_name" will still work, but it will raise deprecated errors.
*/
$peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_na... | [
"public",
"function",
"submit",
"(",
"RequestParameters",
"$",
"params",
")",
"{",
"/**\n * PHP 5.6.0 changed the way you specify the peer name for SSL context options.\n * Using \"CN_name\" will still work, but it will raise deprecated errors.\n */",
"$",
"peer_key",
... | Submit the POST request with the specified parameters.
@param RequestParameters $params Request parameters
@return string Body of the reCAPTCHA response | [
"Submit",
"the",
"POST",
"request",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/excelwebzone/EWZRecaptchaBundle/blob/0ab877583961efac961d651fd3bcc3bfcf3d543c/src/Extension/ReCaptcha/RequestMethod/Post.php#L44-L67 |
excelwebzone/EWZRecaptchaBundle | src/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ewz_recaptcha');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBui... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ewz_recaptcha');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBui... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'ewz_recaptcha'",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"rootNode",
"=",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/excelwebzone/EWZRecaptchaBundle/blob/0ab877583961efac961d651fd3bcc3bfcf3d543c/src/DependencyInjection/Configuration.php#L17-L46 |
excelwebzone/EWZRecaptchaBundle | src/Validator/Constraints/IsTrueValidator.php | IsTrueValidator.validate | public function validate($value, Constraint $constraint)
{
// if recaptcha is disabled, always valid
if (!$this->enabled) {
return;
}
// if we have an authorized role
if ($this->authorizationChecker
&& count($this->trustedRoles) > 0
&& $th... | php | public function validate($value, Constraint $constraint)
{
// if recaptcha is disabled, always valid
if (!$this->enabled) {
return;
}
// if we have an authorized role
if ($this->authorizationChecker
&& count($this->trustedRoles) > 0
&& $th... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"// if recaptcha is disabled, always valid",
"if",
"(",
"!",
"$",
"this",
"->",
"enabled",
")",
"{",
"return",
";",
"}",
"// if we have an authorized role",
"if",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/excelwebzone/EWZRecaptchaBundle/blob/0ab877583961efac961d651fd3bcc3bfcf3d543c/src/Validator/Constraints/IsTrueValidator.php#L115-L150 |
excelwebzone/EWZRecaptchaBundle | src/Form/Type/EWZRecaptchaType.php | EWZRecaptchaType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars = array_replace($view->vars, array(
'ewz_recaptcha_enabled' => $this->enabled,
'ewz_recaptcha_ajax' => $this->ajax,
'ewz_recaptcha_apihost' => $this->apiHost
));
... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars = array_replace($view->vars, array(
'ewz_recaptcha_enabled' => $this->enabled,
'ewz_recaptcha_ajax' => $this->ajax,
'ewz_recaptcha_apihost' => $this->apiHost
));
... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"view",
"->",
"vars",
"=",
"array_replace",
"(",
"$",
"view",
"->",
"vars",
",",
"array",
"(",
"'ewz_recaptch... | {@inheritdoc} | [
"{"
] | train | https://github.com/excelwebzone/EWZRecaptchaBundle/blob/0ab877583961efac961d651fd3bcc3bfcf3d543c/src/Form/Type/EWZRecaptchaType.php#L84-L111 |
excelwebzone/EWZRecaptchaBundle | src/Form/Type/EWZRecaptchaType.php | EWZRecaptchaType.getScriptURL | public function getScriptURL($key)
{
return isset($this->scripts[$key]) ? $this->scripts[$key] : null;
} | php | public function getScriptURL($key)
{
return isset($this->scripts[$key]) ? $this->scripts[$key] : null;
} | [
"public",
"function",
"getScriptURL",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"scripts",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"scripts",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Gets the Javascript source URLs.
@param string $key The script name
@return string The javascript source URL | [
"Gets",
"the",
"Javascript",
"source",
"URLs",
"."
] | train | https://github.com/excelwebzone/EWZRecaptchaBundle/blob/0ab877583961efac961d651fd3bcc3bfcf3d543c/src/Form/Type/EWZRecaptchaType.php#L163-L166 |
excelwebzone/EWZRecaptchaBundle | src/DependencyInjection/EWZRecaptchaExtension.php | EWZRecaptchaExtension.registerWidget | protected function registerWidget(ContainerBuilder $container)
{
$templatingEngines = $container->hasParameter('templating.engines')
? $container->getParameter('templating.engines')
: array('twig');
if (in_array('php', $templatingEngines)) {
$formResource = 'EWZR... | php | protected function registerWidget(ContainerBuilder $container)
{
$templatingEngines = $container->hasParameter('templating.engines')
? $container->getParameter('templating.engines')
: array('twig');
if (in_array('php', $templatingEngines)) {
$formResource = 'EWZR... | [
"protected",
"function",
"registerWidget",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"templatingEngines",
"=",
"$",
"container",
"->",
"hasParameter",
"(",
"'templating.engines'",
")",
"?",
"$",
"container",
"->",
"getParameter",
"(",
"'templating.en... | Registers the form widget.
@param ContainerBuilder $container | [
"Registers",
"the",
"form",
"widget",
"."
] | train | https://github.com/excelwebzone/EWZRecaptchaBundle/blob/0ab877583961efac961d651fd3bcc3bfcf3d543c/src/DependencyInjection/EWZRecaptchaExtension.php#L38-L61 |
spatie/image | src/ManipulationSequence.php | ManipulationSequence.addManipulation | public function addManipulation(string $operation, string $argument)
{
$lastIndex = count($this->groups) - 1;
$this->groups[$lastIndex][$operation] = $argument;
return $this;
} | php | public function addManipulation(string $operation, string $argument)
{
$lastIndex = count($this->groups) - 1;
$this->groups[$lastIndex][$operation] = $argument;
return $this;
} | [
"public",
"function",
"addManipulation",
"(",
"string",
"$",
"operation",
",",
"string",
"$",
"argument",
")",
"{",
"$",
"lastIndex",
"=",
"count",
"(",
"$",
"this",
"->",
"groups",
")",
"-",
"1",
";",
"$",
"this",
"->",
"groups",
"[",
"$",
"lastIndex"... | @param string $operation
@param string $argument
@return $this | [
"@param",
"string",
"$operation",
"@param",
"string",
"$argument"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/ManipulationSequence.php#L25-L32 |
spatie/image | src/ManipulationSequence.php | ManipulationSequence.merge | public function merge(self $sequence)
{
$sequenceArray = $sequence->toArray();
$this->mergeArray($sequenceArray);
return $this;
} | php | public function merge(self $sequence)
{
$sequenceArray = $sequence->toArray();
$this->mergeArray($sequenceArray);
return $this;
} | [
"public",
"function",
"merge",
"(",
"self",
"$",
"sequence",
")",
"{",
"$",
"sequenceArray",
"=",
"$",
"sequence",
"->",
"toArray",
"(",
")",
";",
"$",
"this",
"->",
"mergeArray",
"(",
"$",
"sequenceArray",
")",
";",
"return",
"$",
"this",
";",
"}"
] | @param \Spatie\Image\ManipulationSequence $sequence
@return $this | [
"@param",
"\\",
"Spatie",
"\\",
"Image",
"\\",
"ManipulationSequence",
"$sequence"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/ManipulationSequence.php#L39-L46 |
spatie/image | src/ManipulationSequence.php | ManipulationSequence.removeManipulation | public function removeManipulation(string $manipulationName)
{
foreach ($this->groups as &$group) {
if (array_key_exists($manipulationName, $group)) {
unset($group[$manipulationName]);
}
}
return $this;
} | php | public function removeManipulation(string $manipulationName)
{
foreach ($this->groups as &$group) {
if (array_key_exists($manipulationName, $group)) {
unset($group[$manipulationName]);
}
}
return $this;
} | [
"public",
"function",
"removeManipulation",
"(",
"string",
"$",
"manipulationName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"groups",
"as",
"&",
"$",
"group",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"manipulationName",
",",
"$",
"group",
")... | @param string $manipulationName
@return $this | [
"@param",
"string",
"$manipulationName"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/ManipulationSequence.php#L91-L100 |
spatie/image | src/ManipulationSequence.php | ManipulationSequence.getFirstManipulationArgument | public function getFirstManipulationArgument($searchManipulationName)
{
foreach ($this->groups as $group) {
foreach ($group as $name => $argument) {
if ($name === $searchManipulationName) {
return $argument;
}
}
return;... | php | public function getFirstManipulationArgument($searchManipulationName)
{
foreach ($this->groups as $group) {
foreach ($group as $name => $argument) {
if ($name === $searchManipulationName) {
return $argument;
}
}
return;... | [
"public",
"function",
"getFirstManipulationArgument",
"(",
"$",
"searchManipulationName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"groups",
"as",
"$",
"group",
")",
"{",
"foreach",
"(",
"$",
"group",
"as",
"$",
"name",
"=>",
"$",
"argument",
")",
"{",... | /*
Determine if the sequences contain a manipulation with the given name. | [
"/",
"*",
"Determine",
"if",
"the",
"sequences",
"contain",
"a",
"manipulation",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/ManipulationSequence.php#L125-L136 |
spatie/image | src/ManipulationSequence.php | ManipulationSequence.contains | public function contains($searchManipulationName)
{
foreach ($this->groups as $group) {
foreach ($group as $name => $argument) {
if ($name === $searchManipulationName) {
return true;
}
}
return false;
}
} | php | public function contains($searchManipulationName)
{
foreach ($this->groups as $group) {
foreach ($group as $name => $argument) {
if ($name === $searchManipulationName) {
return true;
}
}
return false;
}
} | [
"public",
"function",
"contains",
"(",
"$",
"searchManipulationName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"groups",
"as",
"$",
"group",
")",
"{",
"foreach",
"(",
"$",
"group",
"as",
"$",
"name",
"=>",
"$",
"argument",
")",
"{",
"if",
"(",
"$... | /*
Determine if the sequences contain a manipulation with the given name. | [
"/",
"*",
"Determine",
"if",
"the",
"sequences",
"contain",
"a",
"manipulation",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/ManipulationSequence.php#L141-L152 |
spatie/image | src/Image.php | Image.useImageDriver | public function useImageDriver(string $imageDriver)
{
if (! in_array($imageDriver, ['gd', 'imagick'])) {
throw InvalidImageDriver::driver($imageDriver);
}
$this->imageDriver = $imageDriver;
InterventionImage::configure([
'driver' => $this->imageDriver,
... | php | public function useImageDriver(string $imageDriver)
{
if (! in_array($imageDriver, ['gd', 'imagick'])) {
throw InvalidImageDriver::driver($imageDriver);
}
$this->imageDriver = $imageDriver;
InterventionImage::configure([
'driver' => $this->imageDriver,
... | [
"public",
"function",
"useImageDriver",
"(",
"string",
"$",
"imageDriver",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"imageDriver",
",",
"[",
"'gd'",
",",
"'imagick'",
"]",
")",
")",
"{",
"throw",
"InvalidImageDriver",
"::",
"driver",
"(",
"$",
"im... | @param string $imageDriver
@return $this
@throws InvalidImageDriver | [
"@param",
"string",
"$imageDriver"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Image.php#L55-L68 |
spatie/image | src/Image.php | Image.manipulate | public function manipulate($manipulations)
{
if (is_callable($manipulations)) {
$manipulations($this->manipulations);
}
if ($manipulations instanceof Manipulations) {
$this->manipulations->mergeManipulations($manipulations);
}
return $this;
} | php | public function manipulate($manipulations)
{
if (is_callable($manipulations)) {
$manipulations($this->manipulations);
}
if ($manipulations instanceof Manipulations) {
$this->manipulations->mergeManipulations($manipulations);
}
return $this;
} | [
"public",
"function",
"manipulate",
"(",
"$",
"manipulations",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"manipulations",
")",
")",
"{",
"$",
"manipulations",
"(",
"$",
"this",
"->",
"manipulations",
")",
";",
"}",
"if",
"(",
"$",
"manipulations",
"i... | @param callable|$manipulations
@return $this | [
"@param",
"callable|$manipulations"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Image.php#L75-L86 |
spatie/image | src/GlideConversion.php | GlideConversion.extractWatermarkPath | private function extractWatermarkPath(&$manipulationGroup)
{
if (array_key_exists('watermark', $manipulationGroup)) {
$watermarkPath = dirname($manipulationGroup['watermark']);
$manipulationGroup['watermark'] = basename($manipulationGroup['watermark']);
return $watermar... | php | private function extractWatermarkPath(&$manipulationGroup)
{
if (array_key_exists('watermark', $manipulationGroup)) {
$watermarkPath = dirname($manipulationGroup['watermark']);
$manipulationGroup['watermark'] = basename($manipulationGroup['watermark']);
return $watermar... | [
"private",
"function",
"extractWatermarkPath",
"(",
"&",
"$",
"manipulationGroup",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'watermark'",
",",
"$",
"manipulationGroup",
")",
")",
"{",
"$",
"watermarkPath",
"=",
"dirname",
"(",
"$",
"manipulationGroup",
"["... | Removes the watermark path from the manipulationGroup and returns it. This way it can be injected into the Glide
server as the `watermarks` path.
@param $manipulationGroup
@return null|string | [
"Removes",
"the",
"watermark",
"path",
"from",
"the",
"manipulationGroup",
"and",
"returns",
"it",
".",
"This",
"way",
"it",
"can",
"be",
"injected",
"into",
"the",
"Glide",
"server",
"as",
"the",
"watermarks",
"path",
"."
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/GlideConversion.php#L101-L110 |
spatie/image | src/Manipulations.php | Manipulations.orientation | public function orientation(string $orientation)
{
if (! $this->validateManipulation($orientation, 'orientation')) {
throw InvalidManipulation::invalidParameter(
'orientation',
$orientation,
$this->getValidManipulationOptions('orientation')
... | php | public function orientation(string $orientation)
{
if (! $this->validateManipulation($orientation, 'orientation')) {
throw InvalidManipulation::invalidParameter(
'orientation',
$orientation,
$this->getValidManipulationOptions('orientation')
... | [
"public",
"function",
"orientation",
"(",
"string",
"$",
"orientation",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateManipulation",
"(",
"$",
"orientation",
",",
"'orientation'",
")",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidParameter",
... | @param string $orientation
@return $this
@throws InvalidManipulation | [
"@param",
"string",
"$orientation"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L83-L94 |
spatie/image | src/Manipulations.php | Manipulations.crop | public function crop(string $cropMethod, int $width, int $height)
{
if (! $this->validateManipulation($cropMethod, 'crop')) {
throw InvalidManipulation::invalidParameter(
'cropmethod',
$cropMethod,
$this->getValidManipulationOptions('crop')
... | php | public function crop(string $cropMethod, int $width, int $height)
{
if (! $this->validateManipulation($cropMethod, 'crop')) {
throw InvalidManipulation::invalidParameter(
'cropmethod',
$cropMethod,
$this->getValidManipulationOptions('crop')
... | [
"public",
"function",
"crop",
"(",
"string",
"$",
"cropMethod",
",",
"int",
"$",
"width",
",",
"int",
"$",
"height",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateManipulation",
"(",
"$",
"cropMethod",
",",
"'crop'",
")",
")",
"{",
"throw",
"... | @param string $cropMethod
@param int $width
@param int $height
@return $this
@throws InvalidManipulation | [
"@param",
"string",
"$cropMethod",
"@param",
"int",
"$width",
"@param",
"int",
"$height"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L125-L139 |
spatie/image | src/Manipulations.php | Manipulations.focalCrop | public function focalCrop(int $width, int $height, int $focalX, int $focalY)
{
$this->width($width);
$this->height($height);
return $this->addManipulation('crop', "crop-{$focalX}-{$focalY}");
} | php | public function focalCrop(int $width, int $height, int $focalX, int $focalY)
{
$this->width($width);
$this->height($height);
return $this->addManipulation('crop', "crop-{$focalX}-{$focalY}");
} | [
"public",
"function",
"focalCrop",
"(",
"int",
"$",
"width",
",",
"int",
"$",
"height",
",",
"int",
"$",
"focalX",
",",
"int",
"$",
"focalY",
")",
"{",
"$",
"this",
"->",
"width",
"(",
"$",
"width",
")",
";",
"$",
"this",
"->",
"height",
"(",
"$"... | @param int $width
@param int $height
@param int $focalX Crop center X in percent
@param int $focalY Crop center Y in percent
@return $this | [
"@param",
"int",
"$width",
"@param",
"int",
"$height",
"@param",
"int",
"$focalX",
"Crop",
"center",
"X",
"in",
"percent",
"@param",
"int",
"$focalY",
"Crop",
"center",
"Y",
"in",
"percent"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L149-L155 |
spatie/image | src/Manipulations.php | Manipulations.manualCrop | public function manualCrop(int $width, int $height, int $x, int $y)
{
if ($width < 0) {
throw InvalidManipulation::invalidWidth($width);
}
if ($height < 0) {
throw InvalidManipulation::invalidWidth($height);
}
return $this->addManipulation('manualCro... | php | public function manualCrop(int $width, int $height, int $x, int $y)
{
if ($width < 0) {
throw InvalidManipulation::invalidWidth($width);
}
if ($height < 0) {
throw InvalidManipulation::invalidWidth($height);
}
return $this->addManipulation('manualCro... | [
"public",
"function",
"manualCrop",
"(",
"int",
"$",
"width",
",",
"int",
"$",
"height",
",",
"int",
"$",
"x",
",",
"int",
"$",
"y",
")",
"{",
"if",
"(",
"$",
"width",
"<",
"0",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidWidth",
"(",
"... | @param int $width
@param int $height
@param int $x
@param int $y
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$width",
"@param",
"int",
"$height",
"@param",
"int",
"$x",
"@param",
"int",
"$y"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L167-L178 |
spatie/image | src/Manipulations.php | Manipulations.width | public function width(int $width)
{
if ($width < 0) {
throw InvalidManipulation::invalidWidth($width);
}
return $this->addManipulation('width', $width);
} | php | public function width(int $width)
{
if ($width < 0) {
throw InvalidManipulation::invalidWidth($width);
}
return $this->addManipulation('width', $width);
} | [
"public",
"function",
"width",
"(",
"int",
"$",
"width",
")",
"{",
"if",
"(",
"$",
"width",
"<",
"0",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidWidth",
"(",
"$",
"width",
")",
";",
"}",
"return",
"$",
"this",
"->",
"addManipulation",
"(",... | @param int $width
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$width"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L187-L194 |
spatie/image | src/Manipulations.php | Manipulations.height | public function height(int $height)
{
if ($height < 0) {
throw InvalidManipulation::invalidHeight($height);
}
return $this->addManipulation('height', $height);
} | php | public function height(int $height)
{
if ($height < 0) {
throw InvalidManipulation::invalidHeight($height);
}
return $this->addManipulation('height', $height);
} | [
"public",
"function",
"height",
"(",
"int",
"$",
"height",
")",
"{",
"if",
"(",
"$",
"height",
"<",
"0",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidHeight",
"(",
"$",
"height",
")",
";",
"}",
"return",
"$",
"this",
"->",
"addManipulation",
... | @param int $height
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$height"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L203-L210 |
spatie/image | src/Manipulations.php | Manipulations.fit | public function fit(string $fitMethod, int $width, int $height)
{
if (! $this->validateManipulation($fitMethod, 'fit')) {
throw InvalidManipulation::invalidParameter(
'fit',
$fitMethod,
$this->getValidManipulationOptions('fit')
);
... | php | public function fit(string $fitMethod, int $width, int $height)
{
if (! $this->validateManipulation($fitMethod, 'fit')) {
throw InvalidManipulation::invalidParameter(
'fit',
$fitMethod,
$this->getValidManipulationOptions('fit')
);
... | [
"public",
"function",
"fit",
"(",
"string",
"$",
"fitMethod",
",",
"int",
"$",
"width",
",",
"int",
"$",
"height",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateManipulation",
"(",
"$",
"fitMethod",
",",
"'fit'",
")",
")",
"{",
"throw",
"Inva... | @param string $fitMethod
@param int $width
@param int $height
@return $this
@throws InvalidManipulation | [
"@param",
"string",
"$fitMethod",
"@param",
"int",
"$width",
"@param",
"int",
"$height"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L221-L235 |
spatie/image | src/Manipulations.php | Manipulations.devicePixelRatio | public function devicePixelRatio(int $ratio)
{
if ($ratio < 1 || $ratio > 8) {
throw InvalidManipulation::valueNotInRange('ratio', $ratio, 1, 8);
}
return $this->addManipulation('devicePixelRatio', $ratio);
} | php | public function devicePixelRatio(int $ratio)
{
if ($ratio < 1 || $ratio > 8) {
throw InvalidManipulation::valueNotInRange('ratio', $ratio, 1, 8);
}
return $this->addManipulation('devicePixelRatio', $ratio);
} | [
"public",
"function",
"devicePixelRatio",
"(",
"int",
"$",
"ratio",
")",
"{",
"if",
"(",
"$",
"ratio",
"<",
"1",
"||",
"$",
"ratio",
">",
"8",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'ratio'",
",",
"$",
"ratio",
",",
"1... | @param int $ratio A value between 1 and 8
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$ratio",
"A",
"value",
"between",
"1",
"and",
"8"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L244-L251 |
spatie/image | src/Manipulations.php | Manipulations.brightness | public function brightness(int $brightness)
{
if ($brightness < -100 || $brightness > 100) {
throw InvalidManipulation::valueNotInRange('brightness', $brightness, -100, 100);
}
return $this->addManipulation('brightness', $brightness);
} | php | public function brightness(int $brightness)
{
if ($brightness < -100 || $brightness > 100) {
throw InvalidManipulation::valueNotInRange('brightness', $brightness, -100, 100);
}
return $this->addManipulation('brightness', $brightness);
} | [
"public",
"function",
"brightness",
"(",
"int",
"$",
"brightness",
")",
"{",
"if",
"(",
"$",
"brightness",
"<",
"-",
"100",
"||",
"$",
"brightness",
">",
"100",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'brightness'",
",",
"$... | @param int $brightness A value between -100 and 100
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$brightness",
"A",
"value",
"between",
"-",
"100",
"and",
"100"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L260-L267 |
spatie/image | src/Manipulations.php | Manipulations.gamma | public function gamma(float $gamma)
{
if ($gamma < 0.01 || $gamma > 9.99) {
throw InvalidManipulation::valueNotInRange('gamma', $gamma, 0.01, 9.00);
}
return $this->addManipulation('gamma', $gamma);
} | php | public function gamma(float $gamma)
{
if ($gamma < 0.01 || $gamma > 9.99) {
throw InvalidManipulation::valueNotInRange('gamma', $gamma, 0.01, 9.00);
}
return $this->addManipulation('gamma', $gamma);
} | [
"public",
"function",
"gamma",
"(",
"float",
"$",
"gamma",
")",
"{",
"if",
"(",
"$",
"gamma",
"<",
"0.01",
"||",
"$",
"gamma",
">",
"9.99",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'gamma'",
",",
"$",
"gamma",
",",
"0.01... | @param float $gamma A value between 0.01 and 9.99
@return $this
@throws InvalidManipulation | [
"@param",
"float",
"$gamma",
"A",
"value",
"between",
"0",
".",
"01",
"and",
"9",
".",
"99"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L276-L283 |
spatie/image | src/Manipulations.php | Manipulations.contrast | public function contrast(int $contrast)
{
if ($contrast < -100 || $contrast > 100) {
throw InvalidManipulation::valueNotInRange('contrast', $contrast, -100, 100);
}
return $this->addManipulation('contrast', $contrast);
} | php | public function contrast(int $contrast)
{
if ($contrast < -100 || $contrast > 100) {
throw InvalidManipulation::valueNotInRange('contrast', $contrast, -100, 100);
}
return $this->addManipulation('contrast', $contrast);
} | [
"public",
"function",
"contrast",
"(",
"int",
"$",
"contrast",
")",
"{",
"if",
"(",
"$",
"contrast",
"<",
"-",
"100",
"||",
"$",
"contrast",
">",
"100",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'contrast'",
",",
"$",
"cont... | @param int $contrast A value between -100 and 100
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$contrast",
"A",
"value",
"between",
"-",
"100",
"and",
"100"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L292-L299 |
spatie/image | src/Manipulations.php | Manipulations.sharpen | public function sharpen(int $sharpen)
{
if ($sharpen < 0 || $sharpen > 100) {
throw InvalidManipulation::valueNotInRange('sharpen', $sharpen, 0, 100);
}
return $this->addManipulation('sharpen', $sharpen);
} | php | public function sharpen(int $sharpen)
{
if ($sharpen < 0 || $sharpen > 100) {
throw InvalidManipulation::valueNotInRange('sharpen', $sharpen, 0, 100);
}
return $this->addManipulation('sharpen', $sharpen);
} | [
"public",
"function",
"sharpen",
"(",
"int",
"$",
"sharpen",
")",
"{",
"if",
"(",
"$",
"sharpen",
"<",
"0",
"||",
"$",
"sharpen",
">",
"100",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'sharpen'",
",",
"$",
"sharpen",
",",
... | @param int $sharpen A value between 0 and 100
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$sharpen",
"A",
"value",
"between",
"0",
"and",
"100"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L308-L315 |
spatie/image | src/Manipulations.php | Manipulations.blur | public function blur(int $blur)
{
if ($blur < 0 || $blur > 100) {
throw InvalidManipulation::valueNotInRange('blur', $blur, 0, 100);
}
return $this->addManipulation('blur', $blur);
} | php | public function blur(int $blur)
{
if ($blur < 0 || $blur > 100) {
throw InvalidManipulation::valueNotInRange('blur', $blur, 0, 100);
}
return $this->addManipulation('blur', $blur);
} | [
"public",
"function",
"blur",
"(",
"int",
"$",
"blur",
")",
"{",
"if",
"(",
"$",
"blur",
"<",
"0",
"||",
"$",
"blur",
">",
"100",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'blur'",
",",
"$",
"blur",
",",
"0",
",",
"10... | @param int $blur A value between 0 and 100
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$blur",
"A",
"value",
"between",
"0",
"and",
"100"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L324-L331 |
spatie/image | src/Manipulations.php | Manipulations.pixelate | public function pixelate(int $pixelate)
{
if ($pixelate < 0 || $pixelate > 1000) {
throw InvalidManipulation::valueNotInRange('pixelate', $pixelate, 0, 1000);
}
return $this->addManipulation('pixelate', $pixelate);
} | php | public function pixelate(int $pixelate)
{
if ($pixelate < 0 || $pixelate > 1000) {
throw InvalidManipulation::valueNotInRange('pixelate', $pixelate, 0, 1000);
}
return $this->addManipulation('pixelate', $pixelate);
} | [
"public",
"function",
"pixelate",
"(",
"int",
"$",
"pixelate",
")",
"{",
"if",
"(",
"$",
"pixelate",
"<",
"0",
"||",
"$",
"pixelate",
">",
"1000",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'pixelate'",
",",
"$",
"pixelate",
... | @param int $pixelate A value between 0 and 1000
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$pixelate",
"A",
"value",
"between",
"0",
"and",
"1000"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L340-L347 |
spatie/image | src/Manipulations.php | Manipulations.border | public function border(int $width, string $color, string $borderType = 'overlay')
{
if ($width < 0) {
throw InvalidManipulation::invalidWidth($width);
}
if (! $this->validateManipulation($borderType, 'border')) {
throw InvalidManipulation::invalidParameter(
... | php | public function border(int $width, string $color, string $borderType = 'overlay')
{
if ($width < 0) {
throw InvalidManipulation::invalidWidth($width);
}
if (! $this->validateManipulation($borderType, 'border')) {
throw InvalidManipulation::invalidParameter(
... | [
"public",
"function",
"border",
"(",
"int",
"$",
"width",
",",
"string",
"$",
"color",
",",
"string",
"$",
"borderType",
"=",
"'overlay'",
")",
"{",
"if",
"(",
"$",
"width",
"<",
"0",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidWidth",
"(",
... | @param int $width
@param string $color
@param string $borderType
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$width",
"@param",
"string",
"$color",
"@param",
"string",
"$borderType"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L384-L399 |
spatie/image | src/Manipulations.php | Manipulations.quality | public function quality(int $quality)
{
if ($quality < 0 || $quality > 100) {
throw InvalidManipulation::valueNotInRange('quality', $quality, 0, 100);
}
return $this->addManipulation('quality', $quality);
} | php | public function quality(int $quality)
{
if ($quality < 0 || $quality > 100) {
throw InvalidManipulation::valueNotInRange('quality', $quality, 0, 100);
}
return $this->addManipulation('quality', $quality);
} | [
"public",
"function",
"quality",
"(",
"int",
"$",
"quality",
")",
"{",
"if",
"(",
"$",
"quality",
"<",
"0",
"||",
"$",
"quality",
">",
"100",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'quality'",
",",
"$",
"quality",
",",
... | @param int $quality
@return $this
@throws InvalidManipulation | [
"@param",
"int",
"$quality"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L408-L415 |
spatie/image | src/Manipulations.php | Manipulations.format | public function format(string $format)
{
if (! $this->validateManipulation($format, 'format')) {
throw InvalidManipulation::invalidParameter(
'format',
$format,
$this->getValidManipulationOptions('format')
);
}
return $... | php | public function format(string $format)
{
if (! $this->validateManipulation($format, 'format')) {
throw InvalidManipulation::invalidParameter(
'format',
$format,
$this->getValidManipulationOptions('format')
);
}
return $... | [
"public",
"function",
"format",
"(",
"string",
"$",
"format",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateManipulation",
"(",
"$",
"format",
",",
"'format'",
")",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidParameter",
"(",
"'format'",
... | @param string $format
@return $this
@throws InvalidManipulation | [
"@param",
"string",
"$format"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L424-L435 |
spatie/image | src/Manipulations.php | Manipulations.filter | protected function filter(string $filterName)
{
if (! $this->validateManipulation($filterName, 'filter')) {
throw InvalidManipulation::invalidParameter(
'filter',
$filterName,
$this->getValidManipulationOptions('filter')
);
}
... | php | protected function filter(string $filterName)
{
if (! $this->validateManipulation($filterName, 'filter')) {
throw InvalidManipulation::invalidParameter(
'filter',
$filterName,
$this->getValidManipulationOptions('filter')
);
}
... | [
"protected",
"function",
"filter",
"(",
"string",
"$",
"filterName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateManipulation",
"(",
"$",
"filterName",
",",
"'filter'",
")",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidParameter",
"(",
"... | @param string $filterName
@return $this
@throws InvalidManipulation | [
"@param",
"string",
"$filterName"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L444-L455 |
spatie/image | src/Manipulations.php | Manipulations.watermark | public function watermark(string $filePath)
{
if (! file_exists($filePath)) {
throw new FileNotFoundException($filePath);
}
$this->addManipulation('watermark', $filePath);
return $this;
} | php | public function watermark(string $filePath)
{
if (! file_exists($filePath)) {
throw new FileNotFoundException($filePath);
}
$this->addManipulation('watermark', $filePath);
return $this;
} | [
"public",
"function",
"watermark",
"(",
"string",
"$",
"filePath",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"filePath",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"$",
"filePath",
")",
";",
"}",
"$",
"this",
"->",
"addManipula... | @param string $filePath
@return $this
@throws FileNotFoundException | [
"@param",
"string",
"$filePath"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L464-L473 |
spatie/image | src/Manipulations.php | Manipulations.watermarkWidth | public function watermarkWidth(int $width, string $unit = 'px')
{
$width = ($unit == static::UNIT_PERCENT ? $width.'w' : $width);
return $this->addManipulation('watermarkWidth', $width);
} | php | public function watermarkWidth(int $width, string $unit = 'px')
{
$width = ($unit == static::UNIT_PERCENT ? $width.'w' : $width);
return $this->addManipulation('watermarkWidth', $width);
} | [
"public",
"function",
"watermarkWidth",
"(",
"int",
"$",
"width",
",",
"string",
"$",
"unit",
"=",
"'px'",
")",
"{",
"$",
"width",
"=",
"(",
"$",
"unit",
"==",
"static",
"::",
"UNIT_PERCENT",
"?",
"$",
"width",
".",
"'w'",
":",
"$",
"width",
")",
"... | @param int $width The width of the watermark in pixels (default) or percent.
@param string $unit The unit of the `$width` parameter. Use `Manipulations::UNIT_PERCENT` or `Manipulations::UNIT_PIXELS`.
@return $this | [
"@param",
"int",
"$width",
"The",
"width",
"of",
"the",
"watermark",
"in",
"pixels",
"(",
"default",
")",
"or",
"percent",
".",
"@param",
"string",
"$unit",
"The",
"unit",
"of",
"the",
"$width",
"parameter",
".",
"Use",
"Manipulations",
"::",
"UNIT_PERCENT",... | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L481-L486 |
spatie/image | src/Manipulations.php | Manipulations.watermarkHeight | public function watermarkHeight(int $height, string $unit = 'px')
{
$height = ($unit == static::UNIT_PERCENT ? $height.'h' : $height);
return $this->addManipulation('watermarkHeight', $height);
} | php | public function watermarkHeight(int $height, string $unit = 'px')
{
$height = ($unit == static::UNIT_PERCENT ? $height.'h' : $height);
return $this->addManipulation('watermarkHeight', $height);
} | [
"public",
"function",
"watermarkHeight",
"(",
"int",
"$",
"height",
",",
"string",
"$",
"unit",
"=",
"'px'",
")",
"{",
"$",
"height",
"=",
"(",
"$",
"unit",
"==",
"static",
"::",
"UNIT_PERCENT",
"?",
"$",
"height",
".",
"'h'",
":",
"$",
"height",
")"... | @param int $height The height of the watermark in pixels (default) or percent.
@param string $unit The unit of the `$height` parameter. Use `Manipulations::UNIT_PERCENT` or `Manipulations::UNIT_PIXELS`.
@return $this | [
"@param",
"int",
"$height",
"The",
"height",
"of",
"the",
"watermark",
"in",
"pixels",
"(",
"default",
")",
"or",
"percent",
".",
"@param",
"string",
"$unit",
"The",
"unit",
"of",
"the",
"$height",
"parameter",
".",
"Use",
"Manipulations",
"::",
"UNIT_PERCEN... | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L494-L499 |
spatie/image | src/Manipulations.php | Manipulations.watermarkFit | public function watermarkFit(string $fitMethod)
{
if (! $this->validateManipulation($fitMethod, 'fit')) {
throw InvalidManipulation::invalidParameter(
'watermarkFit',
$fitMethod,
$this->getValidManipulationOptions('fit')
);
}
... | php | public function watermarkFit(string $fitMethod)
{
if (! $this->validateManipulation($fitMethod, 'fit')) {
throw InvalidManipulation::invalidParameter(
'watermarkFit',
$fitMethod,
$this->getValidManipulationOptions('fit')
);
}
... | [
"public",
"function",
"watermarkFit",
"(",
"string",
"$",
"fitMethod",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateManipulation",
"(",
"$",
"fitMethod",
",",
"'fit'",
")",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidParameter",
"(",
"'w... | @param string $fitMethod How is the watermark fitted into the watermarkWidth and watermarkHeight properties.
@return $this
@throws InvalidManipulation | [
"@param",
"string",
"$fitMethod",
"How",
"is",
"the",
"watermark",
"fitted",
"into",
"the",
"watermarkWidth",
"and",
"watermarkHeight",
"properties",
"."
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L508-L519 |
spatie/image | src/Manipulations.php | Manipulations.watermarkPadding | public function watermarkPadding(int $xPadding, int $yPadding = null, string $unit = 'px')
{
$yPadding = $yPadding ?? $xPadding;
$xPadding = ($unit == static::UNIT_PERCENT ? $xPadding.'w' : $xPadding);
$yPadding = ($unit == static::UNIT_PERCENT ? $yPadding.'h' : $yPadding);
$this->... | php | public function watermarkPadding(int $xPadding, int $yPadding = null, string $unit = 'px')
{
$yPadding = $yPadding ?? $xPadding;
$xPadding = ($unit == static::UNIT_PERCENT ? $xPadding.'w' : $xPadding);
$yPadding = ($unit == static::UNIT_PERCENT ? $yPadding.'h' : $yPadding);
$this->... | [
"public",
"function",
"watermarkPadding",
"(",
"int",
"$",
"xPadding",
",",
"int",
"$",
"yPadding",
"=",
"null",
",",
"string",
"$",
"unit",
"=",
"'px'",
")",
"{",
"$",
"yPadding",
"=",
"$",
"yPadding",
"??",
"$",
"xPadding",
";",
"$",
"xPadding",
"=",... | @param int $xPadding How far is the watermark placed from the left and right edges of the image.
@param int|null $yPadding How far is the watermark placed from the top and bottom edges of the image.
@param string $unit Unit of the padding values. Use `Manipulations::UNIT_PERCENT` or `Manipulations::... | [
"@param",
"int",
"$xPadding",
"How",
"far",
"is",
"the",
"watermark",
"placed",
"from",
"the",
"left",
"and",
"right",
"edges",
"of",
"the",
"image",
".",
"@param",
"int|null",
"$yPadding",
"How",
"far",
"is",
"the",
"watermark",
"placed",
"from",
"the",
"... | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L528-L539 |
spatie/image | src/Manipulations.php | Manipulations.watermarkPosition | public function watermarkPosition(string $position)
{
if (! $this->validateManipulation($position, 'position')) {
throw InvalidManipulation::invalidParameter(
'watermarkPosition',
$position,
$this->getValidManipulationOptions('position')
... | php | public function watermarkPosition(string $position)
{
if (! $this->validateManipulation($position, 'position')) {
throw InvalidManipulation::invalidParameter(
'watermarkPosition',
$position,
$this->getValidManipulationOptions('position')
... | [
"public",
"function",
"watermarkPosition",
"(",
"string",
"$",
"position",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateManipulation",
"(",
"$",
"position",
",",
"'position'",
")",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"invalidParameter",
"(... | @param string $position
@return $this
@throws InvalidManipulation | [
"@param",
"string",
"$position"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L548-L559 |
spatie/image | src/Manipulations.php | Manipulations.watermarkOpacity | public function watermarkOpacity(int $opacity)
{
if ($opacity < 0 || $opacity > 100) {
throw InvalidManipulation::valueNotInRange('opacity', $opacity, 0, 100);
}
return $this->addManipulation('watermarkOpacity', $opacity);
} | php | public function watermarkOpacity(int $opacity)
{
if ($opacity < 0 || $opacity > 100) {
throw InvalidManipulation::valueNotInRange('opacity', $opacity, 0, 100);
}
return $this->addManipulation('watermarkOpacity', $opacity);
} | [
"public",
"function",
"watermarkOpacity",
"(",
"int",
"$",
"opacity",
")",
"{",
"if",
"(",
"$",
"opacity",
"<",
"0",
"||",
"$",
"opacity",
">",
"100",
")",
"{",
"throw",
"InvalidManipulation",
"::",
"valueNotInRange",
"(",
"'opacity'",
",",
"$",
"opacity",... | Sets the opacity of the watermark. Only works with the `imagick` driver.
@param int $opacity A value between 0 and 100.
@return $this
@throws InvalidManipulation | [
"Sets",
"the",
"opacity",
"of",
"the",
"watermark",
".",
"Only",
"works",
"with",
"the",
"imagick",
"driver",
"."
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L570-L577 |
spatie/image | src/Manipulations.php | Manipulations.hasMultipleConversions | private function hasMultipleConversions(array $manipulations) : bool
{
foreach ($manipulations as $manipulation) {
if (isset($manipulation[0]) && is_array($manipulation[0])) {
return true;
}
}
return false;
} | php | private function hasMultipleConversions(array $manipulations) : bool
{
foreach ($manipulations as $manipulation) {
if (isset($manipulation[0]) && is_array($manipulation[0])) {
return true;
}
}
return false;
} | [
"private",
"function",
"hasMultipleConversions",
"(",
"array",
"$",
"manipulations",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"manipulations",
"as",
"$",
"manipulation",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"manipulation",
"[",
"0",
"]",
")",
"&&",
... | Checks if the given manipulations has arrays inside or not.
@param array $manipulations
@return bool | [
"Checks",
"if",
"the",
"given",
"manipulations",
"has",
"arrays",
"inside",
"or",
"not",
"."
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L625-L634 |
spatie/image | src/Manipulations.php | Manipulations.getManipulationArgument | public function getManipulationArgument(string $manipulationName)
{
foreach ($this->manipulationSequence->getGroups() as $manipulationSet) {
if (array_key_exists($manipulationName, $manipulationSet)) {
return $manipulationSet[$manipulationName];
}
}
} | php | public function getManipulationArgument(string $manipulationName)
{
foreach ($this->manipulationSequence->getGroups() as $manipulationSet) {
if (array_key_exists($manipulationName, $manipulationSet)) {
return $manipulationSet[$manipulationName];
}
}
} | [
"public",
"function",
"getManipulationArgument",
"(",
"string",
"$",
"manipulationName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"manipulationSequence",
"->",
"getGroups",
"(",
")",
"as",
"$",
"manipulationSet",
")",
"{",
"if",
"(",
"array_key_exists",
"(",... | @param string $manipulationName
@return string|null | [
"@param",
"string",
"$manipulationName"
] | train | https://github.com/spatie/image/blob/b31d09e73e4202ebd5f7b261fe1b893b1b16a14e/src/Manipulations.php#L651-L658 |
KnpLabs/KnpSnappyBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$fixOptionKeys = function ($options) {
$fixedOptions = [];
foreach ($options as $key => $value) {
$fixedOptions[str_replace('_', '-', $key)] = $value;
}
return $fixedOptions;
};
$treeBu... | php | public function getConfigTreeBuilder()
{
$fixOptionKeys = function ($options) {
$fixedOptions = [];
foreach ($options as $key => $value) {
$fixedOptions[str_replace('_', '-', $key)] = $value;
}
return $fixedOptions;
};
$treeBu... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"fixOptionKeys",
"=",
"function",
"(",
"$",
"options",
")",
"{",
"$",
"fixedOptions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/KnpLabs/KnpSnappyBundle/blob/322a3b33ea9d71c4395f600ad81f299b9a526d36/DependencyInjection/Configuration.php#L16-L82 |
KnpLabs/KnpSnappyBundle | Snappy/Generator/LoggableGenerator.php | LoggableGenerator.generate | public function generate($input, $output, array $options = [], $overwrite = false)
{
if (is_array($input)) {
$debug_input = implode(', ', $input);
} else {
$debug_input = $input;
}
$this->logDebug(sprintf('Generate from file (%s) to file (%s).', $debug_input, ... | php | public function generate($input, $output, array $options = [], $overwrite = false)
{
if (is_array($input)) {
$debug_input = implode(', ', $input);
} else {
$debug_input = $input;
}
$this->logDebug(sprintf('Generate from file (%s) to file (%s).', $debug_input, ... | [
"public",
"function",
"generate",
"(",
"$",
"input",
",",
"$",
"output",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"input",
")",
")",
"{",
"$",
"debug_input",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/KnpLabs/KnpSnappyBundle/blob/322a3b33ea9d71c4395f600ad81f299b9a526d36/Snappy/Generator/LoggableGenerator.php#L46-L56 |
KnpLabs/KnpSnappyBundle | Snappy/Generator/LoggableGenerator.php | LoggableGenerator.generateFromHtml | public function generateFromHtml($html, $output, array $options = [], $overwrite = false)
{
$debugHtml = is_array($html) ? implode(', ', $html) : $html;
$this->logDebug(sprintf('Generate from HTML (%s) to file (%s).', substr($debugHtml, 0, 100), $output));
$this->generator->generateFromHtm... | php | public function generateFromHtml($html, $output, array $options = [], $overwrite = false)
{
$debugHtml = is_array($html) ? implode(', ', $html) : $html;
$this->logDebug(sprintf('Generate from HTML (%s) to file (%s).', substr($debugHtml, 0, 100), $output));
$this->generator->generateFromHtm... | [
"public",
"function",
"generateFromHtml",
"(",
"$",
"html",
",",
"$",
"output",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"$",
"debugHtml",
"=",
"is_array",
"(",
"$",
"html",
")",
"?",
"implode",
"(",... | {@inheritdoc} | [
"{"
] | train | https://github.com/KnpLabs/KnpSnappyBundle/blob/322a3b33ea9d71c4395f600ad81f299b9a526d36/Snappy/Generator/LoggableGenerator.php#L61-L68 |
KnpLabs/KnpSnappyBundle | Snappy/Generator/LoggableGenerator.php | LoggableGenerator.getOutput | public function getOutput($input, array $options = [])
{
if (is_array($input)) {
$debug_input = implode(', ', $input);
} else {
$debug_input = $input;
}
$this->logDebug(sprintf('Output from file (%s).', $debug_input));
return $this->generator->getOutp... | php | public function getOutput($input, array $options = [])
{
if (is_array($input)) {
$debug_input = implode(', ', $input);
} else {
$debug_input = $input;
}
$this->logDebug(sprintf('Output from file (%s).', $debug_input));
return $this->generator->getOutp... | [
"public",
"function",
"getOutput",
"(",
"$",
"input",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"input",
")",
")",
"{",
"$",
"debug_input",
"=",
"implode",
"(",
"', '",
",",
"$",
"input",
")",
";",
"}... | {@inheritdoc} | [
"{"
] | train | https://github.com/KnpLabs/KnpSnappyBundle/blob/322a3b33ea9d71c4395f600ad81f299b9a526d36/Snappy/Generator/LoggableGenerator.php#L73-L83 |
KnpLabs/KnpSnappyBundle | Snappy/Generator/LoggableGenerator.php | LoggableGenerator.getOutputFromHtml | public function getOutputFromHtml($html, array $options = [])
{
$debugHtml = is_array($html) ? implode(', ', $html) : $html;
$this->logDebug(sprintf('Output from HTML (%s).', substr($debugHtml, 0, 100)));
return $this->generator->getOutputFromHtml($html, $options);
} | php | public function getOutputFromHtml($html, array $options = [])
{
$debugHtml = is_array($html) ? implode(', ', $html) : $html;
$this->logDebug(sprintf('Output from HTML (%s).', substr($debugHtml, 0, 100)));
return $this->generator->getOutputFromHtml($html, $options);
} | [
"public",
"function",
"getOutputFromHtml",
"(",
"$",
"html",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"debugHtml",
"=",
"is_array",
"(",
"$",
"html",
")",
"?",
"implode",
"(",
"', '",
",",
"$",
"html",
")",
":",
"$",
"html",
";",... | {@inheritdoc} | [
"{"
] | train | https://github.com/KnpLabs/KnpSnappyBundle/blob/322a3b33ea9d71c4395f600ad81f299b9a526d36/Snappy/Generator/LoggableGenerator.php#L88-L95 |
KnpLabs/KnpSnappyBundle | Snappy/Generator/LoggableGenerator.php | LoggableGenerator.setOption | public function setOption($name, $value)
{
$this->logDebug(sprintf('Set option %s = %s.', $name, var_export($value, true)));
return $this->generator->setOption($name, $value);
} | php | public function setOption($name, $value)
{
$this->logDebug(sprintf('Set option %s = %s.', $name, var_export($value, true)));
return $this->generator->setOption($name, $value);
} | [
"public",
"function",
"setOption",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"logDebug",
"(",
"sprintf",
"(",
"'Set option %s = %s.'",
",",
"$",
"name",
",",
"var_export",
"(",
"$",
"value",
",",
"true",
")",
")",
")",
";",
"r... | {@inheritdoc} | [
"{"
] | train | https://github.com/KnpLabs/KnpSnappyBundle/blob/322a3b33ea9d71c4395f600ad81f299b9a526d36/Snappy/Generator/LoggableGenerator.php#L100-L105 |
KnpLabs/KnpSnappyBundle | DependencyInjection/KnpSnappyExtension.php | KnpSnappyExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$configuration = new Configuration();
$processor = new Processor();
$config = $processor->processConfiguration($configurati... | php | public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$configuration = new Configuration();
$processor = new Processor();
$config = $processor->processConfiguration($configurati... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"loader",
"=",
"new",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/../Resources/config'",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/KnpLabs/KnpSnappyBundle/blob/322a3b33ea9d71c4395f600ad81f299b9a526d36/DependencyInjection/KnpSnappyExtension.php#L16-L57 |
contributte/datagrid | src/Column/ColumnStatus.php | ColumnStatus.getOption | public function getOption($value)
{
foreach ($this->options as $option) {
if ($option->getValue() === $value) {
return $option;
}
}
throw new DataGridColumnStatusException("Option [$value] does not exist");
} | php | public function getOption($value)
{
foreach ($this->options as $option) {
if ($option->getValue() === $value) {
return $option;
}
}
throw new DataGridColumnStatusException("Option [$value] does not exist");
} | [
"public",
"function",
"getOption",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"options",
"as",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"option",
"->",
"getValue",
"(",
")",
"===",
"$",
"value",
")",
"{",
"return",
"$",
"option... | Get particular option
@param mixed $value
@return Option
@throws DataGridColumnStatusException | [
"Get",
"particular",
"option"
] | train | https://github.com/contributte/datagrid/blob/a4e392e1ddef6a442eaea8dfa9bffaeef96a45d1/src/Column/ColumnStatus.php#L77-L86 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.