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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
194,500 | lasallecms/lasallecms-l5-helpers-pkg | src/HTML/HTMLHelper.php | HTMLHelper.properPlural | public static function properPlural($pluralWordToCheck) {
$listOfPlurals = [
'categorys' => 'categories',
'kb_item' => 'item',
'kb_items' => 'Items',
'list_email' => 'email list',
'listlist' => 'list',
'people' ... | php | public static function properPlural($pluralWordToCheck) {
$listOfPlurals = [
'categorys' => 'categories',
'kb_item' => 'item',
'kb_items' => 'Items',
'list_email' => 'email list',
'listlist' => 'list',
'people' ... | [
"public",
"static",
"function",
"properPlural",
"(",
"$",
"pluralWordToCheck",
")",
"{",
"$",
"listOfPlurals",
"=",
"[",
"'categorys'",
"=>",
"'categories'",
",",
"'kb_item'",
"=>",
"'item'",
",",
"'kb_items'",
"=>",
"'Items'",
",",
"'list_email'",
"=>",
"'email... | Is the plural word grammatically correct?
Also, a method to specify custom admin form subtitle names (regular create/edit forms),
and called from Formhandler's AdminBaseFormController.
@param string $pluralWordToCheck Plural word to check
@return string | [
"Is",
"the",
"plural",
"word",
"grammatically",
"correct?"
] | 733967ce3fd81a1efba5265e11663c324ff983c4 | https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/HTML/HTMLHelper.php#L636-L663 |
194,501 | lasallecms/lasallecms-l5-helpers-pkg | src/HTML/HTMLHelper.php | HTMLHelper.determineEpisodeImagePath | public static function determineEpisodeImagePath($episode, $show) {
if (empty($episode->featured_image)) {
// I'm gonna be a very bad boy here and just return the cloudfront path,
// because, at this point, LaSalleCast is just for moi, and I use AWS cloudfront
return $show-... | php | public static function determineEpisodeImagePath($episode, $show) {
if (empty($episode->featured_image)) {
// I'm gonna be a very bad boy here and just return the cloudfront path,
// because, at this point, LaSalleCast is just for moi, and I use AWS cloudfront
return $show-... | [
"public",
"static",
"function",
"determineEpisodeImagePath",
"(",
"$",
"episode",
",",
"$",
"show",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"episode",
"->",
"featured_image",
")",
")",
"{",
"// I'm gonna be a very bad boy here and just return the cloudfront path,",
"/... | What is the episode's image's path?
@param $episode
@param $show
@return string | [
"What",
"is",
"the",
"episode",
"s",
"image",
"s",
"path?"
] | 733967ce3fd81a1efba5265e11663c324ff983c4 | https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/HTML/HTMLHelper.php#L848-L860 |
194,502 | lasallecms/lasallecms-l5-helpers-pkg | src/HTML/HTMLHelper.php | HTMLHelper.createOpenGraphTagsForPost | public static function createOpenGraphTagsForPost($post) {
return [
'og:title' => $post->title,
'og:type' => 'article',
'og:url' => $post->canonical_url,
'og:image' => $post->urlImage,
'og:descr... | php | public static function createOpenGraphTagsForPost($post) {
return [
'og:title' => $post->title,
'og:type' => 'article',
'og:url' => $post->canonical_url,
'og:image' => $post->urlImage,
'og:descr... | [
"public",
"static",
"function",
"createOpenGraphTagsForPost",
"(",
"$",
"post",
")",
"{",
"return",
"[",
"'og:title'",
"=>",
"$",
"post",
"->",
"title",
",",
"'og:type'",
"=>",
"'article'",
",",
"'og:url'",
"=>",
"$",
"post",
"->",
"canonical_url",
",",
"'og... | Create an array of OG tags and their values for a post.
https://developers.facebook.com/docs/sharing/webmasters
@param object $post The post object.
@return array | [
"Create",
"an",
"array",
"of",
"OG",
"tags",
"and",
"their",
"values",
"for",
"a",
"post",
"."
] | 733967ce3fd81a1efba5265e11663c324ff983c4 | https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/HTML/HTMLHelper.php#L876-L887 |
194,503 | lasallecms/lasallecms-l5-helpers-pkg | src/HTML/HTMLHelper.php | HTMLHelper.createTwitterTagsForPost | public static function createTwitterTagsForPost($post) {
return [
'twitter:card' => Config::get('lasallecmsfrontend.twitter_card'),
'twitter:site' => Config::get('lasallecmsfrontend.twitter_site'),
'twitter:title' => $post->title,
'twitter:desc... | php | public static function createTwitterTagsForPost($post) {
return [
'twitter:card' => Config::get('lasallecmsfrontend.twitter_card'),
'twitter:site' => Config::get('lasallecmsfrontend.twitter_site'),
'twitter:title' => $post->title,
'twitter:desc... | [
"public",
"static",
"function",
"createTwitterTagsForPost",
"(",
"$",
"post",
")",
"{",
"return",
"[",
"'twitter:card'",
"=>",
"Config",
"::",
"get",
"(",
"'lasallecmsfrontend.twitter_card'",
")",
",",
"'twitter:site'",
"=>",
"Config",
"::",
"get",
"(",
"'lasallec... | Create an array of Twitter tags and their values for a post.
https://dev.twitter.com/cards/overview
@param object $post The post object.
@return array | [
"Create",
"an",
"array",
"of",
"Twitter",
"tags",
"and",
"their",
"values",
"for",
"a",
"post",
"."
] | 733967ce3fd81a1efba5265e11663c324ff983c4 | https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/HTML/HTMLHelper.php#L897-L907 |
194,504 | lasallecms/lasallecms-l5-helpers-pkg | src/HTML/HTMLHelper.php | HTMLHelper.prefaceURLwithHTTP | public static function prefaceURLwithHTTP($url) {
$url = trim($url);
if (substr($url, 0, 7 ) == "http://") {
return $url;
}
if (substr($url, 0, 8 ) == "https://") {
return $url;
}
return "http://".$url;
} | php | public static function prefaceURLwithHTTP($url) {
$url = trim($url);
if (substr($url, 0, 7 ) == "http://") {
return $url;
}
if (substr($url, 0, 8 ) == "https://") {
return $url;
}
return "http://".$url;
} | [
"public",
"static",
"function",
"prefaceURLwithHTTP",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"trim",
"(",
"$",
"url",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"url",
",",
"0",
",",
"7",
")",
"==",
"\"http://\"",
")",
"{",
"return",
"$",
"url... | Make sure the URL is fully qualified
@param string $url
@return string | [
"Make",
"sure",
"the",
"URL",
"is",
"fully",
"qualified"
] | 733967ce3fd81a1efba5265e11663c324ff983c4 | https://github.com/lasallecms/lasallecms-l5-helpers-pkg/blob/733967ce3fd81a1efba5265e11663c324ff983c4/src/HTML/HTMLHelper.php#L940-L952 |
194,505 | ekyna/Resource | Doctrine/ORM/Mapping/EmbeddableMapper.php | EmbeddableMapper.processClassMetadata | public function processClassMetadata(ClassMetadata $metadata, $property, $prefix)
{
if (in_array($metadata->getName(), $this->processedClasses)) {
return;
}
$metadata->mapEmbedded([
'fieldName' => $property,
'class' => $this->embeddableMetadata-... | php | public function processClassMetadata(ClassMetadata $metadata, $property, $prefix)
{
if (in_array($metadata->getName(), $this->processedClasses)) {
return;
}
$metadata->mapEmbedded([
'fieldName' => $property,
'class' => $this->embeddableMetadata-... | [
"public",
"function",
"processClassMetadata",
"(",
"ClassMetadata",
"$",
"metadata",
",",
"$",
"property",
",",
"$",
"prefix",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"metadata",
"->",
"getName",
"(",
")",
",",
"$",
"this",
"->",
"processedClasses",
")"... | Processes the class metadata.
@param ClassMetadata $metadata
@param string $property
@param string $prefix | [
"Processes",
"the",
"class",
"metadata",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Mapping/EmbeddableMapper.php#L49-L64 |
194,506 | ekyna/Resource | Serializer/AbstractResourceNormalizer.php | AbstractResourceNormalizer.normalizeObject | protected function normalizeObject($object, $format, array $context)
{
if (!$this->serializer instanceof NormalizerInterface) {
throw new LogicException(
'Cannot normalize object because the injected serializer is not a normalizer'
);
}
return $this->... | php | protected function normalizeObject($object, $format, array $context)
{
if (!$this->serializer instanceof NormalizerInterface) {
throw new LogicException(
'Cannot normalize object because the injected serializer is not a normalizer'
);
}
return $this->... | [
"protected",
"function",
"normalizeObject",
"(",
"$",
"object",
",",
"$",
"format",
",",
"array",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"serializer",
"instanceof",
"NormalizerInterface",
")",
"{",
"throw",
"new",
"LogicException",
"(",... | Normalizes the object.
@param object $object
@param string $format
@param array $context
@return array|string | [
"Normalizes",
"the",
"object",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Serializer/AbstractResourceNormalizer.php#L93-L102 |
194,507 | ekyna/Resource | Serializer/AbstractResourceNormalizer.php | AbstractResourceNormalizer.denormalizeObject | protected function denormalizeObject($data, $class, $format, array $context)
{
if (!$this->serializer instanceof DenormalizerInterface) {
throw new LogicException(
'Cannot denormalize object because the injected serializer is not a denormalizer'
);
}
... | php | protected function denormalizeObject($data, $class, $format, array $context)
{
if (!$this->serializer instanceof DenormalizerInterface) {
throw new LogicException(
'Cannot denormalize object because the injected serializer is not a denormalizer'
);
}
... | [
"protected",
"function",
"denormalizeObject",
"(",
"$",
"data",
",",
"$",
"class",
",",
"$",
"format",
",",
"array",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"serializer",
"instanceof",
"DenormalizerInterface",
")",
"{",
"throw",
"new",... | Denormalizes the object.
@param array $data
@param string $class
@param string $format
@param array $context
@return object|void | [
"Denormalizes",
"the",
"object",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Serializer/AbstractResourceNormalizer.php#L122-L131 |
194,508 | hoffmann-oss/arrays-php | src/Arrays2d.php | Arrays2d.rotateX | public static function rotateX(array &$array, int $distance,
int $startX = 0, int $startY = 0, int $stopX = null, int $stopY = null)
{
self::prepare($array, $stopX, $stopY);
$rotateLeft = $distance > 0;
$distance = abs($distance) % ($stopX - $startX);
$x = $rotateLeft ? $startX + $distance : $stopX - $dista... | php | public static function rotateX(array &$array, int $distance,
int $startX = 0, int $startY = 0, int $stopX = null, int $stopY = null)
{
self::prepare($array, $stopX, $stopY);
$rotateLeft = $distance > 0;
$distance = abs($distance) % ($stopX - $startX);
$x = $rotateLeft ? $startX + $distance : $stopX - $dista... | [
"public",
"static",
"function",
"rotateX",
"(",
"array",
"&",
"$",
"array",
",",
"int",
"$",
"distance",
",",
"int",
"$",
"startX",
"=",
"0",
",",
"int",
"$",
"startY",
"=",
"0",
",",
"int",
"$",
"stopX",
"=",
"null",
",",
"int",
"$",
"stopY",
"=... | Array items rotate left if distance is greater than 0. | [
"Array",
"items",
"rotate",
"left",
"if",
"distance",
"is",
"greater",
"than",
"0",
"."
] | e565352ef6118acefe6ec02c0e85f1c3f78642df | https://github.com/hoffmann-oss/arrays-php/blob/e565352ef6118acefe6ec02c0e85f1c3f78642df/src/Arrays2d.php#L73-L83 |
194,509 | hoffmann-oss/arrays-php | src/Arrays2d.php | Arrays2d.rotateY | public static function rotateY(array &$array, int $distance,
int $startX = 0, int $startY = 0, int $stopX = null, int $stopY = null)
{
self::prepare($array, $stopX, $stopY);
$rotateUp = $distance > 0;
$distance = abs($distance) % ($stopY - $startY);
$y = $rotateUp ? $startY + $distance : $stopY - $distance;... | php | public static function rotateY(array &$array, int $distance,
int $startX = 0, int $startY = 0, int $stopX = null, int $stopY = null)
{
self::prepare($array, $stopX, $stopY);
$rotateUp = $distance > 0;
$distance = abs($distance) % ($stopY - $startY);
$y = $rotateUp ? $startY + $distance : $stopY - $distance;... | [
"public",
"static",
"function",
"rotateY",
"(",
"array",
"&",
"$",
"array",
",",
"int",
"$",
"distance",
",",
"int",
"$",
"startX",
"=",
"0",
",",
"int",
"$",
"startY",
"=",
"0",
",",
"int",
"$",
"stopX",
"=",
"null",
",",
"int",
"$",
"stopY",
"=... | Array items rotate up if distance is greater than 0. | [
"Array",
"items",
"rotate",
"up",
"if",
"distance",
"is",
"greater",
"than",
"0",
"."
] | e565352ef6118acefe6ec02c0e85f1c3f78642df | https://github.com/hoffmann-oss/arrays-php/blob/e565352ef6118acefe6ec02c0e85f1c3f78642df/src/Arrays2d.php#L88-L98 |
194,510 | imsamurai/CakePHP-AdvancedShell | Console/Command/AdvancedShell.php | AdvancedShell.statisticsEnd | public function statisticsEnd($name) {
$this->hr();
$this->out('Took: ' . $this->_startTime[$name]->diff(new DateTime())->format('%ad %hh %im %ss'));
$this->out('Memory: ' . sprintf('%0.3f', memory_get_peak_usage(true) / (1024 * 1024)) . "Mb max used");
$this->hr();
} | php | public function statisticsEnd($name) {
$this->hr();
$this->out('Took: ' . $this->_startTime[$name]->diff(new DateTime())->format('%ad %hh %im %ss'));
$this->out('Memory: ' . sprintf('%0.3f', memory_get_peak_usage(true) / (1024 * 1024)) . "Mb max used");
$this->hr();
} | [
"public",
"function",
"statisticsEnd",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"hr",
"(",
")",
";",
"$",
"this",
"->",
"out",
"(",
"'Took: '",
".",
"$",
"this",
"->",
"_startTime",
"[",
"$",
"name",
"]",
"->",
"diff",
"(",
"new",
"DateTime",... | Stop and output statistics
@param string $name | [
"Stop",
"and",
"output",
"statistics"
] | 087d483742e2a76bee45e35b8d94957b0d20f857 | https://github.com/imsamurai/CakePHP-AdvancedShell/blob/087d483742e2a76bee45e35b8d94957b0d20f857/Console/Command/AdvancedShell.php#L76-L81 |
194,511 | imsamurai/CakePHP-AdvancedShell | Console/Command/AdvancedShell.php | AdvancedShell.sqlDump | public function sqlDump($sorted = false, $clear = true) {
if (!class_exists('ConnectionManager') || Configure::read('debug') < 2) {
return;
}
$sources = ConnectionManager::sourceList();
$logs = array();
foreach ($sources as $source) {
$db = ConnectionManager::getDataSource($source);
if (!method_exis... | php | public function sqlDump($sorted = false, $clear = true) {
if (!class_exists('ConnectionManager') || Configure::read('debug') < 2) {
return;
}
$sources = ConnectionManager::sourceList();
$logs = array();
foreach ($sources as $source) {
$db = ConnectionManager::getDataSource($source);
if (!method_exis... | [
"public",
"function",
"sqlDump",
"(",
"$",
"sorted",
"=",
"false",
",",
"$",
"clear",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'ConnectionManager'",
")",
"||",
"Configure",
"::",
"read",
"(",
"'debug'",
")",
"<",
"2",
")",
"{",
"r... | Shows sql dump
@param bool $sorted Get the queries sorted by time taken, defaults to false.
@param bool $clear If True the existing log will cleared. | [
"Shows",
"sql",
"dump"
] | 087d483742e2a76bee45e35b8d94957b0d20f857 | https://github.com/imsamurai/CakePHP-AdvancedShell/blob/087d483742e2a76bee45e35b8d94957b0d20f857/Console/Command/AdvancedShell.php#L108-L135 |
194,512 | bartonlp/site-class | includes/database-engines/dbAbstract.class.php | dbAbstract.query | public function query($query) {
if(method_exists($this->db, 'query')) {
return $this->db->query($query);
} else {
throw new Exception(__METHOD__ . " not implemented");
}
} | php | public function query($query) {
if(method_exists($this->db, 'query')) {
return $this->db->query($query);
} else {
throw new Exception(__METHOD__ . " not implemented");
}
} | [
"public",
"function",
"query",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"db",
",",
"'query'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"$",
"query",
")",
";",
"}",
"else",
"{",
... | The following methods either execute or if the method is not defined throw an Exception | [
"The",
"following",
"methods",
"either",
"execute",
"or",
"if",
"the",
"method",
"is",
"not",
"defined",
"throw",
"an",
"Exception"
] | 9095b101701ef0ae12ea9a2b4587a18072d04438 | https://github.com/bartonlp/site-class/blob/9095b101701ef0ae12ea9a2b4587a18072d04438/includes/database-engines/dbAbstract.class.php#L34-L40 |
194,513 | Wedeto/HTML | src/SafeHTML.php | SafeHTML.allowAttribute | public function allowAttribute($attribute)
{
if (is_array($attribute))
{
foreach ($attribute as $attrib)
$this->allowed_attributes[$attrib] = true;
}
else
$this->allowed_attributes[$attribute] = true;
return $this;
} | php | public function allowAttribute($attribute)
{
if (is_array($attribute))
{
foreach ($attribute as $attrib)
$this->allowed_attributes[$attrib] = true;
}
else
$this->allowed_attributes[$attribute] = true;
return $this;
} | [
"public",
"function",
"allowAttribute",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"attribute",
")",
")",
"{",
"foreach",
"(",
"$",
"attribute",
"as",
"$",
"attrib",
")",
"$",
"this",
"->",
"allowed_attributes",
"[",
"$",
"attrib",... | Add an attribute to the whitelist
@param $attribute string|Array The name of the attribute to add to the whitelist.
Can also be an array to add multiple attributes.
@return SafeHTML Provides fluent interface | [
"Add",
"an",
"attribute",
"to",
"the",
"whitelist"
] | 9e725288098c42d0d2953a929faebe628ff4e389 | https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/SafeHTML.php#L131-L141 |
194,514 | Wedeto/HTML | src/SafeHTML.php | SafeHTML.removeTag | public function removeTag($tag)
{
if (is_array($tag))
{
foreach ($tag as $t)
{
if (isset($this->allowed_tags[$t]))
unset($this->allowed_tags[$t]);
$this->remove_tags[$t] = true;
}
}
else
{... | php | public function removeTag($tag)
{
if (is_array($tag))
{
foreach ($tag as $t)
{
if (isset($this->allowed_tags[$t]))
unset($this->allowed_tags[$t]);
$this->remove_tags[$t] = true;
}
}
else
{... | [
"public",
"function",
"removeTag",
"(",
"$",
"tag",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"tag",
")",
")",
"{",
"foreach",
"(",
"$",
"tag",
"as",
"$",
"t",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"allowed_tags",
"[",
"$",
"t"... | Add a tag to the list of tags to remove including all child nodes
@param $tag string|array The name of the tag to add to the remove list
Can also be an array to add multiple tags.
@return SafeHTML Provides fluent interface | [
"Add",
"a",
"tag",
"to",
"the",
"list",
"of",
"tags",
"to",
"remove",
"including",
"all",
"child",
"nodes"
] | 9e725288098c42d0d2953a929faebe628ff4e389 | https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/SafeHTML.php#L163-L181 |
194,515 | Wedeto/HTML | src/SafeHTML.php | SafeHTML.allowProtocol | public function allowProtocol($protocol)
{
if (is_array($protocol))
{
foreach ($protocol as $proto)
$this->allowed_protocols[$proto] = true;
}
else
$this->allowed_protocols[$protocol] = true;
return $this;
} | php | public function allowProtocol($protocol)
{
if (is_array($protocol))
{
foreach ($protocol as $proto)
$this->allowed_protocols[$proto] = true;
}
else
$this->allowed_protocols[$protocol] = true;
return $this;
} | [
"public",
"function",
"allowProtocol",
"(",
"$",
"protocol",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"protocol",
")",
")",
"{",
"foreach",
"(",
"$",
"protocol",
"as",
"$",
"proto",
")",
"$",
"this",
"->",
"allowed_protocols",
"[",
"$",
"proto",
"]",... | Add a protocol to the list of protocols to allow linking to.
@param $protocl string|array The protocol to add to the whitelist.
Can also be an array to add multiple protocols.
@return SafeHTML Provides fluent interface | [
"Add",
"a",
"protocol",
"to",
"the",
"list",
"of",
"protocols",
"to",
"allow",
"linking",
"to",
"."
] | 9e725288098c42d0d2953a929faebe628ff4e389 | https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/SafeHTML.php#L189-L199 |
194,516 | Wedeto/HTML | src/SafeHTML.php | SafeHTML.getHTML | public function getHTML()
{
$dom = new DOMDocument();
$interceptor = new ErrorInterceptor(array($dom, 'loadHTML'));
$interceptor->registerError(E_WARNING, "DOMDocument::loadHTML");
$interceptor->execute($this->html);
$body = $dom->getElementsByTagName('body')->item(0);
... | php | public function getHTML()
{
$dom = new DOMDocument();
$interceptor = new ErrorInterceptor(array($dom, 'loadHTML'));
$interceptor->registerError(E_WARNING, "DOMDocument::loadHTML");
$interceptor->execute($this->html);
$body = $dom->getElementsByTagName('body')->item(0);
... | [
"public",
"function",
"getHTML",
"(",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"$",
"interceptor",
"=",
"new",
"ErrorInterceptor",
"(",
"array",
"(",
"$",
"dom",
",",
"'loadHTML'",
")",
")",
";",
"$",
"interceptor",
"->",
"regist... | Return the sanitized HTML, according to the set up list of tags and attributes.
@return string The sanitized HTML | [
"Return",
"the",
"sanitized",
"HTML",
"according",
"to",
"the",
"set",
"up",
"list",
"of",
"tags",
"and",
"attributes",
"."
] | 9e725288098c42d0d2953a929faebe628ff4e389 | https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/SafeHTML.php#L243-L260 |
194,517 | Wedeto/HTML | src/SafeHTML.php | SafeHTML.sanitizeNode | private function sanitizeNode(DOMNode $node)
{
// Traverse the nodes, without foreach because nodes may be removed
$child = (!empty($node->childNodes) && $node->childNodes->length > 0) ? $node->childNodes->item(0) : null;
while ($child !== null)
{
$tag = $child->nodeName;... | php | private function sanitizeNode(DOMNode $node)
{
// Traverse the nodes, without foreach because nodes may be removed
$child = (!empty($node->childNodes) && $node->childNodes->length > 0) ? $node->childNodes->item(0) : null;
while ($child !== null)
{
$tag = $child->nodeName;... | [
"private",
"function",
"sanitizeNode",
"(",
"DOMNode",
"$",
"node",
")",
"{",
"// Traverse the nodes, without foreach because nodes may be removed",
"$",
"child",
"=",
"(",
"!",
"empty",
"(",
"$",
"node",
"->",
"childNodes",
")",
"&&",
"$",
"node",
"->",
"childNod... | Helper function to recursively sanitize nodes
@param $node DOMNode The node to sanitize | [
"Helper",
"function",
"to",
"recursively",
"sanitize",
"nodes"
] | 9e725288098c42d0d2953a929faebe628ff4e389 | https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/SafeHTML.php#L267-L311 |
194,518 | Wedeto/HTML | src/SafeHTML.php | SafeHTML.unwrapContents | private function unwrapContents(DOMNode $node, DOMNode $child)
{
// Preserve the content by adding the child nodes to the parent
$next = $child->nextSibling;
if ($next === null)
$next = $child;
if ($child->childNodes !== null)
{
$l = $child->childNode... | php | private function unwrapContents(DOMNode $node, DOMNode $child)
{
// Preserve the content by adding the child nodes to the parent
$next = $child->nextSibling;
if ($next === null)
$next = $child;
if ($child->childNodes !== null)
{
$l = $child->childNode... | [
"private",
"function",
"unwrapContents",
"(",
"DOMNode",
"$",
"node",
",",
"DOMNode",
"$",
"child",
")",
"{",
"// Preserve the content by adding the child nodes to the parent",
"$",
"next",
"=",
"$",
"child",
"->",
"nextSibling",
";",
"if",
"(",
"$",
"next",
"==="... | Helper function to unwrap the contents of a node and remove the node.
@param $node DOMNode The node from which to remove the child
@param $child DOMNode The child to remove from the node
@return The first newly added node, or if none were added, the next sibling node | [
"Helper",
"function",
"to",
"unwrap",
"the",
"contents",
"of",
"a",
"node",
"and",
"remove",
"the",
"node",
"."
] | 9e725288098c42d0d2953a929faebe628ff4e389 | https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/SafeHTML.php#L319-L356 |
194,519 | Wedeto/HTML | src/SafeHTML.php | SafeHTML.sanitizeAttributes | private function sanitizeAttributes(DOMNode $child)
{
// Compile a list of attributes that should be removed
$remove_attributes = array();
foreach ($child->attributes as $attrib)
{
$name = $attrib->name;
if (!isset($this->allowed_attributes[$name]))
... | php | private function sanitizeAttributes(DOMNode $child)
{
// Compile a list of attributes that should be removed
$remove_attributes = array();
foreach ($child->attributes as $attrib)
{
$name = $attrib->name;
if (!isset($this->allowed_attributes[$name]))
... | [
"private",
"function",
"sanitizeAttributes",
"(",
"DOMNode",
"$",
"child",
")",
"{",
"// Compile a list of attributes that should be removed",
"$",
"remove_attributes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"child",
"->",
"attributes",
"as",
"$",
"attrib... | Helper function to sanitize the attributes for the specified node.
@param $child DOMNode the child to examine | [
"Helper",
"function",
"to",
"sanitize",
"the",
"attributes",
"for",
"the",
"specified",
"node",
"."
] | 9e725288098c42d0d2953a929faebe628ff4e389 | https://github.com/Wedeto/HTML/blob/9e725288098c42d0d2953a929faebe628ff4e389/src/SafeHTML.php#L362-L403 |
194,520 | aegis-security/JSON | src/JSON.php | JSON._recursiveJsonExprFinder | protected static function _recursiveJsonExprFinder(
&$value,
array &$javascriptExpressions,
$currentKey = null
) {
if ($value instanceof Expr) {
// TODO: Optimize with ascii keys, if performance is bad
$magicKey = "____" . $currentKey . "_" . (count($javascrip... | php | protected static function _recursiveJsonExprFinder(
&$value,
array &$javascriptExpressions,
$currentKey = null
) {
if ($value instanceof Expr) {
// TODO: Optimize with ascii keys, if performance is bad
$magicKey = "____" . $currentKey . "_" . (count($javascrip... | [
"protected",
"static",
"function",
"_recursiveJsonExprFinder",
"(",
"&",
"$",
"value",
",",
"array",
"&",
"$",
"javascriptExpressions",
",",
"$",
"currentKey",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Expr",
")",
"{",
"// TODO: Optimize w... | Check & Replace Aegis\JSON\Expr for tmp ids in the valueToEncode
Check if the value is a Aegis\JSON\Expr, and if replace its value
with a magic key and save the javascript expression in an array.
NOTE this method is recursive.
NOTE: This method is used internally by the encode method.
@see encode
@param mixed $valu... | [
"Check",
"&",
"Replace",
"Aegis",
"\\",
"JSON",
"\\",
"Expr",
"for",
"tmp",
"ids",
"in",
"the",
"valueToEncode"
] | 7bc8e442e9e570ecbc480053d9aaa42a52910fbc | https://github.com/aegis-security/JSON/blob/7bc8e442e9e570ecbc480053d9aaa42a52910fbc/src/JSON.php#L157-L182 |
194,521 | aegis-security/JSON | src/JSON.php | JSON.prettyPrint | public static function prettyPrint($json, $options = array())
{
$tokens = preg_split('|([\{\}\]\[,])|', $json, -1, PREG_SPLIT_DELIM_CAPTURE);
$result = "";
$indent = 0;
$ind = " ";
if (isset($options['indent'])) {
$ind = $options['indent'];
}
... | php | public static function prettyPrint($json, $options = array())
{
$tokens = preg_split('|([\{\}\]\[,])|', $json, -1, PREG_SPLIT_DELIM_CAPTURE);
$result = "";
$indent = 0;
$ind = " ";
if (isset($options['indent'])) {
$ind = $options['indent'];
}
... | [
"public",
"static",
"function",
"prettyPrint",
"(",
"$",
"json",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"tokens",
"=",
"preg_split",
"(",
"'|([\\{\\}\\]\\[,])|'",
",",
"$",
"json",
",",
"-",
"1",
",",
"PREG_SPLIT_DELIM_CAPTURE",
")",
... | Pretty-print JSON string
Use 'indent' option to select indentation string - by default it's a tab
@param string $json Original JSON string
@param array $options Encoding options
@return string | [
"Pretty",
"-",
"print",
"JSON",
"string"
] | 7bc8e442e9e570ecbc480053d9aaa42a52910fbc | https://github.com/aegis-security/JSON/blob/7bc8e442e9e570ecbc480053d9aaa42a52910fbc/src/JSON.php#L193-L242 |
194,522 | wcatron/Common-DB-Framework-PHP | src/DB.php | DB.getInstance | public static function getInstance($connect = true) {
if (!isset(self::$instances[static::class])) {
self::$instances[static::class] = new static();
}
/** @var DB $instance */
$instance = self::$instances[static::class];
if ($connect) {
$instance->connect(... | php | public static function getInstance($connect = true) {
if (!isset(self::$instances[static::class])) {
self::$instances[static::class] = new static();
}
/** @var DB $instance */
$instance = self::$instances[static::class];
if ($connect) {
$instance->connect(... | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"connect",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instances",
"[",
"static",
"::",
"class",
"]",
")",
")",
"{",
"self",
"::",
"$",
"instances",
"[",
"static",
... | Gets the singleton instance of the DB. Used throughout the framework.
@return static Returns the singlton DB object. | [
"Gets",
"the",
"singleton",
"instance",
"of",
"the",
"DB",
".",
"Used",
"throughout",
"the",
"framework",
"."
] | c5ca1a62499053aee2004aa4cb48d71868f41b68 | https://github.com/wcatron/Common-DB-Framework-PHP/blob/c5ca1a62499053aee2004aa4cb48d71868f41b68/src/DB.php#L18-L28 |
194,523 | SergioMadness/pwf-helpers | src/ArrayHelper.php | ArrayHelper.groupArray | public static function groupArray($arr, $groupField)
{
$result = array();
foreach ($arr as $data) {
$id = $data[$groupField];
if (isset($result[$id])) {
$result[$id][] = $data;
} else {
$result[$id] = array($data);
}
... | php | public static function groupArray($arr, $groupField)
{
$result = array();
foreach ($arr as $data) {
$id = $data[$groupField];
if (isset($result[$id])) {
$result[$id][] = $data;
} else {
$result[$id] = array($data);
}
... | [
"public",
"static",
"function",
"groupArray",
"(",
"$",
"arr",
",",
"$",
"groupField",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"data",
")",
"{",
"$",
"id",
"=",
"$",
"data",
"[",
"$",
"groupFie... | Groupping elements by field
Example:
$arr = [
[
'groupId' => 1,
'name' => 'name11'
],
[
'groupId' => 1,
'name' => 'name12'
],
[
'groupId' => 2,
'name' => 'name21'
]
];
$result = ArrayHelper::groupArray($arr, 'groupId');
$result:
[
'1' => [
[
'groupId' => 1,
'name' => 'name11'
],
[
'groupId' => 1,
'name' => 'name12'
... | [
"Groupping",
"elements",
"by",
"field"
] | d6cd44807c120356d60618cb08f237841c35e293 | https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/ArrayHelper.php#L71-L84 |
194,524 | SergioMadness/pwf-helpers | src/ArrayHelper.php | ArrayHelper.recursiveArraySearch | public static function recursiveArraySearch($needleKey, $needleValue,
array $haystack)
{
foreach ($haystack as $key => $value) {
$currentKey = $key;
if (($currentKey == $needleKey && ($needleValue === null || $needleValue
... | php | public static function recursiveArraySearch($needleKey, $needleValue,
array $haystack)
{
foreach ($haystack as $key => $value) {
$currentKey = $key;
if (($currentKey == $needleKey && ($needleValue === null || $needleValue
... | [
"public",
"static",
"function",
"recursiveArraySearch",
"(",
"$",
"needleKey",
",",
"$",
"needleValue",
",",
"array",
"$",
"haystack",
")",
"{",
"foreach",
"(",
"$",
"haystack",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"currentKey",
"=",
"$",... | Search in array
@param mixed $needleKey
@param mixed $needleValue
@param array $haystack
@return integer | [
"Search",
"in",
"array"
] | d6cd44807c120356d60618cb08f237841c35e293 | https://github.com/SergioMadness/pwf-helpers/blob/d6cd44807c120356d60618cb08f237841c35e293/src/ArrayHelper.php#L151-L164 |
194,525 | ekyna/PaymentBundle | Payum/Action/AbstractPaymentStateAwareAction.php | AbstractPaymentStateAwareAction.updatePaymentState | protected function updatePaymentState(PaymentInterface $payment, $nextState)
{
if ($payment->getState() !== $nextState) {
/** @var \Ekyna\Bundle\PaymentBundle\StateMachine\StateMachineInterface $stateMachine */
$stateMachine = $this->factory->get($payment);
if (null !== $... | php | protected function updatePaymentState(PaymentInterface $payment, $nextState)
{
if ($payment->getState() !== $nextState) {
/** @var \Ekyna\Bundle\PaymentBundle\StateMachine\StateMachineInterface $stateMachine */
$stateMachine = $this->factory->get($payment);
if (null !== $... | [
"protected",
"function",
"updatePaymentState",
"(",
"PaymentInterface",
"$",
"payment",
",",
"$",
"nextState",
")",
"{",
"if",
"(",
"$",
"payment",
"->",
"getState",
"(",
")",
"!==",
"$",
"nextState",
")",
"{",
"/** @var \\Ekyna\\Bundle\\PaymentBundle\\StateMachine\... | Updates the payment state.
@param PaymentInterface $payment
@param string $nextState | [
"Updates",
"the",
"payment",
"state",
"."
] | 1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1 | https://github.com/ekyna/PaymentBundle/blob/1b4f4103b28e3a4f8dbfac2cbd872d728238f4d1/Payum/Action/AbstractPaymentStateAwareAction.php#L44-L55 |
194,526 | azhai/code-refactor | src/CodeRefactor/Printer.php | Printer.pImplode | protected function pImplode(array $nodes, $glue = '')
{
$strings = $this->pIterator($nodes);
return implode($glue, $strings);
} | php | protected function pImplode(array $nodes, $glue = '')
{
$strings = $this->pIterator($nodes);
return implode($glue, $strings);
} | [
"protected",
"function",
"pImplode",
"(",
"array",
"$",
"nodes",
",",
"$",
"glue",
"=",
"''",
")",
"{",
"$",
"strings",
"=",
"$",
"this",
"->",
"pIterator",
"(",
"$",
"nodes",
")",
";",
"return",
"implode",
"(",
"$",
"glue",
",",
"$",
"strings",
")... | Pretty prints an array of nodes and implodes the printed values. | [
"Pretty",
"prints",
"an",
"array",
"of",
"nodes",
"and",
"implodes",
"the",
"printed",
"values",
"."
] | cddb437d72f8239957daeba8211dda5e9366d6ca | https://github.com/azhai/code-refactor/blob/cddb437d72f8239957daeba8211dda5e9366d6ca/src/CodeRefactor/Printer.php#L44-L48 |
194,527 | azhai/code-refactor | src/CodeRefactor/Printer.php | Printer.pCommaSeparated | protected function pCommaSeparated(array $nodes, $max_len = 80)
{
$result = '';
$line = '';
$strings = $this->pIterator($nodes);
foreach ($strings as $node_str) {
if ($line !== '' && strlen($line) + strlen($node_str) > $max_len) {
$result .= $line . ",\n";... | php | protected function pCommaSeparated(array $nodes, $max_len = 80)
{
$result = '';
$line = '';
$strings = $this->pIterator($nodes);
foreach ($strings as $node_str) {
if ($line !== '' && strlen($line) + strlen($node_str) > $max_len) {
$result .= $line . ",\n";... | [
"protected",
"function",
"pCommaSeparated",
"(",
"array",
"$",
"nodes",
",",
"$",
"max_len",
"=",
"80",
")",
"{",
"$",
"result",
"=",
"''",
";",
"$",
"line",
"=",
"''",
";",
"$",
"strings",
"=",
"$",
"this",
"->",
"pIterator",
"(",
"$",
"nodes",
")... | Pretty prints an array of nodes and implodes the printed values with commas. | [
"Pretty",
"prints",
"an",
"array",
"of",
"nodes",
"and",
"implodes",
"the",
"printed",
"values",
"with",
"commas",
"."
] | cddb437d72f8239957daeba8211dda5e9366d6ca | https://github.com/azhai/code-refactor/blob/cddb437d72f8239957daeba8211dda5e9366d6ca/src/CodeRefactor/Printer.php#L53-L68 |
194,528 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.scanInstall | public function scanInstall()
{
if(!$this->lockSystemChanges)
{
foreach ($this->ApplicationContext->detectPluginDirectories()->getPluginDirectories() as $pluginDir) {
if (is_dir($pluginDir)) {
$slug = basename($pluginDir);
if (!$th... | php | public function scanInstall()
{
if(!$this->lockSystemChanges)
{
foreach ($this->ApplicationContext->detectPluginDirectories()->getPluginDirectories() as $pluginDir) {
if (is_dir($pluginDir)) {
$slug = basename($pluginDir);
if (!$th... | [
"public",
"function",
"scanInstall",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"lockSystemChanges",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"ApplicationContext",
"->",
"detectPluginDirectories",
"(",
")",
"->",
"getPluginDirectories",
"(",
")",
... | Scans the plugin directories and installs plugins as needed
@return void | [
"Scans",
"the",
"plugin",
"directories",
"and",
"installs",
"plugins",
"as",
"needed"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L222-L297 |
194,529 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.processPluginXML | public function processPluginXML(Plugin $plugin, Errors &$errors, &$log = '', $xml = false)
{
if(!$xml)
$xml = $this->loadXML($plugin->Path);
$this->processConfig($plugin, $log, $xml);
$this->processPermissions($plugin, $log, $xml);
$this->processCMSNavItems($plugin, $... | php | public function processPluginXML(Plugin $plugin, Errors &$errors, &$log = '', $xml = false)
{
if(!$xml)
$xml = $this->loadXML($plugin->Path);
$this->processConfig($plugin, $log, $xml);
$this->processPermissions($plugin, $log, $xml);
$this->processCMSNavItems($plugin, $... | [
"public",
"function",
"processPluginXML",
"(",
"Plugin",
"$",
"plugin",
",",
"Errors",
"&",
"$",
"errors",
",",
"&",
"$",
"log",
"=",
"''",
",",
"$",
"xml",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"xml",
")",
"$",
"xml",
"=",
"$",
"this",
... | Processes the plugin's plugin.xml file
@param Plugin $plugin The Plugin we're processing
@param Errors &$errors An errors object to update on errors
@param string &$log A log to update with status details
@param SimpleXMLExtended $xml If specified, use this XML
@return void | [
"Processes",
"the",
"plugin",
"s",
"plugin",
".",
"xml",
"file"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L309-L322 |
194,530 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.processPermissions | public function processPermissions(Plugin $plugin, &$log = '', $xml = false)
{
if(!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
// add permissions
$perms = $xml->permissi... | php | public function processPermissions(Plugin $plugin, &$log = '', $xml = false)
{
if(!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
// add permissions
$perms = $xml->permissi... | [
"public",
"function",
"processPermissions",
"(",
"Plugin",
"$",
"plugin",
",",
"&",
"$",
"log",
"=",
"''",
",",
"$",
"xml",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"xml",
")",
"$",
"xml",
"=",
"$",
"this",
"->",
"loadXML",
"(",
"$",
"plugin"... | Add all of the Plugin's permissions from the specified XML
@param Plugin $plugin The Plugin to process
@param string &$log A variable to update with log details
@param SimpleXMLExtended $xml If specified, process this XML, otherwise load the XML from the plugin
@return void | [
"Add",
"all",
"of",
"the",
"Plugin",
"s",
"permissions",
"from",
"the",
"specified",
"XML"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L367-L399 |
194,531 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.processConfig | public function processConfig(Plugin $plugin, &$log = '', $xml = false)
{
if (!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
//process config.php
if (!empty($xml->config))... | php | public function processConfig(Plugin $plugin, &$log = '', $xml = false)
{
if (!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
//process config.php
if (!empty($xml->config))... | [
"public",
"function",
"processConfig",
"(",
"Plugin",
"$",
"plugin",
",",
"&",
"$",
"log",
"=",
"''",
",",
"$",
"xml",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"xml",
")",
"$",
"xml",
"=",
"$",
"this",
"->",
"loadXML",
"(",
"$",
"plugin",
"... | Appends the plugin's config snippet to the config file
@param Plugin $plugin The plugin to process
@param string &$log A var that holds logging details
@param SimpleXMLExtended $xml If specified, process this XML instead of loading the plugins
@return void | [
"Appends",
"the",
"plugin",
"s",
"config",
"snippet",
"to",
"the",
"config",
"file"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L410-L425 |
194,532 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.processCMSNavItems | public function processCMSNavItems(Plugin $plugin, &$log = '', $xml = false)
{
if (!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
$processedSlugs = array();
// add cmsnavi... | php | public function processCMSNavItems(Plugin $plugin, &$log = '', $xml = false)
{
if (!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
$processedSlugs = array();
// add cmsnavi... | [
"public",
"function",
"processCMSNavItems",
"(",
"Plugin",
"$",
"plugin",
",",
"&",
"$",
"log",
"=",
"''",
",",
"$",
"xml",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"xml",
")",
"$",
"xml",
"=",
"$",
"this",
"->",
"loadXML",
"(",
"$",
"plugin"... | Add all the CMS nav items from the plugin
@param Plugin $plugin The plugin to analyze
@param string &$log A string that hold logging detail
@param SimpleXMLExtended $xml If specified, used this instead of the plugin's xml file
@return void | [
"Add",
"all",
"the",
"CMS",
"nav",
"items",
"from",
"the",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L569-L621 |
194,533 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.insertCMSNavItem | protected function insertCMSNavItem(CMSNavItem $cms_nav_item, Plugin $plugin)
{
$cms_nav_item->PluginID = $plugin->PluginID;
// if($cms_nav_item->Slug == '')
// $cms_nav_item->Slug = SlugUtils::createSlug($cms_nav_item->Label);
//
// if (empty($cms_nav_item->SortOrder))
// ... | php | protected function insertCMSNavItem(CMSNavItem $cms_nav_item, Plugin $plugin)
{
$cms_nav_item->PluginID = $plugin->PluginID;
// if($cms_nav_item->Slug == '')
// $cms_nav_item->Slug = SlugUtils::createSlug($cms_nav_item->Label);
//
// if (empty($cms_nav_item->SortOrder))
// ... | [
"protected",
"function",
"insertCMSNavItem",
"(",
"CMSNavItem",
"$",
"cms_nav_item",
",",
"Plugin",
"$",
"plugin",
")",
"{",
"$",
"cms_nav_item",
"->",
"PluginID",
"=",
"$",
"plugin",
"->",
"PluginID",
";",
"// if($cms_nav_item->Slug == '')",
"// $cm... | Inserts the specified CMS Nav Item
@param CMSNavItem $cms_nav_item The item to insert
@param Plugin $plugin The plugin that owns the nav item
@return boolean true on success | [
"Inserts",
"the",
"specified",
"CMS",
"Nav",
"Item"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L631-L661 |
194,534 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.processElements | protected function processElements(Plugin $plugin, &$log = '', $xml = false)
{
if (!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
$processedSlugs = array();
// add eleme... | php | protected function processElements(Plugin $plugin, &$log = '', $xml = false)
{
if (!$xml)
$xml = $this->loadXML($plugin->Path);
if(!$xml)
throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');
$processedSlugs = array();
// add eleme... | [
"protected",
"function",
"processElements",
"(",
"Plugin",
"$",
"plugin",
",",
"&",
"$",
"log",
"=",
"''",
",",
"$",
"xml",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"xml",
")",
"$",
"xml",
"=",
"$",
"this",
"->",
"loadXML",
"(",
"$",
"plugin"... | Add all the elements defined by this plugin
@param Plugin $plugin The plugin to analyze
@param string &$log A string to hold logging detail
@return void | [
"Add",
"all",
"the",
"elements",
"defined",
"by",
"this",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L671-L734 |
194,535 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.processInstallScript | public function processInstallScript(Plugin $plugin, &$log)
{
$script = $plugin->Path .'/install.php';
if(file_exists($script)) {
include_once $script;
}
} | php | public function processInstallScript(Plugin $plugin, &$log)
{
$script = $plugin->Path .'/install.php';
if(file_exists($script)) {
include_once $script;
}
} | [
"public",
"function",
"processInstallScript",
"(",
"Plugin",
"$",
"plugin",
",",
"&",
"$",
"log",
")",
"{",
"$",
"script",
"=",
"$",
"plugin",
"->",
"Path",
".",
"'/install.php'",
";",
"if",
"(",
"file_exists",
"(",
"$",
"script",
")",
")",
"{",
"inclu... | Runs the install script from the plugin
@param Plugin $plugin The Plugin to analyze
@param string &$log A log string that can be updated
@return void | [
"Runs",
"the",
"install",
"script",
"from",
"the",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L744-L750 |
194,536 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.processUpgradeScript | public function processUpgradeScript(Plugin $plugin, &$log, $installedVersion)
{
$script = $plugin->Path .'/upgrade.php';
if(file_exists($script))
include_once $script;
} | php | public function processUpgradeScript(Plugin $plugin, &$log, $installedVersion)
{
$script = $plugin->Path .'/upgrade.php';
if(file_exists($script))
include_once $script;
} | [
"public",
"function",
"processUpgradeScript",
"(",
"Plugin",
"$",
"plugin",
",",
"&",
"$",
"log",
",",
"$",
"installedVersion",
")",
"{",
"$",
"script",
"=",
"$",
"plugin",
"->",
"Path",
".",
"'/upgrade.php'",
";",
"if",
"(",
"file_exists",
"(",
"$",
"sc... | Runs the upgrade script for the plugin
@param Plugin $plugin The Plugin to analyze
@param string &$log A helpful string that will be appended with details of actions
@return void | [
"Runs",
"the",
"upgrade",
"script",
"for",
"the",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L760-L767 |
194,537 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.autoupgradePlugin | public function autoupgradePlugin(Plugin $plugin)
{
if(empty($plugin) || !$plugin->isInstalled() || !$plugin->isEnabled())
return;
$xml = $this->loadXML($plugin->Path);
if(empty($xml))
return;
if($plugin->Version != ($newversion = strval($xml->info->versio... | php | public function autoupgradePlugin(Plugin $plugin)
{
if(empty($plugin) || !$plugin->isInstalled() || !$plugin->isEnabled())
return;
$xml = $this->loadXML($plugin->Path);
if(empty($xml))
return;
if($plugin->Version != ($newversion = strval($xml->info->versio... | [
"public",
"function",
"autoupgradePlugin",
"(",
"Plugin",
"$",
"plugin",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"plugin",
")",
"||",
"!",
"$",
"plugin",
"->",
"isInstalled",
"(",
")",
"||",
"!",
"$",
"plugin",
"->",
"isEnabled",
"(",
")",
")",
"retu... | Reruns the aspect installation to upgrade the plugin if needed
@param Plugin $plugin The plugin to upgrade
@return void | [
"Reruns",
"the",
"aspect",
"installation",
"to",
"upgrade",
"the",
"plugin",
"if",
"needed"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L889-L937 |
194,538 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.upgradePlugin | public function upgradePlugin($pluginSlug, $pluginPath, Errors &$errors)
{
$log = "";
$plugin = $this->PluginService->getBySlug($pluginSlug);
$existingPriority = $plugin->Priority;
if (empty($plugin) || !$plugin->isInstalled()) {
$log .= "Plugin is not installed.";
... | php | public function upgradePlugin($pluginSlug, $pluginPath, Errors &$errors)
{
$log = "";
$plugin = $this->PluginService->getBySlug($pluginSlug);
$existingPriority = $plugin->Priority;
if (empty($plugin) || !$plugin->isInstalled()) {
$log .= "Plugin is not installed.";
... | [
"public",
"function",
"upgradePlugin",
"(",
"$",
"pluginSlug",
",",
"$",
"pluginPath",
",",
"Errors",
"&",
"$",
"errors",
")",
"{",
"$",
"log",
"=",
"\"\"",
";",
"$",
"plugin",
"=",
"$",
"this",
"->",
"PluginService",
"->",
"getBySlug",
"(",
"$",
"plug... | Force an upgrade of the specified plugin
@param string $pluginSlug The slug for the installed plugin
@param string $pluginPath The path to the plugin
@param Errors &$errors An errors object to update on error
@return array 2 items in this array. First, the log, second is a boolean indicating success (true on succe... | [
"Force",
"an",
"upgrade",
"of",
"the",
"specified",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L948-L991 |
194,539 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.uninstallPlugin | public function uninstallPlugin($pluginSlug, Errors $errors, $purge = false)
{
$log = "";
$plugin = $this->PluginService->getBySlug($pluginSlug);
if (empty($plugin) || !$plugin->isInstalled()) {
$log .= "Plugin not installed.";
return array($log,'fail');
}
... | php | public function uninstallPlugin($pluginSlug, Errors $errors, $purge = false)
{
$log = "";
$plugin = $this->PluginService->getBySlug($pluginSlug);
if (empty($plugin) || !$plugin->isInstalled()) {
$log .= "Plugin not installed.";
return array($log,'fail');
}
... | [
"public",
"function",
"uninstallPlugin",
"(",
"$",
"pluginSlug",
",",
"Errors",
"$",
"errors",
",",
"$",
"purge",
"=",
"false",
")",
"{",
"$",
"log",
"=",
"\"\"",
";",
"$",
"plugin",
"=",
"$",
"this",
"->",
"PluginService",
"->",
"getBySlug",
"(",
"$",... | Removes the specified plugin
@param string $pluginSlug The slug of the plugin to remove
@param Errors $errors An errors object to update if things go wrong
@param boolean $purge If true, then uninstall all elements and aspects from the plugin as well
@return array 2 items in this array. First, the log, sec... | [
"Removes",
"the",
"specified",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L1003-L1045 |
194,540 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.uninstallAspects | protected function uninstallAspects(Plugin $plugin)
{
$dto = new DTO(array('PluginID'=>$plugin->PluginID));
$aspects = $this->AspectService->findAll($dto)->getResults();
foreach ($aspects as $aspect) {
$this->AspectService->delete($aspect->Slug);
}
} | php | protected function uninstallAspects(Plugin $plugin)
{
$dto = new DTO(array('PluginID'=>$plugin->PluginID));
$aspects = $this->AspectService->findAll($dto)->getResults();
foreach ($aspects as $aspect) {
$this->AspectService->delete($aspect->Slug);
}
} | [
"protected",
"function",
"uninstallAspects",
"(",
"Plugin",
"$",
"plugin",
")",
"{",
"$",
"dto",
"=",
"new",
"DTO",
"(",
"array",
"(",
"'PluginID'",
"=>",
"$",
"plugin",
"->",
"PluginID",
")",
")",
";",
"$",
"aspects",
"=",
"$",
"this",
"->",
"AspectSe... | Removes all aspects that were installed by this plugin
@param Plugin $plugin The plugin with aspects to remove
@return void | [
"Removes",
"all",
"aspects",
"that",
"were",
"installed",
"by",
"this",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L1054-L1063 |
194,541 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/plugins/PluginInstallationService.php | PluginInstallationService.uninstallCMSNavItems | protected function uninstallCMSNavItems(Plugin $plugin)
{
$dto = new DTO(array('PluginID' => $plugin->PluginID));
$navitems = $this->CMSNavItemService->findAll($dto)->getResults();
rsort($navitems);
foreach ($navitems as $navitem) {
$this->CMSNavItemService->delete($nav... | php | protected function uninstallCMSNavItems(Plugin $plugin)
{
$dto = new DTO(array('PluginID' => $plugin->PluginID));
$navitems = $this->CMSNavItemService->findAll($dto)->getResults();
rsort($navitems);
foreach ($navitems as $navitem) {
$this->CMSNavItemService->delete($nav... | [
"protected",
"function",
"uninstallCMSNavItems",
"(",
"Plugin",
"$",
"plugin",
")",
"{",
"$",
"dto",
"=",
"new",
"DTO",
"(",
"array",
"(",
"'PluginID'",
"=>",
"$",
"plugin",
"->",
"PluginID",
")",
")",
";",
"$",
"navitems",
"=",
"$",
"this",
"->",
"CMS... | Removes all cms nav items that were installed by this plugin
@param Plugin $plugin The plugin with cms nav items to remove
@return void | [
"Removes",
"all",
"cms",
"nav",
"items",
"that",
"were",
"installed",
"by",
"this",
"plugin"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/plugins/PluginInstallationService.php#L1072-L1082 |
194,542 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Event/ListenerAttacherTrait.php | ListenerAttacherTrait.attachListeners | private function attachListeners(HasEmitterInterface $object, array $listeners)
{
$emitter = $object->getEmitter();
foreach ($listeners as $el) {
if ($el['once']) {
$emitter->once($el['name'], $el['fn'], $el['priority']);
} else {
$emitter->on(... | php | private function attachListeners(HasEmitterInterface $object, array $listeners)
{
$emitter = $object->getEmitter();
foreach ($listeners as $el) {
if ($el['once']) {
$emitter->once($el['name'], $el['fn'], $el['priority']);
} else {
$emitter->on(... | [
"private",
"function",
"attachListeners",
"(",
"HasEmitterInterface",
"$",
"object",
",",
"array",
"$",
"listeners",
")",
"{",
"$",
"emitter",
"=",
"$",
"object",
"->",
"getEmitter",
"(",
")",
";",
"foreach",
"(",
"$",
"listeners",
"as",
"$",
"el",
")",
... | Attaches event listeners and properly sets their priorities and whether
or not they are are only executed once.
@param HasEmitterInterface $object Object that has the event emitter.
@param array $listeners Array of hashes representing event
event listeners. Each item contains
"name", "fn", "priority",... | [
"Attaches",
"event",
"listeners",
"and",
"properly",
"sets",
"their",
"priorities",
"and",
"whether",
"or",
"not",
"they",
"are",
"are",
"only",
"executed",
"once",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Event/ListenerAttacherTrait.php#L21-L31 |
194,543 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Event/ListenerAttacherTrait.php | ListenerAttacherTrait.buildListener | private function buildListener($name, $data, &$listeners)
{
static $defaults = ['priority' => 0, 'once' => false];
// If a callable is provided, normalize it to the array format.
if (is_callable($data)) {
$data = ['fn' => $data];
}
// Prepare the listener and ad... | php | private function buildListener($name, $data, &$listeners)
{
static $defaults = ['priority' => 0, 'once' => false];
// If a callable is provided, normalize it to the array format.
if (is_callable($data)) {
$data = ['fn' => $data];
}
// Prepare the listener and ad... | [
"private",
"function",
"buildListener",
"(",
"$",
"name",
",",
"$",
"data",
",",
"&",
"$",
"listeners",
")",
"{",
"static",
"$",
"defaults",
"=",
"[",
"'priority'",
"=>",
"0",
",",
"'once'",
"=>",
"false",
"]",
";",
"// If a callable is provided, normalize i... | Creates a complete event listener definition from the provided array of
listener data. Also works recursively if more than one listeners are
contained in the provided array.
@param string $name Name of the event the listener is for.
@param array|callable $data Event listener data to prepare.
@param a... | [
"Creates",
"a",
"complete",
"event",
"listener",
"definition",
"from",
"the",
"provided",
"array",
"of",
"listener",
"data",
".",
"Also",
"works",
"recursively",
"if",
"more",
"than",
"one",
"listeners",
"are",
"contained",
"in",
"the",
"provided",
"array",
".... | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Event/ListenerAttacherTrait.php#L67-L88 |
194,544 | swaros/golib | src/Types/Timer.php | Timer.validTimeStr | public function validTimeStr ( $time ) {
if ($time === '0000-00-00 00:00:00') {
return true;
}
if ($this->fitNonExistingDates && $this->isNonExistingTimeString( $time )) {
$time = $this->getPossibleDateString( $time );
}
return (is_string( $time ) && str... | php | public function validTimeStr ( $time ) {
if ($time === '0000-00-00 00:00:00') {
return true;
}
if ($this->fitNonExistingDates && $this->isNonExistingTimeString( $time )) {
$time = $this->getPossibleDateString( $time );
}
return (is_string( $time ) && str... | [
"public",
"function",
"validTimeStr",
"(",
"$",
"time",
")",
"{",
"if",
"(",
"$",
"time",
"===",
"'0000-00-00 00:00:00'",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"fitNonExistingDates",
"&&",
"$",
"this",
"->",
"isNonExistingTime... | validate an string ... only valid datestring will pass
@param string $time formated for Y-m-d H:i:s
@return boolan | [
"validate",
"an",
"string",
"...",
"only",
"valid",
"datestring",
"will",
"pass"
] | 9e75c8fb36de7c09b01a6c1c0d27c45f02fed567 | https://github.com/swaros/golib/blob/9e75c8fb36de7c09b01a6c1c0d27c45f02fed567/src/Types/Timer.php#L132-L143 |
194,545 | Eden-PHP/Block | Form/Address.php | Address.setData | public function setData($data)
{
if(is_array($data)) {
$this->data = $data;
}
$args = func_get_args();
$this->data[$args[0]] = $args[1];
return $this;
} | php | public function setData($data)
{
if(is_array($data)) {
$this->data = $data;
}
$args = func_get_args();
$this->data[$args[0]] = $args[1];
return $this;
} | [
"public",
"function",
"setData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"data",
";",
"}",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"this",
"->",
"da... | Sets form data
@param array|string
@return Eden\Block\Form\Address | [
"Sets",
"form",
"data"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Form/Address.php#L335-L345 |
194,546 | Eden-PHP/Block | Form/Address.php | Address.setHolders | public function setHolders($holders)
{
if(is_array($holders)) {
$this->holders = $holders;
}
$args = func_get_args();
$this->holders[$args[0]] = $args[1];
return $this;
} | php | public function setHolders($holders)
{
if(is_array($holders)) {
$this->holders = $holders;
}
$args = func_get_args();
$this->holders[$args[0]] = $args[1];
return $this;
} | [
"public",
"function",
"setHolders",
"(",
"$",
"holders",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"holders",
")",
")",
"{",
"$",
"this",
"->",
"holders",
"=",
"$",
"holders",
";",
"}",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"this"... | Sets place holders
@param string|array
@return Eden\Block\Form\Address | [
"Sets",
"place",
"holders"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Form/Address.php#L385-L395 |
194,547 | Eden-PHP/Block | Form/Address.php | Address.show | public function show(array $fields)
{
$this->show = array();
foreach($fields as $field) {
$this->show[$field] = true;
}
return $this;
} | php | public function show(array $fields)
{
$this->show = array();
foreach($fields as $field) {
$this->show[$field] = true;
}
return $this;
} | [
"public",
"function",
"show",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"this",
"->",
"show",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"show",
"[",
"$",
"field",
"]",
"=",
"t... | Shows only the specified in the order specified
@param array
@return Eden\Block\Form\Address | [
"Shows",
"only",
"the",
"specified",
"in",
"the",
"order",
"specified"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Form/Address.php#L469-L478 |
194,548 | ndavison/groundwork-framework | src/Groundwork/Classes/Container.php | Container.register | public function register($alias, \Closure $closure)
{
if (!is_string($alias))
throw new Exception('Application::register() requires a string as the first parameter.');
$this->registered[$alias] = $closure;
return true;
} | php | public function register($alias, \Closure $closure)
{
if (!is_string($alias))
throw new Exception('Application::register() requires a string as the first parameter.');
$this->registered[$alias] = $closure;
return true;
} | [
"public",
"function",
"register",
"(",
"$",
"alias",
",",
"\\",
"Closure",
"$",
"closure",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"alias",
")",
")",
"throw",
"new",
"Exception",
"(",
"'Application::register() requires a string as the first parameter.'",
... | Registers a alias and Closure pair in the IoC container.
@param string $alias
@param \Closure $closure
@return boolean | [
"Registers",
"a",
"alias",
"and",
"Closure",
"pair",
"in",
"the",
"IoC",
"container",
"."
] | c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c | https://github.com/ndavison/groundwork-framework/blob/c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c/src/Groundwork/Classes/Container.php#L33-L41 |
194,549 | ndavison/groundwork-framework | src/Groundwork/Classes/Container.php | Container.get | public function get($alias)
{
if (!isset($this->registered[$alias]))
return false;
// Does an instance exist for this alias?
if (isset($this->instance[$alias]) && is_object($this->instance[$alias]))
return $this->instance[$alias];
// Execute ... | php | public function get($alias)
{
if (!isset($this->registered[$alias]))
return false;
// Does an instance exist for this alias?
if (isset($this->instance[$alias]) && is_object($this->instance[$alias]))
return $this->instance[$alias];
// Execute ... | [
"public",
"function",
"get",
"(",
"$",
"alias",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"registered",
"[",
"$",
"alias",
"]",
")",
")",
"return",
"false",
";",
"// Does an instance exist for this alias?",
"if",
"(",
"isset",
"(",
"$",
... | Returns the instance associated with the supplied alias.
@param string $alias
@return object|boolean | [
"Returns",
"the",
"instance",
"associated",
"with",
"the",
"supplied",
"alias",
"."
] | c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c | https://github.com/ndavison/groundwork-framework/blob/c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c/src/Groundwork/Classes/Container.php#L49-L64 |
194,550 | ndavison/groundwork-framework | src/Groundwork/Classes/Container.php | Container.getNew | public function getNew($alias)
{
if (!isset($this->registered[$alias]))
return false;
// Execute the Closure to get the first instance
$object = $this->registered[$alias]($this);
if (!is_object($object))
throw new Exception('The alias "' . $alias . '"... | php | public function getNew($alias)
{
if (!isset($this->registered[$alias]))
return false;
// Execute the Closure to get the first instance
$object = $this->registered[$alias]($this);
if (!is_object($object))
throw new Exception('The alias "' . $alias . '"... | [
"public",
"function",
"getNew",
"(",
"$",
"alias",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"registered",
"[",
"$",
"alias",
"]",
")",
")",
"return",
"false",
";",
"// Execute the Closure to get the first instance",
"$",
"object",
"=",
"$... | Returns a new instance associated with the supplies alias.
@param string $alias
@return object|boolean | [
"Returns",
"a",
"new",
"instance",
"associated",
"with",
"the",
"supplies",
"alias",
"."
] | c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c | https://github.com/ndavison/groundwork-framework/blob/c3d22a1410c8d8a07b4ca1f99a35a1181516cd6c/src/Groundwork/Classes/Container.php#L72-L83 |
194,551 | ciims/ciims-modules-hybridauth | models/RemoteLinkAccountForm.php | RemoteLinkAccountForm.validateUserPassword | public function validateUserPassword($attributes, $params)
{
$this->_user = Users::model()->findByPk(Yii::app()->user->id);
if ($this->_user == NULL)
{
$this->addError('password', Yii::t('HybridAuth.main', 'Unable to identify user.'));
return false;
}
... | php | public function validateUserPassword($attributes, $params)
{
$this->_user = Users::model()->findByPk(Yii::app()->user->id);
if ($this->_user == NULL)
{
$this->addError('password', Yii::t('HybridAuth.main', 'Unable to identify user.'));
return false;
}
... | [
"public",
"function",
"validateUserPassword",
"(",
"$",
"attributes",
",",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"_user",
"=",
"Users",
"::",
"model",
"(",
")",
"->",
"findByPk",
"(",
"Yii",
"::",
"app",
"(",
")",
"->",
"user",
"->",
"id",
")",... | Ensures that the password entered matches the one provided during registration
@param array $attributes
@param array $params
return array | [
"Ensures",
"that",
"the",
"password",
"entered",
"matches",
"the",
"one",
"provided",
"during",
"registration"
] | 417b2682bf3468dd509164a9b773d886359a7aec | https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/models/RemoteLinkAccountForm.php#L55-L76 |
194,552 | ciims/ciims-modules-hybridauth | models/RemoteLinkAccountForm.php | RemoteLinkAccountForm.save | public function save()
{
if (!$this->validate())
return false;
$meta = new UserMetadata;
$meta->attributes = array(
'user_id' => $this->_user->id,
'key' => $this->provider.'Provider',
'value' => $this->adapter->identifier
);
/... | php | public function save()
{
if (!$this->validate())
return false;
$meta = new UserMetadata;
$meta->attributes = array(
'user_id' => $this->_user->id,
'key' => $this->provider.'Provider',
'value' => $this->adapter->identifier
);
/... | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"return",
"false",
";",
"$",
"meta",
"=",
"new",
"UserMetadata",
";",
"$",
"meta",
"->",
"attributes",
"=",
"array",
"(",
"'user_id'",
"=>",
... | Bind's the user identity to the mdoel
@return boolean | [
"Bind",
"s",
"the",
"user",
"identity",
"to",
"the",
"mdoel"
] | 417b2682bf3468dd509164a9b773d886359a7aec | https://github.com/ciims/ciims-modules-hybridauth/blob/417b2682bf3468dd509164a9b773d886359a7aec/models/RemoteLinkAccountForm.php#L82-L96 |
194,553 | kambalabs/KmbPmProxy | src/KmbPmProxy/Hydrator/RevisionHydrator.php | RevisionHydrator.hydrate | public function hydrate($puppetModules, $revision)
{
if ($revision->hasGroups()) {
foreach ($revision->getGroups() as $group) {
$this->groupHydrator->hydrate($puppetModules, $group);
}
}
} | php | public function hydrate($puppetModules, $revision)
{
if ($revision->hasGroups()) {
foreach ($revision->getGroups() as $group) {
$this->groupHydrator->hydrate($puppetModules, $group);
}
}
} | [
"public",
"function",
"hydrate",
"(",
"$",
"puppetModules",
",",
"$",
"revision",
")",
"{",
"if",
"(",
"$",
"revision",
"->",
"hasGroups",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"revision",
"->",
"getGroups",
"(",
")",
"as",
"$",
"group",
")",
"{",... | Hydrate revision with the provided puppet modules data.
@param PuppetModule[] $puppetModules
@param RevisionInterface $revision
@return RevisionInterface | [
"Hydrate",
"revision",
"with",
"the",
"provided",
"puppet",
"modules",
"data",
"."
] | b4c664ae8b6f29e4e8768461ed99e1b0b80bde18 | https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Hydrator/RevisionHydrator.php#L38-L45 |
194,554 | koolkode/stream | src/ChunkEncodedInputStream.php | ChunkEncodedInputStream.loadBuffer | protected function loadBuffer()
{
$this->buffer = '';
if($this->finished)
{
return;
}
while(!$this->stream->eof() && strlen($this->buffer) < $this->chunkSize)
{
$this->buffer .= $this->stream->read($this->chunkSize - strlen($this->buffer));
}
if($this->buffer === '')
{
$this->finishe... | php | protected function loadBuffer()
{
$this->buffer = '';
if($this->finished)
{
return;
}
while(!$this->stream->eof() && strlen($this->buffer) < $this->chunkSize)
{
$this->buffer .= $this->stream->read($this->chunkSize - strlen($this->buffer));
}
if($this->buffer === '')
{
$this->finishe... | [
"protected",
"function",
"loadBuffer",
"(",
")",
"{",
"$",
"this",
"->",
"buffer",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"finished",
")",
"{",
"return",
";",
"}",
"while",
"(",
"!",
"$",
"this",
"->",
"stream",
"->",
"eof",
"(",
")",
"&&"... | Read data from the underlying input stream into the read buffer. | [
"Read",
"data",
"from",
"the",
"underlying",
"input",
"stream",
"into",
"the",
"read",
"buffer",
"."
] | 05e83efd76e1cb9e40a972711986b4a7e38bc141 | https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/ChunkEncodedInputStream.php#L159-L182 |
194,555 | ezra-obiwale/dSCore | src/Core/Flash.php | Flash.getMessage | final public function getMessage($parsed = true) {
return ($parsed) ? $this->parseMessages($this->messages) :
$this->messages;
} | php | final public function getMessage($parsed = true) {
return ($parsed) ? $this->parseMessages($this->messages) :
$this->messages;
} | [
"final",
"public",
"function",
"getMessage",
"(",
"$",
"parsed",
"=",
"true",
")",
"{",
"return",
"(",
"$",
"parsed",
")",
"?",
"$",
"this",
"->",
"parseMessages",
"(",
"$",
"this",
"->",
"messages",
")",
":",
"$",
"this",
"->",
"messages",
";",
"}"
... | Fetches the flash message
@return string | [
"Fetches",
"the",
"flash",
"message"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Flash.php#L56-L59 |
194,556 | ezra-obiwale/dSCore | src/Core/Flash.php | Flash.getSuccessMessage | final public function getSuccessMessage($parsed = true) {
return ($parsed) ? $this->parseMessages($this->successMessages) :
$this->successMessages;
} | php | final public function getSuccessMessage($parsed = true) {
return ($parsed) ? $this->parseMessages($this->successMessages) :
$this->successMessages;
} | [
"final",
"public",
"function",
"getSuccessMessage",
"(",
"$",
"parsed",
"=",
"true",
")",
"{",
"return",
"(",
"$",
"parsed",
")",
"?",
"$",
"this",
"->",
"parseMessages",
"(",
"$",
"this",
"->",
"successMessages",
")",
":",
"$",
"this",
"->",
"successMes... | Fetches the flash success message
@return string | [
"Fetches",
"the",
"flash",
"success",
"message"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Flash.php#L84-L87 |
194,557 | ezra-obiwale/dSCore | src/Core/Flash.php | Flash.getErrorMessage | final public function getErrorMessage($parsed = true) {
return ($parsed) ? $this->parseMessages($this->errorMessages) :
$this->errorMessages;
} | php | final public function getErrorMessage($parsed = true) {
return ($parsed) ? $this->parseMessages($this->errorMessages) :
$this->errorMessages;
} | [
"final",
"public",
"function",
"getErrorMessage",
"(",
"$",
"parsed",
"=",
"true",
")",
"{",
"return",
"(",
"$",
"parsed",
")",
"?",
"$",
"this",
"->",
"parseMessages",
"(",
"$",
"this",
"->",
"errorMessages",
")",
":",
"$",
"this",
"->",
"errorMessages"... | Fetches the flash error message
@return string | [
"Fetches",
"the",
"flash",
"error",
"message"
] | dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d | https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/Core/Flash.php#L112-L115 |
194,558 | Wedeto/HTTP | src/Responder.php | Responder.process | public function process(Request $request, Result $result)
{
$this->setRequest($request);
$this->setResult($result);
$this->respond();
} | php | public function process(Request $request, Result $result)
{
$this->setRequest($request);
$this->setResult($result);
$this->respond();
} | [
"public",
"function",
"process",
"(",
"Request",
"$",
"request",
",",
"Result",
"$",
"result",
")",
"{",
"$",
"this",
"->",
"setRequest",
"(",
"$",
"request",
")",
";",
"$",
"this",
"->",
"setResult",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
... | Implement the Processor interface.
@param Wedeto\HTTP\Request $request The request answered
@param Wedeto\HTTP\Response $response The response to the request | [
"Implement",
"the",
"Processor",
"interface",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Responder.php#L73-L78 |
194,559 | Wedeto/HTTP | src/Responder.php | Responder.setResponseCode | public function setResponseCode(int $code)
{
if ($code < 100 || $code > 599)
{
$err = new \InvalidArgumentException("Attempting to set status code to $code");
self::$logger->critical("Invalid status {0}: {1}", [$code, $err]);
$this->response_code = 500;
}
... | php | public function setResponseCode(int $code)
{
if ($code < 100 || $code > 599)
{
$err = new \InvalidArgumentException("Attempting to set status code to $code");
self::$logger->critical("Invalid status {0}: {1}", [$code, $err]);
$this->response_code = 500;
}
... | [
"public",
"function",
"setResponseCode",
"(",
"int",
"$",
"code",
")",
"{",
"if",
"(",
"$",
"code",
"<",
"100",
"||",
"$",
"code",
">",
"599",
")",
"{",
"$",
"err",
"=",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Attempting to set status code to $code\... | Set the HTTP Response code
@param int $code The HTTP response code
@return Wedeto\HTTP\Responder Provides fluent interface | [
"Set",
"the",
"HTTP",
"Response",
"code"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Responder.php#L192-L205 |
194,560 | Wedeto/HTTP | src/Responder.php | Responder.endAllOutputBuffers | public function endAllOutputBuffers($lvl = 0)
{
$ob_cnt = 0;
while (ob_get_level() > $lvl)
{
++$ob_cnt;
$contents = ob_get_contents();
ob_end_clean();
if (self::$logger instanceof \Psr\Log\NullLogger)
continue;
... | php | public function endAllOutputBuffers($lvl = 0)
{
$ob_cnt = 0;
while (ob_get_level() > $lvl)
{
++$ob_cnt;
$contents = ob_get_contents();
ob_end_clean();
if (self::$logger instanceof \Psr\Log\NullLogger)
continue;
... | [
"public",
"function",
"endAllOutputBuffers",
"(",
"$",
"lvl",
"=",
"0",
")",
"{",
"$",
"ob_cnt",
"=",
"0",
";",
"while",
"(",
"ob_get_level",
"(",
")",
">",
"$",
"lvl",
")",
"{",
"++",
"$",
"ob_cnt",
";",
"$",
"contents",
"=",
"ob_get_contents",
"(",... | Close all active output buffers and log their contents | [
"Close",
"all",
"active",
"output",
"buffers",
"and",
"log",
"their",
"contents"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Responder.php#L218-L237 |
194,561 | Wedeto/HTTP | src/Responder.php | Responder.respond | public function respond()
{
// Make sure there always is a response
if (null === $this->result)
{
$this->result = new Result;
$this->result->setResponse(new Error(500, "No output produced"));
}
// Close and log all script output that hasn't be... | php | public function respond()
{
// Make sure there always is a response
if (null === $this->result)
{
$this->result = new Result;
$this->result->setResponse(new Error(500, "No output produced"));
}
// Close and log all script output that hasn't be... | [
"public",
"function",
"respond",
"(",
")",
"{",
"// Make sure there always is a response",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"result",
")",
"{",
"$",
"this",
"->",
"result",
"=",
"new",
"Result",
";",
"$",
"this",
"->",
"result",
"->",
"setRespo... | Prepare the output before sending it, run hooks, collect headers and
finally call doRespond which produces the output. | [
"Prepare",
"the",
"output",
"before",
"sending",
"it",
"run",
"hooks",
"collect",
"headers",
"and",
"finally",
"call",
"doRespond",
"which",
"produces",
"the",
"output",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Responder.php#L243-L313 |
194,562 | Wedeto/HTTP | src/Responder.php | Responder.doOutput | protected function doOutput(string $mime)
{
// Set HTTP response code
http_response_code($this->response_code);
// Set headers
if (!headers_sent())
{
foreach ($this->headers as $name => $value)
header($name . ': ' . $value);
/... | php | protected function doOutput(string $mime)
{
// Set HTTP response code
http_response_code($this->response_code);
// Set headers
if (!headers_sent())
{
foreach ($this->headers as $name => $value)
header($name . ': ' . $value);
/... | [
"protected",
"function",
"doOutput",
"(",
"string",
"$",
"mime",
")",
"{",
"// Set HTTP response code",
"http_response_code",
"(",
"$",
"this",
"->",
"response_code",
")",
";",
"// Set headers",
"if",
"(",
"!",
"headers_sent",
"(",
")",
")",
"{",
"foreach",
"(... | This method sends data to the client after all preparational work has
been done.
@param string $mime The mime-type of the response that has been selected | [
"This",
"method",
"sends",
"data",
"to",
"the",
"client",
"after",
"all",
"preparational",
"work",
"has",
"been",
"done",
"."
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Responder.php#L322-L356 |
194,563 | Formula9/Core | src/Silex/Application/FormTrait.php | FormTrait.namedForm | public function namedForm($name, $data = null, array $options = array(), $type = null)
{
return $this['form.factory']->createNamedBuilder($name, $type ?: FormType::class, $data, $options);
} | php | public function namedForm($name, $data = null, array $options = array(), $type = null)
{
return $this['form.factory']->createNamedBuilder($name, $type ?: FormType::class, $data, $options);
} | [
"public",
"function",
"namedForm",
"(",
"$",
"name",
",",
"$",
"data",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"type",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"[",
"'form.factory'",
"]",
"->",
"createNamedBu... | Creates and returns a named form builder instance.
@param string $name
@param mixed $data The initial data for the form
@param array $options Options for the form
@param string|FormTypeInterface $type Type of the form
@return FormBuilder | [
"Creates",
"and",
"returns",
"a",
"named",
"form",
"builder",
"instance",
"."
] | 7786e873bceaa32a6ac36b10c959628739218011 | https://github.com/Formula9/Core/blob/7786e873bceaa32a6ac36b10c959628739218011/src/Silex/Application/FormTrait.php#L51-L54 |
194,564 | nanbando/mysql | src/MysqlPlugin.php | MysqlPlugin.getExportCommand | private function getExportCommand(array $parameter, $file, $hidePassword = false)
{
$username = $parameter['username'];
$password = $parameter['password'];
$database = $parameter['database'];
$host = $parameter['host'];
$port = $parameter['port'];
return sprintf(
... | php | private function getExportCommand(array $parameter, $file, $hidePassword = false)
{
$username = $parameter['username'];
$password = $parameter['password'];
$database = $parameter['database'];
$host = $parameter['host'];
$port = $parameter['port'];
return sprintf(
... | [
"private",
"function",
"getExportCommand",
"(",
"array",
"$",
"parameter",
",",
"$",
"file",
",",
"$",
"hidePassword",
"=",
"false",
")",
"{",
"$",
"username",
"=",
"$",
"parameter",
"[",
"'username'",
"]",
";",
"$",
"password",
"=",
"$",
"parameter",
"[... | Returns command to export database.
@param array $parameter
@param string $file
@param bool $hidePassword
@return string | [
"Returns",
"command",
"to",
"export",
"database",
"."
] | d4cfb2b60c180ac77ae42fcb30b7e7f3452ba1bd | https://github.com/nanbando/mysql/blob/d4cfb2b60c180ac77ae42fcb30b7e7f3452ba1bd/src/MysqlPlugin.php#L102-L119 |
194,565 | nanbando/mysql | src/MysqlPlugin.php | MysqlPlugin.getImportCommand | private function getImportCommand(array $parameter, $file, $hidePassword = false)
{
$username = $parameter['username'];
$password = $parameter['password'];
$database = $parameter['database'];
$host = $parameter['host'];
$port = $parameter['port'];
return sprintf(
... | php | private function getImportCommand(array $parameter, $file, $hidePassword = false)
{
$username = $parameter['username'];
$password = $parameter['password'];
$database = $parameter['database'];
$host = $parameter['host'];
$port = $parameter['port'];
return sprintf(
... | [
"private",
"function",
"getImportCommand",
"(",
"array",
"$",
"parameter",
",",
"$",
"file",
",",
"$",
"hidePassword",
"=",
"false",
")",
"{",
"$",
"username",
"=",
"$",
"parameter",
"[",
"'username'",
"]",
";",
"$",
"password",
"=",
"$",
"parameter",
"[... | Returns command to import database.
@param array $parameter
@param string $file
@param bool $hidePassword
@return string | [
"Returns",
"command",
"to",
"import",
"database",
"."
] | d4cfb2b60c180ac77ae42fcb30b7e7f3452ba1bd | https://github.com/nanbando/mysql/blob/d4cfb2b60c180ac77ae42fcb30b7e7f3452ba1bd/src/MysqlPlugin.php#L130-L147 |
194,566 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Data/AbstractEndpointData.php | AbstractEndpointData.setProperties | public function setProperties(array $properties) {
if (!isset($properties[self::DATA_PROPERTY_REQUIRED])){
$properties[self::DATA_PROPERTY_REQUIRED] = array();
}
if (!isset($properties[self::DATA_PROPERTY_DEFAULTS])){
$properties[self::DATA_PROPERTY_DEFAULTS] = array();
... | php | public function setProperties(array $properties) {
if (!isset($properties[self::DATA_PROPERTY_REQUIRED])){
$properties[self::DATA_PROPERTY_REQUIRED] = array();
}
if (!isset($properties[self::DATA_PROPERTY_DEFAULTS])){
$properties[self::DATA_PROPERTY_DEFAULTS] = array();
... | [
"public",
"function",
"setProperties",
"(",
"array",
"$",
"properties",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"properties",
"[",
"self",
"::",
"DATA_PROPERTY_REQUIRED",
"]",
")",
")",
"{",
"$",
"properties",
"[",
"self",
"::",
"DATA_PROPERTY_REQUIRED"... | Set properties for data
@param array $properties
@return $this | [
"Set",
"properties",
"for",
"data"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Data/AbstractEndpointData.php#L148-L157 |
194,567 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Data/AbstractEndpointData.php | AbstractEndpointData.configureDefaultData | protected function configureDefaultData(){
if (isset($this->properties['defaults']) && is_array($this->properties['defaults'])){
foreach($this->properties['defaults'] as $data => $value){
if (!isset($this->data[$data])){
$this->data[$data] = $value;
... | php | protected function configureDefaultData(){
if (isset($this->properties['defaults']) && is_array($this->properties['defaults'])){
foreach($this->properties['defaults'] as $data => $value){
if (!isset($this->data[$data])){
$this->data[$data] = $value;
... | [
"protected",
"function",
"configureDefaultData",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"properties",
"[",
"'defaults'",
"]",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"properties",
"[",
"'defaults'",
"]",
")",
")",
"{",
"foreach... | Configures Data with defaults based on properties array
@return $this | [
"Configures",
"Data",
"with",
"defaults",
"based",
"on",
"properties",
"array"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Data/AbstractEndpointData.php#L192-L201 |
194,568 | MichaelJ2324/PHP-REST-Client | src/Endpoint/Data/AbstractEndpointData.php | AbstractEndpointData.verifyRequiredData | protected function verifyRequiredData()
{
$errors = array(
'missing' => array(),
'invalid' => array()
);
$error = FALSE;
if (!empty($this->properties['required'])) {
foreach ($this->properties['required'] as $property => $type) {
if... | php | protected function verifyRequiredData()
{
$errors = array(
'missing' => array(),
'invalid' => array()
);
$error = FALSE;
if (!empty($this->properties['required'])) {
foreach ($this->properties['required'] as $property => $type) {
if... | [
"protected",
"function",
"verifyRequiredData",
"(",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
"'missing'",
"=>",
"array",
"(",
")",
",",
"'invalid'",
"=>",
"array",
"(",
")",
")",
";",
"$",
"error",
"=",
"FALSE",
";",
"if",
"(",
"!",
"empty",
"(",
... | Validate Required Data for the Endpoint
@return bool
@throws InvalidData | [
"Validate",
"Required",
"Data",
"for",
"the",
"Endpoint"
] | b8a2caaf6456eccaa845ba5c5098608aa9645c92 | https://github.com/MichaelJ2324/PHP-REST-Client/blob/b8a2caaf6456eccaa845ba5c5098608aa9645c92/src/Endpoint/Data/AbstractEndpointData.php#L208-L239 |
194,569 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/elements/ElementDAO.php | ElementDAO.preCacheTranslateObject | public function preCacheTranslateObject(ModelObject $obj)
{
// merge aspects
//$db = $this->getConnection();
// $q = new Query();
// $q->select('aspectid');
// $q->from('elementaspectrel');
// $q->where("elementid = {$db->quote($obj->{$obj->getPrimaryKey()})}");
// ... | php | public function preCacheTranslateObject(ModelObject $obj)
{
// merge aspects
//$db = $this->getConnection();
// $q = new Query();
// $q->select('aspectid');
// $q->from('elementaspectrel');
// $q->where("elementid = {$db->quote($obj->{$obj->getPrimaryKey()})}");
// ... | [
"public",
"function",
"preCacheTranslateObject",
"(",
"ModelObject",
"$",
"obj",
")",
"{",
"// merge aspects",
"//$db = $this->getConnection();",
"// $q = new Query();",
"// $q->select('aspectid');",
"// $q->from('elementaspectrel');",
"// $q->where(\"elementi... | Sets the schema for the element
@param Element $obj The element to analyze
@return Element the translated element | [
"Sets",
"the",
"schema",
"for",
"the",
"element"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/elements/ElementDAO.php#L57-L106 |
194,570 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/elements/ElementDAO.php | ElementDAO.findAll | public function findAll(DTO $dto)
{
if($dto->hasParameter($this->getModel()->getPrimaryKey())
|| $dto->hasParameter('Slug')
|| $dto->hasParameter('PluginID')
// || $dto->hasParameter('DefaultOrder')
// || $dto->hasParameter('StartDate')
// || $dto->hasParameter('En... | php | public function findAll(DTO $dto)
{
if($dto->hasParameter($this->getModel()->getPrimaryKey())
|| $dto->hasParameter('Slug')
|| $dto->hasParameter('PluginID')
// || $dto->hasParameter('DefaultOrder')
// || $dto->hasParameter('StartDate')
// || $dto->hasParameter('En... | [
"public",
"function",
"findAll",
"(",
"DTO",
"$",
"dto",
")",
"{",
"if",
"(",
"$",
"dto",
"->",
"hasParameter",
"(",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"getPrimaryKey",
"(",
")",
")",
"||",
"$",
"dto",
"->",
"hasParameter",
"(",
"'Slug'",... | Finds matching elements
@param DTO $dto A DTO that can accept the following params:
<PrimaryKey>
Slug
PluginID
Anchored
DefaultOrder
AnchoredSiteID
StartDate string ModifiedDate is after this
EndDate string ModifiedDate is before this
Search string Matches any part of name, slug, ... | [
"Finds",
"matching",
"elements"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/elements/ElementDAO.php#L126-L222 |
194,571 | linpax/microphp-framework | src/web/Ftp.php | Ftp.cd | public function cd($directory = null)
{
if (\ftp_chdir($this->_stream, $directory)) {
return true;
}
$this->error = "Failed to change directory to \"{$directory}\"";
return false;
} | php | public function cd($directory = null)
{
if (\ftp_chdir($this->_stream, $directory)) {
return true;
}
$this->error = "Failed to change directory to \"{$directory}\"";
return false;
} | [
"public",
"function",
"cd",
"(",
"$",
"directory",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"ftp_chdir",
"(",
"$",
"this",
"->",
"_stream",
",",
"$",
"directory",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"this",
"->",
"error",
"=",
"\"Failed ... | Change current directory on FTP server
@param string $directory
@return bool | [
"Change",
"current",
"directory",
"on",
"FTP",
"server"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/web/Ftp.php#L128-L137 |
194,572 | linpax/microphp-framework | src/web/Ftp.php | Ftp.delete | public function delete($remote_file = null)
{
if (\ftp_delete($this->_stream, $remote_file)) {
return true;
}
$this->error = 'Failed to delete file "'.$remote_file.'"';
return false;
} | php | public function delete($remote_file = null)
{
if (\ftp_delete($this->_stream, $remote_file)) {
return true;
}
$this->error = 'Failed to delete file "'.$remote_file.'"';
return false;
} | [
"public",
"function",
"delete",
"(",
"$",
"remote_file",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"ftp_delete",
"(",
"$",
"this",
"->",
"_stream",
",",
"$",
"remote_file",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"this",
"->",
"error",
"=",
"... | Delete file on FTP server
@param string $remote_file
@return bool | [
"Delete",
"file",
"on",
"FTP",
"server"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/web/Ftp.php#L194-L203 |
194,573 | linpax/microphp-framework | src/web/Ftp.php | Ftp.mkdir | public function mkdir($directory = null)
{
if (\ftp_mkdir($this->_stream, $directory)) {
return true;
}
$this->error = 'Failed to create directory "'.$directory.'"';
return false;
} | php | public function mkdir($directory = null)
{
if (\ftp_mkdir($this->_stream, $directory)) {
return true;
}
$this->error = 'Failed to create directory "'.$directory.'"';
return false;
} | [
"public",
"function",
"mkdir",
"(",
"$",
"directory",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"ftp_mkdir",
"(",
"$",
"this",
"->",
"_stream",
",",
"$",
"directory",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"this",
"->",
"error",
"=",
"'Faile... | Create directory on FTP server
@param string $directory
@return bool | [
"Create",
"directory",
"on",
"FTP",
"server"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/web/Ftp.php#L250-L259 |
194,574 | linpax/microphp-framework | src/web/Ftp.php | Ftp.rmdir | public function rmdir($directory = null)
{
if (\ftp_rmdir($this->_stream, $directory)) {
return true;
}
$this->error = 'Failed to remove directory "'.$directory.'"';
return false;
} | php | public function rmdir($directory = null)
{
if (\ftp_rmdir($this->_stream, $directory)) {
return true;
}
$this->error = 'Failed to remove directory "'.$directory.'"';
return false;
} | [
"public",
"function",
"rmdir",
"(",
"$",
"directory",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"ftp_rmdir",
"(",
"$",
"this",
"->",
"_stream",
",",
"$",
"directory",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"this",
"->",
"error",
"=",
"'Faile... | Remove directory on FTP server
@param string $directory
@return bool | [
"Remove",
"directory",
"on",
"FTP",
"server"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/web/Ftp.php#L317-L326 |
194,575 | nice-php/benchmark | src/BenchmarkCollection.php | BenchmarkCollection.execute | public function execute()
{
$results = array();
foreach ($this->benchmarks as $benchmark) {
$results += $benchmark->execute();
}
return $results;
} | php | public function execute()
{
$results = array();
foreach ($this->benchmarks as $benchmark) {
$results += $benchmark->execute();
}
return $results;
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"benchmarks",
"as",
"$",
"benchmark",
")",
"{",
"$",
"results",
"+=",
"$",
"benchmark",
"->",
"execute",
"(",
")",
";",
... | Execute the registered tests and return the results
@return array The results | [
"Execute",
"the",
"registered",
"tests",
"and",
"return",
"the",
"results"
] | 2084c77dbb88cd76006abbfe85b2b704f6bbd1cf | https://github.com/nice-php/benchmark/blob/2084c77dbb88cd76006abbfe85b2b704f6bbd1cf/src/BenchmarkCollection.php#L82-L90 |
194,576 | stubbles/stubbles-peer | src/main/php/http/HttpConnection.php | HttpConnection.authorizedAs | public function authorizedAs(string $user, string $password): self
{
$this->headers->putAuthorization($user, $password);
return $this;
} | php | public function authorizedAs(string $user, string $password): self
{
$this->headers->putAuthorization($user, $password);
return $this;
} | [
"public",
"function",
"authorizedAs",
"(",
"string",
"$",
"user",
",",
"string",
"$",
"password",
")",
":",
"self",
"{",
"$",
"this",
"->",
"headers",
"->",
"putAuthorization",
"(",
"$",
"user",
",",
"$",
"password",
")",
";",
"return",
"$",
"this",
";... | authorize with given credentials
@api
@param string $user
@param string $password
@return \stubbles\peer\http\HttpConnection | [
"authorize",
"with",
"given",
"credentials"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/http/HttpConnection.php#L109-L113 |
194,577 | stubbles/stubbles-peer | src/main/php/http/HttpConnection.php | HttpConnection.usingHeader | public function usingHeader(string $key, $value): self
{
$this->headers->put($key, $value);
return $this;
} | php | public function usingHeader(string $key, $value): self
{
$this->headers->put($key, $value);
return $this;
} | [
"public",
"function",
"usingHeader",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"self",
"{",
"$",
"this",
"->",
"headers",
"->",
"put",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
";",
"}"
] | adds any arbitrary header
@api
@param string $key name of header
@param string $value value of header
@return \stubbles\peer\http\HttpConnection | [
"adds",
"any",
"arbitrary",
"header"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/http/HttpConnection.php#L123-L127 |
194,578 | stubbles/stubbles-peer | src/main/php/http/HttpConnection.php | HttpConnection.put | public function put(string $body, string $version = HttpVersion::HTTP_1_1): HttpResponse
{
return HttpRequest::create($this->httpUri, $this->headers)
->put($body, $this->timeout, $version);
} | php | public function put(string $body, string $version = HttpVersion::HTTP_1_1): HttpResponse
{
return HttpRequest::create($this->httpUri, $this->headers)
->put($body, $this->timeout, $version);
} | [
"public",
"function",
"put",
"(",
"string",
"$",
"body",
",",
"string",
"$",
"version",
"=",
"HttpVersion",
"::",
"HTTP_1_1",
")",
":",
"HttpResponse",
"{",
"return",
"HttpRequest",
"::",
"create",
"(",
"$",
"this",
"->",
"httpUri",
",",
"$",
"this",
"->... | returns response object for given URI after PUT request
@api
@param string $body
@param string $version optional http version, defaults to HTTP/1.1
@return \stubbles\peer\http\HttpResponse
@since 2.0.0 | [
"returns",
"response",
"object",
"for",
"given",
"URI",
"after",
"PUT",
"request"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/http/HttpConnection.php#L178-L182 |
194,579 | stubbles/stubbles-peer | src/main/php/http/HttpConnection.php | HttpConnection.delete | public function delete(string $version = HttpVersion::HTTP_1_1): HttpResponse
{
return HttpRequest::create($this->httpUri, $this->headers)
->delete($this->timeout, $version);
} | php | public function delete(string $version = HttpVersion::HTTP_1_1): HttpResponse
{
return HttpRequest::create($this->httpUri, $this->headers)
->delete($this->timeout, $version);
} | [
"public",
"function",
"delete",
"(",
"string",
"$",
"version",
"=",
"HttpVersion",
"::",
"HTTP_1_1",
")",
":",
"HttpResponse",
"{",
"return",
"HttpRequest",
"::",
"create",
"(",
"$",
"this",
"->",
"httpUri",
",",
"$",
"this",
"->",
"headers",
")",
"->",
... | returns response object for given URI after DELETE request
@api
@param string $version optional http version, defaults to HTTP/1.1
@return \stubbles\peer\http\HttpResponse
@since 2.0.0 | [
"returns",
"response",
"object",
"for",
"given",
"URI",
"after",
"DELETE",
"request"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/http/HttpConnection.php#L192-L196 |
194,580 | vainproject/vain-user | src/User/Providers/AuthServiceProvider.php | AuthServiceProvider.registerGuest | protected function registerGuest()
{
$this->app->bind('guest.roles', function ($app) {
return ['guest'];
});
$this->app->bind('guest.abilities', function ($app) {
return ['*.show'];
});
$this->app->bind('guest', function ($app) {
return n... | php | protected function registerGuest()
{
$this->app->bind('guest.roles', function ($app) {
return ['guest'];
});
$this->app->bind('guest.abilities', function ($app) {
return ['*.show'];
});
$this->app->bind('guest', function ($app) {
return n... | [
"protected",
"function",
"registerGuest",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'guest.roles'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"[",
"'guest'",
"]",
";",
"}",
")",
";",
"$",
"this",
"->",
"app",
"->",
"b... | Register a guest representing user entity
which is not persistable. | [
"Register",
"a",
"guest",
"representing",
"user",
"entity",
"which",
"is",
"not",
"persistable",
"."
] | 1c059faa61ebf289fcaea39a90b4523cfc9d6efc | https://github.com/vainproject/vain-user/blob/1c059faa61ebf289fcaea39a90b4523cfc9d6efc/src/User/Providers/AuthServiceProvider.php#L75-L88 |
194,581 | fiiSoft/fiisoft-output-writer | src/Tools/OutputWriter/Adapter/BufferedOutputWriter.php | BufferedOutputWriter.flushTo | public function flushTo(OutputWriter $outputWriter)
{
if ($outputWriter === $this) {
throw new LogicException('Operation not allowed');
}
$minLevel = $outputWriter->getLevel();
while (!empty($this->buffer)) {
$item = array_shift($this->buffer);
... | php | public function flushTo(OutputWriter $outputWriter)
{
if ($outputWriter === $this) {
throw new LogicException('Operation not allowed');
}
$minLevel = $outputWriter->getLevel();
while (!empty($this->buffer)) {
$item = array_shift($this->buffer);
... | [
"public",
"function",
"flushTo",
"(",
"OutputWriter",
"$",
"outputWriter",
")",
"{",
"if",
"(",
"$",
"outputWriter",
"===",
"$",
"this",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Operation not allowed'",
")",
";",
"}",
"$",
"minLevel",
"=",
"$",
"... | Send all buffered messages to another OutputWriter.
Be aware that messages are removed during this process.
@param OutputWriter $outputWriter
@throws UnexpectedValueException
@throws LogicException
@return void | [
"Send",
"all",
"buffered",
"messages",
"to",
"another",
"OutputWriter",
".",
"Be",
"aware",
"that",
"messages",
"are",
"removed",
"during",
"this",
"process",
"."
] | d275ca8fa90ce87b4caac0af63af9e708314e505 | https://github.com/fiiSoft/fiisoft-output-writer/blob/d275ca8fa90ce87b4caac0af63af9e708314e505/src/Tools/OutputWriter/Adapter/BufferedOutputWriter.php#L41-L76 |
194,582 | sil-project/SeedBatchBundle | src/Admin/OrganismAdmin.php | OrganismAdmin.validateSeedProducerCode | public function validateSeedProducerCode(ErrorElement $errorElement, $object)
{
$code = $object->getSeedProducerCode();
$container = $this->getConfigurationPool()->getContainer();
$is_new = empty($object->getId());
if (empty($code)) {
// Check if organism is a seed produ... | php | public function validateSeedProducerCode(ErrorElement $errorElement, $object)
{
$code = $object->getSeedProducerCode();
$container = $this->getConfigurationPool()->getContainer();
$is_new = empty($object->getId());
if (empty($code)) {
// Check if organism is a seed produ... | [
"public",
"function",
"validateSeedProducerCode",
"(",
"ErrorElement",
"$",
"errorElement",
",",
"$",
"object",
")",
"{",
"$",
"code",
"=",
"$",
"object",
"->",
"getSeedProducerCode",
"(",
")",
";",
"$",
"container",
"=",
"$",
"this",
"->",
"getConfigurationPo... | Seed producer code validator.
@param ErrorElement $errorElement
@param Organism $object | [
"Seed",
"producer",
"code",
"validator",
"."
] | a2640b5359fe31d3bdb9c9fa2f72141ac841729c | https://github.com/sil-project/SeedBatchBundle/blob/a2640b5359fe31d3bdb9c9fa2f72141ac841729c/src/Admin/OrganismAdmin.php#L94-L121 |
194,583 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Collection/EnumSet.php | EnumSet.contains | public function contains($e) {
if (!EnumUtil::isEnum($e, $this->class))
throw new InvalidArgumentException(sprintf('Element must be an instance of %s.', $this->class));
return ($this->entries & $this->universe[$e->ordinal()]) !== 0;
} | php | public function contains($e) {
if (!EnumUtil::isEnum($e, $this->class))
throw new InvalidArgumentException(sprintf('Element must be an instance of %s.', $this->class));
return ($this->entries & $this->universe[$e->ordinal()]) !== 0;
} | [
"public",
"function",
"contains",
"(",
"$",
"e",
")",
"{",
"if",
"(",
"!",
"EnumUtil",
"::",
"isEnum",
"(",
"$",
"e",
",",
"$",
"this",
"->",
"class",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Element must be an instance ... | Returns true if this set contains the given element.
@param Enum $e the element to test for
@return boolean true if this set contains the element | [
"Returns",
"true",
"if",
"this",
"set",
"contains",
"the",
"given",
"element",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Collection/EnumSet.php#L67-L72 |
194,584 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Collection/EnumSet.php | EnumSet.remove | public function remove($e) {
if (!EnumUtil::isEnum($e, $this->class))
throw new InvalidArgumentException(sprintf('Element must be an instance of %s.', $this->class));
if (!$this->contains($e))
return false;
$this->entries &= ~$this->universe[$e->ordinal()];
return true;
} | php | public function remove($e) {
if (!EnumUtil::isEnum($e, $this->class))
throw new InvalidArgumentException(sprintf('Element must be an instance of %s.', $this->class));
if (!$this->contains($e))
return false;
$this->entries &= ~$this->universe[$e->ordinal()];
return true;
} | [
"public",
"function",
"remove",
"(",
"$",
"e",
")",
"{",
"if",
"(",
"!",
"EnumUtil",
"::",
"isEnum",
"(",
"$",
"e",
",",
"$",
"this",
"->",
"class",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Element must be an instance of... | Removes a single instance of an object from this set, if it is present.
@param Enum $e the element to remove from this set, if present
@return boolean true if this set changed as a result of this call | [
"Removes",
"a",
"single",
"instance",
"of",
"an",
"object",
"from",
"this",
"set",
"if",
"it",
"is",
"present",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Collection/EnumSet.php#L84-L94 |
194,585 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Collection/EnumSet.php | EnumSet.complementOf | public static function complementOf(EnumSet $set) {
$values = array();
foreach (call_user_func(array($set->class, 'values')) as $v)
if (!$set->contains($v))
$values[] = $v;
return new EnumSet($set->class, $values);
} | php | public static function complementOf(EnumSet $set) {
$values = array();
foreach (call_user_func(array($set->class, 'values')) as $v)
if (!$set->contains($v))
$values[] = $v;
return new EnumSet($set->class, $values);
} | [
"public",
"static",
"function",
"complementOf",
"(",
"EnumSet",
"$",
"set",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"call_user_func",
"(",
"array",
"(",
"$",
"set",
"->",
"class",
",",
"'values'",
")",
")",
"as",
"$",
"v... | Creates a new EnumSet that is the complement of the given EnumSet. Or in other words, creates an EnumSet
containing all enum values that are not present in the given EnumSet.
@param EnumSet $set the EnumSet to generate a complement for
@return EnumSet the resulting EnumSet | [
"Creates",
"a",
"new",
"EnumSet",
"that",
"is",
"the",
"complement",
"of",
"the",
"given",
"EnumSet",
".",
"Or",
"in",
"other",
"words",
"creates",
"an",
"EnumSet",
"containing",
"all",
"enum",
"values",
"that",
"are",
"not",
"present",
"in",
"the",
"given... | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Collection/EnumSet.php#L137-L145 |
194,586 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Collection/EnumSet.php | EnumSet.of | public static function of($class/* , ... $values */) {
if (!EnumUtil::isEnumClass($class))
throw new InvalidArgumentException($class .
' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.');
$values = func_get_args();
array_shift($values);
return new EnumSet($class, $values);
} | php | public static function of($class/* , ... $values */) {
if (!EnumUtil::isEnumClass($class))
throw new InvalidArgumentException($class .
' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.');
$values = func_get_args();
array_shift($values);
return new EnumSet($class, $values);
} | [
"public",
"static",
"function",
"of",
"(",
"$",
"class",
"/* , ... $values */",
")",
"{",
"if",
"(",
"!",
"EnumUtil",
"::",
"isEnumClass",
"(",
"$",
"class",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"$",
"class",
".",
"' is not loaded or does... | Creates a new EnumSet that contains all of the elements passed to this method after the first.
@throws InvalidArgumentException if the given class name is not an enum
@param string $class the fully-qualified namespace of the enum
@param Enum $values,... zero or more values that the resulting EnumSet should conta... | [
"Creates",
"a",
"new",
"EnumSet",
"that",
"contains",
"all",
"of",
"the",
"elements",
"passed",
"to",
"this",
"method",
"after",
"the",
"first",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Collection/EnumSet.php#L166-L175 |
194,587 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Collection/EnumSet.php | EnumSet.range | public static function range($class, Enum $from, Enum $to) {
if (!EnumUtil::isEnumClass($class))
throw new InvalidArgumentException($class .
' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.');
else if (!EnumUtil::isEnum($from, $class) || !EnumUtil::isEnum($to, $class))
throw new I... | php | public static function range($class, Enum $from, Enum $to) {
if (!EnumUtil::isEnumClass($class))
throw new InvalidArgumentException($class .
' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.');
else if (!EnumUtil::isEnum($from, $class) || !EnumUtil::isEnum($to, $class))
throw new I... | [
"public",
"static",
"function",
"range",
"(",
"$",
"class",
",",
"Enum",
"$",
"from",
",",
"Enum",
"$",
"to",
")",
"{",
"if",
"(",
"!",
"EnumUtil",
"::",
"isEnumClass",
"(",
"$",
"class",
")",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"$",
... | Creates an EnumSet that initially contains all of the elements between two endpoints.
@throws InvalidArgumentException if either of the range endpoints are not enums, or they are not elements
from the same enum
@param string $class the fully-qualified namespace of the num
@param Enum $from the start point of the... | [
"Creates",
"an",
"EnumSet",
"that",
"initially",
"contains",
"all",
"of",
"the",
"elements",
"between",
"two",
"endpoints",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Collection/EnumSet.php#L188-L202 |
194,588 | shrink0r/monatic | src/ManyMaybe.php | ManyMaybe.get | public function get(callable $codeBlock = null)
{
$getValue = function (Maybe $value) {
return $value->get();
};
return array_map($getValue, parent::get($codeBlock));
} | php | public function get(callable $codeBlock = null)
{
$getValue = function (Maybe $value) {
return $value->get();
};
return array_map($getValue, parent::get($codeBlock));
} | [
"public",
"function",
"get",
"(",
"callable",
"$",
"codeBlock",
"=",
"null",
")",
"{",
"$",
"getValue",
"=",
"function",
"(",
"Maybe",
"$",
"value",
")",
"{",
"return",
"$",
"value",
"->",
"get",
"(",
")",
";",
"}",
";",
"return",
"array_map",
"(",
... | Returns the contained collection and applies an optional code-block to each element before returning it.
@param callable $codeBlock
@return array | [
"Returns",
"the",
"contained",
"collection",
"and",
"applies",
"an",
"optional",
"code",
"-",
"block",
"to",
"each",
"element",
"before",
"returning",
"it",
"."
] | f39b8b2ef68a397d31d844341487412b335fd107 | https://github.com/shrink0r/monatic/blob/f39b8b2ef68a397d31d844341487412b335fd107/src/ManyMaybe.php#L17-L24 |
194,589 | Topolis/Filter | src/Filter.php | Filter.loadFilters | protected static function loadFilters($filters, $options = []) {
$queue = array();
if(!is_array($filters)) {
$filters = [$filters];
$options = [$options];
}
foreach($filters as $idx => $filtername) {
$classname = __NAMES... | php | protected static function loadFilters($filters, $options = []) {
$queue = array();
if(!is_array($filters)) {
$filters = [$filters];
$options = [$options];
}
foreach($filters as $idx => $filtername) {
$classname = __NAMES... | [
"protected",
"static",
"function",
"loadFilters",
"(",
"$",
"filters",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"queue",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filters",
")",
")",
"{",
"$",
"filters",
"=",
"... | load needed filters
@param string|array $filters either one filter name or array of filter names. Default: "Plain"
@param array $options (Optional) either one options array or array of options array for filters,
depending if we specified one or mode filters above. Default: array()
@throws FilterException
@... | [
"load",
"needed",
"filters"
] | 6208a6270490c39f028248dc99f21b3e816e388b | https://github.com/Topolis/Filter/blob/6208a6270490c39f028248dc99f21b3e816e388b/src/Filter.php#L78-L103 |
194,590 | Topolis/Filter | src/Filter.php | Filter.execFilterQueue | protected static function execFilterQueue($value, array $queue, $type) {
foreach($queue as $filter) {
$value = self::executeValueMethod($value, $filter, $type, "filter");
if($value === self::ERR_INVALID)
return false;
}
return $value;
} | php | protected static function execFilterQueue($value, array $queue, $type) {
foreach($queue as $filter) {
$value = self::executeValueMethod($value, $filter, $type, "filter");
if($value === self::ERR_INVALID)
return false;
}
return $value;
} | [
"protected",
"static",
"function",
"execFilterQueue",
"(",
"$",
"value",
",",
"array",
"$",
"queue",
",",
"$",
"type",
")",
"{",
"foreach",
"(",
"$",
"queue",
"as",
"$",
"filter",
")",
"{",
"$",
"value",
"=",
"self",
"::",
"executeValueMethod",
"(",
"$... | execute filter queue on a value
@param mixed $value unfiltered value
@param IFilterType[] $queue array of instantiated filter objects
@param $type
@return mixed either filtered value or self::ERR_INVALID | [
"execute",
"filter",
"queue",
"on",
"a",
"value"
] | 6208a6270490c39f028248dc99f21b3e816e388b | https://github.com/Topolis/Filter/blob/6208a6270490c39f028248dc99f21b3e816e388b/src/Filter.php#L112-L120 |
194,591 | ddrv-test/firmapi-core | src/Repository/Build/Mysql.php | Mysql.prepareParams | public function prepareParams($params)
{
$values['street'] = isset($params['street'])?trim((string)$params['street']):null;
$values['number'] = isset($params['number'])?trim((string)$params['number']):null;
$values['latitude'] = isset($params['latitude'])?(double)$params['latitude']:null... | php | public function prepareParams($params)
{
$values['street'] = isset($params['street'])?trim((string)$params['street']):null;
$values['number'] = isset($params['number'])?trim((string)$params['number']):null;
$values['latitude'] = isset($params['latitude'])?(double)$params['latitude']:null... | [
"public",
"function",
"prepareParams",
"(",
"$",
"params",
")",
"{",
"$",
"values",
"[",
"'street'",
"]",
"=",
"isset",
"(",
"$",
"params",
"[",
"'street'",
"]",
")",
"?",
"trim",
"(",
"(",
"string",
")",
"$",
"params",
"[",
"'street'",
"]",
")",
"... | Prepare parameters.
@param array $params
@return array | [
"Prepare",
"parameters",
"."
] | 8f8843f0fb134568e7764cabd5039e15c579976d | https://github.com/ddrv-test/firmapi-core/blob/8f8843f0fb134568e7764cabd5039e15c579976d/src/Repository/Build/Mysql.php#L40-L48 |
194,592 | fridge-project/dbal | src/Fridge/DBAL/SchemaManager/SQLCollector/CreateTableSQLCollector.php | CreateTableSQLCollector.collect | public function collect(Table $table)
{
$this->createTableQueries = array_merge(
$this->createTableQueries,
$this->platform->getCreateTableSQLQueries($table, array('foreign_key' => false))
);
foreach ($table->getForeignKeys() as $foreignKey) {
$this->crea... | php | public function collect(Table $table)
{
$this->createTableQueries = array_merge(
$this->createTableQueries,
$this->platform->getCreateTableSQLQueries($table, array('foreign_key' => false))
);
foreach ($table->getForeignKeys() as $foreignKey) {
$this->crea... | [
"public",
"function",
"collect",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"createTableQueries",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"createTableQueries",
",",
"$",
"this",
"->",
"platform",
"->",
"getCreateTableSQLQueries",
"(",
"$",
... | Collects queries to create tables.
@param \Fridge\DBAL\Schema\Table $table The table. | [
"Collects",
"queries",
"to",
"create",
"tables",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/SchemaManager/SQLCollector/CreateTableSQLCollector.php#L83-L96 |
194,593 | nails/module-blog | blog/models/blog_widget_model.php | NAILS_Blog_widget_model.categories | public function categories($blogId, $includeCount = true, $onlyPopulated = true)
{
$oDb = Factory::service('Database');
$oDb->select('c.id,c.blog_id,c.slug,c.label');
if ($includeCount) {
$sql = '(SELECT COUNT(DISTINCT bpc.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_categor... | php | public function categories($blogId, $includeCount = true, $onlyPopulated = true)
{
$oDb = Factory::service('Database');
$oDb->select('c.id,c.blog_id,c.slug,c.label');
if ($includeCount) {
$sql = '(SELECT COUNT(DISTINCT bpc.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_categor... | [
"public",
"function",
"categories",
"(",
"$",
"blogId",
",",
"$",
"includeCount",
"=",
"true",
",",
"$",
"onlyPopulated",
"=",
"true",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"$",
"oDb",
"->",
"select",
"(",
... | Returns an array of a blog's categories
@param integer $blogId The ID of the blog to get categories from
@param boolean $includeCount Whether to include the post count of each category
@param boolean $onlyPopulated Whether to remove categories which don't have any posts in them
@return array | [
"Returns",
"an",
"array",
"of",
"a",
"blog",
"s",
"categories"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_widget_model.php#L95-L127 |
194,594 | nails/module-blog | blog/models/blog_widget_model.php | NAILS_Blog_widget_model.tags | public function tags($blogId, $includeCount = true, $onlyPopulated = true)
{
$oDb = Factory::service('Database');
$oDb->select('t.id,t.blog_id,t.slug,t.label');
if ($includeCount) {
$sql = '(SELECT COUNT(DISTINCT bpt.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_tag bpt JOIN ... | php | public function tags($blogId, $includeCount = true, $onlyPopulated = true)
{
$oDb = Factory::service('Database');
$oDb->select('t.id,t.blog_id,t.slug,t.label');
if ($includeCount) {
$sql = '(SELECT COUNT(DISTINCT bpt.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_tag bpt JOIN ... | [
"public",
"function",
"tags",
"(",
"$",
"blogId",
",",
"$",
"includeCount",
"=",
"true",
",",
"$",
"onlyPopulated",
"=",
"true",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"$",
"oDb",
"->",
"select",
"(",
"'t.... | Returns an array of a blog's tags
@param integer $blogId The ID of the blog to get tags from
@param boolean $includeCount Whether to include the post count of each tag
@param boolean $onlyPopulated Whether to remove tags which don't have any posts in them
@return array | [
"Returns",
"an",
"array",
"of",
"a",
"blog",
"s",
"tags"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_widget_model.php#L138-L170 |
194,595 | spartan/console | src/Definition/CommandTrait.php | CommandTrait.withArgument | public function withArgument($name, $description, array $choices = [])
{
$this->choices[$name] = $choices;
return $this->addArgument($name, InputArgument::REQUIRED, $description);
} | php | public function withArgument($name, $description, array $choices = [])
{
$this->choices[$name] = $choices;
return $this->addArgument($name, InputArgument::REQUIRED, $description);
} | [
"public",
"function",
"withArgument",
"(",
"$",
"name",
",",
"$",
"description",
",",
"array",
"$",
"choices",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"choices",
"[",
"$",
"name",
"]",
"=",
"$",
"choices",
";",
"return",
"$",
"this",
"->",
"add... | With mandatory argument
@param string $name
@param string $description
@param array $choices
@return self | [
"With",
"mandatory",
"argument"
] | 66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838 | https://github.com/spartan/console/blob/66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838/src/Definition/CommandTrait.php#L88-L93 |
194,596 | spartan/console | src/Definition/CommandTrait.php | CommandTrait.withOption | public function withOption($name, $description, $default = '', array $choices = [])
{
$this->choices[$name] = $choices;
return $this->addOption($name, null, InputOption::VALUE_OPTIONAL, $description, $default);
} | php | public function withOption($name, $description, $default = '', array $choices = [])
{
$this->choices[$name] = $choices;
return $this->addOption($name, null, InputOption::VALUE_OPTIONAL, $description, $default);
} | [
"public",
"function",
"withOption",
"(",
"$",
"name",
",",
"$",
"description",
",",
"$",
"default",
"=",
"''",
",",
"array",
"$",
"choices",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"choices",
"[",
"$",
"name",
"]",
"=",
"$",
"choices",
";",
"... | With optional option
@param string $name
@param string $description
@param mixed $default Default must be empty string to check if the user has provided a value for option
@param array $choices
@return self | [
"With",
"optional",
"option"
] | 66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838 | https://github.com/spartan/console/blob/66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838/src/Definition/CommandTrait.php#L105-L110 |
194,597 | spartan/console | src/Definition/CommandTrait.php | CommandTrait.exec | public function exec(string $command, array $remote = [], $color = 'note-inverted')
{
if ($remote) {
$path = $remote['path'] ? $remote['path'] : '~';
$command = "ssh -t -p {$remote['port']} {$remote['auth']} \"cd {$path} && {$command}\"";
}
$this->out->writeln("\n... | php | public function exec(string $command, array $remote = [], $color = 'note-inverted')
{
if ($remote) {
$path = $remote['path'] ? $remote['path'] : '~';
$command = "ssh -t -p {$remote['port']} {$remote['auth']} \"cd {$path} && {$command}\"";
}
$this->out->writeln("\n... | [
"public",
"function",
"exec",
"(",
"string",
"$",
"command",
",",
"array",
"$",
"remote",
"=",
"[",
"]",
",",
"$",
"color",
"=",
"'note-inverted'",
")",
"{",
"if",
"(",
"$",
"remote",
")",
"{",
"$",
"path",
"=",
"$",
"remote",
"[",
"'path'",
"]",
... | Execute an command and display output
@param string $command
@param array $remote
@param string $color | [
"Execute",
"an",
"command",
"and",
"display",
"output"
] | 66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838 | https://github.com/spartan/console/blob/66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838/src/Definition/CommandTrait.php#L239-L249 |
194,598 | spartan/console | src/Definition/CommandTrait.php | CommandTrait.initialize | public function initialize(InputInterface $input, OutputInterface $output)
{
$this->in = $input;
$this->out = $output;
} | php | public function initialize(InputInterface $input, OutputInterface $output)
{
$this->in = $input;
$this->out = $output;
} | [
"public",
"function",
"initialize",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"in",
"=",
"$",
"input",
";",
"$",
"this",
"->",
"out",
"=",
"$",
"output",
";",
"}"
] | Initializes the command after the input has been bound
and before the input is validated.
@param InputInterface $input
@param OutputInterface $output | [
"Initializes",
"the",
"command",
"after",
"the",
"input",
"has",
"been",
"bound",
"and",
"before",
"the",
"input",
"is",
"validated",
"."
] | 66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838 | https://github.com/spartan/console/blob/66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838/src/Definition/CommandTrait.php#L419-L423 |
194,599 | mitogh/Katana | src/Edge.php | Edge.filter | public function filter( $sizes ) {
$sizes = apply_filters( Config::KATANA_FILTER, $sizes, $this->request_id() );
return $sizes;
} | php | public function filter( $sizes ) {
$sizes = apply_filters( Config::KATANA_FILTER, $sizes, $this->request_id() );
return $sizes;
} | [
"public",
"function",
"filter",
"(",
"$",
"sizes",
")",
"{",
"$",
"sizes",
"=",
"apply_filters",
"(",
"Config",
"::",
"KATANA_FILTER",
",",
"$",
"sizes",
",",
"$",
"this",
"->",
"request_id",
"(",
")",
")",
";",
"return",
"$",
"sizes",
";",
"}"
] | WP default filter that runs before the images are being generated, then
appplies the custom filter from Katana.
@since 1.0.0
@lik http://codex.wordpress.org/Plugin_API/Filter_Reference/intermediate_image_sizes.html
@param array $sizes The register sizes of images in WP.
@return array $sizes The array of sizes | [
"WP",
"default",
"filter",
"that",
"runs",
"before",
"the",
"images",
"are",
"being",
"generated",
"then",
"appplies",
"the",
"custom",
"filter",
"from",
"Katana",
"."
] | 9eb7267f061fbe555dbe9c12461650bb4153915f | https://github.com/mitogh/Katana/blob/9eb7267f061fbe555dbe9c12461650bb4153915f/src/Edge.php#L36-L39 |
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.