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,600 | Eve-PHP/Framework | src/Error.php | Error.htmlDetails | public function htmlDetails(
$type,
$level,
$class,
$file,
$line,
$message,
$trace,
$offset)
{
$history = array();
for(; isset($trace[$offset]); $offset++) {
$row = $trace[$offset];
//lets formulate the method
... | php | public function htmlDetails(
$type,
$level,
$class,
$file,
$line,
$message,
$trace,
$offset)
{
$history = array();
for(; isset($trace[$offset]); $offset++) {
$row = $trace[$offset];
//lets formulate the method
... | [
"public",
"function",
"htmlDetails",
"(",
"$",
"type",
",",
"$",
"level",
",",
"$",
"class",
",",
"$",
"file",
",",
"$",
"line",
",",
"$",
"message",
",",
"$",
"trace",
",",
"$",
"offset",
")",
"{",
"$",
"history",
"=",
"array",
"(",
")",
";",
... | Output the error details in HTML
@param *string $type The error type
@param *string $level The error level
@param *string $class The class where the error came from
@param *string $file The file where the error came from
@param *string $line The line where the error came from
@param *string $message The e... | [
"Output",
"the",
"error",
"details",
"in",
"HTML"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Error.php#L36-L72 |
225,601 | Eve-PHP/Framework | src/Error.php | Error.jsonDetails | public function jsonDetails(
$type,
$level,
$class,
$file,
$line,
$message,
$trace,
$offset)
{
$history = array();
for(; isset($trace[$offset]); $offset++) {
$row = $trace[$offset];
//lets formulate the method
... | php | public function jsonDetails(
$type,
$level,
$class,
$file,
$line,
$message,
$trace,
$offset)
{
$history = array();
for(; isset($trace[$offset]); $offset++) {
$row = $trace[$offset];
//lets formulate the method
... | [
"public",
"function",
"jsonDetails",
"(",
"$",
"type",
",",
"$",
"level",
",",
"$",
"class",
",",
"$",
"file",
",",
"$",
"line",
",",
"$",
"message",
",",
"$",
"trace",
",",
"$",
"offset",
")",
"{",
"$",
"history",
"=",
"array",
"(",
")",
";",
... | Output the error details in JSON
@param *string $type The error type
@param *string $level The error level
@param *string $class The class where the error came from
@param *string $file The file where the error came from
@param *string $line The line where the error came from
@param *string $message The e... | [
"Output",
"the",
"error",
"details",
"in",
"JSON"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Error.php#L115-L152 |
225,602 | Eve-PHP/Framework | src/Error.php | Error.jsonGeneric | public function jsonGeneric(
$type,
$level,
$class,
$file,
$line,
$message,
$trace,
$offset)
{
return json_encode(array(
'error' => true,
'message' => 'A server Error occurred'),
JSON_PRETTY_PRINT);
... | php | public function jsonGeneric(
$type,
$level,
$class,
$file,
$line,
$message,
$trace,
$offset)
{
return json_encode(array(
'error' => true,
'message' => 'A server Error occurred'),
JSON_PRETTY_PRINT);
... | [
"public",
"function",
"jsonGeneric",
"(",
"$",
"type",
",",
"$",
"level",
",",
"$",
"class",
",",
"$",
"file",
",",
"$",
"line",
",",
"$",
"message",
",",
"$",
"trace",
",",
"$",
"offset",
")",
"{",
"return",
"json_encode",
"(",
"array",
"(",
"'err... | Output the generic error in JSON
@param *string $type The error type
@param *string $level The error level
@param *string $class The class where the error came from
@param *string $file The file where the error came from
@param *string $line The line where the error came from
@param *string $message The e... | [
"Output",
"the",
"generic",
"error",
"in",
"JSON"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Error.php#L168-L182 |
225,603 | Eve-PHP/Framework | src/Queue.php | Queue.save | public function save($queue = 'queue')
{
// declare queue container
$this->channel->queue_declare(
$queue,
false,
$this->durable,
false,
false,
false,
['x-max-priority' => ['I', 10]]);
// set message
... | php | public function save($queue = 'queue')
{
// declare queue container
$this->channel->queue_declare(
$queue,
false,
$this->durable,
false,
false,
false,
['x-max-priority' => ['I', 10]]);
// set message
... | [
"public",
"function",
"save",
"(",
"$",
"queue",
"=",
"'queue'",
")",
"{",
"// declare queue container",
"$",
"this",
"->",
"channel",
"->",
"queue_declare",
"(",
"$",
"queue",
",",
"false",
",",
"$",
"this",
"->",
"durable",
",",
"false",
",",
"false",
... | Process the add queue request
@return Eve\Framework\Queue | [
"Process",
"the",
"add",
"queue",
"request"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Queue.php#L381-L422 |
225,604 | Innmind/Filesystem | src/File/File.php | File.withContent | public function withContent(Readable $content): self
{
$file = clone $this;
$file->content = $content;
return $file;
} | php | public function withContent(Readable $content): self
{
$file = clone $this;
$file->content = $content;
return $file;
} | [
"public",
"function",
"withContent",
"(",
"Readable",
"$",
"content",
")",
":",
"self",
"{",
"$",
"file",
"=",
"clone",
"$",
"this",
";",
"$",
"file",
"->",
"content",
"=",
"$",
"content",
";",
"return",
"$",
"file",
";",
"}"
] | New file reference with a different content
@return self | [
"New",
"file",
"reference",
"with",
"a",
"different",
"content"
] | 21700d8424bc88e99fd5c612c5316613e4c45a3b | https://github.com/Innmind/Filesystem/blob/21700d8424bc88e99fd5c612c5316613e4c45a3b/src/File/File.php#L56-L62 |
225,605 | ricardopedias/report-collection | src/Libs/OldCollector.php | OldCollector.createFromArray | public static function createFromArray(array $array)
{
self::$instance = new Collector;
self::$instance->buffer = null;
$spreadsheet = new Spreadsheet();
$spreadsheet->getActiveSheet()
->fromArray(
$array, // os dados a adicionar
NULL ... | php | public static function createFromArray(array $array)
{
self::$instance = new Collector;
self::$instance->buffer = null;
$spreadsheet = new Spreadsheet();
$spreadsheet->getActiveSheet()
->fromArray(
$array, // os dados a adicionar
NULL ... | [
"public",
"static",
"function",
"createFromArray",
"(",
"array",
"$",
"array",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"Collector",
";",
"self",
"::",
"$",
"instance",
"->",
"buffer",
"=",
"null",
";",
"$",
"spreadsheet",
"=",
"new",
"Spread... | Cria uma planilha a partir de um array
@param array $array | [
"Cria",
"uma",
"planilha",
"a",
"partir",
"de",
"um",
"array"
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/OldCollector.php#L186-L204 |
225,606 | ricardopedias/report-collection | src/Libs/OldCollector.php | OldCollector.setupBody | private function setupBody()
{
$ended_row = $this->getLastRow();
$ended_col = $this->getLastColumn();
// Aplica os estilos a cada célula independente
for ($row=1; $row<=$ended_row; $row++) {
for ($col=1; $col<=$ended_col; $col++) {
$this->applyStyles('bo... | php | private function setupBody()
{
$ended_row = $this->getLastRow();
$ended_col = $this->getLastColumn();
// Aplica os estilos a cada célula independente
for ($row=1; $row<=$ended_row; $row++) {
for ($col=1; $col<=$ended_col; $col++) {
$this->applyStyles('bo... | [
"private",
"function",
"setupBody",
"(",
")",
"{",
"$",
"ended_row",
"=",
"$",
"this",
"->",
"getLastRow",
"(",
")",
";",
"$",
"ended_col",
"=",
"$",
"this",
"->",
"getLastColumn",
"(",
")",
";",
"// Aplica os estilos a cada célula independente",
"for",
"(",
... | Prepara e configura o corpo da planilha. | [
"Prepara",
"e",
"configura",
"o",
"corpo",
"da",
"planilha",
"."
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/OldCollector.php#L387-L399 |
225,607 | ricardopedias/report-collection | src/Libs/OldCollector.php | OldCollector.toArray | public function toArray()
{
// Planilhas do Gnumeric e Xlsx
// possuem linha e colunas nulas na exportação de array
// por isso, são removidas aqui
$list = [];
$array = $this->getActiveSheet()->toArray();
// Linhas
foreach($array as $row_id => $rows) {
... | php | public function toArray()
{
// Planilhas do Gnumeric e Xlsx
// possuem linha e colunas nulas na exportação de array
// por isso, são removidas aqui
$list = [];
$array = $this->getActiveSheet()->toArray();
// Linhas
foreach($array as $row_id => $rows) {
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"// Planilhas do Gnumeric e Xlsx",
"// possuem linha e colunas nulas na exportação de array",
"// por isso, são removidas aqui",
"$",
"list",
"=",
"[",
"]",
";",
"$",
"array",
"=",
"$",
"this",
"->",
"getActiveSheet",
"(",
... | Devolve os dados da planilha em forma de array.
@return array | [
"Devolve",
"os",
"dados",
"da",
"planilha",
"em",
"forma",
"de",
"array",
"."
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/OldCollector.php#L824-L843 |
225,608 | ricardopedias/report-collection | src/Libs/OldCollector.php | OldCollector.toXml | public function toXml()
{
$data = $this->toArray();
$writer = new \SimpleXMLElement('<Table/>');
$headers = [];
foreach ($data as $index => $item) {
if ($index==0) {
$headers = $item;
}
$child = $writer->addChild('Row');
... | php | public function toXml()
{
$data = $this->toArray();
$writer = new \SimpleXMLElement('<Table/>');
$headers = [];
foreach ($data as $index => $item) {
if ($index==0) {
$headers = $item;
}
$child = $writer->addChild('Row');
... | [
"public",
"function",
"toXml",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"toArray",
"(",
")",
";",
"$",
"writer",
"=",
"new",
"\\",
"SimpleXMLElement",
"(",
"'<Table/>'",
")",
";",
"$",
"headers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
... | Devolve os dados da planilha em forma de xml.
@return string | [
"Devolve",
"os",
"dados",
"da",
"planilha",
"em",
"forma",
"de",
"xml",
"."
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/OldCollector.php#L850-L871 |
225,609 | bytic/Common | src/Records/Traits/Media/Images/RecordTrait.php | RecordTrait.uploadImage | public function uploadImage()
{
$image = $this->getTempImage();
$file = $_FILES['Filedata'];
$uploadError = Nip_File_System::instance()->getUploadError($file, $image->extensions);
if (!$uploadError) {
$image->setResourceFromUpload($file);
if ($image->validate... | php | public function uploadImage()
{
$image = $this->getTempImage();
$file = $_FILES['Filedata'];
$uploadError = Nip_File_System::instance()->getUploadError($file, $image->extensions);
if (!$uploadError) {
$image->setResourceFromUpload($file);
if ($image->validate... | [
"public",
"function",
"uploadImage",
"(",
")",
"{",
"$",
"image",
"=",
"$",
"this",
"->",
"getTempImage",
"(",
")",
";",
"$",
"file",
"=",
"$",
"_FILES",
"[",
"'Filedata'",
"]",
";",
"$",
"uploadError",
"=",
"Nip_File_System",
"::",
"instance",
"(",
")... | Uploads image to temporary directory
@return mixed | [
"Uploads",
"image",
"to",
"temporary",
"directory"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/Media/Images/RecordTrait.php#L32-L69 |
225,610 | bytic/Common | src/Records/Traits/Media/Images/RecordTrait.php | RecordTrait.cropImages | public function cropImages($request)
{
$path = $request['path'];
$coords = $this->getCropCoordinates($request);
$images = $this->getNewImages();
$full = reset($this->_imageTypes);
$cropperImage = $this->getTempImage();
$cropperImage->setResourceFromFile(UPLOADS_PATH... | php | public function cropImages($request)
{
$path = $request['path'];
$coords = $this->getCropCoordinates($request);
$images = $this->getNewImages();
$full = reset($this->_imageTypes);
$cropperImage = $this->getTempImage();
$cropperImage->setResourceFromFile(UPLOADS_PATH... | [
"public",
"function",
"cropImages",
"(",
"$",
"request",
")",
"{",
"$",
"path",
"=",
"$",
"request",
"[",
"'path'",
"]",
";",
"$",
"coords",
"=",
"$",
"this",
"->",
"getCropCoordinates",
"(",
"$",
"request",
")",
";",
"$",
"images",
"=",
"$",
"this",... | Saves cropped images
@param array $request | [
"Saves",
"cropped",
"images"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/Media/Images/RecordTrait.php#L266-L307 |
225,611 | DrNixx/yii2-onix | src/i18n/TranslationTrait.php | TranslationTrait.initI18N | public function initI18N($dir = '', $cat = '')
{
if (empty($cat) && empty($this->_msgCat)) {
return;
}
if (empty($cat)) {
$cat = $this->_msgCat;
}
if (empty($dir)) {
$reflector = new \ReflectionClass(get_class($this));
$dir = ... | php | public function initI18N($dir = '', $cat = '')
{
if (empty($cat) && empty($this->_msgCat)) {
return;
}
if (empty($cat)) {
$cat = $this->_msgCat;
}
if (empty($dir)) {
$reflector = new \ReflectionClass(get_class($this));
$dir = ... | [
"public",
"function",
"initI18N",
"(",
"$",
"dir",
"=",
"''",
",",
"$",
"cat",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"cat",
")",
"&&",
"empty",
"(",
"$",
"this",
"->",
"_msgCat",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"emp... | Yii i18n messages configuration for generating translations
@param string $dir the directory path where translation files will exist
@param string $cat the message category
@return void | [
"Yii",
"i18n",
"messages",
"configuration",
"for",
"generating",
"translations"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/i18n/TranslationTrait.php#L22-L54 |
225,612 | stubbles/stubbles-input | src/main/php/valuereader/DefaultValueReader.php | DefaultValueReader.checkDefaultType | private function checkDefaultType(\Closure $isCorrectType, string $expectedType)
{
if (!$isCorrectType()) {
throw new \LogicException(
'Default value is not of type ' . $expectedType
. ' but of type ' . typeOf($this->default)
);
}
} | php | private function checkDefaultType(\Closure $isCorrectType, string $expectedType)
{
if (!$isCorrectType()) {
throw new \LogicException(
'Default value is not of type ' . $expectedType
. ' but of type ' . typeOf($this->default)
);
}
} | [
"private",
"function",
"checkDefaultType",
"(",
"\\",
"Closure",
"$",
"isCorrectType",
",",
"string",
"$",
"expectedType",
")",
"{",
"if",
"(",
"!",
"$",
"isCorrectType",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Default value is not o... | checks type of default value
@param \Closure $isCorrectType check to be executed when default value is not null
@param string $expectedType expected type of default value
@throws \LogicException | [
"checks",
"type",
"of",
"default",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/valuereader/DefaultValueReader.php#L59-L67 |
225,613 | SetBased/php-abc-url | src/Url.php | Url.combine | public static function combine(string $uri1, string $uri2): string
{
$parts2 = parse_url($uri2);
if (isset($parts2['scheme']) || isset($parts2['host']))
{
// The second URI is an absolute URI. Take all parts from second URI.
$combined_uri_parts = $parts2;
// The scheme might by omitted.... | php | public static function combine(string $uri1, string $uri2): string
{
$parts2 = parse_url($uri2);
if (isset($parts2['scheme']) || isset($parts2['host']))
{
// The second URI is an absolute URI. Take all parts from second URI.
$combined_uri_parts = $parts2;
// The scheme might by omitted.... | [
"public",
"static",
"function",
"combine",
"(",
"string",
"$",
"uri1",
",",
"string",
"$",
"uri2",
")",
":",
"string",
"{",
"$",
"parts2",
"=",
"parse_url",
"(",
"$",
"uri2",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"parts2",
"[",
"'scheme'",
"]",
"... | Combines two URIs to a single URL. In most cases the first URI will the an absolute URL and the second URI a
path and optionally a query.
@param string $uri1 The first URI.
@param string $uri2 The second URI.
@return string
@since 1.0.0
@api | [
"Combines",
"two",
"URIs",
"to",
"a",
"single",
"URL",
".",
"In",
"most",
"cases",
"the",
"first",
"URI",
"will",
"the",
"an",
"absolute",
"URL",
"and",
"the",
"second",
"URI",
"a",
"path",
"and",
"optionally",
"a",
"query",
"."
] | 398227e333cea3d77eb371b73b73b869d6d00ce8 | https://github.com/SetBased/php-abc-url/blob/398227e333cea3d77eb371b73b73b869d6d00ce8/src/Url.php#L24-L103 |
225,614 | SetBased/php-abc-url | src/Url.php | Url.isRelative | public static function isRelative(string $url): bool
{
if ($url!=='')
{
return ((mb_substr($url, 0, 1)=='/' &&
(mb_strlen($url)==1 || (mb_substr($url, 1, 1)!='/' && mb_substr($url, 1, 1)!='\\'))) ||
(mb_strlen($url)>1 && mb_substr($url, 0, 2)=='~/'));
}
return false;
} | php | public static function isRelative(string $url): bool
{
if ($url!=='')
{
return ((mb_substr($url, 0, 1)=='/' &&
(mb_strlen($url)==1 || (mb_substr($url, 1, 1)!='/' && mb_substr($url, 1, 1)!='\\'))) ||
(mb_strlen($url)>1 && mb_substr($url, 0, 2)=='~/'));
}
return false;
} | [
"public",
"static",
"function",
"isRelative",
"(",
"string",
"$",
"url",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"url",
"!==",
"''",
")",
"{",
"return",
"(",
"(",
"mb_substr",
"(",
"$",
"url",
",",
"0",
",",
"1",
")",
"==",
"'/'",
"&&",
"(",
"mb... | Returns true if and only if an URL is a relative URL.
Examples of relative URLs:
* /
* /foo
* ~/
* ~/foo
Counter examples:
* //
* /\
* https://www.setbased.nl/
@param string $url The URL.
@return bool
@since 1.0.0
@api | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"an",
"URL",
"is",
"a",
"relative",
"URL",
"."
] | 398227e333cea3d77eb371b73b73b869d6d00ce8 | https://github.com/SetBased/php-abc-url/blob/398227e333cea3d77eb371b73b73b869d6d00ce8/src/Url.php#L126-L136 |
225,615 | SetBased/php-abc-url | src/Url.php | Url.normalizePath | public static function normalizePath(?string $path): string
{
// With thanks to monkeysuffrage, see https://github.com/monkeysuffrage/phpuri/blob/master/phpuri.php.
if ($path===null || $path==='')
{
return '';
}
$normalized_path = $path;
$normalized_path = preg_replace('`//+`', '/', $n... | php | public static function normalizePath(?string $path): string
{
// With thanks to monkeysuffrage, see https://github.com/monkeysuffrage/phpuri/blob/master/phpuri.php.
if ($path===null || $path==='')
{
return '';
}
$normalized_path = $path;
$normalized_path = preg_replace('`//+`', '/', $n... | [
"public",
"static",
"function",
"normalizePath",
"(",
"?",
"string",
"$",
"path",
")",
":",
"string",
"{",
"// With thanks to monkeysuffrage, see https://github.com/monkeysuffrage/phpuri/blob/master/phpuri.php.",
"if",
"(",
"$",
"path",
"===",
"null",
"||",
"$",
"path",
... | Normalize path to format with slashes only.
@param string|null $path The path.
@return string
@since 1.0.0
@api | [
"Normalize",
"path",
"to",
"format",
"with",
"slashes",
"only",
"."
] | 398227e333cea3d77eb371b73b73b869d6d00ce8 | https://github.com/SetBased/php-abc-url/blob/398227e333cea3d77eb371b73b73b869d6d00ce8/src/Url.php#L149-L166 |
225,616 | n2n/n2n-log4php | src/app/n2n/log4php/renderer/RendererMap.php | RendererMap.addRenderer | public function addRenderer($renderedClass, $renderingClass) {
// Check the rendering class exists
if (!class_exists($renderingClass)) {
throw new \n2n\log4php\LoggerException("log4php: Failed adding renderer. Rendering class [$renderingClass] not found.");
return;
}
// Create the instance
$r... | php | public function addRenderer($renderedClass, $renderingClass) {
// Check the rendering class exists
if (!class_exists($renderingClass)) {
throw new \n2n\log4php\LoggerException("log4php: Failed adding renderer. Rendering class [$renderingClass] not found.");
return;
}
// Create the instance
$r... | [
"public",
"function",
"addRenderer",
"(",
"$",
"renderedClass",
",",
"$",
"renderingClass",
")",
"{",
"// Check the rendering class exists\r",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"renderingClass",
")",
")",
"{",
"throw",
"new",
"\\",
"n2n",
"\\",
"log4php"... | Adds a renderer to the map.
If a renderer already exists for the given <var>$renderedClass</var> it
will be overwritten without warning.
@param string $renderedClass The name of the class which will be
rendered by the renderer.
@param string $renderingClass The name of the class which will
perform the rendering. | [
"Adds",
"a",
"renderer",
"to",
"the",
"map",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/renderer/RendererMap.php#L62-L82 |
225,617 | n2n/n2n-log4php | src/app/n2n/log4php/renderer/RendererMap.php | RendererMap.setDefaultRenderer | public function setDefaultRenderer($renderingClass) {
// Check the class exists
if (!class_exists($renderingClass)) {
throw new \n2n\log4php\LoggerException("log4php: Failed setting default renderer. Rendering class [$renderingClass] not found.");
return;
}
// Create the instance
$renderer = ... | php | public function setDefaultRenderer($renderingClass) {
// Check the class exists
if (!class_exists($renderingClass)) {
throw new \n2n\log4php\LoggerException("log4php: Failed setting default renderer. Rendering class [$renderingClass] not found.");
return;
}
// Create the instance
$renderer = ... | [
"public",
"function",
"setDefaultRenderer",
"(",
"$",
"renderingClass",
")",
"{",
"// Check the class exists\r",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"renderingClass",
")",
")",
"{",
"throw",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerException",
"("... | Sets a custom default renderer class.
TODO: there's code duplication here. This method is almost identical to
addRenderer(). However, it has custom error messages so let it sit for
now.
@param string $renderingClass The name of the class which will
perform the rendering. | [
"Sets",
"a",
"custom",
"default",
"renderer",
"class",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/renderer/RendererMap.php#L94-L111 |
225,618 | n2n/n2n-log4php | src/app/n2n/log4php/renderer/RendererMap.php | RendererMap.reset | public function reset() {
$this->defaultRenderer = new \n2n\log4php\renderer\RendererDefault();
$this->clear();
$this->addRenderer('Exception', '\n2n\log4php\renderer\RendererException');
} | php | public function reset() {
$this->defaultRenderer = new \n2n\log4php\renderer\RendererDefault();
$this->clear();
$this->addRenderer('Exception', '\n2n\log4php\renderer\RendererException');
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"defaultRenderer",
"=",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"renderer",
"\\",
"RendererDefault",
"(",
")",
";",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"add... | Resets the renderer map to it's default configuration. | [
"Resets",
"the",
"renderer",
"map",
"to",
"it",
"s",
"default",
"configuration",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/renderer/RendererMap.php#L182-L186 |
225,619 | SetBased/php-abc-form | src/Control/FieldSet.php | FieldSet.createLegend | public function createLegend($type = 'legend')
{
switch ($type)
{
case 'legend':
$tmp = new Legend();
break;
default:
$tmp = new $type();
}
$this->legend = $tmp;
return $tmp;
} | php | public function createLegend($type = 'legend')
{
switch ($type)
{
case 'legend':
$tmp = new Legend();
break;
default:
$tmp = new $type();
}
$this->legend = $tmp;
return $tmp;
} | [
"public",
"function",
"createLegend",
"(",
"$",
"type",
"=",
"'legend'",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'legend'",
":",
"$",
"tmp",
"=",
"new",
"Legend",
"(",
")",
";",
"break",
";",
"default",
":",
"$",
"tmp",
"=",
"new",... | Creates a legend for this fieldset.
@param string $type The class name of the legend.
@return Legend | [
"Creates",
"a",
"legend",
"for",
"this",
"fieldset",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/FieldSet.php#L30-L45 |
225,620 | SetBased/php-abc-form | src/Control/FieldSet.php | FieldSet.getHtmlLegend | protected function getHtmlLegend(): string
{
if ($this->legend)
{
$ret = $this->legend->getHtml();
}
else
{
$ret = '';
}
return $ret;
} | php | protected function getHtmlLegend(): string
{
if ($this->legend)
{
$ret = $this->legend->getHtml();
}
else
{
$ret = '';
}
return $ret;
} | [
"protected",
"function",
"getHtmlLegend",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"legend",
")",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"legend",
"->",
"getHtml",
"(",
")",
";",
"}",
"else",
"{",
"$",
"ret",
"=",
"''",
";",
... | Returns the legend for this fieldset.
@return string
@since 1.0.0
@api | [
"Returns",
"the",
"legend",
"for",
"this",
"fieldset",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/FieldSet.php#L87-L99 |
225,621 | edineibauer/entity | public/src/Entity/Validate.php | Validate.meta | public static function meta(Meta $m)
{
if ($m->getColumn() !== "id") {
self::checkDefaultSet($m);
if (!empty($m->getValue()) && !in_array($m->getKey(), ["extend", "extend_add", "list", "selecao", "checkbox_rel"])) {
self::checkRegular($m);
self::conver... | php | public static function meta(Meta $m)
{
if ($m->getColumn() !== "id") {
self::checkDefaultSet($m);
if (!empty($m->getValue()) && !in_array($m->getKey(), ["extend", "extend_add", "list", "selecao", "checkbox_rel"])) {
self::checkRegular($m);
self::conver... | [
"public",
"static",
"function",
"meta",
"(",
"Meta",
"$",
"m",
")",
"{",
"if",
"(",
"$",
"m",
"->",
"getColumn",
"(",
")",
"!==",
"\"id\"",
")",
"{",
"self",
"::",
"checkDefaultSet",
"(",
"$",
"m",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"... | Valida valor a ser inserido na meta
@param Meta $m
@param $value
@return mixed | [
"Valida",
"valor",
"a",
"ser",
"inserido",
"na",
"meta"
] | 8437f5531ed9cd5f75c4c69c7db27b31e31e02c2 | https://github.com/edineibauer/entity/blob/8437f5531ed9cd5f75c4c69c7db27b31e31e02c2/public/src/Entity/Validate.php#L17-L30 |
225,622 | matteosister/CompassElephant | src/CompassElephant/StalenessChecker/FinderStalenessChecker.php | FinderStalenessChecker.isClean | public function isClean()
{
if ($this->getConfigFileAge() > max($this->getSassMaxAge(), $this->getStylesheetsMaxAge())) {
return false;
}
return $this->getSassMaxAge() <= $this->getStylesheetsMaxAge();
} | php | public function isClean()
{
if ($this->getConfigFileAge() > max($this->getSassMaxAge(), $this->getStylesheetsMaxAge())) {
return false;
}
return $this->getSassMaxAge() <= $this->getStylesheetsMaxAge();
} | [
"public",
"function",
"isClean",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getConfigFileAge",
"(",
")",
">",
"max",
"(",
"$",
"this",
"->",
"getSassMaxAge",
"(",
")",
",",
"$",
"this",
"->",
"getStylesheetsMaxAge",
"(",
")",
")",
")",
"{",
"retur... | return true if the project do not need to be recompiled
@return boolean | [
"return",
"true",
"if",
"the",
"project",
"do",
"not",
"need",
"to",
"be",
"recompiled"
] | 5d2dacca5e33405872219ea5b6297e8aed964cf3 | https://github.com/matteosister/CompassElephant/blob/5d2dacca5e33405872219ea5b6297e8aed964cf3/src/CompassElephant/StalenessChecker/FinderStalenessChecker.php#L51-L58 |
225,623 | matteosister/CompassElephant | src/CompassElephant/StalenessChecker/FinderStalenessChecker.php | FinderStalenessChecker.checkPaths | private function checkPaths()
{
if (!is_dir($this->sassPath)) {
throw new \RuntimeException(sprintf('The path %s do not exists', $this->sassPath));
}
if (!is_dir($this->cssPath)) {
try {
mkdir($this->cssPath);
} catch (\Exception $e) {
... | php | private function checkPaths()
{
if (!is_dir($this->sassPath)) {
throw new \RuntimeException(sprintf('The path %s do not exists', $this->sassPath));
}
if (!is_dir($this->cssPath)) {
try {
mkdir($this->cssPath);
} catch (\Exception $e) {
... | [
"private",
"function",
"checkPaths",
"(",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"this",
"->",
"sassPath",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'The path %s do not exists'",
",",
"$",
"this",
"->",
"sassPath... | check if sass and stylesheets paths are writable
@throws \RuntimeException | [
"check",
"if",
"sass",
"and",
"stylesheets",
"paths",
"are",
"writable"
] | 5d2dacca5e33405872219ea5b6297e8aed964cf3 | https://github.com/matteosister/CompassElephant/blob/5d2dacca5e33405872219ea5b6297e8aed964cf3/src/CompassElephant/StalenessChecker/FinderStalenessChecker.php#L65-L83 |
225,624 | matteosister/CompassElephant | src/CompassElephant/StalenessChecker/FinderStalenessChecker.php | FinderStalenessChecker.findPaths | private function findPaths()
{
$configFilename = $this->projectPath . DIRECTORY_SEPARATOR . $this->configFile;
$handle = fopen($configFilename, 'r');
if (false === $handle) {
throw new \FileNotFoundException($configFilename . ' could not be found');
}
$con... | php | private function findPaths()
{
$configFilename = $this->projectPath . DIRECTORY_SEPARATOR . $this->configFile;
$handle = fopen($configFilename, 'r');
if (false === $handle) {
throw new \FileNotFoundException($configFilename . ' could not be found');
}
$con... | [
"private",
"function",
"findPaths",
"(",
")",
"{",
"$",
"configFilename",
"=",
"$",
"this",
"->",
"projectPath",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
"->",
"configFile",
";",
"$",
"handle",
"=",
"fopen",
"(",
"$",
"configFilename",
",",
"'r'",
")"... | find sass and stylesheets files parsing the config file
@throws \FileNotFoundException | [
"find",
"sass",
"and",
"stylesheets",
"files",
"parsing",
"the",
"config",
"file"
] | 5d2dacca5e33405872219ea5b6297e8aed964cf3 | https://github.com/matteosister/CompassElephant/blob/5d2dacca5e33405872219ea5b6297e8aed964cf3/src/CompassElephant/StalenessChecker/FinderStalenessChecker.php#L90-L106 |
225,625 | matteosister/CompassElephant | src/CompassElephant/StalenessChecker/FinderStalenessChecker.php | FinderStalenessChecker.getStylesheetsMaxAge | private function getStylesheetsMaxAge()
{
if (is_null($this->cssPath)) {
$this->findPaths();
$this->checkPaths();
}
return $this->getFilesMaxAge($this->cssPath, array('*.css'));
} | php | private function getStylesheetsMaxAge()
{
if (is_null($this->cssPath)) {
$this->findPaths();
$this->checkPaths();
}
return $this->getFilesMaxAge($this->cssPath, array('*.css'));
} | [
"private",
"function",
"getStylesheetsMaxAge",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"cssPath",
")",
")",
"{",
"$",
"this",
"->",
"findPaths",
"(",
")",
";",
"$",
"this",
"->",
"checkPaths",
"(",
")",
";",
"}",
"return",
"$",
... | Get the max_age of stylesheets files
@return int | [
"Get",
"the",
"max_age",
"of",
"stylesheets",
"files"
] | 5d2dacca5e33405872219ea5b6297e8aed964cf3 | https://github.com/matteosister/CompassElephant/blob/5d2dacca5e33405872219ea5b6297e8aed964cf3/src/CompassElephant/StalenessChecker/FinderStalenessChecker.php#L113-L120 |
225,626 | cmsgears/module-cms | common/models/entities/Content.php | Content.getParent | public function getParent() {
$pageClass = Yii::$app->cms->getPageClass( $this->type );
return $this->hasOne( $pageClass, [ 'id' => 'parentId' ] );
} | php | public function getParent() {
$pageClass = Yii::$app->cms->getPageClass( $this->type );
return $this->hasOne( $pageClass, [ 'id' => 'parentId' ] );
} | [
"public",
"function",
"getParent",
"(",
")",
"{",
"$",
"pageClass",
"=",
"Yii",
"::",
"$",
"app",
"->",
"cms",
"->",
"getPageClass",
"(",
"$",
"this",
"->",
"type",
")",
";",
"return",
"$",
"this",
"->",
"hasOne",
"(",
"$",
"pageClass",
",",
"[",
"... | Returns the immediate parent.
@return Content | [
"Returns",
"the",
"immediate",
"parent",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/models/entities/Content.php#L306-L311 |
225,627 | stubbles/stubbles-input | src/main/php/filter/ReusableFilter.php | ReusableFilter.instance | public static function instance(): Filter
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
} | php | public static function instance(): Filter
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
} | [
"public",
"static",
"function",
"instance",
"(",
")",
":",
"Filter",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"instance",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"self",
"(",
")",
";",
"}",
"return",
"self",
"::",
"$",
"instan... | returns reusable filter instance
@return \stubbles\input\Filter | [
"returns",
"reusable",
"filter",
"instance"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/ReusableFilter.php#L32-L39 |
225,628 | GFG/dto-context | src/DTOContext/Factory/Base.php | Base.getMappedContext | protected function getMappedContext($contextName)
{
$this->checkMappedContext($contextName);
$mappingList = $this->getMappingList();
return $mappingList[$contextName];
} | php | protected function getMappedContext($contextName)
{
$this->checkMappedContext($contextName);
$mappingList = $this->getMappingList();
return $mappingList[$contextName];
} | [
"protected",
"function",
"getMappedContext",
"(",
"$",
"contextName",
")",
"{",
"$",
"this",
"->",
"checkMappedContext",
"(",
"$",
"contextName",
")",
";",
"$",
"mappingList",
"=",
"$",
"this",
"->",
"getMappingList",
"(",
")",
";",
"return",
"$",
"mappingLi... | Return the mapped context class
@param string $contextName
@return string | [
"Return",
"the",
"mapped",
"context",
"class"
] | c1a47273d3dc2704bfd3f90c2560726688d54558 | https://github.com/GFG/dto-context/blob/c1a47273d3dc2704bfd3f90c2560726688d54558/src/DTOContext/Factory/Base.php#L56-L62 |
225,629 | spiral/translator | src/Indexer.php | Indexer.registerMessage | public function registerMessage(string $domain, string $string, bool $resolveDomain = true)
{
if ($resolveDomain) {
$domain = $this->config->resolveDomain($domain);
}
//Automatically registering
$this->catalogue->set($domain, $string, $string);
$this->getLogger(... | php | public function registerMessage(string $domain, string $string, bool $resolveDomain = true)
{
if ($resolveDomain) {
$domain = $this->config->resolveDomain($domain);
}
//Automatically registering
$this->catalogue->set($domain, $string, $string);
$this->getLogger(... | [
"public",
"function",
"registerMessage",
"(",
"string",
"$",
"domain",
",",
"string",
"$",
"string",
",",
"bool",
"$",
"resolveDomain",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"resolveDomain",
")",
"{",
"$",
"domain",
"=",
"$",
"this",
"->",
"config",
"... | Register string in active translator.
@param string $domain
@param string $string
@param bool $resolveDomain | [
"Register",
"string",
"in",
"active",
"translator",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Indexer.php#L60-L73 |
225,630 | spiral/translator | src/Indexer.php | Indexer.indexClasses | public function indexClasses(ClassesInterface $locator)
{
foreach ($locator->getClasses(TranslatorTrait::class) as $class) {
$strings = $this->fetchMessages($class, true);
foreach ($strings as $string) {
$this->registerMessage($class->getName(), $string);
... | php | public function indexClasses(ClassesInterface $locator)
{
foreach ($locator->getClasses(TranslatorTrait::class) as $class) {
$strings = $this->fetchMessages($class, true);
foreach ($strings as $string) {
$this->registerMessage($class->getName(), $string);
... | [
"public",
"function",
"indexClasses",
"(",
"ClassesInterface",
"$",
"locator",
")",
"{",
"foreach",
"(",
"$",
"locator",
"->",
"getClasses",
"(",
"TranslatorTrait",
"::",
"class",
")",
"as",
"$",
"class",
")",
"{",
"$",
"strings",
"=",
"$",
"this",
"->",
... | Index and register i18n string located in default properties which belongs to TranslatorTrait
classes.
@param ClassesInterface $locator | [
"Index",
"and",
"register",
"i18n",
"string",
"located",
"in",
"default",
"properties",
"which",
"belongs",
"to",
"TranslatorTrait",
"classes",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Indexer.php#L81-L89 |
225,631 | spiral/translator | src/Indexer.php | Indexer.registerInvocations | private function registerInvocations(array $invocations)
{
foreach ($invocations as $invocation) {
if ($invocation->getArgument(0)->getType() != ReflectionArgument::STRING) {
//We can only index invocations with constant string arguments
continue;
}
... | php | private function registerInvocations(array $invocations)
{
foreach ($invocations as $invocation) {
if ($invocation->getArgument(0)->getType() != ReflectionArgument::STRING) {
//We can only index invocations with constant string arguments
continue;
}
... | [
"private",
"function",
"registerInvocations",
"(",
"array",
"$",
"invocations",
")",
"{",
"foreach",
"(",
"$",
"invocations",
"as",
"$",
"invocation",
")",
"{",
"if",
"(",
"$",
"invocation",
"->",
"getArgument",
"(",
"0",
")",
"->",
"getType",
"(",
")",
... | Register found invocations in translator bundles.
@param ReflectionInvocation[] $invocations | [
"Register",
"found",
"invocations",
"in",
"translator",
"bundles",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Indexer.php#L117-L130 |
225,632 | spiral/translator | src/Indexer.php | Indexer.fetchMessages | private function fetchMessages(\ReflectionClass $reflection, bool $inherit = false)
{
$target = $reflection->getDefaultProperties() + $reflection->getConstants();
foreach ($reflection->getProperties() as $property) {
if (is_string($property->getDocComment()) && strpos($property->getDocC... | php | private function fetchMessages(\ReflectionClass $reflection, bool $inherit = false)
{
$target = $reflection->getDefaultProperties() + $reflection->getConstants();
foreach ($reflection->getProperties() as $property) {
if (is_string($property->getDocComment()) && strpos($property->getDocC... | [
"private",
"function",
"fetchMessages",
"(",
"\\",
"ReflectionClass",
"$",
"reflection",
",",
"bool",
"$",
"inherit",
"=",
"false",
")",
"{",
"$",
"target",
"=",
"$",
"reflection",
"->",
"getDefaultProperties",
"(",
")",
"+",
"$",
"reflection",
"->",
"getCon... | Fetch default string values from class and merge it with parent strings if requested.
@param \ReflectionClass $reflection
@param bool $inherit
@return array | [
"Fetch",
"default",
"string",
"values",
"from",
"class",
"and",
"merge",
"it",
"with",
"parent",
"strings",
"if",
"requested",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Indexer.php#L139-L166 |
225,633 | spiral/translator | src/Indexer.php | Indexer.invocationDomain | private function invocationDomain(ReflectionInvocation $invocation): string
{
//Translation using default bundle
$domain = $this->config->getDefaultDomain();
if ($invocation->getName() === 'say') {
//Let's try to confirm domain
$domain = $this->config->resolveDomain(... | php | private function invocationDomain(ReflectionInvocation $invocation): string
{
//Translation using default bundle
$domain = $this->config->getDefaultDomain();
if ($invocation->getName() === 'say') {
//Let's try to confirm domain
$domain = $this->config->resolveDomain(... | [
"private",
"function",
"invocationDomain",
"(",
"ReflectionInvocation",
"$",
"invocation",
")",
":",
"string",
"{",
"//Translation using default bundle",
"$",
"domain",
"=",
"$",
"this",
"->",
"config",
"->",
"getDefaultDomain",
"(",
")",
";",
"if",
"(",
"$",
"i... | Get associated domain.
@param ReflectionInvocation $invocation
@return string | [
"Get",
"associated",
"domain",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Indexer.php#L174-L205 |
225,634 | SetBased/php-abc-table-detail | src/TableRow/IntegerTableRow.php | IntegerTableRow.addRow | public static function addRow(DetailTable $table, $header, ?int $value): void
{
if ($value!==null && $value!=='')
{
$table->addRow($header, ['class' => 'integer'], Cast::toOptString($value));
}
else
{
$table->addRow($header);
}
} | php | public static function addRow(DetailTable $table, $header, ?int $value): void
{
if ($value!==null && $value!=='')
{
$table->addRow($header, ['class' => 'integer'], Cast::toOptString($value));
}
else
{
$table->addRow($header);
}
} | [
"public",
"static",
"function",
"addRow",
"(",
"DetailTable",
"$",
"table",
",",
"$",
"header",
",",
"?",
"int",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
"&&",
"$",
"value",
"!==",
"''",
")",
"{",
"$",
"table",
... | Adds a row with an integer value to a detail table.
@param DetailTable $table The detail table.
@param string|int|null $header The header text of this table row.
@param int|null $value The integer value. | [
"Adds",
"a",
"row",
"with",
"an",
"integer",
"value",
"to",
"a",
"detail",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/TableRow/IntegerTableRow.php#L22-L32 |
225,635 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/FolderCollection.php | FolderCollection.delete | public function delete(bool $recursive = true): bool
{
$this->each(function (Folder $item) use ($recursive) {
$item->delete($recursive);
});
return true;
} | php | public function delete(bool $recursive = true): bool
{
$this->each(function (Folder $item) use ($recursive) {
$item->delete($recursive);
});
return true;
} | [
"public",
"function",
"delete",
"(",
"bool",
"$",
"recursive",
"=",
"true",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"each",
"(",
"function",
"(",
"Folder",
"$",
"item",
")",
"use",
"(",
"$",
"recursive",
")",
"{",
"$",
"item",
"->",
"delete",
"("... | Delete all folders.
@param bool $recursive Set FALSE to prevent recursive deleting all files and sub folders
@return bool | [
"Delete",
"all",
"folders",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/FolderCollection.php#L30-L37 |
225,636 | n2n/n2n-log4php | src/app/n2n/log4php/LoggerRoot.php | LoggerRoot.setLevel | public function setLevel(\n2n\log4php\LoggerLevel $level = null) {
if (isset($level)) {
parent::setLevel($level);
} else {
throw new \n2n\log4php\LoggerException("log4php: Cannot set LoggerRoot level to null.", E_USER_WARNING);
}
} | php | public function setLevel(\n2n\log4php\LoggerLevel $level = null) {
if (isset($level)) {
parent::setLevel($level);
} else {
throw new \n2n\log4php\LoggerException("log4php: Cannot set LoggerRoot level to null.", E_USER_WARNING);
}
} | [
"public",
"function",
"setLevel",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"$",
"level",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"level",
")",
")",
"{",
"parent",
"::",
"setLevel",
"(",
"$",
"level",
")",
";",
"}",
"else... | Override level setter to prevent setting the root logger's level to
null. Root logger must always have a level.
@param \n2n\log4php\LoggerLevel $level | [
"Override",
"level",
"setter",
"to",
"prevent",
"setting",
"the",
"root",
"logger",
"s",
"level",
"to",
"null",
".",
"Root",
"logger",
"must",
"always",
"have",
"a",
"level",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/LoggerRoot.php#L57-L63 |
225,637 | SlayerBirden/dataflow | src/Writer/Dbal/Write.php | Write.pass | public function pass(DataBagInterface $dataBag): DataBagInterface
{
$dataToInsert = $this->getDataToInsert($dataBag);
if ($this->recordExists($dataBag)) {
$this->updateRecord($dataToInsert, $dataBag);
} else {
$this->insertRecord($dataToInsert, $dataBag);
}
... | php | public function pass(DataBagInterface $dataBag): DataBagInterface
{
$dataToInsert = $this->getDataToInsert($dataBag);
if ($this->recordExists($dataBag)) {
$this->updateRecord($dataToInsert, $dataBag);
} else {
$this->insertRecord($dataToInsert, $dataBag);
}
... | [
"public",
"function",
"pass",
"(",
"DataBagInterface",
"$",
"dataBag",
")",
":",
"DataBagInterface",
"{",
"$",
"dataToInsert",
"=",
"$",
"this",
"->",
"getDataToInsert",
"(",
"$",
"dataBag",
")",
";",
"if",
"(",
"$",
"this",
"->",
"recordExists",
"(",
"$",... | DBAL Insert statement.
Inserts data into a table using DBAL.
{@inheritdoc} | [
"DBAL",
"Insert",
"statement",
".",
"Inserts",
"data",
"into",
"a",
"table",
"using",
"DBAL",
"."
] | a9cb826b106e882e43523d39fea319adc4893e00 | https://github.com/SlayerBirden/dataflow/blob/a9cb826b106e882e43523d39fea319adc4893e00/src/Writer/Dbal/Write.php#L73-L83 |
225,638 | SlayerBirden/dataflow | src/Writer/Dbal/Write.php | Write.getRecordId | public function getRecordId(array $identifier, string $autoIncrementColumn): int
{
if (isset($identifier[$autoIncrementColumn])) {
return (int)$identifier[$autoIncrementColumn];
}
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder->select($autoIncremen... | php | public function getRecordId(array $identifier, string $autoIncrementColumn): int
{
if (isset($identifier[$autoIncrementColumn])) {
return (int)$identifier[$autoIncrementColumn];
}
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder->select($autoIncremen... | [
"public",
"function",
"getRecordId",
"(",
"array",
"$",
"identifier",
",",
"string",
"$",
"autoIncrementColumn",
")",
":",
"int",
"{",
"if",
"(",
"isset",
"(",
"$",
"identifier",
"[",
"$",
"autoIncrementColumn",
"]",
")",
")",
"{",
"return",
"(",
"int",
... | Get auto-increment field value of the record using given id.
@param array $identifier
@param string $autoIncrementColumn
@return int
@throws DBALException | [
"Get",
"auto",
"-",
"increment",
"field",
"value",
"of",
"the",
"record",
"using",
"given",
"id",
"."
] | a9cb826b106e882e43523d39fea319adc4893e00 | https://github.com/SlayerBirden/dataflow/blob/a9cb826b106e882e43523d39fea319adc4893e00/src/Writer/Dbal/Write.php#L159-L174 |
225,639 | SlayerBirden/dataflow | src/Writer/Dbal/Write.php | Write.recordExists | private function recordExists(DataBagInterface $dataBag): bool
{
$id = $this->updateStrategy->getRecordIdentifier($dataBag);
if (!empty($id)) {
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder->select('count(*)')
->from($this->table)
... | php | private function recordExists(DataBagInterface $dataBag): bool
{
$id = $this->updateStrategy->getRecordIdentifier($dataBag);
if (!empty($id)) {
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder->select('count(*)')
->from($this->table)
... | [
"private",
"function",
"recordExists",
"(",
"DataBagInterface",
"$",
"dataBag",
")",
":",
"bool",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"updateStrategy",
"->",
"getRecordIdentifier",
"(",
"$",
"dataBag",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"id... | Checks if record already exists in the DB.
@param DataBagInterface $dataBag
@return bool
@throws DBALException | [
"Checks",
"if",
"record",
"already",
"exists",
"in",
"the",
"DB",
"."
] | a9cb826b106e882e43523d39fea319adc4893e00 | https://github.com/SlayerBirden/dataflow/blob/a9cb826b106e882e43523d39fea319adc4893e00/src/Writer/Dbal/Write.php#L183-L206 |
225,640 | railken/amethyst-api | src/Api/Concerns/ApiTransformerTrait.php | ApiTransformerTrait.transform | public function transform(EntityContract $entity)
{
return $this->manager->getSerializer()->serialize($entity, Collection::make(array_merge($this->getSelectedAttributes(), $this->getAuthorizedAttributes())))->toArray();
} | php | public function transform(EntityContract $entity)
{
return $this->manager->getSerializer()->serialize($entity, Collection::make(array_merge($this->getSelectedAttributes(), $this->getAuthorizedAttributes())))->toArray();
} | [
"public",
"function",
"transform",
"(",
"EntityContract",
"$",
"entity",
")",
"{",
"return",
"$",
"this",
"->",
"manager",
"->",
"getSerializer",
"(",
")",
"->",
"serialize",
"(",
"$",
"entity",
",",
"Collection",
"::",
"make",
"(",
"array_merge",
"(",
"$"... | Turn this item object into a generic array.
@return array | [
"Turn",
"this",
"item",
"object",
"into",
"a",
"generic",
"array",
"."
] | 00b78540b05dac59e6ef9367f1c37623a5754b89 | https://github.com/railken/amethyst-api/blob/00b78540b05dac59e6ef9367f1c37623a5754b89/src/Api/Concerns/ApiTransformerTrait.php#L42-L45 |
225,641 | sopinetchat/SopinetChatBundle | Entity/Message.php | Message.getMyType | public function getMyType() {
$className = get_class($this);
$classParts = explode("\\", $className);
$classSingle = $classParts[count($classParts) - 1];
$classLowSingle = strtolower($classSingle);
$type = str_replace("message", "", $classLowSingle);
if (!$type) {
... | php | public function getMyType() {
$className = get_class($this);
$classParts = explode("\\", $className);
$classSingle = $classParts[count($classParts) - 1];
$classLowSingle = strtolower($classSingle);
$type = str_replace("message", "", $classLowSingle);
if (!$type) {
... | [
"public",
"function",
"getMyType",
"(",
")",
"{",
"$",
"className",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"$",
"classParts",
"=",
"explode",
"(",
"\"\\\\\"",
",",
"$",
"className",
")",
";",
"$",
"classSingle",
"=",
"$",
"classParts",
"[",
"cou... | Return type data
@return string | [
"Return",
"type",
"data"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Entity/Message.php#L324-L336 |
225,642 | Finesse/MiniDB | src/Parts/RawStatementsTrait.php | RawStatementsTrait.insert | public function insert(string $query, array $values = []): int
{
try {
return $this->connection->insert($query, $values);
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | php | public function insert(string $query, array $values = []): int
{
try {
return $this->connection->insert($query, $values);
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | [
"public",
"function",
"insert",
"(",
"string",
"$",
"query",
",",
"array",
"$",
"values",
"=",
"[",
"]",
")",
":",
"int",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"connection",
"->",
"insert",
"(",
"$",
"query",
",",
"$",
"values",
")",
";",
... | Performs a insert query and returns the number of inserted rows.
@param string $query Full SQL query (tables are not prefixed here)
@param array $values Values to bind. The indexes are the names or numbers of the values.
@return int
@throws InvalidArgumentException
@throws DatabaseException | [
"Performs",
"a",
"insert",
"query",
"and",
"returns",
"the",
"number",
"of",
"inserted",
"rows",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/RawStatementsTrait.php#L67-L74 |
225,643 | Finesse/MiniDB | src/Parts/RawStatementsTrait.php | RawStatementsTrait.insertGetId | public function insertGetId(string $query, array $values = [], string $sequence = null)
{
try {
return $this->connection->insertGetId($query, $values, $sequence);
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | php | public function insertGetId(string $query, array $values = [], string $sequence = null)
{
try {
return $this->connection->insertGetId($query, $values, $sequence);
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | [
"public",
"function",
"insertGetId",
"(",
"string",
"$",
"query",
",",
"array",
"$",
"values",
"=",
"[",
"]",
",",
"string",
"$",
"sequence",
"=",
"null",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"connection",
"->",
"insertGetId",
"(",
"$",
... | Performs a insert query and returns the identifier of the last inserted row.
@param string $query Full SQL query (tables are not prefixed here)
@param array $values Values to bind. The indexes are the names or numbers of the values.
@param string|null $sequence Name of the sequence object from which the ID should be r... | [
"Performs",
"a",
"insert",
"query",
"and",
"returns",
"the",
"identifier",
"of",
"the",
"last",
"inserted",
"row",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/RawStatementsTrait.php#L86-L93 |
225,644 | bytic/Common | src/Controllers/Traits/Models/HasModelFinder.php | HasModelFinder.getForeignModelFromRequest | protected function getForeignModelFromRequest($name)
{
$this->checkForeignModelFromRequest($name);
$requestKey = $this->getRequestKeyFromString($name);
return $this->getRequest()->attributes->get($requestKey);
} | php | protected function getForeignModelFromRequest($name)
{
$this->checkForeignModelFromRequest($name);
$requestKey = $this->getRequestKeyFromString($name);
return $this->getRequest()->attributes->get($requestKey);
} | [
"protected",
"function",
"getForeignModelFromRequest",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"checkForeignModelFromRequest",
"(",
"$",
"name",
")",
";",
"$",
"requestKey",
"=",
"$",
"this",
"->",
"getRequestKeyFromString",
"(",
"$",
"name",
")",
";",
... | Gets Foreign model from Request
@param string $name
@return Record|null | [
"Gets",
"Foreign",
"model",
"from",
"Request"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Controllers/Traits/Models/HasModelFinder.php#L192-L198 |
225,645 | froq/froq-logger | src/Logger.php | Logger.checkDirectory | public function checkDirectory(): bool
{
if ($this->directory == null) {
throw new LoggerException('Log directory is not defined yet');
}
self::$directoryChecked = self::$directoryChecked ?: is_dir($this->directory);
if (!self::$directoryChecked) {
self::$dir... | php | public function checkDirectory(): bool
{
if ($this->directory == null) {
throw new LoggerException('Log directory is not defined yet');
}
self::$directoryChecked = self::$directoryChecked ?: is_dir($this->directory);
if (!self::$directoryChecked) {
self::$dir... | [
"public",
"function",
"checkDirectory",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"directory",
"==",
"null",
")",
"{",
"throw",
"new",
"LoggerException",
"(",
"'Log directory is not defined yet'",
")",
";",
"}",
"self",
"::",
"$",
"directoryC... | Check directory.
@return bool
@throws froq\logger\LoggerException | [
"Check",
"directory",
"."
] | 7b04a012375828bec556bd93e2d023dd58a9fe74 | https://github.com/froq/froq-logger/blob/7b04a012375828bec556bd93e2d023dd58a9fe74/src/Logger.php#L119-L135 |
225,646 | froq/froq-logger | src/Logger.php | Logger.logAny | public function logAny($message, bool $separate = false): ?bool
{
return $this->log(self::ANY, $message, $separate);
} | php | public function logAny($message, bool $separate = false): ?bool
{
return $this->log(self::ANY, $message, $separate);
} | [
"public",
"function",
"logAny",
"(",
"$",
"message",
",",
"bool",
"$",
"separate",
"=",
"false",
")",
":",
"?",
"bool",
"{",
"return",
"$",
"this",
"->",
"log",
"(",
"self",
"::",
"ANY",
",",
"$",
"message",
",",
"$",
"separate",
")",
";",
"}"
] | Log any.
@param any $message
@param bool $separate
@return ?bool
@since 3.2 | [
"Log",
"any",
"."
] | 7b04a012375828bec556bd93e2d023dd58a9fe74 | https://github.com/froq/froq-logger/blob/7b04a012375828bec556bd93e2d023dd58a9fe74/src/Logger.php#L211-L214 |
225,647 | froq/froq-logger | src/Logger.php | Logger.logFail | public function logFail($message, bool $separate = false): ?bool
{
return $this->log(self::FAIL, $message, $separate);
} | php | public function logFail($message, bool $separate = false): ?bool
{
return $this->log(self::FAIL, $message, $separate);
} | [
"public",
"function",
"logFail",
"(",
"$",
"message",
",",
"bool",
"$",
"separate",
"=",
"false",
")",
":",
"?",
"bool",
"{",
"return",
"$",
"this",
"->",
"log",
"(",
"self",
"::",
"FAIL",
",",
"$",
"message",
",",
"$",
"separate",
")",
";",
"}"
] | Log fail.
@param any $message
@param bool $separate
@return ?bool | [
"Log",
"fail",
"."
] | 7b04a012375828bec556bd93e2d023dd58a9fe74 | https://github.com/froq/froq-logger/blob/7b04a012375828bec556bd93e2d023dd58a9fe74/src/Logger.php#L222-L225 |
225,648 | froq/froq-logger | src/Logger.php | Logger.logWarn | public function logWarn($message, bool $separate = false): ?bool
{
return $this->log(self::WARN, $message, $separate);
} | php | public function logWarn($message, bool $separate = false): ?bool
{
return $this->log(self::WARN, $message, $separate);
} | [
"public",
"function",
"logWarn",
"(",
"$",
"message",
",",
"bool",
"$",
"separate",
"=",
"false",
")",
":",
"?",
"bool",
"{",
"return",
"$",
"this",
"->",
"log",
"(",
"self",
"::",
"WARN",
",",
"$",
"message",
",",
"$",
"separate",
")",
";",
"}"
] | Log warn.
@param any $message
@param bool $separate
@return ?bool | [
"Log",
"warn",
"."
] | 7b04a012375828bec556bd93e2d023dd58a9fe74 | https://github.com/froq/froq-logger/blob/7b04a012375828bec556bd93e2d023dd58a9fe74/src/Logger.php#L233-L236 |
225,649 | froq/froq-logger | src/Logger.php | Logger.logInfo | public function logInfo($message, bool $separate = false): ?bool
{
return $this->log(self::INFO, $message, $separate);
} | php | public function logInfo($message, bool $separate = false): ?bool
{
return $this->log(self::INFO, $message, $separate);
} | [
"public",
"function",
"logInfo",
"(",
"$",
"message",
",",
"bool",
"$",
"separate",
"=",
"false",
")",
":",
"?",
"bool",
"{",
"return",
"$",
"this",
"->",
"log",
"(",
"self",
"::",
"INFO",
",",
"$",
"message",
",",
"$",
"separate",
")",
";",
"}"
] | Log info.
@param any $message
@param bool $separate
@return ?bool | [
"Log",
"info",
"."
] | 7b04a012375828bec556bd93e2d023dd58a9fe74 | https://github.com/froq/froq-logger/blob/7b04a012375828bec556bd93e2d023dd58a9fe74/src/Logger.php#L244-L247 |
225,650 | froq/froq-logger | src/Logger.php | Logger.logDebug | public function logDebug($message, bool $separate = false): ?bool
{
return $this->log(self::DEBUG, $message, $separate);
} | php | public function logDebug($message, bool $separate = false): ?bool
{
return $this->log(self::DEBUG, $message, $separate);
} | [
"public",
"function",
"logDebug",
"(",
"$",
"message",
",",
"bool",
"$",
"separate",
"=",
"false",
")",
":",
"?",
"bool",
"{",
"return",
"$",
"this",
"->",
"log",
"(",
"self",
"::",
"DEBUG",
",",
"$",
"message",
",",
"$",
"separate",
")",
";",
"}"
... | Log debug.
@param any $message
@param bool $separate
@return ?bool | [
"Log",
"debug",
"."
] | 7b04a012375828bec556bd93e2d023dd58a9fe74 | https://github.com/froq/froq-logger/blob/7b04a012375828bec556bd93e2d023dd58a9fe74/src/Logger.php#L255-L258 |
225,651 | interserver/myadmin-plugin-installer | src/Loader.php | Loader.get_routes | public function get_routes($include_admin = false)
{
//if ($include_admin === FALSE && $GLOBALS['tf']->ima === 'admin')
//$include_admin = TRUE;
$routes = array_merge($this->public_routes, $this->routes);
if ($include_admin === true) {
$routes = array_merge($this->admin_routes, $routes);
}
uksort($route... | php | public function get_routes($include_admin = false)
{
//if ($include_admin === FALSE && $GLOBALS['tf']->ima === 'admin')
//$include_admin = TRUE;
$routes = array_merge($this->public_routes, $this->routes);
if ($include_admin === true) {
$routes = array_merge($this->admin_routes, $routes);
}
uksort($route... | [
"public",
"function",
"get_routes",
"(",
"$",
"include_admin",
"=",
"false",
")",
"{",
"//if ($include_admin === FALSE && $GLOBALS['tf']->ima === 'admin')",
"//$include_admin = TRUE;",
"$",
"routes",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"public_routes",
",",
"$",
... | gets the page routes
@param bool $include_admin
@return array of routes | [
"gets",
"the",
"page",
"routes"
] | 128efde0b61f5623b094cbb399e66ab4aa0dba3f | https://github.com/interserver/myadmin-plugin-installer/blob/128efde0b61f5623b094cbb399e66ab4aa0dba3f/src/Loader.php#L38-L58 |
225,652 | SetBased/php-abc-form | src/Cleaner/DateCleaner.php | DateCleaner.clean | public function clean($value)
{
// First prune whitespace.
$value = PruneWhitespaceCleaner::get()->clean($value);
// If the value is empty return immediately.
if ($value==='' || $value===null || $value===false)
{
return $this->openDate;
}
// First validate against ISO 8601.
$ma... | php | public function clean($value)
{
// First prune whitespace.
$value = PruneWhitespaceCleaner::get()->clean($value);
// If the value is empty return immediately.
if ($value==='' || $value===null || $value===false)
{
return $this->openDate;
}
// First validate against ISO 8601.
$ma... | [
"public",
"function",
"clean",
"(",
"$",
"value",
")",
"{",
"// First prune whitespace.",
"$",
"value",
"=",
"PruneWhitespaceCleaner",
"::",
"get",
"(",
")",
"->",
"clean",
"(",
"$",
"value",
")",
";",
"// If the value is empty return immediately.",
"if",
"(",
"... | Cleans a submitted date and returns the date in ISO 8601 machine format if the date is a valid date. Otherwise
returns the original submitted value.
@param string|null $value The submitted date.
@return string|null
@since 1.0.0
@api | [
"Cleans",
"a",
"submitted",
"date",
"and",
"returns",
"the",
"date",
"in",
"ISO",
"8601",
"machine",
"format",
"if",
"the",
"date",
"is",
"a",
"valid",
"date",
".",
"Otherwise",
"returns",
"the",
"original",
"submitted",
"value",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Cleaner/DateCleaner.php#L72-L112 |
225,653 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.addAll | public function addAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
} else {
$elements = array_values($elements);
}
$this->elements = array_merge($this->elements, $elements);
return $this;
} | php | public function addAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
} else {
$elements = array_values($elements);
}
$this->elements = array_merge($this->elements, $elements);
return $this;
} | [
"public",
"function",
"addAll",
"(",
"$",
"elements",
")",
"{",
"if",
"(",
"$",
"elements",
"instanceof",
"CollectionInterface",
")",
"{",
"$",
"elements",
"=",
"$",
"elements",
"->",
"toArray",
"(",
")",
";",
"}",
"else",
"{",
"$",
"elements",
"=",
"a... | Adds elements to the end of the list.
@param CollectionInterface|array $elements Elements to add to the list.
@return ArrayList A reference to the list.
@see add | [
"Adds",
"elements",
"to",
"the",
"end",
"of",
"the",
"list",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L40-L49 |
225,654 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.insert | public function insert($index, $element)
{
if (0 < $index && $this->count() < $index) {
throw new \OutOfBoundsException();
}
array_splice($this->elements, $index, 0, $element);
foreach ($this->subLists as $subList) {
$subList->insert($index, $element, true);
... | php | public function insert($index, $element)
{
if (0 < $index && $this->count() < $index) {
throw new \OutOfBoundsException();
}
array_splice($this->elements, $index, 0, $element);
foreach ($this->subLists as $subList) {
$subList->insert($index, $element, true);
... | [
"public",
"function",
"insert",
"(",
"$",
"index",
",",
"$",
"element",
")",
"{",
"if",
"(",
"0",
"<",
"$",
"index",
"&&",
"$",
"this",
"->",
"count",
"(",
")",
"<",
"$",
"index",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
")",
... | Inserts the element at the specified position in this list.
Shifts the element currently at that position (if any) and any subsequent
elements to the right (adds one to their indices).
@param int $index Index to insert at.
@param mixed $element Element to insert.
@return ArrayList A reference to the list.
@thro... | [
"Inserts",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"list",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L66-L78 |
225,655 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.insertAll | public function insertAll($index, $elements)
{
if (0 < $index && $this->count() < $index) {
throw new \OutOfBoundsException();
}
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
} else {
$elements = array_values($el... | php | public function insertAll($index, $elements)
{
if (0 < $index && $this->count() < $index) {
throw new \OutOfBoundsException();
}
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
} else {
$elements = array_values($el... | [
"public",
"function",
"insertAll",
"(",
"$",
"index",
",",
"$",
"elements",
")",
"{",
"if",
"(",
"0",
"<",
"$",
"index",
"&&",
"$",
"this",
"->",
"count",
"(",
")",
"<",
"$",
"index",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
")"... | Inserts all of the elements into this list at the specified position.
Shifts the element currently at that position (if any) and any
subsequent elements to the right (increases their indices). The new
elements will appear in this list in the order that they are returned by
the specified collection's iterator.
@param ... | [
"Inserts",
"all",
"of",
"the",
"elements",
"into",
"this",
"list",
"at",
"the",
"specified",
"position",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L95-L110 |
225,656 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.set | public function set($index, $element)
{
if (false === array_key_exists($index, $this->elements)) {
throw new \OutOfBoundsException();
}
$this->elements[$index] = $element;
foreach ($this->subLists as $subList) {
$subList->set($index, $element, true);
}... | php | public function set($index, $element)
{
if (false === array_key_exists($index, $this->elements)) {
throw new \OutOfBoundsException();
}
$this->elements[$index] = $element;
foreach ($this->subLists as $subList) {
$subList->set($index, $element, true);
}... | [
"public",
"function",
"set",
"(",
"$",
"index",
",",
"$",
"element",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"elements",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
")",
... | Replaces the element at the specified position in this list with the
specified element.
@param int $index Index of the element to replace.
@param mixed $element Element to replace.
@return ArrayList A reference to the list.
@throws \OutOfBoundsException If the index is out of range. | [
"Replaces",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"list",
"with",
"the",
"specified",
"element",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L123-L133 |
225,657 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.remove | public function remove($element)
{
$key = array_search($element, $this->elements, true);
if (false !== $key) {
unset($this->elements[$key]);
$this->elements = array_values($this->elements);
}
foreach ($this->subLists as $subList) {
$subList->drop($... | php | public function remove($element)
{
$key = array_search($element, $this->elements, true);
if (false !== $key) {
unset($this->elements[$key]);
$this->elements = array_values($this->elements);
}
foreach ($this->subLists as $subList) {
$subList->drop($... | [
"public",
"function",
"remove",
"(",
"$",
"element",
")",
"{",
"$",
"key",
"=",
"array_search",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"elements",
",",
"true",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"key",
")",
"{",
"unset",
"(",
"$",
"t... | Removes the first instance of the element from the list, if it is present.
@param mixed $element Element to be removed from the list.
@return ArrayList A reference to the list.
@see removeAll | [
"Removes",
"the",
"first",
"instance",
"of",
"the",
"element",
"from",
"the",
"list",
"if",
"it",
"is",
"present",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L144-L155 |
225,658 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.removeAll | public function removeAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
}
$this->elements = array_values(
array_udiff(
$this->elements,
$elements,
function ($a, $b) {
... | php | public function removeAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
}
$this->elements = array_values(
array_udiff(
$this->elements,
$elements,
function ($a, $b) {
... | [
"public",
"function",
"removeAll",
"(",
"$",
"elements",
")",
"{",
"if",
"(",
"$",
"elements",
"instanceof",
"CollectionInterface",
")",
"{",
"$",
"elements",
"=",
"$",
"elements",
"->",
"toArray",
"(",
")",
";",
"}",
"$",
"this",
"->",
"elements",
"=",
... | Removes all instances of the elements from the list, if they are present.
@param CollectionInterface|array $elements Elements to be removed from the list, if present.
@return ArrayList A reference to the list.
@see remove | [
"Removes",
"all",
"instances",
"of",
"the",
"elements",
"from",
"the",
"list",
"if",
"they",
"are",
"present",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L166-L194 |
225,659 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.drop | public function drop($index)
{
if (false === array_key_exists($index, $this->elements)) {
throw new \OutOfBoundsException();
}
unset($this->elements[$index]);
$this->elements = array_values($this->elements);
foreach ($this->subLists as $subList) {
$sub... | php | public function drop($index)
{
if (false === array_key_exists($index, $this->elements)) {
throw new \OutOfBoundsException();
}
unset($this->elements[$index]);
$this->elements = array_values($this->elements);
foreach ($this->subLists as $subList) {
$sub... | [
"public",
"function",
"drop",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"elements",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
")",
";",
"}",
"unset",
... | Removes the element at the specified position in this list.
Shifts any subsequent elements to the left (subtracts one from their
indices).
@param int $index Index of the element to be removed.
@return ArrayList A reference to the list.
@throws \OutOfBoundsException If the index is out of range. | [
"Removes",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"list",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L208-L219 |
225,660 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.clear | public function clear()
{
$this->elements = array();
foreach ($this->subLists as $subList) {
$subList->clear(true);
}
return $this;
} | php | public function clear()
{
$this->elements = array();
foreach ($this->subLists as $subList) {
$subList->clear(true);
}
return $this;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"elements",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"subLists",
"as",
"$",
"subList",
")",
"{",
"$",
"subList",
"->",
"clear",
"(",
"true",
")",
";",
"}",
"r... | Removes all elements from the list.
@return ArrayList A reference to the list. | [
"Removes",
"all",
"elements",
"from",
"the",
"list",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L226-L233 |
225,661 | DrNixx/yii2-onix | src/collections/ArrayList.php | ArrayList.retainAll | public function retainAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
}
$this->elements = array_values(
array_uintersect(
$this->elements,
$elements,
function ($a, $b) {... | php | public function retainAll($elements)
{
if ($elements instanceof CollectionInterface) {
$elements = $elements->toArray();
}
$this->elements = array_values(
array_uintersect(
$this->elements,
$elements,
function ($a, $b) {... | [
"public",
"function",
"retainAll",
"(",
"$",
"elements",
")",
"{",
"if",
"(",
"$",
"elements",
"instanceof",
"CollectionInterface",
")",
"{",
"$",
"elements",
"=",
"$",
"elements",
"->",
"toArray",
"(",
")",
";",
"}",
"$",
"this",
"->",
"elements",
"=",
... | Retains only the elements in the list that are contained in the specified
collection.
In other words, removes from the list all of its elements that are not
contained in the specified collection.
@param CollectionInterface|array $elements Elements to be retained in the list.
@return ArrayList A reference to the list... | [
"Retains",
"only",
"the",
"elements",
"in",
"the",
"list",
"that",
"are",
"contained",
"in",
"the",
"specified",
"collection",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/ArrayList.php#L246-L271 |
225,662 | n2n/n2n-log4php | src/app/n2n/log4php/pattern/PatternParser.php | PatternParser.parse | public function parse() {
// Skip parsing if the pattern is empty
if (empty($this->pattern)) {
$this->addLiteral('');
return $this->head;
}
// Find all conversion words in the conversion pattern
$count = preg_match_all($this->regex, $this->pattern, $matches, PREG_OFFSET_CAPTURE);
if ($... | php | public function parse() {
// Skip parsing if the pattern is empty
if (empty($this->pattern)) {
$this->addLiteral('');
return $this->head;
}
// Find all conversion words in the conversion pattern
$count = preg_match_all($this->regex, $this->pattern, $matches, PREG_OFFSET_CAPTURE);
if ($... | [
"public",
"function",
"parse",
"(",
")",
"{",
"// Skip parsing if the pattern is empty\r",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"pattern",
")",
")",
"{",
"$",
"this",
"->",
"addLiteral",
"(",
"''",
")",
";",
"return",
"$",
"this",
"->",
"head",
";... | Parses the conversion pattern string, converts it to a chain of pattern
converters and returns the first converter in the chain.
@return \n2n\log4php\pattern\PatternConverter | [
"Parses",
"the",
"conversion",
"pattern",
"string",
"converts",
"it",
"to",
"a",
"chain",
"of",
"pattern",
"converters",
"and",
"returns",
"the",
"first",
"converter",
"in",
"the",
"chain",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/pattern/PatternParser.php#L78-L126 |
225,663 | n2n/n2n-log4php | src/app/n2n/log4php/pattern/PatternParser.php | PatternParser.addLiteral | private function addLiteral($string) {
$converter = new \n2n\log4php\pattern\converter\ConverterLiteral($string);
$this->addToChain($converter);
} | php | private function addLiteral($string) {
$converter = new \n2n\log4php\pattern\converter\ConverterLiteral($string);
$this->addToChain($converter);
} | [
"private",
"function",
"addLiteral",
"(",
"$",
"string",
")",
"{",
"$",
"converter",
"=",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"pattern",
"\\",
"converter",
"\\",
"ConverterLiteral",
"(",
"$",
"string",
")",
";",
"$",
"this",
"->",
"addToChain",
"(... | Adds a literal converter to the converter chain.
@param string $string The string for the literal converter. | [
"Adds",
"a",
"literal",
"converter",
"to",
"the",
"converter",
"chain",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/pattern/PatternParser.php#L132-L135 |
225,664 | n2n/n2n-log4php | src/app/n2n/log4php/pattern/PatternParser.php | PatternParser.addConverter | private function addConverter($word, $modifiers, $option) {
$formattingInfo = $this->parseModifiers($modifiers);
$option = trim($option, "{} ");
if (isset($this->converterMap[$word])) {
$converter = $this->getConverter($word, $formattingInfo, $option);
$this->addToChain($converter);
} else {
... | php | private function addConverter($word, $modifiers, $option) {
$formattingInfo = $this->parseModifiers($modifiers);
$option = trim($option, "{} ");
if (isset($this->converterMap[$word])) {
$converter = $this->getConverter($word, $formattingInfo, $option);
$this->addToChain($converter);
} else {
... | [
"private",
"function",
"addConverter",
"(",
"$",
"word",
",",
"$",
"modifiers",
",",
"$",
"option",
")",
"{",
"$",
"formattingInfo",
"=",
"$",
"this",
"->",
"parseModifiers",
"(",
"$",
"modifiers",
")",
";",
"$",
"option",
"=",
"trim",
"(",
"$",
"optio... | Adds a non-literal converter to the converter chain.
@param string $word The conversion word, used to determine which
converter will be used.
@param string $modifiers Formatting modifiers.
@param string $option Option to pass to the converter. | [
"Adds",
"a",
"non",
"-",
"literal",
"converter",
"to",
"the",
"converter",
"chain",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/pattern/PatternParser.php#L145-L155 |
225,665 | n2n/n2n-log4php | src/app/n2n/log4php/pattern/PatternParser.php | PatternParser.getConverter | private function getConverter($word, $info, $option) {
if (!isset($this->converterMap[$word])) {
throw new \n2n\log4php\LoggerException("Invalid keyword '%$word' in converison pattern. Ignoring keyword.");
}
$converterClass = $this->converterMap[$word];
if(!class_exists($converterClass)) {
throw... | php | private function getConverter($word, $info, $option) {
if (!isset($this->converterMap[$word])) {
throw new \n2n\log4php\LoggerException("Invalid keyword '%$word' in converison pattern. Ignoring keyword.");
}
$converterClass = $this->converterMap[$word];
if(!class_exists($converterClass)) {
throw... | [
"private",
"function",
"getConverter",
"(",
"$",
"word",
",",
"$",
"info",
",",
"$",
"option",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"converterMap",
"[",
"$",
"word",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"n2n",
"\\",
"lo... | Determines which converter to use based on the conversion word. Creates
an instance of the converter using the provided formatting info and
option and returns it.
@param string $word The conversion word.
@param \n2n\log4php\formatting\FormattingInfo $info Formatting info.
@param string $option Converter option.
@thro... | [
"Determines",
"which",
"converter",
"to",
"use",
"based",
"on",
"the",
"conversion",
"word",
".",
"Creates",
"an",
"instance",
"of",
"the",
"converter",
"using",
"the",
"provided",
"formatting",
"info",
"and",
"option",
"and",
"returns",
"it",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/pattern/PatternParser.php#L170-L186 |
225,666 | n2n/n2n-log4php | src/app/n2n/log4php/pattern/PatternParser.php | PatternParser.parseModifiers | private function parseModifiers($modifiers) {
$info = new \n2n\log4php\formatting\FormattingInfo();
// If no modifiers are given, return default values
if (empty($modifiers)) {
return $info;
}
// Validate
$pattern = '/^(-?[0-9]+)?\.?-?[0-9]+$/';
if (!preg_match($pattern, $modifiers)) {
... | php | private function parseModifiers($modifiers) {
$info = new \n2n\log4php\formatting\FormattingInfo();
// If no modifiers are given, return default values
if (empty($modifiers)) {
return $info;
}
// Validate
$pattern = '/^(-?[0-9]+)?\.?-?[0-9]+$/';
if (!preg_match($pattern, $modifiers)) {
... | [
"private",
"function",
"parseModifiers",
"(",
"$",
"modifiers",
")",
"{",
"$",
"info",
"=",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"formatting",
"\\",
"FormattingInfo",
"(",
")",
";",
"// If no modifiers are given, return default values\r",
"if",
"(",
"empty",... | Parses the formatting modifiers and produces the corresponding
\n2n\log4php\formatting\FormattingInfo object.
@param string $modifier
@return \n2n\log4php\formatting\FormattingInfo
@throws \n2n\log4php\LoggerException | [
"Parses",
"the",
"formatting",
"modifiers",
"and",
"produces",
"the",
"corresponding",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"formatting",
"\\",
"FormattingInfo",
"object",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/pattern/PatternParser.php#L207-L237 |
225,667 | sopinetchat/SopinetChatBundle | Service/ChatHelper.php | ChatHelper.getMyChats | public function getMyChats(Request $request){
/** @var LoginHelper $loginHelper */
$loginHelper = $this->container->get('sopinet_login_helper');
try {
$user = $loginHelper->getUser($request);
} catch(Exception $e) {
throw new Exception($e->getMessage());
... | php | public function getMyChats(Request $request){
/** @var LoginHelper $loginHelper */
$loginHelper = $this->container->get('sopinet_login_helper');
try {
$user = $loginHelper->getUser($request);
} catch(Exception $e) {
throw new Exception($e->getMessage());
... | [
"public",
"function",
"getMyChats",
"(",
"Request",
"$",
"request",
")",
"{",
"/** @var LoginHelper $loginHelper */",
"$",
"loginHelper",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'sopinet_login_helper'",
")",
";",
"try",
"{",
"$",
"user",
"=",
"... | Funcion para obtener mis chats
@param Request $request
@return array | [
"Funcion",
"para",
"obtener",
"mis",
"chats"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Service/ChatHelper.php#L129-L157 |
225,668 | SetBased/php-helper-code-store-php | src/PhpCodeStore.php | PhpCodeStore.indentationModeBlock | private function indentationModeBlock(string $line): int
{
$mode = 0;
if (substr($line, -1, 1)=='{')
{
$mode |= self::C_INDENT_INCREMENT_AFTER;
$this->defaultLevelIncrement();
}
if (substr($line, 0, 1)=='}')
{
$this->defaultLevelDecrement();
if ($this->defaultLevelI... | php | private function indentationModeBlock(string $line): int
{
$mode = 0;
if (substr($line, -1, 1)=='{')
{
$mode |= self::C_INDENT_INCREMENT_AFTER;
$this->defaultLevelIncrement();
}
if (substr($line, 0, 1)=='}')
{
$this->defaultLevelDecrement();
if ($this->defaultLevelI... | [
"private",
"function",
"indentationModeBlock",
"(",
"string",
"$",
"line",
")",
":",
"int",
"{",
"$",
"mode",
"=",
"0",
";",
"if",
"(",
"substr",
"(",
"$",
"line",
",",
"-",
"1",
",",
"1",
")",
"==",
"'{'",
")",
"{",
"$",
"mode",
"|=",
"self",
... | Returns the indentation mode based blocks of code.
@param string $line The line of code.
@return int | [
"Returns",
"the",
"indentation",
"mode",
"based",
"blocks",
"of",
"code",
"."
] | 954f8dcc47e12e5c2878ba7473f9feb9c3aaa643 | https://github.com/SetBased/php-helper-code-store-php/blob/954f8dcc47e12e5c2878ba7473f9feb9c3aaa643/src/PhpCodeStore.php#L92-L120 |
225,669 | SetBased/php-helper-code-store-php | src/PhpCodeStore.php | PhpCodeStore.indentationModeSwitch | private function indentationModeSwitch(string $line): int
{
$mode = 0;
if (substr($line, 0, 5)=='case ')
{
$mode |= self::C_INDENT_INCREMENT_AFTER;
}
if (substr($line, 0, 8)=='default:')
{
$this->defaultLevel[] = 0;
$mode |= self::C_INDENT_INCREMENT_AFTER;
}
if (s... | php | private function indentationModeSwitch(string $line): int
{
$mode = 0;
if (substr($line, 0, 5)=='case ')
{
$mode |= self::C_INDENT_INCREMENT_AFTER;
}
if (substr($line, 0, 8)=='default:')
{
$this->defaultLevel[] = 0;
$mode |= self::C_INDENT_INCREMENT_AFTER;
}
if (s... | [
"private",
"function",
"indentationModeSwitch",
"(",
"string",
"$",
"line",
")",
":",
"int",
"{",
"$",
"mode",
"=",
"0",
";",
"if",
"(",
"substr",
"(",
"$",
"line",
",",
"0",
",",
"5",
")",
"==",
"'case '",
")",
"{",
"$",
"mode",
"|=",
"self",
":... | Returns the indentation mode based on a line of code for switch statements.
@param string $line The line of code.
@return int | [
"Returns",
"the",
"indentation",
"mode",
"based",
"on",
"a",
"line",
"of",
"code",
"for",
"switch",
"statements",
"."
] | 954f8dcc47e12e5c2878ba7473f9feb9c3aaa643 | https://github.com/SetBased/php-helper-code-store-php/blob/954f8dcc47e12e5c2878ba7473f9feb9c3aaa643/src/PhpCodeStore.php#L130-L152 |
225,670 | SetBased/php-abc-form | src/Control/SimpleControl.php | SimpleControl.setLabelAttribute | public function setLabelAttribute(string $name, ?string $value)
{
if ($value==='' || $value===null)
{
unset($this->labelAttributes[$name]);
}
else
{
if ($name=='class' && isset($this->labelAttributes[$name]))
{
$this->labelAttributes[$name] .= ' ';
$this->labelAtt... | php | public function setLabelAttribute(string $name, ?string $value)
{
if ($value==='' || $value===null)
{
unset($this->labelAttributes[$name]);
}
else
{
if ($name=='class' && isset($this->labelAttributes[$name]))
{
$this->labelAttributes[$name] .= ' ';
$this->labelAtt... | [
"public",
"function",
"setLabelAttribute",
"(",
"string",
"$",
"name",
",",
"?",
"string",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"labelAttributes",
... | Sets the value of an attribute the label for this form control.
The attribute is unset when the value is one of:
<ul>
<li> null
<li> false
<li> ''.
</ul>
If attribute name is 'class' then the value is appended to the space separated list of classes.
@param string $name The name of the attribute.
@param string|... | [
"Sets",
"the",
"value",
"of",
"an",
"attribute",
"the",
"label",
"for",
"this",
"form",
"control",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/SimpleControl.php#L375-L393 |
225,671 | SetBased/php-abc-form | src/Control/SimpleControl.php | SimpleControl.getHtmlPrefixLabel | protected function getHtmlPrefixLabel(): string
{
// If a label must be generated make sure the form control and the label have matching 'id' and 'for' attributes.
if (isset($this->labelPosition))
{
if (!isset($this->attributes['id']))
{
$id = Html::getAutoId(... | php | protected function getHtmlPrefixLabel(): string
{
// If a label must be generated make sure the form control and the label have matching 'id' and 'for' attributes.
if (isset($this->labelPosition))
{
if (!isset($this->attributes['id']))
{
$id = Html::getAutoId(... | [
"protected",
"function",
"getHtmlPrefixLabel",
"(",
")",
":",
"string",
"{",
"// If a label must be generated make sure the form control and the label have matching 'id' and 'for' attributes.",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"labelPosition",
")",
")",
"{",
"if",
... | Returns HTML code for a label for this form control te be inserted before the HTML code of this form control.
@return string
@since 1.0.0
@api | [
"Returns",
"HTML",
"code",
"for",
"a",
"label",
"for",
"this",
"form",
"control",
"te",
"be",
"inserted",
"before",
"the",
"HTML",
"code",
"of",
"this",
"form",
"control",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/SimpleControl.php#L513-L541 |
225,672 | nails/module-currency | src/Service/Currency.php | Currency.getByIsoCode | public function getByIsoCode($sCode)
{
if (array_key_exists($sCode, $this->aSupportedCurrencies)) {
return $this->aSupportedCurrencies[$sCode];
} else {
throw new CurrencyException('"' . $sCode . '" is not a valid currency code.');
}
} | php | public function getByIsoCode($sCode)
{
if (array_key_exists($sCode, $this->aSupportedCurrencies)) {
return $this->aSupportedCurrencies[$sCode];
} else {
throw new CurrencyException('"' . $sCode . '" is not a valid currency code.');
}
} | [
"public",
"function",
"getByIsoCode",
"(",
"$",
"sCode",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"sCode",
",",
"$",
"this",
"->",
"aSupportedCurrencies",
")",
")",
"{",
"return",
"$",
"this",
"->",
"aSupportedCurrencies",
"[",
"$",
"sCode",
"]",... | Returns a currency by it's ISO 4217 code
@param string $sCode The currency to get
@return \stdClass
@throws CurrencyException | [
"Returns",
"a",
"currency",
"by",
"it",
"s",
"ISO",
"4217",
"code"
] | c2dc3ade2e03bc3a6cee749eceea84ca7ee5f1c6 | https://github.com/nails/module-currency/blob/c2dc3ade2e03bc3a6cee749eceea84ca7ee5f1c6/src/Service/Currency.php#L76-L83 |
225,673 | nails/module-currency | src/Service/Currency.php | Currency.format | public function format($sCode, $nValue, $bIncludeSymbol = true)
{
try {
$oCurrency = $this->getByIsoCode($sCode);
$sOut = number_format(
$nValue,
$oCurrency->decimal_precision,
$oCurrency->decimal_symbol,
$oCurrenc... | php | public function format($sCode, $nValue, $bIncludeSymbol = true)
{
try {
$oCurrency = $this->getByIsoCode($sCode);
$sOut = number_format(
$nValue,
$oCurrency->decimal_precision,
$oCurrency->decimal_symbol,
$oCurrenc... | [
"public",
"function",
"format",
"(",
"$",
"sCode",
",",
"$",
"nValue",
",",
"$",
"bIncludeSymbol",
"=",
"true",
")",
"{",
"try",
"{",
"$",
"oCurrency",
"=",
"$",
"this",
"->",
"getByIsoCode",
"(",
"$",
"sCode",
")",
";",
"$",
"sOut",
"=",
"number_for... | Formats a currency
@param string $sCode The currency to get
@param number $nValue The value
@param boolean $bIncludeSymbol Include the currency symbol
@return string | [
"Formats",
"a",
"currency"
] | c2dc3ade2e03bc3a6cee749eceea84ca7ee5f1c6 | https://github.com/nails/module-currency/blob/c2dc3ade2e03bc3a6cee749eceea84ca7ee5f1c6/src/Service/Currency.php#L94-L119 |
225,674 | bytic/Common | src/Controllers/Traits/HasView.php | HasView.initViewVars | protected function initViewVars($view)
{
$view->set('controller', $this->getName());
$view->set('action', $this->getAction());
if (method_exists($view, 'setRequest')) {
$view->setRequest($this->getRequest());
}
return $view;
} | php | protected function initViewVars($view)
{
$view->set('controller', $this->getName());
$view->set('action', $this->getAction());
if (method_exists($view, 'setRequest')) {
$view->setRequest($this->getRequest());
}
return $view;
} | [
"protected",
"function",
"initViewVars",
"(",
"$",
"view",
")",
"{",
"$",
"view",
"->",
"set",
"(",
"'controller'",
",",
"$",
"this",
"->",
"getName",
"(",
")",
")",
";",
"$",
"view",
"->",
"set",
"(",
"'action'",
",",
"$",
"this",
"->",
"getAction",... | Init View variables
@param View $view View Instance
@return View | [
"Init",
"View",
"variables"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Controllers/Traits/HasView.php#L97-L107 |
225,675 | bytic/Common | src/Controllers/Traits/HasView.php | HasView.initViewContentBlocks | protected function initViewContentBlocks($view)
{
$view->setBlock(
'content',
$this->getRequest()->getControllerName() . '/' . $this->getRequest()->getActionName()
);
return $view;
} | php | protected function initViewContentBlocks($view)
{
$view->setBlock(
'content',
$this->getRequest()->getControllerName() . '/' . $this->getRequest()->getActionName()
);
return $view;
} | [
"protected",
"function",
"initViewContentBlocks",
"(",
"$",
"view",
")",
"{",
"$",
"view",
"->",
"setBlock",
"(",
"'content'",
",",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getControllerName",
"(",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getRe... | Init View Content block
@param View $view View instance
@return View | [
"Init",
"View",
"Content",
"block"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Controllers/Traits/HasView.php#L123-L131 |
225,676 | SetBased/php-abc-table-detail | src/TableRow/NumericTableRow.php | NumericTableRow.addRow | public static function addRow(DetailTable $table, $header, ?string $value, string $format): void
{
if ($value!==null && $value!=='')
{
$table->addRow($header, ['class' => 'number'], sprintf($format, $value));
}
else
{
$table->addRow($header);
}
} | php | public static function addRow(DetailTable $table, $header, ?string $value, string $format): void
{
if ($value!==null && $value!=='')
{
$table->addRow($header, ['class' => 'number'], sprintf($format, $value));
}
else
{
$table->addRow($header);
}
} | [
"public",
"static",
"function",
"addRow",
"(",
"DetailTable",
"$",
"table",
",",
"$",
"header",
",",
"?",
"string",
"$",
"value",
",",
"string",
"$",
"format",
")",
":",
"void",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
"&&",
"$",
"value",
"!==",
... | Adds a row with a numeric value to a detail table.
@param DetailTable $table The detail table.
@param string|int|null $header The header text of this table row.
@param string|null $value The value.
@param string $format The formatting string (see sprintf). | [
"Adds",
"a",
"row",
"with",
"a",
"numeric",
"value",
"to",
"a",
"detail",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/TableRow/NumericTableRow.php#L21-L31 |
225,677 | czogori/Dami | src/Dami/Migration/MigrationNameParser.php | MigrationNameParser.setMigrationName | public function setMigrationName($migrationName)
{
$this->migrationName = $migrationName;
$migrationNameAsUnderscoreSrtring = S::underscored($migrationName);
$items = explode('_', $migrationNameAsUnderscoreSrtring);
if (count($items) >= 3) {
$this->action = in_array($item... | php | public function setMigrationName($migrationName)
{
$this->migrationName = $migrationName;
$migrationNameAsUnderscoreSrtring = S::underscored($migrationName);
$items = explode('_', $migrationNameAsUnderscoreSrtring);
if (count($items) >= 3) {
$this->action = in_array($item... | [
"public",
"function",
"setMigrationName",
"(",
"$",
"migrationName",
")",
"{",
"$",
"this",
"->",
"migrationName",
"=",
"$",
"migrationName",
";",
"$",
"migrationNameAsUnderscoreSrtring",
"=",
"S",
"::",
"underscored",
"(",
"$",
"migrationName",
")",
";",
"$",
... | Sets a migration name.
@param string $migrationName A migration name.
@return void | [
"Sets",
"a",
"migration",
"name",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/MigrationNameParser.php#L23-L37 |
225,678 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderSyslog.php | AppenderSyslog.append | public function append(\n2n\log4php\logging\LoggingEvent $event) {
$priority = $this->getSyslogPriority($event->getLevel());
$message = $this->layout->format($event);
openlog($this->ident, $this->intOption, $this->intFacility);
syslog($priority, $message);
closelog();
} | php | public function append(\n2n\log4php\logging\LoggingEvent $event) {
$priority = $this->getSyslogPriority($event->getLevel());
$message = $this->layout->format($event);
openlog($this->ident, $this->intOption, $this->intFacility);
syslog($priority, $message);
closelog();
} | [
"public",
"function",
"append",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"logging",
"\\",
"LoggingEvent",
"$",
"event",
")",
"{",
"$",
"priority",
"=",
"$",
"this",
"->",
"getSyslogPriority",
"(",
"$",
"event",
"->",
"getLevel",
"(",
")",
")",
";",
"$"... | Appends the event to syslog.
Log is opened and closed each time because if it is not closed, it
can cause the Apache httpd server to log to whatever ident/facility
was used in openlog().
@see http://www.php.net/manual/en/function.syslog.php#97843 | [
"Appends",
"the",
"event",
"to",
"syslog",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderSyslog.php#L246-L253 |
225,679 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderSyslog.php | AppenderSyslog.getSyslogPriority | private function getSyslogPriority(\n2n\log4php\LoggerLevel $level) {
if($this->overridePriority) {
return $this->intPriority;
}
return $level->getSyslogEquivalent();
} | php | private function getSyslogPriority(\n2n\log4php\LoggerLevel $level) {
if($this->overridePriority) {
return $this->intPriority;
}
return $level->getSyslogEquivalent();
} | [
"private",
"function",
"getSyslogPriority",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerLevel",
"$",
"level",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"overridePriority",
")",
"{",
"return",
"$",
"this",
"->",
"intPriority",
";",
"}",
"return",
"$",
"... | Determines which syslog priority to use based on the given level. | [
"Determines",
"which",
"syslog",
"priority",
"to",
"use",
"based",
"on",
"the",
"given",
"level",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderSyslog.php#L256-L261 |
225,680 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderSyslog.php | AppenderSyslog.parseOption | private function parseOption() {
$value = 0;
$options = explode('|', $this->option);
foreach($options as $option) {
if (!empty($option)) {
$constant = "LOG_" . trim($option);
if (defined($constant)) {
$value |= constant($constant);
} else {
throw new \n2n\log4php\LoggerExcepti... | php | private function parseOption() {
$value = 0;
$options = explode('|', $this->option);
foreach($options as $option) {
if (!empty($option)) {
$constant = "LOG_" . trim($option);
if (defined($constant)) {
$value |= constant($constant);
} else {
throw new \n2n\log4php\LoggerExcepti... | [
"private",
"function",
"parseOption",
"(",
")",
"{",
"$",
"value",
"=",
"0",
";",
"$",
"options",
"=",
"explode",
"(",
"'|'",
",",
"$",
"this",
"->",
"option",
")",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"option",
")",
"{",
"if",
"(",
"!... | Parses a syslog option string and returns the correspodning int value. | [
"Parses",
"a",
"syslog",
"option",
"string",
"and",
"returns",
"the",
"correspodning",
"int",
"value",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderSyslog.php#L264-L279 |
225,681 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderSyslog.php | AppenderSyslog.parseFacility | private function parseFacility() {
if (!empty($this->facility)) {
$constant = "LOG_" . trim($this->facility);
if (defined($constant)) {
return constant($constant);
} else {
throw new \n2n\log4php\LoggerException("log4php: Invalid syslog facility provided: {$this->facility}.", E_USER_WARNING)... | php | private function parseFacility() {
if (!empty($this->facility)) {
$constant = "LOG_" . trim($this->facility);
if (defined($constant)) {
return constant($constant);
} else {
throw new \n2n\log4php\LoggerException("log4php: Invalid syslog facility provided: {$this->facility}.", E_USER_WARNING)... | [
"private",
"function",
"parseFacility",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"facility",
")",
")",
"{",
"$",
"constant",
"=",
"\"LOG_\"",
".",
"trim",
"(",
"$",
"this",
"->",
"facility",
")",
";",
"if",
"(",
"defined",
"(... | Parses the facility string and returns the corresponding int value. | [
"Parses",
"the",
"facility",
"string",
"and",
"returns",
"the",
"corresponding",
"int",
"value",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderSyslog.php#L282-L291 |
225,682 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderSyslog.php | AppenderSyslog.parsePriority | private function parsePriority() {
if (!empty($this->priority)) {
$constant = "LOG_" . trim($this->priority);
if (defined($constant)) {
return constant($constant);
} else {
throw new \n2n\log4php\LoggerException("log4php: Invalid syslog priority provided: {$this->priority}.", E_USER_WARNING);
... | php | private function parsePriority() {
if (!empty($this->priority)) {
$constant = "LOG_" . trim($this->priority);
if (defined($constant)) {
return constant($constant);
} else {
throw new \n2n\log4php\LoggerException("log4php: Invalid syslog priority provided: {$this->priority}.", E_USER_WARNING);
... | [
"private",
"function",
"parsePriority",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"priority",
")",
")",
"{",
"$",
"constant",
"=",
"\"LOG_\"",
".",
"trim",
"(",
"$",
"this",
"->",
"priority",
")",
";",
"if",
"(",
"defined",
"(... | Parses the priority string and returns the corresponding int value. | [
"Parses",
"the",
"priority",
"string",
"and",
"returns",
"the",
"corresponding",
"int",
"value",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderSyslog.php#L294-L303 |
225,683 | fxpio/fxp-default-value | ObjectConfigBuilder.php | ObjectConfigBuilder.findProperties | protected function findProperties(\ReflectionClass $reflection): void
{
if (false !== $reflection->getParentClass()) {
$this->findProperties($reflection->getParentClass());
}
$this->properties = array_unique(array_merge($this->properties, array_keys($reflection->getDefaultProper... | php | protected function findProperties(\ReflectionClass $reflection): void
{
if (false !== $reflection->getParentClass()) {
$this->findProperties($reflection->getParentClass());
}
$this->properties = array_unique(array_merge($this->properties, array_keys($reflection->getDefaultProper... | [
"protected",
"function",
"findProperties",
"(",
"\\",
"ReflectionClass",
"$",
"reflection",
")",
":",
"void",
"{",
"if",
"(",
"false",
"!==",
"$",
"reflection",
"->",
"getParentClass",
"(",
")",
")",
"{",
"$",
"this",
"->",
"findProperties",
"(",
"$",
"ref... | Finds all properties in class.
@param \ReflectionClass $reflection | [
"Finds",
"all",
"properties",
"in",
"class",
"."
] | c045f5c7e3078377a092f197f8e5c633f5084091 | https://github.com/fxpio/fxp-default-value/blob/c045f5c7e3078377a092f197f8e5c633f5084091/ObjectConfigBuilder.php#L261-L268 |
225,684 | fxpio/fxp-default-value | ObjectConfigBuilder.php | ObjectConfigBuilder.findReflectionProperty | protected function findReflectionProperty($property, \ReflectionClass $reflection)
{
if ($reflection->hasProperty($property)) {
$refProp = $reflection->getProperty($property);
$refProp->setAccessible(true);
return $refProp;
}
if (false !== $reflection->g... | php | protected function findReflectionProperty($property, \ReflectionClass $reflection)
{
if ($reflection->hasProperty($property)) {
$refProp = $reflection->getProperty($property);
$refProp->setAccessible(true);
return $refProp;
}
if (false !== $reflection->g... | [
"protected",
"function",
"findReflectionProperty",
"(",
"$",
"property",
",",
"\\",
"ReflectionClass",
"$",
"reflection",
")",
"{",
"if",
"(",
"$",
"reflection",
"->",
"hasProperty",
"(",
"$",
"property",
")",
")",
"{",
"$",
"refProp",
"=",
"$",
"reflection"... | Finds the reflection property.
@param string $property
@param \ReflectionClass $reflection
@throws InvalidArgumentException When the property is not found
@return \ReflectionProperty | [
"Finds",
"the",
"reflection",
"property",
"."
] | c045f5c7e3078377a092f197f8e5c633f5084091 | https://github.com/fxpio/fxp-default-value/blob/c045f5c7e3078377a092f197f8e5c633f5084091/ObjectConfigBuilder.php#L280-L294 |
225,685 | Eve-PHP/Framework | src/Action/Json.php | Json.fail | protected function fail($message = null, $validation = null)
{
$this->trigger('json-fail', $this, $message, $validation);
$this->trigger('response-fail', $this, $message, $validation);
$json = array('error' => true);
if($message) {
$json['message'] = $message;
}... | php | protected function fail($message = null, $validation = null)
{
$this->trigger('json-fail', $this, $message, $validation);
$this->trigger('response-fail', $this, $message, $validation);
$json = array('error' => true);
if($message) {
$json['message'] = $message;
}... | [
"protected",
"function",
"fail",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"validation",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"'json-fail'",
",",
"$",
"this",
",",
"$",
"message",
",",
"$",
"validation",
")",
";",
"$",
"this",
... | Sets a fail format
@param string|null $message Any message to pass to the page
@param mixed $validation Field specific errors
@return string | [
"Sets",
"a",
"fail",
"format"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Action/Json.php#L32-L54 |
225,686 | Eve-PHP/Framework | src/Action/Json.php | Json.success | protected function success($results = null)
{
$this->trigger('json-success', $this, $results);
$this->trigger('response-success', $this, $results);
$json = array('error' => false);
if($results) {
$json['results'] = $results;
}
$body = json_encode($json,... | php | protected function success($results = null)
{
$this->trigger('json-success', $this, $results);
$this->trigger('response-success', $this, $results);
$json = array('error' => false);
if($results) {
$json['results'] = $results;
}
$body = json_encode($json,... | [
"protected",
"function",
"success",
"(",
"$",
"results",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"trigger",
"(",
"'json-success'",
",",
"$",
"this",
",",
"$",
"results",
")",
";",
"$",
"this",
"->",
"trigger",
"(",
"'response-success'",
",",
"$",
"th... | Sets a success format
@param mixed $results Data to be included in the success packet
@return string | [
"Sets",
"a",
"success",
"format"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Action/Json.php#L63-L81 |
225,687 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Console/Processor/InitProcessor.php | InitProcessor.initBundleDirectoryStructure | protected function initBundleDirectoryStructure(InputInterface $input, OutputInterface $output)
{
// Bootstrap SS so we can use module listing
$frameworkPath = $this->container->getParameter('behat.silverstripe_extension.framework_path');
$_GET['flush'] = 1;
require_once $frameworkPa... | php | protected function initBundleDirectoryStructure(InputInterface $input, OutputInterface $output)
{
// Bootstrap SS so we can use module listing
$frameworkPath = $this->container->getParameter('behat.silverstripe_extension.framework_path');
$_GET['flush'] = 1;
require_once $frameworkPa... | [
"protected",
"function",
"initBundleDirectoryStructure",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"// Bootstrap SS so we can use module listing",
"$",
"frameworkPath",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
... | Inits bundle directory structure
@param InputInterface $input
@param OutputInterface $output | [
"Inits",
"bundle",
"directory",
"structure"
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Console/Processor/InitProcessor.php#L62-L136 |
225,688 | Finesse/MiniDB | src/Parts/InsertTrait.php | InsertTrait.insert | public function insert(array $rows): int
{
try {
$query = (clone $this)->addInsert($rows)->apply($this->database->getTablePrefixer());
$statements = $this->database->getGrammar()->compileInsert($query);
$count = 0;
foreach ($statements as $statement) {
... | php | public function insert(array $rows): int
{
try {
$query = (clone $this)->addInsert($rows)->apply($this->database->getTablePrefixer());
$statements = $this->database->getGrammar()->compileInsert($query);
$count = 0;
foreach ($statements as $statement) {
... | [
"public",
"function",
"insert",
"(",
"array",
"$",
"rows",
")",
":",
"int",
"{",
"try",
"{",
"$",
"query",
"=",
"(",
"clone",
"$",
"this",
")",
"->",
"addInsert",
"(",
"$",
"rows",
")",
"->",
"apply",
"(",
"$",
"this",
"->",
"database",
"->",
"ge... | Inserts rows to a table. Doesn't modify itself.
@param mixed[][]|\Closure[][]|Query[][]|StatementInterface[][] $rows An array of rows. Each row is an associative
array where indexes are column names and values are cell values. Rows indexes must be strings.
@return int Number of inserted rows
@throws DatabaseException
... | [
"Inserts",
"rows",
"to",
"a",
"table",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/InsertTrait.php#L36-L51 |
225,689 | Finesse/MiniDB | src/Parts/InsertTrait.php | InsertTrait.insertGetId | public function insertGetId(array $row, string $sequence = null)
{
try {
$query = (clone $this)->addInsert([$row])->apply($this->database->getTablePrefixer());
$statements = $this->database->getGrammar()->compileInsert($query);
$id = null;
foreach ($statement... | php | public function insertGetId(array $row, string $sequence = null)
{
try {
$query = (clone $this)->addInsert([$row])->apply($this->database->getTablePrefixer());
$statements = $this->database->getGrammar()->compileInsert($query);
$id = null;
foreach ($statement... | [
"public",
"function",
"insertGetId",
"(",
"array",
"$",
"row",
",",
"string",
"$",
"sequence",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"query",
"=",
"(",
"clone",
"$",
"this",
")",
"->",
"addInsert",
"(",
"[",
"$",
"row",
"]",
")",
"->",
"apply",
... | Inserts a row to a table and returns the inserted row identifier. Doesn't modify itself.
@param mixed[]|\Closure[]|Query[]|StatementInterface[] $rows Row. Associative array where indexes are column
names and values are cell values. Rows indexes must be strings.
@param string|null $sequence Name of the sequence object ... | [
"Inserts",
"a",
"row",
"to",
"a",
"table",
"and",
"returns",
"the",
"inserted",
"row",
"identifier",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/InsertTrait.php#L64-L79 |
225,690 | Finesse/MiniDB | src/Parts/InsertTrait.php | InsertTrait.insertFromSelect | public function insertFromSelect($columns, $selectQuery = null): int
{
return (clone $this)->addInsertFromSelect($columns, $selectQuery)->insert([]);
} | php | public function insertFromSelect($columns, $selectQuery = null): int
{
return (clone $this)->addInsertFromSelect($columns, $selectQuery)->insert([]);
} | [
"public",
"function",
"insertFromSelect",
"(",
"$",
"columns",
",",
"$",
"selectQuery",
"=",
"null",
")",
":",
"int",
"{",
"return",
"(",
"clone",
"$",
"this",
")",
"->",
"addInsertFromSelect",
"(",
"$",
"columns",
",",
"$",
"selectQuery",
")",
"->",
"in... | Inserts rows to a table from a select query. Doesn't modify itself.
@param string[]|\Closure|Query|StatementInterface $columns The list of the columns to which the selected values
should be inserted. You may omit this argument and pass the $selectQuery argument instead.
@param \Closure|self|StatementInterface|null $se... | [
"Inserts",
"rows",
"to",
"a",
"table",
"from",
"a",
"select",
"query",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/InsertTrait.php#L92-L95 |
225,691 | chEbba/LogStock | src/Che/LogStock/Loader/HierarchicalNameLoader.php | HierarchicalNameLoader.getParentName | protected function getParentName($name)
{
return (string) substr($name, 0, (int) strrpos($name, $this->separator));
} | php | protected function getParentName($name)
{
return (string) substr($name, 0, (int) strrpos($name, $this->separator));
} | [
"protected",
"function",
"getParentName",
"(",
"$",
"name",
")",
"{",
"return",
"(",
"string",
")",
"substr",
"(",
"$",
"name",
",",
"0",
",",
"(",
"int",
")",
"strrpos",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"separator",
")",
")",
";",
"}"
] | Get name for parent loader
@param string $name Child logger name
@return string Parent name, an empty string is the top level parent | [
"Get",
"name",
"for",
"parent",
"loader"
] | 206ee26ed937b0f8857b63a527dd1a6020f52168 | https://github.com/chEbba/LogStock/blob/206ee26ed937b0f8857b63a527dd1a6020f52168/src/Che/LogStock/Loader/HierarchicalNameLoader.php#L90-L93 |
225,692 | stubbles/stubbles-input | src/main/php/broker/TargetMethod.php | TargetMethod.invoke | public function invoke($object, $value)
{
if (null !== $value) {
$this->method->invoke($object, $value);
}
} | php | public function invoke($object, $value)
{
if (null !== $value) {
$this->method->invoke($object, $value);
}
} | [
"public",
"function",
"invoke",
"(",
"$",
"object",
",",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"method",
"->",
"invoke",
"(",
"$",
"object",
",",
"$",
"value",
")",
";",
"}",
"}"
] | passes procured value to the instance
@api
@param object $object instance to invoke the method on
@param mixed $value value to pass to the method | [
"passes",
"procured",
"value",
"to",
"the",
"instance"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/TargetMethod.php#L140-L145 |
225,693 | railken/amethyst-user | src/Repositories/UserRepository.php | UserRepository.findAllToRefreshToken | public function findAllToRefreshToken(bool $force = false)
{
$query = $this->newQuery();
return $force ? $query->get() : $query->whereNull('token')->get();
} | php | public function findAllToRefreshToken(bool $force = false)
{
$query = $this->newQuery();
return $force ? $query->get() : $query->whereNull('token')->get();
} | [
"public",
"function",
"findAllToRefreshToken",
"(",
"bool",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"newQuery",
"(",
")",
";",
"return",
"$",
"force",
"?",
"$",
"query",
"->",
"get",
"(",
")",
":",
"$",
"query",
... | Find all user that have a null token.
@param bool $force
@return \Illuminate\Support\Collection | [
"Find",
"all",
"user",
"that",
"have",
"a",
"null",
"token",
"."
] | ab95c6298219fe17bc69c719adf0eeb6c304e401 | https://github.com/railken/amethyst-user/blob/ab95c6298219fe17bc69c719adf0eeb6c304e401/src/Repositories/UserRepository.php#L42-L47 |
225,694 | kaystrobach/FLOW.Custom | Classes/ViewHelpers/SurfReleaseViewHelper.php | SurfReleaseViewHelper.render | public function render($format = 'd.m.Y H:i:s') {
$output = $this->getContext() . ': ';
$date = $this->extractDateFromRevisionFile();
if ($date === null) {
$date = $this->extractDateFromSurfPath();
}
if ($date === null) {
$date = new \DateTime('now');
}
$output.=... | php | public function render($format = 'd.m.Y H:i:s') {
$output = $this->getContext() . ': ';
$date = $this->extractDateFromRevisionFile();
if ($date === null) {
$date = $this->extractDateFromSurfPath();
}
if ($date === null) {
$date = new \DateTime('now');
}
$output.=... | [
"public",
"function",
"render",
"(",
"$",
"format",
"=",
"'d.m.Y H:i:s'",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"getContext",
"(",
")",
".",
"': '",
";",
"$",
"date",
"=",
"$",
"this",
"->",
"extractDateFromRevisionFile",
"(",
")",
";",
"if"... | Show release string based on symlink
@param string $format
@return string
@throws \Exception | [
"Show",
"release",
"string",
"based",
"on",
"symlink"
] | 873001a46fa0dfbc426edd74af1841cfa7bcf1b9 | https://github.com/kaystrobach/FLOW.Custom/blob/873001a46fa0dfbc426edd74af1841cfa7bcf1b9/Classes/ViewHelpers/SurfReleaseViewHelper.php#L17-L31 |
225,695 | cmsgears/module-cms | common/models/traits/resources/PageContentTrait.php | PageContentTrait.isPublished | public function isPublished() {
$user = Yii::$app->core->getUser();
if( isset( $user ) ) {
// Always published for owner
if( $this->createdBy == $user->id ) {
return true;
}
// TODO: Add code for secured visibility with password match
// Visible to logged in users in strictly protected mode... | php | public function isPublished() {
$user = Yii::$app->core->getUser();
if( isset( $user ) ) {
// Always published for owner
if( $this->createdBy == $user->id ) {
return true;
}
// TODO: Add code for secured visibility with password match
// Visible to logged in users in strictly protected mode... | [
"public",
"function",
"isPublished",
"(",
")",
"{",
"$",
"user",
"=",
"Yii",
"::",
"$",
"app",
"->",
"core",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"user",
")",
")",
"{",
"// Always published for owner",
"if",
"(",
"$",
"this",... | Check whether content is published. To consider a model as published, it must
be publicly visible in either active or frozen status.
@return boolean | [
"Check",
"whether",
"content",
"is",
"published",
".",
"To",
"consider",
"a",
"model",
"as",
"published",
"it",
"must",
"be",
"publicly",
"visible",
"in",
"either",
"active",
"or",
"frozen",
"status",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/models/traits/resources/PageContentTrait.php#L68-L91 |
225,696 | SetBased/php-abc-form | src/Cleaner/AmbiguityCleaner.php | AmbiguityCleaner.clean | public function clean($value)
{
// Return null for empty strings.
if ($value==='' || $value===null || $value===false)
{
return null;
}
// Replace all ambiguous characters.
$tmp = $value;
foreach ($this->ambiguities as $unambiguity => $ambiguities)
{
foreach ($ambiguities a... | php | public function clean($value)
{
// Return null for empty strings.
if ($value==='' || $value===null || $value===false)
{
return null;
}
// Replace all ambiguous characters.
$tmp = $value;
foreach ($this->ambiguities as $unambiguity => $ambiguities)
{
foreach ($ambiguities a... | [
"public",
"function",
"clean",
"(",
"$",
"value",
")",
"{",
"// Return null for empty strings.",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"// Replac... | Replaces all ambiguous characters in a submitted values with the intended characters.
@param string|null $value The submitted value.
@return string|null
@since 1.0.0
@api | [
"Replaces",
"all",
"ambiguous",
"characters",
"in",
"a",
"submitted",
"values",
"with",
"the",
"intended",
"characters",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Cleaner/AmbiguityCleaner.php#L158-L184 |
225,697 | fxpio/fxp-default-value | ResolvedObjectType.php | ResolvedObjectType.doActionObject | protected function doActionObject($method, ObjectBuilderInterface $builder, array $options): void
{
if (null !== $this->parent) {
$this->parent->{$method}($builder, $options);
}
$this->innerType->{$method}($builder, $options);
foreach ($this->typeExtensions as $extensio... | php | protected function doActionObject($method, ObjectBuilderInterface $builder, array $options): void
{
if (null !== $this->parent) {
$this->parent->{$method}($builder, $options);
}
$this->innerType->{$method}($builder, $options);
foreach ($this->typeExtensions as $extensio... | [
"protected",
"function",
"doActionObject",
"(",
"$",
"method",
",",
"ObjectBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
":",
"void",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"parent",
")",
"{",
"$",
"this",
"->",
"parent... | Build or finish the object.
@param string $method The buildObject or finishObject method name
@param ObjectBuilderInterface $builder
@param array $options | [
"Build",
"or",
"finish",
"the",
"object",
"."
] | c045f5c7e3078377a092f197f8e5c633f5084091 | https://github.com/fxpio/fxp-default-value/blob/c045f5c7e3078377a092f197f8e5c633f5084091/ResolvedObjectType.php#L180-L192 |
225,698 | peterkahl/Chinese-Master | src/ChineseMaster.php | ChineseMaster.isTraditional | public static function isTraditional($str) {
if (empty($str)) {
throw new Exception('Argument str cannot be empty');
}
$ords = self::utf8ToUnicode($str);
foreach ($ords as $val) {
if (!empty($val) && array_key_exists($val, self::$trad2simple)) {
return true;
}
}
return ... | php | public static function isTraditional($str) {
if (empty($str)) {
throw new Exception('Argument str cannot be empty');
}
$ords = self::utf8ToUnicode($str);
foreach ($ords as $val) {
if (!empty($val) && array_key_exists($val, self::$trad2simple)) {
return true;
}
}
return ... | [
"public",
"static",
"function",
"isTraditional",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"str",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Argument str cannot be empty'",
")",
";",
"}",
"$",
"ords",
"=",
"self",
"::",
"utf8ToUnic... | Is string made up of traditional Chinese characters? At least one character.
@param string | [
"Is",
"string",
"made",
"up",
"of",
"traditional",
"Chinese",
"characters?",
"At",
"least",
"one",
"character",
"."
] | 31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c | https://github.com/peterkahl/Chinese-Master/blob/31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c/src/ChineseMaster.php#L37-L48 |
225,699 | peterkahl/Chinese-Master | src/ChineseMaster.php | ChineseMaster.trad2simp | public static function trad2simp($str) {
if (empty($str)) {
throw new Exception('Argument str cannot be empty');
}
$ords = self::utf8ToUnicode($str);
foreach ($ords as $k => $val) {
if ($val !== false && array_key_exists($val, self::$trad2simple)) {
$ords[$k] = self::$trad2simple[$va... | php | public static function trad2simp($str) {
if (empty($str)) {
throw new Exception('Argument str cannot be empty');
}
$ords = self::utf8ToUnicode($str);
foreach ($ords as $k => $val) {
if ($val !== false && array_key_exists($val, self::$trad2simple)) {
$ords[$k] = self::$trad2simple[$va... | [
"public",
"static",
"function",
"trad2simp",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"str",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Argument str cannot be empty'",
")",
";",
"}",
"$",
"ords",
"=",
"self",
"::",
"utf8ToUnicode"... | Converts traditional to simplified.
@param string | [
"Converts",
"traditional",
"to",
"simplified",
"."
] | 31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c | https://github.com/peterkahl/Chinese-Master/blob/31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c/src/ChineseMaster.php#L56-L70 |
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.