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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8,800 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.arraySort | public static function arraySort( &$arrayToSort, $columnsToSort = array() )
{
// Convert to an array
if ( !empty( $columnsToSort ) && !is_array( $columnsToSort ) )
{
$columnsToSort = array($columnsToSort);
}
// Any fields?
if ( !empty( $columnsToSort ) )
... | php | public static function arraySort( &$arrayToSort, $columnsToSort = array() )
{
// Convert to an array
if ( !empty( $columnsToSort ) && !is_array( $columnsToSort ) )
{
$columnsToSort = array($columnsToSort);
}
// Any fields?
if ( !empty( $columnsToSort ) )
... | [
"public",
"static",
"function",
"arraySort",
"(",
"&",
"$",
"arrayToSort",
",",
"$",
"columnsToSort",
"=",
"array",
"(",
")",
")",
"{",
"//\tConvert to an array",
"if",
"(",
"!",
"empty",
"(",
"$",
"columnsToSort",
")",
"&&",
"!",
"is_array",
"(",
"$",
"... | Generic array sorter
To sort a column in descending order, assign 'desc' to the column's value in the defining array:
$_columnsToSort = array(
'date' => 'desc',
'lastName' => 'asc',
'firstName' => 'asc',
);
@param array $arrayToSort
@param array $columnsToSort Array of columns in $arrayToSort to sort.
@return boole... | [
"Generic",
"array",
"sorter"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L323-L362 |
8,801 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.array_multisort_column | public static function array_multisort_column( &$sourceArray, $column, $sortDirection = SORT_ASC )
{
$_sortColumn = array();
foreach ( $sourceArray as $_key => $_row )
{
$_sortColumn[$_key] = ( isset( $_row[$column] ) ? $_row[$column] : null );
}
return \array_m... | php | public static function array_multisort_column( &$sourceArray, $column, $sortDirection = SORT_ASC )
{
$_sortColumn = array();
foreach ( $sourceArray as $_key => $_row )
{
$_sortColumn[$_key] = ( isset( $_row[$column] ) ? $_row[$column] : null );
}
return \array_m... | [
"public",
"static",
"function",
"array_multisort_column",
"(",
"&",
"$",
"sourceArray",
",",
"$",
"column",
",",
"$",
"sortDirection",
"=",
"SORT_ASC",
")",
"{",
"$",
"_sortColumn",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"sourceArray",
"as",
"$"... | Sorts an array by a single column
@param array $sourceArray
@param string $column
@param int $sortDirection
@return bool | [
"Sorts",
"an",
"array",
"by",
"a",
"single",
"column"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L373-L383 |
8,802 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.strlen | public static function strlen( $string )
{
if ( false === ( $_encoding = static::mbSupported( $string ) ) )
{
return strlen( $string );
}
return mb_strwidth( $string, $_encoding );
} | php | public static function strlen( $string )
{
if ( false === ( $_encoding = static::mbSupported( $string ) ) )
{
return strlen( $string );
}
return mb_strwidth( $string, $_encoding );
} | [
"public",
"static",
"function",
"strlen",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"$",
"_encoding",
"=",
"static",
"::",
"mbSupported",
"(",
"$",
"string",
")",
")",
")",
"{",
"return",
"strlen",
"(",
"$",
"string",
")",
";",
... | Multibyte-aware strlen
Originally swiped from Symfony2 Console Application class private functions. Modified for Kisma use.
@param string $string
@return int | [
"Multibyte",
"-",
"aware",
"strlen",
"Originally",
"swiped",
"from",
"Symfony2",
"Console",
"Application",
"class",
"private",
"functions",
".",
"Modified",
"for",
"Kisma",
"use",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L393-L401 |
8,803 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.mbSupported | public static function mbSupported( $string = null )
{
$_encoding = false;
if ( !function_exists( 'mb_strwidth' ) || ( $string && false === ( $_encoding = mb_detect_encoding( $string ) ) ) )
{
return false;
}
return $_encoding;
} | php | public static function mbSupported( $string = null )
{
$_encoding = false;
if ( !function_exists( 'mb_strwidth' ) || ( $string && false === ( $_encoding = mb_detect_encoding( $string ) ) ) )
{
return false;
}
return $_encoding;
} | [
"public",
"static",
"function",
"mbSupported",
"(",
"$",
"string",
"=",
"null",
")",
"{",
"$",
"_encoding",
"=",
"false",
";",
"if",
"(",
"!",
"function_exists",
"(",
"'mb_strwidth'",
")",
"||",
"(",
"$",
"string",
"&&",
"false",
"===",
"(",
"$",
"_enc... | Checks if multi-byte is available and returns encoding of optional string. False otherwise.
@param string $string
@return bool|string | [
"Checks",
"if",
"multi",
"-",
"byte",
"is",
"available",
"and",
"returns",
"encoding",
"of",
"optional",
"string",
".",
"False",
"otherwise",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L459-L469 |
8,804 | synga-nl/inheritance-finder | src/Parser/PhpClassParser.php | PhpClassParser.parse | public function parse(PhpClass $phpClass, SplFileInfo $fileInfo) {
try {
$this->nodeVisitor->setPhpClass($phpClass);
$this->traverse($fileInfo->getContents(), [$this->nodeVisitor]);
$phpClass->setFile($fileInfo);
$phpClass->setLastModified((new \DateTime())->se... | php | public function parse(PhpClass $phpClass, SplFileInfo $fileInfo) {
try {
$this->nodeVisitor->setPhpClass($phpClass);
$this->traverse($fileInfo->getContents(), [$this->nodeVisitor]);
$phpClass->setFile($fileInfo);
$phpClass->setLastModified((new \DateTime())->se... | [
"public",
"function",
"parse",
"(",
"PhpClass",
"$",
"phpClass",
",",
"SplFileInfo",
"$",
"fileInfo",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"nodeVisitor",
"->",
"setPhpClass",
"(",
"$",
"phpClass",
")",
";",
"$",
"this",
"->",
"traverse",
"(",
"$",
... | Builds the cache
@param PhpClass $phpClass
@param SplFileInfo $fileInfo
@return \Synga\InheritanceFinder\PhpClass[] | [
"Builds",
"the",
"cache"
] | 52669ac662b58dfeb6142b2e1bffbfba6f17d4b0 | https://github.com/synga-nl/inheritance-finder/blob/52669ac662b58dfeb6142b2e1bffbfba6f17d4b0/src/Parser/PhpClassParser.php#L43-L61 |
8,805 | synga-nl/inheritance-finder | src/Parser/PhpClassParser.php | PhpClassParser.traverse | protected function traverse($content, array $nodeVisitors = []) {
$nodes = $this->phpParser->parse($content);
$traverser = new NodeTraverser;
$traverser->addVisitor(new NameResolver());
foreach ($nodeVisitors as $nodeVisitor) {
$traverser->addVisitor($nodeVisitor);
... | php | protected function traverse($content, array $nodeVisitors = []) {
$nodes = $this->phpParser->parse($content);
$traverser = new NodeTraverser;
$traverser->addVisitor(new NameResolver());
foreach ($nodeVisitors as $nodeVisitor) {
$traverser->addVisitor($nodeVisitor);
... | [
"protected",
"function",
"traverse",
"(",
"$",
"content",
",",
"array",
"$",
"nodeVisitors",
"=",
"[",
"]",
")",
"{",
"$",
"nodes",
"=",
"$",
"this",
"->",
"phpParser",
"->",
"parse",
"(",
"$",
"content",
")",
";",
"$",
"traverser",
"=",
"new",
"Node... | Traverse the parser nodes so we can extract the information
@param $content
@param array $nodeVisitors
@internal param bool $addInterface | [
"Traverse",
"the",
"parser",
"nodes",
"so",
"we",
"can",
"extract",
"the",
"information"
] | 52669ac662b58dfeb6142b2e1bffbfba6f17d4b0 | https://github.com/synga-nl/inheritance-finder/blob/52669ac662b58dfeb6142b2e1bffbfba6f17d4b0/src/Parser/PhpClassParser.php#L70-L81 |
8,806 | asbsoft/yii2module-news_1b_160430 | models/News.php | News.correctSavedData | protected function correctSavedData($insert)
{
if ($insert) {
$tzShiftSec = intval(date('Z')); // server time zone shift in seconds: west UTC <0, east UTC >0
if (!empty($tzShiftSec)) {//var_dump($tzShiftSec);exit;
$now = new Expression("DATE_SUB(NOW(), INTERVAL {$tzS... | php | protected function correctSavedData($insert)
{
if ($insert) {
$tzShiftSec = intval(date('Z')); // server time zone shift in seconds: west UTC <0, east UTC >0
if (!empty($tzShiftSec)) {//var_dump($tzShiftSec);exit;
$now = new Expression("DATE_SUB(NOW(), INTERVAL {$tzS... | [
"protected",
"function",
"correctSavedData",
"(",
"$",
"insert",
")",
"{",
"if",
"(",
"$",
"insert",
")",
"{",
"$",
"tzShiftSec",
"=",
"intval",
"(",
"date",
"(",
"'Z'",
")",
")",
";",
"// server time zone shift in seconds: west UTC <0, east UTC >0",
"if",
"(",
... | Data correction immediatly before save.
Datetime fields will convert into Expression-class. | [
"Data",
"correction",
"immediatly",
"before",
"save",
".",
"Datetime",
"fields",
"will",
"convert",
"into",
"Expression",
"-",
"class",
"."
] | ce64b1e70c5a57b572921945cc51384087905461 | https://github.com/asbsoft/yii2module-news_1b_160430/blob/ce64b1e70c5a57b572921945cc51384087905461/models/News.php#L147-L170 |
8,807 | asbsoft/yii2module-news_1b_160430 | models/News.php | News.prepareI18nModels | public static function prepareI18nModels($model)
{//echo __METHOD__;var_dump($model->attributes);
//$languages = LangHelper::activeLanguages();//var_dump($languages);
//$config = Module::getModuleConfigByClassname(Module::className());//var_dump($config);
//$langHelper = $config['params']['l... | php | public static function prepareI18nModels($model)
{//echo __METHOD__;var_dump($model->attributes);
//$languages = LangHelper::activeLanguages();//var_dump($languages);
//$config = Module::getModuleConfigByClassname(Module::className());//var_dump($config);
//$langHelper = $config['params']['l... | [
"public",
"static",
"function",
"prepareI18nModels",
"(",
"$",
"model",
")",
"{",
"//echo __METHOD__;var_dump($model->attributes);",
"//$languages = LangHelper::activeLanguages();//var_dump($languages);",
"//$config = Module::getModuleConfigByClassname(Module::className());//var_dump($config);... | Prepare multilang models array.
@return array of NewsI18n | [
"Prepare",
"multilang",
"models",
"array",
"."
] | ce64b1e70c5a57b572921945cc51384087905461 | https://github.com/asbsoft/yii2module-news_1b_160430/blob/ce64b1e70c5a57b572921945cc51384087905461/models/News.php#L291-L330 |
8,808 | asbsoft/yii2module-news_1b_160430 | models/News.php | News.correctI18nBodies | public static function correctI18nBodies($modelsI18n)
{
$module = Module::getModuleByClassname(Module::className());
$contentHelperClass = $module->contentHelper;
foreach ($modelsI18n as $modelI18n) {//var_dump($modelI18n->attributes);exit;
$modelI18n->body = $contentHelperClass... | php | public static function correctI18nBodies($modelsI18n)
{
$module = Module::getModuleByClassname(Module::className());
$contentHelperClass = $module->contentHelper;
foreach ($modelsI18n as $modelI18n) {//var_dump($modelI18n->attributes);exit;
$modelI18n->body = $contentHelperClass... | [
"public",
"static",
"function",
"correctI18nBodies",
"(",
"$",
"modelsI18n",
")",
"{",
"$",
"module",
"=",
"Module",
"::",
"getModuleByClassname",
"(",
"Module",
"::",
"className",
"(",
")",
")",
";",
"$",
"contentHelperClass",
"=",
"$",
"module",
"->",
"con... | Use ContentHelper to correct texts after visual editor.
Need as independent method to repeat run after unsuccessful validation. | [
"Use",
"ContentHelper",
"to",
"correct",
"texts",
"after",
"visual",
"editor",
".",
"Need",
"as",
"independent",
"method",
"to",
"repeat",
"run",
"after",
"unsuccessful",
"validation",
"."
] | ce64b1e70c5a57b572921945cc51384087905461 | https://github.com/asbsoft/yii2module-news_1b_160430/blob/ce64b1e70c5a57b572921945cc51384087905461/models/News.php#L336-L345 |
8,809 | asbsoft/yii2module-news_1b_160430 | models/News.php | News.deleteFiles | protected function deleteFiles($id)
{//echo __METHOD__."($id)";
$subdir = static::getImageSubdir($id);
if (!empty($this->module->params['uploadsNewsDir'])) {
$uploadsDir = Yii::getAlias($this->module->params['uploadsNewsDir']) . '/' . $subdir;//var_dump($uploadsDir);
//@FileH... | php | protected function deleteFiles($id)
{//echo __METHOD__."($id)";
$subdir = static::getImageSubdir($id);
if (!empty($this->module->params['uploadsNewsDir'])) {
$uploadsDir = Yii::getAlias($this->module->params['uploadsNewsDir']) . '/' . $subdir;//var_dump($uploadsDir);
//@FileH... | [
"protected",
"function",
"deleteFiles",
"(",
"$",
"id",
")",
"{",
"//echo __METHOD__.\"($id)\";",
"$",
"subdir",
"=",
"static",
"::",
"getImageSubdir",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"module",
"->",
"params",
"... | Delete uploaded files connected with the model.
@param integet $id model id | [
"Delete",
"uploaded",
"files",
"connected",
"with",
"the",
"model",
"."
] | ce64b1e70c5a57b572921945cc51384087905461 | https://github.com/asbsoft/yii2module-news_1b_160430/blob/ce64b1e70c5a57b572921945cc51384087905461/models/News.php#L381-L394 |
8,810 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/session/redis.php | Session_Redis._write_redis | protected function _write_redis($session_id, $payload)
{
// write it to the redis server
$this->redis->set($session_id, $payload);
$this->redis->expire($session_id, $this->config['expiration_time']);
} | php | protected function _write_redis($session_id, $payload)
{
// write it to the redis server
$this->redis->set($session_id, $payload);
$this->redis->expire($session_id, $this->config['expiration_time']);
} | [
"protected",
"function",
"_write_redis",
"(",
"$",
"session_id",
",",
"$",
"payload",
")",
"{",
"// write it to the redis server",
"$",
"this",
"->",
"redis",
"->",
"set",
"(",
"$",
"session_id",
",",
"$",
"payload",
")",
";",
"$",
"this",
"->",
"redis",
"... | Writes the redis entry
@access private
@return boolean, true if it was an existing session, false if not | [
"Writes",
"the",
"redis",
"entry"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/session/redis.php#L233-L238 |
8,811 | kirkbowers/sphec | src/Context.php | Context.describe | public function describe($label, $block) {
return $this->_tests[] = new Context($label, $block, $this->_indent . ' ', $this);
} | php | public function describe($label, $block) {
return $this->_tests[] = new Context($label, $block, $this->_indent . ' ', $this);
} | [
"public",
"function",
"describe",
"(",
"$",
"label",
",",
"$",
"block",
")",
"{",
"return",
"$",
"this",
"->",
"_tests",
"[",
"]",
"=",
"new",
"Context",
"(",
"$",
"label",
",",
"$",
"block",
",",
"$",
"this",
"->",
"_indent",
".",
"' '",
",",
"... | Creates a new subcontext.
Usually this is used to group together tests on a sub-feature such as a method of
a class.
@param $label A string label of what is being described.
@param $block An anonymous function that performs all the specifying and testing
for this subcontext. It should take one parameter, which will ... | [
"Creates",
"a",
"new",
"subcontext",
"."
] | e1b849aac683fd07eae2e344faad0a00f559e1eb | https://github.com/kirkbowers/sphec/blob/e1b849aac683fd07eae2e344faad0a00f559e1eb/src/Context.php#L38-L40 |
8,812 | kirkbowers/sphec | src/Context.php | Context.it | public function it($label, $block) {
return $this->_tests[] = new Example($label, $block, $this->_indent . ' ', $this);
} | php | public function it($label, $block) {
return $this->_tests[] = new Example($label, $block, $this->_indent . ' ', $this);
} | [
"public",
"function",
"it",
"(",
"$",
"label",
",",
"$",
"block",
")",
"{",
"return",
"$",
"this",
"->",
"_tests",
"[",
"]",
"=",
"new",
"Example",
"(",
"$",
"label",
",",
"$",
"block",
",",
"$",
"this",
"->",
"_indent",
".",
"' '",
",",
"$",
... | Creates a new example.
This is where individual tests are performed. The label should describe
what is to be expected in this test in a sentence that follows "it".
(Eg. "It" "should evaluate to true in this situation.")
@param $label A string label of what is being expected.
@param $block An anonymous function that ... | [
"Creates",
"a",
"new",
"example",
"."
] | e1b849aac683fd07eae2e344faad0a00f559e1eb | https://github.com/kirkbowers/sphec/blob/e1b849aac683fd07eae2e344faad0a00f559e1eb/src/Context.php#L95-L97 |
8,813 | kirkbowers/sphec | src/Context.php | Context.run | public function run() {
if ($this->_expector->output && $this->_expector->output->isVerbose()) {
$this->_expector->output->writeln($this->_indent . $this->_label);
}
foreach ($this->_tests as $test) {
$test->run();
}
} | php | public function run() {
if ($this->_expector->output && $this->_expector->output->isVerbose()) {
$this->_expector->output->writeln($this->_indent . $this->_label);
}
foreach ($this->_tests as $test) {
$test->run();
}
} | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_expector",
"->",
"output",
"&&",
"$",
"this",
"->",
"_expector",
"->",
"output",
"->",
"isVerbose",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_expector",
"->",
"output",
"->",
... | Runs all the tests in this scope. | [
"Runs",
"all",
"the",
"tests",
"in",
"this",
"scope",
"."
] | e1b849aac683fd07eae2e344faad0a00f559e1eb | https://github.com/kirkbowers/sphec/blob/e1b849aac683fd07eae2e344faad0a00f559e1eb/src/Context.php#L136-L144 |
8,814 | marando/phpSOFA | src/Marando/IAU/iauC2ixys.php | iauC2ixys.C2ixys | public static function C2ixys($x, $y, $s, array &$rc2i) {
$r2;
$e;
$d;
/* Obtain the spherical angles E and d. */
$r2 = $x * $x + $y * $y;
$e = ($r2 > 0.0) ? atan2($y, $x) : 0.0;
$d = atan(sqrt($r2 / (1.0 - $r2)));
/* Form the matrix. */
IAU::Ir($rc2i);
IAU::Rz($e, $rc2i);
... | php | public static function C2ixys($x, $y, $s, array &$rc2i) {
$r2;
$e;
$d;
/* Obtain the spherical angles E and d. */
$r2 = $x * $x + $y * $y;
$e = ($r2 > 0.0) ? atan2($y, $x) : 0.0;
$d = atan(sqrt($r2 / (1.0 - $r2)));
/* Form the matrix. */
IAU::Ir($rc2i);
IAU::Rz($e, $rc2i);
... | [
"public",
"static",
"function",
"C2ixys",
"(",
"$",
"x",
",",
"$",
"y",
",",
"$",
"s",
",",
"array",
"&",
"$",
"rc2i",
")",
"{",
"$",
"r2",
";",
"$",
"e",
";",
"$",
"d",
";",
"/* Obtain the spherical angles E and d. */",
"$",
"r2",
"=",
"$",
"x",
... | - - - - - - - - - -
i a u C 2 i x y s
- - - - - - - - - -
Form the celestial to intermediate-frame-of-date matrix given the CIP
X,Y and the CIO locator s.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: support function.
Given:
... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"C",
"2",
"i",
"x",
"y",
"s",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauC2ixys.php#L64-L81 |
8,815 | hametuha/hametwoo | src/Hametuha/HametWoo/Utility/UniqueId.php | UniqueId.generate | public static function generate( $length = 16 ) {
if ( function_exists( 'random_bytes' ) ) {
return bin2hex( random_bytes( $length ) );
} elseif ( function_exists( 'openssl_random_pseudo_bytes' ) ) {
return bin2hex( openssl_random_pseudo_bytes( $length ) );
} else {
$id = uniqid();
$hash = '';
$str... | php | public static function generate( $length = 16 ) {
if ( function_exists( 'random_bytes' ) ) {
return bin2hex( random_bytes( $length ) );
} elseif ( function_exists( 'openssl_random_pseudo_bytes' ) ) {
return bin2hex( openssl_random_pseudo_bytes( $length ) );
} else {
$id = uniqid();
$hash = '';
$str... | [
"public",
"static",
"function",
"generate",
"(",
"$",
"length",
"=",
"16",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'random_bytes'",
")",
")",
"{",
"return",
"bin2hex",
"(",
"random_bytes",
"(",
"$",
"length",
")",
")",
";",
"}",
"elseif",
"(",
"f... | Generate unique ID
@param int $length Length of id. Default 16.
@return string | [
"Generate",
"unique",
"ID"
] | bcd5948ea53d6ca2181873a9f9d0d221c346592e | https://github.com/hametuha/hametwoo/blob/bcd5948ea53d6ca2181873a9f9d0d221c346592e/src/Hametuha/HametWoo/Utility/UniqueId.php#L27-L46 |
8,816 | cawaphp/module-swagger-server | src/ExamplesService/Type.php | Type.string | public function string(int $length = 8)
{
$list = 'abcdefghijklmnopqrstuvwxyz';
$return = '';
for ($i = 0; $i < $length; $i++) {
$return .= $list[rand(0, strlen($list) - 1)];
}
return $return;
} | php | public function string(int $length = 8)
{
$list = 'abcdefghijklmnopqrstuvwxyz';
$return = '';
for ($i = 0; $i < $length; $i++) {
$return .= $list[rand(0, strlen($list) - 1)];
}
return $return;
} | [
"public",
"function",
"string",
"(",
"int",
"$",
"length",
"=",
"8",
")",
"{",
"$",
"list",
"=",
"'abcdefghijklmnopqrstuvwxyz'",
";",
"$",
"return",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"length",
";",
"$",
"i",... | Return a simple random string.
taken from character list : 0123456789abcdefghijklmnopqrstuvwxyz
@httpmethod GET
@auth None
@param int $length the length of generated string
@return string the generated random string | [
"Return",
"a",
"simple",
"random",
"string",
"."
] | 809d541254e8a839938bb49bcc9e91d61d0879a8 | https://github.com/cawaphp/module-swagger-server/blob/809d541254e8a839938bb49bcc9e91d61d0879a8/src/ExamplesService/Type.php#L34-L43 |
8,817 | cawaphp/module-swagger-server | src/ExamplesService/Type.php | Type.integer | public function integer(int $min, int $max)
{
if ($max < $min) {
throw new ResponseCode('max must be greater than min', 422);
}
return rand($min, $max);
} | php | public function integer(int $min, int $max)
{
if ($max < $min) {
throw new ResponseCode('max must be greater than min', 422);
}
return rand($min, $max);
} | [
"public",
"function",
"integer",
"(",
"int",
"$",
"min",
",",
"int",
"$",
"max",
")",
"{",
"if",
"(",
"$",
"max",
"<",
"$",
"min",
")",
"{",
"throw",
"new",
"ResponseCode",
"(",
"'max must be greater than min'",
",",
"422",
")",
";",
"}",
"return",
"... | Return a random integer.
taken between $min and $max value
@httpmethod GET
@auth None
@param int $min the min value @validation(gte:0|lte:20)
@param int $max the max value @validation(gte:0|lt:20)
@throws ResponseCode 422 max must be greater than min
@return int | [
"Return",
"a",
"random",
"integer",
"."
] | 809d541254e8a839938bb49bcc9e91d61d0879a8 | https://github.com/cawaphp/module-swagger-server/blob/809d541254e8a839938bb49bcc9e91d61d0879a8/src/ExamplesService/Type.php#L60-L67 |
8,818 | cawaphp/module-swagger-server | src/ExamplesService/Type.php | Type.float | public function float(float $min, float $max)
{
if ($max < $min) {
throw new ResponseCode('max must be greater than min', 422);
}
return rand((int) $min * 100, (int) $max * 100) / 100;
} | php | public function float(float $min, float $max)
{
if ($max < $min) {
throw new ResponseCode('max must be greater than min', 422);
}
return rand((int) $min * 100, (int) $max * 100) / 100;
} | [
"public",
"function",
"float",
"(",
"float",
"$",
"min",
",",
"float",
"$",
"max",
")",
"{",
"if",
"(",
"$",
"max",
"<",
"$",
"min",
")",
"{",
"throw",
"new",
"ResponseCode",
"(",
"'max must be greater than min'",
",",
"422",
")",
";",
"}",
"return",
... | Return a random float.
with 2 decimal taken between $min and $max value
@httpmethod GET
@auth None
@param float $min the min value @validation(gte:0|lte:20)
@param float $max the max value @validation(gte:0|lt:20)
@throws ResponseCode 422 max must be greater than min
@return float the generated value | [
"Return",
"a",
"random",
"float",
"."
] | 809d541254e8a839938bb49bcc9e91d61d0879a8 | https://github.com/cawaphp/module-swagger-server/blob/809d541254e8a839938bb49bcc9e91d61d0879a8/src/ExamplesService/Type.php#L84-L91 |
8,819 | cawaphp/module-swagger-server | src/ExamplesService/Type.php | Type.object | public function object(float $min, float $max)
{
$populate = function (bool $extended = false) use ($min, $max) {
$class = 'Cawa\\SwaggerServer\\ExamplesService\\' . ($extended ? 'ObjectExtended' : 'Object');
$object = new $class();
$object->string = $this->String((int) $... | php | public function object(float $min, float $max)
{
$populate = function (bool $extended = false) use ($min, $max) {
$class = 'Cawa\\SwaggerServer\\ExamplesService\\' . ($extended ? 'ObjectExtended' : 'Object');
$object = new $class();
$object->string = $this->String((int) $... | [
"public",
"function",
"object",
"(",
"float",
"$",
"min",
",",
"float",
"$",
"max",
")",
"{",
"$",
"populate",
"=",
"function",
"(",
"bool",
"$",
"extended",
"=",
"false",
")",
"use",
"(",
"$",
"min",
",",
"$",
"max",
")",
"{",
"$",
"class",
"=",... | Return a random object.
with all possible primitive type
@httpmethod GET
@auth None
@param float $min the min value @validation(gte:0|lte:20)
@param float $max the max value @validation(gte:0|lt:20)
@throws ResponseCode 422 max must be greater than min
@return \Cawa\SwaggerServer\ExamplesService\Object | [
"Return",
"a",
"random",
"object",
"."
] | 809d541254e8a839938bb49bcc9e91d61d0879a8 | https://github.com/cawaphp/module-swagger-server/blob/809d541254e8a839938bb49bcc9e91d61d0879a8/src/ExamplesService/Type.php#L136-L172 |
8,820 | nowzoo/wp-utils | src/NowZoo/WPUtils/WPUtils.php | WPUtils.trim_stripslashes_deep | public static function trim_stripslashes_deep($value){
if ( is_array($value) ) {
$value = array_map(array(get_called_class(), 'trim_stripslashes_deep'), $value);
} elseif ( is_object($value) ) {
$vars = get_object_vars( $value );
foreach ($vars as $key=>$data) {
... | php | public static function trim_stripslashes_deep($value){
if ( is_array($value) ) {
$value = array_map(array(get_called_class(), 'trim_stripslashes_deep'), $value);
} elseif ( is_object($value) ) {
$vars = get_object_vars( $value );
foreach ($vars as $key=>$data) {
... | [
"public",
"static",
"function",
"trim_stripslashes_deep",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array_map",
"(",
"array",
"(",
"get_called_class",
"(",
")",
",",
"'trim_stripslashes_deep'",
... | Provides a replacement for WP's native stripslashes_deep
function, which, frustratingly, doesn't trim
@param $value
@return array|object|string | [
"Provides",
"a",
"replacement",
"for",
"WP",
"s",
"native",
"stripslashes_deep",
"function",
"which",
"frustratingly",
"doesn",
"t",
"trim"
] | 4d0bba292cc86958374da4ddff0956200f154b85 | https://github.com/nowzoo/wp-utils/blob/4d0bba292cc86958374da4ddff0956200f154b85/src/NowZoo/WPUtils/WPUtils.php#L22-L34 |
8,821 | DerekMarcinyshyn/monashee-backup | src/Monashee/Backup/Database.php | Database.checkMysqlConnection | private function checkMysqlConnection() {
$this->connection = new \mysqli(
$this->config->get('backup::config')['BACKUP_MYSQL_HOST'],
$this->config->get('backup::config')['BACKUP_MYSQL_USER'],
$this->config->get('backup::config')['BACKUP_MYSQL_PASSWORD']);
if ($this-... | php | private function checkMysqlConnection() {
$this->connection = new \mysqli(
$this->config->get('backup::config')['BACKUP_MYSQL_HOST'],
$this->config->get('backup::config')['BACKUP_MYSQL_USER'],
$this->config->get('backup::config')['BACKUP_MYSQL_PASSWORD']);
if ($this-... | [
"private",
"function",
"checkMysqlConnection",
"(",
")",
"{",
"$",
"this",
"->",
"connection",
"=",
"new",
"\\",
"mysqli",
"(",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'backup::config'",
")",
"[",
"'BACKUP_MYSQL_HOST'",
"]",
",",
"$",
"this",
"->",... | Check MySQL Connection
@return bool
@throws \Exception | [
"Check",
"MySQL",
"Connection"
] | 2f96f3ddbbdd1c672e0064bf3b66951f94975158 | https://github.com/DerekMarcinyshyn/monashee-backup/blob/2f96f3ddbbdd1c672e0064bf3b66951f94975158/src/Monashee/Backup/Database.php#L75-L91 |
8,822 | indigophp-archive/fuel-core | classes/Controller/TemplateController.php | TemplateController.view | protected function view($view, $data = [], $auto_filter = null)
{
return \View::forge($view, $data, $auto_filter);
} | php | protected function view($view, $data = [], $auto_filter = null)
{
return \View::forge($view, $data, $auto_filter);
} | [
"protected",
"function",
"view",
"(",
"$",
"view",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"auto_filter",
"=",
"null",
")",
"{",
"return",
"\\",
"View",
"::",
"forge",
"(",
"$",
"view",
",",
"$",
"data",
",",
"$",
"auto_filter",
")",
";",
"}"
... | Creates a new View object
@see View::forge
@return View | [
"Creates",
"a",
"new",
"View",
"object"
] | 275462154fb7937f8e1c2c541b31d8e7c5760e39 | https://github.com/indigophp-archive/fuel-core/blob/275462154fb7937f8e1c2c541b31d8e7c5760e39/classes/Controller/TemplateController.php#L56-L59 |
8,823 | webriq/core | module/Customize/src/Grid/Customize/Controller/CssAdminController.php | CssAdminController.editAction | public function editAction()
{
/* @var $form \Zork\Form\Form */
/* @var $model \Grid\Customize\Model\Sheet\Model */
$params = $this->params();
$request = $this->getRequest();
$locator = $this->getServiceLocator();
$id = $params->fromRoute( 'id' );
... | php | public function editAction()
{
/* @var $form \Zork\Form\Form */
/* @var $model \Grid\Customize\Model\Sheet\Model */
$params = $this->params();
$request = $this->getRequest();
$locator = $this->getServiceLocator();
$id = $params->fromRoute( 'id' );
... | [
"public",
"function",
"editAction",
"(",
")",
"{",
"/* @var $form \\Zork\\Form\\Form */",
"/* @var $model \\Grid\\Customize\\Model\\Sheet\\Model */",
"$",
"params",
"=",
"$",
"this",
"->",
"params",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
... | Edit a css | [
"Edit",
"a",
"css"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Controller/CssAdminController.php#L53-L105 |
8,824 | webriq/core | module/Customize/src/Grid/Customize/Controller/CssAdminController.php | CssAdminController.previewAction | public function previewAction()
{
/* @var $form \Zork\Form\Form */
/* @var $model \Grid\Customize\Model\Sheet\Model */
$params = $this->params();
$request = $this->getRequest();
$locator = $this->getServiceLocator();
$id = $params->fromRoute( 'id' );... | php | public function previewAction()
{
/* @var $form \Zork\Form\Form */
/* @var $model \Grid\Customize\Model\Sheet\Model */
$params = $this->params();
$request = $this->getRequest();
$locator = $this->getServiceLocator();
$id = $params->fromRoute( 'id' );... | [
"public",
"function",
"previewAction",
"(",
")",
"{",
"/* @var $form \\Zork\\Form\\Form */",
"/* @var $model \\Grid\\Customize\\Model\\Sheet\\Model */",
"$",
"params",
"=",
"$",
"this",
"->",
"params",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest... | Preview a css | [
"Preview",
"a",
"css"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Controller/CssAdminController.php#L110-L181 |
8,825 | webriq/core | module/Customize/src/Grid/Customize/Controller/CssAdminController.php | CssAdminController.cancelAction | public function cancelAction()
{
/* @var $cssPreview \Grid\Customize\Service\CssPreview */
$params = $this->params();
$locator = $this->getServiceLocator();
$cssPreview = $locator->get( 'Grid\Customize\Service\CssPreview' );
$id = $params->fromRoute( 'id' );
... | php | public function cancelAction()
{
/* @var $cssPreview \Grid\Customize\Service\CssPreview */
$params = $this->params();
$locator = $this->getServiceLocator();
$cssPreview = $locator->get( 'Grid\Customize\Service\CssPreview' );
$id = $params->fromRoute( 'id' );
... | [
"public",
"function",
"cancelAction",
"(",
")",
"{",
"/* @var $cssPreview \\Grid\\Customize\\Service\\CssPreview */",
"$",
"params",
"=",
"$",
"this",
"->",
"params",
"(",
")",
";",
"$",
"locator",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
";",
"$",... | Cancel an edit of a css | [
"Cancel",
"an",
"edit",
"of",
"a",
"css"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Controller/CssAdminController.php#L186-L205 |
8,826 | webriq/core | module/Customize/src/Grid/Customize/Controller/CssAdminController.php | CssAdminController.resetPreviewsAction | public function resetPreviewsAction()
{
/* @var $cssPreview \Grid\Customize\Service\CssPreview */
$cssPreview = $this->getServiceLocator()
->get( 'Grid\Customize\Service\CssPreview' );
foreach ( $cssPreview->getPreviews() as $url )
{
@ unlink( ... | php | public function resetPreviewsAction()
{
/* @var $cssPreview \Grid\Customize\Service\CssPreview */
$cssPreview = $this->getServiceLocator()
->get( 'Grid\Customize\Service\CssPreview' );
foreach ( $cssPreview->getPreviews() as $url )
{
@ unlink( ... | [
"public",
"function",
"resetPreviewsAction",
"(",
")",
"{",
"/* @var $cssPreview \\Grid\\Customize\\Service\\CssPreview */",
"$",
"cssPreview",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'Grid\\Customize\\Service\\CssPreview'",
")",
";",
"fo... | Reset all previews | [
"Reset",
"all",
"previews"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Controller/CssAdminController.php#L210-L229 |
8,827 | gomaframework/GomaLogging | src/ExceptionLogger.php | ExceptionLogger.handleException | public static function handleException($exception)
{
$message = get_class($exception) . " " . $exception->getCode() . ":\n\n" . $exception->getMessage() . "\n" .
self::exception_get_dev_message($exception) . " in " .
$exception->getFile() . " on line " . $exception->getLine() . ".\n\... | php | public static function handleException($exception)
{
$message = get_class($exception) . " " . $exception->getCode() . ":\n\n" . $exception->getMessage() . "\n" .
self::exception_get_dev_message($exception) . " in " .
$exception->getFile() . " on line " . $exception->getLine() . ".\n\... | [
"public",
"static",
"function",
"handleException",
"(",
"$",
"exception",
")",
"{",
"$",
"message",
"=",
"get_class",
"(",
"$",
"exception",
")",
".",
"\" \"",
".",
"$",
"exception",
"->",
"getCode",
"(",
")",
".",
"\":\\n\\n\"",
".",
"$",
"exception",
"... | At this point exceptions can be handled.
Return true if exception was handled and default handling or handling by others should be stopped.
@param Throwable $exception
@return bool|null | [
"At",
"this",
"point",
"exceptions",
"can",
"be",
"handled",
".",
"Return",
"true",
"if",
"exception",
"was",
"handled",
"and",
"default",
"handling",
"or",
"handling",
"by",
"others",
"should",
"be",
"stopped",
"."
] | 86b9b8b1734e6c5094b39fee52164ce56cc299f5 | https://github.com/gomaframework/GomaLogging/blob/86b9b8b1734e6c5094b39fee52164ce56cc299f5/src/ExceptionLogger.php#L44-L71 |
8,828 | laradic/service-provider | src/Plugins/Providers.php | Providers.startProvidersPlugin | protected function startProvidersPlugin($app)
{
switch ($this->registerProvidersOn) {
case 'register':
$this->onRegister('providers', function () {
$this->handleProviders();
});
break;
case 'booting':
... | php | protected function startProvidersPlugin($app)
{
switch ($this->registerProvidersOn) {
case 'register':
$this->onRegister('providers', function () {
$this->handleProviders();
});
break;
case 'booting':
... | [
"protected",
"function",
"startProvidersPlugin",
"(",
"$",
"app",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"registerProvidersOn",
")",
"{",
"case",
"'register'",
":",
"$",
"this",
"->",
"onRegister",
"(",
"'providers'",
",",
"function",
"(",
")",
"{",
"... | startProvidersPlugin method.
@param \Illuminate\Foundation\Application $app | [
"startProvidersPlugin",
"method",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/Plugins/Providers.php#L58-L85 |
8,829 | laradic/service-provider | src/Plugins/Providers.php | Providers.handleProviders | protected function handleProviders()
{
// register deferred providers
foreach ($this->deferredProviders as $provider) {
$this->app->registerDeferredProvider($provider);
}
if ($this->registerProvidersMethod === 'register') {
$this->registerProviders();
... | php | protected function handleProviders()
{
// register deferred providers
foreach ($this->deferredProviders as $provider) {
$this->app->registerDeferredProvider($provider);
}
if ($this->registerProvidersMethod === 'register') {
$this->registerProviders();
... | [
"protected",
"function",
"handleProviders",
"(",
")",
"{",
"// register deferred providers",
"foreach",
"(",
"$",
"this",
"->",
"deferredProviders",
"as",
"$",
"provider",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"registerDeferredProvider",
"(",
"$",
"provider",
... | handleProviders method. | [
"handleProviders",
"method",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/Plugins/Providers.php#L90-L104 |
8,830 | laradic/service-provider | src/Plugins/Providers.php | Providers.resolveProviders | protected function resolveProviders()
{
foreach ($this->providers as $provider) {
$resolved = $this->resolveProvider($registered[] = $provider);
$resolved->register();
if ($this->registerProvidersOn === 'boot') {
$this->app->call([$provider, 'boot']);
... | php | protected function resolveProviders()
{
foreach ($this->providers as $provider) {
$resolved = $this->resolveProvider($registered[] = $provider);
$resolved->register();
if ($this->registerProvidersOn === 'boot') {
$this->app->call([$provider, 'boot']);
... | [
"protected",
"function",
"resolveProviders",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"providers",
"as",
"$",
"provider",
")",
"{",
"$",
"resolved",
"=",
"$",
"this",
"->",
"resolveProvider",
"(",
"$",
"registered",
"[",
"]",
"=",
"$",
"provider... | resolveProviders method. | [
"resolveProviders",
"method",
"."
] | b1428d566b97b3662b405c64ff0cad8a89102033 | https://github.com/laradic/service-provider/blob/b1428d566b97b3662b405c64ff0cad8a89102033/src/Plugins/Providers.php#L119-L128 |
8,831 | GrupaZero/core | src/Gzero/Core/Services/LanguageService.php | LanguageService.getByCode | public function getByCode($code)
{
return $this->languages->filter(
function ($language) use ($code) {
return $language->code == $code;
}
)->first();
} | php | public function getByCode($code)
{
return $this->languages->filter(
function ($language) use ($code) {
return $language->code == $code;
}
)->first();
} | [
"public",
"function",
"getByCode",
"(",
"$",
"code",
")",
"{",
"return",
"$",
"this",
"->",
"languages",
"->",
"filter",
"(",
"function",
"(",
"$",
"language",
")",
"use",
"(",
"$",
"code",
")",
"{",
"return",
"$",
"language",
"->",
"code",
"==",
"$"... | Get lang by lang code
@param string $code Lang code eg. "en"
@return \Gzero\Core\Models\Language | [
"Get",
"lang",
"by",
"lang",
"code"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Services/LanguageService.php#L43-L50 |
8,832 | glendmaatita/Tolkien | src/Tolkien/Init.php | Init.create | public function create()
{
$blog_dir = getcwd() . '/' . $this->name . '/';
$this->createBlogDirectory($blog_dir);
$this->createConfigFile($blog_dir);
$this->createTemplateFile($blog_dir);
} | php | public function create()
{
$blog_dir = getcwd() . '/' . $this->name . '/';
$this->createBlogDirectory($blog_dir);
$this->createConfigFile($blog_dir);
$this->createTemplateFile($blog_dir);
} | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"blog_dir",
"=",
"getcwd",
"(",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"name",
".",
"'/'",
";",
"$",
"this",
"->",
"createBlogDirectory",
"(",
"$",
"blog_dir",
")",
";",
"$",
"this",
"->",
"crea... | Create blog app with all its mandatory folder
@return void | [
"Create",
"blog",
"app",
"with",
"all",
"its",
"mandatory",
"folder"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/Init.php#L36-L42 |
8,833 | glendmaatita/Tolkien | src/Tolkien/Init.php | Init.createBlogDirectory | public function createBlogDirectory($blog_dir)
{
@mkdir($blog_dir , 0777, true );
$this->config = $this->configContent( $blog_dir );
@mkdir( $this->config['dir']['post'], 0777, true );
@mkdir( $this->config['dir']['page'], 0777, true );
@mkdir( $this->config['dir']['site'], 0777, true );
@mkdir( $this->con... | php | public function createBlogDirectory($blog_dir)
{
@mkdir($blog_dir , 0777, true );
$this->config = $this->configContent( $blog_dir );
@mkdir( $this->config['dir']['post'], 0777, true );
@mkdir( $this->config['dir']['page'], 0777, true );
@mkdir( $this->config['dir']['site'], 0777, true );
@mkdir( $this->con... | [
"public",
"function",
"createBlogDirectory",
"(",
"$",
"blog_dir",
")",
"{",
"@",
"mkdir",
"(",
"$",
"blog_dir",
",",
"0777",
",",
"true",
")",
";",
"$",
"this",
"->",
"config",
"=",
"$",
"this",
"->",
"configContent",
"(",
"$",
"blog_dir",
")",
";",
... | Create Blog App Directories
@return void | [
"Create",
"Blog",
"App",
"Directories"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/Init.php#L49-L58 |
8,834 | glendmaatita/Tolkien | src/Tolkien/Init.php | Init.createTemplateFile | public function createTemplateFile()
{
// css
if (!is_dir($this->config['dir']['asset'] . '/css')) {
// dir doesn't exist, make it
mkdir($this->config['dir']['asset'] . '/css');
}
//js
if (!is_dir($this->config['dir']['asset'] . '/js')) {
mkdir($this->config['dir']['asset'] . '/js');
}
//... | php | public function createTemplateFile()
{
// css
if (!is_dir($this->config['dir']['asset'] . '/css')) {
// dir doesn't exist, make it
mkdir($this->config['dir']['asset'] . '/css');
}
//js
if (!is_dir($this->config['dir']['asset'] . '/js')) {
mkdir($this->config['dir']['asset'] . '/js');
}
//... | [
"public",
"function",
"createTemplateFile",
"(",
")",
"{",
"// css",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"this",
"->",
"config",
"[",
"'dir'",
"]",
"[",
"'asset'",
"]",
".",
"'/css'",
")",
")",
"{",
"// dir doesn't exist, make it",
"mkdir",
"(",
"$",
"th... | Creating template file. Template will be used for view
@return void | [
"Creating",
"template",
"file",
".",
"Template",
"will",
"be",
"used",
"for",
"view"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/Init.php#L76-L120 |
8,835 | glendmaatita/Tolkien | src/Tolkien/Init.php | Init.configContent | public function configContent($blog_dir)
{
$base_blog = basename($blog_dir);
return $array = array(
"config" => array(
"name" => $this->name,
"url" => '/',
"title" => "Your Site Title",
"tagline" => "Your Site Tagline",
"pagination" => 10),
"dir" => array(
"post" => $ba... | php | public function configContent($blog_dir)
{
$base_blog = basename($blog_dir);
return $array = array(
"config" => array(
"name" => $this->name,
"url" => '/',
"title" => "Your Site Title",
"tagline" => "Your Site Tagline",
"pagination" => 10),
"dir" => array(
"post" => $ba... | [
"public",
"function",
"configContent",
"(",
"$",
"blog_dir",
")",
"{",
"$",
"base_blog",
"=",
"basename",
"(",
"$",
"blog_dir",
")",
";",
"return",
"$",
"array",
"=",
"array",
"(",
"\"config\"",
"=>",
"array",
"(",
"\"name\"",
"=>",
"$",
"this",
"->",
... | Content of config.yml
@return array | [
"Content",
"of",
"config",
".",
"yml"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/Init.php#L127-L156 |
8,836 | gridprinciples/friendly | src/Traits/Friendly.php | Friendly.block | public function block($model)
{
$deletedAtLeastOne = false;
if ($this->friends->count()) {
foreach ($this->friends as $friend) {
if ($friend->getKey() == $model->id) {
$friend->pivot->delete();
$this->resetFriends();
... | php | public function block($model)
{
$deletedAtLeastOne = false;
if ($this->friends->count()) {
foreach ($this->friends as $friend) {
if ($friend->getKey() == $model->id) {
$friend->pivot->delete();
$this->resetFriends();
... | [
"public",
"function",
"block",
"(",
"$",
"model",
")",
"{",
"$",
"deletedAtLeastOne",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"friends",
"->",
"count",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"friends",
"as",
"$",
"friend",
... | Remove the connection between these two models. AKA "block user".
@param $model
@return bool | [
"Remove",
"the",
"connection",
"between",
"these",
"two",
"models",
".",
"AKA",
"block",
"user",
"."
] | cb5ffa8834b3f3f38275765339597f3355fd4f75 | https://github.com/gridprinciples/friendly/blob/cb5ffa8834b3f3f38275765339597f3355fd4f75/src/Traits/Friendly.php#L28-L44 |
8,837 | gridprinciples/friendly | src/Traits/Friendly.php | Friendly.approve | public function approve($model)
{
$approvedAtLeastOne = false;
if ($model->friends->count()) {
foreach ($model->friends as $friend) {
if ((int) $friend->getKey() === (int) $this->getKey()) {
$friend->pivot->approved_at = new \Carbon\Carbon;
... | php | public function approve($model)
{
$approvedAtLeastOne = false;
if ($model->friends->count()) {
foreach ($model->friends as $friend) {
if ((int) $friend->getKey() === (int) $this->getKey()) {
$friend->pivot->approved_at = new \Carbon\Carbon;
... | [
"public",
"function",
"approve",
"(",
"$",
"model",
")",
"{",
"$",
"approvedAtLeastOne",
"=",
"false",
";",
"if",
"(",
"$",
"model",
"->",
"friends",
"->",
"count",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"model",
"->",
"friends",
"as",
"$",
"friend... | Approve an incoming connection request. AKA "approve request"
@param $model
@return bool | [
"Approve",
"an",
"incoming",
"connection",
"request",
".",
"AKA",
"approve",
"request"
] | cb5ffa8834b3f3f38275765339597f3355fd4f75 | https://github.com/gridprinciples/friendly/blob/cb5ffa8834b3f3f38275765339597f3355fd4f75/src/Traits/Friendly.php#L52-L69 |
8,838 | gridprinciples/friendly | src/Traits/Friendly.php | Friendly.getCurrentFriendsAttribute | public function getCurrentFriendsAttribute()
{
return $this->friends->filter(function ($item) {
$now = new \Carbon\Carbon;
if(!$item->pivot->approved_at)
{
return false;
}
switch (true) {
// no dates set
... | php | public function getCurrentFriendsAttribute()
{
return $this->friends->filter(function ($item) {
$now = new \Carbon\Carbon;
if(!$item->pivot->approved_at)
{
return false;
}
switch (true) {
// no dates set
... | [
"public",
"function",
"getCurrentFriendsAttribute",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"friends",
"->",
"filter",
"(",
"function",
"(",
"$",
"item",
")",
"{",
"$",
"now",
"=",
"new",
"\\",
"Carbon",
"\\",
"Carbon",
";",
"if",
"(",
"!",
"$",
... | Filters the primary connections by ones that are currently active.
@return mixed | [
"Filters",
"the",
"primary",
"connections",
"by",
"ones",
"that",
"are",
"currently",
"active",
"."
] | cb5ffa8834b3f3f38275765339597f3355fd4f75 | https://github.com/gridprinciples/friendly/blob/cb5ffa8834b3f3f38275765339597f3355fd4f75/src/Traits/Friendly.php#L90-L120 |
8,839 | gridprinciples/friendly | src/Traits/Friendly.php | Friendly.mergeMineAndRequestedFriends | protected function mergeMineAndRequestedFriends()
{
$all = $this->sentRequests;
if($more = $this->receivedApprovedRequests->all())
{
foreach($more as $m)
{
$all->add($m);
}
}
return $all;
} | php | protected function mergeMineAndRequestedFriends()
{
$all = $this->sentRequests;
if($more = $this->receivedApprovedRequests->all())
{
foreach($more as $m)
{
$all->add($m);
}
}
return $all;
} | [
"protected",
"function",
"mergeMineAndRequestedFriends",
"(",
")",
"{",
"$",
"all",
"=",
"$",
"this",
"->",
"sentRequests",
";",
"if",
"(",
"$",
"more",
"=",
"$",
"this",
"->",
"receivedApprovedRequests",
"->",
"all",
"(",
")",
")",
"{",
"foreach",
"(",
... | Merge the result of two relationships.
@return mixed | [
"Merge",
"the",
"result",
"of",
"two",
"relationships",
"."
] | cb5ffa8834b3f3f38275765339597f3355fd4f75 | https://github.com/gridprinciples/friendly/blob/cb5ffa8834b3f3f38275765339597f3355fd4f75/src/Traits/Friendly.php#L173-L186 |
8,840 | EarthlingInteractive/PHPCMIPREST | lib/EarthIT/CMIPREST/ResultAssembler/CSVResultAssembler.php | EarthIT_CMIPREST_ResultAssembler_CSVResultAssembler.assembleResult | public function assembleResult( EarthIT_CMIPREST_ActionResult $result, TOGoS_Action $action=null, $ctx=null ) {
$rootRc = $result->getRootResourceClass();
$columnHeaders = array();
foreach( $rootRc->getFields() as $fn=>$field ) {
$columnHeaders[] = $fn;
}
$itemCollections = $result->getItemCollections();
... | php | public function assembleResult( EarthIT_CMIPREST_ActionResult $result, TOGoS_Action $action=null, $ctx=null ) {
$rootRc = $result->getRootResourceClass();
$columnHeaders = array();
foreach( $rootRc->getFields() as $fn=>$field ) {
$columnHeaders[] = $fn;
}
$itemCollections = $result->getItemCollections();
... | [
"public",
"function",
"assembleResult",
"(",
"EarthIT_CMIPREST_ActionResult",
"$",
"result",
",",
"TOGoS_Action",
"$",
"action",
"=",
"null",
",",
"$",
"ctx",
"=",
"null",
")",
"{",
"$",
"rootRc",
"=",
"$",
"result",
"->",
"getRootResourceClass",
"(",
")",
"... | Assemble a StorageResult into whatever format the thing that's
going to take the results needs. Normally this will be an array.
@param EarthIT_CMIPREST_ActionResult $result the return value of the action
@param TOGoS_Action $action the action that was invoked to get this result
@param mixed $ctx some value representi... | [
"Assemble",
"a",
"StorageResult",
"into",
"whatever",
"format",
"the",
"thing",
"that",
"s",
"going",
"to",
"take",
"the",
"results",
"needs",
".",
"Normally",
"this",
"will",
"be",
"an",
"array",
"."
] | db0398ea4fc07fa62f2de9ba43f2f3137170d9f0 | https://github.com/EarthlingInteractive/PHPCMIPREST/blob/db0398ea4fc07fa62f2de9ba43f2f3137170d9f0/lib/EarthIT/CMIPREST/ResultAssembler/CSVResultAssembler.php#L15-L32 |
8,841 | EarthlingInteractive/PHPCMIPREST | lib/EarthIT/CMIPREST/ResultAssembler/CSVResultAssembler.php | EarthIT_CMIPREST_ResultAssembler_CSVResultAssembler.assembledResultToHttpResponse | public function assembledResultToHttpResponse( $assembled, TOGoS_Action $action=null, $ctx=null ) {
return Nife_Util::httpResponse(200, new EarthIT_CMIPREST_CSVBlob($assembled), array('content-type'=>'text/csv'));
} | php | public function assembledResultToHttpResponse( $assembled, TOGoS_Action $action=null, $ctx=null ) {
return Nife_Util::httpResponse(200, new EarthIT_CMIPREST_CSVBlob($assembled), array('content-type'=>'text/csv'));
} | [
"public",
"function",
"assembledResultToHttpResponse",
"(",
"$",
"assembled",
",",
"TOGoS_Action",
"$",
"action",
"=",
"null",
",",
"$",
"ctx",
"=",
"null",
")",
"{",
"return",
"Nife_Util",
"::",
"httpResponse",
"(",
"200",
",",
"new",
"EarthIT_CMIPREST_CSVBlob"... | Take the result returned by assembleResult and encode
it as a Nife_HTTP_Response | [
"Take",
"the",
"result",
"returned",
"by",
"assembleResult",
"and",
"encode",
"it",
"as",
"a",
"Nife_HTTP_Response"
] | db0398ea4fc07fa62f2de9ba43f2f3137170d9f0 | https://github.com/EarthlingInteractive/PHPCMIPREST/blob/db0398ea4fc07fa62f2de9ba43f2f3137170d9f0/lib/EarthIT/CMIPREST/ResultAssembler/CSVResultAssembler.php#L38-L40 |
8,842 | EarthlingInteractive/PHPCMIPREST | lib/EarthIT/CMIPREST/ResultAssembler/CSVResultAssembler.php | EarthIT_CMIPREST_ResultAssembler_CSVResultAssembler.exceptionToHttpResponse | public function exceptionToHttpResponse( Exception $e, TOGoS_Action $action=null, $ctx=null ) {
$userIsAuthenticated = ($ctx and method_exists($ctx,'userIsAuthenticated')) ? $ctx->userIsAuthenticated() : false;
return EarthIT_CMIPREST_Util::exceptionalNormalJsonHttpResponse($e, $userIsAuthenticated, array(
Earth... | php | public function exceptionToHttpResponse( Exception $e, TOGoS_Action $action=null, $ctx=null ) {
$userIsAuthenticated = ($ctx and method_exists($ctx,'userIsAuthenticated')) ? $ctx->userIsAuthenticated() : false;
return EarthIT_CMIPREST_Util::exceptionalNormalJsonHttpResponse($e, $userIsAuthenticated, array(
Earth... | [
"public",
"function",
"exceptionToHttpResponse",
"(",
"Exception",
"$",
"e",
",",
"TOGoS_Action",
"$",
"action",
"=",
"null",
",",
"$",
"ctx",
"=",
"null",
")",
"{",
"$",
"userIsAuthenticated",
"=",
"(",
"$",
"ctx",
"and",
"method_exists",
"(",
"$",
"ctx",... | Encode the fact that an exception occurred as a Nife_HTTP_Response. | [
"Encode",
"the",
"fact",
"that",
"an",
"exception",
"occurred",
"as",
"a",
"Nife_HTTP_Response",
"."
] | db0398ea4fc07fa62f2de9ba43f2f3137170d9f0 | https://github.com/EarthlingInteractive/PHPCMIPREST/blob/db0398ea4fc07fa62f2de9ba43f2f3137170d9f0/lib/EarthIT/CMIPREST/ResultAssembler/CSVResultAssembler.php#L45-L50 |
8,843 | squire-assistant/debug | FatalErrorHandler/ClassNotFoundFatalErrorHandler.php | ClassNotFoundFatalErrorHandler.getClassCandidates | private function getClassCandidates($class)
{
if (!is_array($functions = spl_autoload_functions())) {
return array();
}
// find Symfony and Composer autoloaders
$classes = array();
foreach ($functions as $function) {
if (!is_array($function)) {
... | php | private function getClassCandidates($class)
{
if (!is_array($functions = spl_autoload_functions())) {
return array();
}
// find Symfony and Composer autoloaders
$classes = array();
foreach ($functions as $function) {
if (!is_array($function)) {
... | [
"private",
"function",
"getClassCandidates",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"functions",
"=",
"spl_autoload_functions",
"(",
")",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"// find Symfony and Composer autoloader... | Tries to guess the full namespace for a given class name.
By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer
autoloader (that should cover all common cases).
@param string $class A class name (without its namespace)
@return array An array of possible fully qualified class names | [
"Tries",
"to",
"guess",
"the",
"full",
"namespace",
"for",
"a",
"given",
"class",
"name",
"."
] | c43819e74eea94cde8faf31c1a6b00f018e607a0 | https://github.com/squire-assistant/debug/blob/c43819e74eea94cde8faf31c1a6b00f018e607a0/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php#L86-L125 |
8,844 | simondeeley/type | src/Helpers/TypeEqualityHelperMethods.php | TypeEqualityHelperMethods.isSameObjectAs | final private function isSameObjectAs(Type $type, int $flags = null): bool
{
if ($flags & TypeEquality::IGNORE_OBJECT_IDENTITY) {
return true;
}
return (spl_object_hash($this) === spl_object_hash($type)) ? true : false;
} | php | final private function isSameObjectAs(Type $type, int $flags = null): bool
{
if ($flags & TypeEquality::IGNORE_OBJECT_IDENTITY) {
return true;
}
return (spl_object_hash($this) === spl_object_hash($type)) ? true : false;
} | [
"final",
"private",
"function",
"isSameObjectAs",
"(",
"Type",
"$",
"type",
",",
"int",
"$",
"flags",
"=",
"null",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"flags",
"&",
"TypeEquality",
"::",
"IGNORE_OBJECT_IDENTITY",
")",
"{",
"return",
"true",
";",
"}",
... | Check against an objects ID
Makes a comparison against an objects identity, obtained through the use
of spl_object_hash. Method returns true if both objects point to the
same PHP reference. Note that this method also returns true when the $flag
is set to ignore this type of check.
@param Type $type - the object to ch... | [
"Check",
"against",
"an",
"objects",
"ID"
] | 1c96f526fd8b532482517a1c647d956fa4e4e348 | https://github.com/simondeeley/type/blob/1c96f526fd8b532482517a1c647d956fa4e4e348/src/Helpers/TypeEqualityHelperMethods.php#L72-L79 |
8,845 | wasabi-cms/core | src/Model/Table/SettingsTable.php | SettingsTable.afterSave | public function afterSave(Event $event, Setting $entity, ArrayObject $options)
{
Cache::delete('settings', 'wasabi/core/longterm');
$this->eventManager()->dispatch(new Event('Wasabi.Settings.changed'));
} | php | public function afterSave(Event $event, Setting $entity, ArrayObject $options)
{
Cache::delete('settings', 'wasabi/core/longterm');
$this->eventManager()->dispatch(new Event('Wasabi.Settings.changed'));
} | [
"public",
"function",
"afterSave",
"(",
"Event",
"$",
"event",
",",
"Setting",
"$",
"entity",
",",
"ArrayObject",
"$",
"options",
")",
"{",
"Cache",
"::",
"delete",
"(",
"'settings'",
",",
"'wasabi/core/longterm'",
")",
";",
"$",
"this",
"->",
"eventManager"... | Called after an entity is saved.
@param Event $event An event instance.
@param Setting $entity The entity that triggered the event.
@param ArrayObject $options Additional options passed to the save call.
@return void | [
"Called",
"after",
"an",
"entity",
"is",
"saved",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Model/Table/SettingsTable.php#L51-L55 |
8,846 | twister-php/twister | src/ORM/Collection.php | Collection.map | public function map(callable $callback)
{
$keys = array_keys($this->members);
$members = array_map($callback, $this->members, $keys);
return new static(array_combine($keys, $members));
} | php | public function map(callable $callback)
{
$keys = array_keys($this->members);
$members = array_map($callback, $this->members, $keys);
return new static(array_combine($keys, $members));
} | [
"public",
"function",
"map",
"(",
"callable",
"$",
"callback",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"members",
")",
";",
"$",
"members",
"=",
"array_map",
"(",
"$",
"callback",
",",
"$",
"this",
"->",
"members",
",",
"$",... | Run a map over each of the members.
@link http://php.net/manual/en/function.array-map.php
@param callable $callback
@return static | [
"Run",
"a",
"map",
"over",
"each",
"of",
"the",
"members",
"."
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/ORM/Collection.php#L92-L97 |
8,847 | twister-php/twister | src/ORM/Collection.php | Collection.random | public function random($num = 1)
{
if ($num == 1)
return $this->members[array_rand($this->members)];
$keys = array_rand($this->members, $num);
return new static(array_intersect_key($this->members, array_flip($keys)));
} | php | public function random($num = 1)
{
if ($num == 1)
return $this->members[array_rand($this->members)];
$keys = array_rand($this->members, $num);
return new static(array_intersect_key($this->members, array_flip($keys)));
} | [
"public",
"function",
"random",
"(",
"$",
"num",
"=",
"1",
")",
"{",
"if",
"(",
"$",
"num",
"==",
"1",
")",
"return",
"$",
"this",
"->",
"members",
"[",
"array_rand",
"(",
"$",
"this",
"->",
"members",
")",
"]",
";",
"$",
"keys",
"=",
"array_rand... | Get one or more random members from the collection.
@link http://php.net/manual/en/function.array-rand.php
@param int $num
@return mixed | [
"Get",
"one",
"or",
"more",
"random",
"members",
"from",
"the",
"collection",
"."
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/ORM/Collection.php#L187-L194 |
8,848 | twister-php/twister | src/ORM/Collection.php | Collection.filter | public function filter(callable $callback = null)
{
return new static($callback ? array_filter($this->members, $callback) : array_filter($this->members));
} | php | public function filter(callable $callback = null)
{
return new static($callback ? array_filter($this->members, $callback) : array_filter($this->members));
} | [
"public",
"function",
"filter",
"(",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"$",
"callback",
"?",
"array_filter",
"(",
"$",
"this",
"->",
"members",
",",
"$",
"callback",
")",
":",
"array_filter",
"(",
"$",
... | Run a filter over each of the members.
@link http://php.net/manual/en/function.array-filter.php
@param callable|null $callback
@return static | [
"Run",
"a",
"filter",
"over",
"each",
"of",
"the",
"members",
"."
] | c06ea2650331faf11590c017c850dc5f0bbc5c13 | https://github.com/twister-php/twister/blob/c06ea2650331faf11590c017c850dc5f0bbc5c13/src/ORM/Collection.php#L257-L260 |
8,849 | tacowordpress/util | src/Util/Arr.php | Arr.median | public static function median($arr)
{
$vals = array_values($arr);
sort($vals);
$num_vals = count($vals);
return ($num_vals % 2)
? ($vals[$num_vals / 2] + $vals[($num_vals / 2) + 1]) / 2
: $vals[($num_vals + 1) / 2];
} | php | public static function median($arr)
{
$vals = array_values($arr);
sort($vals);
$num_vals = count($vals);
return ($num_vals % 2)
? ($vals[$num_vals / 2] + $vals[($num_vals / 2) + 1]) / 2
: $vals[($num_vals + 1) / 2];
} | [
"public",
"static",
"function",
"median",
"(",
"$",
"arr",
")",
"{",
"$",
"vals",
"=",
"array_values",
"(",
"$",
"arr",
")",
";",
"sort",
"(",
"$",
"vals",
")",
";",
"$",
"num_vals",
"=",
"count",
"(",
"$",
"vals",
")",
";",
"return",
"(",
"$",
... | Get the median
@param array $arr
@return mixed | [
"Get",
"the",
"median"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Arr.php#L38-L47 |
8,850 | tacowordpress/util | src/Util/Arr.php | Arr.mode | public static function mode($arr)
{
$vals = array_count_values($arr);
asort($vals);
return end(array_keys($vals));
} | php | public static function mode($arr)
{
$vals = array_count_values($arr);
asort($vals);
return end(array_keys($vals));
} | [
"public",
"static",
"function",
"mode",
"(",
"$",
"arr",
")",
"{",
"$",
"vals",
"=",
"array_count_values",
"(",
"$",
"arr",
")",
";",
"asort",
"(",
"$",
"vals",
")",
";",
"return",
"end",
"(",
"array_keys",
"(",
"$",
"vals",
")",
")",
";",
"}"
] | Get the mode
@param array $arr
@return mixed | [
"Get",
"the",
"mode"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Arr.php#L55-L60 |
8,851 | tacowordpress/util | src/Util/Arr.php | Arr.withKeys | public static function withKeys($records, $keys)
{
if (!self::iterable($records)) {
return array();
}
$out = array();
foreach ($records as $n => $record) {
if (!self::iterable($record)) {
$out[$n] = $record;
continue;
... | php | public static function withKeys($records, $keys)
{
if (!self::iterable($records)) {
return array();
}
$out = array();
foreach ($records as $n => $record) {
if (!self::iterable($record)) {
$out[$n] = $record;
continue;
... | [
"public",
"static",
"function",
"withKeys",
"(",
"$",
"records",
",",
"$",
"keys",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"iterable",
"(",
"$",
"records",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"out",
"=",
"array",
"(",
")",
... | Get the data only with specific keys
@param array $records
@param array $keys
@return array | [
"Get",
"the",
"data",
"only",
"with",
"specific",
"keys"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Arr.php#L69-L91 |
8,852 | tacowordpress/util | src/Util/Arr.php | Arr.apportion | public static function apportion($arr, $num_groups = 2, $strict_group_count = false, $backload = false)
{
if (!self::iterable($arr)) {
return array();
}
if ($backload) {
$arr = array_reverse($arr, true);
}
$apportioned = array();
... | php | public static function apportion($arr, $num_groups = 2, $strict_group_count = false, $backload = false)
{
if (!self::iterable($arr)) {
return array();
}
if ($backload) {
$arr = array_reverse($arr, true);
}
$apportioned = array();
... | [
"public",
"static",
"function",
"apportion",
"(",
"$",
"arr",
",",
"$",
"num_groups",
"=",
"2",
",",
"$",
"strict_group_count",
"=",
"false",
",",
"$",
"backload",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"iterable",
"(",
"$",
"arr",
")"... | Split array into groups with nearly equal number of elements
@param array $arr
@param int $num_groups
@param bool $strict_group_count
@param bool $backload
@return array | [
"Split",
"array",
"into",
"groups",
"with",
"nearly",
"equal",
"number",
"of",
"elements"
] | a27f6f1c3f96a908c7480f359fd44028e89f26c3 | https://github.com/tacowordpress/util/blob/a27f6f1c3f96a908c7480f359fd44028e89f26c3/src/Util/Arr.php#L161-L197 |
8,853 | common-libs/user | src/legacy/auth.php | auth.logout | public static function logout() {
$_SESSION = [];
session_destroy();
session_unset();
self::$isGuest = true;
self::$user = user::guest();
} | php | public static function logout() {
$_SESSION = [];
session_destroy();
session_unset();
self::$isGuest = true;
self::$user = user::guest();
} | [
"public",
"static",
"function",
"logout",
"(",
")",
"{",
"$",
"_SESSION",
"=",
"[",
"]",
";",
"session_destroy",
"(",
")",
";",
"session_unset",
"(",
")",
";",
"self",
"::",
"$",
"isGuest",
"=",
"true",
";",
"self",
"::",
"$",
"user",
"=",
"user",
... | logout the current user | [
"logout",
"the",
"current",
"user"
] | 820fce6748a59e8d692bf613b4694f903d9db6c1 | https://github.com/common-libs/user/blob/820fce6748a59e8d692bf613b4694f903d9db6c1/src/legacy/auth.php#L93-L99 |
8,854 | grnrbt/yii2-materialized-path-postgres-array | src/MaterializedPathBehavior.php | MaterializedPathBehavior.getPath | public function getPath($asArray = true)
{
$raw = $this->owner->{$this->pathAttribute};
return $asArray ? $this->convertPathFromPgToPhp($raw) : $raw;
} | php | public function getPath($asArray = true)
{
$raw = $this->owner->{$this->pathAttribute};
return $asArray ? $this->convertPathFromPgToPhp($raw) : $raw;
} | [
"public",
"function",
"getPath",
"(",
"$",
"asArray",
"=",
"true",
")",
"{",
"$",
"raw",
"=",
"$",
"this",
"->",
"owner",
"->",
"{",
"$",
"this",
"->",
"pathAttribute",
"}",
";",
"return",
"$",
"asArray",
"?",
"$",
"this",
"->",
"convertPathFromPgToPhp... | Returns path of self node.
@param bool $asArray = true Return array instead string
@return array|string|\yii\db\ArrayExpression | [
"Returns",
"path",
"of",
"self",
"node",
"."
] | dbad565bf55236c8753dbc14fcee7bbec4030edf | https://github.com/grnrbt/yii2-materialized-path-postgres-array/blob/dbad565bf55236c8753dbc14fcee7bbec4030edf/src/MaterializedPathBehavior.php#L151-L155 |
8,855 | grnrbt/yii2-materialized-path-postgres-array | src/MaterializedPathBehavior.php | MaterializedPathBehavior.getParentPath | public function getParentPath($asArray = true)
{
if ($this->owner->isRoot()) {
return null;
}
$path = $this->owner->getPath();
array_pop($path);
return $asArray ? $path : $this->convertPathFromPhpToPg($path);
} | php | public function getParentPath($asArray = true)
{
if ($this->owner->isRoot()) {
return null;
}
$path = $this->owner->getPath();
array_pop($path);
return $asArray ? $path : $this->convertPathFromPhpToPg($path);
} | [
"public",
"function",
"getParentPath",
"(",
"$",
"asArray",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"isRoot",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"path",
"=",
"$",
"this",
"->",
"owner",
"->",
"getPath",... | Returns path from root to parent node.
@param bool $asArray = true
@return null|string|array|\yii\db\ArrayExpression | [
"Returns",
"path",
"from",
"root",
"to",
"parent",
"node",
"."
] | dbad565bf55236c8753dbc14fcee7bbec4030edf | https://github.com/grnrbt/yii2-materialized-path-postgres-array/blob/dbad565bf55236c8753dbc14fcee7bbec4030edf/src/MaterializedPathBehavior.php#L163-L171 |
8,856 | grnrbt/yii2-materialized-path-postgres-array | src/MaterializedPathBehavior.php | MaterializedPathBehavior.getParents | public function getParents($depth = null)
{
/** @var \yii\db\ActiveQuery|MaterializedPathQueryTrait $query */
$query = $this->owner->find();
return $query->parentsOf($this->owner, $depth);
} | php | public function getParents($depth = null)
{
/** @var \yii\db\ActiveQuery|MaterializedPathQueryTrait $query */
$query = $this->owner->find();
return $query->parentsOf($this->owner, $depth);
} | [
"public",
"function",
"getParents",
"(",
"$",
"depth",
"=",
"null",
")",
"{",
"/** @var \\yii\\db\\ActiveQuery|MaterializedPathQueryTrait $query */",
"$",
"query",
"=",
"$",
"this",
"->",
"owner",
"->",
"find",
"(",
")",
";",
"return",
"$",
"query",
"->",
"paren... | Returns list of parents from root to self node.
@param int $depth = null
@return \yii\db\ActiveQuery | [
"Returns",
"list",
"of",
"parents",
"from",
"root",
"to",
"self",
"node",
"."
] | dbad565bf55236c8753dbc14fcee7bbec4030edf | https://github.com/grnrbt/yii2-materialized-path-postgres-array/blob/dbad565bf55236c8753dbc14fcee7bbec4030edf/src/MaterializedPathBehavior.php#L209-L214 |
8,857 | grnrbt/yii2-materialized-path-postgres-array | src/MaterializedPathBehavior.php | MaterializedPathBehavior.getRoot | public function getRoot()
{
$path = $this->owner->getPath();
$path = array_shift($path);
$query = $this->owner->find();
/** @var \yii\db\ActiveQuery $query */
$query
->andWhere([$this->keyColumn => $path])
->limit(1);
$query->multiple = false;
... | php | public function getRoot()
{
$path = $this->owner->getPath();
$path = array_shift($path);
$query = $this->owner->find();
/** @var \yii\db\ActiveQuery $query */
$query
->andWhere([$this->keyColumn => $path])
->limit(1);
$query->multiple = false;
... | [
"public",
"function",
"getRoot",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"owner",
"->",
"getPath",
"(",
")",
";",
"$",
"path",
"=",
"array_shift",
"(",
"$",
"path",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"owner",
"->",
"find"... | Returns root node in self node's subtree.
@return \yii\db\ActiveQuery | [
"Returns",
"root",
"node",
"in",
"self",
"node",
"s",
"subtree",
"."
] | dbad565bf55236c8753dbc14fcee7bbec4030edf | https://github.com/grnrbt/yii2-materialized-path-postgres-array/blob/dbad565bf55236c8753dbc14fcee7bbec4030edf/src/MaterializedPathBehavior.php#L233-L244 |
8,858 | grnrbt/yii2-materialized-path-postgres-array | src/MaterializedPathBehavior.php | MaterializedPathBehavior.getDescendants | public function getDescendants($depth = null, $andSelf = false)
{
/** @var \yii\db\ActiveQuery|MaterializedPathQueryTrait $query */
$query = $this->owner->find();
return $query->descendantsOf($this->owner, $depth, $andSelf);
} | php | public function getDescendants($depth = null, $andSelf = false)
{
/** @var \yii\db\ActiveQuery|MaterializedPathQueryTrait $query */
$query = $this->owner->find();
return $query->descendantsOf($this->owner, $depth, $andSelf);
} | [
"public",
"function",
"getDescendants",
"(",
"$",
"depth",
"=",
"null",
",",
"$",
"andSelf",
"=",
"false",
")",
"{",
"/** @var \\yii\\db\\ActiveQuery|MaterializedPathQueryTrait $query */",
"$",
"query",
"=",
"$",
"this",
"->",
"owner",
"->",
"find",
"(",
")",
";... | Returns descendants as plain list.
@param int $depth = null
@param bool $andSelf = false
@return \yii\db\ActiveQuery|MaterializedPathQueryTrait | [
"Returns",
"descendants",
"as",
"plain",
"list",
"."
] | dbad565bf55236c8753dbc14fcee7bbec4030edf | https://github.com/grnrbt/yii2-materialized-path-postgres-array/blob/dbad565bf55236c8753dbc14fcee7bbec4030edf/src/MaterializedPathBehavior.php#L253-L258 |
8,859 | grnrbt/yii2-materialized-path-postgres-array | src/MaterializedPathBehavior.php | MaterializedPathBehavior.populateTree | public function populateTree($depth = null)
{
/** @var ActiveRecord|MaterializedPathBehavior $nodes */
$nodes = $this
->getDescendants($depth)
->indexBy($this->keyAttribute)
->all();
$relates = [];
foreach ($nodes as $key => $node) {
$p... | php | public function populateTree($depth = null)
{
/** @var ActiveRecord|MaterializedPathBehavior $nodes */
$nodes = $this
->getDescendants($depth)
->indexBy($this->keyAttribute)
->all();
$relates = [];
foreach ($nodes as $key => $node) {
$p... | [
"public",
"function",
"populateTree",
"(",
"$",
"depth",
"=",
"null",
")",
"{",
"/** @var ActiveRecord|MaterializedPathBehavior $nodes */",
"$",
"nodes",
"=",
"$",
"this",
"->",
"getDescendants",
"(",
"$",
"depth",
")",
"->",
"indexBy",
"(",
"$",
"this",
"->",
... | Returns descendants nodes as tree with self node in the root.
@param int $depth = null
@return MaterializedPathBehavior|ActiveRecord | [
"Returns",
"descendants",
"nodes",
"as",
"tree",
"with",
"self",
"node",
"in",
"the",
"root",
"."
] | dbad565bf55236c8753dbc14fcee7bbec4030edf | https://github.com/grnrbt/yii2-materialized-path-postgres-array/blob/dbad565bf55236c8753dbc14fcee7bbec4030edf/src/MaterializedPathBehavior.php#L534-L554 |
8,860 | grnrbt/yii2-materialized-path-postgres-array | src/MaterializedPathBehavior.php | MaterializedPathBehavior.getParentKey | public function getParentKey()
{
if ($this->owner->isRoot()) {
return null;
}
$path = $this->getPath();
return array_pop($path);
} | php | public function getParentKey()
{
if ($this->owner->isRoot()) {
return null;
}
$path = $this->getPath();
return array_pop($path);
} | [
"public",
"function",
"getParentKey",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"isRoot",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"return",
"array_pop",
"(",
... | Returns key of parent.
@return mixed|null | [
"Returns",
"key",
"of",
"parent",
"."
] | dbad565bf55236c8753dbc14fcee7bbec4030edf | https://github.com/grnrbt/yii2-materialized-path-postgres-array/blob/dbad565bf55236c8753dbc14fcee7bbec4030edf/src/MaterializedPathBehavior.php#L561-L568 |
8,861 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/database/result.php | Database_Result.as_array | public function as_array($key = null, $value = null)
{
$results = array();
if ($key === null and $value === null)
{
// Indexed rows
foreach ($this as $row)
{
$results[] = $row;
}
}
elseif ($key === null)
{
// Indexed columns
if ($this->_as_object)
{
foreach ($this as $row)
... | php | public function as_array($key = null, $value = null)
{
$results = array();
if ($key === null and $value === null)
{
// Indexed rows
foreach ($this as $row)
{
$results[] = $row;
}
}
elseif ($key === null)
{
// Indexed columns
if ($this->_as_object)
{
foreach ($this as $row)
... | [
"public",
"function",
"as_array",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"key",
"===",
"null",
"and",
"$",
"value",
"===",
"null",
")",
"{",
"// Indexed... | Return all of the rows in the result as an array.
// Indexed array of all rows
$rows = $result->as_array();
// Associative array of rows by "id"
$rows = $result->as_array('id');
// Associative array of rows, "id" => "name"
$rows = $result->as_array('id', 'name');
@param string column for associative keys
@param ... | [
"Return",
"all",
"of",
"the",
"rows",
"in",
"the",
"result",
"as",
"an",
"array",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/result.php#L104-L178 |
8,862 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/database/result.php | Database_Result.get | public function get($name, $default = null)
{
$row = $this->current();
if ($this->_as_object)
{
if (isset($row->$name))
{
return $row->$name;
}
}
else
{
if (isset($row[$name]))
{
return $row[$name];
}
}
return \Fuel::value($default);
} | php | public function get($name, $default = null)
{
$row = $this->current();
if ($this->_as_object)
{
if (isset($row->$name))
{
return $row->$name;
}
}
else
{
if (isset($row[$name]))
{
return $row[$name];
}
}
return \Fuel::value($default);
} | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"row",
"=",
"$",
"this",
"->",
"current",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_as_object",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"row",
... | Return the named column from the current row.
// Get the "id" value
$id = $result->get('id');
@param string $name column to get
@param mixed $default default value if the column does not exist
@return mixed | [
"Return",
"the",
"named",
"column",
"from",
"the",
"current",
"row",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/database/result.php#L191-L211 |
8,863 | SocietyCMS/Menu | Repositories/Menu/MenuBuilder.php | MenuBuilder.getItemProviders | public function getItemProviders()
{
foreach ($this->modules->enabled() as $module) {
$name = studly_case($module->getName());
$class = 'Modules\\'.$name.'\\MenuExtenders\\MenuExtender';
if (class_exists($class)) {
$extender = $this->container->make($clas... | php | public function getItemProviders()
{
foreach ($this->modules->enabled() as $module) {
$name = studly_case($module->getName());
$class = 'Modules\\'.$name.'\\MenuExtenders\\MenuExtender';
if (class_exists($class)) {
$extender = $this->container->make($clas... | [
"public",
"function",
"getItemProviders",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"modules",
"->",
"enabled",
"(",
")",
"as",
"$",
"module",
")",
"{",
"$",
"name",
"=",
"studly_case",
"(",
"$",
"module",
"->",
"getName",
"(",
")",
")",
";",... | Build the menu structure.
@return mixed | [
"Build",
"the",
"menu",
"structure",
"."
] | 417468edaa2be0051ae041ee614ab609f0ac8b49 | https://github.com/SocietyCMS/Menu/blob/417468edaa2be0051ae041ee614ab609f0ac8b49/Repositories/Menu/MenuBuilder.php#L51-L67 |
8,864 | SocietyCMS/Menu | Repositories/Menu/MenuBuilder.php | MenuBuilder.buildMenus | public function buildMenus()
{
$menu = Menu::whereIsRoot()->get();
foreach ($menu as $item) {
LavaryMenu::make(Str::slug($item->name), function ($menu) use ($item) {
$this->buildMenuItems($menu, $item);
});
}
} | php | public function buildMenus()
{
$menu = Menu::whereIsRoot()->get();
foreach ($menu as $item) {
LavaryMenu::make(Str::slug($item->name), function ($menu) use ($item) {
$this->buildMenuItems($menu, $item);
});
}
} | [
"public",
"function",
"buildMenus",
"(",
")",
"{",
"$",
"menu",
"=",
"Menu",
"::",
"whereIsRoot",
"(",
")",
"->",
"get",
"(",
")",
";",
"foreach",
"(",
"$",
"menu",
"as",
"$",
"item",
")",
"{",
"LavaryMenu",
"::",
"make",
"(",
"Str",
"::",
"slug",
... | Build all Menus. | [
"Build",
"all",
"Menus",
"."
] | 417468edaa2be0051ae041ee614ab609f0ac8b49 | https://github.com/SocietyCMS/Menu/blob/417468edaa2be0051ae041ee614ab609f0ac8b49/Repositories/Menu/MenuBuilder.php#L72-L80 |
8,865 | fabsgc/framework | Core/Engine/Engine.php | Engine.init | public function init() {
if (!Config::config()['user']['debug']['maintenance']) {
date_default_timezone_set(Config::config()['user']['output']['timezone']);
$this->_setEnvironment();
$this->_route();
if ($this->_route == true) {
$this->_setDatabas... | php | public function init() {
if (!Config::config()['user']['debug']['maintenance']) {
date_default_timezone_set(Config::config()['user']['output']['timezone']);
$this->_setEnvironment();
$this->_route();
if ($this->_route == true) {
$this->_setDatabas... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"!",
"Config",
"::",
"config",
"(",
")",
"[",
"'user'",
"]",
"[",
"'debug'",
"]",
"[",
"'maintenance'",
"]",
")",
"{",
"date_default_timezone_set",
"(",
"Config",
"::",
"config",
"(",
")",
"[",
... | initialization of the engine
@access public
@return void
@since 3.0
@package Gcs\Framework\Core\Engine | [
"initialization",
"of",
"the",
"engine"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L80-L97 |
8,866 | fabsgc/framework | Core/Engine/Engine.php | Engine.initCron | public function initCron($src, $controller, $action) {
if (!Config::config()['user']['debug']['maintenance']) {
$this->_routeCron($src, $controller, $action);
if ($this->_route == true) {
$this->_setFunction($this->request->src);
$this->_setEvent($this->r... | php | public function initCron($src, $controller, $action) {
if (!Config::config()['user']['debug']['maintenance']) {
$this->_routeCron($src, $controller, $action);
if ($this->_route == true) {
$this->_setFunction($this->request->src);
$this->_setEvent($this->r... | [
"public",
"function",
"initCron",
"(",
"$",
"src",
",",
"$",
"controller",
",",
"$",
"action",
")",
"{",
"if",
"(",
"!",
"Config",
"::",
"config",
"(",
")",
"[",
"'user'",
"]",
"[",
"'debug'",
"]",
"[",
"'maintenance'",
"]",
")",
"{",
"$",
"this",
... | initialization of the engine for cron
@access public
@param $src string
@param $controller string
@param $action string
@return void
@since 3.0
@package Gcs\Framework\Core\Engine | [
"initialization",
"of",
"the",
"engine",
"for",
"cron"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L110-L119 |
8,867 | fabsgc/framework | Core/Engine/Engine.php | Engine._routeCron | private function _routeCron($src, $controller, $action) {
$this->request->name = '-' . $src . '_' . $controller . '_' . $action;
$this->request->src = $src;
$this->request->controller = $controller;
$this->request->action = $action;
$this->request->auth = new Auth($this->request-... | php | private function _routeCron($src, $controller, $action) {
$this->request->name = '-' . $src . '_' . $controller . '_' . $action;
$this->request->src = $src;
$this->request->controller = $controller;
$this->request->action = $action;
$this->request->auth = new Auth($this->request-... | [
"private",
"function",
"_routeCron",
"(",
"$",
"src",
",",
"$",
"controller",
",",
"$",
"action",
")",
"{",
"$",
"this",
"->",
"request",
"->",
"name",
"=",
"'-'",
".",
"$",
"src",
".",
"'_'",
".",
"$",
"controller",
".",
"'_'",
".",
"$",
"action",... | routing with cron
@access private
@param $src string
@param $controller string
@param $action string
@return void
@since 3.0
@package Gcs\Framework\Core\Engine | [
"routing",
"with",
"cron"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L240-L247 |
8,868 | fabsgc/framework | Core/Engine/Engine.php | Engine._action | public function _action(&$class) {
ob_start();
$annotation = Annotation::getClass($class);
$this->_callAnnotation($class, $annotation, 'class', 'Before');
if (method_exists($class, 'action' . ucfirst($this->request->action))) {
$this->_callAnnotation($class, $annotation, '... | php | public function _action(&$class) {
ob_start();
$annotation = Annotation::getClass($class);
$this->_callAnnotation($class, $annotation, 'class', 'Before');
if (method_exists($class, 'action' . ucfirst($this->request->action))) {
$this->_callAnnotation($class, $annotation, '... | [
"public",
"function",
"_action",
"(",
"&",
"$",
"class",
")",
"{",
"ob_start",
"(",
")",
";",
"$",
"annotation",
"=",
"Annotation",
"::",
"getClass",
"(",
"$",
"class",
")",
";",
"$",
"this",
"->",
"_callAnnotation",
"(",
"$",
"class",
",",
"$",
"ann... | call action from controller
@param &$class Controller
@throws Exception
@access public
@return string
@since 3.0
@package Gcs\Framework\Core\Engine | [
"call",
"action",
"from",
"controller"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L312-L339 |
8,869 | fabsgc/framework | Core/Engine/Engine.php | Engine._callAnnotation | protected function _callAnnotation(Controller &$class, $annotation = [], $type = 'class', $annotationType = 'Before') {
foreach ($annotation[$type] as $action => $annotationClasses) {
foreach ($annotationClasses as $annotationClass) {
if ($annotationClass['annotation'] == $annotation... | php | protected function _callAnnotation(Controller &$class, $annotation = [], $type = 'class', $annotationType = 'Before') {
foreach ($annotation[$type] as $action => $annotationClasses) {
foreach ($annotationClasses as $annotationClass) {
if ($annotationClass['annotation'] == $annotation... | [
"protected",
"function",
"_callAnnotation",
"(",
"Controller",
"&",
"$",
"class",
",",
"$",
"annotation",
"=",
"[",
"]",
",",
"$",
"type",
"=",
"'class'",
",",
"$",
"annotationType",
"=",
"'Before'",
")",
"{",
"foreach",
"(",
"$",
"annotation",
"[",
"$",... | call all annotation methods required
@param Controller $class
@param array $annotation
@param string $type
@param string $annotationType
@throws MissingMethodException
@access protected
@since 3.0
@package Gcs\Framework\Core\Engine | [
"call",
"all",
"annotation",
"methods",
"required"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L353-L378 |
8,870 | fabsgc/framework | Core/Engine/Engine.php | Engine._setControllerFile | protected function _setControllerFile($src, $controller) {
$controllerPath = SRC_PATH . $src . '/' . SRC_CONTROLLER_PATH . ucfirst($controller) . '.php';
if (file_exists($controllerPath)) {
require_once($controllerPath);
return true;
}
return false;
} | php | protected function _setControllerFile($src, $controller) {
$controllerPath = SRC_PATH . $src . '/' . SRC_CONTROLLER_PATH . ucfirst($controller) . '.php';
if (file_exists($controllerPath)) {
require_once($controllerPath);
return true;
}
return false;
} | [
"protected",
"function",
"_setControllerFile",
"(",
"$",
"src",
",",
"$",
"controller",
")",
"{",
"$",
"controllerPath",
"=",
"SRC_PATH",
".",
"$",
"src",
".",
"'/'",
".",
"SRC_CONTROLLER_PATH",
".",
"ucfirst",
"(",
"$",
"controller",
")",
".",
"'.php'",
"... | include the module
@access protected
@param $src string
@param $controller string
@return boolean
@since 3.0
@package Gcs\Framework\Core\Engine | [
"include",
"the",
"module"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L390-L400 |
8,871 | fabsgc/framework | Core/Engine/Engine.php | Engine.run | public function run() {
if (!Config::config()['user']['debug']['maintenance']) {
if ($this->_route == false) {
$this->response->status(404);
$this->addError('routing failed : http://' . $this->request->env('HTTP_HOST') . $this->request->env('REQUEST_URI'), __FILE__, _... | php | public function run() {
if (!Config::config()['user']['debug']['maintenance']) {
if ($this->_route == false) {
$this->response->status(404);
$this->addError('routing failed : http://' . $this->request->env('HTTP_HOST') . $this->request->env('REQUEST_URI'), __FILE__, _... | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"!",
"Config",
"::",
"config",
"(",
")",
"[",
"'user'",
"]",
"[",
"'debug'",
"]",
"[",
"'maintenance'",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_route",
"==",
"false",
")",
"{",
"$",
... | display the page
@access public
@return void
@since 3.0
@package Gcs\Framework\Core\Engine | [
"display",
"the",
"page"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L410-L438 |
8,872 | fabsgc/framework | Core/Engine/Engine.php | Engine.runCron | public function runCron() {
if (!Config::config()['user']['debug']['maintenance']) {
$this->_controller();
$this->_setHistory('CRON');
}
echo $this->response->page();
} | php | public function runCron() {
if (!Config::config()['user']['debug']['maintenance']) {
$this->_controller();
$this->_setHistory('CRON');
}
echo $this->response->page();
} | [
"public",
"function",
"runCron",
"(",
")",
"{",
"if",
"(",
"!",
"Config",
"::",
"config",
"(",
")",
"[",
"'user'",
"]",
"[",
"'debug'",
"]",
"[",
"'maintenance'",
"]",
")",
"{",
"$",
"this",
"->",
"_controller",
"(",
")",
";",
"$",
"this",
"->",
... | display the page for a cron
@access public
@return void
@since 3.0
@package Gcs\Framework\Core\Engine | [
"display",
"the",
"page",
"for",
"a",
"cron"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L448-L455 |
8,873 | fabsgc/framework | Core/Engine/Engine.php | Engine._setHistory | private function _setHistory($message) {
$this->addError('URL : http://' . $this->request->env('HTTP_HOST') . $this->request->env('REQUEST_URI') . ' (' . $this->response->status() . ') / SRC "' . $this->request->src . '" / CONTROLLER "' . $this->request->controller . '" / ACTION "' . $this->request->action . '"... | php | private function _setHistory($message) {
$this->addError('URL : http://' . $this->request->env('HTTP_HOST') . $this->request->env('REQUEST_URI') . ' (' . $this->response->status() . ') / SRC "' . $this->request->src . '" / CONTROLLER "' . $this->request->controller . '" / ACTION "' . $this->request->action . '"... | [
"private",
"function",
"_setHistory",
"(",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"addError",
"(",
"'URL : http://'",
".",
"$",
"this",
"->",
"request",
"->",
"env",
"(",
"'HTTP_HOST'",
")",
".",
"$",
"this",
"->",
"request",
"->",
"env",
"(",
"'... | log request in history
@access private
@param $message string
@return void
@since 3.0
@package Gcs\Framework\Core\Engine | [
"log",
"request",
"in",
"history"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Engine/Engine.php#L653-L655 |
8,874 | gplcart/gapi | controllers/Credential.php | Credential.addCredential | public function addCredential($type)
{
$this->data_type = $type;
$this->setTitleEditCredential();
$this->setBreadcrumbEditCredential();
$this->credential->callHandler($type, 'edit');
} | php | public function addCredential($type)
{
$this->data_type = $type;
$this->setTitleEditCredential();
$this->setBreadcrumbEditCredential();
$this->credential->callHandler($type, 'edit');
} | [
"public",
"function",
"addCredential",
"(",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"data_type",
"=",
"$",
"type",
";",
"$",
"this",
"->",
"setTitleEditCredential",
"(",
")",
";",
"$",
"this",
"->",
"setBreadcrumbEditCredential",
"(",
")",
";",
"$",
"t... | Route page callback
Displays the add credential page
@param string $type | [
"Route",
"page",
"callback",
"Displays",
"the",
"add",
"credential",
"page"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L69-L77 |
8,875 | gplcart/gapi | controllers/Credential.php | Credential.editCredential | public function editCredential($credential_id)
{
$this->setCredential($credential_id);
$this->setTitleEditCredential();
$this->setBreadcrumbEditCredential();
$this->setData('credential', $this->data_credential);
$this->submitDeleteCredential();
$this->credential->ca... | php | public function editCredential($credential_id)
{
$this->setCredential($credential_id);
$this->setTitleEditCredential();
$this->setBreadcrumbEditCredential();
$this->setData('credential', $this->data_credential);
$this->submitDeleteCredential();
$this->credential->ca... | [
"public",
"function",
"editCredential",
"(",
"$",
"credential_id",
")",
"{",
"$",
"this",
"->",
"setCredential",
"(",
"$",
"credential_id",
")",
";",
"$",
"this",
"->",
"setTitleEditCredential",
"(",
")",
";",
"$",
"this",
"->",
"setBreadcrumbEditCredential",
... | Route page callback
Displays the edit credential page
@param int $credential_id | [
"Route",
"page",
"callback",
"Displays",
"the",
"edit",
"credential",
"page"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L123-L133 |
8,876 | gplcart/gapi | controllers/Credential.php | Credential.setCredential | protected function setCredential($credential_id)
{
if (is_numeric($credential_id)) {
$this->data_credential = $this->credential->get($credential_id);
if (empty($this->data_credential)) {
$this->outputHttpStatus(404);
}
}
} | php | protected function setCredential($credential_id)
{
if (is_numeric($credential_id)) {
$this->data_credential = $this->credential->get($credential_id);
if (empty($this->data_credential)) {
$this->outputHttpStatus(404);
}
}
} | [
"protected",
"function",
"setCredential",
"(",
"$",
"credential_id",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"credential_id",
")",
")",
"{",
"$",
"this",
"->",
"data_credential",
"=",
"$",
"this",
"->",
"credential",
"->",
"get",
"(",
"$",
"credential... | Sets the credential data
@param $credential_id | [
"Sets",
"the",
"credential",
"data"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L139-L147 |
8,877 | gplcart/gapi | controllers/Credential.php | Credential.setTitleEditCredential | protected function setTitleEditCredential()
{
if (isset($this->data_credential['name'])) {
$text = $this->text('Edit %name', array('%name' => $this->data_credential['name']));
} else {
$text = $this->text('Add credential');
}
$this->setTitle($text);
} | php | protected function setTitleEditCredential()
{
if (isset($this->data_credential['name'])) {
$text = $this->text('Edit %name', array('%name' => $this->data_credential['name']));
} else {
$text = $this->text('Add credential');
}
$this->setTitle($text);
} | [
"protected",
"function",
"setTitleEditCredential",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data_credential",
"[",
"'name'",
"]",
")",
")",
"{",
"$",
"text",
"=",
"$",
"this",
"->",
"text",
"(",
"'Edit %name'",
",",
"array",
"(",
"'%... | Set titles on the edit credential page | [
"Set",
"titles",
"on",
"the",
"edit",
"credential",
"page"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L152-L161 |
8,878 | gplcart/gapi | controllers/Credential.php | Credential.setBreadcrumbEditCredential | protected function setBreadcrumbEditCredential()
{
$breadcrumbs = array();
$breadcrumbs[] = array(
'url' => $this->url('admin'),
'text' => $this->text('Dashboard')
);
$breadcrumbs[] = array(
'text' => $this->text('Google API credentials'),
... | php | protected function setBreadcrumbEditCredential()
{
$breadcrumbs = array();
$breadcrumbs[] = array(
'url' => $this->url('admin'),
'text' => $this->text('Dashboard')
);
$breadcrumbs[] = array(
'text' => $this->text('Google API credentials'),
... | [
"protected",
"function",
"setBreadcrumbEditCredential",
"(",
")",
"{",
"$",
"breadcrumbs",
"=",
"array",
"(",
")",
";",
"$",
"breadcrumbs",
"[",
"]",
"=",
"array",
"(",
"'url'",
"=>",
"$",
"this",
"->",
"url",
"(",
"'admin'",
")",
",",
"'text'",
"=>",
... | Set breadcrumbs on the edit credential page | [
"Set",
"breadcrumbs",
"on",
"the",
"edit",
"credential",
"page"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L166-L181 |
8,879 | gplcart/gapi | controllers/Credential.php | Credential.validateKeyCredential | protected function validateKeyCredential()
{
if (!$this->isPosted('save')) {
return false;
}
$this->setSubmitted('credential');
$this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
$this->validateElement(array('data.key' => $this... | php | protected function validateKeyCredential()
{
if (!$this->isPosted('save')) {
return false;
}
$this->setSubmitted('credential');
$this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
$this->validateElement(array('data.key' => $this... | [
"protected",
"function",
"validateKeyCredential",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPosted",
"(",
"'save'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"setSubmitted",
"(",
"'credential'",
")",
";",
"$",
"this",
"-... | Validates "API key" credential data
@return bool | [
"Validates",
"API",
"key",
"credential",
"data"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L187-L198 |
8,880 | gplcart/gapi | controllers/Credential.php | Credential.validateOauthCredential | protected function validateOauthCredential()
{
if (!$this->isPosted('save')) {
return false;
}
$this->setSubmitted('credential');
$this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
$this->validateElement(array('data.id' => $thi... | php | protected function validateOauthCredential()
{
if (!$this->isPosted('save')) {
return false;
}
$this->setSubmitted('credential');
$this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
$this->validateElement(array('data.id' => $thi... | [
"protected",
"function",
"validateOauthCredential",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPosted",
"(",
"'save'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"setSubmitted",
"(",
"'credential'",
")",
";",
"$",
"this",
... | Validates "OAuth" credential data
@return bool | [
"Validates",
"OAuth",
"credential",
"data"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L204-L216 |
8,881 | gplcart/gapi | controllers/Credential.php | Credential.validateServiceCredential | protected function validateServiceCredential()
{
if (!$this->isPosted('save')) {
return false;
}
$this->setSubmitted('credential');
$this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
$this->validateFileUploadCredential();
... | php | protected function validateServiceCredential()
{
if (!$this->isPosted('save')) {
return false;
}
$this->setSubmitted('credential');
$this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
$this->validateFileUploadCredential();
... | [
"protected",
"function",
"validateServiceCredential",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isPosted",
"(",
"'save'",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"setSubmitted",
"(",
"'credential'",
")",
";",
"$",
"this",
... | Validates "Service" credential data
@return bool | [
"Validates",
"Service",
"credential",
"data"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L222-L233 |
8,882 | gplcart/gapi | controllers/Credential.php | Credential.validateFileUploadCredential | protected function validateFileUploadCredential()
{
$upload = $this->request->file('file');
if (empty($upload)) {
if (!isset($this->data_credential['credential_id'])) {
$this->setError('data.file', $this->text('File is required'));
return false;
... | php | protected function validateFileUploadCredential()
{
$upload = $this->request->file('file');
if (empty($upload)) {
if (!isset($this->data_credential['credential_id'])) {
$this->setError('data.file', $this->text('File is required'));
return false;
... | [
"protected",
"function",
"validateFileUploadCredential",
"(",
")",
"{",
"$",
"upload",
"=",
"$",
"this",
"->",
"request",
"->",
"file",
"(",
"'file'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"upload",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",... | Validates JSON file upload
@return bool | [
"Validates",
"JSON",
"file",
"upload"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L239-L282 |
8,883 | gplcart/gapi | controllers/Credential.php | Credential.updateSubmittedCredential | protected function updateSubmittedCredential()
{
$this->controlAccess('module_gapi_credential_edit');
if ($this->credential->update($this->data_credential['credential_id'], $this->getSubmitted())) {
$this->redirect('admin/report/gapi', $this->text('Credential has been updated'), 'succes... | php | protected function updateSubmittedCredential()
{
$this->controlAccess('module_gapi_credential_edit');
if ($this->credential->update($this->data_credential['credential_id'], $this->getSubmitted())) {
$this->redirect('admin/report/gapi', $this->text('Credential has been updated'), 'succes... | [
"protected",
"function",
"updateSubmittedCredential",
"(",
")",
"{",
"$",
"this",
"->",
"controlAccess",
"(",
"'module_gapi_credential_edit'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"credential",
"->",
"update",
"(",
"$",
"this",
"->",
"data_credential",
"[",
... | Updates a submitted credential | [
"Updates",
"a",
"submitted",
"credential"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L299-L308 |
8,884 | gplcart/gapi | controllers/Credential.php | Credential.addSubmittedCredential | protected function addSubmittedCredential()
{
$this->controlAccess('module_gapi_credential_add');
$submitted = $this->getSubmitted();
$submitted['type'] = $this->data_type;
if ($this->credential->add($submitted)) {
$this->redirect('admin/report/gapi', $this->text('Crede... | php | protected function addSubmittedCredential()
{
$this->controlAccess('module_gapi_credential_add');
$submitted = $this->getSubmitted();
$submitted['type'] = $this->data_type;
if ($this->credential->add($submitted)) {
$this->redirect('admin/report/gapi', $this->text('Crede... | [
"protected",
"function",
"addSubmittedCredential",
"(",
")",
"{",
"$",
"this",
"->",
"controlAccess",
"(",
"'module_gapi_credential_add'",
")",
";",
"$",
"submitted",
"=",
"$",
"this",
"->",
"getSubmitted",
"(",
")",
";",
"$",
"submitted",
"[",
"'type'",
"]",
... | Adds a submitted credential | [
"Adds",
"a",
"submitted",
"credential"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L313-L325 |
8,885 | gplcart/gapi | controllers/Credential.php | Credential.submitDeleteCredential | protected function submitDeleteCredential()
{
if ($this->isPosted('delete') && isset($this->data_credential['credential_id'])) {
$this->controlAccess('module_gapi_credential_delete');
if ($this->credential->callHandler($this->data_credential['type'], 'delete', array(
... | php | protected function submitDeleteCredential()
{
if ($this->isPosted('delete') && isset($this->data_credential['credential_id'])) {
$this->controlAccess('module_gapi_credential_delete');
if ($this->credential->callHandler($this->data_credential['type'], 'delete', array(
... | [
"protected",
"function",
"submitDeleteCredential",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isPosted",
"(",
"'delete'",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"data_credential",
"[",
"'credential_id'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"co... | Delete a submitted credential | [
"Delete",
"a",
"submitted",
"credential"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L330-L343 |
8,886 | gplcart/gapi | controllers/Credential.php | Credential.listCredential | public function listCredential()
{
$this->actionListCredential();
$this->setTitleListCredential();
$this->setBreadcrumbListCredential();
$this->setFilterListCredential();
$this->setPagerListCredential();
$this->setData('credentials', $this->getListCredential());
... | php | public function listCredential()
{
$this->actionListCredential();
$this->setTitleListCredential();
$this->setBreadcrumbListCredential();
$this->setFilterListCredential();
$this->setPagerListCredential();
$this->setData('credentials', $this->getListCredential());
... | [
"public",
"function",
"listCredential",
"(",
")",
"{",
"$",
"this",
"->",
"actionListCredential",
"(",
")",
";",
"$",
"this",
"->",
"setTitleListCredential",
"(",
")",
";",
"$",
"this",
"->",
"setBreadcrumbListCredential",
"(",
")",
";",
"$",
"this",
"->",
... | Route callback
Displays the credential overview page | [
"Route",
"callback",
"Displays",
"the",
"credential",
"overview",
"page"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L349-L360 |
8,887 | gplcart/gapi | controllers/Credential.php | Credential.actionListCredential | protected function actionListCredential()
{
list($selected, $action) = $this->getPostedAction();
$deleted = 0;
foreach ($selected as $id) {
if ($action === 'delete' && $this->access('module_gapi_credential_delete')) {
$credential = $this->credential->get($id);
... | php | protected function actionListCredential()
{
list($selected, $action) = $this->getPostedAction();
$deleted = 0;
foreach ($selected as $id) {
if ($action === 'delete' && $this->access('module_gapi_credential_delete')) {
$credential = $this->credential->get($id);
... | [
"protected",
"function",
"actionListCredential",
"(",
")",
"{",
"list",
"(",
"$",
"selected",
",",
"$",
"action",
")",
"=",
"$",
"this",
"->",
"getPostedAction",
"(",
")",
";",
"$",
"deleted",
"=",
"0",
";",
"foreach",
"(",
"$",
"selected",
"as",
"$",
... | Applies an action to the selected credentials | [
"Applies",
"an",
"action",
"to",
"the",
"selected",
"credentials"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L365-L383 |
8,888 | gplcart/gapi | controllers/Credential.php | Credential.getListCredential | protected function getListCredential()
{
$options = $this->query_filter;
$options['limit'] = $this->data_limit;
return $this->credential->getList($options);
} | php | protected function getListCredential()
{
$options = $this->query_filter;
$options['limit'] = $this->data_limit;
return $this->credential->getList($options);
} | [
"protected",
"function",
"getListCredential",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"query_filter",
";",
"$",
"options",
"[",
"'limit'",
"]",
"=",
"$",
"this",
"->",
"data_limit",
";",
"return",
"$",
"this",
"->",
"credential",
"->",
"ge... | Returns an array of credentials
@return array | [
"Returns",
"an",
"array",
"of",
"credentials"
] | b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8 | https://github.com/gplcart/gapi/blob/b1f8a737d8ff3b6a3e54f44d19af3295ce732fa8/controllers/Credential.php#L414-L420 |
8,889 | vworldat/AttachmentBundle | Model/Attachment.php | Attachment.saveRememberedCustomName | public function saveRememberedCustomName()
{
if (null === $this->rememberName || !$this->hasLoadedLinks())
{
return;
}
foreach ($this->collAttachmentLinks as $attachmentLink)
{
/* @var $attachmentLink AttachmentLink */
$attachmentL... | php | public function saveRememberedCustomName()
{
if (null === $this->rememberName || !$this->hasLoadedLinks())
{
return;
}
foreach ($this->collAttachmentLinks as $attachmentLink)
{
/* @var $attachmentLink AttachmentLink */
$attachmentL... | [
"public",
"function",
"saveRememberedCustomName",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"rememberName",
"||",
"!",
"$",
"this",
"->",
"hasLoadedLinks",
"(",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"co... | Save custom name to all loaded AttachmentLinks if it has been set from the outside.
@return Attachment | [
"Save",
"custom",
"name",
"to",
"all",
"loaded",
"AttachmentLinks",
"if",
"it",
"has",
"been",
"set",
"from",
"the",
"outside",
"."
] | fb179c913e135164e0d1ebc69dcaf8b4782370dd | https://github.com/vworldat/AttachmentBundle/blob/fb179c913e135164e0d1ebc69dcaf8b4782370dd/Model/Attachment.php#L126-L143 |
8,890 | vworldat/AttachmentBundle | Model/Attachment.php | Attachment.getLinkForObject | public function getLinkForObject(AttachableObjectInterface $object, $fieldName = null)
{
return AttachmentLinkQuery::create()
->filterByAttachment($this)
->filterByAttachableObject($object)
->filterByModelField($fieldName)
->findOne()
;
} | php | public function getLinkForObject(AttachableObjectInterface $object, $fieldName = null)
{
return AttachmentLinkQuery::create()
->filterByAttachment($this)
->filterByAttachableObject($object)
->filterByModelField($fieldName)
->findOne()
;
} | [
"public",
"function",
"getLinkForObject",
"(",
"AttachableObjectInterface",
"$",
"object",
",",
"$",
"fieldName",
"=",
"null",
")",
"{",
"return",
"AttachmentLinkQuery",
"::",
"create",
"(",
")",
"->",
"filterByAttachment",
"(",
"$",
"this",
")",
"->",
"filterBy... | Get the AttachmentLink for a specific attachable object and field name.
@param AttachableObjectInterface $object
@param string $fieldName
@return AttachmentLink | [
"Get",
"the",
"AttachmentLink",
"for",
"a",
"specific",
"attachable",
"object",
"and",
"field",
"name",
"."
] | fb179c913e135164e0d1ebc69dcaf8b4782370dd | https://github.com/vworldat/AttachmentBundle/blob/fb179c913e135164e0d1ebc69dcaf8b4782370dd/Model/Attachment.php#L211-L219 |
8,891 | meridius/helpers | src/ExcelHelper.php | ExcelHelper.getExcelColumnName | public static function getExcelColumnName($num) {
$num--;
for ($name = ''; $num >= 0; $num = intval($num / 26) - 1) {
$name = chr($num % 26 + 0x41) . $name;
}
return $name;
} | php | public static function getExcelColumnName($num) {
$num--;
for ($name = ''; $num >= 0; $num = intval($num / 26) - 1) {
$name = chr($num % 26 + 0x41) . $name;
}
return $name;
} | [
"public",
"static",
"function",
"getExcelColumnName",
"(",
"$",
"num",
")",
"{",
"$",
"num",
"--",
";",
"for",
"(",
"$",
"name",
"=",
"''",
";",
"$",
"num",
">=",
"0",
";",
"$",
"num",
"=",
"intval",
"(",
"$",
"num",
"/",
"26",
")",
"-",
"1",
... | Converts numbers to Excel-like column names
A = 1
@param int $num
@return string | [
"Converts",
"numbers",
"to",
"Excel",
"-",
"like",
"column",
"names",
"A",
"=",
"1"
] | 108dac43a0bb90d95ebcf8e6f5a21f37221764f1 | https://github.com/meridius/helpers/blob/108dac43a0bb90d95ebcf8e6f5a21f37221764f1/src/ExcelHelper.php#L15-L21 |
8,892 | meridius/helpers | src/ExcelHelper.php | ExcelHelper.getExcelColumnNumber | public static function getExcelColumnNumber($letters) {
$num = 0;
$arr = array_reverse(str_split($letters));
$arrSize = count($arr);
for ($i = 0; $i < $arrSize; $i++) {
$num += (ord(strtolower($arr[$i])) - 96) * (pow(26, $i));
}
return $num;
} | php | public static function getExcelColumnNumber($letters) {
$num = 0;
$arr = array_reverse(str_split($letters));
$arrSize = count($arr);
for ($i = 0; $i < $arrSize; $i++) {
$num += (ord(strtolower($arr[$i])) - 96) * (pow(26, $i));
}
return $num;
} | [
"public",
"static",
"function",
"getExcelColumnNumber",
"(",
"$",
"letters",
")",
"{",
"$",
"num",
"=",
"0",
";",
"$",
"arr",
"=",
"array_reverse",
"(",
"str_split",
"(",
"$",
"letters",
")",
")",
";",
"$",
"arrSize",
"=",
"count",
"(",
"$",
"arr",
"... | Converts Excel-like column names to numbers
@param string $letters
@return int | [
"Converts",
"Excel",
"-",
"like",
"column",
"names",
"to",
"numbers"
] | 108dac43a0bb90d95ebcf8e6f5a21f37221764f1 | https://github.com/meridius/helpers/blob/108dac43a0bb90d95ebcf8e6f5a21f37221764f1/src/ExcelHelper.php#L28-L37 |
8,893 | mtoolkit/mtoolkit-network | src/rpc/json/server/MRPCJsonWebServiceDefinition.php | MRPCJsonWebServiceDefinition.initMethodDefinitionList | private function initMethodDefinitionList()
{
$class = new \ReflectionClass( $this->className );
$methods = $class->getMethods( \ReflectionMethod::IS_PUBLIC );
foreach( $methods as /* @var $reflect \ReflectionMethod */
$reflect )
{
if( $reflect->class !=... | php | private function initMethodDefinitionList()
{
$class = new \ReflectionClass( $this->className );
$methods = $class->getMethods( \ReflectionMethod::IS_PUBLIC );
foreach( $methods as /* @var $reflect \ReflectionMethod */
$reflect )
{
if( $reflect->class !=... | [
"private",
"function",
"initMethodDefinitionList",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"className",
")",
";",
"$",
"methods",
"=",
"$",
"class",
"->",
"getMethods",
"(",
"\\",
"ReflectionMethod",
"::",
... | Sets the array of the definitions of the methods. | [
"Sets",
"the",
"array",
"of",
"the",
"definitions",
"of",
"the",
"methods",
"."
] | eecf251df546a60ecb693fd3983e78cb946cb9d4 | https://github.com/mtoolkit/mtoolkit-network/blob/eecf251df546a60ecb693fd3983e78cb946cb9d4/src/rpc/json/server/MRPCJsonWebServiceDefinition.php#L47-L68 |
8,894 | chrismou/phergie-irc-plugin-react-weather | src/Provider/Wunderground.php | Wunderground.getApiRequestUrl | public function getApiRequestUrl(Event $event)
{
$params = $event->getCustomParams();
// Final parameter should be the country
$country = $params[count($params) - 1];
// Remove the final paramater
unset($params[count($params) - 1]);
// Merge the remainder of the supp... | php | public function getApiRequestUrl(Event $event)
{
$params = $event->getCustomParams();
// Final parameter should be the country
$country = $params[count($params) - 1];
// Remove the final paramater
unset($params[count($params) - 1]);
// Merge the remainder of the supp... | [
"public",
"function",
"getApiRequestUrl",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"params",
"=",
"$",
"event",
"->",
"getCustomParams",
"(",
")",
";",
"// Final parameter should be the country",
"$",
"country",
"=",
"$",
"params",
"[",
"count",
"(",
"$",
... | Return the url for the API request
@param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
@return string | [
"Return",
"the",
"url",
"for",
"the",
"API",
"request"
] | 9bc0e0b6d49f629a8c1c8df25a5561f5cf2901a2 | https://github.com/chrismou/phergie-irc-plugin-react-weather/blob/9bc0e0b6d49f629a8c1c8df25a5561f5cf2901a2/src/Provider/Wunderground.php#L41-L52 |
8,895 | asbsoft/yii2-common_2_170212 | base/ModulesManager.php | ModulesManager.instance | public static function instance()
{
if (empty(static::$_modmgr)) {
$module = Yii::$app->getModule(static::$modulesManagerModuleUid);
if (!empty($module) && $module instanceof UniModule) {
static::$_modmgr = $module->getDataModel(static::$modulesManagerModelAlias);
... | php | public static function instance()
{
if (empty(static::$_modmgr)) {
$module = Yii::$app->getModule(static::$modulesManagerModuleUid);
if (!empty($module) && $module instanceof UniModule) {
static::$_modmgr = $module->getDataModel(static::$modulesManagerModelAlias);
... | [
"public",
"static",
"function",
"instance",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"static",
"::",
"$",
"_modmgr",
")",
")",
"{",
"$",
"module",
"=",
"Yii",
"::",
"$",
"app",
"->",
"getModule",
"(",
"static",
"::",
"$",
"modulesManagerModuleUid",
")",... | Get modules manager instance | [
"Get",
"modules",
"manager",
"instance"
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/base/ModulesManager.php#L49-L60 |
8,896 | asbsoft/yii2-common_2_170212 | base/ModulesManager.php | ModulesManager.setAlreadyAddSubmodulesFor | public static function setAlreadyAddSubmodulesFor($module, $app = null)
{
if (empty($app)) {
$app = Yii::$app;
}
$appKey = UniApplication::appKey($app);
if($module instanceof YiiBaseModule) {
static::$_modulesWithInstalledSubmodules[$appKey][$module::className... | php | public static function setAlreadyAddSubmodulesFor($module, $app = null)
{
if (empty($app)) {
$app = Yii::$app;
}
$appKey = UniApplication::appKey($app);
if($module instanceof YiiBaseModule) {
static::$_modulesWithInstalledSubmodules[$appKey][$module::className... | [
"public",
"static",
"function",
"setAlreadyAddSubmodulesFor",
"(",
"$",
"module",
",",
"$",
"app",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"app",
")",
")",
"{",
"$",
"app",
"=",
"Yii",
"::",
"$",
"app",
";",
"}",
"$",
"appKey",
"=",
... | Add new module to list modules with already installed submodules.
@param yii\base\Module $module
@param yii\base\Application $app | [
"Add",
"new",
"module",
"to",
"list",
"modules",
"with",
"already",
"installed",
"submodules",
"."
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/base/ModulesManager.php#L69-L78 |
8,897 | asbsoft/yii2-common_2_170212 | base/ModulesManager.php | ModulesManager.modulesNamesList | public static function modulesNamesList($module = null, $onlyActivated = true, $forModmgr = false
, $onlyUniModule = false, $onlyLoaded = false, $indent = '. ')
{
$list = [];
if (empty($module)) {
$module = Yii::$app;
}
$modmgr = static::instance();
if (me... | php | public static function modulesNamesList($module = null, $onlyActivated = true, $forModmgr = false
, $onlyUniModule = false, $onlyLoaded = false, $indent = '. ')
{
$list = [];
if (empty($module)) {
$module = Yii::$app;
}
$modmgr = static::instance();
if (me... | [
"public",
"static",
"function",
"modulesNamesList",
"(",
"$",
"module",
"=",
"null",
",",
"$",
"onlyActivated",
"=",
"true",
",",
"$",
"forModmgr",
"=",
"false",
",",
"$",
"onlyUniModule",
"=",
"false",
",",
"$",
"onlyLoaded",
"=",
"false",
",",
"$",
"in... | Get modules list in format uniqueId => label.
Use for modules dropdown list.
@param yii\base\Module|empty $module "parent"(container) module
@param boolean $onlyActivated if true show only activated in Modules manager
@param boolean $forModmgr if true not expand to string moduleId-number from Modules manager
@param boo... | [
"Get",
"modules",
"list",
"in",
"format",
"uniqueId",
"=",
">",
"label",
".",
"Use",
"for",
"modules",
"dropdown",
"list",
"."
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/base/ModulesManager.php#L138-L187 |
8,898 | asbsoft/yii2-common_2_170212 | base/ModulesManager.php | ModulesManager.initSubmodules | public static function initSubmodules($module)
{
$submodules = ArrayHelper::merge($module->modules, static::submodules($module));
foreach ($submodules as $submoduleId => $submodule) {
if (is_array($submodule)) $submodule = $module->getModule($submoduleId);
if (empty($submodul... | php | public static function initSubmodules($module)
{
$submodules = ArrayHelper::merge($module->modules, static::submodules($module));
foreach ($submodules as $submoduleId => $submodule) {
if (is_array($submodule)) $submodule = $module->getModule($submoduleId);
if (empty($submodul... | [
"public",
"static",
"function",
"initSubmodules",
"(",
"$",
"module",
")",
"{",
"$",
"submodules",
"=",
"ArrayHelper",
"::",
"merge",
"(",
"$",
"module",
"->",
"modules",
",",
"static",
"::",
"submodules",
"(",
"$",
"module",
")",
")",
";",
"foreach",
"(... | Recursively init all submodules of module.
@param \yii\base\Module $module | [
"Recursively",
"init",
"all",
"submodules",
"of",
"module",
"."
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/base/ModulesManager.php#L263-L271 |
8,899 | Solve/Solve | SolveConsole/Controllers/GenController.php | GenController.modelAction | public function modelAction() {
$name = ucfirst(Inflector::camelize($this->getFirstParamOrAsk('Enter model name')));
$path = DC::getEnvironment()->getUserClassesRoot() . 'db/';
$mo = ModelOperator::getInstance($path);
if ($mo->getModelStructure($name)) {
$this->warning('mod... | php | public function modelAction() {
$name = ucfirst(Inflector::camelize($this->getFirstParamOrAsk('Enter model name')));
$path = DC::getEnvironment()->getUserClassesRoot() . 'db/';
$mo = ModelOperator::getInstance($path);
if ($mo->getModelStructure($name)) {
$this->warning('mod... | [
"public",
"function",
"modelAction",
"(",
")",
"{",
"$",
"name",
"=",
"ucfirst",
"(",
"Inflector",
"::",
"camelize",
"(",
"$",
"this",
"->",
"getFirstParamOrAsk",
"(",
"'Enter model name'",
")",
")",
")",
";",
"$",
"path",
"=",
"DC",
"::",
"getEnvironment"... | Generates default database model structure | [
"Generates",
"default",
"database",
"model",
"structure"
] | b2ac834c37831ba6049dafa28255d32b4ea0bf1d | https://github.com/Solve/Solve/blob/b2ac834c37831ba6049dafa28255d32b4ea0bf1d/SolveConsole/Controllers/GenController.php#L34-L45 |
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.