id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
225,800 | kaystrobach/FLOW.Custom | Classes/Command/MailCommandController.php | MailCommandController.sendCommand | public function sendCommand(
$recipientMail,
$templateFile = 'resource://KayStrobach.Custom/Private/Templates/Mail/Default.html'
) {
$this->output->output('Sending Mail to ' . $recipientMail);
$mailUtility = new MailUtility();
$mailUtility->send(
$recipientMail,... | php | public function sendCommand(
$recipientMail,
$templateFile = 'resource://KayStrobach.Custom/Private/Templates/Mail/Default.html'
) {
$this->output->output('Sending Mail to ' . $recipientMail);
$mailUtility = new MailUtility();
$mailUtility->send(
$recipientMail,... | [
"public",
"function",
"sendCommand",
"(",
"$",
"recipientMail",
",",
"$",
"templateFile",
"=",
"'resource://KayStrobach.Custom/Private/Templates/Mail/Default.html'",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"output",
"(",
"'Sending Mail to '",
".",
"$",
"recipientMa... | An example command
The comment of this command method is also used for TYPO3 Flow's help screens. The first line should give a very short
summary about what the command does. Then, after an empty line, you should explain in more detail what the command
does. You might also give some usage example.
It is important to ... | [
"An",
"example",
"command"
] | 873001a46fa0dfbc426edd74af1841cfa7bcf1b9 | https://github.com/kaystrobach/FLOW.Custom/blob/873001a46fa0dfbc426edd74af1841cfa7bcf1b9/Classes/Command/MailCommandController.php#L44-L61 |
225,801 | cloudcreativity/utils-object | src/Obj.php | Obj.replicate | public static function replicate($data)
{
$copy = clone $data;
foreach ($copy as $key => $value) {
if (is_object($value)) {
$copy->{$key} = static::replicate($value);
}
}
return $copy;
} | php | public static function replicate($data)
{
$copy = clone $data;
foreach ($copy as $key => $value) {
if (is_object($value)) {
$copy->{$key} = static::replicate($value);
}
}
return $copy;
} | [
"public",
"static",
"function",
"replicate",
"(",
"$",
"data",
")",
"{",
"$",
"copy",
"=",
"clone",
"$",
"data",
";",
"foreach",
"(",
"$",
"copy",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
")"... | Clone the object recursively.
@param object $data
@return object | [
"Clone",
"the",
"object",
"recursively",
"."
] | 4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2 | https://github.com/cloudcreativity/utils-object/blob/4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2/src/Obj.php#L86-L97 |
225,802 | php-xapi/json-test-fixtures | src/JsonFixtures.php | JsonFixtures.load | protected static function load($file)
{
if (null !== static::DIRECTORY) {
return file_get_contents(__DIR__.'/../data/'.static::DIRECTORY.'/'.$file.'.json');
}
return file_get_contents(__DIR__.'/../data/'.$file.'.json');
} | php | protected static function load($file)
{
if (null !== static::DIRECTORY) {
return file_get_contents(__DIR__.'/../data/'.static::DIRECTORY.'/'.$file.'.json');
}
return file_get_contents(__DIR__.'/../data/'.$file.'.json');
} | [
"protected",
"static",
"function",
"load",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"null",
"!==",
"static",
"::",
"DIRECTORY",
")",
"{",
"return",
"file_get_contents",
"(",
"__DIR__",
".",
"'/../data/'",
".",
"static",
"::",
"DIRECTORY",
".",
"'/'",
".",
... | Loads a JSON encoded fixture from the file system
@param string $file The fixture to load
@return string The JSON encoded fixture | [
"Loads",
"a",
"JSON",
"encoded",
"fixture",
"from",
"the",
"file",
"system"
] | 696bb6c4047f4e95e619b8bb31d83517ab009ac5 | https://github.com/php-xapi/json-test-fixtures/blob/696bb6c4047f4e95e619b8bb31d83517ab009ac5/src/JsonFixtures.php#L30-L37 |
225,803 | vperyod/vperyod.auth-handler | src/AuthHandler.php | AuthHandler.process | public function process(Request $request, Handler $handler): Response
{
$request = $request->withAttribute(
$this->authAttribute,
$this->resume()
);
return $handler->handle($request);
} | php | public function process(Request $request, Handler $handler): Response
{
$request = $request->withAttribute(
$this->authAttribute,
$this->resume()
);
return $handler->handle($request);
} | [
"public",
"function",
"process",
"(",
"Request",
"$",
"request",
",",
"Handler",
"$",
"handler",
")",
":",
"Response",
"{",
"$",
"request",
"=",
"$",
"request",
"->",
"withAttribute",
"(",
"$",
"this",
"->",
"authAttribute",
",",
"$",
"this",
"->",
"resu... | Resumes Authenticated Session
@param Request $request PSR7 HTTP Request
@param Handler $handler Next handler
@return Response
@access public | [
"Resumes",
"Authenticated",
"Session"
] | 7b90b4ca1d8a39f8ea159022046fe898eaae3db7 | https://github.com/vperyod/vperyod.auth-handler/blob/7b90b4ca1d8a39f8ea159022046fe898eaae3db7/src/AuthHandler.php#L98-L105 |
225,804 | SetBased/php-abc-form | src/RawForm.php | RawForm.hasScalars | public static function hasScalars(array $array): bool
{
$ret = false;
foreach ($array as $tmp)
{
if (is_object($tmp))
{
$ret = true;
break;
}
}
return $ret;
} | php | public static function hasScalars(array $array): bool
{
$ret = false;
foreach ($array as $tmp)
{
if (is_object($tmp))
{
$ret = true;
break;
}
}
return $ret;
} | [
"public",
"static",
"function",
"hasScalars",
"(",
"array",
"$",
"array",
")",
":",
"bool",
"{",
"$",
"ret",
"=",
"false",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"tmp",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"tmp",
")",
")",
"{",
"$",... | Returns true if array has one or more scalars. Otherwise, returns false.
@param array $array The array.
@return bool | [
"Returns",
"true",
"if",
"array",
"has",
"one",
"or",
"more",
"scalars",
".",
"Otherwise",
"returns",
"false",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/RawForm.php#L96-L109 |
225,805 | SetBased/php-abc-form | src/RawForm.php | RawForm.getHtml | public function getHtml(): string
{
if (!isset($this->attributes['action']))
{
$this->attributes['action'] = Abc::$request->getRequestUri();
}
$this->prepare();
$html = $this->getHtmlStartTag();
$html .= $this->getHtmlBody();
$html .= $this->getHtmlEndTag();
return $html;
... | php | public function getHtml(): string
{
if (!isset($this->attributes['action']))
{
$this->attributes['action'] = Abc::$request->getRequestUri();
}
$this->prepare();
$html = $this->getHtmlStartTag();
$html .= $this->getHtmlBody();
$html .= $this->getHtmlEndTag();
return $html;
... | [
"public",
"function",
"getHtml",
"(",
")",
":",
"string",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'action'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'action'",
"]",
"=",
"Abc",
"::",
"$",
"reques... | Returns the HTML code of this form.
Note: This method will not load submitted values
@return string
@since 1.0.0
@api | [
"Returns",
"the",
"HTML",
"code",
"of",
"this",
"form",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/RawForm.php#L214-L230 |
225,806 | SetBased/php-abc-form | src/RawForm.php | RawForm.prepare | protected function prepare(): void
{
if (!$this->prepared)
{
$this->fieldSets->prepare('');
$this->prepared = true;
}
} | php | protected function prepare(): void
{
if (!$this->prepared)
{
$this->fieldSets->prepare('');
$this->prepared = true;
}
} | [
"protected",
"function",
"prepare",
"(",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"prepared",
")",
"{",
"$",
"this",
"->",
"fieldSets",
"->",
"prepare",
"(",
"''",
")",
";",
"$",
"this",
"->",
"prepared",
"=",
"true",
";",
"}",
"... | Prepares this form for HTML code generation or loading submitted values.
@since 1.0.0
@api | [
"Prepares",
"this",
"form",
"for",
"HTML",
"code",
"generation",
"or",
"loading",
"submitted",
"values",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/RawForm.php#L505-L513 |
225,807 | SetBased/php-abc-form | src/RawForm.php | RawForm.searchSubmitHandler | protected function searchSubmitHandler(): ?string
{
switch ($this->attributes['method'])
{
case 'post':
$values = &$_POST;
break;
case 'get':
$values = &$_GET;
break;
default:
throw new FallenException('method', $this->attributes['method']);
}
... | php | protected function searchSubmitHandler(): ?string
{
switch ($this->attributes['method'])
{
case 'post':
$values = &$_POST;
break;
case 'get':
$values = &$_GET;
break;
default:
throw new FallenException('method', $this->attributes['method']);
}
... | [
"protected",
"function",
"searchSubmitHandler",
"(",
")",
":",
"?",
"string",
"{",
"switch",
"(",
"$",
"this",
"->",
"attributes",
"[",
"'method'",
"]",
")",
"{",
"case",
"'post'",
":",
"$",
"values",
"=",
"&",
"$",
"_POST",
";",
"break",
";",
"case",
... | If this form has been submitted returns the name of the method for handling this form. Otherwise, returns null.
@since 1.0.0
@api
@return string|null | [
"If",
"this",
"form",
"has",
"been",
"submitted",
"returns",
"the",
"name",
"of",
"the",
"method",
"for",
"handling",
"this",
"form",
".",
"Otherwise",
"returns",
"null",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/RawForm.php#L524-L541 |
225,808 | php-toolkit/sys-utils | src/Sys.php | Sys.execInBackground | public static function execInBackground(string $cmd): void
{
if (self::isWindows()) {
\pclose(\popen('start /B ' . $cmd, 'r'));
} else {
\exec($cmd . ' > /dev/null &');
}
} | php | public static function execInBackground(string $cmd): void
{
if (self::isWindows()) {
\pclose(\popen('start /B ' . $cmd, 'r'));
} else {
\exec($cmd . ' > /dev/null &');
}
} | [
"public",
"static",
"function",
"execInBackground",
"(",
"string",
"$",
"cmd",
")",
":",
"void",
"{",
"if",
"(",
"self",
"::",
"isWindows",
"(",
")",
")",
"{",
"\\",
"pclose",
"(",
"\\",
"popen",
"(",
"'start /B '",
".",
"$",
"cmd",
",",
"'r'",
")",
... | run a command in background
@param string $cmd | [
"run",
"a",
"command",
"in",
"background"
] | cf6ca81efed472ca4457e6f4325fe00398d2d0ca | https://github.com/php-toolkit/sys-utils/blob/cf6ca81efed472ca4457e6f4325fe00398d2d0ca/src/Sys.php#L155-L162 |
225,809 | php-toolkit/sys-utils | src/Sys.php | Sys.getScreenSize | public static function getScreenSize(bool $refresh = false)
{
static $size;
if ($size !== null && !$refresh) {
return $size;
}
if (self::shIsAvailable()) {
// try stty if available
$stty = [];
if (
\exec('stty -a 2>&1'... | php | public static function getScreenSize(bool $refresh = false)
{
static $size;
if ($size !== null && !$refresh) {
return $size;
}
if (self::shIsAvailable()) {
// try stty if available
$stty = [];
if (
\exec('stty -a 2>&1'... | [
"public",
"static",
"function",
"getScreenSize",
"(",
"bool",
"$",
"refresh",
"=",
"false",
")",
"{",
"static",
"$",
"size",
";",
"if",
"(",
"$",
"size",
"!==",
"null",
"&&",
"!",
"$",
"refresh",
")",
"{",
"return",
"$",
"size",
";",
"}",
"if",
"("... | get screen size
```php
list($width, $height) = Sys::getScreenSize();
```
@from Yii2
@param boolean $refresh whether to force checking and not re-use cached size value.
This is useful to detect changing window size while the application is running but may
not get up to date values on every terminal.
@return array|boole... | [
"get",
"screen",
"size"
] | cf6ca81efed472ca4457e6f4325fe00398d2d0ca | https://github.com/php-toolkit/sys-utils/blob/cf6ca81efed472ca4457e6f4325fe00398d2d0ca/src/Sys.php#L255-L297 |
225,810 | php-toolkit/file-utils | src/File.php | File.downBigFile | public static function downBigFile($file, $as): void
{
header('Expires: Mon, 1 Apr 1974 05:00:00 GMT');
header('Pragma: no-cache');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Description: File Download');
header('Content-Type: applica... | php | public static function downBigFile($file, $as): void
{
header('Expires: Mon, 1 Apr 1974 05:00:00 GMT');
header('Pragma: no-cache');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Description: File Download');
header('Content-Type: applica... | [
"public",
"static",
"function",
"downBigFile",
"(",
"$",
"file",
",",
"$",
"as",
")",
":",
"void",
"{",
"header",
"(",
"'Expires: Mon, 1 Apr 1974 05:00:00 GMT'",
")",
";",
"header",
"(",
"'Pragma: no-cache'",
")",
";",
"header",
"(",
"'Cache-Control: must-revalida... | If you want to download files from a linux server with
a filesize bigger than 2GB you can use the following
@param string $file
@param string $as | [
"If",
"you",
"want",
"to",
"download",
"files",
"from",
"a",
"linux",
"server",
"with",
"a",
"filesize",
"bigger",
"than",
"2GB",
"you",
"can",
"use",
"the",
"following"
] | cf55fa8ce34000731460e8dc705d7006632119a8 | https://github.com/php-toolkit/file-utils/blob/cf55fa8ce34000731460e8dc705d7006632119a8/src/File.php#L391-L414 |
225,811 | SlayerBirden/dataflow | src/Plumber.php | Plumber.pour | public function pour(): void
{
$provider = $this->source->getCask();
foreach ($provider as $dataBag) {
try {
$this->pipeLine->rewind();
while ($this->pipeLine->valid()) {
$handler = $this->pipeLine->current();
$dataB... | php | public function pour(): void
{
$provider = $this->source->getCask();
foreach ($provider as $dataBag) {
try {
$this->pipeLine->rewind();
while ($this->pipeLine->valid()) {
$handler = $this->pipeLine->current();
$dataB... | [
"public",
"function",
"pour",
"(",
")",
":",
"void",
"{",
"$",
"provider",
"=",
"$",
"this",
"->",
"source",
"->",
"getCask",
"(",
")",
";",
"foreach",
"(",
"$",
"provider",
"as",
"$",
"dataBag",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"pipeLine",... | Pour source into pipeline. | [
"Pour",
"source",
"into",
"pipeline",
"."
] | a9cb826b106e882e43523d39fea319adc4893e00 | https://github.com/SlayerBirden/dataflow/blob/a9cb826b106e882e43523d39fea319adc4893e00/src/Plumber.php#L33-L49 |
225,812 | oscarotero/inline-svg | src/Sources/FileSystem.php | FileSystem.getPath | protected function getPath($name)
{
$name = isset($this->map[$name]) ? $this->map[$name] : $name;
return "{$this->basePath}/{$name}.svg";
} | php | protected function getPath($name)
{
$name = isset($this->map[$name]) ? $this->map[$name] : $name;
return "{$this->basePath}/{$name}.svg";
} | [
"protected",
"function",
"getPath",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"isset",
"(",
"$",
"this",
"->",
"map",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"map",
"[",
"$",
"name",
"]",
":",
"$",
"name",
";",
"return",
"\"{$th... | Returns the path of a svg.
@param string $name
@return string | [
"Returns",
"the",
"path",
"of",
"a",
"svg",
"."
] | 9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2 | https://github.com/oscarotero/inline-svg/blob/9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2/src/Sources/FileSystem.php#L51-L56 |
225,813 | puli/cli | src/Updater/PuliStrategy.php | PuliStrategy.setStability | public function setStability($stability)
{
if (!in_array($stability, self::$stabilities, true)) {
throw new InvalidArgumentException(
'Invalid stability value. Must be one of "stable", "unstable" or "any".'
);
}
$this->stability = $stability;
} | php | public function setStability($stability)
{
if (!in_array($stability, self::$stabilities, true)) {
throw new InvalidArgumentException(
'Invalid stability value. Must be one of "stable", "unstable" or "any".'
);
}
$this->stability = $stability;
} | [
"public",
"function",
"setStability",
"(",
"$",
"stability",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"stability",
",",
"self",
"::",
"$",
"stabilities",
",",
"true",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Invalid stability ... | Set target stability.
@param string $stability | [
"Set",
"target",
"stability",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Updater/PuliStrategy.php#L121-L130 |
225,814 | pyrou/morpheus | src/Morpheus/Image.php | Image.create | static function create($im) {
if(is_resource($im) && get_resource_type($im)) {
return new ImageGD($im);
}
if($im instanceof \Imagick) {
return new ImageImagick($im);
}
} | php | static function create($im) {
if(is_resource($im) && get_resource_type($im)) {
return new ImageGD($im);
}
if($im instanceof \Imagick) {
return new ImageImagick($im);
}
} | [
"static",
"function",
"create",
"(",
"$",
"im",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"im",
")",
"&&",
"get_resource_type",
"(",
"$",
"im",
")",
")",
"{",
"return",
"new",
"ImageGD",
"(",
"$",
"im",
")",
";",
"}",
"if",
"(",
"$",
"im",
... | Create a new Morpheus\Image instance.
@param resource|Imagick GD Resource or Imagick instance
@return Morpheus\Image | [
"Create",
"a",
"new",
"Morpheus",
"\\",
"Image",
"instance",
"."
] | 5dc1686651da5cbc4968fcf999b9ee998cc43b25 | https://github.com/pyrou/morpheus/blob/5dc1686651da5cbc4968fcf999b9ee998cc43b25/src/Morpheus/Image.php#L28-L36 |
225,815 | pyrou/morpheus | src/Morpheus/Image.php | Image.parity | private function parity($byte) {
$parity = 0;
for($i=7; $i>=0; $i--) {
$parity ^= ($byte >> $i) & 1;
}
return (bool) $parity;
} | php | private function parity($byte) {
$parity = 0;
for($i=7; $i>=0; $i--) {
$parity ^= ($byte >> $i) & 1;
}
return (bool) $parity;
} | [
"private",
"function",
"parity",
"(",
"$",
"byte",
")",
"{",
"$",
"parity",
"=",
"0",
";",
"for",
"(",
"$",
"i",
"=",
"7",
";",
"$",
"i",
">=",
"0",
";",
"$",
"i",
"--",
")",
"{",
"$",
"parity",
"^=",
"(",
"$",
"byte",
">>",
"$",
"i",
")"... | Calculate the XOR parity of the given byte.
@param integer byte between 0x00 and 0xFF
@return bool | [
"Calculate",
"the",
"XOR",
"parity",
"of",
"the",
"given",
"byte",
"."
] | 5dc1686651da5cbc4968fcf999b9ee998cc43b25 | https://github.com/pyrou/morpheus/blob/5dc1686651da5cbc4968fcf999b9ee998cc43b25/src/Morpheus/Image.php#L58-L64 |
225,816 | pyrou/morpheus | src/Morpheus/Image.php | Image.writeByte | private function writeByte($byte) {
// byte : 0b11010100
// parity : 0b1
// pixel 1 : 110
// pixel 2 : 101
// pixel 3 : 001
list($x, $y) = $this->coordinates->current();
$color = $this->getColor($x, $y);
$color->writeBits(($byte>>5) & 7);
$this->setColor($x, $y, $color);
... | php | private function writeByte($byte) {
// byte : 0b11010100
// parity : 0b1
// pixel 1 : 110
// pixel 2 : 101
// pixel 3 : 001
list($x, $y) = $this->coordinates->current();
$color = $this->getColor($x, $y);
$color->writeBits(($byte>>5) & 7);
$this->setColor($x, $y, $color);
... | [
"private",
"function",
"writeByte",
"(",
"$",
"byte",
")",
"{",
"// byte : 0b11010100",
"// parity : 0b1",
"// pixel 1 : 110",
"// pixel 2 : 101",
"// pixel 3 : 001",
"list",
"(",
"$",
"x",
",",
"$",
"y",
")",
"=",
"$",
"this",
"->",
"coor... | Store a byte at the current coordinates pointer
@param integer byte between 0x00 and 0xFF | [
"Store",
"a",
"byte",
"at",
"the",
"current",
"coordinates",
"pointer"
] | 5dc1686651da5cbc4968fcf999b9ee998cc43b25 | https://github.com/pyrou/morpheus/blob/5dc1686651da5cbc4968fcf999b9ee998cc43b25/src/Morpheus/Image.php#L70-L95 |
225,817 | BKWLD/upchuck | src/Helpers.php | Helpers.path | public function path($url) {
$prefix = $this->config['url_prefix'];
// If the url_prefix is absolute-path style but the url isn't, get only the
// path from the URL before comparing against the prefix.
if (preg_match('#^/#', $prefix) && preg_match('#^http#', $url)) {
$url = ... | php | public function path($url) {
$prefix = $this->config['url_prefix'];
// If the url_prefix is absolute-path style but the url isn't, get only the
// path from the URL before comparing against the prefix.
if (preg_match('#^/#', $prefix) && preg_match('#^http#', $url)) {
$url = ... | [
"public",
"function",
"path",
"(",
"$",
"url",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"config",
"[",
"'url_prefix'",
"]",
";",
"// If the url_prefix is absolute-path style but the url isn't, get only the",
"// path from the URL before comparing against the prefix.",... | Get the path on the disk given the URL.
@param string $url
@return string | [
"Get",
"the",
"path",
"on",
"the",
"disk",
"given",
"the",
"URL",
"."
] | 2d2202b1bc4a86a0a91ceb319521a263b0c88f54 | https://github.com/BKWLD/upchuck/blob/2d2202b1bc4a86a0a91ceb319521a263b0c88f54/src/Helpers.php#L38-L49 |
225,818 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/Traits/Revisionable.php | Revisionable.revisionAtTimestamp | public function revisionAtTimestamp($timestamp)
{
$revision = $this->revisions()
->where('created_at', '<=', Carbon::parse($timestamp))
->first();
return $this->wrapRevision($revision);
} | php | public function revisionAtTimestamp($timestamp)
{
$revision = $this->revisions()
->where('created_at', '<=', Carbon::parse($timestamp))
->first();
return $this->wrapRevision($revision);
} | [
"public",
"function",
"revisionAtTimestamp",
"(",
"$",
"timestamp",
")",
"{",
"$",
"revision",
"=",
"$",
"this",
"->",
"revisions",
"(",
")",
"->",
"where",
"(",
"'created_at'",
",",
"'<='",
",",
"Carbon",
"::",
"parse",
"(",
"$",
"timestamp",
")",
")",
... | Get record version at given timestamp.
@param \DateTime|string $timestamp DateTime|Carbon object or parseable date string @see strtotime()
@return Revision|null | [
"Get",
"record",
"version",
"at",
"given",
"timestamp",
"."
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/Traits/Revisionable.php#L28-L35 |
225,819 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/Traits/Revisionable.php | Revisionable.rollbackToRevision | private function rollbackToRevision(Revision $revision) {
if ($revision == null) {
return null;
}
$current = $revision->revisioned;
// delete the old revisions for this model if needed
if($this->getConfigRollbackCleanup()) {
$revisionsToDelete = $current... | php | private function rollbackToRevision(Revision $revision) {
if ($revision == null) {
return null;
}
$current = $revision->revisioned;
// delete the old revisions for this model if needed
if($this->getConfigRollbackCleanup()) {
$revisionsToDelete = $current... | [
"private",
"function",
"rollbackToRevision",
"(",
"Revision",
"$",
"revision",
")",
"{",
"if",
"(",
"$",
"revision",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"current",
"=",
"$",
"revision",
"->",
"revisioned",
";",
"// delete the old revisio... | Rollback to a given revision.
@param Revision $revision
@return Revision|null | [
"Rollback",
"to",
"a",
"given",
"revision",
"."
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/Traits/Revisionable.php#L80-L99 |
225,820 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/Traits/Revisionable.php | Revisionable.getConfigRevisionForModel | public function getConfigRevisionForModel() {
if(is_null($this->revisionEnabled)) {
// the parameter is not set - default behaviour is to create revisions
return true;
}
if($this->revisionEnabled === false) {
return false;
}
return true;
} | php | public function getConfigRevisionForModel() {
if(is_null($this->revisionEnabled)) {
// the parameter is not set - default behaviour is to create revisions
return true;
}
if($this->revisionEnabled === false) {
return false;
}
return true;
} | [
"public",
"function",
"getConfigRevisionForModel",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"revisionEnabled",
")",
")",
"{",
"// the parameter is not set - default behaviour is to create revisions",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"t... | checks if revisions for this model shall be created
@return bool | [
"checks",
"if",
"revisions",
"for",
"this",
"model",
"shall",
"be",
"created"
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/Traits/Revisionable.php#L294-L304 |
225,821 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/Traits/Revisionable.php | Revisionable.getConfigRevisionLimit | public function getConfigRevisionLimit() {
$default = Config::get('revisionable.revisions.limit');
if(is_null($this->revisionLimit)) {
// the parameter is not set - default behaviour is to create revisions
return $default;
}
if(! is_numeric($this->revisionLimit))... | php | public function getConfigRevisionLimit() {
$default = Config::get('revisionable.revisions.limit');
if(is_null($this->revisionLimit)) {
// the parameter is not set - default behaviour is to create revisions
return $default;
}
if(! is_numeric($this->revisionLimit))... | [
"public",
"function",
"getConfigRevisionLimit",
"(",
")",
"{",
"$",
"default",
"=",
"Config",
"::",
"get",
"(",
"'revisionable.revisions.limit'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"revisionLimit",
")",
")",
"{",
"// the parameter is not set... | Returns, how many revisions of a model must be kept
@return int | [
"Returns",
"how",
"many",
"revisions",
"of",
"a",
"model",
"must",
"be",
"kept"
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/Traits/Revisionable.php#L311-L323 |
225,822 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/Traits/Revisionable.php | Revisionable.getConfigRevisionLimitCleanup | public function getConfigRevisionLimitCleanup() {
$default = Config::get('revisionable.revisions.limitCleanup');
if(is_null($this->revisionLimitCleanup)) {
// the parameter is not set - default behaviour is to create revisions
return $default;
}
if($this->revisio... | php | public function getConfigRevisionLimitCleanup() {
$default = Config::get('revisionable.revisions.limitCleanup');
if(is_null($this->revisionLimitCleanup)) {
// the parameter is not set - default behaviour is to create revisions
return $default;
}
if($this->revisio... | [
"public",
"function",
"getConfigRevisionLimitCleanup",
"(",
")",
"{",
"$",
"default",
"=",
"Config",
"::",
"get",
"(",
"'revisionable.revisions.limitCleanup'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"revisionLimitCleanup",
")",
")",
"{",
"// the... | Returns if older revisions shall be removed
@return bool | [
"Returns",
"if",
"older",
"revisions",
"shall",
"be",
"removed"
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/Traits/Revisionable.php#L330-L342 |
225,823 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-locator-term.php | Carbon_Breadcrumb_Locator_Term.is_included | public function is_included() {
$queried_object = get_queried_object();
if ( ! empty( $queried_object->taxonomy ) && $queried_object->taxonomy == $this->get_subtype() ) {
return true;
}
return false;
} | php | public function is_included() {
$queried_object = get_queried_object();
if ( ! empty( $queried_object->taxonomy ) && $queried_object->taxonomy == $this->get_subtype() ) {
return true;
}
return false;
} | [
"public",
"function",
"is_included",
"(",
")",
"{",
"$",
"queried_object",
"=",
"get_queried_object",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"queried_object",
"->",
"taxonomy",
")",
"&&",
"$",
"queried_object",
"->",
"taxonomy",
"==",
"$",
"this... | Whether this the items of this locator should be included in the trail.
@access public
@return bool $is_included Whether the found items should be included. | [
"Whether",
"this",
"the",
"items",
"of",
"this",
"locator",
"should",
"be",
"included",
"in",
"the",
"trail",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-locator-term.php#L22-L30 |
225,824 | xmeltrut/WordSearch | src/Utils.php | Utils.integerAsOptions | public static function integerAsOptions($num)
{
$options = [];
for ($i = 0; $i <= $num; $i++) {
$options[] = $i;
}
shuffle($options);
return $options;
} | php | public static function integerAsOptions($num)
{
$options = [];
for ($i = 0; $i <= $num; $i++) {
$options[] = $i;
}
shuffle($options);
return $options;
} | [
"public",
"static",
"function",
"integerAsOptions",
"(",
"$",
"num",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<=",
"$",
"num",
";",
"$",
"i",
"++",
")",
"{",
"$",
"options",
"[",
"]",
"=",
... | Take an integer and convert it into an array of shuffled options.
@param integer $num Maximum index.
@return array | [
"Take",
"an",
"integer",
"and",
"convert",
"it",
"into",
"an",
"array",
"of",
"shuffled",
"options",
"."
] | a6dd7c96b78045a3d172e3c5b97e9909b32a9fba | https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Utils.php#L13-L24 |
225,825 | xmeltrut/WordSearch | src/Utils.php | Utils.stringToArray | public static function stringToArray($str)
{
$arr = [];
for ($i = 0; $i < self::stringLength($str); $i++) {
$arr[] = function_exists('mb_substr') ? mb_substr($str, $i, 1) : $str[$i];
}
return $arr;
} | php | public static function stringToArray($str)
{
$arr = [];
for ($i = 0; $i < self::stringLength($str); $i++) {
$arr[] = function_exists('mb_substr') ? mb_substr($str, $i, 1) : $str[$i];
}
return $arr;
} | [
"public",
"static",
"function",
"stringToArray",
"(",
"$",
"str",
")",
"{",
"$",
"arr",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"self",
"::",
"stringLength",
"(",
"$",
"str",
")",
";",
"$",
"i",
"++",
")",
"{",... | Convert a string to an array of letters.
@param string $str String.
@return array | [
"Convert",
"a",
"string",
"to",
"an",
"array",
"of",
"letters",
"."
] | a6dd7c96b78045a3d172e3c5b97e9909b32a9fba | https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Utils.php#L47-L56 |
225,826 | oscarotero/inline-svg | src/Svg.php | Svg.withAttributes | public function withAttributes(array $attributes)
{
$clone = clone $this;
foreach ($attributes as $name => $value) {
$clone->dom->documentElement->setAttribute($name, $value);
}
return $clone;
} | php | public function withAttributes(array $attributes)
{
$clone = clone $this;
foreach ($attributes as $name => $value) {
$clone->dom->documentElement->setAttribute($name, $value);
}
return $clone;
} | [
"public",
"function",
"withAttributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"clone",
"=",
"clone",
"$",
"this",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"clone",
"->",
"dom",
"->",
"doc... | Set new attributes.
@param array $attributes
@return self | [
"Set",
"new",
"attributes",
"."
] | 9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2 | https://github.com/oscarotero/inline-svg/blob/9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2/src/Svg.php#L63-L72 |
225,827 | oscarotero/inline-svg | src/Svg.php | Svg.withA11y | public function withA11y($title = null, $desc = null)
{
$clone = clone $this;
$clone->dom->documentElement->setAttribute('role', 'img');
$ids = [];
if ($title) {
self::getOrCreateNode($clone->dom->documentElement, 'title', $title)->setAttribute('id', $ids[] = uniqid('s... | php | public function withA11y($title = null, $desc = null)
{
$clone = clone $this;
$clone->dom->documentElement->setAttribute('role', 'img');
$ids = [];
if ($title) {
self::getOrCreateNode($clone->dom->documentElement, 'title', $title)->setAttribute('id', $ids[] = uniqid('s... | [
"public",
"function",
"withA11y",
"(",
"$",
"title",
"=",
"null",
",",
"$",
"desc",
"=",
"null",
")",
"{",
"$",
"clone",
"=",
"clone",
"$",
"this",
";",
"$",
"clone",
"->",
"dom",
"->",
"documentElement",
"->",
"setAttribute",
"(",
"'role'",
",",
"'i... | Set accessibility information to the svg.
@param string|null $title Short description
@param string|null $desc Long description
@return Svg | [
"Set",
"accessibility",
"information",
"to",
"the",
"svg",
"."
] | 9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2 | https://github.com/oscarotero/inline-svg/blob/9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2/src/Svg.php#L82-L103 |
225,828 | oscarotero/inline-svg | src/Svg.php | Svg.getOrCreateNode | private static function getOrCreateNode(DOMElement $svg, $tagName, $value)
{
$node = $svg->getElementsByTagName($tagName);
if ($node->length) {
$node = $node->item(0);
$node->nodeValue = $value;
return $node;
}
$newNode = new DOMElem... | php | private static function getOrCreateNode(DOMElement $svg, $tagName, $value)
{
$node = $svg->getElementsByTagName($tagName);
if ($node->length) {
$node = $node->item(0);
$node->nodeValue = $value;
return $node;
}
$newNode = new DOMElem... | [
"private",
"static",
"function",
"getOrCreateNode",
"(",
"DOMElement",
"$",
"svg",
",",
"$",
"tagName",
",",
"$",
"value",
")",
"{",
"$",
"node",
"=",
"$",
"svg",
"->",
"getElementsByTagName",
"(",
"$",
"tagName",
")",
";",
"if",
"(",
"$",
"node",
"->"... | Returns a node by tagName. Create if it doesn't exist
@param DOMElement $svg
@param string $tagName
@param string $value
@return DOMElement | [
"Returns",
"a",
"node",
"by",
"tagName",
".",
"Create",
"if",
"it",
"doesn",
"t",
"exist"
] | 9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2 | https://github.com/oscarotero/inline-svg/blob/9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2/src/Svg.php#L124-L139 |
225,829 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-item-term.php | Carbon_Breadcrumb_Item_Term.setup | public function setup() {
// In order to continue, taxonomy term ID must be specified.
if ( ! $this->get_id() ) {
throw new Carbon_Breadcrumb_Exception( 'The term breadcrumb items must have term ID specified.' );
}
// In order to continue, taxonomy must be specified.
if ( ! $this->get_subtype() ) {
thr... | php | public function setup() {
// In order to continue, taxonomy term ID must be specified.
if ( ! $this->get_id() ) {
throw new Carbon_Breadcrumb_Exception( 'The term breadcrumb items must have term ID specified.' );
}
// In order to continue, taxonomy must be specified.
if ( ! $this->get_subtype() ) {
thr... | [
"public",
"function",
"setup",
"(",
")",
"{",
"// In order to continue, taxonomy term ID must be specified.",
"if",
"(",
"!",
"$",
"this",
"->",
"get_id",
"(",
")",
")",
"{",
"throw",
"new",
"Carbon_Breadcrumb_Exception",
"(",
"'The term breadcrumb items must have term ID... | Configure the title and link URL by using the specified term ID.
@access public
@throws Carbon_Breadcrumb_Exception When term ID or taxonomy isn't specified. | [
"Configure",
"the",
"title",
"and",
"link",
"URL",
"by",
"using",
"the",
"specified",
"term",
"ID",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-term.php#L29-L45 |
225,830 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-item-term.php | Carbon_Breadcrumb_Item_Term.setup_link | public function setup_link() {
$link = get_term_link( $this->term_object->term_id, $this->term_object->taxonomy );
$this->set_link( $link );
} | php | public function setup_link() {
$link = get_term_link( $this->term_object->term_id, $this->term_object->taxonomy );
$this->set_link( $link );
} | [
"public",
"function",
"setup_link",
"(",
")",
"{",
"$",
"link",
"=",
"get_term_link",
"(",
"$",
"this",
"->",
"term_object",
"->",
"term_id",
",",
"$",
"this",
"->",
"term_object",
"->",
"taxonomy",
")",
";",
"$",
"this",
"->",
"set_link",
"(",
"$",
"l... | Setup the link of this item.
@access public | [
"Setup",
"the",
"link",
"of",
"this",
"item",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-term.php#L69-L72 |
225,831 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-renderer.php | Carbon_Breadcrumb_Trail_Renderer.prepare_for_rendering | public function prepare_for_rendering( $trail ) {
// Last chance to modify render settings before rendering.
do_action( 'carbon_breadcrumbs_before_render', $this );
// Whether to auto-sort the items.
$auto_sort = apply_filters( 'carbon_breadcrumbs_auto_sort_items', true );
if ( $auto_sort ) {
$trail->sort... | php | public function prepare_for_rendering( $trail ) {
// Last chance to modify render settings before rendering.
do_action( 'carbon_breadcrumbs_before_render', $this );
// Whether to auto-sort the items.
$auto_sort = apply_filters( 'carbon_breadcrumbs_auto_sort_items', true );
if ( $auto_sort ) {
$trail->sort... | [
"public",
"function",
"prepare_for_rendering",
"(",
"$",
"trail",
")",
"{",
"// Last chance to modify render settings before rendering.",
"do_action",
"(",
"'carbon_breadcrumbs_before_render'",
",",
"$",
"this",
")",
";",
"// Whether to auto-sort the items.",
"$",
"auto_sort",
... | Prepare for rendering.
Allows renderer to be modified in the last second.
Also autosorts the trail items, if autosorting is enabled.
@access public
@param Carbon_Breadcrumb_Trail $trail Trail object. | [
"Prepare",
"for",
"rendering",
".",
"Allows",
"renderer",
"to",
"be",
"modified",
"in",
"the",
"last",
"second",
".",
"Also",
"autosorts",
"the",
"trail",
"items",
"if",
"autosorting",
"is",
"enabled",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-renderer.php#L386-L395 |
225,832 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-renderer.php | Carbon_Breadcrumb_Trail_Renderer.render | public function render( Carbon_Breadcrumb_Trail $trail, $return = false ) {
// If the items are less than the minimum, nothing should be rendered.
if ( $trail->get_total_items() < $this->get_min_items() ) {
return;
}
// Prepare the trail & renderer for rendering.
$this->prepare_for_rendering( $trail );
... | php | public function render( Carbon_Breadcrumb_Trail $trail, $return = false ) {
// If the items are less than the minimum, nothing should be rendered.
if ( $trail->get_total_items() < $this->get_min_items() ) {
return;
}
// Prepare the trail & renderer for rendering.
$this->prepare_for_rendering( $trail );
... | [
"public",
"function",
"render",
"(",
"Carbon_Breadcrumb_Trail",
"$",
"trail",
",",
"$",
"return",
"=",
"false",
")",
"{",
"// If the items are less than the minimum, nothing should be rendered.",
"if",
"(",
"$",
"trail",
"->",
"get_total_items",
"(",
")",
"<",
"$",
... | Render the given breadcrumb trail.
@access public
@param Carbon_Breadcrumb_Trail $trail The trail object.
@param bool $return Whether to return the output.
@return string|void $output The output HTML if $return is true. | [
"Render",
"the",
"given",
"breadcrumb",
"trail",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-renderer.php#L406-L428 |
225,833 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-renderer.php | Carbon_Breadcrumb_Trail_Renderer.render_items | public function render_items( $trail ) {
$items_output = array();
$counter = 0;
$all_items = $trail->get_flat_items();
foreach ( $all_items as $item ) {
// Allow each item to be filtered right before rendering.
$item = apply_filters( 'carbon_breadcrumbs_item', $item, $trail, $this, $counter );
... | php | public function render_items( $trail ) {
$items_output = array();
$counter = 0;
$all_items = $trail->get_flat_items();
foreach ( $all_items as $item ) {
// Allow each item to be filtered right before rendering.
$item = apply_filters( 'carbon_breadcrumbs_item', $item, $trail, $this, $counter );
... | [
"public",
"function",
"render_items",
"(",
"$",
"trail",
")",
"{",
"$",
"items_output",
"=",
"array",
"(",
")",
";",
"$",
"counter",
"=",
"0",
";",
"$",
"all_items",
"=",
"$",
"trail",
"->",
"get_flat_items",
"(",
")",
";",
"foreach",
"(",
"$",
"all_... | Render the breadcrumb trail items.
@access public
@param Carbon_Breadcrumb_Trail $trail The trail object.
@return array $output The output elements. | [
"Render",
"the",
"breadcrumb",
"trail",
"items",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-renderer.php#L438-L459 |
225,834 | xmeltrut/WordSearch | src/Transformer/HtmlTransformer.php | HtmlTransformer.grid | public function grid()
{
$html = "<table class=\"word-search\">\n";
foreach ($this->puzzle->toArray() as $row) {
$html .= "<tr>\n";
foreach ($row as $cell) {
$html .= sprintf("<td>%s</td>\n", $cell);
}
$html .= "</tr>\n";
}
... | php | public function grid()
{
$html = "<table class=\"word-search\">\n";
foreach ($this->puzzle->toArray() as $row) {
$html .= "<tr>\n";
foreach ($row as $cell) {
$html .= sprintf("<td>%s</td>\n", $cell);
}
$html .= "</tr>\n";
}
... | [
"public",
"function",
"grid",
"(",
")",
"{",
"$",
"html",
"=",
"\"<table class=\\\"word-search\\\">\\n\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"puzzle",
"->",
"toArray",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"html",
".=",
"\"<tr>\\n\"",
";",
"fo... | Transform the grid.
@return string | [
"Transform",
"the",
"grid",
"."
] | a6dd7c96b78045a3d172e3c5b97e9909b32a9fba | https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Transformer/HtmlTransformer.php#L27-L42 |
225,835 | xmeltrut/WordSearch | src/Transformer/HtmlTransformer.php | HtmlTransformer.wordList | public function wordList()
{
$html = "<ul>\n";
foreach ($this->puzzle->getWordList() as $word) {
$html .= sprintf("<li>%s</li>\n", $word->word);
}
$html .= "</ul>\n";
return $html;
} | php | public function wordList()
{
$html = "<ul>\n";
foreach ($this->puzzle->getWordList() as $word) {
$html .= sprintf("<li>%s</li>\n", $word->word);
}
$html .= "</ul>\n";
return $html;
} | [
"public",
"function",
"wordList",
"(",
")",
"{",
"$",
"html",
"=",
"\"<ul>\\n\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"puzzle",
"->",
"getWordList",
"(",
")",
"as",
"$",
"word",
")",
"{",
"$",
"html",
".=",
"sprintf",
"(",
"\"<li>%s</li>\\n\"",
","... | Transform the words list.
@return string | [
"Transform",
"the",
"words",
"list",
"."
] | a6dd7c96b78045a3d172e3c5b97e9909b32a9fba | https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Transformer/HtmlTransformer.php#L49-L60 |
225,836 | basvandorst/UberPHP | src/Uber/API/Client.php | Client.getHeaders | private function getHeaders() {
$headers = array('Accept-Language: '.$this->locale);
if($this->user_authorization) {
$headers[] = 'Authorization: Bearer '.$this->token;
} else {
$headers[] ='Authorization: Token '.$this->token;
}
return $headers;
... | php | private function getHeaders() {
$headers = array('Accept-Language: '.$this->locale);
if($this->user_authorization) {
$headers[] = 'Authorization: Bearer '.$this->token;
} else {
$headers[] ='Authorization: Token '.$this->token;
}
return $headers;
... | [
"private",
"function",
"getHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
"'Accept-Language: '",
".",
"$",
"this",
"->",
"locale",
")",
";",
"if",
"(",
"$",
"this",
"->",
"user_authorization",
")",
"{",
"$",
"headers",
"[",
"]",
"=",
"'Aut... | Return an array of HTTP headers
@return string[] | [
"Return",
"an",
"array",
"of",
"HTTP",
"headers"
] | eed59311657cf0e971d46caf3768a8aff53df8e3 | https://github.com/basvandorst/UberPHP/blob/eed59311657cf0e971d46caf3768a8aff53df8e3/src/Uber/API/Client.php#L64-L73 |
225,837 | basvandorst/UberPHP | src/Uber/API/Client.php | Client.products | public function products($latitude, $longitude) {
$path = '/v1/products';
$parameters = array(
'latitude' => $latitude,
'longitude' => $longitude
);
$result = $this->adapter->get($path, $parameters, $this->getHeaders());
return $this->format($result);
... | php | public function products($latitude, $longitude) {
$path = '/v1/products';
$parameters = array(
'latitude' => $latitude,
'longitude' => $longitude
);
$result = $this->adapter->get($path, $parameters, $this->getHeaders());
return $this->format($result);
... | [
"public",
"function",
"products",
"(",
"$",
"latitude",
",",
"$",
"longitude",
")",
"{",
"$",
"path",
"=",
"'/v1/products'",
";",
"$",
"parameters",
"=",
"array",
"(",
"'latitude'",
"=>",
"$",
"latitude",
",",
"'longitude'",
"=>",
"$",
"longitude",
")",
... | Returns information about the Uber products offered at a given location.
@see https://developer.uber.com/v1/endpoints/#product-types
@param float $latitude
@param float $longitude
@return array | [
"Returns",
"information",
"about",
"the",
"Uber",
"products",
"offered",
"at",
"a",
"given",
"location",
"."
] | eed59311657cf0e971d46caf3768a8aff53df8e3 | https://github.com/basvandorst/UberPHP/blob/eed59311657cf0e971d46caf3768a8aff53df8e3/src/Uber/API/Client.php#L83-L91 |
225,838 | basvandorst/UberPHP | src/Uber/API/Client.php | Client.estimatesPrice | public function estimatesPrice($start_latitude, $start_longitude, $end_latitude, $end_longitude) {
$path = '/v1/estimates/price';
$parameters = array(
'start_latitude' => $start_latitude,
'start_longitude' => $start_longitude,
'end_latitude' => $end_latitude,
... | php | public function estimatesPrice($start_latitude, $start_longitude, $end_latitude, $end_longitude) {
$path = '/v1/estimates/price';
$parameters = array(
'start_latitude' => $start_latitude,
'start_longitude' => $start_longitude,
'end_latitude' => $end_latitude,
... | [
"public",
"function",
"estimatesPrice",
"(",
"$",
"start_latitude",
",",
"$",
"start_longitude",
",",
"$",
"end_latitude",
",",
"$",
"end_longitude",
")",
"{",
"$",
"path",
"=",
"'/v1/estimates/price'",
";",
"$",
"parameters",
"=",
"array",
"(",
"'start_latitude... | Returns an estimated price range for each product offered at a given
location.
@see https://developer.uber.com/v1/endpoints/#price-estimates
@param float $start_latitude
@param float $start_longitude
@param float $end_latitude
@param float $end_longitude
@return array | [
"Returns",
"an",
"estimated",
"price",
"range",
"for",
"each",
"product",
"offered",
"at",
"a",
"given",
"location",
"."
] | eed59311657cf0e971d46caf3768a8aff53df8e3 | https://github.com/basvandorst/UberPHP/blob/eed59311657cf0e971d46caf3768a8aff53df8e3/src/Uber/API/Client.php#L130-L140 |
225,839 | basvandorst/UberPHP | src/Uber/API/Client.php | Client.userProfile | public function userProfile() {
$path = '/v1/me';
$result = $this->adapter->get($path, array(), $this->getHeaders());
return $this->format($result);
} | php | public function userProfile() {
$path = '/v1/me';
$result = $this->adapter->get($path, array(), $this->getHeaders());
return $this->format($result);
} | [
"public",
"function",
"userProfile",
"(",
")",
"{",
"$",
"path",
"=",
"'/v1/me'",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"adapter",
"->",
"get",
"(",
"$",
"path",
",",
"array",
"(",
")",
",",
"$",
"this",
"->",
"getHeaders",
"(",
")",
")",
"... | Returns information about the Uber user that has authorized with
the application.
@see https://developer.uber.com/v1/endpoints/#user-profile
@return array | [
"Returns",
"information",
"about",
"the",
"Uber",
"user",
"that",
"has",
"authorized",
"with",
"the",
"application",
"."
] | eed59311657cf0e971d46caf3768a8aff53df8e3 | https://github.com/basvandorst/UberPHP/blob/eed59311657cf0e971d46caf3768a8aff53df8e3/src/Uber/API/Client.php#L172-L177 |
225,840 | puli/cli | src/Handler/ConfigCommandHandler.php | ConfigCommandHandler.handleList | public function handleList(Args $args, IO $io)
{
$raw = !$args->isOptionSet('parsed');
$userValues = $this->manager->getConfigKeys(false, false, $raw);
$effectiveValues = $this->manager->getConfigKeys(true, true, $raw);
$table = new Table(PuliTableStyle::borderless());
$tabl... | php | public function handleList(Args $args, IO $io)
{
$raw = !$args->isOptionSet('parsed');
$userValues = $this->manager->getConfigKeys(false, false, $raw);
$effectiveValues = $this->manager->getConfigKeys(true, true, $raw);
$table = new Table(PuliTableStyle::borderless());
$tabl... | [
"public",
"function",
"handleList",
"(",
"Args",
"$",
"args",
",",
"IO",
"$",
"io",
")",
"{",
"$",
"raw",
"=",
"!",
"$",
"args",
"->",
"isOptionSet",
"(",
"'parsed'",
")",
";",
"$",
"userValues",
"=",
"$",
"this",
"->",
"manager",
"->",
"getConfigKey... | Handles the "config" command.
@param Args $args The console arguments
@param IO $io The I/O
@return int The status code | [
"Handles",
"the",
"config",
"command",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ConfigCommandHandler.php#L53-L75 |
225,841 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php | RevisionableServiceProvider.bindUserProvider | protected function bindUserProvider()
{
$userProvider = $this->app['config']->get('revisionable.userprovider');
switch ($userProvider) {
case 'sentry':
$this->bindSentryProvider();
break;
case 'sentinel':
$this->bindSentinelPr... | php | protected function bindUserProvider()
{
$userProvider = $this->app['config']->get('revisionable.userprovider');
switch ($userProvider) {
case 'sentry':
$this->bindSentryProvider();
break;
case 'sentinel':
$this->bindSentinelPr... | [
"protected",
"function",
"bindUserProvider",
"(",
")",
"{",
"$",
"userProvider",
"=",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'revisionable.userprovider'",
")",
";",
"switch",
"(",
"$",
"userProvider",
")",
"{",
"case",
"'sentry'",... | Bind user provider implementation to the IoC. | [
"Bind",
"user",
"provider",
"implementation",
"to",
"the",
"IoC",
"."
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php#L38-L64 |
225,842 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php | RevisionableServiceProvider.bindSentryProvider | protected function bindSentryProvider()
{
$this->app->singleton('revisionable.userprovider', function ($app) {
$field = $app['config']->get('revisionable.userfield');
return new Adapters\Sentry($app['sentry'], $field);
});
} | php | protected function bindSentryProvider()
{
$this->app->singleton('revisionable.userprovider', function ($app) {
$field = $app['config']->get('revisionable.userfield');
return new Adapters\Sentry($app['sentry'], $field);
});
} | [
"protected",
"function",
"bindSentryProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'revisionable.userprovider'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"field",
"=",
"$",
"app",
"[",
"'config'",
"]",
"->",
"get",
"... | Bind adapter for Sentry to the IoC. | [
"Bind",
"adapter",
"for",
"Sentry",
"to",
"the",
"IoC",
"."
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php#L69-L75 |
225,843 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php | RevisionableServiceProvider.bindSessionProvider | protected function bindSessionProvider()
{
$this->app->singleton('revisionable.userprovider', function ($app) {
$field = $app['config']->get('revisionable.userfield');
return new Adapters\Session(session(), $field);
});
} | php | protected function bindSessionProvider()
{
$this->app->singleton('revisionable.userprovider', function ($app) {
$field = $app['config']->get('revisionable.userfield');
return new Adapters\Session(session(), $field);
});
} | [
"protected",
"function",
"bindSessionProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'revisionable.userprovider'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"field",
"=",
"$",
"app",
"[",
"'config'",
"]",
"->",
"get",
... | Bind adapter for Session to the IoC.
@return void | [
"Bind",
"adapter",
"for",
"Session",
"to",
"the",
"IoC",
"."
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php#L115-L121 |
225,844 | johannesschobel/laravel-revisionable | src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php | RevisionableServiceProvider.bootModel | protected function bootModel()
{
$table = $this->app['config']->get('revisionable.table', 'revisions');
$user = $this->app['config']->get('revisionable.usermodel', 'App\User');
forward_static_call_array([Revision::class, 'setCustomTable'], [$table]);
forward_static_call_array([Revis... | php | protected function bootModel()
{
$table = $this->app['config']->get('revisionable.table', 'revisions');
$user = $this->app['config']->get('revisionable.usermodel', 'App\User');
forward_static_call_array([Revision::class, 'setCustomTable'], [$table]);
forward_static_call_array([Revis... | [
"protected",
"function",
"bootModel",
"(",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'revisionable.table'",
",",
"'revisions'",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"app",
"[",
"'config'",... | Boot the Revision model. | [
"Boot",
"the",
"Revision",
"model",
"."
] | f5a1d4c1eff343e76f58b19b97be3007f4584b49 | https://github.com/johannesschobel/laravel-revisionable/blob/f5a1d4c1eff343e76f58b19b97be3007f4584b49/src/JohannesSchobel/Revisionable/RevisionableServiceProvider.php#L126-L133 |
225,845 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-locator.php | Carbon_Breadcrumb_Locator.factory | public static function factory( $type, $subtype = '' ) {
$class = self::verify_class_name( __CLASS__ . '_' . $type, 'Unexisting breadcrumb locator type: "' . $type . '".' );
$locator = new $class( $type, $subtype );
return $locator;
} | php | public static function factory( $type, $subtype = '' ) {
$class = self::verify_class_name( __CLASS__ . '_' . $type, 'Unexisting breadcrumb locator type: "' . $type . '".' );
$locator = new $class( $type, $subtype );
return $locator;
} | [
"public",
"static",
"function",
"factory",
"(",
"$",
"type",
",",
"$",
"subtype",
"=",
"''",
")",
"{",
"$",
"class",
"=",
"self",
"::",
"verify_class_name",
"(",
"__CLASS__",
".",
"'_'",
".",
"$",
"type",
",",
"'Unexisting breadcrumb locator type: \"'",
".",... | Build a new breadcrumb item locator of the selected type.
@static
@access public
@param string $type Type of the breadcrumb item locator.
@param string $subtype Subtype of the breadcrumb item locator.
@return Carbon_Breadcrumb_Locator $locator The new breadcrumb item locator. | [
"Build",
"a",
"new",
"breadcrumb",
"item",
"locator",
"of",
"the",
"selected",
"type",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-locator.php#L41-L46 |
225,846 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-locator.php | Carbon_Breadcrumb_Locator.generate_items_for_subtypes | public function generate_items_for_subtypes( $subtypes ) {
$all_items = array();
foreach ( $subtypes as $subtype ) {
$locator = Carbon_Breadcrumb_Locator::factory( $this->get_type(), $subtype );
if ( $locator->is_included() ) {
$items = $locator->get_items();
$all_items = array_merge( $all_items,... | php | public function generate_items_for_subtypes( $subtypes ) {
$all_items = array();
foreach ( $subtypes as $subtype ) {
$locator = Carbon_Breadcrumb_Locator::factory( $this->get_type(), $subtype );
if ( $locator->is_included() ) {
$items = $locator->get_items();
$all_items = array_merge( $all_items,... | [
"public",
"function",
"generate_items_for_subtypes",
"(",
"$",
"subtypes",
")",
"{",
"$",
"all_items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"subtypes",
"as",
"$",
"subtype",
")",
"{",
"$",
"locator",
"=",
"Carbon_Breadcrumb_Locator",
"::",
"fact... | Generate a set of breadcrumb items that found by the current type and the provided subtypes.
@access public
@param array $subtypes The subtypes to generate items for.
@return array $items The items, generated by this locator. | [
"Generate",
"a",
"set",
"of",
"breadcrumb",
"items",
"that",
"found",
"by",
"the",
"current",
"type",
"and",
"the",
"provided",
"subtypes",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-locator.php#L71-L83 |
225,847 | BKWLD/upchuck | src/Storage.php | Storage.makeNestedAndUniquePath | public function makeNestedAndUniquePath($filename, $disk = null) {
// If no disk defined, get it from the current mount mananger
if (empty($disk)) $disk = $this->manager->getFilesystem('disk');
// Remove unsafe characters from the filename
// https://regex101.com/r/mJ3sI5/1
$fi... | php | public function makeNestedAndUniquePath($filename, $disk = null) {
// If no disk defined, get it from the current mount mananger
if (empty($disk)) $disk = $this->manager->getFilesystem('disk');
// Remove unsafe characters from the filename
// https://regex101.com/r/mJ3sI5/1
$fi... | [
"public",
"function",
"makeNestedAndUniquePath",
"(",
"$",
"filename",
",",
"$",
"disk",
"=",
"null",
")",
"{",
"// If no disk defined, get it from the current mount mananger",
"if",
"(",
"empty",
"(",
"$",
"disk",
")",
")",
"$",
"disk",
"=",
"$",
"this",
"->",
... | Create a unique directory and filename
@param string $filename
@param League\Flysystem\Filesystem|void $disk
@return string New path and filename | [
"Create",
"a",
"unique",
"directory",
"and",
"filename"
] | 2d2202b1bc4a86a0a91ceb319521a263b0c88f54 | https://github.com/BKWLD/upchuck/blob/2d2202b1bc4a86a0a91ceb319521a263b0c88f54/src/Storage.php#L75-L101 |
225,848 | BKWLD/upchuck | src/Storage.php | Storage.delete | public function delete($url) {
// Convert to a path
$path = $this->helpers->path($url);
// Delete the path if it still exists
if ($this->manager->has('disk://'.$path)) $this->manager->delete('disk://'.$path);
} | php | public function delete($url) {
// Convert to a path
$path = $this->helpers->path($url);
// Delete the path if it still exists
if ($this->manager->has('disk://'.$path)) $this->manager->delete('disk://'.$path);
} | [
"public",
"function",
"delete",
"(",
"$",
"url",
")",
"{",
"// Convert to a path",
"$",
"path",
"=",
"$",
"this",
"->",
"helpers",
"->",
"path",
"(",
"$",
"url",
")",
";",
"// Delete the path if it still exists",
"if",
"(",
"$",
"this",
"->",
"manager",
"-... | Delete an upload
@param string $url A URL like was returned from moveUpload()
@return void | [
"Delete",
"an",
"upload"
] | 2d2202b1bc4a86a0a91ceb319521a263b0c88f54 | https://github.com/BKWLD/upchuck/blob/2d2202b1bc4a86a0a91ceb319521a263b0c88f54/src/Storage.php#L109-L116 |
225,849 | puli/cli | src/Handler/BuildCommandHandler.php | BuildCommandHandler.handle | public function handle(Args $args)
{
$target = $args->getArgument('target');
if (!in_array($target, self::$targets)) {
throw new RuntimeException(sprintf(
'Invalid build target "%s". Expected one of: "%s"',
$target,
implode('", "', self::$... | php | public function handle(Args $args)
{
$target = $args->getArgument('target');
if (!in_array($target, self::$targets)) {
throw new RuntimeException(sprintf(
'Invalid build target "%s". Expected one of: "%s"',
$target,
implode('", "', self::$... | [
"public",
"function",
"handle",
"(",
"Args",
"$",
"args",
")",
"{",
"$",
"target",
"=",
"$",
"args",
"->",
"getArgument",
"(",
"'target'",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"target",
",",
"self",
"::",
"$",
"targets",
")",
")",
"{",
... | Handles the "build" command.
@param Args $args The console arguments.
@return int The status code. | [
"Handles",
"the",
"build",
"command",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/BuildCommandHandler.php#L70-L98 |
225,850 | Gaufrette/extras | src/Resolvable/Resolver/AwsS3PresignedUrlResolver.php | AwsS3PresignedUrlResolver.resolve | public function resolve($path)
{
// For AWS SDK v2
if ($this->service instanceof \Aws\Common\Client\AbstractClient) {
return $this->service->getObjectUrl(
$this->bucket,
$this->computePath($path),
$this->expiresAt
);
}
... | php | public function resolve($path)
{
// For AWS SDK v2
if ($this->service instanceof \Aws\Common\Client\AbstractClient) {
return $this->service->getObjectUrl(
$this->bucket,
$this->computePath($path),
$this->expiresAt
);
}
... | [
"public",
"function",
"resolve",
"(",
"$",
"path",
")",
"{",
"// For AWS SDK v2",
"if",
"(",
"$",
"this",
"->",
"service",
"instanceof",
"\\",
"Aws",
"\\",
"Common",
"\\",
"Client",
"\\",
"AbstractClient",
")",
"{",
"return",
"$",
"this",
"->",
"service",
... | Resolves given object path into presigned request URI.
@param string $path
@return string | [
"Resolves",
"given",
"object",
"path",
"into",
"presigned",
"request",
"URI",
"."
] | 191863b75138a70890f924f5c7cc2772e477667c | https://github.com/Gaufrette/extras/blob/191863b75138a70890f924f5c7cc2772e477667c/src/Resolvable/Resolver/AwsS3PresignedUrlResolver.php#L50-L68 |
225,851 | puli/cli | src/Handler/TreeCommandHandler.php | TreeCommandHandler.handle | public function handle(Args $args, IO $io)
{
$path = Path::makeAbsolute($args->getArgument('path'), $this->currentPath);
$resource = $this->repo->get($path);
$total = 0;
$io->writeLine('<c1>'.$resource->getPath().'</c1>');
$this->printTree($io, $resource, $total);
... | php | public function handle(Args $args, IO $io)
{
$path = Path::makeAbsolute($args->getArgument('path'), $this->currentPath);
$resource = $this->repo->get($path);
$total = 0;
$io->writeLine('<c1>'.$resource->getPath().'</c1>');
$this->printTree($io, $resource, $total);
... | [
"public",
"function",
"handle",
"(",
"Args",
"$",
"args",
",",
"IO",
"$",
"io",
")",
"{",
"$",
"path",
"=",
"Path",
"::",
"makeAbsolute",
"(",
"$",
"args",
"->",
"getArgument",
"(",
"'path'",
")",
",",
"$",
"this",
"->",
"currentPath",
")",
";",
"$... | Handles the "tree" command.
@param Args $args The console arguments.
@param IO $io The I/O.
@return int The status code. | [
"Handles",
"the",
"tree",
"command",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/TreeCommandHandler.php#L85-L100 |
225,852 | puli/cli | src/Handler/TreeCommandHandler.php | TreeCommandHandler.printTree | private function printTree(IO $io, PuliResource $resource, &$total, $prefix = '')
{
// The root node has an empty name
$children = $resource->listChildren();
$lastIndex = count($children) - 1;
$index = 0;
foreach ($children as $child) {
$isLastChild = $index === ... | php | private function printTree(IO $io, PuliResource $resource, &$total, $prefix = '')
{
// The root node has an empty name
$children = $resource->listChildren();
$lastIndex = count($children) - 1;
$index = 0;
foreach ($children as $child) {
$isLastChild = $index === ... | [
"private",
"function",
"printTree",
"(",
"IO",
"$",
"io",
",",
"PuliResource",
"$",
"resource",
",",
"&",
"$",
"total",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"// The root node has an empty name",
"$",
"children",
"=",
"$",
"resource",
"->",
"listChildren"... | Recursively prints the tree for the given resource.
@param IO $io The I/O.
@param PuliResource $resource The printed resource.
@param int $total Collects the total number of printed resources.
@param string $prefix The prefix for all printed resources. | [
"Recursively",
"prints",
"the",
"tree",
"for",
"the",
"given",
"resource",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/TreeCommandHandler.php#L110-L135 |
225,853 | tyxla/carbon-breadcrumbs | admin/class-carbon-breadcrumb-admin-settings-field.php | Carbon_Breadcrumb_Admin_Settings_Field.factory | public static function factory( $type, $id, $title, $section = '', $args = array() ) {
$class = self::verify_class_name( __CLASS__ . '_' . $type, 'Unknown settings field type "' . $type . '".' );
$field = new $class( $id, $title, $section, $args );
return $field;
} | php | public static function factory( $type, $id, $title, $section = '', $args = array() ) {
$class = self::verify_class_name( __CLASS__ . '_' . $type, 'Unknown settings field type "' . $type . '".' );
$field = new $class( $id, $title, $section, $args );
return $field;
} | [
"public",
"static",
"function",
"factory",
"(",
"$",
"type",
",",
"$",
"id",
",",
"$",
"title",
",",
"$",
"section",
"=",
"''",
",",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"$",
"class",
"=",
"self",
"::",
"verify_class_name",
"(",
"__CLASS_... | Register a new administration breadcrumb settings field of a certain type.
@static
@access public
@param string $type Type of the field.
@param string $id The ID of the field.
@param string $title The title of the field.
@param string $section The name of the section.
@param array $args Additional args.
@return Carb... | [
"Register",
"a",
"new",
"administration",
"breadcrumb",
"settings",
"field",
"of",
"a",
"certain",
"type",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin-settings-field.php#L75-L80 |
225,854 | tyxla/carbon-breadcrumbs | admin/class-carbon-breadcrumb-admin-settings-field.php | Carbon_Breadcrumb_Admin_Settings_Field.get_value | public function get_value() {
$original_name = str_replace( 'carbon_breadcrumbs_', '', $this->get_id() );
$field_data = Carbon_Breadcrumb_Admin_Settings::get_field_data();
$default = ! empty( $field_data[ $original_name ]['default'] ) ? $field_data[ $original_name ]['default'] : '';
$value = get_optio... | php | public function get_value() {
$original_name = str_replace( 'carbon_breadcrumbs_', '', $this->get_id() );
$field_data = Carbon_Breadcrumb_Admin_Settings::get_field_data();
$default = ! empty( $field_data[ $original_name ]['default'] ) ? $field_data[ $original_name ]['default'] : '';
$value = get_optio... | [
"public",
"function",
"get_value",
"(",
")",
"{",
"$",
"original_name",
"=",
"str_replace",
"(",
"'carbon_breadcrumbs_'",
",",
"''",
",",
"$",
"this",
"->",
"get_id",
"(",
")",
")",
";",
"$",
"field_data",
"=",
"Carbon_Breadcrumb_Admin_Settings",
"::",
"get_fi... | Retrieve the field value. If there is no value, use the default one.
@access public
@return mixed $value The value of this field. | [
"Retrieve",
"the",
"field",
"value",
".",
"If",
"there",
"is",
"no",
"value",
"use",
"the",
"default",
"one",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin-settings-field.php#L133-L144 |
225,855 | tyxla/carbon-breadcrumbs | admin/class-carbon-breadcrumb-admin-settings-field.php | Carbon_Breadcrumb_Admin_Settings_Field.render_help | public function render_help() {
$field_data = Carbon_Breadcrumb_Admin_Settings::get_field_data();
$original_name = str_replace( 'carbon_breadcrumbs_', '', $this->get_id() );
$help = ! empty( $field_data[ $original_name ]['help'] ) ? $field_data[ $original_name ]['help'] : '';
if ( ! $help ) {
ret... | php | public function render_help() {
$field_data = Carbon_Breadcrumb_Admin_Settings::get_field_data();
$original_name = str_replace( 'carbon_breadcrumbs_', '', $this->get_id() );
$help = ! empty( $field_data[ $original_name ]['help'] ) ? $field_data[ $original_name ]['help'] : '';
if ( ! $help ) {
ret... | [
"public",
"function",
"render_help",
"(",
")",
"{",
"$",
"field_data",
"=",
"Carbon_Breadcrumb_Admin_Settings",
"::",
"get_field_data",
"(",
")",
";",
"$",
"original_name",
"=",
"str_replace",
"(",
"'carbon_breadcrumbs_'",
",",
"''",
",",
"$",
"this",
"->",
"get... | Render the help description of this field.
@access public | [
"Render",
"the",
"help",
"description",
"of",
"this",
"field",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin-settings-field.php#L151-L161 |
225,856 | ccottet/ldap | Core/NodeAttribute.php | NodeAttribute.add | public function add($value)
{
if (is_array($value)) {
return $this->handleArray('add', $value);
}
if (is_null($value) || strlen($value) == 0) {
return false;
}
if (false !== array_search($value, $this->values)) {
return false;
}
... | php | public function add($value)
{
if (is_array($value)) {
return $this->handleArray('add', $value);
}
if (is_null($value) || strlen($value) == 0) {
return false;
}
if (false !== array_search($value, $this->values)) {
return false;
}
... | [
"public",
"function",
"add",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"this",
"->",
"handleArray",
"(",
"'add'",
",",
"$",
"value",
")",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"value"... | Add a value as an instance of this attribute
@param mixed $value Value to add to the attribute instances
@return boolean true if success | [
"Add",
"a",
"value",
"as",
"an",
"instance",
"of",
"this",
"attribute"
] | 0759f17996fbb434ee5155dc527b95d8059c6d41 | https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/NodeAttribute.php#L75-L88 |
225,857 | ccottet/ldap | Core/NodeAttribute.php | NodeAttribute.set | public function set($values)
{
if (! is_array($values)) {
$values = array($values);
}
$this->values = $values;
$this->snapshot();
$this->tracker->markOverridden();
return true;
} | php | public function set($values)
{
if (! is_array($values)) {
$values = array($values);
}
$this->values = $values;
$this->snapshot();
$this->tracker->markOverridden();
return true;
} | [
"public",
"function",
"set",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"$",
"values",
"=",
"array",
"(",
"$",
"values",
")",
";",
"}",
"$",
"this",
"->",
"values",
"=",
"$",
"values",
";",
"$",... | Sets a set of value replacing any existing values registered
@param mixed $values Values to set for the attribute instances
@return boolean true if success | [
"Sets",
"a",
"set",
"of",
"value",
"replacing",
"any",
"existing",
"values",
"registered"
] | 0759f17996fbb434ee5155dc527b95d8059c6d41 | https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/NodeAttribute.php#L97-L106 |
225,858 | ccottet/ldap | Core/NodeAttribute.php | NodeAttribute.handleArray | protected function handleArray($method, array $values)
{
$result = false;
foreach ($values as $value) {
$flag = call_user_func(array($this, $method), $value);
$result = $result || $flag;
}
return $result;
} | php | protected function handleArray($method, array $values)
{
$result = false;
foreach ($values as $value) {
$flag = call_user_func(array($this, $method), $value);
$result = $result || $flag;
}
return $result;
} | [
"protected",
"function",
"handleArray",
"(",
"$",
"method",
",",
"array",
"$",
"values",
")",
"{",
"$",
"result",
"=",
"false",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
"{",
"$",
"flag",
"=",
"call_user_func",
"(",
"array",
"(",
"... | Handle action for an array of values to the attribute
@param string $method Name of the method to use for handling
@param array $values Values to be added
@return boolean True if success | [
"Handle",
"action",
"for",
"an",
"array",
"of",
"values",
"to",
"the",
"attribute"
] | 0759f17996fbb434ee5155dc527b95d8059c6d41 | https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/NodeAttribute.php#L126-L134 |
225,859 | ccottet/ldap | Core/NodeAttribute.php | NodeAttribute.remove | public function remove($value)
{
if (is_array($value)) {
return $this->handleArray('remove', $value);
}
$key = array_search($value, $this->values);
if (false === $key) {
return false;
}
$this->offsetUnset($key);
return true;
} | php | public function remove($value)
{
if (is_array($value)) {
return $this->handleArray('remove', $value);
}
$key = array_search($value, $this->values);
if (false === $key) {
return false;
}
$this->offsetUnset($key);
return true;
} | [
"public",
"function",
"remove",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"this",
"->",
"handleArray",
"(",
"'remove'",
",",
"$",
"value",
")",
";",
"}",
"$",
"key",
"=",
"array_search",
"(... | Removes a value from the attribute stack
@param mixed $value Value to be removed
@return boolean True if success | [
"Removes",
"a",
"value",
"from",
"the",
"attribute",
"stack"
] | 0759f17996fbb434ee5155dc527b95d8059c6d41 | https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/NodeAttribute.php#L143-L154 |
225,860 | okvpn/datadog-symfony | src/Services/ExceptionHashService.php | ExceptionHashService.hash | public function hash(\Throwable $exception): string
{
$hash = '';
$trace = $exception->getTrace();
$trace[] = [
'file' => $exception->getFile(),
'line' => $exception->getLine()
];
foreach ($trace as $place) {
if (isset($place['file'], $pla... | php | public function hash(\Throwable $exception): string
{
$hash = '';
$trace = $exception->getTrace();
$trace[] = [
'file' => $exception->getFile(),
'line' => $exception->getLine()
];
foreach ($trace as $place) {
if (isset($place['file'], $pla... | [
"public",
"function",
"hash",
"(",
"\\",
"Throwable",
"$",
"exception",
")",
":",
"string",
"{",
"$",
"hash",
"=",
"''",
";",
"$",
"trace",
"=",
"$",
"exception",
"->",
"getTrace",
"(",
")",
";",
"$",
"trace",
"[",
"]",
"=",
"[",
"'file'",
"=>",
... | This function returns a unique identifier for the exception.
This id can be used as a hash key for find duplicate exceptions
@param \Throwable $exception
@return string | [
"This",
"function",
"returns",
"a",
"unique",
"identifier",
"for",
"the",
"exception",
".",
"This",
"id",
"can",
"be",
"used",
"as",
"a",
"hash",
"key",
"for",
"find",
"duplicate",
"exceptions"
] | 310eb65b648db692fa877dfb5de6005bf4b9b640 | https://github.com/okvpn/datadog-symfony/blob/310eb65b648db692fa877dfb5de6005bf4b9b640/src/Services/ExceptionHashService.php#L24-L41 |
225,861 | garf/laravel-conf | src/Drivers/DatabaseDriver.php | DatabaseDriver.set | public function set($key, $value)
{
array_set($this->config, $key, $value);
$this->persist();
return $this;
} | php | public function set($key, $value)
{
array_set($this->config, $key, $value);
$this->persist();
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"array_set",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"key",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"persist",
"(",
")",
";",
"return",
"$",
"this",
";",
"}"... | Store config value by key.
@param string $key
@param mixed $value
@return $this | [
"Store",
"config",
"value",
"by",
"key",
"."
] | bca2622a2563b538f400379fbcf3dbd91601da70 | https://github.com/garf/laravel-conf/blob/bca2622a2563b538f400379fbcf3dbd91601da70/src/Drivers/DatabaseDriver.php#L43-L49 |
225,862 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail.php | Carbon_Breadcrumb_Trail.add_item | public function add_item( $item ) {
if ( is_array( $item ) ) {
foreach ( $item as $single_item ) {
$this->add_item( $single_item );
}
} else {
$priority = $item->get_priority();
$this->items[ $priority ][] = $item;
}
} | php | public function add_item( $item ) {
if ( is_array( $item ) ) {
foreach ( $item as $single_item ) {
$this->add_item( $single_item );
}
} else {
$priority = $item->get_priority();
$this->items[ $priority ][] = $item;
}
} | [
"public",
"function",
"add_item",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"item",
")",
")",
"{",
"foreach",
"(",
"$",
"item",
"as",
"$",
"single_item",
")",
"{",
"$",
"this",
"->",
"add_item",
"(",
"$",
"single_item",
")",
";",... | Add a single Carbon_Breadcrumb_Item or an array of them to the trail.
@access public
@param mixed $item The item or array of items to add. | [
"Add",
"a",
"single",
"Carbon_Breadcrumb_Item",
"or",
"an",
"array",
"of",
"them",
"to",
"the",
"trail",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail.php#L104-L113 |
225,863 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail.php | Carbon_Breadcrumb_Trail.add_custom_item | public function add_custom_item( $title, $link = '', $priority = 1000 ) {
$custom_item = Carbon_Breadcrumb_Item::factory( 'custom', $priority );
$custom_item->set_title( $title );
$custom_item->set_link( $link );
$custom_item->setup();
$this->add_item( $custom_item );
} | php | public function add_custom_item( $title, $link = '', $priority = 1000 ) {
$custom_item = Carbon_Breadcrumb_Item::factory( 'custom', $priority );
$custom_item->set_title( $title );
$custom_item->set_link( $link );
$custom_item->setup();
$this->add_item( $custom_item );
} | [
"public",
"function",
"add_custom_item",
"(",
"$",
"title",
",",
"$",
"link",
"=",
"''",
",",
"$",
"priority",
"=",
"1000",
")",
"{",
"$",
"custom_item",
"=",
"Carbon_Breadcrumb_Item",
"::",
"factory",
"(",
"'custom'",
",",
"$",
"priority",
")",
";",
"$"... | Add a custom breadcrumb item to the trail.
@access public
@param string $title Breadcrumb item title.
@param string $link Breadcrumb item link.
@param int $priority Breadcrumb item priority. | [
"Add",
"a",
"custom",
"breadcrumb",
"item",
"to",
"the",
"trail",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail.php#L124-L130 |
225,864 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail.php | Carbon_Breadcrumb_Trail.remove_item | public function remove_item( $title = '', $link = '' ) {
// If both title and link are specified, search for exact match.
$all_items = $this->get_items();
foreach ( $all_items as $items_priority => $items ) {
foreach ( $items as $item_key => $item ) {
if ( 0 === strcasecmp( $item->get_title(), $title ) && ... | php | public function remove_item( $title = '', $link = '' ) {
// If both title and link are specified, search for exact match.
$all_items = $this->get_items();
foreach ( $all_items as $items_priority => $items ) {
foreach ( $items as $item_key => $item ) {
if ( 0 === strcasecmp( $item->get_title(), $title ) && ... | [
"public",
"function",
"remove_item",
"(",
"$",
"title",
"=",
"''",
",",
"$",
"link",
"=",
"''",
")",
"{",
"// If both title and link are specified, search for exact match.",
"$",
"all_items",
"=",
"$",
"this",
"->",
"get_items",
"(",
")",
";",
"foreach",
"(",
... | Remove an item from the breadcrumb trail by both title and link.
@access public
@param string $title Title to remove breadcrumb item by.
@param string $link Link URL to remove breadcrumb item by. | [
"Remove",
"an",
"item",
"from",
"the",
"breadcrumb",
"trail",
"by",
"both",
"title",
"and",
"link",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail.php#L140-L154 |
225,865 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail.php | Carbon_Breadcrumb_Trail.remove_item_by_method | public function remove_item_by_method( $method, $data ) {
// Search all items for one with the same title.
$all_items = $this->get_items();
foreach ( $all_items as $priority => $items ) {
foreach ( $items as $item_key => $item ) {
$method_result = call_user_func( array( $item, $method ), $data );
if ( ... | php | public function remove_item_by_method( $method, $data ) {
// Search all items for one with the same title.
$all_items = $this->get_items();
foreach ( $all_items as $priority => $items ) {
foreach ( $items as $item_key => $item ) {
$method_result = call_user_func( array( $item, $method ), $data );
if ( ... | [
"public",
"function",
"remove_item_by_method",
"(",
"$",
"method",
",",
"$",
"data",
")",
"{",
"// Search all items for one with the same title.",
"$",
"all_items",
"=",
"$",
"this",
"->",
"get_items",
"(",
")",
";",
"foreach",
"(",
"$",
"all_items",
"as",
"$",
... | Remove an item from the breadcrumb trail by a specified method.
@access public
@param string $method Item method to remove breadcrumb item by.
@param string $data Additional data to pass to the method. | [
"Remove",
"an",
"item",
"from",
"the",
"breadcrumb",
"trail",
"by",
"a",
"specified",
"method",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail.php#L164-L179 |
225,866 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail.php | Carbon_Breadcrumb_Trail.remove_item_by_priority | public function remove_item_by_priority( $priority = 0 ) {
// Search all items for the same priority.
$all_items = $this->get_items();
if ( array_key_exists( $priority, $all_items ) ) {
// Remove all items with that priority.
unset( $all_items[ $priority ] );
}
// Update the items.
$this->set_items( ... | php | public function remove_item_by_priority( $priority = 0 ) {
// Search all items for the same priority.
$all_items = $this->get_items();
if ( array_key_exists( $priority, $all_items ) ) {
// Remove all items with that priority.
unset( $all_items[ $priority ] );
}
// Update the items.
$this->set_items( ... | [
"public",
"function",
"remove_item_by_priority",
"(",
"$",
"priority",
"=",
"0",
")",
"{",
"// Search all items for the same priority.",
"$",
"all_items",
"=",
"$",
"this",
"->",
"get_items",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"priority",
",... | Remove an item from the breadcrumb trail by its priority.
@access public
@param int $priority Priority to remove breadcrumb item by. | [
"Remove",
"an",
"item",
"from",
"the",
"breadcrumb",
"trail",
"by",
"its",
"priority",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail.php#L210-L220 |
225,867 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail.php | Carbon_Breadcrumb_Trail.get_flat_items | public function get_flat_items() {
$flat_items = array();
foreach ( $this->items as $priority => $items ) {
$flat_items = array_merge( $flat_items, $items );
}
return $flat_items;
} | php | public function get_flat_items() {
$flat_items = array();
foreach ( $this->items as $priority => $items ) {
$flat_items = array_merge( $flat_items, $items );
}
return $flat_items;
} | [
"public",
"function",
"get_flat_items",
"(",
")",
"{",
"$",
"flat_items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"priority",
"=>",
"$",
"items",
")",
"{",
"$",
"flat_items",
"=",
"array_merge",
"(",
"$",
"... | Retrieve the breadcrumb items in a flat list.
@access public
@return array $flat_items The breadcrumb items, contained in the trail. | [
"Retrieve",
"the",
"breadcrumb",
"items",
"in",
"a",
"flat",
"list",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail.php#L240-L248 |
225,868 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail.php | Carbon_Breadcrumb_Trail.render | public function render( $return = false ) {
// Get the rendered output.
$output = $this->get_renderer()->render( $this, true );
if ( $return ) {
return $output;
}
echo wp_kses( $output, wp_kses_allowed_html( 'post' ) );
} | php | public function render( $return = false ) {
// Get the rendered output.
$output = $this->get_renderer()->render( $this, true );
if ( $return ) {
return $output;
}
echo wp_kses( $output, wp_kses_allowed_html( 'post' ) );
} | [
"public",
"function",
"render",
"(",
"$",
"return",
"=",
"false",
")",
"{",
"// Get the rendered output.",
"$",
"output",
"=",
"$",
"this",
"->",
"get_renderer",
"(",
")",
"->",
"render",
"(",
"$",
"this",
",",
"true",
")",
";",
"if",
"(",
"$",
"return... | Render the breadcrumb trail.
@access public
@param bool $return Whether to return the output.
@return string|void $output The output HTML if $return is true. | [
"Render",
"the",
"breadcrumb",
"trail",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail.php#L292-L302 |
225,869 | pyrou/morpheus | src/Morpheus/Color.php | Color.writeBits | function writeBits($value) {
$this->r = ($this->r & 0xFE) + ($value >> 2 & 1);
$this->g = ($this->g & 0xFE) + ($value >> 1 & 1);
$this->b = ($this->b & 0xFE) + ($value >> 0 & 1);
/* // debug colors
$this->r = 0;
$this->g = $value << 5;
$this->b = 0;
$this->a = 1;
/**/
} | php | function writeBits($value) {
$this->r = ($this->r & 0xFE) + ($value >> 2 & 1);
$this->g = ($this->g & 0xFE) + ($value >> 1 & 1);
$this->b = ($this->b & 0xFE) + ($value >> 0 & 1);
/* // debug colors
$this->r = 0;
$this->g = $value << 5;
$this->b = 0;
$this->a = 1;
/**/
} | [
"function",
"writeBits",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"r",
"=",
"(",
"$",
"this",
"->",
"r",
"&",
"0xFE",
")",
"+",
"(",
"$",
"value",
">>",
"2",
"&",
"1",
")",
";",
"$",
"this",
"->",
"g",
"=",
"(",
"$",
"this",
"->",
... | Write a 3-bits-length integer in color
@param integer $value Integer value between 0 (0b000) and 7 (0b111) | [
"Write",
"a",
"3",
"-",
"bits",
"-",
"length",
"integer",
"in",
"color"
] | 5dc1686651da5cbc4968fcf999b9ee998cc43b25 | https://github.com/pyrou/morpheus/blob/5dc1686651da5cbc4968fcf999b9ee998cc43b25/src/Morpheus/Color.php#L29-L39 |
225,870 | pyrou/morpheus | src/Morpheus/Color.php | Color.readBits | function readBits() {
$value = ($this->r & 1) << 2;
$value += ($this->g & 1) << 1;
$value += ($this->b & 1) << 0;
return $value;
} | php | function readBits() {
$value = ($this->r & 1) << 2;
$value += ($this->g & 1) << 1;
$value += ($this->b & 1) << 0;
return $value;
} | [
"function",
"readBits",
"(",
")",
"{",
"$",
"value",
"=",
"(",
"$",
"this",
"->",
"r",
"&",
"1",
")",
"<<",
"2",
";",
"$",
"value",
"+=",
"(",
"$",
"this",
"->",
"g",
"&",
"1",
")",
"<<",
"1",
";",
"$",
"value",
"+=",
"(",
"$",
"this",
"-... | Read 3-bits-length integer from color
@return integer Integer value between 0 (0b000) and 7 (0b111) | [
"Read",
"3",
"-",
"bits",
"-",
"length",
"integer",
"from",
"color"
] | 5dc1686651da5cbc4968fcf999b9ee998cc43b25 | https://github.com/pyrou/morpheus/blob/5dc1686651da5cbc4968fcf999b9ee998cc43b25/src/Morpheus/Color.php#L45-L51 |
225,871 | chronon/CakePHP-MobileDetectComponent-Plugin | Controller/Component/MobileDetectComponent.php | MobileDetectComponent.detect | public function detect($method = 'isMobile', $args = null) {
if (!class_exists('Mobile_Detect')) {
// load the vendor class if it hasn't allready been autoloaded.
$loaded = App::import('Vendor', 'MobileDetect.MobileDetect', array(
'file' => 'MobileDetect' . DS . 'Mobile_Detect.php')
);
// abort if ven... | php | public function detect($method = 'isMobile', $args = null) {
if (!class_exists('Mobile_Detect')) {
// load the vendor class if it hasn't allready been autoloaded.
$loaded = App::import('Vendor', 'MobileDetect.MobileDetect', array(
'file' => 'MobileDetect' . DS . 'Mobile_Detect.php')
);
// abort if ven... | [
"public",
"function",
"detect",
"(",
"$",
"method",
"=",
"'isMobile'",
",",
"$",
"args",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'Mobile_Detect'",
")",
")",
"{",
"// load the vendor class if it hasn't allready been autoloaded.",
"$",
"loaded",... | Loads the Mobile_Detect class, runs the given Mobile_Detect method. Uses
'isMobile' if no method given.
@param string $method The method to run
@param string $args Optional arguments to the given method
@return mixed
@throws CakeException | [
"Loads",
"the",
"Mobile_Detect",
"class",
"runs",
"the",
"given",
"Mobile_Detect",
"method",
".",
"Uses",
"isMobile",
"if",
"no",
"method",
"given",
"."
] | 01be8fbdac64136dd9bc1aa6cf70e361acc238e8 | https://github.com/chronon/CakePHP-MobileDetectComponent-Plugin/blob/01be8fbdac64136dd9bc1aa6cf70e361acc238e8/Controller/Component/MobileDetectComponent.php#L50-L67 |
225,872 | puli/cli | src/Handler/TypeCommandHandler.php | TypeCommandHandler.getBindingTypeStates | private function getBindingTypeStates(Args $args)
{
$states = array();
if ($args->isOptionSet('enabled')) {
$states[] = BindingTypeState::ENABLED;
}
if ($args->isOptionSet('duplicate')) {
$states[] = BindingTypeState::DUPLICATE;
}
return $st... | php | private function getBindingTypeStates(Args $args)
{
$states = array();
if ($args->isOptionSet('enabled')) {
$states[] = BindingTypeState::ENABLED;
}
if ($args->isOptionSet('duplicate')) {
$states[] = BindingTypeState::DUPLICATE;
}
return $st... | [
"private",
"function",
"getBindingTypeStates",
"(",
"Args",
"$",
"args",
")",
"{",
"$",
"states",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"args",
"->",
"isOptionSet",
"(",
"'enabled'",
")",
")",
"{",
"$",
"states",
"[",
"]",
"=",
"BindingTypeState... | Returns the binding type states selected in the console arguments.
@param Args $args The console arguments
@return int[] A list of {@link BindingTypeState} constants | [
"Returns",
"the",
"binding",
"type",
"states",
"selected",
"in",
"the",
"console",
"arguments",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/TypeCommandHandler.php#L224-L237 |
225,873 | puli/cli | src/Handler/TypeCommandHandler.php | TypeCommandHandler.printTypeTable | private function printTypeTable(IO $io, array $descriptors, $styleTag = null, $indentation = 0)
{
$table = new Table(PuliTableStyle::borderless());
$table->setHeaderRow(array('Type', 'Description', 'Parameters'));
$paramTag = $styleTag ?: 'c1';
$typeTag = $styleTag ?: 'u';
... | php | private function printTypeTable(IO $io, array $descriptors, $styleTag = null, $indentation = 0)
{
$table = new Table(PuliTableStyle::borderless());
$table->setHeaderRow(array('Type', 'Description', 'Parameters'));
$paramTag = $styleTag ?: 'c1';
$typeTag = $styleTag ?: 'u';
... | [
"private",
"function",
"printTypeTable",
"(",
"IO",
"$",
"io",
",",
"array",
"$",
"descriptors",
",",
"$",
"styleTag",
"=",
"null",
",",
"$",
"indentation",
"=",
"0",
")",
"{",
"$",
"table",
"=",
"new",
"Table",
"(",
"PuliTableStyle",
"::",
"borderless",... | Prints the binding types in a table.
@param IO $io The I/O
@param BindingTypeDescriptor[] $descriptors The type descriptors to print
@param string $styleTag The tag used to style the output
@param int $indentation The number of spaces to indent | [
"Prints",
"the",
"binding",
"types",
"in",
"a",
"table",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/TypeCommandHandler.php#L247-L284 |
225,874 | puli/cli | src/Handler/TypeCommandHandler.php | TypeCommandHandler.printBindingTypeState | private function printBindingTypeState(IO $io, $typeState)
{
switch ($typeState) {
case BindingTypeState::ENABLED:
$io->writeLine('The following binding types are currently enabled:');
$io->writeLine('');
return;
case BindingTypeState:... | php | private function printBindingTypeState(IO $io, $typeState)
{
switch ($typeState) {
case BindingTypeState::ENABLED:
$io->writeLine('The following binding types are currently enabled:');
$io->writeLine('');
return;
case BindingTypeState:... | [
"private",
"function",
"printBindingTypeState",
"(",
"IO",
"$",
"io",
",",
"$",
"typeState",
")",
"{",
"switch",
"(",
"$",
"typeState",
")",
"{",
"case",
"BindingTypeState",
"::",
"ENABLED",
":",
"$",
"io",
"->",
"writeLine",
"(",
"'The following binding types... | Prints the heading for a binding type state.
@param IO $io The I/O
@param int $typeState The {@link BindingTypeState} constant | [
"Prints",
"the",
"heading",
"for",
"a",
"binding",
"type",
"state",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/TypeCommandHandler.php#L292-L306 |
225,875 | puli/cli | src/Handler/SelfUpdateCommandHandler.php | SelfUpdateCommandHandler.handle | public function handle(Args $args, IO $io)
{
$updateStrategy = new PuliStrategy();
$updateStrategy->setStability($this->getStability($args));
// false: disable signed releases, otherwise the updater will look for
// a *.pubkey file for the PHAR
$updater = new Updater(null, f... | php | public function handle(Args $args, IO $io)
{
$updateStrategy = new PuliStrategy();
$updateStrategy->setStability($this->getStability($args));
// false: disable signed releases, otherwise the updater will look for
// a *.pubkey file for the PHAR
$updater = new Updater(null, f... | [
"public",
"function",
"handle",
"(",
"Args",
"$",
"args",
",",
"IO",
"$",
"io",
")",
"{",
"$",
"updateStrategy",
"=",
"new",
"PuliStrategy",
"(",
")",
";",
"$",
"updateStrategy",
"->",
"setStability",
"(",
"$",
"this",
"->",
"getStability",
"(",
"$",
"... | Handles the "self-update" command.
@param Args $args The console arguments.
@param IO $io The I/O.
@return int The status code. | [
"Handles",
"the",
"self",
"-",
"update",
"command",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/SelfUpdateCommandHandler.php#L37-L63 |
225,876 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-locator-date.php | Carbon_Breadcrumb_Locator_Date.get_archive_item_details | public function get_archive_item_details() {
return array(
'year' => array(
'condition' => is_year() || is_month() || is_day(),
'title_format' => 'Y',
'link' => get_year_link( get_query_var( 'year' ) ),
),
'month' => array(
'condition' => is_month() || is_day(),
'title_form... | php | public function get_archive_item_details() {
return array(
'year' => array(
'condition' => is_year() || is_month() || is_day(),
'title_format' => 'Y',
'link' => get_year_link( get_query_var( 'year' ) ),
),
'month' => array(
'condition' => is_month() || is_day(),
'title_form... | [
"public",
"function",
"get_archive_item_details",
"(",
")",
"{",
"return",
"array",
"(",
"'year'",
"=>",
"array",
"(",
"'condition'",
"=>",
"is_year",
"(",
")",
"||",
"is_month",
"(",
")",
"||",
"is_day",
"(",
")",
",",
"'title_format'",
"=>",
"'Y'",
",",
... | Prepare the date archive conditions, with the corresponding title format and link.
@access public
@return array $details Date archive details. | [
"Prepare",
"the",
"date",
"archive",
"conditions",
"with",
"the",
"corresponding",
"title",
"format",
"and",
"link",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-locator-date.php#L62-L80 |
225,877 | oscarotero/inline-svg | src/Collection.php | Collection.transform | protected function transform(DOMDocument $element)
{
foreach ($this->transformers as $transformer) {
$transformer($element);
}
return $element;
} | php | protected function transform(DOMDocument $element)
{
foreach ($this->transformers as $transformer) {
$transformer($element);
}
return $element;
} | [
"protected",
"function",
"transform",
"(",
"DOMDocument",
"$",
"element",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"transformers",
"as",
"$",
"transformer",
")",
"{",
"$",
"transformer",
"(",
"$",
"element",
")",
";",
"}",
"return",
"$",
"element",
"... | Transform an element
@param DOMDocument $element
@return DOMDocument | [
"Transform",
"an",
"element"
] | 9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2 | https://github.com/oscarotero/inline-svg/blob/9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2/src/Collection.php#L70-L77 |
225,878 | oscarotero/inline-svg | src/Collection.php | Collection.load | protected function load($name)
{
foreach ($this->sources as $source) {
if ($source->has($name)) {
return $this->transform($source->get($name));
}
}
throw new NotFoundException(sprintf('The svg "%s" is not found', $name));
} | php | protected function load($name)
{
foreach ($this->sources as $source) {
if ($source->has($name)) {
return $this->transform($source->get($name));
}
}
throw new NotFoundException(sprintf('The svg "%s" is not found', $name));
} | [
"protected",
"function",
"load",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"sources",
"as",
"$",
"source",
")",
"{",
"if",
"(",
"$",
"source",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"transf... | Load a svg from the sources.
@param string $name The svg name
@throws NotFoundException
@return DOMDocument | [
"Load",
"a",
"svg",
"from",
"the",
"sources",
"."
] | 9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2 | https://github.com/oscarotero/inline-svg/blob/9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2/src/Collection.php#L88-L97 |
225,879 | oscarotero/inline-svg | src/Collection.php | Collection.get | public function get($name)
{
if (!isset($this->svg[$name])) {
$this->svg[$name] = new Svg($this->load($name));
}
if ($this->svg[$name] !== false) {
return $this->svg[$name];
}
} | php | public function get($name)
{
if (!isset($this->svg[$name])) {
$this->svg[$name] = new Svg($this->load($name));
}
if ($this->svg[$name] !== false) {
return $this->svg[$name];
}
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"svg",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"svg",
"[",
"$",
"name",
"]",
"=",
"new",
"Svg",
"(",
"$",
"this",
"->... | Returns a clone of a svg.
@param string $name The svg name
@return Svg|null | [
"Returns",
"a",
"clone",
"of",
"a",
"svg",
"."
] | 9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2 | https://github.com/oscarotero/inline-svg/blob/9c2c38166d03bb79a0ae6e1e221ff67efb46e6d2/src/Collection.php#L106-L115 |
225,880 | xmeltrut/WordSearch | src/WordList.php | WordList.add | public function add($word, $row, $column)
{
$this->words[] = new Word($word, $row, $column);
} | php | public function add($word, $row, $column)
{
$this->words[] = new Word($word, $row, $column);
} | [
"public",
"function",
"add",
"(",
"$",
"word",
",",
"$",
"row",
",",
"$",
"column",
")",
"{",
"$",
"this",
"->",
"words",
"[",
"]",
"=",
"new",
"Word",
"(",
"$",
"word",
",",
"$",
"row",
",",
"$",
"column",
")",
";",
"}"
] | Add a word.
@param string $word Word.
@param integer $row Row.
@param integer $column Column.
@return void | [
"Add",
"a",
"word",
"."
] | a6dd7c96b78045a3d172e3c5b97e9909b32a9fba | https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/WordList.php#L28-L31 |
225,881 | ccottet/ldap | Platform/Native/Entry.php | Entry.getAttributes | public function getAttributes()
{
$data = @ldap_get_attributes($this->connection, $this->entry);
$result = array();
for ($i = 0; $i < $data['count']; $i++) {
$key = $data[$i];
$result[$key] = array();
for ($j = 0; $j < $data[$key]['count']; $j++) {
... | php | public function getAttributes()
{
$data = @ldap_get_attributes($this->connection, $this->entry);
$result = array();
for ($i = 0; $i < $data['count']; $i++) {
$key = $data[$i];
$result[$key] = array();
for ($j = 0; $j < $data[$key]['count']; $j++) {
... | [
"public",
"function",
"getAttributes",
"(",
")",
"{",
"$",
"data",
"=",
"@",
"ldap_get_attributes",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"this",
"->",
"entry",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"i",
"... | Retrieves entry attributes
@return array(attribute => array(values)) | [
"Retrieves",
"entry",
"attributes"
] | 0759f17996fbb434ee5155dc527b95d8059c6d41 | https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Entry.php#L57-L72 |
225,882 | ccottet/ldap | Platform/Native/Driver.php | Driver.connect | public function connect(
$hostname,
$port = 389,
$withSSL = false,
$withTLS = false
) {
if ($withSSL && $withTLS) {
throw new ConnectionException('Cannot support both TLS & SSL for a given Ldap Connection');
}
if (! extension_loaded('ldap') && ! @... | php | public function connect(
$hostname,
$port = 389,
$withSSL = false,
$withTLS = false
) {
if ($withSSL && $withTLS) {
throw new ConnectionException('Cannot support both TLS & SSL for a given Ldap Connection');
}
if (! extension_loaded('ldap') && ! @... | [
"public",
"function",
"connect",
"(",
"$",
"hostname",
",",
"$",
"port",
"=",
"389",
",",
"$",
"withSSL",
"=",
"false",
",",
"$",
"withTLS",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"withSSL",
"&&",
"$",
"withTLS",
")",
"{",
"throw",
"new",
"Connect... | Connects to a Ldap directory without binding
@param string $hostname Hostname to connect to
@param int $port Port to connect to (Default: 389)
@param boolean $withSSL Whether to connect with SSL support (Default: false)
@param boolean $withTLS Whether to connect with TLS support (Default: false)
@return Co... | [
"Connects",
"to",
"a",
"Ldap",
"directory",
"without",
"binding"
] | 0759f17996fbb434ee5155dc527b95d8059c6d41 | https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Driver.php#L36-L71 |
225,883 | puli/cli | src/Handler/ModuleCommandHandler.php | ModuleCommandHandler.getSelectedStates | private function getSelectedStates(Args $args)
{
$states = array();
if ($args->isOptionSet('enabled')) {
$states[] = ModuleState::ENABLED;
}
if ($args->isOptionSet('not-found')) {
$states[] = ModuleState::NOT_FOUND;
}
if ($args->isOptionSet(... | php | private function getSelectedStates(Args $args)
{
$states = array();
if ($args->isOptionSet('enabled')) {
$states[] = ModuleState::ENABLED;
}
if ($args->isOptionSet('not-found')) {
$states[] = ModuleState::NOT_FOUND;
}
if ($args->isOptionSet(... | [
"private",
"function",
"getSelectedStates",
"(",
"Args",
"$",
"args",
")",
"{",
"$",
"states",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"args",
"->",
"isOptionSet",
"(",
"'enabled'",
")",
")",
"{",
"$",
"states",
"[",
"]",
"=",
"ModuleState",
"::... | Returns the module states that should be displayed for the given
console arguments.
@param Args $args The console arguments
@return int[] A list of {@link ModuleState} constants | [
"Returns",
"the",
"module",
"states",
"that",
"should",
"be",
"displayed",
"for",
"the",
"given",
"console",
"arguments",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ModuleCommandHandler.php#L169-L186 |
225,884 | puli/cli | src/Handler/ModuleCommandHandler.php | ModuleCommandHandler.getSelectedModules | private function getSelectedModules(Args $args)
{
$states = $this->getSelectedStates($args);
$expr = Expr::true();
$envs = array();
if ($states !== ModuleState::all()) {
$expr = $expr->andMethod('getState', Expr::in($states));
}
if ($args->isOptionSet('i... | php | private function getSelectedModules(Args $args)
{
$states = $this->getSelectedStates($args);
$expr = Expr::true();
$envs = array();
if ($states !== ModuleState::all()) {
$expr = $expr->andMethod('getState', Expr::in($states));
}
if ($args->isOptionSet('i... | [
"private",
"function",
"getSelectedModules",
"(",
"Args",
"$",
"args",
")",
"{",
"$",
"states",
"=",
"$",
"this",
"->",
"getSelectedStates",
"(",
"$",
"args",
")",
";",
"$",
"expr",
"=",
"Expr",
"::",
"true",
"(",
")",
";",
"$",
"envs",
"=",
"array",... | Returns the modules that should be displayed for the given console
arguments.
@param Args $args The console arguments
@return ModuleList The modules | [
"Returns",
"the",
"modules",
"that",
"should",
"be",
"displayed",
"for",
"the",
"given",
"console",
"arguments",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ModuleCommandHandler.php#L196-L223 |
225,885 | puli/cli | src/Handler/ModuleCommandHandler.php | ModuleCommandHandler.printModulesByState | private function printModulesByState(IO $io, ModuleList $modules, array $states)
{
$printStates = count($states) > 1;
foreach ($states as $state) {
$filteredModules = array_filter($modules->toArray(), function (Module $module) use ($state) {
return $state === $module->ge... | php | private function printModulesByState(IO $io, ModuleList $modules, array $states)
{
$printStates = count($states) > 1;
foreach ($states as $state) {
$filteredModules = array_filter($modules->toArray(), function (Module $module) use ($state) {
return $state === $module->ge... | [
"private",
"function",
"printModulesByState",
"(",
"IO",
"$",
"io",
",",
"ModuleList",
"$",
"modules",
",",
"array",
"$",
"states",
")",
"{",
"$",
"printStates",
"=",
"count",
"(",
"$",
"states",
")",
">",
"1",
";",
"foreach",
"(",
"$",
"states",
"as",... | Prints modules with intermediate headers for the module states.
@param IO $io The I/O
@param ModuleList $modules The modules to print
@param int[] $states The states to print | [
"Prints",
"modules",
"with",
"intermediate",
"headers",
"for",
"the",
"module",
"states",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ModuleCommandHandler.php#L232-L260 |
225,886 | puli/cli | src/Handler/ModuleCommandHandler.php | ModuleCommandHandler.printModulesWithFormat | private function printModulesWithFormat(IO $io, ModuleList $modules, $format)
{
/** @var Module $module */
foreach ($modules as $module) {
$installInfo = $module->getInstallInfo();
$io->writeLine(strtr($format, array(
'%name%' => $module->getName(),
... | php | private function printModulesWithFormat(IO $io, ModuleList $modules, $format)
{
/** @var Module $module */
foreach ($modules as $module) {
$installInfo = $module->getInstallInfo();
$io->writeLine(strtr($format, array(
'%name%' => $module->getName(),
... | [
"private",
"function",
"printModulesWithFormat",
"(",
"IO",
"$",
"io",
",",
"ModuleList",
"$",
"modules",
",",
"$",
"format",
")",
"{",
"/** @var Module $module */",
"foreach",
"(",
"$",
"modules",
"as",
"$",
"module",
")",
"{",
"$",
"installInfo",
"=",
"$",... | Prints modules using the given format.
@param IO $io The I/O
@param ModuleList $modules The modules to print
@param string $format The format string | [
"Prints",
"modules",
"using",
"the",
"given",
"format",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ModuleCommandHandler.php#L269-L283 |
225,887 | puli/cli | src/Handler/ModuleCommandHandler.php | ModuleCommandHandler.printModuleState | private function printModuleState(IO $io, $ModuleState)
{
switch ($ModuleState) {
case ModuleState::ENABLED:
$io->writeLine('The following modules are currently enabled:');
$io->writeLine('');
return;
case ModuleState::NOT_FOUND:
... | php | private function printModuleState(IO $io, $ModuleState)
{
switch ($ModuleState) {
case ModuleState::ENABLED:
$io->writeLine('The following modules are currently enabled:');
$io->writeLine('');
return;
case ModuleState::NOT_FOUND:
... | [
"private",
"function",
"printModuleState",
"(",
"IO",
"$",
"io",
",",
"$",
"ModuleState",
")",
"{",
"switch",
"(",
"$",
"ModuleState",
")",
"{",
"case",
"ModuleState",
"::",
"ENABLED",
":",
"$",
"io",
"->",
"writeLine",
"(",
"'The following modules are current... | Prints the heading for a given module state.
@param IO $io The I/O
@param int $ModuleState The {@link ModuleState} constant | [
"Prints",
"the",
"heading",
"for",
"a",
"given",
"module",
"state",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ModuleCommandHandler.php#L291-L311 |
225,888 | puli/cli | src/Handler/ModuleCommandHandler.php | ModuleCommandHandler.printModuleTable | private function printModuleTable(IO $io, array $modules, $styleTag = null, $indent = false)
{
$table = new Table(PuliTableStyle::borderless());
$table->setHeaderRow(array('Module Name', 'Installer', 'Env', 'Install Path'));
$installerTag = $styleTag ?: 'c1';
$envTag = $styleTag ?: ... | php | private function printModuleTable(IO $io, array $modules, $styleTag = null, $indent = false)
{
$table = new Table(PuliTableStyle::borderless());
$table->setHeaderRow(array('Module Name', 'Installer', 'Env', 'Install Path'));
$installerTag = $styleTag ?: 'c1';
$envTag = $styleTag ?: ... | [
"private",
"function",
"printModuleTable",
"(",
"IO",
"$",
"io",
",",
"array",
"$",
"modules",
",",
"$",
"styleTag",
"=",
"null",
",",
"$",
"indent",
"=",
"false",
")",
"{",
"$",
"table",
"=",
"new",
"Table",
"(",
"PuliTableStyle",
"::",
"borderless",
... | Prints a list of modules in a table.
@param IO $io The I/O
@param Module[] $modules The modules
@param string|null $styleTag The tag used to style the output. If `null`,
the default colors are used
@param bool $indent Whether to indent the output | [
"Prints",
"a",
"list",
"of",
"modules",
"in",
"a",
"table",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ModuleCommandHandler.php#L322-L349 |
225,889 | puli/cli | src/Handler/ModuleCommandHandler.php | ModuleCommandHandler.printNotLoadableModules | private function printNotLoadableModules(IO $io, array $modules, $indent = false)
{
$rootDir = $this->moduleManager->getContext()->getRootDirectory();
$table = new Table(PuliTableStyle::borderless());
$table->setHeaderRow(array('Module Name', 'Error'));
ksort($modules);
for... | php | private function printNotLoadableModules(IO $io, array $modules, $indent = false)
{
$rootDir = $this->moduleManager->getContext()->getRootDirectory();
$table = new Table(PuliTableStyle::borderless());
$table->setHeaderRow(array('Module Name', 'Error'));
ksort($modules);
for... | [
"private",
"function",
"printNotLoadableModules",
"(",
"IO",
"$",
"io",
",",
"array",
"$",
"modules",
",",
"$",
"indent",
"=",
"false",
")",
"{",
"$",
"rootDir",
"=",
"$",
"this",
"->",
"moduleManager",
"->",
"getContext",
"(",
")",
"->",
"getRootDirectory... | Prints not-loadable modules in a table.
@param IO $io The I/O
@param Module[] $modules The not-loadable modules
@param bool $indent Whether to indent the output | [
"Prints",
"not",
"-",
"loadable",
"modules",
"in",
"a",
"table",
"."
] | bbd704e8755650f7ab7bb07a7d5ef15fb0d70794 | https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/ModuleCommandHandler.php#L358-L391 |
225,890 | tyxla/carbon-breadcrumbs | admin/class-carbon-breadcrumb-admin.php | Carbon_Breadcrumb_Admin.apply_settings | public function apply_settings( $settings = array() ) {
$settings_fields = Carbon_Breadcrumb_Admin_Settings::get_field_data();
foreach ( $settings_fields as $field_id => $field ) {
$settings[ $field_id ] = get_option( 'carbon_breadcrumbs_' . $field_id );
if ( 'checkbox' == $field['type'] ) {
$settings[ $... | php | public function apply_settings( $settings = array() ) {
$settings_fields = Carbon_Breadcrumb_Admin_Settings::get_field_data();
foreach ( $settings_fields as $field_id => $field ) {
$settings[ $field_id ] = get_option( 'carbon_breadcrumbs_' . $field_id );
if ( 'checkbox' == $field['type'] ) {
$settings[ $... | [
"public",
"function",
"apply_settings",
"(",
"$",
"settings",
"=",
"array",
"(",
")",
")",
"{",
"$",
"settings_fields",
"=",
"Carbon_Breadcrumb_Admin_Settings",
"::",
"get_field_data",
"(",
")",
";",
"foreach",
"(",
"$",
"settings_fields",
"as",
"$",
"field_id",... | Apply the settings to the breadcrumb trail renderer
@access public
@param array $settings The default settings.
@return array $settings The modified settings. | [
"Apply",
"the",
"settings",
"to",
"the",
"breadcrumb",
"trail",
"renderer"
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin.php#L94-L105 |
225,891 | tyxla/carbon-breadcrumbs | admin/class-carbon-breadcrumb-admin.php | Carbon_Breadcrumb_Admin.is_enabled | public function is_enabled() {
$enabled = false;
// Enabled if this plugin is installed as a regular WordPress plugin.
$plugin_path = untrailingslashit( ABSPATH ) . DIRECTORY_SEPARATOR . 'wp-content' . DIRECTORY_SEPARATOR . 'plugins';
$current_dir = $this->current_dir();
if ( false !== strpos( $current_dir, ... | php | public function is_enabled() {
$enabled = false;
// Enabled if this plugin is installed as a regular WordPress plugin.
$plugin_path = untrailingslashit( ABSPATH ) . DIRECTORY_SEPARATOR . 'wp-content' . DIRECTORY_SEPARATOR . 'plugins';
$current_dir = $this->current_dir();
if ( false !== strpos( $current_dir, ... | [
"public",
"function",
"is_enabled",
"(",
")",
"{",
"$",
"enabled",
"=",
"false",
";",
"// Enabled if this plugin is installed as a regular WordPress plugin.",
"$",
"plugin_path",
"=",
"untrailingslashit",
"(",
"ABSPATH",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'wp-content'... | Whether the administration interface should be enabled.
@access public
@return bool $is_enabled True if the admin interface is enabled. | [
"Whether",
"the",
"administration",
"interface",
"should",
"be",
"enabled",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin.php#L114-L131 |
225,892 | nztim/queue | src/Lock.php | Lock.set | public function set(int $timeoutMinutes) : bool
{
if ($this->isLocked()) {
return false;
}
$this->setLock($timeoutMinutes);
return true;
} | php | public function set(int $timeoutMinutes) : bool
{
if ($this->isLocked()) {
return false;
}
$this->setLock($timeoutMinutes);
return true;
} | [
"public",
"function",
"set",
"(",
"int",
"$",
"timeoutMinutes",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"isLocked",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"setLock",
"(",
"$",
"timeoutMinutes",
")",
";",
"r... | Returns true if exclusive lock obtained
@param int $timeoutMinutes
@return bool | [
"Returns",
"true",
"if",
"exclusive",
"lock",
"obtained"
] | 88ca18eed292f6c121b81aa668e1e659c73c6495 | https://github.com/nztim/queue/blob/88ca18eed292f6c121b81aa668e1e659c73c6495/src/Lock.php#L22-L29 |
225,893 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-setup.php | Carbon_Breadcrumb_Trail_Setup.populate_date_archive_items | public function populate_date_archive_items() {
if ( ! is_date() ) {
return;
}
$locator = Carbon_Breadcrumb_Locator::factory( 'date' );
$items = $locator->get_items( 700 );
$this->get_trail()->add_item( $items );
} | php | public function populate_date_archive_items() {
if ( ! is_date() ) {
return;
}
$locator = Carbon_Breadcrumb_Locator::factory( 'date' );
$items = $locator->get_items( 700 );
$this->get_trail()->add_item( $items );
} | [
"public",
"function",
"populate_date_archive_items",
"(",
")",
"{",
"if",
"(",
"!",
"is_date",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"locator",
"=",
"Carbon_Breadcrumb_Locator",
"::",
"factory",
"(",
"'date'",
")",
";",
"$",
"items",
"=",
"$",
"lo... | Populate date archives.
@access public | [
"Populate",
"date",
"archives",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-setup.php#L68-L76 |
225,894 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-setup.php | Carbon_Breadcrumb_Trail_Setup.populate_post_type_archive_items | public function populate_post_type_archive_items() {
if ( is_post_type_archive() ) {
$post_type = get_post_type_object( get_query_var( 'post_type' ) );
} elseif ( is_singular() ) {
$post_type = get_post_type_object( get_post_type() );
if ( ! $post_type->has_archive ) {
return;
}
} else {
return... | php | public function populate_post_type_archive_items() {
if ( is_post_type_archive() ) {
$post_type = get_post_type_object( get_query_var( 'post_type' ) );
} elseif ( is_singular() ) {
$post_type = get_post_type_object( get_post_type() );
if ( ! $post_type->has_archive ) {
return;
}
} else {
return... | [
"public",
"function",
"populate_post_type_archive_items",
"(",
")",
"{",
"if",
"(",
"is_post_type_archive",
"(",
")",
")",
"{",
"$",
"post_type",
"=",
"get_post_type_object",
"(",
"get_query_var",
"(",
"'post_type'",
")",
")",
";",
"}",
"elseif",
"(",
"is_singul... | Populate post type archives.
@access public | [
"Populate",
"post",
"type",
"archives",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-setup.php#L83-L98 |
225,895 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-setup.php | Carbon_Breadcrumb_Trail_Setup.populate_search_items | public function populate_search_items() {
if ( ! is_search() ) {
return;
}
// Translators: %1$s - search query.
$search_title = sprintf( __( 'Search results for: "%1$s"', 'carbon_breadcrumbs' ), get_search_query() );
$this->get_trail()->add_custom_item( $search_title, '', 700 );
} | php | public function populate_search_items() {
if ( ! is_search() ) {
return;
}
// Translators: %1$s - search query.
$search_title = sprintf( __( 'Search results for: "%1$s"', 'carbon_breadcrumbs' ), get_search_query() );
$this->get_trail()->add_custom_item( $search_title, '', 700 );
} | [
"public",
"function",
"populate_search_items",
"(",
")",
"{",
"if",
"(",
"!",
"is_search",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Translators: %1$s - search query.",
"$",
"search_title",
"=",
"sprintf",
"(",
"__",
"(",
"'Search results for: \"%1$s\"'",
",",
... | Populate search items.
@access public | [
"Populate",
"search",
"items",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-setup.php#L106-L114 |
225,896 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-setup.php | Carbon_Breadcrumb_Trail_Setup.populate_category_items | public function populate_category_items() {
if ( ! ( is_single() && 'post' == get_post_type() ) ) {
return;
}
$taxonomy = 'category';
$categories = wp_get_object_terms( get_the_ID(), $taxonomy, array( 'orderby' => 'term_id' ) );
$last_category = array_pop( $categories );
$locator = Carbon_... | php | public function populate_category_items() {
if ( ! ( is_single() && 'post' == get_post_type() ) ) {
return;
}
$taxonomy = 'category';
$categories = wp_get_object_terms( get_the_ID(), $taxonomy, array( 'orderby' => 'term_id' ) );
$last_category = array_pop( $categories );
$locator = Carbon_... | [
"public",
"function",
"populate_category_items",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"is_single",
"(",
")",
"&&",
"'post'",
"==",
"get_post_type",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"$",
"taxonomy",
"=",
"'category'",
";",
"$",
"categories",
... | Populate category hierarchy when on a single post.
@access public | [
"Populate",
"category",
"hierarchy",
"when",
"on",
"a",
"single",
"post",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-setup.php#L135-L146 |
225,897 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-setup.php | Carbon_Breadcrumb_Trail_Setup.populate_page_for_posts_items | public function populate_page_for_posts_items() {
$page_for_posts = get_option( 'page_for_posts' );
if ( ! $page_for_posts ) {
return;
}
if ( $this->is_post_context() ) {
$locator = Carbon_Breadcrumb_Locator::factory( 'post', 'page' );
$items = $locator->get_items( 500, $page_for_posts );
$this->... | php | public function populate_page_for_posts_items() {
$page_for_posts = get_option( 'page_for_posts' );
if ( ! $page_for_posts ) {
return;
}
if ( $this->is_post_context() ) {
$locator = Carbon_Breadcrumb_Locator::factory( 'post', 'page' );
$items = $locator->get_items( 500, $page_for_posts );
$this->... | [
"public",
"function",
"populate_page_for_posts_items",
"(",
")",
"{",
"$",
"page_for_posts",
"=",
"get_option",
"(",
"'page_for_posts'",
")",
";",
"if",
"(",
"!",
"$",
"page_for_posts",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"is_post_con... | Populate page for posts item where necessary.
@access public | [
"Populate",
"page",
"for",
"posts",
"item",
"where",
"necessary",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-setup.php#L153-L164 |
225,898 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-setup.php | Carbon_Breadcrumb_Trail_Setup.populate_home_items | public function populate_home_items() {
$trail = $this->get_trail();
$renderer = $trail->get_renderer();
if ( ! $renderer->get_display_home_item() ) {
return;
}
$home_title = $renderer->get_home_item_title();
$home_link = home_url( '/' );
$trail->add_custom_item( $home_title, $home_link, 10 );
} | php | public function populate_home_items() {
$trail = $this->get_trail();
$renderer = $trail->get_renderer();
if ( ! $renderer->get_display_home_item() ) {
return;
}
$home_title = $renderer->get_home_item_title();
$home_link = home_url( '/' );
$trail->add_custom_item( $home_title, $home_link, 10 );
} | [
"public",
"function",
"populate_home_items",
"(",
")",
"{",
"$",
"trail",
"=",
"$",
"this",
"->",
"get_trail",
"(",
")",
";",
"$",
"renderer",
"=",
"$",
"trail",
"->",
"get_renderer",
"(",
")",
";",
"if",
"(",
"!",
"$",
"renderer",
"->",
"get_display_h... | Populate home item.
@access public | [
"Populate",
"home",
"item",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-setup.php#L194-L204 |
225,899 | tyxla/carbon-breadcrumbs | core/class-carbon-breadcrumb-trail-setup.php | Carbon_Breadcrumb_Trail_Setup.generate_locator_items | protected function generate_locator_items( $locator_name ) {
$locator = Carbon_Breadcrumb_Locator::factory( $locator_name );
$items = $locator->generate_items();
if ( $items ) {
return $items;
}
return array();
} | php | protected function generate_locator_items( $locator_name ) {
$locator = Carbon_Breadcrumb_Locator::factory( $locator_name );
$items = $locator->generate_items();
if ( $items ) {
return $items;
}
return array();
} | [
"protected",
"function",
"generate_locator_items",
"(",
"$",
"locator_name",
")",
"{",
"$",
"locator",
"=",
"Carbon_Breadcrumb_Locator",
"::",
"factory",
"(",
"$",
"locator_name",
")",
";",
"$",
"items",
"=",
"$",
"locator",
"->",
"generate_items",
"(",
")",
"... | Generate the items of a certain locator.
@access protected
@param string $locator_name Name of the locator.
@return array $items Items generated by this locator. | [
"Generate",
"the",
"items",
"of",
"a",
"certain",
"locator",
"."
] | 0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185 | https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-trail-setup.php#L214-L223 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.