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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,700 | BapCat/Persist | src/Driver.php | Driver.getDirectory | public function getDirectory(string $path): Directory {
if($this->isFile($path)) {
throw new NotADirectoryException($path);
}
return $this->instantiateDir($path);
} | php | public function getDirectory(string $path): Directory {
if($this->isFile($path)) {
throw new NotADirectoryException($path);
}
return $this->instantiateDir($path);
} | [
"public",
"function",
"getDirectory",
"(",
"string",
"$",
"path",
")",
":",
"Directory",
"{",
"if",
"(",
"$",
"this",
"->",
"isFile",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"NotADirectoryException",
"(",
"$",
"path",
")",
";",
"}",
"return",
... | Gets a directory from the storage medium
@param string $path The path of the directory
@return Directory A directory object
@throws NotADirectoryException if <tt>$path</tt> is not a directory | [
"Gets",
"a",
"directory",
"from",
"the",
"storage",
"medium"
] | 0bc53dc50d0c40ecb519c88e33d77889619dbc20 | https://github.com/BapCat/Persist/blob/0bc53dc50d0c40ecb519c88e33d77889619dbc20/src/Driver.php#L34-L40 |
11,701 | Innmind/RestBundle | Client/LoaderFactory.php | LoaderFactory.make | public function make($host)
{
$host = $this->resolver->resolve($host, '/');
$hash = md5($host);
if (isset($this->instances[$hash])) {
return $this->instances[$hash];
}
$dir = sprintf(
'%s/%s',
rtrim($this->cacheDir, '/'),
$has... | php | public function make($host)
{
$host = $this->resolver->resolve($host, '/');
$hash = md5($host);
if (isset($this->instances[$hash])) {
return $this->instances[$hash];
}
$dir = sprintf(
'%s/%s',
rtrim($this->cacheDir, '/'),
$has... | [
"public",
"function",
"make",
"(",
"$",
"host",
")",
"{",
"$",
"host",
"=",
"$",
"this",
"->",
"resolver",
"->",
"resolve",
"(",
"$",
"host",
",",
"'/'",
")",
";",
"$",
"hash",
"=",
"md5",
"(",
"$",
"host",
")",
";",
"if",
"(",
"isset",
"(",
... | Create a loader for a given host
@param string $host
@return Loader | [
"Create",
"a",
"loader",
"for",
"a",
"given",
"host"
] | 46de57d9b45dfbfcf98867be3c601fba57f2edc2 | https://github.com/Innmind/RestBundle/blob/46de57d9b45dfbfcf98867be3c601fba57f2edc2/Client/LoaderFactory.php#L41-L68 |
11,702 | harvestcloud/CoreBundle | Repository/SellerWindowRepository.php | SellerWindowRepository.findOneForHubIdAndStartTime | public function findOneForHubIdAndStartTime($hub_id, $start_time)
{
$qb = $this->getEntityManager()->createQueryBuilder()
->from('HarvestCloudCoreBundle:SellerWindow', 'pw')
->select('pw')
->where('pw.start_time = :start_time')
->andWhere('pw.start_time > :now... | php | public function findOneForHubIdAndStartTime($hub_id, $start_time)
{
$qb = $this->getEntityManager()->createQueryBuilder()
->from('HarvestCloudCoreBundle:SellerWindow', 'pw')
->select('pw')
->where('pw.start_time = :start_time')
->andWhere('pw.start_time > :now... | [
"public",
"function",
"findOneForHubIdAndStartTime",
"(",
"$",
"hub_id",
",",
"$",
"start_time",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"createQueryBuilder",
"(",
")",
"->",
"from",
"(",
"'HarvestCloudCoreBundle:SellerWi... | Find for hub_id and datetime
@author Tom Haskins-Vaughan <[email protected]>
@since 2012-05-19
@param int $hub_id
@param string $start_time | [
"Find",
"for",
"hub_id",
"and",
"datetime"
] | f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc | https://github.com/harvestcloud/CoreBundle/blob/f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc/Repository/SellerWindowRepository.php#L26-L40 |
11,703 | harvestcloud/CoreBundle | Repository/SellerWindowRepository.php | SellerWindowRepository.findUpcomingForSeller | public function findUpcomingForSeller(Profile $seller)
{
$em = $this->getEntityManager();
$q = $em->createQuery('
SELECT w
FROM HarvestCloudCoreBundle:SellerWindow w
LEFT JOIN w.sellerHubRef shr
LEFT JOIN shr.hub h
WHE... | php | public function findUpcomingForSeller(Profile $seller)
{
$em = $this->getEntityManager();
$q = $em->createQuery('
SELECT w
FROM HarvestCloudCoreBundle:SellerWindow w
LEFT JOIN w.sellerHubRef shr
LEFT JOIN shr.hub h
WHE... | [
"public",
"function",
"findUpcomingForSeller",
"(",
"Profile",
"$",
"seller",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"q",
"=",
"$",
"em",
"->",
"createQuery",
"(",
"'\n SELECT w\n FROM H... | Find upcoming for a given Seller
@author Tom Haskins-Vaughan <[email protected]>
@since 2012-10-10
@param Profile $seller | [
"Find",
"upcoming",
"for",
"a",
"given",
"Seller"
] | f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc | https://github.com/harvestcloud/CoreBundle/blob/f33e079c4a6191cf674aa2678f2fb2e6f0dd89cc/Repository/SellerWindowRepository.php#L50-L67 |
11,704 | flavorzyb/wechat | src/Sdk/JsApiTicket.php | JsApiTicket.saveTicket | private function saveTicket($ticket, $expire)
{
$data = ['ticket' => $ticket, 'expire' => intval($expire), 'time' => time()];
return ($this->getFileSystem()->put($this->getTicketFilePath(), serialize($data), true) > 0);
} | php | private function saveTicket($ticket, $expire)
{
$data = ['ticket' => $ticket, 'expire' => intval($expire), 'time' => time()];
return ($this->getFileSystem()->put($this->getTicketFilePath(), serialize($data), true) > 0);
} | [
"private",
"function",
"saveTicket",
"(",
"$",
"ticket",
",",
"$",
"expire",
")",
"{",
"$",
"data",
"=",
"[",
"'ticket'",
"=>",
"$",
"ticket",
",",
"'expire'",
"=>",
"intval",
"(",
"$",
"expire",
")",
",",
"'time'",
"=>",
"time",
"(",
")",
"]",
";"... | save js api ticket to file
@param string $ticket
@param int $expire
@return bool | [
"save",
"js",
"api",
"ticket",
"to",
"file"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Sdk/JsApiTicket.php#L104-L108 |
11,705 | flavorzyb/wechat | src/Sdk/JsApiTicket.php | JsApiTicket.readTicket | private function readTicket()
{
if (!$this->getFileSystem()->isFile($this->getTicketFilePath())) {
return '';
}
$content = trim($this->getFileSystem()->get($this->getTicketFilePath()));
$result = unserialize($content);
if (isset($result['ticket']) && isset($resu... | php | private function readTicket()
{
if (!$this->getFileSystem()->isFile($this->getTicketFilePath())) {
return '';
}
$content = trim($this->getFileSystem()->get($this->getTicketFilePath()));
$result = unserialize($content);
if (isset($result['ticket']) && isset($resu... | [
"private",
"function",
"readTicket",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getFileSystem",
"(",
")",
"->",
"isFile",
"(",
"$",
"this",
"->",
"getTicketFilePath",
"(",
")",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"content",
"=",
"... | read js api ticket from file
@return string
@throws \Simple\Filesystem\FileNotFoundException | [
"read",
"js",
"api",
"ticket",
"from",
"file"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Sdk/JsApiTicket.php#L116-L133 |
11,706 | 20steps/autotables-bundle | Model/AbstractColumnDescriptor.php | AbstractColumnDescriptor.validate | public function validate() {
if ($this->initializer) {
Ensure::isFalse($this->initializer->getRepository() && $this->initializer->getValue(), 'It makes no sense to define initializer repository and value simultaneously for column [%s]', $this->name);
}
} | php | public function validate() {
if ($this->initializer) {
Ensure::isFalse($this->initializer->getRepository() && $this->initializer->getValue(), 'It makes no sense to define initializer repository and value simultaneously for column [%s]', $this->name);
}
} | [
"public",
"function",
"validate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"initializer",
")",
"{",
"Ensure",
"::",
"isFalse",
"(",
"$",
"this",
"->",
"initializer",
"->",
"getRepository",
"(",
")",
"&&",
"$",
"this",
"->",
"initializer",
"->",
"ge... | Throws an exception if the settings are inconsistent. | [
"Throws",
"an",
"exception",
"if",
"the",
"settings",
"are",
"inconsistent",
"."
] | 12c52f485079766154d0ac784df4b421ce2e1b85 | https://github.com/20steps/autotables-bundle/blob/12c52f485079766154d0ac784df4b421ce2e1b85/Model/AbstractColumnDescriptor.php#L142-L146 |
11,707 | 20steps/autotables-bundle | Model/AbstractColumnDescriptor.php | AbstractColumnDescriptor.getEditableDataString | public function getEditableDataString() {
$valuePairs = array();
if ($this->values) {
foreach ($this->values as $value) {
$valuePairs[] = '\''.$value['label'].'\':\''.$value['value'].'\'';
}
}
return '{'.join(', ',$valuePairs).'}';
} | php | public function getEditableDataString() {
$valuePairs = array();
if ($this->values) {
foreach ($this->values as $value) {
$valuePairs[] = '\''.$value['label'].'\':\''.$value['value'].'\'';
}
}
return '{'.join(', ',$valuePairs).'}';
} | [
"public",
"function",
"getEditableDataString",
"(",
")",
"{",
"$",
"valuePairs",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"values",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"values",
"as",
"$",
"value",
")",
"{",
"$",
"valuePair... | Returns the viewType specific data string for the editable plugin. | [
"Returns",
"the",
"viewType",
"specific",
"data",
"string",
"for",
"the",
"editable",
"plugin",
"."
] | 12c52f485079766154d0ac784df4b421ce2e1b85 | https://github.com/20steps/autotables-bundle/blob/12c52f485079766154d0ac784df4b421ce2e1b85/Model/AbstractColumnDescriptor.php#L222-L230 |
11,708 | perseids-project/perseids-clients-manager | src/Entity/ClientRepository.php | ClientRepository.update | public function update(Client $client)
{
$this->getEntityManager()->persist($client);
$this->getEntityManager()->flush();
} | php | public function update(Client $client)
{
$this->getEntityManager()->persist($client);
$this->getEntityManager()->flush();
} | [
"public",
"function",
"update",
"(",
"Client",
"$",
"client",
")",
"{",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"persist",
"(",
"$",
"client",
")",
";",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"flush",
"(",
")",
";",
"}"... | Update a client in the DB
@param Client $client [description]
@return - | [
"Update",
"a",
"client",
"in",
"the",
"DB"
] | e0f4c9e9b5522001052cf6cfc7b2543a4a1cc378 | https://github.com/perseids-project/perseids-clients-manager/blob/e0f4c9e9b5522001052cf6cfc7b2543a4a1cc378/src/Entity/ClientRepository.php#L46-L50 |
11,709 | perseids-project/perseids-clients-manager | src/Entity/ClientRepository.php | ClientRepository.delete | public function delete(Client $client)
{
$this->getEntityManager()->remove($client);
$this->getEntityManager()->flush();
} | php | public function delete(Client $client)
{
$this->getEntityManager()->remove($client);
$this->getEntityManager()->flush();
} | [
"public",
"function",
"delete",
"(",
"Client",
"$",
"client",
")",
"{",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"remove",
"(",
"$",
"client",
")",
";",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"flush",
"(",
")",
";",
"}"
... | Remove a client from the databasee
@param Client $client A Client instance
@return [type] [description] | [
"Remove",
"a",
"client",
"from",
"the",
"databasee"
] | e0f4c9e9b5522001052cf6cfc7b2543a4a1cc378 | https://github.com/perseids-project/perseids-clients-manager/blob/e0f4c9e9b5522001052cf6cfc7b2543a4a1cc378/src/Entity/ClientRepository.php#L69-L73 |
11,710 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.setDisabledDates | public function setDisabledDates($dates)
{
if (!is_array($dates)) {
$dates = (array) $dates;
}
$this->option_disabled_dates = $dates;
$this->set_options['disabled_dates'] = 'disabledDates';
return $this;
} | php | public function setDisabledDates($dates)
{
if (!is_array($dates)) {
$dates = (array) $dates;
}
$this->option_disabled_dates = $dates;
$this->set_options['disabled_dates'] = 'disabledDates';
return $this;
} | [
"public",
"function",
"setDisabledDates",
"(",
"$",
"dates",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"dates",
")",
")",
"{",
"$",
"dates",
"=",
"(",
"array",
")",
"$",
"dates",
";",
"}",
"$",
"this",
"->",
"option_disabled_dates",
"=",
"$",
... | Sets disabled dates.
Accepts a single date or a list of dates in an array.
@param string|array $dates
@return \Core\Html\Controls\DateTimePicker | [
"Sets",
"disabled",
"dates",
".",
"Accepts",
"a",
"single",
"date",
"or",
"a",
"list",
"of",
"dates",
"in",
"an",
"array",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L203-L213 |
11,711 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.setEnabledDates | public function setEnabledDates($dates)
{
if (!is_array($dates)) {
$dates = (array) $dates;
}
$this->option_enabled_dates = $dates;
$this->set_options['enablede_dates'] = 'enabledDates';
return $this;
} | php | public function setEnabledDates($dates)
{
if (!is_array($dates)) {
$dates = (array) $dates;
}
$this->option_enabled_dates = $dates;
$this->set_options['enablede_dates'] = 'enabledDates';
return $this;
} | [
"public",
"function",
"setEnabledDates",
"(",
"$",
"dates",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"dates",
")",
")",
"{",
"$",
"dates",
"=",
"(",
"array",
")",
"$",
"dates",
";",
"}",
"$",
"this",
"->",
"option_enabled_dates",
"=",
"$",
"... | Sets enabled dates.
Accepts a single date or a list of dates in an array.
@param string|array $dates
@return \Core\Html\Controls\DateTimePicker | [
"Sets",
"enabled",
"dates",
".",
"Accepts",
"a",
"single",
"date",
"or",
"a",
"list",
"of",
"dates",
"in",
"an",
"array",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L233-L243 |
11,712 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.showToday | public function showToday($bool = null)
{
if (isset($bool)) {
$this->option_show_today = is_bool($bool) ? $bool : false;
$this->set_options['show_today'] = 'showToday';
return $this;
}
else {
return $this->option_show_today;
}
} | php | public function showToday($bool = null)
{
if (isset($bool)) {
$this->option_show_today = is_bool($bool) ? $bool : false;
$this->set_options['show_today'] = 'showToday';
return $this;
}
else {
return $this->option_show_today;
}
} | [
"public",
"function",
"showToday",
"(",
"$",
"bool",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"option_show_today",
"=",
"is_bool",
"(",
"$",
"bool",
")",
"?",
"$",
"bool",
":",
"false",
";",
"... | Set flag to use or not use the show today button.
This option is "true" by default.
Calling this method without parameter returns the currently set value.
@param boolean $bool
@return boolean, @return \Core\Html\Controls\DateTimePicker | [
"Set",
"flag",
"to",
"use",
"or",
"not",
"use",
"the",
"show",
"today",
"button",
".",
"This",
"option",
"is",
"true",
"by",
"default",
".",
"Calling",
"this",
"method",
"without",
"parameter",
"returns",
"the",
"currently",
"set",
"value",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L254-L267 |
11,713 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.useCurrent | public function useCurrent($bool = null)
{
if (isset($bool)) {
$this->option_use_current = is_bool($bool) ? $bool : false;
$this->set_options['use_current'] = 'useCurrent';
return $this;
}
else {
return $this->option_show_today;
}
... | php | public function useCurrent($bool = null)
{
if (isset($bool)) {
$this->option_use_current = is_bool($bool) ? $bool : false;
$this->set_options['use_current'] = 'useCurrent';
return $this;
}
else {
return $this->option_show_today;
}
... | [
"public",
"function",
"useCurrent",
"(",
"$",
"bool",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"option_use_current",
"=",
"is_bool",
"(",
"$",
"bool",
")",
"?",
"$",
"bool",
":",
"false",
";",
... | Set flag to use or not use the current button.
This option is "true" by default.
Calling this method without parameter returns the currently set value.
@param boolean $bool
@return boolean, @return \Core\Html\Controls\DateTimePicker | [
"Set",
"flag",
"to",
"use",
"or",
"not",
"use",
"the",
"current",
"button",
".",
"This",
"option",
"is",
"true",
"by",
"default",
".",
"Calling",
"this",
"method",
"without",
"parameter",
"returns",
"the",
"currently",
"set",
"value",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L278-L291 |
11,714 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.usePickDate | public function usePickDate($bool = null)
{
if (isset($bool)) {
$this->option_pick_date = (bool) $bool;
$this->set_options['pick_date'] = 'pickDate';
return $this;
}
else {
return $this->option_pick_date;
}
} | php | public function usePickDate($bool = null)
{
if (isset($bool)) {
$this->option_pick_date = (bool) $bool;
$this->set_options['pick_date'] = 'pickDate';
return $this;
}
else {
return $this->option_pick_date;
}
} | [
"public",
"function",
"usePickDate",
"(",
"$",
"bool",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"option_pick_date",
"=",
"(",
"bool",
")",
"$",
"bool",
";",
"$",
"this",
"->",
"set_options",
"["... | Set flag for using datepicker.
This option is "true" by default.
Calling this method without parameter returns the currently set value.
@param boolean $bool
@return boolean, \Core\Html\Controls\DateTimePicker | [
"Set",
"flag",
"for",
"using",
"datepicker",
".",
"This",
"option",
"is",
"true",
"by",
"default",
".",
"Calling",
"this",
"method",
"without",
"parameter",
"returns",
"the",
"currently",
"set",
"value",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L412-L425 |
11,715 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.usePickTime | public function usePickTime($bool = null)
{
if (isset($bool)) {
$this->option_pick_time = (bool) $bool;
$this->set_options['pick_time'] = 'pickTime';
return $this;
}
else {
return $this->option_pick_time;
}
} | php | public function usePickTime($bool = null)
{
if (isset($bool)) {
$this->option_pick_time = (bool) $bool;
$this->set_options['pick_time'] = 'pickTime';
return $this;
}
else {
return $this->option_pick_time;
}
} | [
"public",
"function",
"usePickTime",
"(",
"$",
"bool",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"option_pick_time",
"=",
"(",
"bool",
")",
"$",
"bool",
";",
"$",
"this",
"->",
"set_options",
"["... | Set flag for using timepicker.
This option is "true" by default.
Calling this method without parameter returns the currently set value.
@param boolean $bool
@return boolean, \Core\Html\Controls\DateTimePicker | [
"Set",
"flag",
"for",
"using",
"timepicker",
".",
"This",
"option",
"is",
"true",
"by",
"default",
".",
"Calling",
"this",
"method",
"without",
"parameter",
"returns",
"the",
"currently",
"set",
"value",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L436-L449 |
11,716 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.useMinutes | public function useMinutes($bool = null)
{
if (isset($bool)) {
$this->option_use_minutes = (bool) $bool;
$this->set_options['use_minutes'] = 'useMinutes';
return $this;
}
else {
return $this->option_use_minutes;
}
} | php | public function useMinutes($bool = null)
{
if (isset($bool)) {
$this->option_use_minutes = (bool) $bool;
$this->set_options['use_minutes'] = 'useMinutes';
return $this;
}
else {
return $this->option_use_minutes;
}
} | [
"public",
"function",
"useMinutes",
"(",
"$",
"bool",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"option_use_minutes",
"=",
"(",
"bool",
")",
"$",
"bool",
";",
"$",
"this",
"->",
"set_options",
"[... | Set flag to use or not use minutes in timepicker.
This option is "true" by default.
Calling this method without parameter returns the currently set value.
@param boolean $bool
@return boolean, \Core\Html\Controls\DateTimePicker | [
"Set",
"flag",
"to",
"use",
"or",
"not",
"use",
"minutes",
"in",
"timepicker",
".",
"This",
"option",
"is",
"true",
"by",
"default",
".",
"Calling",
"this",
"method",
"without",
"parameter",
"returns",
"the",
"currently",
"set",
"value",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L459-L472 |
11,717 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.useSeconds | public function useSeconds($bool = null)
{
if (isset($bool)) {
$this->option_use_seconds = (bool) $bool;
$this->set_options['use_seconds'] = 'useSeconds';
return $this;
}
else {
return $this->option_use_seconds;
}
} | php | public function useSeconds($bool = null)
{
if (isset($bool)) {
$this->option_use_seconds = (bool) $bool;
$this->set_options['use_seconds'] = 'useSeconds';
return $this;
}
else {
return $this->option_use_seconds;
}
} | [
"public",
"function",
"useSeconds",
"(",
"$",
"bool",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"bool",
")",
")",
"{",
"$",
"this",
"->",
"option_use_seconds",
"=",
"(",
"bool",
")",
"$",
"bool",
";",
"$",
"this",
"->",
"set_options",
"[... | Set flag to use or not use saeconds int timepicker.
This option is "true" by default.
Calling this method without parameter returns the currently set value.
@param boolean $bool
@return boolean, \Core\Html\Controls\DateTimePicker | [
"Set",
"flag",
"to",
"use",
"or",
"not",
"use",
"saeconds",
"int",
"timepicker",
".",
"This",
"option",
"is",
"true",
"by",
"default",
".",
"Calling",
"this",
"method",
"without",
"parameter",
"returns",
"the",
"currently",
"set",
"value",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L483-L496 |
11,718 | tekkla/core-html | Core/Html/Controls/DateTimePicker.php | DateTimePicker.setLocale | public function setLocale(string $locale): DateTimePicker
{
$this->option_locale = $locale;
$this->set_options['locale'] = 'locale';
return $this;
} | php | public function setLocale(string $locale): DateTimePicker
{
$this->option_locale = $locale;
$this->set_options['locale'] = 'locale';
return $this;
} | [
"public",
"function",
"setLocale",
"(",
"string",
"$",
"locale",
")",
":",
"DateTimePicker",
"{",
"$",
"this",
"->",
"option_locale",
"=",
"$",
"locale",
";",
"$",
"this",
"->",
"set_options",
"[",
"'locale'",
"]",
"=",
"'locale'",
";",
"return",
"$",
"t... | Sets locale to use
@param string $locale
@return DateTimePicker | [
"Sets",
"locale",
"to",
"use"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Controls/DateTimePicker.php#L505-L511 |
11,719 | hermajan/lib | src/net/Net.php | Net.pageURL | public static function pageURL() {
$URL = "http";
if(!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$URL .= "s";
}
$URL .= "://".$_SERVER["SERVER_NAME"];
if($_SERVER["SERVER_PORT"] != "80") {
$URL .= ":".$_SERVER["SERVER_PORT"];
}
$URL .= $_SERVER["REQUEST_URI"];
return $URL;
} | php | public static function pageURL() {
$URL = "http";
if(!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$URL .= "s";
}
$URL .= "://".$_SERVER["SERVER_NAME"];
if($_SERVER["SERVER_PORT"] != "80") {
$URL .= ":".$_SERVER["SERVER_PORT"];
}
$URL .= $_SERVER["REQUEST_URI"];
return $URL;
} | [
"public",
"static",
"function",
"pageURL",
"(",
")",
"{",
"$",
"URL",
"=",
"\"http\"",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"_SERVER",
"[",
"\"HTTPS\"",
"]",
")",
"&&",
"$",
"_SERVER",
"[",
"\"HTTPS\"",
"]",
"==",
"\"on\"",
")",
"{",
"$",
"URL",... | Returns URL of page, where function is called.
@return string URL of page | [
"Returns",
"URL",
"of",
"page",
"where",
"function",
"is",
"called",
"."
] | 7d666260f5bcee041f130a3c3100f520b5e4bbd2 | https://github.com/hermajan/lib/blob/7d666260f5bcee041f130a3c3100f520b5e4bbd2/src/net/Net.php#L20-L31 |
11,720 | OWeb/OWeb-Framework | OWeb/defaults/controllers/OWeb/widgets/jquery/CodeGenerator.php | CodeGenerator.addOption | public function addOption($name, $defaultValue, $necessary=false){
$this->defValues[$name] = $defaultValue;
if($necessary)
$this->necessary[$name] = true;
} | php | public function addOption($name, $defaultValue, $necessary=false){
$this->defValues[$name] = $defaultValue;
if($necessary)
$this->necessary[$name] = true;
} | [
"public",
"function",
"addOption",
"(",
"$",
"name",
",",
"$",
"defaultValue",
",",
"$",
"necessary",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"defValues",
"[",
"$",
"name",
"]",
"=",
"$",
"defaultValue",
";",
"if",
"(",
"$",
"necessary",
")",
"$",... | Add an option that this code might have or must have
@param String $name The name of the option
@param String/int $defaultValue The default value this function has
@param Boolean Does the code requires this option to work? | [
"Add",
"an",
"option",
"that",
"this",
"code",
"might",
"have",
"or",
"must",
"have"
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/defaults/controllers/OWeb/widgets/jquery/CodeGenerator.php#L57-L61 |
11,721 | OWeb/OWeb-Framework | OWeb/defaults/controllers/OWeb/widgets/jquery/CodeGenerator.php | CodeGenerator.generateJqueryCode | protected function generateJqueryCode($selector, $function){
$code = '$( "'.$selector.'" ).'.$function.'(';
$optionsShown = false;
foreach($this->necessary as $pname => $v){
$pvalue = $this->getParam($pname);
if($pvalue == null)
$pvalue = $this->defValues[$pname];
if(!empty($pvalue) && $pva... | php | protected function generateJqueryCode($selector, $function){
$code = '$( "'.$selector.'" ).'.$function.'(';
$optionsShown = false;
foreach($this->necessary as $pname => $v){
$pvalue = $this->getParam($pname);
if($pvalue == null)
$pvalue = $this->defValues[$pname];
if(!empty($pvalue) && $pva... | [
"protected",
"function",
"generateJqueryCode",
"(",
"$",
"selector",
",",
"$",
"function",
")",
"{",
"$",
"code",
"=",
"'$( \"'",
".",
"$",
"selector",
".",
"'\" ).'",
".",
"$",
"function",
".",
"'('",
";",
"$",
"optionsShown",
"=",
"false",
";",
"foreac... | Generates the jquery code with default values as well
@param type $selector
@param type $function
@return string | [
"Generates",
"the",
"jquery",
"code",
"with",
"default",
"values",
"as",
"well"
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/defaults/controllers/OWeb/widgets/jquery/CodeGenerator.php#L98-L149 |
11,722 | OWeb/OWeb-Framework | OWeb/defaults/controllers/OWeb/widgets/jquery/CodeGenerator.php | CodeGenerator.prepareDisplay | public function prepareDisplay(){
if($this->id == null && $this->class == null){
$this->id = (String)(new \OWeb\utils\IdGenerator ());
$displayId = 'id="'.$this->id.'"';
$jid = "#".$this->id;
}else if($this->id == null){
$displayId = 'class="'.$this->class.'"';
$jid = ".".$this->class;
}else{
$d... | php | public function prepareDisplay(){
if($this->id == null && $this->class == null){
$this->id = (String)(new \OWeb\utils\IdGenerator ());
$displayId = 'id="'.$this->id.'"';
$jid = "#".$this->id;
}else if($this->id == null){
$displayId = 'class="'.$this->class.'"';
$jid = ".".$this->class;
}else{
$d... | [
"public",
"function",
"prepareDisplay",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"id",
"==",
"null",
"&&",
"$",
"this",
"->",
"class",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"(",
"String",
")",
"(",
"new",
"\\",
"OWeb",
"\\",
... | Makes the necessary verifications to see if the Controller can be displayed.
Will also generate the selector for the jquery call as well as the code needed
for it in the html code
@return string The Jquery selector
@throws \Controller\OWeb\widgets\jquery\OWeb\Exception If the function hasn't been set up | [
"Makes",
"the",
"necessary",
"verifications",
"to",
"see",
"if",
"the",
"Controller",
"can",
"be",
"displayed",
".",
"Will",
"also",
"generate",
"the",
"selector",
"for",
"the",
"jquery",
"call",
"as",
"well",
"as",
"the",
"code",
"needed",
"for",
"it",
"i... | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/defaults/controllers/OWeb/widgets/jquery/CodeGenerator.php#L159-L181 |
11,723 | jaztec/jaztec-acl | src/JaztecAcl/Direct/AuthorizedDirectObject.php | AuthorizedDirectObject.checkAcl | public function checkAcl($privilege)
{
// Find the base resource name this module is given.
$moduleName = substr(get_class($this), 0, strpos(get_class($this), '\\'));
$config = $this->getServiceLocator()->get('Config');
$baseName = $config['jaztec_acl']['name'][$moduleName];
... | php | public function checkAcl($privilege)
{
// Find the base resource name this module is given.
$moduleName = substr(get_class($this), 0, strpos(get_class($this), '\\'));
$config = $this->getServiceLocator()->get('Config');
$baseName = $config['jaztec_acl']['name'][$moduleName];
... | [
"public",
"function",
"checkAcl",
"(",
"$",
"privilege",
")",
"{",
"// Find the base resource name this module is given.",
"$",
"moduleName",
"=",
"substr",
"(",
"get_class",
"(",
"$",
"this",
")",
",",
"0",
",",
"strpos",
"(",
"get_class",
"(",
"$",
"this",
"... | Checks the ACL registry.
@param string $privilege
@return boolean | [
"Checks",
"the",
"ACL",
"registry",
"."
] | dcd0f57ee95b362d810b09bfd7efaaf19ea8c4c4 | https://github.com/jaztec/jaztec-acl/blob/dcd0f57ee95b362d810b09bfd7efaaf19ea8c4c4/src/JaztecAcl/Direct/AuthorizedDirectObject.php#L53-L62 |
11,724 | OpenResourceManager/client-php | src/Client/AliasAccount.php | AliasAccount.store | public function store(
$username,
$should_propagate_password = null,
$password = null,
$account_id = null,
$account_identifier = null,
$account_username = null,
$expires_at = null,
$disabled = null
)
{
$fields = [];
//@todo validate... | php | public function store(
$username,
$should_propagate_password = null,
$password = null,
$account_id = null,
$account_identifier = null,
$account_username = null,
$expires_at = null,
$disabled = null
)
{
$fields = [];
//@todo validate... | [
"public",
"function",
"store",
"(",
"$",
"username",
",",
"$",
"should_propagate_password",
"=",
"null",
",",
"$",
"password",
"=",
"null",
",",
"$",
"account_id",
"=",
"null",
",",
"$",
"account_identifier",
"=",
"null",
",",
"$",
"account_username",
"=",
... | Store Alias Account
Create or update an alias account, by it's username.
@param string $username
@param boolean $should_propagate_password
@param string $password
@param int $account_id
@param string $account_identifier
@param string $account_username
@param DateTime $expires_at
@param boolean $disabled
@return \Unir... | [
"Store",
"Alias",
"Account"
] | fa468e3425d32f97294fefed77a7f096f3f8cc86 | https://github.com/OpenResourceManager/client-php/blob/fa468e3425d32f97294fefed77a7f096f3f8cc86/src/Client/AliasAccount.php#L89-L112 |
11,725 | easy-system/es-view | src/Listener/InjectTemplateListener.php | InjectTemplateListener.resolveTemplate | protected function resolveTemplate($controller, $moduleNamespace)
{
$class = get_class($controller);
$server = $this->getServer();
$request = $server->getRequest();
$action = $request->getAttribute('action', 'index');
if (0 !== strpos($class, $moduleNamespace)) {
... | php | protected function resolveTemplate($controller, $moduleNamespace)
{
$class = get_class($controller);
$server = $this->getServer();
$request = $server->getRequest();
$action = $request->getAttribute('action', 'index');
if (0 !== strpos($class, $moduleNamespace)) {
... | [
"protected",
"function",
"resolveTemplate",
"(",
"$",
"controller",
",",
"$",
"moduleNamespace",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"controller",
")",
";",
"$",
"server",
"=",
"$",
"this",
"->",
"getServer",
"(",
")",
";",
"$",
"request"... | Resolves template for received controller.
@param object $controller The controller
@param string $moduleNamespace The module namespace
@throws \UnexpectedValueException If the controller namespace does not
match with namespace of module
@return string The template name | [
"Resolves",
"template",
"for",
"received",
"controller",
"."
] | 8a29efcef8cd59640c98f5440379a93d0f504212 | https://github.com/easy-system/es-view/blob/8a29efcef8cd59640c98f5440379a93d0f504212/src/Listener/InjectTemplateListener.php#L71-L99 |
11,726 | wisquimas/valleysofsorcery | admin/mf_post.php | mf_post.mf_post_add_metaboxes | function mf_post_add_metaboxes() {
global $post,$mf_post_values;
//if the user are going to add a new link
//the var $post is not defined and we do nothing
if(!isset($post)) {
return false;
}
$mf_post_values = $this->mf_get_post_values($post->ID);
//Getting the post types
$post_... | php | function mf_post_add_metaboxes() {
global $post,$mf_post_values;
//if the user are going to add a new link
//the var $post is not defined and we do nothing
if(!isset($post)) {
return false;
}
$mf_post_values = $this->mf_get_post_values($post->ID);
//Getting the post types
$post_... | [
"function",
"mf_post_add_metaboxes",
"(",
")",
"{",
"global",
"$",
"post",
",",
"$",
"mf_post_values",
";",
"//if the user are going to add a new link",
"//the var $post is not defined and we do nothing",
"if",
"(",
"!",
"isset",
"(",
"$",
"post",
")",
")",
"{",
"retu... | Adding the metaboxes | [
"Adding",
"the",
"metaboxes"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_post.php#L32-L84 |
11,727 | wisquimas/valleysofsorcery | admin/mf_post.php | mf_post.mf_metabox_content | function mf_metabox_content( $post, $metabox ) {
global $mf_domain, $mf_post_values;
//Getting the custom fields for this metabox
$custom_fields = $this->get_custom_fields_by_group($metabox['args']['group_info']['id']);
$group_id = $metabox['args']['group_info']['id'];
//default markup
?>
<... | php | function mf_metabox_content( $post, $metabox ) {
global $mf_domain, $mf_post_values;
//Getting the custom fields for this metabox
$custom_fields = $this->get_custom_fields_by_group($metabox['args']['group_info']['id']);
$group_id = $metabox['args']['group_info']['id'];
//default markup
?>
<... | [
"function",
"mf_metabox_content",
"(",
"$",
"post",
",",
"$",
"metabox",
")",
"{",
"global",
"$",
"mf_domain",
",",
"$",
"mf_post_values",
";",
"//Getting the custom fields for this metabox",
"$",
"custom_fields",
"=",
"$",
"this",
"->",
"get_custom_fields_by_group",
... | Fill a metabox with custom fields | [
"Fill",
"a",
"metabox",
"with",
"custom",
"fields"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_post.php#L89-L117 |
11,728 | wisquimas/valleysofsorcery | admin/mf_post.php | mf_post.mf_get_post_values | function mf_get_post_values( $post_id ) {
global $wpdb;
$raw = $wpdb->get_results(
"SELECT
mfpm.meta_id,
mfpm.field_name,
mfpm.field_count,
mfpm.group_count,
pm.meta_value
FROM
".MF_TABLE_POST_META." as mfpm
LEFT JOIN
".$wpdb->postmeta." ... | php | function mf_get_post_values( $post_id ) {
global $wpdb;
$raw = $wpdb->get_results(
"SELECT
mfpm.meta_id,
mfpm.field_name,
mfpm.field_count,
mfpm.group_count,
pm.meta_value
FROM
".MF_TABLE_POST_META." as mfpm
LEFT JOIN
".$wpdb->postmeta." ... | [
"function",
"mf_get_post_values",
"(",
"$",
"post_id",
")",
"{",
"global",
"$",
"wpdb",
";",
"$",
"raw",
"=",
"$",
"wpdb",
"->",
"get_results",
"(",
"\"SELECT\n mfpm.meta_id,\n mfpm.field_name,\n mfpm.field_count,\n mfpm.group_count,\n pm.meta... | retrieve the custom fields values of a certain post | [
"retrieve",
"the",
"custom",
"fields",
"values",
"of",
"a",
"certain",
"post"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_post.php#L375-L402 |
11,729 | wisquimas/valleysofsorcery | admin/mf_post.php | mf_post.mf_metabox_template | function mf_metabox_template () {
global $post;
if ( 0 != count( get_page_templates() ) ) {
$template = get_post_meta($post->ID, '_wp_mf_page_template', TRUE);
$template = ($template != '') ? $template : false;
?>
<label class="screen-reader-text" for="page_template"><?php _e('Page Temp... | php | function mf_metabox_template () {
global $post;
if ( 0 != count( get_page_templates() ) ) {
$template = get_post_meta($post->ID, '_wp_mf_page_template', TRUE);
$template = ($template != '') ? $template : false;
?>
<label class="screen-reader-text" for="page_template"><?php _e('Page Temp... | [
"function",
"mf_metabox_template",
"(",
")",
"{",
"global",
"$",
"post",
";",
"if",
"(",
"0",
"!=",
"count",
"(",
"get_page_templates",
"(",
")",
")",
")",
"{",
"$",
"template",
"=",
"get_post_meta",
"(",
"$",
"post",
"->",
"ID",
",",
"'_wp_mf_page_templ... | MF Meta box for select template | [
"MF",
"Meta",
"box",
"for",
"select",
"template"
] | 78a8d8f1d1102c5043e2cf7c98762e63464d2d7a | https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_post.php#L624-L638 |
11,730 | squire-assistant/console | Command/Command.php | Command.setAliases | public function setAliases($aliases)
{
if (!is_array($aliases) && !$aliases instanceof \Traversable) {
throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable');
}
foreach ($aliases as $alias) {
$this->validateName($alias);
... | php | public function setAliases($aliases)
{
if (!is_array($aliases) && !$aliases instanceof \Traversable) {
throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable');
}
foreach ($aliases as $alias) {
$this->validateName($alias);
... | [
"public",
"function",
"setAliases",
"(",
"$",
"aliases",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"aliases",
")",
"&&",
"!",
"$",
"aliases",
"instanceof",
"\\",
"Traversable",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'$aliases must ... | Sets the aliases for the command.
@param string[] $aliases An array of aliases for the command
@return $this
@throws InvalidArgumentException When an alias is invalid | [
"Sets",
"the",
"aliases",
"for",
"the",
"command",
"."
] | 9e16b975a3b9403af52e2d1b465a625e8936076c | https://github.com/squire-assistant/console/blob/9e16b975a3b9403af52e2d1b465a625e8936076c/Command/Command.php#L564-L577 |
11,731 | rikby/console-helper | src/Helper/Shell/ShellHelper.php | ShellHelper.filterCommand | protected function filterCommand($command, $tail)
{
$command = trim($command);
if (!$command) {
throw new ShellException('Command cannot be empty.');
}
if ($tail && !strpos($command, $tail)) {
$command .= $tail;
}
return $command;
} | php | protected function filterCommand($command, $tail)
{
$command = trim($command);
if (!$command) {
throw new ShellException('Command cannot be empty.');
}
if ($tail && !strpos($command, $tail)) {
$command .= $tail;
}
return $command;
} | [
"protected",
"function",
"filterCommand",
"(",
"$",
"command",
",",
"$",
"tail",
")",
"{",
"$",
"command",
"=",
"trim",
"(",
"$",
"command",
")",
";",
"if",
"(",
"!",
"$",
"command",
")",
"{",
"throw",
"new",
"ShellException",
"(",
"'Command cannot be em... | Filter command string
@param string $command
@param string $tail
@return string
@throws ShellException | [
"Filter",
"command",
"string"
] | c618daf79e01439ea6cd60a75c9ff5b09de9b75d | https://github.com/rikby/console-helper/blob/c618daf79e01439ea6cd60a75c9ff5b09de9b75d/src/Helper/Shell/ShellHelper.php#L144-L156 |
11,732 | rikby/console-helper | src/Helper/Shell/ShellHelper.php | ShellHelper.processError | protected function processError($output, $exceptionOnError = true, $exceptionClass = ShellException::class)
{
if ($exceptionOnError && $this->hadError()) {
$exceptionClass = $exceptionClass ?: ShellException::class;
throw new $exceptionClass($output);
}
return $this;... | php | protected function processError($output, $exceptionOnError = true, $exceptionClass = ShellException::class)
{
if ($exceptionOnError && $this->hadError()) {
$exceptionClass = $exceptionClass ?: ShellException::class;
throw new $exceptionClass($output);
}
return $this;... | [
"protected",
"function",
"processError",
"(",
"$",
"output",
",",
"$",
"exceptionOnError",
"=",
"true",
",",
"$",
"exceptionClass",
"=",
"ShellException",
"::",
"class",
")",
"{",
"if",
"(",
"$",
"exceptionOnError",
"&&",
"$",
"this",
"->",
"hadError",
"(",
... | Process error in output
@param string $output
@param bool $exceptionOnError
@param string $exceptionClass
@return $this | [
"Process",
"error",
"in",
"output"
] | c618daf79e01439ea6cd60a75c9ff5b09de9b75d | https://github.com/rikby/console-helper/blob/c618daf79e01439ea6cd60a75c9ff5b09de9b75d/src/Helper/Shell/ShellHelper.php#L196-L204 |
11,733 | teamelf/ext-bulletin | src/Bulletin.php | Bulletin.getAbstract | public function getAbstract($length = 100)
{
$content = $this->getContent();
if (mb_strlen($content) > $length - 3) {
return mb_substr($content, 0, $length - 3) . '...';
} else {
return $content;
}
} | php | public function getAbstract($length = 100)
{
$content = $this->getContent();
if (mb_strlen($content) > $length - 3) {
return mb_substr($content, 0, $length - 3) . '...';
} else {
return $content;
}
} | [
"public",
"function",
"getAbstract",
"(",
"$",
"length",
"=",
"100",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
";",
"if",
"(",
"mb_strlen",
"(",
"$",
"content",
")",
">",
"$",
"length",
"-",
"3",
")",
"{",
"return",
... | get content's abstract
@param int $length
@return string | [
"get",
"content",
"s",
"abstract"
] | 59100b615cfff8fd9645e883a8482b1641144b0f | https://github.com/teamelf/ext-bulletin/blob/59100b615cfff8fd9645e883a8482b1641144b0f/src/Bulletin.php#L174-L182 |
11,734 | zepi/turbo-base | Zepi/Web/AccessControl/src/EventHandler/Profile.php | Profile.execute | public function execute(Framework $framework, WebRequest $request, Response $response)
{
// Prepare the page
$this->setTitle($this->translate('Profile', '\\Zepi\\Web\\AccessControl'));
$menuEntry = $this->activateMenuEntry();
$overviewPage = $this->getOverviewPageRenderer()-... | php | public function execute(Framework $framework, WebRequest $request, Response $response)
{
// Prepare the page
$this->setTitle($this->translate('Profile', '\\Zepi\\Web\\AccessControl'));
$menuEntry = $this->activateMenuEntry();
$overviewPage = $this->getOverviewPageRenderer()-... | [
"public",
"function",
"execute",
"(",
"Framework",
"$",
"framework",
",",
"WebRequest",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"// Prepare the page",
"$",
"this",
"->",
"setTitle",
"(",
"$",
"this",
"->",
"translate",
"(",
"'Profile'",
"... | Displays the profile page for an logged in user.
@access public
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response | [
"Displays",
"the",
"profile",
"page",
"for",
"an",
"logged",
"in",
"user",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/EventHandler/Profile.php#L60-L72 |
11,735 | samurai-fw/samurai | src/Console/Controller/SpecController.php | SpecController.executeAction | public function executeAction()
{
if ($this->isUsage()) return [self::FORWARD_ACTION, 'spec.usage'];
// production
if ($this->application->isProduction() && ! $this->response->confirmation('May I execute spec in production environment ?')) {
$this->send('aborted.');
... | php | public function executeAction()
{
if ($this->isUsage()) return [self::FORWARD_ACTION, 'spec.usage'];
// production
if ($this->application->isProduction() && ! $this->response->confirmation('May I execute spec in production environment ?')) {
$this->send('aborted.');
... | [
"public",
"function",
"executeAction",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isUsage",
"(",
")",
")",
"return",
"[",
"self",
"::",
"FORWARD_ACTION",
",",
"'spec.usage'",
"]",
";",
"// production",
"if",
"(",
"$",
"this",
"->",
"application",
"->"... | execute spec files.
spec step is...
1. setup
4. run spec.
@access public | [
"execute",
"spec",
"files",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/SpecController.php#L66-L78 |
11,736 | samurai-fw/samurai | src/Console/Controller/SpecController.php | SpecController.setup | private function setup()
{
$this->runner = $this->specHelper->getRunner();
$this->setupWorkspace();
$this->setupTargets();
// call initializers
foreach ($this->application->config('spec.initializers.*') as $initializer) {
$initializer($this->application);
... | php | private function setup()
{
$this->runner = $this->specHelper->getRunner();
$this->setupWorkspace();
$this->setupTargets();
// call initializers
foreach ($this->application->config('spec.initializers.*') as $initializer) {
$initializer($this->application);
... | [
"private",
"function",
"setup",
"(",
")",
"{",
"$",
"this",
"->",
"runner",
"=",
"$",
"this",
"->",
"specHelper",
"->",
"getRunner",
"(",
")",
";",
"$",
"this",
"->",
"setupWorkspace",
"(",
")",
";",
"$",
"this",
"->",
"setupTargets",
"(",
")",
";",
... | set up for to run spec.
@access private | [
"set",
"up",
"for",
"to",
"run",
"spec",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/SpecController.php#L101-L112 |
11,737 | samurai-fw/samurai | src/Console/Controller/SpecController.php | SpecController.setupWorkspace | private function setupWorkspace()
{
// search spec configuration file.
$config_file_name = $this->runner->getConfigurationFileName();
$dirs = explode(DS, getcwd());
$find = false;
do {
$workspace = join(DS, $dirs);
$config_file_path = $workspace . DS .... | php | private function setupWorkspace()
{
// search spec configuration file.
$config_file_name = $this->runner->getConfigurationFileName();
$dirs = explode(DS, getcwd());
$find = false;
do {
$workspace = join(DS, $dirs);
$config_file_path = $workspace . DS .... | [
"private",
"function",
"setupWorkspace",
"(",
")",
"{",
"// search spec configuration file.",
"$",
"config_file_name",
"=",
"$",
"this",
"->",
"runner",
"->",
"getConfigurationFileName",
"(",
")",
";",
"$",
"dirs",
"=",
"explode",
"(",
"DS",
",",
"getcwd",
"(",
... | Setup workspace.
@access private | [
"Setup",
"workspace",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/SpecController.php#L119-L136 |
11,738 | samurai-fw/samurai | src/Console/Controller/SpecController.php | SpecController.setupTargets | private function setupTargets()
{
// has targets
$args = $this->request->getAsArray('args');
foreach ($args as $arg) {
$this->runner->addTarget(realpath($arg));
}
} | php | private function setupTargets()
{
// has targets
$args = $this->request->getAsArray('args');
foreach ($args as $arg) {
$this->runner->addTarget(realpath($arg));
}
} | [
"private",
"function",
"setupTargets",
"(",
")",
"{",
"// has targets",
"$",
"args",
"=",
"$",
"this",
"->",
"request",
"->",
"getAsArray",
"(",
"'args'",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"arg",
")",
"{",
"$",
"this",
"->",
"runner",
... | Setup target.
@access private | [
"Setup",
"target",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Console/Controller/SpecController.php#L143-L150 |
11,739 | athena-oss/php-fluent-webdriver-client | src/Browser/Page/Find/PageFinderBuilder.php | PageFinderBuilder.build | public function build()
{
$pageFinder = new PageFinder($this->browser);
if ($this->isWithAssertions) {
$pageFinder = new PageFinderWithAssertions($pageFinder);
}
if ($this->isWithWaits) {
$pageFinder = new PageFinderWithWaits($pageFinder, $this->timeOutInSec... | php | public function build()
{
$pageFinder = new PageFinder($this->browser);
if ($this->isWithAssertions) {
$pageFinder = new PageFinderWithAssertions($pageFinder);
}
if ($this->isWithWaits) {
$pageFinder = new PageFinderWithWaits($pageFinder, $this->timeOutInSec... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"pageFinder",
"=",
"new",
"PageFinder",
"(",
"$",
"this",
"->",
"browser",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isWithAssertions",
")",
"{",
"$",
"pageFinder",
"=",
"new",
"PageFinderWithAssertions",
... | Creates and returns a new PageFinder object according to the current builder state.
@return PageFinderInterface | [
"Creates",
"and",
"returns",
"a",
"new",
"PageFinder",
"object",
"according",
"to",
"the",
"current",
"builder",
"state",
"."
] | 0b4cca15ab876bd9af40c115728fafce08ce3472 | https://github.com/athena-oss/php-fluent-webdriver-client/blob/0b4cca15ab876bd9af40c115728fafce08ce3472/src/Browser/Page/Find/PageFinderBuilder.php#L64-L77 |
11,740 | rodmcnew/symfonize-zf-container-bridge | ContainerBridge.php | ContainerBridge.getContainer | public static function getContainer($zendServiceManager = null)
{
if (!self::$container) {
self::$container = new SymfonyContainerWithZFFallback();
}
if (!Module::$zendServiceManager && $zendServiceManager) {
if ($zendServiceManager->has('serviceLocator')) {
... | php | public static function getContainer($zendServiceManager = null)
{
if (!self::$container) {
self::$container = new SymfonyContainerWithZFFallback();
}
if (!Module::$zendServiceManager && $zendServiceManager) {
if ($zendServiceManager->has('serviceLocator')) {
... | [
"public",
"static",
"function",
"getContainer",
"(",
"$",
"zendServiceManager",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"container",
")",
"{",
"self",
"::",
"$",
"container",
"=",
"new",
"SymfonyContainerWithZFFallback",
"(",
")",
";",
"}... | Returns the Symfony Container
@param ServiceLocatorInterface $zendServiceManager
@return ContainerInterface | [
"Returns",
"the",
"Symfony",
"Container"
] | 6781ed5686a87a7351e3617c6692ef1fc55e0792 | https://github.com/rodmcnew/symfonize-zf-container-bridge/blob/6781ed5686a87a7351e3617c6692ef1fc55e0792/ContainerBridge.php#L22-L36 |
11,741 | flavorzyb/wechat | src/Message/Parser.php | Parser.createReceiveImageMsg | protected function createReceiveImageMsg(array $data)
{
$result = new WxReceiveImageMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setPicUrl(isset($data['PicUrl']) ? trim($data['PicUrl']) : '');
... | php | protected function createReceiveImageMsg(array $data)
{
$result = new WxReceiveImageMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setPicUrl(isset($data['PicUrl']) ? trim($data['PicUrl']) : '');
... | [
"protected",
"function",
"createReceiveImageMsg",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveImageMsg",
"(",
")",
";",
"$",
"this",
"->",
"initReceiveMsg",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->"... | create image msg
@param array $data
@return WxReceiveImageMsg | [
"create",
"image",
"msg"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Message/Parser.php#L66-L73 |
11,742 | flavorzyb/wechat | src/Message/Parser.php | Parser.createReceiveLinkMsg | protected function createReceiveLinkMsg(array $data)
{
$result = new WxReceiveLinkMsg();
$this->initReceiveMsg($result, $data);
$result->setTitle(isset($data['Title']) ? trim($data['Title']) : '');
$result->setDescription(isset($data['Description']) ? trim($data['Description']) : '')... | php | protected function createReceiveLinkMsg(array $data)
{
$result = new WxReceiveLinkMsg();
$this->initReceiveMsg($result, $data);
$result->setTitle(isset($data['Title']) ? trim($data['Title']) : '');
$result->setDescription(isset($data['Description']) ? trim($data['Description']) : '')... | [
"protected",
"function",
"createReceiveLinkMsg",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveLinkMsg",
"(",
")",
";",
"$",
"this",
"->",
"initReceiveMsg",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->",
... | create link msg
@param array $data
@return WxReceiveLinkMsg | [
"create",
"link",
"msg"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Message/Parser.php#L81-L89 |
11,743 | flavorzyb/wechat | src/Message/Parser.php | Parser.createReceiveLocationMsg | protected function createReceiveLocationMsg(array $data)
{
$result = new WxReceiveLocationMsg();
$this->initReceiveMsg($result, $data);
$result->setLocationX(isset($data['Location_X']) ? $data['Location_X']: '');
$result->setLocationY(isset($data['Location_Y']) ? $data['Location_Y'] ... | php | protected function createReceiveLocationMsg(array $data)
{
$result = new WxReceiveLocationMsg();
$this->initReceiveMsg($result, $data);
$result->setLocationX(isset($data['Location_X']) ? $data['Location_X']: '');
$result->setLocationY(isset($data['Location_Y']) ? $data['Location_Y'] ... | [
"protected",
"function",
"createReceiveLocationMsg",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveLocationMsg",
"(",
")",
";",
"$",
"this",
"->",
"initReceiveMsg",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
... | create location msg
@param array $data
@return WxReceiveLocationMsg | [
"create",
"location",
"msg"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Message/Parser.php#L97-L106 |
11,744 | flavorzyb/wechat | src/Message/Parser.php | Parser.createReceiveShortVideoMsg | protected function createReceiveShortVideoMsg(array $data)
{
$result = new WxReceiveShortVideoMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setThumbMediaId(isset($data['ThumbMediaId']) ? trim($data['... | php | protected function createReceiveShortVideoMsg(array $data)
{
$result = new WxReceiveShortVideoMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setThumbMediaId(isset($data['ThumbMediaId']) ? trim($data['... | [
"protected",
"function",
"createReceiveShortVideoMsg",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveShortVideoMsg",
"(",
")",
";",
"$",
"this",
"->",
"initReceiveMsg",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"resul... | create short video msg
@param array $data
@return WxReceiveShortVideoMsg | [
"create",
"short",
"video",
"msg"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Message/Parser.php#L114-L121 |
11,745 | flavorzyb/wechat | src/Message/Parser.php | Parser.createReceiveTextMsg | protected function createReceiveTextMsg(array $data)
{
$result = new WxReceiveTextMsg();
$this->initReceiveMsg($result, $data);
if (isset($data['Content'])) {
if (!is_string($data['Content'])) {
Helper::getLogWriter()->debug("[createReceiveTextMsg]" . serialize($d... | php | protected function createReceiveTextMsg(array $data)
{
$result = new WxReceiveTextMsg();
$this->initReceiveMsg($result, $data);
if (isset($data['Content'])) {
if (!is_string($data['Content'])) {
Helper::getLogWriter()->debug("[createReceiveTextMsg]" . serialize($d... | [
"protected",
"function",
"createReceiveTextMsg",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveTextMsg",
"(",
")",
";",
"$",
"this",
"->",
"initReceiveMsg",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"if",
"(",
"isset",
... | create text msg
@param array $data
@return WxReceiveTextMsg | [
"create",
"text",
"msg"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Message/Parser.php#L129-L142 |
11,746 | flavorzyb/wechat | src/Message/Parser.php | Parser.createReceiveVideoMsg | protected function createReceiveVideoMsg(array $data)
{
$result = new WxReceiveVideoMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setThumbMediaId(isset($data['ThumbMediaId']) ? trim($data['ThumbMedia... | php | protected function createReceiveVideoMsg(array $data)
{
$result = new WxReceiveVideoMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setThumbMediaId(isset($data['ThumbMediaId']) ? trim($data['ThumbMedia... | [
"protected",
"function",
"createReceiveVideoMsg",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveVideoMsg",
"(",
")",
";",
"$",
"this",
"->",
"initReceiveMsg",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->"... | create video msg
@param array $data
@return WxReceiveVideoMsg | [
"create",
"video",
"msg"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Message/Parser.php#L150-L157 |
11,747 | flavorzyb/wechat | src/Message/Parser.php | Parser.createReceiveVoiceMsg | protected function createReceiveVoiceMsg(array $data)
{
$result = new WxReceiveVoiceMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setFormat(isset($data['Format']) ? trim($data['Format']) : '');
... | php | protected function createReceiveVoiceMsg(array $data)
{
$result = new WxReceiveVoiceMsg();
$this->initReceiveMsg($result, $data);
$result->setMediaId(isset($data['MediaId']) ? trim($data['MediaId']) : '');
$result->setFormat(isset($data['Format']) ? trim($data['Format']) : '');
... | [
"protected",
"function",
"createReceiveVoiceMsg",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"new",
"WxReceiveVoiceMsg",
"(",
")",
";",
"$",
"this",
"->",
"initReceiveMsg",
"(",
"$",
"result",
",",
"$",
"data",
")",
";",
"$",
"result",
"->"... | create Voice msg
@param array $data
@return WxReceiveVoiceMsg | [
"create",
"Voice",
"msg"
] | e7854a193c4d23cc9b84afa465f4706c09e7e7c5 | https://github.com/flavorzyb/wechat/blob/e7854a193c4d23cc9b84afa465f4706c09e7e7c5/src/Message/Parser.php#L165-L172 |
11,748 | Palmabit-IT/authenticator | src/Palmabit/Authentication/Helpers/FileRouteHelper.php | FileRouteHelper.getPermFromRoute | public function getPermFromRoute($route) {
$menu_info = Config::get($this->config_path);
foreach ($menu_info as $menu) {
if ($menu[$this->route_variable_index] == $route) {
return $menu[$this->pemissions_variable_index];
}
}
} | php | public function getPermFromRoute($route) {
$menu_info = Config::get($this->config_path);
foreach ($menu_info as $menu) {
if ($menu[$this->route_variable_index] == $route) {
return $menu[$this->pemissions_variable_index];
}
}
} | [
"public",
"function",
"getPermFromRoute",
"(",
"$",
"route",
")",
"{",
"$",
"menu_info",
"=",
"Config",
"::",
"get",
"(",
"$",
"this",
"->",
"config_path",
")",
";",
"foreach",
"(",
"$",
"menu_info",
"as",
"$",
"menu",
")",
"{",
"if",
"(",
"$",
"menu... | Obtain the permissions from a given url
@param $url
@return mixed | [
"Obtain",
"the",
"permissions",
"from",
"a",
"given",
"url"
] | 986cfc7e666e0e1b0312e518d586ec61b08cdb42 | https://github.com/Palmabit-IT/authenticator/blob/986cfc7e666e0e1b0312e518d586ec61b08cdb42/src/Palmabit/Authentication/Helpers/FileRouteHelper.php#L35-L43 |
11,749 | Flowpack/Flowpack.SingleSignOn.DemoInstance | Classes/Flowpack/SingleSignOn/DemoInstance/ViewHelpers/Security/AccountViewHelper.php | AccountViewHelper.render | public function render($as) {
$this->templateVariableContainer->add($as, $this->securityContext->getAccount());
$result = $this->renderChildren();
$this->templateVariableContainer->remove($as);
return $result;
} | php | public function render($as) {
$this->templateVariableContainer->add($as, $this->securityContext->getAccount());
$result = $this->renderChildren();
$this->templateVariableContainer->remove($as);
return $result;
} | [
"public",
"function",
"render",
"(",
"$",
"as",
")",
"{",
"$",
"this",
"->",
"templateVariableContainer",
"->",
"add",
"(",
"$",
"as",
",",
"$",
"this",
"->",
"securityContext",
"->",
"getAccount",
"(",
")",
")",
";",
"$",
"result",
"=",
"$",
"this",
... | Assign the authenticated account to a template variable
@param string $as Variable name for the account
@return mixed | [
"Assign",
"the",
"authenticated",
"account",
"to",
"a",
"template",
"variable"
] | a3de8fef092cec34e2577832576e32b37ca507c5 | https://github.com/Flowpack/Flowpack.SingleSignOn.DemoInstance/blob/a3de8fef092cec34e2577832576e32b37ca507c5/Classes/Flowpack/SingleSignOn/DemoInstance/ViewHelpers/Security/AccountViewHelper.php#L27-L32 |
11,750 | marcqualie/mongominify | src/MongoMinify/Query.php | Query.isSequentialArray | public function isSequentialArray($array)
{
$counter = 0;
foreach ($array as $key => $value) {
if ($counter !== $key) {
return false;
}
$counter++;
}
return true;
} | php | public function isSequentialArray($array)
{
$counter = 0;
foreach ($array as $key => $value) {
if ($counter !== $key) {
return false;
}
$counter++;
}
return true;
} | [
"public",
"function",
"isSequentialArray",
"(",
"$",
"array",
")",
"{",
"$",
"counter",
"=",
"0",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"counter",
"!==",
"$",
"key",
")",
"{",
"return",
... | Check if this array is sequential | [
"Check",
"if",
"this",
"array",
"is",
"sequential"
] | 63240a91431e09279009235596bfc7f67636b269 | https://github.com/marcqualie/mongominify/blob/63240a91431e09279009235596bfc7f67636b269/src/MongoMinify/Query.php#L152-L163 |
11,751 | black-forest/piwik-bundle | src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikPlugin.php | PiwikPlugin.setVisitPlugin | public function setVisitPlugin(\BlackForest\PiwikBundle\Entity\PiwikVisitPlugin $visitPlugin = null)
{
$this->visitPlugin = $visitPlugin;
return $this;
} | php | public function setVisitPlugin(\BlackForest\PiwikBundle\Entity\PiwikVisitPlugin $visitPlugin = null)
{
$this->visitPlugin = $visitPlugin;
return $this;
} | [
"public",
"function",
"setVisitPlugin",
"(",
"\\",
"BlackForest",
"\\",
"PiwikBundle",
"\\",
"Entity",
"\\",
"PiwikVisitPlugin",
"$",
"visitPlugin",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"visitPlugin",
"=",
"$",
"visitPlugin",
";",
"return",
"$",
"this",
... | Set visitPlugin.
@param \BlackForest\PiwikBundle\Entity\PiwikVisitPlugin|null $visitPlugin
@return PiwikPlugin | [
"Set",
"visitPlugin",
"."
] | be1000f898f9583bb4ecbe4ca1933ab7b7e0e785 | https://github.com/black-forest/piwik-bundle/blob/be1000f898f9583bb4ecbe4ca1933ab7b7e0e785/src/Resources/doctrine/BlackForest/PiwikBundle/Entity/PiwikPlugin.php#L224-L229 |
11,752 | bishopb/vanilla | applications/dashboard/controllers/class.importcontroller.php | ImportController.Export | public function Export() {
$this->Permission('Garden.Export'); // This permission doesn't exist, so only users with Admin == '1' will succeed.
set_time_limit(60*2);
$Ex = new ExportModel();
$Ex->PDO(Gdn::Database()->Connection());
$Ex->Prefix = Gdn::Database()->DatabasePrefix;
... | php | public function Export() {
$this->Permission('Garden.Export'); // This permission doesn't exist, so only users with Admin == '1' will succeed.
set_time_limit(60*2);
$Ex = new ExportModel();
$Ex->PDO(Gdn::Database()->Connection());
$Ex->Prefix = Gdn::Database()->DatabasePrefix;
... | [
"public",
"function",
"Export",
"(",
")",
"{",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Export'",
")",
";",
"// This permission doesn't exist, so only users with Admin == '1' will succeed.\r",
"set_time_limit",
"(",
"60",
"*",
"2",
")",
";",
"$",
"Ex",
"=",
"n... | Export core Vanilla and Conversations tables.
@since 2.0.0
@access public | [
"Export",
"core",
"Vanilla",
"and",
"Conversations",
"tables",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.importcontroller.php#L34-L59 |
11,753 | bishopb/vanilla | applications/dashboard/controllers/class.importcontroller.php | ImportController.Go | public function Go() {
$this->Permission('Garden.Settings.Manage');
$Imp = new ImportModel();
$Imp->LoadState();
$this->SetData('Steps', $Imp->Steps());
$this->Form = new Gdn_Form();
if($Imp->CurrentStep < 1) {
// Check for the import file.
if($... | php | public function Go() {
$this->Permission('Garden.Settings.Manage');
$Imp = new ImportModel();
$Imp->LoadState();
$this->SetData('Steps', $Imp->Steps());
$this->Form = new Gdn_Form();
if($Imp->CurrentStep < 1) {
// Check for the import file.
if($... | [
"public",
"function",
"Go",
"(",
")",
"{",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"$",
"Imp",
"=",
"new",
"ImportModel",
"(",
")",
";",
"$",
"Imp",
"->",
"LoadState",
"(",
")",
";",
"$",
"this",
"->",
"SetData",
"... | Manage importing process.
@since 2.0.0
@access public | [
"Manage",
"importing",
"process",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.importcontroller.php#L67-L122 |
11,754 | bishopb/vanilla | applications/dashboard/controllers/class.importcontroller.php | ImportController.Restart | public function Restart() {
$this->Permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.
// Delete the individual table files.
$Imp = new ImportModel();
try {
$Imp->LoadState();
$Imp->DeleteFiles();
} catch(E... | php | public function Restart() {
$this->Permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.
// Delete the individual table files.
$Imp = new ImportModel();
try {
$Imp->LoadState();
$Imp->DeleteFiles();
} catch(E... | [
"public",
"function",
"Restart",
"(",
")",
"{",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Import'",
")",
";",
"// This permission doesn't exist, so only users with Admin == '1' will succeed.\r",
"// Delete the individual table files.\r",
"$",
"Imp",
"=",
"new",
"ImportMo... | Restart the import process. Undo any work we've done so far and erase state.
@since 2.0.0
@access public | [
"Restart",
"the",
"import",
"process",
".",
"Undo",
"any",
"work",
"we",
"ve",
"done",
"so",
"far",
"and",
"erase",
"state",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/controllers/class.importcontroller.php#L244-L257 |
11,755 | silverstripe-modular-project/silverstripe-placeable | code/models/PlaceableObject_Preset.php | PlaceableObject_Preset.getPlaceableObject | public function getPlaceableObject()
{
if ($this->placeableobject) {
return $this->placeableobject;
}
$instance = Injector::inst()->get($this->ObjectClassName);
$this->placeableobject = $instance;
return $instance;
} | php | public function getPlaceableObject()
{
if ($this->placeableobject) {
return $this->placeableobject;
}
$instance = Injector::inst()->get($this->ObjectClassName);
$this->placeableobject = $instance;
return $instance;
} | [
"public",
"function",
"getPlaceableObject",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"placeableobject",
")",
"{",
"return",
"$",
"this",
"->",
"placeableobject",
";",
"}",
"$",
"instance",
"=",
"Injector",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
... | Gets a class instance of PlaceableObject
@return string | [
"Gets",
"a",
"class",
"instance",
"of",
"PlaceableObject"
] | 8ac5891493e5af2efaab7afa93ef2d1c1bea946f | https://github.com/silverstripe-modular-project/silverstripe-placeable/blob/8ac5891493e5af2efaab7afa93ef2d1c1bea946f/code/models/PlaceableObject_Preset.php#L160-L168 |
11,756 | silverstripe-modular-project/silverstripe-placeable | code/models/PlaceableObject_Preset.php | PlaceableObject_Preset.getSubClassNames | public function getSubClassNames()
{
$classes = array();
$killAncestors = array();
// make it easier to unset values
foreach(ClassInfo::subclassesFor($this->ClassName) as $class) {
$classes[$class] = $class;
}
unset(
$classes['PlaceableObject_... | php | public function getSubClassNames()
{
$classes = array();
$killAncestors = array();
// make it easier to unset values
foreach(ClassInfo::subclassesFor($this->ClassName) as $class) {
$classes[$class] = $class;
}
unset(
$classes['PlaceableObject_... | [
"public",
"function",
"getSubClassNames",
"(",
")",
"{",
"$",
"classes",
"=",
"array",
"(",
")",
";",
"$",
"killAncestors",
"=",
"array",
"(",
")",
";",
"// make it easier to unset values",
"foreach",
"(",
"ClassInfo",
"::",
"subclassesFor",
"(",
"$",
"this",
... | Get available sub classes from current class
@return array | [
"Get",
"available",
"sub",
"classes",
"from",
"current",
"class"
] | 8ac5891493e5af2efaab7afa93ef2d1c1bea946f | https://github.com/silverstripe-modular-project/silverstripe-placeable/blob/8ac5891493e5af2efaab7afa93ef2d1c1bea946f/code/models/PlaceableObject_Preset.php#L174-L218 |
11,757 | silverstripe-modular-project/silverstripe-placeable | code/models/PlaceableObject_Preset.php | PlaceableObject_Preset.getStyles | public function getStyles()
{
$styles = $this->config()->get('styles');
$i18nStyles = array();
if ($styles) {
foreach ($styles as $key => $label) {
$i18nStyles[$key] = _t('PlaceableObject_Preset.STYLE'.strtoupper($key), $label);
}
}
ret... | php | public function getStyles()
{
$styles = $this->config()->get('styles');
$i18nStyles = array();
if ($styles) {
foreach ($styles as $key => $label) {
$i18nStyles[$key] = _t('PlaceableObject_Preset.STYLE'.strtoupper($key), $label);
}
}
ret... | [
"public",
"function",
"getStyles",
"(",
")",
"{",
"$",
"styles",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"get",
"(",
"'styles'",
")",
";",
"$",
"i18nStyles",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"styles",
")",
"{",
"foreach",
"(... | Get available template styles from config
@return array | [
"Get",
"available",
"template",
"styles",
"from",
"config"
] | 8ac5891493e5af2efaab7afa93ef2d1c1bea946f | https://github.com/silverstripe-modular-project/silverstripe-placeable/blob/8ac5891493e5af2efaab7afa93ef2d1c1bea946f/code/models/PlaceableObject_Preset.php#L262-L272 |
11,758 | phlexible/phlexible | src/Phlexible/Bundle/MessageBundle/Digest/Digest.php | Digest.sendDigestMails | public function sendDigestMails()
{
$subscriptionRepository = $this->entityManager->getRepository('PhlexibleMessageBundle:Subscription');
$subscriptions = $subscriptionRepository->findByHandler('digest');
$digests = [];
foreach ($subscriptions as $subscription) {
$filter... | php | public function sendDigestMails()
{
$subscriptionRepository = $this->entityManager->getRepository('PhlexibleMessageBundle:Subscription');
$subscriptions = $subscriptionRepository->findByHandler('digest');
$digests = [];
foreach ($subscriptions as $subscription) {
$filter... | [
"public",
"function",
"sendDigestMails",
"(",
")",
"{",
"$",
"subscriptionRepository",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"getRepository",
"(",
"'PhlexibleMessageBundle:Subscription'",
")",
";",
"$",
"subscriptions",
"=",
"$",
"subscriptionRepository",
"->... | Static send function for use with events.
@return array | [
"Static",
"send",
"function",
"for",
"use",
"with",
"events",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/MessageBundle/Digest/Digest.php#L88-L142 |
11,759 | mimmi20/ua-result-company | src/CompanyLoader.php | CompanyLoader.load | public function load(string $key): CompanyInterface
{
if (!$this->has($key)) {
throw new NotFoundException('the company with key "' . $key . '" was not found');
}
$company = $this->companies[$key];
return new Company(
$key,
$company['name'],
... | php | public function load(string $key): CompanyInterface
{
if (!$this->has($key)) {
throw new NotFoundException('the company with key "' . $key . '" was not found');
}
$company = $this->companies[$key];
return new Company(
$key,
$company['name'],
... | [
"public",
"function",
"load",
"(",
"string",
"$",
"key",
")",
":",
"CompanyInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"NotFoundException",
"(",
"'the company with key \"'",
".",
"$",
"key",
... | Gets the information about the company
@param string $key
@throws \BrowserDetector\Loader\NotFoundException
@return \UaResult\Company\CompanyInterface | [
"Gets",
"the",
"information",
"about",
"the",
"company"
] | 16d4454169c004ddb1d00ad736d9296cecafd002 | https://github.com/mimmi20/ua-result-company/blob/16d4454169c004ddb1d00ad736d9296cecafd002/src/CompanyLoader.php#L91-L104 |
11,760 | phlexible/phlexible | src/Phlexible/Bundle/GuiBundle/Properties/Properties.php | Properties.remove | public function remove($component, $name)
{
$this->load();
$propertyKey = sprintf('%s__%s', $component, $name);
if (isset($this->properties[$propertyKey])) {
$this->entityManager->remove($this->properties[$propertyKey]);
unset($this->properties[$propertyKey]);
... | php | public function remove($component, $name)
{
$this->load();
$propertyKey = sprintf('%s__%s', $component, $name);
if (isset($this->properties[$propertyKey])) {
$this->entityManager->remove($this->properties[$propertyKey]);
unset($this->properties[$propertyKey]);
... | [
"public",
"function",
"remove",
"(",
"$",
"component",
",",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"$",
"propertyKey",
"=",
"sprintf",
"(",
"'%s__%s'",
",",
"$",
"component",
",",
"$",
"name",
")",
";",
"if",
"(",
"isset",... | Remove property.
@param string $component
@param string $name
@return $this | [
"Remove",
"property",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/GuiBundle/Properties/Properties.php#L105-L117 |
11,761 | phlexible/phlexible | src/Phlexible/Bundle/GuiBundle/Properties/Properties.php | Properties.has | public function has($component, $name)
{
$this->load();
return (bool) mb_strlen($this->get($component, $name));
} | php | public function has($component, $name)
{
$this->load();
return (bool) mb_strlen($this->get($component, $name));
} | [
"public",
"function",
"has",
"(",
"$",
"component",
",",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"load",
"(",
")",
";",
"return",
"(",
"bool",
")",
"mb_strlen",
"(",
"$",
"this",
"->",
"get",
"(",
"$",
"component",
",",
"$",
"name",
")",
")",
... | Is property set?
@param string $component
@param string $name
@return bool | [
"Is",
"property",
"set?"
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/GuiBundle/Properties/Properties.php#L127-L132 |
11,762 | oyjz/phpQuery-single | phpQuery.php | DOMDocumentWrapper.documentFragmentCreate | protected function documentFragmentCreate($source, $charset = null)
{
$fake = new DOMDocumentWrapper();
$fake->contentType = $this->contentType;
$fake->isXML = $this->isXML;
$fake->isHTML = $this->isHTML;
$fake->isXHTML = $this->isXHTML;
$f... | php | protected function documentFragmentCreate($source, $charset = null)
{
$fake = new DOMDocumentWrapper();
$fake->contentType = $this->contentType;
$fake->isXML = $this->isXML;
$fake->isHTML = $this->isHTML;
$fake->isXHTML = $this->isXHTML;
$f... | [
"protected",
"function",
"documentFragmentCreate",
"(",
"$",
"source",
",",
"$",
"charset",
"=",
"null",
")",
"{",
"$",
"fake",
"=",
"new",
"DOMDocumentWrapper",
"(",
")",
";",
"$",
"fake",
"->",
"contentType",
"=",
"$",
"this",
"->",
"contentType",
";",
... | Creates new document fragment.
@param $source
@return DOMDocumentWrapper | bool | [
"Creates",
"new",
"document",
"fragment",
"."
] | d91fafb8aa75a9080640c4b96f592785da557d0d | https://github.com/oyjz/phpQuery-single/blob/d91fafb8aa75a9080640c4b96f592785da557d0d/phpQuery.php#L703-L733 |
11,763 | rozaverta/cmf | core/Language/Lang.php | Lang.reload | public function reload( string $language ): bool
{
$language = trim( $language );
if( ! self::valid($language) )
{
return false;
}
if( $this->language === $language && $this->lang_init )
{
return true;
}
$packages = is_null($this->lang) ? [] : $this->lang->packages();
$this->language = $langu... | php | public function reload( string $language ): bool
{
$language = trim( $language );
if( ! self::valid($language) )
{
return false;
}
if( $this->language === $language && $this->lang_init )
{
return true;
}
$packages = is_null($this->lang) ? [] : $this->lang->packages();
$this->language = $langu... | [
"public",
"function",
"reload",
"(",
"string",
"$",
"language",
")",
":",
"bool",
"{",
"$",
"language",
"=",
"trim",
"(",
"$",
"language",
")",
";",
"if",
"(",
"!",
"self",
"::",
"valid",
"(",
"$",
"language",
")",
")",
"{",
"return",
"false",
";",... | Set new language key and reload all packages
@param string $language
@return bool | [
"Set",
"new",
"language",
"key",
"and",
"reload",
"all",
"packages"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Language/Lang.php#L131-L177 |
11,764 | rozaverta/cmf | core/Language/Lang.php | Lang.getProxy | public function getProxy( string $context ): ThenProxy
{
if( isset($this->proxy[$context]) )
{
return $this->proxy[$context];
}
if( !$this->lang->load($context) )
{
throw new \InvalidArgumentException("Cannot load the '{$context}' language package");
}
$this->proxy[$context] = new ThenProxy($this... | php | public function getProxy( string $context ): ThenProxy
{
if( isset($this->proxy[$context]) )
{
return $this->proxy[$context];
}
if( !$this->lang->load($context) )
{
throw new \InvalidArgumentException("Cannot load the '{$context}' language package");
}
$this->proxy[$context] = new ThenProxy($this... | [
"public",
"function",
"getProxy",
"(",
"string",
"$",
"context",
")",
":",
"ThenProxy",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"proxy",
"[",
"$",
"context",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"proxy",
"[",
"$",
"context",
"]... | Get the language package proxy
@param string $context
@return ThenProxy | [
"Get",
"the",
"language",
"package",
"proxy"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Language/Lang.php#L197-L211 |
11,765 | rozaverta/cmf | core/Language/Lang.php | Lang.replace | public function replace( string $text, ... $replace ): string
{
$then = $this->package_context;
return $this->format(
$this->line($text),
$then,
count($replace) === 1 && is_array($replace[0]) ? $replace[0] : $replace
);
} | php | public function replace( string $text, ... $replace ): string
{
$then = $this->package_context;
return $this->format(
$this->line($text),
$then,
count($replace) === 1 && is_array($replace[0]) ? $replace[0] : $replace
);
} | [
"public",
"function",
"replace",
"(",
"string",
"$",
"text",
",",
"...",
"$",
"replace",
")",
":",
"string",
"{",
"$",
"then",
"=",
"$",
"this",
"->",
"package_context",
";",
"return",
"$",
"this",
"->",
"format",
"(",
"$",
"this",
"->",
"line",
"(",... | Get line and replace values
@param string $text
@param array ...$replace
@return string | [
"Get",
"line",
"and",
"replace",
"values"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Language/Lang.php#L244-L252 |
11,766 | rozaverta/cmf | core/Language/Lang.php | Lang.text | public function text( string $text ): string
{
$then = $this->getThen();
if( $this->lang_text )
{
return $this->lang->text($text, $then);
}
else
{
return $text;
}
} | php | public function text( string $text ): string
{
$then = $this->getThen();
if( $this->lang_text )
{
return $this->lang->text($text, $then);
}
else
{
return $text;
}
} | [
"public",
"function",
"text",
"(",
"string",
"$",
"text",
")",
":",
"string",
"{",
"$",
"then",
"=",
"$",
"this",
"->",
"getThen",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"lang_text",
")",
"{",
"return",
"$",
"this",
"->",
"lang",
"->",
"tex... | Get text block
@param string $text
@return string | [
"Get",
"text",
"block"
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Language/Lang.php#L302-L313 |
11,767 | crip-laravel/core | src/Helpers/FileSystem.php | FileSystem.canonical | public static function canonical($path)
{
$path = self::split($path);
$canon = [];
foreach ($path as $segment) {
if ($segment === '..') {
array_pop($canon);
} elseif ($segment !== '.') {
$canon[] = $segment;
}
}
... | php | public static function canonical($path)
{
$path = self::split($path);
$canon = [];
foreach ($path as $segment) {
if ($segment === '..') {
array_pop($canon);
} elseif ($segment !== '.') {
$canon[] = $segment;
}
}
... | [
"public",
"static",
"function",
"canonical",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"split",
"(",
"$",
"path",
")",
";",
"$",
"canon",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"path",
"as",
"$",
"segment",
")",
"{",
"if",
"... | Canonicalizes the file system path. Always remove slash from the end.
@param string $path The path to canoncalize.
@return string The canoncalized path. | [
"Canonicalizes",
"the",
"file",
"system",
"path",
".",
"Always",
"remove",
"slash",
"from",
"the",
"end",
"."
] | d58cef97d97fba8b01bec33801452ecbd7c992de | https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Helpers/FileSystem.php#L45-L62 |
11,768 | crip-laravel/core | src/Helpers/FileSystem.php | FileSystem.trimFileName | public static function trimFileName($path)
{
$name = static::nameFromPath($path);
return substr($path, 0, strlen($path) - strlen($name));
} | php | public static function trimFileName($path)
{
$name = static::nameFromPath($path);
return substr($path, 0, strlen($path) - strlen($name));
} | [
"public",
"static",
"function",
"trimFileName",
"(",
"$",
"path",
")",
"{",
"$",
"name",
"=",
"static",
"::",
"nameFromPath",
"(",
"$",
"path",
")",
";",
"return",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"strlen",
"(",
"$",
"path",
")",
"-",
"st... | Trim file name from provided path
@param string $path
@return string | [
"Trim",
"file",
"name",
"from",
"provided",
"path"
] | d58cef97d97fba8b01bec33801452ecbd7c992de | https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Helpers/FileSystem.php#L127-L132 |
11,769 | crip-laravel/core | src/Helpers/FileSystem.php | FileSystem.splitNameFromPath | public static function splitNameFromPath($path)
{
$name = static::nameFromPath($path);
$path = static::trimFileName($path);
return [$path, $name];
} | php | public static function splitNameFromPath($path)
{
$name = static::nameFromPath($path);
$path = static::trimFileName($path);
return [$path, $name];
} | [
"public",
"static",
"function",
"splitNameFromPath",
"(",
"$",
"path",
")",
"{",
"$",
"name",
"=",
"static",
"::",
"nameFromPath",
"(",
"$",
"path",
")",
";",
"$",
"path",
"=",
"static",
"::",
"trimFileName",
"(",
"$",
"path",
")",
";",
"return",
"[",
... | Get the path separate from name
@param string $path
@return array | [
"Get",
"the",
"path",
"separate",
"from",
"name"
] | d58cef97d97fba8b01bec33801452ecbd7c992de | https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Helpers/FileSystem.php#L141-L147 |
11,770 | crip-laravel/core | src/Helpers/FileSystem.php | FileSystem.deleteDirectory | public static function deleteDirectory($path)
{
if (!is_dir($path)) {
return false;
}
$files = array_diff(scandir($path), ['.', '..']);
foreach ($files as $file) {
$inner_file = static::join($path, $file);
if (is_dir($inner_file)) {
... | php | public static function deleteDirectory($path)
{
if (!is_dir($path)) {
return false;
}
$files = array_diff(scandir($path), ['.', '..']);
foreach ($files as $file) {
$inner_file = static::join($path, $file);
if (is_dir($inner_file)) {
... | [
"public",
"static",
"function",
"deleteDirectory",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"files",
"=",
"array_diff",
"(",
"scandir",
"(",
"$",
"path",
")",
",",
"[",... | Delete directory recursive
@param string $path
@return bool | [
"Delete",
"directory",
"recursive"
] | d58cef97d97fba8b01bec33801452ecbd7c992de | https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Helpers/FileSystem.php#L197-L216 |
11,771 | crip-laravel/core | src/Helpers/FileSystem.php | FileSystem.dirSize | public static function dirSize($path, array $exclude = [])
{
if (!is_dir($path)) {
return 0;
}
$size = 0;
$exclude = array_merge(['.', '..'], $exclude);
$items = array_diff(scandir($path), $exclude);
foreach ($items as $item) {
$inner_item = s... | php | public static function dirSize($path, array $exclude = [])
{
if (!is_dir($path)) {
return 0;
}
$size = 0;
$exclude = array_merge(['.', '..'], $exclude);
$items = array_diff(scandir($path), $exclude);
foreach ($items as $item) {
$inner_item = s... | [
"public",
"static",
"function",
"dirSize",
"(",
"$",
"path",
",",
"array",
"$",
"exclude",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"return",
"0",
";",
"}",
"$",
"size",
"=",
"0",
";",
"$",
"exclude",
... | Calculate directory size including sub-folders
@param string $path
@param array $exclude
@return int | [
"Calculate",
"directory",
"size",
"including",
"sub",
"-",
"folders"
] | d58cef97d97fba8b01bec33801452ecbd7c992de | https://github.com/crip-laravel/core/blob/d58cef97d97fba8b01bec33801452ecbd7c992de/src/Helpers/FileSystem.php#L226-L241 |
11,772 | anklimsk/cakephp-basic-functions | Vendor/langcode-conv/zendframework/zend-filter/src/StringTrim.php | StringTrim.setCharList | public function setCharList($charList)
{
if (! strlen($charList)) {
$charList = null;
}
$this->options['charlist'] = $charList;
return $this;
} | php | public function setCharList($charList)
{
if (! strlen($charList)) {
$charList = null;
}
$this->options['charlist'] = $charList;
return $this;
} | [
"public",
"function",
"setCharList",
"(",
"$",
"charList",
")",
"{",
"if",
"(",
"!",
"strlen",
"(",
"$",
"charList",
")",
")",
"{",
"$",
"charList",
"=",
"null",
";",
"}",
"$",
"this",
"->",
"options",
"[",
"'charlist'",
"]",
"=",
"$",
"charList",
... | Sets the charList option
@param string $charList
@return self Provides a fluent interface | [
"Sets",
"the",
"charList",
"option"
] | 7554e8b0b420fd3155593af7bf76b7ccbdc8701e | https://github.com/anklimsk/cakephp-basic-functions/blob/7554e8b0b420fd3155593af7bf76b7ccbdc8701e/Vendor/langcode-conv/zendframework/zend-filter/src/StringTrim.php#L45-L54 |
11,773 | ehough/shortstop | src/main/php/ehough/shortstop/impl/DefaultHttpClient.php | ehough_shortstop_impl_DefaultHttpClient.execute | public final function execute(ehough_shortstop_api_HttpRequest $request)
{
/**
* Fire request event.
*/
$requestEvent = new ehough_tickertape_GenericEvent($request);
$this->_eventDispatcher->dispatch(ehough_shortstop_api_Events::REQUEST, $requestEvent);
/**
... | php | public final function execute(ehough_shortstop_api_HttpRequest $request)
{
/**
* Fire request event.
*/
$requestEvent = new ehough_tickertape_GenericEvent($request);
$this->_eventDispatcher->dispatch(ehough_shortstop_api_Events::REQUEST, $requestEvent);
/**
... | [
"public",
"final",
"function",
"execute",
"(",
"ehough_shortstop_api_HttpRequest",
"$",
"request",
")",
"{",
"/**\n * Fire request event.\n */",
"$",
"requestEvent",
"=",
"new",
"ehough_tickertape_GenericEvent",
"(",
"$",
"request",
")",
";",
"$",
"this",
... | Execute a given HTTP request.
@param ehough_shortstop_api_HttpRequest $request The HTTP request.
@throws ehough_shortstop_api_exception_RuntimeException If something goes wrong.
@return ehough_shortstop_api_HttpResponse The HTTP response. | [
"Execute",
"a",
"given",
"HTTP",
"request",
"."
] | 4cef21457741347546c70e8e5c0cef6d3162b257 | https://github.com/ehough/shortstop/blob/4cef21457741347546c70e8e5c0cef6d3162b257/src/main/php/ehough/shortstop/impl/DefaultHttpClient.php#L47-L78 |
11,774 | chippyash/Validation | src/Chippyash/Validation/Common/ISO8601/SplitDate.php | SplitDate.splitDate | public function splitDate($value)
{
$parts = Match::on($this->laxTime)
->test(true, function () use ($value) {
$parts = explode(' ', $value);
//join back zone part if found
if (count($parts) == 3) {
$parts[1] .= ' ' . $parts[2];... | php | public function splitDate($value)
{
$parts = Match::on($this->laxTime)
->test(true, function () use ($value) {
$parts = explode(' ', $value);
//join back zone part if found
if (count($parts) == 3) {
$parts[1] .= ' ' . $parts[2];... | [
"public",
"function",
"splitDate",
"(",
"$",
"value",
")",
"{",
"$",
"parts",
"=",
"Match",
"::",
"on",
"(",
"$",
"this",
"->",
"laxTime",
")",
"->",
"test",
"(",
"true",
",",
"function",
"(",
")",
"use",
"(",
"$",
"value",
")",
"{",
"$",
"parts"... | Split date by its parts
@param string $value ISO datetime string
@return array[date, time, zone, timePartFound] | [
"Split",
"date",
"by",
"its",
"parts"
] | 8e2373ce968e84077f67101404ea74b997e3ccf3 | https://github.com/chippyash/Validation/blob/8e2373ce968e84077f67101404ea74b997e3ccf3/src/Chippyash/Validation/Common/ISO8601/SplitDate.php#L67-L105 |
11,775 | chippyash/Validation | src/Chippyash/Validation/Common/ISO8601/SplitDate.php | SplitDate.splitTime | protected function splitTime($value)
{
//guard
if (empty($value)) {
return array(null, null);
}
//try to find zone, z == UTC
$partsZ = explode('z', $value);
$partsM = explode('-', $value);
$partsP = explode('+', $value);
if ($this->laxZone... | php | protected function splitTime($value)
{
//guard
if (empty($value)) {
return array(null, null);
}
//try to find zone, z == UTC
$partsZ = explode('z', $value);
$partsM = explode('-', $value);
$partsP = explode('+', $value);
if ($this->laxZone... | [
"protected",
"function",
"splitTime",
"(",
"$",
"value",
")",
"{",
"//guard",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"return",
"array",
"(",
"null",
",",
"null",
")",
";",
"}",
"//try to find zone, z == UTC",
"$",
"partsZ",
"=",
"explode",... | Split timezone by its parts
@param string $value
@return array[time, zone] | [
"Split",
"timezone",
"by",
"its",
"parts"
] | 8e2373ce968e84077f67101404ea74b997e3ccf3 | https://github.com/chippyash/Validation/blob/8e2373ce968e84077f67101404ea74b997e3ccf3/src/Chippyash/Validation/Common/ISO8601/SplitDate.php#L113-L154 |
11,776 | chippyash/Validation | src/Chippyash/Validation/Common/ISO8601/SplitDate.php | SplitDate.getUTCTimezone | protected function getUTCTimezone()
{
if (\date_default_timezone_get() == 'UTC') {
return 'UTC'; //already in UTC. workaround as zone must be non empty
}
$timezone = new \DateTimeZone(\date_default_timezone_get()); // Get default system timezone to create a new DateTime... | php | protected function getUTCTimezone()
{
if (\date_default_timezone_get() == 'UTC') {
return 'UTC'; //already in UTC. workaround as zone must be non empty
}
$timezone = new \DateTimeZone(\date_default_timezone_get()); // Get default system timezone to create a new DateTime... | [
"protected",
"function",
"getUTCTimezone",
"(",
")",
"{",
"if",
"(",
"\\",
"date_default_timezone_get",
"(",
")",
"==",
"'UTC'",
")",
"{",
"return",
"'UTC'",
";",
"//already in UTC. workaround as zone must be non empty",
"}",
"$",
"timezone",
"=",
"new",
"\\",
"Da... | Get current UTC timezone offset
@return string|null | [
"Get",
"current",
"UTC",
"timezone",
"offset"
] | 8e2373ce968e84077f67101404ea74b997e3ccf3 | https://github.com/chippyash/Validation/blob/8e2373ce968e84077f67101404ea74b997e3ccf3/src/Chippyash/Validation/Common/ISO8601/SplitDate.php#L161-L177 |
11,777 | eix/core | src/php/main/Eix/Services/Identity/Providers/OpenId.php | OpenId.authenticate | public function authenticate()
{
Logger::get()->debug('Authenticating OpenID user...');
if (!$this->isAuthenticated) {
if (!static::getConsumer()->validate()) {
Logger::get()->debug(' Failed!');
throw new NotAuthenticatedException('OpenID authentication failed.... | php | public function authenticate()
{
Logger::get()->debug('Authenticating OpenID user...');
if (!$this->isAuthenticated) {
if (!static::getConsumer()->validate()) {
Logger::get()->debug(' Failed!');
throw new NotAuthenticatedException('OpenID authentication failed.... | [
"public",
"function",
"authenticate",
"(",
")",
"{",
"Logger",
"::",
"get",
"(",
")",
"->",
"debug",
"(",
"'Authenticating OpenID user...'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isAuthenticated",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"getCon... | Makes sure the user is authenticated. If not, an exception is thrown.
@throws NotAuthenticatedException | [
"Makes",
"sure",
"the",
"user",
"is",
"authenticated",
".",
"If",
"not",
"an",
"exception",
"is",
"thrown",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Services/Identity/Providers/OpenId.php#L49-L62 |
11,778 | nattreid/tracy-plugin | src/Tracy.php | Tracy.setMail | public function setMail(string $mailPath, bool $mailPanel): void
{
$this->mailPath = $mailPath;
$this->mailPanel = $mailPanel;
} | php | public function setMail(string $mailPath, bool $mailPanel): void
{
$this->mailPath = $mailPath;
$this->mailPanel = $mailPanel;
} | [
"public",
"function",
"setMail",
"(",
"string",
"$",
"mailPath",
",",
"bool",
"$",
"mailPanel",
")",
":",
"void",
"{",
"$",
"this",
"->",
"mailPath",
"=",
"$",
"mailPath",
";",
"$",
"this",
"->",
"mailPanel",
"=",
"$",
"mailPanel",
";",
"}"
] | Nastavi mail panel
@param string $mailPath
@param bool $mailPanel | [
"Nastavi",
"mail",
"panel"
] | 05ff14c52112b5b2c92fb82d8cf8eeb041bd1300 | https://github.com/nattreid/tracy-plugin/blob/05ff14c52112b5b2c92fb82d8cf8eeb041bd1300/src/Tracy.php#L61-L65 |
11,779 | nattreid/tracy-plugin | src/Tracy.php | Tracy.enable | public function enable(): void
{
$this->response->setCookie(Configurator::COOKIE_SECRET, $this->cookie, strtotime('1 years'), '/', '', '', true);
$this->enable = true;
} | php | public function enable(): void
{
$this->response->setCookie(Configurator::COOKIE_SECRET, $this->cookie, strtotime('1 years'), '/', '', '', true);
$this->enable = true;
} | [
"public",
"function",
"enable",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"response",
"->",
"setCookie",
"(",
"Configurator",
"::",
"COOKIE_SECRET",
",",
"$",
"this",
"->",
"cookie",
",",
"strtotime",
"(",
"'1 years'",
")",
",",
"'/'",
",",
"''",
... | Zapnuti debug modu pomoci cookie | [
"Zapnuti",
"debug",
"modu",
"pomoci",
"cookie"
] | 05ff14c52112b5b2c92fb82d8cf8eeb041bd1300 | https://github.com/nattreid/tracy-plugin/blob/05ff14c52112b5b2c92fb82d8cf8eeb041bd1300/src/Tracy.php#L88-L92 |
11,780 | nattreid/tracy-plugin | src/Tracy.php | Tracy.disable | public function disable(): void
{
$this->response->deleteCookie(Configurator::COOKIE_SECRET);
$this->enable = false;
} | php | public function disable(): void
{
$this->response->deleteCookie(Configurator::COOKIE_SECRET);
$this->enable = false;
} | [
"public",
"function",
"disable",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"response",
"->",
"deleteCookie",
"(",
"Configurator",
"::",
"COOKIE_SECRET",
")",
";",
"$",
"this",
"->",
"enable",
"=",
"false",
";",
"}"
] | Vypnuti debug modu pomoci cookie | [
"Vypnuti",
"debug",
"modu",
"pomoci",
"cookie"
] | 05ff14c52112b5b2c92fb82d8cf8eeb041bd1300 | https://github.com/nattreid/tracy-plugin/blob/05ff14c52112b5b2c92fb82d8cf8eeb041bd1300/src/Tracy.php#L97-L101 |
11,781 | clacy-builders/xml-express-php | src/shared/ClassAttribute.php | ClassAttribute.stripes | public function stripes($classes, $column = false)
{
$count = count($classes);
$index = -1;
$prev = null;
foreach ($this->children as $i => $row) {
if ($column === false) {
$index = ++$index % $count;
}
else {
foreach ($row->children as $k => $cell) {
if ($k > $column) break;
if ($i ... | php | public function stripes($classes, $column = false)
{
$count = count($classes);
$index = -1;
$prev = null;
foreach ($this->children as $i => $row) {
if ($column === false) {
$index = ++$index % $count;
}
else {
foreach ($row->children as $k => $cell) {
if ($k > $column) break;
if ($i ... | [
"public",
"function",
"stripes",
"(",
"$",
"classes",
",",
"$",
"column",
"=",
"false",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"classes",
")",
";",
"$",
"index",
"=",
"-",
"1",
";",
"$",
"prev",
"=",
"null",
";",
"foreach",
"(",
"$",
"... | Adds alternating classes to child elements.
@param string[] $classes
@param int|false $column
@return Xml | [
"Adds",
"alternating",
"classes",
"to",
"child",
"elements",
"."
] | 9c66fd640738b0e87b05047c3f3b8f1cba8aa7e0 | https://github.com/clacy-builders/xml-express-php/blob/9c66fd640738b0e87b05047c3f3b8f1cba8aa7e0/src/shared/ClassAttribute.php#L26-L48 |
11,782 | liip/LiipDrupalEventManagerModule | src/Liip/Drupal/Modules/EventManager/SubjectFactory.php | SubjectFactory.getSubject | public function getSubject($name)
{
if (empty($this->subjects[$name])) {
$this->initSubject($name);
}
return $this->subjects[$name];
} | php | public function getSubject($name)
{
if (empty($this->subjects[$name])) {
$this->initSubject($name);
}
return $this->subjects[$name];
} | [
"public",
"function",
"getSubject",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"subjects",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"initSubject",
"(",
"$",
"name",
")",
";",
"}",
"return",
"$",
"this"... | Provides an event subject identified by the given name.
@param string $name
@return \Liip\Drupal\Modules\EventManager\EventSubject | [
"Provides",
"an",
"event",
"subject",
"identified",
"by",
"the",
"given",
"name",
"."
] | c049662aa1efaab1149d7edb0cb7bca265983571 | https://github.com/liip/LiipDrupalEventManagerModule/blob/c049662aa1efaab1149d7edb0cb7bca265983571/src/Liip/Drupal/Modules/EventManager/SubjectFactory.php#L51-L59 |
11,783 | liip/LiipDrupalEventManagerModule | src/Liip/Drupal/Modules/EventManager/SubjectFactory.php | SubjectFactory.initSubject | public function initSubject($name)
{
$this->fetchSubjectsFromRegistry($name);
try {
if (empty($this->subjects[$name])) {
$this->subjects[$name] = new EventSubject($name);
if ($this->registry->isRegistered($name)) {
// modify registr... | php | public function initSubject($name)
{
$this->fetchSubjectsFromRegistry($name);
try {
if (empty($this->subjects[$name])) {
$this->subjects[$name] = new EventSubject($name);
if ($this->registry->isRegistered($name)) {
// modify registr... | [
"public",
"function",
"initSubject",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"fetchSubjectsFromRegistry",
"(",
"$",
"name",
")",
";",
"try",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"subjects",
"[",
"$",
"name",
"]",
")",
")",
"{",
"... | Initiates and caches an event subject for later use.
@param string $name | [
"Initiates",
"and",
"caches",
"an",
"event",
"subject",
"for",
"later",
"use",
"."
] | c049662aa1efaab1149d7edb0cb7bca265983571 | https://github.com/liip/LiipDrupalEventManagerModule/blob/c049662aa1efaab1149d7edb0cb7bca265983571/src/Liip/Drupal/Modules/EventManager/SubjectFactory.php#L66-L96 |
11,784 | liip/LiipDrupalEventManagerModule | src/Liip/Drupal/Modules/EventManager/SubjectFactory.php | SubjectFactory.fetchSubjectsFromRegistry | protected function fetchSubjectsFromRegistry($name)
{
try {
$this->subjects = $this->registry->getContent();
if (!empty($this->subjects[$name])) {
$this->assertions->isInstanceOf(
$this->subjects[$name],
'\\Liip\\Drupal\\Module... | php | protected function fetchSubjectsFromRegistry($name)
{
try {
$this->subjects = $this->registry->getContent();
if (!empty($this->subjects[$name])) {
$this->assertions->isInstanceOf(
$this->subjects[$name],
'\\Liip\\Drupal\\Module... | [
"protected",
"function",
"fetchSubjectsFromRegistry",
"(",
"$",
"name",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"subjects",
"=",
"$",
"this",
"->",
"registry",
"->",
"getContent",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"subjec... | Retrieves the set of subjects from the registry currently attached.
@param string $name | [
"Retrieves",
"the",
"set",
"of",
"subjects",
"from",
"the",
"registry",
"currently",
"attached",
"."
] | c049662aa1efaab1149d7edb0cb7bca265983571 | https://github.com/liip/LiipDrupalEventManagerModule/blob/c049662aa1efaab1149d7edb0cb7bca265983571/src/Liip/Drupal/Modules/EventManager/SubjectFactory.php#L103-L128 |
11,785 | elastification/php-client | src/Repository/DocumentRepository.php | DocumentRepository.create | public function create($index, $type, $document)
{
$request = $this->createRequestInstance(self::CREATE_DOCUMENT, $index, $type);
$request->setBody($document);
return $this->client->send($request);
} | php | public function create($index, $type, $document)
{
$request = $this->createRequestInstance(self::CREATE_DOCUMENT, $index, $type);
$request->setBody($document);
return $this->client->send($request);
} | [
"public",
"function",
"create",
"(",
"$",
"index",
",",
"$",
"type",
",",
"$",
"document",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"createRequestInstance",
"(",
"self",
"::",
"CREATE_DOCUMENT",
",",
"$",
"index",
",",
"$",
"type",
")",
";",
... | creates a document
@param string $index
@param string $type
@param mixed $document
@return \Elastification\Client\Response\ResponseInterface
@author Daniel Wendlandt | [
"creates",
"a",
"document"
] | eb01be0905dd1eba7baa62f84492d82e4b3cae61 | https://github.com/elastification/php-client/blob/eb01be0905dd1eba7baa62f84492d82e4b3cae61/src/Repository/DocumentRepository.php#L34-L40 |
11,786 | elastification/php-client | src/Repository/DocumentRepository.php | DocumentRepository.delete | public function delete($index, $type, $id)
{
$request = $this->createRequestInstance(self::DELETE_DOCUMENT, $index, $type);
$request->setId($id);
return $this->client->send($request);
} | php | public function delete($index, $type, $id)
{
$request = $this->createRequestInstance(self::DELETE_DOCUMENT, $index, $type);
$request->setId($id);
return $this->client->send($request);
} | [
"public",
"function",
"delete",
"(",
"$",
"index",
",",
"$",
"type",
",",
"$",
"id",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"createRequestInstance",
"(",
"self",
"::",
"DELETE_DOCUMENT",
",",
"$",
"index",
",",
"$",
"type",
")",
";",
"$",
... | Deletes a document by id
@param string $index
@param string $type
@param string $id
@return \Elastification\Client\Response\ResponseInterface
@author Daniel Wendlandt | [
"Deletes",
"a",
"document",
"by",
"id"
] | eb01be0905dd1eba7baa62f84492d82e4b3cae61 | https://github.com/elastification/php-client/blob/eb01be0905dd1eba7baa62f84492d82e4b3cae61/src/Repository/DocumentRepository.php#L52-L58 |
11,787 | elastification/php-client | src/Repository/DocumentRepository.php | DocumentRepository.get | public function get($index, $type, $id)
{
$request = $this->createRequestInstance(self::GET_DOCUMENT, $index, $type);
$request->setId($id);
return $this->client->send($request);
} | php | public function get($index, $type, $id)
{
$request = $this->createRequestInstance(self::GET_DOCUMENT, $index, $type);
$request->setId($id);
return $this->client->send($request);
} | [
"public",
"function",
"get",
"(",
"$",
"index",
",",
"$",
"type",
",",
"$",
"id",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"createRequestInstance",
"(",
"self",
"::",
"GET_DOCUMENT",
",",
"$",
"index",
",",
"$",
"type",
")",
";",
"$",
"req... | gets a document by id
@param string $index
@param string $type
@param string $id
@return \Elastification\Client\Response\ResponseInterface
@author Daniel Wendlandt | [
"gets",
"a",
"document",
"by",
"id"
] | eb01be0905dd1eba7baa62f84492d82e4b3cae61 | https://github.com/elastification/php-client/blob/eb01be0905dd1eba7baa62f84492d82e4b3cae61/src/Repository/DocumentRepository.php#L70-L76 |
11,788 | JamesRezo/webhelper-parser | src/Parser/Checker.php | Checker.setString | public function setString($string = '')
{
try {
Assert::string($string);
} catch (InvalidArgumentException $e) {
$this->string = '';
}
$this->string = $string;
return $this;
} | php | public function setString($string = '')
{
try {
Assert::string($string);
} catch (InvalidArgumentException $e) {
$this->string = '';
}
$this->string = $string;
return $this;
} | [
"public",
"function",
"setString",
"(",
"$",
"string",
"=",
"''",
")",
"{",
"try",
"{",
"Assert",
"::",
"string",
"(",
"$",
"string",
")",
";",
"}",
"catch",
"(",
"InvalidArgumentException",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"string",
"=",
"''",... | Sets an empty string if the parameter has the wrong type.
@param string $string a string to check | [
"Sets",
"an",
"empty",
"string",
"if",
"the",
"parameter",
"has",
"the",
"wrong",
"type",
"."
] | 0b39e7abe8f35afbeacdd6681fa9d0767888c646 | https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Parser/Checker.php#L32-L43 |
11,789 | JamesRezo/webhelper-parser | src/Parser/Checker.php | Checker.isValidAbsolutePath | public function isValidAbsolutePath()
{
if (!Path::isAbsolute($this->string)) {
return false;
}
if (!is_dir($this->string)) {
return false;
}
return true;
} | php | public function isValidAbsolutePath()
{
if (!Path::isAbsolute($this->string)) {
return false;
}
if (!is_dir($this->string)) {
return false;
}
return true;
} | [
"public",
"function",
"isValidAbsolutePath",
"(",
")",
"{",
"if",
"(",
"!",
"Path",
"::",
"isAbsolute",
"(",
"$",
"this",
"->",
"string",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"this",
"->",
"string",
")",
"... | Confirms if a string is an existing absolute path.
@return bool true if the string is an existing absolute path, false otherwise | [
"Confirms",
"if",
"a",
"string",
"is",
"an",
"existing",
"absolute",
"path",
"."
] | 0b39e7abe8f35afbeacdd6681fa9d0767888c646 | https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Parser/Checker.php#L60-L71 |
11,790 | JamesRezo/webhelper-parser | src/Parser/Checker.php | Checker.isValidRegex | public function isValidRegex()
{
set_error_handler(function ($errno, $errstr) {
throw new InvalidArgumentException($errstr, $errno);
}, E_WARNING);
$valid = true;
try {
preg_match($this->string, 'tester');
} catch (InvalidArgumentException $e) {
... | php | public function isValidRegex()
{
set_error_handler(function ($errno, $errstr) {
throw new InvalidArgumentException($errstr, $errno);
}, E_WARNING);
$valid = true;
try {
preg_match($this->string, 'tester');
} catch (InvalidArgumentException $e) {
... | [
"public",
"function",
"isValidRegex",
"(",
")",
"{",
"set_error_handler",
"(",
"function",
"(",
"$",
"errno",
",",
"$",
"errstr",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"$",
"errstr",
",",
"$",
"errno",
")",
";",
"}",
",",
"E_WARNING",
... | Confirms if a string is a valid regular expression.
@return bool true if the string is a valid regex, false otherwise | [
"Confirms",
"if",
"a",
"string",
"is",
"a",
"valid",
"regular",
"expression",
"."
] | 0b39e7abe8f35afbeacdd6681fa9d0767888c646 | https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Parser/Checker.php#L78-L95 |
11,791 | JamesRezo/webhelper-parser | src/Parser/Checker.php | Checker.hasKeyAndValueSubPattern | public function hasKeyAndValueSubPattern()
{
if (!$this->isValidRegex()) {
return false;
}
if (false === strpos($this->string, '(?<key>') || false === strpos($this->string, '(?<value>')) {
return false;
}
return true;
} | php | public function hasKeyAndValueSubPattern()
{
if (!$this->isValidRegex()) {
return false;
}
if (false === strpos($this->string, '(?<key>') || false === strpos($this->string, '(?<value>')) {
return false;
}
return true;
} | [
"public",
"function",
"hasKeyAndValueSubPattern",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValidRegex",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"false",
"===",
"strpos",
"(",
"$",
"this",
"->",
"string",
",",
"'(?<key>'"... | Confirms if a valid regex string contains a key and a value named suppattern.
A simple directive matcher MUST contain a key and a value named subpattern.
A starting block directive matcher MUST contain a key and a value named subpattern.
@return bool true if the string is valid, false otherwise | [
"Confirms",
"if",
"a",
"valid",
"regex",
"string",
"contains",
"a",
"key",
"and",
"a",
"value",
"named",
"suppattern",
"."
] | 0b39e7abe8f35afbeacdd6681fa9d0767888c646 | https://github.com/JamesRezo/webhelper-parser/blob/0b39e7abe8f35afbeacdd6681fa9d0767888c646/src/Parser/Checker.php#L105-L116 |
11,792 | DevGroup-ru/dotplant-entity-structure | src/models/StructureTranslation.php | StructureTranslation.validateUrl | public function validateUrl($attribute, $params)
{
$parentParentId = (null === $this->structure) ? 0 : (int)$this->structure->parent_id;
$parentContextId = (null === $this->structure) ? 0 : (int)$this->structure->context_id;
if (
$this->slug != $this->oldSlug
|| $this... | php | public function validateUrl($attribute, $params)
{
$parentParentId = (null === $this->structure) ? 0 : (int)$this->structure->parent_id;
$parentContextId = (null === $this->structure) ? 0 : (int)$this->structure->context_id;
if (
$this->slug != $this->oldSlug
|| $this... | [
"public",
"function",
"validateUrl",
"(",
"$",
"attribute",
",",
"$",
"params",
")",
"{",
"$",
"parentParentId",
"=",
"(",
"null",
"===",
"$",
"this",
"->",
"structure",
")",
"?",
"0",
":",
"(",
"int",
")",
"$",
"this",
"->",
"structure",
"->",
"pare... | Validates url to be unique among other in one context and in one language range
@param $attribute
@param $params | [
"Validates",
"url",
"to",
"be",
"unique",
"among",
"other",
"in",
"one",
"context",
"and",
"in",
"one",
"language",
"range"
] | 43e3354b5ebf9171e9afef38d82dccb02357bfed | https://github.com/DevGroup-ru/dotplant-entity-structure/blob/43e3354b5ebf9171e9afef38d82dccb02357bfed/src/models/StructureTranslation.php#L104-L138 |
11,793 | corycollier/php-cli | src/Output.php | Output.write | public function write($message, $params = [])
{
$options = $this->getMergedWriteParams($params);
echo $this->getMessagePrefix($options)
, $this->getDecoratedMessage($message, $options)
, $this->getReset();
return $this;
} | php | public function write($message, $params = [])
{
$options = $this->getMergedWriteParams($params);
echo $this->getMessagePrefix($options)
, $this->getDecoratedMessage($message, $options)
, $this->getReset();
return $this;
} | [
"public",
"function",
"write",
"(",
"$",
"message",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getMergedWriteParams",
"(",
"$",
"params",
")",
";",
"echo",
"$",
"this",
"->",
"getMessagePrefix",
"(",
"$",
"o... | writes a messge to the output
@param string $message The message to write.
@param array $params Array of parameters for writing.
@return \PhpCli\Output Return $this for object-chaining. | [
"writes",
"a",
"messge",
"to",
"the",
"output"
] | f6763c1b22a674ce9d83f179538d5500fa573ec5 | https://github.com/corycollier/php-cli/blob/f6763c1b22a674ce9d83f179538d5500fa573ec5/src/Output.php#L60-L69 |
11,794 | corycollier/php-cli | src/Output.php | Output.getMergedWriteParams | protected function getMergedWriteParams($params = [])
{
$defaults = [
'background' => false,
'color' => false,
'bold' => false,
'underline' => false,
];
return array_merge($defaults, $params);
} | php | protected function getMergedWriteParams($params = [])
{
$defaults = [
'background' => false,
'color' => false,
'bold' => false,
'underline' => false,
];
return array_merge($defaults, $params);
} | [
"protected",
"function",
"getMergedWriteParams",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'background'",
"=>",
"false",
",",
"'color'",
"=>",
"false",
",",
"'bold'",
"=>",
"false",
",",
"'underline'",
"=>",
"false",
",",
"... | Gets merged params with defaults
@param array $params An array of parameters to merge with.
@return array An array of merged parameters. | [
"Gets",
"merged",
"params",
"with",
"defaults"
] | f6763c1b22a674ce9d83f179538d5500fa573ec5 | https://github.com/corycollier/php-cli/blob/f6763c1b22a674ce9d83f179538d5500fa573ec5/src/Output.php#L89-L99 |
11,795 | corycollier/php-cli | src/Output.php | Output.getDecoratedMessage | protected function getDecoratedMessage($message, $params = [])
{
$result = '';
$prefix = '';
foreach ($params as $option => $value) {
if ($value) {
$result .= $prefix . $this->decorations[$option][$value];
$prefix = ';';
}
}
... | php | protected function getDecoratedMessage($message, $params = [])
{
$result = '';
$prefix = '';
foreach ($params as $option => $value) {
if ($value) {
$result .= $prefix . $this->decorations[$option][$value];
$prefix = ';';
}
}
... | [
"protected",
"function",
"getDecoratedMessage",
"(",
"$",
"message",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"''",
";",
"$",
"prefix",
"=",
"''",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"option",
"=>",
"$",
"value",
... | Gets a decorated version of the message.
@param string $message The message to output.
@param array $params An array of options for outputting the message.
@return string The decorated message. | [
"Gets",
"a",
"decorated",
"version",
"of",
"the",
"message",
"."
] | f6763c1b22a674ce9d83f179538d5500fa573ec5 | https://github.com/corycollier/php-cli/blob/f6763c1b22a674ce9d83f179538d5500fa573ec5/src/Output.php#L109-L125 |
11,796 | samurai-fw/samurai | src/Samurai/Component/Core/Config.php | Config.import | public function import($file)
{
$data = $this->yaml->load($file);
parent::import($data);
} | php | public function import($file)
{
$data = $this->yaml->load($file);
parent::import($data);
} | [
"public",
"function",
"import",
"(",
"$",
"file",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"yaml",
"->",
"load",
"(",
"$",
"file",
")",
";",
"parent",
"::",
"import",
"(",
"$",
"data",
")",
";",
"}"
] | import config file.
@access public
@param string $file | [
"import",
"config",
"file",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Core/Config.php#L50-L54 |
11,797 | digipolisgent/openbib-id-api | src/Value/UserActivities/HoldCollection.php | HoldCollection.fromXml | public static function fromXml(\DOMNodeList $xml)
{
$items = array();
foreach ($xml as $xmlTag) {
$items[] = Hold::fromXml($xmlTag);
}
return new static($items);
} | php | public static function fromXml(\DOMNodeList $xml)
{
$items = array();
foreach ($xml as $xmlTag) {
$items[] = Hold::fromXml($xmlTag);
}
return new static($items);
} | [
"public",
"static",
"function",
"fromXml",
"(",
"\\",
"DOMNodeList",
"$",
"xml",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"xml",
"as",
"$",
"xmlTag",
")",
"{",
"$",
"items",
"[",
"]",
"=",
"Hold",
"::",
"fromXml",
... | Builds a HoldCollection object from XML.
@param \DOMNodeList $xml
The list of xml tags representing the holds.
@return HoldCollection
A HoldCollection object. | [
"Builds",
"a",
"HoldCollection",
"object",
"from",
"XML",
"."
] | 79f58dec53a91f44333d10fa4ef79f85f31fc2de | https://github.com/digipolisgent/openbib-id-api/blob/79f58dec53a91f44333d10fa4ef79f85f31fc2de/src/Value/UserActivities/HoldCollection.php#L18-L25 |
11,798 | lasallecrm/lasallecrm-l5-listmanagement-pkg | src/Http/Controllers/FrontendListSubscribeController.php | FrontendListSubscribeController.subscribeform | public function subscribeform($listID) {
if (!$this->subscribeToList->getListByID($listID)) {
return view('lasallecrmlistmanagement::subscribe-unsubscribe-list.list_invalid', [
'title' => 'Invalid List',
]);
}
return view('lasallecrmlistmanagement... | php | public function subscribeform($listID) {
if (!$this->subscribeToList->getListByID($listID)) {
return view('lasallecrmlistmanagement::subscribe-unsubscribe-list.list_invalid', [
'title' => 'Invalid List',
]);
}
return view('lasallecrmlistmanagement... | [
"public",
"function",
"subscribeform",
"(",
"$",
"listID",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"subscribeToList",
"->",
"getListByID",
"(",
"$",
"listID",
")",
")",
"{",
"return",
"view",
"(",
"'lasallecrmlistmanagement::subscribe-unsubscribe-list.list_in... | Display the subscribe form for a given list ID
@param int $listID The "id" field of the "email_list" db table
@return \Illuminate\Http\Response | [
"Display",
"the",
"subscribe",
"form",
"for",
"a",
"given",
"list",
"ID"
] | 4b5da1af5d25d5fb4be5199f3cf22da313d475f3 | https://github.com/lasallecrm/lasallecrm-l5-listmanagement-pkg/blob/4b5da1af5d25d5fb4be5199f3cf22da313d475f3/src/Http/Controllers/FrontendListSubscribeController.php#L79-L93 |
11,799 | lasallecrm/lasallecrm-l5-listmanagement-pkg | src/Http/Controllers/FrontendListSubscribeController.php | FrontendListSubscribeController.postSubscribe | public function postSubscribe(Request $request) {
// Does the email ID exist in the "list_emails" table for this list ID already?
// We need the email ID, but only have an email address. See if this email address exists in the "emails" db table
if ($this->subscribeToList->getEmailIDByTitle($req... | php | public function postSubscribe(Request $request) {
// Does the email ID exist in the "list_emails" table for this list ID already?
// We need the email ID, but only have an email address. See if this email address exists in the "emails" db table
if ($this->subscribeToList->getEmailIDByTitle($req... | [
"public",
"function",
"postSubscribe",
"(",
"Request",
"$",
"request",
")",
"{",
"// Does the email ID exist in the \"list_emails\" table for this list ID already?",
"// We need the email ID, but only have an email address. See if this email address exists in the \"emails\" db table",
"if",
... | Subscribe someone to a LaSalleCRM email list from the filled in subscribe form
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Subscribe",
"someone",
"to",
"a",
"LaSalleCRM",
"email",
"list",
"from",
"the",
"filled",
"in",
"subscribe",
"form"
] | 4b5da1af5d25d5fb4be5199f3cf22da313d475f3 | https://github.com/lasallecrm/lasallecrm-l5-listmanagement-pkg/blob/4b5da1af5d25d5fb4be5199f3cf22da313d475f3/src/Http/Controllers/FrontendListSubscribeController.php#L101-L196 |
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.