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,700 | MINISTRYGmbH/morrow-core | src/Db.php | Db.delete | public function delete($table, $where, $where_tokens = [], $affected_rows = false) {
// add tokens of where clause
$values = [];
if (is_scalar($where_tokens)) $where_tokens = [$where_tokens];
foreach ($where_tokens as $value) {
$values[] = $value;
}
$query = "DELETE FROM `$table` $where";
$this->co... | php | public function delete($table, $where, $where_tokens = [], $affected_rows = false) {
// add tokens of where clause
$values = [];
if (is_scalar($where_tokens)) $where_tokens = [$where_tokens];
foreach ($where_tokens as $value) {
$values[] = $value;
}
$query = "DELETE FROM `$table` $where";
$this->co... | [
"public",
"function",
"delete",
"(",
"$",
"table",
",",
"$",
"where",
",",
"$",
"where_tokens",
"=",
"[",
"]",
",",
"$",
"affected_rows",
"=",
"false",
")",
"{",
"// add tokens of where clause",
"$",
"values",
"=",
"[",
"]",
";",
"if",
"(",
"is_scalar",
... | Deletes a database row.
@param string $table The table name the query refers to.
@param string $where The where condition in the update query
@param mixed $where_tokens An array (or a scalar) for use as a Prepared Statement in the where clause. Only question marks are allowed for the token in the where clause. You can... | [
"Deletes",
"a",
"database",
"row",
"."
] | bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e | https://github.com/MINISTRYGmbH/morrow-core/blob/bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e/src/Db.php#L400-L416 |
8,701 | MINISTRYGmbH/morrow-core | src/Db.php | Db._createUpdateValues | protected function _createUpdateValues($array) {
$values = [];
$tokens = [];
// divide normal values from function calls
foreach ($array as $key => $value) {
if (is_array($value)) {
$tokens[] = '`'.$key.'`='.$value['FUNC'];
} else {
$tokens[] = '`'.$key.'`=?';
$values[] = $value;
}
}
... | php | protected function _createUpdateValues($array) {
$values = [];
$tokens = [];
// divide normal values from function calls
foreach ($array as $key => $value) {
if (is_array($value)) {
$tokens[] = '`'.$key.'`='.$value['FUNC'];
} else {
$tokens[] = '`'.$key.'`=?';
$values[] = $value;
}
}
... | [
"protected",
"function",
"_createUpdateValues",
"(",
"$",
"array",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"$",
"tokens",
"=",
"[",
"]",
";",
"// divide normal values from function calls",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"va... | Creates an update string of an associative array for use in a SQL query
@param array $array An associative array: column_name > value
@return string | [
"Creates",
"an",
"update",
"string",
"of",
"an",
"associative",
"array",
"for",
"use",
"in",
"a",
"SQL",
"query"
] | bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e | https://github.com/MINISTRYGmbH/morrow-core/blob/bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e/src/Db.php#L461-L479 |
8,702 | MINISTRYGmbH/morrow-core | src/Db.php | Db._createInsertAndReplaceValues | protected function _createInsertAndReplaceValues($array) {
$keys = [];
$values = [];
$binds = [];
foreach ($array as $value) {
if (is_array($value)) {
$values[] = $value['FUNC'];
} else {
$values[] = '?';
$binds[] = $value;
}
}
$keys = implode(',', array_keys($array));
$values = i... | php | protected function _createInsertAndReplaceValues($array) {
$keys = [];
$values = [];
$binds = [];
foreach ($array as $value) {
if (is_array($value)) {
$values[] = $value['FUNC'];
} else {
$values[] = '?';
$binds[] = $value;
}
}
$keys = implode(',', array_keys($array));
$values = i... | [
"protected",
"function",
"_createInsertAndReplaceValues",
"(",
"$",
"array",
")",
"{",
"$",
"keys",
"=",
"[",
"]",
";",
"$",
"values",
"=",
"[",
"]",
";",
"$",
"binds",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"value",
")",
"{",... | Creates an insert and replace string of an associative array for use in a SQL query
@param array $array An associative array: column_name > value
@return string | [
"Creates",
"an",
"insert",
"and",
"replace",
"string",
"of",
"an",
"associative",
"array",
"for",
"use",
"in",
"a",
"SQL",
"query"
] | bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e | https://github.com/MINISTRYGmbH/morrow-core/blob/bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e/src/Db.php#L487-L506 |
8,703 | MINISTRYGmbH/morrow-core | src/Db.php | Db._safe | protected function _safe($table, $array) {
if (!isset($this->cache[$table])) {
$this->connect();
$query = "SHOW COLUMNS FROM `$table`";
if ($this->config['driver'] == 'sqlite') {
$query = 'PRAGMA table_info(`'.$table.'`);';
}
$sth = $this->prepare($query);
$sth->execute();
$result = $sth-... | php | protected function _safe($table, $array) {
if (!isset($this->cache[$table])) {
$this->connect();
$query = "SHOW COLUMNS FROM `$table`";
if ($this->config['driver'] == 'sqlite') {
$query = 'PRAGMA table_info(`'.$table.'`);';
}
$sth = $this->prepare($query);
$sth->execute();
$result = $sth-... | [
"protected",
"function",
"_safe",
"(",
"$",
"table",
",",
"$",
"array",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"table",
"]",
")",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"query",
"=",
... | Removes all keys from an array which are not available in the given table
@param string $table The table name to compare the array with
@param array $array An associative array: column_name > value
@return array | [
"Removes",
"all",
"keys",
"from",
"an",
"array",
"which",
"are",
"not",
"available",
"in",
"the",
"given",
"table"
] | bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e | https://github.com/MINISTRYGmbH/morrow-core/blob/bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e/src/Db.php#L515-L543 |
8,704 | asbsoft/yii2module-content_2_170309 | controllers/AdminController.php | AdminController.actionIndex | public function actionIndex($parent = null, $page = 1)
{
$searchModel = $this->module->model('ContentSearch');
// list filter parameters correction
$params = Yii::$app->request->queryParams;
if ($parent === '-') { // to show all nodes
$params['parent'] = $parent;
... | php | public function actionIndex($parent = null, $page = 1)
{
$searchModel = $this->module->model('ContentSearch');
// list filter parameters correction
$params = Yii::$app->request->queryParams;
if ($parent === '-') { // to show all nodes
$params['parent'] = $parent;
... | [
"public",
"function",
"actionIndex",
"(",
"$",
"parent",
"=",
"null",
",",
"$",
"page",
"=",
"1",
")",
"{",
"$",
"searchModel",
"=",
"$",
"this",
"->",
"module",
"->",
"model",
"(",
"'ContentSearch'",
")",
";",
"// list filter parameters correction",
"$",
... | Lists all Content models.
@param mixed $parent parent node id, '0' means show root children, '-' means show all nodes.
@param integer $page
@return mixed | [
"Lists",
"all",
"Content",
"models",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/controllers/AdminController.php#L89-L121 |
8,705 | asbsoft/yii2module-content_2_170309 | controllers/AdminController.php | AdminController.actionView | public function actionView($id)
{
$model = $this->findModel($id);
$modelsI18n = $model->prepareI18nModels();
if ($model->pageSize > 0) {
$model->orderBy = $model::$defaultOrderBy;
$model->page = $model->calcPage();
}
// build frontend links
$... | php | public function actionView($id)
{
$model = $this->findModel($id);
$modelsI18n = $model->prepareI18nModels();
if ($model->pageSize > 0) {
$model->orderBy = $model::$defaultOrderBy;
$model->page = $model->calcPage();
}
// build frontend links
$... | [
"public",
"function",
"actionView",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"modelsI18n",
"=",
"$",
"model",
"->",
"prepareI18nModels",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->"... | Displays a single Content model.
@param integer $id
@return mixed | [
"Displays",
"a",
"single",
"Content",
"model",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/controllers/AdminController.php#L128-L169 |
8,706 | asbsoft/yii2module-content_2_170309 | controllers/AdminController.php | AdminController.actionCreate | public function actionCreate($parent = 0)
{
$model = $this->module->model('Content');
if (!isset($model->parent_id)) {
$model->parent_id = $parent;
}
$post = Yii::$app->request->post();
$loaded = $model->load($post);
if ($loaded && $model->save()) {
... | php | public function actionCreate($parent = 0)
{
$model = $this->module->model('Content');
if (!isset($model->parent_id)) {
$model->parent_id = $parent;
}
$post = Yii::$app->request->post();
$loaded = $model->load($post);
if ($loaded && $model->save()) {
... | [
"public",
"function",
"actionCreate",
"(",
"$",
"parent",
"=",
"0",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"module",
"->",
"model",
"(",
"'Content'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"model",
"->",
"parent_id",
")",
")",
"{",
... | Creates a new Content model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"Content",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/controllers/AdminController.php#L176-L201 |
8,707 | asbsoft/yii2module-content_2_170309 | controllers/AdminController.php | AdminController.actionUpdate | public function actionUpdate($id)
{
$model = $this->findModel($id);
// check permissions
if (!Yii::$app->user->can('roleContentModerator') // user is not moderator
&& Yii::$app->user->can('roleContentAuthor') // but is author ...
&& !Yii::$app->user->can('updateOwnCont... | php | public function actionUpdate($id)
{
$model = $this->findModel($id);
// check permissions
if (!Yii::$app->user->can('roleContentModerator') // user is not moderator
&& Yii::$app->user->can('roleContentAuthor') // but is author ...
&& !Yii::$app->user->can('updateOwnCont... | [
"public",
"function",
"actionUpdate",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"// check permissions",
"if",
"(",
"!",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"can",
"(",
"'roleConten... | Updates an existing Content model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Content",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/controllers/AdminController.php#L209-L252 |
8,708 | asbsoft/yii2module-content_2_170309 | controllers/AdminController.php | AdminController.actionDelete | public function actionDelete($id)
{
$model = $this->findModel($id);
$model->orderBy = $model::$defaultOrderBy;
$model->page = $model->calcPage($model::find()->where(['parent_id' => $model->parent_id]));
$returnTo = ['index', // try to return to same place - deletion may be unsuccess... | php | public function actionDelete($id)
{
$model = $this->findModel($id);
$model->orderBy = $model::$defaultOrderBy;
$model->page = $model->calcPage($model::find()->where(['parent_id' => $model->parent_id]));
$returnTo = ['index', // try to return to same place - deletion may be unsuccess... | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"->",
"orderBy",
"=",
"$",
"model",
"::",
"$",
"defaultOrderBy",
";",
"$",
"model",
"->",
"pa... | Deletes an existing Content model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Deletes",
"an",
"existing",
"Content",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/controllers/AdminController.php#L260-L276 |
8,709 | asbsoft/yii2module-content_2_170309 | controllers/AdminController.php | AdminController.findModel | protected function findModel($id)
{
$model = $this->module->model('Content')->findOne($id);
if ($model !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | php | protected function findModel($id)
{
$model = $this->module->model('Content')->findOne($id);
if ($model !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"protected",
"function",
"findModel",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"module",
"->",
"model",
"(",
"'Content'",
")",
"->",
"findOne",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"!==",
"null",
")",
"{",
"re... | Finds the Content model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@return Content the loaded model
@throws NotFoundHttpException if the model cannot be found | [
"Finds",
"the",
"Content",
"model",
"based",
"on",
"its",
"primary",
"key",
"value",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"404",
"HTTP",
"exception",
"will",
"be",
"thrown",
"."
] | 9e7ee40fd48ef9656a9f95379f20bf6a4004187b | https://github.com/asbsoft/yii2module-content_2_170309/blob/9e7ee40fd48ef9656a9f95379f20bf6a4004187b/controllers/AdminController.php#L354-L362 |
8,710 | pgraham/database | src/PreparedStatement.php | PreparedStatement.execute | public function execute($params = null) {
if ($params === null) {
$params = [];
}
try {
$this->stmt->execute($params);
return new QueryResult($this->stmt, $this->pdo);
} catch (PDOException $e) {
throw $this->exAdapter->adapt($e, $this->stmt, $params);
}
} | php | public function execute($params = null) {
if ($params === null) {
$params = [];
}
try {
$this->stmt->execute($params);
return new QueryResult($this->stmt, $this->pdo);
} catch (PDOException $e) {
throw $this->exAdapter->adapt($e, $this->stmt, $params);
}
} | [
"public",
"function",
"execute",
"(",
"$",
"params",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"params",
"===",
"null",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"}",
"try",
"{",
"$",
"this",
"->",
"stmt",
"->",
"execute",
"(",
"$",
"params",
"... | Execute the prepared statment with the given parameter values.
@throws DatabaseException | [
"Execute",
"the",
"prepared",
"statment",
"with",
"the",
"given",
"parameter",
"values",
"."
] | b325425da23273536772d4fe62da4b669b78601b | https://github.com/pgraham/database/blob/b325425da23273536772d4fe62da4b669b78601b/src/PreparedStatement.php#L69-L81 |
8,711 | remote-office/libx | src/Util/Date.php | Date.getValue | public function getValue()
{
$value = sprintf("%04d-%02d-%02d", $this->year, $this->month, $this->day);
return $value;
} | php | public function getValue()
{
$value = sprintf("%04d-%02d-%02d", $this->year, $this->month, $this->day);
return $value;
} | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"value",
"=",
"sprintf",
"(",
"\"%04d-%02d-%02d\"",
",",
"$",
"this",
"->",
"year",
",",
"$",
"this",
"->",
"month",
",",
"$",
"this",
"->",
"day",
")",
";",
"return",
"$",
"value",
";",
"}"
] | Get the value of this Date as an ISO string
@param void
@return string | [
"Get",
"the",
"value",
"of",
"this",
"Date",
"as",
"an",
"ISO",
"string"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Util/Date.php#L57-L62 |
8,712 | remote-office/libx | src/Util/Date.php | Date.getLocale | public function getLocale()
{
$value = sprintf("%02d-%02d-%04d", $this->day, $this->month, $this->year);
return $value;
} | php | public function getLocale()
{
$value = sprintf("%02d-%02d-%04d", $this->day, $this->month, $this->year);
return $value;
} | [
"public",
"function",
"getLocale",
"(",
")",
"{",
"$",
"value",
"=",
"sprintf",
"(",
"\"%02d-%02d-%04d\"",
",",
"$",
"this",
"->",
"day",
",",
"$",
"this",
"->",
"month",
",",
"$",
"this",
"->",
"year",
")",
";",
"return",
"$",
"value",
";",
"}"
] | Get the value of this Date as a locale string
@param void
@return string | [
"Get",
"the",
"value",
"of",
"this",
"Date",
"as",
"a",
"locale",
"string"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Util/Date.php#L70-L75 |
8,713 | remote-office/libx | src/Util/Date.php | Date.setDate | public function setDate($year, $month, $day)
{
// Validate
self::validateDate($year, $month, $day);
// Set internal year, month and day variables
$this->year = (int)$year;
$this->month = (int)$month;
$this->day = (int)$day;
} | php | public function setDate($year, $month, $day)
{
// Validate
self::validateDate($year, $month, $day);
// Set internal year, month and day variables
$this->year = (int)$year;
$this->month = (int)$month;
$this->day = (int)$day;
} | [
"public",
"function",
"setDate",
"(",
"$",
"year",
",",
"$",
"month",
",",
"$",
"day",
")",
"{",
"// Validate",
"self",
"::",
"validateDate",
"(",
"$",
"year",
",",
"$",
"month",
",",
"$",
"day",
")",
";",
"// Set internal year, month and day variables",
"... | Set the date represented by this Date
@param integer $year
@param integer $month
@param integer $day
@return void | [
"Set",
"the",
"date",
"represented",
"by",
"this",
"Date"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Util/Date.php#L85-L94 |
8,714 | remote-office/libx | src/Util/Date.php | Date.validate | static public function validate($date)
{
// Check if date is a string
if(is_string($date) && strlen(trim($date)) > 0)
return false;
// Check if date matches pattern
if(!preg_match('/^' . self::PATTERN . '$/', $date, $matches))
return false;
// Extrac... | php | static public function validate($date)
{
// Check if date is a string
if(is_string($date) && strlen(trim($date)) > 0)
return false;
// Check if date matches pattern
if(!preg_match('/^' . self::PATTERN . '$/', $date, $matches))
return false;
// Extrac... | [
"static",
"public",
"function",
"validate",
"(",
"$",
"date",
")",
"{",
"// Check if date is a string",
"if",
"(",
"is_string",
"(",
"$",
"date",
")",
"&&",
"strlen",
"(",
"trim",
"(",
"$",
"date",
")",
")",
">",
"0",
")",
"return",
"false",
";",
"// C... | Validate if a string is a date
@param string $date
@return boolean true if string is a date, false otherwise | [
"Validate",
"if",
"a",
"string",
"is",
"a",
"date"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Util/Date.php#L117-L135 |
8,715 | calgamo/event-loop | src/EventLoop.php | EventLoop.run | public function run(string $startup_event, $startup_data = null)
{
$event = new Event($startup_event, $startup_data);
$ctx = new EventContext($event, $this->event_queue);
$loop_exit = $this->loop_exit ?? function (int $counter){
return $counter > $this->max_loop_count;
... | php | public function run(string $startup_event, $startup_data = null)
{
$event = new Event($startup_event, $startup_data);
$ctx = new EventContext($event, $this->event_queue);
$loop_exit = $this->loop_exit ?? function (int $counter){
return $counter > $this->max_loop_count;
... | [
"public",
"function",
"run",
"(",
"string",
"$",
"startup_event",
",",
"$",
"startup_data",
"=",
"null",
")",
"{",
"$",
"event",
"=",
"new",
"Event",
"(",
"$",
"startup_event",
",",
"$",
"startup_data",
")",
";",
"$",
"ctx",
"=",
"new",
"EventContext",
... | Process event loop
@param string $startup_event
@param mixed $startup_data | [
"Process",
"event",
"loop"
] | f85a9c153f2548a94ddc58334c001f241dd8f12d | https://github.com/calgamo/event-loop/blob/f85a9c153f2548a94ddc58334c001f241dd8f12d/src/EventLoop.php#L66-L117 |
8,716 | unyx/diagnostics | debug/handlers/Exception.php | Exception.register | public static function register(interfaces\handlers\Exception $handler = null) : Exception
{
set_exception_handler([$handler ?: $handler = new static, 'handle']);
return $handler;
} | php | public static function register(interfaces\handlers\Exception $handler = null) : Exception
{
set_exception_handler([$handler ?: $handler = new static, 'handle']);
return $handler;
} | [
"public",
"static",
"function",
"register",
"(",
"interfaces",
"\\",
"handlers",
"\\",
"Exception",
"$",
"handler",
"=",
"null",
")",
":",
"Exception",
"{",
"set_exception_handler",
"(",
"[",
"$",
"handler",
"?",
":",
"$",
"handler",
"=",
"new",
"static",
... | Registers the given or this Exception Handler with PHP.
@param interfaces\handlers\Exception $handler An optional, already instantiated Exception Handler
instance. If none is given, a new one will be
instantiated.
@return Exception An instance of the Exception Handler which go... | [
"Registers",
"the",
"given",
"or",
"this",
"Exception",
"Handler",
"with",
"PHP",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/handlers/Exception.php#L73-L78 |
8,717 | unyx/diagnostics | debug/handlers/Exception.php | Exception.add | public function add($delegate, string $name = null, int $priority = 0) : self
{
// Which name should we use?
// Micro-optimization note: mt_rand() turned out to be several times faster than uniqid and somewhat
// faster than counting the current number of delegates.
$name = $name ?: ... | php | public function add($delegate, string $name = null, int $priority = 0) : self
{
// Which name should we use?
// Micro-optimization note: mt_rand() turned out to be several times faster than uniqid and somewhat
// faster than counting the current number of delegates.
$name = $name ?: ... | [
"public",
"function",
"add",
"(",
"$",
"delegate",
",",
"string",
"$",
"name",
"=",
"null",
",",
"int",
"$",
"priority",
"=",
"0",
")",
":",
"self",
"{",
"// Which name should we use?",
"// Micro-optimization note: mt_rand() turned out to be several times faster than un... | Adds the given Delegate with the given optional priority to the stack.
@param interfaces\Delegate|callable $delegate The Delegate to be inserted into the stack.
@param string $name The name of the Delegate. Has to be unique. If none is
given, the full (ie. with namespace) classn... | [
"Adds",
"the",
"given",
"Delegate",
"with",
"the",
"given",
"optional",
"priority",
"to",
"the",
"stack",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/handlers/Exception.php#L210-L222 |
8,718 | unyx/diagnostics | debug/handlers/Exception.php | Exception.remove | public function remove($delegate, bool $all = true) : self
{
// When a string was passed, we will need to distinguish what to compare within our search.
$name = is_string($delegate) ? $delegate : null;
foreach ($this->delegates as $k => $v) {
if (($name and $k === $name) or (!$n... | php | public function remove($delegate, bool $all = true) : self
{
// When a string was passed, we will need to distinguish what to compare within our search.
$name = is_string($delegate) ? $delegate : null;
foreach ($this->delegates as $k => $v) {
if (($name and $k === $name) or (!$n... | [
"public",
"function",
"remove",
"(",
"$",
"delegate",
",",
"bool",
"$",
"all",
"=",
"true",
")",
":",
"self",
"{",
"// When a string was passed, we will need to distinguish what to compare within our search.",
"$",
"name",
"=",
"is_string",
"(",
"$",
"delegate",
")",
... | Removes a specific Delegate or callable from the stack.
Important note: This will remove all *instances* of the given Delegate if it passes the strict match unless
$all is set to false *or* a name is used instead of an instance as the first argument to this method, since
Delegate names are unique within this Handler.
... | [
"Removes",
"a",
"specific",
"Delegate",
"or",
"callable",
"from",
"the",
"stack",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/handlers/Exception.php#L237-L254 |
8,719 | unyx/diagnostics | debug/handlers/Exception.php | Exception.sort | protected function sort(array &$delegates) : self
{
uasort($delegates, function($a, $b) {
return $b['priority'] - $a['priority'];
});
return $this;
} | php | protected function sort(array &$delegates) : self
{
uasort($delegates, function($a, $b) {
return $b['priority'] - $a['priority'];
});
return $this;
} | [
"protected",
"function",
"sort",
"(",
"array",
"&",
"$",
"delegates",
")",
":",
"self",
"{",
"uasort",
"(",
"$",
"delegates",
",",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"$",
"b",
"[",
"'priority'",
"]",
"-",
"$",
"a",
"[",... | Sorts the given Delegates by their priority, highest first.
@param array &$delegates The Delegates to sort.
@return $this | [
"Sorts",
"the",
"given",
"Delegates",
"by",
"their",
"priority",
"highest",
"first",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/handlers/Exception.php#L407-L414 |
8,720 | unyx/diagnostics | debug/handlers/Exception.php | Exception.pushToList | protected function pushToList(array &$list, $name) : self
{
// Handle arrays (recursively).
if (is_array($name)) {
foreach ($name as $single) {
$this->pushToList($list, $single);
}
return $this;
}
$list[] = $name;
// Reset... | php | protected function pushToList(array &$list, $name) : self
{
// Handle arrays (recursively).
if (is_array($name)) {
foreach ($name as $single) {
$this->pushToList($list, $single);
}
return $this;
}
$list[] = $name;
// Reset... | [
"protected",
"function",
"pushToList",
"(",
"array",
"&",
"$",
"list",
",",
"$",
"name",
")",
":",
"self",
"{",
"// Handle arrays (recursively).",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"foreach",
"(",
"$",
"name",
"as",
"$",
"single",
... | Pushes the given values to either the black-or-white-list.
@param array &$list Either $this->blacklist or $this->whitelist.
@param string|array $name {@see self::blacklist()} or {@see self::whitelist()}
@return $this | [
"Pushes",
"the",
"given",
"values",
"to",
"either",
"the",
"black",
"-",
"or",
"-",
"white",
"-",
"list",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/handlers/Exception.php#L423-L439 |
8,721 | unyx/diagnostics | debug/handlers/Exception.php | Exception.compileList | protected function compileList(array &$list, array $delegates)
{
$return = [];
foreach ($list as $name) {
$return[] = preg_grep('/'.$name.'/', $delegates);
}
return call_user_func_array('array_merge', $return);
} | php | protected function compileList(array &$list, array $delegates)
{
$return = [];
foreach ($list as $name) {
$return[] = preg_grep('/'.$name.'/', $delegates);
}
return call_user_func_array('array_merge', $return);
} | [
"protected",
"function",
"compileList",
"(",
"array",
"&",
"$",
"list",
",",
"array",
"$",
"delegates",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"name",
")",
"{",
"$",
"return",
"[",
"]",
"=",
"preg_grep"... | Compiles the given black-or-white-list based on the given Delegate names, ie. run regex matches against
the Delegate names.
@param array &$list Either $this->blacklist or $this->whitelist.
@param array $delegates An array of Delegate names that should be considered.
@return array The compi... | [
"Compiles",
"the",
"given",
"black",
"-",
"or",
"-",
"white",
"-",
"list",
"based",
"on",
"the",
"given",
"Delegate",
"names",
"ie",
".",
"run",
"regex",
"matches",
"against",
"the",
"Delegate",
"names",
"."
] | 024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e | https://github.com/unyx/diagnostics/blob/024dbe138dc27ff1797e74cd7d1bc7e3f81ab80e/debug/handlers/Exception.php#L449-L458 |
8,722 | lbausch/laravel-cornerstone | src/Http/Controllers/CornerstoneController.php | CornerstoneController.getTitle | public function getTitle()
{
$title = $this->title;
if (isset($this->title_suffix)) {
$title = $title.$this->title_suffix;
}
if (isset($this->title_prefix)) {
$title = $this->title_prefix.$title;
}
return $title;
} | php | public function getTitle()
{
$title = $this->title;
if (isset($this->title_suffix)) {
$title = $title.$this->title_suffix;
}
if (isset($this->title_prefix)) {
$title = $this->title_prefix.$title;
}
return $title;
} | [
"public",
"function",
"getTitle",
"(",
")",
"{",
"$",
"title",
"=",
"$",
"this",
"->",
"title",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"title_suffix",
")",
")",
"{",
"$",
"title",
"=",
"$",
"title",
".",
"$",
"this",
"->",
"title_suffix",... | Get title.
@return string | [
"Get",
"title",
"."
] | c0907c5e3dce1737bfa5dac30e6bb89f448d15f3 | https://github.com/lbausch/laravel-cornerstone/blob/c0907c5e3dce1737bfa5dac30e6bb89f448d15f3/src/Http/Controllers/CornerstoneController.php#L37-L50 |
8,723 | easy-system/es-http | src/Factory/UploadedFilesFactory.php | UploadedFilesFactory.normalize | protected static function normalize(array $files)
{
$normalized = [];
foreach ($files as $key => $value) {
if ($value instanceof UploadedFileInterface) {
$normalized[$key] = $value;
continue;
}
if (! is_array($value)) {
... | php | protected static function normalize(array $files)
{
$normalized = [];
foreach ($files as $key => $value) {
if ($value instanceof UploadedFileInterface) {
$normalized[$key] = $value;
continue;
}
if (! is_array($value)) {
... | [
"protected",
"static",
"function",
"normalize",
"(",
"array",
"$",
"files",
")",
"{",
"$",
"normalized",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Uploade... | Normalizes the array.
@param array $files The array with specifications of uploaded files
@throws \InvalidArgumentException If invalid value present in
files specification
@return array The normalized array | [
"Normalizes",
"the",
"array",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Factory/UploadedFilesFactory.php#L48-L74 |
8,724 | easy-system/es-http | src/Factory/UploadedFilesFactory.php | UploadedFilesFactory.build | protected static function build(array $file)
{
if (is_array($file['tmp_name'])) {
return static::normalizeNested($file);
}
return new UploadedFile(
$file['name'],
$file['tmp_name'],
$file['type'],
$file['size'],
$file['... | php | protected static function build(array $file)
{
if (is_array($file['tmp_name'])) {
return static::normalizeNested($file);
}
return new UploadedFile(
$file['name'],
$file['tmp_name'],
$file['type'],
$file['size'],
$file['... | [
"protected",
"static",
"function",
"build",
"(",
"array",
"$",
"file",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"file",
"[",
"'tmp_name'",
"]",
")",
")",
"{",
"return",
"static",
"::",
"normalizeNested",
"(",
"$",
"file",
")",
";",
"}",
"return",
"... | Builds the uploaded file from specification.
@param array $file The specification of uploaded file or a nested array
@return \Es\Http\UploadedFile The uploaded file | [
"Builds",
"the",
"uploaded",
"file",
"from",
"specification",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Factory/UploadedFilesFactory.php#L83-L96 |
8,725 | easy-system/es-http | src/Factory/UploadedFilesFactory.php | UploadedFilesFactory.normalizeNested | protected static function normalizeNested(array $files)
{
$normalized = [];
foreach (array_keys($files['tmp_name']) as $key) {
$spec = [
'name' => $files['name'][$key],
'tmp_name' => $files['tmp_name'][$key],
'type' => $files['type'... | php | protected static function normalizeNested(array $files)
{
$normalized = [];
foreach (array_keys($files['tmp_name']) as $key) {
$spec = [
'name' => $files['name'][$key],
'tmp_name' => $files['tmp_name'][$key],
'type' => $files['type'... | [
"protected",
"static",
"function",
"normalizeNested",
"(",
"array",
"$",
"files",
")",
"{",
"$",
"normalized",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"files",
"[",
"'tmp_name'",
"]",
")",
"as",
"$",
"key",
")",
"{",
"$",
"spec",
... | Normalizes a nested array.
@param array $files The nested array
@return array Normalized array | [
"Normalizes",
"a",
"nested",
"array",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Factory/UploadedFilesFactory.php#L105-L120 |
8,726 | flavorzyb/simple | src/Log/Writer.php | Writer.setDirPath | public function setDirPath($dirPath)
{
$dirPath = trim($dirPath);
if ($this->filesystem->isDirectory($dirPath)) {
$this->dirPath = $this->filesystem->realPath($dirPath);
}
} | php | public function setDirPath($dirPath)
{
$dirPath = trim($dirPath);
if ($this->filesystem->isDirectory($dirPath)) {
$this->dirPath = $this->filesystem->realPath($dirPath);
}
} | [
"public",
"function",
"setDirPath",
"(",
"$",
"dirPath",
")",
"{",
"$",
"dirPath",
"=",
"trim",
"(",
"$",
"dirPath",
")",
";",
"if",
"(",
"$",
"this",
"->",
"filesystem",
"->",
"isDirectory",
"(",
"$",
"dirPath",
")",
")",
"{",
"$",
"this",
"->",
"... | set the log dir path
@param string $dirPath | [
"set",
"the",
"log",
"dir",
"path"
] | 8c4c539ae2057217b2637fc72c2a90ba266e8e6c | https://github.com/flavorzyb/simple/blob/8c4c539ae2057217b2637fc72c2a90ba266e8e6c/src/Log/Writer.php#L80-L86 |
8,727 | flavorzyb/simple | src/Log/Writer.php | Writer.log | protected function log($type, $msg)
{
$msg = trim($msg);
if ('' == $msg) {
return false;
}
$filesystem = $this->filesystem;
if (!$filesystem->isDirectory($this->dirPath)) {
return false;
}
$type = intval($type);
$subP... | php | protected function log($type, $msg)
{
$msg = trim($msg);
if ('' == $msg) {
return false;
}
$filesystem = $this->filesystem;
if (!$filesystem->isDirectory($this->dirPath)) {
return false;
}
$type = intval($type);
$subP... | [
"protected",
"function",
"log",
"(",
"$",
"type",
",",
"$",
"msg",
")",
"{",
"$",
"msg",
"=",
"trim",
"(",
"$",
"msg",
")",
";",
"if",
"(",
"''",
"==",
"$",
"msg",
")",
"{",
"return",
"false",
";",
"}",
"$",
"filesystem",
"=",
"$",
"this",
"-... | write log to file
@param int $type
@param string $msg
@return boolean | [
"write",
"log",
"to",
"file"
] | 8c4c539ae2057217b2637fc72c2a90ba266e8e6c | https://github.com/flavorzyb/simple/blob/8c4c539ae2057217b2637fc72c2a90ba266e8e6c/src/Log/Writer.php#L103-L170 |
8,728 | northern/PHP-Common | src/Northern/Common/Util/TokenUtil.php | TokenUtil.getNonce | public static function getNonce($length = 32)
{
do {
$entropy = openssl_random_pseudo_bytes($length, $strong);
} while ($strong === false);
$nonce = sha1($entropy);
return $nonce;
} | php | public static function getNonce($length = 32)
{
do {
$entropy = openssl_random_pseudo_bytes($length, $strong);
} while ($strong === false);
$nonce = sha1($entropy);
return $nonce;
} | [
"public",
"static",
"function",
"getNonce",
"(",
"$",
"length",
"=",
"32",
")",
"{",
"do",
"{",
"$",
"entropy",
"=",
"openssl_random_pseudo_bytes",
"(",
"$",
"length",
",",
"$",
"strong",
")",
";",
"}",
"while",
"(",
"$",
"strong",
"===",
"false",
")",... | This method will generate a pseudo random SHA1 that can be used as nonce or
other kind of token. To specifiy the length of the token use the length
parameter.
@param int $length | [
"This",
"method",
"will",
"generate",
"a",
"pseudo",
"random",
"SHA1",
"that",
"can",
"be",
"used",
"as",
"nonce",
"or",
"other",
"kind",
"of",
"token",
".",
"To",
"specifiy",
"the",
"length",
"of",
"the",
"token",
"use",
"the",
"length",
"parameter",
".... | 7c63ef19252fd540fb412a18af956b8563afaa55 | https://github.com/northern/PHP-Common/blob/7c63ef19252fd540fb412a18af956b8563afaa55/src/Northern/Common/Util/TokenUtil.php#L32-L41 |
8,729 | mszewcz/php-light-framework | src/Variables/Specific/Get.php | Get.buildString | public function buildString(array $variables = [], bool $useExisting = true): string
{
if ($useExisting === true) {
$variables = \array_merge($this->variables, $variables);
}
$tmp = [];
foreach ($variables as $name => $val) {
if ($val !== null) {
... | php | public function buildString(array $variables = [], bool $useExisting = true): string
{
if ($useExisting === true) {
$variables = \array_merge($this->variables, $variables);
}
$tmp = [];
foreach ($variables as $name => $val) {
if ($val !== null) {
... | [
"public",
"function",
"buildString",
"(",
"array",
"$",
"variables",
"=",
"[",
"]",
",",
"bool",
"$",
"useExisting",
"=",
"true",
")",
":",
"string",
"{",
"if",
"(",
"$",
"useExisting",
"===",
"true",
")",
"{",
"$",
"variables",
"=",
"\\",
"array_merge... | Builds GET variables string.
@param array $variables
@param bool $useExisting
@return string | [
"Builds",
"GET",
"variables",
"string",
"."
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Variables/Specific/Get.php#L73-L91 |
8,730 | synapsestudios/synapse-base | src/Synapse/Mapper/DeleterTrait.php | DeleterTrait.deleteWhere | public function deleteWhere(array $wheres)
{
$query = $this->getSqlObject()
->delete()
->where($wheres);
return $this->execute($query);
} | php | public function deleteWhere(array $wheres)
{
$query = $this->getSqlObject()
->delete()
->where($wheres);
return $this->execute($query);
} | [
"public",
"function",
"deleteWhere",
"(",
"array",
"$",
"wheres",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getSqlObject",
"(",
")",
"->",
"delete",
"(",
")",
"->",
"where",
"(",
"$",
"wheres",
")",
";",
"return",
"$",
"this",
"->",
"execute",... | Delete all records in this table that meet the provided conditions
@param array $wheres An array of where conditions in the format: ['column' => 'value']
@return Result | [
"Delete",
"all",
"records",
"in",
"this",
"table",
"that",
"meet",
"the",
"provided",
"conditions"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/DeleterTrait.php#L29-L36 |
8,731 | IVIR3zaM/ObjectArrayTools | src/Traits/ArrayAccessTrait.php | ArrayAccessTrait.offsetGet | public function offsetGet($offset)
{
if ($this->offsetExists($offset) &&
$this->internalFilterHooks($offset, $this->baseConcreteData[$offset], 'output')
) {
return $this->internalSanitizeHooks($offset, $this->baseConcreteData[$offset], 'output');
}
} | php | public function offsetGet($offset)
{
if ($this->offsetExists($offset) &&
$this->internalFilterHooks($offset, $this->baseConcreteData[$offset], 'output')
) {
return $this->internalSanitizeHooks($offset, $this->baseConcreteData[$offset], 'output');
}
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"offset",
")",
"&&",
"$",
"this",
"->",
"internalFilterHooks",
"(",
"$",
"offset",
",",
"$",
"this",
"->",
"baseConcreteData",
"[",
... | this is necessary for ArrayAccess Interface and return and element by offset
@param $offset
@return mixed the element data or null if it not exists | [
"this",
"is",
"necessary",
"for",
"ArrayAccess",
"Interface",
"and",
"return",
"and",
"element",
"by",
"offset"
] | 31c12fc6f8a40a36873c074409ae4299b35f9177 | https://github.com/IVIR3zaM/ObjectArrayTools/blob/31c12fc6f8a40a36873c074409ae4299b35f9177/src/Traits/ArrayAccessTrait.php#L39-L46 |
8,732 | IVIR3zaM/ObjectArrayTools | src/Traits/ArrayAccessTrait.php | ArrayAccessTrait.offsetSet | public function offsetSet($offset, $value)
{
if (!is_scalar($offset) && !is_null($offset)) {
return;
}
$isNew = $this->offsetIsNew($offset);
$oldData = $isNew ? null : $this->offsetGet($offset);
$index = $isNew ? $this->arrayAccessMapIndex++ : array_search($offse... | php | public function offsetSet($offset, $value)
{
if (!is_scalar($offset) && !is_null($offset)) {
return;
}
$isNew = $this->offsetIsNew($offset);
$oldData = $isNew ? null : $this->offsetGet($offset);
$index = $isNew ? $this->arrayAccessMapIndex++ : array_search($offse... | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"offset",
")",
"&&",
"!",
"is_null",
"(",
"$",
"offset",
")",
")",
"{",
"return",
";",
"}",
"$",
"isNew",
"=",
"$",
"this",... | this is necessary for ArrayAccess Interface and save and element to array by offset
@param mixed $offset
@param mixed $value
@return void | [
"this",
"is",
"necessary",
"for",
"ArrayAccess",
"Interface",
"and",
"save",
"and",
"element",
"to",
"array",
"by",
"offset"
] | 31c12fc6f8a40a36873c074409ae4299b35f9177 | https://github.com/IVIR3zaM/ObjectArrayTools/blob/31c12fc6f8a40a36873c074409ae4299b35f9177/src/Traits/ArrayAccessTrait.php#L59-L88 |
8,733 | IVIR3zaM/ObjectArrayTools | src/Traits/ArrayAccessTrait.php | ArrayAccessTrait.offsetUnset | public function offsetUnset($offset)
{
if ($this->offsetExists($offset) && $this->internalFilterHooks($offset, null, 'remove')) {
$oldData = $this->offsetGet($offset);
unset($this->baseConcreteData[$offset]);
if (($index = array_search($offset, $this->baseArrayMap, true)... | php | public function offsetUnset($offset)
{
if ($this->offsetExists($offset) && $this->internalFilterHooks($offset, null, 'remove')) {
$oldData = $this->offsetGet($offset);
unset($this->baseConcreteData[$offset]);
if (($index = array_search($offset, $this->baseArrayMap, true)... | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"offset",
")",
"&&",
"$",
"this",
"->",
"internalFilterHooks",
"(",
"$",
"offset",
",",
"null",
",",
"'remove'",
")",
")",
"{",
... | this is necessary for ArrayAccess Interface and delete element by offset and rearrange the map
@param mixed $offset
@return void | [
"this",
"is",
"necessary",
"for",
"ArrayAccess",
"Interface",
"and",
"delete",
"element",
"by",
"offset",
"and",
"rearrange",
"the",
"map"
] | 31c12fc6f8a40a36873c074409ae4299b35f9177 | https://github.com/IVIR3zaM/ObjectArrayTools/blob/31c12fc6f8a40a36873c074409ae4299b35f9177/src/Traits/ArrayAccessTrait.php#L95-L110 |
8,734 | bishopb/vanilla | applications/dashboard/models/class.banmodel.php | BanModel.ApplyBan | public function ApplyBan($NewBan = NULL, $OldBan = NULL) {
if (!$NewBan && !$OldBan)
return;
$OldUsers = array();
$OldUserIDs = array();
$NewUsers = array();
$NewUserIDs = array();
$AllBans = $this->AllBans();
if ($NewBan) {
// Get a list of us... | php | public function ApplyBan($NewBan = NULL, $OldBan = NULL) {
if (!$NewBan && !$OldBan)
return;
$OldUsers = array();
$OldUserIDs = array();
$NewUsers = array();
$NewUserIDs = array();
$AllBans = $this->AllBans();
if ($NewBan) {
// Get a list of us... | [
"public",
"function",
"ApplyBan",
"(",
"$",
"NewBan",
"=",
"NULL",
",",
"$",
"OldBan",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"NewBan",
"&&",
"!",
"$",
"OldBan",
")",
"return",
";",
"$",
"OldUsers",
"=",
"array",
"(",
")",
";",
"$",
"OldUser... | Convert bans to new type.
@since 2.0.18
@access public
@param array $NewBan Data about the new ban.
@param array $OldBan Data about the old ban. | [
"Convert",
"bans",
"to",
"new",
"type",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.banmodel.php#L49-L100 |
8,735 | bishopb/vanilla | applications/dashboard/models/class.banmodel.php | BanModel.BanWhere | public function BanWhere($Ban) {
$Result = array('u.Admin' => 0, 'u.Deleted' => 0);
$Ban['BanValue'] = str_replace('*', '%', $Ban['BanValue']);
switch(strtolower($Ban['BanType'])) {
case 'email':
$Result['u.Email like'] = $Ban['BanValue'];
break;
case 'ipaddr... | php | public function BanWhere($Ban) {
$Result = array('u.Admin' => 0, 'u.Deleted' => 0);
$Ban['BanValue'] = str_replace('*', '%', $Ban['BanValue']);
switch(strtolower($Ban['BanType'])) {
case 'email':
$Result['u.Email like'] = $Ban['BanValue'];
break;
case 'ipaddr... | [
"public",
"function",
"BanWhere",
"(",
"$",
"Ban",
")",
"{",
"$",
"Result",
"=",
"array",
"(",
"'u.Admin'",
"=>",
"0",
",",
"'u.Deleted'",
"=>",
"0",
")",
";",
"$",
"Ban",
"[",
"'BanValue'",
"]",
"=",
"str_replace",
"(",
"'*'",
",",
"'%'",
",",
"$"... | Ban users that meet conditions given.
@since 2.0.18
@access public
@param array $Ban Data about the ban.
Valid keys are BanType and BanValue. BanValue is what is to be banned.
Valid values for BanType are email, ipaddress or name. | [
"Ban",
"users",
"that",
"meet",
"conditions",
"given",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.banmodel.php#L111-L127 |
8,736 | bishopb/vanilla | applications/dashboard/models/class.banmodel.php | BanModel.CheckUser | public static function CheckUser($User, $Validation = NULL, $UpdateBlocks = FALSE, &$BansFound = NULL) {
$Bans = self::AllBans();
$Fields = array('Name' => 'Name', 'Email' => 'Email', 'IPAddress' => 'LastIPAddress');
$Banned = array();
if (!$BansFound)
$BansFound = array();
... | php | public static function CheckUser($User, $Validation = NULL, $UpdateBlocks = FALSE, &$BansFound = NULL) {
$Bans = self::AllBans();
$Fields = array('Name' => 'Name', 'Email' => 'Email', 'IPAddress' => 'LastIPAddress');
$Banned = array();
if (!$BansFound)
$BansFound = array();
... | [
"public",
"static",
"function",
"CheckUser",
"(",
"$",
"User",
",",
"$",
"Validation",
"=",
"NULL",
",",
"$",
"UpdateBlocks",
"=",
"FALSE",
",",
"&",
"$",
"BansFound",
"=",
"NULL",
")",
"{",
"$",
"Bans",
"=",
"self",
"::",
"AllBans",
"(",
")",
";",
... | Add ban data to all Get requests.
@since 2.0.18
@access public
@param mixed User data (array or object).
@param Gdn_Validation $Validation
@param bool $UpdateBlocks
@return bool Whether user is banned. | [
"Add",
"ban",
"data",
"to",
"all",
"Get",
"requests",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.banmodel.php#L155-L190 |
8,737 | bishopb/vanilla | applications/dashboard/models/class.banmodel.php | BanModel.Delete | public function Delete($Where = '', $Limit = FALSE, $ResetData = FALSE) {
if (isset($Where['BanID'])) {
$OldBan = $this->GetID($Where['BanID'], DATASET_TYPE_ARRAY);
}
parent::Delete($Where, $Limit, $ResetData);
if (isset($OldBan))
$this->ApplyBan(NULL, $OldBan);
} | php | public function Delete($Where = '', $Limit = FALSE, $ResetData = FALSE) {
if (isset($Where['BanID'])) {
$OldBan = $this->GetID($Where['BanID'], DATASET_TYPE_ARRAY);
}
parent::Delete($Where, $Limit, $ResetData);
if (isset($OldBan))
$this->ApplyBan(NULL, $OldBan);
} | [
"public",
"function",
"Delete",
"(",
"$",
"Where",
"=",
"''",
",",
"$",
"Limit",
"=",
"FALSE",
",",
"$",
"ResetData",
"=",
"FALSE",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"Where",
"[",
"'BanID'",
"]",
")",
")",
"{",
"$",
"OldBan",
"=",
"$",
"t... | Remove a ban.
@since 2.0.18
@access public
@param array $Where
@param int $Limit
@param bool $ResetData | [
"Remove",
"a",
"ban",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.banmodel.php#L202-L211 |
8,738 | bishopb/vanilla | applications/dashboard/models/class.banmodel.php | BanModel.Save | public function Save($FormPostValues, $Settings = FALSE) {
$CurrentBanID = GetValue('BanID', $FormPostValues);
// Get the current ban before saving.
if ($CurrentBanID)
$CurrentBan = $this->GetID($CurrentBanID, DATASET_TYPE_ARRAY);
else
$CurrentBan = NULL;
$this->Set... | php | public function Save($FormPostValues, $Settings = FALSE) {
$CurrentBanID = GetValue('BanID', $FormPostValues);
// Get the current ban before saving.
if ($CurrentBanID)
$CurrentBan = $this->GetID($CurrentBanID, DATASET_TYPE_ARRAY);
else
$CurrentBan = NULL;
$this->Set... | [
"public",
"function",
"Save",
"(",
"$",
"FormPostValues",
",",
"$",
"Settings",
"=",
"FALSE",
")",
"{",
"$",
"CurrentBanID",
"=",
"GetValue",
"(",
"'BanID'",
",",
"$",
"FormPostValues",
")",
";",
"// Get the current ban before saving.",
"if",
"(",
"$",
"Curren... | Save data about ban from form.
@since 2.0.18
@access public
@param array $FormPostValues
@param array $Settings | [
"Save",
"data",
"about",
"ban",
"from",
"form",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.banmodel.php#L233-L247 |
8,739 | gregorybesson/PlaygroundFacebook | src/PlaygroundFacebook/Entity/Page.php | Page.addApps | public function addApps(ArrayCollection $apps)
{
foreach ($apps as $app) {
$app->addPage($this);
$this->apps->add($app);
}
} | php | public function addApps(ArrayCollection $apps)
{
foreach ($apps as $app) {
$app->addPage($this);
$this->apps->add($app);
}
} | [
"public",
"function",
"addApps",
"(",
"ArrayCollection",
"$",
"apps",
")",
"{",
"foreach",
"(",
"$",
"apps",
"as",
"$",
"app",
")",
"{",
"$",
"app",
"->",
"addPage",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"apps",
"->",
"add",
"(",
"$",
"a... | Add apps to the page.
@param ArrayCollection $apps
@return void | [
"Add",
"apps",
"to",
"the",
"page",
"."
] | 35d9561af5af6ccda8a02f4c61a55ff0107e8efd | https://github.com/gregorybesson/PlaygroundFacebook/blob/35d9561af5af6ccda8a02f4c61a55ff0107e8efd/src/PlaygroundFacebook/Entity/Page.php#L222-L228 |
8,740 | gregorybesson/PlaygroundFacebook | src/PlaygroundFacebook/Entity/Page.php | Page.removeApps | public function removeApps(ArrayCollection $apps)
{
foreach ($apps as $app) {
$app->removePage($this);
$this->apps->removeElement($app);
}
} | php | public function removeApps(ArrayCollection $apps)
{
foreach ($apps as $app) {
$app->removePage($this);
$this->apps->removeElement($app);
}
} | [
"public",
"function",
"removeApps",
"(",
"ArrayCollection",
"$",
"apps",
")",
"{",
"foreach",
"(",
"$",
"apps",
"as",
"$",
"app",
")",
"{",
"$",
"app",
"->",
"removePage",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"apps",
"->",
"removeElement",
... | Remove apps from the page.
@param ArrayCollection $apps
@return void | [
"Remove",
"apps",
"from",
"the",
"page",
"."
] | 35d9561af5af6ccda8a02f4c61a55ff0107e8efd | https://github.com/gregorybesson/PlaygroundFacebook/blob/35d9561af5af6ccda8a02f4c61a55ff0107e8efd/src/PlaygroundFacebook/Entity/Page.php#L237-L243 |
8,741 | heterogeny/heterogeny-php | src/Heterogeny/Seq.php | Seq.sanitizeOffset | protected function sanitizeOffset($offset): int
{
if (!is_numeric($offset)) {
throw new \InvalidArgumentException(
sprintf('`$index` must be an `int`, %s(%s) received', gettype($offset), var_export($offset, true))
);
}
return intval($offset);
} | php | protected function sanitizeOffset($offset): int
{
if (!is_numeric($offset)) {
throw new \InvalidArgumentException(
sprintf('`$index` must be an `int`, %s(%s) received', gettype($offset), var_export($offset, true))
);
}
return intval($offset);
} | [
"protected",
"function",
"sanitizeOffset",
"(",
"$",
"offset",
")",
":",
"int",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'`$index` must be an `int`, %s(%s) recei... | Validates the offset throw an exception if invalid
@param mixed $offset offset to lookup
@return void
@throws \InvalidArgumentException | [
"Validates",
"the",
"offset",
"throw",
"an",
"exception",
"if",
"invalid"
] | 7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f | https://github.com/heterogeny/heterogeny-php/blob/7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f/src/Heterogeny/Seq.php#L167-L176 |
8,742 | heterogeny/heterogeny-php | src/Heterogeny/Seq.php | Seq.equals | public function equals($other): bool
{
if (is_array($other) || $other instanceof self) {
return count($other) === count($this) &&
$this->zip($other)->every(
function ($tuple) {
list($a, $b) = $tuple;
if ($a inst... | php | public function equals($other): bool
{
if (is_array($other) || $other instanceof self) {
return count($other) === count($this) &&
$this->zip($other)->every(
function ($tuple) {
list($a, $b) = $tuple;
if ($a inst... | [
"public",
"function",
"equals",
"(",
"$",
"other",
")",
":",
"bool",
"{",
"if",
"(",
"is_array",
"(",
"$",
"other",
")",
"||",
"$",
"other",
"instanceof",
"self",
")",
"{",
"return",
"count",
"(",
"$",
"other",
")",
"===",
"count",
"(",
"$",
"this"... | Deep strict comparison, preferable over `==`
@param array|Seq $other other `Seq` to compare
@return bool | [
"Deep",
"strict",
"comparison",
"preferable",
"over",
"=="
] | 7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f | https://github.com/heterogeny/heterogeny-php/blob/7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f/src/Heterogeny/Seq.php#L440-L458 |
8,743 | heterogeny/heterogeny-php | src/Heterogeny/Seq.php | Seq.mapWithIndex | public function mapWithIndex(callable $function)
{
$values = array_values($this->data);
return new Seq(array_map($function, array_keys($values), $values));
} | php | public function mapWithIndex(callable $function)
{
$values = array_values($this->data);
return new Seq(array_map($function, array_keys($values), $values));
} | [
"public",
"function",
"mapWithIndex",
"(",
"callable",
"$",
"function",
")",
"{",
"$",
"values",
"=",
"array_values",
"(",
"$",
"this",
"->",
"data",
")",
";",
"return",
"new",
"Seq",
"(",
"array_map",
"(",
"$",
"function",
",",
"array_keys",
"(",
"$",
... | Map over each `Seq` item with index
@param callable $function map function
@return static | [
"Map",
"over",
"each",
"Seq",
"item",
"with",
"index"
] | 7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f | https://github.com/heterogeny/heterogeny-php/blob/7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f/src/Heterogeny/Seq.php#L479-L484 |
8,744 | heterogeny/heterogeny-php | src/Heterogeny/Seq.php | Seq.filterWithIndex | public function filterWithIndex(callable $function): Seq
{
$result = new Seq();
foreach ($this->data as $key => $value) {
if (!!$function($key, $value)) {
$result = $result->append($value);
}
}
return $result;
} | php | public function filterWithIndex(callable $function): Seq
{
$result = new Seq();
foreach ($this->data as $key => $value) {
if (!!$function($key, $value)) {
$result = $result->append($value);
}
}
return $result;
} | [
"public",
"function",
"filterWithIndex",
"(",
"callable",
"$",
"function",
")",
":",
"Seq",
"{",
"$",
"result",
"=",
"new",
"Seq",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
... | Filter an Seq using a predicate which receives key and value return a new `Seq` with elements
that doesn't match the predicate
@param callable $function
@return Seq | [
"Filter",
"an",
"Seq",
"using",
"a",
"predicate",
"which",
"receives",
"key",
"and",
"value",
"return",
"a",
"new",
"Seq",
"with",
"elements",
"that",
"doesn",
"t",
"match",
"the",
"predicate"
] | 7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f | https://github.com/heterogeny/heterogeny-php/blob/7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f/src/Heterogeny/Seq.php#L506-L517 |
8,745 | heterogeny/heterogeny-php | src/Heterogeny/Seq.php | Seq.reduceLeft | public function reduceLeft(callable $function)
{
if ($this->isEmpty()) {
return null;
}
list($head, $tail) = $this->headAndTail();
return array_reduce($tail->all(), $function, $head);
} | php | public function reduceLeft(callable $function)
{
if ($this->isEmpty()) {
return null;
}
list($head, $tail) = $this->headAndTail();
return array_reduce($tail->all(), $function, $head);
} | [
"public",
"function",
"reduceLeft",
"(",
"callable",
"$",
"function",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"list",
"(",
"$",
"head",
",",
"$",
"tail",
")",
"=",
"$",
"this",
"->",
"hea... | Reduces `Seq` items to the left
Reduce does not take any initial value, instead,
it uses head as initial.
@param callable $function function which will reduce the Seq
@return mixed|null | [
"Reduces",
"Seq",
"items",
"to",
"the",
"left"
] | 7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f | https://github.com/heterogeny/heterogeny-php/blob/7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f/src/Heterogeny/Seq.php#L563-L572 |
8,746 | heterogeny/heterogeny-php | src/Heterogeny/Seq.php | Seq.reduceRight | public function reduceRight(callable $function)
{
if ($this->isEmpty()) {
return null;
}
list($head, $tail) = $this->reverse()->headAndTail();
return array_reduce($tail->all(), $function, $head);
} | php | public function reduceRight(callable $function)
{
if ($this->isEmpty()) {
return null;
}
list($head, $tail) = $this->reverse()->headAndTail();
return array_reduce($tail->all(), $function, $head);
} | [
"public",
"function",
"reduceRight",
"(",
"callable",
"$",
"function",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"list",
"(",
"$",
"head",
",",
"$",
"tail",
")",
"=",
"$",
"this",
"->",
"re... | Reduces `Seq` items to the right
Reduce does not take any initial value, instead,
it uses head as initial.
@param callable $function function which will reduce the Seq
@return mixed|null | [
"Reduces",
"Seq",
"items",
"to",
"the",
"right"
] | 7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f | https://github.com/heterogeny/heterogeny-php/blob/7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f/src/Heterogeny/Seq.php#L584-L593 |
8,747 | heterogeny/heterogeny-php | src/Heterogeny/Seq.php | Seq.zipLeft | public function zipLeft($other)
{
if (count($other) !== count($this)) {
throw new \InvalidArgumentException(
'Both left and right must have same size.'
);
}
if (is_array($other)) {
return new Seq(
array_map(
... | php | public function zipLeft($other)
{
if (count($other) !== count($this)) {
throw new \InvalidArgumentException(
'Both left and right must have same size.'
);
}
if (is_array($other)) {
return new Seq(
array_map(
... | [
"public",
"function",
"zipLeft",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"other",
")",
"!==",
"count",
"(",
"$",
"this",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Both left and right must have same size.'",
")... | Zip with another `Seq` values on the left
@param array|Seq $other another list
@return static | [
"Zip",
"with",
"another",
"Seq",
"values",
"on",
"the",
"left"
] | 7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f | https://github.com/heterogeny/heterogeny-php/blob/7b110dfe0ab0a7b37bfb60d61fae8efdcabb1e8f/src/Heterogeny/Seq.php#L602-L627 |
8,748 | flavorzyb/simple | src/Environment/DotEnv.php | DotEnv.getFilePath | protected function getFilePath($path, $file)
{
if (!is_string($file)) {
$file = ".env";
}
return rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
} | php | protected function getFilePath($path, $file)
{
if (!is_string($file)) {
$file = ".env";
}
return rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
} | [
"protected",
"function",
"getFilePath",
"(",
"$",
"path",
",",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"file",
")",
")",
"{",
"$",
"file",
"=",
"\".env\"",
";",
"}",
"return",
"rtrim",
"(",
"$",
"path",
",",
"DIRECTORY_SEPARATOR... | Returns the full path to the file.
@param string $path
@param string $file
@return string | [
"Returns",
"the",
"full",
"path",
"to",
"the",
"file",
"."
] | 8c4c539ae2057217b2637fc72c2a90ba266e8e6c | https://github.com/flavorzyb/simple/blob/8c4c539ae2057217b2637fc72c2a90ba266e8e6c/src/Environment/DotEnv.php#L55-L62 |
8,749 | erickmerchant/wright | src/DI/Definition.php | Definition.resolve | public function resolve()
{
$instance = null;
$args = [];
if (isset($this->concrete)) {
$reflected_class = new \ReflectionClass($this->concrete);
} else {
throw new ResolveException;
}
$reflected_method = $reflected_class->getConstructor(... | php | public function resolve()
{
$instance = null;
$args = [];
if (isset($this->concrete)) {
$reflected_class = new \ReflectionClass($this->concrete);
} else {
throw new ResolveException;
}
$reflected_method = $reflected_class->getConstructor(... | [
"public",
"function",
"resolve",
"(",
")",
"{",
"$",
"instance",
"=",
"null",
";",
"$",
"args",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"concrete",
")",
")",
"{",
"$",
"reflected_class",
"=",
"new",
"\\",
"ReflectionClass",
... | Resolves the definition
@throws DefinitionException If a class has not yet been set.
@return object | [
"Resolves",
"the",
"definition"
] | 3b2d46b9b4df4d47a5197c1efca7cd309d5e6cfd | https://github.com/erickmerchant/wright/blob/3b2d46b9b4df4d47a5197c1efca7cd309d5e6cfd/src/DI/Definition.php#L91-L120 |
8,750 | the-kbA-team/typecast | src/TypeCastValue.php | TypeCastValue.prepareNumericCast | protected static function prepareNumericCast($value)
{
if (!in_array(gettype($value), static::$numericCastable, true)) {
return '';
}
if (is_string($value)) {
return trim($value);
}
return $value;
} | php | protected static function prepareNumericCast($value)
{
if (!in_array(gettype($value), static::$numericCastable, true)) {
return '';
}
if (is_string($value)) {
return trim($value);
}
return $value;
} | [
"protected",
"static",
"function",
"prepareNumericCast",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"gettype",
"(",
"$",
"value",
")",
",",
"static",
"::",
"$",
"numericCastable",
",",
"true",
")",
")",
"{",
"return",
"''",
";",
"}",... | Return empty string in case the type is not castable to a numeric data type
and trim the value.
@param mixed $value
@return string|float|int|bool | [
"Return",
"empty",
"string",
"in",
"case",
"the",
"type",
"is",
"not",
"castable",
"to",
"a",
"numeric",
"data",
"type",
"and",
"trim",
"the",
"value",
"."
] | 89939ad0dbf92f6ef09c48764347f473d51e8786 | https://github.com/the-kbA-team/typecast/blob/89939ad0dbf92f6ef09c48764347f473d51e8786/src/TypeCastValue.php#L147-L156 |
8,751 | FiveLab/Exception | src/ViolationListException.php | ViolationListException.create | public static function create(ConstraintViolationListInterface $violationList, $code = 0, \Exception $prev = null)
{
$violationMessages = [];
/** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
foreach ($violationList as $violation) {
$violationMessa... | php | public static function create(ConstraintViolationListInterface $violationList, $code = 0, \Exception $prev = null)
{
$violationMessages = [];
/** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
foreach ($violationList as $violation) {
$violationMessa... | [
"public",
"static",
"function",
"create",
"(",
"ConstraintViolationListInterface",
"$",
"violationList",
",",
"$",
"code",
"=",
"0",
",",
"\\",
"Exception",
"$",
"prev",
"=",
"null",
")",
"{",
"$",
"violationMessages",
"=",
"[",
"]",
";",
"/** @var \\Symfony\\... | Create a new instance with violation list
@param ConstraintViolationListInterface $violationList
@param int $code
@param \Exception $prev
@return ViolationListException | [
"Create",
"a",
"new",
"instance",
"with",
"violation",
"list"
] | 6fc8bb53fe8f70b32e3cf71840799179893220a7 | https://github.com/FiveLab/Exception/blob/6fc8bb53fe8f70b32e3cf71840799179893220a7/src/ViolationListException.php#L67-L83 |
8,752 | AnonymPHP/Anonym-Library | src/Anonym/Cron/Crontab/CrontabFileHandler.php | CrontabFileHandler.listJobs | public function listJobs($crontab){
$process = new Process($this->crontabCommand($crontab).' -l');
$process->run();
$this->error = $process->getErrorOutput();
return $process->getOutput();
} | php | public function listJobs($crontab){
$process = new Process($this->crontabCommand($crontab).' -l');
$process->run();
$this->error = $process->getErrorOutput();
return $process->getOutput();
} | [
"public",
"function",
"listJobs",
"(",
"$",
"crontab",
")",
"{",
"$",
"process",
"=",
"new",
"Process",
"(",
"$",
"this",
"->",
"crontabCommand",
"(",
"$",
"crontab",
")",
".",
"' -l'",
")",
";",
"$",
"process",
"->",
"run",
"(",
")",
";",
"$",
"th... | list the current jobs
@param Crontab $crontab
@return array | [
"list",
"the",
"current",
"jobs"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Cron/Crontab/CrontabFileHandler.php#L40-L48 |
8,753 | tekkla/core-framework | Core/Framework/Core.php | Core.registerClassloader | private function registerClassloader()
{
// Register core classloader
require_once ('SplClassLoader.php');
// Classloader to register
$register = [
'Core' => $this->basedir,
'Apps' => $this->basedir,
'AppsSec' => $this->basedir,
'Theme... | php | private function registerClassloader()
{
// Register core classloader
require_once ('SplClassLoader.php');
// Classloader to register
$register = [
'Core' => $this->basedir,
'Apps' => $this->basedir,
'AppsSec' => $this->basedir,
'Theme... | [
"private",
"function",
"registerClassloader",
"(",
")",
"{",
"// Register core classloader",
"require_once",
"(",
"'SplClassLoader.php'",
")",
";",
"// Classloader to register",
"$",
"register",
"=",
"[",
"'Core'",
"=>",
"$",
"this",
"->",
"basedir",
",",
"'Apps'",
... | Registers SPL classloader | [
"Registers",
"SPL",
"classloader"
] | ad69e9f15ee3644b6ca376edc30d8f5555399892 | https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Core.php#L306-L324 |
8,754 | tekkla/core-framework | Core/Framework/Core.php | Core.initHttp | private function initHttp()
{
$this->di->mapService('core.http', '\Core\Http\Http', [
'core.http.cookie',
'core.http.header'
]);
$this->di->mapService('core.http.cookie', '\Core\Http\Cookie\CookieHandler');
$this->di->mapService('core.http.header', '\Core\Http... | php | private function initHttp()
{
$this->di->mapService('core.http', '\Core\Http\Http', [
'core.http.cookie',
'core.http.header'
]);
$this->di->mapService('core.http.cookie', '\Core\Http\Cookie\CookieHandler');
$this->di->mapService('core.http.header', '\Core\Http... | [
"private",
"function",
"initHttp",
"(",
")",
"{",
"$",
"this",
"->",
"di",
"->",
"mapService",
"(",
"'core.http'",
",",
"'\\Core\\Http\\Http'",
",",
"[",
"'core.http.cookie'",
",",
"'core.http.header'",
"]",
")",
";",
"$",
"this",
"->",
"di",
"->",
"mapServi... | Inits the http library system for cookie and header handling | [
"Inits",
"the",
"http",
"library",
"system",
"for",
"cookie",
"and",
"header",
"handling"
] | ad69e9f15ee3644b6ca376edc30d8f5555399892 | https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Core.php#L636-L646 |
8,755 | tekkla/core-framework | Core/Framework/Core.php | Core.initAssetManager | private function initAssetManager()
{
$this->di->mapService('core.asset', '\Core\Asset\AssetManager');
$this->assetmanager = $this->di->get('core.asset');
// Create default js asset handler
$ah = $this->assetmanager->createAssetHandler('js', 'js');
$ah->setBasedir($this->ba... | php | private function initAssetManager()
{
$this->di->mapService('core.asset', '\Core\Asset\AssetManager');
$this->assetmanager = $this->di->get('core.asset');
// Create default js asset handler
$ah = $this->assetmanager->createAssetHandler('js', 'js');
$ah->setBasedir($this->ba... | [
"private",
"function",
"initAssetManager",
"(",
")",
"{",
"$",
"this",
"->",
"di",
"->",
"mapService",
"(",
"'core.asset'",
",",
"'\\Core\\Asset\\AssetManager'",
")",
";",
"$",
"this",
"->",
"assetmanager",
"=",
"$",
"this",
"->",
"di",
"->",
"get",
"(",
"... | Initiates the AssetManager | [
"Initiates",
"the",
"AssetManager"
] | ad69e9f15ee3644b6ca376edc30d8f5555399892 | https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Core.php#L651-L682 |
8,756 | tekkla/core-framework | Core/Framework/Core.php | Core.initMessageHandler | private function initMessageHandler()
{
$this->di->mapFactory('core.message.message_handler', '\Core\Message\MessageHandler');
$this->di->mapFactory('core.message.message_storage', '\Core\Message\MessageStorage');
$this->di->mapFactory('core.message.message', '\Core\Notification\Notifcation'... | php | private function initMessageHandler()
{
$this->di->mapFactory('core.message.message_handler', '\Core\Message\MessageHandler');
$this->di->mapFactory('core.message.message_storage', '\Core\Message\MessageStorage');
$this->di->mapFactory('core.message.message', '\Core\Notification\Notifcation'... | [
"private",
"function",
"initMessageHandler",
"(",
")",
"{",
"$",
"this",
"->",
"di",
"->",
"mapFactory",
"(",
"'core.message.message_handler'",
",",
"'\\Core\\Message\\MessageHandler'",
")",
";",
"$",
"this",
"->",
"di",
"->",
"mapFactory",
"(",
"'core.message.messa... | Inits message handler | [
"Inits",
"message",
"handler"
] | ad69e9f15ee3644b6ca376edc30d8f5555399892 | https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Core.php#L687-L712 |
8,757 | tekkla/core-framework | Core/Framework/Core.php | Core.callAppEvent | private function callAppEvent(AbstractApp $app, string $event)
{
if (method_exists($app, $event)) {
return call_user_func([
$app,
$event
]);
}
} | php | private function callAppEvent(AbstractApp $app, string $event)
{
if (method_exists($app, $event)) {
return call_user_func([
$app,
$event
]);
}
} | [
"private",
"function",
"callAppEvent",
"(",
"AbstractApp",
"$",
"app",
",",
"string",
"$",
"event",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"app",
",",
"$",
"event",
")",
")",
"{",
"return",
"call_user_func",
"(",
"[",
"$",
"app",
",",
"$",
"... | Calls an existing event method of an app
@param AbstractApp $app
@param string $event | [
"Calls",
"an",
"existing",
"event",
"method",
"of",
"an",
"app"
] | ad69e9f15ee3644b6ca376edc30d8f5555399892 | https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Core.php#L855-L863 |
8,758 | tekkla/core-framework | Core/Framework/Core.php | Core.processAssets | private function processAssets()
{
$js = $this->assetmanager->getAssetHandler('js');
$afh = new \Core\Asset\AssetFileHandler();
$afh->setFilename($this->config->get('Core', 'dir.cache') . '/script.js');
$afh->setTTL($this->config->get('Core', 'cache.ttl.js'));
$js->setFileH... | php | private function processAssets()
{
$js = $this->assetmanager->getAssetHandler('js');
$afh = new \Core\Asset\AssetFileHandler();
$afh->setFilename($this->config->get('Core', 'dir.cache') . '/script.js');
$afh->setTTL($this->config->get('Core', 'cache.ttl.js'));
$js->setFileH... | [
"private",
"function",
"processAssets",
"(",
")",
"{",
"$",
"js",
"=",
"$",
"this",
"->",
"assetmanager",
"->",
"getAssetHandler",
"(",
"'js'",
")",
";",
"$",
"afh",
"=",
"new",
"\\",
"Core",
"\\",
"Asset",
"\\",
"AssetFileHandler",
"(",
")",
";",
"$",... | Processes asset handlers and their contents | [
"Processes",
"asset",
"handlers",
"and",
"their",
"contents"
] | ad69e9f15ee3644b6ca376edc30d8f5555399892 | https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Core.php#L1042-L1077 |
8,759 | tekkla/core-framework | Core/Framework/Core.php | Core.initApps | private function initApps()
{
// Run app specfic functions
/* @var $app \Core\Amvc\App\Abstractapp */
foreach ($this->apps as $app) {
// Call additional Init() methods in apps
if (method_exists($app, 'Init')) {
$app->Init();
}
... | php | private function initApps()
{
// Run app specfic functions
/* @var $app \Core\Amvc\App\Abstractapp */
foreach ($this->apps as $app) {
// Call additional Init() methods in apps
if (method_exists($app, 'Init')) {
$app->Init();
}
... | [
"private",
"function",
"initApps",
"(",
")",
"{",
"// Run app specfic functions",
"/* @var $app \\Core\\Amvc\\App\\Abstractapp */",
"foreach",
"(",
"$",
"this",
"->",
"apps",
"as",
"$",
"app",
")",
"{",
"// Call additional Init() methods in apps",
"if",
"(",
"method_exist... | Inits all loaded apps, calls core specific actions and maps | [
"Inits",
"all",
"loaded",
"apps",
"calls",
"core",
"specific",
"actions",
"and",
"maps"
] | ad69e9f15ee3644b6ca376edc30d8f5555399892 | https://github.com/tekkla/core-framework/blob/ad69e9f15ee3644b6ca376edc30d8f5555399892/Core/Framework/Core.php#L1212-L1240 |
8,760 | Cyberrebell/ZF2DoctrineCrudHandler | library/ZF2DoctrineCrudHandler/src/ZF2DoctrineCrudHandler/Request/RequestHandler.php | RequestHandler.filterEntity | protected static function filterEntity($filter, $entity) {
if ($filter !== null && $filter($entity) === false) {
return false;
} else {
return $entity;
}
} | php | protected static function filterEntity($filter, $entity) {
if ($filter !== null && $filter($entity) === false) {
return false;
} else {
return $entity;
}
} | [
"protected",
"static",
"function",
"filterEntity",
"(",
"$",
"filter",
",",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"filter",
"!==",
"null",
"&&",
"$",
"filter",
"(",
"$",
"entity",
")",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"else",... | Use given entityFilter to check if entity is allowed
@param object $entity Doctrine-Entity
@return object|boolean | [
"Use",
"given",
"entityFilter",
"to",
"check",
"if",
"entity",
"is",
"allowed"
] | 9ed9b1ae8d7a2a051a1f4638be1dfeefa150d8bb | https://github.com/Cyberrebell/ZF2DoctrineCrudHandler/blob/9ed9b1ae8d7a2a051a1f4638be1dfeefa150d8bb/library/ZF2DoctrineCrudHandler/src/ZF2DoctrineCrudHandler/Request/RequestHandler.php#L111-L117 |
8,761 | kambo-1st/HttpMessage | src/Environment/Environment.php | Environment.getProtocolVersion | public function getProtocolVersion()
{
$version = null;
if (isset($this->server['SERVER_PROTOCOL'])) {
$protocol = $this->server['SERVER_PROTOCOL'];
list(,$version) = explode("/", $protocol);
}
return $version;
} | php | public function getProtocolVersion()
{
$version = null;
if (isset($this->server['SERVER_PROTOCOL'])) {
$protocol = $this->server['SERVER_PROTOCOL'];
list(,$version) = explode("/", $protocol);
}
return $version;
} | [
"public",
"function",
"getProtocolVersion",
"(",
")",
"{",
"$",
"version",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"server",
"[",
"'SERVER_PROTOCOL'",
"]",
")",
")",
"{",
"$",
"protocol",
"=",
"$",
"this",
"->",
"server",
"[",
"... | Get protocol version
@return string|null | [
"Get",
"protocol",
"version"
] | 38877b9d895f279fdd5bdf957d8f23f9808a940a | https://github.com/kambo-1st/HttpMessage/blob/38877b9d895f279fdd5bdf957d8f23f9808a940a/src/Environment/Environment.php#L142-L151 |
8,762 | academic/VipaImportBundle | Importer/PKP/ArticleFileImporter.php | ArticleFileImporter.importArticleFiles | public function importArticleFiles($article, $oldId, $slug)
{
$fileIdsSql = "SELECT DISTINCT file_id FROM article_files WHERE article_id = :id";
$fileIdsStatement = $this->dbalConnection->prepare($fileIdsSql);
$fileIdsStatement->bindValue('id', $oldId);
$fileIdsStatement->execute();
... | php | public function importArticleFiles($article, $oldId, $slug)
{
$fileIdsSql = "SELECT DISTINCT file_id FROM article_files WHERE article_id = :id";
$fileIdsStatement = $this->dbalConnection->prepare($fileIdsSql);
$fileIdsStatement->bindValue('id', $oldId);
$fileIdsStatement->execute();
... | [
"public",
"function",
"importArticleFiles",
"(",
"$",
"article",
",",
"$",
"oldId",
",",
"$",
"slug",
")",
"{",
"$",
"fileIdsSql",
"=",
"\"SELECT DISTINCT file_id FROM article_files WHERE article_id = :id\"",
";",
"$",
"fileIdsStatement",
"=",
"$",
"this",
"->",
"db... | Imports files of the given article
@param Article $article The Article whose files are going to be imported
@param int $oldId Old ID of the article
@param String $slug Journal's slug
@throws \Doctrine\DBAL\DBALException | [
"Imports",
"files",
"of",
"the",
"given",
"article"
] | cee7d9e51613706a4fd6e2eade44041ce1af9ad3 | https://github.com/academic/VipaImportBundle/blob/cee7d9e51613706a4fd6e2eade44041ce1af9ad3/Importer/PKP/ArticleFileImporter.php#L22-L46 |
8,763 | academic/VipaImportBundle | Importer/PKP/ArticleFileImporter.php | ArticleFileImporter.importArticleFile | public function importArticleFile($pkpArticleFile, $oldArticleId, $article, $slug)
{
$this->consoleOutput->writeln("Reading article file #" . $pkpArticleFile['file_id'] . "... ", true);
$galleysSql = "SELECT galley_id, article_id, locale, label FROM article_galleys " .
"WHERE article_id... | php | public function importArticleFile($pkpArticleFile, $oldArticleId, $article, $slug)
{
$this->consoleOutput->writeln("Reading article file #" . $pkpArticleFile['file_id'] . "... ", true);
$galleysSql = "SELECT galley_id, article_id, locale, label FROM article_galleys " .
"WHERE article_id... | [
"public",
"function",
"importArticleFile",
"(",
"$",
"pkpArticleFile",
",",
"$",
"oldArticleId",
",",
"$",
"article",
",",
"$",
"slug",
")",
"{",
"$",
"this",
"->",
"consoleOutput",
"->",
"writeln",
"(",
"\"Reading article file #\"",
".",
"$",
"pkpArticleFile",
... | Imports the given article file
@param int $pkpArticleFile ID of the old article file
@param int $oldArticleId ID of the old article
@param Article $article Newly imported Article entity
@param string $slug Journal's slug | [
"Imports",
"the",
"given",
"article",
"file"
] | cee7d9e51613706a4fd6e2eade44041ce1af9ad3 | https://github.com/academic/VipaImportBundle/blob/cee7d9e51613706a4fd6e2eade44041ce1af9ad3/Importer/PKP/ArticleFileImporter.php#L55-L109 |
8,764 | lucifurious/kisma | src/Kisma/Core/SeedBag.php | SeedBag.contains | public function contains( $key )
{
if ( $key instanceof Interfaces\SeedLike )
{
$key = $key->getId();
}
return Utility\Option::contains( $this->_bag, $key );
} | php | public function contains( $key )
{
if ( $key instanceof Interfaces\SeedLike )
{
$key = $key->getId();
}
return Utility\Option::contains( $this->_bag, $key );
} | [
"public",
"function",
"contains",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"key",
"instanceof",
"Interfaces",
"\\",
"SeedLike",
")",
"{",
"$",
"key",
"=",
"$",
"key",
"->",
"getId",
"(",
")",
";",
"}",
"return",
"Utility",
"\\",
"Option",
"::",
"... | Checks to see if a key is in the bag.
@param string $key
@return bool | [
"Checks",
"to",
"see",
"if",
"a",
"key",
"is",
"in",
"the",
"bag",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/SeedBag.php#L238-L246 |
8,765 | jaimeeee/laravelpanel | src/LaravelPanel/models/Form.php | Form.header | private function header()
{
$fields = collect($this->entity->fields)->unique('type')->all();
$codeArray = [];
foreach ($fields as $name => $options) {
$type = ucwords($options['type']);
$className = 'Jaimeeee\\Panel\\Fields\\'.$type.'\\'.$type.'Field';
i... | php | private function header()
{
$fields = collect($this->entity->fields)->unique('type')->all();
$codeArray = [];
foreach ($fields as $name => $options) {
$type = ucwords($options['type']);
$className = 'Jaimeeee\\Panel\\Fields\\'.$type.'\\'.$type.'Field';
i... | [
"private",
"function",
"header",
"(",
")",
"{",
"$",
"fields",
"=",
"collect",
"(",
"$",
"this",
"->",
"entity",
"->",
"fields",
")",
"->",
"unique",
"(",
"'type'",
")",
"->",
"all",
"(",
")",
";",
"$",
"codeArray",
"=",
"[",
"]",
";",
"foreach",
... | Return each fields' header code.
@return string | [
"Return",
"each",
"fields",
"header",
"code",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/models/Form.php#L124-L139 |
8,766 | jaimeeee/laravelpanel | src/LaravelPanel/models/Form.php | Form.view | public function view()
{
$code = $this->code();
// If there are images supposed to appear on the editor, lets find them
$imageList = [];
if (isset($this->entity->images['class']) && $imageClass = $this->entity->images['class']) {
$images = $imageClass::orderBy(isset($thi... | php | public function view()
{
$code = $this->code();
// If there are images supposed to appear on the editor, lets find them
$imageList = [];
if (isset($this->entity->images['class']) && $imageClass = $this->entity->images['class']) {
$images = $imageClass::orderBy(isset($thi... | [
"public",
"function",
"view",
"(",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"code",
"(",
")",
";",
"// If there are images supposed to appear on the editor, lets find them",
"$",
"imageList",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"-... | Return the form view.
@return \Illuminate\Http\Response | [
"Return",
"the",
"form",
"view",
"."
] | 211599ba0be7dc5ea11af292a75d4104c41512ca | https://github.com/jaimeeee/laravelpanel/blob/211599ba0be7dc5ea11af292a75d4104c41512ca/src/LaravelPanel/models/Form.php#L168-L201 |
8,767 | setrun/setrun-component-sys | src/components/Configurator.php | Configurator.setting | public function setting($key = null) : Storage
{
$this->getStorage()->clearKey();
$storage = $this->getStorage()->addKey(self::SETTING);
if ($key === null) {
return $this->getStorage()->get();
}
return $storage->addKey($key);
} | php | public function setting($key = null) : Storage
{
$this->getStorage()->clearKey();
$storage = $this->getStorage()->addKey(self::SETTING);
if ($key === null) {
return $this->getStorage()->get();
}
return $storage->addKey($key);
} | [
"public",
"function",
"setting",
"(",
"$",
"key",
"=",
"null",
")",
":",
"Storage",
"{",
"$",
"this",
"->",
"getStorage",
"(",
")",
"->",
"clearKey",
"(",
")",
";",
"$",
"storage",
"=",
"$",
"this",
"->",
"getStorage",
"(",
")",
"->",
"addKey",
"("... | Get a settings of key.
@param null $key
@return Storage | [
"Get",
"a",
"settings",
"of",
"key",
"."
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/components/Configurator.php#L84-L92 |
8,768 | setrun/setrun-component-sys | src/components/Configurator.php | Configurator.application | public function application(bool $null = true) : array
{
$config = $this->appConfig;
if ($null) {
$this->appConfig = [];
}
return $config;
} | php | public function application(bool $null = true) : array
{
$config = $this->appConfig;
if ($null) {
$this->appConfig = [];
}
return $config;
} | [
"public",
"function",
"application",
"(",
"bool",
"$",
"null",
"=",
"true",
")",
":",
"array",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"appConfig",
";",
"if",
"(",
"$",
"null",
")",
"{",
"$",
"this",
"->",
"appConfig",
"=",
"[",
"]",
";",
"}"... | Get a configurations of launch app.
@param bool $null
@return array | [
"Get",
"a",
"configurations",
"of",
"launch",
"app",
"."
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/components/Configurator.php#L99-L106 |
8,769 | setrun/setrun-component-sys | src/components/Configurator.php | Configurator.getStorage | public function getStorage($clone = false) : Storage
{
if ($this->storage === null) {
$this->storage = new Storage($this->getCache());
}
return $clone ? clone $this->storage : $this->storage;
} | php | public function getStorage($clone = false) : Storage
{
if ($this->storage === null) {
$this->storage = new Storage($this->getCache());
}
return $clone ? clone $this->storage : $this->storage;
} | [
"public",
"function",
"getStorage",
"(",
"$",
"clone",
"=",
"false",
")",
":",
"Storage",
"{",
"if",
"(",
"$",
"this",
"->",
"storage",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"storage",
"=",
"new",
"Storage",
"(",
"$",
"this",
"->",
"getCache",
... | Get storage interface
@param bool $clone
@return Storage | [
"Get",
"storage",
"interface"
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/components/Configurator.php#L113-L119 |
8,770 | setrun/setrun-component-sys | src/components/Configurator.php | Configurator.load | public function load(array $files) : void
{
$this->appConfig = $this->getCache()->getOrSet($this->env, function() use ($files){
$config = $this->loadBaseConfig($files);
return $this->loadInstalledComponentsConfig($config);
});
} | php | public function load(array $files) : void
{
$this->appConfig = $this->getCache()->getOrSet($this->env, function() use ($files){
$config = $this->loadBaseConfig($files);
return $this->loadInstalledComponentsConfig($config);
});
} | [
"public",
"function",
"load",
"(",
"array",
"$",
"files",
")",
":",
"void",
"{",
"$",
"this",
"->",
"appConfig",
"=",
"$",
"this",
"->",
"getCache",
"(",
")",
"->",
"getOrSet",
"(",
"$",
"this",
"->",
"env",
",",
"function",
"(",
")",
"use",
"(",
... | Load a configuration of app.
@param array $files
@return void | [
"Load",
"a",
"configuration",
"of",
"app",
"."
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/components/Configurator.php#L126-L132 |
8,771 | setrun/setrun-component-sys | src/components/Configurator.php | Configurator.loadInstalledComponentsConfig | protected function loadInstalledComponentsConfig(array $config = []) : array
{
$env = $this->env === self::WEB ? 'web' : 'console';
$config = FileHelper::loadExtensionsFiles('config/main.php', $config);
$config = FileHelper::loadExtensionsFiles("config/{$env}.php", $config);
ret... | php | protected function loadInstalledComponentsConfig(array $config = []) : array
{
$env = $this->env === self::WEB ? 'web' : 'console';
$config = FileHelper::loadExtensionsFiles('config/main.php', $config);
$config = FileHelper::loadExtensionsFiles("config/{$env}.php", $config);
ret... | [
"protected",
"function",
"loadInstalledComponentsConfig",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"env",
"=",
"$",
"this",
"->",
"env",
"===",
"self",
"::",
"WEB",
"?",
"'web'",
":",
"'console'",
";",
"$",
"config",
"="... | Load a configuration of installed components.
@param array $config
@return array | [
"Load",
"a",
"configuration",
"of",
"installed",
"components",
"."
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/components/Configurator.php#L155-L161 |
8,772 | setrun/setrun-component-sys | src/components/Configurator.php | Configurator.getCache | public function getCache() : FileCache
{
if (!$this->cache) {
$this->cache = Yii::createObject([
'class' => FileCache::className(),
'cachePath' => Yii::getAlias($this->cachePath)
]);
}
return $this->cache;
} | php | public function getCache() : FileCache
{
if (!$this->cache) {
$this->cache = Yii::createObject([
'class' => FileCache::className(),
'cachePath' => Yii::getAlias($this->cachePath)
]);
}
return $this->cache;
} | [
"public",
"function",
"getCache",
"(",
")",
":",
"FileCache",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cache",
")",
"{",
"$",
"this",
"->",
"cache",
"=",
"Yii",
"::",
"createObject",
"(",
"[",
"'class'",
"=>",
"FileCache",
"::",
"className",
"(",
")"... | Get a cache object.
@return object|FileCache | [
"Get",
"a",
"cache",
"object",
"."
] | ad9a6442a2921e0f061ed4e455b050c56029d565 | https://github.com/setrun/setrun-component-sys/blob/ad9a6442a2921e0f061ed4e455b050c56029d565/src/components/Configurator.php#L167-L176 |
8,773 | remote-office/libx | src/Util/Time.php | Time.getValue | public function getValue()
{
$value = sprintf("%02d:%02d", $this->hours, $this->minutes);
if(isset($this->seconds))
$value .= sprintf(":%02d", $this->seconds);
if(isset($this->microtime))
$value .= substr($this->microtime, 1);
return $value;
} | php | public function getValue()
{
$value = sprintf("%02d:%02d", $this->hours, $this->minutes);
if(isset($this->seconds))
$value .= sprintf(":%02d", $this->seconds);
if(isset($this->microtime))
$value .= substr($this->microtime, 1);
return $value;
} | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"value",
"=",
"sprintf",
"(",
"\"%02d:%02d\"",
",",
"$",
"this",
"->",
"hours",
",",
"$",
"this",
"->",
"minutes",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"seconds",
")",
")",
"$",... | Get the value of this Time as an ISO string
@param void
@return string | [
"Get",
"the",
"value",
"of",
"this",
"Time",
"as",
"an",
"ISO",
"string"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Util/Time.php#L66-L77 |
8,774 | remote-office/libx | src/Util/Time.php | Time.setTime | public function setTime($hours, $minutes, $seconds)
{
// Validate
self::validateTime($hours, $minutes, $seconds);
// Set internal hours, minutes, seconds and microtime variables
$this->hours = (int)$hours;
$this->minutes = (int)$minutes;
$this->seconds = (int)$seconds;
... | php | public function setTime($hours, $minutes, $seconds)
{
// Validate
self::validateTime($hours, $minutes, $seconds);
// Set internal hours, minutes, seconds and microtime variables
$this->hours = (int)$hours;
$this->minutes = (int)$minutes;
$this->seconds = (int)$seconds;
... | [
"public",
"function",
"setTime",
"(",
"$",
"hours",
",",
"$",
"minutes",
",",
"$",
"seconds",
")",
"{",
"// Validate",
"self",
"::",
"validateTime",
"(",
"$",
"hours",
",",
"$",
"minutes",
",",
"$",
"seconds",
")",
";",
"// Set internal hours, minutes, secon... | Set the time represented by this Time
@param integer $hours
@param integer $minutes
@param integer $seconds
@return void | [
"Set",
"the",
"time",
"represented",
"by",
"this",
"Time"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Util/Time.php#L87-L99 |
8,775 | remote-office/libx | src/Util/Time.php | Time.validate | static public function validate($time)
{
// Check if date is a string
if(is_string($time) && strlen(trim($time)) > 0)
return false;
// Check if date matches pattern
if(!preg_match('/^' . self::PATTERN . '$/', $time, $matches))
return false;
// Extrac... | php | static public function validate($time)
{
// Check if date is a string
if(is_string($time) && strlen(trim($time)) > 0)
return false;
// Check if date matches pattern
if(!preg_match('/^' . self::PATTERN . '$/', $time, $matches))
return false;
// Extrac... | [
"static",
"public",
"function",
"validate",
"(",
"$",
"time",
")",
"{",
"// Check if date is a string",
"if",
"(",
"is_string",
"(",
"$",
"time",
")",
"&&",
"strlen",
"(",
"trim",
"(",
"$",
"time",
")",
")",
">",
"0",
")",
"return",
"false",
";",
"// C... | Validate if a string is a time
@param string $time
@return boolean true if string is a time, false otherwise | [
"Validate",
"if",
"a",
"string",
"is",
"a",
"time"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Util/Time.php#L107-L132 |
8,776 | pdenis/SnideTravinizerBundle | Twig/Extension/GithubExtension.php | GithubExtension.getCommitUrl | public function getCommitUrl(Repo $repo, $commitSHA)
{
return $this->helper->getCommitUrl($repo->getSlug(), $commitSHA);
} | php | public function getCommitUrl(Repo $repo, $commitSHA)
{
return $this->helper->getCommitUrl($repo->getSlug(), $commitSHA);
} | [
"public",
"function",
"getCommitUrl",
"(",
"Repo",
"$",
"repo",
",",
"$",
"commitSHA",
")",
"{",
"return",
"$",
"this",
"->",
"helper",
"->",
"getCommitUrl",
"(",
"$",
"repo",
"->",
"getSlug",
"(",
")",
",",
"$",
"commitSHA",
")",
";",
"}"
] | Get Repo commit url
@param Repo $repo
@param string $commitSHA
@return string | [
"Get",
"Repo",
"commit",
"url"
] | 53a6fd647280d81a496018d379e4b5c446f81729 | https://github.com/pdenis/SnideTravinizerBundle/blob/53a6fd647280d81a496018d379e4b5c446f81729/Twig/Extension/GithubExtension.php#L80-L83 |
8,777 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.find | private function find($key)
{
if ($this->exists($key)) {
$data = Query::from($this->table)
->where('name', '=', $key)
->first();
if ($data->lifetime >= time()) {
return ['name' => $key, 'value' => $this->unpacking($data... | php | private function find($key)
{
if ($this->exists($key)) {
$data = Query::from($this->table)
->where('name', '=', $key)
->first();
if ($data->lifetime >= time()) {
return ['name' => $key, 'value' => $this->unpacking($data... | [
"private",
"function",
"find",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
"$",
"key",
")",
")",
"{",
"$",
"data",
"=",
"Query",
"::",
"from",
"(",
"$",
"this",
"->",
"table",
")",
"->",
"where",
"(",
"'name'",
",",
... | Find item in cache.
@param string $key
@return array | [
"Find",
"item",
"in",
"cache",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L53-L66 |
8,778 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.createTable | private function createTable()
{
Schema::create($this->table, function ($tab) {
$tab->inc('id');
$tab->string('name');
$tab->string('value');
$tab->long('lifetime');
$tab->unique('cacheunique', ['name']);
});
} | php | private function createTable()
{
Schema::create($this->table, function ($tab) {
$tab->inc('id');
$tab->string('name');
$tab->string('value');
$tab->long('lifetime');
$tab->unique('cacheunique', ['name']);
});
} | [
"private",
"function",
"createTable",
"(",
")",
"{",
"Schema",
"::",
"create",
"(",
"$",
"this",
"->",
"table",
",",
"function",
"(",
"$",
"tab",
")",
"{",
"$",
"tab",
"->",
"inc",
"(",
"'id'",
")",
";",
"$",
"tab",
"->",
"string",
"(",
"'name'",
... | Create database cache table.
@return null | [
"Create",
"database",
"cache",
"table",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L83-L92 |
8,779 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.put | public function put($name, $value, $lifetime = null, $timestamp = false)
{
if (is_null($lifetime)) {
$lifetime = confg('cache.lifetime');
}
if (!$timestamp) {
$lifetime = time() + $lifetime;
}
$value = $this->packing($value);
$this->save($na... | php | public function put($name, $value, $lifetime = null, $timestamp = false)
{
if (is_null($lifetime)) {
$lifetime = confg('cache.lifetime');
}
if (!$timestamp) {
$lifetime = time() + $lifetime;
}
$value = $this->packing($value);
$this->save($na... | [
"public",
"function",
"put",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"lifetime",
"=",
"null",
",",
"$",
"timestamp",
"=",
"false",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"lifetime",
")",
")",
"{",
"$",
"lifetime",
"=",
"confg",
"(",
"'c... | Create new item cache.
@param string $name
@param mixed $value
@param int $lifetime
@return bool | [
"Create",
"new",
"item",
"cache",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L141-L154 |
8,780 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.add | protected function add($name, $value, $lifetime)
{
return Query::into($this->table)
->column('name', 'value', 'lifetime')
->value($name, $value, $lifetime)
->insert();
} | php | protected function add($name, $value, $lifetime)
{
return Query::into($this->table)
->column('name', 'value', 'lifetime')
->value($name, $value, $lifetime)
->insert();
} | [
"protected",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"lifetime",
")",
"{",
"return",
"Query",
"::",
"into",
"(",
"$",
"this",
"->",
"table",
")",
"->",
"column",
"(",
"'name'",
",",
"'value'",
",",
"'lifetime'",
")",
"->",
... | Add data to cache database table.
@param string $name
@param string $value
@param int $lifetime
@return bool | [
"Add",
"data",
"to",
"cache",
"database",
"table",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L165-L171 |
8,781 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.edit | protected function edit($name, $value, $lifetime)
{
return Query::into($this->table)
->set('name', $name)
->set('value', $value)
->set('lifetime', $lifetime)
->where('name', '=', $name)
->update();
} | php | protected function edit($name, $value, $lifetime)
{
return Query::into($this->table)
->set('name', $name)
->set('value', $value)
->set('lifetime', $lifetime)
->where('name', '=', $name)
->update();
} | [
"protected",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"lifetime",
")",
"{",
"return",
"Query",
"::",
"into",
"(",
"$",
"this",
"->",
"table",
")",
"->",
"set",
"(",
"'name'",
",",
"$",
"name",
")",
"->",
"set",
"(",
"'va... | Update data in cache database table.
@param string $name
@param string $value
@param int $lifetime
@return bool | [
"Update",
"data",
"in",
"cache",
"database",
"table",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L182-L190 |
8,782 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.save | protected function save($name, $value, $lifetime)
{
if ($this->exists($name)) {
return $this->edit($name, $value, $lifetime);
}
return $this->add($name, $value, $lifetime);
} | php | protected function save($name, $value, $lifetime)
{
if ($this->exists($name)) {
return $this->edit($name, $value, $lifetime);
}
return $this->add($name, $value, $lifetime);
} | [
"protected",
"function",
"save",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"lifetime",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"edit",
"(",
"$",
"name",
",",
"$",
"val... | Save the data cache.
@param string $name
@param string $value
@param int $lifetime
@return bool | [
"Save",
"the",
"data",
"cache",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L215-L222 |
8,783 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.exists | private function exists($key)
{
$data = Query::from($this->table)->where('name', '=', $key)->get();
return count($data) > 0;
} | php | private function exists($key)
{
$data = Query::from($this->table)->where('name', '=', $key)->get();
return count($data) > 0;
} | [
"private",
"function",
"exists",
"(",
"$",
"key",
")",
"{",
"$",
"data",
"=",
"Query",
"::",
"from",
"(",
"$",
"this",
"->",
"table",
")",
"->",
"where",
"(",
"'name'",
",",
"'='",
",",
"$",
"key",
")",
"->",
"get",
"(",
")",
";",
"return",
"co... | Check if cache key exists in database.
@param string $key
@return bool | [
"Check",
"if",
"cache",
"key",
"exists",
"in",
"database",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L231-L236 |
8,784 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.get | public function get($name, $default = null)
{
if ($this->exists($name)) {
$data = Query::from($this->table)
->where('name', '=', $name)
->first();
if ($data->lifetime >= time()) {
return $this->unpacking($data->value);
... | php | public function get($name, $default = null)
{
if ($this->exists($name)) {
$data = Query::from($this->table)
->where('name', '=', $name)
->first();
if ($data->lifetime >= time()) {
return $this->unpacking($data->value);
... | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
"$",
"name",
")",
")",
"{",
"$",
"data",
"=",
"Query",
"::",
"from",
"(",
"$",
"this",
"->",
"table",
")",
... | Get a cache key.
@param string name
@return mixed | [
"Get",
"a",
"cache",
"key",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L257-L274 |
8,785 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.expiration | public function expiration($key)
{
if ($this->exists($name)) {
$data = Query::from($this->table)
->where('name', '=', $name)
->first();
if ($data->lifetime >= time()) {
return $data->lifetime;
}
}
... | php | public function expiration($key)
{
if ($this->exists($name)) {
$data = Query::from($this->table)
->where('name', '=', $name)
->first();
if ($data->lifetime >= time()) {
return $data->lifetime;
}
}
... | [
"public",
"function",
"expiration",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
"$",
"name",
")",
")",
"{",
"$",
"data",
"=",
"Query",
"::",
"from",
"(",
"$",
"this",
"->",
"table",
")",
"->",
"where",
"(",
"'name'",
... | Get Expiration time of a key.
@param string $key
@return int | [
"Get",
"Expiration",
"time",
"of",
"a",
"key",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L299-L310 |
8,786 | vinala/kernel | src/Caches/Drivers/PDODriver.php | PDODriver.prolong | public function prolong($key, $lifetime)
{
$item = $this->find($key);
if (!is_null($item)) {
$lifetime = $item['lifetime'] + $lifetime;
$this->put($key, $item['value'], $lifetime, true);
}
} | php | public function prolong($key, $lifetime)
{
$item = $this->find($key);
if (!is_null($item)) {
$lifetime = $item['lifetime'] + $lifetime;
$this->put($key, $item['value'], $lifetime, true);
}
} | [
"public",
"function",
"prolong",
"(",
"$",
"key",
",",
"$",
"lifetime",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"item",
")",
")",
"{",
"$",
"lifetime",
"=",
"$",
"... | Prolong a lifetime of cache item.
@param string $key
@param int $lifetime
@return bool | [
"Prolong",
"a",
"lifetime",
"of",
"cache",
"item",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Caches/Drivers/PDODriver.php#L320-L329 |
8,787 | gbv/jskos-http | src/Result.php | Result.append | public function append($resource)
{
parent::append($resource);
if ($this->totalCount !== null) {
$this->setTotalCount($this->totalCount);
}
} | php | public function append($resource)
{
parent::append($resource);
if ($this->totalCount !== null) {
$this->setTotalCount($this->totalCount);
}
} | [
"public",
"function",
"append",
"(",
"$",
"resource",
")",
"{",
"parent",
"::",
"append",
"(",
"$",
"resource",
")",
";",
"if",
"(",
"$",
"this",
"->",
"totalCount",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"setTotalCount",
"(",
"$",
"this",
"->",... | Append a Resource and possibly increase totalCount if needed. | [
"Append",
"a",
"Resource",
"and",
"possibly",
"increase",
"totalCount",
"if",
"needed",
"."
] | 3a9e82d875bed409c129401b4bee9285562db265 | https://github.com/gbv/jskos-http/blob/3a9e82d875bed409c129401b4bee9285562db265/src/Result.php#L56-L62 |
8,788 | gbv/jskos-http | src/Result.php | Result.jsonLDSerialize | public function jsonLDSerialize(string $context = self::DEFAULT_CONTEXT, bool $types = NULL)
{
return array_map(function($m) use ($context, $types) {
return $m->jsonLDSerialize($context, $types ?? true);
}, $this->members);
} | php | public function jsonLDSerialize(string $context = self::DEFAULT_CONTEXT, bool $types = NULL)
{
return array_map(function($m) use ($context, $types) {
return $m->jsonLDSerialize($context, $types ?? true);
}, $this->members);
} | [
"public",
"function",
"jsonLDSerialize",
"(",
"string",
"$",
"context",
"=",
"self",
"::",
"DEFAULT_CONTEXT",
",",
"bool",
"$",
"types",
"=",
"NULL",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"m",
")",
"use",
"(",
"$",
"context",
",",
... | Serialize with type and context fields for each member. | [
"Serialize",
"with",
"type",
"and",
"context",
"fields",
"for",
"each",
"member",
"."
] | 3a9e82d875bed409c129401b4bee9285562db265 | https://github.com/gbv/jskos-http/blob/3a9e82d875bed409c129401b4bee9285562db265/src/Result.php#L67-L72 |
8,789 | agencms/structured-data | src/StructuredData.php | StructuredData.repeater | public function repeater(string $key = 'structured_data')
{
return Group::full('Structured Data')
->repeater($key)
->addGroup(
Group::full('Person')
->key('structureddata.person')
->addField(
Field::strin... | php | public function repeater(string $key = 'structured_data')
{
return Group::full('Structured Data')
->repeater($key)
->addGroup(
Group::full('Person')
->key('structureddata.person')
->addField(
Field::strin... | [
"public",
"function",
"repeater",
"(",
"string",
"$",
"key",
"=",
"'structured_data'",
")",
"{",
"return",
"Group",
"::",
"full",
"(",
"'Structured Data'",
")",
"->",
"repeater",
"(",
"$",
"key",
")",
"->",
"addGroup",
"(",
"Group",
"::",
"full",
"(",
"'... | Returns the Agencms repeater configuration for Structured Data blocks
@param string $key
@return Group | [
"Returns",
"the",
"Agencms",
"repeater",
"configuration",
"for",
"Structured",
"Data",
"blocks"
] | f1da29a0c50e3ac5e922265895e4dbe353d2afd9 | https://github.com/agencms/structured-data/blob/f1da29a0c50e3ac5e922265895e4dbe353d2afd9/src/StructuredData.php#L16-L56 |
8,790 | budkit/budkit-framework | src/Budkit/Datastore/Drivers/MySQLi/Driver.php | Driver.hasUTF | final public function hasUTF()
{
$verParts = explode('.', $this->getVersion());
return ($verParts[0] == 5 || ($verParts[0] == 4 && $verParts[1] == 1 && (int)$verParts[2] >= 2));
} | php | final public function hasUTF()
{
$verParts = explode('.', $this->getVersion());
return ($verParts[0] == 5 || ($verParts[0] == 4 && $verParts[1] == 1 && (int)$verParts[2] >= 2));
} | [
"final",
"public",
"function",
"hasUTF",
"(",
")",
"{",
"$",
"verParts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"getVersion",
"(",
")",
")",
";",
"return",
"(",
"$",
"verParts",
"[",
"0",
"]",
"==",
"5",
"||",
"(",
"$",
"verParts",
"... | Determines UTF support
@access public
@return boolean True - UTF is supported | [
"Determines",
"UTF",
"support"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Driver.php#L250-L254 |
8,791 | budkit/budkit-framework | src/Budkit/Datastore/Drivers/MySQLi/Driver.php | Driver.getEscaped | final public function getEscaped($text, $extra = false)
{
$result = mysqli_real_escape_string($this->resourceId, $text);
if ($extra) {
$result = addcslashes($result, '%_');
}
return $result;
} | php | final public function getEscaped($text, $extra = false)
{
$result = mysqli_real_escape_string($this->resourceId, $text);
if ($extra) {
$result = addcslashes($result, '%_');
}
return $result;
} | [
"final",
"public",
"function",
"getEscaped",
"(",
"$",
"text",
",",
"$",
"extra",
"=",
"false",
")",
"{",
"$",
"result",
"=",
"mysqli_real_escape_string",
"(",
"$",
"this",
"->",
"resourceId",
",",
"$",
"text",
")",
";",
"if",
"(",
"$",
"extra",
")",
... | Get a database escaped string
@param string The string to be escaped
@param boolean Optional parameter to provide extra escaping
@return string
@access public
@abstract | [
"Get",
"a",
"database",
"escaped",
"string"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Driver.php#L275-L282 |
8,792 | budkit/budkit-framework | src/Budkit/Datastore/Drivers/MySQLi/Driver.php | Driver.startTransaction | public function startTransaction()
{
if (!is_a($this->resourceId, "mysqli")) {
throw new QueryException("No valid db resource Id found. This is required to start a transaction");
return false;
}
$this->resourceId->autocommit(FALSE); //Turns autocommit off;
} | php | public function startTransaction()
{
if (!is_a($this->resourceId, "mysqli")) {
throw new QueryException("No valid db resource Id found. This is required to start a transaction");
return false;
}
$this->resourceId->autocommit(FALSE); //Turns autocommit off;
} | [
"public",
"function",
"startTransaction",
"(",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"this",
"->",
"resourceId",
",",
"\"mysqli\"",
")",
")",
"{",
"throw",
"new",
"QueryException",
"(",
"\"No valid db resource Id found. This is required to start a transaction\""... | Begins a database transaction
@return void; | [
"Begins",
"a",
"database",
"transaction"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Driver.php#L347-L356 |
8,793 | budkit/budkit-framework | src/Budkit/Datastore/Drivers/MySQLi/Driver.php | Driver.query | public function query($sql, $execute = FALSE)
{
$query = (empty($sql)) ? $this->query : $sql;
$this->transactions[] = $this->replacePrefix($query); //just for reference
//@TODO;
if ($execute) {
$this->exec($query);
}
return true;
} | php | public function query($sql, $execute = FALSE)
{
$query = (empty($sql)) ? $this->query : $sql;
$this->transactions[] = $this->replacePrefix($query); //just for reference
//@TODO;
if ($execute) {
$this->exec($query);
}
return true;
} | [
"public",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"execute",
"=",
"FALSE",
")",
"{",
"$",
"query",
"=",
"(",
"empty",
"(",
"$",
"sql",
")",
")",
"?",
"$",
"this",
"->",
"query",
":",
"$",
"sql",
";",
"$",
"this",
"->",
"transactions",
"... | This method is intended for use in transsactions
@param type $sql
@param type $execute
@return boolean | [
"This",
"method",
"is",
"intended",
"for",
"use",
"in",
"transsactions"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Driver.php#L365-L377 |
8,794 | budkit/budkit-framework | src/Budkit/Datastore/Drivers/MySQLi/Driver.php | Driver.commitTransaction | public function commitTransaction()
{
if (empty($this->transactions) || !is_array($this->transactions)) {
throw new QueryException(t("No transaction queries found"));
$this->transactions = array();
$this->resourceId->autocommit(TRUE); //Turns autocommit back on
... | php | public function commitTransaction()
{
if (empty($this->transactions) || !is_array($this->transactions)) {
throw new QueryException(t("No transaction queries found"));
$this->transactions = array();
$this->resourceId->autocommit(TRUE); //Turns autocommit back on
... | [
"public",
"function",
"commitTransaction",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"transactions",
")",
"||",
"!",
"is_array",
"(",
"$",
"this",
"->",
"transactions",
")",
")",
"{",
"throw",
"new",
"QueryException",
"(",
"t",
"(",
"\... | Commits a transaction or rollbacks on error
@return boolean | [
"Commits",
"a",
"transaction",
"or",
"rollbacks",
"on",
"error"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Drivers/MySQLi/Driver.php#L384-L421 |
8,795 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.is_array | public static function is_array( $possibleArray, $_ = null )
{
foreach ( func_get_args() as $_argument )
{
if ( !is_array( $_argument ) )
{
return false;
}
}
return true;
} | php | public static function is_array( $possibleArray, $_ = null )
{
foreach ( func_get_args() as $_argument )
{
if ( !is_array( $_argument ) )
{
return false;
}
}
return true;
} | [
"public",
"static",
"function",
"is_array",
"(",
"$",
"possibleArray",
",",
"$",
"_",
"=",
"null",
")",
"{",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"_argument",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"_argument",
")",
")",
"{"... | Multi-argument is_array helper
Usage: is_array( $array1[, $array2][, ...])
@param mixed $possibleArray
@param mixed|null $_ [optional]
@return bool | [
"Multi",
"-",
"argument",
"is_array",
"helper"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L111-L122 |
8,796 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.array_prepend | public static function array_prepend( $array, $string, $deep = false )
{
if ( empty( $array ) || empty( $string ) )
{
return $array;
}
foreach ( $array as $key => $element )
{
if ( is_array( $element ) )
{
if ( $deep )
... | php | public static function array_prepend( $array, $string, $deep = false )
{
if ( empty( $array ) || empty( $string ) )
{
return $array;
}
foreach ( $array as $key => $element )
{
if ( is_array( $element ) )
{
if ( $deep )
... | [
"public",
"static",
"function",
"array_prepend",
"(",
"$",
"array",
",",
"$",
"string",
",",
"$",
"deep",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"array",
")",
"||",
"empty",
"(",
"$",
"string",
")",
")",
"{",
"return",
"$",
"array",
... | Prepend an array
@param array $array
@param string $string
@param bool $deep
@return array | [
"Prepend",
"an",
"array"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L133-L160 |
8,797 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.argsToArray | public static function argsToArray()
{
$_array = array();
foreach ( func_get_args() as $_key => $_argument )
{
$_array[$_key] = $_argument;
}
// Return the fresh array...
return $_array;
} | php | public static function argsToArray()
{
$_array = array();
foreach ( func_get_args() as $_key => $_argument )
{
$_array[$_key] = $_argument;
}
// Return the fresh array...
return $_array;
} | [
"public",
"static",
"function",
"argsToArray",
"(",
")",
"{",
"$",
"_array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"_key",
"=>",
"$",
"_argument",
")",
"{",
"$",
"_array",
"[",
"$",
"_key",
"]",
"=",
"$"... | Takes a list of things and returns them in an array as the values. Keys are maintained.
@param ...
@return array | [
"Takes",
"a",
"list",
"of",
"things",
"and",
"returns",
"them",
"in",
"an",
"array",
"as",
"the",
"values",
".",
"Keys",
"are",
"maintained",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L169-L180 |
8,798 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.in | public static function in()
{
$_haystack = func_get_args();
if ( !empty( $_haystack ) && count( $_haystack ) > 1 )
{
$_needle = array_shift( $_haystack );
return in_array( $_needle, $_haystack );
}
return false;
} | php | public static function in()
{
$_haystack = func_get_args();
if ( !empty( $_haystack ) && count( $_haystack ) > 1 )
{
$_needle = array_shift( $_haystack );
return in_array( $_needle, $_haystack );
}
return false;
} | [
"public",
"static",
"function",
"in",
"(",
")",
"{",
"$",
"_haystack",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"_haystack",
")",
"&&",
"count",
"(",
"$",
"_haystack",
")",
">",
"1",
")",
"{",
"$",
"_needle",
"=",
"... | Convenience "in_array" method. Takes variable args.
The first argument is the needle, the rest are considered in the haystack. For example:
Option::in( 'x', 'x', 'y', 'z' ) returns true
Option::in( 'a', 'x', 'y', 'z' ) returns false
@internal param mixed $needle
@internal param mixed $haystack
@return bool | [
"Convenience",
"in_array",
"method",
".",
"Takes",
"variable",
"args",
"."
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L228-L240 |
8,799 | lucifurious/kisma | src/Kisma/Core/Utility/Scalar.php | Scalar.contains | public static function contains( $needle, $haystack, $strict = false )
{
foreach ( $haystack as $_index => $_value )
{
if ( is_string( $_value ) )
{
if ( 0 === strcasecmp( $needle, $_value ) )
{
return true;
... | php | public static function contains( $needle, $haystack, $strict = false )
{
foreach ( $haystack as $_index => $_value )
{
if ( is_string( $_value ) )
{
if ( 0 === strcasecmp( $needle, $_value ) )
{
return true;
... | [
"public",
"static",
"function",
"contains",
"(",
"$",
"needle",
",",
"$",
"haystack",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"haystack",
"as",
"$",
"_index",
"=>",
"$",
"_value",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
... | A case-insensitive "in_array" for all intents and purposes. Works with objects too!
@param string $needle
@param array|object $haystack
@param bool $strict
@return bool Returns true if found, false otherwise. Just like in_array | [
"A",
"case",
"-",
"insensitive",
"in_array",
"for",
"all",
"intents",
"and",
"purposes",
".",
"Works",
"with",
"objects",
"too!"
] | 4cc9954249da4e535b52f154e728935f07e648ae | https://github.com/lucifurious/kisma/blob/4cc9954249da4e535b52f154e728935f07e648ae/src/Kisma/Core/Utility/Scalar.php#L275-L293 |
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.