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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
224,700 | acacha/users | src/Observers/UserObserver.php | UserObserver.deleted | public function deleted(User $user)
{
\DB::table((new Revision())->getTable())->insert([
[
'revisionable_type' => $user->getMorphClass(),
'revisionable_id' => $user->id,
'key' => 'deleted_at',
'old_value' => $user,
'... | php | public function deleted(User $user)
{
\DB::table((new Revision())->getTable())->insert([
[
'revisionable_type' => $user->getMorphClass(),
'revisionable_id' => $user->id,
'key' => 'deleted_at',
'old_value' => $user,
'... | [
"public",
"function",
"deleted",
"(",
"User",
"$",
"user",
")",
"{",
"\\",
"DB",
"::",
"table",
"(",
"(",
"new",
"Revision",
"(",
")",
")",
"->",
"getTable",
"(",
")",
")",
"->",
"insert",
"(",
"[",
"[",
"'revisionable_type'",
"=>",
"$",
"user",
"-... | Listen to the User deleted event. | [
"Listen",
"to",
"the",
"User",
"deleted",
"event",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Observers/UserObserver.php#L28-L42 |
224,701 | atorscho/membership | src/Handlable.php | Handlable.bootHandlable | protected static function bootHandlable()
{
static::creating(function ($model) {
if (!$model->handle) {
$model->handle = '';
}
});
static::updating(function ($model) {
if (!$model->handle) {
$model->handle = '';
... | php | protected static function bootHandlable()
{
static::creating(function ($model) {
if (!$model->handle) {
$model->handle = '';
}
});
static::updating(function ($model) {
if (!$model->handle) {
$model->handle = '';
... | [
"protected",
"static",
"function",
"bootHandlable",
"(",
")",
"{",
"static",
"::",
"creating",
"(",
"function",
"(",
"$",
"model",
")",
"{",
"if",
"(",
"!",
"$",
"model",
"->",
"handle",
")",
"{",
"$",
"model",
"->",
"handle",
"=",
"''",
";",
"}",
... | Set the handle if missing. | [
"Set",
"the",
"handle",
"if",
"missing",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Handlable.php#L19-L32 |
224,702 | atorscho/membership | src/Handlable.php | Handlable.setHandleAttribute | public function setHandleAttribute(?string $handle): void
{
$this->attributes['handle'] = str_slug($handle ?: $this->name);
} | php | public function setHandleAttribute(?string $handle): void
{
$this->attributes['handle'] = str_slug($handle ?: $this->name);
} | [
"public",
"function",
"setHandleAttribute",
"(",
"?",
"string",
"$",
"handle",
")",
":",
"void",
"{",
"$",
"this",
"->",
"attributes",
"[",
"'handle'",
"]",
"=",
"str_slug",
"(",
"$",
"handle",
"?",
":",
"$",
"this",
"->",
"name",
")",
";",
"}"
] | Set model's handle if none was provided. | [
"Set",
"model",
"s",
"handle",
"if",
"none",
"was",
"provided",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Handlable.php#L37-L40 |
224,703 | fojuth/plupload | src/Fojuth/Plupload/TwigExtension.php | TwigExtension.getFunctions | public function getFunctions() {
return [
new Twig_SimpleFunction(
'plupload',
function($view = null, $browse_button = null, $prefix = null, $additional_data = array()){
$view = (true === is_null($view)) ? \Config::get('plupload::plupload.view') :... | php | public function getFunctions() {
return [
new Twig_SimpleFunction(
'plupload',
function($view = null, $browse_button = null, $prefix = null, $additional_data = array()){
$view = (true === is_null($view)) ? \Config::get('plupload::plupload.view') :... | [
"public",
"function",
"getFunctions",
"(",
")",
"{",
"return",
"[",
"new",
"Twig_SimpleFunction",
"(",
"'plupload'",
",",
"function",
"(",
"$",
"view",
"=",
"null",
",",
"$",
"browse_button",
"=",
"null",
",",
"$",
"prefix",
"=",
"null",
",",
"$",
"addit... | Registers the Twig functions. | [
"Registers",
"the",
"Twig",
"functions",
"."
] | 9d27e62516761352863cd08b7a2342326d69dd5c | https://github.com/fojuth/plupload/blob/9d27e62516761352863cd08b7a2342326d69dd5c/src/Fojuth/Plupload/TwigExtension.php#L22-L43 |
224,704 | JeroenBoersma/php-normalize | src/Normalize.php | Normalize.normalize | public function normalize(string $string) : string
{
if (isset($this->cache[$string])) {
return $this->cache[$string];
}
$result = $this->normalizeChain($string);
$toCache = array_map(function(RuleInterface $rule) use (&$result) {
return $result = $rule->app... | php | public function normalize(string $string) : string
{
if (isset($this->cache[$string])) {
return $this->cache[$string];
}
$result = $this->normalizeChain($string);
$toCache = array_map(function(RuleInterface $rule) use (&$result) {
return $result = $rule->app... | [
"public",
"function",
"normalize",
"(",
"string",
"$",
"string",
")",
":",
"string",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"string",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
"[",
"$",
"string",
"]",
... | Return normalized string
@param string $string
@return string | [
"Return",
"normalized",
"string"
] | 254fdcc50bfd8cbf3eba8dae93439c07e28e0396 | https://github.com/JeroenBoersma/php-normalize/blob/254fdcc50bfd8cbf3eba8dae93439c07e28e0396/src/Normalize.php#L47-L66 |
224,705 | JeroenBoersma/php-normalize | src/Normalize.php | Normalize.normalizeChain | protected function normalizeChain(string $string): string
{
if (null === $this->chain) {
return $string;
}
return $this->chain
->normalize($string);
} | php | protected function normalizeChain(string $string): string
{
if (null === $this->chain) {
return $string;
}
return $this->chain
->normalize($string);
} | [
"protected",
"function",
"normalizeChain",
"(",
"string",
"$",
"string",
")",
":",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"chain",
")",
"{",
"return",
"$",
"string",
";",
"}",
"return",
"$",
"this",
"->",
"chain",
"->",
"normalize"... | Normalize parent if exists
@param string $string
@return string | [
"Normalize",
"parent",
"if",
"exists"
] | 254fdcc50bfd8cbf3eba8dae93439c07e28e0396 | https://github.com/JeroenBoersma/php-normalize/blob/254fdcc50bfd8cbf3eba8dae93439c07e28e0396/src/Normalize.php#L74-L82 |
224,706 | acacha/users | src/Http/Controllers/RevisionableController.php | RevisionableController.trackModel | public function trackModel(TrackModelRequest $request)
{
$model = $request->input('model');
$revisions = Revision::where(['revisionable_type' => $model])
->orderBy('created_at','desv')->get();
$result = [];
$lastDate = '';
foreach ($revisions as $revision) {
... | php | public function trackModel(TrackModelRequest $request)
{
$model = $request->input('model');
$revisions = Revision::where(['revisionable_type' => $model])
->orderBy('created_at','desv')->get();
$result = [];
$lastDate = '';
foreach ($revisions as $revision) {
... | [
"public",
"function",
"trackModel",
"(",
"TrackModelRequest",
"$",
"request",
")",
"{",
"$",
"model",
"=",
"$",
"request",
"->",
"input",
"(",
"'model'",
")",
";",
"$",
"revisions",
"=",
"Revision",
"::",
"where",
"(",
"[",
"'revisionable_type'",
"=>",
"$"... | Obtain tracking info for a Model.
@param TrackModelRequest $request
@return array | [
"Obtain",
"tracking",
"info",
"for",
"a",
"Model",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/RevisionableController.php#L22-L51 |
224,707 | acacha/users | src/Http/Controllers/RevisionableController.php | RevisionableController.getMessage | private function getMessage($revision)
{
switch ($revision->key) {
case 'created_at':
return $this->getResponsibleInfo($revision) . ' created user '
. $this->getAffectedResourceName($revision) . ' (' . $revision->revisionable_id . ')';
case 'delete... | php | private function getMessage($revision)
{
switch ($revision->key) {
case 'created_at':
return $this->getResponsibleInfo($revision) . ' created user '
. $this->getAffectedResourceName($revision) . ' (' . $revision->revisionable_id . ')';
case 'delete... | [
"private",
"function",
"getMessage",
"(",
"$",
"revision",
")",
"{",
"switch",
"(",
"$",
"revision",
"->",
"key",
")",
"{",
"case",
"'created_at'",
":",
"return",
"$",
"this",
"->",
"getResponsibleInfo",
"(",
"$",
"revision",
")",
".",
"' created user '",
... | Get icon background.
@param $revision
@return string | [
"Get",
"icon",
"background",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/RevisionableController.php#L59-L74 |
224,708 | acacha/users | src/Http/Controllers/RevisionableController.php | RevisionableController.getResponsibleInfo | private function getResponsibleInfo($revision)
{
$username = $this->getResponsibleUsername($revision);
return '<span title="'. $username . ' (' . $revision->user_id . ')' . '" class="responsibleUser"
model="' . $revision->revisionable_type . '">' . $username . '</span>';
} | php | private function getResponsibleInfo($revision)
{
$username = $this->getResponsibleUsername($revision);
return '<span title="'. $username . ' (' . $revision->user_id . ')' . '" class="responsibleUser"
model="' . $revision->revisionable_type . '">' . $username . '</span>';
} | [
"private",
"function",
"getResponsibleInfo",
"(",
"$",
"revision",
")",
"{",
"$",
"username",
"=",
"$",
"this",
"->",
"getResponsibleUsername",
"(",
"$",
"revision",
")",
";",
"return",
"'<span title=\"'",
".",
"$",
"username",
".",
"' ('",
".",
"$",
"revisi... | Get responsible info.
@param $revision
@return string | [
"Get",
"responsible",
"info",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/RevisionableController.php#L82-L87 |
224,709 | acacha/users | src/Http/Controllers/RevisionableController.php | RevisionableController.getAffectedResourceName | private function getAffectedResourceName($revision)
{
if ($revision->historyOf()) {
return $revision->historyOf()->name;
}
if ($revision->key == 'deleted_at') {
$oldUser = json_decode($revision->old_value);
if($oldUser) {
return $oldUser->n... | php | private function getAffectedResourceName($revision)
{
if ($revision->historyOf()) {
return $revision->historyOf()->name;
}
if ($revision->key == 'deleted_at') {
$oldUser = json_decode($revision->old_value);
if($oldUser) {
return $oldUser->n... | [
"private",
"function",
"getAffectedResourceName",
"(",
"$",
"revision",
")",
"{",
"if",
"(",
"$",
"revision",
"->",
"historyOf",
"(",
")",
")",
"{",
"return",
"$",
"revision",
"->",
"historyOf",
"(",
")",
"->",
"name",
";",
"}",
"if",
"(",
"$",
"revisi... | Get affected resource name.
@param $revision
@return string | [
"Get",
"affected",
"resource",
"name",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/RevisionableController.php#L109-L121 |
224,710 | burnbright/silverstripe-importexport | code/CSVPreviewer.php | CSVPreviewer.loadCSV | public function loadCSV()
{
$parser = new CSVParser($this->file);
$count = 0;
foreach ($parser as $row) {
$this->rows[]= $row;
$count++;
if ($count == $this->previewcount) {
break;
}
}
$firstrow = array_keys($thi... | php | public function loadCSV()
{
$parser = new CSVParser($this->file);
$count = 0;
foreach ($parser as $row) {
$this->rows[]= $row;
$count++;
if ($count == $this->previewcount) {
break;
}
}
$firstrow = array_keys($thi... | [
"public",
"function",
"loadCSV",
"(",
")",
"{",
"$",
"parser",
"=",
"new",
"CSVParser",
"(",
"$",
"this",
"->",
"file",
")",
";",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"parser",
"as",
"$",
"row",
")",
"{",
"$",
"this",
"->",
"rows",
... | Extract preview of CSV from file | [
"Extract",
"preview",
"of",
"CSV",
"from",
"file"
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/CSVPreviewer.php#L34-L53 |
224,711 | burnbright/silverstripe-importexport | code/CSVPreviewer.php | CSVPreviewer.getHeadings | public function getHeadings()
{
if (!$this->headings) {
return;
}
$out = new ArrayList();
foreach ($this->headings as $heading) {
$out->push(
new ArrayData(array(
"Label" => $heading
))
);
... | php | public function getHeadings()
{
if (!$this->headings) {
return;
}
$out = new ArrayList();
foreach ($this->headings as $heading) {
$out->push(
new ArrayData(array(
"Label" => $heading
))
);
... | [
"public",
"function",
"getHeadings",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"headings",
")",
"{",
"return",
";",
"}",
"$",
"out",
"=",
"new",
"ArrayList",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"headings",
"as",
"$",
"heading"... | Get the CSV headings for use in template
@return ArrayList | [
"Get",
"the",
"CSV",
"headings",
"for",
"use",
"in",
"template"
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/CSVPreviewer.php#L71-L85 |
224,712 | acacha/users | src/Services/GoogleApps/GoogleAppsService.php | GoogleAppsService.getConnectionState | public function getConnectionState()
{
$directory = Google::make('directory');
try {
$r = $directory->users->get($email = config('users.google_apps_user_email_to_check_connection'));
if($r) {
$state = 'connected';
} else {
echo 'Us... | php | public function getConnectionState()
{
$directory = Google::make('directory');
try {
$r = $directory->users->get($email = config('users.google_apps_user_email_to_check_connection'));
if($r) {
$state = 'connected';
} else {
echo 'Us... | [
"public",
"function",
"getConnectionState",
"(",
")",
"{",
"$",
"directory",
"=",
"Google",
"::",
"make",
"(",
"'directory'",
")",
";",
"try",
"{",
"$",
"r",
"=",
"$",
"directory",
"->",
"users",
"->",
"get",
"(",
"$",
"email",
"=",
"config",
"(",
"'... | Get connection state.
@return string | [
"Get",
"connection",
"state",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Services/GoogleApps/GoogleAppsService.php#L22-L45 |
224,713 | acacha/users | src/Services/GoogleApps/GoogleAppsService.php | GoogleAppsService.allUsers | protected function allUsers()
{
$directory = Google::make('directory');
$pageToken = null;
$users = [];
do {
try {
$r = $directory->users->listUsers([
'domain' => config('users.google_apps_domain'),
'maxResults' => c... | php | protected function allUsers()
{
$directory = Google::make('directory');
$pageToken = null;
$users = [];
do {
try {
$r = $directory->users->listUsers([
'domain' => config('users.google_apps_domain'),
'maxResults' => c... | [
"protected",
"function",
"allUsers",
"(",
")",
"{",
"$",
"directory",
"=",
"Google",
"::",
"make",
"(",
"'directory'",
")",
";",
"$",
"pageToken",
"=",
"null",
";",
"$",
"users",
"=",
"[",
"]",
";",
"do",
"{",
"try",
"{",
"$",
"r",
"=",
"$",
"dir... | Get all users from google apps.
@return array|mixed | [
"Get",
"all",
"users",
"from",
"google",
"apps",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Services/GoogleApps/GoogleAppsService.php#L60-L79 |
224,714 | acacha/users | src/Services/GoogleApps/GoogleAppsService.php | GoogleAppsService.localSync | public function localSync()
{
$users = Cache::rememberForever('google_app_users', function () {
return $this->allUsers();
});
try {
foreach ($users as $user) {
$user = GoogleUser::firstOrCreate([
'customerId' => $user->customerId,
... | php | public function localSync()
{
$users = Cache::rememberForever('google_app_users', function () {
return $this->allUsers();
});
try {
foreach ($users as $user) {
$user = GoogleUser::firstOrCreate([
'customerId' => $user->customerId,
... | [
"public",
"function",
"localSync",
"(",
")",
"{",
"$",
"users",
"=",
"Cache",
"::",
"rememberForever",
"(",
"'google_app_users'",
",",
"function",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"allUsers",
"(",
")",
";",
"}",
")",
";",
"try",
"{",
"foreac... | Sync local database with remote Google apps info. | [
"Sync",
"local",
"database",
"with",
"remote",
"Google",
"apps",
"info",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Services/GoogleApps/GoogleAppsService.php#L84-L127 |
224,715 | acacha/users | src/Services/GoogleApps/GoogleAppsService.php | GoogleAppsService.getUsers | public function getUsers($perPage = 15)
{
$directory = Google::make('directory');
try {
$r = $directory->users->listUsers([
'domain' => config('users.google_apps_domain'),
'maxResults' => $perPage
]);
} catch (\Exception $e) {
... | php | public function getUsers($perPage = 15)
{
$directory = Google::make('directory');
try {
$r = $directory->users->listUsers([
'domain' => config('users.google_apps_domain'),
'maxResults' => $perPage
]);
} catch (\Exception $e) {
... | [
"public",
"function",
"getUsers",
"(",
"$",
"perPage",
"=",
"15",
")",
"{",
"$",
"directory",
"=",
"Google",
"::",
"make",
"(",
"'directory'",
")",
";",
"try",
"{",
"$",
"r",
"=",
"$",
"directory",
"->",
"users",
"->",
"listUsers",
"(",
"[",
"'domain... | Get users.
@param int $perPage
@return int|mixed | [
"Get",
"users",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Services/GoogleApps/GoogleAppsService.php#L135-L148 |
224,716 | joomla-framework/github-api | src/Package/Issues/Comments.php | Comments.getList | public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, \DateTime $since = null)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo . '/issues/' . (int) $issueId . '/comments';
$uri = new Uri($this->fetchUrl($path, $page, $limit));
if ($since)
{
$uri->setVar('since', $... | php | public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, \DateTime $since = null)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo . '/issues/' . (int) $issueId . '/comments';
$uri = new Uri($this->fetchUrl($path, $page, $limit));
if ($since)
{
$uri->setVar('since', $... | [
"public",
"function",
"getList",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"issueId",
",",
"$",
"page",
"=",
"0",
",",
"$",
"limit",
"=",
"0",
",",
"\\",
"DateTime",
"$",
"since",
"=",
"null",
")",
"{",
"// Build the request path.",
"$",
"path",... | List comments on an issue.
@param string $owner The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $issueId The issue number.
@param integer $page The page number from which to get items.
@param integer $limit ... | [
"List",
"comments",
"on",
"an",
"issue",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Issues/Comments.php#L41-L55 |
224,717 | joomla-framework/github-api | src/Package/Gists.php | Gists.create | public function create($files, $public = false, $description = null)
{
// Build the request path.
$path = '/gists';
// Build the request data.
$data = json_encode(
array(
'files' => $this->buildFileData((array) $files),
'public' => (bool) $public,
'description' => $description,
)
... | php | public function create($files, $public = false, $description = null)
{
// Build the request path.
$path = '/gists';
// Build the request data.
$data = json_encode(
array(
'files' => $this->buildFileData((array) $files),
'public' => (bool) $public,
'description' => $description,
)
... | [
"public",
"function",
"create",
"(",
"$",
"files",
",",
"$",
"public",
"=",
"false",
",",
"$",
"description",
"=",
"null",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/gists'",
";",
"// Build the request data.",
"$",
"data",
"=",
"json_encode",... | Create a gist.
@param mixed $files Either an array of file paths or a single file path as a string.
@param boolean $public True if the gist should be public.
@param string $description The optional description of the gist.
@return object
@since 1.0
@throws \DomainException | [
"Create",
"a",
"gist",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Gists.php#L38-L54 |
224,718 | joomla-framework/github-api | src/Package/Gists.php | Gists.edit | public function edit($gistId, $files = null, $public = null, $description = null)
{
// Build the request path.
$path = '/gists/' . (int) $gistId;
// Create the data object.
$data = new \stdClass;
// If a description is set add it to the data object.
if (isset($description))
{
$data->description = $d... | php | public function edit($gistId, $files = null, $public = null, $description = null)
{
// Build the request path.
$path = '/gists/' . (int) $gistId;
// Create the data object.
$data = new \stdClass;
// If a description is set add it to the data object.
if (isset($description))
{
$data->description = $d... | [
"public",
"function",
"edit",
"(",
"$",
"gistId",
",",
"$",
"files",
"=",
"null",
",",
"$",
"public",
"=",
"null",
",",
"$",
"description",
"=",
"null",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/gists/'",
".",
"(",
"int",
")",
"$",
... | Edit a gist.
@param integer $gistId The gist number.
@param mixed $files Either an array of file paths or a single file path as a string.
@param boolean $public True if the gist should be public.
@param string $description The description of the gist.
@return object
@since 1.0
@... | [
"Edit",
"a",
"gist",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Gists.php#L88-L119 |
224,719 | joomla-framework/github-api | src/Package/Gists.php | Gists.fork | public function fork($gistId)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/forks';
// Send the request.
return $this->processResponse($this->client->post($this->fetchUrl($path), ''), 201);
} | php | public function fork($gistId)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/forks';
// Send the request.
return $this->processResponse($this->client->post($this->fetchUrl($path), ''), 201);
} | [
"public",
"function",
"fork",
"(",
"$",
"gistId",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/gists/'",
".",
"(",
"int",
")",
"$",
"gistId",
".",
"'/forks'",
";",
"// Send the request.",
"return",
"$",
"this",
"->",
"processResponse",
"(",
"... | Fork a gist.
@param integer $gistId The gist number.
@return object
@since 1.0
@throws \DomainException | [
"Fork",
"a",
"gist",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Gists.php#L131-L138 |
224,720 | joomla-framework/github-api | src/Package/Gists.php | Gists.getRevision | public function getRevision($gistId, $sha)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/' . $sha;
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path)));
} | php | public function getRevision($gistId, $sha)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/' . $sha;
// Send the request.
return $this->processResponse($this->client->get($this->fetchUrl($path)));
} | [
"public",
"function",
"getRevision",
"(",
"$",
"gistId",
",",
"$",
"sha",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/gists/'",
".",
"(",
"int",
")",
"$",
"gistId",
".",
"'/'",
".",
"$",
"sha",
";",
"// Send the request.",
"return",
"$",
... | Get a specific revision of a gist.
@param integer $gistId The gist number.
@param string $sha The SHA for the revision to get.
@return object
@since 1.4.0
@throws \DomainException | [
"Get",
"a",
"specific",
"revision",
"of",
"a",
"gist",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Gists.php#L314-L321 |
224,721 | joomla-framework/github-api | src/Package/Gists.php | Gists.star | public function star($gistId)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/star';
// Send the request.
$this->processResponse($this->client->put($this->fetchUrl($path), ''), 204);
} | php | public function star($gistId)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/star';
// Send the request.
$this->processResponse($this->client->put($this->fetchUrl($path), ''), 204);
} | [
"public",
"function",
"star",
"(",
"$",
"gistId",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/gists/'",
".",
"(",
"int",
")",
"$",
"gistId",
".",
"'/star'",
";",
"// Send the request.",
"$",
"this",
"->",
"processResponse",
"(",
"$",
"this",... | Star a gist.
@param integer $gistId The gist number.
@return void
@since 1.0
@throws \DomainException | [
"Star",
"a",
"gist",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Gists.php#L369-L376 |
224,722 | joomla-framework/github-api | src/Package/Gists.php | Gists.unstar | public function unstar($gistId)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/star';
// Send the request.
$this->processResponse($this->client->delete($this->fetchUrl($path)), 204);
} | php | public function unstar($gistId)
{
// Build the request path.
$path = '/gists/' . (int) $gistId . '/star';
// Send the request.
$this->processResponse($this->client->delete($this->fetchUrl($path)), 204);
} | [
"public",
"function",
"unstar",
"(",
"$",
"gistId",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/gists/'",
".",
"(",
"int",
")",
"$",
"gistId",
".",
"'/star'",
";",
"// Send the request.",
"$",
"this",
"->",
"processResponse",
"(",
"$",
"this... | Unstar a gist.
@param integer $gistId The gist number.
@return void
@since 1.0
@throws \DomainException | [
"Unstar",
"a",
"gist",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Gists.php#L388-L395 |
224,723 | joomla-framework/github-api | src/Package/Issues/Milestones.php | Milestones.getList | public function getList($user, $repo, $state = 'open', $sort = 'due_date', $direction = 'desc', $page = 0, $limit = 0)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones';
$uri = new Uri($this->fetchUrl($path, $page, $limit));
$uri->setVar('state', $state);
$uri->setVar('sor... | php | public function getList($user, $repo, $state = 'open', $sort = 'due_date', $direction = 'desc', $page = 0, $limit = 0)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones';
$uri = new Uri($this->fetchUrl($path, $page, $limit));
$uri->setVar('state', $state);
$uri->setVar('sor... | [
"public",
"function",
"getList",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"state",
"=",
"'open'",
",",
"$",
"sort",
"=",
"'due_date'",
",",
"$",
"direction",
"=",
"'desc'",
",",
"$",
"page",
"=",
"0",
",",
"$",
"limit",
"=",
"0",
")",
"{",
... | List milestones for a repository.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $state The milestone state to retrieved. Open (default) or closed.
@param string $sort Sort can be due_date ... | [
"List",
"milestones",
"for",
"a",
"repository",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Issues/Milestones.php#L39-L51 |
224,724 | joomla-framework/github-api | src/Package/Issues/Milestones.php | Milestones.create | public function create($user, $repo, $title, $state = null, $description = null, $dueOn = null)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones';
// Build the request data.
$data = array(
'title' => $title,
);
if ($state !== null)
{
$data['state'] = $state;
}... | php | public function create($user, $repo, $title, $state = null, $description = null, $dueOn = null)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones';
// Build the request data.
$data = array(
'title' => $title,
);
if ($state !== null)
{
$data['state'] = $state;
}... | [
"public",
"function",
"create",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"title",
",",
"$",
"state",
"=",
"null",
",",
"$",
"description",
"=",
"null",
",",
"$",
"dueOn",
"=",
"null",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/... | Create a milestone.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $title The title of the milestone.
@param string $state Can be open (default) or closed.
@param string $descript... | [
"Create",
"a",
"milestone",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Issues/Milestones.php#L90-L119 |
224,725 | joomla-framework/github-api | src/Package/Issues/Milestones.php | Milestones.edit | public function edit($user, $repo, $milestoneId, $title = null, $state = null, $description = null, $dueOn = null)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId;
// Build the request data.
$data = array();
if ($title !== null)
{
$data['title... | php | public function edit($user, $repo, $milestoneId, $title = null, $state = null, $description = null, $dueOn = null)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId;
// Build the request data.
$data = array();
if ($title !== null)
{
$data['title... | [
"public",
"function",
"edit",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"milestoneId",
",",
"$",
"title",
"=",
"null",
",",
"$",
"state",
"=",
"null",
",",
"$",
"description",
"=",
"null",
",",
"$",
"dueOn",
"=",
"null",
")",
"{",
"// Build the... | Update a milestone.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param integer $milestoneId The id of the comment to update.
@param integer $title Optional title of the milestone.
@param string $sta... | [
"Update",
"a",
"milestone",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Issues/Milestones.php#L138-L170 |
224,726 | joomla-framework/github-api | src/Package/Data/Refs.php | Refs.create | public function create($user, $repo, $ref, $sha)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs';
// Build the request data.
$data = json_encode(
array(
'ref' => $ref,
'sha' => $sha,
)
);
// Send the request.
return $this->processResponse($this->client->... | php | public function create($user, $repo, $ref, $sha)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs';
// Build the request data.
$data = json_encode(
array(
'ref' => $ref,
'sha' => $sha,
)
);
// Send the request.
return $this->processResponse($this->client->... | [
"public",
"function",
"create",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"ref",
",",
"$",
"sha",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"user",
".",
"'/'",
".",
"$",
"repo",
".",
"'/git/refs'",
";",
"// ... | Create a Reference.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $ref The name of the fully qualified reference.
@param string $sha The SHA1 value to set this reference to.
@return object
@since 1.0
@thro... | [
"Create",
"a",
"Reference",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Data/Refs.php#L84-L99 |
224,727 | joomla-framework/github-api | src/Package/Data/Refs.php | Refs.edit | public function edit($user, $repo, $ref, $sha, $force = false)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref;
// Create the data object.
$data = new \stdClass;
// If a title is set add it to the data object.
if ($force)
{
$data->force = true;
}
$data... | php | public function edit($user, $repo, $ref, $sha, $force = false)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref;
// Create the data object.
$data = new \stdClass;
// If a title is set add it to the data object.
if ($force)
{
$data->force = true;
}
$data... | [
"public",
"function",
"edit",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"ref",
",",
"$",
"sha",
",",
"$",
"force",
"=",
"false",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"user",
".",
"'/'",
".",
"$",
"rep... | Update a Reference.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $ref The reference to update.
@param string $sha The SHA1 value to set the reference to.
@param boolean $force Whether the update sh... | [
"Update",
"a",
"Reference",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Data/Refs.php#L115-L136 |
224,728 | acacha/users | src/Observers/UserInvitationObserver.php | UserInvitationObserver.deleted | public function deleted(UserInvitation $invitation)
{
// Insert into 'revisions' (calling getTable probably not necessary, but to be safe).
\DB::table((new Revision())->getTable())->insert([
[
'revisionable_type' => $invitation->getMorphClass(),
'revisiona... | php | public function deleted(UserInvitation $invitation)
{
// Insert into 'revisions' (calling getTable probably not necessary, but to be safe).
\DB::table((new Revision())->getTable())->insert([
[
'revisionable_type' => $invitation->getMorphClass(),
'revisiona... | [
"public",
"function",
"deleted",
"(",
"UserInvitation",
"$",
"invitation",
")",
"{",
"// Insert into 'revisions' (calling getTable probably not necessary, but to be safe).",
"\\",
"DB",
"::",
"table",
"(",
"(",
"new",
"Revision",
"(",
")",
")",
"->",
"getTable",
"(",
... | Listen to the UserInvitation deleted event. | [
"Listen",
"to",
"the",
"UserInvitation",
"deleted",
"event",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Observers/UserInvitationObserver.php#L52-L67 |
224,729 | php-poppler/php-poppler | Processor/PdfFile.php | PdfFile.getInfo | public function getInfo($inputfile)
{
if (!file_exists($inputfile)) {
throw new FileNotFoundException("File $inputfile not found.");
}
$args = array($inputfile);
$output = $this->pdfinfo->command($args);
$info = array();
foreach (explode(PHP_EOL, $outpu... | php | public function getInfo($inputfile)
{
if (!file_exists($inputfile)) {
throw new FileNotFoundException("File $inputfile not found.");
}
$args = array($inputfile);
$output = $this->pdfinfo->command($args);
$info = array();
foreach (explode(PHP_EOL, $outpu... | [
"public",
"function",
"getInfo",
"(",
"$",
"inputfile",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"inputfile",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"\"File $inputfile not found.\"",
")",
";",
"}",
"$",
"args",
"=",
"array",
... | Write to file or return content
@param string $inputfile
@return array | [
"Write",
"to",
"file",
"or",
"return",
"content"
] | 033427289ec4f1ff00656a0e02410a84c529ace4 | https://github.com/php-poppler/php-poppler/blob/033427289ec4f1ff00656a0e02410a84c529ace4/Processor/PdfFile.php#L100-L122 |
224,730 | joomla-framework/github-api | src/Package/Users.php | Users.getList | public function getList($since = 0)
{
// Build the request path.
$uri = new Uri($this->fetchUrl('/users'));
if ($since)
{
$uri->setVar('since', $since);
}
// Send the request.
return $this->processResponse($this->client->get($uri));
} | php | public function getList($since = 0)
{
// Build the request path.
$uri = new Uri($this->fetchUrl('/users'));
if ($since)
{
$uri->setVar('since', $since);
}
// Send the request.
return $this->processResponse($this->client->get($uri));
} | [
"public",
"function",
"getList",
"(",
"$",
"since",
"=",
"0",
")",
"{",
"// Build the request path.",
"$",
"uri",
"=",
"new",
"Uri",
"(",
"$",
"this",
"->",
"fetchUrl",
"(",
"'/users'",
")",
")",
";",
"if",
"(",
"$",
"since",
")",
"{",
"$",
"uri",
... | Get all users.
This provides a dump of every user, in the order that they signed up for GitHub.
@param integer $since The integer ID of the last User that you’ve seen.
@return object
@since 1.0
@throws \DomainException | [
"Get",
"all",
"users",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Users.php#L116-L128 |
224,731 | joomla-framework/github-api | src/Package/Repositories/Contents.php | Contents.create | public function create($owner, $repo, $path, $message, $content, $branch = 'master', $authorName = '', $authorEmail = '', $committerName = '',
$committerEmail = ''
)
{
// Build the request path.
$route = '/repos/' . $owner . '/' . $repo . '/contents/' . $path;
$data = array(
'message' => $message,
'con... | php | public function create($owner, $repo, $path, $message, $content, $branch = 'master', $authorName = '', $authorEmail = '', $committerName = '',
$committerEmail = ''
)
{
// Build the request path.
$route = '/repos/' . $owner . '/' . $repo . '/contents/' . $path;
$data = array(
'message' => $message,
'con... | [
"public",
"function",
"create",
"(",
"$",
"owner",
",",
"$",
"repo",
",",
"$",
"path",
",",
"$",
"message",
",",
"$",
"content",
",",
"$",
"branch",
"=",
"'master'",
",",
"$",
"authorName",
"=",
"''",
",",
"$",
"authorEmail",
"=",
"''",
",",
"$",
... | Create a file.
This method creates a new file in a repository.
Optional Parameters
The author section is optional and is filled in with the committer information if omitted.
If the committer information is omitted, the authenticated user’s information is used.
You must provide values for both name and email, whether... | [
"Create",
"a",
"file",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Repositories/Contents.php#L156-L196 |
224,732 | atorscho/membership | src/Assignable.php | Assignable.assignTo | public function assignTo($group): void
{
$group = $this->resolveGroup($group);
$this->groups()->attach($group);
} | php | public function assignTo($group): void
{
$group = $this->resolveGroup($group);
$this->groups()->attach($group);
} | [
"public",
"function",
"assignTo",
"(",
"$",
"group",
")",
":",
"void",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"resolveGroup",
"(",
"$",
"group",
")",
";",
"$",
"this",
"->",
"groups",
"(",
")",
"->",
"attach",
"(",
"$",
"group",
")",
";",
"}"... | Assign the model to a group.
@param int|string|Group $group | [
"Assign",
"the",
"model",
"to",
"a",
"group",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Assignable.php#L21-L26 |
224,733 | atorscho/membership | src/Assignable.php | Assignable.retractFrom | public function retractFrom($group): void
{
$group = $this->resolveGroup($group);
$this->groups()->detach($group);
} | php | public function retractFrom($group): void
{
$group = $this->resolveGroup($group);
$this->groups()->detach($group);
} | [
"public",
"function",
"retractFrom",
"(",
"$",
"group",
")",
":",
"void",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"resolveGroup",
"(",
"$",
"group",
")",
";",
"$",
"this",
"->",
"groups",
"(",
")",
"->",
"detach",
"(",
"$",
"group",
")",
";",
... | Retract the model from a group.
@param int|string|Group $group | [
"Retract",
"the",
"model",
"from",
"a",
"group",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Assignable.php#L33-L38 |
224,734 | atorscho/membership | src/Assignable.php | Assignable.isAssignedTo | public function isAssignedTo($group): bool
{
$group = $this->resolveGroup($group);
return $this->groups()->where('group_id', is_int($group) ? $group : $group->id)->exists();
} | php | public function isAssignedTo($group): bool
{
$group = $this->resolveGroup($group);
return $this->groups()->where('group_id', is_int($group) ? $group : $group->id)->exists();
} | [
"public",
"function",
"isAssignedTo",
"(",
"$",
"group",
")",
":",
"bool",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"resolveGroup",
"(",
"$",
"group",
")",
";",
"return",
"$",
"this",
"->",
"groups",
"(",
")",
"->",
"where",
"(",
"'group_id'",
",",... | Check whether the model is assigned to a group.
@param int|string|Group $group
@return bool | [
"Check",
"whether",
"the",
"model",
"is",
"assigned",
"to",
"a",
"group",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Assignable.php#L47-L52 |
224,735 | atorscho/membership | src/Assignable.php | Assignable.resolveGroup | protected function resolveGroup($group)
{
if (is_string($group)) {
$group = Group::whereHandle($group)->firstOrFail();
}
return $group;
} | php | protected function resolveGroup($group)
{
if (is_string($group)) {
$group = Group::whereHandle($group)->firstOrFail();
}
return $group;
} | [
"protected",
"function",
"resolveGroup",
"(",
"$",
"group",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"group",
")",
")",
"{",
"$",
"group",
"=",
"Group",
"::",
"whereHandle",
"(",
"$",
"group",
")",
"->",
"firstOrFail",
"(",
")",
";",
"}",
"return"... | Resolve the group parameter.
@param int|string|Group $group
@return Group|int | [
"Resolve",
"the",
"group",
"parameter",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Assignable.php#L61-L68 |
224,736 | atorscho/membership | src/Group.php | Group.grantPermissions | public function grantPermissions($permissions): void
{
if (!is_array($permissions) && !$permissions instanceof Collection) {
$permissions = func_get_args();
}
foreach ($permissions as $permission) {
$permission = $this->resolvePermission($permission);
$p... | php | public function grantPermissions($permissions): void
{
if (!is_array($permissions) && !$permissions instanceof Collection) {
$permissions = func_get_args();
}
foreach ($permissions as $permission) {
$permission = $this->resolvePermission($permission);
$p... | [
"public",
"function",
"grantPermissions",
"(",
"$",
"permissions",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"permissions",
")",
"&&",
"!",
"$",
"permissions",
"instanceof",
"Collection",
")",
"{",
"$",
"permissions",
"=",
"func_get_args",... | Grant given permissions to the group.
@param array|Permission|Collection|string $permissions | [
"Grant",
"given",
"permissions",
"to",
"the",
"group",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Group.php#L100-L111 |
224,737 | atorscho/membership | src/Group.php | Group.assign | public function assign($user, bool $primary = false): bool
{
if ($this->limitExceeded()) {
return false;
}
$this->users()->attach($user);
// Set user's primary group
if ($primary) {
// Get user's model name
$userModel = config('auth.provi... | php | public function assign($user, bool $primary = false): bool
{
if ($this->limitExceeded()) {
return false;
}
$this->users()->attach($user);
// Set user's primary group
if ($primary) {
// Get user's model name
$userModel = config('auth.provi... | [
"public",
"function",
"assign",
"(",
"$",
"user",
",",
"bool",
"$",
"primary",
"=",
"false",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"limitExceeded",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"users",
"(",
"... | Assign a user to the group.
@param int|Authenticatable $user
@param bool $primary
@return bool Whether the user has been assigned. | [
"Assign",
"a",
"user",
"to",
"the",
"group",
"."
] | c39ee69b5bc33702912fb16ef4f4736eaf1e6d71 | https://github.com/atorscho/membership/blob/c39ee69b5bc33702912fb16ef4f4736eaf1e6d71/src/Group.php#L139-L162 |
224,738 | alxmsl/AppStoreClient | source/AbstractClient.php | AbstractClient.getRequest | protected function getRequest($url) {
$Request = new Request();
$Request->setTransport(Request::TRANSPORT_CURL);
return $Request->setUrl($url)
->setConnectTimeout($this->getConnectTimeout())
->setTimeout($this->getRequestTimeout())
->setContentTypeCode(Request... | php | protected function getRequest($url) {
$Request = new Request();
$Request->setTransport(Request::TRANSPORT_CURL);
return $Request->setUrl($url)
->setConnectTimeout($this->getConnectTimeout())
->setTimeout($this->getRequestTimeout())
->setContentTypeCode(Request... | [
"protected",
"function",
"getRequest",
"(",
"$",
"url",
")",
"{",
"$",
"Request",
"=",
"new",
"Request",
"(",
")",
";",
"$",
"Request",
"->",
"setTransport",
"(",
"Request",
"::",
"TRANSPORT_CURL",
")",
";",
"return",
"$",
"Request",
"->",
"setUrl",
"(",... | Getter for the request
@param string $url request url
@return Request request object | [
"Getter",
"for",
"the",
"request"
] | 95b6e9ea9f8b717760cf648f4a2e83d6fe3103b4 | https://github.com/alxmsl/AppStoreClient/blob/95b6e9ea9f8b717760cf648f4a2e83d6fe3103b4/source/AbstractClient.php#L44-L51 |
224,739 | burnbright/silverstripe-importexport | code/extensions/ImportAdminExtension.php | ImportAdminExtension.updateEditForm | public function updateEditForm($form)
{
if ($doadd = Config::inst()->get('ModelAdmin', 'addbetterimporters')) {
$modelclass = $this->owner->modelClass;
$grid = $form->Fields()->fieldByName($modelclass);
$config = $grid->getConfig();
//don't proceed if there ... | php | public function updateEditForm($form)
{
if ($doadd = Config::inst()->get('ModelAdmin', 'addbetterimporters')) {
$modelclass = $this->owner->modelClass;
$grid = $form->Fields()->fieldByName($modelclass);
$config = $grid->getConfig();
//don't proceed if there ... | [
"public",
"function",
"updateEditForm",
"(",
"$",
"form",
")",
"{",
"if",
"(",
"$",
"doadd",
"=",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"'ModelAdmin'",
",",
"'addbetterimporters'",
")",
")",
"{",
"$",
"modelclass",
"=",
"$",
"this",
"->",... | Add in new bulk GridFieldImporter | [
"Add",
"in",
"new",
"bulk",
"GridFieldImporter"
] | 673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3 | https://github.com/burnbright/silverstripe-importexport/blob/673ca4f63ce69d2128c2cd31daac64ee5bb2ecb3/code/extensions/ImportAdminExtension.php#L21-L49 |
224,740 | vboctor/disposable_email_checker | php/src/DisposableEmailChecker.php | DisposableEmailChecker.is_disposable_email | public static function is_disposable_email( $p_email ) {
$t_domain = DisposableEmailChecker::_get_domain_from_address( $p_email );
DisposableEmailChecker::_load_domains();
return isset( DisposableEmailChecker::$domains_array[$t_domain] );
} | php | public static function is_disposable_email( $p_email ) {
$t_domain = DisposableEmailChecker::_get_domain_from_address( $p_email );
DisposableEmailChecker::_load_domains();
return isset( DisposableEmailChecker::$domains_array[$t_domain] );
} | [
"public",
"static",
"function",
"is_disposable_email",
"(",
"$",
"p_email",
")",
"{",
"$",
"t_domain",
"=",
"DisposableEmailChecker",
"::",
"_get_domain_from_address",
"(",
"$",
"p_email",
")",
";",
"DisposableEmailChecker",
"::",
"_load_domains",
"(",
")",
";",
"... | Determines if the email address is disposable.
@param string $p_email The email address to validate.
@return boolean true: disposable, false: non-disposable. | [
"Determines",
"if",
"the",
"email",
"address",
"is",
"disposable",
"."
] | e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73 | https://github.com/vboctor/disposable_email_checker/blob/e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73/php/src/DisposableEmailChecker.php#L28-L34 |
224,741 | vboctor/disposable_email_checker | php/src/DisposableEmailChecker.php | DisposableEmailChecker.add_domains | public static function add_domains( array $p_domains ) {
DisposableEmailChecker::_load_domains();
foreach( $p_domains as $t_domain ) {
$t_domain = strtolower( $t_domain );
DisposableEmailChecker::$domains_array[$t_domain] = true;
}
} | php | public static function add_domains( array $p_domains ) {
DisposableEmailChecker::_load_domains();
foreach( $p_domains as $t_domain ) {
$t_domain = strtolower( $t_domain );
DisposableEmailChecker::$domains_array[$t_domain] = true;
}
} | [
"public",
"static",
"function",
"add_domains",
"(",
"array",
"$",
"p_domains",
")",
"{",
"DisposableEmailChecker",
"::",
"_load_domains",
"(",
")",
";",
"foreach",
"(",
"$",
"p_domains",
"as",
"$",
"t_domain",
")",
"{",
"$",
"t_domain",
"=",
"strtolower",
"(... | Add a list of domains to the black list.
@param array $p_domains The list of domains to add. | [
"Add",
"a",
"list",
"of",
"domains",
"to",
"the",
"black",
"list",
"."
] | e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73 | https://github.com/vboctor/disposable_email_checker/blob/e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73/php/src/DisposableEmailChecker.php#L58-L65 |
224,742 | vboctor/disposable_email_checker | php/src/DisposableEmailChecker.php | DisposableEmailChecker.remove_domains | public static function remove_domains( array $p_domains ) {
DisposableEmailChecker::_load_domains();
foreach( $p_domains as $t_domain ) {
$t_domain = strtolower( $t_domain );
unset( DisposableEmailChecker::$domains_array[$t_domain] );
}
} | php | public static function remove_domains( array $p_domains ) {
DisposableEmailChecker::_load_domains();
foreach( $p_domains as $t_domain ) {
$t_domain = strtolower( $t_domain );
unset( DisposableEmailChecker::$domains_array[$t_domain] );
}
} | [
"public",
"static",
"function",
"remove_domains",
"(",
"array",
"$",
"p_domains",
")",
"{",
"DisposableEmailChecker",
"::",
"_load_domains",
"(",
")",
";",
"foreach",
"(",
"$",
"p_domains",
"as",
"$",
"t_domain",
")",
"{",
"$",
"t_domain",
"=",
"strtolower",
... | Remove a list of domains from the black list.
@param array $p_domains The list of domains to remove. | [
"Remove",
"a",
"list",
"of",
"domains",
"from",
"the",
"black",
"list",
"."
] | e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73 | https://github.com/vboctor/disposable_email_checker/blob/e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73/php/src/DisposableEmailChecker.php#L72-L79 |
224,743 | vboctor/disposable_email_checker | php/src/DisposableEmailChecker.php | DisposableEmailChecker._load_file | private static function _load_file() {
$t_array = file( __DIR__ . '/../../data/domains.txt' );
$t_result_array = array();
foreach ( $t_array as $t_line ) {
$t_entry = trim( $t_line );
if ( empty( $t_entry ) ) {
continue;
}
# Exclude commented lines
if ( strpos( $t_entry, '#' ) === 0 ) {
c... | php | private static function _load_file() {
$t_array = file( __DIR__ . '/../../data/domains.txt' );
$t_result_array = array();
foreach ( $t_array as $t_line ) {
$t_entry = trim( $t_line );
if ( empty( $t_entry ) ) {
continue;
}
# Exclude commented lines
if ( strpos( $t_entry, '#' ) === 0 ) {
c... | [
"private",
"static",
"function",
"_load_file",
"(",
")",
"{",
"$",
"t_array",
"=",
"file",
"(",
"__DIR__",
".",
"'/../../data/domains.txt'",
")",
";",
"$",
"t_result_array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"t_array",
"as",
"$",
"t_line",
... | Loads the domains list from disk.
@return array An array of domains matching the specified file name. | [
"Loads",
"the",
"domains",
"list",
"from",
"disk",
"."
] | e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73 | https://github.com/vboctor/disposable_email_checker/blob/e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73/php/src/DisposableEmailChecker.php#L99-L119 |
224,744 | vboctor/disposable_email_checker | php/src/DisposableEmailChecker.php | DisposableEmailChecker._get_domain_from_address | private static function _get_domain_from_address( $p_email ) {
$t_domain_pos = strpos( $p_email, '@' );
// If no @ sign, assume domain was passed in and return as is.
if ( $t_domain_pos === false ) {
return $p_email;
}
return strtolower( substr( $p_email, $t_domain_pos + 1 ) );
} | php | private static function _get_domain_from_address( $p_email ) {
$t_domain_pos = strpos( $p_email, '@' );
// If no @ sign, assume domain was passed in and return as is.
if ( $t_domain_pos === false ) {
return $p_email;
}
return strtolower( substr( $p_email, $t_domain_pos + 1 ) );
} | [
"private",
"static",
"function",
"_get_domain_from_address",
"(",
"$",
"p_email",
")",
"{",
"$",
"t_domain_pos",
"=",
"strpos",
"(",
"$",
"p_email",
",",
"'@'",
")",
";",
"// If no @ sign, assume domain was passed in and return as is.",
"if",
"(",
"$",
"t_domain_pos",... | A helper function that takes in an email address and returns a lower case
domain.
@param string $p_email The email address to extra the domain from.
@return string The lower case domain or empty string if email not valid. | [
"A",
"helper",
"function",
"that",
"takes",
"in",
"an",
"email",
"address",
"and",
"returns",
"a",
"lower",
"case",
"domain",
"."
] | e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73 | https://github.com/vboctor/disposable_email_checker/blob/e73467c0fd4773bf5a7f0c1cddd6dac92b1c8f73/php/src/DisposableEmailChecker.php#L128-L137 |
224,745 | neos/setup | Classes/Controller/LoginController.php | LoginController.initializeObject | public function initializeObject()
{
$settings = $this->configurationManager->getConfiguration(\Neos\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow');
if (isset($settings['security']['authentication']['providers']['Neos.Setup:Login']['providerOptions']['keyName'])) ... | php | public function initializeObject()
{
$settings = $this->configurationManager->getConfiguration(\Neos\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow');
if (isset($settings['security']['authentication']['providers']['Neos.Setup:Login']['providerOptions']['keyName'])) ... | [
"public",
"function",
"initializeObject",
"(",
")",
"{",
"$",
"settings",
"=",
"$",
"this",
"->",
"configurationManager",
"->",
"getConfiguration",
"(",
"\\",
"Neos",
"\\",
"Flow",
"\\",
"Configuration",
"\\",
"ConfigurationManager",
"::",
"CONFIGURATION_TYPE_SETTIN... | Gets the authentication provider configuration needed
@return void | [
"Gets",
"the",
"authentication",
"provider",
"configuration",
"needed"
] | 7b5437efe8113e997007be6896628aa9f5c39d2f | https://github.com/neos/setup/blob/7b5437efe8113e997007be6896628aa9f5c39d2f/Classes/Controller/LoginController.php#L53-L59 |
224,746 | neos/setup | Classes/Controller/LoginController.php | LoginController.generateNewPasswordAction | public function generateNewPasswordAction($step = 0)
{
$existingPasswordFile = Files::concatenatePaths([FLOW_PATH_DATA, 'Persistent', 'FileBasedSimpleKeyService', $this->keyName]);
if (file_exists($existingPasswordFile)) {
unlink($existingPasswordFile);
$this->addFlashMessage... | php | public function generateNewPasswordAction($step = 0)
{
$existingPasswordFile = Files::concatenatePaths([FLOW_PATH_DATA, 'Persistent', 'FileBasedSimpleKeyService', $this->keyName]);
if (file_exists($existingPasswordFile)) {
unlink($existingPasswordFile);
$this->addFlashMessage... | [
"public",
"function",
"generateNewPasswordAction",
"(",
"$",
"step",
"=",
"0",
")",
"{",
"$",
"existingPasswordFile",
"=",
"Files",
"::",
"concatenatePaths",
"(",
"[",
"FLOW_PATH_DATA",
",",
"'Persistent'",
",",
"'FileBasedSimpleKeyService'",
",",
"$",
"this",
"->... | Removes the existing password and starts over by generating a new one.
@param integer $step The requested setup step
@return void
@Flow\SkipCsrfProtection | [
"Removes",
"the",
"existing",
"password",
"and",
"starts",
"over",
"by",
"generating",
"a",
"new",
"one",
"."
] | 7b5437efe8113e997007be6896628aa9f5c39d2f | https://github.com/neos/setup/blob/7b5437efe8113e997007be6896628aa9f5c39d2f/Classes/Controller/LoginController.php#L114-L122 |
224,747 | acacha/users | src/Http/Controllers/GoogleAppsUsersController.php | GoogleAppsUsersController.all | public function all(Request $request)
{
$this->authorize('list-google-apps-users');
$perPage = config('users.google_apps_users_per_page' , 15);
if ($request->has('perPage')) {
$perPage = $request->input('perPage');
}
$users = $this->service->getUsers($perPage);
... | php | public function all(Request $request)
{
$this->authorize('list-google-apps-users');
$perPage = config('users.google_apps_users_per_page' , 15);
if ($request->has('perPage')) {
$perPage = $request->input('perPage');
}
$users = $this->service->getUsers($perPage);
... | [
"public",
"function",
"all",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'list-google-apps-users'",
")",
";",
"$",
"perPage",
"=",
"config",
"(",
"'users.google_apps_users_per_page'",
",",
"15",
")",
";",
"if",
"(",
"$",
... | List Google apps users. | [
"List",
"Google",
"apps",
"users",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Http/Controllers/GoogleAppsUsersController.php#L64-L76 |
224,748 | phootwork/collection | src/Set.php | Set.add | public function add($element) {
if (!in_array($element, $this->collection, true)) {
$this->collection[$this->size()] = $element;
}
return $this;
} | php | public function add($element) {
if (!in_array($element, $this->collection, true)) {
$this->collection[$this->size()] = $element;
}
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"collection",
",",
"true",
")",
")",
"{",
"$",
"this",
"->",
"collection",
"[",
"$",
"this",
"->",
"size",
"(",
"... | Adds an element to that set
@param mixed $element
@return $this | [
"Adds",
"an",
"element",
"to",
"that",
"set"
] | e745fe3735a6f2099015d11ea7b917634ebf76f3 | https://github.com/phootwork/collection/blob/e745fe3735a6f2099015d11ea7b917634ebf76f3/src/Set.php#L28-L34 |
224,749 | codebach/PianoSoloWeatherBundle | Twig/WeatherExtension.php | WeatherExtension.weather | public function weather(\Twig_Environment $environment, $city)
{
$weathers = $this->weatherFactory->getWeatherObject($city);
return $environment->render('PianoSoloWeatherBundle:Weather:weather.html.twig', array(
'city' => $city,
'weathers' => $weathers,
'download... | php | public function weather(\Twig_Environment $environment, $city)
{
$weathers = $this->weatherFactory->getWeatherObject($city);
return $environment->render('PianoSoloWeatherBundle:Weather:weather.html.twig', array(
'city' => $city,
'weathers' => $weathers,
'download... | [
"public",
"function",
"weather",
"(",
"\\",
"Twig_Environment",
"$",
"environment",
",",
"$",
"city",
")",
"{",
"$",
"weathers",
"=",
"$",
"this",
"->",
"weatherFactory",
"->",
"getWeatherObject",
"(",
"$",
"city",
")",
";",
"return",
"$",
"environment",
"... | Renders weather object of a city
@param \Twig_Environment $environment
@param mixed (integer|string) $city
@return string | [
"Renders",
"weather",
"object",
"of",
"a",
"city"
] | f6b3ce0a86dbd8ab4e23d4e2d3031e6d4af0e269 | https://github.com/codebach/PianoSoloWeatherBundle/blob/f6b3ce0a86dbd8ab4e23d4e2d3031e6d4af0e269/Twig/WeatherExtension.php#L56-L65 |
224,750 | codebach/PianoSoloWeatherBundle | Twig/WeatherExtension.php | WeatherExtension.forecast | public function forecast(\Twig_Environment $environment, $city, $days = 3)
{
$weathers = $this->weatherFactory->getForecastObject($city, $days);
return $environment->render('PianoSoloWeatherBundle:Weather:weather.html.twig', array(
'city' => $city,
'weathers' => $weathers,
... | php | public function forecast(\Twig_Environment $environment, $city, $days = 3)
{
$weathers = $this->weatherFactory->getForecastObject($city, $days);
return $environment->render('PianoSoloWeatherBundle:Weather:weather.html.twig', array(
'city' => $city,
'weathers' => $weathers,
... | [
"public",
"function",
"forecast",
"(",
"\\",
"Twig_Environment",
"$",
"environment",
",",
"$",
"city",
",",
"$",
"days",
"=",
"3",
")",
"{",
"$",
"weathers",
"=",
"$",
"this",
"->",
"weatherFactory",
"->",
"getForecastObject",
"(",
"$",
"city",
",",
"$",... | Renders weather list of a city for days
@param \Twig_Environment $environment
@param mixed (integer|string) $city
@param int $days
@return string | [
"Renders",
"weather",
"list",
"of",
"a",
"city",
"for",
"days"
] | f6b3ce0a86dbd8ab4e23d4e2d3031e6d4af0e269 | https://github.com/codebach/PianoSoloWeatherBundle/blob/f6b3ce0a86dbd8ab4e23d4e2d3031e6d4af0e269/Twig/WeatherExtension.php#L76-L85 |
224,751 | joomla-framework/github-api | src/Package/Users/Followers.php | Followers.checkUserFollowing | public function checkUserFollowing($user, $target)
{
// Build the request path.
$path = "/user/$user/following/$target";
$response = $this->client->get($this->fetchUrl($path));
switch ($response->code)
{
case '204' :
// User is following the target
return true;
case '404' :
// User is no... | php | public function checkUserFollowing($user, $target)
{
// Build the request path.
$path = "/user/$user/following/$target";
$response = $this->client->get($this->fetchUrl($path));
switch ($response->code)
{
case '204' :
// User is following the target
return true;
case '404' :
// User is no... | [
"public",
"function",
"checkUserFollowing",
"(",
"$",
"user",
",",
"$",
"target",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"\"/user/$user/following/$target\"",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"thi... | Check if one user follows another.
@param string $user The name of the user.
@param string $target The name of the user to check is being followed.
@return boolean
@since 1.4.0
@throws \UnexpectedValueException | [
"Check",
"if",
"one",
"user",
"follows",
"another",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Users/Followers.php#L107-L127 |
224,752 | acacha/users | src/Traits/HasPaginator.php | HasPaginator.paginate | protected function paginate($items, $perPage = 15)
{
$currentPage = LengthAwarePaginator::resolveCurrentPage();
$currentPageItems = collect($items)->slice(($currentPage - 1) * $perPage, $perPage);
return new LengthAwarePaginator($currentPageItems, count($items), $perPage);
} | php | protected function paginate($items, $perPage = 15)
{
$currentPage = LengthAwarePaginator::resolveCurrentPage();
$currentPageItems = collect($items)->slice(($currentPage - 1) * $perPage, $perPage);
return new LengthAwarePaginator($currentPageItems, count($items), $perPage);
} | [
"protected",
"function",
"paginate",
"(",
"$",
"items",
",",
"$",
"perPage",
"=",
"15",
")",
"{",
"$",
"currentPage",
"=",
"LengthAwarePaginator",
"::",
"resolveCurrentPage",
"(",
")",
";",
"$",
"currentPageItems",
"=",
"collect",
"(",
"$",
"items",
")",
"... | Create a length aware custom paginator instance.
@param Collection $items
@param int $perPage
@return \Illuminate\Pagination\LengthAwarePaginator | [
"Create",
"a",
"length",
"aware",
"custom",
"paginator",
"instance",
"."
] | af74be23d225bc9a23ee049579abb1596ae683c0 | https://github.com/acacha/users/blob/af74be23d225bc9a23ee049579abb1596ae683c0/src/Traits/HasPaginator.php#L23-L30 |
224,753 | netz98/n98-deployer | src/Deployer/Registry.php | Registry.registerTasks | public static function registerTasks(array $tasks)
{
// Register Tasks
foreach ($tasks as $key => $task) {
$roles = array_key_exists('roles', $task) ? $task['roles'] : null;
self::registerTask($key, $task['desc'], $task['callback'], $roles);
}
} | php | public static function registerTasks(array $tasks)
{
// Register Tasks
foreach ($tasks as $key => $task) {
$roles = array_key_exists('roles', $task) ? $task['roles'] : null;
self::registerTask($key, $task['desc'], $task['callback'], $roles);
}
} | [
"public",
"static",
"function",
"registerTasks",
"(",
"array",
"$",
"tasks",
")",
"{",
"// Register Tasks",
"foreach",
"(",
"$",
"tasks",
"as",
"$",
"key",
"=>",
"$",
"task",
")",
"{",
"$",
"roles",
"=",
"array_key_exists",
"(",
"'roles'",
",",
"$",
"tas... | Register All N98 Tasks
@param array $tasks | [
"Register",
"All",
"N98",
"Tasks"
] | cf7b7c790f45c41ed338b8a33b498eeaaaa765e9 | https://github.com/netz98/n98-deployer/blob/cf7b7c790f45c41ed338b8a33b498eeaaaa765e9/src/Deployer/Registry.php#L20-L27 |
224,754 | joomla-framework/github-api | src/Package/Issues/Labels.php | Labels.update | public function update($user, $repo, $label, $name, $color)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/labels/' . $label;
// Build the request data.
$data = json_encode(
array(
'name' => $name,
'color' => $color,
)
);
// Send the request.
return $this->proce... | php | public function update($user, $repo, $label, $name, $color)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/labels/' . $label;
// Build the request data.
$data = json_encode(
array(
'name' => $name,
'color' => $color,
)
);
// Send the request.
return $this->proce... | [
"public",
"function",
"update",
"(",
"$",
"user",
",",
"$",
"repo",
",",
"$",
"label",
",",
"$",
"name",
",",
"$",
"color",
")",
"{",
"// Build the request path.",
"$",
"path",
"=",
"'/repos/'",
".",
"$",
"user",
".",
"'/'",
".",
"$",
"repo",
".",
... | Update a label.
@param string $user The name of the owner of the GitHub repository.
@param string $repo The name of the GitHub repository.
@param string $label The label name.
@param string $name The new label name.
@param string $color The new label color.
@return object
@since 1.0 | [
"Update",
"a",
"label",
"."
] | 27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04 | https://github.com/joomla-framework/github-api/blob/27dcf6ab6389f68cf01903fcec6ab7b5cdc30e04/src/Package/Issues/Labels.php#L131-L148 |
224,755 | jonathantorres/laravel-medium-sdk | src/LaravelMediumSdkServiceProvider.php | LaravelMediumSdkServiceProvider.register | public function register()
{
$this->app->bind('JonathanTorres\LaravelMediumSdk\LaravelMediumSdk', function ($app) {
return new Medium([
'client-id' => config('laravel-medium-sdk.client-id'),
'client-secret' => config('laravel-medium-sdk.client-secret'),
... | php | public function register()
{
$this->app->bind('JonathanTorres\LaravelMediumSdk\LaravelMediumSdk', function ($app) {
return new Medium([
'client-id' => config('laravel-medium-sdk.client-id'),
'client-secret' => config('laravel-medium-sdk.client-secret'),
... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'JonathanTorres\\LaravelMediumSdk\\LaravelMediumSdk'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"Medium",
"(",
"[",
"'client-id'",
"=>",
"config"... | Register Medium class instance in the container.
@return void | [
"Register",
"Medium",
"class",
"instance",
"in",
"the",
"container",
"."
] | 8f9c7a2c86ad6f2b4cda56a7f582d8be123845be | https://github.com/jonathantorres/laravel-medium-sdk/blob/8f9c7a2c86ad6f2b4cda56a7f582d8be123845be/src/LaravelMediumSdkServiceProvider.php#L27-L38 |
224,756 | Influendo/laravel-survivor | src/Survivor.php | Survivor.getScript | public function getScript()
{
$script = view('survivor::script')->with([
'token' => csrf_token(),
'url' => route('survivor.ping'),
'interval' => config('survivor.interval', 300000),
'input_elements' => config('survivor.input_elements'... | php | public function getScript()
{
$script = view('survivor::script')->with([
'token' => csrf_token(),
'url' => route('survivor.ping'),
'interval' => config('survivor.interval', 300000),
'input_elements' => config('survivor.input_elements'... | [
"public",
"function",
"getScript",
"(",
")",
"{",
"$",
"script",
"=",
"view",
"(",
"'survivor::script'",
")",
"->",
"with",
"(",
"[",
"'token'",
"=>",
"csrf_token",
"(",
")",
",",
"'url'",
"=>",
"route",
"(",
"'survivor.ping'",
")",
",",
"'interval'",
"=... | Return the script tag for the survivor lib
@return string | [
"Return",
"the",
"script",
"tag",
"for",
"the",
"survivor",
"lib"
] | 422aa0727110a86b8b0557bc48c68a94f0de6fba | https://github.com/Influendo/laravel-survivor/blob/422aa0727110a86b8b0557bc48c68a94f0de6fba/src/Survivor.php#L12-L22 |
224,757 | rambler-digital-solutions/hydrogen | src/Query.php | Query.has | public function has(string $criterion): bool
{
foreach ($this->criteria as $haystack) {
if (\get_class($haystack) === $criterion) {
return true;
}
}
return false;
} | php | public function has(string $criterion): bool
{
foreach ($this->criteria as $haystack) {
if (\get_class($haystack) === $criterion) {
return true;
}
}
return false;
} | [
"public",
"function",
"has",
"(",
"string",
"$",
"criterion",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"criteria",
"as",
"$",
"haystack",
")",
"{",
"if",
"(",
"\\",
"get_class",
"(",
"$",
"haystack",
")",
"===",
"$",
"criterion",
")"... | The method checks for the presence of the required criterion inside the query.
TODO Add callable argument support (like filter).
@param string $criterion
@return bool | [
"The",
"method",
"checks",
"for",
"the",
"presence",
"of",
"the",
"required",
"criterion",
"inside",
"the",
"query",
"."
] | 997f37ede0b88f345f049ead61862ae20b1fe5e2 | https://github.com/rambler-digital-solutions/hydrogen/blob/997f37ede0b88f345f049ead61862ae20b1fe5e2/src/Query.php#L110-L119 |
224,758 | rambler-digital-solutions/hydrogen | src/Query.php | Query.column | public function column(string $name): string
{
$name = \addcslashes($name, "'");
$table = $this->getMetadata()->getTableName();
return \sprintf("FIELD('%s', '%s', '%s')", $table, $this->getAlias(), $name);
} | php | public function column(string $name): string
{
$name = \addcslashes($name, "'");
$table = $this->getMetadata()->getTableName();
return \sprintf("FIELD('%s', '%s', '%s')", $table, $this->getAlias(), $name);
} | [
"public",
"function",
"column",
"(",
"string",
"$",
"name",
")",
":",
"string",
"{",
"$",
"name",
"=",
"\\",
"addcslashes",
"(",
"$",
"name",
",",
"\"'\"",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->",
"getMetadata",
"(",
")",
"->",
"getTableName",... | Creates the ability to directly access the table's column.
@param string $name
@return string | [
"Creates",
"the",
"ability",
"to",
"directly",
"access",
"the",
"table",
"s",
"column",
"."
] | 997f37ede0b88f345f049ead61862ae20b1fe5e2 | https://github.com/rambler-digital-solutions/hydrogen/blob/997f37ede0b88f345f049ead61862ae20b1fe5e2/src/Query.php#L145-L151 |
224,759 | rambler-digital-solutions/hydrogen | src/Query.php | Query.merge | public function merge(Query $query): Query
{
foreach ($query->getCriteria() as $criterion) {
$criterion->attach($this);
}
return $this->attach($query);
} | php | public function merge(Query $query): Query
{
foreach ($query->getCriteria() as $criterion) {
$criterion->attach($this);
}
return $this->attach($query);
} | [
"public",
"function",
"merge",
"(",
"Query",
"$",
"query",
")",
":",
"Query",
"{",
"foreach",
"(",
"$",
"query",
"->",
"getCriteria",
"(",
")",
"as",
"$",
"criterion",
")",
"{",
"$",
"criterion",
"->",
"attach",
"(",
"$",
"this",
")",
";",
"}",
"re... | Copies a set of Criteria from the child query to the parent.
@param Query $query
@return Query | [
"Copies",
"a",
"set",
"of",
"Criteria",
"from",
"the",
"child",
"query",
"to",
"the",
"parent",
"."
] | 997f37ede0b88f345f049ead61862ae20b1fe5e2 | https://github.com/rambler-digital-solutions/hydrogen/blob/997f37ede0b88f345f049ead61862ae20b1fe5e2/src/Query.php#L223-L230 |
224,760 | rambler-digital-solutions/hydrogen | src/Query.php | Query.create | public function create(): Query
{
$query = static::new()->scope(...$this->getScopes());
if ($this->repository) {
return $query->from($this->repository);
}
return $query;
} | php | public function create(): Query
{
$query = static::new()->scope(...$this->getScopes());
if ($this->repository) {
return $query->from($this->repository);
}
return $query;
} | [
"public",
"function",
"create",
"(",
")",
":",
"Query",
"{",
"$",
"query",
"=",
"static",
"::",
"new",
"(",
")",
"->",
"scope",
"(",
"...",
"$",
"this",
"->",
"getScopes",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"repository",
")",
"{",
... | Creates a new query using the current set of scopes.
@return Query | [
"Creates",
"a",
"new",
"query",
"using",
"the",
"current",
"set",
"of",
"scopes",
"."
] | 997f37ede0b88f345f049ead61862ae20b1fe5e2 | https://github.com/rambler-digital-solutions/hydrogen/blob/997f37ede0b88f345f049ead61862ae20b1fe5e2/src/Query.php#L297-L306 |
224,761 | dereuromark/cakephp-data | src/Model/Table/LocationsTable.php | LocationsTable.findIp | public static function findIp() {
if ((int)Configure::read('debug') > 1) {
$ip = Configure::read('App.defaultIp');
if ($ip) {
return $ip;
}
return '127.0.0.1';
}
$ip = Utility::getClientIp();
# usually getClientIp already removes multiple ips in favor of one single ip. but seems to fail sometime... | php | public static function findIp() {
if ((int)Configure::read('debug') > 1) {
$ip = Configure::read('App.defaultIp');
if ($ip) {
return $ip;
}
return '127.0.0.1';
}
$ip = Utility::getClientIp();
# usually getClientIp already removes multiple ips in favor of one single ip. but seems to fail sometime... | [
"public",
"static",
"function",
"findIp",
"(",
")",
"{",
"if",
"(",
"(",
"int",
")",
"Configure",
"::",
"read",
"(",
"'debug'",
")",
">",
"1",
")",
"{",
"$",
"ip",
"=",
"Configure",
"::",
"read",
"(",
"'App.defaultIp'",
")",
";",
"if",
"(",
"$",
... | Returns current IP address.
Note that in debug mode it will emulate it - and retrieve the preconfigured one.
NEW: if many ips in row (ip1, ip2, ip3), use last (or first???) one!
@return string IP | [
"Returns",
"current",
"IP",
"address",
".",
"Note",
"that",
"in",
"debug",
"mode",
"it",
"will",
"emulate",
"it",
"-",
"and",
"retrieve",
"the",
"preconfigured",
"one",
"."
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/LocationsTable.php#L151-L168 |
224,762 | dereuromark/cakephp-data | src/Model/Table/DistrictsTable.php | DistrictsTable.getDistrictsByCity | public function getDistrictsByCity($citySlug, $type = 'all') {
$options = [
'contain' => ['Cities'],
'conditions' => [
//$this->alias.'.lat <>' => 0,
//$this->alias.'.lng <>' => 0,
$this->Cities->getAlias() . '.slug' => $citySlug,
],
'fields' => [$this->getAlias() . '.slug', $this->getAlias() ... | php | public function getDistrictsByCity($citySlug, $type = 'all') {
$options = [
'contain' => ['Cities'],
'conditions' => [
//$this->alias.'.lat <>' => 0,
//$this->alias.'.lng <>' => 0,
$this->Cities->getAlias() . '.slug' => $citySlug,
],
'fields' => [$this->getAlias() . '.slug', $this->getAlias() ... | [
"public",
"function",
"getDistrictsByCity",
"(",
"$",
"citySlug",
",",
"$",
"type",
"=",
"'all'",
")",
"{",
"$",
"options",
"=",
"[",
"'contain'",
"=>",
"[",
"'Cities'",
"]",
",",
"'conditions'",
"=>",
"[",
"//$this->alias.'.lat <>' => 0,",
"//$this->alias.'.lng... | For start page
@param string $citySlug
@param string $type
@return \Cake\ORM\Query | [
"For",
"start",
"page"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/DistrictsTable.php#L76-L87 |
224,763 | sulu/SuluRedirectBundle | Controller/RedirectRouteImportController.php | RedirectRouteImportController.importAction | public function importAction(Request $request)
{
if (!$request->files->has('redirectRoutes')) {
return new JsonResponse(null, Response::HTTP_BAD_REQUEST);
}
/** @var UploadedFile $uploadedFile */
$uploadedFile = $request->files->get('redirectRoutes');
$file = $up... | php | public function importAction(Request $request)
{
if (!$request->files->has('redirectRoutes')) {
return new JsonResponse(null, Response::HTTP_BAD_REQUEST);
}
/** @var UploadedFile $uploadedFile */
$uploadedFile = $request->files->get('redirectRoutes');
$file = $up... | [
"public",
"function",
"importAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"files",
"->",
"has",
"(",
"'redirectRoutes'",
")",
")",
"{",
"return",
"new",
"JsonResponse",
"(",
"null",
",",
"Response",
"::",
"HTTP... | Import file which was uploaded.
@param Request $request
@return Response | [
"Import",
"file",
"which",
"was",
"uploaded",
"."
] | 913c501cced6c7db5fb96d4baf6cce4b884c65c6 | https://github.com/sulu/SuluRedirectBundle/blob/913c501cced6c7db5fb96d4baf6cce4b884c65c6/Controller/RedirectRouteImportController.php#L56-L76 |
224,764 | sulu/SuluRedirectBundle | Controller/RedirectRouteImportController.php | RedirectRouteImportController.importFile | private function importFile(File $file)
{
$response = [
'fileName' => $file->getFilename(),
'total' => 0,
'exceptions' => [],
];
/** @var Item $item */
foreach ($this->import->import($file->getRealPath()) as $item) {
++$response['total... | php | private function importFile(File $file)
{
$response = [
'fileName' => $file->getFilename(),
'total' => 0,
'exceptions' => [],
];
/** @var Item $item */
foreach ($this->import->import($file->getRealPath()) as $item) {
++$response['total... | [
"private",
"function",
"importFile",
"(",
"File",
"$",
"file",
")",
"{",
"$",
"response",
"=",
"[",
"'fileName'",
"=>",
"$",
"file",
"->",
"getFilename",
"(",
")",
",",
"'total'",
"=>",
"0",
",",
"'exceptions'",
"=>",
"[",
"]",
",",
"]",
";",
"/** @v... | Import given file and returns serializable response.
@param File $file
@return array | [
"Import",
"given",
"file",
"and",
"returns",
"serializable",
"response",
"."
] | 913c501cced6c7db5fb96d4baf6cce4b884c65c6 | https://github.com/sulu/SuluRedirectBundle/blob/913c501cced6c7db5fb96d4baf6cce4b884c65c6/Controller/RedirectRouteImportController.php#L85-L109 |
224,765 | sulu/SuluRedirectBundle | Import/Reader/CsvReader.php | CsvReader.interpret | private function interpret(array $line, array $header)
{
$item = [];
foreach ($header as $index => $key) {
$item[$key] = array_key_exists($index, $line) ? $line[$index] : null;
}
return $item;
} | php | private function interpret(array $line, array $header)
{
$item = [];
foreach ($header as $index => $key) {
$item[$key] = array_key_exists($index, $line) ? $line[$index] : null;
}
return $item;
} | [
"private",
"function",
"interpret",
"(",
"array",
"$",
"line",
",",
"array",
"$",
"header",
")",
"{",
"$",
"item",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"header",
"as",
"$",
"index",
"=>",
"$",
"key",
")",
"{",
"$",
"item",
"[",
"$",
"key",
... | Interpret given line.
@param array $line
@param array $header
@return array | [
"Interpret",
"given",
"line",
"."
] | 913c501cced6c7db5fb96d4baf6cce4b884c65c6 | https://github.com/sulu/SuluRedirectBundle/blob/913c501cced6c7db5fb96d4baf6cce4b884c65c6/Import/Reader/CsvReader.php#L64-L72 |
224,766 | addwiki/wikibase-api | src/Api/GenericOptions.php | GenericOptions.setOption | public function setOption( $option, $value ) {
if ( !is_string( $option ) ) {
throw new InvalidArgumentException( 'Option name needs to be a string' );
}
$this->options[$option] = $value;
} | php | public function setOption( $option, $value ) {
if ( !is_string( $option ) ) {
throw new InvalidArgumentException( 'Option name needs to be a string' );
}
$this->options[$option] = $value;
} | [
"public",
"function",
"setOption",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"option",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Option name needs to be a string'",
")",
";",
"}",
"$",
"... | Sets the value of the specified option.
@since 0.2
@param string $option
@param mixed $value
@throws InvalidArgumentException | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"option",
"."
] | 86d397451692bd5984cad83e9d4f76c78a844fa1 | https://github.com/addwiki/wikibase-api/blob/86d397451692bd5984cad83e9d4f76c78a844fa1/src/Api/GenericOptions.php#L50-L56 |
224,767 | addwiki/wikibase-api | src/Api/GenericOptions.php | GenericOptions.getOption | public function getOption( $option ) {
if ( !array_key_exists( $option, $this->options ) ) {
throw new OutOfBoundsException( "Option '$option' has not been set so cannot be obtained" );
}
return $this->options[$option];
} | php | public function getOption( $option ) {
if ( !array_key_exists( $option, $this->options ) ) {
throw new OutOfBoundsException( "Option '$option' has not been set so cannot be obtained" );
}
return $this->options[$option];
} | [
"public",
"function",
"getOption",
"(",
"$",
"option",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"option",
",",
"$",
"this",
"->",
"options",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"\"Option '$option' has not been set so cannot... | Returns the value of the specified option. If the option is not set,
an InvalidArgumentException is thrown.
@since 0.2
@param string $option
@throws OutOfBoundsException | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"option",
".",
"If",
"the",
"option",
"is",
"not",
"set",
"an",
"InvalidArgumentException",
"is",
"thrown",
"."
] | 86d397451692bd5984cad83e9d4f76c78a844fa1 | https://github.com/addwiki/wikibase-api/blob/86d397451692bd5984cad83e9d4f76c78a844fa1/src/Api/GenericOptions.php#L68-L74 |
224,768 | dereuromark/cakephp-data | src/Model/Table/LanguagesTable.php | LanguagesTable.codeList | public function codeList($conditions = []) {
$conditions += ['status' => 1];
$res = $this->find('all', ['conditions' => $conditions, 'fields' => ['code', 'name']]);
$ret = [];
foreach ($res as $language) {
$ret[$language['code']] = $language['name'];
}
return $ret;
} | php | public function codeList($conditions = []) {
$conditions += ['status' => 1];
$res = $this->find('all', ['conditions' => $conditions, 'fields' => ['code', 'name']]);
$ret = [];
foreach ($res as $language) {
$ret[$language['code']] = $language['name'];
}
return $ret;
} | [
"public",
"function",
"codeList",
"(",
"$",
"conditions",
"=",
"[",
"]",
")",
"{",
"$",
"conditions",
"+=",
"[",
"'status'",
"=>",
"1",
"]",
";",
"$",
"res",
"=",
"$",
"this",
"->",
"find",
"(",
"'all'",
",",
"[",
"'conditions'",
"=>",
"$",
"condit... | DE => Deutsch, ...
@param array $conditions
@return array | [
"DE",
"=",
">",
"Deutsch",
"..."
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/LanguagesTable.php#L154-L162 |
224,769 | opensky/OpenSkyRuntimeConfigBundle | Service/RuntimeParameterBag.php | RuntimeParameterBag.get | public function get($name)
{
$this->initialize();
if (!isset($this->parameters[$name]) && !array_key_exists($name, $this->parameters)) {
if ($this->container) {
return $this->container->getParameter($name);
}
return null;
}
retur... | php | public function get($name)
{
$this->initialize();
if (!isset($this->parameters[$name]) && !array_key_exists($name, $this->parameters)) {
if ($this->container) {
return $this->container->getParameter($name);
}
return null;
}
retur... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"name",
"]",
")",
"&&",
"!",
"array_key_exists",
"(",
"$",
"name",
"... | Gets a parameter by name. If the parameter is undefined, this method will
defer to the service container if available.
{@inheritdoc} | [
"Gets",
"a",
"parameter",
"by",
"name",
".",
"If",
"the",
"parameter",
"is",
"undefined",
"this",
"method",
"will",
"defer",
"to",
"the",
"service",
"container",
"if",
"available",
"."
] | bcd76223b6582d34ffcc3962802760bc98df8a6f | https://github.com/opensky/OpenSkyRuntimeConfigBundle/blob/bcd76223b6582d34ffcc3962802760bc98df8a6f/Service/RuntimeParameterBag.php#L59-L72 |
224,770 | opensky/OpenSkyRuntimeConfigBundle | Service/RuntimeParameterBag.php | RuntimeParameterBag.has | public function has($name)
{
$this->initialize();
if (parent::has($name)) {
return true;
}
if ($this->container !== null) {
return $this->container->hasParameter($name);
}
return false;
} | php | public function has($name)
{
$this->initialize();
if (parent::has($name)) {
return true;
}
if ($this->container !== null) {
return $this->container->hasParameter($name);
}
return false;
} | [
"public",
"function",
"has",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"if",
"(",
"parent",
"::",
"has",
"(",
"$",
"name",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"container",
"... | Returns whether a parameter is defined. This method does not consider
parameters from the service container, regardless of its availability.
{@inheritdoc} | [
"Returns",
"whether",
"a",
"parameter",
"is",
"defined",
".",
"This",
"method",
"does",
"not",
"consider",
"parameters",
"from",
"the",
"service",
"container",
"regardless",
"of",
"its",
"availability",
"."
] | bcd76223b6582d34ffcc3962802760bc98df8a6f | https://github.com/opensky/OpenSkyRuntimeConfigBundle/blob/bcd76223b6582d34ffcc3962802760bc98df8a6f/Service/RuntimeParameterBag.php#L80-L93 |
224,771 | tooleks/laravel-asset-version | src/Services/AssetService.php | AssetService.appendVersionToPath | protected function appendVersionToPath(string $path) : string
{
return ($this->version) ? ($path . '?v=' . $this->version) : ($path);
} | php | protected function appendVersionToPath(string $path) : string
{
return ($this->version) ? ($path . '?v=' . $this->version) : ($path);
} | [
"protected",
"function",
"appendVersionToPath",
"(",
"string",
"$",
"path",
")",
":",
"string",
"{",
"return",
"(",
"$",
"this",
"->",
"version",
")",
"?",
"(",
"$",
"path",
".",
"'?v='",
".",
"$",
"this",
"->",
"version",
")",
":",
"(",
"$",
"path",... | Append version parameter to the asset path.
@param string $path
@return string | [
"Append",
"version",
"parameter",
"to",
"the",
"asset",
"path",
"."
] | 0eae13d91002c3c29e1ae7c5809b540150d797fe | https://github.com/tooleks/laravel-asset-version/blob/0eae13d91002c3c29e1ae7c5809b540150d797fe/src/Services/AssetService.php#L88-L91 |
224,772 | flipboxstudio/image-controller | src/Flipbox/ImageController/ImageUploader.php | ImageUploader.createUploadedFile | protected function createUploadedFile($file)
{
try {
$imageManager = new ImageManager;
$image = $imageManager->make($file);
$extension = $this->getExtensionFromMime($image->mime());
$fileName = $this->generateFileName($extension);
$temporaryPath = $this->getTemporaryImageBasePath();
$this->temporar... | php | protected function createUploadedFile($file)
{
try {
$imageManager = new ImageManager;
$image = $imageManager->make($file);
$extension = $this->getExtensionFromMime($image->mime());
$fileName = $this->generateFileName($extension);
$temporaryPath = $this->getTemporaryImageBasePath();
$this->temporar... | [
"protected",
"function",
"createUploadedFile",
"(",
"$",
"file",
")",
"{",
"try",
"{",
"$",
"imageManager",
"=",
"new",
"ImageManager",
";",
"$",
"image",
"=",
"$",
"imageManager",
"->",
"make",
"(",
"$",
"file",
")",
";",
"$",
"extension",
"=",
"$",
"... | create uploaded file
@param string $file
@return UploadedFile | [
"create",
"uploaded",
"file"
] | a32649839adaec40929c14dce39fdaf764f07599 | https://github.com/flipboxstudio/image-controller/blob/a32649839adaec40929c14dce39fdaf764f07599/src/Flipbox/ImageController/ImageUploader.php#L94-L116 |
224,773 | flipboxstudio/image-controller | src/Flipbox/ImageController/ImageUploader.php | ImageUploader.getTemporaryImageBasePath | protected function getTemporaryImageBasePath()
{
$basePath = $this->getImageBasePath();
$temporaryPath = $basePath . '/'. $this->temporaryPath;
if (!File::exists($temporaryPath)) {
File::makeDirectory($temporaryPath, 0755, true);
}
return $temporaryPath;
} | php | protected function getTemporaryImageBasePath()
{
$basePath = $this->getImageBasePath();
$temporaryPath = $basePath . '/'. $this->temporaryPath;
if (!File::exists($temporaryPath)) {
File::makeDirectory($temporaryPath, 0755, true);
}
return $temporaryPath;
} | [
"protected",
"function",
"getTemporaryImageBasePath",
"(",
")",
"{",
"$",
"basePath",
"=",
"$",
"this",
"->",
"getImageBasePath",
"(",
")",
";",
"$",
"temporaryPath",
"=",
"$",
"basePath",
".",
"'/'",
".",
"$",
"this",
"->",
"temporaryPath",
";",
"if",
"("... | get temporary image base path
@return string | [
"get",
"temporary",
"image",
"base",
"path"
] | a32649839adaec40929c14dce39fdaf764f07599 | https://github.com/flipboxstudio/image-controller/blob/a32649839adaec40929c14dce39fdaf764f07599/src/Flipbox/ImageController/ImageUploader.php#L167-L178 |
224,774 | flipboxstudio/image-controller | src/Flipbox/ImageController/ImageUploader.php | ImageUploader.generateImageUrl | public function generateImageUrl($file, $size=null)
{
$url = $this->config->get('prefix').'/'.$file;
if (!is_null($size)) {
$url .= '?size='.$size;
}
return URL::to($url);
} | php | public function generateImageUrl($file, $size=null)
{
$url = $this->config->get('prefix').'/'.$file;
if (!is_null($size)) {
$url .= '?size='.$size;
}
return URL::to($url);
} | [
"public",
"function",
"generateImageUrl",
"(",
"$",
"file",
",",
"$",
"size",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'prefix'",
")",
".",
"'/'",
".",
"$",
"file",
";",
"if",
"(",
"!",
"is_null",
"(... | generate image file url
@param string $file, $size
@return string | [
"generate",
"image",
"file",
"url"
] | a32649839adaec40929c14dce39fdaf764f07599 | https://github.com/flipboxstudio/image-controller/blob/a32649839adaec40929c14dce39fdaf764f07599/src/Flipbox/ImageController/ImageUploader.php#L186-L195 |
224,775 | rambler-digital-solutions/hydrogen | src/Collection.php | Collection.wrap | public static function wrap($value): self
{
switch (true) {
case $value instanceof self:
return new static($value);
case $value instanceof BaseCollection:
return new static($value);
default:
return new static(Arr::wrap($va... | php | public static function wrap($value): self
{
switch (true) {
case $value instanceof self:
return new static($value);
case $value instanceof BaseCollection:
return new static($value);
default:
return new static(Arr::wrap($va... | [
"public",
"static",
"function",
"wrap",
"(",
"$",
"value",
")",
":",
"self",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"$",
"value",
"instanceof",
"self",
":",
"return",
"new",
"static",
"(",
"$",
"value",
")",
";",
"case",
"$",
"value",
"instanc... | Wrap the given value in a collection if applicable.
@param mixed $value
@return static | [
"Wrap",
"the",
"given",
"value",
"in",
"a",
"collection",
"if",
"applicable",
"."
] | 997f37ede0b88f345f049ead61862ae20b1fe5e2 | https://github.com/rambler-digital-solutions/hydrogen/blob/997f37ede0b88f345f049ead61862ae20b1fe5e2/src/Collection.php#L88-L100 |
224,776 | Influendo/laravel-survivor | src/SurvivorServiceProvider.php | SurvivorServiceProvider.boot | public function boot()
{
// Setup config file
$this->publishes([__DIR__ . '/../config/config.php' => config_path('survivor.php')], 'survivor');
// Also setup views
$this->loadViewsFrom(__DIR__.'/../views', 'survivor');
// Load the routes if not cached already
if ( !... | php | public function boot()
{
// Setup config file
$this->publishes([__DIR__ . '/../config/config.php' => config_path('survivor.php')], 'survivor');
// Also setup views
$this->loadViewsFrom(__DIR__.'/../views', 'survivor');
// Load the routes if not cached already
if ( !... | [
"public",
"function",
"boot",
"(",
")",
"{",
"// Setup config file",
"$",
"this",
"->",
"publishes",
"(",
"[",
"__DIR__",
".",
"'/../config/config.php'",
"=>",
"config_path",
"(",
"'survivor.php'",
")",
"]",
",",
"'survivor'",
")",
";",
"// Also setup views",
"$... | Boot up the provider and load routes
@return void | [
"Boot",
"up",
"the",
"provider",
"and",
"load",
"routes"
] | 422aa0727110a86b8b0557bc48c68a94f0de6fba | https://github.com/Influendo/laravel-survivor/blob/422aa0727110a86b8b0557bc48c68a94f0de6fba/src/SurvivorServiceProvider.php#L22-L42 |
224,777 | addwiki/wikibase-api | src/Api/Service/RevisionsGetter.php | RevisionsGetter.getRevisions | public function getRevisions( array $identifyingInfoArray ) {
$entityIdStrings = array();
$siteLinksStringMapping = array();
foreach( $identifyingInfoArray as $someInfo ) {
if( $someInfo instanceof EntityId ) {
$entityIdStrings[] = $someInfo->getSerialization();
} elseif ( $someInfo instanceof SiteLink... | php | public function getRevisions( array $identifyingInfoArray ) {
$entityIdStrings = array();
$siteLinksStringMapping = array();
foreach( $identifyingInfoArray as $someInfo ) {
if( $someInfo instanceof EntityId ) {
$entityIdStrings[] = $someInfo->getSerialization();
} elseif ( $someInfo instanceof SiteLink... | [
"public",
"function",
"getRevisions",
"(",
"array",
"$",
"identifyingInfoArray",
")",
"{",
"$",
"entityIdStrings",
"=",
"array",
"(",
")",
";",
"$",
"siteLinksStringMapping",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"identifyingInfoArray",
"as",
"$",
... | Get revisions for the entities identified using as few requests as possible.
@param array $identifyingInfoArray Can include the following:
EntityId EntityId objects
SiteLink SiteLink objects
string Serialized entity ids (these are not validated before passing to the api)
@since 0.4
@return Revisions | [
"Get",
"revisions",
"for",
"the",
"entities",
"identified",
"using",
"as",
"few",
"requests",
"as",
"possible",
"."
] | 86d397451692bd5984cad83e9d4f76c78a844fa1 | https://github.com/addwiki/wikibase-api/blob/86d397451692bd5984cad83e9d4f76c78a844fa1/src/Api/Service/RevisionsGetter.php#L58-L98 |
224,778 | dereuromark/cakephp-data | src/Model/Table/PostalCodesTable.php | PostalCodesTable.stats | public function stats() {
$res = [];
$query = $this->find();
$list = $query
->select(['count' => $query->count(), 'country_id'])
->group('country_id')
->hydrate(false)
->all();
foreach ($list as $x) {
$res[$x['country_id']] = (int)$x['count'];
}
return $res;
} | php | public function stats() {
$res = [];
$query = $this->find();
$list = $query
->select(['count' => $query->count(), 'country_id'])
->group('country_id')
->hydrate(false)
->all();
foreach ($list as $x) {
$res[$x['country_id']] = (int)$x['count'];
}
return $res;
} | [
"public",
"function",
"stats",
"(",
")",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"find",
"(",
")",
";",
"$",
"list",
"=",
"$",
"query",
"->",
"select",
"(",
"[",
"'count'",
"=>",
"$",
"query",
"->",
"count",
... | Postal codes per country
@return array | [
"Postal",
"codes",
"per",
"country"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/PostalCodesTable.php#L118-L133 |
224,779 | sulu/SuluRedirectBundle | Controller/WebsiteRedirectController.php | WebsiteRedirectController.redirect | public function redirect(Request $request, RedirectRouteInterface $redirectRoute)
{
if (410 === $redirectRoute->getStatusCode()) {
throw new HttpException(410);
}
$queryString = http_build_query($request->query->all());
$url = [
$redirectRoute->getTarget(),
... | php | public function redirect(Request $request, RedirectRouteInterface $redirectRoute)
{
if (410 === $redirectRoute->getStatusCode()) {
throw new HttpException(410);
}
$queryString = http_build_query($request->query->all());
$url = [
$redirectRoute->getTarget(),
... | [
"public",
"function",
"redirect",
"(",
"Request",
"$",
"request",
",",
"RedirectRouteInterface",
"$",
"redirectRoute",
")",
"{",
"if",
"(",
"410",
"===",
"$",
"redirectRoute",
"->",
"getStatusCode",
"(",
")",
")",
"{",
"throw",
"new",
"HttpException",
"(",
"... | Handles redirect for given redirect-route.
@param Request $request
@param RedirectRouteInterface $redirectRoute
@return RedirectResponse | [
"Handles",
"redirect",
"for",
"given",
"redirect",
"-",
"route",
"."
] | 913c501cced6c7db5fb96d4baf6cce4b884c65c6 | https://github.com/sulu/SuluRedirectBundle/blob/913c501cced6c7db5fb96d4baf6cce4b884c65c6/Controller/WebsiteRedirectController.php#L32-L49 |
224,780 | opensky/OpenSkyRuntimeConfigBundle | Service/RuntimeParameterBagLogger.php | RuntimeParameterBagLogger.log | public function log($message)
{
if (null !== $this->logger) {
call_user_func(array($this->logger, $this->level), $message);
}
} | php | public function log($message)
{
if (null !== $this->logger) {
call_user_func(array($this->logger, $this->level), $message);
}
} | [
"public",
"function",
"log",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"logger",
")",
"{",
"call_user_func",
"(",
"array",
"(",
"$",
"this",
"->",
"logger",
",",
"$",
"this",
"->",
"level",
")",
",",
"$",
"message"... | Log a message at the specified level.
@param string $message | [
"Log",
"a",
"message",
"at",
"the",
"specified",
"level",
"."
] | bcd76223b6582d34ffcc3962802760bc98df8a6f | https://github.com/opensky/OpenSkyRuntimeConfigBundle/blob/bcd76223b6582d34ffcc3962802760bc98df8a6f/Service/RuntimeParameterBagLogger.php#L35-L40 |
224,781 | dereuromark/cakephp-data | src/Controller/Admin/StatesController.php | StatesController._processCountry | protected function _processCountry($cid) {
$saveCid = true;
if (empty($cid)) {
$saveCid = false;
$cid = $this->request->getSession()->read('State.cid');
}
if (!empty($cid) && $cid < 0) {
$this->request->getSession()->delete('State.cid');
$cid = null;
} elseif (!empty($cid) && $saveCid) {
$this-... | php | protected function _processCountry($cid) {
$saveCid = true;
if (empty($cid)) {
$saveCid = false;
$cid = $this->request->getSession()->read('State.cid');
}
if (!empty($cid) && $cid < 0) {
$this->request->getSession()->delete('State.cid');
$cid = null;
} elseif (!empty($cid) && $saveCid) {
$this-... | [
"protected",
"function",
"_processCountry",
"(",
"$",
"cid",
")",
"{",
"$",
"saveCid",
"=",
"true",
";",
"if",
"(",
"empty",
"(",
"$",
"cid",
")",
")",
"{",
"$",
"saveCid",
"=",
"false",
";",
"$",
"cid",
"=",
"$",
"this",
"->",
"request",
"->",
"... | For both index views
@deprecated
@param int $cid
@return \Cake\Http\Response|null | [
"For",
"both",
"index",
"views"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Controller/Admin/StatesController.php#L193-L210 |
224,782 | dereuromark/cakephp-data | src/Controller/Admin/CurrenciesController.php | CurrenciesController.toggle | public function toggle($field = null, $id = null) {
$fields = ['active'];
if (!empty($field) && in_array($field, $fields) && !empty($id)) {
$value = $this->{$this->modelClass}->toggleField($field, $id);
}
# http get request + redirect
if (!$this->request->is('ajax')) {
$this->Flash->success(__('Save... | php | public function toggle($field = null, $id = null) {
$fields = ['active'];
if (!empty($field) && in_array($field, $fields) && !empty($id)) {
$value = $this->{$this->modelClass}->toggleField($field, $id);
}
# http get request + redirect
if (!$this->request->is('ajax')) {
$this->Flash->success(__('Save... | [
"public",
"function",
"toggle",
"(",
"$",
"field",
"=",
"null",
",",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"fields",
"=",
"[",
"'active'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"field",
")",
"&&",
"in_array",
"(",
"$",
"field",
",",
"$"... | Toggle - ajax
@param string|null $field
@param int|null $id
@return \Cake\Http\Response|null | [
"Toggle",
"-",
"ajax"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Controller/Admin/CurrenciesController.php#L152-L176 |
224,783 | mcustiel/php-simple-cache | src/Drivers/memcache/Cache.php | Cache.openConnection | private function openConnection(\stdClass $initData)
{
$connectionOptions = $this->parseConnectionData($initData);
if (isset($this->persistent) && (boolean) $this->persistent) {
$this->persistentConnect($connectionOptions);
} else {
$this->notPersistentConnect($connec... | php | private function openConnection(\stdClass $initData)
{
$connectionOptions = $this->parseConnectionData($initData);
if (isset($this->persistent) && (boolean) $this->persistent) {
$this->persistentConnect($connectionOptions);
} else {
$this->notPersistentConnect($connec... | [
"private",
"function",
"openConnection",
"(",
"\\",
"stdClass",
"$",
"initData",
")",
"{",
"$",
"connectionOptions",
"=",
"$",
"this",
"->",
"parseConnectionData",
"(",
"$",
"initData",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"persistent",
")... | Opens a connection to memcached server.
@param \stdClass $initData | [
"Opens",
"a",
"connection",
"to",
"memcached",
"server",
"."
] | ceb3856b5e672a7ab5196277e3e61dc697482a0b | https://github.com/mcustiel/php-simple-cache/blob/ceb3856b5e672a7ab5196277e3e61dc697482a0b/src/Drivers/memcache/Cache.php#L115-L123 |
224,784 | mcustiel/php-simple-cache | src/Drivers/memcache/Cache.php | Cache.parseConnectionData | private function parseConnectionData(\stdClass $initData)
{
$return = new \stdClass;
$return->host = isset($initData->host) ? $initData->host : self::DEFAULT_HOST;
$return->port = isset($initData->port) ? $initData->port : null;
$return->timeout = isset($initData->timeoutInSeconds) ?... | php | private function parseConnectionData(\stdClass $initData)
{
$return = new \stdClass;
$return->host = isset($initData->host) ? $initData->host : self::DEFAULT_HOST;
$return->port = isset($initData->port) ? $initData->port : null;
$return->timeout = isset($initData->timeoutInSeconds) ?... | [
"private",
"function",
"parseConnectionData",
"(",
"\\",
"stdClass",
"$",
"initData",
")",
"{",
"$",
"return",
"=",
"new",
"\\",
"stdClass",
";",
"$",
"return",
"->",
"host",
"=",
"isset",
"(",
"$",
"initData",
"->",
"host",
")",
"?",
"$",
"initData",
... | Fixes memcached configuration.
@param \stdClass $initData
@return \stdClass | [
"Fixes",
"memcached",
"configuration",
"."
] | ceb3856b5e672a7ab5196277e3e61dc697482a0b | https://github.com/mcustiel/php-simple-cache/blob/ceb3856b5e672a7ab5196277e3e61dc697482a0b/src/Drivers/memcache/Cache.php#L170-L178 |
224,785 | yii2mod/yii2-toggle-column | actions/ToggleAction.php | ToggleAction.run | public function run($id, $attribute)
{
$model = $this->findModel($this->modelClass, $id);
if (!$model->hasAttribute($attribute)) {
throw new InvalidConfigException("Attribute doesn't exist.");
}
if ($model->$attribute == $this->onValue) {
$model->$attribute ... | php | public function run($id, $attribute)
{
$model = $this->findModel($this->modelClass, $id);
if (!$model->hasAttribute($attribute)) {
throw new InvalidConfigException("Attribute doesn't exist.");
}
if ($model->$attribute == $this->onValue) {
$model->$attribute ... | [
"public",
"function",
"run",
"(",
"$",
"id",
",",
"$",
"attribute",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"this",
"->",
"modelClass",
",",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"model",
"->",
"hasAttribute",
"... | Change column value
@param $id
@param $attribute
@return \yii\web\Response
@throws InvalidConfigException | [
"Change",
"column",
"value"
] | f9251136728c70830a2b8fc138bf27c9638c8602 | https://github.com/yii2mod/yii2-toggle-column/blob/f9251136728c70830a2b8fc138bf27c9638c8602/actions/ToggleAction.php#L86-L123 |
224,786 | sulu/SuluRedirectBundle | Import/Writer/Writer.php | Writer.save | private function save(RedirectRouteInterface $entity)
{
$this->manager->save($entity);
if (0 === count($this->sources) % $this->batchSize) {
$this->entityManager->flush();
}
} | php | private function save(RedirectRouteInterface $entity)
{
$this->manager->save($entity);
if (0 === count($this->sources) % $this->batchSize) {
$this->entityManager->flush();
}
} | [
"private",
"function",
"save",
"(",
"RedirectRouteInterface",
"$",
"entity",
")",
"{",
"$",
"this",
"->",
"manager",
"->",
"save",
"(",
"$",
"entity",
")",
";",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"this",
"->",
"sources",
")",
"%",
"$",
"this",... | Save entity by using manager.
@param RedirectRouteInterface $entity | [
"Save",
"entity",
"by",
"using",
"manager",
"."
] | 913c501cced6c7db5fb96d4baf6cce4b884c65c6 | https://github.com/sulu/SuluRedirectBundle/blob/913c501cced6c7db5fb96d4baf6cce4b884c65c6/Import/Writer/Writer.php#L97-L104 |
224,787 | sulu/SuluRedirectBundle | Import/Writer/Writer.php | Writer.validate | private function validate(RedirectRouteInterface $entity)
{
if ('' === $entity->getTarget() && Response::HTTP_GONE !== (int)$entity->getStatusCode()) {
throw new TargetIsEmptyException($entity);
}
if (in_array(strtolower($entity->getSource()), $this->sources)) {
thro... | php | private function validate(RedirectRouteInterface $entity)
{
if ('' === $entity->getTarget() && Response::HTTP_GONE !== (int)$entity->getStatusCode()) {
throw new TargetIsEmptyException($entity);
}
if (in_array(strtolower($entity->getSource()), $this->sources)) {
thro... | [
"private",
"function",
"validate",
"(",
"RedirectRouteInterface",
"$",
"entity",
")",
"{",
"if",
"(",
"''",
"===",
"$",
"entity",
"->",
"getTarget",
"(",
")",
"&&",
"Response",
"::",
"HTTP_GONE",
"!==",
"(",
"int",
")",
"$",
"entity",
"->",
"getStatusCode"... | Validate given redirect-route.
@param RedirectRouteInterface $entity
@throws DuplicatedSourceException
@throws TargetIsEmptyException | [
"Validate",
"given",
"redirect",
"-",
"route",
"."
] | 913c501cced6c7db5fb96d4baf6cce4b884c65c6 | https://github.com/sulu/SuluRedirectBundle/blob/913c501cced6c7db5fb96d4baf6cce4b884c65c6/Import/Writer/Writer.php#L114-L123 |
224,788 | dereuromark/cakephp-data | src/Controller/Admin/LanguagesController.php | LanguagesController.importFromCore | public function importFromCore() {
if (!empty($this->request->query['reset'])) {
$this->Languages->truncate();
}
//$languages = $this->Languages->iso3ToIso2();
$languages = $this->Languages->catalog();
$count = 0;
$errors = [];
foreach ($languages as $language) {
if (!($code = $this->Languages->iso3... | php | public function importFromCore() {
if (!empty($this->request->query['reset'])) {
$this->Languages->truncate();
}
//$languages = $this->Languages->iso3ToIso2();
$languages = $this->Languages->catalog();
$count = 0;
$errors = [];
foreach ($languages as $language) {
if (!($code = $this->Languages->iso3... | [
"public",
"function",
"importFromCore",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"request",
"->",
"query",
"[",
"'reset'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"Languages",
"->",
"truncate",
"(",
")",
";",
"}",
"//$languages ... | Should only be done once at the very beginning
@return \Cake\Http\Response|null | [
"Should",
"only",
"be",
"done",
"once",
"at",
"the",
"very",
"beginning"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Controller/Admin/LanguagesController.php#L119-L155 |
224,789 | mediumart/orange-sms | src/SMS.php | SMS.from | public function from($number, $name = null)
{
$this->senderNumber = $number;
$this->senderName = $name;
return $this;
} | php | public function from($number, $name = null)
{
$this->senderNumber = $number;
$this->senderName = $name;
return $this;
} | [
"public",
"function",
"from",
"(",
"$",
"number",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"senderNumber",
"=",
"$",
"number",
";",
"$",
"this",
"->",
"senderName",
"=",
"$",
"name",
";",
"return",
"$",
"this",
";",
"}"
] | set SMS sender details.
@param string $number
@param string|null $name
@return $this | [
"set",
"SMS",
"sender",
"details",
"."
] | 62aff9d24c326663fa8b9e742fa3f15c9df20945 | https://github.com/mediumart/orange-sms/blob/62aff9d24c326663fa8b9e742fa3f15c9df20945/src/SMS.php#L83-L90 |
224,790 | mediumart/orange-sms | src/SMS.php | SMS.send | public function send()
{
return $this->client->executeRequest(
new OutboundSMSRequest(
$this->message,
$this->recipientNumber,
$this->senderNumber,
$this->senderName
)
);
} | php | public function send()
{
return $this->client->executeRequest(
new OutboundSMSRequest(
$this->message,
$this->recipientNumber,
$this->senderNumber,
$this->senderName
)
);
} | [
"public",
"function",
"send",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"executeRequest",
"(",
"new",
"OutboundSMSRequest",
"(",
"$",
"this",
"->",
"message",
",",
"$",
"this",
"->",
"recipientNumber",
",",
"$",
"this",
"->",
"senderNumbe... | Send SMS.
@return array | [
"Send",
"SMS",
"."
] | 62aff9d24c326663fa8b9e742fa3f15c9df20945 | https://github.com/mediumart/orange-sms/blob/62aff9d24c326663fa8b9e742fa3f15c9df20945/src/SMS.php#L110-L120 |
224,791 | mediumart/orange-sms | src/SMS.php | SMS.statistics | public function statistics($country = null, $appID = null)
{
return $this->client->executeRequest(
new StatisticsRequest($country, $appID)
);
} | php | public function statistics($country = null, $appID = null)
{
return $this->client->executeRequest(
new StatisticsRequest($country, $appID)
);
} | [
"public",
"function",
"statistics",
"(",
"$",
"country",
"=",
"null",
",",
"$",
"appID",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"executeRequest",
"(",
"new",
"StatisticsRequest",
"(",
"$",
"country",
",",
"$",
"appID",
")",
... | Get SMS statistics.
@param string|null $country
@param string|null $appID
@return array | [
"Get",
"SMS",
"statistics",
"."
] | 62aff9d24c326663fa8b9e742fa3f15c9df20945 | https://github.com/mediumart/orange-sms/blob/62aff9d24c326663fa8b9e742fa3f15c9df20945/src/SMS.php#L155-L160 |
224,792 | mediumart/orange-sms | src/SMS.php | SMS.setDeliveryReceiptNotificationUrl | public function setDeliveryReceiptNotificationUrl($url, $sender = null)
{
return $this->client->executeRequest(
new SMSDRRegisterCallbackRequest($url, $sender ?: $this->senderNumber)
);
} | php | public function setDeliveryReceiptNotificationUrl($url, $sender = null)
{
return $this->client->executeRequest(
new SMSDRRegisterCallbackRequest($url, $sender ?: $this->senderNumber)
);
} | [
"public",
"function",
"setDeliveryReceiptNotificationUrl",
"(",
"$",
"url",
",",
"$",
"sender",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"executeRequest",
"(",
"new",
"SMSDRRegisterCallbackRequest",
"(",
"$",
"url",
",",
"$",
"sender... | Set the SMS DR notification endpoint.
@param $url
@param $sender
@return array | [
"Set",
"the",
"SMS",
"DR",
"notification",
"endpoint",
"."
] | 62aff9d24c326663fa8b9e742fa3f15c9df20945 | https://github.com/mediumart/orange-sms/blob/62aff9d24c326663fa8b9e742fa3f15c9df20945/src/SMS.php#L169-L174 |
224,793 | mediumart/orange-sms | src/SMS.php | SMS.deleteDeliveryReceiptNotificationUrl | public function deleteDeliveryReceiptNotificationUrl($id, $sender = null)
{
return $this->client->executeRequest(
new SMSDRDeleteCallbackRequest($id, $sender ?: $this->senderNumber)
);
} | php | public function deleteDeliveryReceiptNotificationUrl($id, $sender = null)
{
return $this->client->executeRequest(
new SMSDRDeleteCallbackRequest($id, $sender ?: $this->senderNumber)
);
} | [
"public",
"function",
"deleteDeliveryReceiptNotificationUrl",
"(",
"$",
"id",
",",
"$",
"sender",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"executeRequest",
"(",
"new",
"SMSDRDeleteCallbackRequest",
"(",
"$",
"id",
",",
"$",
"sender"... | Delete the SMS DR notification endpoint.
@param $id
@param $sender
@return array | [
"Delete",
"the",
"SMS",
"DR",
"notification",
"endpoint",
"."
] | 62aff9d24c326663fa8b9e742fa3f15c9df20945 | https://github.com/mediumart/orange-sms/blob/62aff9d24c326663fa8b9e742fa3f15c9df20945/src/SMS.php#L196-L201 |
224,794 | dereuromark/cakephp-data | src/Model/Table/CurrenciesTable.php | CurrenciesTable.foreignCurrencies | public function foreignCurrencies($options = []) {
$defaults = ['conditions' => [$this->getAlias() . '.base' => 0]];
$options = Hash::merge($defaults, $options);
return $this->find('all', $options);
} | php | public function foreignCurrencies($options = []) {
$defaults = ['conditions' => [$this->getAlias() . '.base' => 0]];
$options = Hash::merge($defaults, $options);
return $this->find('all', $options);
} | [
"public",
"function",
"foreignCurrencies",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'conditions'",
"=>",
"[",
"$",
"this",
"->",
"getAlias",
"(",
")",
".",
"'.base'",
"=>",
"0",
"]",
"]",
";",
"$",
"options",
"=",
"... | All except base one
@param array $options
@return \Cake\ORM\Query | [
"All",
"except",
"base",
"one"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/CurrenciesTable.php#L194-L198 |
224,795 | dereuromark/cakephp-data | src/Model/Table/CurrenciesTable.php | CurrenciesTable.availableCurrencies | public function availableCurrencies() {
if (!isset($this->CurrencyLib)) {
$this->CurrencyLib = new CurrencyLib();
}
$base = $this->baseCurrency();
$res = $this->CurrencyLib->table($base['code'], 4);
if ($res) {
return $res;
}
return [];
} | php | public function availableCurrencies() {
if (!isset($this->CurrencyLib)) {
$this->CurrencyLib = new CurrencyLib();
}
$base = $this->baseCurrency();
$res = $this->CurrencyLib->table($base['code'], 4);
if ($res) {
return $res;
}
return [];
} | [
"public",
"function",
"availableCurrencies",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"CurrencyLib",
")",
")",
"{",
"$",
"this",
"->",
"CurrencyLib",
"=",
"new",
"CurrencyLib",
"(",
")",
";",
"}",
"$",
"base",
"=",
"$",
"this",... | For calculation etc
@return array | [
"For",
"calculation",
"etc"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/CurrenciesTable.php#L216-L226 |
224,796 | dereuromark/cakephp-data | src/Model/Table/CurrenciesTable.php | CurrenciesTable.currencyList | public function currencyList() {
$res = $this->availableCurrencies();
foreach ($res as $key => $val) {
$val = $key;
$valExt = $this->CurrencyLib->getName($key);
if ($valExt) {
$val .= ' - ' . $valExt;
}
$res[$key] = $val;
}
return $res;
} | php | public function currencyList() {
$res = $this->availableCurrencies();
foreach ($res as $key => $val) {
$val = $key;
$valExt = $this->CurrencyLib->getName($key);
if ($valExt) {
$val .= ' - ' . $valExt;
}
$res[$key] = $val;
}
return $res;
} | [
"public",
"function",
"currencyList",
"(",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"availableCurrencies",
"(",
")",
";",
"foreach",
"(",
"$",
"res",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"val",
"=",
"$",
"key",
";",
"$",
"valEx... | For user selection
@return array | [
"For",
"user",
"selection"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/CurrenciesTable.php#L233-L246 |
224,797 | enlitepro/enlite-monolog | src/EnliteMonolog/Service/MonologServiceFactory.php | MonologServiceFactory.createInstanceFromArguments | private function createInstanceFromArguments($className, array $arguments)
{
$reflection = new \ReflectionClass($className);
$constructor = $reflection->getConstructor();
// There is no or at least a non-accessible constructor for provided class name,
// therefore there is no need t... | php | private function createInstanceFromArguments($className, array $arguments)
{
$reflection = new \ReflectionClass($className);
$constructor = $reflection->getConstructor();
// There is no or at least a non-accessible constructor for provided class name,
// therefore there is no need t... | [
"private",
"function",
"createInstanceFromArguments",
"(",
"$",
"className",
",",
"array",
"$",
"arguments",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
"$",
"constructor",
"=",
"$",
"reflection",
"->",
... | Handles the constructor arguments and if they're named, just sort them to fit constructor ordering.
@param string $className
@param array $arguments
@return object
@throws \InvalidArgumentException If given arguments are not valid for provided className constructor. | [
"Handles",
"the",
"constructor",
"arguments",
"and",
"if",
"they",
"re",
"named",
"just",
"sort",
"them",
"to",
"fit",
"constructor",
"ordering",
"."
] | 4c3064f25499ee78b26e4706852acae3e228e81f | https://github.com/enlitepro/enlite-monolog/blob/4c3064f25499ee78b26e4706852acae3e228e81f/src/EnliteMonolog/Service/MonologServiceFactory.php#L250-L306 |
224,798 | schmittjoh/composer-deps-analyzer | src/JMS/Composer/Graph/DependencyGraph.php | DependencyGraph.getAggregatePackageContaining | public function getAggregatePackageContaining($packageName)
{
foreach ($this->packages as $packageNode) {
if ($packageNode->replaces($packageName)) {
return $packageNode;
}
}
return null;
} | php | public function getAggregatePackageContaining($packageName)
{
foreach ($this->packages as $packageNode) {
if ($packageNode->replaces($packageName)) {
return $packageNode;
}
}
return null;
} | [
"public",
"function",
"getAggregatePackageContaining",
"(",
"$",
"packageName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"packages",
"as",
"$",
"packageNode",
")",
"{",
"if",
"(",
"$",
"packageNode",
"->",
"replaces",
"(",
"$",
"packageName",
")",
")",
... | Searches the graph for an aggregate package that contains the given package.
@param string $packageName the name of the contained package
@return PackageNode|null the aggregate package | [
"Searches",
"the",
"graph",
"for",
"an",
"aggregate",
"package",
"that",
"contains",
"the",
"given",
"package",
"."
] | 6e72a866c40a98e63efb6bb059a2bbaadcb8aa15 | https://github.com/schmittjoh/composer-deps-analyzer/blob/6e72a866c40a98e63efb6bb059a2bbaadcb8aa15/src/JMS/Composer/Graph/DependencyGraph.php#L156-L165 |
224,799 | dereuromark/cakephp-data | src/Model/Table/AddressesTable.php | AddressesTable.fitsToCountry | public function fitsToCountry($data) {
if (!isset($data['country_id']) || !isset($data['country_province_id'])) {
return true;
}
$res = $this->Countries->States->find('list', [
'conditions' => ['country_id' => $data['country_id']]
])->toArray();
if (empty($res) || array_shift($data) == 0) {
$data['co... | php | public function fitsToCountry($data) {
if (!isset($data['country_id']) || !isset($data['country_province_id'])) {
return true;
}
$res = $this->Countries->States->find('list', [
'conditions' => ['country_id' => $data['country_id']]
])->toArray();
if (empty($res) || array_shift($data) == 0) {
$data['co... | [
"public",
"function",
"fitsToCountry",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'country_id'",
"]",
")",
"||",
"!",
"isset",
"(",
"$",
"data",
"[",
"'country_province_id'",
"]",
")",
")",
"{",
"return",
"true",
";"... | Validation of country_province_id
@param string $data
@return bool | [
"Validation",
"of",
"country_province_id"
] | 362f8db270fc994ac3665c33682cefba7d73bb44 | https://github.com/dereuromark/cakephp-data/blob/362f8db270fc994ac3665c33682cefba7d73bb44/src/Model/Table/AddressesTable.php#L231-L244 |
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.