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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
204,400 | ntentan/atiaa | src/Descriptor.php | Descriptor.describe | public function describe()
{
$defaultSchema = $this->driver->getDefaultSchema();
$description = [
'schemata' => [],
];
$schemata = $this->getSchemata();
foreach ($schemata as $schema) {
if ($schema['name'] == $defaultSchema) {
$descri... | php | public function describe()
{
$defaultSchema = $this->driver->getDefaultSchema();
$description = [
'schemata' => [],
];
$schemata = $this->getSchemata();
foreach ($schemata as $schema) {
if ($schema['name'] == $defaultSchema) {
$descri... | [
"public",
"function",
"describe",
"(",
")",
"{",
"$",
"defaultSchema",
"=",
"$",
"this",
"->",
"driver",
"->",
"getDefaultSchema",
"(",
")",
";",
"$",
"description",
"=",
"[",
"'schemata'",
"=>",
"[",
"]",
",",
"]",
";",
"$",
"schemata",
"=",
"$",
"t... | Returns the description of the database as an array.
@return array | [
"Returns",
"the",
"description",
"of",
"the",
"database",
"as",
"an",
"array",
"."
] | 2604fea83e9643adaa8d1fb65443fb214cfa60e6 | https://github.com/ntentan/atiaa/blob/2604fea83e9643adaa8d1fb65443fb214cfa60e6/src/Descriptor.php#L235-L256 |
204,401 | ntentan/atiaa | src/Descriptor.php | Descriptor.throwTableExceptions | private function throwTableExceptions($tables, $requestedTables)
{
$foundTables = [];
foreach ($tables as $table) {
$foundTables[] = $table['name'];
}
foreach ($requestedTables as $requestedTable) {
if (array_search($requestedTable, $foundTables) === false) {... | php | private function throwTableExceptions($tables, $requestedTables)
{
$foundTables = [];
foreach ($tables as $table) {
$foundTables[] = $table['name'];
}
foreach ($requestedTables as $requestedTable) {
if (array_search($requestedTable, $foundTables) === false) {... | [
"private",
"function",
"throwTableExceptions",
"(",
"$",
"tables",
",",
"$",
"requestedTables",
")",
"{",
"$",
"foundTables",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"tables",
"as",
"$",
"table",
")",
"{",
"$",
"foundTables",
"[",
"]",
"=",
"$",
"tabl... | Throws exceptions for which are found in the list of requested tables
but not found in the list of found tables.
@param array $tables
@param array $requestedTables
@throws exceptions\TableNotFoundException | [
"Throws",
"exceptions",
"for",
"which",
"are",
"found",
"in",
"the",
"list",
"of",
"requested",
"tables",
"but",
"not",
"found",
"in",
"the",
"list",
"of",
"found",
"tables",
"."
] | 2604fea83e9643adaa8d1fb65443fb214cfa60e6 | https://github.com/ntentan/atiaa/blob/2604fea83e9643adaa8d1fb65443fb214cfa60e6/src/Descriptor.php#L272-L287 |
204,402 | rnijveld/pgt | lib/Pgettext/Po.php | Po.toFile | public static function toFile(Stringset $set, $filename)
{
try {
$str = self::toString($set, $options);
if (!file_exists($filename) || is_writable($filename)) {
file_put_contents($filename, $str);
} else {
throw new Exception("Cannot write ... | php | public static function toFile(Stringset $set, $filename)
{
try {
$str = self::toString($set, $options);
if (!file_exists($filename) || is_writable($filename)) {
file_put_contents($filename, $str);
} else {
throw new Exception("Cannot write ... | [
"public",
"static",
"function",
"toFile",
"(",
"Stringset",
"$",
"set",
",",
"$",
"filename",
")",
"{",
"try",
"{",
"$",
"str",
"=",
"self",
"::",
"toString",
"(",
"$",
"set",
",",
"$",
"options",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
... | Takes a Stringset and a filename and writes a po formatted file.
@param Stringset $set
@param string $filename
@return void | [
"Takes",
"a",
"Stringset",
"and",
"a",
"filename",
"and",
"writes",
"a",
"po",
"formatted",
"file",
"."
] | 9d64b4858438a9833065265c2e6d2db94b7e6fcd | https://github.com/rnijveld/pgt/blob/9d64b4858438a9833065265c2e6d2db94b7e6fcd/lib/Pgettext/Po.php#L34-L46 |
204,403 | rnijveld/pgt | lib/Pgettext/Po.php | Po.toString | public static function toString(Stringset $set)
{
$str = '';
for ($i = 0; $i < $set->size(); $i += 1) {
$item = $set->item($i);
if (count($item['flags']) > 0) {
$str .= "#, " . implode(", ", $item['flags']) . "\n";
}
if ($item['context... | php | public static function toString(Stringset $set)
{
$str = '';
for ($i = 0; $i < $set->size(); $i += 1) {
$item = $set->item($i);
if (count($item['flags']) > 0) {
$str .= "#, " . implode(", ", $item['flags']) . "\n";
}
if ($item['context... | [
"public",
"static",
"function",
"toString",
"(",
"Stringset",
"$",
"set",
")",
"{",
"$",
"str",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"set",
"->",
"size",
"(",
")",
";",
"$",
"i",
"+=",
"1",
")",
"{",
"$",... | Takes a Stringset and an array of options and creates a po formatted string.
@param Stringset $set
@return string | [
"Takes",
"a",
"Stringset",
"and",
"an",
"array",
"of",
"options",
"and",
"creates",
"a",
"po",
"formatted",
"string",
"."
] | 9d64b4858438a9833065265c2e6d2db94b7e6fcd | https://github.com/rnijveld/pgt/blob/9d64b4858438a9833065265c2e6d2db94b7e6fcd/lib/Pgettext/Po.php#L53-L82 |
204,404 | rnijveld/pgt | lib/Pgettext/Po.php | Po.escapeString | private static function escapeString($str)
{
if (strlen($str) === 0) {
return $str;
}
$str = str_replace(array(
"\r",
"\t",
"\\",
"\$",
"\v",
"\e",
"\f",
"\""
), array(
... | php | private static function escapeString($str)
{
if (strlen($str) === 0) {
return $str;
}
$str = str_replace(array(
"\r",
"\t",
"\\",
"\$",
"\v",
"\e",
"\f",
"\""
), array(
... | [
"private",
"static",
"function",
"escapeString",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"str",
")",
"===",
"0",
")",
"{",
"return",
"$",
"str",
";",
"}",
"$",
"str",
"=",
"str_replace",
"(",
"array",
"(",
"\"\\r\"",
",",
"\"\\t\"... | Adds escapes to characters that are in some way special.
@param string $str
@return string | [
"Adds",
"escapes",
"to",
"characters",
"that",
"are",
"in",
"some",
"way",
"special",
"."
] | 9d64b4858438a9833065265c2e6d2db94b7e6fcd | https://github.com/rnijveld/pgt/blob/9d64b4858438a9833065265c2e6d2db94b7e6fcd/lib/Pgettext/Po.php#L89-L130 |
204,405 | rnijveld/pgt | lib/Pgettext/Po.php | Po.fromString | public static function fromString($str)
{
$stringset = new Stringset();
$entry = array();
$state = null;
$line = 1;
foreach (explode("\n", $str) as $line) {
$line = trim($line);
if (strlen($line) === 0) {
if (count($entry) > 0) {
... | php | public static function fromString($str)
{
$stringset = new Stringset();
$entry = array();
$state = null;
$line = 1;
foreach (explode("\n", $str) as $line) {
$line = trim($line);
if (strlen($line) === 0) {
if (count($entry) > 0) {
... | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"str",
")",
"{",
"$",
"stringset",
"=",
"new",
"Stringset",
"(",
")",
";",
"$",
"entry",
"=",
"array",
"(",
")",
";",
"$",
"state",
"=",
"null",
";",
"$",
"line",
"=",
"1",
";",
"foreach",
"... | Takes a string in the format of a po file and returns a Stringset
@param string $str
@return Stringset | [
"Takes",
"a",
"string",
"in",
"the",
"format",
"of",
"a",
"po",
"file",
"and",
"returns",
"a",
"Stringset"
] | 9d64b4858438a9833065265c2e6d2db94b7e6fcd | https://github.com/rnijveld/pgt/blob/9d64b4858438a9833065265c2e6d2db94b7e6fcd/lib/Pgettext/Po.php#L137-L185 |
204,406 | rnijveld/pgt | lib/Pgettext/Po.php | Po.parseString | private static function parseString($str)
{
if ($str[0] !== '"' || $str[strlen($str) - 1] !== '"') {
throw new Exception("Invalid string delimiters");
}
$result = '';
$start = str_split(substr($str, 1, -1), 1);
$escaped = false;
$data = null;
for... | php | private static function parseString($str)
{
if ($str[0] !== '"' || $str[strlen($str) - 1] !== '"') {
throw new Exception("Invalid string delimiters");
}
$result = '';
$start = str_split(substr($str, 1, -1), 1);
$escaped = false;
$data = null;
for... | [
"private",
"static",
"function",
"parseString",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"$",
"str",
"[",
"0",
"]",
"!==",
"'\"'",
"||",
"$",
"str",
"[",
"strlen",
"(",
"$",
"str",
")",
"-",
"1",
"]",
"!==",
"'\"'",
")",
"{",
"throw",
"new",
"Exce... | PHP String parsing without using eval.
@param string $str Unparsed double-quoted string with escape sequences.
@return string | [
"PHP",
"String",
"parsing",
"without",
"using",
"eval",
"."
] | 9d64b4858438a9833065265c2e6d2db94b7e6fcd | https://github.com/rnijveld/pgt/blob/9d64b4858438a9833065265c2e6d2db94b7e6fcd/lib/Pgettext/Po.php#L192-L266 |
204,407 | newestindustry/ginger-rest | src/Ginger/Request.php | Request.go | public function go() {
if ($this->action == "options") {
$file = "options" . $this->getExtension();
} else {
// Check if handler file exists
if ($this->route->route == "/") {
$file = $this->getAction() . $this->getExtension();
} else {
$file = $this->route->resource . "/" . $this->getAction() . ... | php | public function go() {
if ($this->action == "options") {
$file = "options" . $this->getExtension();
} else {
// Check if handler file exists
if ($this->route->route == "/") {
$file = $this->getAction() . $this->getExtension();
} else {
$file = $this->route->resource . "/" . $this->getAction() . ... | [
"public",
"function",
"go",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"action",
"==",
"\"options\"",
")",
"{",
"$",
"file",
"=",
"\"options\"",
".",
"$",
"this",
"->",
"getExtension",
"(",
")",
";",
"}",
"else",
"{",
"// Check if handler file exists",... | Load file and dispatch to response | [
"Load",
"file",
"and",
"dispatch",
"to",
"response"
] | 482b77dc122a60ab0bf143a3c4a1e67168985c83 | https://github.com/newestindustry/ginger-rest/blob/482b77dc122a60ab0bf143a3c4a1e67168985c83/src/Ginger/Request.php#L101-L121 |
204,408 | newestindustry/ginger-rest | src/Ginger/Request.php | Request.getAction | public function getAction() {
if ($this->action) {
return $this->action;
} else {
$action = "index";
switch ($_SERVER['REQUEST_METHOD']) {
case "GET":
if (count($this->getFilterParameters()) == 0) {
$action = "index";
} else {
$action = "get";
}
break;
case "POST":
... | php | public function getAction() {
if ($this->action) {
return $this->action;
} else {
$action = "index";
switch ($_SERVER['REQUEST_METHOD']) {
case "GET":
if (count($this->getFilterParameters()) == 0) {
$action = "index";
} else {
$action = "get";
}
break;
case "POST":
... | [
"public",
"function",
"getAction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"action",
")",
"{",
"return",
"$",
"this",
"->",
"action",
";",
"}",
"else",
"{",
"$",
"action",
"=",
"\"index\"",
";",
"switch",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METH... | Return current action
@return string | [
"Return",
"current",
"action"
] | 482b77dc122a60ab0bf143a3c4a1e67168985c83 | https://github.com/newestindustry/ginger-rest/blob/482b77dc122a60ab0bf143a3c4a1e67168985c83/src/Ginger/Request.php#L195-L230 |
204,409 | amarcinkowski/hospitalplugin | src/Twig/GetPropertiesExtension.php | GetPropertiesExtension.getProps | private static function getProps($class)
{
if ($class == NULL) {
return array();
}
$class = new \ReflectionClass($class);
$properties = array_filter($class->getProperties(), function ($prop) use($class)
{
return $prop->getDeclaringClass()->name == $cla... | php | private static function getProps($class)
{
if ($class == NULL) {
return array();
}
$class = new \ReflectionClass($class);
$properties = array_filter($class->getProperties(), function ($prop) use($class)
{
return $prop->getDeclaringClass()->name == $cla... | [
"private",
"static",
"function",
"getProps",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"class",
"==",
"NULL",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
... | return props of a class
@param unknown $class
@return boolean|multitype: | [
"return",
"props",
"of",
"a",
"class"
] | acdc2be5157abfbdcafb4dcf6c6ba505e291263f | https://github.com/amarcinkowski/hospitalplugin/blob/acdc2be5157abfbdcafb4dcf6c6ba505e291263f/src/Twig/GetPropertiesExtension.php#L22-L33 |
204,410 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.createService | private function createService(stdClass $serviceData)
{
$this->comment('');
$this->comment('*************************************');
$this->comment('* Service creation *');
$this->comment('*************************************');
$this->comment($serviceData->... | php | private function createService(stdClass $serviceData)
{
$this->comment('');
$this->comment('*************************************');
$this->comment('* Service creation *');
$this->comment('*************************************');
$this->comment($serviceData->... | [
"private",
"function",
"createService",
"(",
"stdClass",
"$",
"serviceData",
")",
"{",
"$",
"this",
"->",
"comment",
"(",
"''",
")",
";",
"$",
"this",
"->",
"comment",
"(",
"'*************************************'",
")",
";",
"$",
"this",
"->",
"comment",
"(... | Generating service information
@param $serviceData | [
"Generating",
"service",
"information"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L79-L121 |
204,411 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.loadConfiguration | private function loadConfiguration()
{
$allFiles = File::allFiles('_automate');
foreach ( $allFiles as $file )
if( strpos((string)$file, '.done') === false )
$this->configurationData[] = $this->optimizeData($file);
} | php | private function loadConfiguration()
{
$allFiles = File::allFiles('_automate');
foreach ( $allFiles as $file )
if( strpos((string)$file, '.done') === false )
$this->configurationData[] = $this->optimizeData($file);
} | [
"private",
"function",
"loadConfiguration",
"(",
")",
"{",
"$",
"allFiles",
"=",
"File",
"::",
"allFiles",
"(",
"'_automate'",
")",
";",
"foreach",
"(",
"$",
"allFiles",
"as",
"$",
"file",
")",
"if",
"(",
"strpos",
"(",
"(",
"string",
")",
"$",
"file",... | Loading configuration files
@return this | [
"Loading",
"configuration",
"files"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L128-L136 |
204,412 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.checkPackage | private function checkPackage(stdClass $item)
{
if( ! file_exists($item->rootDirectory) )
$this->abort('Package ' . $item->directory . ' not existing, please create a repository and launch "php artisan hc:new-package" command');
} | php | private function checkPackage(stdClass $item)
{
if( ! file_exists($item->rootDirectory) )
$this->abort('Package ' . $item->directory . ' not existing, please create a repository and launch "php artisan hc:new-package" command');
} | [
"private",
"function",
"checkPackage",
"(",
"stdClass",
"$",
"item",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"item",
"->",
"rootDirectory",
")",
")",
"$",
"this",
"->",
"abort",
"(",
"'Package '",
".",
"$",
"item",
"->",
"directory",
".",
"'... | Checking package existence
@param $item | [
"Checking",
"package",
"existence"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L169-L173 |
204,413 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.executeAfterAbort | protected function executeAfterAbort()
{
/*foreach ($this->originalFiles as $value)
{
$this->file->put($value['path'], $value['content']);
$this->comment('Restored: ' . $value['path']);
}*/
foreach ( $this->createdFiles as $value ) {
File::delete(... | php | protected function executeAfterAbort()
{
/*foreach ($this->originalFiles as $value)
{
$this->file->put($value['path'], $value['content']);
$this->comment('Restored: ' . $value['path']);
}*/
foreach ( $this->createdFiles as $value ) {
File::delete(... | [
"protected",
"function",
"executeAfterAbort",
"(",
")",
"{",
"/*foreach ($this->originalFiles as $value)\n {\n $this->file->put($value['path'], $value['content']);\n $this->comment('Restored: ' . $value['path']);\n }*/",
"foreach",
"(",
"$",
"this",
"->",
... | Restoring changed files after the abort
Deleting create files
@return this | [
"Restoring",
"changed",
"files",
"after",
"the",
"abort",
"Deleting",
"create",
"files"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L181-L193 |
204,414 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.updateActions | private function updateActions(stdClass $config, stdClass $serviceData)
{
$servicePermissions = [
"name" => "admin." . $serviceData->serviceRouteName,
"controller" => $serviceData->controllerNamespace . '\\' . $serviceData->controllerName,
"actions" => [
... | php | private function updateActions(stdClass $config, stdClass $serviceData)
{
$servicePermissions = [
"name" => "admin." . $serviceData->serviceRouteName,
"controller" => $serviceData->controllerNamespace . '\\' . $serviceData->controllerName,
"actions" => [
... | [
"private",
"function",
"updateActions",
"(",
"stdClass",
"$",
"config",
",",
"stdClass",
"$",
"serviceData",
")",
"{",
"$",
"servicePermissions",
"=",
"[",
"\"name\"",
"=>",
"\"admin.\"",
".",
"$",
"serviceData",
"->",
"serviceRouteName",
",",
"\"controller\"",
... | Updating service actions
@param $config
@param $serviceData
@return null | [
"Updating",
"service",
"actions"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L221-L255 |
204,415 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.updateRolesActions | private function updateRolesActions(stdClass $config, stdClass $serviceData)
{
$rolesActions = [
"project-admin" =>
[$serviceData->aclPrefix . "_list",
$serviceData->aclPrefix . "_create",
$serviceData->aclPrefix . "_update",
... | php | private function updateRolesActions(stdClass $config, stdClass $serviceData)
{
$rolesActions = [
"project-admin" =>
[$serviceData->aclPrefix . "_list",
$serviceData->aclPrefix . "_create",
$serviceData->aclPrefix . "_update",
... | [
"private",
"function",
"updateRolesActions",
"(",
"stdClass",
"$",
"config",
",",
"stdClass",
"$",
"serviceData",
")",
"{",
"$",
"rolesActions",
"=",
"[",
"\"project-admin\"",
"=>",
"[",
"$",
"serviceData",
"->",
"aclPrefix",
".",
"\"_list\"",
",",
"$",
"servi... | Updating roles actions
@param $config
@param $serviceData
@return stdClass | [
"Updating",
"roles",
"actions"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L264-L281 |
204,416 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.updateMenu | private function updateMenu(stdClass $config, stdClass $serviceData)
{
$menuItem = [
"route" => 'admin.' . $serviceData->serviceRouteName . '.index',
"translation" => $serviceData->translationsLocation . '.page_title',
"icon" => $serviceData->serviceIco... | php | private function updateMenu(stdClass $config, stdClass $serviceData)
{
$menuItem = [
"route" => 'admin.' . $serviceData->serviceRouteName . '.index',
"translation" => $serviceData->translationsLocation . '.page_title',
"icon" => $serviceData->serviceIco... | [
"private",
"function",
"updateMenu",
"(",
"stdClass",
"$",
"config",
",",
"stdClass",
"$",
"serviceData",
")",
"{",
"$",
"menuItem",
"=",
"[",
"\"route\"",
"=>",
"'admin.'",
".",
"$",
"serviceData",
"->",
"serviceRouteName",
".",
"'.index'",
",",
"\"translatio... | Updating menu parameter
@param $config
@param $serviceData
@return null | [
"Updating",
"menu",
"parameter"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L300-L331 |
204,417 | interactivesolutions/honeycomb-scripts | src/app/commands/HCNewService.php | HCNewService.updateFormManager | private function updateFormManager(stdClass $config, stdClass $serviceData)
{
$config->formData = json_decode(json_encode($config->formData), true);
if( ! isset($config->formData[$serviceData->formID]) )
$config->formData[$serviceData->formID] = $serviceData->formNameSpace . '\\' . $ser... | php | private function updateFormManager(stdClass $config, stdClass $serviceData)
{
$config->formData = json_decode(json_encode($config->formData), true);
if( ! isset($config->formData[$serviceData->formID]) )
$config->formData[$serviceData->formID] = $serviceData->formNameSpace . '\\' . $ser... | [
"private",
"function",
"updateFormManager",
"(",
"stdClass",
"$",
"config",
",",
"stdClass",
"$",
"serviceData",
")",
"{",
"$",
"config",
"->",
"formData",
"=",
"json_decode",
"(",
"json_encode",
"(",
"$",
"config",
"->",
"formData",
")",
",",
"true",
")",
... | Updating form manager
@param $config
@param $serviceData
@return mixed | [
"Updating",
"form",
"manager"
] | be2428ded5219dc612ecc51f43aa4dedff3d034d | https://github.com/interactivesolutions/honeycomb-scripts/blob/be2428ded5219dc612ecc51f43aa4dedff3d034d/src/app/commands/HCNewService.php#L341-L349 |
204,418 | Synapse-Cmf/synapse-cmf | src/Synapse/Cmf/Framework/Theme/Variation/Entity/Variation.php | Variation.getConfiguration | public function getConfiguration($namespace, $element, $key, $default = null)
{
$propertyPath = sprintf('[%s][%s][%s]', $namespace, $element, $key);
if ($value = $this->propertyAccessor->getValue($this->configurations, $propertyPath)) {
return $value;
}
return $default;... | php | public function getConfiguration($namespace, $element, $key, $default = null)
{
$propertyPath = sprintf('[%s][%s][%s]', $namespace, $element, $key);
if ($value = $this->propertyAccessor->getValue($this->configurations, $propertyPath)) {
return $value;
}
return $default;... | [
"public",
"function",
"getConfiguration",
"(",
"$",
"namespace",
",",
"$",
"element",
",",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"propertyPath",
"=",
"sprintf",
"(",
"'[%s][%s][%s]'",
",",
"$",
"namespace",
",",
"$",
"element",
","... | Return configuration value under given property path into given namespace or default if not readable.
@see PropertyAccessorInterface::getValue()
@param sgring $namespace
@param string $path
@param string $element
@param mixed $default
@return mixed | [
"Return",
"configuration",
"value",
"under",
"given",
"property",
"path",
"into",
"given",
"namespace",
"or",
"default",
"if",
"not",
"readable",
"."
] | d8122a4150a83d5607289724425cf35c56a5e880 | https://github.com/Synapse-Cmf/synapse-cmf/blob/d8122a4150a83d5607289724425cf35c56a5e880/src/Synapse/Cmf/Framework/Theme/Variation/Entity/Variation.php#L46-L55 |
204,419 | IftekherSunny/Planet-Framework | src/Sun/Session/Session.php | Session.startSession | protected function startSession()
{
if (session_status() == PHP_SESSION_NONE) {
session_start();
if(!$this->expireOnClose) {
setcookie('planet_session', session_id(), time() + ($this->expireTime * 60 ), '/', null, false, false);
}
}
... | php | protected function startSession()
{
if (session_status() == PHP_SESSION_NONE) {
session_start();
if(!$this->expireOnClose) {
setcookie('planet_session', session_id(), time() + ($this->expireTime * 60 ), '/', null, false, false);
}
}
... | [
"protected",
"function",
"startSession",
"(",
")",
"{",
"if",
"(",
"session_status",
"(",
")",
"==",
"PHP_SESSION_NONE",
")",
"{",
"session_start",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"expireOnClose",
")",
"{",
"setcookie",
"(",
"'planet_sess... | To start session | [
"To",
"start",
"session"
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Session/Session.php#L54-L64 |
204,420 | IftekherSunny/Planet-Framework | src/Sun/Session/Session.php | Session.pull | public function pull($name, $value = '')
{
$value = $this->get($name, $value);
$this->delete($name);
return $value;
} | php | public function pull($name, $value = '')
{
$value = $this->get($name, $value);
$this->delete($name);
return $value;
} | [
"public",
"function",
"pull",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"delete",
"(",
"$",
"name",
")",
";",
"retu... | To pull session data
@param string $name
@param string $value
@return mixed | [
"To",
"pull",
"session",
"data"
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Session/Session.php#L156-L162 |
204,421 | IftekherSunny/Planet-Framework | src/Sun/Session/Session.php | Session.pop | public function pop($name)
{
$previousValue = $this->get($name);
$value = array_pop($previousValue);
$this->create($name, $previousValue);
return $value;
} | php | public function pop($name)
{
$previousValue = $this->get($name);
$value = array_pop($previousValue);
$this->create($name, $previousValue);
return $value;
} | [
"public",
"function",
"pop",
"(",
"$",
"name",
")",
"{",
"$",
"previousValue",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
")",
";",
"$",
"value",
"=",
"array_pop",
"(",
"$",
"previousValue",
")",
";",
"$",
"this",
"->",
"create",
"(",
"$",
... | To pop session data from session array
@param string $name
@return string | [
"To",
"pop",
"session",
"data",
"from",
"session",
"array"
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Session/Session.php#L188-L197 |
204,422 | IftekherSunny/Planet-Framework | src/Sun/Session/Session.php | Session.shift | public function shift($name)
{
$previousValue = $this->get($name);
$value = array_shift($previousValue);
$this->create($name, $previousValue);
return $value;
} | php | public function shift($name)
{
$previousValue = $this->get($name);
$value = array_shift($previousValue);
$this->create($name, $previousValue);
return $value;
} | [
"public",
"function",
"shift",
"(",
"$",
"name",
")",
"{",
"$",
"previousValue",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
")",
";",
"$",
"value",
"=",
"array_shift",
"(",
"$",
"previousValue",
")",
";",
"$",
"this",
"->",
"create",
"(",
"$"... | To shift session data from session array
@param string $name
@return string | [
"To",
"shift",
"session",
"data",
"from",
"session",
"array"
] | 530e772fb97695c1c4e1af73f81675f189474d9f | https://github.com/IftekherSunny/Planet-Framework/blob/530e772fb97695c1c4e1af73f81675f189474d9f/src/Sun/Session/Session.php#L206-L215 |
204,423 | Elephant418/Staq | src/Staq/Autoloader.php | Autoloader.getRealClass | protected function getRealClass($stack, $extensionNamespace)
{
$stackPath = \Staq\Util::convertNamespaceToPath($stack);
$absolutePath = realpath($this->extensions[$extensionNamespace] . '/Stack/' . $stackPath . '.php');
if (is_file($absolutePath)) {
$realClass = $extensionNamespa... | php | protected function getRealClass($stack, $extensionNamespace)
{
$stackPath = \Staq\Util::convertNamespaceToPath($stack);
$absolutePath = realpath($this->extensions[$extensionNamespace] . '/Stack/' . $stackPath . '.php');
if (is_file($absolutePath)) {
$realClass = $extensionNamespa... | [
"protected",
"function",
"getRealClass",
"(",
"$",
"stack",
",",
"$",
"extensionNamespace",
")",
"{",
"$",
"stackPath",
"=",
"\\",
"Staq",
"\\",
"Util",
"::",
"convertNamespaceToPath",
"(",
"$",
"stack",
")",
";",
"$",
"absolutePath",
"=",
"realpath",
"(",
... | "stack" is now a part of the namespace, there is no burgers left at my bakery | [
"stack",
"is",
"now",
"a",
"part",
"of",
"the",
"namespace",
"there",
"is",
"no",
"burgers",
"left",
"at",
"my",
"bakery"
] | b96110eb069a2b3fd992d3e56327a54a308b68b2 | https://github.com/Elephant418/Staq/blob/b96110eb069a2b3fd992d3e56327a54a308b68b2/src/Staq/Autoloader.php#L76-L84 |
204,424 | schpill/thin | src/Filter/Striptags.php | Striptags.filter | public function filter($value)
{
// start by stripping the comments, if necessary
if(!$this->allowComments) {
$value = preg_replace('/<!\-\-.*\-\->/U', '', $value);
}
// strip unallowed tags
$allowed = '';
foreach($this->al... | php | public function filter($value)
{
// start by stripping the comments, if necessary
if(!$this->allowComments) {
$value = preg_replace('/<!\-\-.*\-\->/U', '', $value);
}
// strip unallowed tags
$allowed = '';
foreach($this->al... | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"// start by stripping the comments, if necessary",
"if",
"(",
"!",
"$",
"this",
"->",
"allowComments",
")",
"{",
"$",
"value",
"=",
"preg_replace",
"(",
"'/<!\\-\\-.*\\-\\->/U'",
",",
"''",
",",
"$",
... | Strip the undesired HTML markup
@param string $value The input string with HTML markup
@return string Filtered string | [
"Strip",
"the",
"undesired",
"HTML",
"markup"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Filter/Striptags.php#L33-L65 |
204,425 | schpill/thin | src/Filter/Striptags.php | Striptags.setAllowedTags | public function setAllowedTags($tags)
{
if(!is_array($tags)) {
$tags = [$tags];
}
$this->allowedTags = $tags;
return $this;
} | php | public function setAllowedTags($tags)
{
if(!is_array($tags)) {
$tags = [$tags];
}
$this->allowedTags = $tags;
return $this;
} | [
"public",
"function",
"setAllowedTags",
"(",
"$",
"tags",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"tags",
")",
")",
"{",
"$",
"tags",
"=",
"[",
"$",
"tags",
"]",
";",
"}",
"$",
"this",
"->",
"allowedTags",
"=",
"$",
"tags",
";",
"return",... | Set the HTML tags that should be left in the input string
@param array|string $tags The allowed tags: either an array or a string with a single tag.
@return \Thin\Filter\StripTags Provides a fluent interface | [
"Set",
"the",
"HTML",
"tags",
"that",
"should",
"be",
"left",
"in",
"the",
"input",
"string"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Filter/Striptags.php#L76-L83 |
204,426 | schpill/thin | src/Filter/Striptags.php | Striptags.setAllowedAttributes | public function setAllowedAttributes($attributes)
{
if(!is_array($attributes)) {
$attributes = [$attributes];
}
$this->allowedAttributes = $attributes;
return $this;
} | php | public function setAllowedAttributes($attributes)
{
if(!is_array($attributes)) {
$attributes = [$attributes];
}
$this->allowedAttributes = $attributes;
return $this;
} | [
"public",
"function",
"setAllowedAttributes",
"(",
"$",
"attributes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"attributes",
")",
")",
"{",
"$",
"attributes",
"=",
"[",
"$",
"attributes",
"]",
";",
"}",
"$",
"this",
"->",
"allowedAttributes",
"=",... | Set the HTML attributes that should be left in the unstripped tags in the input string
@param array $attributes The allowed attributes: either an array or a string with a single attribute.
@return \Thin\Filter\StripTags Provides a fluent interface | [
"Set",
"the",
"HTML",
"attributes",
"that",
"should",
"be",
"left",
"in",
"the",
"unstripped",
"tags",
"in",
"the",
"input",
"string"
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Filter/Striptags.php#L94-L101 |
204,427 | phPoirot/Stream | Streamable.php | Streamable.write | function write($content, $inByte = null)
{
$this->_assertWritable();
$stream = $this->resource()->getRHandler();
$inByte = ($inByte === null)
? $this->getBuffer()
: $inByte;
$content = (string) $content;
if (null === $inByte)
$ret = fwr... | php | function write($content, $inByte = null)
{
$this->_assertWritable();
$stream = $this->resource()->getRHandler();
$inByte = ($inByte === null)
? $this->getBuffer()
: $inByte;
$content = (string) $content;
if (null === $inByte)
$ret = fwr... | [
"function",
"write",
"(",
"$",
"content",
",",
"$",
"inByte",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_assertWritable",
"(",
")",
";",
"$",
"stream",
"=",
"$",
"this",
"->",
"resource",
"(",
")",
"->",
"getRHandler",
"(",
")",
";",
"$",
"inByte"... | Writes the contents of string to the file stream
@param string $content The string that is to be written
@param int $inByte Writing will stop after length bytes
have been written or the end of string
is reached
@return $this | [
"Writes",
"the",
"contents",
"of",
"string",
"to",
"the",
"file",
"stream"
] | db448ee0528c2a5b07c594b8a30e2543fbc15f57 | https://github.com/phPoirot/Stream/blob/db448ee0528c2a5b07c594b8a30e2543fbc15f57/Streamable.php#L244-L274 |
204,428 | phPoirot/Stream | Streamable.php | Streamable.sendData | function sendData($data, $flags = null)
{
$rHandler = $this->resource()->getRHandler();
if ($flags === null) {
if ($this->resource()->meta()->getStreamType() == 'udp_socket')
// STREAM_OOB data not provided on udp sockets
$flags = STREAM_PEEK;
... | php | function sendData($data, $flags = null)
{
$rHandler = $this->resource()->getRHandler();
if ($flags === null) {
if ($this->resource()->meta()->getStreamType() == 'udp_socket')
// STREAM_OOB data not provided on udp sockets
$flags = STREAM_PEEK;
... | [
"function",
"sendData",
"(",
"$",
"data",
",",
"$",
"flags",
"=",
"null",
")",
"{",
"$",
"rHandler",
"=",
"$",
"this",
"->",
"resource",
"(",
")",
"->",
"getRHandler",
"(",
")",
";",
"if",
"(",
"$",
"flags",
"===",
"null",
")",
"{",
"if",
"(",
... | Sends the specified data through the socket,
whether it is connected or not
@param string $data The data to be sent
@param int|null $flags Provides a RDM (Reliably-delivered messages) socket
The value of flags can be any combination of the following:
- STREAM_SOCK_RDM
- STREAM_PEEK
- STREAM_OOB process OOB (o... | [
"Sends",
"the",
"specified",
"data",
"through",
"the",
"socket",
"whether",
"it",
"is",
"connected",
"or",
"not"
] | db448ee0528c2a5b07c594b8a30e2543fbc15f57 | https://github.com/phPoirot/Stream/blob/db448ee0528c2a5b07c594b8a30e2543fbc15f57/Streamable.php#L305-L331 |
204,429 | phPoirot/Stream | Streamable.php | Streamable.rewind | function rewind()
{
$this->_assertSeekable();
$stream = $this->resource()->getRHandler();
if (false === rewind($stream))
throw new \RuntimeException('Cannot rewind stream');
return $this;
} | php | function rewind()
{
$this->_assertSeekable();
$stream = $this->resource()->getRHandler();
if (false === rewind($stream))
throw new \RuntimeException('Cannot rewind stream');
return $this;
} | [
"function",
"rewind",
"(",
")",
"{",
"$",
"this",
"->",
"_assertSeekable",
"(",
")",
";",
"$",
"stream",
"=",
"$",
"this",
"->",
"resource",
"(",
")",
"->",
"getRHandler",
"(",
")",
";",
"if",
"(",
"false",
"===",
"rewind",
"(",
"$",
"stream",
")",... | Move the file pointer to the beginning of the stream
! php doesn't support seek/rewind on non-local streams
we can using temp/cache piped stream.
! If you have opened the file in append ("a" or "a+") mode,
any data you write to the file will always be appended,
regardless of the file position.
@return $this | [
"Move",
"the",
"file",
"pointer",
"to",
"the",
"beginning",
"of",
"the",
"stream"
] | db448ee0528c2a5b07c594b8a30e2543fbc15f57 | https://github.com/phPoirot/Stream/blob/db448ee0528c2a5b07c594b8a30e2543fbc15f57/Streamable.php#L429-L439 |
204,430 | hal-platform/hal-core | src/Repository/System/VersionControlProviderRepository.php | VersionControlProviderRepository.getPagedResults | public function getPagedResults($limit = 50, $page = 0)
{
$dql = sprintf(self::DQL_GET_VCSS, VersionControlProvider::class);
return $this->getPaginator($dql, $limit, $page);
} | php | public function getPagedResults($limit = 50, $page = 0)
{
$dql = sprintf(self::DQL_GET_VCSS, VersionControlProvider::class);
return $this->getPaginator($dql, $limit, $page);
} | [
"public",
"function",
"getPagedResults",
"(",
"$",
"limit",
"=",
"50",
",",
"$",
"page",
"=",
"0",
")",
"{",
"$",
"dql",
"=",
"sprintf",
"(",
"self",
"::",
"DQL_GET_VCSS",
",",
"VersionControlProvider",
"::",
"class",
")",
";",
"return",
"$",
"this",
"... | Get all VCSs, paged.
@param int $limit
@param int $page
@return Paginator | [
"Get",
"all",
"VCSs",
"paged",
"."
] | 30d456f8392fc873301ad4217d2ae90436c67090 | https://github.com/hal-platform/hal-core/blob/30d456f8392fc873301ad4217d2ae90436c67090/src/Repository/System/VersionControlProviderRepository.php#L60-L65 |
204,431 | iron-bound-designs/wp-notifications | src/Template/Listener.php | Listener.get_callback_reflection | public function get_callback_reflection() {
if ( is_array( $this->callback ) ) {
return new \ReflectionMethod( $this->callback[0], $this->callback[1] );
} else {
return new \ReflectionFunction( $this->callback );
}
} | php | public function get_callback_reflection() {
if ( is_array( $this->callback ) ) {
return new \ReflectionMethod( $this->callback[0], $this->callback[1] );
} else {
return new \ReflectionFunction( $this->callback );
}
} | [
"public",
"function",
"get_callback_reflection",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"callback",
")",
")",
"{",
"return",
"new",
"\\",
"ReflectionMethod",
"(",
"$",
"this",
"->",
"callback",
"[",
"0",
"]",
",",
"$",
"this",
"-... | Get a reflection object for the callback function.
@since 1.0
@return \ReflectionFunctionAbstract | [
"Get",
"a",
"reflection",
"object",
"for",
"the",
"callback",
"function",
"."
] | 4fdf67d28d194576d35f86245b2f539c4815cde2 | https://github.com/iron-bound-designs/wp-notifications/blob/4fdf67d28d194576d35f86245b2f539c4815cde2/src/Template/Listener.php#L50-L56 |
204,432 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.pushClassData | protected function pushClassData(array $data, \ReflectionClass $reflector): array
{
return $this->collectClassData(
$reflector->newInstanceWithoutConstructor(),
$data,
$reflector
);
} | php | protected function pushClassData(array $data, \ReflectionClass $reflector): array
{
return $this->collectClassData(
$reflector->newInstanceWithoutConstructor(),
$data,
$reflector
);
} | [
"protected",
"function",
"pushClassData",
"(",
"array",
"$",
"data",
",",
"\\",
"ReflectionClass",
"$",
"reflector",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"collectClassData",
"(",
"$",
"reflector",
"->",
"newInstanceWithoutConstructor",
"(",
")",
... | Push class data
@param array $data
@param \ReflectionClass $reflector
@return array | [
"Push",
"class",
"data"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L73-L80 |
204,433 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.collectClassData | protected function collectClassData($item, array $data, \ReflectionClass $reflector): array
{
foreach ($this->getClassVariants($reflector, $item) as $name)
{
$key = $this->getItemKey($name);
if (!array_key_exists($key, $data['data']) || $this->isItemGreedy($data['data'][$key... | php | protected function collectClassData($item, array $data, \ReflectionClass $reflector): array
{
foreach ($this->getClassVariants($reflector, $item) as $name)
{
$key = $this->getItemKey($name);
if (!array_key_exists($key, $data['data']) || $this->isItemGreedy($data['data'][$key... | [
"protected",
"function",
"collectClassData",
"(",
"$",
"item",
",",
"array",
"$",
"data",
",",
"\\",
"ReflectionClass",
"$",
"reflector",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getClassVariants",
"(",
"$",
"reflector",
",",
"$",
"item"... | Collect class data
@param object $item
@param array $data
@param \ReflectionClass $reflector
@return array | [
"Collect",
"class",
"data"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L91-L102 |
204,434 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.addClassData | protected function addClassData(array $data, string $key, \ReflectionClass $reflector, $item, $variant): array
{
$data['data'][$key] = $this->getClassData($reflector, $item, $variant);
return $data;
} | php | protected function addClassData(array $data, string $key, \ReflectionClass $reflector, $item, $variant): array
{
$data['data'][$key] = $this->getClassData($reflector, $item, $variant);
return $data;
} | [
"protected",
"function",
"addClassData",
"(",
"array",
"$",
"data",
",",
"string",
"$",
"key",
",",
"\\",
"ReflectionClass",
"$",
"reflector",
",",
"$",
"item",
",",
"$",
"variant",
")",
":",
"array",
"{",
"$",
"data",
"[",
"'data'",
"]",
"[",
"$",
"... | Add class data
@param array $data
@param string $key
@param \ReflectionClass $reflector
@param object $item
@param mixed $variant
@return array | [
"Add",
"class",
"data"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L115-L120 |
204,435 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.isItemGreedy | protected function isItemGreedy(array $info, \ReflectionClass $reflector, $item): bool
{
$base = new \ReflectionClass($info['class']);
if ($reflector->isSubclassOf($base->getName()))
return true;
if (!$base->isSubclassOf($reflector->getName()))
throw new \LogicExcep... | php | protected function isItemGreedy(array $info, \ReflectionClass $reflector, $item): bool
{
$base = new \ReflectionClass($info['class']);
if ($reflector->isSubclassOf($base->getName()))
return true;
if (!$base->isSubclassOf($reflector->getName()))
throw new \LogicExcep... | [
"protected",
"function",
"isItemGreedy",
"(",
"array",
"$",
"info",
",",
"\\",
"ReflectionClass",
"$",
"reflector",
",",
"$",
"item",
")",
":",
"bool",
"{",
"$",
"base",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"info",
"[",
"'class'",
"]",
")",
"... | Returns true if item is greedy
@param array $info
@param \ReflectionClass $reflector
@param object $item
@return bool | [
"Returns",
"true",
"if",
"item",
"is",
"greedy"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L162-L173 |
204,436 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.getClassBaseNames | protected function getClassBaseNames($item): array
{
$basenames = array();
$reflector = new \ReflectionClass($item);
do
{
if (!$reflector->isAbstract())
{
$docComment = $reflector->getDocComment();
if ($docComment && strpos($do... | php | protected function getClassBaseNames($item): array
{
$basenames = array();
$reflector = new \ReflectionClass($item);
do
{
if (!$reflector->isAbstract())
{
$docComment = $reflector->getDocComment();
if ($docComment && strpos($do... | [
"protected",
"function",
"getClassBaseNames",
"(",
"$",
"item",
")",
":",
"array",
"{",
"$",
"basenames",
"=",
"array",
"(",
")",
";",
"$",
"reflector",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"item",
")",
";",
"do",
"{",
"if",
"(",
"!",
"$",
... | Get class base names
@param object $item
@return array | [
"Get",
"class",
"base",
"names"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L196-L226 |
204,437 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.getClassTraits | protected function getClassTraits(\ReflectionClass $reflector): array
{
$class = $reflector->getName();
$traits = array();
do
{
$traits = array_merge(class_uses($class), $traits);
}
while ($class = get_parent_class($class));
foreach ($traits as ... | php | protected function getClassTraits(\ReflectionClass $reflector): array
{
$class = $reflector->getName();
$traits = array();
do
{
$traits = array_merge(class_uses($class), $traits);
}
while ($class = get_parent_class($class));
foreach ($traits as ... | [
"protected",
"function",
"getClassTraits",
"(",
"\\",
"ReflectionClass",
"$",
"reflector",
")",
":",
"array",
"{",
"$",
"class",
"=",
"$",
"reflector",
"->",
"getName",
"(",
")",
";",
"$",
"traits",
"=",
"array",
"(",
")",
";",
"do",
"{",
"$",
"traits"... | Get class traits
@param \ReflectionClass $reflector
@return array | [
"Get",
"class",
"traits"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L269-L285 |
204,438 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.getItemData | public function getItemData($name): array
{
if (func_num_args() > 1)
$name = func_get_args();
if (!$this->hasItemData($name))
return $this->getItemDataNotFound($name);
return $this->getData()[$this->getItemKey($name)];
} | php | public function getItemData($name): array
{
if (func_num_args() > 1)
$name = func_get_args();
if (!$this->hasItemData($name))
return $this->getItemDataNotFound($name);
return $this->getData()[$this->getItemKey($name)];
} | [
"public",
"function",
"getItemData",
"(",
"$",
"name",
")",
":",
"array",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"1",
")",
"$",
"name",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasItemData",
"(",
"$",
"name"... | Get item data
@param string|array $name
@return array | [
"Get",
"item",
"data"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L383-L392 |
204,439 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.hasItemData | public function hasItemData($name): bool
{
if (func_num_args() > 1)
$name = func_get_args();
return array_key_exists($this->getItemKey($name), $this->getData());
} | php | public function hasItemData($name): bool
{
if (func_num_args() > 1)
$name = func_get_args();
return array_key_exists($this->getItemKey($name), $this->getData());
} | [
"public",
"function",
"hasItemData",
"(",
"$",
"name",
")",
":",
"bool",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"1",
")",
"$",
"name",
"=",
"func_get_args",
"(",
")",
";",
"return",
"array_key_exists",
"(",
"$",
"this",
"->",
"getItemKey",
"("... | Has item data
@param string|array $name
@return bool | [
"Has",
"item",
"data"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L401-L407 |
204,440 | apishka/easy-extend | source/RouterAbstract.php | RouterAbstract.getItemKey | public function getItemKey($name): string
{
if (func_num_args() > 1)
$name = func_get_args();
if (is_array($name))
return implode('|', $name);
return (string) $name;
} | php | public function getItemKey($name): string
{
if (func_num_args() > 1)
$name = func_get_args();
if (is_array($name))
return implode('|', $name);
return (string) $name;
} | [
"public",
"function",
"getItemKey",
"(",
"$",
"name",
")",
":",
"string",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"1",
")",
"$",
"name",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"return",
"impl... | Returns item key
@param string|array $name
@return string | [
"Returns",
"item",
"key"
] | 5e5c63c2509377abc3db6956e353623683703e09 | https://github.com/apishka/easy-extend/blob/5e5c63c2509377abc3db6956e353623683703e09/source/RouterAbstract.php#L416-L425 |
204,441 | slickframework/form | src/Input/ValidationAwareMethods.php | ValidationAwareMethods.isValid | public function isValid()
{
$valid = $this->valid;
if ($this->isMultiple()) {
$valid = $this->isMultipleValid();
}
return $valid;
} | php | public function isValid()
{
$valid = $this->valid;
if ($this->isMultiple()) {
$valid = $this->isMultipleValid();
}
return $valid;
} | [
"public",
"function",
"isValid",
"(",
")",
"{",
"$",
"valid",
"=",
"$",
"this",
"->",
"valid",
";",
"if",
"(",
"$",
"this",
"->",
"isMultiple",
"(",
")",
")",
"{",
"$",
"valid",
"=",
"$",
"this",
"->",
"isMultipleValid",
"(",
")",
";",
"}",
"retu... | Check if the value is valid
The value should pass through all validators in the validation chain
@return boolean True if is valid, false otherwise | [
"Check",
"if",
"the",
"value",
"is",
"valid"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/ValidationAwareMethods.php#L64-L71 |
204,442 | slickframework/form | src/Input/ValidationAwareMethods.php | ValidationAwareMethods.isMultipleValid | protected function isMultipleValid()
{
if (!$this->isRendering()) {
return empty($this->invalidInstances);
}
return ! in_array($this->getInstance(), $this->invalidInstances);
} | php | protected function isMultipleValid()
{
if (!$this->isRendering()) {
return empty($this->invalidInstances);
}
return ! in_array($this->getInstance(), $this->invalidInstances);
} | [
"protected",
"function",
"isMultipleValid",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isRendering",
"(",
")",
")",
"{",
"return",
"empty",
"(",
"$",
"this",
"->",
"invalidInstances",
")",
";",
"}",
"return",
"!",
"in_array",
"(",
"$",
"this",
... | Validates when input is set to be multiple
@return bool | [
"Validates",
"when",
"input",
"is",
"set",
"to",
"be",
"multiple"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/ValidationAwareMethods.php#L78-L85 |
204,443 | slickframework/form | src/Input/ValidationAwareMethods.php | ValidationAwareMethods.validateArray | protected function validateArray(array $values, $context)
{
foreach ($values as $key => $value) {
$valid = $this->getValidationChain()
->validates($value, $context);
if (!$valid) {
$this->setInvalid($key);
}
}
} | php | protected function validateArray(array $values, $context)
{
foreach ($values as $key => $value) {
$valid = $this->getValidationChain()
->validates($value, $context);
if (!$valid) {
$this->setInvalid($key);
}
}
} | [
"protected",
"function",
"validateArray",
"(",
"array",
"$",
"values",
",",
"$",
"context",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"valid",
"=",
"$",
"this",
"->",
"getValidationChain",
"(",
")",
... | Validates input when is set to be multiple
@param array $values
@param array $context | [
"Validates",
"input",
"when",
"is",
"set",
"to",
"be",
"multiple"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/ValidationAwareMethods.php#L112-L121 |
204,444 | slickframework/form | src/Input/ValidationAwareMethods.php | ValidationAwareMethods.addValidator | public function addValidator($validator, $message = null)
{
try {
$msg = $message;
if (is_array($message)) {
$msg = array_shift($message);
$this->context = $message;
}
$validator = StaticValidator::create($validator, $msg);
... | php | public function addValidator($validator, $message = null)
{
try {
$msg = $message;
if (is_array($message)) {
$msg = array_shift($message);
$this->context = $message;
}
$validator = StaticValidator::create($validator, $msg);
... | [
"public",
"function",
"addValidator",
"(",
"$",
"validator",
",",
"$",
"message",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"msg",
"=",
"$",
"message",
";",
"if",
"(",
"is_array",
"(",
"$",
"message",
")",
")",
"{",
"$",
"msg",
"=",
"array_shift",
"(... | Adds a validator to the validation chain
The validator param could be a known validator alias, a FQ
ValidatorInterface class name or an object implementing
ValidatorInterface.
@param string|ValidatorInterface $validator
@param string|array $message Error message and possible contexts
variables.
@return self|$this|Va... | [
"Adds",
"a",
"validator",
"to",
"the",
"validation",
"chain"
] | e7d536b3bad49194e246ff93587da2589e31a003 | https://github.com/slickframework/form/blob/e7d536b3bad49194e246ff93587da2589e31a003/src/Input/ValidationAwareMethods.php#L179-L201 |
204,445 | air-php/http | src/Request/Request.php | Request.getReferer | public function getReferer()
{
$referer = null;
if (array_key_exists(self::REFERER_KEY, $this->serverData)) {
$referer = $this->serverData[self::REFERER_KEY];
}
return $referer;
} | php | public function getReferer()
{
$referer = null;
if (array_key_exists(self::REFERER_KEY, $this->serverData)) {
$referer = $this->serverData[self::REFERER_KEY];
}
return $referer;
} | [
"public",
"function",
"getReferer",
"(",
")",
"{",
"$",
"referer",
"=",
"null",
";",
"if",
"(",
"array_key_exists",
"(",
"self",
"::",
"REFERER_KEY",
",",
"$",
"this",
"->",
"serverData",
")",
")",
"{",
"$",
"referer",
"=",
"$",
"this",
"->",
"serverDa... | Get the HTTP REFERER from the server data.
@return string|null The referer or null if not found. | [
"Get",
"the",
"HTTP",
"REFERER",
"from",
"the",
"server",
"data",
"."
] | 213c02e537cea3d949cc8dbb1218c60c070fce8a | https://github.com/air-php/http/blob/213c02e537cea3d949cc8dbb1218c60c070fce8a/src/Request/Request.php#L176-L185 |
204,446 | hummer2k/ConLayout | src/Zdt/Collector/LayoutCollector.php | LayoutCollector.collect | public function collect(MvcEvent $mvcEvent)
{
$layout = $mvcEvent->getViewModel();
$blocks = [];
foreach ($this->layout->getBlocks() as $blockId => $block) {
if ($parentBlock = $block->getOption('parent')) {
$captureTo = $parentBlock . '::' . $block->captureTo();
... | php | public function collect(MvcEvent $mvcEvent)
{
$layout = $mvcEvent->getViewModel();
$blocks = [];
foreach ($this->layout->getBlocks() as $blockId => $block) {
if ($parentBlock = $block->getOption('parent')) {
$captureTo = $parentBlock . '::' . $block->captureTo();
... | [
"public",
"function",
"collect",
"(",
"MvcEvent",
"$",
"mvcEvent",
")",
"{",
"$",
"layout",
"=",
"$",
"mvcEvent",
"->",
"getViewModel",
"(",
")",
";",
"$",
"blocks",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"layout",
"->",
"getBlocks",
... | collect data for zdt
@param MvcEvent $mvcEvent
@return LayoutCollector | [
"collect",
"data",
"for",
"zdt"
] | 15e472eaabc9b23ec6a5547524874e30d95e8d3e | https://github.com/hummer2k/ConLayout/blob/15e472eaabc9b23ec6a5547524874e30d95e8d3e/src/Zdt/Collector/LayoutCollector.php#L77-L104 |
204,447 | hummer2k/ConLayout | src/Zdt/Collector/LayoutCollector.php | LayoutCollector.resolveTemplate | private function resolveTemplate($template)
{
$template = str_replace(
getcwd(),
'',
$this->viewResolver->resolve($template)
);
return $template;
} | php | private function resolveTemplate($template)
{
$template = str_replace(
getcwd(),
'',
$this->viewResolver->resolve($template)
);
return $template;
} | [
"private",
"function",
"resolveTemplate",
"(",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"str_replace",
"(",
"getcwd",
"(",
")",
",",
"''",
",",
"$",
"this",
"->",
"viewResolver",
"->",
"resolve",
"(",
"$",
"template",
")",
")",
";",
"return",
"... | retrieve resolved template path
@param string $template
@return string | [
"retrieve",
"resolved",
"template",
"path"
] | 15e472eaabc9b23ec6a5547524874e30d95e8d3e | https://github.com/hummer2k/ConLayout/blob/15e472eaabc9b23ec6a5547524874e30d95e8d3e/src/Zdt/Collector/LayoutCollector.php#L112-L120 |
204,448 | phPoirot/Stream | ResourceStream.php | ResourceStream.meta | function meta()
{
if (!$this->_rMetaInfo)
$this->_rMetaInfo = new MetaReaderOfPhpResource($this->getRHandler());
return $this->_rMetaInfo;
} | php | function meta()
{
if (!$this->_rMetaInfo)
$this->_rMetaInfo = new MetaReaderOfPhpResource($this->getRHandler());
return $this->_rMetaInfo;
} | [
"function",
"meta",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_rMetaInfo",
")",
"$",
"this",
"->",
"_rMetaInfo",
"=",
"new",
"MetaReaderOfPhpResource",
"(",
"$",
"this",
"->",
"getRHandler",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"... | Meta Data About Handler
@return MetaReaderOfPhpResource|iMetaReaderOfPhpResource | [
"Meta",
"Data",
"About",
"Handler"
] | db448ee0528c2a5b07c594b8a30e2543fbc15f57 | https://github.com/phPoirot/Stream/blob/db448ee0528c2a5b07c594b8a30e2543fbc15f57/ResourceStream.php#L90-L96 |
204,449 | phPoirot/Stream | ResourceStream.php | ResourceStream.removeFilter | function removeFilter(iFilterStream $filter)
{
$filterName = $filter->getLabel();
if (isset($this->attachedFilters[$filterName])) {
$filterRes = $this->attachedFilters[$filterName];
stream_filter_remove($filterRes);
unset($this->attachedFilters[$filterName]); // ... | php | function removeFilter(iFilterStream $filter)
{
$filterName = $filter->getLabel();
if (isset($this->attachedFilters[$filterName])) {
$filterRes = $this->attachedFilters[$filterName];
stream_filter_remove($filterRes);
unset($this->attachedFilters[$filterName]); // ... | [
"function",
"removeFilter",
"(",
"iFilterStream",
"$",
"filter",
")",
"{",
"$",
"filterName",
"=",
"$",
"filter",
"->",
"getLabel",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"attachedFilters",
"[",
"$",
"filterName",
"]",
")",
")",
"{"... | Remove Given Filter From Resource
@param iFilterStream $filter
@return $this | [
"Remove",
"Given",
"Filter",
"From",
"Resource"
] | db448ee0528c2a5b07c594b8a30e2543fbc15f57 | https://github.com/phPoirot/Stream/blob/db448ee0528c2a5b07c594b8a30e2543fbc15f57/ResourceStream.php#L143-L154 |
204,450 | austinkregel/formmodel | src/FormModel/Frameworks/Materialize.php | Materialize.select | public function select(array $configs, $options)
{
$label = (!empty($options['name']) ? ucwords($options['name']) : '');
return '
<div class="input-field">
'.parent::plainSelect(array_merge([
'id' => $this->genId($label),
], $configs), $options).(empty($label) | ... | php | public function select(array $configs, $options)
{
$label = (!empty($options['name']) ? ucwords($options['name']) : '');
return '
<div class="input-field">
'.parent::plainSelect(array_merge([
'id' => $this->genId($label),
], $configs), $options).(empty($label) | ... | [
"public",
"function",
"select",
"(",
"array",
"$",
"configs",
",",
"$",
"options",
")",
"{",
"$",
"label",
"=",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'name'",
"]",
")",
"?",
"ucwords",
"(",
"$",
"options",
"[",
"'name'",
"]",
")",
":",
"'... | Generate a select.
@param array $configs
@param mixed $options
@return string | [
"Generate",
"a",
"select",
"."
] | 49943a8f563d2e9028f6bc992708e104f9be22e3 | https://github.com/austinkregel/formmodel/blob/49943a8f563d2e9028f6bc992708e104f9be22e3/src/FormModel/Frameworks/Materialize.php#L57-L69 |
204,451 | austinkregel/formmodel | src/FormModel/Frameworks/Materialize.php | Materialize.textarea | public function textarea(array $options, $text = '')
{
$label = (!empty($options['name']) ? ucwords($options['name']) : '');
return '
<div class="input-field">
'.parent::plainTextarea(array_merge([
'class' => 'materialize-textarea',
'id' => $th... | php | public function textarea(array $options, $text = '')
{
$label = (!empty($options['name']) ? ucwords($options['name']) : '');
return '
<div class="input-field">
'.parent::plainTextarea(array_merge([
'class' => 'materialize-textarea',
'id' => $th... | [
"public",
"function",
"textarea",
"(",
"array",
"$",
"options",
",",
"$",
"text",
"=",
"''",
")",
"{",
"$",
"label",
"=",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'name'",
"]",
")",
"?",
"ucwords",
"(",
"$",
"options",
"[",
"'name'",
"]",
")... | Generate a textarea.
@param array $options
@param string $text
@return string | [
"Generate",
"a",
"textarea",
"."
] | 49943a8f563d2e9028f6bc992708e104f9be22e3 | https://github.com/austinkregel/formmodel/blob/49943a8f563d2e9028f6bc992708e104f9be22e3/src/FormModel/Frameworks/Materialize.php#L79-L92 |
204,452 | austinkregel/formmodel | src/FormModel/Frameworks/Materialize.php | Materialize.input | public function input(array $options)
{
$label = (!empty($options['name']) ? ucwords($options['name']) : '');
return '
<div class="input-field">
'.parent::plainInput(array_merge([
'class' => 'validate',
'id' => $this->genId($label),
], $opt... | php | public function input(array $options)
{
$label = (!empty($options['name']) ? ucwords($options['name']) : '');
return '
<div class="input-field">
'.parent::plainInput(array_merge([
'class' => 'validate',
'id' => $this->genId($label),
], $opt... | [
"public",
"function",
"input",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"label",
"=",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'name'",
"]",
")",
"?",
"ucwords",
"(",
"$",
"options",
"[",
"'name'",
"]",
")",
":",
"''",
")",
";",
"return"... | Generate an input area.
@param array $options
@return string | [
"Generate",
"an",
"input",
"area",
"."
] | 49943a8f563d2e9028f6bc992708e104f9be22e3 | https://github.com/austinkregel/formmodel/blob/49943a8f563d2e9028f6bc992708e104f9be22e3/src/FormModel/Frameworks/Materialize.php#L101-L114 |
204,453 | PhoxPHP/Glider | src/Model/Model.php | Model.addPropertyIf | final public function addPropertyIf(Bool $condition=null, String $property, $value=null)
{
if ($condition == true) {
$this->softProperties[$property] = $value;
}
} | php | final public function addPropertyIf(Bool $condition=null, String $property, $value=null)
{
if ($condition == true) {
$this->softProperties[$property] = $value;
}
} | [
"final",
"public",
"function",
"addPropertyIf",
"(",
"Bool",
"$",
"condition",
"=",
"null",
",",
"String",
"$",
"property",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"condition",
"==",
"true",
")",
"{",
"$",
"this",
"->",
"softPropertie... | Adds a property to list of soft properties if condition is true.
@param $condition <Boolean>
@param $property <String>
@param $value <Mixed>
@access public
@return <void> | [
"Adds",
"a",
"property",
"to",
"list",
"of",
"soft",
"properties",
"if",
"condition",
"is",
"true",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Model/Model.php#L193-L198 |
204,454 | PhoxPHP/Glider | src/Model/Model.php | Model.addPropertyIfNot | final public function addPropertyIfNot(Bool $condition=null, String $property, $value=null)
{
if ($condition == false) {
$this->softProperties[$property] = $value;
}
} | php | final public function addPropertyIfNot(Bool $condition=null, String $property, $value=null)
{
if ($condition == false) {
$this->softProperties[$property] = $value;
}
} | [
"final",
"public",
"function",
"addPropertyIfNot",
"(",
"Bool",
"$",
"condition",
"=",
"null",
",",
"String",
"$",
"property",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"condition",
"==",
"false",
")",
"{",
"$",
"this",
"->",
"softPrope... | Adds a property to list of soft properties if condition is false.
@param $condition <Boolean>
@param $property <String>
@param $value <Mixed>
@access public
@return <void> | [
"Adds",
"a",
"property",
"to",
"list",
"of",
"soft",
"properties",
"if",
"condition",
"is",
"false",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Model/Model.php#L209-L214 |
204,455 | PhoxPHP/Glider | src/Model/Model.php | Model.hasRelation | public function hasRelation(String $label) : Bool
{
if (isset($this->relations[$label])) {
return true;
}
return false;
} | php | public function hasRelation(String $label) : Bool
{
if (isset($this->relations[$label])) {
return true;
}
return false;
} | [
"public",
"function",
"hasRelation",
"(",
"String",
"$",
"label",
")",
":",
"Bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"relations",
"[",
"$",
"label",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Checks if model is related to another model.
@param $label <String>
@access public
@return <Boolean> | [
"Checks",
"if",
"model",
"is",
"related",
"to",
"another",
"model",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Model/Model.php#L490-L497 |
204,456 | PhoxPHP/Glider | src/Model/Model.php | Model.toSql | protected function toSql($fields=null) : QueryBuilder
{
$queryBuilder = $this->queryBuilder()
->select($fields)
->from($this->table);
$orderBy = [];
if (isset(Model::$findOptions['asc'])) {
$orderBy[] = Model::$findOptions['asc'] . ' ASC';
}
if (isset(Model::$findOptions['desc'])) {
$orderBy[] =... | php | protected function toSql($fields=null) : QueryBuilder
{
$queryBuilder = $this->queryBuilder()
->select($fields)
->from($this->table);
$orderBy = [];
if (isset(Model::$findOptions['asc'])) {
$orderBy[] = Model::$findOptions['asc'] . ' ASC';
}
if (isset(Model::$findOptions['desc'])) {
$orderBy[] =... | [
"protected",
"function",
"toSql",
"(",
"$",
"fields",
"=",
"null",
")",
":",
"QueryBuilder",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"queryBuilder",
"(",
")",
"->",
"select",
"(",
"$",
"fields",
")",
"->",
"from",
"(",
"$",
"this",
"->",
"t... | Returns a prepared query that will be used by other find methods.
@param $fields <Mixed>
@access protected
@static
@return <Object> <Kit\Glider\Query\Builder\QueryBuilder> | [
"Returns",
"a",
"prepared",
"query",
"that",
"will",
"be",
"used",
"by",
"other",
"find",
"methods",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Model/Model.php#L507-L538 |
204,457 | PhoxPHP/Glider | src/Model/Model.php | Model.isAccessible | protected function isAccessible(String $property) : Bool
{
if (in_array($property, $this->accessibleProperties())) {
return true;
}
return false;
} | php | protected function isAccessible(String $property) : Bool
{
if (in_array($property, $this->accessibleProperties())) {
return true;
}
return false;
} | [
"protected",
"function",
"isAccessible",
"(",
"String",
"$",
"property",
")",
":",
"Bool",
"{",
"if",
"(",
"in_array",
"(",
"$",
"property",
",",
"$",
"this",
"->",
"accessibleProperties",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
... | Checks if a property can be accessed.
@param $property <String>
@access protected
@return <Boolean> | [
"Checks",
"if",
"a",
"property",
"can",
"be",
"accessed",
"."
] | 17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042 | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Model/Model.php#L576-L583 |
204,458 | alxmsl/Cli | source/CommandPosix.php | CommandPosix.getPostfix | private static function getPostfix(Option $Option) {
$postfix = '';
if ($Option->getType() == Option::TYPE_STRING) {
$postfix .= ':';
if (!$Option->isRequired()) {
$postfix .= ':';
}
}
return $postfix;
} | php | private static function getPostfix(Option $Option) {
$postfix = '';
if ($Option->getType() == Option::TYPE_STRING) {
$postfix .= ':';
if (!$Option->isRequired()) {
$postfix .= ':';
}
}
return $postfix;
} | [
"private",
"static",
"function",
"getPostfix",
"(",
"Option",
"$",
"Option",
")",
"{",
"$",
"postfix",
"=",
"''",
";",
"if",
"(",
"$",
"Option",
"->",
"getType",
"(",
")",
"==",
"Option",
"::",
"TYPE_STRING",
")",
"{",
"$",
"postfix",
".=",
"':'",
";... | Method to build getopt parameter postfix for option
@param Option $Option instance of option
@return string getopt parameter postfix for option | [
"Method",
"to",
"build",
"getopt",
"parameter",
"postfix",
"for",
"option"
] | 806fc2baa23e5a3d32734a4b913c3730342a8bb1 | https://github.com/alxmsl/Cli/blob/806fc2baa23e5a3d32734a4b913c3730342a8bb1/source/CommandPosix.php#L39-L48 |
204,459 | alxmsl/Cli | source/CommandPosix.php | CommandPosix.getOptionsSearchStrings | private function getOptionsSearchStrings() {
if (empty($this->searchStringsCache)) {
$this->searchStringsCache = array(
0 => '',
1 => array(),
);
foreach ($this->parameters as $Option) {
$postfix = self::getPostfix($Option);
... | php | private function getOptionsSearchStrings() {
if (empty($this->searchStringsCache)) {
$this->searchStringsCache = array(
0 => '',
1 => array(),
);
foreach ($this->parameters as $Option) {
$postfix = self::getPostfix($Option);
... | [
"private",
"function",
"getOptionsSearchStrings",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"searchStringsCache",
")",
")",
"{",
"$",
"this",
"->",
"searchStringsCache",
"=",
"array",
"(",
"0",
"=>",
"''",
",",
"1",
"=>",
"array",
"(",
... | Method to get getopt parameters for command line parsing
@return array getopt parameters | [
"Method",
"to",
"get",
"getopt",
"parameters",
"for",
"command",
"line",
"parsing"
] | 806fc2baa23e5a3d32734a4b913c3730342a8bb1 | https://github.com/alxmsl/Cli/blob/806fc2baa23e5a3d32734a4b913c3730342a8bb1/source/CommandPosix.php#L54-L68 |
204,460 | alxmsl/Cli | source/CommandPosix.php | CommandPosix.parse | public function parse($panic = false) {
list($shorts, $longs) = $this->getOptionsSearchStrings();
$options = getopt($shorts, $longs);
$Exception = null;
foreach ($this->parameters as $Option) {
/** @var $Option Option */
$short = $Option->getShort();
$... | php | public function parse($panic = false) {
list($shorts, $longs) = $this->getOptionsSearchStrings();
$options = getopt($shorts, $longs);
$Exception = null;
foreach ($this->parameters as $Option) {
/** @var $Option Option */
$short = $Option->getShort();
$... | [
"public",
"function",
"parse",
"(",
"$",
"panic",
"=",
"false",
")",
"{",
"list",
"(",
"$",
"shorts",
",",
"$",
"longs",
")",
"=",
"$",
"this",
"->",
"getOptionsSearchStrings",
"(",
")",
";",
"$",
"options",
"=",
"getopt",
"(",
"$",
"shorts",
",",
... | POSIX parse command line method
@param bool $panic throw exception about required option absence
@throws DuplicateOptionException when option value duplicated
@throws RequiredOptionException when required options is not set | [
"POSIX",
"parse",
"command",
"line",
"method"
] | 806fc2baa23e5a3d32734a4b913c3730342a8bb1 | https://github.com/alxmsl/Cli/blob/806fc2baa23e5a3d32734a4b913c3730342a8bb1/source/CommandPosix.php#L92-L117 |
204,461 | alxmsl/Cli | source/CommandPosix.php | CommandPosix.displayHelp | public function displayHelp() {
$string = 'Using: ' . $this->script . ' ' . $this->command . ' ';
$where = array();
foreach ($this->parameters as $Option) {
/** @var $Option Option */
$short = $Option->getShort();
$long = $Option->getLong();
$temp ... | php | public function displayHelp() {
$string = 'Using: ' . $this->script . ' ' . $this->command . ' ';
$where = array();
foreach ($this->parameters as $Option) {
/** @var $Option Option */
$short = $Option->getShort();
$long = $Option->getLong();
$temp ... | [
"public",
"function",
"displayHelp",
"(",
")",
"{",
"$",
"string",
"=",
"'Using: '",
".",
"$",
"this",
"->",
"script",
".",
"' '",
".",
"$",
"this",
"->",
"command",
".",
"' '",
";",
"$",
"where",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
... | Display command help | [
"Display",
"command",
"help"
] | 806fc2baa23e5a3d32734a4b913c3730342a8bb1 | https://github.com/alxmsl/Cli/blob/806fc2baa23e5a3d32734a4b913c3730342a8bb1/source/CommandPosix.php#L122-L142 |
204,462 | alxmsl/Cli | source/CommandPosix.php | CommandPosix.setOptionValue | private function setOptionValue(Option $Option, $value) {
$Option->setValue($value);
$long = $Option->getLong();
if (isset($this->events[$long])) {
$Handler = $this->events[$long];
$Handler($long, $value);
}
} | php | private function setOptionValue(Option $Option, $value) {
$Option->setValue($value);
$long = $Option->getLong();
if (isset($this->events[$long])) {
$Handler = $this->events[$long];
$Handler($long, $value);
}
} | [
"private",
"function",
"setOptionValue",
"(",
"Option",
"$",
"Option",
",",
"$",
"value",
")",
"{",
"$",
"Option",
"->",
"setValue",
"(",
"$",
"value",
")",
";",
"$",
"long",
"=",
"$",
"Option",
"->",
"getLong",
"(",
")",
";",
"if",
"(",
"isset",
"... | Method to set option value and call event handler if needed
@param Option $Option instance of option
@param bool|string $value option value | [
"Method",
"to",
"set",
"option",
"value",
"and",
"call",
"event",
"handler",
"if",
"needed"
] | 806fc2baa23e5a3d32734a4b913c3730342a8bb1 | https://github.com/alxmsl/Cli/blob/806fc2baa23e5a3d32734a4b913c3730342a8bb1/source/CommandPosix.php#L149-L156 |
204,463 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.setAdapterAction | public function setAdapterAction($action)
{
if (true===$this->isInited) {
$this->resetOutput();
}
$this->__adapter_action = $action;
return $this;
} | php | public function setAdapterAction($action)
{
if (true===$this->isInited) {
$this->resetOutput();
}
$this->__adapter_action = $action;
return $this;
} | [
"public",
"function",
"setAdapterAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"isInited",
")",
"{",
"$",
"this",
"->",
"resetOutput",
"(",
")",
";",
"}",
"$",
"this",
"->",
"__adapter_action",
"=",
"$",
"action",
... | Set the adapter action to process and reset the output
@param string $action The action name
@return self | [
"Set",
"the",
"adapter",
"action",
"to",
"process",
"and",
"reset",
"the",
"output"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L239-L246 |
204,464 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.addContent | public function addContent($str, $index = null)
{
if (!is_null($index)) {
$this->contents[$index] = $str;
} else {
$this->contents[] = $str;
}
return $this;
} | php | public function addContent($str, $index = null)
{
if (!is_null($index)) {
$this->contents[$index] = $str;
} else {
$this->contents[] = $str;
}
return $this;
} | [
"public",
"function",
"addContent",
"(",
"$",
"str",
",",
"$",
"index",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"index",
")",
")",
"{",
"$",
"this",
"->",
"contents",
"[",
"$",
"index",
"]",
"=",
"$",
"str",
";",
"}",
"else"... | Add a raw content to treat
@param string $str the content to add
@param null/string $index the content index
@return self | [
"Add",
"a",
"raw",
"content",
"to",
"treat"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L279-L287 |
204,465 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.setDestinationFile | public function setDestinationFile($destination_file)
{
if (is_string($destination_file)) {
$this->destination_file = $destination_file;
} else {
if (false===$this->silent) {
throw new \InvalidArgumentException(
sprintf('[Compressor] Destin... | php | public function setDestinationFile($destination_file)
{
if (is_string($destination_file)) {
$this->destination_file = $destination_file;
} else {
if (false===$this->silent) {
throw new \InvalidArgumentException(
sprintf('[Compressor] Destin... | [
"public",
"function",
"setDestinationFile",
"(",
"$",
"destination_file",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"destination_file",
")",
")",
"{",
"$",
"this",
"->",
"destination_file",
"=",
"$",
"destination_file",
";",
"}",
"else",
"{",
"if",
"(",
... | Set the destination file to write the result in
@param string $destination_file The file path or name to create and write in
@return self
@throws \InvalidArgumentException if the file name is not a string (and if $silent==false) | [
"Set",
"the",
"destination",
"file",
"to",
"write",
"the",
"result",
"in"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L351-L363 |
204,466 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.guessDestinationFilename | public function guessDestinationFilename()
{
if (!empty($this->files_stack)) {
$this->_cleanFilesStack();
$this->init();
$_fs = array();
foreach ($this->files_stack as $_file) {
$_fs[] = $_file->getFilename();
}
if (!em... | php | public function guessDestinationFilename()
{
if (!empty($this->files_stack)) {
$this->_cleanFilesStack();
$this->init();
$_fs = array();
foreach ($this->files_stack as $_file) {
$_fs[] = $_file->getFilename();
}
if (!em... | [
"public",
"function",
"guessDestinationFilename",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"files_stack",
")",
")",
"{",
"$",
"this",
"->",
"_cleanFilesStack",
"(",
")",
";",
"$",
"this",
"->",
"init",
"(",
")",
";",
"$",
"_fs"... | Build a destination filename based on the files stack names
@return string The file name built
@throws \RuntimeException if the files stack is empty (filename can not be guessed) | [
"Build",
"a",
"destination",
"filename",
"based",
"on",
"the",
"files",
"stack",
"names"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L381-L407 |
204,467 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.setDestinationDir | public function setDestinationDir($destination_dir)
{
if (is_string($destination_dir)) {
$destination_dir = realpath($destination_dir);
if (@file_exists($destination_dir) && @is_dir($destination_dir)) {
$this->destination_dir = rtrim($destination_dir, '/').'/';
... | php | public function setDestinationDir($destination_dir)
{
if (is_string($destination_dir)) {
$destination_dir = realpath($destination_dir);
if (@file_exists($destination_dir) && @is_dir($destination_dir)) {
$this->destination_dir = rtrim($destination_dir, '/').'/';
... | [
"public",
"function",
"setDestinationDir",
"(",
"$",
"destination_dir",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"destination_dir",
")",
")",
"{",
"$",
"destination_dir",
"=",
"realpath",
"(",
"$",
"destination_dir",
")",
";",
"if",
"(",
"@",
"file_exists... | Set the destination directory to write the destination file in
@param string $destination_dir The directory path to create the file in
@return self
@throws \InvalidArgumentException if the directory name is not a string (and if $silent==false) | [
"Set",
"the",
"destination",
"directory",
"to",
"write",
"the",
"destination",
"file",
"in"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L416-L435 |
204,468 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.getDestinationWebPath | public function getDestinationWebPath()
{
if (!empty($this->web_root_path)) {
return str_replace($this->web_root_path, '', $this->getDestinationRealPath());
} elseif (false===$this->silent) {
throw new \LogicException(
'[Compressor] Can\'t create web path beca... | php | public function getDestinationWebPath()
{
if (!empty($this->web_root_path)) {
return str_replace($this->web_root_path, '', $this->getDestinationRealPath());
} elseif (false===$this->silent) {
throw new \LogicException(
'[Compressor] Can\'t create web path beca... | [
"public",
"function",
"getDestinationWebPath",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"web_root_path",
")",
")",
"{",
"return",
"str_replace",
"(",
"$",
"this",
"->",
"web_root_path",
",",
"''",
",",
"$",
"this",
"->",
"getDestin... | Get the destination file path ready for web inclusion
@return string The file path to write in
@throws \LogicException if the web root path has not been set (and silent==false) | [
"Get",
"the",
"destination",
"file",
"path",
"ready",
"for",
"web",
"inclusion"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L491-L501 |
204,469 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.mustRefresh | public function mustRefresh()
{
if ($this->fileExists()) {
$this->_cleanFilesStack();
$_dest = new \SplFileInfo($this->getDestinationRealPath());
if (!empty($this->files_stack)) {
foreach ($this->files_stack as $_file) {
if ($_file->get... | php | public function mustRefresh()
{
if ($this->fileExists()) {
$this->_cleanFilesStack();
$_dest = new \SplFileInfo($this->getDestinationRealPath());
if (!empty($this->files_stack)) {
foreach ($this->files_stack as $_file) {
if ($_file->get... | [
"public",
"function",
"mustRefresh",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fileExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_cleanFilesStack",
"(",
")",
";",
"$",
"_dest",
"=",
"new",
"\\",
"SplFileInfo",
"(",
"$",
"this",
"->",
"getDesti... | Check if a destination file already exist for the current object and if it is fresher than sources
@return bool True if the sources had been modified after minified file creation | [
"Check",
"if",
"a",
"destination",
"file",
"already",
"exist",
"for",
"the",
"current",
"object",
"and",
"if",
"it",
"is",
"fresher",
"than",
"sources"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L531-L546 |
204,470 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor.process | public function process()
{
$this->_cleanFilesStack();
$this->init();
if (empty($this->destination_file) && false===$this->direct_output) {
$this->guessDestinationFilename();
}
if (!method_exists($this->__adapter, $this->__adapter_action)) {
throw ne... | php | public function process()
{
$this->_cleanFilesStack();
$this->init();
if (empty($this->destination_file) && false===$this->direct_output) {
$this->guessDestinationFilename();
}
if (!method_exists($this->__adapter, $this->__adapter_action)) {
throw ne... | [
"public",
"function",
"process",
"(",
")",
"{",
"$",
"this",
"->",
"_cleanFilesStack",
"(",
")",
";",
"$",
"this",
"->",
"init",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"destination_file",
")",
"&&",
"false",
"===",
"$",
"this",
... | Process the current files stack
@return self
@throws \RuntimeException | [
"Process",
"the",
"current",
"files",
"stack"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L576-L615 |
204,471 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor._cleanFilesStack | protected function _cleanFilesStack()
{
if (true===$this->isCleaned_files_stack) {
return;
}
$new_stack = array();
foreach ($this->files_stack as $_file) {
if (is_object($_file) && ($_file instanceof \SplFileInfo)) {
$new_stack[] = $_file;
... | php | protected function _cleanFilesStack()
{
if (true===$this->isCleaned_files_stack) {
return;
}
$new_stack = array();
foreach ($this->files_stack as $_file) {
if (is_object($_file) && ($_file instanceof \SplFileInfo)) {
$new_stack[] = $_file;
... | [
"protected",
"function",
"_cleanFilesStack",
"(",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"isCleaned_files_stack",
")",
"{",
"return",
";",
"}",
"$",
"new_stack",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"files_stack... | Rebuild the current files stack as an array of File objects
@return void
@throws \RuntimeException if one of the files stack doesn't exist (and if $silent==false) | [
"Rebuild",
"the",
"current",
"files",
"stack",
"as",
"an",
"array",
"of",
"File",
"objects"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L659-L679 |
204,472 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor._guessAdapterType | protected function _guessAdapterType()
{
$this->_cleanFilesStack();
if (!empty($this->files_stack)) {
$_fs = $this->files_stack;
$_file = array_shift($_fs);
$this->setAdapterType($_file->getExtension());
return true;
} elseif (false===$this->si... | php | protected function _guessAdapterType()
{
$this->_cleanFilesStack();
if (!empty($this->files_stack)) {
$_fs = $this->files_stack;
$_file = array_shift($_fs);
$this->setAdapterType($_file->getExtension());
return true;
} elseif (false===$this->si... | [
"protected",
"function",
"_guessAdapterType",
"(",
")",
"{",
"$",
"this",
"->",
"_cleanFilesStack",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"files_stack",
")",
")",
"{",
"$",
"_fs",
"=",
"$",
"this",
"->",
"files_stack",
";",
... | Guess the adapter type based on extension of the first file in stack
@return bool True if the adapter type had been guessed
@throws \RuntimeException if no file was found in the stack | [
"Guess",
"the",
"adapter",
"type",
"based",
"on",
"extension",
"of",
"the",
"first",
"file",
"in",
"stack"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L687-L701 |
204,473 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor._writeDestinationFile | protected function _writeDestinationFile()
{
if (empty($this->destination_file)) {
$this->guessDestinationFilename();
}
$content = $this->_getHeaderComment()."\n".$this->output;
$dest_file = $this->getDestinationRealPath();
if (false!==file_put_contents($dest_fil... | php | protected function _writeDestinationFile()
{
if (empty($this->destination_file)) {
$this->guessDestinationFilename();
}
$content = $this->_getHeaderComment()."\n".$this->output;
$dest_file = $this->getDestinationRealPath();
if (false!==file_put_contents($dest_fil... | [
"protected",
"function",
"_writeDestinationFile",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"destination_file",
")",
")",
"{",
"$",
"this",
"->",
"guessDestinationFilename",
"(",
")",
";",
"}",
"$",
"content",
"=",
"$",
"this",
"->",
"_g... | Writes the compressed content in the destination file
@return bool|string The filename if it has been created, false otherwise
@throws \RuntimeException if the file can't be written | [
"Writes",
"the",
"compressed",
"content",
"in",
"the",
"destination",
"file"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L713-L731 |
204,474 | atelierspierrot/templatengine | src/Assets/Compressor.php | Compressor._getHeaderComment | protected function _getHeaderComment()
{
$this->init();
return $this->__adapter->buildComment(
sprintf('Generated by %s class on %s at %s', __CLASS__, date('Y-m-d'), date('H:i'))
);
} | php | protected function _getHeaderComment()
{
$this->init();
return $this->__adapter->buildComment(
sprintf('Generated by %s class on %s at %s', __CLASS__, date('Y-m-d'), date('H:i'))
);
} | [
"protected",
"function",
"_getHeaderComment",
"(",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"return",
"$",
"this",
"->",
"__adapter",
"->",
"buildComment",
"(",
"sprintf",
"(",
"'Generated by %s class on %s at %s'",
",",
"__CLASS__",
",",
"date",
"(... | Build the compressed content header comment information
@return string A comment string to write in top of the content | [
"Build",
"the",
"compressed",
"content",
"header",
"comment",
"information"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/Assets/Compressor.php#L738-L744 |
204,475 | acacha/forge-publish | src/Console/Commands/Traits/InteractsWithLocalGithub.php | InteractsWithLocalGithub.getRepoFromGithubConfig | protected function getRepoFromGithubConfig()
{
$remote = `git remote get-url origin 2> /dev/null`;
if (! starts_with($remote, ['git@github.com:','https://github.com/'])) {
return '';
}
if (starts_with($remote, 'git@github.com:')) {
// git@github.com:acacha/fo... | php | protected function getRepoFromGithubConfig()
{
$remote = `git remote get-url origin 2> /dev/null`;
if (! starts_with($remote, ['git@github.com:','https://github.com/'])) {
return '';
}
if (starts_with($remote, 'git@github.com:')) {
// git@github.com:acacha/fo... | [
"protected",
"function",
"getRepoFromGithubConfig",
"(",
")",
"{",
"$",
"remote",
"=",
"`git remote get-url origin 2> /dev/null`",
";",
"if",
"(",
"!",
"starts_with",
"(",
"$",
"remote",
",",
"[",
"'git@github.com:'",
",",
"'https://github.com/'",
"]",
")",
")",
"... | Get github repo from github.
@return string | [
"Get",
"github",
"repo",
"from",
"github",
"."
] | 010779e3d2297c763b82dc3fbde992edffb3a6c6 | https://github.com/acacha/forge-publish/blob/010779e3d2297c763b82dc3fbde992edffb3a6c6/src/Console/Commands/Traits/InteractsWithLocalGithub.php#L17-L32 |
204,476 | pmdevelopment/tool-bundle | Framework/Utilities/CryptUtility.php | CryptUtility.encrypt | public static function encrypt($sValue, $sSecretKey, $migration = false)
{
if (empty($sValue)) {
return "";
}
if (true === $migration) {
$sSecretKey = substr($sSecretKey, 0, 30) . "\0\0";
} else {
$sSecretKey = substr($sSecretKey, 0, 32);
... | php | public static function encrypt($sValue, $sSecretKey, $migration = false)
{
if (empty($sValue)) {
return "";
}
if (true === $migration) {
$sSecretKey = substr($sSecretKey, 0, 30) . "\0\0";
} else {
$sSecretKey = substr($sSecretKey, 0, 32);
... | [
"public",
"static",
"function",
"encrypt",
"(",
"$",
"sValue",
",",
"$",
"sSecretKey",
",",
"$",
"migration",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sValue",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"true",
"===",
"$",
... | Encrypt Value by Key
@param string $sValue
@param string $sSecretKey
@param bool $migration Use old buggy key or not
@return string | [
"Encrypt",
"Value",
"by",
"Key"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Framework/Utilities/CryptUtility.php#L27-L41 |
204,477 | pmdevelopment/tool-bundle | Framework/Utilities/CryptUtility.php | CryptUtility.decrypt | public static function decrypt($sValue, $sSecretKey, $migration = false)
{
if (empty($sValue)) {
return "";
}
if (true === $migration) {
$sSecretKey = substr($sSecretKey, 0, 30) . "\0\0";
} else {
$sSecretKey = substr($sSecretKey, 0, 32);
... | php | public static function decrypt($sValue, $sSecretKey, $migration = false)
{
if (empty($sValue)) {
return "";
}
if (true === $migration) {
$sSecretKey = substr($sSecretKey, 0, 30) . "\0\0";
} else {
$sSecretKey = substr($sSecretKey, 0, 32);
... | [
"public",
"static",
"function",
"decrypt",
"(",
"$",
"sValue",
",",
"$",
"sSecretKey",
",",
"$",
"migration",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"sValue",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"true",
"===",
"$",
... | Decrypt value by key
@param string $sValue
@param string $sSecretKey
@param bool $migration Use old buggy key or not
@return string | [
"Decrypt",
"value",
"by",
"key"
] | 2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129 | https://github.com/pmdevelopment/tool-bundle/blob/2cbc9f82c5b33fd7a9d389edd3676e9f70ea8129/Framework/Utilities/CryptUtility.php#L52-L65 |
204,478 | 3ev/wordpress-core | src/Tev/Post/Model/AbstractPost.php | AbstractPost.getContent | public function getContent()
{
$content = $this->getRawContent();
$content = apply_filters('the_content', $content);
$content = str_replace( ']]>', ']]>', $content);
return $content;
} | php | public function getContent()
{
$content = $this->getRawContent();
$content = apply_filters('the_content', $content);
$content = str_replace( ']]>', ']]>', $content);
return $content;
} | [
"public",
"function",
"getContent",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getRawContent",
"(",
")",
";",
"$",
"content",
"=",
"apply_filters",
"(",
"'the_content'",
",",
"$",
"content",
")",
";",
"$",
"content",
"=",
"str_replace",
"(",... | Get the post content, formatted as HTML.
@return string | [
"Get",
"the",
"post",
"content",
"formatted",
"as",
"HTML",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Post/Model/AbstractPost.php#L207-L214 |
204,479 | 3ev/wordpress-core | src/Tev/Post/Model/AbstractPost.php | AbstractPost.getExcerpt | public function getExcerpt($content = null)
{
$raw = $exc = $this->base->post_excerpt;
if (!strlen($exc)) {
$exc = $content === null ? $this->getRawContent() : $content;
$exc = strip_shortcodes($exc);
$exc = apply_filters('the_content', $exc);
$exc = ... | php | public function getExcerpt($content = null)
{
$raw = $exc = $this->base->post_excerpt;
if (!strlen($exc)) {
$exc = $content === null ? $this->getRawContent() : $content;
$exc = strip_shortcodes($exc);
$exc = apply_filters('the_content', $exc);
$exc = ... | [
"public",
"function",
"getExcerpt",
"(",
"$",
"content",
"=",
"null",
")",
"{",
"$",
"raw",
"=",
"$",
"exc",
"=",
"$",
"this",
"->",
"base",
"->",
"post_excerpt",
";",
"if",
"(",
"!",
"strlen",
"(",
"$",
"exc",
")",
")",
"{",
"$",
"exc",
"=",
"... | Get the post excerpt.
Adapted from wp_trim_excerpt() in wp-includes/formatting.php.
@param string|null $content Optional. Base content to use for excerpt
if post excerpt isn't defined. Defaults to
post content
@return string | [
"Get",
"the",
"post",
"excerpt",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Post/Model/AbstractPost.php#L246-L263 |
204,480 | 3ev/wordpress-core | src/Tev/Post/Model/AbstractPost.php | AbstractPost.getFeaturedImage | public function getFeaturedImage()
{
if ($this->featuredImage === null) {
if ($imgId = get_post_thumbnail_id((int) $this->getId())) {
$this->featuredImage = $this->postFactory->create(get_post($imgId));
} else {
$this->featuredImage = false;
... | php | public function getFeaturedImage()
{
if ($this->featuredImage === null) {
if ($imgId = get_post_thumbnail_id((int) $this->getId())) {
$this->featuredImage = $this->postFactory->create(get_post($imgId));
} else {
$this->featuredImage = false;
... | [
"public",
"function",
"getFeaturedImage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"featuredImage",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"imgId",
"=",
"get_post_thumbnail_id",
"(",
"(",
"int",
")",
"$",
"this",
"->",
"getId",
"(",
")",
")",
"... | Get this Post's featured image.
@return \Tev\Post\Model\Attachment|false Featured image object, or false if not
set | [
"Get",
"this",
"Post",
"s",
"featured",
"image",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Post/Model/AbstractPost.php#L282-L293 |
204,481 | 3ev/wordpress-core | src/Tev/Post/Model/AbstractPost.php | AbstractPost.getAuthor | public function getAuthor()
{
if ($this->author === null) {
$this->author = $this->authorFactory->create($this->getAuthorId());
}
return $this->author;
} | php | public function getAuthor()
{
if ($this->author === null) {
$this->author = $this->authorFactory->create($this->getAuthorId());
}
return $this->author;
} | [
"public",
"function",
"getAuthor",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"author",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"author",
"=",
"$",
"this",
"->",
"authorFactory",
"->",
"create",
"(",
"$",
"this",
"->",
"getAuthorId",
"(",
")",
... | Get post author.
@return \Tev\Author\Model\Author | [
"Get",
"post",
"author",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Post/Model/AbstractPost.php#L331-L338 |
204,482 | 3ev/wordpress-core | src/Tev/Post/Model/AbstractPost.php | AbstractPost.getParent | public function getParent()
{
if ($this->parent === null) {
if (($parentId = $this->getParentPostId()) !== null) {
$this->parent = $this->postFactory->create(get_post($parentId));
} else {
$this->parent = false;
}
}
return ... | php | public function getParent()
{
if ($this->parent === null) {
if (($parentId = $this->getParentPostId()) !== null) {
$this->parent = $this->postFactory->create(get_post($parentId));
} else {
$this->parent = false;
}
}
return ... | [
"public",
"function",
"getParent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parent",
"===",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"parentId",
"=",
"$",
"this",
"->",
"getParentPostId",
"(",
")",
")",
"!==",
"null",
")",
"{",
"$",
"this",
"-... | Get the parent post, if set.
@return \Tev\Post\Model\AbstractPost|null | [
"Get",
"the",
"parent",
"post",
"if",
"set",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Post/Model/AbstractPost.php#L355-L366 |
204,483 | 3ev/wordpress-core | src/Tev/Post/Model/AbstractPost.php | AbstractPost.getTermsFor | public function getTermsFor($taxonomy)
{
if (!($taxonomy instanceof Taxonomy)) {
$taxonomy = $this->taxonomyFactory->create($taxonomy);
}
return $taxonomy->getTermsForPost($this);
} | php | public function getTermsFor($taxonomy)
{
if (!($taxonomy instanceof Taxonomy)) {
$taxonomy = $this->taxonomyFactory->create($taxonomy);
}
return $taxonomy->getTermsForPost($this);
} | [
"public",
"function",
"getTermsFor",
"(",
"$",
"taxonomy",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"taxonomy",
"instanceof",
"Taxonomy",
")",
")",
"{",
"$",
"taxonomy",
"=",
"$",
"this",
"->",
"taxonomyFactory",
"->",
"create",
"(",
"$",
"taxonomy",
")",
"... | Get all terms for this post in the given taxonomy.
@param mixed|\Tev\Taxonomy\Model\Taxonomy $taxonomy Taxonomy name or object
@return \Tev\Term\Model\Term[] Array of terms | [
"Get",
"all",
"terms",
"for",
"this",
"post",
"in",
"the",
"given",
"taxonomy",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Post/Model/AbstractPost.php#L442-L449 |
204,484 | 3ev/wordpress-core | src/Tev/Post/Model/AbstractPost.php | AbstractPost.getPostTypeObject | protected function getPostTypeObject()
{
if ($this->postTypeObj === null) {
$this->postTypeObj = get_post_type_object($this->getType());
}
return $this->postTypeObj;
} | php | protected function getPostTypeObject()
{
if ($this->postTypeObj === null) {
$this->postTypeObj = get_post_type_object($this->getType());
}
return $this->postTypeObj;
} | [
"protected",
"function",
"getPostTypeObject",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"postTypeObj",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"postTypeObj",
"=",
"get_post_type_object",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
")",
";",
"}",
... | Get the post type object for this post.
Contains information about the post type of this post.
@return \stdClass | [
"Get",
"the",
"post",
"type",
"object",
"for",
"this",
"post",
"."
] | da674fbec5bf3d5bd2a2141680a4c141113eb6b0 | https://github.com/3ev/wordpress-core/blob/da674fbec5bf3d5bd2a2141680a4c141113eb6b0/src/Tev/Post/Model/AbstractPost.php#L494-L501 |
204,485 | atelierspierrot/patterns | src/Patterns/Abstracts/AbstractView.php | AbstractView.getParams | public function getParams($alone = false)
{
if ($alone) {
return $this->params;
} else {
return array_merge($this->getDefaultViewParams(), $this->params);
}
} | php | public function getParams($alone = false)
{
if ($alone) {
return $this->params;
} else {
return array_merge($this->getDefaultViewParams(), $this->params);
}
} | [
"public",
"function",
"getParams",
"(",
"$",
"alone",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"alone",
")",
"{",
"return",
"$",
"this",
"->",
"params",
";",
"}",
"else",
"{",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"getDefaultViewParams",
"(",... | Get the parameters for the current view
@param bool $alone Get the stack of parameters without the default params (default is `false`)
@return array The array of parameters | [
"Get",
"the",
"parameters",
"for",
"the",
"current",
"view"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Abstracts/AbstractView.php#L168-L175 |
204,486 | YiMAproject/yimaAdminor | src/yimaAdminor/Mvc/OffCanvasAdminThemeResolver.php | OffCanvasAdminThemeResolver.getName | public function getName()
{
$name = false;
// - we are on admin
$sm = $this->themeLocator->getServiceLocator();
// get registered PermissionsManager service and retrieve plugin
$permissionsManager = $sm->get('yimaAuthorize.AuthServiceManager');
/** @var $permission... | php | public function getName()
{
$name = false;
// - we are on admin
$sm = $this->themeLocator->getServiceLocator();
// get registered PermissionsManager service and retrieve plugin
$permissionsManager = $sm->get('yimaAuthorize.AuthServiceManager');
/** @var $permission... | [
"public",
"function",
"getName",
"(",
")",
"{",
"$",
"name",
"=",
"false",
";",
"// - we are on admin",
"$",
"sm",
"=",
"$",
"this",
"->",
"themeLocator",
"->",
"getServiceLocator",
"(",
")",
";",
"// get registered PermissionsManager service and retrieve plugin",
"... | Get default admin template name from merged config
@return bool | [
"Get",
"default",
"admin",
"template",
"name",
"from",
"merged",
"config"
] | 7a6c66e05aedaef8061c8998dfa44ac1ce9cc319 | https://github.com/YiMAproject/yimaAdminor/blob/7a6c66e05aedaef8061c8998dfa44ac1ce9cc319/src/yimaAdminor/Mvc/OffCanvasAdminThemeResolver.php#L25-L50 |
204,487 | eloquent/endec | src/Base32/Base32DecodeTransform.php | Base32DecodeTransform.mapByte | protected function mapByte($data, $index)
{
$byte = ord($data[$index]);
if ($byte > 49) {
if ($byte < 56) {
return $byte - 24;
}
if ($byte > 64 && $byte < 91) {
return $byte - 65;
}
}
throw new InvalidEn... | php | protected function mapByte($data, $index)
{
$byte = ord($data[$index]);
if ($byte > 49) {
if ($byte < 56) {
return $byte - 24;
}
if ($byte > 64 && $byte < 91) {
return $byte - 65;
}
}
throw new InvalidEn... | [
"protected",
"function",
"mapByte",
"(",
"$",
"data",
",",
"$",
"index",
")",
"{",
"$",
"byte",
"=",
"ord",
"(",
"$",
"data",
"[",
"$",
"index",
"]",
")",
";",
"if",
"(",
"$",
"byte",
">",
"49",
")",
"{",
"if",
"(",
"$",
"byte",
"<",
"56",
... | Map a byte to its relevant alphabet entry.
@param string $data The data to be decoded.
@param integer $index The index into the data at which the relevant byte is located.
@return integer The relevant alphabet entry.
@throws EncodingExceptionInterface If there is no relevant alphabet entry. | [
"Map",
"a",
"byte",
"to",
"its",
"relevant",
"alphabet",
"entry",
"."
] | 90043a26439739d6bac631cc57dab3ecf5cafdc3 | https://github.com/eloquent/endec/blob/90043a26439739d6bac631cc57dab3ecf5cafdc3/src/Base32/Base32DecodeTransform.php#L48-L61 |
204,488 | parfumix/eloquent-translatable | src/TranslatableTrait.php | TranslatableTrait.removeTranslation | public function removeTranslation($locale = null) {
$translation = $this->translate($locale);
if(! is_null($translation))
$translation->delete();
return $this;
} | php | public function removeTranslation($locale = null) {
$translation = $this->translate($locale);
if(! is_null($translation))
$translation->delete();
return $this;
} | [
"public",
"function",
"removeTranslation",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"translation",
"=",
"$",
"this",
"->",
"translate",
"(",
"$",
"locale",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"translation",
")",
")",
"$",
"translation... | Remove translation by locale .
@param null $locale
@return $this
@throws TranslatableException | [
"Remove",
"translation",
"by",
"locale",
"."
] | 53a4d5c7288219a035d8c512892efbe670029a79 | https://github.com/parfumix/eloquent-translatable/blob/53a4d5c7288219a035d8c512892efbe670029a79/src/TranslatableTrait.php#L21-L28 |
204,489 | parfumix/eloquent-translatable | src/TranslatableTrait.php | TranslatableTrait.translate | public function translate($locale = null) {
$locale = isset($locale) ? $locale : Locale\get_active_locale();
if( in_array( $locale, Locale\get_locales() ) )
throw new TranslatableException(
_('Invalid locale')
);
$language = $this->getByLocale($locale);
... | php | public function translate($locale = null) {
$locale = isset($locale) ? $locale : Locale\get_active_locale();
if( in_array( $locale, Locale\get_locales() ) )
throw new TranslatableException(
_('Invalid locale')
);
$language = $this->getByLocale($locale);
... | [
"public",
"function",
"translate",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"locale",
"=",
"isset",
"(",
"$",
"locale",
")",
"?",
"$",
"locale",
":",
"Locale",
"\\",
"get_active_locale",
"(",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"locale"... | Translate attribute by locale .
@param null $locale
@return mixed
@throws TranslatableException | [
"Translate",
"attribute",
"by",
"locale",
"."
] | 53a4d5c7288219a035d8c512892efbe670029a79 | https://github.com/parfumix/eloquent-translatable/blob/53a4d5c7288219a035d8c512892efbe670029a79/src/TranslatableTrait.php#L48-L61 |
204,490 | parfumix/eloquent-translatable | src/TranslatableTrait.php | TranslatableTrait.save | public function save(array $options = []) {
$saved = parent::save($options);
array_walk($this->translations, function($translation, $locale) {
if(! array_filter($translation))
return false;
$this->newTranslation($locale, $translation)
->save();
... | php | public function save(array $options = []) {
$saved = parent::save($options);
array_walk($this->translations, function($translation, $locale) {
if(! array_filter($translation))
return false;
$this->newTranslation($locale, $translation)
->save();
... | [
"public",
"function",
"save",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"saved",
"=",
"parent",
"::",
"save",
"(",
"$",
"options",
")",
";",
"array_walk",
"(",
"$",
"this",
"->",
"translations",
",",
"function",
"(",
"$",
"translati... | Save eloquent model .
@param array $options
@return mixed | [
"Save",
"eloquent",
"model",
"."
] | 53a4d5c7288219a035d8c512892efbe670029a79 | https://github.com/parfumix/eloquent-translatable/blob/53a4d5c7288219a035d8c512892efbe670029a79/src/TranslatableTrait.php#L70-L82 |
204,491 | parfumix/eloquent-translatable | src/TranslatableTrait.php | TranslatableTrait.fill | public function fill(array $attributes) {
$locales = Locale\get_locales();
foreach($locales as $locale => $options)
if( in_array($locale, array_keys($attributes)) )
$this->translations[$locale] = array_pull($attributes, $locale);
return parent::fill($attributes);
... | php | public function fill(array $attributes) {
$locales = Locale\get_locales();
foreach($locales as $locale => $options)
if( in_array($locale, array_keys($attributes)) )
$this->translations[$locale] = array_pull($attributes, $locale);
return parent::fill($attributes);
... | [
"public",
"function",
"fill",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"locales",
"=",
"Locale",
"\\",
"get_locales",
"(",
")",
";",
"foreach",
"(",
"$",
"locales",
"as",
"$",
"locale",
"=>",
"$",
"options",
")",
"if",
"(",
"in_array",
"(",
"$... | Fill attributes and save locales if exists .
@param array $attributes
@return mixed | [
"Fill",
"attributes",
"and",
"save",
"locales",
"if",
"exists",
"."
] | 53a4d5c7288219a035d8c512892efbe670029a79 | https://github.com/parfumix/eloquent-translatable/blob/53a4d5c7288219a035d8c512892efbe670029a79/src/TranslatableTrait.php#L90-L98 |
204,492 | parfumix/eloquent-translatable | src/TranslatableTrait.php | TranslatableTrait.newTranslation | protected function newTranslation($locale = null, array $attributes) {
$locale = isset($locale) ? $locale : Locale\get_active_locale();
$language = $this->getByLocale($locale);
$class = $this->classTranslation();
$update = [
'language_id' => $language->id,
iss... | php | protected function newTranslation($locale = null, array $attributes) {
$locale = isset($locale) ? $locale : Locale\get_active_locale();
$language = $this->getByLocale($locale);
$class = $this->classTranslation();
$update = [
'language_id' => $language->id,
iss... | [
"protected",
"function",
"newTranslation",
"(",
"$",
"locale",
"=",
"null",
",",
"array",
"$",
"attributes",
")",
"{",
"$",
"locale",
"=",
"isset",
"(",
"$",
"locale",
")",
"?",
"$",
"locale",
":",
"Locale",
"\\",
"get_active_locale",
"(",
")",
";",
"$... | Get new translation instance .
@param null $locale
@param array $attributes
@return mixed | [
"Get",
"new",
"translation",
"instance",
"."
] | 53a4d5c7288219a035d8c512892efbe670029a79 | https://github.com/parfumix/eloquent-translatable/blob/53a4d5c7288219a035d8c512892efbe670029a79/src/TranslatableTrait.php#L108-L123 |
204,493 | parfumix/eloquent-translatable | src/TranslatableTrait.php | TranslatableTrait.classTranslation | protected function classTranslation() {
if(! $classTranslation = $this['translationClass'])
$classTranslation = sprintf('App\\%s%s', ucfirst(str_singular($this->getModel()->getTable())), 'Translations');
return $classTranslation;
} | php | protected function classTranslation() {
if(! $classTranslation = $this['translationClass'])
$classTranslation = sprintf('App\\%s%s', ucfirst(str_singular($this->getModel()->getTable())), 'Translations');
return $classTranslation;
} | [
"protected",
"function",
"classTranslation",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"classTranslation",
"=",
"$",
"this",
"[",
"'translationClass'",
"]",
")",
"$",
"classTranslation",
"=",
"sprintf",
"(",
"'App\\\\%s%s'",
",",
"ucfirst",
"(",
"str_singular",
"(",... | Get Class Translations .
@return string | [
"Get",
"Class",
"Translations",
"."
] | 53a4d5c7288219a035d8c512892efbe670029a79 | https://github.com/parfumix/eloquent-translatable/blob/53a4d5c7288219a035d8c512892efbe670029a79/src/TranslatableTrait.php#L142-L147 |
204,494 | parfumix/eloquent-translatable | src/TranslatableTrait.php | TranslatableTrait.translatedAttributes | public function translatedAttributes() {
if(! $attributes = isset($this['translatedAttributes']) ? $this['translatedAttributes'] : null) {
$class = $this->classTranslation();
$attributes = (new $class)
->getFillable();
$attributes = array_except(array_flip($... | php | public function translatedAttributes() {
if(! $attributes = isset($this['translatedAttributes']) ? $this['translatedAttributes'] : null) {
$class = $this->classTranslation();
$attributes = (new $class)
->getFillable();
$attributes = array_except(array_flip($... | [
"public",
"function",
"translatedAttributes",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"attributes",
"=",
"isset",
"(",
"$",
"this",
"[",
"'translatedAttributes'",
"]",
")",
"?",
"$",
"this",
"[",
"'translatedAttributes'",
"]",
":",
"null",
")",
"{",
"$",
"cl... | Get translatedAttributes .
@return mixed | [
"Get",
"translatedAttributes",
"."
] | 53a4d5c7288219a035d8c512892efbe670029a79 | https://github.com/parfumix/eloquent-translatable/blob/53a4d5c7288219a035d8c512892efbe670029a79/src/TranslatableTrait.php#L167-L183 |
204,495 | rkeet/zf-doctrine-mvc | src/Controller/AbstractDoctrineActionController.php | AbstractDoctrineActionController.isEntity | function isEntity(string $classFQCN) : bool
{
if ( ! class_exists($classFQCN)) {
throw new ClassNotFoundException(sprintf('Given class FQCN "%s" does not exist.', $classFQCN));
}
if ( ! is_object($classFQCN)) {
throw new EntityNotFoundException(sprintf('Given class... | php | function isEntity(string $classFQCN) : bool
{
if ( ! class_exists($classFQCN)) {
throw new ClassNotFoundException(sprintf('Given class FQCN "%s" does not exist.', $classFQCN));
}
if ( ! is_object($classFQCN)) {
throw new EntityNotFoundException(sprintf('Given class... | [
"function",
"isEntity",
"(",
"string",
"$",
"classFQCN",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"classFQCN",
")",
")",
"{",
"throw",
"new",
"ClassNotFoundException",
"(",
"sprintf",
"(",
"'Given class FQCN \"%s\" does not exist.'",
",",... | Tests if a received class name is in fact a Doctrine Entity
Based on @link https://stackoverflow.com/a/27121978/1155833
@param string $classFQCN
@return boolean
@throws EntityNotFoundException | [
"Tests",
"if",
"a",
"received",
"class",
"name",
"is",
"in",
"fact",
"a",
"Doctrine",
"Entity"
] | ec5fb19e453824383b39570d15bd77b85cec3ca1 | https://github.com/rkeet/zf-doctrine-mvc/blob/ec5fb19e453824383b39570d15bd77b85cec3ca1/src/Controller/AbstractDoctrineActionController.php#L39-L54 |
204,496 | borobudur-php/borobudur | src/Borobudur/Component/Http/Request.php | Request.getBodyData | private function getBodyData(string $key, $default = null)
{
$body = $this->getParsedBody();
if (is_array($body)) {
return array_key_exists($key, $body) ? $body[$key] : $default;
}
if (is_object($body)) {
return property_exists($body, $key) ? $body->{$key} :... | php | private function getBodyData(string $key, $default = null)
{
$body = $this->getParsedBody();
if (is_array($body)) {
return array_key_exists($key, $body) ? $body[$key] : $default;
}
if (is_object($body)) {
return property_exists($body, $key) ? $body->{$key} :... | [
"private",
"function",
"getBodyData",
"(",
"string",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"body",
")",
")",
"{",
"return",
"arr... | Gets parsed body data with specified key.
@param string $key
@param mixed $default
@return mixed | [
"Gets",
"parsed",
"body",
"data",
"with",
"specified",
"key",
"."
] | 6ab0d97e1819ba0b96dc4c3bca3a7c9b1217bd44 | https://github.com/borobudur-php/borobudur/blob/6ab0d97e1819ba0b96dc4c3bca3a7c9b1217bd44/src/Borobudur/Component/Http/Request.php#L101-L114 |
204,497 | fxpio/fxp-doctrine-console | Command/Base.php | Base.showMessage | protected function showMessage(OutputInterface $output, $instance, $message)
{
$methodGet = $this->adapter->getDisplayNameMethod();
$output->writeln([
'',
sprintf($message, strtolower($this->adapter->getShortName()), $instance->$methodGet()),
]);
} | php | protected function showMessage(OutputInterface $output, $instance, $message)
{
$methodGet = $this->adapter->getDisplayNameMethod();
$output->writeln([
'',
sprintf($message, strtolower($this->adapter->getShortName()), $instance->$methodGet()),
]);
} | [
"protected",
"function",
"showMessage",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"instance",
",",
"$",
"message",
")",
"{",
"$",
"methodGet",
"=",
"$",
"this",
"->",
"adapter",
"->",
"getDisplayNameMethod",
"(",
")",
";",
"$",
"output",
"->",
"writ... | Show the message in the console output.
@param OutputInterface $output The console output
@param object $instance The object instance
@param string $message The displayed message | [
"Show",
"the",
"message",
"in",
"the",
"console",
"output",
"."
] | 2fc16d7a4eb0f247075c50de225ec2670ca5479a | https://github.com/fxpio/fxp-doctrine-console/blob/2fc16d7a4eb0f247075c50de225ec2670ca5479a/Command/Base.php#L123-L131 |
204,498 | hal-platform/hal-core | src/Repository/TargetRepository.php | TargetRepository.getGroupedTargets | public function getGroupedTargets(?Application $application = null): array
{
$environments = $this->getEntityManager()
->getRepository(Environment::class)
->findAll();
if ($application) {
$findBy = ['application' => $application];
} else {
$fi... | php | public function getGroupedTargets(?Application $application = null): array
{
$environments = $this->getEntityManager()
->getRepository(Environment::class)
->findAll();
if ($application) {
$findBy = ['application' => $application];
} else {
$fi... | [
"public",
"function",
"getGroupedTargets",
"(",
"?",
"Application",
"$",
"application",
"=",
"null",
")",
":",
"array",
"{",
"$",
"environments",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"getRepository",
"(",
"Environment",
"::",
"class",
... | Get all targets sorted into environments.
@param Application|null $application
@return array | [
"Get",
"all",
"targets",
"sorted",
"into",
"environments",
"."
] | 30d456f8392fc873301ad4217d2ae90436c67090 | https://github.com/hal-platform/hal-core/blob/30d456f8392fc873301ad4217d2ae90436c67090/src/Repository/TargetRepository.php#L50-L83 |
204,499 | ajaxtown/eaglehorn_framework | src/Eaglehorn/Template.php | Template._applyInjections | private function _applyInjections()
{
foreach ($this->injections as $head)
{
$tags = $this->_getInjectionString($head);
}
$this->template_markup = str_replace('</head>', $tags, $this->template_markup);
} | php | private function _applyInjections()
{
foreach ($this->injections as $head)
{
$tags = $this->_getInjectionString($head);
}
$this->template_markup = str_replace('</head>', $tags, $this->template_markup);
} | [
"private",
"function",
"_applyInjections",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"injections",
"as",
"$",
"head",
")",
"{",
"$",
"tags",
"=",
"$",
"this",
"->",
"_getInjectionString",
"(",
"$",
"head",
")",
";",
"}",
"$",
"this",
"->",
"t... | Insert the stored CSS links, JS, files and Meta into the HEAD | [
"Insert",
"the",
"stored",
"CSS",
"links",
"JS",
"files",
"and",
"Meta",
"into",
"the",
"HEAD"
] | 5e2a1456ff6c65b3925f1219f115d8a919930f52 | https://github.com/ajaxtown/eaglehorn_framework/blob/5e2a1456ff6c65b3925f1219f115d8a919930f52/src/Eaglehorn/Template.php#L137-L146 |
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.