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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34,700 | nepttune/nepttune | src/Model/PushNotificationModel.php | PushNotificationModel.sendByType | public function sendByType(int $typeId, string $msg, ?string $dest = null, bool $flush = false) : void
{
$msg = $this->composeMsg($msg, $dest);
$subscriptions = $this->subscriptionTable->findAll()
->where('subscription.active', 1)
->where('user.active', 1)
->wher... | php | public function sendByType(int $typeId, string $msg, ?string $dest = null, bool $flush = false) : void
{
$msg = $this->composeMsg($msg, $dest);
$subscriptions = $this->subscriptionTable->findAll()
->where('subscription.active', 1)
->where('user.active', 1)
->wher... | [
"public",
"function",
"sendByType",
"(",
"int",
"$",
"typeId",
",",
"string",
"$",
"msg",
",",
"?",
"string",
"$",
"dest",
"=",
"null",
",",
"bool",
"$",
"flush",
"=",
"false",
")",
":",
"void",
"{",
"$",
"msg",
"=",
"$",
"this",
"->",
"composeMsg"... | Send notification to all users subscribed to specific type.
@param int $typeId
@param string $msg
@param string $dest
@param bool $flush | [
"Send",
"notification",
"to",
"all",
"users",
"subscribed",
"to",
"specific",
"type",
"."
] | 63b41f62e0589a0ebac698abd1b8cf65abfcb1d5 | https://github.com/nepttune/nepttune/blob/63b41f62e0589a0ebac698abd1b8cf65abfcb1d5/src/Model/PushNotificationModel.php#L103-L121 |
34,701 | nepttune/nepttune | src/Model/PushNotificationModel.php | PushNotificationModel.saveSubscription | public function saveSubscription(int $userId = null) : void
{
$json = \file_get_contents('php://input');
if (!$json)
{
return;
}
$data = \json_decode($json, true);
if (!$data || empty($data['endpoint']) || empty($data['publicKey']) || empty($data['authT... | php | public function saveSubscription(int $userId = null) : void
{
$json = \file_get_contents('php://input');
if (!$json)
{
return;
}
$data = \json_decode($json, true);
if (!$data || empty($data['endpoint']) || empty($data['publicKey']) || empty($data['authT... | [
"public",
"function",
"saveSubscription",
"(",
"int",
"$",
"userId",
"=",
"null",
")",
":",
"void",
"{",
"$",
"json",
"=",
"\\",
"file_get_contents",
"(",
"'php://input'",
")",
";",
"if",
"(",
"!",
"$",
"json",
")",
"{",
"return",
";",
"}",
"$",
"dat... | Save or update subscriber information.
@throws \Nette\Application\BadRequestException
@param int $userId | [
"Save",
"or",
"update",
"subscriber",
"information",
"."
] | 63b41f62e0589a0ebac698abd1b8cf65abfcb1d5 | https://github.com/nepttune/nepttune/blob/63b41f62e0589a0ebac698abd1b8cf65abfcb1d5/src/Model/PushNotificationModel.php#L128-L188 |
34,702 | voslartomas/WebCMS2 | AdminModule/presenters/LanguagesPresenter.php | LanguagesPresenter.actionExportLanguage | public function actionExportLanguage($id)
{
$language = $this->em->find("WebCMS\Entity\Language", $id);
$export = array(
'name' => $language->getName(),
'abbr' => $language->getAbbr(),
'translations' => array(),
);
foreach ($language->getTranslat... | php | public function actionExportLanguage($id)
{
$language = $this->em->find("WebCMS\Entity\Language", $id);
$export = array(
'name' => $language->getName(),
'abbr' => $language->getAbbr(),
'translations' => array(),
);
foreach ($language->getTranslat... | [
"public",
"function",
"actionExportLanguage",
"(",
"$",
"id",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"em",
"->",
"find",
"(",
"\"WebCMS\\Entity\\Language\"",
",",
"$",
"id",
")",
";",
"$",
"export",
"=",
"array",
"(",
"'name'",
"=>",
"$",
"... | Export language into JSON file and terminate response for download it.
@param Int $id | [
"Export",
"language",
"into",
"JSON",
"file",
"and",
"terminate",
"response",
"for",
"download",
"it",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/AdminModule/presenters/LanguagesPresenter.php#L142-L180 |
34,703 | CESNET/perun-simplesamlphp-module | lib/DatabaseConnector.php | DatabaseConnector.getConnection | public function getConnection()
{
$conn = mysqli_init();
if ($this->encryption === true) {
Logger::debug("Getting connection with encryption.");
mysqli_ssl_set($conn, $this->sslKey, $this->sslCert, $this->sslCA, $this->sslCAPath, null);
if ($this->port === null) {... | php | public function getConnection()
{
$conn = mysqli_init();
if ($this->encryption === true) {
Logger::debug("Getting connection with encryption.");
mysqli_ssl_set($conn, $this->sslKey, $this->sslCert, $this->sslCA, $this->sslCAPath, null);
if ($this->port === null) {... | [
"public",
"function",
"getConnection",
"(",
")",
"{",
"$",
"conn",
"=",
"mysqli_init",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"encryption",
"===",
"true",
")",
"{",
"Logger",
"::",
"debug",
"(",
"\"Getting connection with encryption.\"",
")",
";",
"m... | Function returns the connection to db
@return mysqli connection | [
"Function",
"returns",
"the",
"connection",
"to",
"db"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/DatabaseConnector.php#L63-L94 |
34,704 | MetaModels/filter_range | src/FilterSetting/AbstractRange.php | AbstractRange.getReferencedAttributes | public function getReferencedAttributes()
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$objAttribute2 = $objMetaModel->getAttributeById($this->get('attr_id2'));
$arrResult = [];
if ($objAttribute) {
... | php | public function getReferencedAttributes()
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$objAttribute2 = $objMetaModel->getAttributeById($this->get('attr_id2'));
$arrResult = [];
if ($objAttribute) {
... | [
"public",
"function",
"getReferencedAttributes",
"(",
")",
"{",
"$",
"objMetaModel",
"=",
"$",
"this",
"->",
"getMetaModel",
"(",
")",
";",
"$",
"objAttribute",
"=",
"$",
"objMetaModel",
"->",
"getAttributeById",
"(",
"$",
"this",
"->",
"get",
"(",
"'attr_id... | Retrieve the attributes that are referenced in this filter setting.
@return array | [
"Retrieve",
"the",
"attributes",
"that",
"are",
"referenced",
"in",
"this",
"filter",
"setting",
"."
] | 1875e4a2206df2c5c98f5b0a7f18feb17b34f393 | https://github.com/MetaModels/filter_range/blob/1875e4a2206df2c5c98f5b0a7f18feb17b34f393/src/FilterSetting/AbstractRange.php#L102-L118 |
34,705 | MetaModels/filter_range | src/FilterSetting/AbstractRange.php | AbstractRange.getFilterWidgetParameters | protected function getFilterWidgetParameters(IAttribute $attribute, $currentValue, $ids)
{
return [
'label' => $this->prepareWidgetLabel($attribute),
'inputType' => 'multitext',
'options' => $this->prepareWidgetOptions($ids, $attribute),
'tim... | php | protected function getFilterWidgetParameters(IAttribute $attribute, $currentValue, $ids)
{
return [
'label' => $this->prepareWidgetLabel($attribute),
'inputType' => 'multitext',
'options' => $this->prepareWidgetOptions($ids, $attribute),
'tim... | [
"protected",
"function",
"getFilterWidgetParameters",
"(",
"IAttribute",
"$",
"attribute",
",",
"$",
"currentValue",
",",
"$",
"ids",
")",
"{",
"return",
"[",
"'label'",
"=>",
"$",
"this",
"->",
"prepareWidgetLabel",
"(",
"$",
"attribute",
")",
",",
"'inputTyp... | Get the parameter array for configuring the widget.
@param IAttribute $attribute The attribute.
@param array $currentValue The current value.
@param string[] $ids The list of ids.
@return array | [
"Get",
"the",
"parameter",
"array",
"for",
"configuring",
"the",
"widget",
"."
] | 1875e4a2206df2c5c98f5b0a7f18feb17b34f393 | https://github.com/MetaModels/filter_range/blob/1875e4a2206df2c5c98f5b0a7f18feb17b34f393/src/FilterSetting/AbstractRange.php#L263-L281 |
34,706 | Rareloop/primer-core | src/Primer/Renderable/Group.php | Group.loadPatternsInPath | public static function loadPatternsInPath($path)
{
$groups = array();
if ($handle = opendir($path)) {
while (false !== ($entry = readdir($handle))) {
$fullPath = $path . '/' . $entry;
if (substr($entry, 0, 1) !== '.') {
... | php | public static function loadPatternsInPath($path)
{
$groups = array();
if ($handle = opendir($path)) {
while (false !== ($entry = readdir($handle))) {
$fullPath = $path . '/' . $entry;
if (substr($entry, 0, 1) !== '.') {
... | [
"public",
"static",
"function",
"loadPatternsInPath",
"(",
"$",
"path",
")",
"{",
"$",
"groups",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"handle",
"=",
"opendir",
"(",
"$",
"path",
")",
")",
"{",
"while",
"(",
"false",
"!==",
"(",
"$",
"entry"... | Helper function to load all groups in a folder
@param String $path The path of the directory to load from
@return Array Array of all groups loaded | [
"Helper",
"function",
"to",
"load",
"all",
"groups",
"in",
"a",
"folder"
] | fe098d6794a4add368f97672397dc93d223a1786 | https://github.com/Rareloop/primer-core/blob/fe098d6794a4add368f97672397dc93d223a1786/src/Primer/Renderable/Group.php#L93-L116 |
34,707 | c4studio/chronos | src/Chronos/Scaffolding/ScaffoldingServiceProvider.php | ScaffoldingServiceProvider.registerGates | protected function registerGates($gate)
{
if (class_exists('Chronos\Scaffolding\Models\Permission') && Schema::hasTable('roles')) {
$permissions = \Chronos\Scaffolding\Models\Permission::all();
foreach ($permissions as $permission) {
$gate->define($permission->name, f... | php | protected function registerGates($gate)
{
if (class_exists('Chronos\Scaffolding\Models\Permission') && Schema::hasTable('roles')) {
$permissions = \Chronos\Scaffolding\Models\Permission::all();
foreach ($permissions as $permission) {
$gate->define($permission->name, f... | [
"protected",
"function",
"registerGates",
"(",
"$",
"gate",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'Chronos\\Scaffolding\\Models\\Permission'",
")",
"&&",
"Schema",
"::",
"hasTable",
"(",
"'roles'",
")",
")",
"{",
"$",
"permissions",
"=",
"\\",
"Chronos",
... | Register gates. | [
"Register",
"gates",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Scaffolding/ScaffoldingServiceProvider.php#L93-L103 |
34,708 | c4studio/chronos | src/Chronos/Scaffolding/ScaffoldingServiceProvider.php | ScaffoldingServiceProvider.registerMenu | protected function registerMenu()
{
\Menu::make('ChronosMenu', function($menu) {
// $menu->add(trans('chronos.scaffolding::menu.Dashboard'), ['route' => 'chronos.dashboard'])
// ->prepend('<span class="icon c4icon-dashboard"></span>')
// ->data('order', 1)->data('per... | php | protected function registerMenu()
{
\Menu::make('ChronosMenu', function($menu) {
// $menu->add(trans('chronos.scaffolding::menu.Dashboard'), ['route' => 'chronos.dashboard'])
// ->prepend('<span class="icon c4icon-dashboard"></span>')
// ->data('order', 1)->data('per... | [
"protected",
"function",
"registerMenu",
"(",
")",
"{",
"\\",
"Menu",
"::",
"make",
"(",
"'ChronosMenu'",
",",
"function",
"(",
"$",
"menu",
")",
"{",
"// $menu->add(trans('chronos.scaffolding::menu.Dashboard'), ['route' => 'chronos.dashboard'])",
"// ... | Register menu and share it with all views. | [
"Register",
"menu",
"and",
"share",
"it",
"with",
"all",
"views",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Scaffolding/ScaffoldingServiceProvider.php#L108-L138 |
34,709 | voslartomas/WebCMS2 | libs/translation/Translator.php | Translator.translate | public function translate($message, $parameters = array())
{
if (count($parameters) === 0) {
return $this->translations[$message];
} else {
return vsprintf($this->translations[$message], $parameters);
}
} | php | public function translate($message, $parameters = array())
{
if (count($parameters) === 0) {
return $this->translations[$message];
} else {
return vsprintf($this->translations[$message], $parameters);
}
} | [
"public",
"function",
"translate",
"(",
"$",
"message",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"parameters",
")",
"===",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"translations",
"[",
"$",
"message",... | Translates given message.
@param type $message
@param type $parameters | [
"Translates",
"given",
"message",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/libs/translation/Translator.php#L26-L33 |
34,710 | c4studio/chronos | src/Chronos/Scaffolding/app/Services/RouteMapService.php | RouteMapService.add | public static function add($action, $type, $id = null)
{
if (!is_null($id))
self::$modelMap[$type][$id] = $action;
else
self::$typeMap[$type] = $action;
} | php | public static function add($action, $type, $id = null)
{
if (!is_null($id))
self::$modelMap[$type][$id] = $action;
else
self::$typeMap[$type] = $action;
} | [
"public",
"static",
"function",
"add",
"(",
"$",
"action",
",",
"$",
"type",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"id",
")",
")",
"self",
"::",
"$",
"modelMap",
"[",
"$",
"type",
"]",
"[",
"$",
"id",
"]"... | Register new mapping
@param $action
@param $type
@param null $id | [
"Register",
"new",
"mapping"
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Scaffolding/app/Services/RouteMapService.php#L17-L23 |
34,711 | voslartomas/WebCMS2 | libs/helpers/SystemHelper.php | SystemHelper.checkFileContainsStr | public static function checkFileContainsStr($filename, $needle)
{
if (file_exists($filename)) {
$content = file_get_contents($filename);
if (strstr($content, $needle)) {
return true;
}
}
return false;
} | php | public static function checkFileContainsStr($filename, $needle)
{
if (file_exists($filename)) {
$content = file_get_contents($filename);
if (strstr($content, $needle)) {
return true;
}
}
return false;
} | [
"public",
"static",
"function",
"checkFileContainsStr",
"(",
"$",
"filename",
",",
"$",
"needle",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"content",
"=",
"file_get_contents",
"(",
"$",
"filename",
")",
";",
"if",
"("... | Check if given file contains given string
@param String $filename
@param String $needle
@return Boolean | [
"Check",
"if",
"given",
"file",
"contains",
"given",
"string"
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/libs/helpers/SystemHelper.php#L107-L118 |
34,712 | voslartomas/WebCMS2 | libs/helpers/SystemHelper.php | SystemHelper.isSuperAdmin | public static function isSuperAdmin(\Nette\Security\User $user)
{
$roles = $user->getIdentity()->getRoles();
return in_array('superadmin', $roles);
} | php | public static function isSuperAdmin(\Nette\Security\User $user)
{
$roles = $user->getIdentity()->getRoles();
return in_array('superadmin', $roles);
} | [
"public",
"static",
"function",
"isSuperAdmin",
"(",
"\\",
"Nette",
"\\",
"Security",
"\\",
"User",
"$",
"user",
")",
"{",
"$",
"roles",
"=",
"$",
"user",
"->",
"getIdentity",
"(",
")",
"->",
"getRoles",
"(",
")",
";",
"return",
"in_array",
"(",
"'supe... | Checks whether user has role superadmin or not.
@param \Nette\Security\User $user
@return Boolean | [
"Checks",
"whether",
"user",
"has",
"role",
"superadmin",
"or",
"not",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/libs/helpers/SystemHelper.php#L149-L154 |
34,713 | voslartomas/WebCMS2 | libs/helpers/SystemHelper.php | SystemHelper.strFindAndReplaceAll | public static function strFindAndReplaceAll($vars = array(), $str)
{
if (array_count_values($vars) > 0){
foreach ($vars as $key => $val) {
for ($i = substr_count($str, $key); $i > 0; $i--) {
$str = \WebCMS\Helpers\SystemHelper::strlReplace($key, $val, $str);
... | php | public static function strFindAndReplaceAll($vars = array(), $str)
{
if (array_count_values($vars) > 0){
foreach ($vars as $key => $val) {
for ($i = substr_count($str, $key); $i > 0; $i--) {
$str = \WebCMS\Helpers\SystemHelper::strlReplace($key, $val, $str);
... | [
"public",
"static",
"function",
"strFindAndReplaceAll",
"(",
"$",
"vars",
"=",
"array",
"(",
")",
",",
"$",
"str",
")",
"{",
"if",
"(",
"array_count_values",
"(",
"$",
"vars",
")",
">",
"0",
")",
"{",
"foreach",
"(",
"$",
"vars",
"as",
"$",
"key",
... | Replace all needles found in str with rewrites
@param Array[needle, rewrite]
@param string $str
@return string $str | [
"Replace",
"all",
"needles",
"found",
"in",
"str",
"with",
"rewrites"
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/libs/helpers/SystemHelper.php#L197-L207 |
34,714 | voslartomas/WebCMS2 | libs/helpers/SystemHelper.php | SystemHelper.relative | public static function relative($path)
{
// windows fix :/
$path = str_replace('\\', '/', $path);
// standard working directory
if (strpos($path, WWW_DIR) !== false) {
return str_replace(WWW_DIR, '', $path);
}
// symlink
$pos = strpos($path, 'upl... | php | public static function relative($path)
{
// windows fix :/
$path = str_replace('\\', '/', $path);
// standard working directory
if (strpos($path, WWW_DIR) !== false) {
return str_replace(WWW_DIR, '', $path);
}
// symlink
$pos = strpos($path, 'upl... | [
"public",
"static",
"function",
"relative",
"(",
"$",
"path",
")",
"{",
"// windows fix :/",
"$",
"path",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"path",
")",
";",
"// standard working directory",
"if",
"(",
"strpos",
"(",
"$",
"path",
","... | Create relative path from an absolute path.
@param string $path absolute path | [
"Create",
"relative",
"path",
"from",
"an",
"absolute",
"path",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/libs/helpers/SystemHelper.php#L239-L253 |
34,715 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.postCreate | public function postCreate()
{
// @todo (Pablo - 2017-12-18) - this should be protected using admin permissions or the token uploader
$oHttpCodes = Factory::service('HttpCodes');
$oInput = Factory::service('Input');
$oCdn = Factory::service('Cdn', 'nails/module-cdn');
... | php | public function postCreate()
{
// @todo (Pablo - 2017-12-18) - this should be protected using admin permissions or the token uploader
$oHttpCodes = Factory::service('HttpCodes');
$oInput = Factory::service('Input');
$oCdn = Factory::service('Cdn', 'nails/module-cdn');
... | [
"public",
"function",
"postCreate",
"(",
")",
"{",
"// @todo (Pablo - 2017-12-18) - this should be protected using admin permissions or the token uploader",
"$",
"oHttpCodes",
"=",
"Factory",
"::",
"service",
"(",
"'HttpCodes'",
")",
";",
"$",
"oInput",
"=",
"Factory",
"::... | Upload a new object to the CDN
@return array | [
"Upload",
"a",
"new",
"object",
"to",
"the",
"CDN"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L99-L138 |
34,716 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.postDelete | public function postDelete()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:delete')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | php | public function postDelete()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:delete')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | [
"public",
"function",
"postDelete",
"(",
")",
"{",
"$",
"oHttpCodes",
"=",
"Factory",
"::",
"service",
"(",
"'HttpCodes'",
")",
";",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:cdn:manager:object:delete'",
")",
")",
"{",
"throw",
"new",
"ApiException",
"... | Delete an object from the CDN
@return array | [
"Delete",
"an",
"object",
"from",
"the",
"CDN"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L147-L197 |
34,717 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.postRestore | public function postRestore()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:restore')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | php | public function postRestore()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:restore')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | [
"public",
"function",
"postRestore",
"(",
")",
"{",
"$",
"oHttpCodes",
"=",
"Factory",
"::",
"service",
"(",
"'HttpCodes'",
")",
";",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:cdn:manager:object:restore'",
")",
")",
"{",
"throw",
"new",
"ApiException",
... | Restore an item form the trash
@return array | [
"Restore",
"an",
"item",
"form",
"the",
"trash"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L206-L229 |
34,718 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.getSearch | public function getSearch()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:browse')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | php | public function getSearch()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:browse')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | [
"public",
"function",
"getSearch",
"(",
")",
"{",
"$",
"oHttpCodes",
"=",
"Factory",
"::",
"service",
"(",
"'HttpCodes'",
")",
";",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:cdn:manager:object:browse'",
")",
")",
"{",
"throw",
"new",
"ApiException",
"(... | Search across all objects
@return array | [
"Search",
"across",
"all",
"objects"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L238-L272 |
34,719 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.getTrash | public function getTrash()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:browse')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | php | public function getTrash()
{
$oHttpCodes = Factory::service('HttpCodes');
if (!userHasPermission('admin:cdn:manager:object:browse')) {
throw new ApiException(
'You do not have permission to access this resource',
$oHttpCodes::STATUS_UNAUTHORIZED
... | [
"public",
"function",
"getTrash",
"(",
")",
"{",
"$",
"oHttpCodes",
"=",
"Factory",
"::",
"service",
"(",
"'HttpCodes'",
")",
";",
"if",
"(",
"!",
"userHasPermission",
"(",
"'admin:cdn:manager:object:browse'",
")",
")",
"{",
"throw",
"new",
"ApiException",
"("... | List items in the trash
@return array | [
"List",
"items",
"in",
"the",
"trash"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L281-L314 |
34,720 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.getRequestedUrls | protected function getRequestedUrls()
{
$oInput = Factory::service('Input');
$sUrls = $oInput->get('urls') ?: $oInput->header('X-Cdn-Urls');
$aUrls = !is_array($sUrls) ? explode(',', $sUrls) : $sUrls;
$aUrls = array_map('strtolower', $aUrls);
// Filter out any which don'... | php | protected function getRequestedUrls()
{
$oInput = Factory::service('Input');
$sUrls = $oInput->get('urls') ?: $oInput->header('X-Cdn-Urls');
$aUrls = !is_array($sUrls) ? explode(',', $sUrls) : $sUrls;
$aUrls = array_map('strtolower', $aUrls);
// Filter out any which don'... | [
"protected",
"function",
"getRequestedUrls",
"(",
")",
"{",
"$",
"oInput",
"=",
"Factory",
"::",
"service",
"(",
"'Input'",
")",
";",
"$",
"sUrls",
"=",
"$",
"oInput",
"->",
"get",
"(",
"'urls'",
")",
"?",
":",
"$",
"oInput",
"->",
"header",
"(",
"'X... | Return an array of the requested URLs form the request
@return array | [
"Return",
"an",
"array",
"of",
"the",
"requested",
"URLs",
"form",
"the",
"request"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L323-L352 |
34,721 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.formatObject | protected function formatObject($oObject, $aUrls = [])
{
return (object) [
'id' => $oObject->id,
'object' => (object) [
'name' => $oObject->file->name->human,
'mime' => $oObject->file->mime,
'size' => $oObject->file->size,
... | php | protected function formatObject($oObject, $aUrls = [])
{
return (object) [
'id' => $oObject->id,
'object' => (object) [
'name' => $oObject->file->name->human,
'mime' => $oObject->file->mime,
'size' => $oObject->file->size,
... | [
"protected",
"function",
"formatObject",
"(",
"$",
"oObject",
",",
"$",
"aUrls",
"=",
"[",
"]",
")",
"{",
"return",
"(",
"object",
")",
"[",
"'id'",
"=>",
"$",
"oObject",
"->",
"id",
",",
"'object'",
"=>",
"(",
"object",
")",
"[",
"'name'",
"=>",
"... | Format an object object
@param \stdClass $oObject the object to format
@param array $aUrls The requested URLs
@return object | [
"Format",
"an",
"object",
"object"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L364-L385 |
34,722 | nails/module-cdn | src/Api/Controller/CdnObject.php | CdnObject.generateUrls | protected function generateUrls($oObject, $aUrls)
{
$oCdn = Factory::service('Cdn', 'nails/module-cdn');
$aOut = ['src' => $oCdn->urlServe($oObject)];
if (!empty($aUrls) && $oObject->is_img) {
foreach ($aUrls as $aDimension) {
$sProperty = $aDimension['width'] .... | php | protected function generateUrls($oObject, $aUrls)
{
$oCdn = Factory::service('Cdn', 'nails/module-cdn');
$aOut = ['src' => $oCdn->urlServe($oObject)];
if (!empty($aUrls) && $oObject->is_img) {
foreach ($aUrls as $aDimension) {
$sProperty = $aDimension['width'] .... | [
"protected",
"function",
"generateUrls",
"(",
"$",
"oObject",
",",
"$",
"aUrls",
")",
"{",
"$",
"oCdn",
"=",
"Factory",
"::",
"service",
"(",
"'Cdn'",
",",
"'nails/module-cdn'",
")",
";",
"$",
"aOut",
"=",
"[",
"'src'",
"=>",
"$",
"oCdn",
"->",
"urlSer... | Generate the requested URLs
@param \stdClass $oObject The object object
@param array $aUrls The URLs to generate
@return array | [
"Generate",
"the",
"requested",
"URLs"
] | 1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef | https://github.com/nails/module-cdn/blob/1c2ff1cbdf2aa6a7162f92c8fdbcde87c506e1ef/src/Api/Controller/CdnObject.php#L397-L428 |
34,723 | CanalTP/NmmPortalBundle | Controller/CustomerController.php | CustomerController.findCustomerById | private function findCustomerById ($id) {
$customer = $this->getDoctrine()
->getManager()
->getRepository('CanalTPNmmPortalBundle:Customer')
->find($id);
return $customer;
} | php | private function findCustomerById ($id) {
$customer = $this->getDoctrine()
->getManager()
->getRepository('CanalTPNmmPortalBundle:Customer')
->find($id);
return $customer;
} | [
"private",
"function",
"findCustomerById",
"(",
"$",
"id",
")",
"{",
"$",
"customer",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
"->",
"getRepository",
"(",
"'CanalTPNmmPortalBundle:Customer'",
")",
"->",
"find",
"(",
"$",... | Find a Customer by id.
@param mixed $id The customer id
@return CanalTP\NmmPortalBundle\Entity\Customer | [
"Find",
"a",
"Customer",
"by",
"id",
"."
] | b1ad026a33897984206ea1691ad9e25db5854efb | https://github.com/CanalTP/NmmPortalBundle/blob/b1ad026a33897984206ea1691ad9e25db5854efb/Controller/CustomerController.php#L120-L127 |
34,724 | kadet1090/KeyLighter | Parser/Rules.php | Rules.addMany | public function addMany(array $rules, $prefix = null)
{
foreach ($rules as $type => $rule) {
$type = $this->_getName($type, $prefix);
if ($rule instanceof Rule) {
$this->add($type, $rule);
} elseif (is_array($rule)) {
$this->addMany($rule,... | php | public function addMany(array $rules, $prefix = null)
{
foreach ($rules as $type => $rule) {
$type = $this->_getName($type, $prefix);
if ($rule instanceof Rule) {
$this->add($type, $rule);
} elseif (is_array($rule)) {
$this->addMany($rule,... | [
"public",
"function",
"addMany",
"(",
"array",
"$",
"rules",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"type",
"=>",
"$",
"rule",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"_getName",
"(",
"$",
"type... | Adds array of rules
@param array $rules
@param string|null $prefix
@throws \LogicException | [
"Adds",
"array",
"of",
"rules"
] | 6aac402b7fe0170edf3c5afbae652009951068af | https://github.com/kadet1090/KeyLighter/blob/6aac402b7fe0170edf3c5afbae652009951068af/Parser/Rules.php#L61-L74 |
34,725 | kadet1090/KeyLighter | Parser/Rules.php | Rules.add | public function add($type, Rule $rule)
{
if (!isset($this[$type])) {
$this[$type] = [];
}
if ($rule->language === false) {
$rule->language = $this->_language;
}
if ($rule->validator === false) {
$rule->validator = $this->validator;
... | php | public function add($type, Rule $rule)
{
if (!isset($this[$type])) {
$this[$type] = [];
}
if ($rule->language === false) {
$rule->language = $this->_language;
}
if ($rule->validator === false) {
$rule->validator = $this->validator;
... | [
"public",
"function",
"add",
"(",
"$",
"type",
",",
"Rule",
"$",
"rule",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"[",
"$",
"type",
"]",
")",
")",
"{",
"$",
"this",
"[",
"$",
"type",
"]",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"$... | Adds one rule
@param string $type
@param Rule $rule
@throws NameConflictException When there is already defined rule with given name. | [
"Adds",
"one",
"rule"
] | 6aac402b7fe0170edf3c5afbae652009951068af | https://github.com/kadet1090/KeyLighter/blob/6aac402b7fe0170edf3c5afbae652009951068af/Parser/Rules.php#L84-L110 |
34,726 | kadet1090/KeyLighter | Parser/Rules.php | Rules.replace | public function replace(Rule $replacement, $type, $index = 0)
{
$current = $this->rule($type, $index);
if ($current->name !== null) {
$replacement->name = $current->name;
}
$this[$type][$index] = $replacement;
} | php | public function replace(Rule $replacement, $type, $index = 0)
{
$current = $this->rule($type, $index);
if ($current->name !== null) {
$replacement->name = $current->name;
}
$this[$type][$index] = $replacement;
} | [
"public",
"function",
"replace",
"(",
"Rule",
"$",
"replacement",
",",
"$",
"type",
",",
"$",
"index",
"=",
"0",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"rule",
"(",
"$",
"type",
",",
"$",
"index",
")",
";",
"if",
"(",
"$",
"current",
... | Replaces rule of given type and index with provided one.
@param Rule $replacement
@param $type
@param int $index | [
"Replaces",
"rule",
"of",
"given",
"type",
"and",
"index",
"with",
"provided",
"one",
"."
] | 6aac402b7fe0170edf3c5afbae652009951068af | https://github.com/kadet1090/KeyLighter/blob/6aac402b7fe0170edf3c5afbae652009951068af/Parser/Rules.php#L149-L157 |
34,727 | kadet1090/KeyLighter | Parser/Rules.php | Rules.remove | public function remove($type, $index = null)
{
if ($index === null) {
unset($this[$type]);
return;
}
if(!isset($this[$type][$index])) {
throw new NoSuchElementException("There is no rule '$type' type indexed by '$index'.");
}
unset($this[... | php | public function remove($type, $index = null)
{
if ($index === null) {
unset($this[$type]);
return;
}
if(!isset($this[$type][$index])) {
throw new NoSuchElementException("There is no rule '$type' type indexed by '$index'.");
}
unset($this[... | [
"public",
"function",
"remove",
"(",
"$",
"type",
",",
"$",
"index",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"index",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"[",
"$",
"type",
"]",
")",
";",
"return",
";",
"}",
"if",
"(",
"!",
"iss... | Removes rule of given type and index.
@param string $type
@param mixed $index
@throws NoSuchElementException | [
"Removes",
"rule",
"of",
"given",
"type",
"and",
"index",
"."
] | 6aac402b7fe0170edf3c5afbae652009951068af | https://github.com/kadet1090/KeyLighter/blob/6aac402b7fe0170edf3c5afbae652009951068af/Parser/Rules.php#L167-L179 |
34,728 | Rareloop/primer-core | src/Primer/FileSystem.php | FileSystem.getDataForPattern | public static function getDataForPattern($id, $resolveAlias = false)
{
$data = array();
$id = Primer::cleanId($id);
// Load the Patterns default data
$defaultData = @file_get_contents(Primer::$PATTERN_PATH . '/' . $id . '/data.json');
if ($defaultData) {
$json ... | php | public static function getDataForPattern($id, $resolveAlias = false)
{
$data = array();
$id = Primer::cleanId($id);
// Load the Patterns default data
$defaultData = @file_get_contents(Primer::$PATTERN_PATH . '/' . $id . '/data.json');
if ($defaultData) {
$json ... | [
"public",
"static",
"function",
"getDataForPattern",
"(",
"$",
"id",
",",
"$",
"resolveAlias",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"id",
"=",
"Primer",
"::",
"cleanId",
"(",
"$",
"id",
")",
";",
"// Load the Patterns ... | Retrieve data for a patter
@param String $id The id of the pattern
@param Boolean $resolveAlias Whether or not to resolve data from aliased patterns (e.g. button~outline -> button)
@return ViewData The decoded JSON data | [
"Retrieve",
"data",
"for",
"a",
"patter"
] | fe098d6794a4add368f97672397dc93d223a1786 | https://github.com/Rareloop/primer-core/blob/fe098d6794a4add368f97672397dc93d223a1786/src/Primer/FileSystem.php#L20-L59 |
34,729 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.getGeoAnalysis | public function getGeoAnalysis($id, $only_enabled = true) {
$args = array (
'gedcom_id' => $this->tree->getTreeId(),
'ga_id' => $id
);
$sql = 'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen, majgd_stat... | php | public function getGeoAnalysis($id, $only_enabled = true) {
$args = array (
'gedcom_id' => $this->tree->getTreeId(),
'ga_id' => $id
);
$sql = 'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen, majgd_stat... | [
"public",
"function",
"getGeoAnalysis",
"(",
"$",
"id",
",",
"$",
"only_enabled",
"=",
"true",
")",
"{",
"$",
"args",
"=",
"array",
"(",
"'gedcom_id'",
"=>",
"$",
"this",
"->",
"tree",
"->",
"getTreeId",
"(",
")",
",",
"'ga_id'",
"=>",
"$",
"id",
")"... | Get a geographical analysis by its ID.
The function can only search for only enabled analysis, or all.
@param int $id geodispersion analysis ID
@param bool $only_enabled Search for only enabled geodispersion analysis
@return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoAnalysis|NULL | [
"Get",
"a",
"geographical",
"analysis",
"by",
"its",
"ID",
".",
"The",
"function",
"can",
"only",
"search",
"for",
"only",
"enabled",
"analysis",
"or",
"all",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L112-L134 |
34,730 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.createGeoAnalysis | public function createGeoAnalysis($description, $analysis_level, $map_file, $map_top_level, $use_flags, $gen_details) {
try{
Database::beginTransaction();
Database::prepare(
'INSERT INTO `##maj_geodispersion`'.
' (majgd_file, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, ... | php | public function createGeoAnalysis($description, $analysis_level, $map_file, $map_top_level, $use_flags, $gen_details) {
try{
Database::beginTransaction();
Database::prepare(
'INSERT INTO `##maj_geodispersion`'.
' (majgd_file, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, ... | [
"public",
"function",
"createGeoAnalysis",
"(",
"$",
"description",
",",
"$",
"analysis_level",
",",
"$",
"map_file",
",",
"$",
"map_top_level",
",",
"$",
"use_flags",
",",
"$",
"gen_details",
")",
"{",
"try",
"{",
"Database",
"::",
"beginTransaction",
"(",
... | Add a new geodispersion analysis in the database, in a transactional manner.
When successful, eturns the newly created GeoAnalysis object.
@param string $description geodispersion analysis title
@param int $analysis_level Analysis level
@param string $map_file Filename of the map
@param int $map_top_level Parent level... | [
"Add",
"a",
"new",
"geodispersion",
"analysis",
"in",
"the",
"database",
"in",
"a",
"transactional",
"manner",
".",
"When",
"successful",
"eturns",
"the",
"newly",
"created",
"GeoAnalysis",
"object",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L148-L177 |
34,731 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.deleteGeoAnalysis | public function deleteGeoAnalysis(GeoAnalysis $ga) {
Database::prepare(
'DELETE FROM `##maj_geodispersion`'.
' WHERE majgd_file = :gedcom_id AND majgd_id=:ga_id'
)->execute(array(
'gedcom_id' => $this->tree->getTreeId(),
'ga_id' => $ga->getId()... | php | public function deleteGeoAnalysis(GeoAnalysis $ga) {
Database::prepare(
'DELETE FROM `##maj_geodispersion`'.
' WHERE majgd_file = :gedcom_id AND majgd_id=:ga_id'
)->execute(array(
'gedcom_id' => $this->tree->getTreeId(),
'ga_id' => $ga->getId()... | [
"public",
"function",
"deleteGeoAnalysis",
"(",
"GeoAnalysis",
"$",
"ga",
")",
"{",
"Database",
"::",
"prepare",
"(",
"'DELETE FROM `##maj_geodispersion`'",
".",
"' WHERE majgd_file = :gedcom_id AND majgd_id=:ga_id'",
")",
"->",
"execute",
"(",
"array",
"(",
"'gedcom_id'"... | Delete a geodispersion analysis from the database.
@param GeoAnalysis $ga | [
"Delete",
"a",
"geodispersion",
"analysis",
"from",
"the",
"database",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L246-L254 |
34,732 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.getGeoAnalysisList | public function getGeoAnalysisList(){
$res = array();
$list = Database::prepare(
'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen' .
' FROM `##maj_geodispersion`' .
' WHERE majgd_file = :gedcom_id A... | php | public function getGeoAnalysisList(){
$res = array();
$list = Database::prepare(
'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen' .
' FROM `##maj_geodispersion`' .
' WHERE majgd_file = :gedcom_id A... | [
"public",
"function",
"getGeoAnalysisList",
"(",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"$",
"list",
"=",
"Database",
"::",
"prepare",
"(",
"'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen'",
".",
"... | Return the list of geodispersion analysis recorded and enabled for a specific GEDCOM
@return array List of enabled maps | [
"Return",
"the",
"list",
"of",
"geodispersion",
"analysis",
"recorded",
"and",
"enabled",
"for",
"a",
"specific",
"GEDCOM"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L261-L279 |
34,733 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.getFilteredGeoAnalysisList | public function getFilteredGeoAnalysisList($search = null, $order_by = null, $start = 0, $limit = null){
$res = array();
$sql =
'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen, majgd_status' .
' FROM `##m... | php | public function getFilteredGeoAnalysisList($search = null, $order_by = null, $start = 0, $limit = null){
$res = array();
$sql =
'SELECT majgd_id, majgd_descr, majgd_sublevel, majgd_map, majgd_toplevel, majgd_useflagsgen, majgd_detailsgen, majgd_status' .
' FROM `##m... | [
"public",
"function",
"getFilteredGeoAnalysisList",
"(",
"$",
"search",
"=",
"null",
",",
"$",
"order_by",
"=",
"null",
",",
"$",
"start",
"=",
"0",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"$",
"sql",
"=",... | Return the list of geodispersion analysis matching specified criterias.
@param string $search Search criteria in analysis description
@param array $order_by Columns to order by
@param int $start Offset to start with (for pagination)
@param int|null $limit Max number of items to return (for pagination)
@return \MyArtJa... | [
"Return",
"the",
"list",
"of",
"geodispersion",
"analysis",
"matching",
"specified",
"criterias",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L290-L338 |
34,734 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.getPlacesHierarchyFromHeader | protected function getPlacesHierarchyFromHeader() {
$head = GedcomRecord::getInstance('HEAD', $this->tree);
$head_place = $head->getFirstFact('PLAC');
if($head_place && $head_place_value = $head_place->getAttribute('FORM')){
return array_reverse(array_map('trim',explode(',', $head_pl... | php | protected function getPlacesHierarchyFromHeader() {
$head = GedcomRecord::getInstance('HEAD', $this->tree);
$head_place = $head->getFirstFact('PLAC');
if($head_place && $head_place_value = $head_place->getAttribute('FORM')){
return array_reverse(array_map('trim',explode(',', $head_pl... | [
"protected",
"function",
"getPlacesHierarchyFromHeader",
"(",
")",
"{",
"$",
"head",
"=",
"GedcomRecord",
"::",
"getInstance",
"(",
"'HEAD'",
",",
"$",
"this",
"->",
"tree",
")",
";",
"$",
"head_place",
"=",
"$",
"head",
"->",
"getFirstFact",
"(",
"'PLAC'",
... | Returns an array of the place hierarchy, as defined in the GEDCOM header.
The places are reversed compared to normal GEDCOM structure.
@return array|null | [
"Returns",
"an",
"array",
"of",
"the",
"place",
"hierarchy",
"as",
"defined",
"in",
"the",
"GEDCOM",
"header",
".",
"The",
"places",
"are",
"reversed",
"compared",
"to",
"normal",
"GEDCOM",
"structure",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L367-L374 |
34,735 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.getPlacesHierarchyFromData | protected function getPlacesHierarchyFromData() {
$nb_levels = 0;
//Select all '2 PLAC ' tags in the file and create array
$places_list=array();
$ged_data = Database::prepare(
'SELECT i_gedcom AS gedcom'.
' FROM `##individuals`'.
' WHERE i_ged... | php | protected function getPlacesHierarchyFromData() {
$nb_levels = 0;
//Select all '2 PLAC ' tags in the file and create array
$places_list=array();
$ged_data = Database::prepare(
'SELECT i_gedcom AS gedcom'.
' FROM `##individuals`'.
' WHERE i_ged... | [
"protected",
"function",
"getPlacesHierarchyFromData",
"(",
")",
"{",
"$",
"nb_levels",
"=",
"0",
";",
"//Select all '2 PLAC ' tags in the file and create array",
"$",
"places_list",
"=",
"array",
"(",
")",
";",
"$",
"ged_data",
"=",
"Database",
"::",
"prepare",
"("... | Returns an array of the place hierarchy, based on a random example of place within the GEDCOM.
It will look for the longest hierarchy in the tree.
The places are reversed compared to normal GEDCOM structure.
@return array | [
"Returns",
"an",
"array",
"of",
"the",
"place",
"hierarchy",
"based",
"on",
"a",
"random",
"example",
"of",
"place",
"within",
"the",
"GEDCOM",
".",
"It",
"will",
"look",
"for",
"the",
"longest",
"hierarchy",
"in",
"the",
"tree",
".",
"The",
"places",
"a... | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L383-L431 |
34,736 | jon48/webtrees-lib | src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php | GeoAnalysisProvider.getOutlineMapsList | public function getOutlineMapsList() {
$res = array();
$root_path = WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/';
if(is_dir($root_path)){
$dir = opendir($root_path);
while (($file=readdir($dir))!== false) {
if (preg_match('/^[a-zA-Z0-... | php | public function getOutlineMapsList() {
$res = array();
$root_path = WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/';
if(is_dir($root_path)){
$dir = opendir($root_path);
while (($file=readdir($dir))!== false) {
if (preg_match('/^[a-zA-Z0-... | [
"public",
"function",
"getOutlineMapsList",
"(",
")",
"{",
"$",
"res",
"=",
"array",
"(",
")",
";",
"$",
"root_path",
"=",
"WT_ROOT",
".",
"WT_MODULES_DIR",
".",
"Constants",
"::",
"MODULE_MAJ_GEODISP_NAME",
".",
"'/maps/'",
";",
"if",
"(",
"is_dir",
"(",
... | Returns the list of geodispersion maps available within the maps folder.
@return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMap[] | [
"Returns",
"the",
"list",
"of",
"geodispersion",
"maps",
"available",
"within",
"the",
"maps",
"folder",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/GeoDispersion/Model/GeoAnalysisProvider.php#L438-L450 |
34,737 | jon48/webtrees-lib | src/Webtrees/Module/Sosa/SosaStatsController.php | SosaStatsController.htmlAncestorDispersionG2 | private function htmlAncestorDispersionG2()
{
$ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2);
if(count($ancestorsDispGen2) == 0) return;
$size = '600x300';
$total = array_sum($ancestorsDispGen2);
$father_count = array_key_exists(1,... | php | private function htmlAncestorDispersionG2()
{
$ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2);
if(count($ancestorsDispGen2) == 0) return;
$size = '600x300';
$total = array_sum($ancestorsDispGen2);
$father_count = array_key_exists(1,... | [
"private",
"function",
"htmlAncestorDispersionG2",
"(",
")",
"{",
"$",
"ancestorsDispGen2",
"=",
"$",
"this",
"->",
"sosa_provider",
"->",
"getAncestorDispersionForGen",
"(",
"2",
")",
";",
"if",
"(",
"count",
"(",
"$",
"ancestorsDispGen2",
")",
"==",
"0",
")"... | Returns HTML code for a graph showing the dispersion of ancestors across father & mother
@return string HTML code | [
"Returns",
"HTML",
"code",
"for",
"a",
"graph",
"showing",
"the",
"dispersion",
"of",
"ancestors",
"across",
"father",
"&",
"mother"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/Sosa/SosaStatsController.php#L154-L191 |
34,738 | jon48/webtrees-lib | src/Webtrees/Module/Sosa/SosaStatsController.php | SosaStatsController.htmlAncestorDispersionG3 | private function htmlAncestorDispersionG3()
{
$ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(3);
$size = '700x300';
$color_motmot = 'ffd1dc';
$color_motfat = 'b998a0';
$color_fatfat = '577292';
$color_fatmot = '84beff';
... | php | private function htmlAncestorDispersionG3()
{
$ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(3);
$size = '700x300';
$color_motmot = 'ffd1dc';
$color_motfat = 'b998a0';
$color_fatfat = '577292';
$color_fatmot = '84beff';
... | [
"private",
"function",
"htmlAncestorDispersionG3",
"(",
")",
"{",
"$",
"ancestorsDispGen2",
"=",
"$",
"this",
"->",
"sosa_provider",
"->",
"getAncestorDispersionForGen",
"(",
"3",
")",
";",
"$",
"size",
"=",
"'700x300'",
";",
"$",
"color_motmot",
"=",
"'ffd1dc'"... | Returns HTML code for a graph showing the dispersion of ancestors across grand-parents
@return string HTML code | [
"Returns",
"HTML",
"code",
"for",
"a",
"graph",
"showing",
"the",
"dispersion",
"of",
"ancestors",
"across",
"grand",
"-",
"parents"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/Sosa/SosaStatsController.php#L197-L231 |
34,739 | jon48/webtrees-lib | src/Webtrees/Module/Sosa/SosaStatsController.php | SosaStatsController.arrayToExtendedEncoding | private function arrayToExtendedEncoding($a) {
$xencoding = WT_GOOGLE_CHART_ENCODING;
$encoding = '';
foreach ($a as $value) {
if ($value < 0) {
$value = 0;
}
$first = (int) ($value / 64);
$second = $value % 64;
$e... | php | private function arrayToExtendedEncoding($a) {
$xencoding = WT_GOOGLE_CHART_ENCODING;
$encoding = '';
foreach ($a as $value) {
if ($value < 0) {
$value = 0;
}
$first = (int) ($value / 64);
$second = $value % 64;
$e... | [
"private",
"function",
"arrayToExtendedEncoding",
"(",
"$",
"a",
")",
"{",
"$",
"xencoding",
"=",
"WT_GOOGLE_CHART_ENCODING",
";",
"$",
"encoding",
"=",
"''",
";",
"foreach",
"(",
"$",
"a",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"<",
"0... | Convert an array to Google Chart encoding
@param arrat $a Array to encode
@return string | [
"Convert",
"an",
"array",
"to",
"Google",
"Chart",
"encoding"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/Sosa/SosaStatsController.php#L238-L252 |
34,740 | CESNET/perun-simplesamlphp-module | lib/Disco.php | Disco.handleRequest | public function handleRequest()
{
// test if user has selected an idp or idp can be deremine automatically somehow.
$this->start();
// no choice possible. Show discovery service page
$idpList = $this->getIdPList();
if (isset($this->originalsp['disco.addInstitutionApp'])
... | php | public function handleRequest()
{
// test if user has selected an idp or idp can be deremine automatically somehow.
$this->start();
// no choice possible. Show discovery service page
$idpList = $this->getIdPList();
if (isset($this->originalsp['disco.addInstitutionApp'])
... | [
"public",
"function",
"handleRequest",
"(",
")",
"{",
"// test if user has selected an idp or idp can be deremine automatically somehow.",
"$",
"this",
"->",
"start",
"(",
")",
";",
"// no choice possible. Show discovery service page",
"$",
"idpList",
"=",
"$",
"this",
"->",
... | Handles a request to this discovery service. It is enry point of Discovery service.
The IdP disco parameters should be set before calling this function. | [
"Handles",
"a",
"request",
"to",
"this",
"discovery",
"service",
".",
"It",
"is",
"enry",
"point",
"of",
"Discovery",
"service",
"."
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Disco.php#L79-L119 |
34,741 | CESNET/perun-simplesamlphp-module | lib/Disco.php | Disco.filterList | protected function filterList($list)
{
$conf = Configuration::getConfig(self::CONFIG_FILE_NAME);
$disableWhitelisting
= $conf->getBoolean(self::PROPNAME_DISABLE_WHITELISTING, false);
if (!isset($this->originalsp['disco.doNotFilterIdps'])
|| !$this->originalsp['disco.... | php | protected function filterList($list)
{
$conf = Configuration::getConfig(self::CONFIG_FILE_NAME);
$disableWhitelisting
= $conf->getBoolean(self::PROPNAME_DISABLE_WHITELISTING, false);
if (!isset($this->originalsp['disco.doNotFilterIdps'])
|| !$this->originalsp['disco.... | [
"protected",
"function",
"filterList",
"(",
"$",
"list",
")",
"{",
"$",
"conf",
"=",
"Configuration",
"::",
"getConfig",
"(",
"self",
"::",
"CONFIG_FILE_NAME",
")",
";",
"$",
"disableWhitelisting",
"=",
"$",
"conf",
"->",
"getBoolean",
"(",
"self",
"::",
"... | Filter a list of entities according to any filters defined in the parent class, plus
@param array $list A map of entities to filter.
@return array The list in $list after filtering entities.
@throws Exception if all IdPs are filtered out and no one left. | [
"Filter",
"a",
"list",
"of",
"entities",
"according",
"to",
"any",
"filters",
"defined",
"in",
"the",
"parent",
"class",
"plus"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Disco.php#L128-L151 |
34,742 | CESNET/perun-simplesamlphp-module | lib/Disco.php | Disco.filterAddInstitutionList | protected function filterAddInstitutionList($list)
{
foreach ($list as $entityId => $idp) {
if (in_array($entityId, $this->whitelist)) {
unset($list[$entityId]);
}
}
if (empty($list)) {
throw new Exception('All IdPs has been filtered out. ... | php | protected function filterAddInstitutionList($list)
{
foreach ($list as $entityId => $idp) {
if (in_array($entityId, $this->whitelist)) {
unset($list[$entityId]);
}
}
if (empty($list)) {
throw new Exception('All IdPs has been filtered out. ... | [
"protected",
"function",
"filterAddInstitutionList",
"(",
"$",
"list",
")",
"{",
"foreach",
"(",
"$",
"list",
"as",
"$",
"entityId",
"=>",
"$",
"idp",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"entityId",
",",
"$",
"this",
"->",
"whitelist",
")",
")",... | Filter a list of entities for addInstitution app according to if entityID is whitelisted or not
@param array $list A map of entities to filter.
@return array The list in $list after filtering entities.
@throws Exception if all IdPs are filtered out and no one left. | [
"Filter",
"a",
"list",
"of",
"entities",
"for",
"addInstitution",
"app",
"according",
"to",
"if",
"entityID",
"is",
"whitelisted",
"or",
"not"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Disco.php#L160-L173 |
34,743 | CESNET/perun-simplesamlphp-module | lib/Disco.php | Disco.removeAuthContextClassRefWithPrefix | public function removeAuthContextClassRefWithPrefix(&$state)
{
$conf = Configuration::getConfig(self::CONFIG_FILE_NAME);
$prefix = $conf->getString(self::PROPNAME_PREFIX, null);
if (is_null($prefix)) {
return;
}
unset($state['saml:RequestedAuthnContext']['AuthnCo... | php | public function removeAuthContextClassRefWithPrefix(&$state)
{
$conf = Configuration::getConfig(self::CONFIG_FILE_NAME);
$prefix = $conf->getString(self::PROPNAME_PREFIX, null);
if (is_null($prefix)) {
return;
}
unset($state['saml:RequestedAuthnContext']['AuthnCo... | [
"public",
"function",
"removeAuthContextClassRefWithPrefix",
"(",
"&",
"$",
"state",
")",
"{",
"$",
"conf",
"=",
"Configuration",
"::",
"getConfig",
"(",
"self",
"::",
"CONFIG_FILE_NAME",
")",
";",
"$",
"prefix",
"=",
"$",
"conf",
"->",
"getString",
"(",
"se... | This method remove all AuthnContextClassRef which start with prefix from configuration
@param $state | [
"This",
"method",
"remove",
"all",
"AuthnContextClassRef",
"which",
"start",
"with",
"prefix",
"from",
"configuration"
] | f1d686f06472053a7cdb31f2b2776f9714779ee1 | https://github.com/CESNET/perun-simplesamlphp-module/blob/f1d686f06472053a7cdb31f2b2776f9714779ee1/lib/Disco.php#L307-L326 |
34,744 | jon48/webtrees-lib | src/Webtrees/Module/Certificates/Model/Certificate.php | Certificate.setSource | public function setSource($xref){
if($xref instanceof Source){
$this->source = $xref;
} else {
$this->source = Source::getInstance($xref, $this->tree);
}
} | php | public function setSource($xref){
if($xref instanceof Source){
$this->source = $xref;
} else {
$this->source = Source::getInstance($xref, $this->tree);
}
} | [
"public",
"function",
"setSource",
"(",
"$",
"xref",
")",
"{",
"if",
"(",
"$",
"xref",
"instanceof",
"Source",
")",
"{",
"$",
"this",
"->",
"source",
"=",
"$",
"xref",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"source",
"=",
"Source",
"::",
"getIns... | Define a source associated with the certificate
@param string|Source $xref | [
"Define",
"a",
"source",
"associated",
"with",
"the",
"certificate"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/Certificates/Model/Certificate.php#L156-L162 |
34,745 | jon48/webtrees-lib | src/Webtrees/Module/Certificates/Model/Certificate.php | Certificate.fetchALinkedSource | public function fetchALinkedSource(){
$sid = null;
// Try to find in individual, then families, then other types of records. We are interested in the first available value.
$ged =
Database::prepare(
'SELECT i_gedcom AS gedrec FROM `##individuals`'.
' WHERE i_file=:gedcom_id AND i_gedcom LIKE :gedco... | php | public function fetchALinkedSource(){
$sid = null;
// Try to find in individual, then families, then other types of records. We are interested in the first available value.
$ged =
Database::prepare(
'SELECT i_gedcom AS gedrec FROM `##individuals`'.
' WHERE i_file=:gedcom_id AND i_gedcom LIKE :gedco... | [
"public",
"function",
"fetchALinkedSource",
"(",
")",
"{",
"$",
"sid",
"=",
"null",
";",
"// Try to find in individual, then families, then other types of records. We are interested in the first available value.",
"$",
"ged",
"=",
"Database",
"::",
"prepare",
"(",
"'SELECT i_ge... | Returns a unique source linked to the certificate
@return Source|NULL Linked source | [
"Returns",
"a",
"unique",
"source",
"linked",
"to",
"the",
"certificate"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Module/Certificates/Model/Certificate.php#L369-L435 |
34,746 | c4studio/chronos | src/Chronos/Scaffolding/app/Exceptions/Handler.php | Handler.tokenMismatch | protected function tokenMismatch($request, TokenMismatchException $e)
{
// check if Chronos path or app
if ($request && ($request->is('admin') || $request->is('admin/*')))
return response()->view("chronos::errors.token_mismatch", ['exception' => $e]);
else
return $thi... | php | protected function tokenMismatch($request, TokenMismatchException $e)
{
// check if Chronos path or app
if ($request && ($request->is('admin') || $request->is('admin/*')))
return response()->view("chronos::errors.token_mismatch", ['exception' => $e]);
else
return $thi... | [
"protected",
"function",
"tokenMismatch",
"(",
"$",
"request",
",",
"TokenMismatchException",
"$",
"e",
")",
"{",
"// check if Chronos path or app",
"if",
"(",
"$",
"request",
"&&",
"(",
"$",
"request",
"->",
"is",
"(",
"'admin'",
")",
"||",
"$",
"request",
... | Renders the token mismatch exception page.
@param \Illuminate\Http\Request $request
@param \Illuminate\Auth\AuthenticationException $e
@return \Illuminate\Http\Response | [
"Renders",
"the",
"token",
"mismatch",
"exception",
"page",
"."
] | df7f3a9794afaade3bee8f6be1223c98e4936cb2 | https://github.com/c4studio/chronos/blob/df7f3a9794afaade3bee8f6be1223c98e4936cb2/src/Chronos/Scaffolding/app/Exceptions/Handler.php#L107-L114 |
34,747 | voslartomas/WebCMS2 | libs/helpers/PriceFormatter.php | PriceFormatter.format | public static function format($price, $string = "%2n")
{
setlocale(LC_MONETARY, self::$locale);
if (function_exists("money_format")) {
return money_format($string, $price);
} else {
return $price;
}
} | php | public static function format($price, $string = "%2n")
{
setlocale(LC_MONETARY, self::$locale);
if (function_exists("money_format")) {
return money_format($string, $price);
} else {
return $price;
}
} | [
"public",
"static",
"function",
"format",
"(",
"$",
"price",
",",
"$",
"string",
"=",
"\"%2n\"",
")",
"{",
"setlocale",
"(",
"LC_MONETARY",
",",
"self",
"::",
"$",
"locale",
")",
";",
"if",
"(",
"function_exists",
"(",
"\"money_format\"",
")",
")",
"{",
... | Format the given price.
@param type $price
@param type $string
@return type | [
"Format",
"the",
"given",
"price",
"."
] | b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf | https://github.com/voslartomas/WebCMS2/blob/b39ea4b2fd30e87ff5e4fa81441cefa308e51fbf/libs/helpers/PriceFormatter.php#L28-L37 |
34,748 | jon48/webtrees-lib | src/Webtrees/Functions/FunctionsPrint.php | FunctionsPrint.htmlFactPlaceIcon | public static function htmlFactPlaceIcon(
\Fisharebest\Webtrees\Fact $fact,
\MyArtJaub\Webtrees\Map\MapProviderInterface $mapProvider
) {
$place = $fact->getPlace();
if(!$place->isEmpty()) {
$iconPlace= $mapProvider->getPlaceIcon($place);
if($iconPlace && strlen($iconPlace) > 0){
return '<div clas... | php | public static function htmlFactPlaceIcon(
\Fisharebest\Webtrees\Fact $fact,
\MyArtJaub\Webtrees\Map\MapProviderInterface $mapProvider
) {
$place = $fact->getPlace();
if(!$place->isEmpty()) {
$iconPlace= $mapProvider->getPlaceIcon($place);
if($iconPlace && strlen($iconPlace) > 0){
return '<div clas... | [
"public",
"static",
"function",
"htmlFactPlaceIcon",
"(",
"\\",
"Fisharebest",
"\\",
"Webtrees",
"\\",
"Fact",
"$",
"fact",
",",
"\\",
"MyArtJaub",
"\\",
"Webtrees",
"\\",
"Map",
"\\",
"MapProviderInterface",
"$",
"mapProvider",
")",
"{",
"$",
"place",
"=",
... | Return HTML code to include a flag icon in facts description
@param \Fisharebest\Webtrees\Fact $fact Fact record
@param \MyArtJaub\Webtrees\Map\MapProviderInterface $mapProvider Map Provider
@return string HTML code of the inserted flag | [
"Return",
"HTML",
"code",
"to",
"include",
"a",
"flag",
"icon",
"in",
"facts",
"description"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Functions/FunctionsPrint.php#L58-L70 |
34,749 | jon48/webtrees-lib | src/Webtrees/Functions/FunctionsPrint.php | FunctionsPrint.htmlPlaceIcon | public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) {
return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />';
} | php | public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) {
return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />';
} | [
"public",
"static",
"function",
"htmlPlaceIcon",
"(",
"\\",
"Fisharebest",
"\\",
"Webtrees",
"\\",
"Place",
"$",
"place",
",",
"$",
"icon_path",
",",
"$",
"size",
"=",
"50",
")",
"{",
"return",
"'<img class=\"flag_gm_h'",
".",
"$",
"size",
".",
"'\" src=\"'"... | Return HTML code to include a flag icon
@param \Fisharebest\Webtrees\Place $place
@param string $icon_path
@param number $size
@return string HTML code of the inserted flag | [
"Return",
"HTML",
"code",
"to",
"include",
"a",
"flag",
"icon"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Functions/FunctionsPrint.php#L80-L82 |
34,750 | jon48/webtrees-lib | src/Webtrees/Functions/FunctionsPrint.php | FunctionsPrint.htmlPlacesCloud | public static function htmlPlacesCloud($places, $totals, Tree $tree) {
$items = array();
foreach ($places as $place => $count) {
/** var \MyArtJaub\Webtrees\Place */
$dplace = Place::getIntance($place, $tree);
$items[] = array(
'text' => $dplace->htmlFormattedName('%1 (%2)'),
'count' => $count,
... | php | public static function htmlPlacesCloud($places, $totals, Tree $tree) {
$items = array();
foreach ($places as $place => $count) {
/** var \MyArtJaub\Webtrees\Place */
$dplace = Place::getIntance($place, $tree);
$items[] = array(
'text' => $dplace->htmlFormattedName('%1 (%2)'),
'count' => $count,
... | [
"public",
"static",
"function",
"htmlPlacesCloud",
"(",
"$",
"places",
",",
"$",
"totals",
",",
"Tree",
"$",
"tree",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"places",
"as",
"$",
"place",
"=>",
"$",
"count",
")",
"{... | Returns HTML code to include a place cloud
@param array $places Array of places to display in the cloud
@param bool $totals Display totals for a place
@param \Fisharebest\Webtrees\Tree $tree Tree
@return string Place Cloud HTML Code | [
"Returns",
"HTML",
"code",
"to",
"include",
"a",
"place",
"cloud"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Functions/FunctionsPrint.php#L137-L151 |
34,751 | jon48/webtrees-lib | src/Webtrees/Functions/FunctionsPrint.php | FunctionsPrint.formatFactPlaceShort | public static function formatFactPlaceShort(\Fisharebest\Webtrees\Fact $fact, $format, $anchor=false){
$html='';
if ($fact === null) return $html;
$place = $fact->getPlace();
if($place){
$dplace = new Place($place);
$html .= $dplace->htmlFormattedName($format, $anchor);
}
return $html;
} | php | public static function formatFactPlaceShort(\Fisharebest\Webtrees\Fact $fact, $format, $anchor=false){
$html='';
if ($fact === null) return $html;
$place = $fact->getPlace();
if($place){
$dplace = new Place($place);
$html .= $dplace->htmlFormattedName($format, $anchor);
}
return $html;
} | [
"public",
"static",
"function",
"formatFactPlaceShort",
"(",
"\\",
"Fisharebest",
"\\",
"Webtrees",
"\\",
"Fact",
"$",
"fact",
",",
"$",
"format",
",",
"$",
"anchor",
"=",
"false",
")",
"{",
"$",
"html",
"=",
"''",
";",
"if",
"(",
"$",
"fact",
"===",
... | Format fact place to display short
@param \Fisharebest\Webtrees\Fact $eventObj Fact to display date
@param string $format Format of the place
@param boolean $anchor option to print a link to placelist
@return string HTML code for short place | [
"Format",
"fact",
"place",
"to",
"display",
"short"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Functions/FunctionsPrint.php#L218-L228 |
34,752 | GrupaZero/cms | src/Gzero/Cms/ViewModels/ContentViewModel.php | ContentViewModel.seoTitle | public function seoTitle($alternativeField = false)
{
if (!$alternativeField) {
$alternativeField = config('gzero-cms.seo.alternative_title', 'title');
}
$text = $this->removeNewLinesAndWhitespace($this->translation[$alternativeField]);
// if alternative field is not emp... | php | public function seoTitle($alternativeField = false)
{
if (!$alternativeField) {
$alternativeField = config('gzero-cms.seo.alternative_title', 'title');
}
$text = $this->removeNewLinesAndWhitespace($this->translation[$alternativeField]);
// if alternative field is not emp... | [
"public",
"function",
"seoTitle",
"(",
"$",
"alternativeField",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"alternativeField",
")",
"{",
"$",
"alternativeField",
"=",
"config",
"(",
"'gzero-cms.seo.alternative_title'",
",",
"'title'",
")",
";",
"}",
"$",
"... | Return seoTitle of translation if exists
otherwise return generated one
@param mixed $alternativeField alternative field to display when seoTitle field is empty
@return string | [
"Return",
"seoTitle",
"of",
"translation",
"if",
"exists",
"otherwise",
"return",
"generated",
"one"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/ViewModels/ContentViewModel.php#L235-L248 |
34,753 | GrupaZero/cms | src/Gzero/Cms/ViewModels/ContentViewModel.php | ContentViewModel.seoDescription | public function seoDescription($alternativeField = false)
{
$descLength = option('seo', 'desc_length', config('gzero.seo.desc_length', 160));
if (!$alternativeField) {
$alternativeField = config('gzero-cms.seo.alternative_desc', 'body');
}
// if SEO description is set
... | php | public function seoDescription($alternativeField = false)
{
$descLength = option('seo', 'desc_length', config('gzero.seo.desc_length', 160));
if (!$alternativeField) {
$alternativeField = config('gzero-cms.seo.alternative_desc', 'body');
}
// if SEO description is set
... | [
"public",
"function",
"seoDescription",
"(",
"$",
"alternativeField",
"=",
"false",
")",
"{",
"$",
"descLength",
"=",
"option",
"(",
"'seo'",
",",
"'desc_length'",
",",
"config",
"(",
"'gzero.seo.desc_length'",
",",
"160",
")",
")",
";",
"if",
"(",
"!",
"$... | Return seoDescription of translation if exists
otherwise return generated one
@param mixed $alternativeField alternative field to display when seoDescription field is empty
@return string | [
"Return",
"seoDescription",
"of",
"translation",
"if",
"exists",
"otherwise",
"return",
"generated",
"one"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/ViewModels/ContentViewModel.php#L258-L276 |
34,754 | GrupaZero/cms | src/Gzero/Cms/ViewModels/ContentViewModel.php | ContentViewModel.publishedAt | public function publishedAt()
{
$publishedAt = array_get($this->data, 'published_at', null);
if ($publishedAt === null) {
return trans('gzero-core::common.unknown');
}
return $publishedAt;
} | php | public function publishedAt()
{
$publishedAt = array_get($this->data, 'published_at', null);
if ($publishedAt === null) {
return trans('gzero-core::common.unknown');
}
return $publishedAt;
} | [
"public",
"function",
"publishedAt",
"(",
")",
"{",
"$",
"publishedAt",
"=",
"array_get",
"(",
"$",
"this",
"->",
"data",
",",
"'published_at'",
",",
"null",
")",
";",
"if",
"(",
"$",
"publishedAt",
"===",
"null",
")",
"{",
"return",
"trans",
"(",
"'gz... | This function returns formatted publish date
@return string | [
"This",
"function",
"returns",
"formatted",
"publish",
"date"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/ViewModels/ContentViewModel.php#L291-L300 |
34,755 | GrupaZero/cms | src/Gzero/Cms/ViewModels/ContentViewModel.php | ContentViewModel.updatedAt | public function updatedAt()
{
$updatedAt = array_get($this->data, 'updated_at', null);
if ($updatedAt === null) {
return trans('gzero-core::common.unknown');
}
return $updatedAt;
} | php | public function updatedAt()
{
$updatedAt = array_get($this->data, 'updated_at', null);
if ($updatedAt === null) {
return trans('gzero-core::common.unknown');
}
return $updatedAt;
} | [
"public",
"function",
"updatedAt",
"(",
")",
"{",
"$",
"updatedAt",
"=",
"array_get",
"(",
"$",
"this",
"->",
"data",
",",
"'updated_at'",
",",
"null",
")",
";",
"if",
"(",
"$",
"updatedAt",
"===",
"null",
")",
"{",
"return",
"trans",
"(",
"'gzero-core... | This function returns formatted updated date
@return string | [
"This",
"function",
"returns",
"formatted",
"updated",
"date"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/ViewModels/ContentViewModel.php#L307-L316 |
34,756 | GrupaZero/cms | src/Gzero/Cms/ViewModels/ContentViewModel.php | ContentViewModel.firstImageUrl | public function firstImageUrl($text, $default = null)
{
$url = $default;
if (!empty($text)) {
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $text, $matches);
}
if (!empty($matches) && isset($matches[1])) {
$url = $matches[1];
}
return ... | php | public function firstImageUrl($text, $default = null)
{
$url = $default;
if (!empty($text)) {
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $text, $matches);
}
if (!empty($matches) && isset($matches[1])) {
$url = $matches[1];
}
return ... | [
"public",
"function",
"firstImageUrl",
"(",
"$",
"text",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"$",
"default",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"text",
")",
")",
"{",
"preg_match",
"(",
"'/< *img[^>]*src *= *[\"\\']?([^\"\\'... | This function returns the first img url from provided text
@param string $text text to get first image url from
@param null $default default url to return if image is not found
@return string first image url | [
"This",
"function",
"returns",
"the",
"first",
"img",
"url",
"from",
"provided",
"text"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/ViewModels/ContentViewModel.php#L347-L360 |
34,757 | GrupaZero/cms | src/Gzero/Cms/ViewModels/ContentViewModel.php | ContentViewModel.ancestorsNames | public function ancestorsNames()
{
$ancestors = explode('/', array_get($this->route, 'path'));
if (empty($ancestors)) {
return null;
}
array_pop($ancestors);
return array_map('ucfirst', $ancestors);
} | php | public function ancestorsNames()
{
$ancestors = explode('/', array_get($this->route, 'path'));
if (empty($ancestors)) {
return null;
}
array_pop($ancestors);
return array_map('ucfirst', $ancestors);
} | [
"public",
"function",
"ancestorsNames",
"(",
")",
"{",
"$",
"ancestors",
"=",
"explode",
"(",
"'/'",
",",
"array_get",
"(",
"$",
"this",
"->",
"route",
",",
"'path'",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"ancestors",
")",
")",
"{",
"return",
... | This function returns names of all ancestors based on route path
@return array ancestors names | [
"This",
"function",
"returns",
"names",
"of",
"all",
"ancestors",
"based",
"on",
"route",
"path"
] | a7956966d2edec54fc99ebb61eeb2f01704aa2c2 | https://github.com/GrupaZero/cms/blob/a7956966d2edec54fc99ebb61eeb2f01704aa2c2/src/Gzero/Cms/ViewModels/ContentViewModel.php#L367-L378 |
34,758 | jon48/webtrees-lib | src/Webtrees/Individual.php | Individual.getIntance | public static function getIntance($xref, Tree $tree, $gedcom = null){
$indi = \Fisharebest\Webtrees\Individual::getInstance($xref, $tree, $gedcom);
if($indi){
return new Individual($indi);
}
return null;
} | php | public static function getIntance($xref, Tree $tree, $gedcom = null){
$indi = \Fisharebest\Webtrees\Individual::getInstance($xref, $tree, $gedcom);
if($indi){
return new Individual($indi);
}
return null;
} | [
"public",
"static",
"function",
"getIntance",
"(",
"$",
"xref",
",",
"Tree",
"$",
"tree",
",",
"$",
"gedcom",
"=",
"null",
")",
"{",
"$",
"indi",
"=",
"\\",
"Fisharebest",
"\\",
"Webtrees",
"\\",
"Individual",
"::",
"getInstance",
"(",
"$",
"xref",
","... | Extend \Fisharebest\Webtrees\Individual getInstance, in order to retrieve directly a object
@param string $xref
@param Tree $tree
@param null|string $gedcom
@return null|Individual | [
"Extend",
"\\",
"Fisharebest",
"\\",
"Webtrees",
"\\",
"Individual",
"getInstance",
"in",
"order",
"to",
"retrieve",
"directly",
"a",
"object"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Individual.php#L46-L52 |
34,759 | jon48/webtrees-lib | src/Webtrees/Individual.php | Individual.getEstimatedBirthPlace | public function getEstimatedBirthPlace($perc=false){
if($bplace = $this->gedcomrecord->getBirthPlace()){
if($perc){
return array ($bplace, 1);
}
else{
return $bplace;
}
}
return null;
} | php | public function getEstimatedBirthPlace($perc=false){
if($bplace = $this->gedcomrecord->getBirthPlace()){
if($perc){
return array ($bplace, 1);
}
else{
return $bplace;
}
}
return null;
} | [
"public",
"function",
"getEstimatedBirthPlace",
"(",
"$",
"perc",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"bplace",
"=",
"$",
"this",
"->",
"gedcomrecord",
"->",
"getBirthPlace",
"(",
")",
")",
"{",
"if",
"(",
"$",
"perc",
")",
"{",
"return",
"array",
... | Returns an estimated birth place based on statistics on the base
@param boolean $perc Should the coefficient of reliability be returned
@return string|array Estimated birth place if found, null otherwise | [
"Returns",
"an",
"estimated",
"birth",
"place",
"based",
"on",
"statistics",
"on",
"the",
"base"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Individual.php#L97-L107 |
34,760 | jon48/webtrees-lib | src/Webtrees/Individual.php | Individual.getSignificantPlace | public function getSignificantPlace(){
if($bplace = $this->gedcomrecord->getBirthPlace()){
return $bplace;
}
foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) {
if ($rplace) {
return $rplace;
}
}
if($dplace = $this->gedcomrecord->get... | php | public function getSignificantPlace(){
if($bplace = $this->gedcomrecord->getBirthPlace()){
return $bplace;
}
foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) {
if ($rplace) {
return $rplace;
}
}
if($dplace = $this->gedcomrecord->get... | [
"public",
"function",
"getSignificantPlace",
"(",
")",
"{",
"if",
"(",
"$",
"bplace",
"=",
"$",
"this",
"->",
"gedcomrecord",
"->",
"getBirthPlace",
"(",
")",
")",
"{",
"return",
"$",
"bplace",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"gedcomrecord",... | Returns a significant place for the individual
@param boolean $perc Should the coefficient of reliability be returned
@return string|array Estimated birth place if found, null otherwise | [
"Returns",
"a",
"significant",
"place",
"for",
"the",
"individual"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Individual.php#L115-L139 |
34,761 | jon48/webtrees-lib | src/Webtrees/Individual.php | Individual.getSosaNumbers | public function getSosaNumbers(){
if($this->sosa === null) {
$provider = new SosaProvider($this->gedcomrecord->getTree());
$this->sosa = $provider->getSosaNumbers($this->gedcomrecord);
}
return $this->sosa;
} | php | public function getSosaNumbers(){
if($this->sosa === null) {
$provider = new SosaProvider($this->gedcomrecord->getTree());
$this->sosa = $provider->getSosaNumbers($this->gedcomrecord);
}
return $this->sosa;
} | [
"public",
"function",
"getSosaNumbers",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"sosa",
"===",
"null",
")",
"{",
"$",
"provider",
"=",
"new",
"SosaProvider",
"(",
"$",
"this",
"->",
"gedcomrecord",
"->",
"getTree",
"(",
")",
")",
";",
"$",
"this... | Get the list of Sosa numbers for this individual
This list is cached.
@uses \MyArtJaub\Webtrees\Functions\ModuleManager
@return array List of Sosa numbers | [
"Get",
"the",
"list",
"of",
"Sosa",
"numbers",
"for",
"this",
"individual",
"This",
"list",
"is",
"cached",
"."
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Individual.php#L157-L163 |
34,762 | jon48/webtrees-lib | src/Webtrees/Individual.php | Individual.isBirthSourced | public function isBirthSourced(){
if($this->is_birth_sourced !== null) return $this->is_birth_sourced;
$this->is_birth_sourced = $this->isFactSourced(WT_EVENTS_BIRT);
return $this->is_birth_sourced;
} | php | public function isBirthSourced(){
if($this->is_birth_sourced !== null) return $this->is_birth_sourced;
$this->is_birth_sourced = $this->isFactSourced(WT_EVENTS_BIRT);
return $this->is_birth_sourced;
} | [
"public",
"function",
"isBirthSourced",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_birth_sourced",
"!==",
"null",
")",
"return",
"$",
"this",
"->",
"is_birth_sourced",
";",
"$",
"this",
"->",
"is_birth_sourced",
"=",
"$",
"this",
"->",
"isFactSourced",... | Check if this individual's birth is sourced
@return int Level of sources | [
"Check",
"if",
"this",
"individual",
"s",
"birth",
"is",
"sourced"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Individual.php#L170-L174 |
34,763 | jon48/webtrees-lib | src/Webtrees/Individual.php | Individual.isDeathSourced | public function isDeathSourced(){
if($this->is_death_sourced !== null) return $this->is_death_sourced;
$this->is_death_sourced = $this->isFactSourced(WT_EVENTS_DEAT);
return $this->is_death_sourced;
} | php | public function isDeathSourced(){
if($this->is_death_sourced !== null) return $this->is_death_sourced;
$this->is_death_sourced = $this->isFactSourced(WT_EVENTS_DEAT);
return $this->is_death_sourced;
} | [
"public",
"function",
"isDeathSourced",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_death_sourced",
"!==",
"null",
")",
"return",
"$",
"this",
"->",
"is_death_sourced",
";",
"$",
"this",
"->",
"is_death_sourced",
"=",
"$",
"this",
"->",
"isFactSourced",... | Check if this individual's death is sourced
@return int Level of sources | [
"Check",
"if",
"this",
"individual",
"s",
"death",
"is",
"sourced"
] | e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7 | https://github.com/jon48/webtrees-lib/blob/e8097cdfcdbb3c9e885e7e06fe7683ed39267bb7/src/Webtrees/Individual.php#L181-L185 |
34,764 | KnpLabs/packagist-api | src/Packagist/Api/Client.php | Client.respond | protected function respond($url)
{
$response = $this->request($url);
$response = $this->parse($response);
return $this->create($response);
} | php | protected function respond($url)
{
$response = $this->request($url);
$response = $this->parse($response);
return $this->create($response);
} | [
"protected",
"function",
"respond",
"(",
"$",
"url",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"(",
"$",
"url",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"parse",
"(",
"$",
"response",
")",
";",
"return",
"$",
"this",
... | Execute the url request and parse the response
@param string $url
@return array|\Packagist\Api\Result\Package | [
"Execute",
"the",
"url",
"request",
"and",
"parse",
"the",
"response"
] | 74dbe93eab7cb80feb8fb9f2294f962d8d37fc71 | https://github.com/KnpLabs/packagist-api/blob/74dbe93eab7cb80feb8fb9f2294f962d8d37fc71/src/Packagist/Api/Client.php#L168-L174 |
34,765 | KnpLabs/packagist-api | src/Packagist/Api/Client.php | Client.request | protected function request($url)
{
if (null === $this->httpClient) {
$this->httpClient = new HttpClient();
}
return $this->httpClient
->get($url)
->getBody();
} | php | protected function request($url)
{
if (null === $this->httpClient) {
$this->httpClient = new HttpClient();
}
return $this->httpClient
->get($url)
->getBody();
} | [
"protected",
"function",
"request",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"httpClient",
")",
"{",
"$",
"this",
"->",
"httpClient",
"=",
"new",
"HttpClient",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"httpClien... | Execute the url request
@param string $url
@return \Psr\Http\Message\StreamInterface | [
"Execute",
"the",
"url",
"request"
] | 74dbe93eab7cb80feb8fb9f2294f962d8d37fc71 | https://github.com/KnpLabs/packagist-api/blob/74dbe93eab7cb80feb8fb9f2294f962d8d37fc71/src/Packagist/Api/Client.php#L183-L192 |
34,766 | KnpLabs/packagist-api | src/Packagist/Api/Client.php | Client.create | protected function create(array $data)
{
if (null === $this->resultFactory) {
$this->resultFactory = new Factory();
}
return $this->resultFactory->create($data);
} | php | protected function create(array $data)
{
if (null === $this->resultFactory) {
$this->resultFactory = new Factory();
}
return $this->resultFactory->create($data);
} | [
"protected",
"function",
"create",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"resultFactory",
")",
"{",
"$",
"this",
"->",
"resultFactory",
"=",
"new",
"Factory",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->"... | Hydrate the knowing type depending on passed data
@param array $data
@return array|\Packagist\Api\Result\Package | [
"Hydrate",
"the",
"knowing",
"type",
"depending",
"on",
"passed",
"data"
] | 74dbe93eab7cb80feb8fb9f2294f962d8d37fc71 | https://github.com/KnpLabs/packagist-api/blob/74dbe93eab7cb80feb8fb9f2294f962d8d37fc71/src/Packagist/Api/Client.php#L213-L220 |
34,767 | KnpLabs/packagist-api | src/Packagist/Api/Result/Factory.php | Factory.create | public function create(array $data)
{
if (isset($data['results'])) {
return $this->createSearchResults($data['results']);
} elseif (isset($data['packages'])) {
return $this->createSearchResults($data['packages']);
} elseif (isset($data['package'])) {
retur... | php | public function create(array $data)
{
if (isset($data['results'])) {
return $this->createSearchResults($data['results']);
} elseif (isset($data['packages'])) {
return $this->createSearchResults($data['packages']);
} elseif (isset($data['package'])) {
retur... | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'results'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createSearchResults",
"(",
"$",
"data",
"[",
"'results'",
"]",
")",
";",
... | Analyse the data and transform to a known type
@param array $data
@throws InvalidArgumentException
@return array|Package | [
"Analyse",
"the",
"data",
"and",
"transform",
"to",
"a",
"known",
"type"
] | 74dbe93eab7cb80feb8fb9f2294f962d8d37fc71 | https://github.com/KnpLabs/packagist-api/blob/74dbe93eab7cb80feb8fb9f2294f962d8d37fc71/src/Packagist/Api/Result/Factory.php#L22-L35 |
34,768 | KnpLabs/packagist-api | src/Packagist/Api/Result/Factory.php | Factory.createSearchResults | public function createSearchResults(array $results)
{
$created = array();
foreach ($results as $key => $result) {
$created[$key] = $this->createResult('Packagist\Api\Result\Result', $result);
}
return $created;
} | php | public function createSearchResults(array $results)
{
$created = array();
foreach ($results as $key => $result) {
$created[$key] = $this->createResult('Packagist\Api\Result\Result', $result);
}
return $created;
} | [
"public",
"function",
"createSearchResults",
"(",
"array",
"$",
"results",
")",
"{",
"$",
"created",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"results",
"as",
"$",
"key",
"=>",
"$",
"result",
")",
"{",
"$",
"created",
"[",
"$",
"key",
"]",
... | Create a collection of \Packagist\Api\Result\Result
@param array $results
@return array | [
"Create",
"a",
"collection",
"of",
"\\",
"Packagist",
"\\",
"Api",
"\\",
"Result",
"\\",
"Result"
] | 74dbe93eab7cb80feb8fb9f2294f962d8d37fc71 | https://github.com/KnpLabs/packagist-api/blob/74dbe93eab7cb80feb8fb9f2294f962d8d37fc71/src/Packagist/Api/Result/Factory.php#L44-L52 |
34,769 | KnpLabs/packagist-api | src/Packagist/Api/Result/Factory.php | Factory.createPackageResults | public function createPackageResults(array $package)
{
$created = array();
if (isset($package['maintainers']) && $package['maintainers']) {
foreach ($package['maintainers'] as $key => $maintainer) {
$package['maintainers'][$key] = $this->createResult('Packagist\Api\Resul... | php | public function createPackageResults(array $package)
{
$created = array();
if (isset($package['maintainers']) && $package['maintainers']) {
foreach ($package['maintainers'] as $key => $maintainer) {
$package['maintainers'][$key] = $this->createResult('Packagist\Api\Resul... | [
"public",
"function",
"createPackageResults",
"(",
"array",
"$",
"package",
")",
"{",
"$",
"created",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"package",
"[",
"'maintainers'",
"]",
")",
"&&",
"$",
"package",
"[",
"'maintainers'",
"]",
... | Parse array to \Packagist\Api\Result\Result
@param array $package
@return Package | [
"Parse",
"array",
"to",
"\\",
"Packagist",
"\\",
"Api",
"\\",
"Result",
"\\",
"Result"
] | 74dbe93eab7cb80feb8fb9f2294f962d8d37fc71 | https://github.com/KnpLabs/packagist-api/blob/74dbe93eab7cb80feb8fb9f2294f962d8d37fc71/src/Packagist/Api/Result/Factory.php#L61-L95 |
34,770 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Event/DaemonEvent.php | DaemonEvent.getCommandLastExceptionClassName | public function getCommandLastExceptionClassName()
{
$exception = $this->command->getLastException();
if (!is_null($exception)) {
return get_class($exception);
}
return null;
} | php | public function getCommandLastExceptionClassName()
{
$exception = $this->command->getLastException();
if (!is_null($exception)) {
return get_class($exception);
}
return null;
} | [
"public",
"function",
"getCommandLastExceptionClassName",
"(",
")",
"{",
"$",
"exception",
"=",
"$",
"this",
"->",
"command",
"->",
"getLastException",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"exception",
")",
")",
"{",
"return",
"get_class",
"... | Gets last exception class name.
@return string|null | [
"Gets",
"last",
"exception",
"class",
"name",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Event/DaemonEvent.php#L84-L93 |
34,771 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php | DaemonCommand.configureDaemonDefinition | private function configureDaemonDefinition(): void
{
$this->addOption('run-once', null, InputOption::VALUE_NONE, 'Run the command just once.');
$this->addOption('run-max', null, InputOption::VALUE_OPTIONAL, 'Run the command x time.');
$this->addOption('memory-max', null, InputOption::VALUE_O... | php | private function configureDaemonDefinition(): void
{
$this->addOption('run-once', null, InputOption::VALUE_NONE, 'Run the command just once.');
$this->addOption('run-max', null, InputOption::VALUE_OPTIONAL, 'Run the command x time.');
$this->addOption('memory-max', null, InputOption::VALUE_O... | [
"private",
"function",
"configureDaemonDefinition",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"addOption",
"(",
"'run-once'",
",",
"null",
",",
"InputOption",
"::",
"VALUE_NONE",
",",
"'Run the command just once.'",
")",
";",
"$",
"this",
"->",
"addOption",... | Add daemon options to the command definition. | [
"Add",
"daemon",
"options",
"to",
"the",
"command",
"definition",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php#L133-L140 |
34,772 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php | DaemonCommand.configureEvents | protected function configureEvents(): self
{
$container = $this->getContainer();
$key = 'm6web_daemon.iterations_events';
if ($container->hasParameter($key)) {
$this->iterationsEvents = $container->getParameter($key);
}
return $this;
} | php | protected function configureEvents(): self
{
$container = $this->getContainer();
$key = 'm6web_daemon.iterations_events';
if ($container->hasParameter($key)) {
$this->iterationsEvents = $container->getParameter($key);
}
return $this;
} | [
"protected",
"function",
"configureEvents",
"(",
")",
":",
"self",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
";",
"$",
"key",
"=",
"'m6web_daemon.iterations_events'",
";",
"if",
"(",
"$",
"container",
"->",
"hasParameter",
"(",... | Retrieve configured events.
@return DaemonCommand | [
"Retrieve",
"configured",
"events",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php#L258-L268 |
34,773 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php | DaemonCommand.dispatchEvent | protected function dispatchEvent(string $eventName): self
{
$dispatcher = $this->getEventDispatcher();
if (!is_null($dispatcher)) {
$time = !is_null($this->startTime) ? microtime(true) - $this->startTime : 0;
$event = new DaemonEvent($this);
$event->setExecutionT... | php | protected function dispatchEvent(string $eventName): self
{
$dispatcher = $this->getEventDispatcher();
if (!is_null($dispatcher)) {
$time = !is_null($this->startTime) ? microtime(true) - $this->startTime : 0;
$event = new DaemonEvent($this);
$event->setExecutionT... | [
"protected",
"function",
"dispatchEvent",
"(",
"string",
"$",
"eventName",
")",
":",
"self",
"{",
"$",
"dispatcher",
"=",
"$",
"this",
"->",
"getEventDispatcher",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"dispatcher",
")",
")",
"{",
"$",
"ti... | Dispatch a daemon event.
@param string $eventName
@return DaemonCommand | [
"Dispatch",
"a",
"daemon",
"event",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php#L276-L289 |
34,774 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php | DaemonCommand.callIterationsIntervalCallbacks | protected function callIterationsIntervalCallbacks(InputInterface $input, OutputInterface $output)
{
foreach ($this->iterationsIntervalCallbacks as $iterationsIntervalCallback) {
if (($this->getLoopCount() + 1) % $iterationsIntervalCallback['interval'] === 0) {
call_user_func($it... | php | protected function callIterationsIntervalCallbacks(InputInterface $input, OutputInterface $output)
{
foreach ($this->iterationsIntervalCallbacks as $iterationsIntervalCallback) {
if (($this->getLoopCount() + 1) % $iterationsIntervalCallback['interval'] === 0) {
call_user_func($it... | [
"protected",
"function",
"callIterationsIntervalCallbacks",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"iterationsIntervalCallbacks",
"as",
"$",
"iterationsIntervalCallback",
")",
"{",
"if",... | Execute callbacks after every iteration interval.
@param InputInterface $input
@param OutputInterface $output | [
"Execute",
"callbacks",
"after",
"every",
"iteration",
"interval",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php#L369-L376 |
34,775 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php | DaemonCommand.dispatchConfigurationEvents | protected function dispatchConfigurationEvents(): self
{
foreach ($this->iterationsEvents as $event) {
if (!($this->loopCount % $event['count'])) {
$this->dispatchEvent($event['name']);
}
}
return $this;
} | php | protected function dispatchConfigurationEvents(): self
{
foreach ($this->iterationsEvents as $event) {
if (!($this->loopCount % $event['count'])) {
$this->dispatchEvent($event['name']);
}
}
return $this;
} | [
"protected",
"function",
"dispatchConfigurationEvents",
"(",
")",
":",
"self",
"{",
"foreach",
"(",
"$",
"this",
"->",
"iterationsEvents",
"as",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"loopCount",
"%",
"$",
"event",
"[",
"'count'... | Dispatch configured events.
@return DaemonCommand | [
"Dispatch",
"configured",
"events",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php#L469-L478 |
34,776 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php | DaemonCommand.isLastLoop | protected function isLastLoop(): bool
{
// Count loop
if (!is_null($this->getLoopMax()) && ($this->getLoopCount() >= $this->getLoopMax())) {
$this->requestShutdown();
}
// Memory
if ($this->memoryMax > 0 && memory_get_peak_usage(true) >= $this->memoryMax) {
... | php | protected function isLastLoop(): bool
{
// Count loop
if (!is_null($this->getLoopMax()) && ($this->getLoopCount() >= $this->getLoopMax())) {
$this->requestShutdown();
}
// Memory
if ($this->memoryMax > 0 && memory_get_peak_usage(true) >= $this->memoryMax) {
... | [
"protected",
"function",
"isLastLoop",
"(",
")",
":",
"bool",
"{",
"// Count loop",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"getLoopMax",
"(",
")",
")",
"&&",
"(",
"$",
"this",
"->",
"getLoopCount",
"(",
")",
">=",
"$",
"this",
"->",
"getL... | Return true after the last loop.
@return bool | [
"Return",
"true",
"after",
"the",
"last",
"loop",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php#L485-L499 |
34,777 | M6Web/DaemonBundle | src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php | DaemonCommand.addIterationsIntervalCallback | public function addIterationsIntervalCallback($iterationsInterval, callable $onIterationsInterval)
{
if (!is_int($iterationsInterval) || ($iterationsInterval <= 0)) {
throw new \InvalidArgumentException('Iteration interval must be a positive integer');
}
$this->iterationsInterva... | php | public function addIterationsIntervalCallback($iterationsInterval, callable $onIterationsInterval)
{
if (!is_int($iterationsInterval) || ($iterationsInterval <= 0)) {
throw new \InvalidArgumentException('Iteration interval must be a positive integer');
}
$this->iterationsInterva... | [
"public",
"function",
"addIterationsIntervalCallback",
"(",
"$",
"iterationsInterval",
",",
"callable",
"$",
"onIterationsInterval",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"iterationsInterval",
")",
"||",
"(",
"$",
"iterationsInterval",
"<=",
"0",
")",
")... | Add your own callback after every iteration interval.
@param int $iterationsInterval
@param callable $onIterationsInterval | [
"Add",
"your",
"own",
"callback",
"after",
"every",
"iteration",
"interval",
"."
] | 9db55b0a28802f7ef0a3041d222e74803145b194 | https://github.com/M6Web/DaemonBundle/blob/9db55b0a28802f7ef0a3041d222e74803145b194/src/M6Web/Bundle/DaemonBundle/Command/DaemonCommand.php#L615-L622 |
34,778 | TiendaNube/tiendanube-php-sdk | src/TiendaNube/Auth.php | Auth.request_access_token | public function request_access_token($code){
$params = [
'client_id' => $this->client_id,
'client_secret' => $this->client_secret,
'code' => $code,
'grant_type' => 'authorization_code',
];
$response = $this->requests->post($this->auth_url,... | php | public function request_access_token($code){
$params = [
'client_id' => $this->client_id,
'client_secret' => $this->client_secret,
'code' => $code,
'grant_type' => 'authorization_code',
];
$response = $this->requests->post($this->auth_url,... | [
"public",
"function",
"request_access_token",
"(",
"$",
"code",
")",
"{",
"$",
"params",
"=",
"[",
"'client_id'",
"=>",
"$",
"this",
"->",
"client_id",
",",
"'client_secret'",
"=>",
"$",
"this",
"->",
"client_secret",
",",
"'code'",
"=>",
"$",
"code",
",",... | Obtain a permanent access token from an authorization code.
@param string $code Authorization code retrieved from the redirect URI. | [
"Obtain",
"a",
"permanent",
"access",
"token",
"from",
"an",
"authorization",
"code",
"."
] | 7e2c025fafdc942d5ec334da133896f4c918e8e8 | https://github.com/TiendaNube/tiendanube-php-sdk/blob/7e2c025fafdc942d5ec334da133896f4c918e8e8/src/TiendaNube/Auth.php#L50-L73 |
34,779 | TiendaNube/tiendanube-php-sdk | src/TiendaNube/API.php | API.get | public function get($path, $params = null){
$url_params = '';
if (is_array($params)){
$url_params = '?' . http_build_query($params);
}
return $this->_call('GET', $path . $url_params);
} | php | public function get($path, $params = null){
$url_params = '';
if (is_array($params)){
$url_params = '?' . http_build_query($params);
}
return $this->_call('GET', $path . $url_params);
} | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"url_params",
"=",
"''",
";",
"if",
"(",
"is_array",
"(",
"$",
"params",
")",
")",
"{",
"$",
"url_params",
"=",
"'?'",
".",
"http_build_query",
"(",
"$",... | Make a GET request to the specified path.
@param string $path The path to the desired resource
@param array $params Optional parameters to send in the query string
@return TiendaNube/API/Response | [
"Make",
"a",
"GET",
"request",
"to",
"the",
"specified",
"path",
"."
] | 7e2c025fafdc942d5ec334da133896f4c918e8e8 | https://github.com/TiendaNube/tiendanube-php-sdk/blob/7e2c025fafdc942d5ec334da133896f4c918e8e8/src/TiendaNube/API.php#L38-L45 |
34,780 | TiendaNube/tiendanube-php-sdk | src/TiendaNube/API.php | API.post | public function post($path, $params = []){
$json = json_encode($params);
return $this->_call('POST', $path, $json);
} | php | public function post($path, $params = []){
$json = json_encode($params);
return $this->_call('POST', $path, $json);
} | [
"public",
"function",
"post",
"(",
"$",
"path",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"json",
"=",
"json_encode",
"(",
"$",
"params",
")",
";",
"return",
"$",
"this",
"->",
"_call",
"(",
"'POST'",
",",
"$",
"path",
",",
"$",
"json",
... | Make a POST request to the specified path.
@param string $path The path to the desired resource
@param array $params Parameters to send in the POST data
@return TiendaNube/API/Response | [
"Make",
"a",
"POST",
"request",
"to",
"the",
"specified",
"path",
"."
] | 7e2c025fafdc942d5ec334da133896f4c918e8e8 | https://github.com/TiendaNube/tiendanube-php-sdk/blob/7e2c025fafdc942d5ec334da133896f4c918e8e8/src/TiendaNube/API.php#L54-L58 |
34,781 | TiendaNube/tiendanube-php-sdk | src/TiendaNube/API.php | API.put | public function put($path, $params = []){
$json = json_encode($params);
return $this->_call('PUT', $path, $json);
} | php | public function put($path, $params = []){
$json = json_encode($params);
return $this->_call('PUT', $path, $json);
} | [
"public",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"json",
"=",
"json_encode",
"(",
"$",
"params",
")",
";",
"return",
"$",
"this",
"->",
"_call",
"(",
"'PUT'",
",",
"$",
"path",
",",
"$",
"json",
"... | Make a PUT request to the specified path.
@param string $path The path to the desired resource
@param array $params Parameters to send in the PUT data
@return TiendaNube/API/Response | [
"Make",
"a",
"PUT",
"request",
"to",
"the",
"specified",
"path",
"."
] | 7e2c025fafdc942d5ec334da133896f4c918e8e8 | https://github.com/TiendaNube/tiendanube-php-sdk/blob/7e2c025fafdc942d5ec334da133896f4c918e8e8/src/TiendaNube/API.php#L67-L71 |
34,782 | teamdeeson/wardenapi | src/Api.php | Api.getPublicKey | public function getPublicKey() {
if (empty($this->wardenPublicKey)) {
$result = $this->request('/public-key');
$this->wardenPublicKey = base64_decode($result->getBody());
}
return $this->wardenPublicKey;
} | php | public function getPublicKey() {
if (empty($this->wardenPublicKey)) {
$result = $this->request('/public-key');
$this->wardenPublicKey = base64_decode($result->getBody());
}
return $this->wardenPublicKey;
} | [
"public",
"function",
"getPublicKey",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"wardenPublicKey",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'/public-key'",
")",
";",
"$",
"this",
"->",
"wardenPublicKey",
"... | Get the public key.
@throws WardenBadResponseException
If the response status was not 200 | [
"Get",
"the",
"public",
"key",
"."
] | d93f30b3c482f27696c1371b163e9260b33a80d8 | https://github.com/teamdeeson/wardenapi/blob/d93f30b3c482f27696c1371b163e9260b33a80d8/src/Api.php#L109-L117 |
34,783 | teamdeeson/wardenapi | src/Api.php | Api.isValidWardenToken | public function isValidWardenToken($encryptedRemoteToken, $timestamp) {
$envelope = json_decode(base64_decode($encryptedRemoteToken));
if (!is_object($envelope) || empty($envelope->time) || empty($envelope->signature)) {
return FALSE;
}
$remoteTimestamp = base64_decode($envelope->time);
if ... | php | public function isValidWardenToken($encryptedRemoteToken, $timestamp) {
$envelope = json_decode(base64_decode($encryptedRemoteToken));
if (!is_object($envelope) || empty($envelope->time) || empty($envelope->signature)) {
return FALSE;
}
$remoteTimestamp = base64_decode($envelope->time);
if ... | [
"public",
"function",
"isValidWardenToken",
"(",
"$",
"encryptedRemoteToken",
",",
"$",
"timestamp",
")",
"{",
"$",
"envelope",
"=",
"json_decode",
"(",
"base64_decode",
"(",
"$",
"encryptedRemoteToken",
")",
")",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
... | Check the validity of a token sent from Warden.
To prove a request came from the Warden application, Warden encrypts
the current timestamp using its private key which can be decrypted with
its public key. Only the true Warden can produce the encrypted message.
Since it is possible to reply the token, the token only la... | [
"Check",
"the",
"validity",
"of",
"a",
"token",
"sent",
"from",
"Warden",
"."
] | d93f30b3c482f27696c1371b163e9260b33a80d8 | https://github.com/teamdeeson/wardenapi/blob/d93f30b3c482f27696c1371b163e9260b33a80d8/src/Api.php#L135-L153 |
34,784 | teamdeeson/wardenapi | src/Api.php | Api.encrypt | public function encrypt($data) {
$plaintext = json_encode($data);
$public_key = $this->getPublicKey();
$result = openssl_seal($plaintext, $message, $keys, array($public_key));
if ($result === FALSE || empty($keys[0]) || empty($message) || $message === $plaintext) {
throw new EncryptionException... | php | public function encrypt($data) {
$plaintext = json_encode($data);
$public_key = $this->getPublicKey();
$result = openssl_seal($plaintext, $message, $keys, array($public_key));
if ($result === FALSE || empty($keys[0]) || empty($message) || $message === $plaintext) {
throw new EncryptionException... | [
"public",
"function",
"encrypt",
"(",
"$",
"data",
")",
"{",
"$",
"plaintext",
"=",
"json_encode",
"(",
"$",
"data",
")",
";",
"$",
"public_key",
"=",
"$",
"this",
"->",
"getPublicKey",
"(",
")",
";",
"$",
"result",
"=",
"openssl_seal",
"(",
"$",
"pl... | Encrypt a plaintext message.
@param mixed $data
The data to encrypt for transport.
@return string
The encoded message
@throws EncryptionException
If there is a problem with the encryption process.
@throws WardenBadResponseException
If the response status from Warden was not 200 when retrieving the
public key. | [
"Encrypt",
"a",
"plaintext",
"message",
"."
] | d93f30b3c482f27696c1371b163e9260b33a80d8 | https://github.com/teamdeeson/wardenapi/blob/d93f30b3c482f27696c1371b163e9260b33a80d8/src/Api.php#L170-L187 |
34,785 | teamdeeson/wardenapi | src/Api.php | Api.decrypt | public function decrypt($cypherText) {
$envelope = json_decode(base64_decode($cypherText));
if (!is_object($envelope) || empty($envelope->key) || empty($envelope->message)) {
throw new EncryptionException('Encrypted message is not understood');
}
$key = base64_decode($envelope->key);
$messag... | php | public function decrypt($cypherText) {
$envelope = json_decode(base64_decode($cypherText));
if (!is_object($envelope) || empty($envelope->key) || empty($envelope->message)) {
throw new EncryptionException('Encrypted message is not understood');
}
$key = base64_decode($envelope->key);
$messag... | [
"public",
"function",
"decrypt",
"(",
"$",
"cypherText",
")",
"{",
"$",
"envelope",
"=",
"json_decode",
"(",
"base64_decode",
"(",
"$",
"cypherText",
")",
")",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"envelope",
")",
"||",
"empty",
"(",
"$",
"envel... | Decrypt a message which was encrypted with the Warden private key.
@param string $cypherText
The encrypted text
@return mixed
The original data
@throws EncryptionException
If there was a problem with the decryption process.
@throws WardenBadResponseException
If the response status from Warden was not 200 when retriev... | [
"Decrypt",
"a",
"message",
"which",
"was",
"encrypted",
"with",
"the",
"Warden",
"private",
"key",
"."
] | d93f30b3c482f27696c1371b163e9260b33a80d8 | https://github.com/teamdeeson/wardenapi/blob/d93f30b3c482f27696c1371b163e9260b33a80d8/src/Api.php#L203-L221 |
34,786 | teamdeeson/wardenapi | src/Api.php | Api.request | public function request($path, $content = '') {
$url = $this->getWardenUrl() . $path;
$options = [];
if ($this->hasBasicAuthentication()) {
$options['auth'] = [ $this->getUsername(), $this->getPassword()];
}
$method = 'GET';
if (!empty($content)) {
$method = 'POST';
$options... | php | public function request($path, $content = '') {
$url = $this->getWardenUrl() . $path;
$options = [];
if ($this->hasBasicAuthentication()) {
$options['auth'] = [ $this->getUsername(), $this->getPassword()];
}
$method = 'GET';
if (!empty($content)) {
$method = 'POST';
$options... | [
"public",
"function",
"request",
"(",
"$",
"path",
",",
"$",
"content",
"=",
"''",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getWardenUrl",
"(",
")",
".",
"$",
"path",
";",
"$",
"options",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
... | Send a message to warden
@param string $path
The query path including the leading slash (e.g. '/public-key')
@param string $content
The body of the request. If this is not empty, the request is a post.
@return ResponseInterface
The response object
@throws WardenBadResponseException
If the response status was not 200 | [
"Send",
"a",
"message",
"to",
"warden"
] | d93f30b3c482f27696c1371b163e9260b33a80d8 | https://github.com/teamdeeson/wardenapi/blob/d93f30b3c482f27696c1371b163e9260b33a80d8/src/Api.php#L250-L278 |
34,787 | yawik/jobs | src/Entity/Job.php | Job.getCompany | public function getCompany($useOrganizationEntity = true)
{
if ($this->organization && $useOrganizationEntity) {
return $this->organization->getOrganizationName()->getName();
}
return $this->company;
} | php | public function getCompany($useOrganizationEntity = true)
{
if ($this->organization && $useOrganizationEntity) {
return $this->organization->getOrganizationName()->getName();
}
return $this->company;
} | [
"public",
"function",
"getCompany",
"(",
"$",
"useOrganizationEntity",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"organization",
"&&",
"$",
"useOrganizationEntity",
")",
"{",
"return",
"$",
"this",
"->",
"organization",
"->",
"getOrganizationName",
... | Gets the name oof the company. If there is an organization assigned to the
job posting. Take the name of the organization.
@param bool $useOrganizationEntity Get the name from the organization entity, if it is available.
@see \Jobs\Entity\JobInterface::getCompany()
@return string | [
"Gets",
"the",
"name",
"oof",
"the",
"company",
".",
"If",
"there",
"is",
"an",
"organization",
"assigned",
"to",
"the",
"job",
"posting",
".",
"Take",
"the",
"name",
"of",
"the",
"organization",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/Job.php#L419-L426 |
34,788 | yawik/jobs | src/Entity/Job.php | Job.changeStatus | public function changeStatus($status, $message = '[System]')
{
$this->setStatus($status);
$status = $this->getStatus(); // ensure StatusEntity
$history = new History($status, $message);
$this->getHistory()->add($history);
return $this;
} | php | public function changeStatus($status, $message = '[System]')
{
$this->setStatus($status);
$status = $this->getStatus(); // ensure StatusEntity
$history = new History($status, $message);
$this->getHistory()->add($history);
return $this;
} | [
"public",
"function",
"changeStatus",
"(",
"$",
"status",
",",
"$",
"message",
"=",
"'[System]'",
")",
"{",
"$",
"this",
"->",
"setStatus",
"(",
"$",
"status",
")",
";",
"$",
"status",
"=",
"$",
"this",
"->",
"getStatus",
"(",
")",
";",
"// ensure Stat... | Modifies the state of an application.
Creates a history entry.
@param StatusInterface|string $status
@param string $message
@return Job | [
"Modifies",
"the",
"state",
"of",
"an",
"application",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/Job.php#L705-L714 |
34,789 | yawik/jobs | src/Entity/Job.php | Job.getLogoRef | public function getLogoRef()
{
/** @var $organization \Organizations\Entity\Organization */
$organization = $this->organization;
if (is_object($organization) && $organization->getImage()) {
$organizationImage = $organization->getImage();
return "/file/Organizations.Or... | php | public function getLogoRef()
{
/** @var $organization \Organizations\Entity\Organization */
$organization = $this->organization;
if (is_object($organization) && $organization->getImage()) {
$organizationImage = $organization->getImage();
return "/file/Organizations.Or... | [
"public",
"function",
"getLogoRef",
"(",
")",
"{",
"/** @var $organization \\Organizations\\Entity\\Organization */",
"$",
"organization",
"=",
"$",
"this",
"->",
"organization",
";",
"if",
"(",
"is_object",
"(",
"$",
"organization",
")",
"&&",
"$",
"organization",
... | returns an uri to the organization logo.
@return string | [
"returns",
"an",
"uri",
"to",
"the",
"organization",
"logo",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/Job.php#L863-L872 |
34,790 | yawik/jobs | src/Options/ProviderOptions.php | ProviderOptions.getChannel | public function getChannel($key)
{
if (array_key_exists($key, $this->channels)) {
return $this->channels[$key];
}
return null;
} | php | public function getChannel($key)
{
if (array_key_exists($key, $this->channels)) {
return $this->channels[$key];
}
return null;
} | [
"public",
"function",
"getChannel",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"channels",
")",
")",
"{",
"return",
"$",
"this",
"->",
"channels",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"nu... | Get a channel by "key"
@param string $key
@return ChannelOptions | [
"Get",
"a",
"channel",
"by",
"key"
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Options/ProviderOptions.php#L66-L72 |
34,791 | yawik/jobs | src/Filter/ViewModelTemplateFilterJob.php | ViewModelTemplateFilterJob.extract | protected function extract($job)
{
$this->job = $job;
$this->getJsonLdHelper()->setJob($job);
$this->setApplyData();
$this->setOrganizationInfo();
$this->setLocation();
$this->setDescription();
$this->setTemplate();
$this->setTemplateDefaultValues();
... | php | protected function extract($job)
{
$this->job = $job;
$this->getJsonLdHelper()->setJob($job);
$this->setApplyData();
$this->setOrganizationInfo();
$this->setLocation();
$this->setDescription();
$this->setTemplate();
$this->setTemplateDefaultValues();
... | [
"protected",
"function",
"extract",
"(",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"job",
"=",
"$",
"job",
";",
"$",
"this",
"->",
"getJsonLdHelper",
"(",
")",
"->",
"setJob",
"(",
"$",
"job",
")",
";",
"$",
"this",
"->",
"setApplyData",
"(",
")",
... | assign the form-elements to the template
@param \Jobs\Entity\Job $job
@return $this | [
"assign",
"the",
"form",
"-",
"elements",
"to",
"the",
"template"
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ViewModelTemplateFilterJob.php#L27-L59 |
34,792 | yawik/jobs | src/Entity/AtsMode.php | AtsMode.setMode | public function setMode($mode)
{
$validModes = array(
self::MODE_INTERN,
self::MODE_URI,
self::MODE_EMAIL,
self::MODE_NONE,
);
if (!in_array($mode, $validModes)) {
throw new \InvalidArgumentException('Unknown value for ats mode.');... | php | public function setMode($mode)
{
$validModes = array(
self::MODE_INTERN,
self::MODE_URI,
self::MODE_EMAIL,
self::MODE_NONE,
);
if (!in_array($mode, $validModes)) {
throw new \InvalidArgumentException('Unknown value for ats mode.');... | [
"public",
"function",
"setMode",
"(",
"$",
"mode",
")",
"{",
"$",
"validModes",
"=",
"array",
"(",
"self",
"::",
"MODE_INTERN",
",",
"self",
"::",
"MODE_URI",
",",
"self",
"::",
"MODE_EMAIL",
",",
"self",
"::",
"MODE_NONE",
",",
")",
";",
"if",
"(",
... | Sets the ATS mode.
@throws \InvalidArgumentException | [
"Sets",
"the",
"ATS",
"mode",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/AtsMode.php#L95-L111 |
34,793 | yawik/jobs | src/Listener/MailSender.php | MailSender.onJobCreated | public function onJobCreated(JobEvent $e)
{
$job = $e->getJobEntity();
$this->sendMail(
$job,
'mail/job-created',
/*@translate*/ 'A new job opening was created',
/*adminMail*/ true
);
$this->sendMail(
$job,
'mail... | php | public function onJobCreated(JobEvent $e)
{
$job = $e->getJobEntity();
$this->sendMail(
$job,
'mail/job-created',
/*@translate*/ 'A new job opening was created',
/*adminMail*/ true
);
$this->sendMail(
$job,
'mail... | [
"public",
"function",
"onJobCreated",
"(",
"JobEvent",
"$",
"e",
")",
"{",
"$",
"job",
"=",
"$",
"e",
"->",
"getJobEntity",
"(",
")",
";",
"$",
"this",
"->",
"sendMail",
"(",
"$",
"job",
",",
"'mail/job-created'",
",",
"/*@translate*/",
"'A new job opening... | Callback for the job created event.
@param JobEvent $e | [
"Callback",
"for",
"the",
"job",
"created",
"event",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Listener/MailSender.php#L85-L99 |
34,794 | yawik/jobs | src/Listener/MailSender.php | MailSender.sendMail | protected function sendMail(Job $job, $template, $subject, $adminMail = false)
{
$mail = $this->mailer->get('htmltemplate');
$mail->setTemplate($template)
->setSubject($subject)
->setVariables(
array(
'job' => $job,
... | php | protected function sendMail(Job $job, $template, $subject, $adminMail = false)
{
$mail = $this->mailer->get('htmltemplate');
$mail->setTemplate($template)
->setSubject($subject)
->setVariables(
array(
'job' => $job,
... | [
"protected",
"function",
"sendMail",
"(",
"Job",
"$",
"job",
",",
"$",
"template",
",",
"$",
"subject",
",",
"$",
"adminMail",
"=",
"false",
")",
"{",
"$",
"mail",
"=",
"$",
"this",
"->",
"mailer",
"->",
"get",
"(",
"'htmltemplate'",
")",
";",
"$",
... | Sends a job event related mail
@param Job $job
@param string $template
@param string $subject
@param bool $adminMail if true, the mail is send to the administrator instead of to the user. | [
"Sends",
"a",
"job",
"event",
"related",
"mail"
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Listener/MailSender.php#L137-L163 |
34,795 | yawik/jobs | src/Acl/WriteAssertion.php | WriteAssertion.assert | public function assert(
Acl $acl,
RoleInterface $role = null,
ResourceInterface $resource = null,
$privilege = null
) {
if (!$role instanceof UserInterface || !$resource instanceof JobInterface || 'edit' != $privilege) {
return false;
}
/* @var $r... | php | public function assert(
Acl $acl,
RoleInterface $role = null,
ResourceInterface $resource = null,
$privilege = null
) {
if (!$role instanceof UserInterface || !$resource instanceof JobInterface || 'edit' != $privilege) {
return false;
}
/* @var $r... | [
"public",
"function",
"assert",
"(",
"Acl",
"$",
"acl",
",",
"RoleInterface",
"$",
"role",
"=",
"null",
",",
"ResourceInterface",
"$",
"resource",
"=",
"null",
",",
"$",
"privilege",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"role",
"instanceof",
"Us... | Returns true, if the user has write access to the job.
{@inheritDoc}
@see \Zend\Permissions\Acl\Assertion\AssertionInterface::assert() | [
"Returns",
"true",
"if",
"the",
"user",
"has",
"write",
"access",
"to",
"the",
"job",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Acl/WriteAssertion.php#L36-L50 |
34,796 | yawik/jobs | src/Acl/WriteAssertion.php | WriteAssertion.checkOrganizationPermissions | protected function checkOrganizationPermissions($role, $resource)
{
/* @var $resource \Jobs\Entity\JobInterface */
/* @var $role \Auth\Entity\UserInterface */
$organization = $resource->getOrganization();
if (!$organization) {
return false;
}
if ($org... | php | protected function checkOrganizationPermissions($role, $resource)
{
/* @var $resource \Jobs\Entity\JobInterface */
/* @var $role \Auth\Entity\UserInterface */
$organization = $resource->getOrganization();
if (!$organization) {
return false;
}
if ($org... | [
"protected",
"function",
"checkOrganizationPermissions",
"(",
"$",
"role",
",",
"$",
"resource",
")",
"{",
"/* @var $resource \\Jobs\\Entity\\JobInterface */",
"/* @var $role \\Auth\\Entity\\UserInterface */",
"$",
"organization",
"=",
"$",
"resource",
"->",
"getOrganizatio... | Returns true, if the user has write access to the job granted from the organization.
@param RoleInterface $role This must be a UserInterface instance
@param ResourceInterface $resource This must be a JobInterface instance
@return bool | [
"Returns",
"true",
"if",
"the",
"user",
"has",
"write",
"access",
"to",
"the",
"job",
"granted",
"from",
"the",
"organization",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Acl/WriteAssertion.php#L60-L91 |
34,797 | yawik/jobs | src/Form/InputFilter/AtsMode.php | AtsMode.setData | public function setData($data)
{
switch ($data['mode']) {
default:
break;
case AtsModeInterface::MODE_URI:
$this->add(
array(
'name' => 'uri',
'validators' => array(
a... | php | public function setData($data)
{
switch ($data['mode']) {
default:
break;
case AtsModeInterface::MODE_URI:
$this->add(
array(
'name' => 'uri',
'validators' => array(
a... | [
"public",
"function",
"setData",
"(",
"$",
"data",
")",
"{",
"switch",
"(",
"$",
"data",
"[",
"'mode'",
"]",
")",
"{",
"default",
":",
"break",
";",
"case",
"AtsModeInterface",
"::",
"MODE_URI",
":",
"$",
"this",
"->",
"add",
"(",
"array",
"(",
"'nam... | Sets data for validating and filtering.
@internal
We needed to add dynamically validators, because when "mode" is "intern" or "none" we must
not validate anything. When "mode" is "uri" we must not validate "email address" and we must not
validate "uri" if mode is "uri".
And only when the data is set we do know what h... | [
"Sets",
"data",
"for",
"validating",
"and",
"filtering",
"."
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Form/InputFilter/AtsMode.php#L50-L93 |
34,798 | yawik/jobs | src/Repository/Job.php | Job.getPaginatorCursor | public function getPaginatorCursor($params)
{
$filter = $this->getService('filterManager')->get('Jobs/PaginationQuery');
/* @var $filter \Core\Repository\Filter\AbstractPaginationQuery */
$qb = $filter->filter($params, $this->createQueryBuilder());
return $qb->getQuery()->execute();... | php | public function getPaginatorCursor($params)
{
$filter = $this->getService('filterManager')->get('Jobs/PaginationQuery');
/* @var $filter \Core\Repository\Filter\AbstractPaginationQuery */
$qb = $filter->filter($params, $this->createQueryBuilder());
return $qb->getQuery()->execute();... | [
"public",
"function",
"getPaginatorCursor",
"(",
"$",
"params",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"getService",
"(",
"'filterManager'",
")",
"->",
"get",
"(",
"'Jobs/PaginationQuery'",
")",
";",
"/* @var $filter \\Core\\Repository\\Filter\\AbstractPagin... | Gets a pagination cursor to the jobs collection
@param $params
@return mixed | [
"Gets",
"a",
"pagination",
"cursor",
"to",
"the",
"jobs",
"collection"
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Repository/Job.php#L39-L45 |
34,799 | yawik/jobs | src/Repository/Job.php | Job.findByOrganization | public function findByOrganization($organizationId)
{
$criteria = $this->getIsDeletedCriteria([
'organization' => new \MongoId($organizationId),
]);
return $this->findBy($criteria);
} | php | public function findByOrganization($organizationId)
{
$criteria = $this->getIsDeletedCriteria([
'organization' => new \MongoId($organizationId),
]);
return $this->findBy($criteria);
} | [
"public",
"function",
"findByOrganization",
"(",
"$",
"organizationId",
")",
"{",
"$",
"criteria",
"=",
"$",
"this",
"->",
"getIsDeletedCriteria",
"(",
"[",
"'organization'",
"=>",
"new",
"\\",
"MongoId",
"(",
"$",
"organizationId",
")",
",",
"]",
")",
";",
... | Selects job postings of a certain organization
@param int $organizationId
@return \Jobs\Entity\Job[] | [
"Selects",
"job",
"postings",
"of",
"a",
"certain",
"organization"
] | 50c124152e9de98bd789bf7593d152019269ff7b | https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Repository/Job.php#L119-L126 |
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.