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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
227,100 | BootstrapCMS/Credentials | src/Repositories/PaginateRepositoryTrait.php | PaginateRepositoryTrait.isPageInRange | protected function isPageInRange(LengthAwarePaginator $paginator)
{
return $paginator->currentPage() <= ceil($paginator->lastItem() / $paginator->perPage());
} | php | protected function isPageInRange(LengthAwarePaginator $paginator)
{
return $paginator->currentPage() <= ceil($paginator->lastItem() / $paginator->perPage());
} | [
"protected",
"function",
"isPageInRange",
"(",
"LengthAwarePaginator",
"$",
"paginator",
")",
"{",
"return",
"$",
"paginator",
"->",
"currentPage",
"(",
")",
"<=",
"ceil",
"(",
"$",
"paginator",
"->",
"lastItem",
"(",
")",
"/",
"$",
"paginator",
"->",
"perPa... | Is this current page in range?
@param \Illuminate\Pagination\LengthAwarePaginator $paginator
@return bool | [
"Is",
"this",
"current",
"page",
"in",
"range?"
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Repositories/PaginateRepositoryTrait.php#L66-L69 |
227,101 | ARCANEDEV/LaravelAuth | src/Models/User.php | User.roles | public function roles()
{
return $this->belongsToMany(
config('laravel-auth.roles.model', Role::class),
$this->getPrefix().config('laravel-auth.role-user.table', 'role_user')
)
->using(Pivots\RoleUser::class)
->withTimestamps();
} | php | public function roles()
{
return $this->belongsToMany(
config('laravel-auth.roles.model', Role::class),
$this->getPrefix().config('laravel-auth.role-user.table', 'role_user')
)
->using(Pivots\RoleUser::class)
->withTimestamps();
} | [
"public",
"function",
"roles",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"belongsToMany",
"(",
"config",
"(",
"'laravel-auth.roles.model'",
",",
"Role",
"::",
"class",
")",
",",
"$",
"this",
"->",
"getPrefix",
"(",
")",
".",
"config",
"(",
"'laravel-auth... | User belongs to many roles.
@return \Illuminate\Database\Eloquent\Relations\BelongsToMany | [
"User",
"belongs",
"to",
"many",
"roles",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/User.php#L177-L185 |
227,102 | ARCANEDEV/LaravelAuth | src/Models/User.php | User.getPermissionsAttribute | public function getPermissionsAttribute()
{
return $this->active_roles
->pluck('permissions')
->flatten()
->unique(function (PermissionContract $permission) {
return $permission->getKey();
});
} | php | public function getPermissionsAttribute()
{
return $this->active_roles
->pluck('permissions')
->flatten()
->unique(function (PermissionContract $permission) {
return $permission->getKey();
});
} | [
"public",
"function",
"getPermissionsAttribute",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"active_roles",
"->",
"pluck",
"(",
"'permissions'",
")",
"->",
"flatten",
"(",
")",
"->",
"unique",
"(",
"function",
"(",
"PermissionContract",
"$",
"permission",
")"... | Get all user permissions.
@return \Illuminate\Support\Collection | [
"Get",
"all",
"user",
"permissions",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/User.php#L192-L200 |
227,103 | ARCANEDEV/LaravelAuth | src/Models/User.php | User.scopeLastActive | public function scopeLastActive($query, $minutes = null)
{
$date = $this->freshTimestamp()->subMinutes(
$minutes ?: config('laravel_auth.track-activity.minutes', 5)
)->toDateTimeString();
return $query->where('last_activity', '>=', $date);
} | php | public function scopeLastActive($query, $minutes = null)
{
$date = $this->freshTimestamp()->subMinutes(
$minutes ?: config('laravel_auth.track-activity.minutes', 5)
)->toDateTimeString();
return $query->where('last_activity', '>=', $date);
} | [
"public",
"function",
"scopeLastActive",
"(",
"$",
"query",
",",
"$",
"minutes",
"=",
"null",
")",
"{",
"$",
"date",
"=",
"$",
"this",
"->",
"freshTimestamp",
"(",
")",
"->",
"subMinutes",
"(",
"$",
"minutes",
"?",
":",
"config",
"(",
"'laravel_auth.trac... | Scope last active users.
@param \Illuminate\Database\Eloquent\Builder $query
@param int|null $minutes
@return \Illuminate\Database\Eloquent\Builder | [
"Scope",
"last",
"active",
"users",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/User.php#L215-L222 |
227,104 | ARCANEDEV/LaravelAuth | src/Models/User.php | User.activate | public function activate($save = true)
{
event(new ActivatingUser($this));
$result = $this->switchActive(true, $save);
event(new ActivatedUser($this));
return $result;
} | php | public function activate($save = true)
{
event(new ActivatingUser($this));
$result = $this->switchActive(true, $save);
event(new ActivatedUser($this));
return $result;
} | [
"public",
"function",
"activate",
"(",
"$",
"save",
"=",
"true",
")",
"{",
"event",
"(",
"new",
"ActivatingUser",
"(",
"$",
"this",
")",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"switchActive",
"(",
"true",
",",
"$",
"save",
")",
";",
"even... | Activate the model.
@param bool $save
@return bool | [
"Activate",
"the",
"model",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/User.php#L325-L332 |
227,105 | ARCANEDEV/LaravelAuth | src/Models/User.php | User.deactivate | public function deactivate($save = true)
{
event(new DeactivatingUser($this));
$result = $this->switchActive(false, $save);
event(new DeactivatedUser($this));
return $result;
} | php | public function deactivate($save = true)
{
event(new DeactivatingUser($this));
$result = $this->switchActive(false, $save);
event(new DeactivatedUser($this));
return $result;
} | [
"public",
"function",
"deactivate",
"(",
"$",
"save",
"=",
"true",
")",
"{",
"event",
"(",
"new",
"DeactivatingUser",
"(",
"$",
"this",
")",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"switchActive",
"(",
"false",
",",
"$",
"save",
")",
";",
... | Deactivate the model.
@param bool $save
@return bool | [
"Deactivate",
"the",
"model",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/User.php#L341-L348 |
227,106 | ARCANEDEV/LaravelAuth | src/Models/User.php | User.updateLastActivity | public function updateLastActivity($save = true)
{
$this->forceFill(['last_activity' => $this->freshTimestamp()]);
if ($save) $this->save();
} | php | public function updateLastActivity($save = true)
{
$this->forceFill(['last_activity' => $this->freshTimestamp()]);
if ($save) $this->save();
} | [
"public",
"function",
"updateLastActivity",
"(",
"$",
"save",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"forceFill",
"(",
"[",
"'last_activity'",
"=>",
"$",
"this",
"->",
"freshTimestamp",
"(",
")",
"]",
")",
";",
"if",
"(",
"$",
"save",
")",
"$",
"t... | Update the user's last activity.
@param bool $save | [
"Update",
"the",
"user",
"s",
"last",
"activity",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/User.php#L431-L436 |
227,107 | hscstudio/yii2-heart | helpers/DateTimeCompareValidator.php | DateTimeCompareValidator.compareValues | protected function compareValues($operator, $value, $compareValue)
{
switch ($operator) {
case '==':
return $value == $compareValue;
case '===':
return $value === $compareValue;
case '!=':
return $value != $compareValue;
... | php | protected function compareValues($operator, $value, $compareValue)
{
switch ($operator) {
case '==':
return $value == $compareValue;
case '===':
return $value === $compareValue;
case '!=':
return $value != $compareValue;
... | [
"protected",
"function",
"compareValues",
"(",
"$",
"operator",
",",
"$",
"value",
",",
"$",
"compareValue",
")",
"{",
"switch",
"(",
"$",
"operator",
")",
"{",
"case",
"'=='",
":",
"return",
"$",
"value",
"==",
"$",
"compareValue",
";",
"case",
"'==='",... | Compares two values with the specified operator.
@param string $operator the comparison operator
@param mixed $value the value being compared
@param mixed $compareValue another value being compared
@return boolean whether the comparison using the specified operator is true. | [
"Compares",
"two",
"values",
"with",
"the",
"specified",
"operator",
"."
] | 7c54c7794c5045c0beb1d8bd70b287278eddbeee | https://github.com/hscstudio/yii2-heart/blob/7c54c7794c5045c0beb1d8bd70b287278eddbeee/helpers/DateTimeCompareValidator.php#L145-L167 |
227,108 | secit-pl/schema-org | SchemaOrg/Mapping/Type/ItemList.php | ItemList.setItemListElements | public function setItemListElements($itemListElements) {
if (!is_array($itemListElements)) {
throw new \Exception('The value is expected to be an array');
}
foreach ($itemListElements as $itemListElement) {
if (!$itemListElement instanceof Property\ItemListElement) {
throw new \Exception('Un... | php | public function setItemListElements($itemListElements) {
if (!is_array($itemListElements)) {
throw new \Exception('The value is expected to be an array');
}
foreach ($itemListElements as $itemListElement) {
if (!$itemListElement instanceof Property\ItemListElement) {
throw new \Exception('Un... | [
"public",
"function",
"setItemListElements",
"(",
"$",
"itemListElements",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"itemListElements",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'The value is expected to be an array'",
")",
";",
"}",
"foreac... | Set item list elements.
@param array|Property\ItemListElement[] $itemListElements
@return ItemList | [
"Set",
"item",
"list",
"elements",
"."
] | 5d1656153b5eebf7227cc72dd77562e288157346 | https://github.com/secit-pl/schema-org/blob/5d1656153b5eebf7227cc72dd77562e288157346/SchemaOrg/Mapping/Type/ItemList.php#L108-L120 |
227,109 | BootstrapCMS/Credentials | src/Credentials.php | Credentials.check | public function check()
{
if ($this->cache === null) {
$this->cache = $this->sentry->check();
}
return $this->cache && $this->getUser();
} | php | public function check()
{
if ($this->cache === null) {
$this->cache = $this->sentry->check();
}
return $this->cache && $this->getUser();
} | [
"public",
"function",
"check",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"cache",
"=",
"$",
"this",
"->",
"sentry",
"->",
"check",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"cache",
... | Call Sentry's check method or load of cached value.
@return bool | [
"Call",
"Sentry",
"s",
"check",
"method",
"or",
"load",
"of",
"cached",
"value",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Credentials.php#L64-L71 |
227,110 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.index | public function index()
{
$users = UserRepository::paginate();
$links = UserRepository::links();
return View::make('credentials::users.index', compact('users', 'links'));
} | php | public function index()
{
$users = UserRepository::paginate();
$links = UserRepository::links();
return View::make('credentials::users.index', compact('users', 'links'));
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"users",
"=",
"UserRepository",
"::",
"paginate",
"(",
")",
";",
"$",
"links",
"=",
"UserRepository",
"::",
"links",
"(",
")",
";",
"return",
"View",
"::",
"make",
"(",
"'credentials::users.index'",
",",
... | Display a listing of the users.
@return \Illuminate\View\View | [
"Display",
"a",
"listing",
"of",
"the",
"users",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L66-L72 |
227,111 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.store | public function store()
{
$password = Str::random();
$input = array_merge(Binput::only(['first_name', 'last_name', 'email']), [
'password' => $password,
'activated' => true,
'activated_at' => new DateTime(),
]);
$rules = UserRepository::ru... | php | public function store()
{
$password = Str::random();
$input = array_merge(Binput::only(['first_name', 'last_name', 'email']), [
'password' => $password,
'activated' => true,
'activated_at' => new DateTime(),
]);
$rules = UserRepository::ru... | [
"public",
"function",
"store",
"(",
")",
"{",
"$",
"password",
"=",
"Str",
"::",
"random",
"(",
")",
";",
"$",
"input",
"=",
"array_merge",
"(",
"Binput",
"::",
"only",
"(",
"[",
"'first_name'",
",",
"'last_name'",
",",
"'email'",
"]",
")",
",",
"[",... | Store a new user.
@return \Illuminate\Http\Response | [
"Store",
"a",
"new",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L91-L136 |
227,112 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.show | public function show($id)
{
$user = UserRepository::find($id);
$this->checkUser($user);
if ($user->activated_at) {
$activated = html_ago($user->activated_at);
} else {
if (Credentials::hasAccess('admin') && Config::get('credentials.activation')) {
... | php | public function show($id)
{
$user = UserRepository::find($id);
$this->checkUser($user);
if ($user->activated_at) {
$activated = html_ago($user->activated_at);
} else {
if (Credentials::hasAccess('admin') && Config::get('credentials.activation')) {
... | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"UserRepository",
"::",
"find",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"checkUser",
"(",
"$",
"user",
")",
";",
"if",
"(",
"$",
"user",
"->",
"activated_at",
")",
"{"... | Show the specified user.
@param int $id
@return \Illuminate\View\View | [
"Show",
"the",
"specified",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L145-L178 |
227,113 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.update | public function update($id)
{
$input = Binput::only(['first_name', 'last_name', 'email']);
$val = UserRepository::validate($input, array_keys($input));
if ($val->fails()) {
return Redirect::route('users.edit', ['users' => $id])
->withInput()->withErrors($val->err... | php | public function update($id)
{
$input = Binput::only(['first_name', 'last_name', 'email']);
$val = UserRepository::validate($input, array_keys($input));
if ($val->fails()) {
return Redirect::route('users.edit', ['users' => $id])
->withInput()->withErrors($val->err... | [
"public",
"function",
"update",
"(",
"$",
"id",
")",
"{",
"$",
"input",
"=",
"Binput",
"::",
"only",
"(",
"[",
"'first_name'",
",",
"'last_name'",
",",
"'email'",
"]",
")",
";",
"$",
"val",
"=",
"UserRepository",
"::",
"validate",
"(",
"$",
"input",
... | Update an existing user.
@param int $id
@return \Illuminate\Http\Response | [
"Update",
"an",
"existing",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L204-L270 |
227,114 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.suspend | public function suspend($id)
{
try {
$throttle = Credentials::getThrottleProvider()->findByUserId($id);
$throttle->suspend();
} catch (UserNotFoundException $e) {
throw new NotFoundHttpException('User Not Found', $e);
} catch (UserSuspendedException $e) {
... | php | public function suspend($id)
{
try {
$throttle = Credentials::getThrottleProvider()->findByUserId($id);
$throttle->suspend();
} catch (UserNotFoundException $e) {
throw new NotFoundHttpException('User Not Found', $e);
} catch (UserSuspendedException $e) {
... | [
"public",
"function",
"suspend",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"throttle",
"=",
"Credentials",
"::",
"getThrottleProvider",
"(",
")",
"->",
"findByUserId",
"(",
"$",
"id",
")",
";",
"$",
"throttle",
"->",
"suspend",
"(",
")",
";",
"}",
"... | Suspend an existing user.
@param int $id
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
@return \Illuminate\Http\Response | [
"Suspend",
"an",
"existing",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L281-L300 |
227,115 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.reset | public function reset($id)
{
$password = Str::random();
$input = [
'password' => $password,
];
$rules = [
'password' => 'required|min:6',
];
$val = UserRepository::validate($input, $rules, true);
if ($val->fails()) {
retu... | php | public function reset($id)
{
$password = Str::random();
$input = [
'password' => $password,
];
$rules = [
'password' => 'required|min:6',
];
$val = UserRepository::validate($input, $rules, true);
if ($val->fails()) {
retu... | [
"public",
"function",
"reset",
"(",
"$",
"id",
")",
"{",
"$",
"password",
"=",
"Str",
"::",
"random",
"(",
")",
";",
"$",
"input",
"=",
"[",
"'password'",
"=>",
"$",
"password",
",",
"]",
";",
"$",
"rules",
"=",
"[",
"'password'",
"=>",
"'required|... | Reset the password of an existing user.
@param int $id
@return \Illuminate\Http\Response | [
"Reset",
"the",
"password",
"of",
"an",
"existing",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L309-L343 |
227,116 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.resend | public function resend($id)
{
$user = UserRepository::find($id);
$this->checkUser($user);
if ($user->activated) {
return Redirect::route('account.resend')->withInput()
->with('error', 'That user is already activated.');
}
$code = $user->getActiva... | php | public function resend($id)
{
$user = UserRepository::find($id);
$this->checkUser($user);
if ($user->activated) {
return Redirect::route('account.resend')->withInput()
->with('error', 'That user is already activated.');
}
$code = $user->getActiva... | [
"public",
"function",
"resend",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"UserRepository",
"::",
"find",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"checkUser",
"(",
"$",
"user",
")",
";",
"if",
"(",
"$",
"user",
"->",
"activated",
")",
"{",... | Resend the activation email of an existing user.
@param int $id
@return \Illuminate\Http\Response | [
"Resend",
"the",
"activation",
"email",
"of",
"an",
"existing",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L352-L377 |
227,117 | BootstrapCMS/Credentials | src/Http/Controllers/UserController.php | UserController.destroy | public function destroy($id)
{
$user = UserRepository::find($id);
$this->checkUser($user);
$email = $user->getLogin();
try {
$user->delete();
} catch (\Exception $e) {
return Redirect::route('users.show', ['users' => $id])
->with('err... | php | public function destroy($id)
{
$user = UserRepository::find($id);
$this->checkUser($user);
$email = $user->getLogin();
try {
$user->delete();
} catch (\Exception $e) {
return Redirect::route('users.show', ['users' => $id])
->with('err... | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"UserRepository",
"::",
"find",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"checkUser",
"(",
"$",
"user",
")",
";",
"$",
"email",
"=",
"$",
"user",
"->",
"getLogin",
"... | Delete an existing user.
@param int $id
@return \Illuminate\Http\Response | [
"Delete",
"an",
"existing",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Http/Controllers/UserController.php#L386-L412 |
227,118 | cagartner/sql-anywhere-client | src/Cagartner/SQLAnywhereClient.php | SQLAnywhereClient.query | public function query($sql_string, $return=self::FETCH_ASSOC)
{
$query = self::exec( $sql_string );
if ( $query ) {
return $query->fetch($return);
}
return 0;
} | php | public function query($sql_string, $return=self::FETCH_ASSOC)
{
$query = self::exec( $sql_string );
if ( $query ) {
return $query->fetch($return);
}
return 0;
} | [
"public",
"function",
"query",
"(",
"$",
"sql_string",
",",
"$",
"return",
"=",
"self",
"::",
"FETCH_ASSOC",
")",
"{",
"$",
"query",
"=",
"self",
"::",
"exec",
"(",
"$",
"sql_string",
")",
";",
"if",
"(",
"$",
"query",
")",
"{",
"return",
"$",
"que... | Retunr Array of itens
@param string $sql_string SQL command
@return array|boolean | [
"Retunr",
"Array",
"of",
"itens"
] | 95280faf5b2cbf34d827665ce3cbc1de187d6f11 | https://github.com/cagartner/sql-anywhere-client/blob/95280faf5b2cbf34d827665ce3cbc1de187d6f11/src/Cagartner/SQLAnywhereClient.php#L79-L86 |
227,119 | cagartner/sql-anywhere-client | src/Cagartner/SQLAnywhereClient.php | SQLAnywhereClient.exec | public function exec($sql_string)
{
$this->sql_string = $sql_string;
$query = sasql_query( $this->connection, $this->sql_string );
if ( $query ) {
return new SQLAnywhereQuery( $query, $this->connection );
} else {
throw new Exception("SQL String Problem :: " . sasql_error( $this->connection ), 110);
... | php | public function exec($sql_string)
{
$this->sql_string = $sql_string;
$query = sasql_query( $this->connection, $this->sql_string );
if ( $query ) {
return new SQLAnywhereQuery( $query, $this->connection );
} else {
throw new Exception("SQL String Problem :: " . sasql_error( $this->connection ), 110);
... | [
"public",
"function",
"exec",
"(",
"$",
"sql_string",
")",
"{",
"$",
"this",
"->",
"sql_string",
"=",
"$",
"sql_string",
";",
"$",
"query",
"=",
"sasql_query",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"this",
"->",
"sql_string",
")",
";",
"if",
... | Exec a query os sql comand
@param string $sql_string SQÇ Command
@return SQLAnywhereQuery|boolean | [
"Exec",
"a",
"query",
"os",
"sql",
"comand"
] | 95280faf5b2cbf34d827665ce3cbc1de187d6f11 | https://github.com/cagartner/sql-anywhere-client/blob/95280faf5b2cbf34d827665ce3cbc1de187d6f11/src/Cagartner/SQLAnywhereClient.php#L93-L103 |
227,120 | ARCANEDEV/LaravelAuth | src/Models/PermissionsGroup.php | PermissionsGroup.createPermission | public function createPermission(array $attributes, $reload = true)
{
$this->permissions()->create($attributes);
$this->loadPermissions($reload);
} | php | public function createPermission(array $attributes, $reload = true)
{
$this->permissions()->create($attributes);
$this->loadPermissions($reload);
} | [
"public",
"function",
"createPermission",
"(",
"array",
"$",
"attributes",
",",
"$",
"reload",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"permissions",
"(",
")",
"->",
"create",
"(",
"$",
"attributes",
")",
";",
"$",
"this",
"->",
"loadPermissions",
"(",... | Create and attach a permission.
@param array $attributes
@param bool $reload | [
"Create",
"and",
"attach",
"a",
"permission",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/PermissionsGroup.php#L142-L147 |
227,121 | ARCANEDEV/LaravelAuth | src/Models/PermissionsGroup.php | PermissionsGroup.attachPermission | public function attachPermission(&$permission, $reload = true)
{
if ($this->hasPermission($permission)) return;
event(new AttachingPermissionToGroup($this, $permission));
$permission = $this->permissions()->save($permission);
event(new AttachedPermissionToGroup($this, $permission));... | php | public function attachPermission(&$permission, $reload = true)
{
if ($this->hasPermission($permission)) return;
event(new AttachingPermissionToGroup($this, $permission));
$permission = $this->permissions()->save($permission);
event(new AttachedPermissionToGroup($this, $permission));... | [
"public",
"function",
"attachPermission",
"(",
"&",
"$",
"permission",
",",
"$",
"reload",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasPermission",
"(",
"$",
"permission",
")",
")",
"return",
";",
"event",
"(",
"new",
"AttachingPermissionToGro... | Attach the permission to a group.
@param \Arcanesoft\Contracts\Auth\Models\Permission $permission
@param bool $reload | [
"Attach",
"the",
"permission",
"to",
"a",
"group",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/PermissionsGroup.php#L155-L164 |
227,122 | ARCANEDEV/LaravelAuth | src/Models/PermissionsGroup.php | PermissionsGroup.attachPermissions | public function attachPermissions($permissions, $reload = true)
{
event(new AttachingPermissionsToGroup($this, $permissions));
$permissions = $this->permissions()->saveMany($permissions);
event(new AttachedPermissionsToGroup($this, $permissions));
$this->loadPermissions($reload);
... | php | public function attachPermissions($permissions, $reload = true)
{
event(new AttachingPermissionsToGroup($this, $permissions));
$permissions = $this->permissions()->saveMany($permissions);
event(new AttachedPermissionsToGroup($this, $permissions));
$this->loadPermissions($reload);
... | [
"public",
"function",
"attachPermissions",
"(",
"$",
"permissions",
",",
"$",
"reload",
"=",
"true",
")",
"{",
"event",
"(",
"new",
"AttachingPermissionsToGroup",
"(",
"$",
"this",
",",
"$",
"permissions",
")",
")",
";",
"$",
"permissions",
"=",
"$",
"this... | Attach a collection of permissions to the group.
@param \Illuminate\Database\Eloquent\Collection|array $permissions
@param bool $reload
@return \Illuminate\Database\Eloquent\Collection|array | [
"Attach",
"a",
"collection",
"of",
"permissions",
"to",
"the",
"group",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/PermissionsGroup.php#L192-L201 |
227,123 | ARCANEDEV/LaravelAuth | src/Models/PermissionsGroup.php | PermissionsGroup.detachPermission | public function detachPermission(&$permission, $reload = true)
{
if ( ! $this->hasPermission($permission))
return;
/** @var \Arcanesoft\Contracts\Auth\Models\Permission $permission */
$permission = $this->getPermissionFromGroup($permission);
event(new DetachingPermiss... | php | public function detachPermission(&$permission, $reload = true)
{
if ( ! $this->hasPermission($permission))
return;
/** @var \Arcanesoft\Contracts\Auth\Models\Permission $permission */
$permission = $this->getPermissionFromGroup($permission);
event(new DetachingPermiss... | [
"public",
"function",
"detachPermission",
"(",
"&",
"$",
"permission",
",",
"$",
"reload",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPermission",
"(",
"$",
"permission",
")",
")",
"return",
";",
"/** @var \\Arcanesoft\\Contracts\\Auth\\Mod... | Attach the permission from a group.
@param \Arcanesoft\Contracts\Auth\Models\Permission $permission
@param bool $reload | [
"Attach",
"the",
"permission",
"from",
"a",
"group",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/PermissionsGroup.php#L209-L222 |
227,124 | ARCANEDEV/LaravelAuth | src/Models/PermissionsGroup.php | PermissionsGroup.detachPermissions | public function detachPermissions(array $ids, $reload = true)
{
event(new DetachingPermissionsFromGroup($this, $ids));
$detached = $this->permissions()->whereIn('id', $ids)->update(['group_id' => 0]);
event(new DetachedPermissionsFromGroup($this, $ids, $detached));
$this->loadPermis... | php | public function detachPermissions(array $ids, $reload = true)
{
event(new DetachingPermissionsFromGroup($this, $ids));
$detached = $this->permissions()->whereIn('id', $ids)->update(['group_id' => 0]);
event(new DetachedPermissionsFromGroup($this, $ids, $detached));
$this->loadPermis... | [
"public",
"function",
"detachPermissions",
"(",
"array",
"$",
"ids",
",",
"$",
"reload",
"=",
"true",
")",
"{",
"event",
"(",
"new",
"DetachingPermissionsFromGroup",
"(",
"$",
"this",
",",
"$",
"ids",
")",
")",
";",
"$",
"detached",
"=",
"$",
"this",
"... | Detach multiple permissions by ids.
@param array $ids
@param bool $reload
@return int | [
"Detach",
"multiple",
"permissions",
"by",
"ids",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/PermissionsGroup.php#L248-L257 |
227,125 | ARCANEDEV/LaravelAuth | src/Models/PermissionsGroup.php | PermissionsGroup.detachAllPermissions | public function detachAllPermissions($reload = true)
{
event(new DetachingAllPermissions($this));
$detached = $this->permissions()->update(['group_id' => 0]);
event(new DetachedAllPermissions($this, $detached));
$this->loadPermissions($reload);
return $detached;
} | php | public function detachAllPermissions($reload = true)
{
event(new DetachingAllPermissions($this));
$detached = $this->permissions()->update(['group_id' => 0]);
event(new DetachedAllPermissions($this, $detached));
$this->loadPermissions($reload);
return $detached;
} | [
"public",
"function",
"detachAllPermissions",
"(",
"$",
"reload",
"=",
"true",
")",
"{",
"event",
"(",
"new",
"DetachingAllPermissions",
"(",
"$",
"this",
")",
")",
";",
"$",
"detached",
"=",
"$",
"this",
"->",
"permissions",
"(",
")",
"->",
"update",
"(... | Detach all permissions from the group.
@param bool $reload
@return int | [
"Detach",
"all",
"permissions",
"from",
"the",
"group",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/PermissionsGroup.php#L266-L275 |
227,126 | ARCANEDEV/LaravelAuth | src/Models/PermissionsGroup.php | PermissionsGroup.getPermissionFromGroup | private function getPermissionFromGroup($id)
{
if ($id instanceof Eloquent) $id = $id->getKey();
$this->loadPermissions();
return $this->permissions
->filter(function (PermissionContract $permission) use ($id) {
return $permission->getKey() == $id;
}... | php | private function getPermissionFromGroup($id)
{
if ($id instanceof Eloquent) $id = $id->getKey();
$this->loadPermissions();
return $this->permissions
->filter(function (PermissionContract $permission) use ($id) {
return $permission->getKey() == $id;
}... | [
"private",
"function",
"getPermissionFromGroup",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"id",
"instanceof",
"Eloquent",
")",
"$",
"id",
"=",
"$",
"id",
"->",
"getKey",
"(",
")",
";",
"$",
"this",
"->",
"loadPermissions",
"(",
")",
";",
"return",
"... | Get a permission from the group.
@param \Arcanesoft\Contracts\Auth\Models\Permission|int $id
@return \Arcanesoft\Contracts\Auth\Models\Permission|null | [
"Get",
"a",
"permission",
"from",
"the",
"group",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/PermissionsGroup.php#L308-L319 |
227,127 | BootstrapCMS/Credentials | src/Repositories/SlugRepositoryTrait.php | SlugRepositoryTrait.find | public function find($slug, array $columns = ['*'])
{
$model = $this->model;
return $model::where('slug', '=', $slug)->first($columns);
} | php | public function find($slug, array $columns = ['*'])
{
$model = $this->model;
return $model::where('slug', '=', $slug)->first($columns);
} | [
"public",
"function",
"find",
"(",
"$",
"slug",
",",
"array",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
";",
"return",
"$",
"model",
"::",
"where",
"(",
"'slug'",
",",
"'='",
",",
"$",
"slug",
... | Find an existing model by slug.
@param string $slug
@param string[] $columns
@return \Illuminate\Database\Eloquent\Model | [
"Find",
"an",
"existing",
"model",
"by",
"slug",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Repositories/SlugRepositoryTrait.php#L29-L34 |
227,128 | hscstudio/yii2-heart | widgets/SideNavMetro.php | SideNavMetro.run | public function run()
{
$heading = '';
if (isset($this->heading) && $this->heading != '') {
Html::addCssClass($this->headingOptions, 'panel-heading');
$heading = Html::tag('div', '<h3 class="panel-title">' . $this->heading . '</h3>', $this->headingOptions);
}
... | php | public function run()
{
$heading = '';
if (isset($this->heading) && $this->heading != '') {
Html::addCssClass($this->headingOptions, 'panel-heading');
$heading = Html::tag('div', '<h3 class="panel-title">' . $this->heading . '</h3>', $this->headingOptions);
}
... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"heading",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"heading",
")",
"&&",
"$",
"this",
"->",
"heading",
"!=",
"''",
")",
"{",
"Html",
"::",
"addCssClass",
"(",
"$",
"this",
"->",... | Renders the side navigation menu.
with the heading and panel containers | [
"Renders",
"the",
"side",
"navigation",
"menu",
".",
"with",
"the",
"heading",
"and",
"panel",
"containers"
] | 7c54c7794c5045c0beb1d8bd70b287278eddbeee | https://github.com/hscstudio/yii2-heart/blob/7c54c7794c5045c0beb1d8bd70b287278eddbeee/widgets/SideNavMetro.php#L109-L121 |
227,129 | hscstudio/yii2-heart | widgets/SideNavMetro.php | SideNavMetro.renderMenu | protected function renderMenu()
{
if ($this->route === null && Yii::$app->controller !== null) {
$this->route = Yii::$app->controller->getRoute();
}
if ($this->params === null) {
$this->params = $_GET;
}
$items = $this->normalizeItems($this->items, $ha... | php | protected function renderMenu()
{
if ($this->route === null && Yii::$app->controller !== null) {
$this->route = Yii::$app->controller->getRoute();
}
if ($this->params === null) {
$this->params = $_GET;
}
$items = $this->normalizeItems($this->items, $ha... | [
"protected",
"function",
"renderMenu",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"route",
"===",
"null",
"&&",
"Yii",
"::",
"$",
"app",
"->",
"controller",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"route",
"=",
"Yii",
"::",
"$",
"app",
"->",
... | Renders the main menu | [
"Renders",
"the",
"main",
"menu"
] | 7c54c7794c5045c0beb1d8bd70b287278eddbeee | https://github.com/hscstudio/yii2-heart/blob/7c54c7794c5045c0beb1d8bd70b287278eddbeee/widgets/SideNavMetro.php#L126-L138 |
227,130 | hscstudio/yii2-heart | widgets/SideNavMetro.php | SideNavMetro.markTopItems | protected function markTopItems()
{
$items = [];
foreach ($this->items as $item) {
if (empty($item['items'])) {
$item['top'] = true;
}
$items[] = $item;
}
$this->items = $items;
} | php | protected function markTopItems()
{
$items = [];
foreach ($this->items as $item) {
if (empty($item['items'])) {
$item['top'] = true;
}
$items[] = $item;
}
$this->items = $items;
} | [
"protected",
"function",
"markTopItems",
"(",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"item",
"[",
"'items'",
"]",
")",
")",
"{",
"$",
"i... | Marks each topmost level item which is not a submenu | [
"Marks",
"each",
"topmost",
"level",
"item",
"which",
"is",
"not",
"a",
"submenu"
] | 7c54c7794c5045c0beb1d8bd70b287278eddbeee | https://github.com/hscstudio/yii2-heart/blob/7c54c7794c5045c0beb1d8bd70b287278eddbeee/widgets/SideNavMetro.php#L143-L153 |
227,131 | hscstudio/yii2-heart | widgets/SideNavMetro.php | SideNavMetro.renderItem | protected function renderItem($item)
{
$this->validateItems($item);
$template = ArrayHelper::getValue($item, 'template', $this->linkTemplate);
$url = Url::to(ArrayHelper::getValue($item, 'url', '#'));
if (empty($item['top'])) {
if (empty($item['items'])) {
... | php | protected function renderItem($item)
{
$this->validateItems($item);
$template = ArrayHelper::getValue($item, 'template', $this->linkTemplate);
$url = Url::to(ArrayHelper::getValue($item, 'url', '#'));
if (empty($item['top'])) {
if (empty($item['items'])) {
... | [
"protected",
"function",
"renderItem",
"(",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"validateItems",
"(",
"$",
"item",
")",
";",
"$",
"template",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"item",
",",
"'template'",
",",
"$",
"this",
"->",
"link... | Renders the content of a side navigation menu item.
@param array $item the menu item to be rendered. Please refer to [[items]] to see what data might be in the item.
@return string the rendering result
@throws InvalidConfigException | [
"Renders",
"the",
"content",
"of",
"a",
"side",
"navigation",
"menu",
"item",
"."
] | 7c54c7794c5045c0beb1d8bd70b287278eddbeee | https://github.com/hscstudio/yii2-heart/blob/7c54c7794c5045c0beb1d8bd70b287278eddbeee/widgets/SideNavMetro.php#L162-L185 |
227,132 | OpenSkill/Datatable | src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php | QueryConfigurationBuilder.drawCall | public function drawCall($drawCall)
{
if (!is_string($drawCall) && !is_numeric($drawCall)) {
throw new \InvalidArgumentException('$drawCall needs to be a string or numeric');
}
$this->drawCall = $drawCall;
return $this;
} | php | public function drawCall($drawCall)
{
if (!is_string($drawCall) && !is_numeric($drawCall)) {
throw new \InvalidArgumentException('$drawCall needs to be a string or numeric');
}
$this->drawCall = $drawCall;
return $this;
} | [
"public",
"function",
"drawCall",
"(",
"$",
"drawCall",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"drawCall",
")",
"&&",
"!",
"is_numeric",
"(",
"$",
"drawCall",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'$drawCall needs... | Will set the drawCall parameter send by the frontend.
@param mixed $drawCall The draw call parameter
@return $this | [
"Will",
"set",
"the",
"drawCall",
"parameter",
"send",
"by",
"the",
"frontend",
"."
] | e9814345dca4d0427da512f17c24117797e6ffbb | https://github.com/OpenSkill/Datatable/blob/e9814345dca4d0427da512f17c24117797e6ffbb/src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php#L54-L61 |
227,133 | OpenSkill/Datatable | src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php | QueryConfigurationBuilder.searchRegex | public function searchRegex($searchRegex)
{
if (!is_bool($searchRegex) && $searchRegex !== 'false' && $searchRegex !== 'true') {
throw new \InvalidArgumentException('$searchRegex needs to be a boolean');
}
$this->searchRegex = $searchRegex;
return $this;
} | php | public function searchRegex($searchRegex)
{
if (!is_bool($searchRegex) && $searchRegex !== 'false' && $searchRegex !== 'true') {
throw new \InvalidArgumentException('$searchRegex needs to be a boolean');
}
$this->searchRegex = $searchRegex;
return $this;
} | [
"public",
"function",
"searchRegex",
"(",
"$",
"searchRegex",
")",
"{",
"if",
"(",
"!",
"is_bool",
"(",
"$",
"searchRegex",
")",
"&&",
"$",
"searchRegex",
"!==",
"'false'",
"&&",
"$",
"searchRegex",
"!==",
"'true'",
")",
"{",
"throw",
"new",
"\\",
"Inval... | Will indicate if the global search value should be used as a regular expression
@param bool $searchRegex
@return $this | [
"Will",
"indicate",
"if",
"the",
"global",
"search",
"value",
"should",
"be",
"used",
"as",
"a",
"regular",
"expression"
] | e9814345dca4d0427da512f17c24117797e6ffbb | https://github.com/OpenSkill/Datatable/blob/e9814345dca4d0427da512f17c24117797e6ffbb/src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php#L110-L117 |
227,134 | OpenSkill/Datatable | src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php | QueryConfigurationBuilder.columnSearch | public function columnSearch($columnName, $searchValue)
{
if (!is_string($searchValue)) {
throw new \InvalidArgumentException('$searchValue needs to be a string');
}
$this->columSearches[$columnName] = new ColumnSearch($columnName, $searchValue);
return $this;
} | php | public function columnSearch($columnName, $searchValue)
{
if (!is_string($searchValue)) {
throw new \InvalidArgumentException('$searchValue needs to be a string');
}
$this->columSearches[$columnName] = new ColumnSearch($columnName, $searchValue);
return $this;
} | [
"public",
"function",
"columnSearch",
"(",
"$",
"columnName",
",",
"$",
"searchValue",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"searchValue",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'$searchValue needs to be a string'",
")... | Will add the given search value to the given column which indicates that the frontend wants to search on the
given column for the given value
@param string $columnName The name of the column that will be searched
@param string $searchValue The value to search for
@return $this | [
"Will",
"add",
"the",
"given",
"search",
"value",
"to",
"the",
"given",
"column",
"which",
"indicates",
"that",
"the",
"frontend",
"wants",
"to",
"search",
"on",
"the",
"given",
"column",
"for",
"the",
"given",
"value"
] | e9814345dca4d0427da512f17c24117797e6ffbb | https://github.com/OpenSkill/Datatable/blob/e9814345dca4d0427da512f17c24117797e6ffbb/src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php#L126-L133 |
227,135 | OpenSkill/Datatable | src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php | QueryConfigurationBuilder.columnOrder | public function columnOrder($columnName, $orderDirection)
{
if (!is_string($orderDirection)) {
throw new \InvalidArgumentException('$orderDirection "' . $orderDirection . '" needs to be a string');
}
$isAscOrdering = $orderDirection === "asc" ? true : false;
$this->column... | php | public function columnOrder($columnName, $orderDirection)
{
if (!is_string($orderDirection)) {
throw new \InvalidArgumentException('$orderDirection "' . $orderDirection . '" needs to be a string');
}
$isAscOrdering = $orderDirection === "asc" ? true : false;
$this->column... | [
"public",
"function",
"columnOrder",
"(",
"$",
"columnName",
",",
"$",
"orderDirection",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"orderDirection",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'$orderDirection \"'",
".",
"$",
... | Will set the ordering of the column to the given direction if possible
@param string $columnName The column name that should be ordered
@param string $orderDirection the direction that the column should be ordered by
@return $this | [
"Will",
"set",
"the",
"ordering",
"of",
"the",
"column",
"to",
"the",
"given",
"direction",
"if",
"possible"
] | e9814345dca4d0427da512f17c24117797e6ffbb | https://github.com/OpenSkill/Datatable/blob/e9814345dca4d0427da512f17c24117797e6ffbb/src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php#L141-L149 |
227,136 | OpenSkill/Datatable | src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php | QueryConfigurationBuilder.build | public function build()
{
return new QueryConfiguration(
$this->drawCall,
$this->start,
$this->length,
$this->searchValue,
$this->searchRegex,
$this->columSearches,
$this->columnOrders
);
} | php | public function build()
{
return new QueryConfiguration(
$this->drawCall,
$this->start,
$this->length,
$this->searchValue,
$this->searchRegex,
$this->columSearches,
$this->columnOrders
);
} | [
"public",
"function",
"build",
"(",
")",
"{",
"return",
"new",
"QueryConfiguration",
"(",
"$",
"this",
"->",
"drawCall",
",",
"$",
"this",
"->",
"start",
",",
"$",
"this",
"->",
"length",
",",
"$",
"this",
"->",
"searchValue",
",",
"$",
"this",
"->",
... | Will build the final QueryConfiguration that will be used later in the process pipeline
@return QueryConfiguration | [
"Will",
"build",
"the",
"final",
"QueryConfiguration",
"that",
"will",
"be",
"used",
"later",
"in",
"the",
"process",
"pipeline"
] | e9814345dca4d0427da512f17c24117797e6ffbb | https://github.com/OpenSkill/Datatable/blob/e9814345dca4d0427da512f17c24117797e6ffbb/src/OpenSkill/Datatable/Queries/QueryConfigurationBuilder.php#L155-L166 |
227,137 | javanile/moldable | src/Parser/Mysql/ValueTrait.php | ValueTrait.getNotationValue | public function getNotationValue($notation, &$errors = null)
{
$type = $this->getNotationType($notation, $params, $errors);
if (in_array($type, static::TYPE_WITHOUT_VALUE)) {
return;
}
switch ($type) {
case 'integer':
return (int) $notation;
... | php | public function getNotationValue($notation, &$errors = null)
{
$type = $this->getNotationType($notation, $params, $errors);
if (in_array($type, static::TYPE_WITHOUT_VALUE)) {
return;
}
switch ($type) {
case 'integer':
return (int) $notation;
... | [
"public",
"function",
"getNotationValue",
"(",
"$",
"notation",
",",
"&",
"$",
"errors",
"=",
"null",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"getNotationType",
"(",
"$",
"notation",
",",
"$",
"params",
",",
"$",
"errors",
")",
";",
"if",
"(",... | Retrieve value of a parsable notation
Value rapresent ...
@param type $notation
@return type | [
"Retrieve",
"value",
"of",
"a",
"parsable",
"notation",
"Value",
"rapresent",
"..."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Parser/Mysql/ValueTrait.php#L24-L56 |
227,138 | OpenSkill/Datatable | src/OpenSkill/Datatable/DatatableService.php | DatatableService.handleRequest | public function handleRequest()
{
$request = $this->prepareRequest();
$version = $request['version'];
$queryConfiguration = $request['queryConfiguration'];
$data = $this->provider->process();
return $version->createResponse($data, $queryConfiguration, $this->columnConfigurat... | php | public function handleRequest()
{
$request = $this->prepareRequest();
$version = $request['version'];
$queryConfiguration = $request['queryConfiguration'];
$data = $this->provider->process();
return $version->createResponse($data, $queryConfiguration, $this->columnConfigurat... | [
"public",
"function",
"handleRequest",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"prepareRequest",
"(",
")",
";",
"$",
"version",
"=",
"$",
"request",
"[",
"'version'",
"]",
";",
"$",
"queryConfiguration",
"=",
"$",
"request",
"[",
"'queryCo... | Will handle the current request and returns the correct response
@return JsonResponse the response that should be returned to the client. | [
"Will",
"handle",
"the",
"current",
"request",
"and",
"returns",
"the",
"correct",
"response"
] | e9814345dca4d0427da512f17c24117797e6ffbb | https://github.com/OpenSkill/Datatable/blob/e9814345dca4d0427da512f17c24117797e6ffbb/src/OpenSkill/Datatable/DatatableService.php#L97-L105 |
227,139 | javanile/moldable | src/Model/ModelApi.php | ModelApi.getModel | public static function getModel()
{
$attribute = 'model';
if (!static::hasClassAttribute($attribute)) {
$class = static::getClass();
$slash = strrpos($class, '\\');
$model = $slash === false ? $class : substr($class, $slash + 1);
static::setClassAttr... | php | public static function getModel()
{
$attribute = 'model';
if (!static::hasClassAttribute($attribute)) {
$class = static::getClass();
$slash = strrpos($class, '\\');
$model = $slash === false ? $class : substr($class, $slash + 1);
static::setClassAttr... | [
"public",
"static",
"function",
"getModel",
"(",
")",
"{",
"$",
"attribute",
"=",
"'model'",
";",
"if",
"(",
"!",
"static",
"::",
"hasClassAttribute",
"(",
"$",
"attribute",
")",
")",
"{",
"$",
"class",
"=",
"static",
"::",
"getClass",
"(",
")",
";",
... | Retrieve model name.
@return string | [
"Retrieve",
"model",
"name",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Model/ModelApi.php#L19-L32 |
227,140 | aik099/CodingStandard | CodingStandard/Sniffs/NamingConventions/ValidFunctionNameSniff.php | ValidFunctionNameSniff.isExclusion | protected function isExclusion($className, $methodName, $isPublic)
{
foreach ($this->exclusions as $classRegExp => $excludedMethods) {
if (preg_match($classRegExp, $className)) {
return ($excludedMethods[0] == '*' && $isPublic) || in_array($methodName, $excludedMethods);
... | php | protected function isExclusion($className, $methodName, $isPublic)
{
foreach ($this->exclusions as $classRegExp => $excludedMethods) {
if (preg_match($classRegExp, $className)) {
return ($excludedMethods[0] == '*' && $isPublic) || in_array($methodName, $excludedMethods);
... | [
"protected",
"function",
"isExclusion",
"(",
"$",
"className",
",",
"$",
"methodName",
",",
"$",
"isPublic",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"exclusions",
"as",
"$",
"classRegExp",
"=>",
"$",
"excludedMethods",
")",
"{",
"if",
"(",
"preg_match... | Determines if a method name shouldn't be checked for camelCaps format.
@param string $className Class name.
@param string $methodName Method name.
@param bool $isPublic Public.
@return bool | [
"Determines",
"if",
"a",
"method",
"name",
"shouldn",
"t",
"be",
"checked",
"for",
"camelCaps",
"format",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/NamingConventions/ValidFunctionNameSniff.php#L203-L212 |
227,141 | aik099/CodingStandard | CodingStandard/Sniffs/NamingConventions/ValidFunctionNameSniff.php | ValidFunctionNameSniff.isEventHandlerExclusion | protected function isEventHandlerExclusion($className, $methodName, array $methodParams)
{
if (strpos($className, 'EventHandler') === false) {
// Not EventHandler class.
return false;
}
return substr($methodName, 0, 2) == 'On' && count($methodParams) === 1 && $method... | php | protected function isEventHandlerExclusion($className, $methodName, array $methodParams)
{
if (strpos($className, 'EventHandler') === false) {
// Not EventHandler class.
return false;
}
return substr($methodName, 0, 2) == 'On' && count($methodParams) === 1 && $method... | [
"protected",
"function",
"isEventHandlerExclusion",
"(",
"$",
"className",
",",
"$",
"methodName",
",",
"array",
"$",
"methodParams",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"className",
",",
"'EventHandler'",
")",
"===",
"false",
")",
"{",
"// Not EventHandl... | Determines if a method is an event in the event handler class.
@param string $className Class name.
@param string $methodName Method name.
@param array $methodParams Method parameters.
@return bool | [
"Determines",
"if",
"a",
"method",
"is",
"an",
"event",
"in",
"the",
"event",
"handler",
"class",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/NamingConventions/ValidFunctionNameSniff.php#L223-L231 |
227,142 | aik099/CodingStandard | CodingStandard/Sniffs/NamingConventions/ValidFunctionNameSniff.php | ValidFunctionNameSniff.isTagProcessorExclusion | protected function isTagProcessorExclusion($className, $methodName, array $methodParams)
{
if (strpos($className, 'TagProcessor') === false) {
// Not TagProcessor class.
return false;
}
return count($methodParams) === 1 && $methodParams[0]['name'] === '$params';
... | php | protected function isTagProcessorExclusion($className, $methodName, array $methodParams)
{
if (strpos($className, 'TagProcessor') === false) {
// Not TagProcessor class.
return false;
}
return count($methodParams) === 1 && $methodParams[0]['name'] === '$params';
... | [
"protected",
"function",
"isTagProcessorExclusion",
"(",
"$",
"className",
",",
"$",
"methodName",
",",
"array",
"$",
"methodParams",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"className",
",",
"'TagProcessor'",
")",
"===",
"false",
")",
"{",
"// Not TagProcess... | Determines if a method is an tag in the tag processor class.
@param string $className Class name.
@param string $methodName Method name.
@param array $methodParams Method parameters.
@return bool | [
"Determines",
"if",
"a",
"method",
"is",
"an",
"tag",
"in",
"the",
"tag",
"processor",
"class",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/NamingConventions/ValidFunctionNameSniff.php#L243-L251 |
227,143 | neoxygen/neo4j-neogen | src/Neogen.php | Neogen.generateGraph | public function generateGraph(array $userSchema)
{
$graphSchema = $this->getService('neogen.schema_builder')->buildGraph($userSchema);
return $this->getGraphGenerator()->generateGraph($graphSchema);
} | php | public function generateGraph(array $userSchema)
{
$graphSchema = $this->getService('neogen.schema_builder')->buildGraph($userSchema);
return $this->getGraphGenerator()->generateGraph($graphSchema);
} | [
"public",
"function",
"generateGraph",
"(",
"array",
"$",
"userSchema",
")",
"{",
"$",
"graphSchema",
"=",
"$",
"this",
"->",
"getService",
"(",
"'neogen.schema_builder'",
")",
"->",
"buildGraph",
"(",
"$",
"userSchema",
")",
";",
"return",
"$",
"this",
"->"... | Generates a graph based on a given user schema array
@param array $userSchema
@return Graph\Graph | [
"Generates",
"a",
"graph",
"based",
"on",
"a",
"given",
"user",
"schema",
"array"
] | 3bc3ae1b95aae13915ce699b4f2d20762b2f0146 | https://github.com/neoxygen/neo4j-neogen/blob/3bc3ae1b95aae13915ce699b4f2d20762b2f0146/src/Neogen.php#L83-L88 |
227,144 | ForestAdmin/forest-php | src/ForestAdmin/Liana/Analyzer/DoctrineAnalyzer.php | DoctrineAnalyzer.getFieldForToOneAssociation | protected function getFieldForToOneAssociation($sourceAssociation)
{
$targetClassMetadata = $this->getClassMetadata($sourceAssociation['targetEntity']);
$joinedColumn = reset($sourceAssociation['joinColumns']);
if (!$joinedColumn) {
// One-to-One referenced only in foreign table... | php | protected function getFieldForToOneAssociation($sourceAssociation)
{
$targetClassMetadata = $this->getClassMetadata($sourceAssociation['targetEntity']);
$joinedColumn = reset($sourceAssociation['joinColumns']);
if (!$joinedColumn) {
// One-to-One referenced only in foreign table... | [
"protected",
"function",
"getFieldForToOneAssociation",
"(",
"$",
"sourceAssociation",
")",
"{",
"$",
"targetClassMetadata",
"=",
"$",
"this",
"->",
"getClassMetadata",
"(",
"$",
"sourceAssociation",
"[",
"'targetEntity'",
"]",
")",
";",
"$",
"joinedColumn",
"=",
... | Create a schema array for one-to-one and many-to-one associations
@param $sourceAssociation
@return ForestField | [
"Create",
"a",
"schema",
"array",
"for",
"one",
"-",
"to",
"-",
"one",
"and",
"many",
"-",
"to",
"-",
"one",
"associations"
] | 5929816a8834d3a626125a7708d4f6aab7982134 | https://github.com/ForestAdmin/forest-php/blob/5929816a8834d3a626125a7708d4f6aab7982134/src/ForestAdmin/Liana/Analyzer/DoctrineAnalyzer.php#L214-L240 |
227,145 | andre487/php_rutils | struct/TimeParams.php | TimeParams.create | public static function create(array $aParams = null)
{
$params = new self();
if ($aParams === null) {
return $params;
}
foreach ($aParams as $name => $value) {
$params->$name = $value;
}
return $params;
} | php | public static function create(array $aParams = null)
{
$params = new self();
if ($aParams === null) {
return $params;
}
foreach ($aParams as $name => $value) {
$params->$name = $value;
}
return $params;
} | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"aParams",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"new",
"self",
"(",
")",
";",
"if",
"(",
"$",
"aParams",
"===",
"null",
")",
"{",
"return",
"$",
"params",
";",
"}",
"foreach",
"(",
... | Create params from array or with default values
@param array|null $aParams
@return TimeParams | [
"Create",
"params",
"from",
"array",
"or",
"with",
"default",
"values"
] | f85a9f17d55259458326f657211c7b411a30bc53 | https://github.com/andre487/php_rutils/blob/f85a9f17d55259458326f657211c7b411a30bc53/struct/TimeParams.php#L54-L66 |
227,146 | neoxygen/neo4j-neogen | src/Schema/Node.php | Node.getIndexedProperties | public function getIndexedProperties()
{
$props = [];
foreach ($this->properties as $property) {
if ($property->isIndexed()) {
$props[] = $property;
}
}
return $props;
} | php | public function getIndexedProperties()
{
$props = [];
foreach ($this->properties as $property) {
if ($property->isIndexed()) {
$props[] = $property;
}
}
return $props;
} | [
"public",
"function",
"getIndexedProperties",
"(",
")",
"{",
"$",
"props",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"properties",
"as",
"$",
"property",
")",
"{",
"if",
"(",
"$",
"property",
"->",
"isIndexed",
"(",
")",
")",
"{",
"$",
... | Get all the properties that are indexed
@return array | [
"Get",
"all",
"the",
"properties",
"that",
"are",
"indexed"
] | 3bc3ae1b95aae13915ce699b4f2d20762b2f0146 | https://github.com/neoxygen/neo4j-neogen/blob/3bc3ae1b95aae13915ce699b4f2d20762b2f0146/src/Schema/Node.php#L98-L108 |
227,147 | neoxygen/neo4j-neogen | src/Schema/Node.php | Node.getUniqueProperties | public function getUniqueProperties()
{
$props = [];
foreach ($this->properties as $property) {
if ($property->isUnique()) {
$props[] = $property;
}
}
return $props;
} | php | public function getUniqueProperties()
{
$props = [];
foreach ($this->properties as $property) {
if ($property->isUnique()) {
$props[] = $property;
}
}
return $props;
} | [
"public",
"function",
"getUniqueProperties",
"(",
")",
"{",
"$",
"props",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"properties",
"as",
"$",
"property",
")",
"{",
"if",
"(",
"$",
"property",
"->",
"isUnique",
"(",
")",
")",
"{",
"$",
"... | Get all the properties that are unique
@return array | [
"Get",
"all",
"the",
"properties",
"that",
"are",
"unique"
] | 3bc3ae1b95aae13915ce699b4f2d20762b2f0146 | https://github.com/neoxygen/neo4j-neogen/blob/3bc3ae1b95aae13915ce699b4f2d20762b2f0146/src/Schema/Node.php#L115-L125 |
227,148 | neoxygen/neo4j-neogen | src/Schema/Node.php | Node.addLabel | public function addLabel($label)
{
if (null !== $label) {
$l = (string) $label;
if (!$this->hasLabel($l)) {
$this->labels->add($l);
return true;
}
}
return false;
} | php | public function addLabel($label)
{
if (null !== $label) {
$l = (string) $label;
if (!$this->hasLabel($l)) {
$this->labels->add($l);
return true;
}
}
return false;
} | [
"public",
"function",
"addLabel",
"(",
"$",
"label",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"label",
")",
"{",
"$",
"l",
"=",
"(",
"string",
")",
"$",
"label",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasLabel",
"(",
"$",
"l",
")",
")",
"{"... | Adds a label to this node, checks if the label does not exist to avoid duplicates
@param string $label
@return bool | [
"Adds",
"a",
"label",
"to",
"this",
"node",
"checks",
"if",
"the",
"label",
"does",
"not",
"exist",
"to",
"avoid",
"duplicates"
] | 3bc3ae1b95aae13915ce699b4f2d20762b2f0146 | https://github.com/neoxygen/neo4j-neogen/blob/3bc3ae1b95aae13915ce699b4f2d20762b2f0146/src/Schema/Node.php#L153-L165 |
227,149 | neoxygen/neo4j-neogen | src/Schema/Node.php | Node.hasLabel | public function hasLabel($label)
{
if (null !== $label) {
$l = (string) $label;
if ($this->labels->contains($l)) {
return true;
}
}
return false;
} | php | public function hasLabel($label)
{
if (null !== $label) {
$l = (string) $label;
if ($this->labels->contains($l)) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasLabel",
"(",
"$",
"label",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"label",
")",
"{",
"$",
"l",
"=",
"(",
"string",
")",
"$",
"label",
";",
"if",
"(",
"$",
"this",
"->",
"labels",
"->",
"contains",
"(",
"$",
"l",
")",... | Checks whether or not this node has the specified label
@param string $label
@return bool | [
"Checks",
"whether",
"or",
"not",
"this",
"node",
"has",
"the",
"specified",
"label"
] | 3bc3ae1b95aae13915ce699b4f2d20762b2f0146 | https://github.com/neoxygen/neo4j-neogen/blob/3bc3ae1b95aae13915ce699b4f2d20762b2f0146/src/Schema/Node.php#L185-L195 |
227,150 | web2all/safebrowsingv4 | src/GoogleSafeBrowsing/Lookup/URL.php | GoogleSafeBrowsing_Lookup_URL.makeRFC2396Valid | public static function makeRFC2396Valid($url)
{
// parse the url into parts
$parsed_url=@parse_url($url);
// check parsed url
if($parsed_url===false){
// unable to parse url
return null;
}
// when no scheme present, parse_url may go haywire
if(!isset($parsed_url['scheme'])){
... | php | public static function makeRFC2396Valid($url)
{
// parse the url into parts
$parsed_url=@parse_url($url);
// check parsed url
if($parsed_url===false){
// unable to parse url
return null;
}
// when no scheme present, parse_url may go haywire
if(!isset($parsed_url['scheme'])){
... | [
"public",
"static",
"function",
"makeRFC2396Valid",
"(",
"$",
"url",
")",
"{",
"// parse the url into parts",
"$",
"parsed_url",
"=",
"@",
"parse_url",
"(",
"$",
"url",
")",
";",
"// check parsed url",
"if",
"(",
"$",
"parsed_url",
"===",
"false",
")",
"{",
... | Make valid url
Make it valid according to RFC 2396. If the URL uses an internationalized domain name (IDN),
it should be converted to the ASCII Punycode representation. The URL must include a path
component; that is, it must have a trailing slash ('http://google.com/').
@param string $url
@return string or null if n... | [
"Make",
"valid",
"url"
] | e506341efa8d919974c8eb362987bc1e2f398983 | https://github.com/web2all/safebrowsingv4/blob/e506341efa8d919974c8eb362987bc1e2f398983/src/GoogleSafeBrowsing/Lookup/URL.php#L26-L93 |
227,151 | web2all/safebrowsingv4 | src/GoogleSafeBrowsing/Lookup/URL.php | GoogleSafeBrowsing_Lookup_URL.googleCanonicalize | public static function googleCanonicalize($url)
{
// First, remove tab (0x09), CR (0x0d), and LF (0x0a) characters from the URL. Do not remove escape sequences for these characters (e.g. '%0a').
$url=preg_replace('#[\x09\x0d\x0a]#', '', $url);
$url=self::makeRFC2396Valid(trim($url));
if(is_nul... | php | public static function googleCanonicalize($url)
{
// First, remove tab (0x09), CR (0x0d), and LF (0x0a) characters from the URL. Do not remove escape sequences for these characters (e.g. '%0a').
$url=preg_replace('#[\x09\x0d\x0a]#', '', $url);
$url=self::makeRFC2396Valid(trim($url));
if(is_nul... | [
"public",
"static",
"function",
"googleCanonicalize",
"(",
"$",
"url",
")",
"{",
"// First, remove tab (0x09), CR (0x0d), and LF (0x0a) characters from the URL. Do not remove escape sequences for these characters (e.g. '%0a').",
"$",
"url",
"=",
"preg_replace",
"(",
"'#[\\x09\\x0d\\x0a... | Canonicalize the url according to google's wishes
First, remove tab (0x09), CR (0x0d), and LF (0x0a) characters from the URL. Do not remove escape sequences for these characters (e.g. '%0a').
If the URL ends in a fragment, remove the fragment. For example, shorten 'http://google.com/#frag' to 'http://google.com/'.
N... | [
"Canonicalize",
"the",
"url",
"according",
"to",
"google",
"s",
"wishes"
] | e506341efa8d919974c8eb362987bc1e2f398983 | https://github.com/web2all/safebrowsingv4/blob/e506341efa8d919974c8eb362987bc1e2f398983/src/GoogleSafeBrowsing/Lookup/URL.php#L124-L189 |
227,152 | web2all/safebrowsingv4 | src/GoogleSafeBrowsing/Lookup/URL.php | GoogleSafeBrowsing_Lookup_URL.isHostnameIP | public static function isHostnameIP($hostname)
{
// IP-literal: encased in square brackets
// we match starting [ character followed by non ] characters followed by ] character as last character in hostname
if(preg_match('/^\[[^\]]\]$/',$hostname)){
// ok its an IP-literal, we do not parse the liter... | php | public static function isHostnameIP($hostname)
{
// IP-literal: encased in square brackets
// we match starting [ character followed by non ] characters followed by ] character as last character in hostname
if(preg_match('/^\[[^\]]\]$/',$hostname)){
// ok its an IP-literal, we do not parse the liter... | [
"public",
"static",
"function",
"isHostnameIP",
"(",
"$",
"hostname",
")",
"{",
"// IP-literal: encased in square brackets",
"// we match starting [ character followed by non ] characters followed by ] character as last character in hostname",
"if",
"(",
"preg_match",
"(",
"'/^\\[[^\\]... | Check if the given hostname is an ip address
@param string $hostname
@return boolean | [
"Check",
"if",
"the",
"given",
"hostname",
"is",
"an",
"ip",
"address"
] | e506341efa8d919974c8eb362987bc1e2f398983 | https://github.com/web2all/safebrowsingv4/blob/e506341efa8d919974c8eb362987bc1e2f398983/src/GoogleSafeBrowsing/Lookup/URL.php#L320-L349 |
227,153 | web2all/safebrowsingv4 | src/GoogleSafeBrowsing/Lookup/URL.php | GoogleSafeBrowsing_Lookup_URL.percentUnEscape | public static function percentUnEscape($string)
{
// Next, repeatedly percent-unescape the URL until it has no more percent-escapes.
// this is not trivial, because the percent character could be in the url, when are we done?
// lets unescape till there are no more percentages, or the only percentages are... | php | public static function percentUnEscape($string)
{
// Next, repeatedly percent-unescape the URL until it has no more percent-escapes.
// this is not trivial, because the percent character could be in the url, when are we done?
// lets unescape till there are no more percentages, or the only percentages are... | [
"public",
"static",
"function",
"percentUnEscape",
"(",
"$",
"string",
")",
"{",
"// Next, repeatedly percent-unescape the URL until it has no more percent-escapes.",
"// this is not trivial, because the percent character could be in the url, when are we done?",
"// lets unescape till there ar... | unescape the string
@param string $string
@return string | [
"unescape",
"the",
"string"
] | e506341efa8d919974c8eb362987bc1e2f398983 | https://github.com/web2all/safebrowsingv4/blob/e506341efa8d919974c8eb362987bc1e2f398983/src/GoogleSafeBrowsing/Lookup/URL.php#L377-L404 |
227,154 | javanile/moldable | src/Model/QueryApi.php | QueryApi.query | public static function query($query)
{
//
static::applySchema();
//
$table = self::getTable();
$whereArray = [];
//
if (isset($query['where'])) {
$whereArray[] = '('.$query['where'].')';
unset($query['where']);
}
//
... | php | public static function query($query)
{
//
static::applySchema();
//
$table = self::getTable();
$whereArray = [];
//
if (isset($query['where'])) {
$whereArray[] = '('.$query['where'].')';
unset($query['where']);
}
//
... | [
"public",
"static",
"function",
"query",
"(",
"$",
"query",
")",
"{",
"//",
"static",
"::",
"applySchema",
"(",
")",
";",
"//",
"$",
"table",
"=",
"self",
"::",
"getTable",
"(",
")",
";",
"$",
"whereArray",
"=",
"[",
"]",
";",
"//",
"if",
"(",
"i... | Query a list of records.
@param type $query
@return type | [
"Query",
"a",
"list",
"of",
"records",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Model/QueryApi.php#L21-L57 |
227,155 | neoxygen/neo4j-neogen | src/Parser/YamlFileParser.php | YamlFileParser.getSchemaFileContent | public function getSchemaFileContent($filePath)
{
if (!$this->fs->exists($filePath)) {
throw new SchemaDefinitionException(sprintf('The schema file "%s" was not found', $filePath));
}
$content = file_get_contents($filePath);
try {
$schema = Yaml::parse($cont... | php | public function getSchemaFileContent($filePath)
{
if (!$this->fs->exists($filePath)) {
throw new SchemaDefinitionException(sprintf('The schema file "%s" was not found', $filePath));
}
$content = file_get_contents($filePath);
try {
$schema = Yaml::parse($cont... | [
"public",
"function",
"getSchemaFileContent",
"(",
"$",
"filePath",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"fs",
"->",
"exists",
"(",
"$",
"filePath",
")",
")",
"{",
"throw",
"new",
"SchemaDefinitionException",
"(",
"sprintf",
"(",
"'The schema file \"... | Get the contents of the User Schema YAML File and transforms it to php array
@param $filePath
@return array
@throws SchemaDefinitionException | [
"Get",
"the",
"contents",
"of",
"the",
"User",
"Schema",
"YAML",
"File",
"and",
"transforms",
"it",
"to",
"php",
"array"
] | 3bc3ae1b95aae13915ce699b4f2d20762b2f0146 | https://github.com/neoxygen/neo4j-neogen/blob/3bc3ae1b95aae13915ce699b4f2d20762b2f0146/src/Parser/YamlFileParser.php#L65-L80 |
227,156 | hscstudio/yii2-heart | helpers/Heart.php | Heart.abjad | public static function abjad($start=0,$end=0){
$abjadList = [];
for($i=65;$i<=90;$i++){
$abjadList[]=chr($i);
if($i==90){
for($j=65;$j<=90;$j++){
for($k=65;$k<=90;$k++){
$abjadList[]=chr($j).chr($k);
}
}
}
}
$abjad = [];
if($end<$start) $end=$start;
for($x=$start;$x<=$e... | php | public static function abjad($start=0,$end=0){
$abjadList = [];
for($i=65;$i<=90;$i++){
$abjadList[]=chr($i);
if($i==90){
for($j=65;$j<=90;$j++){
for($k=65;$k<=90;$k++){
$abjadList[]=chr($j).chr($k);
}
}
}
}
$abjad = [];
if($end<$start) $end=$start;
for($x=$start;$x<=$e... | [
"public",
"static",
"function",
"abjad",
"(",
"$",
"start",
"=",
"0",
",",
"$",
"end",
"=",
"0",
")",
"{",
"$",
"abjadList",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"65",
";",
"$",
"i",
"<=",
"90",
";",
"$",
"i",
"++",
")",
"{",
"$... | Generates abjad list column.
@param integer $start
@param integer $end
Example(s):
~~~
echo Heart::abjad(0); // [A]
echo Heart::abjad(28); // [AB]
echo Heart::abjad(1,3); // [B,C,D]
~~~
@see Excel columns | [
"Generates",
"abjad",
"list",
"column",
"."
] | 7c54c7794c5045c0beb1d8bd70b287278eddbeee | https://github.com/hscstudio/yii2-heart/blob/7c54c7794c5045c0beb1d8bd70b287278eddbeee/helpers/Heart.php#L43-L63 |
227,157 | aik099/CodingStandard | CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php | ControlStructureSpacingSniff.checkBracketSpacing | protected function checkBracketSpacing(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) {
return;
}
$parenOpener = $tokens[$stackPtr]['parenthesis_opener'];
$parenCloser = $toke... | php | protected function checkBracketSpacing(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) {
return;
}
$parenOpener = $tokens[$stackPtr]['parenthesis_opener'];
$parenCloser = $toke... | [
"protected",
"function",
"checkBracketSpacing",
"(",
"File",
"$",
"phpcsFile",
",",
"$",
"stackPtr",
")",
"{",
"$",
"tokens",
"=",
"$",
"phpcsFile",
"->",
"getTokens",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"tokens",
"[",
"$",
"stackPtr",
"]",
"[... | Checks bracket spacing.
@param File $phpcsFile The file being scanned.
@param int $stackPtr The position of the current token
in the stack passed in $tokens.
@return void | [
"Checks",
"bracket",
"spacing",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L121-L182 |
227,158 | aik099/CodingStandard | CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php | ControlStructureSpacingSniff.getLeadingCommentOrSelf | protected function getLeadingCommentOrSelf(File $phpcsFile, $stackPtr)
{
$prevTokens = array($stackPtr);
$tokens = $phpcsFile->getTokens();
do {
$prev = end($prevTokens);
$newPrev = $phpcsFile->findPrevious(
T_WHITESPACE,
($prev... | php | protected function getLeadingCommentOrSelf(File $phpcsFile, $stackPtr)
{
$prevTokens = array($stackPtr);
$tokens = $phpcsFile->getTokens();
do {
$prev = end($prevTokens);
$newPrev = $phpcsFile->findPrevious(
T_WHITESPACE,
($prev... | [
"protected",
"function",
"getLeadingCommentOrSelf",
"(",
"File",
"$",
"phpcsFile",
",",
"$",
"stackPtr",
")",
"{",
"$",
"prevTokens",
"=",
"array",
"(",
"$",
"stackPtr",
")",
";",
"$",
"tokens",
"=",
"$",
"phpcsFile",
"->",
"getTokens",
"(",
")",
";",
"d... | Returns leading comment or self.
@param File $phpcsFile All the tokens found in the document.
@param int $stackPtr The position of the current token
in the stack passed in $tokens.
@return bool|int | [
"Returns",
"leading",
"comment",
"or",
"self",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L408-L432 |
227,159 | aik099/CodingStandard | CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php | ControlStructureSpacingSniff.getScopeCloser | protected function getScopeCloser(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$scopeCloser = $tokens[$stackPtr]['scope_closer'];
if ($tokens[$stackPtr]['code'] !== T_DO) {
return $scopeCloser;
}
$trailingContent = $phpcsFile->findNext(
... | php | protected function getScopeCloser(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$scopeCloser = $tokens[$stackPtr]['scope_closer'];
if ($tokens[$stackPtr]['code'] !== T_DO) {
return $scopeCloser;
}
$trailingContent = $phpcsFile->findNext(
... | [
"protected",
"function",
"getScopeCloser",
"(",
"File",
"$",
"phpcsFile",
",",
"$",
"stackPtr",
")",
"{",
"$",
"tokens",
"=",
"$",
"phpcsFile",
"->",
"getTokens",
"(",
")",
";",
"$",
"scopeCloser",
"=",
"$",
"tokens",
"[",
"$",
"stackPtr",
"]",
"[",
"'... | Returns scope closer with special check for "do...while" statements.
@param File $phpcsFile All the tokens found in the document.
@param int $stackPtr The position of the current token
in the stack passed in $tokens.
@return int|bool | [
"Returns",
"scope",
"closer",
"with",
"special",
"check",
"for",
"do",
"...",
"while",
"statements",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L532-L557 |
227,160 | aik099/CodingStandard | CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php | ControlStructureSpacingSniff.getTrailingContent | protected function getTrailingContent(File $phpcsFile, $stackPtr)
{
$nextNonWhitespace = $phpcsFile->findNext(
array(
T_WHITESPACE,
T_COMMENT,
),
($stackPtr + 1),
null,
true
);
return $nextNonWhitespace;
... | php | protected function getTrailingContent(File $phpcsFile, $stackPtr)
{
$nextNonWhitespace = $phpcsFile->findNext(
array(
T_WHITESPACE,
T_COMMENT,
),
($stackPtr + 1),
null,
true
);
return $nextNonWhitespace;
... | [
"protected",
"function",
"getTrailingContent",
"(",
"File",
"$",
"phpcsFile",
",",
"$",
"stackPtr",
")",
"{",
"$",
"nextNonWhitespace",
"=",
"$",
"phpcsFile",
"->",
"findNext",
"(",
"array",
"(",
"T_WHITESPACE",
",",
"T_COMMENT",
",",
")",
",",
"(",
"$",
"... | Returns trailing content token.
@param File $phpcsFile All the tokens found in the document.
@param int $stackPtr The position of the current token
in the stack passed in $tokens.
@return int|bool | [
"Returns",
"trailing",
"content",
"token",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L569-L582 |
227,161 | aik099/CodingStandard | CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php | ControlStructureSpacingSniff.getTrailingCommentOrSelf | protected function getTrailingCommentOrSelf(File $phpcsFile, $stackPtr)
{
$nextTokens = array($stackPtr);
$tokens = $phpcsFile->getTokens();
do {
$next = end($nextTokens);
$newNext = $phpcsFile->findNext(
T_WHITESPACE,
($next + 1),
... | php | protected function getTrailingCommentOrSelf(File $phpcsFile, $stackPtr)
{
$nextTokens = array($stackPtr);
$tokens = $phpcsFile->getTokens();
do {
$next = end($nextTokens);
$newNext = $phpcsFile->findNext(
T_WHITESPACE,
($next + 1),
... | [
"protected",
"function",
"getTrailingCommentOrSelf",
"(",
"File",
"$",
"phpcsFile",
",",
"$",
"stackPtr",
")",
"{",
"$",
"nextTokens",
"=",
"array",
"(",
"$",
"stackPtr",
")",
";",
"$",
"tokens",
"=",
"$",
"phpcsFile",
"->",
"getTokens",
"(",
")",
";",
"... | Returns trailing comment or self.
@param File $phpcsFile All the tokens found in the document.
@param int $stackPtr The position of the current token
in the stack passed in $tokens.
@return bool|int | [
"Returns",
"trailing",
"comment",
"or",
"self",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L594-L618 |
227,162 | aik099/CodingStandard | CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php | ControlStructureSpacingSniff.isClosure | protected function isClosure(File $phpcsFile, $stackPtr, $scopeConditionPtr)
{
$tokens = $phpcsFile->getTokens();
if ($this->isScopeCondition($phpcsFile, $scopeConditionPtr, T_CLOSURE) === true
&& ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) === true
|| $phpcsFile->hasCo... | php | protected function isClosure(File $phpcsFile, $stackPtr, $scopeConditionPtr)
{
$tokens = $phpcsFile->getTokens();
if ($this->isScopeCondition($phpcsFile, $scopeConditionPtr, T_CLOSURE) === true
&& ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) === true
|| $phpcsFile->hasCo... | [
"protected",
"function",
"isClosure",
"(",
"File",
"$",
"phpcsFile",
",",
"$",
"stackPtr",
",",
"$",
"scopeConditionPtr",
")",
"{",
"$",
"tokens",
"=",
"$",
"phpcsFile",
"->",
"getTokens",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isScopeCondition",
... | Determines that a closure is located at given position.
@param File $phpcsFile The file being scanned.
@param int $stackPtr The position of the current token.
in the stack passed in $tokens.
@param int $scopeConditionPtr Position of scope condition.
@return bool | [
"Determines",
"that",
"a",
"closure",
"is",
"located",
"at",
"given",
"position",
"."
] | 0f65c52bf2d95d5068af9f73110770ddb9de8de7 | https://github.com/aik099/CodingStandard/blob/0f65c52bf2d95d5068af9f73110770ddb9de8de7/CodingStandard/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L767-L780 |
227,163 | matthewbdaly/laravel-repositories | src/Repositories/Decorators/BaseDecorator.php | BaseDecorator.firstOrCreate | public function firstOrCreate(array $input)
{
$this->cache->tags($this->getModel())->flush();
return $this->repository->firstOrCreate($input);
} | php | public function firstOrCreate(array $input)
{
$this->cache->tags($this->getModel())->flush();
return $this->repository->firstOrCreate($input);
} | [
"public",
"function",
"firstOrCreate",
"(",
"array",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"tags",
"(",
"$",
"this",
"->",
"getModel",
"(",
")",
")",
"->",
"flush",
"(",
")",
";",
"return",
"$",
"this",
"->",
"repository",
"->",
... | Get or create row
@param array $input The input data.
@return \Illuminate\Database\Eloquent\Model | [
"Get",
"or",
"create",
"row"
] | af05180e3674fa3a9f5ba6f9ecccdda10b41135a | https://github.com/matthewbdaly/laravel-repositories/blob/af05180e3674fa3a9f5ba6f9ecccdda10b41135a/src/Repositories/Decorators/BaseDecorator.php#L190-L194 |
227,164 | matthewbdaly/laravel-repositories | src/Repositories/Decorators/BaseDecorator.php | BaseDecorator.updateOrCreate | public function updateOrCreate(array $input)
{
$this->cache->tags($this->getModel())->flush();
return $this->repository->updateOrCreate($input);
} | php | public function updateOrCreate(array $input)
{
$this->cache->tags($this->getModel())->flush();
return $this->repository->updateOrCreate($input);
} | [
"public",
"function",
"updateOrCreate",
"(",
"array",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"tags",
"(",
"$",
"this",
"->",
"getModel",
"(",
")",
")",
"->",
"flush",
"(",
")",
";",
"return",
"$",
"this",
"->",
"repository",
"->",
... | Update or create row
@param array $input The input data.
@return \Illuminate\Database\Eloquent\Model | [
"Update",
"or",
"create",
"row"
] | af05180e3674fa3a9f5ba6f9ecccdda10b41135a | https://github.com/matthewbdaly/laravel-repositories/blob/af05180e3674fa3a9f5ba6f9ecccdda10b41135a/src/Repositories/Decorators/BaseDecorator.php#L202-L206 |
227,165 | BootstrapCMS/Credentials | src/Models/Throttle.php | Throttle.suspend | public function suspend()
{
RevisionRepository::create([
'revisionable_type' => Config::get('sentry.users.model'),
'revisionable_id' => $this['user_id'],
'key' => 'suspended_at',
'old_value' => $this['suspended_at'],
'new_va... | php | public function suspend()
{
RevisionRepository::create([
'revisionable_type' => Config::get('sentry.users.model'),
'revisionable_id' => $this['user_id'],
'key' => 'suspended_at',
'old_value' => $this['suspended_at'],
'new_va... | [
"public",
"function",
"suspend",
"(",
")",
"{",
"RevisionRepository",
"::",
"create",
"(",
"[",
"'revisionable_type'",
"=>",
"Config",
"::",
"get",
"(",
"'sentry.users.model'",
")",
",",
"'revisionable_id'",
"=>",
"$",
"this",
"[",
"'user_id'",
"]",
",",
"'key... | Suspend the user associated with the throttle.
@return void | [
"Suspend",
"the",
"user",
"associated",
"with",
"the",
"throttle",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Throttle.php#L66-L78 |
227,166 | javanile/moldable | src/Parser/MysqlParser.php | MysqlParser.parse | public function parse(&$schema)
{
// loop throh tables on the schema
foreach ($schema as &$table) {
static::parseTable($table);
}
// loop throh tables on the schema
foreach ($schema as &$table) {
foreach ($table as $aspects) {
if (isse... | php | public function parse(&$schema)
{
// loop throh tables on the schema
foreach ($schema as &$table) {
static::parseTable($table);
}
// loop throh tables on the schema
foreach ($schema as &$table) {
foreach ($table as $aspects) {
if (isse... | [
"public",
"function",
"parse",
"(",
"&",
"$",
"schema",
")",
"{",
"// loop throh tables on the schema",
"foreach",
"(",
"$",
"schema",
"as",
"&",
"$",
"table",
")",
"{",
"static",
"::",
"parseTable",
"(",
"$",
"table",
")",
";",
"}",
"// loop throh tables on... | parse a multi-table schema to sanitize end explode implicit info.
@param type $schema
@return type | [
"parse",
"a",
"multi",
"-",
"table",
"schema",
"to",
"sanitize",
"end",
"explode",
"implicit",
"info",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Parser/MysqlParser.php#L48-L63 |
227,167 | javanile/moldable | src/Parser/MysqlParser.php | MysqlParser.parseTable | public function parseTable(&$table, &$errors = null, $namespace = '\\')
{
// for first field no have before
$before = false;
// loop throuh fields on table
foreach ($table as $field => &$notation) {
$notation = static::getNotationAspects(
$notation,
... | php | public function parseTable(&$table, &$errors = null, $namespace = '\\')
{
// for first field no have before
$before = false;
// loop throuh fields on table
foreach ($table as $field => &$notation) {
$notation = static::getNotationAspects(
$notation,
... | [
"public",
"function",
"parseTable",
"(",
"&",
"$",
"table",
",",
"&",
"$",
"errors",
"=",
"null",
",",
"$",
"namespace",
"=",
"'\\\\'",
")",
"{",
"// for first field no have before",
"$",
"before",
"=",
"false",
";",
"// loop throuh fields on table",
"foreach",
... | Parse table schema to sanitize end explod implicit info.
@param type $schema
@param mixed $namespace
@return type | [
"Parse",
"table",
"schema",
"to",
"sanitize",
"end",
"explod",
"implicit",
"info",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Parser/MysqlParser.php#L73-L89 |
227,168 | javanile/moldable | src/Parser/MysqlParser.php | MysqlParser.getNotationAspects | public function getNotationAspects(
$notation,
$field = null,
$before = null,
&$errors = null,
$namespace = null
) {
$params = null;
$type = $this->getNotationType($notation, $params, $errors, $namespace);
$aspects = $this->getNotationCommonAspects($fi... | php | public function getNotationAspects(
$notation,
$field = null,
$before = null,
&$errors = null,
$namespace = null
) {
$params = null;
$type = $this->getNotationType($notation, $params, $errors, $namespace);
$aspects = $this->getNotationCommonAspects($fi... | [
"public",
"function",
"getNotationAspects",
"(",
"$",
"notation",
",",
"$",
"field",
"=",
"null",
",",
"$",
"before",
"=",
"null",
",",
"&",
"$",
"errors",
"=",
"null",
",",
"$",
"namespace",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"null",
";",
... | Parse notation of a field.
@param type $notation
@param type $field
@param type $before
@param null|mixed $namespace
@return string | [
"Parse",
"notation",
"of",
"a",
"field",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Parser/MysqlParser.php#L101-L154 |
227,169 | javanile/moldable | src/Parser/MysqlParser.php | MysqlParser.getNotationCommonAspects | private function getNotationCommonAspects($field, $before)
{
$aspects = [
'Field' => null,
'Key' => '',
'Type' => '',
'Null' => 'YES',
'Extra' => '',
'Default' => '',
'Relation' => null,
];
... | php | private function getNotationCommonAspects($field, $before)
{
$aspects = [
'Field' => null,
'Key' => '',
'Type' => '',
'Null' => 'YES',
'Extra' => '',
'Default' => '',
'Relation' => null,
];
... | [
"private",
"function",
"getNotationCommonAspects",
"(",
"$",
"field",
",",
"$",
"before",
")",
"{",
"$",
"aspects",
"=",
"[",
"'Field'",
"=>",
"null",
",",
"'Key'",
"=>",
"''",
",",
"'Type'",
"=>",
"''",
",",
"'Null'",
"=>",
"'YES'",
",",
"'Extra'",
"=... | Get common or default aspects.
@param mixed $field
@param mixed $before | [
"Get",
"common",
"or",
"default",
"aspects",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Parser/MysqlParser.php#L162-L184 |
227,170 | BootstrapCMS/Credentials | src/Repositories/BaseRepositoryTrait.php | BaseRepositoryTrait.find | public function find($id, array $columns = ['*'])
{
$model = $this->model;
return $model::find($id, $columns);
} | php | public function find($id, array $columns = ['*'])
{
$model = $this->model;
return $model::find($id, $columns);
} | [
"public",
"function",
"find",
"(",
"$",
"id",
",",
"array",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
";",
"return",
"$",
"model",
"::",
"find",
"(",
"$",
"id",
",",
"$",
"columns",
")",
";",... | Find an existing model.
@param int $id
@param string[] $columns
@return \Illuminate\Database\Eloquent\Model | [
"Find",
"an",
"existing",
"model",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Repositories/BaseRepositoryTrait.php#L43-L48 |
227,171 | BootstrapCMS/Credentials | src/Repositories/BaseRepositoryTrait.php | BaseRepositoryTrait.index | public function index()
{
$model = $this->model;
if (property_exists($model, 'order')) {
return $model::orderBy($model::$order, $model::$sort)->get($model::$index);
}
return $model::get($model::$index);
} | php | public function index()
{
$model = $this->model;
if (property_exists($model, 'order')) {
return $model::orderBy($model::$order, $model::$sort)->get($model::$index);
}
return $model::get($model::$index);
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
";",
"if",
"(",
"property_exists",
"(",
"$",
"model",
",",
"'order'",
")",
")",
"{",
"return",
"$",
"model",
"::",
"orderBy",
"(",
"$",
"model",
"::",
"$",... | Get a list of the models.
@return \Illuminate\Database\Eloquent\Collection | [
"Get",
"a",
"list",
"of",
"the",
"models",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Repositories/BaseRepositoryTrait.php#L69-L78 |
227,172 | BootstrapCMS/Credentials | src/Repositories/BaseRepositoryTrait.php | BaseRepositoryTrait.rules | public function rules($query = null)
{
$model = $this->model;
// get rules from the model if set
if (isset($model::$rules)) {
$rules = $model::$rules;
} else {
$rules = [];
}
// if the there are no rules
if (!is_array($rules) || !$rul... | php | public function rules($query = null)
{
$model = $this->model;
// get rules from the model if set
if (isset($model::$rules)) {
$rules = $model::$rules;
} else {
$rules = [];
}
// if the there are no rules
if (!is_array($rules) || !$rul... | [
"public",
"function",
"rules",
"(",
"$",
"query",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
";",
"// get rules from the model if set",
"if",
"(",
"isset",
"(",
"$",
"model",
"::",
"$",
"rules",
")",
")",
"{",
"$",
"rules",
... | Return the rules.
@param string|string[] $query
@return string[] | [
"Return",
"the",
"rules",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Repositories/BaseRepositoryTrait.php#L114-L139 |
227,173 | javanile/moldable | src/Database/Socket/LaravelSocket.php | LaravelSocket.getRow | public function getRow($sql, $params = null)
{
return $this->_socket->getRow($sql, $params = null);
} | php | public function getRow($sql, $params = null)
{
return $this->_socket->getRow($sql, $params = null);
} | [
"public",
"function",
"getRow",
"(",
"$",
"sql",
",",
"$",
"params",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_socket",
"->",
"getRow",
"(",
"$",
"sql",
",",
"$",
"params",
"=",
"null",
")",
";",
"}"
] | Get a single row.
@param type $sql
@param null|mixed $params
@return type | [
"Get",
"a",
"single",
"row",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Database/Socket/LaravelSocket.php#L72-L75 |
227,174 | javanile/moldable | src/Database/Socket/LaravelSocket.php | LaravelSocket.getResults | public function getResults($sql, $params = null)
{
return $this->_socket->getResults($sql, $params = null);
} | php | public function getResults($sql, $params = null)
{
return $this->_socket->getResults($sql, $params = null);
} | [
"public",
"function",
"getResults",
"(",
"$",
"sql",
",",
"$",
"params",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_socket",
"->",
"getResults",
"(",
"$",
"sql",
",",
"$",
"params",
"=",
"null",
")",
";",
"}"
] | Get list of records.
@param type $sql
@param null|mixed $params
@return type | [
"Get",
"list",
"of",
"records",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Database/Socket/LaravelSocket.php#L85-L88 |
227,175 | secit-pl/schema-org | SchemaOrg.php | SchemaOrg.toJsonLd | public function toJsonLd(Type\TypeInterface $thing, $addScriptTag = true)
{
$return = json_encode($this->toJsonLdDataArray($thing));
if ($addScriptTag) {
return '<script type="application/ld+json">'.$return.'</script>';
}
return $return;
} | php | public function toJsonLd(Type\TypeInterface $thing, $addScriptTag = true)
{
$return = json_encode($this->toJsonLdDataArray($thing));
if ($addScriptTag) {
return '<script type="application/ld+json">'.$return.'</script>';
}
return $return;
} | [
"public",
"function",
"toJsonLd",
"(",
"Type",
"\\",
"TypeInterface",
"$",
"thing",
",",
"$",
"addScriptTag",
"=",
"true",
")",
"{",
"$",
"return",
"=",
"json_encode",
"(",
"$",
"this",
"->",
"toJsonLdDataArray",
"(",
"$",
"thing",
")",
")",
";",
"if",
... | Convert schema.rg type to the json-ld string.
@param Type\TypeInterface $thing
@param bool $addScriptTag Wrap returned json-ld with the <script type="application/ld+json"></script> tag
@return string | [
"Convert",
"schema",
".",
"rg",
"type",
"to",
"the",
"json",
"-",
"ld",
"string",
"."
] | 5d1656153b5eebf7227cc72dd77562e288157346 | https://github.com/secit-pl/schema-org/blob/5d1656153b5eebf7227cc72dd77562e288157346/SchemaOrg.php#L24-L32 |
227,176 | secit-pl/schema-org | SchemaOrg.php | SchemaOrg.typeToJsonLd | protected function typeToJsonLd(Type\TypeInterface $type)
{
$typeName = (new \ReflectionClass($type))->getShortName();
if (strlen($typeName) > 4 && substr($typeName, -4) === 'Type') {
$typeName = substr($typeName, 0, -4);
}
$jsonLd = [
'@type' => $typeName,
... | php | protected function typeToJsonLd(Type\TypeInterface $type)
{
$typeName = (new \ReflectionClass($type))->getShortName();
if (strlen($typeName) > 4 && substr($typeName, -4) === 'Type') {
$typeName = substr($typeName, 0, -4);
}
$jsonLd = [
'@type' => $typeName,
... | [
"protected",
"function",
"typeToJsonLd",
"(",
"Type",
"\\",
"TypeInterface",
"$",
"type",
")",
"{",
"$",
"typeName",
"=",
"(",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"type",
")",
")",
"->",
"getShortName",
"(",
")",
";",
"if",
"(",
"strlen",
"(",
"$... | Convert type to json-ld data array.
@param Type\TypeInterface $type
@return array | [
"Convert",
"type",
"to",
"json",
"-",
"ld",
"data",
"array",
"."
] | 5d1656153b5eebf7227cc72dd77562e288157346 | https://github.com/secit-pl/schema-org/blob/5d1656153b5eebf7227cc72dd77562e288157346/SchemaOrg.php#L55-L96 |
227,177 | secit-pl/schema-org | SchemaOrg.php | SchemaOrg.valueToJsonLd | protected function valueToJsonLd($value)
{
if (is_array($value)) {
$return = [];
foreach ($value as $item) {
$return[] = $this->valueToJsonLd($item);
}
return $return;
} elseif ($value instanceof Type\EnumerationType || $value instance... | php | protected function valueToJsonLd($value)
{
if (is_array($value)) {
$return = [];
foreach ($value as $item) {
$return[] = $this->valueToJsonLd($item);
}
return $return;
} elseif ($value instanceof Type\EnumerationType || $value instance... | [
"protected",
"function",
"valueToJsonLd",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"item",
")",
"{",
"$",
"return",
"[",
"]",... | Convert value to json-ld format.
@param mixed $value
@return array|string
@throws \Exception | [
"Convert",
"value",
"to",
"json",
"-",
"ld",
"format",
"."
] | 5d1656153b5eebf7227cc72dd77562e288157346 | https://github.com/secit-pl/schema-org/blob/5d1656153b5eebf7227cc72dd77562e288157346/SchemaOrg.php#L131-L151 |
227,178 | BootstrapCMS/Credentials | src/Models/Relations/RevisionableTrait.php | RevisionableTrait.boot | public static function boot()
{
parent::boot();
static::saving(function ($model) {
$model->preSave();
});
static::saved(function ($model) {
$model->postSave();
});
static::deleted(function ($model) {
$model->preSave();
... | php | public static function boot()
{
parent::boot();
static::saving(function ($model) {
$model->preSave();
});
static::saved(function ($model) {
$model->postSave();
});
static::deleted(function ($model) {
$model->preSave();
... | [
"public",
"static",
"function",
"boot",
"(",
")",
"{",
"parent",
"::",
"boot",
"(",
")",
";",
"static",
"::",
"saving",
"(",
"function",
"(",
"$",
"model",
")",
"{",
"$",
"model",
"->",
"preSave",
"(",
")",
";",
"}",
")",
";",
"static",
"::",
"sa... | Create the event listeners for the saving and saved events.
@return void | [
"Create",
"the",
"event",
"listeners",
"for",
"the",
"saving",
"and",
"saved",
"events",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Relations/RevisionableTrait.php#L77-L93 |
227,179 | BootstrapCMS/Credentials | src/Models/Relations/RevisionableTrait.php | RevisionableTrait.preSave | public function preSave()
{
$this->originalData = $this->original;
$this->updatedData = $this->attributes;
// we can only safely compare basic items, so for now we drop any object based
// items apart from DateTime objects where we compare them specially
foreach ($this->upda... | php | public function preSave()
{
$this->originalData = $this->original;
$this->updatedData = $this->attributes;
// we can only safely compare basic items, so for now we drop any object based
// items apart from DateTime objects where we compare them specially
foreach ($this->upda... | [
"public",
"function",
"preSave",
"(",
")",
"{",
"$",
"this",
"->",
"originalData",
"=",
"$",
"this",
"->",
"original",
";",
"$",
"this",
"->",
"updatedData",
"=",
"$",
"this",
"->",
"attributes",
";",
"// we can only safely compare basic items, so for now we drop ... | Do some work before we start the saving process.
@return void | [
"Do",
"some",
"work",
"before",
"we",
"start",
"the",
"saving",
"process",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Relations/RevisionableTrait.php#L110-L141 |
227,180 | BootstrapCMS/Credentials | src/Models/Relations/RevisionableTrait.php | RevisionableTrait.getDataValue | protected function getDataValue($type, $key)
{
if ($key == 'password') {
return;
}
$name = $type.'Data';
return array_get($this->$name, $key);
} | php | protected function getDataValue($type, $key)
{
if ($key == 'password') {
return;
}
$name = $type.'Data';
return array_get($this->$name, $key);
} | [
"protected",
"function",
"getDataValue",
"(",
"$",
"type",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"'password'",
")",
"{",
"return",
";",
"}",
"$",
"name",
"=",
"$",
"type",
".",
"'Data'",
";",
"return",
"array_get",
"(",
"$",
"this... | Get the value to be saved, stripping passwords.
@param string $type
@param string $key
@return string|\DateTime | [
"Get",
"the",
"value",
"to",
"be",
"saved",
"stripping",
"passwords",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Relations/RevisionableTrait.php#L184-L193 |
227,181 | BootstrapCMS/Credentials | src/Models/Relations/RevisionableTrait.php | RevisionableTrait.postDelete | public function postDelete()
{
RevisionRepository::create([
'revisionable_type' => get_class($this),
'revisionable_id' => $this->getKey(),
'key' => 'deleted_at',
'old_value' => null,
'new_value' => new DateTime(),
... | php | public function postDelete()
{
RevisionRepository::create([
'revisionable_type' => get_class($this),
'revisionable_id' => $this->getKey(),
'key' => 'deleted_at',
'old_value' => null,
'new_value' => new DateTime(),
... | [
"public",
"function",
"postDelete",
"(",
")",
"{",
"RevisionRepository",
"::",
"create",
"(",
"[",
"'revisionable_type'",
"=>",
"get_class",
"(",
"$",
"this",
")",
",",
"'revisionable_id'",
"=>",
"$",
"this",
"->",
"getKey",
"(",
")",
",",
"'key'",
"=>",
"... | Store the deleted time.
@return void | [
"Store",
"the",
"deleted",
"time",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Relations/RevisionableTrait.php#L200-L210 |
227,182 | BootstrapCMS/Credentials | src/Models/Relations/RevisionableTrait.php | RevisionableTrait.getUserId | protected function getUserId()
{
if (Credentials::check()) {
return Credentials::getUser()->id;
} elseif (isset($this['user_id']) && $this['user_id']) {
return $this['user_id'];
}
} | php | protected function getUserId()
{
if (Credentials::check()) {
return Credentials::getUser()->id;
} elseif (isset($this['user_id']) && $this['user_id']) {
return $this['user_id'];
}
} | [
"protected",
"function",
"getUserId",
"(",
")",
"{",
"if",
"(",
"Credentials",
"::",
"check",
"(",
")",
")",
"{",
"return",
"Credentials",
"::",
"getUser",
"(",
")",
"->",
"id",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"this",
"[",
"'user_id'",
"]... | Attempt to find the user id of the currently logged in user.
@return int|null | [
"Attempt",
"to",
"find",
"the",
"user",
"id",
"of",
"the",
"currently",
"logged",
"in",
"user",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Relations/RevisionableTrait.php#L217-L224 |
227,183 | BootstrapCMS/Credentials | src/Models/Relations/RevisionableTrait.php | RevisionableTrait.changedRevisionableFields | protected function changedRevisionableFields()
{
$changes = [];
foreach ($this->dirtyData as $key => $value) {
// check that the field is revisionable, and the data is dirty enough
if ($this->isRevisionable($key) && !is_array($value)) {
if (is_object($original... | php | protected function changedRevisionableFields()
{
$changes = [];
foreach ($this->dirtyData as $key => $value) {
// check that the field is revisionable, and the data is dirty enough
if ($this->isRevisionable($key) && !is_array($value)) {
if (is_object($original... | [
"protected",
"function",
"changedRevisionableFields",
"(",
")",
"{",
"$",
"changes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"dirtyData",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"// check that the field is revisionable, and the data is dirty... | Get the fields for all of the storable changes that have been made.
@return string[] | [
"Get",
"the",
"fields",
"for",
"all",
"of",
"the",
"storable",
"changes",
"that",
"have",
"been",
"made",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Relations/RevisionableTrait.php#L231-L256 |
227,184 | BootstrapCMS/Credentials | src/Models/Relations/RevisionableTrait.php | RevisionableTrait.isRevisionable | protected function isRevisionable($key)
{
if (isset($this->doKeep) && in_array($key, $this->doKeep)) {
return true;
}
if (isset($this->dontKeep) && in_array($key, $this->dontKeep)) {
return false;
}
return empty($this->doKeep);
} | php | protected function isRevisionable($key)
{
if (isset($this->doKeep) && in_array($key, $this->doKeep)) {
return true;
}
if (isset($this->dontKeep) && in_array($key, $this->dontKeep)) {
return false;
}
return empty($this->doKeep);
} | [
"protected",
"function",
"isRevisionable",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"doKeep",
")",
"&&",
"in_array",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"doKeep",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
... | Check if this field should have a revision kept.
If we are not tracking updates that null the field, and the update nulls
the field, then return false. If the field is explicitly revisionable,
then return true. If it's explicitly not revisionable, return false.
Otherwise, if neither condition is met, only return true... | [
"Check",
"if",
"this",
"field",
"should",
"have",
"a",
"revision",
"kept",
"."
] | 128c5359eea7417ca95670933a28d4e6c7e01e6b | https://github.com/BootstrapCMS/Credentials/blob/128c5359eea7417ca95670933a28d4e6c7e01e6b/src/Models/Relations/RevisionableTrait.php#L271-L282 |
227,185 | amphp/uri | src/Uri.php | Uri.normalize | public function normalize(): string {
if (!$this->uri) {
return '';
}
$path = $this->path ?: '/';
$path = $this->removeDotSegments($path);
$path = $this->decodeUnreservedCharacters($path);
$path = $this->decodeReservedSubDelimiters($path);
return $th... | php | public function normalize(): string {
if (!$this->uri) {
return '';
}
$path = $this->path ?: '/';
$path = $this->removeDotSegments($path);
$path = $this->decodeUnreservedCharacters($path);
$path = $this->decodeReservedSubDelimiters($path);
return $th... | [
"public",
"function",
"normalize",
"(",
")",
":",
"string",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"uri",
")",
"{",
"return",
"''",
";",
"}",
"$",
"path",
"=",
"$",
"this",
"->",
"path",
"?",
":",
"'/'",
";",
"$",
"path",
"=",
"$",
"this",
"... | Normalizes the URI for maximal comparison success.
@return string | [
"Normalizes",
"the",
"URI",
"for",
"maximal",
"comparison",
"success",
"."
] | b1b0aa74ba76aad7a75693fdc87e017b0c349316 | https://github.com/amphp/uri/blob/b1b0aa74ba76aad7a75693fdc87e017b0c349316/src/Uri.php#L126-L143 |
227,186 | amphp/uri | src/Uri.php | Uri.getAbsoluteUri | public function getAbsoluteUri() {
return $this->reconstitute(
$this->scheme,
$this->getAuthority(),
$this->path,
$this->query,
$fragment = ''
);
} | php | public function getAbsoluteUri() {
return $this->reconstitute(
$this->scheme,
$this->getAuthority(),
$this->path,
$this->query,
$fragment = ''
);
} | [
"public",
"function",
"getAbsoluteUri",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"reconstitute",
"(",
"$",
"this",
"->",
"scheme",
",",
"$",
"this",
"->",
"getAuthority",
"(",
")",
",",
"$",
"this",
"->",
"path",
",",
"$",
"this",
"->",
"query",
"... | Retrieve the URI without the fragment component. | [
"Retrieve",
"the",
"URI",
"without",
"the",
"fragment",
"component",
"."
] | b1b0aa74ba76aad7a75693fdc87e017b0c349316 | https://github.com/amphp/uri/blob/b1b0aa74ba76aad7a75693fdc87e017b0c349316/src/Uri.php#L363-L371 |
227,187 | amphp/uri | src/Uri.php | Uri.isValid | public static function isValid(string $uri): bool {
try {
new self($uri);
} catch (InvalidUriException $e) {
return false;
}
return true;
} | php | public static function isValid(string $uri): bool {
try {
new self($uri);
} catch (InvalidUriException $e) {
return false;
}
return true;
} | [
"public",
"static",
"function",
"isValid",
"(",
"string",
"$",
"uri",
")",
":",
"bool",
"{",
"try",
"{",
"new",
"self",
"(",
"$",
"uri",
")",
";",
"}",
"catch",
"(",
"InvalidUriException",
"$",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return",
... | Test whether the specified string is a valid URI.
@param string $uri
@return bool | [
"Test",
"whether",
"the",
"specified",
"string",
"is",
"a",
"valid",
"URI",
"."
] | b1b0aa74ba76aad7a75693fdc87e017b0c349316 | https://github.com/amphp/uri/blob/b1b0aa74ba76aad7a75693fdc87e017b0c349316/src/Uri.php#L474-L482 |
227,188 | ARCANEDEV/LaravelAuth | database/migrations/2015_01_01_000001_create_auth_users_table.php | CreateAuthUsersTable.addCredentialsColumns | private function addCredentialsColumns(Blueprint $table)
{
if (SocialAuthenticator::isEnabled()) {
$table->string('password')->nullable();
// Social network columns
$table->string('social_provider')->nullable();
$table->string('social_provider_id')->unique()->... | php | private function addCredentialsColumns(Blueprint $table)
{
if (SocialAuthenticator::isEnabled()) {
$table->string('password')->nullable();
// Social network columns
$table->string('social_provider')->nullable();
$table->string('social_provider_id')->unique()->... | [
"private",
"function",
"addCredentialsColumns",
"(",
"Blueprint",
"$",
"table",
")",
"{",
"if",
"(",
"SocialAuthenticator",
"::",
"isEnabled",
"(",
")",
")",
"{",
"$",
"table",
"->",
"string",
"(",
"'password'",
")",
"->",
"nullable",
"(",
")",
";",
"// So... | Add credentials columns.
@param \Illuminate\Database\Schema\Blueprint $table | [
"Add",
"credentials",
"columns",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/database/migrations/2015_01_01_000001_create_auth_users_table.php#L68-L79 |
227,189 | javanile/moldable | src/Database/FieldApi.php | FieldApi.getPrimaryKeyOrMainField | public function getPrimaryKeyOrMainField($model)
{
$key = $this->getPrimaryKey($model);
return $key ? $key : $this->getMainField($model);
} | php | public function getPrimaryKeyOrMainField($model)
{
$key = $this->getPrimaryKey($model);
return $key ? $key : $this->getMainField($model);
} | [
"public",
"function",
"getPrimaryKeyOrMainField",
"(",
"$",
"model",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
"$",
"model",
")",
";",
"return",
"$",
"key",
"?",
"$",
"key",
":",
"$",
"this",
"->",
"getMainField",
"(",
"$",
... | Get primary key or main field.
@param mixed $model | [
"Get",
"primary",
"key",
"or",
"main",
"field",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Database/FieldApi.php#L39-L44 |
227,190 | javanile/moldable | src/Database/FieldApi.php | FieldApi.getMainField | public function getMainField($model)
{
// describe the model
$desc = $this->desc($model);
// search by fields for primary key
foreach (array_keys($desc[$model]) as $field) {
return $field;
}
} | php | public function getMainField($model)
{
// describe the model
$desc = $this->desc($model);
// search by fields for primary key
foreach (array_keys($desc[$model]) as $field) {
return $field;
}
} | [
"public",
"function",
"getMainField",
"(",
"$",
"model",
")",
"{",
"// describe the model",
"$",
"desc",
"=",
"$",
"this",
"->",
"desc",
"(",
"$",
"model",
")",
";",
"// search by fields for primary key",
"foreach",
"(",
"array_keys",
"(",
"$",
"desc",
"[",
... | Get the main field.
@param mixed $model | [
"Get",
"the",
"main",
"field",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Database/FieldApi.php#L51-L60 |
227,191 | ARCANEDEV/LaravelAuth | src/Models/Traits/Roleable.php | Roleable.isAll | public function isAll($roles, &$failed = null)
{
$this->isOne($roles, $failed);
return $failed->isEmpty();
} | php | public function isAll($roles, &$failed = null)
{
$this->isOne($roles, $failed);
return $failed->isEmpty();
} | [
"public",
"function",
"isAll",
"(",
"$",
"roles",
",",
"&",
"$",
"failed",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"isOne",
"(",
"$",
"roles",
",",
"$",
"failed",
")",
";",
"return",
"$",
"failed",
"->",
"isEmpty",
"(",
")",
";",
"}"
] | Check if has all roles.
@param \Illuminate\Support\Collection|array $roles
@param \Illuminate\Support\Collection &$failed
@return bool | [
"Check",
"if",
"has",
"all",
"roles",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/Traits/Roleable.php#L63-L68 |
227,192 | ARCANEDEV/LaravelAuth | src/Models/Traits/Roleable.php | Roleable.isOne | public function isOne($roles, &$failed = null)
{
$roles = is_array($roles) ? collect($roles) : $roles;
$failed = $roles->reject(function ($role) {
return $this->hasRoleSlug($role);
})->values();
return $roles->count() !== $failed->count();
} | php | public function isOne($roles, &$failed = null)
{
$roles = is_array($roles) ? collect($roles) : $roles;
$failed = $roles->reject(function ($role) {
return $this->hasRoleSlug($role);
})->values();
return $roles->count() !== $failed->count();
} | [
"public",
"function",
"isOne",
"(",
"$",
"roles",
",",
"&",
"$",
"failed",
"=",
"null",
")",
"{",
"$",
"roles",
"=",
"is_array",
"(",
"$",
"roles",
")",
"?",
"collect",
"(",
"$",
"roles",
")",
":",
"$",
"roles",
";",
"$",
"failed",
"=",
"$",
"r... | Check if has at least one role.
@param \Illuminate\Support\Collection|array $roles
@param \Illuminate\Support\Collection &$failed
@return bool | [
"Check",
"if",
"has",
"at",
"least",
"one",
"role",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/Traits/Roleable.php#L78-L87 |
227,193 | ARCANEDEV/LaravelAuth | src/Models/Traits/Roleable.php | Roleable.hasRoleSlug | public function hasRoleSlug($slug)
{
$roles = $this->active_roles->filter(function (Role $role) use ($slug) {
return $role->hasSlug($slug);
});
return ! $roles->isEmpty();
} | php | public function hasRoleSlug($slug)
{
$roles = $this->active_roles->filter(function (Role $role) use ($slug) {
return $role->hasSlug($slug);
});
return ! $roles->isEmpty();
} | [
"public",
"function",
"hasRoleSlug",
"(",
"$",
"slug",
")",
"{",
"$",
"roles",
"=",
"$",
"this",
"->",
"active_roles",
"->",
"filter",
"(",
"function",
"(",
"Role",
"$",
"role",
")",
"use",
"(",
"$",
"slug",
")",
"{",
"return",
"$",
"role",
"->",
"... | Check if has a role by its slug.
@param string $slug
@return bool | [
"Check",
"if",
"has",
"a",
"role",
"by",
"its",
"slug",
"."
] | a2719e924c2299f931879139c6cd97642e80acc7 | https://github.com/ARCANEDEV/LaravelAuth/blob/a2719e924c2299f931879139c6cd97642e80acc7/src/Models/Traits/Roleable.php#L96-L103 |
227,194 | javanile/moldable | src/Model/DeleteApi.php | DeleteApi.delete | public static function delete($query)
{
static::applySchema();
$key = static::getPrimaryKeyOrMainField();
if ($key && !is_array($query)) {
$query = [$key => $query];
}
$whereArray = [];
if (isset($query['where'])) {
$whereArray[] = $query['w... | php | public static function delete($query)
{
static::applySchema();
$key = static::getPrimaryKeyOrMainField();
if ($key && !is_array($query)) {
$query = [$key => $query];
}
$whereArray = [];
if (isset($query['where'])) {
$whereArray[] = $query['w... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"query",
")",
"{",
"static",
"::",
"applySchema",
"(",
")",
";",
"$",
"key",
"=",
"static",
"::",
"getPrimaryKeyOrMainField",
"(",
")",
";",
"if",
"(",
"$",
"key",
"&&",
"!",
"is_array",
"(",
"$",
"... | Delete element by primary key or query.
@param type $query | [
"Delete",
"element",
"by",
"primary",
"key",
"or",
"query",
"."
] | 463ec60ba1fc00ffac39416302103af47aae42fb | https://github.com/javanile/moldable/blob/463ec60ba1fc00ffac39416302103af47aae42fb/src/Model/DeleteApi.php#L19-L51 |
227,195 | OpenSkill/Datatable | src/OpenSkill/Datatable/Composers/ColumnComposer.php | ColumnComposer.column | public function column($name, $callable = null, Searchable $searchable = null, Orderable $orderable = null)
{
/**
* @var ColumnConfigurationBuilder
*/
$config = ColumnConfigurationBuilder::create();
if (is_string($name)) {
$config->name($name);
} else {... | php | public function column($name, $callable = null, Searchable $searchable = null, Orderable $orderable = null)
{
/**
* @var ColumnConfigurationBuilder
*/
$config = ColumnConfigurationBuilder::create();
if (is_string($name)) {
$config->name($name);
} else {... | [
"public",
"function",
"column",
"(",
"$",
"name",
",",
"$",
"callable",
"=",
"null",
",",
"Searchable",
"$",
"searchable",
"=",
"null",
",",
"Orderable",
"$",
"orderable",
"=",
"null",
")",
"{",
"/**\n * @var ColumnConfigurationBuilder\n */",
"$",
... | Will create a new ColumnConfiguration with all defaults but allows overriding of all properties through the method.
@param string $name The name of the configuration, required for the configuration
@param string|callable $callable The function to execute, defaults to null which means the default will be set.
@param Se... | [
"Will",
"create",
"a",
"new",
"ColumnConfiguration",
"with",
"all",
"defaults",
"but",
"allows",
"overriding",
"of",
"all",
"properties",
"through",
"the",
"method",
"."
] | e9814345dca4d0427da512f17c24117797e6ffbb | https://github.com/OpenSkill/Datatable/blob/e9814345dca4d0427da512f17c24117797e6ffbb/src/OpenSkill/Datatable/Composers/ColumnComposer.php#L96-L123 |
227,196 | moust/silex-cache-service-provider | src/Moust/Silex/Cache/RedisCache.php | RedisCache.setRedis | public function setRedis(\Redis $redis)
{
$redis->setOption(Redis::OPT_SERIALIZER, $this->getSerializerValue());
$this->_redis = $redis;
} | php | public function setRedis(\Redis $redis)
{
$redis->setOption(Redis::OPT_SERIALIZER, $this->getSerializerValue());
$this->_redis = $redis;
} | [
"public",
"function",
"setRedis",
"(",
"\\",
"Redis",
"$",
"redis",
")",
"{",
"$",
"redis",
"->",
"setOption",
"(",
"Redis",
"::",
"OPT_SERIALIZER",
",",
"$",
"this",
"->",
"getSerializerValue",
"(",
")",
")",
";",
"$",
"this",
"->",
"_redis",
"=",
"$"... | Sets the Redis instance to use.
@param Redis $redis | [
"Sets",
"the",
"Redis",
"instance",
"to",
"use",
"."
] | b3ca953def0f95676eec6a47573a3da168486b37 | https://github.com/moust/silex-cache-service-provider/blob/b3ca953def0f95676eec6a47573a3da168486b37/src/Moust/Silex/Cache/RedisCache.php#L45-L49 |
227,197 | secit-pl/schema-org | SchemaOrg/Generator.php | Generator.generatePropertyInterface | public function generatePropertyInterface()
{
$interface = new PhpInterface($this->propertyInterfaceName);
$interface
->setQualifiedName('SecIT\\SchemaOrg\\Mapping\\Property\\'.$this->propertyInterfaceName)
->setDescription('Interface '.$this->propertyInterfaceName.'.')
... | php | public function generatePropertyInterface()
{
$interface = new PhpInterface($this->propertyInterfaceName);
$interface
->setQualifiedName('SecIT\\SchemaOrg\\Mapping\\Property\\'.$this->propertyInterfaceName)
->setDescription('Interface '.$this->propertyInterfaceName.'.')
... | [
"public",
"function",
"generatePropertyInterface",
"(",
")",
"{",
"$",
"interface",
"=",
"new",
"PhpInterface",
"(",
"$",
"this",
"->",
"propertyInterfaceName",
")",
";",
"$",
"interface",
"->",
"setQualifiedName",
"(",
"'SecIT\\\\SchemaOrg\\\\Mapping\\\\Property\\\\'",... | Generate property interface. | [
"Generate",
"property",
"interface",
"."
] | 5d1656153b5eebf7227cc72dd77562e288157346 | https://github.com/secit-pl/schema-org/blob/5d1656153b5eebf7227cc72dd77562e288157346/SchemaOrg/Generator.php#L154-L182 |
227,198 | secit-pl/schema-org | SchemaOrg/Generator.php | Generator.generateTypeInterface | public function generateTypeInterface()
{
$interface = new PhpInterface($this->typeInterfaceName);
$interface
->setQualifiedName('SecIT\\SchemaOrg\\Mapping\\Type\\'.$this->typeInterfaceName)
->setDescription('Interface '.$this->typeInterfaceName.'.')
->setMethod(P... | php | public function generateTypeInterface()
{
$interface = new PhpInterface($this->typeInterfaceName);
$interface
->setQualifiedName('SecIT\\SchemaOrg\\Mapping\\Type\\'.$this->typeInterfaceName)
->setDescription('Interface '.$this->typeInterfaceName.'.')
->setMethod(P... | [
"public",
"function",
"generateTypeInterface",
"(",
")",
"{",
"$",
"interface",
"=",
"new",
"PhpInterface",
"(",
"$",
"this",
"->",
"typeInterfaceName",
")",
";",
"$",
"interface",
"->",
"setQualifiedName",
"(",
"'SecIT\\\\SchemaOrg\\\\Mapping\\\\Type\\\\'",
".",
"$... | Generate type interface. | [
"Generate",
"type",
"interface",
"."
] | 5d1656153b5eebf7227cc72dd77562e288157346 | https://github.com/secit-pl/schema-org/blob/5d1656153b5eebf7227cc72dd77562e288157346/SchemaOrg/Generator.php#L187-L208 |
227,199 | secit-pl/schema-org | SchemaOrg/Generator.php | Generator.generateDataTypes | protected function generateDataTypes(array $schema)
{
$directory = $this->getMappingDirectory('DataType');
foreach ($schema['datatypes'] as $dataType => $data) {
$this->generateDataType($dataType, $data, $directory);
}
} | php | protected function generateDataTypes(array $schema)
{
$directory = $this->getMappingDirectory('DataType');
foreach ($schema['datatypes'] as $dataType => $data) {
$this->generateDataType($dataType, $data, $directory);
}
} | [
"protected",
"function",
"generateDataTypes",
"(",
"array",
"$",
"schema",
")",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"getMappingDirectory",
"(",
"'DataType'",
")",
";",
"foreach",
"(",
"$",
"schema",
"[",
"'datatypes'",
"]",
"as",
"$",
"dataType",
... | Generate data types.
@param array $schema | [
"Generate",
"data",
"types",
"."
] | 5d1656153b5eebf7227cc72dd77562e288157346 | https://github.com/secit-pl/schema-org/blob/5d1656153b5eebf7227cc72dd77562e288157346/SchemaOrg/Generator.php#L227-L233 |
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.