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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
187,500 | hutnikau/job-scheduler | src/Scheduler.php | Scheduler.sortActions | protected function sortActions(\ArrayIterator $iterator)
{
$iterator->uasort(function ($a, $b) {
return $a->getTime()->getTimestamp() - $b->getTime()->getTimestamp();
});
} | php | protected function sortActions(\ArrayIterator $iterator)
{
$iterator->uasort(function ($a, $b) {
return $a->getTime()->getTimestamp() - $b->getTime()->getTimestamp();
});
} | [
"protected",
"function",
"sortActions",
"(",
"\\",
"ArrayIterator",
"$",
"iterator",
")",
"{",
"$",
"iterator",
"->",
"uasort",
"(",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"$",
"a",
"->",
"getTime",
"(",
")",
"->",
"getTimestamp"... | Sort actions by execution time
@param \ArrayIterator $iterator - iterator to append actions | [
"Sort",
"actions",
"by",
"execution",
"time"
] | 8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc | https://github.com/hutnikau/job-scheduler/blob/8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc/src/Scheduler.php#L77-L82 |
187,501 | hutnikau/job-scheduler | src/Worker/AbstractWorker.php | AbstractWorker.getSeconds | private function getSeconds(DateInterval $interval)
{
$date = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
$date2 = $date->add($interval);
return $date2->getTimestamp() - $date->getTimestamp();
} | php | private function getSeconds(DateInterval $interval)
{
$date = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
$date2 = $date->add($interval);
return $date2->getTimestamp() - $date->getTimestamp();
} | [
"private",
"function",
"getSeconds",
"(",
"DateInterval",
"$",
"interval",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTimeImmutable",
"(",
"'now'",
",",
"new",
"\\",
"DateTimeZone",
"(",
"'UTC'",
")",
")",
";",
"$",
"date2",
"=",
"$",
"date",
"->",
... | Get amount of seconds in date interval
@param DateInterval $interval
@return int
@throws \Exception | [
"Get",
"amount",
"of",
"seconds",
"in",
"date",
"interval"
] | 8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc | https://github.com/hutnikau/job-scheduler/blob/8aaa520d9eb6e1e3dcc79ae5d63c41fbcb9f25fc/src/Worker/AbstractWorker.php#L119-L124 |
187,502 | yajra/laravel-acl | src/Traits/HasRole.php | HasRole.canAtLeast | public function canAtLeast(array $permissions)
{
$can = false;
if (auth()->check()) {
foreach ($this->roles as $role) {
if ($role->canAtLeast($permissions)) {
$can = true;
}
}
} else {
$guest = Role::whe... | php | public function canAtLeast(array $permissions)
{
$can = false;
if (auth()->check()) {
foreach ($this->roles as $role) {
if ($role->canAtLeast($permissions)) {
$can = true;
}
}
} else {
$guest = Role::whe... | [
"public",
"function",
"canAtLeast",
"(",
"array",
"$",
"permissions",
")",
"{",
"$",
"can",
"=",
"false",
";",
"if",
"(",
"auth",
"(",
")",
"->",
"check",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"roles",
"as",
"$",
"role",
")",
"{"... | Check if user has at least one of the given permissions
@param array $permissions
@return bool | [
"Check",
"if",
"user",
"has",
"at",
"least",
"one",
"of",
"the",
"given",
"permissions"
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasRole.php#L27-L46 |
187,503 | yajra/laravel-acl | src/Traits/HasRole.php | HasRole.hasRole | public function hasRole($role)
{
if (is_string($role)) {
return $this->roles->contains('slug', $role);
}
if (is_array($role)) {
$roles = $this->getRoleSlugs();
$intersection = array_intersect($roles, (array) $role);
$intersectionCount = ... | php | public function hasRole($role)
{
if (is_string($role)) {
return $this->roles->contains('slug', $role);
}
if (is_array($role)) {
$roles = $this->getRoleSlugs();
$intersection = array_intersect($roles, (array) $role);
$intersectionCount = ... | [
"public",
"function",
"hasRole",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"role",
")",
")",
"{",
"return",
"$",
"this",
"->",
"roles",
"->",
"contains",
"(",
"'slug'",
",",
"$",
"role",
")",
";",
"}",
"if",
"(",
"is_array",
"... | Check if user has the given role.
@param string|array $role
@return bool | [
"Check",
"if",
"user",
"has",
"the",
"given",
"role",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasRole.php#L54-L70 |
187,504 | yajra/laravel-acl | src/Traits/HasRole.php | HasRole.attachRoleBySlug | public function attachRoleBySlug($slug)
{
$role = Role::where('slug', $slug)->first();
return $this->attachRole($role);
} | php | public function attachRoleBySlug($slug)
{
$role = Role::where('slug', $slug)->first();
return $this->attachRole($role);
} | [
"public",
"function",
"attachRoleBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"role",
"=",
"Role",
"::",
"where",
"(",
"'slug'",
",",
"$",
"slug",
")",
"->",
"first",
"(",
")",
";",
"return",
"$",
"this",
"->",
"attachRole",
"(",
"$",
"role",
")",
";"... | Attach a role to user using slug.
@param $slug
@return bool | [
"Attach",
"a",
"role",
"to",
"user",
"using",
"slug",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasRole.php#L92-L97 |
187,505 | yajra/laravel-acl | src/Traits/HasRole.php | HasRole.scopeHavingRoles | public function scopeHavingRoles($query, array $roles)
{
return $query->whereExists(function ($query) use ($roles) {
$query->selectRaw('1')
->from('role_user')
->whereRaw('role_user.user_id = users.id')
->whereIn('role_id', $roles);
}... | php | public function scopeHavingRoles($query, array $roles)
{
return $query->whereExists(function ($query) use ($roles) {
$query->selectRaw('1')
->from('role_user')
->whereRaw('role_user.user_id = users.id')
->whereIn('role_id', $roles);
}... | [
"public",
"function",
"scopeHavingRoles",
"(",
"$",
"query",
",",
"array",
"$",
"roles",
")",
"{",
"return",
"$",
"query",
"->",
"whereExists",
"(",
"function",
"(",
"$",
"query",
")",
"use",
"(",
"$",
"roles",
")",
"{",
"$",
"query",
"->",
"selectRaw"... | Query scope for user having the given roles.
@param \Illuminate\Database\Eloquent\Builder $query
@param array $roles
@return mixed | [
"Query",
"scope",
"for",
"user",
"having",
"the",
"given",
"roles",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasRole.php#L144-L152 |
187,506 | yajra/laravel-acl | src/Traits/HasRole.php | HasRole.revokeRoleBySlug | public function revokeRoleBySlug($slug)
{
$role = Role::where('slug', $slug)->first();
return $this->roles()->detach($role);
} | php | public function revokeRoleBySlug($slug)
{
$role = Role::where('slug', $slug)->first();
return $this->roles()->detach($role);
} | [
"public",
"function",
"revokeRoleBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"role",
"=",
"Role",
"::",
"where",
"(",
"'slug'",
",",
"$",
"slug",
")",
"->",
"first",
"(",
")",
";",
"return",
"$",
"this",
"->",
"roles",
"(",
")",
"->",
"detach",
"(",
... | Revokes the given role from the user using slug.
@param string $slug
@return bool | [
"Revokes",
"the",
"given",
"role",
"from",
"the",
"user",
"using",
"slug",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasRole.php#L160-L165 |
187,507 | yajra/laravel-acl | src/Traits/HasRole.php | HasRole.getPermissions | public function getPermissions()
{
$permissions = [[], []];
foreach ($this->roles as $role) {
$permissions[] = $role->getPermissions();
}
return call_user_func_array('array_merge', $permissions);
} | php | public function getPermissions()
{
$permissions = [[], []];
foreach ($this->roles as $role) {
$permissions[] = $role->getPermissions();
}
return call_user_func_array('array_merge', $permissions);
} | [
"public",
"function",
"getPermissions",
"(",
")",
"{",
"$",
"permissions",
"=",
"[",
"[",
"]",
",",
"[",
"]",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"roles",
"as",
"$",
"role",
")",
"{",
"$",
"permissions",
"[",
"]",
"=",
"$",
"role",
"->",... | Get all user role permissions.
@return array|null | [
"Get",
"all",
"user",
"role",
"permissions",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasRole.php#L204-L213 |
187,508 | yajra/laravel-acl | src/Models/Permission.php | Permission.createResource | public static function createResource($resource, $system = false)
{
$group = ucfirst($resource);
$slug = strtolower($group);
$permissions = [
[
'slug' => $slug . '.view',
'resource' => $group,
'name' => 'View... | php | public static function createResource($resource, $system = false)
{
$group = ucfirst($resource);
$slug = strtolower($group);
$permissions = [
[
'slug' => $slug . '.view',
'resource' => $group,
'name' => 'View... | [
"public",
"static",
"function",
"createResource",
"(",
"$",
"resource",
",",
"$",
"system",
"=",
"false",
")",
"{",
"$",
"group",
"=",
"ucfirst",
"(",
"$",
"resource",
")",
";",
"$",
"slug",
"=",
"strtolower",
"(",
"$",
"group",
")",
";",
"$",
"permi... | Create a permissions for a resource.
@param $resource
@param bool $system
@return \Illuminate\Support\Collection | [
"Create",
"a",
"permissions",
"for",
"a",
"resource",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Models/Permission.php#L38-L79 |
187,509 | yajra/laravel-acl | src/Traits/HasPermission.php | HasPermission.assignPermission | public function assignPermission($permissionId = null)
{
$permissions = $this->permissions;
if (! $permissions->contains($permissionId)) {
$this->permissions()->attach($permissionId);
return true;
}
return false;
} | php | public function assignPermission($permissionId = null)
{
$permissions = $this->permissions;
if (! $permissions->contains($permissionId)) {
$this->permissions()->attach($permissionId);
return true;
}
return false;
} | [
"public",
"function",
"assignPermission",
"(",
"$",
"permissionId",
"=",
"null",
")",
"{",
"$",
"permissions",
"=",
"$",
"this",
"->",
"permissions",
";",
"if",
"(",
"!",
"$",
"permissions",
"->",
"contains",
"(",
"$",
"permissionId",
")",
")",
"{",
"$",... | Assigns the given permission to the role.
@param int $permissionId
@return bool | [
"Assigns",
"the",
"given",
"permission",
"to",
"the",
"role",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasPermission.php#L15-L26 |
187,510 | yajra/laravel-acl | src/Traits/HasPermission.php | HasPermission.canAtLeast | public function canAtLeast(array $permission = [])
{
$permissions = $this->getPermissions();
$intersection = array_intersect($permissions, $permission);
$intersectionCount = count($intersection);
return ($intersectionCount > 0) ? true : false;
} | php | public function canAtLeast(array $permission = [])
{
$permissions = $this->getPermissions();
$intersection = array_intersect($permissions, $permission);
$intersectionCount = count($intersection);
return ($intersectionCount > 0) ? true : false;
} | [
"public",
"function",
"canAtLeast",
"(",
"array",
"$",
"permission",
"=",
"[",
"]",
")",
"{",
"$",
"permissions",
"=",
"$",
"this",
"->",
"getPermissions",
"(",
")",
";",
"$",
"intersection",
"=",
"array_intersect",
"(",
"$",
"permissions",
",",
"$",
"pe... | Check if the role has at least one of the given permissions.
@param array $permission
@return bool | [
"Check",
"if",
"the",
"role",
"has",
"at",
"least",
"one",
"of",
"the",
"given",
"permissions",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/HasPermission.php#L107-L115 |
187,511 | yajra/laravel-acl | src/Directives/RoleDirective.php | RoleDirective.handle | public function handle($role)
{
if ($this->auth->check()) {
return $this->auth->user()->isRole($role);
} else {
if ($role === 'guest') {
return true;
}
}
return false;
} | php | public function handle($role)
{
if ($this->auth->check()) {
return $this->auth->user()->isRole($role);
} else {
if ($role === 'guest') {
return true;
}
}
return false;
} | [
"public",
"function",
"handle",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"auth",
"->",
"check",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"auth",
"->",
"user",
"(",
")",
"->",
"isRole",
"(",
"$",
"role",
")",
";",
"}",
... | Is Role blade directive compiler.
@param string $role
@return bool | [
"Is",
"Role",
"blade",
"directive",
"compiler",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Directives/RoleDirective.php#L13-L24 |
187,512 | yajra/laravel-acl | src/Directives/HasRoleDirective.php | HasRoleDirective.handle | public function handle($roles)
{
if ($this->auth->check()) {
return $this->auth->user()->hasRole($roles);
}
return false;
} | php | public function handle($roles)
{
if ($this->auth->check()) {
return $this->auth->user()->hasRole($roles);
}
return false;
} | [
"public",
"function",
"handle",
"(",
"$",
"roles",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"auth",
"->",
"check",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"auth",
"->",
"user",
"(",
")",
"->",
"hasRole",
"(",
"$",
"roles",
")",
";",
"}"... | Handle hasRole directive.
@param string|array $roles
@return bool | [
"Handle",
"hasRole",
"directive",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Directives/HasRoleDirective.php#L13-L20 |
187,513 | yajra/laravel-acl | src/GateRegistrar.php | GateRegistrar.register | public function register()
{
$this->getPermissions()->each(function (Permission $permission) {
$ability = $permission->slug;
$policy = function ($user) use ($permission) {
return $user->hasRole($permission->roles);
};
if (Str::contains($permi... | php | public function register()
{
$this->getPermissions()->each(function (Permission $permission) {
$ability = $permission->slug;
$policy = function ($user) use ($permission) {
return $user->hasRole($permission->roles);
};
if (Str::contains($permi... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"getPermissions",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"Permission",
"$",
"permission",
")",
"{",
"$",
"ability",
"=",
"$",
"permission",
"->",
"slug",
";",
"$",
"policy",
"="... | Handle permission gate registration. | [
"Handle",
"permission",
"gate",
"registration",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/GateRegistrar.php#L38-L53 |
187,514 | yajra/laravel-acl | src/GateRegistrar.php | GateRegistrar.getPermissions | protected function getPermissions()
{
try {
return $this->cache->rememberForever('permissions.policies', function () {
return Permission::with('roles')->get();
});
} catch (\Exception $exception) {
$this->cache->forget('permissions.policies');
... | php | protected function getPermissions()
{
try {
return $this->cache->rememberForever('permissions.policies', function () {
return Permission::with('roles')->get();
});
} catch (\Exception $exception) {
$this->cache->forget('permissions.policies');
... | [
"protected",
"function",
"getPermissions",
"(",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"cache",
"->",
"rememberForever",
"(",
"'permissions.policies'",
",",
"function",
"(",
")",
"{",
"return",
"Permission",
"::",
"with",
"(",
"'roles'",
")",
"->... | Get all permissions.
@return Collection | [
"Get",
"all",
"permissions",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/GateRegistrar.php#L60-L71 |
187,515 | yajra/laravel-acl | src/AclServiceProvider.php | AclServiceProvider.registerCacheListener | protected function registerCacheListener()
{
Permission::saved(function () {
$this->app['cache.store']->forget('permissions.policies');
});
Permission::deleted(function () {
$this->app['cache.store']->forget('permissions.policies');
});
Role::saved(f... | php | protected function registerCacheListener()
{
Permission::saved(function () {
$this->app['cache.store']->forget('permissions.policies');
});
Permission::deleted(function () {
$this->app['cache.store']->forget('permissions.policies');
});
Role::saved(f... | [
"protected",
"function",
"registerCacheListener",
"(",
")",
"{",
"Permission",
"::",
"saved",
"(",
"function",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"[",
"'cache.store'",
"]",
"->",
"forget",
"(",
"'permissions.policies'",
")",
";",
"}",
")",
";",
"Perm... | Register ACL models cache listener. | [
"Register",
"ACL",
"models",
"cache",
"listener",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/AclServiceProvider.php#L53-L70 |
187,516 | yajra/laravel-acl | src/AclServiceProvider.php | AclServiceProvider.registerBladeDirectives | protected function registerBladeDirectives()
{
/** @var BladeCompiler $blade */
$blade = $this->app['blade.compiler'];
$blade->directive('canAtLeast', function ($expression) {
return "<?php if (app('laravel-acl.directives.canAtLeast')->handle({$expression})): ?>";
});
... | php | protected function registerBladeDirectives()
{
/** @var BladeCompiler $blade */
$blade = $this->app['blade.compiler'];
$blade->directive('canAtLeast', function ($expression) {
return "<?php if (app('laravel-acl.directives.canAtLeast')->handle({$expression})): ?>";
});
... | [
"protected",
"function",
"registerBladeDirectives",
"(",
")",
"{",
"/** @var BladeCompiler $blade */",
"$",
"blade",
"=",
"$",
"this",
"->",
"app",
"[",
"'blade.compiler'",
"]",
";",
"$",
"blade",
"->",
"directive",
"(",
"'canAtLeast'",
",",
"function",
"(",
"$"... | Register custom blade directives. | [
"Register",
"custom",
"blade",
"directives",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/AclServiceProvider.php#L75-L107 |
187,517 | yajra/laravel-acl | src/Directives/CanAtLeastDirective.php | CanAtLeastDirective.handle | public function handle($permissions)
{
if ($this->auth->check()) {
return $this->auth->user()->canAtLeast((array) $permissions);
} else {
$guest = Role::whereSlug('guest')->first();
if ($guest) {
return $guest->canAtLeast((array) $permissions);
... | php | public function handle($permissions)
{
if ($this->auth->check()) {
return $this->auth->user()->canAtLeast((array) $permissions);
} else {
$guest = Role::whereSlug('guest')->first();
if ($guest) {
return $guest->canAtLeast((array) $permissions);
... | [
"public",
"function",
"handle",
"(",
"$",
"permissions",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"auth",
"->",
"check",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"auth",
"->",
"user",
"(",
")",
"->",
"canAtLeast",
"(",
"(",
"array",
")",
"... | Can at least blade directive compiler.
@param string|array $permissions
@return bool
@throws \Exception
@throws \Throwable | [
"Can",
"at",
"least",
"blade",
"directive",
"compiler",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Directives/CanAtLeastDirective.php#L17-L29 |
187,518 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.bookmarkedJobs | public function bookmarkedJobs() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/job-bookmarks';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked in method comments... | php | public function bookmarkedJobs() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/job-bookmarks';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked in method comments... | [
"public",
"function",
"bookmarkedJobs",
"(",
")",
"{",
"// construct and send the request ",
"$",
"query",
"=",
"self",
"::",
"_URL_API",
".",
"'/v1/people/~/job-bookmarks'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"fetch",
"(",
"'GET'",
",",
"$",
"query"... | Get list of jobs you have bookmarked.
Returns a list of jobs the current user has bookmarked, per:
http://developer.linkedin.com/docs/DOC-1323
@return arr
Array containing retrieval success, LinkedIn response. | [
"Get",
"list",
"of",
"jobs",
"you",
"have",
"bookmarked",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L232-L242 |
187,519 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.checkResponse | private function checkResponse($http_code_required, $response) {
// check passed data
if(is_array($http_code_required)) {
array_walk($http_code_required, function($value, $key) {
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer... | php | private function checkResponse($http_code_required, $response) {
// check passed data
if(is_array($http_code_required)) {
array_walk($http_code_required, function($value, $key) {
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer... | [
"private",
"function",
"checkResponse",
"(",
"$",
"http_code_required",
",",
"$",
"response",
")",
"{",
"// check passed data",
"if",
"(",
"is_array",
"(",
"$",
"http_code_required",
")",
")",
"{",
"array_walk",
"(",
"$",
"http_code_required",
",",
"function",
"... | Used to check whether a response LinkedIn object has the required http_code or not and
returns an appropriate LinkedIn object.
@param var $http_code_required
The required http response from LinkedIn, passed in either as an integer,
or an array of integers representing the expected values.
@param arr $response
An array... | [
"Used",
"to",
"check",
"whether",
"a",
"response",
"LinkedIn",
"object",
"has",
"the",
"required",
"http_code",
"or",
"not",
"and",
"returns",
"an",
"appropriate",
"LinkedIn",
"object",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L257-L286 |
187,520 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.closeJob | public function closeJob($jid) {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->closeJob(): bad data passed, $jid must be of string value.');
}
// construct and send the request
$query = self::_URL_API . '/v1/jobs/partner-job-id=' . t... | php | public function closeJob($jid) {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->closeJob(): bad data passed, $jid must be of string value.');
}
// construct and send the request
$query = self::_URL_API . '/v1/jobs/partner-job-id=' . t... | [
"public",
"function",
"closeJob",
"(",
"$",
"jid",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"jid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->closeJob(): bad data passed, $jid must be of s... | Close a job.
Calling this method causes the passed job to be closed, per:
http://developer.linkedin.com/docs/DOC-1151
@param str $jid
Job ID you want to close.
@return arr
Array containing retrieval success, LinkedIn response. | [
"Close",
"a",
"job",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L301-L317 |
187,521 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.comment | public function comment($uid, $comment) {
// check passed data
if(!is_string($uid)) {
// bad data passed
throw new LinkedInException('LinkedIn->comment(): bad data passed, $uid must be of type string.');
}
if(!is_string($comment)) {
// nothing/non-string passed, raise an exception
throw ... | php | public function comment($uid, $comment) {
// check passed data
if(!is_string($uid)) {
// bad data passed
throw new LinkedInException('LinkedIn->comment(): bad data passed, $uid must be of type string.');
}
if(!is_string($comment)) {
// nothing/non-string passed, raise an exception
throw ... | [
"public",
"function",
"comment",
"(",
"$",
"uid",
",",
"$",
"comment",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"uid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->comment(): bad data ... | Share comment posting method.
Post a comment on an existing connections shared content. API details can
be found here:
http://developer.linkedin.com/docs/DOC-1043
@param str $uid
The LinkedIn update ID.
@param str $comment
The share comment to be posted.
@return arr
Array containing retrieval success, LinkedIn resp... | [
"Share",
"comment",
"posting",
"method",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L335-L367 |
187,522 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.comments | public function comments($uid) {
// check passed data
if(!is_string($uid)) {
// bad data passed
throw new LinkedInException('LinkedIn->comments(): bad data passed, $uid must be of type string.');
}
// construct and send the request
$query = self::_URL_API . '/v1/people/~/network/updates/ke... | php | public function comments($uid) {
// check passed data
if(!is_string($uid)) {
// bad data passed
throw new LinkedInException('LinkedIn->comments(): bad data passed, $uid must be of type string.');
}
// construct and send the request
$query = self::_URL_API . '/v1/people/~/network/updates/ke... | [
"public",
"function",
"comments",
"(",
"$",
"uid",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"uid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->comments(): bad data passed, $uid must be of t... | Share comment retrieval.
Return all comments associated with a given network update:
http://developer.linkedin.com/docs/DOC-1043
@param str $uid
The LinkedIn update ID.
@return arr
Array containing retrieval success, LinkedIn response. | [
"Share",
"comment",
"retrieval",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L382-L398 |
187,523 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.company | public function company($options, $by_email = FALSE) {
// check passed data
if(!is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->company(): bad data passed, $options must be of type string.');
}
if(!is_bool($by_email)) {
// bad data passed
throw new LinkedIn... | php | public function company($options, $by_email = FALSE) {
// check passed data
if(!is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->company(): bad data passed, $options must be of type string.');
}
if(!is_bool($by_email)) {
// bad data passed
throw new LinkedIn... | [
"public",
"function",
"company",
"(",
"$",
"options",
",",
"$",
"by_email",
"=",
"FALSE",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"options",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'Lin... | Company profile retrieval function.
Takes a string of parameters as input and requests company profile data
from the LinkedIn Company Profile API. See the official documentation for
$options 'field selector' formatting:
http://developer.linkedin.com/docs/DOC-1014
http://developer.linkedin.com/docs/DOC-1259
@param st... | [
"Company",
"profile",
"retrieval",
"function",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L418-L438 |
187,524 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.companyProducts | public function companyProducts($cid, $options = '') {
// check passed data
if(!is_string($cid)) {
// bad data passed
throw new LinkedInException('LinkedIn->companyProducts(): bad data passed, $cid must be of type string.');
}
if(!is_string($options)) {
// bad data passed
throw new LinkedI... | php | public function companyProducts($cid, $options = '') {
// check passed data
if(!is_string($cid)) {
// bad data passed
throw new LinkedInException('LinkedIn->companyProducts(): bad data passed, $cid must be of type string.');
}
if(!is_string($options)) {
// bad data passed
throw new LinkedI... | [
"public",
"function",
"companyProducts",
"(",
"$",
"cid",
",",
"$",
"options",
"=",
"''",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"cid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedI... | Company products and their associated recommendations.
The product data type contains details about a company's product or
service, including recommendations from LinkedIn members, and replies from
company representatives.
http://developer.linkedin.com/docs/DOC-1327
@param str $cid
Company ID you want the producte f... | [
"Company",
"products",
"and",
"their",
"associated",
"recommendations",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L457-L477 |
187,525 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.createPost | public function createPost($gid, $title, $summary = '') {
if(!is_string($gid)) {
throw new LinkedInException('LinkedIn->createPost(): bad data passed, $gid must be of type string.');
}
if(!is_string($title) || empty($title)) {
throw new LinkedInException('LinkedIn->createPost(): bad data passed, $title must... | php | public function createPost($gid, $title, $summary = '') {
if(!is_string($gid)) {
throw new LinkedInException('LinkedIn->createPost(): bad data passed, $gid must be of type string.');
}
if(!is_string($title) || empty($title)) {
throw new LinkedInException('LinkedIn->createPost(): bad data passed, $title must... | [
"public",
"function",
"createPost",
"(",
"$",
"gid",
",",
"$",
"title",
",",
"$",
"summary",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"gid",
")",
")",
"{",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->createPost(): bad data pass... | This creates a post in the specified group with the specified title and specified summary.
http://developer.linkedin.com/documents/groups-api
@param str $gid
The group id.
@param str $title
The title of the post. This must be non-empty.
@param str $summary
[OPTIONAL] The content or summary of the post. This can be em... | [
"This",
"creates",
"a",
"post",
"in",
"the",
"specified",
"group",
"with",
"the",
"specified",
"title",
"and",
"specified",
"summary",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L527-L554 |
187,526 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.deletePost | public function deletePost($pid) {
if(!is_string($pid)) {
throw new LinkedInException('LinkedIn->deletePost(): bad data passed, $pid must be of type string');
}
// construct and send the request
$query = self::_URL_API . '/v1/posts/' . trim($pid);
$response = $this->fetch('DELETE', $query);
/*... | php | public function deletePost($pid) {
if(!is_string($pid)) {
throw new LinkedInException('LinkedIn->deletePost(): bad data passed, $pid must be of type string');
}
// construct and send the request
$query = self::_URL_API . '/v1/posts/' . trim($pid);
$response = $this->fetch('DELETE', $query);
/*... | [
"public",
"function",
"deletePost",
"(",
"$",
"pid",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"pid",
")",
")",
"{",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->deletePost(): bad data passed, $pid must be of type string'",
")",
";",
"}",
"// const... | This deletes the specified post if you are the owner or moderator that post.
Otherwise, it just flags the post as inappropriate.
https://developer.linkedin.com/documents/groups-api
@param str $pid
The post id.
@return arr
Array containing retrieval success, LinkedIn response. | [
"This",
"deletes",
"the",
"specified",
"post",
"if",
"you",
"are",
"the",
"owner",
"or",
"moderator",
"that",
"post",
".",
"Otherwise",
"it",
"just",
"flags",
"the",
"post",
"as",
"inappropriate",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L568-L582 |
187,527 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.editJob | public function editJob($jid, $xml) {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->editJob(): bad data passed, $jid must be of string value.');
}
if(is_string($xml)) {
$xml = trim(stripslashes($xml));
} else {
// bad data passed
... | php | public function editJob($jid, $xml) {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->editJob(): bad data passed, $jid must be of string value.');
}
if(is_string($xml)) {
$xml = trim(stripslashes($xml));
} else {
// bad data passed
... | [
"public",
"function",
"editJob",
"(",
"$",
"jid",
",",
"$",
"xml",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"jid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->editJob(): bad data pass... | Edit a job.
Calling this method causes the passed job to be edited, with the passed
XML instructing which fields to change, per:
http://developer.linkedin.com/docs/DOC-1154
http://developer.linkedin.com/docs/DOC-1142
@param str $jid
Job ID you want to renew.
@param str $xml
The XML containing the job fields to edit.... | [
"Edit",
"a",
"job",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L601-L623 |
187,528 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.flagPost | public function flagPost($pid, $type) {
if(!is_string($pid)) {
throw new LinkedInException('LinkedIn->flagPost(): bad data passed, $pid must be of type string');
}
if(!is_string($type)) {
throw new LinkedInException('LinkedIn->flagPost(): bad data passed, $like must be of type string');
}
//Constructing... | php | public function flagPost($pid, $type) {
if(!is_string($pid)) {
throw new LinkedInException('LinkedIn->flagPost(): bad data passed, $pid must be of type string');
}
if(!is_string($type)) {
throw new LinkedInException('LinkedIn->flagPost(): bad data passed, $like must be of type string');
}
//Constructing... | [
"public",
"function",
"flagPost",
"(",
"$",
"pid",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"pid",
")",
")",
"{",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->flagPost(): bad data passed, $pid must be of type string'",
")",
";"... | This flags a specified post as specified by type.
http://developer.linkedin.com/documents/groups-api
@param str $pid
The post id.
@param str $type
The type to flag the post as.
@return arr
Array containing retrieval success, LinkedIn response. | [
"This",
"flags",
"a",
"specified",
"post",
"as",
"specified",
"by",
"type",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L740-L770 |
187,529 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.followedCompanies | public function followedCompanies() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/following/companies';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked in method... | php | public function followedCompanies() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/following/companies';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked in method... | [
"public",
"function",
"followedCompanies",
"(",
")",
"{",
"// construct and send the request",
"$",
"query",
"=",
"self",
"::",
"_URL_API",
".",
"'/v1/people/~/following/companies'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"fetch",
"(",
"'GET'",
",",
"$",
... | Get list of companies you follow.
Returns a list of companies the current user is currently following, per:
http://developer.linkedin.com/docs/DOC-1324
@return arr
Array containing retrieval success, LinkedIn response. | [
"Get",
"list",
"of",
"companies",
"you",
"follow",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L851-L861 |
187,530 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.groupPostComments | public function groupPostComments($pid, $options = ''){
if(!is_string($pid)){
throw new LinkedInException('LinkedIn->groupPostComments(): bad data passed, $pid must be of type string.');
}
if(!is_string($options)) {
throw new LinkedInException('LinkedIn->groupPostComments(): bad data passed, $options must ... | php | public function groupPostComments($pid, $options = ''){
if(!is_string($pid)){
throw new LinkedInException('LinkedIn->groupPostComments(): bad data passed, $pid must be of type string.');
}
if(!is_string($options)) {
throw new LinkedInException('LinkedIn->groupPostComments(): bad data passed, $options must ... | [
"public",
"function",
"groupPostComments",
"(",
"$",
"pid",
",",
"$",
"options",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"pid",
")",
")",
"{",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->groupPostComments(): bad data passed, $pid mu... | This returns all the comments made on the specified post within a group.
http://developer.linkedin.com/documents/groups-api
@param str $pid
The post id.
@param str $options
[OPTIONAL] Field selectors for the post comments.
@return arr
Array containing retrieval success, LinkedIn response. | [
"This",
"returns",
"all",
"the",
"comments",
"made",
"on",
"the",
"specified",
"post",
"within",
"a",
"group",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1030-L1047 |
187,531 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.groupPosts | public function groupPosts($gid, $options = '') {
if(!is_string($gid)){
throw new LinkedInException('LinkedIn->groupPosts(): bad data passed, $gid must be of type string');
}
if(!is_string($options)){
throw new LinkedInException('LinkedIn->groupPosts(): bad data passed, $options must be of type string');
... | php | public function groupPosts($gid, $options = '') {
if(!is_string($gid)){
throw new LinkedInException('LinkedIn->groupPosts(): bad data passed, $gid must be of type string');
}
if(!is_string($options)){
throw new LinkedInException('LinkedIn->groupPosts(): bad data passed, $options must be of type string');
... | [
"public",
"function",
"groupPosts",
"(",
"$",
"gid",
",",
"$",
"options",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"gid",
")",
")",
"{",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->groupPosts(): bad data passed, $gid must be of type ... | This returns all the posts within a group.
http://developer.linkedin.com/documents/groups-api
@param str $gid
The group id.
@return arr
Array containing retrieval success, LinkedIn response. | [
"This",
"returns",
"all",
"the",
"posts",
"within",
"a",
"group",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1060-L1077 |
187,532 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.isId | public static function isId($id) {
// check passed data
if(!is_string($id)) {
// bad data passed
throw new LinkedInException('LinkedIn->isId(): bad data passed, $id must be of type string.');
}
$pattern = '/^[a-z0-9_\-]{10}$/i';
if($match = preg_match($pattern, $id)) {
// we have a ma... | php | public static function isId($id) {
// check passed data
if(!is_string($id)) {
// bad data passed
throw new LinkedInException('LinkedIn->isId(): bad data passed, $id must be of type string.');
}
$pattern = '/^[a-z0-9_\-]{10}$/i';
if($match = preg_match($pattern, $id)) {
// we have a ma... | [
"public",
"static",
"function",
"isId",
"(",
"$",
"id",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"id",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->isId(): bad data passed, $id must be of ... | LinkedIn ID validation.
Checks the passed string $id to see if it has a valid LinkedIn ID format,
which is, as of October 15th, 2010:
10 alpha-numeric mixed-case characters, plus underscores and dashes.
@param str $id
A possible LinkedIn ID.
@return bool
TRUE/FALSE depending on valid ID format determination. | [
"LinkedIn",
"ID",
"validation",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1271-L1287 |
187,533 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.isThrottled | public static function isThrottled($response) {
$return_data = FALSE;
// check the variable
if(!empty($response) && is_string($response)) {
// we have an array and have a properly formatted LinkedIn response
// store the response in a temp variable
$temp_response = self::xmlToAr... | php | public static function isThrottled($response) {
$return_data = FALSE;
// check the variable
if(!empty($response) && is_string($response)) {
// we have an array and have a properly formatted LinkedIn response
// store the response in a temp variable
$temp_response = self::xmlToAr... | [
"public",
"static",
"function",
"isThrottled",
"(",
"$",
"response",
")",
"{",
"$",
"return_data",
"=",
"FALSE",
";",
"// check the variable",
"if",
"(",
"!",
"empty",
"(",
"$",
"response",
")",
"&&",
"is_string",
"(",
"$",
"response",
")",
")",
"{",
"//... | Throttling check.
Checks the passed LinkedIn response to see if we have hit a throttling
limit:
http://developer.linkedin.com/docs/DOC-1112
@param arr $response
The LinkedIn response.
@return bool
TRUE/FALSE depending on content of response. | [
"Throttling",
"check",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1303-L1321 |
187,534 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.job | public function job($jid, $options = '') {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->job(): bad data passed, $jid must be of type string.');
}
if(!is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->jo... | php | public function job($jid, $options = '') {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->job(): bad data passed, $jid must be of type string.');
}
if(!is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->jo... | [
"public",
"function",
"job",
"(",
"$",
"jid",
",",
"$",
"options",
"=",
"''",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"jid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->job(): ba... | Job posting detail info retrieval function.
The Jobs API returns detailed information about job postings on LinkedIn.
Find the job summary, description, location, and apply our professional graph
to present the relationship between the current member and the job poster or
hiring manager.
http://developer.linkedin.com... | [
"Job",
"posting",
"detail",
"info",
"retrieval",
"function",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1341-L1361 |
187,535 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.message | public function message($recipients, $subject, $body, $copy_self = FALSE) {
/**
* Clean up the passed data per these rules:
*
* 1) Message must be sent to at least one recipient
* 2) No HTML permitted
*/
if(!empty($subject) && is_string($subject)) {
$subject = trim(strip_tags(str... | php | public function message($recipients, $subject, $body, $copy_self = FALSE) {
/**
* Clean up the passed data per these rules:
*
* 1) Message must be sent to at least one recipient
* 2) No HTML permitted
*/
if(!empty($subject) && is_string($subject)) {
$subject = trim(strip_tags(str... | [
"public",
"function",
"message",
"(",
"$",
"recipients",
",",
"$",
"subject",
",",
"$",
"body",
",",
"$",
"copy_self",
"=",
"FALSE",
")",
"{",
"/**\n * Clean up the passed data per these rules:\n * \n * 1) Message must be sent to at least one recipient\n * 2) No... | Connection messaging method.
Send a message to your network connection(s), optionally copying yourself.
Full details from LinkedIn on this functionality can be found here:
http://developer.linkedin.com/docs/DOC-1044
@param arr $recipients
The connection(s) to send the message to.
@param str $subject
The subject of t... | [
"Connection",
"messaging",
"method",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1567-L1615 |
187,536 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.raw | public function raw($method, $url, $body = NULL) {
if(!is_string($method)) {
// bad data passed
throw new LinkedInException('LinkedIn->raw(): bad data passed, $method must be of string value.');
}
if(!is_string($url)) {
// bad data passed
throw new LinkedInException('LinkedIn->raw(): bad data... | php | public function raw($method, $url, $body = NULL) {
if(!is_string($method)) {
// bad data passed
throw new LinkedInException('LinkedIn->raw(): bad data passed, $method must be of string value.');
}
if(!is_string($url)) {
// bad data passed
throw new LinkedInException('LinkedIn->raw(): bad data... | [
"public",
"function",
"raw",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"body",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"method",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->raw(): ... | Manual API call method, allowing for support for un-implemented API
functionality to be supported.
@param str $method
The data communication method.
@param str $url
The Linkedin API endpoint to connect with - should NOT include the
leading https://api.linkedin.com/v1.
@param str $body
[OPTIONAL] The URL-encoded body d... | [
"Manual",
"API",
"call",
"method",
"allowing",
"for",
"support",
"for",
"un",
"-",
"implemented",
"API",
"functionality",
"to",
"be",
"supported",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1701-L1718 |
187,537 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.renewJob | public function renewJob($jid, $cid) {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->renewJob(): bad data passed, $jid must be of string value.');
}
if(!is_string($cid)) {
// bad data passed
throw new LinkedInException('LinkedIn->rene... | php | public function renewJob($jid, $cid) {
// check passed data
if(!is_string($jid)) {
// bad data passed
throw new LinkedInException('LinkedIn->renewJob(): bad data passed, $jid must be of string value.');
}
if(!is_string($cid)) {
// bad data passed
throw new LinkedInException('LinkedIn->rene... | [
"public",
"function",
"renewJob",
"(",
"$",
"jid",
",",
"$",
"cid",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"jid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->renewJob(): bad data pa... | Renew a job.
Calling this method causes the passed job to be renewed, per:
http://developer.linkedin.com/docs/DOC-1154
@param str $jid
Job ID you want to renew.
@param str $cid
Contract ID that covers the passed Job ID.
@return arr
Array containing retrieval success, LinkedIn response. | [
"Renew",
"a",
"job",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1762-L1789 |
187,538 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.retrieveTokenAccess | public function retrieveTokenAccess($token, $secret, $verifier) {
// check passed data
if(!is_string($token) || !is_string($secret) || !is_string($verifier)) {
// nothing passed, raise an exception
throw new LinkedInException('LinkedIn->retrieveTokenAccess(): bad data passed, string type is required fo... | php | public function retrieveTokenAccess($token, $secret, $verifier) {
// check passed data
if(!is_string($token) || !is_string($secret) || !is_string($verifier)) {
// nothing passed, raise an exception
throw new LinkedInException('LinkedIn->retrieveTokenAccess(): bad data passed, string type is required fo... | [
"public",
"function",
"retrieveTokenAccess",
"(",
"$",
"token",
",",
"$",
"secret",
",",
"$",
"verifier",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"token",
")",
"||",
"!",
"is_string",
"(",
"$",
"secret",
")",
"||",
"!",
... | Access token retrieval.
Request the user's access token from the Linkedin API.
@param str $token
The token returned from the user authorization stage.
@param str $secret
The secret returned from the request token stage.
@param str $verifier
The verification value from LinkedIn.
@return arr
The Linkedin OAuth/http re... | [
"Access",
"token",
"retrieval",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1806-L1842 |
187,539 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.retrieveTokenRequest | public function retrieveTokenRequest(array $scope = array()) {
$parameters = array(
'oauth_callback' => $this->getCallbackUrl()
);
$requestUrl = self::_URL_REQUEST;
if (!empty($scope)) {
$requestUrl .= '?scope=' . implode('+', $scope);
}
$response = $this->fetch(self::_METHOD_TO... | php | public function retrieveTokenRequest(array $scope = array()) {
$parameters = array(
'oauth_callback' => $this->getCallbackUrl()
);
$requestUrl = self::_URL_REQUEST;
if (!empty($scope)) {
$requestUrl .= '?scope=' . implode('+', $scope);
}
$response = $this->fetch(self::_METHOD_TO... | [
"public",
"function",
"retrieveTokenRequest",
"(",
"array",
"$",
"scope",
"=",
"array",
"(",
")",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
"'oauth_callback'",
"=>",
"$",
"this",
"->",
"getCallbackUrl",
"(",
")",
")",
";",
"$",
"requestUrl",
"=",
"... | Request token retrieval.
Get the request token from the Linkedin API.
@param array $scope
@return arr
The Linkedin OAuth/http response, in array format. | [
"Request",
"token",
"retrieval",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1854-L1893 |
187,540 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.searchCompanies | public function searchCompanies($options = '') {
// check passed data
if(!is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->searchCompanies(): bad data passed, $options must be of type string.');
}
// construct and send the request
$query = self::_URL_API . ... | php | public function searchCompanies($options = '') {
// check passed data
if(!is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->searchCompanies(): bad data passed, $options must be of type string.');
}
// construct and send the request
$query = self::_URL_API . ... | [
"public",
"function",
"searchCompanies",
"(",
"$",
"options",
"=",
"''",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"options",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->searchCompanies(... | Company search.
Uses the Company Search API to find companies using keywords, industry,
location, or some other criteria. It returns a collection of matching
companies.
http://developer.linkedin.com/docs/DOC-1325
@param str $options
[OPTIONAL] Search options.
@return arr
Array containing retrieval success, LinkedIn ... | [
"Company",
"search",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L1951-L1967 |
187,541 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.searchPeople | public function searchPeople($options = NULL) {
// check passed data
if(!is_null($options) && !is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->search(): bad data passed, $options must be of type string.');
}
// construct and send the request
$query = sel... | php | public function searchPeople($options = NULL) {
// check passed data
if(!is_null($options) && !is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->search(): bad data passed, $options must be of type string.');
}
// construct and send the request
$query = sel... | [
"public",
"function",
"searchPeople",
"(",
"$",
"options",
"=",
"NULL",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_null",
"(",
"$",
"options",
")",
"&&",
"!",
"is_string",
"(",
"$",
"options",
")",
")",
"{",
"// bad data passed",
"throw",
"new",... | General people search function.
Takes a string of parameters as input and requests profile data from the
Linkedin People Search API. See the official documentation for $options
querystring formatting:
http://developer.linkedin.com/docs/DOC-1191
@param str $options
[OPTIONAL] Data retrieval options.
@return arr
Arr... | [
"General",
"people",
"search",
"function",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2017-L2033 |
187,542 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.setGroupSettings | public function setGroupSettings($gid, $xml) {
if(!is_string ($gid)) {
throw new LinkedInException('LinkedIn->setGroupSettings(): bad data passed, $token_access should be in array format.');
}
if(!is_string ($xml)) {
throw new LinkedInException('LinkedIn->setGroupSettings(): bad data passed, $token_ac... | php | public function setGroupSettings($gid, $xml) {
if(!is_string ($gid)) {
throw new LinkedInException('LinkedIn->setGroupSettings(): bad data passed, $token_access should be in array format.');
}
if(!is_string ($xml)) {
throw new LinkedInException('LinkedIn->setGroupSettings(): bad data passed, $token_ac... | [
"public",
"function",
"setGroupSettings",
"(",
"$",
"gid",
",",
"$",
"xml",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"gid",
")",
")",
"{",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->setGroupSettings(): bad data passed, $token_access should be in a... | This sets the group settings of the specified group.
http://developer.linkedin.com/documents/groups-api
@param str $gid
The group id.
@param str $xml
The group settings to set. The settings are:
-<show-group-logo-in-profle>
-<contact-email>
-<email-digest-frequency>
-<email-annoucements-from-managers>
-<allow-message... | [
"This",
"sets",
"the",
"group",
"settings",
"of",
"the",
"specified",
"group",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2084-L2101 |
187,543 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.setToken | public function setToken($token) {
// check passed data
if(!is_null($token) && !is_array($token)) {
// bad data passed
throw new LinkedInException('LinkedIn->setToken(): bad data passed, $token_access should be in array format.');
}
// set token
$this->token = $token;
} | php | public function setToken($token) {
// check passed data
if(!is_null($token) && !is_array($token)) {
// bad data passed
throw new LinkedInException('LinkedIn->setToken(): bad data passed, $token_access should be in array format.');
}
// set token
$this->token = $token;
} | [
"public",
"function",
"setToken",
"(",
"$",
"token",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_null",
"(",
"$",
"token",
")",
"&&",
"!",
"is_array",
"(",
"$",
"token",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(... | Set the token property.
@return arr $token
The LinkedIn OAuth token. | [
"Set",
"the",
"token",
"property",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2119-L2128 |
187,544 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.statistics | public function statistics() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/network/network-stats';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked in method comments a... | php | public function statistics() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/network/network-stats';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked in method comments a... | [
"public",
"function",
"statistics",
"(",
")",
"{",
"// construct and send the request",
"$",
"query",
"=",
"self",
"::",
"_URL_API",
".",
"'/v1/people/~/network/network-stats'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"fetch",
"(",
"'GET'",
",",
"$",
"quer... | Network statistics.
General network statistics retrieval function, returns the number of connections,
second-connections an authenticated user has. More information here:
http://developer.linkedin.com/docs/DOC-1006
@return arr
Array containing retrieval success, LinkedIn response. | [
"Network",
"statistics",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2299-L2309 |
187,545 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.suggestedCompanies | public function suggestedCompanies() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/suggestions/to-follow/companies';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked... | php | public function suggestedCompanies() {
// construct and send the request
$query = self::_URL_API . '/v1/people/~/suggestions/to-follow/companies';
$response = $this->fetch('GET', $query);
/**
* Check for successful request (a 200 response from LinkedIn server)
* per the documentation linked... | [
"public",
"function",
"suggestedCompanies",
"(",
")",
"{",
"// construct and send the request",
"$",
"query",
"=",
"self",
"::",
"_URL_API",
".",
"'/v1/people/~/suggestions/to-follow/companies'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"fetch",
"(",
"'GET'",
"... | Companies you may want to follow.
Returns a list of companies the current user may want to follow, per:
http://developer.linkedin.com/docs/DOC-1324
@return arr
Array containing retrieval success, LinkedIn response. | [
"Companies",
"you",
"may",
"want",
"to",
"follow",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2321-L2331 |
187,546 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.unfollowCompany | public function unfollowCompany($cid) {
// check passed data
if(!is_string($cid)) {
// bad data passed
throw new LinkedInException('LinkedIn->unfollowCompany(): bad data passed, $cid must be of string value.');
}
// construct and send the request
$query = self::_URL_API . '/v1/people/~/fo... | php | public function unfollowCompany($cid) {
// check passed data
if(!is_string($cid)) {
// bad data passed
throw new LinkedInException('LinkedIn->unfollowCompany(): bad data passed, $cid must be of string value.');
}
// construct and send the request
$query = self::_URL_API . '/v1/people/~/fo... | [
"public",
"function",
"unfollowCompany",
"(",
"$",
"cid",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"cid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->unfollowCompany(): bad data passed, $ci... | Unfollow a company.
Calling this method causes the current user to stop following the specified
company, per:
http://developer.linkedin.com/docs/DOC-1324
@param str $cid
Company ID you want to unfollow.
@return arr
Array containing retrieval success, LinkedIn response. | [
"Unfollow",
"a",
"company",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2430-L2446 |
187,547 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.unlike | public function unlike($uid) {
// check passed data
if(!is_string($uid)) {
// bad data passed
throw new LinkedInException('LinkedIn->unlike(): bad data passed, $uid must be of type string.');
}
// construct the xml data
$data = '<?xml version="1.0" encoding="UTF-8"?>
<is-liked>fa... | php | public function unlike($uid) {
// check passed data
if(!is_string($uid)) {
// bad data passed
throw new LinkedInException('LinkedIn->unlike(): bad data passed, $uid must be of type string.');
}
// construct the xml data
$data = '<?xml version="1.0" encoding="UTF-8"?>
<is-liked>fa... | [
"public",
"function",
"unlike",
"(",
"$",
"uid",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"uid",
")",
")",
"{",
"// bad data passed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->unlike(): bad data passed, $uid must be of type ... | Unlike a network update.
Unlike another user's network update:
http://developer.linkedin.com/docs/DOC-1043
@param str $uid
The LinkedIn update ID.
@return arr
Array containing retrieval success, LinkedIn response. | [
"Unlike",
"a",
"network",
"update",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2461-L2481 |
187,548 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.updateNetwork | public function updateNetwork($update) {
// check passed data
if(!is_string($update)) {
// nothing/non-string passed, raise an exception
throw new LinkedInException('LinkedIn->updateNetwork(): bad data passed, $update must be a non-zero length string.');
}
/**
* Network update is not ... | php | public function updateNetwork($update) {
// check passed data
if(!is_string($update)) {
// nothing/non-string passed, raise an exception
throw new LinkedInException('LinkedIn->updateNetwork(): bad data passed, $update must be a non-zero length string.');
}
/**
* Network update is not ... | [
"public",
"function",
"updateNetwork",
"(",
"$",
"update",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"update",
")",
")",
"{",
"// nothing/non-string passed, raise an exception",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->updat... | Post network update.
Update the user's Linkedin network status. Full details from LinkedIn
on this functionality can be found here:
http://developer.linkedin.com/docs/DOC-1009
http://developer.linkedin.com/docs/DOC-1009#comment-1077
@param str $update
The network update.
@return arr
Array containing retrieval succe... | [
"Post",
"network",
"update",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2498-L2556 |
187,549 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.updates | public function updates($options = NULL, $id = NULL) {
// check passed data
if(!is_null($options) && !is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->updates(): bad data passed, $options must be of type string.');
}
if(!is_null($id) && !is_string($id)) {
// ba... | php | public function updates($options = NULL, $id = NULL) {
// check passed data
if(!is_null($options) && !is_string($options)) {
// bad data passed
throw new LinkedInException('LinkedIn->updates(): bad data passed, $options must be of type string.');
}
if(!is_null($id) && !is_string($id)) {
// ba... | [
"public",
"function",
"updates",
"(",
"$",
"options",
"=",
"NULL",
",",
"$",
"id",
"=",
"NULL",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_null",
"(",
"$",
"options",
")",
"&&",
"!",
"is_string",
"(",
"$",
"options",
")",
")",
"{",
"// bad... | General network update retrieval function.
Takes a string of parameters as input and requests update-related data
from the Linkedin Network Updates API. See the official documentation for
$options parameter formatting:
http://developer.linkedin.com/docs/DOC-1006
For getting more comments, likes, etc, see here:
http... | [
"General",
"network",
"update",
"retrieval",
"function",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2579-L2603 |
187,550 | sajari/simple-linkedin-php | linkedin_3.2.0.1.class.php | LinkedIn.xmlToArray | public static function xmlToArray($xml) {
// check passed data
if(!is_string($xml)) {
// bad data possed
throw new LinkedInException('LinkedIn->xmlToArray(): bad data passed, $xml must be a non-zero length string.');
}
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTI... | php | public static function xmlToArray($xml) {
// check passed data
if(!is_string($xml)) {
// bad data possed
throw new LinkedInException('LinkedIn->xmlToArray(): bad data passed, $xml must be a non-zero length string.');
}
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTI... | [
"public",
"static",
"function",
"xmlToArray",
"(",
"$",
"xml",
")",
"{",
"// check passed data",
"if",
"(",
"!",
"is_string",
"(",
"$",
"xml",
")",
")",
"{",
"// bad data possed",
"throw",
"new",
"LinkedInException",
"(",
"'LinkedIn->xmlToArray(): bad data passed, $... | Converts passed XML data to an array.
@param str $xml
The XML to convert to an array.
@return arr
Array containing the XML data.
@return bool
FALSE if passed data cannot be parsed to an array. | [
"Converts",
"passed",
"XML",
"data",
"to",
"an",
"array",
"."
] | 78dbda6d41b64ac0600dea08cd22f50bc56ccac6 | https://github.com/sajari/simple-linkedin-php/blob/78dbda6d41b64ac0600dea08cd22f50bc56ccac6/linkedin_3.2.0.1.class.php#L2616-L2653 |
187,551 | yajra/laravel-acl | src/Traits/AuthorizesPermissionResources.php | AuthorizesPermissionResources.authorizePermissionResource | public function authorizePermissionResource($resource, array $options = [])
{
$permissions = $this->resourcePermissionMap();
$collection = new Collection;
foreach ($permissions as $method => $ability) {
$collection->push(new Fluent([
'ability' => $ability,
... | php | public function authorizePermissionResource($resource, array $options = [])
{
$permissions = $this->resourcePermissionMap();
$collection = new Collection;
foreach ($permissions as $method => $ability) {
$collection->push(new Fluent([
'ability' => $ability,
... | [
"public",
"function",
"authorizePermissionResource",
"(",
"$",
"resource",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"permissions",
"=",
"$",
"this",
"->",
"resourcePermissionMap",
"(",
")",
";",
"$",
"collection",
"=",
"new",
"Collection",... | Authorize a permission resource action based on the incoming request.
@param string $resource
@param array $options
@return void | [
"Authorize",
"a",
"permission",
"resource",
"action",
"based",
"on",
"the",
"incoming",
"request",
"."
] | 8ec89ae0e3a4c41d96a764854e8602df0b6d828d | https://github.com/yajra/laravel-acl/blob/8ec89ae0e3a4c41d96a764854e8602df0b6d828d/src/Traits/AuthorizesPermissionResources.php#L39-L54 |
187,552 | yii2mod/yii2-editable | Editable.php | Editable.registerClientEvents | public function registerClientEvents($id)
{
$view = $this->getView();
$js = [];
foreach ($this->clientEvents as $event => $handler) {
$js[] = "jQuery('$id').on('$event', $handler);";
}
$view->registerJs(implode("\n", $js));
} | php | public function registerClientEvents($id)
{
$view = $this->getView();
$js = [];
foreach ($this->clientEvents as $event => $handler) {
$js[] = "jQuery('$id').on('$event', $handler);";
}
$view->registerJs(implode("\n", $js));
} | [
"public",
"function",
"registerClientEvents",
"(",
"$",
"id",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"js",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"clientEvents",
"as",
"$",
"event",
"=>",
"$",
... | Register client events
@param $id | [
"Register",
"client",
"events"
] | 7263315ff25127c0af50394029182b3f0f843096 | https://github.com/yii2mod/yii2-editable/blob/7263315ff25127c0af50394029182b3f0f843096/Editable.php#L146-L154 |
187,553 | yii2mod/yii2-editable | Editable.php | Editable.getLinkText | protected function getLinkText()
{
$value = $this->value;
if ($this->hasModel()) {
$model = $this->model;
if ($value !== null) {
if (is_string($value)) {
$linkText = ArrayHelper::getValue($model, $value);
} else {
... | php | protected function getLinkText()
{
$value = $this->value;
if ($this->hasModel()) {
$model = $this->model;
if ($value !== null) {
if (is_string($value)) {
$linkText = ArrayHelper::getValue($model, $value);
} else {
... | [
"protected",
"function",
"getLinkText",
"(",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"value",
";",
"if",
"(",
"$",
"this",
"->",
"hasModel",
"(",
")",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
";",
"if",
"(",
"$",
"value",
... | Return link text
@return mixed|string | [
"Return",
"link",
"text"
] | 7263315ff25127c0af50394029182b3f0f843096 | https://github.com/yii2mod/yii2-editable/blob/7263315ff25127c0af50394029182b3f0f843096/Editable.php#L161-L180 |
187,554 | yii2mod/yii2-editable | EditableColumn.php | EditableColumn.registerClientScript | protected function registerClientScript()
{
$view = $this->grid->getView();
switch ($this->type) {
case 'address':
EditableAddressAsset::register($view);
break;
case 'combodate':
EditableComboDateAsset::register($view);
... | php | protected function registerClientScript()
{
$view = $this->grid->getView();
switch ($this->type) {
case 'address':
EditableAddressAsset::register($view);
break;
case 'combodate':
EditableComboDateAsset::register($view);
... | [
"protected",
"function",
"registerClientScript",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"grid",
"->",
"getView",
"(",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"'address'",
":",
"EditableAddressAsset",
"::",
"regi... | Registers required script to the columns work | [
"Registers",
"required",
"script",
"to",
"the",
"columns",
"work"
] | 7263315ff25127c0af50394029182b3f0f843096 | https://github.com/yii2mod/yii2-editable/blob/7263315ff25127c0af50394029182b3f0f843096/EditableColumn.php#L106-L130 |
187,555 | zicht/util | src/Zicht/Util/Html.php | Html.fromText | public static function fromText($text, $mode = null)
{
$text = nl2br(htmlentities($text, null, 'utf-8'));
$text = self::createLinks($text);
return $text;
} | php | public static function fromText($text, $mode = null)
{
$text = nl2br(htmlentities($text, null, 'utf-8'));
$text = self::createLinks($text);
return $text;
} | [
"public",
"static",
"function",
"fromText",
"(",
"$",
"text",
",",
"$",
"mode",
"=",
"null",
")",
"{",
"$",
"text",
"=",
"nl2br",
"(",
"htmlentities",
"(",
"$",
"text",
",",
"null",
",",
"'utf-8'",
")",
")",
";",
"$",
"text",
"=",
"self",
"::",
"... | Creates HTML from a text string, typically for formatting comments.
@param string $text
@param null $mode
@return string | [
"Creates",
"HTML",
"from",
"a",
"text",
"string",
"typically",
"for",
"formatting",
"comments",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Html.php#L258-L265 |
187,556 | zicht/util | src/Zicht/Util/Mutex.php | Mutex.run | public function run($runnable, &$ran = null)
{
$ran = false;
$fd = call_user_func($this->filesystem['fopen'], $this->file, 'w');
if (!$fd) {
throw new \RuntimeException("Could not open file {$this->file}");
}
$hasLock = call_user_func($this->filesystem['flock'],... | php | public function run($runnable, &$ran = null)
{
$ran = false;
$fd = call_user_func($this->filesystem['fopen'], $this->file, 'w');
if (!$fd) {
throw new \RuntimeException("Could not open file {$this->file}");
}
$hasLock = call_user_func($this->filesystem['flock'],... | [
"public",
"function",
"run",
"(",
"$",
"runnable",
",",
"&",
"$",
"ran",
"=",
"null",
")",
"{",
"$",
"ran",
"=",
"false",
";",
"$",
"fd",
"=",
"call_user_func",
"(",
"$",
"this",
"->",
"filesystem",
"[",
"'fopen'",
"]",
",",
"$",
"this",
"->",
"f... | Run the runnable code, typically a closure.
The $ran parameter is set to true when the code was run. the return value of the closure is used as a return
value.
If the lock file could not be opened, a \RuntimeException is thrown
If the lock could not be acquired, false is returned, and the $run parameter will be set t... | [
"Run",
"the",
"runnable",
"code",
"typically",
"a",
"closure",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Mutex.php#L56-L86 |
187,557 | yawik/applications | src/Acl/ApplicationAccessAssertion.php | ApplicationAccessAssertion.assert | public function assert(
Acl $acl,
RoleInterface $role = null,
ResourceInterface $resource = null,
$privilege = null
) {
if (!$role instanceof UserInterface || !$resource instanceof ApplicationInterface) {
return false;
}
/* @var $resource Applicat... | php | public function assert(
Acl $acl,
RoleInterface $role = null,
ResourceInterface $resource = null,
$privilege = null
) {
if (!$role instanceof UserInterface || !$resource instanceof ApplicationInterface) {
return false;
}
/* @var $resource Applicat... | [
"public",
"function",
"assert",
"(",
"Acl",
"$",
"acl",
",",
"RoleInterface",
"$",
"role",
"=",
"null",
",",
"ResourceInterface",
"$",
"resource",
"=",
"null",
",",
"$",
"privilege",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"role",
"instanceof",
"Us... | Checks permissions based on resources' permissions.
{@inheritDoc}
@see \Zend\Permissions\Acl\Assertion\AssertionInterface::assert() | [
"Checks",
"permissions",
"based",
"on",
"resources",
"permissions",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Acl/ApplicationAccessAssertion.php#L41-L69 |
187,558 | railken/amethyst-file-generator | src/Jobs/FileGenerator/GenerateFile.php | GenerateFile.generate | public function generate()
{
$generator = $this->generator;
$data = $this->data;
$fgm = new FileGeneratorManager();
$fm = new FileManager();
$tm = new TemplateManager();
$dbm = new DataBuilderManager();
$result = $dbm->build($generator->data_builder, $data);... | php | public function generate()
{
$generator = $this->generator;
$data = $this->data;
$fgm = new FileGeneratorManager();
$fm = new FileManager();
$tm = new TemplateManager();
$dbm = new DataBuilderManager();
$result = $dbm->build($generator->data_builder, $data);... | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"generator",
"=",
"$",
"this",
"->",
"generator",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"data",
";",
"$",
"fgm",
"=",
"new",
"FileGeneratorManager",
"(",
")",
";",
"$",
"fm",
"=",
"new",
"Fi... | Generate a file.
@return \Railken\Lem\Result | [
"Generate",
"a",
"file",
"."
] | 444f7e7762e826c36573591d12f46a67b911c0d6 | https://github.com/railken/amethyst-file-generator/blob/444f7e7762e826c36573591d12f46a67b911c0d6/src/Jobs/FileGenerator/GenerateFile.php#L63-L107 |
187,559 | hnm/gallery-core | src/app/gallery/core/util/GalleryUtils.php | GalleryUtils.readIPTC | protected static function readIPTC($iptc, $value, $glue=", ") {
if (isset($iptc[$value])){
return implode($glue, $iptc[$value]);
} else {
return null;
}
} | php | protected static function readIPTC($iptc, $value, $glue=", ") {
if (isset($iptc[$value])){
return implode($glue, $iptc[$value]);
} else {
return null;
}
} | [
"protected",
"static",
"function",
"readIPTC",
"(",
"$",
"iptc",
",",
"$",
"value",
",",
"$",
"glue",
"=",
"\", \"",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"iptc",
"[",
"$",
"value",
"]",
")",
")",
"{",
"return",
"implode",
"(",
"$",
"glue",
","... | reads the iptc information of a certain value
@param array $iptc array with iptc values
@param string $value array key of value
@param string $glue
@return string | [
"reads",
"the",
"iptc",
"information",
"of",
"a",
"certain",
"value"
] | 3c4d48808fc822471afe9289afaae91587bdd3e7 | https://github.com/hnm/gallery-core/blob/3c4d48808fc822471afe9289afaae91587bdd3e7/src/app/gallery/core/util/GalleryUtils.php#L95-L101 |
187,560 | n2n/n2n-mail | src/app/n2n/mail/MailTemplate.php | MailTemplate.createMail | public function createMail($to, array $args) {
$keys = array();
$values = array();
foreach ($args as $key => $value) {
$keys[] = '{' . $key . '}';
$values[] = $value;
}
$subject = str_replace($keys, $values, $this->subject);
$message = str_replace($keys, $values, $this->message);
$mail = ne... | php | public function createMail($to, array $args) {
$keys = array();
$values = array();
foreach ($args as $key => $value) {
$keys[] = '{' . $key . '}';
$values[] = $value;
}
$subject = str_replace($keys, $values, $this->subject);
$message = str_replace($keys, $values, $this->message);
$mail = ne... | [
"public",
"function",
"createMail",
"(",
"$",
"to",
",",
"array",
"$",
"args",
")",
"{",
"$",
"keys",
"=",
"array",
"(",
")",
";",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"key",
"=>",
"$",
"value",
")... | creates a mail object for a given sender
@param mixed $to
@param array $args | [
"creates",
"a",
"mail",
"object",
"for",
"a",
"given",
"sender"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailTemplate.php#L62-L78 |
187,561 | yawik/applications | src/Controller/CommentController.php | CommentController.listAction | public function listAction()
{
$repository = $this->repositories->get('Applications/Application');
$applicationId = $this->params()->fromQuery('applicationId', 0);
$application = $repository->find($applicationId); /* @var \Applications\Entity\Application $application */
$thi... | php | public function listAction()
{
$repository = $this->repositories->get('Applications/Application');
$applicationId = $this->params()->fromQuery('applicationId', 0);
$application = $repository->find($applicationId); /* @var \Applications\Entity\Application $application */
$thi... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"repositories",
"->",
"get",
"(",
"'Applications/Application'",
")",
";",
"$",
"applicationId",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromQuery",
"("... | Lists comments of an application
@return array | [
"Lists",
"comments",
"of",
"an",
"application"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/CommentController.php#L37-L48 |
187,562 | yawik/applications | src/Controller/CommentController.php | CommentController.formAction | public function formAction()
{
$repository = $this->repositories->get('Applications/Application');
$mode = $this->params()->fromQuery('mode', 'new');
$appId = $this->params()->fromQuery('id');
/* @var \Applications\Entity\Application $application */
$application = $... | php | public function formAction()
{
$repository = $this->repositories->get('Applications/Application');
$mode = $this->params()->fromQuery('mode', 'new');
$appId = $this->params()->fromQuery('id');
/* @var \Applications\Entity\Application $application */
$application = $... | [
"public",
"function",
"formAction",
"(",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"repositories",
"->",
"get",
"(",
"'Applications/Application'",
")",
";",
"$",
"mode",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromQuery",
"(",
"'mod... | Processes formular data
@return \Zend\View\Model\ViewModel | [
"Processes",
"formular",
"data"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/CommentController.php#L55-L104 |
187,563 | yawik/applications | src/Repository/Subscriber.php | Subscriber.findByUri | public function findByUri($uri, $create = false)
{
$subscriber = $this->findOneBy(array( "uri" => $uri ));
if (!isset($subscriber) && $create) {
$subscriber = $this->create();
$subscriber->uri = $uri;
$this->dm->persist($subscriber);
$this->dm->flush()... | php | public function findByUri($uri, $create = false)
{
$subscriber = $this->findOneBy(array( "uri" => $uri ));
if (!isset($subscriber) && $create) {
$subscriber = $this->create();
$subscriber->uri = $uri;
$this->dm->persist($subscriber);
$this->dm->flush()... | [
"public",
"function",
"findByUri",
"(",
"$",
"uri",
",",
"$",
"create",
"=",
"false",
")",
"{",
"$",
"subscriber",
"=",
"$",
"this",
"->",
"findOneBy",
"(",
"array",
"(",
"\"uri\"",
"=>",
"$",
"uri",
")",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"... | Find a subscriber by an uri
@param String $uri
@param boolean $create
@return \Applications\Entity\Subscriber | [
"Find",
"a",
"subscriber",
"by",
"an",
"uri"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Subscriber.php#L26-L36 |
187,564 | OpenLdapObject/OpenLdapObject | lib/OpenLdapObject/Manager/EntityAnalyzer.php | EntityAnalyzer.listColumns | public function listColumns()
{
if (!is_null($this->listColumns)) {
return $this->listColumns;
}
// We use this method to load the annotation classes, because the annotation Library Doctrine does not
AnnotationManager::autoLoadAnnotation();
// Set the list of pr... | php | public function listColumns()
{
if (!is_null($this->listColumns)) {
return $this->listColumns;
}
// We use this method to load the annotation classes, because the annotation Library Doctrine does not
AnnotationManager::autoLoadAnnotation();
// Set the list of pr... | [
"public",
"function",
"listColumns",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"listColumns",
")",
")",
"{",
"return",
"$",
"this",
"->",
"listColumns",
";",
"}",
"// We use this method to load the annotation classes, because the annotation L... | List the Ldap Columns of an Entity Class
@return array
@throws \OpenLdapObject\Annotations\InvalidAnnotationException | [
"List",
"the",
"Ldap",
"Columns",
"of",
"an",
"Entity",
"Class"
] | 6aa5f699a6c35c17b016655c84e9debb026df125 | https://github.com/OpenLdapObject/OpenLdapObject/blob/6aa5f699a6c35c17b016655c84e9debb026df125/lib/OpenLdapObject/Manager/EntityAnalyzer.php#L89-L152 |
187,565 | OpenLdapObject/OpenLdapObject | lib/OpenLdapObject/Manager/EntityAnalyzer.php | EntityAnalyzer.listRequiredMethod | public function listRequiredMethod()
{
if (!is_null($this->listRequiredMethod)) return $this->listRequiredMethod;
$columns = $this->listColumns();
$methodList = array();
foreach ($columns as $name => $schema) {
$this->methodGetter($methodList, $name);
switch... | php | public function listRequiredMethod()
{
if (!is_null($this->listRequiredMethod)) return $this->listRequiredMethod;
$columns = $this->listColumns();
$methodList = array();
foreach ($columns as $name => $schema) {
$this->methodGetter($methodList, $name);
switch... | [
"public",
"function",
"listRequiredMethod",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"listRequiredMethod",
")",
")",
"return",
"$",
"this",
"->",
"listRequiredMethod",
";",
"$",
"columns",
"=",
"$",
"this",
"->",
"listColumns",
"("... | Get the list of require method
@return array | [
"Get",
"the",
"list",
"of",
"require",
"method"
] | 6aa5f699a6c35c17b016655c84e9debb026df125 | https://github.com/OpenLdapObject/OpenLdapObject/blob/6aa5f699a6c35c17b016655c84e9debb026df125/lib/OpenLdapObject/Manager/EntityAnalyzer.php#L207-L236 |
187,566 | OpenLdapObject/OpenLdapObject | lib/OpenLdapObject/Manager/EntityAnalyzer.php | EntityAnalyzer.listMissingMethod | public function listMissingMethod()
{
if (!is_null($this->listMissingMethod)) return $this->listMissingMethod;
$required = $this->listRequiredMethod();
$missing = array();
foreach ($required as $methodName => $data) {
if (!$this->reflection->hasMethod($methodName)) {
... | php | public function listMissingMethod()
{
if (!is_null($this->listMissingMethod)) return $this->listMissingMethod;
$required = $this->listRequiredMethod();
$missing = array();
foreach ($required as $methodName => $data) {
if (!$this->reflection->hasMethod($methodName)) {
... | [
"public",
"function",
"listMissingMethod",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"listMissingMethod",
")",
")",
"return",
"$",
"this",
"->",
"listMissingMethod",
";",
"$",
"required",
"=",
"$",
"this",
"->",
"listRequiredMethod",
... | Get the list of missing require method | [
"Get",
"the",
"list",
"of",
"missing",
"require",
"method"
] | 6aa5f699a6c35c17b016655c84e9debb026df125 | https://github.com/OpenLdapObject/OpenLdapObject/blob/6aa5f699a6c35c17b016655c84e9debb026df125/lib/OpenLdapObject/Manager/EntityAnalyzer.php#L241-L257 |
187,567 | OpenLdapObject/OpenLdapObject | lib/OpenLdapObject/Manager/EntityAnalyzer.php | EntityAnalyzer.haveAnnotation | private static function haveAnnotation($annotationClass, array $annotationList)
{
foreach ($annotationList as $annotation) {
if (is_a($annotation, $annotationClass)) {
return $annotation;
}
}
return false;
} | php | private static function haveAnnotation($annotationClass, array $annotationList)
{
foreach ($annotationList as $annotation) {
if (is_a($annotation, $annotationClass)) {
return $annotation;
}
}
return false;
} | [
"private",
"static",
"function",
"haveAnnotation",
"(",
"$",
"annotationClass",
",",
"array",
"$",
"annotationList",
")",
"{",
"foreach",
"(",
"$",
"annotationList",
"as",
"$",
"annotation",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"annotation",
",",
"$",
"a... | Get the annotation of the class in the list or return false
@param $annotationClass
@param array $annotationList
@return bool|Annotation | [
"Get",
"the",
"annotation",
"of",
"the",
"class",
"in",
"the",
"list",
"or",
"return",
"false"
] | 6aa5f699a6c35c17b016655c84e9debb026df125 | https://github.com/OpenLdapObject/OpenLdapObject/blob/6aa5f699a6c35c17b016655c84e9debb026df125/lib/OpenLdapObject/Manager/EntityAnalyzer.php#L265-L273 |
187,568 | yawik/applications | src/Entity/Validator/Application.php | Application.isValid | public function isValid($value)
{
if (!$value instanceof ApplicationInterface) {
$this->error('NO_APPLICATION');
return false;
}
$error = false;
if ('' == $value->getContact()->getEmail()) {
$error = true;
$this->error('NO_EMAIL');
... | php | public function isValid($value)
{
if (!$value instanceof ApplicationInterface) {
$this->error('NO_APPLICATION');
return false;
}
$error = false;
if ('' == $value->getContact()->getEmail()) {
$error = true;
$this->error('NO_EMAIL');
... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"value",
"instanceof",
"ApplicationInterface",
")",
"{",
"$",
"this",
"->",
"error",
"(",
"'NO_APPLICATION'",
")",
";",
"return",
"false",
";",
"}",
"$",
"error",
"=",
"... | Returns true, if and only if there's at least an email address set and the privacy policy accepted in the application.
{@inheritDoc}
@param ApplicationInterface $value | [
"Returns",
"true",
"if",
"and",
"only",
"if",
"there",
"s",
"at",
"least",
"an",
"email",
"address",
"set",
"and",
"the",
"privacy",
"policy",
"accepted",
"in",
"the",
"application",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Entity/Validator/Application.php#L34-L55 |
187,569 | BuzzinaSocial/traits | src/JsonRender.php | JsonRender.toObject | public function toObject($string): stdClass
{
if (is_string($string)) {
return $this->jsonDecode($string);
}
return $this->jsonDecode($this->jsonEncode($string));
} | php | public function toObject($string): stdClass
{
if (is_string($string)) {
return $this->jsonDecode($string);
}
return $this->jsonDecode($this->jsonEncode($string));
} | [
"public",
"function",
"toObject",
"(",
"$",
"string",
")",
":",
"stdClass",
"{",
"if",
"(",
"is_string",
"(",
"$",
"string",
")",
")",
"{",
"return",
"$",
"this",
"->",
"jsonDecode",
"(",
"$",
"string",
")",
";",
"}",
"return",
"$",
"this",
"->",
"... | Convert to object.
@param mixed $string
@return stdClass | [
"Convert",
"to",
"object",
"."
] | ab78140f234082911bfda6b6542ca11557c46f2c | https://github.com/BuzzinaSocial/traits/blob/ab78140f234082911bfda6b6542ca11557c46f2c/src/JsonRender.php#L74-L81 |
187,570 | yawik/applications | src/Form/Attributes.php | Attributes.init | public function init()
{
$this->setIsDisableCapable(false)
->setIsDisableElementsCapable(false)
->setAttribute('data-submit-on', 'checkbox');
$this->add(
array(
'type' => 'checkbox',
'name' => 'sendCarbonCopy',
'options' => a... | php | public function init()
{
$this->setIsDisableCapable(false)
->setIsDisableElementsCapable(false)
->setAttribute('data-submit-on', 'checkbox');
$this->add(
array(
'type' => 'checkbox',
'name' => 'sendCarbonCopy',
'options' => a... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"setIsDisableCapable",
"(",
"false",
")",
"->",
"setIsDisableElementsCapable",
"(",
"false",
")",
"->",
"setAttribute",
"(",
"'data-submit-on'",
",",
"'checkbox'",
")",
";",
"$",
"this",
"->",
"... | initialize attributes form | [
"initialize",
"attributes",
"form"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Form/Attributes.php#L25-L65 |
187,571 | yawik/applications | src/Form/FactsFieldset.php | FactsFieldset.init | public function init()
{
$this->setHydrator(new \Core\Entity\Hydrator\EntityHydrator())
->setName('base');
$this->add(
array(
'name' => 'willingnessToTravel',
'type' => '\Core\Form\Element\Select',
'options' => array(
'val... | php | public function init()
{
$this->setHydrator(new \Core\Entity\Hydrator\EntityHydrator())
->setName('base');
$this->add(
array(
'name' => 'willingnessToTravel',
'type' => '\Core\Form\Element\Select',
'options' => array(
'val... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"setHydrator",
"(",
"new",
"\\",
"Core",
"\\",
"Entity",
"\\",
"Hydrator",
"\\",
"EntityHydrator",
"(",
")",
")",
"->",
"setName",
"(",
"'base'",
")",
";",
"$",
"this",
"->",
"add",
"(",... | initialize facts fieldset | [
"initialize",
"facts",
"fieldset"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Form/FactsFieldset.php#L34-L120 |
187,572 | yawik/applications | src/Controller/MultimanageController.php | MultimanageController.moveAction | public function moveAction()
{
$ids = (array)$this->params()->fromPost('ids');
$moved = 0;
if ($ids) {
$serviceManager = $this->serviceLocator;
$repositories = $serviceManager->get('repositories');
$applicationRepository = $repositories->get('Appl... | php | public function moveAction()
{
$ids = (array)$this->params()->fromPost('ids');
$moved = 0;
if ($ids) {
$serviceManager = $this->serviceLocator;
$repositories = $serviceManager->get('repositories');
$applicationRepository = $repositories->get('Appl... | [
"public",
"function",
"moveAction",
"(",
")",
"{",
"$",
"ids",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromPost",
"(",
"'ids'",
")",
";",
"$",
"moved",
"=",
"0",
";",
"if",
"(",
"$",
"ids",
")",
"{",
"$",
"serviceM... | Move given applications to Talent Pool
@since 0.26 | [
"Move",
"given",
"applications",
"to",
"Talent",
"Pool"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Controller/MultimanageController.php#L153-L191 |
187,573 | yawik/applications | src/Entity/Settings.php | Settings.getApplyFormSettings | public function getApplyFormSettings()
{
if (!$this->applyFormSettings) {
$settings = new DisableElementsCapableFormSettings();
$settings->setForm('Applications/Apply');
$this->applyFormSettings = $settings;
}
return $this->applyFormSettings;
} | php | public function getApplyFormSettings()
{
if (!$this->applyFormSettings) {
$settings = new DisableElementsCapableFormSettings();
$settings->setForm('Applications/Apply');
$this->applyFormSettings = $settings;
}
return $this->applyFormSettings;
} | [
"public",
"function",
"getApplyFormSettings",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"applyFormSettings",
")",
"{",
"$",
"settings",
"=",
"new",
"DisableElementsCapableFormSettings",
"(",
")",
";",
"$",
"settings",
"->",
"setForm",
"(",
"'Applicatio... | Gets the disabled apply form elements settings.
@return DisableElementsCapableFormSettings | [
"Gets",
"the",
"disabled",
"apply",
"form",
"elements",
"settings",
"."
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Entity/Settings.php#L135-L143 |
187,574 | yawik/applications | src/Form/ContactContainer.php | ContactContainer.init | public function init()
{
$this->setIsDisableCapable(false)
->setIsDisableElementsCapable(false);
$this->setForms(
array(
'contact' => array(
'type' => 'Auth/UserInfo',
'property' => true,
),
'image' => arra... | php | public function init()
{
$this->setIsDisableCapable(false)
->setIsDisableElementsCapable(false);
$this->setForms(
array(
'contact' => array(
'type' => 'Auth/UserInfo',
'property' => true,
),
'image' => arra... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"setIsDisableCapable",
"(",
"false",
")",
"->",
"setIsDisableElementsCapable",
"(",
"false",
")",
";",
"$",
"this",
"->",
"setForms",
"(",
"array",
"(",
"'contact'",
"=>",
"array",
"(",
"'type... | initialize contact container | [
"initialize",
"contact",
"container"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Form/ContactContainer.php#L25-L43 |
187,575 | zicht/util | src/Zicht/Util/Xml.php | Xml.format | public static function format($str)
{
$dom = new \DOMDocument();
$dom->loadXML($str);
$dom->formatOutput = true;
return $dom->saveXML();
} | php | public static function format($str)
{
$dom = new \DOMDocument();
$dom->loadXML($str);
$dom->formatOutput = true;
return $dom->saveXML();
} | [
"public",
"static",
"function",
"format",
"(",
"$",
"str",
")",
"{",
"$",
"dom",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"$",
"dom",
"->",
"loadXML",
"(",
"$",
"str",
")",
";",
"$",
"dom",
"->",
"formatOutput",
"=",
"true",
";",
"return",
... | Format an XML string using libxml's domdocument formatter
@param string $str
@return string | [
"Format",
"an",
"XML",
"string",
"using",
"libxml",
"s",
"domdocument",
"formatter"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Xml.php#L19-L25 |
187,576 | yawik/applications | src/Form/Facts.php | Facts.init | public function init()
{
$this->options['disable_capable'] = array(
'description' => /*@translate*/ 'Request additional facts from the Applicant. Selected Fields will be added to the application Form.',
);
$this->setLabel('Facts');
$this->setIsDescriptionsEnabled(true);
... | php | public function init()
{
$this->options['disable_capable'] = array(
'description' => /*@translate*/ 'Request additional facts from the Applicant. Selected Fields will be added to the application Form.',
);
$this->setLabel('Facts');
$this->setIsDescriptionsEnabled(true);
... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'disable_capable'",
"]",
"=",
"array",
"(",
"'description'",
"=>",
"/*@translate*/",
"'Request additional facts from the Applicant. Selected Fields will be added to the application Form.'",
",",
... | initialize facts form | [
"initialize",
"facts",
"form"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Form/Facts.php#L38-L50 |
187,577 | n2n/n2n-mail | src/app/n2n/mail/MailEncoder.php | MailEncoder.htmlToText | public static function htmlToText($html, $eol = "\n") {
// strip parts before body tag
if (strpos($html, '<body>')){
$html = substr($html, (strpos($html, '<body>')+6));
}
// remove all new lines
$html = str_replace(array("\r\n", "\n", "\r"), '', $html);
// convert br and p strip html tags
$... | php | public static function htmlToText($html, $eol = "\n") {
// strip parts before body tag
if (strpos($html, '<body>')){
$html = substr($html, (strpos($html, '<body>')+6));
}
// remove all new lines
$html = str_replace(array("\r\n", "\n", "\r"), '', $html);
// convert br and p strip html tags
$... | [
"public",
"static",
"function",
"htmlToText",
"(",
"$",
"html",
",",
"$",
"eol",
"=",
"\"\\n\"",
")",
"{",
"// strip parts before body tag\r",
"if",
"(",
"strpos",
"(",
"$",
"html",
",",
"'<body>'",
")",
")",
"{",
"$",
"html",
"=",
"substr",
"(",
"$",
... | converts html into text
@param string $html
@param string $eol | [
"converts",
"html",
"into",
"text"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailEncoder.php#L40-L52 |
187,578 | n2n/n2n-mail | src/app/n2n/mail/MailEncoder.php | MailEncoder.encodeString | public static function encodeString($string, $encoding, $eol = "\n") {
$encoding = strtolower($encoding);
switch($encoding) {
case self::ENCODING_BASE64:
return chunk_split(base64_encode($string), 76, $eol);
case self::ENCODING_7BIT:
case self::ENCODING_8BIT:
$encoded = self::cleanEol($strin... | php | public static function encodeString($string, $encoding, $eol = "\n") {
$encoding = strtolower($encoding);
switch($encoding) {
case self::ENCODING_BASE64:
return chunk_split(base64_encode($string), 76, $eol);
case self::ENCODING_7BIT:
case self::ENCODING_8BIT:
$encoded = self::cleanEol($strin... | [
"public",
"static",
"function",
"encodeString",
"(",
"$",
"string",
",",
"$",
"encoding",
",",
"$",
"eol",
"=",
"\"\\n\"",
")",
"{",
"$",
"encoding",
"=",
"strtolower",
"(",
"$",
"encoding",
")",
";",
"switch",
"(",
"$",
"encoding",
")",
"{",
"case",
... | encodes a string to the given encoding
@param string $string
@param string $encoding
@param string $eol
@throws MailException | [
"encodes",
"a",
"string",
"to",
"the",
"given",
"encoding"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailEncoder.php#L61-L78 |
187,579 | n2n/n2n-mail | src/app/n2n/mail/MailEncoder.php | MailEncoder.encodeBoundaryBlock | private static function encodeBoundaryBlock($boundary, $contentType, $charset, $encoding, $content, $eol = "\n") {
return '--' . $boundary . $eol
. 'Content-Type: ' . $contentType. '; charset="' . $charset . '"' . $eol
. 'Content-Transfer-Encoding: ' . $encoding . $eol . $eol
. self::encodeString($conte... | php | private static function encodeBoundaryBlock($boundary, $contentType, $charset, $encoding, $content, $eol = "\n") {
return '--' . $boundary . $eol
. 'Content-Type: ' . $contentType. '; charset="' . $charset . '"' . $eol
. 'Content-Transfer-Encoding: ' . $encoding . $eol . $eol
. self::encodeString($conte... | [
"private",
"static",
"function",
"encodeBoundaryBlock",
"(",
"$",
"boundary",
",",
"$",
"contentType",
",",
"$",
"charset",
",",
"$",
"encoding",
",",
"$",
"content",
",",
"$",
"eol",
"=",
"\"\\n\"",
")",
"{",
"return",
"'--'",
".",
"$",
"boundary",
".",... | encodes a boundary block
@param string $boundary
@param string $contentType
@param string $charset
@param string $encoding
@param string $content
@param string $eol | [
"encodes",
"a",
"boundary",
"block"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailEncoder.php#L144-L150 |
187,580 | n2n/n2n-mail | src/app/n2n/mail/MailEncoder.php | MailEncoder.encodeAttachment | private static function encodeAttachment($boundary, FsPath $path, $fileName, $charset, $encoding, $eol = "\n") {
$file = new FsPath($fileName);
$string = "--{$boundary}{$eol}"
. "Content-Type: " . self::getMimeType($file->getExtension()) . "; name=\"" . mb_encode_mimeheader($file->getName(), $charset, 'Q', $e... | php | private static function encodeAttachment($boundary, FsPath $path, $fileName, $charset, $encoding, $eol = "\n") {
$file = new FsPath($fileName);
$string = "--{$boundary}{$eol}"
. "Content-Type: " . self::getMimeType($file->getExtension()) . "; name=\"" . mb_encode_mimeheader($file->getName(), $charset, 'Q', $e... | [
"private",
"static",
"function",
"encodeAttachment",
"(",
"$",
"boundary",
",",
"FsPath",
"$",
"path",
",",
"$",
"fileName",
",",
"$",
"charset",
",",
"$",
"encoding",
",",
"$",
"eol",
"=",
"\"\\n\"",
")",
"{",
"$",
"file",
"=",
"new",
"FsPath",
"(",
... | encodes an attachment
@param string $boundary
@param FsPath $path
@param string $fileName
@param string $charset
@param string $encoding
@param string $eol | [
"encodes",
"an",
"attachment"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailEncoder.php#L161-L169 |
187,581 | n2n/n2n-mail | src/app/n2n/mail/MailEncoder.php | MailEncoder.getMimeType | public static function getMimeType($ext) {
$ext = strtolower($ext);
$mimes = array('hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword',
'bin' => 'application/macbinary', 'dms' => 'application/octet-stream', 'lha' => 'application/octet-stream',
'lzh' ... | php | public static function getMimeType($ext) {
$ext = strtolower($ext);
$mimes = array('hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword',
'bin' => 'application/macbinary', 'dms' => 'application/octet-stream', 'lha' => 'application/octet-stream',
'lzh' ... | [
"public",
"static",
"function",
"getMimeType",
"(",
"$",
"ext",
")",
"{",
"$",
"ext",
"=",
"strtolower",
"(",
"$",
"ext",
")",
";",
"$",
"mimes",
"=",
"array",
"(",
"'hqx'",
"=>",
"'application/mac-binhex40'",
",",
"'cpt'",
"=>",
"'application/mac-compactpro... | returns a mime type of a file
@param string $ext | [
"returns",
"a",
"mime",
"type",
"of",
"a",
"file"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/MailEncoder.php#L184-L211 |
187,582 | OpenLdapObject/OpenLdapObject | lib/OpenLdapObject/Manager/Hydrate/Hydrater.php | Hydrater.getData | public function getData(Entity $entity)
{
$column = $this->analyzer->listColumns();
$data = array();
foreach ($column as $key => $value) {
$method = 'get' . Utils::capitalize($key);
$data[$key] = $entity->$method();
if (is_null($data[$key])) $data[$key] =... | php | public function getData(Entity $entity)
{
$column = $this->analyzer->listColumns();
$data = array();
foreach ($column as $key => $value) {
$method = 'get' . Utils::capitalize($key);
$data[$key] = $entity->$method();
if (is_null($data[$key])) $data[$key] =... | [
"public",
"function",
"getData",
"(",
"Entity",
"$",
"entity",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"analyzer",
"->",
"listColumns",
"(",
")",
";",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"column",
"as",
"$",
"key... | Inverse the hydrate method
@param $entity
@return array | [
"Inverse",
"the",
"hydrate",
"method"
] | 6aa5f699a6c35c17b016655c84e9debb026df125 | https://github.com/OpenLdapObject/OpenLdapObject/blob/6aa5f699a6c35c17b016655c84e9debb026df125/lib/OpenLdapObject/Manager/Hydrate/Hydrater.php#L143-L158 |
187,583 | n2n/n2n-impl-web-dispatch | src/app/n2n/impl/web/dispatch/map/val/ValUrl.php | ValUrl.isUrl | public static function isUrl($url, bool $schemeRequired = true) {
try {
$url = Url::create($url)->toIdnaAsciiString();
} catch (\InvalidArgumentException $e) {
return false;
}
if ($schemeRequired) {
if (false !== filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
retu... | php | public static function isUrl($url, bool $schemeRequired = true) {
try {
$url = Url::create($url)->toIdnaAsciiString();
} catch (\InvalidArgumentException $e) {
return false;
}
if ($schemeRequired) {
if (false !== filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
retu... | [
"public",
"static",
"function",
"isUrl",
"(",
"$",
"url",
",",
"bool",
"$",
"schemeRequired",
"=",
"true",
")",
"{",
"try",
"{",
"$",
"url",
"=",
"Url",
"::",
"create",
"(",
"$",
"url",
")",
"->",
"toIdnaAsciiString",
"(",
")",
";",
"}",
"catch",
"... | checks a string, if it is a valid url address
@param string $url
@return bool | [
"checks",
"a",
"string",
"if",
"it",
"is",
"a",
"valid",
"url",
"address"
] | 9e10b074437928b97ab06bea835e3987ec452b3c | https://github.com/n2n/n2n-impl-web-dispatch/blob/9e10b074437928b97ab06bea835e3987ec452b3c/src/app/n2n/impl/web/dispatch/map/val/ValUrl.php#L67-L85 |
187,584 | railken/amethyst-file-generator | src/Http/Controllers/Admin/FileGeneratorsController.php | FileGeneratorsController.render | public function render(Request $request)
{
/** @var \Railken\Amethyst\Managers\FileGeneratorManager */
$manager = $this->manager;
$dbm = new DataBuilderManager();
/** @var \Railken\Amethyst\Models\DataBuilder */
$data_builder = $dbm->getRepository()->findOneById(intval($req... | php | public function render(Request $request)
{
/** @var \Railken\Amethyst\Managers\FileGeneratorManager */
$manager = $this->manager;
$dbm = new DataBuilderManager();
/** @var \Railken\Amethyst\Models\DataBuilder */
$data_builder = $dbm->getRepository()->findOneById(intval($req... | [
"public",
"function",
"render",
"(",
"Request",
"$",
"request",
")",
"{",
"/** @var \\Railken\\Amethyst\\Managers\\FileGeneratorManager */",
"$",
"manager",
"=",
"$",
"this",
"->",
"manager",
";",
"$",
"dbm",
"=",
"new",
"DataBuilderManager",
"(",
")",
";",
"/** @... | Render raw template.
@param \Illuminate\Http\Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"Render",
"raw",
"template",
"."
] | 444f7e7762e826c36573591d12f46a67b911c0d6 | https://github.com/railken/amethyst-file-generator/blob/444f7e7762e826c36573591d12f46a67b911c0d6/src/Http/Controllers/Admin/FileGeneratorsController.php#L62-L106 |
187,585 | zicht/util | src/Zicht/Util/Debug.php | Debug.indent | public static function indent($str, $with = ' ')
{
$newline = (substr($str, -1, 1) == "\n") ? "\n" : '';
return $with . join("\n" . $with, self::lines($str)) . $newline;
} | php | public static function indent($str, $with = ' ')
{
$newline = (substr($str, -1, 1) == "\n") ? "\n" : '';
return $with . join("\n" . $with, self::lines($str)) . $newline;
} | [
"public",
"static",
"function",
"indent",
"(",
"$",
"str",
",",
"$",
"with",
"=",
"' '",
")",
"{",
"$",
"newline",
"=",
"(",
"substr",
"(",
"$",
"str",
",",
"-",
"1",
",",
"1",
")",
"==",
"\"\\n\"",
")",
"?",
"\"\\n\"",
":",
"''",
";",
"retu... | Indent a string with the specified indent
@param string $str
@param string $with
@return string | [
"Indent",
"a",
"string",
"with",
"the",
"specified",
"indent"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Debug.php#L54-L58 |
187,586 | zicht/util | src/Zicht/Util/Debug.php | Debug.formatLines | public static function formatLines($lines, $prefixStart = 1)
{
$max = strlen((string)(count($lines) + $prefixStart));
$prefixTemplate = "%{$max}d. ";
$ret = '';
foreach ($lines as $l => $line) {
$ret .= sprintf($prefixTemplate, $prefixStart + $l) . $line . "\n";
... | php | public static function formatLines($lines, $prefixStart = 1)
{
$max = strlen((string)(count($lines) + $prefixStart));
$prefixTemplate = "%{$max}d. ";
$ret = '';
foreach ($lines as $l => $line) {
$ret .= sprintf($prefixTemplate, $prefixStart + $l) . $line . "\n";
... | [
"public",
"static",
"function",
"formatLines",
"(",
"$",
"lines",
",",
"$",
"prefixStart",
"=",
"1",
")",
"{",
"$",
"max",
"=",
"strlen",
"(",
"(",
"string",
")",
"(",
"count",
"(",
"$",
"lines",
")",
"+",
"$",
"prefixStart",
")",
")",
";",
"$",
... | Prefix all lines with a line number starting at the given number.
@param array $lines
@param int $prefixStart
@return string | [
"Prefix",
"all",
"lines",
"with",
"a",
"line",
"number",
"starting",
"at",
"the",
"given",
"number",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Debug.php#L68-L78 |
187,587 | zicht/util | src/Zicht/Util/Debug.php | Debug.dump | public static function dump($var, $maxdepth = 10, $maxValueLen = 255, $stack = [])
{
$children = $hierarchyNotation = null;
if (is_object($var)) {
$children = get_object_vars($var);
$hierarchyNotation = '->%s';
} elseif (is_array($var)) {
$children = $var... | php | public static function dump($var, $maxdepth = 10, $maxValueLen = 255, $stack = [])
{
$children = $hierarchyNotation = null;
if (is_object($var)) {
$children = get_object_vars($var);
$hierarchyNotation = '->%s';
} elseif (is_array($var)) {
$children = $var... | [
"public",
"static",
"function",
"dump",
"(",
"$",
"var",
",",
"$",
"maxdepth",
"=",
"10",
",",
"$",
"maxValueLen",
"=",
"255",
",",
"$",
"stack",
"=",
"[",
"]",
")",
"{",
"$",
"children",
"=",
"$",
"hierarchyNotation",
"=",
"null",
";",
"if",
"(",
... | Variable dumper.
Dumps variables in a PHP-syntax format.
@param mixed $var
@param int $maxdepth
@param int $maxValueLen
@param array $stack
@return string | [
"Variable",
"dumper",
".",
"Dumps",
"variables",
"in",
"a",
"PHP",
"-",
"syntax",
"format",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Debug.php#L91-L134 |
187,588 | zicht/util | src/Zicht/Util/Debug.php | Debug.dumpScalar | public static function dumpScalar($var, $maxValueLen)
{
switch (true) {
case is_null($var):
$val = 'null';
break;
case is_bool($var):
$val = ($var ? 'true' : 'false');
break;
case is_integer($var):
... | php | public static function dumpScalar($var, $maxValueLen)
{
switch (true) {
case is_null($var):
$val = 'null';
break;
case is_bool($var):
$val = ($var ? 'true' : 'false');
break;
case is_integer($var):
... | [
"public",
"static",
"function",
"dumpScalar",
"(",
"$",
"var",
",",
"$",
"maxValueLen",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"is_null",
"(",
"$",
"var",
")",
":",
"$",
"val",
"=",
"'null'",
";",
"break",
";",
"case",
"is_bool",
"(",
"... | Dumps a scalar value.
@param mixed $var
@param int $maxValueLen
@return string | [
"Dumps",
"a",
"scalar",
"value",
"."
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Debug.php#L144-L170 |
187,589 | zicht/util | src/Zicht/Util/Debug.php | Debug.formatString | public static function formatString($var, $maxValueLen)
{
$val = '"';
if (strlen($var) > $maxValueLen) {
$val .= substr($var, 0, $maxValueLen) . '" ... (' . (strlen($var) - $maxValueLen) . ' more)';
} else {
$val .= $var . '"';
}
return $val;
} | php | public static function formatString($var, $maxValueLen)
{
$val = '"';
if (strlen($var) > $maxValueLen) {
$val .= substr($var, 0, $maxValueLen) . '" ... (' . (strlen($var) - $maxValueLen) . ' more)';
} else {
$val .= $var . '"';
}
return $val;
} | [
"public",
"static",
"function",
"formatString",
"(",
"$",
"var",
",",
"$",
"maxValueLen",
")",
"{",
"$",
"val",
"=",
"'\"'",
";",
"if",
"(",
"strlen",
"(",
"$",
"var",
")",
">",
"$",
"maxValueLen",
")",
"{",
"$",
"val",
".=",
"substr",
"(",
"$",
... | Format a string for dump output
@param string $var
@param int $maxValueLen
@return string | [
"Format",
"a",
"string",
"for",
"dump",
"output"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Debug.php#L180-L189 |
187,590 | zicht/util | src/Zicht/Util/Debug.php | Debug.formatDumpStack | protected static function formatDumpStack($stack, $var)
{
$ret = (count($stack) ? join('', $stack) : '');
$ret .= '<' . (
is_array($var)
? 'array(' . count($var) . ')'
: get_class($var)
) . '>';
return $ret;
} | php | protected static function formatDumpStack($stack, $var)
{
$ret = (count($stack) ? join('', $stack) : '');
$ret .= '<' . (
is_array($var)
? 'array(' . count($var) . ')'
: get_class($var)
) . '>';
return $ret;
} | [
"protected",
"static",
"function",
"formatDumpStack",
"(",
"$",
"stack",
",",
"$",
"var",
")",
"{",
"$",
"ret",
"=",
"(",
"count",
"(",
"$",
"stack",
")",
"?",
"join",
"(",
"''",
",",
"$",
"stack",
")",
":",
"''",
")",
";",
"$",
"ret",
".=",
"'... | Formats a stack prefix
@param array $stack
@param string $var
@return string | [
"Formats",
"a",
"stack",
"prefix"
] | c98521aa2524a5224d9c1e81145c5b0434892a5a | https://github.com/zicht/util/blob/c98521aa2524a5224d9c1e81145c5b0434892a5a/src/Zicht/Util/Debug.php#L199-L209 |
187,591 | yawik/applications | src/Repository/Filter/PaginationQuery.php | PaginationQuery.createQuery | public function createQuery($params, $queryBuilder)
{
$userID = $this->auth->getUser()->getId();
if ($params instanceof Parameters) {
$value = $params->toArray();
} else {
$value = $params;
}
if (isset($value['job']) && !empty($value['job'])) {
... | php | public function createQuery($params, $queryBuilder)
{
$userID = $this->auth->getUser()->getId();
if ($params instanceof Parameters) {
$value = $params->toArray();
} else {
$value = $params;
}
if (isset($value['job']) && !empty($value['job'])) {
... | [
"public",
"function",
"createQuery",
"(",
"$",
"params",
",",
"$",
"queryBuilder",
")",
"{",
"$",
"userID",
"=",
"$",
"this",
"->",
"auth",
"->",
"getUser",
"(",
")",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"$",
"params",
"instanceof",
"Parameters",
... | Creates a query for filtering applications
@see \Core\Repository\Filter\AbstractPaginationQuery::createQuery()
@param array $params
@param Builder $queryBuilder
@return Builder | [
"Creates",
"a",
"query",
"for",
"filtering",
"applications"
] | c3876ae91dc35f03aa71fa0e79877d15a78a2d0f | https://github.com/yawik/applications/blob/c3876ae91dc35f03aa71fa0e79877d15a78a2d0f/src/Repository/Filter/PaginationQuery.php#L58-L102 |
187,592 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.connect | public function connect() {
// only continue, if not connected
if ($this->isConnected()) throw new SmtpException('SMTP client already connected');
$this->log('connecting...');
$response = $this->connection->open();
$this->log($response);
} | php | public function connect() {
// only continue, if not connected
if ($this->isConnected()) throw new SmtpException('SMTP client already connected');
$this->log('connecting...');
$response = $this->connection->open();
$this->log($response);
} | [
"public",
"function",
"connect",
"(",
")",
"{",
"// only continue, if not connected\r",
"if",
"(",
"$",
"this",
"->",
"isConnected",
"(",
")",
")",
"throw",
"new",
"SmtpException",
"(",
"'SMTP client already connected'",
")",
";",
"$",
"this",
"->",
"log",
"(",
... | connects to an smtp server
@throws SmtpException
@throws SmtpConnectionException | [
"connects",
"to",
"an",
"smtp",
"server"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L55-L62 |
187,593 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.isConnected | function isConnected() {
try {
return $this->connection->isOpen();
} catch (SmtpException $ex) {
$this->log('EOF caught while checking if connected', 'client');
$this->close();
}
return false;
} | php | function isConnected() {
try {
return $this->connection->isOpen();
} catch (SmtpException $ex) {
$this->log('EOF caught while checking if connected', 'client');
$this->close();
}
return false;
} | [
"function",
"isConnected",
"(",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"connection",
"->",
"isOpen",
"(",
")",
";",
"}",
"catch",
"(",
"SmtpException",
"$",
"ex",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'EOF caught while checking if connected... | returns whether or not a connection is open
@return boolean | [
"returns",
"whether",
"or",
"not",
"a",
"connection",
"is",
"open"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L69-L77 |
187,594 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.authenticate | public function authenticate() {
$this->sendMessage('AUTH LOGIN', 334, 'SMTP AUTH not accepted from server');
$this->sendMessage($this->config->getUser(), 334, 'SMTP username not accepted from server', true);
$this->sendMessage($this->config->getPassword(), 235, 'SMTP password not accepted from server', true);... | php | public function authenticate() {
$this->sendMessage('AUTH LOGIN', 334, 'SMTP AUTH not accepted from server');
$this->sendMessage($this->config->getUser(), 334, 'SMTP username not accepted from server', true);
$this->sendMessage($this->config->getPassword(), 235, 'SMTP password not accepted from server', true);... | [
"public",
"function",
"authenticate",
"(",
")",
"{",
"$",
"this",
"->",
"sendMessage",
"(",
"'AUTH LOGIN'",
",",
"334",
",",
"'SMTP AUTH not accepted from server'",
")",
";",
"$",
"this",
"->",
"sendMessage",
"(",
"$",
"this",
"->",
"config",
"->",
"getUser",
... | sends authentification to the server
@throws SmtpConnectionException | [
"sends",
"authentification",
"to",
"the",
"server"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L95-L99 |
187,595 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.quit | public function quit($closeOnError = true) {
try {
$this->sendMessage('QUIT', 221, 'SMTP server rejected quit command');
} catch (SmtpConnectionException $ex) {
if (!$closeOnError) throw $ex;
}
$this->close();
} | php | public function quit($closeOnError = true) {
try {
$this->sendMessage('QUIT', 221, 'SMTP server rejected quit command');
} catch (SmtpConnectionException $ex) {
if (!$closeOnError) throw $ex;
}
$this->close();
} | [
"public",
"function",
"quit",
"(",
"$",
"closeOnError",
"=",
"true",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"sendMessage",
"(",
"'QUIT'",
",",
"221",
",",
"'SMTP server rejected quit command'",
")",
";",
"}",
"catch",
"(",
"SmtpConnectionException",
"$",
"... | quits the communication with the server. is private as you shoul always call quit
@param bool $closeOnError
@throws SmtpConnectionException | [
"quits",
"the",
"communication",
"with",
"the",
"server",
".",
"is",
"private",
"as",
"you",
"shoul",
"always",
"call",
"quit"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L166-L173 |
187,596 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.connectAndAuthenticate | public function connectAndAuthenticate() {
// 1. connect
if (!$this->isConnected()) {
$this->connect();
}
$this->hello();
// 2. open tls connection if needed
$securityMode = $this->config->getSecurityMode();
if ($securityMode == SmtpConfig::SECURITY_MODE_TLS) {
$this->startTls();
$t... | php | public function connectAndAuthenticate() {
// 1. connect
if (!$this->isConnected()) {
$this->connect();
}
$this->hello();
// 2. open tls connection if needed
$securityMode = $this->config->getSecurityMode();
if ($securityMode == SmtpConfig::SECURITY_MODE_TLS) {
$this->startTls();
$t... | [
"public",
"function",
"connectAndAuthenticate",
"(",
")",
"{",
"// 1. connect\r",
"if",
"(",
"!",
"$",
"this",
"->",
"isConnected",
"(",
")",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"$",
"this",
"->",
"hello",
"(",
")",
";",
"// 2... | method to call connect, hello, tls, hello and authenticate if needed | [
"method",
"to",
"call",
"connect",
"hello",
"tls",
"hello",
"and",
"authenticate",
"if",
"needed"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L190-L208 |
187,597 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.sendMail | public function sendMail(Mail $mail) {
$sender = $mail->getSender();
if (!$sender instanceof MailAddress) {
throw new SmtpException('no sender found on mail');
}
$this->mail($sender->getEmail());
foreach ($mail->getRecipients() as $address) {
$address instanceof MailAddress;
// @todo: cat... | php | public function sendMail(Mail $mail) {
$sender = $mail->getSender();
if (!$sender instanceof MailAddress) {
throw new SmtpException('no sender found on mail');
}
$this->mail($sender->getEmail());
foreach ($mail->getRecipients() as $address) {
$address instanceof MailAddress;
// @todo: cat... | [
"public",
"function",
"sendMail",
"(",
"Mail",
"$",
"mail",
")",
"{",
"$",
"sender",
"=",
"$",
"mail",
"->",
"getSender",
"(",
")",
";",
"if",
"(",
"!",
"$",
"sender",
"instanceof",
"MailAddress",
")",
"{",
"throw",
"new",
"SmtpException",
"(",
"'no se... | method to call mail, recipients and data after each other
@param Mail $mail | [
"method",
"to",
"call",
"mail",
"recipients",
"and",
"data",
"after",
"each",
"other"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L215-L229 |
187,598 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.sendMessage | private function sendMessage($message, $successCodes = null, $errorMsg = null, $baseEncode = false) {
$this->log($message);
$getResponse = (bool) $successCodes;
if ($baseEncode) $message = base64_encode($message);
try {
$response = $this->connection->sendMessage($message, $getResponse, self::EOL);
} ... | php | private function sendMessage($message, $successCodes = null, $errorMsg = null, $baseEncode = false) {
$this->log($message);
$getResponse = (bool) $successCodes;
if ($baseEncode) $message = base64_encode($message);
try {
$response = $this->connection->sendMessage($message, $getResponse, self::EOL);
} ... | [
"private",
"function",
"sendMessage",
"(",
"$",
"message",
",",
"$",
"successCodes",
"=",
"null",
",",
"$",
"errorMsg",
"=",
"null",
",",
"$",
"baseEncode",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"$",
"message",
")",
";",
"$",
"getRes... | sends a message over the SmtpConnection to the server
@param string $message
@param mixed $successCodes
@param string $errorMsg
@param bool $baseEncode
@throws SmtpConnectionException
@return SmtpResponse | [
"sends",
"a",
"message",
"over",
"the",
"SmtpConnection",
"to",
"the",
"server"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L260-L280 |
187,599 | n2n/n2n-mail | src/app/n2n/mail/smtp/SmtpClient.php | SmtpClient.log | private function log($message, $party = null, $exception = false) {
if (!$this->config->getDebugMode()) return;
if (!$party) {
$party = $message instanceof SmtpResponse ? 'server' : 'client';
}
// @todo: add logger possibility
$eol = self::EOL;
echo "SMTP " . strtoupper($party) . ":{$eol}{$mes... | php | private function log($message, $party = null, $exception = false) {
if (!$this->config->getDebugMode()) return;
if (!$party) {
$party = $message instanceof SmtpResponse ? 'server' : 'client';
}
// @todo: add logger possibility
$eol = self::EOL;
echo "SMTP " . strtoupper($party) . ":{$eol}{$mes... | [
"private",
"function",
"log",
"(",
"$",
"message",
",",
"$",
"party",
"=",
"null",
",",
"$",
"exception",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"config",
"->",
"getDebugMode",
"(",
")",
")",
"return",
";",
"if",
"(",
"!",
"$"... | makes a log entry
@param string $message
@param string $party
@param bool $exception | [
"makes",
"a",
"log",
"entry"
] | 00fcceab594a2dc2e6923be950a71edacb44b276 | https://github.com/n2n/n2n-mail/blob/00fcceab594a2dc2e6923be950a71edacb44b276/src/app/n2n/mail/smtp/SmtpClient.php#L288-L298 |
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.