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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
23,100 | ezsystems/ezcomments-ls-extension | classes/ezcomsubscription.php | ezcomSubscription.countWithSubscriberID | static function countWithSubscriberID( $subscriberID, $languageID =false , $enabled = false )
{
$cond = array();
$cond['subscriber_id'] = $subscriberID;
if ( $enabled !== false )
{
$cond['enabled'] = $enabled;
}
if ( $languageID !== false )
{
... | php | static function countWithSubscriberID( $subscriberID, $languageID =false , $enabled = false )
{
$cond = array();
$cond['subscriber_id'] = $subscriberID;
if ( $enabled !== false )
{
$cond['enabled'] = $enabled;
}
if ( $languageID !== false )
{
... | [
"static",
"function",
"countWithSubscriberID",
"(",
"$",
"subscriberID",
",",
"$",
"languageID",
"=",
"false",
",",
"$",
"enabled",
"=",
"false",
")",
"{",
"$",
"cond",
"=",
"array",
"(",
")",
";",
"$",
"cond",
"[",
"'subscriber_id'",
"]",
"=",
"$",
"s... | get the count of subscription in a subscriber ID
@param $subscriberID
@param $status
@return unknown_type | [
"get",
"the",
"count",
"of",
"subscription",
"in",
"a",
"subscriber",
"ID"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomsubscription.php#L143-L157 |
23,101 | ezsystems/ezcomments-ls-extension | classes/ezcomsubscription.php | ezcomSubscription.contentObject | public function contentObject()
{
$contentID = $this->attribute( 'content_id' );
//TODO:try to get the language id
$languageID = $this->attribute( 'language_id' );
return eZContentObject::fetch( $contentID );
} | php | public function contentObject()
{
$contentID = $this->attribute( 'content_id' );
//TODO:try to get the language id
$languageID = $this->attribute( 'language_id' );
return eZContentObject::fetch( $contentID );
} | [
"public",
"function",
"contentObject",
"(",
")",
"{",
"$",
"contentID",
"=",
"$",
"this",
"->",
"attribute",
"(",
"'content_id'",
")",
";",
"//TODO:try to get the language id",
"$",
"languageID",
"=",
"$",
"this",
"->",
"attribute",
"(",
"'language_id'",
")",
... | get the content of the subscription
@return ezcontentobject | [
"get",
"the",
"content",
"of",
"the",
"subscription"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomsubscription.php#L182-L188 |
23,102 | ezsystems/ezcomments-ls-extension | classes/ezcomsubscription.php | ezcomSubscription.exists | static function exists( $contentID, $languageID , $subscriptionType, $email = null, $enabled = false )
{
$emailString = '';
if ( !is_null($email) )
{
$emailString = " WHERE email = '$email'";
}
$countArray = null;
$db = eZDB::instance();
if ... | php | static function exists( $contentID, $languageID , $subscriptionType, $email = null, $enabled = false )
{
$emailString = '';
if ( !is_null($email) )
{
$emailString = " WHERE email = '$email'";
}
$countArray = null;
$db = eZDB::instance();
if ... | [
"static",
"function",
"exists",
"(",
"$",
"contentID",
",",
"$",
"languageID",
",",
"$",
"subscriptionType",
",",
"$",
"email",
"=",
"null",
",",
"$",
"enabled",
"=",
"false",
")",
"{",
"$",
"emailString",
"=",
"''",
";",
"if",
"(",
"!",
"is_null",
"... | Check if the subscription exists by a given contentID
@param string $contentID : the ID of content subscribed
@param string $languageID : the language ID of content
@param string $subscriptionType : type of the subscription
@param string $email : email in table subscriber
@param integer $enabled : 1/0 - check if the su... | [
"Check",
"if",
"the",
"subscription",
"exists",
"by",
"a",
"given",
"contentID"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomsubscription.php#L227-L285 |
23,103 | ShaoZeMing/laravel-merchant | src/Tree.php | Tree.render | public function render()
{
Merchant::script($this->script());
view()->share([
'path' => $this->path,
'keyName' => $this->model->getKeyName(),
'branchView' => $this->view['branch'],
'branchCallback' => $this->branchCallback,
... | php | public function render()
{
Merchant::script($this->script());
view()->share([
'path' => $this->path,
'keyName' => $this->model->getKeyName(),
'branchView' => $this->view['branch'],
'branchCallback' => $this->branchCallback,
... | [
"public",
"function",
"render",
"(",
")",
"{",
"Merchant",
"::",
"script",
"(",
"$",
"this",
"->",
"script",
"(",
")",
")",
";",
"view",
"(",
")",
"->",
"share",
"(",
"[",
"'path'",
"=>",
"$",
"this",
"->",
"path",
",",
"'keyName'",
"=>",
"$",
"t... | Render a tree.
@return \Illuminate\Http\JsonResponse|string | [
"Render",
"a",
"tree",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Tree.php#L356-L368 |
23,104 | fortis/silex-graphite | src/Graphite/Silex/Client/GraphiteClient.php | GraphiteClient.send | public function send($data)
{
$pieces = [
$this->config['apiKey'],
$this->config['prefix'],
$data.' '.time(),
];
$message = implode('.', $pieces).PHP_EOL;
return $this->sendData($this->config['host'], $this->config['port'], $message);
} | php | public function send($data)
{
$pieces = [
$this->config['apiKey'],
$this->config['prefix'],
$data.' '.time(),
];
$message = implode('.', $pieces).PHP_EOL;
return $this->sendData($this->config['host'], $this->config['port'], $message);
} | [
"public",
"function",
"send",
"(",
"$",
"data",
")",
"{",
"$",
"pieces",
"=",
"[",
"$",
"this",
"->",
"config",
"[",
"'apiKey'",
"]",
",",
"$",
"this",
"->",
"config",
"[",
"'prefix'",
"]",
",",
"$",
"data",
".",
"' '",
".",
"time",
"(",
")",
"... | Data to send to Graphite host
@param string $data
@return bool | [
"Data",
"to",
"send",
"to",
"Graphite",
"host"
] | 1faf4b53531c62d19b281b736a1dda326e127c7f | https://github.com/fortis/silex-graphite/blob/1faf4b53531c62d19b281b736a1dda326e127c7f/src/Graphite/Silex/Client/GraphiteClient.php#L21-L31 |
23,105 | ArrowSphere/Client | src/xAC/MagicFactoryTrait.php | MagicFactoryTrait.__callstatic | public static function __callstatic($name, $arguments)
{
// Get global services or entity services
$services = Client::getServices(isset($arguments['context']) ? $arguments['context'] : null);
if (array_key_exists($name, $services)) {
$service = $services[$name];
... | php | public static function __callstatic($name, $arguments)
{
// Get global services or entity services
$services = Client::getServices(isset($arguments['context']) ? $arguments['context'] : null);
if (array_key_exists($name, $services)) {
$service = $services[$name];
... | [
"public",
"static",
"function",
"__callstatic",
"(",
"$",
"name",
",",
"$",
"arguments",
")",
"{",
"// Get global services or entity services",
"$",
"services",
"=",
"Client",
"::",
"getServices",
"(",
"isset",
"(",
"$",
"arguments",
"[",
"'context'",
"]",
")",
... | Magic method for static calls
@param string $name
@param array $arguments
@return mixed | [
"Magic",
"method",
"for",
"static",
"calls"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC/MagicFactoryTrait.php#L17-L59 |
23,106 | NuclearCMS/Hierarchy | src/Tags/TagRepository.php | TagRepository.getTagAndSetLocale | public function getTagAndSetLocale($name, $locale = null)
{
$tag = $this->getTag($name);
// Override locale or use tag locale
// this is for when a tag does not have to be translated
// and the app locale is determined via route parameter (etiket|tag)
$locale = $locale ?: $t... | php | public function getTagAndSetLocale($name, $locale = null)
{
$tag = $this->getTag($name);
// Override locale or use tag locale
// this is for when a tag does not have to be translated
// and the app locale is determined via route parameter (etiket|tag)
$locale = $locale ?: $t... | [
"public",
"function",
"getTagAndSetLocale",
"(",
"$",
"name",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"tag",
"=",
"$",
"this",
"->",
"getTag",
"(",
"$",
"name",
")",
";",
"// Override locale or use tag locale",
"// this is for when a tag does not have to b... | Returns a tag by name and sets the locale
@param string $name
@param string $locale
@return Tag | [
"Returns",
"a",
"tag",
"by",
"name",
"and",
"sets",
"the",
"locale"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Tags/TagRepository.php#L27-L39 |
23,107 | OKTOTV/OktolabMediaBundle | Controller/EpisodeController.php | EpisodeController.createCreateForm | private function createCreateForm(Episode $entity)
{
$form = $this->createForm(EpisodeType::class, $entity, array(
'action' => $this->generateUrl('oktolab_episode_create'),
'method' => 'POST',
));
$form->add(
'submit',
SubmitType::class,
... | php | private function createCreateForm(Episode $entity)
{
$form = $this->createForm(EpisodeType::class, $entity, array(
'action' => $this->generateUrl('oktolab_episode_create'),
'method' => 'POST',
));
$form->add(
'submit',
SubmitType::class,
... | [
"private",
"function",
"createCreateForm",
"(",
"Episode",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"EpisodeType",
"::",
"class",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"generat... | Creates a form to create a Episode entity.
@param Episode $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"Episode",
"entity",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L99-L116 |
23,108 | OKTOTV/OktolabMediaBundle | Controller/EpisodeController.php | EpisodeController.newAction | public function newAction(Request $request)
{
$entity = new Episode();
$form = $this->createCreateForm($entity);
return [
'entity' => $entity,
'form' => $form->createView(),
];
} | php | public function newAction(Request $request)
{
$entity = new Episode();
$form = $this->createCreateForm($entity);
return [
'entity' => $entity,
'form' => $form->createView(),
];
} | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"entity",
"=",
"new",
"Episode",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createCreateForm",
"(",
"$",
"entity",
")",
";",
"return",
"[",
"'entity'",
"=>",
... | Displays a form to create a new Episode entity.
@Route("/new", name="oktolab_episode_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Episode",
"entity",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L125-L134 |
23,109 | OKTOTV/OktolabMediaBundle | Controller/EpisodeController.php | EpisodeController.createEditForm | private function createEditForm(Episode $entity)
{
$form = $this->createForm(
new EpisodeType(),
$entity,
[
'action' => $this->generateUrl(
'oktolab_episode_update',
['id' => $entity->getId()]
),
... | php | private function createEditForm(Episode $entity)
{
$form = $this->createForm(
new EpisodeType(),
$entity,
[
'action' => $this->generateUrl(
'oktolab_episode_update',
['id' => $entity->getId()]
),
... | [
"private",
"function",
"createEditForm",
"(",
"Episode",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"EpisodeType",
"(",
")",
",",
"$",
"entity",
",",
"[",
"'action'",
"=>",
"$",
"this",
"->",
"generateUrl",
... | Creates a form to edit a Episode entity.
@param Episode $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"Episode",
"entity",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L229-L250 |
23,110 | OKTOTV/OktolabMediaBundle | Controller/EpisodeController.php | EpisodeController.deleteAction | public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('OktolabMediaBundle:Episode')->find($id);
... | php | public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('OktolabMediaBundle:Episode')->find($id);
... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"id",
")",
";",
"$",
"form",
"->",
"handleRequest",
"(",
"$",
"request",
")",
";",
"if"... | Deletes a Episode entity.
@Route("/{id}", name="oktolab_episode_delete")
@Method("DELETE") | [
"Deletes",
"a",
"Episode",
"entity",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L306-L323 |
23,111 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox.Image_Toolbox | function Image_Toolbox()
{
$args = func_get_args();
$argc = func_num_args();
//get GD information. see what types we can handle
$gd_info = function_exists('gd_info') ? gd_info() : $this->_gd_info();
preg_match("/\A[\D]*([\d+\.]*)[\D]*\Z/", $gd_info['GD Version'], $matches);
... | php | function Image_Toolbox()
{
$args = func_get_args();
$argc = func_num_args();
//get GD information. see what types we can handle
$gd_info = function_exists('gd_info') ? gd_info() : $this->_gd_info();
preg_match("/\A[\D]*([\d+\.]*)[\D]*\Z/", $gd_info['GD Version'], $matches);
... | [
"function",
"Image_Toolbox",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"argc",
"=",
"func_num_args",
"(",
")",
";",
"//get GD information. see what types we can handle",
"$",
"gd_info",
"=",
"function_exists",
"(",
"'gd_info'",
")",
"... | The class constructor.
Determines the image features of the server and sets the according values.<br>
Additionally you can specify a image to be created/loaded. like {@link addImage() addImage}.
If no parameter is given, no image resource will be generated<br>
Or:<br>
<i>string</i> <b>$file</b> imagefile to load<br>
... | [
"The",
"class",
"constructor",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L175-L239 |
23,112 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox.getServerFeatures | function getServerFeatures()
{
$features = array();
$features['gd_version'] = $this->_gd_version_number;
$features['gif'] = $this->_types[1]['supported'];
$features['jpg'] = $this->_types[2]['supported'];
$features['png'] = $this->_types[3]['supported'];
$features['tt... | php | function getServerFeatures()
{
$features = array();
$features['gd_version'] = $this->_gd_version_number;
$features['gif'] = $this->_types[1]['supported'];
$features['jpg'] = $this->_types[2]['supported'];
$features['png'] = $this->_types[3]['supported'];
$features['tt... | [
"function",
"getServerFeatures",
"(",
")",
"{",
"$",
"features",
"=",
"array",
"(",
")",
";",
"$",
"features",
"[",
"'gd_version'",
"]",
"=",
"$",
"this",
"->",
"_gd_version_number",
";",
"$",
"features",
"[",
"'gif'",
"]",
"=",
"$",
"this",
"->",
"_ty... | Returns an assocative array with information about the image features of this server
Array values:
<ul>
<li>'gd_version' -> what GD version is installed on this server (e.g. 2.0)</li>
<li>'gif' -> 0 = not supported, 1 = reading is supported, 2 = creating is supported</li>
<li>'jpg' -> 0 = not supported, 1 = reading is... | [
"Returns",
"an",
"assocative",
"array",
"with",
"information",
"about",
"the",
"image",
"features",
"of",
"this",
"server"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L255-L264 |
23,113 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox.newImage | function newImage()
{
$args = func_get_args();
$argc = func_num_args();
if ($this->_addImage($argc, $args))
{
foreach ($this->_img['operator'] as $key => $value)
{
$this->_img['main'][$key] = $value;
}
$this->_img['main... | php | function newImage()
{
$args = func_get_args();
$argc = func_num_args();
if ($this->_addImage($argc, $args))
{
foreach ($this->_img['operator'] as $key => $value)
{
$this->_img['main'][$key] = $value;
}
$this->_img['main... | [
"function",
"newImage",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"argc",
"=",
"func_num_args",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_addImage",
"(",
"$",
"argc",
",",
"$",
"args",
")",
")",
"{",
"foreach",
"(... | Flush all image resources and init a new one
Parameter:<br>
<i>string</i> <b>$file</b> imagefile to load<br>
Or:<br>
<i>integer</i> <b>$width</b> imagewidth of new image to be created<br>
<i>integer</i> <b>$height</b> imageheight of new image to be created<br>
<i>string</i> <b>$fillcolor</b> optional fill the new imag... | [
"Flush",
"all",
"image",
"resources",
"and",
"init",
"a",
"new",
"one"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L276-L296 |
23,114 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox._hexToPHPColor | function _hexToPHPColor($hex)
{
$length = strlen($hex);
$dr = hexdec(substr($hex, $length - 6, 2));
$dg = hexdec(substr($hex, $length - 4, 2));
$db = hexdec(substr($hex, $length - 2, 2));
$color = ($dr << 16) + ($dg << 8) + $db;
return $color;
} | php | function _hexToPHPColor($hex)
{
$length = strlen($hex);
$dr = hexdec(substr($hex, $length - 6, 2));
$dg = hexdec(substr($hex, $length - 4, 2));
$db = hexdec(substr($hex, $length - 2, 2));
$color = ($dr << 16) + ($dg << 8) + $db;
return $color;
} | [
"function",
"_hexToPHPColor",
"(",
"$",
"hex",
")",
"{",
"$",
"length",
"=",
"strlen",
"(",
"$",
"hex",
")",
";",
"$",
"dr",
"=",
"hexdec",
"(",
"substr",
"(",
"$",
"hex",
",",
"$",
"length",
"-",
"6",
",",
"2",
")",
")",
";",
"$",
"dg",
"=",... | Convert a color defined in hexvalues to the PHP color format
@access private
@param string $hex color value in hexformat (e.g. '#FF0000')
@return integer color value in PHP format | [
"Convert",
"a",
"color",
"defined",
"in",
"hexvalues",
"to",
"the",
"PHP",
"color",
"format"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L429-L437 |
23,115 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox._hexToDecColor | function _hexToDecColor($hex)
{
$length = strlen($hex);
$color['red'] = hexdec(substr($hex, $length - 6, 2));
$color['green'] = hexdec(substr($hex, $length - 4, 2));
$color['blue'] = hexdec(substr($hex, $length - 2, 2));
return $color;
} | php | function _hexToDecColor($hex)
{
$length = strlen($hex);
$color['red'] = hexdec(substr($hex, $length - 6, 2));
$color['green'] = hexdec(substr($hex, $length - 4, 2));
$color['blue'] = hexdec(substr($hex, $length - 2, 2));
return $color;
} | [
"function",
"_hexToDecColor",
"(",
"$",
"hex",
")",
"{",
"$",
"length",
"=",
"strlen",
"(",
"$",
"hex",
")",
";",
"$",
"color",
"[",
"'red'",
"]",
"=",
"hexdec",
"(",
"substr",
"(",
"$",
"hex",
",",
"$",
"length",
"-",
"6",
",",
"2",
")",
")",
... | Convert a color defined in hexvalues to corresponding dezimal values
@access private
@param string $hex color value in hexformat (e.g. '#FF0000')
@return array associative array with color values in dezimal format (fields: 'red', 'green', 'blue') | [
"Convert",
"a",
"color",
"defined",
"in",
"hexvalues",
"to",
"corresponding",
"dezimal",
"values"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L446-L453 |
23,116 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox._addImage | function _addImage($argc, $args)
{
if (($argc == 2 || $argc == 3) && is_int($args[0]) && is_int($args[1]) && (is_string($args[2]) || !isset($args[2])))
{
//neues leeres bild mit width und height (fillcolor optional)
$this->_img['operator']['width'] = $args[0];
$th... | php | function _addImage($argc, $args)
{
if (($argc == 2 || $argc == 3) && is_int($args[0]) && is_int($args[1]) && (is_string($args[2]) || !isset($args[2])))
{
//neues leeres bild mit width und height (fillcolor optional)
$this->_img['operator']['width'] = $args[0];
$th... | [
"function",
"_addImage",
"(",
"$",
"argc",
",",
"$",
"args",
")",
"{",
"if",
"(",
"(",
"$",
"argc",
"==",
"2",
"||",
"$",
"argc",
"==",
"3",
")",
"&&",
"is_int",
"(",
"$",
"args",
"[",
"0",
"]",
")",
"&&",
"is_int",
"(",
"$",
"args",
"[",
"... | Generate a new image resource based on the given parameters
Parameter:
<i>string</i> <b>$file</b> imagefile to load<br>
Or:<br>
<i>integer</i> <b>$width</b> imagewidth of new image to be created<br>
<i>integer</i> <b>$height</b> imageheight of new image to be created<br>
<i>string</i> <b>$fillcolor</b> optional fill t... | [
"Generate",
"a",
"new",
"image",
"resource",
"based",
"on",
"the",
"given",
"parameters"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L467-L505 |
23,117 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox._loadFile | function _loadFile($filename)
{
if (file_exists($filename))
{
$info = getimagesize($filename);
$filedata['width'] = $info[0];
$filedata['height'] = $info[1];
($filedata['width'] >= $filedata['height']) ? ($filedata['bias'] = IMAGE_TOOLBOX_BIAS_HORIZONT... | php | function _loadFile($filename)
{
if (file_exists($filename))
{
$info = getimagesize($filename);
$filedata['width'] = $info[0];
$filedata['height'] = $info[1];
($filedata['width'] >= $filedata['height']) ? ($filedata['bias'] = IMAGE_TOOLBOX_BIAS_HORIZONT... | [
"function",
"_loadFile",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"$",
"info",
"=",
"getimagesize",
"(",
"$",
"filename",
")",
";",
"$",
"filedata",
"[",
"'width'",
"]",
"=",
"$",
"info",
"[",
"... | Loads a image file
@access private
@param string $filename imagefile to load
@return array associative array with the loaded filedata | [
"Loads",
"a",
"image",
"file"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L514-L570 |
23,118 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox.setResizeMethod | function setResizeMethod($method)
{
switch ($method)
{
case 1:
case 'resize':
$this->_resize_function = 'imagecopyresized';
break;
case 2:
case 'resample':
if (!function_exists('imagecopyresampled'))
... | php | function setResizeMethod($method)
{
switch ($method)
{
case 1:
case 'resize':
$this->_resize_function = 'imagecopyresized';
break;
case 2:
case 'resample':
if (!function_exists('imagecopyresampled'))
... | [
"function",
"setResizeMethod",
"(",
"$",
"method",
")",
"{",
"switch",
"(",
"$",
"method",
")",
"{",
"case",
"1",
":",
"case",
"'resize'",
":",
"$",
"this",
"->",
"_resize_function",
"=",
"'imagecopyresized'",
";",
"break",
";",
"case",
"2",
":",
"case",... | Sets the resize method of choice
$method can be one of the following:<br>
<ul>
<li>'resize' -> supported by every version of GD (fast but ugly resize of image)</li>
<li>'resample' -> only supported by GD version >= 2.0 (slower but antialiased resize of image)</li>
<li>'workaround' -> supported by every version of GD (... | [
"Sets",
"the",
"resize",
"method",
"of",
"choice"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L827-L860 |
23,119 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox.addImage | function addImage()
{
$args = func_get_args();
$argc = func_num_args();
if ($this->_addImage($argc, $args))
{
return true;
}
else
{
//trigger_error($this->_error_prefix . 'failed to add image.', E_USER_ERROR);
return false;... | php | function addImage()
{
$args = func_get_args();
$argc = func_num_args();
if ($this->_addImage($argc, $args))
{
return true;
}
else
{
//trigger_error($this->_error_prefix . 'failed to add image.', E_USER_ERROR);
return false;... | [
"function",
"addImage",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"argc",
"=",
"func_num_args",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_addImage",
"(",
"$",
"argc",
",",
"$",
"args",
")",
")",
"{",
"return",
"tr... | Adds a new image resource based on the given parameters.
It does not overwrite the existing image resource.<br>
Instead it is used to load a second image to merge with the existing image.
Parameter:<br>
<i>string</i> <b>$file</b> imagefile to load<br>
Or:<br>
<i>integer</i> <b>$width</b> imagewidth of new image to be... | [
"Adds",
"a",
"new",
"image",
"resource",
"based",
"on",
"the",
"given",
"parameters",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1056-L1070 |
23,120 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox.addText | function addText($text, $font, $size, $color, $x, $y, $angle = 0)
{
global $HTTP_SERVER_VARS;
if (substr($font, 0, 1) == DIRECTORY_SEPARATOR || (substr($font, 1, 1) == ":" && (substr($font, 2, 1) == "\\" || substr($font, 2, 1) == "/")))
{
$prepath = '';
}
else
... | php | function addText($text, $font, $size, $color, $x, $y, $angle = 0)
{
global $HTTP_SERVER_VARS;
if (substr($font, 0, 1) == DIRECTORY_SEPARATOR || (substr($font, 1, 1) == ":" && (substr($font, 2, 1) == "\\" || substr($font, 2, 1) == "/")))
{
$prepath = '';
}
else
... | [
"function",
"addText",
"(",
"$",
"text",
",",
"$",
"font",
",",
"$",
"size",
",",
"$",
"color",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"angle",
"=",
"0",
")",
"{",
"global",
"$",
"HTTP_SERVER_VARS",
";",
"if",
"(",
"substr",
"(",
"$",
"font",
... | Writes text over the image
only TTF fonts are supported at the moment
$x:<br>
You can also use the following keywords ('left', 'center' or 'middle', 'right').<br>
Additionally you can specify an offset in pixel with the keywords like this 'left +10'.<br>
(default = 0)
$y:<br>
You can also use the following keywords ... | [
"Writes",
"text",
"over",
"the",
"image"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1454-L1513 |
23,121 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox._imageCopyResampledWorkaround | function _imageCopyResampledWorkaround(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
{
/*
for ($i = 0; $i < imagecolorstotal($src_img); $i++)
{
$colors = ImageColorsForIndex ($src_img, $i);
ImageColorAllocate ($dst_img, $colors[... | php | function _imageCopyResampledWorkaround(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
{
/*
for ($i = 0; $i < imagecolorstotal($src_img); $i++)
{
$colors = ImageColorsForIndex ($src_img, $i);
ImageColorAllocate ($dst_img, $colors[... | [
"function",
"_imageCopyResampledWorkaround",
"(",
"&",
"$",
"dst_img",
",",
"&",
"$",
"src_img",
",",
"$",
"dst_x",
",",
"$",
"dst_y",
",",
"$",
"src_x",
",",
"$",
"src_y",
",",
"$",
"dst_w",
",",
"$",
"dst_h",
",",
"$",
"src_w",
",",
"$",
"src_h",
... | workaround function for bicubic resizing. works well for downsizing only. VERY slow. taken from php.net comments
@access private | [
"workaround",
"function",
"for",
"bicubic",
"resizing",
".",
"works",
"well",
"for",
"downsizing",
"only",
".",
"VERY",
"slow",
".",
"taken",
"from",
"php",
".",
"net",
"comments"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1520-L1555 |
23,122 | Eresus/EresusCMS | src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php | Image_Toolbox._imageCopyResampledWorkaround2 | function _imageCopyResampledWorkaround2(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
{
ImagePaletteCopy($dst_img, $src_img);
$rX = $src_w / $dst_w;
$rY = $src_h / $dst_h;
$w = 0;
for ($y = $dst_y; $y < $dst_h; $y++)
{
... | php | function _imageCopyResampledWorkaround2(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
{
ImagePaletteCopy($dst_img, $src_img);
$rX = $src_w / $dst_w;
$rY = $src_h / $dst_h;
$w = 0;
for ($y = $dst_y; $y < $dst_h; $y++)
{
... | [
"function",
"_imageCopyResampledWorkaround2",
"(",
"&",
"$",
"dst_img",
",",
"&",
"$",
"src_img",
",",
"$",
"dst_x",
",",
"$",
"dst_y",
",",
"$",
"src_x",
",",
"$",
"src_y",
",",
"$",
"dst_w",
",",
"$",
"dst_h",
",",
"$",
"src_w",
",",
"$",
"src_h",
... | alternative workaround function for bicubic resizing. works well for downsizing and upsizing. VERY VERY slow. taken from php.net comments
@access private | [
"alternative",
"workaround",
"function",
"for",
"bicubic",
"resizing",
".",
"works",
"well",
"for",
"downsizing",
"and",
"upsizing",
".",
"VERY",
"VERY",
"slow",
".",
"taken",
"from",
"php",
".",
"net",
"comments"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1562-L1593 |
23,123 | 99designs/ergo-http | src/HeaderField.php | HeaderField.fromString | public static function fromString($headerString)
{
$headerString = trim($headerString);
list($name, $value) = explode(': ', trim($headerString), 2);
return new self($name, $value);
} | php | public static function fromString($headerString)
{
$headerString = trim($headerString);
list($name, $value) = explode(': ', trim($headerString), 2);
return new self($name, $value);
} | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"headerString",
")",
"{",
"$",
"headerString",
"=",
"trim",
"(",
"$",
"headerString",
")",
";",
"list",
"(",
"$",
"name",
",",
"$",
"value",
")",
"=",
"explode",
"(",
"': '",
",",
"trim",
"(",
"... | Creates a header from a string representing a single header.
@param string $headerString
@return | [
"Creates",
"a",
"header",
"from",
"a",
"string",
"representing",
"a",
"single",
"header",
"."
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderField.php#L76-L81 |
23,124 | CupOfTea696/WordPress-Composer | src/Installer.php | Installer.installDotEnv | protected function installDotEnv(PackageInterface $package)
{
$templatePath = $this->getTempPath($package) . '/.env.template';
$dotEnvPath = $this->getInstallPath($package) . '/.env';
$dotEnvExamplePath = $this->getInstallPath($package) . '/.env.example';
if (! file_exists($... | php | protected function installDotEnv(PackageInterface $package)
{
$templatePath = $this->getTempPath($package) . '/.env.template';
$dotEnvPath = $this->getInstallPath($package) . '/.env';
$dotEnvExamplePath = $this->getInstallPath($package) . '/.env.example';
if (! file_exists($... | [
"protected",
"function",
"installDotEnv",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"templatePath",
"=",
"$",
"this",
"->",
"getTempPath",
"(",
"$",
"package",
")",
".",
"'/.env.template'",
";",
"$",
"dotEnvPath",
"=",
"$",
"this",
"->",
"getIn... | Set up the .env file.
@param \Composer\Package\PackageInterface $package
@return void | [
"Set",
"up",
"the",
".",
"env",
"file",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L213-L253 |
23,125 | CupOfTea696/WordPress-Composer | src/Installer.php | Installer.checkWordPressInstallation | protected function checkWordPressInstallation()
{
$defaultWpInstallDir = $this->plugin->getRootDirectory() . '/wordpress';
$wpInstallDir = $this->getComposerConfigurator()->getWordPressInstallDirectory();
if (file_exists($defaultWpInstallDir) && is_dir($defaultWpInstallDir)) {
... | php | protected function checkWordPressInstallation()
{
$defaultWpInstallDir = $this->plugin->getRootDirectory() . '/wordpress';
$wpInstallDir = $this->getComposerConfigurator()->getWordPressInstallDirectory();
if (file_exists($defaultWpInstallDir) && is_dir($defaultWpInstallDir)) {
... | [
"protected",
"function",
"checkWordPressInstallation",
"(",
")",
"{",
"$",
"defaultWpInstallDir",
"=",
"$",
"this",
"->",
"plugin",
"->",
"getRootDirectory",
"(",
")",
".",
"'/wordpress'",
";",
"$",
"wpInstallDir",
"=",
"$",
"this",
"->",
"getComposerConfigurator"... | Check if WordPress is installed in the correct directory,
and move it there if it is not.
@return void | [
"Check",
"if",
"WordPress",
"is",
"installed",
"in",
"the",
"correct",
"directory",
"and",
"move",
"it",
"there",
"if",
"it",
"is",
"not",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L281-L297 |
23,126 | CupOfTea696/WordPress-Composer | src/Installer.php | Installer.selectPreferredLanguageOnWordPressInstall | protected function selectPreferredLanguageOnWordPressInstall()
{
$wpInstallScriptPath = $this->getComposerConfigurator()->getWordPressInstallDirectory() . '/wp-admin/install.php';
if (file_exists($wpInstallScriptPath)) {
$wpInstallScript = file_get_contents($wpInstallScriptPath)... | php | protected function selectPreferredLanguageOnWordPressInstall()
{
$wpInstallScriptPath = $this->getComposerConfigurator()->getWordPressInstallDirectory() . '/wp-admin/install.php';
if (file_exists($wpInstallScriptPath)) {
$wpInstallScript = file_get_contents($wpInstallScriptPath)... | [
"protected",
"function",
"selectPreferredLanguageOnWordPressInstall",
"(",
")",
"{",
"$",
"wpInstallScriptPath",
"=",
"$",
"this",
"->",
"getComposerConfigurator",
"(",
")",
"->",
"getWordPressInstallDirectory",
"(",
")",
".",
"'/wp-admin/install.php'",
";",
"if",
"(",
... | Select the preferred en_GB option in the WordPress installation language form.
@return void | [
"Select",
"the",
"preferred",
"en_GB",
"option",
"in",
"the",
"WordPress",
"installation",
"language",
"form",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L304-L320 |
23,127 | CupOfTea696/WordPress-Composer | src/Installer.php | Installer.installFiles | protected function installFiles($installPath, $downloadPath, $publicPath, $files = [])
{
foreach ($files as $file => $overwrite) {
if ($overwrite || (! $overwrite && ! file_exists($installPath . '/' . $file))) {
if (! file_exists($downloadPath . '/' . $file)) {
... | php | protected function installFiles($installPath, $downloadPath, $publicPath, $files = [])
{
foreach ($files as $file => $overwrite) {
if ($overwrite || (! $overwrite && ! file_exists($installPath . '/' . $file))) {
if (! file_exists($downloadPath . '/' . $file)) {
... | [
"protected",
"function",
"installFiles",
"(",
"$",
"installPath",
",",
"$",
"downloadPath",
",",
"$",
"publicPath",
",",
"$",
"files",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
"=>",
"$",
"overwrite",
")",
"{",
"if",
"... | Install files.
@param string $installPath
@param string $downloadPath
@param string $publicPath
@param array $files
@return void | [
"Install",
"files",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L401-L424 |
23,128 | CupOfTea696/WordPress-Composer | src/Installer.php | Installer.compileTemplate | private function compileTemplate($templatePath, $destinationPath, $data = null)
{
if ($data == null) {
$data = $destinationPath;
$destinationPath = null;
}
if (! isset($this->templates[$templatePath])) {
$this->templates[$templatePath] = file_get_... | php | private function compileTemplate($templatePath, $destinationPath, $data = null)
{
if ($data == null) {
$data = $destinationPath;
$destinationPath = null;
}
if (! isset($this->templates[$templatePath])) {
$this->templates[$templatePath] = file_get_... | [
"private",
"function",
"compileTemplate",
"(",
"$",
"templatePath",
",",
"$",
"destinationPath",
",",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"data",
"==",
"null",
")",
"{",
"$",
"data",
"=",
"$",
"destinationPath",
";",
"$",
"destinationPath... | Compile a template file.
@param string $templatePath
@param string $destinationPath
@param array|null $data
@return string | [
"Compile",
"a",
"template",
"file",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L434-L458 |
23,129 | CupOfTea696/WordPress-Composer | src/Installer.php | Installer.sortRules | private function sortRules(&$rules)
{
sort($rules);
usort($rules, function ($a, $b) {
return strlen($a) - strlen($b);
});
} | php | private function sortRules(&$rules)
{
sort($rules);
usort($rules, function ($a, $b) {
return strlen($a) - strlen($b);
});
} | [
"private",
"function",
"sortRules",
"(",
"&",
"$",
"rules",
")",
"{",
"sort",
"(",
"$",
"rules",
")",
";",
"usort",
"(",
"$",
"rules",
",",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"strlen",
"(",
"$",
"a",
")",
"-",
"strlen... | Sort gitignore rules.
@param array &$rules
@return void | [
"Sort",
"gitignore",
"rules",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L466-L472 |
23,130 | CupOfTea696/WordPress-Composer | src/Installer.php | Installer.generateSalt | private function generateSalt()
{
$str = '';
$length = 64;
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}[]/|`,.?+-_=:;<> ';
$count = strlen($chars);
while ($length--) {
$str .= $chars[mt_rand(0, $count - 1)];
... | php | private function generateSalt()
{
$str = '';
$length = 64;
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}[]/|`,.?+-_=:;<> ';
$count = strlen($chars);
while ($length--) {
$str .= $chars[mt_rand(0, $count - 1)];
... | [
"private",
"function",
"generateSalt",
"(",
")",
"{",
"$",
"str",
"=",
"''",
";",
"$",
"length",
"=",
"64",
";",
"$",
"chars",
"=",
"'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}[]/|`,.?+-_=:;<> '",
";",
"$",
"count",
"=",
"strlen",
"("... | Generate a Salt Key.
@return string | [
"Generate",
"a",
"Salt",
"Key",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L479-L491 |
23,131 | ShaoZeMing/laravel-merchant | src/Form/Field.php | Field.removeElementClass | public function removeElementClass($class)
{
$delClass = [];
if (is_string($class) || is_array($class)) {
$delClass = (array) $class;
}
foreach ($delClass as $del) {
if (($key = array_search($del, $this->elementClass))) {
unset($this->element... | php | public function removeElementClass($class)
{
$delClass = [];
if (is_string($class) || is_array($class)) {
$delClass = (array) $class;
}
foreach ($delClass as $del) {
if (($key = array_search($del, $this->elementClass))) {
unset($this->element... | [
"public",
"function",
"removeElementClass",
"(",
"$",
"class",
")",
"{",
"$",
"delClass",
"=",
"[",
"]",
";",
"if",
"(",
"is_string",
"(",
"$",
"class",
")",
"||",
"is_array",
"(",
"$",
"class",
")",
")",
"{",
"$",
"delClass",
"=",
"(",
"array",
")... | Remove element class.
@param $class
@return $this | [
"Remove",
"element",
"class",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Field.php#L835-L850 |
23,132 | ShaoZeMing/laravel-merchant | src/Form/Field.php | Field.getView | public function getView()
{
if (!empty($this->view)) {
return $this->view;
}
$class = explode('\\', get_called_class());
return 'merchant::form.'.strtolower(end($class));
} | php | public function getView()
{
if (!empty($this->view)) {
return $this->view;
}
$class = explode('\\', get_called_class());
return 'merchant::form.'.strtolower(end($class));
} | [
"public",
"function",
"getView",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"view",
")",
")",
"{",
"return",
"$",
"this",
"->",
"view",
";",
"}",
"$",
"class",
"=",
"explode",
"(",
"'\\\\'",
",",
"get_called_class",
"(",
")",
... | Get view of this field.
@return string | [
"Get",
"view",
"of",
"this",
"field",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Field.php#L879-L888 |
23,133 | ezsystems/ezcomments-ls-extension | classes/ezcomcommentmanager.php | ezcomCommentManager.updateComment | public function updateComment( $comment, $user=null, $time = null , $notified = null )
{
if ( $time === null )
{
$time = time();
}
$beforeUpdating = $this->beforeUpdatingComment( $comment, $notified, $time );
if ( $beforeUpdating !== true )
{
... | php | public function updateComment( $comment, $user=null, $time = null , $notified = null )
{
if ( $time === null )
{
$time = time();
}
$beforeUpdating = $this->beforeUpdatingComment( $comment, $notified, $time );
if ( $beforeUpdating !== true )
{
... | [
"public",
"function",
"updateComment",
"(",
"$",
"comment",
",",
"$",
"user",
"=",
"null",
",",
"$",
"time",
"=",
"null",
",",
"$",
"notified",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"time",
"===",
"null",
")",
"{",
"$",
"time",
"=",
"time",
"(",... | Update the comment
@param $comment comment to be updated
@param $notified change the notification
@param $time
@param $user user to change
@return | [
"Update",
"the",
"comment"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcommentmanager.php#L120-L140 |
23,134 | ezsystems/ezcomments-ls-extension | classes/ezcomcommentmanager.php | ezcomCommentManager.instance | public static function instance()
{
if ( !isset( self::$instance ) )
{
$ini = eZINI::instance( 'ezcomments.ini' );
$className = $ini->variable( 'ManagerClasses', 'CommentManagerClass' );
self::$instance = new $className();
}
return self::$instance;... | php | public static function instance()
{
if ( !isset( self::$instance ) )
{
$ini = eZINI::instance( 'ezcomments.ini' );
$className = $ini->variable( 'ManagerClasses', 'CommentManagerClass' );
self::$instance = new $className();
}
return self::$instance;... | [
"public",
"static",
"function",
"instance",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"$",
"ini",
"=",
"eZINI",
"::",
"instance",
"(",
"'ezcomments.ini'",
")",
";",
"$",
"className",
"=",
"$",
"ini",
... | create an instance of ezcomCommentManager
@return ezcomCommentManager | [
"create",
"an",
"instance",
"of",
"ezcomCommentManager"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcommentmanager.php#L159-L168 |
23,135 | LeaseCloud/leasecloud-php-sdk | src/ApiResource.php | ApiResource.staticRequest | protected static function staticRequest($method, $url, $params)
{
$requestor = new ApiRequestor();
list($response, $code) = $requestor->request($method, $url, $params);
return array($response, $code);
} | php | protected static function staticRequest($method, $url, $params)
{
$requestor = new ApiRequestor();
list($response, $code) = $requestor->request($method, $url, $params);
return array($response, $code);
} | [
"protected",
"static",
"function",
"staticRequest",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"params",
")",
"{",
"$",
"requestor",
"=",
"new",
"ApiRequestor",
"(",
")",
";",
"list",
"(",
"$",
"response",
",",
"$",
"code",
")",
"=",
"$",
"reques... | Make the http GET or POST request
@param string $method
@param string $url
@param array|null $params
@return array | [
"Make",
"the",
"http",
"GET",
"or",
"POST",
"request"
] | 091b073dd4f79ba915a68c0ed151bd9bfa61e7ca | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/ApiResource.php#L68-L73 |
23,136 | xiewulong/yii2-fileupload | oss/libs/guzzle/http/Guzzle/Http/Message/Response.php | Response.xml | public function xml()
{
try {
// Allow XML to be retrieved even if there is no response body
$xml = new \SimpleXMLElement((string) $this->body ?: '<root />');
} catch (\Exception $e) {
throw new RuntimeException('Unable to parse response body into XML: ' . $e->get... | php | public function xml()
{
try {
// Allow XML to be retrieved even if there is no response body
$xml = new \SimpleXMLElement((string) $this->body ?: '<root />');
} catch (\Exception $e) {
throw new RuntimeException('Unable to parse response body into XML: ' . $e->get... | [
"public",
"function",
"xml",
"(",
")",
"{",
"try",
"{",
"// Allow XML to be retrieved even if there is no response body",
"$",
"xml",
"=",
"new",
"\\",
"SimpleXMLElement",
"(",
"(",
"string",
")",
"$",
"this",
"->",
"body",
"?",
":",
"'<root />'",
")",
";",
"}... | Parse the XML response body and return a SimpleXMLElement
@return \SimpleXMLElement
@throws RuntimeException if the response body is not in XML format | [
"Parse",
"the",
"XML",
"response",
"body",
"and",
"return",
"a",
"SimpleXMLElement"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Message/Response.php#L873-L883 |
23,137 | j-d/draggy | src/Draggy/Utils/Yaml/YamlLoader.php | YamlLoader.mergeConfigurations | public static function mergeConfigurations($target, $source)
{
foreach (['attributes', 'entities', 'relationships', 'autocode', 'languages', 'frameworks', 'orms'] as $configurationPart) {
if (isset($source[$configurationPart])) {
$target[$configurationPart] = self::mergeArrays($t... | php | public static function mergeConfigurations($target, $source)
{
foreach (['attributes', 'entities', 'relationships', 'autocode', 'languages', 'frameworks', 'orms'] as $configurationPart) {
if (isset($source[$configurationPart])) {
$target[$configurationPart] = self::mergeArrays($t... | [
"public",
"static",
"function",
"mergeConfigurations",
"(",
"$",
"target",
",",
"$",
"source",
")",
"{",
"foreach",
"(",
"[",
"'attributes'",
",",
"'entities'",
",",
"'relationships'",
",",
"'autocode'",
",",
"'languages'",
",",
"'frameworks'",
",",
"'orms'",
... | Complete the different configuration sections on the target array with those ones found on the source array
@param array $target
@param array $source
@return array | [
"Complete",
"the",
"different",
"configuration",
"sections",
"on",
"the",
"target",
"array",
"with",
"those",
"ones",
"found",
"on",
"the",
"source",
"array"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Utils/Yaml/YamlLoader.php#L48-L57 |
23,138 | j-d/draggy | src/Draggy/Utils/Yaml/YamlLoader.php | YamlLoader.loadConfiguration | public static function loadConfiguration()
{
$defaultsFile = __DIR__ . '/../../../../app/config/defaults.yml';
$draggyFile = __DIR__ . '/../../../../app/config/draggy.yml';
$userFile = __DIR__ . '/../../../../app/config/user.yml';
$defaultsArray = Yaml::parse($defaultsFile);
... | php | public static function loadConfiguration()
{
$defaultsFile = __DIR__ . '/../../../../app/config/defaults.yml';
$draggyFile = __DIR__ . '/../../../../app/config/draggy.yml';
$userFile = __DIR__ . '/../../../../app/config/user.yml';
$defaultsArray = Yaml::parse($defaultsFile);
... | [
"public",
"static",
"function",
"loadConfiguration",
"(",
")",
"{",
"$",
"defaultsFile",
"=",
"__DIR__",
".",
"'/../../../../app/config/defaults.yml'",
";",
"$",
"draggyFile",
"=",
"__DIR__",
".",
"'/../../../../app/config/draggy.yml'",
";",
"$",
"userFile",
"=",
"__D... | Load the model configuration, merge it onto the default one and return the result array
@return array | [
"Load",
"the",
"model",
"configuration",
"merge",
"it",
"onto",
"the",
"default",
"one",
"and",
"return",
"the",
"result",
"array"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Utils/Yaml/YamlLoader.php#L64-L79 |
23,139 | m4grio/bangkok-insurance-php | src/ClientBuilder.php | ClientBuilder.build | public function build()
{
$soapClient = (new Factory)->getClient($this->getEndpoint(), $this->getSoapOptions());
$params['user_id'] = $this->userId;
$params['agent_code'] = $this->agentCode;
$params['agent_seq'] = $this->agentSeq;
$client = new $this->client($soapClient, $pa... | php | public function build()
{
$soapClient = (new Factory)->getClient($this->getEndpoint(), $this->getSoapOptions());
$params['user_id'] = $this->userId;
$params['agent_code'] = $this->agentCode;
$params['agent_seq'] = $this->agentSeq;
$client = new $this->client($soapClient, $pa... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"soapClient",
"=",
"(",
"new",
"Factory",
")",
"->",
"getClient",
"(",
"$",
"this",
"->",
"getEndpoint",
"(",
")",
",",
"$",
"this",
"->",
"getSoapOptions",
"(",
")",
")",
";",
"$",
"params",
"[",
... | Build a new client's instance
@return Client | [
"Build",
"a",
"new",
"client",
"s",
"instance"
] | 400266d043abe6b7cacb9da36064cbb169149c2a | https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/ClientBuilder.php#L147-L161 |
23,140 | husccexo/php-handlersocket-core | src/HSCore/Socket.php | Socket.parseResponse | protected function parseResponse($string)
{
$exp = explode(Driver::SEP, $string);
if ($exp[0] != 0) {
throw new HSException(isset($exp[2]) ? $exp[2] : '', $exp[0]);
}
array_shift($exp); // skip error code
$numCols = intval(array_shift($exp));
$exp = arr... | php | protected function parseResponse($string)
{
$exp = explode(Driver::SEP, $string);
if ($exp[0] != 0) {
throw new HSException(isset($exp[2]) ? $exp[2] : '', $exp[0]);
}
array_shift($exp); // skip error code
$numCols = intval(array_shift($exp));
$exp = arr... | [
"protected",
"function",
"parseResponse",
"(",
"$",
"string",
")",
"{",
"$",
"exp",
"=",
"explode",
"(",
"Driver",
"::",
"SEP",
",",
"$",
"string",
")",
";",
"if",
"(",
"$",
"exp",
"[",
"0",
"]",
"!=",
"0",
")",
"{",
"throw",
"new",
"HSException",
... | Parse response from server
@param $string
@return array
@throws HSException | [
"Parse",
"response",
"from",
"server"
] | aaeeece9c90a89bbc861a6fe390bc0c892496bf0 | https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Socket.php#L100-L114 |
23,141 | husccexo/php-handlersocket-core | src/HSCore/Socket.php | Socket.connect | private function connect()
{
if (!$this->socket->isOpened()) {
$this->socket->open();
if ($this->secret) {
$this->socket->send(join(Driver::SEP, ['A', 1, Driver::encode($this->secret)]).Driver::EOL);
}
}
} | php | private function connect()
{
if (!$this->socket->isOpened()) {
$this->socket->open();
if ($this->secret) {
$this->socket->send(join(Driver::SEP, ['A', 1, Driver::encode($this->secret)]).Driver::EOL);
}
}
} | [
"private",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"socket",
"->",
"isOpened",
"(",
")",
")",
"{",
"$",
"this",
"->",
"socket",
"->",
"open",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"secret",
")",
"{",
"$",... | Connect to Handler Socket
@throws HSException | [
"Connect",
"to",
"Handler",
"Socket"
] | aaeeece9c90a89bbc861a6fe390bc0c892496bf0 | https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Socket.php#L122-L131 |
23,142 | blast-project/BaseEntitiesBundle | src/Controller/SortableController.php | SortableController.moveSortableItemAction | public function moveSortableItemAction(Request $request)
{
$admin = $this->container->get('sonata.admin.pool')->getInstance($request->get('admin_code'));
$class = $admin->getClass();
$id = $request->get('id');
$prev_rank = (int) $request->get('prev_rank');
$next_rank = (int)... | php | public function moveSortableItemAction(Request $request)
{
$admin = $this->container->get('sonata.admin.pool')->getInstance($request->get('admin_code'));
$class = $admin->getClass();
$id = $request->get('id');
$prev_rank = (int) $request->get('prev_rank');
$next_rank = (int)... | [
"public",
"function",
"moveSortableItemAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"admin",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'sonata.admin.pool'",
")",
"->",
"getInstance",
"(",
"$",
"request",
"->",
"get",
"(",
"'admin_cod... | Move a sortable item.
@param Request $request
@return JsonResponse
@throws \RuntimeException
@throws AccessDeniedException | [
"Move",
"a",
"sortable",
"item",
"."
] | abd06891fc38922225ab7e4fcb437a286ba2c0c4 | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Controller/SortableController.php#L34-L57 |
23,143 | gn36/phpbb-oo-posting-api | src/Gn36/OoPostingApi/topic.php | topic.bump | function bump($user_id = 0)
{
global $db, $user;
$current_time = time();
if ($user_id == 0)
$user_id = $user->data['user_id'];
$db->sql_transaction('begin');
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_time = $current_time
WHERE post_id = {$this->topic_last_post_id}
AND topic_id = {$this->topic_i... | php | function bump($user_id = 0)
{
global $db, $user;
$current_time = time();
if ($user_id == 0)
$user_id = $user->data['user_id'];
$db->sql_transaction('begin');
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_time = $current_time
WHERE post_id = {$this->topic_last_post_id}
AND topic_id = {$this->topic_i... | [
"function",
"bump",
"(",
"$",
"user_id",
"=",
"0",
")",
"{",
"global",
"$",
"db",
",",
"$",
"user",
";",
"$",
"current_time",
"=",
"time",
"(",
")",
";",
"if",
"(",
"$",
"user_id",
"==",
"0",
")",
"$",
"user_id",
"=",
"$",
"user",
"->",
"data",... | bumps the topic
@param | [
"bumps",
"the",
"topic"
] | d0e19482a9e1e93a435c1758a66df9324145381a | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/src/Gn36/OoPostingApi/topic.php#L717-L755 |
23,144 | Baachi/CouchDB | src/CouchDB/Connection.php | Connection.version | public function version()
{
$json = (string) $this->client->request('GET', '/')->getBody();
$value = JSONEncoder::decode($json);
return $value['version'];
} | php | public function version()
{
$json = (string) $this->client->request('GET', '/')->getBody();
$value = JSONEncoder::decode($json);
return $value['version'];
} | [
"public",
"function",
"version",
"(",
")",
"{",
"$",
"json",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
",",
"'/'",
")",
"->",
"getBody",
"(",
")",
";",
"$",
"value",
"=",
"JSONEncoder",
"::",
"decode",
"("... | Get the couchdb version.
@return string | [
"Get",
"the",
"couchdb",
"version",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L52-L58 |
23,145 | Baachi/CouchDB | src/CouchDB/Connection.php | Connection.listDatabases | public function listDatabases()
{
$json = (string) $this->client->request('GET', '/_all_dbs')->getBody();
$databases = JSONEncoder::decode($json);
return $databases;
} | php | public function listDatabases()
{
$json = (string) $this->client->request('GET', '/_all_dbs')->getBody();
$databases = JSONEncoder::decode($json);
return $databases;
} | [
"public",
"function",
"listDatabases",
"(",
")",
"{",
"$",
"json",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'GET'",
",",
"'/_all_dbs'",
")",
"->",
"getBody",
"(",
")",
";",
"$",
"databases",
"=",
"JSONEncoder",
"::",... | Show all databases.
@return array | [
"Show",
"all",
"databases",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L65-L71 |
23,146 | Baachi/CouchDB | src/CouchDB/Connection.php | Connection.dropDatabase | public function dropDatabase($name)
{
if ($this->eventManager->hasListeners(Events::PRE_DROP_DATABASE)) {
// @codeCoverageIgnoreStart
$this->eventManager->dispatchEvent(Events::PRE_DROP_DATABASE, new EventArgs($this, $name));
// @codeCoverageIgnoreEnd
}
$... | php | public function dropDatabase($name)
{
if ($this->eventManager->hasListeners(Events::PRE_DROP_DATABASE)) {
// @codeCoverageIgnoreStart
$this->eventManager->dispatchEvent(Events::PRE_DROP_DATABASE, new EventArgs($this, $name));
// @codeCoverageIgnoreEnd
}
$... | [
"public",
"function",
"dropDatabase",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"eventManager",
"->",
"hasListeners",
"(",
"Events",
"::",
"PRE_DROP_DATABASE",
")",
")",
"{",
"// @codeCoverageIgnoreStart",
"$",
"this",
"->",
"eventManager",
"->... | Drop a database.
@param string $name
@return bool | [
"Drop",
"a",
"database",
"."
] | 6be364c2f3d9c7b1288b1c11115469c91819ff5c | https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L80-L104 |
23,147 | antismok/domain-events-publisher | src/DomainEventPublisher.php | DomainEventPublisher.removeListener | public function removeListener(string $eventName, $listener): void
{
$this->dispatcher->removeListener($eventName, $listener);
} | php | public function removeListener(string $eventName, $listener): void
{
$this->dispatcher->removeListener($eventName, $listener);
} | [
"public",
"function",
"removeListener",
"(",
"string",
"$",
"eventName",
",",
"$",
"listener",
")",
":",
"void",
"{",
"$",
"this",
"->",
"dispatcher",
"->",
"removeListener",
"(",
"$",
"eventName",
",",
"$",
"listener",
")",
";",
"}"
] | Remove event listener
@param string $eventName
@param type $listener
@return void | [
"Remove",
"event",
"listener"
] | 3ce431a0b81b1de10cd189281b05b8084c42bc63 | https://github.com/antismok/domain-events-publisher/blob/3ce431a0b81b1de10cd189281b05b8084c42bc63/src/DomainEventPublisher.php#L75-L78 |
23,148 | antismok/domain-events-publisher | src/DomainEventPublisher.php | DomainEventPublisher.removeListeners | public function removeListeners(string $eventName): void
{
foreach ($this->dispatcher->getListeners($eventName) as $listener) {
$this->removeListener($eventName, $listener);
}
} | php | public function removeListeners(string $eventName): void
{
foreach ($this->dispatcher->getListeners($eventName) as $listener) {
$this->removeListener($eventName, $listener);
}
} | [
"public",
"function",
"removeListeners",
"(",
"string",
"$",
"eventName",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"dispatcher",
"->",
"getListeners",
"(",
"$",
"eventName",
")",
"as",
"$",
"listener",
")",
"{",
"$",
"this",
"->",
"remov... | Remove all event listeners
@param string $eventName
@return void | [
"Remove",
"all",
"event",
"listeners"
] | 3ce431a0b81b1de10cd189281b05b8084c42bc63 | https://github.com/antismok/domain-events-publisher/blob/3ce431a0b81b1de10cd189281b05b8084c42bc63/src/DomainEventPublisher.php#L87-L92 |
23,149 | surebert/surebert-framework | src/sb/XMPP/Packet.php | Packet.setTo | public function setTo($to)
{
$attr = $this->createAttribute('to');
$this->doc->appendChild($attr);
$attr->appendChild($this->createTextNode($to));
} | php | public function setTo($to)
{
$attr = $this->createAttribute('to');
$this->doc->appendChild($attr);
$attr->appendChild($this->createTextNode($to));
} | [
"public",
"function",
"setTo",
"(",
"$",
"to",
")",
"{",
"$",
"attr",
"=",
"$",
"this",
"->",
"createAttribute",
"(",
"'to'",
")",
";",
"$",
"this",
"->",
"doc",
"->",
"appendChild",
"(",
"$",
"attr",
")",
";",
"$",
"attr",
"->",
"appendChild",
"("... | Sets the to jid of the message
@param string $to e.g. paul.visco@chat.roswellpark.org | [
"Sets",
"the",
"to",
"jid",
"of",
"the",
"message"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Packet.php#L62-L67 |
23,150 | surebert/surebert-framework | src/sb/XMPP/Packet.php | Packet.setFrom | public function setFrom($from)
{
$attr = $this->createAttribute('from');
$this->doc->appendChild($attr);
$attr->appendChild($this->createTextNode($from));
} | php | public function setFrom($from)
{
$attr = $this->createAttribute('from');
$this->doc->appendChild($attr);
$attr->appendChild($this->createTextNode($from));
} | [
"public",
"function",
"setFrom",
"(",
"$",
"from",
")",
"{",
"$",
"attr",
"=",
"$",
"this",
"->",
"createAttribute",
"(",
"'from'",
")",
";",
"$",
"this",
"->",
"doc",
"->",
"appendChild",
"(",
"$",
"attr",
")",
";",
"$",
"attr",
"->",
"appendChild",... | Sets the from jid of the message
@param string $from e.g. paul.visco@chat.roswellpark.org | [
"Sets",
"the",
"from",
"jid",
"of",
"the",
"message"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Packet.php#L73-L78 |
23,151 | surebert/surebert-framework | src/sb/XMPP/Packet.php | Packet.addXML | public function addXML($xml)
{
$next_elem = $this->createDocumentFragment();
$next_elem->appendXML($xml);
$this->doc->appendChild($next_elem);
} | php | public function addXML($xml)
{
$next_elem = $this->createDocumentFragment();
$next_elem->appendXML($xml);
$this->doc->appendChild($next_elem);
} | [
"public",
"function",
"addXML",
"(",
"$",
"xml",
")",
"{",
"$",
"next_elem",
"=",
"$",
"this",
"->",
"createDocumentFragment",
"(",
")",
";",
"$",
"next_elem",
"->",
"appendXML",
"(",
"$",
"xml",
")",
";",
"$",
"this",
"->",
"doc",
"->",
"appendChild",... | Adds an arbitrary XML string to the packet's root node
@param string $xml | [
"Adds",
"an",
"arbitrary",
"XML",
"string",
"to",
"the",
"packet",
"s",
"root",
"node"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Packet.php#L104-L110 |
23,152 | glynnforrest/active-doctrine | src/ActiveDoctrine/Repository/AbstractRepository.php | AbstractRepository.findBy | public function findBy(array $conditions)
{
$s = $this->selector();
foreach ($conditions as $column => $value) {
$s->where($column, '=', $value);
}
return $s->execute();
} | php | public function findBy(array $conditions)
{
$s = $this->selector();
foreach ($conditions as $column => $value) {
$s->where($column, '=', $value);
}
return $s->execute();
} | [
"public",
"function",
"findBy",
"(",
"array",
"$",
"conditions",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"selector",
"(",
")",
";",
"foreach",
"(",
"$",
"conditions",
"as",
"$",
"column",
"=>",
"$",
"value",
")",
"{",
"$",
"s",
"->",
"where",
... | Select entities matching an array of conditions.
@param array $conditions An array of the form 'column => value'
@return EntityCollection The selected entities | [
"Select",
"entities",
"matching",
"an",
"array",
"of",
"conditions",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Repository/AbstractRepository.php#L57-L65 |
23,153 | glynnforrest/active-doctrine | src/ActiveDoctrine/Repository/AbstractRepository.php | AbstractRepository.findOneBy | public function findOneBy(array $conditions)
{
$s = $this->selector()->one();
foreach ($conditions as $column => $value) {
$s->where($column, '=', $value);
}
return $s->execute();
} | php | public function findOneBy(array $conditions)
{
$s = $this->selector()->one();
foreach ($conditions as $column => $value) {
$s->where($column, '=', $value);
}
return $s->execute();
} | [
"public",
"function",
"findOneBy",
"(",
"array",
"$",
"conditions",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"selector",
"(",
")",
"->",
"one",
"(",
")",
";",
"foreach",
"(",
"$",
"conditions",
"as",
"$",
"column",
"=>",
"$",
"value",
")",
"{",
... | Select a single entity matching an array of conditions.
@param array $conditions An array of the form 'column => value'
@return Entity|null The selected entity or null | [
"Select",
"a",
"single",
"entity",
"matching",
"an",
"array",
"of",
"conditions",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Repository/AbstractRepository.php#L73-L81 |
23,154 | scherersoftware/cake-monitor | src/Error/SentryHandler.php | SentryHandler.captureMessage | public function captureMessage($message, $params = [], $data = [], $stack = false, $vars = null)
{
if (!Configure::read('CakeMonitor.Sentry.enabled') || error_reporting() === 0) {
return false;
}
if (is_callable(Configure::read('CakeMonitor.Sentry.extraDataCallback'))) {
... | php | public function captureMessage($message, $params = [], $data = [], $stack = false, $vars = null)
{
if (!Configure::read('CakeMonitor.Sentry.enabled') || error_reporting() === 0) {
return false;
}
if (is_callable(Configure::read('CakeMonitor.Sentry.extraDataCallback'))) {
... | [
"public",
"function",
"captureMessage",
"(",
"$",
"message",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"stack",
"=",
"false",
",",
"$",
"vars",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"Configure",
"::",
"read",
... | Capture a message via sentry
@param string $message The message (primary description) for the event.
@param array $params params to use when formatting the message.
@param array $data Additional attributes to pass with this event (see Sentry docs).
@param bool $stack Print stack trace
@param null $vars Variables
@retu... | [
"Capture",
"a",
"message",
"via",
"sentry"
] | dbe07a1aac41b3db15e631d9e59cf26214bf6938 | https://github.com/scherersoftware/cake-monitor/blob/dbe07a1aac41b3db15e631d9e59cf26214bf6938/src/Error/SentryHandler.php#L65-L76 |
23,155 | oroinc/OroLayoutComponent | Loader/Generator/ConfigLayoutUpdateGenerator.php | ConfigLayoutUpdateGenerator.validate | protected function validate(GeneratorData $data)
{
$source = $data->getSource();
if (!(is_array($source) && isset($source[self::NODE_ACTIONS]) && is_array($source[self::NODE_ACTIONS]))) {
throw new SyntaxException(sprintf('expected array with "%s" node', self::NODE_ACTIONS), $source);
... | php | protected function validate(GeneratorData $data)
{
$source = $data->getSource();
if (!(is_array($source) && isset($source[self::NODE_ACTIONS]) && is_array($source[self::NODE_ACTIONS]))) {
throw new SyntaxException(sprintf('expected array with "%s" node', self::NODE_ACTIONS), $source);
... | [
"protected",
"function",
"validate",
"(",
"GeneratorData",
"$",
"data",
")",
"{",
"$",
"source",
"=",
"$",
"data",
"->",
"getSource",
"(",
")",
";",
"if",
"(",
"!",
"(",
"is_array",
"(",
"$",
"source",
")",
"&&",
"isset",
"(",
"$",
"source",
"[",
"... | Validates given resource data, checks that "actions" node exists and consist valid actions.
{@inheritdoc}
@SuppressWarnings(PHPMD.NPathComplexity) | [
"Validates",
"given",
"resource",
"data",
"checks",
"that",
"actions",
"node",
"exists",
"and",
"consist",
"valid",
"actions",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Generator/ConfigLayoutUpdateGenerator.php#L68-L115 |
23,156 | tylernathanreed/flash | src/Flash.php | Flash.flash | private function flash($type, $message)
{
// Determine the Current Session Flash Type
$flash = Session::has($type) ? Session::get($type) : array();
// Prevent Duplicate Messages from Appearing
if(!in_array($message, $flash))
$flash[] = $message; // Add the Message to the Flashes
// Flash the Message
S... | php | private function flash($type, $message)
{
// Determine the Current Session Flash Type
$flash = Session::has($type) ? Session::get($type) : array();
// Prevent Duplicate Messages from Appearing
if(!in_array($message, $flash))
$flash[] = $message; // Add the Message to the Flashes
// Flash the Message
S... | [
"private",
"function",
"flash",
"(",
"$",
"type",
",",
"$",
"message",
")",
"{",
"// Determine the Current Session Flash Type",
"$",
"flash",
"=",
"Session",
"::",
"has",
"(",
"$",
"type",
")",
"?",
"Session",
"::",
"get",
"(",
"$",
"type",
")",
":",
"ar... | Flashes a Message to the Session.
@param string $type The Type of Message to Flash.
@param string $message The Message to Flash.
@return void | [
"Flashes",
"a",
"Message",
"to",
"the",
"Session",
"."
] | 6ca4b361493e7e48e3c3cf6b1ed95f8a1b2b724c | https://github.com/tylernathanreed/flash/blob/6ca4b361493e7e48e3c3cf6b1ed95f8a1b2b724c/src/Flash.php#L82-L93 |
23,157 | nabab/bbn | src/bbn/appui/mailbox.php | mailbox.mbox_exists | public function mbox_exists($name){
if ( $this->is_connected() && !empty($name) ){
$names = $this->get_all_names_mboxes();
if ( !empty($names) && \in_array($name, $names) ){
return true;
}
}
return false;
} | php | public function mbox_exists($name){
if ( $this->is_connected() && !empty($name) ){
$names = $this->get_all_names_mboxes();
if ( !empty($names) && \in_array($name, $names) ){
return true;
}
}
return false;
} | [
"public",
"function",
"mbox_exists",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_connected",
"(",
")",
"&&",
"!",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"$",
"names",
"=",
"$",
"this",
"->",
"get_all_names_mboxes",
"(",
")",
";... | Check if a mailbox exists
@param string $name The mailbox name
@return bool | [
"Check",
"if",
"a",
"mailbox",
"exists"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/mailbox.php#L710-L718 |
23,158 | surebert/surebert-framework | src/sb/Gitlab/Project.php | Project.issueCreate | public function issueCreate($title, $description, $assignee_email, $labels='') {
$post = [
'id' => $this->id,
'title' => $title,
'description' => $description
];
if($assignee_email){
$user = new \sb\Gitlab\User($assignee_email, $t... | php | public function issueCreate($title, $description, $assignee_email, $labels='') {
$post = [
'id' => $this->id,
'title' => $title,
'description' => $description
];
if($assignee_email){
$user = new \sb\Gitlab\User($assignee_email, $t... | [
"public",
"function",
"issueCreate",
"(",
"$",
"title",
",",
"$",
"description",
",",
"$",
"assignee_email",
",",
"$",
"labels",
"=",
"''",
")",
"{",
"$",
"post",
"=",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'title'",
"=>",
"$",
"title",
... | Adds an issue to a git repository
@param string $title
@param string $description
@param string $assignee_email
@return \Gitlab\Model\Issue
@throws \Exception | [
"Adds",
"an",
"issue",
"to",
"a",
"git",
"repository"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Gitlab/Project.php#L183-L200 |
23,159 | surebert/surebert-framework | src/sb/Gitlab/Project.php | Project.issueClose | public function issueClose(\sb\Gitlab\Issue $issue){
$response = $this->_client->get("/projects/".$this->id."/issues/".$issue->id, [
'state_event' => 'close'
], 'PUT');
if(is_object($response) && isset($response->message)){
throw new \Exception("Could not close ... | php | public function issueClose(\sb\Gitlab\Issue $issue){
$response = $this->_client->get("/projects/".$this->id."/issues/".$issue->id, [
'state_event' => 'close'
], 'PUT');
if(is_object($response) && isset($response->message)){
throw new \Exception("Could not close ... | [
"public",
"function",
"issueClose",
"(",
"\\",
"sb",
"\\",
"Gitlab",
"\\",
"Issue",
"$",
"issue",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"_client",
"->",
"get",
"(",
"\"/projects/\"",
".",
"$",
"this",
"->",
"id",
".",
"\"/issues/\"",
".",
... | Closes an issue by id within the project
@param int $issue_id
@return type | [
"Closes",
"an",
"issue",
"by",
"id",
"within",
"the",
"project"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Gitlab/Project.php#L207-L217 |
23,160 | surebert/surebert-framework | src/sb/Gitlab/Project.php | Project.fromObject | public static function fromObject($object){
$issue = new \sb\Gitlab\P();
foreach(get_object_vars($object) as $k=>$v){
switch($k){
case 'assignee':
case 'author':
if(!is_object($v)){
$issue->{$k} = $v;
... | php | public static function fromObject($object){
$issue = new \sb\Gitlab\P();
foreach(get_object_vars($object) as $k=>$v){
switch($k){
case 'assignee':
case 'author':
if(!is_object($v)){
$issue->{$k} = $v;
... | [
"public",
"static",
"function",
"fromObject",
"(",
"$",
"object",
")",
"{",
"$",
"issue",
"=",
"new",
"\\",
"sb",
"\\",
"Gitlab",
"\\",
"P",
"(",
")",
";",
"foreach",
"(",
"get_object_vars",
"(",
"$",
"object",
")",
"as",
"$",
"k",
"=>",
"$",
"v",
... | Convert stdClass Object to actual \sb\Gitlab\Issue
@param \stdClass $object
@return \sb\Gitlab\Issue | [
"Convert",
"stdClass",
"Object",
"to",
"actual",
"\\",
"sb",
"\\",
"Gitlab",
"\\",
"Issue"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Gitlab/Project.php#L277-L302 |
23,161 | DevFactoryCH/api | src/Provider/RequestProvider.php | RequestProvider.put | public function put($url, $params = null) {
$this->params = $params;
$this->method = 'PUT';
$this->url = $url;
return $this->request();
} | php | public function put($url, $params = null) {
$this->params = $params;
$this->method = 'PUT';
$this->url = $url;
return $this->request();
} | [
"public",
"function",
"put",
"(",
"$",
"url",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"params",
"=",
"$",
"params",
";",
"$",
"this",
"->",
"method",
"=",
"'PUT'",
";",
"$",
"this",
"->",
"url",
"=",
"$",
"url",
";",
"retu... | Make a PUT query
@param data
@return | [
"Make",
"a",
"PUT",
"query"
] | ed239aac6e15cba23ae527b1d175c478d2b7d6ae | https://github.com/DevFactoryCH/api/blob/ed239aac6e15cba23ae527b1d175c478d2b7d6ae/src/Provider/RequestProvider.php#L27-L33 |
23,162 | DevFactoryCH/api | src/Provider/RequestProvider.php | RequestProvider.post | public function post($url, $params = null) {
$this->params = $params;
$this->method = 'POST';
$this->url = $url;
return $this->request();
} | php | public function post($url, $params = null) {
$this->params = $params;
$this->method = 'POST';
$this->url = $url;
return $this->request();
} | [
"public",
"function",
"post",
"(",
"$",
"url",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"params",
"=",
"$",
"params",
";",
"$",
"this",
"->",
"method",
"=",
"'POST'",
";",
"$",
"this",
"->",
"url",
"=",
"$",
"url",
";",
"re... | Make a POST query
@param data
@return | [
"Make",
"a",
"POST",
"query"
] | ed239aac6e15cba23ae527b1d175c478d2b7d6ae | https://github.com/DevFactoryCH/api/blob/ed239aac6e15cba23ae527b1d175c478d2b7d6ae/src/Provider/RequestProvider.php#L42-L48 |
23,163 | DevFactoryCH/api | src/Provider/RequestProvider.php | RequestProvider.get | public function get($url, $params = null) {
$this->params = $params;
$this->method = 'GET';
$this->url = $url;
return $this->request();
} | php | public function get($url, $params = null) {
$this->params = $params;
$this->method = 'GET';
$this->url = $url;
return $this->request();
} | [
"public",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"params",
"=",
"$",
"params",
";",
"$",
"this",
"->",
"method",
"=",
"'GET'",
";",
"$",
"this",
"->",
"url",
"=",
"$",
"url",
";",
"retu... | Make a GET query
@param data
@return | [
"Make",
"a",
"GET",
"query"
] | ed239aac6e15cba23ae527b1d175c478d2b7d6ae | https://github.com/DevFactoryCH/api/blob/ed239aac6e15cba23ae527b1d175c478d2b7d6ae/src/Provider/RequestProvider.php#L57-L63 |
23,164 | rafalkot/yii2-settings | SettingsTrait.php | SettingsTrait.getSetting | public function getSetting($key = null, $default = null)
{
return $this->getSettingsComponent()->get($this->getSettingsCategory(), $key, $default);
} | php | public function getSetting($key = null, $default = null)
{
return $this->getSettingsComponent()->get($this->getSettingsCategory(), $key, $default);
} | [
"public",
"function",
"getSetting",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getSettingsComponent",
"(",
")",
"->",
"get",
"(",
"$",
"this",
"->",
"getSettingsCategory",
"(",
")",
",",
"$",... | Returns settings from current category.
@param string|array $key Single or multiple keys in array
@param mixed $default Default value when setting does not exist
@return mixed Setting value
@throws Exception | [
"Returns",
"settings",
"from",
"current",
"category",
"."
] | b601b58809322f617273093766dc28c08e74d566 | https://github.com/rafalkot/yii2-settings/blob/b601b58809322f617273093766dc28c08e74d566/SettingsTrait.php#L39-L42 |
23,165 | oroinc/OroLayoutComponent | StringOptionValueBuilder.php | StringOptionValueBuilder.add | public function add($value)
{
if (!is_string($value)) {
throw new UnexpectedTypeException($value, 'string', 'value');
}
if (empty($value)) {
return;
}
if ($this->allowTokenize) {
$this->values = array_merge($this->values, explode($this->de... | php | public function add($value)
{
if (!is_string($value)) {
throw new UnexpectedTypeException($value, 'string', 'value');
}
if (empty($value)) {
return;
}
if ($this->allowTokenize) {
$this->values = array_merge($this->values, explode($this->de... | [
"public",
"function",
"add",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"value",
",",
"'string'",
",",
"'value'",
")",
";",
"}",
"if",
"(",
"empty",... | Requests to add new value
@param string $value | [
"Requests",
"to",
"add",
"new",
"value"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/StringOptionValueBuilder.php#L38-L52 |
23,166 | oroinc/OroLayoutComponent | StringOptionValueBuilder.php | StringOptionValueBuilder.remove | public function remove($value)
{
if (!is_string($value)) {
throw new UnexpectedTypeException($value, 'string', 'value');
}
if (empty($value)) {
return;
}
if ($this->allowTokenize) {
$this->values = array_diff($this->values, explode($this->... | php | public function remove($value)
{
if (!is_string($value)) {
throw new UnexpectedTypeException($value, 'string', 'value');
}
if (empty($value)) {
return;
}
if ($this->allowTokenize) {
$this->values = array_diff($this->values, explode($this->... | [
"public",
"function",
"remove",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"value",
",",
"'string'",
",",
"'value'",
")",
";",
"}",
"if",
"(",
"empt... | Requests to remove existing value
@param string $value | [
"Requests",
"to",
"remove",
"existing",
"value"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/StringOptionValueBuilder.php#L59-L73 |
23,167 | oroinc/OroLayoutComponent | StringOptionValueBuilder.php | StringOptionValueBuilder.replace | public function replace($oldValue, $newValue)
{
if (!is_string($oldValue)) {
throw new UnexpectedTypeException($oldValue, 'string', 'oldValue');
}
if (empty($oldValue)) {
return;
}
if (!is_string($newValue) && null !== $newValue) {
throw ne... | php | public function replace($oldValue, $newValue)
{
if (!is_string($oldValue)) {
throw new UnexpectedTypeException($oldValue, 'string', 'oldValue');
}
if (empty($oldValue)) {
return;
}
if (!is_string($newValue) && null !== $newValue) {
throw ne... | [
"public",
"function",
"replace",
"(",
"$",
"oldValue",
",",
"$",
"newValue",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"oldValue",
")",
")",
"{",
"throw",
"new",
"UnexpectedTypeException",
"(",
"$",
"oldValue",
",",
"'string'",
",",
"'oldValue'",
... | Requests to replace one value with another value
@param string $oldValue
@param string|null $newValue | [
"Requests",
"to",
"replace",
"one",
"value",
"with",
"another",
"value"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/StringOptionValueBuilder.php#L81-L101 |
23,168 | ekuiter/feature-php | FeaturePhp/File/StoredFileContent.php | StoredFileContent.copy | public function copy($target) {
if (!parent::copy($target))
return false;
return copy($this->fileSource, $target);
} | php | public function copy($target) {
if (!parent::copy($target))
return false;
return copy($this->fileSource, $target);
} | [
"public",
"function",
"copy",
"(",
"$",
"target",
")",
"{",
"if",
"(",
"!",
"parent",
"::",
"copy",
"(",
"$",
"target",
")",
")",
"return",
"false",
";",
"return",
"copy",
"(",
"$",
"this",
"->",
"fileSource",
",",
"$",
"target",
")",
";",
"}"
] | Copies the stored file's content to the local filesystem.
@param string $target the file target in the filesystem | [
"Copies",
"the",
"stored",
"file",
"s",
"content",
"to",
"the",
"local",
"filesystem",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/File/StoredFileContent.php#L59-L63 |
23,169 | blast-project/BaseEntitiesBundle | src/Search/SearchHandler.php | SearchHandler.indexSearch | public function indexSearch($searchText, $maxResults)
{
// split the phrase into words
$words = SearchAnalyser::analyse($searchText);
if (!$words) {
return [];
}
$query = $this->_em->createQueryBuilder()
->select('o')
->from($this->_entity... | php | public function indexSearch($searchText, $maxResults)
{
// split the phrase into words
$words = SearchAnalyser::analyse($searchText);
if (!$words) {
return [];
}
$query = $this->_em->createQueryBuilder()
->select('o')
->from($this->_entity... | [
"public",
"function",
"indexSearch",
"(",
"$",
"searchText",
",",
"$",
"maxResults",
")",
"{",
"// split the phrase into words",
"$",
"words",
"=",
"SearchAnalyser",
"::",
"analyse",
"(",
"$",
"searchText",
")",
";",
"if",
"(",
"!",
"$",
"words",
")",
"{",
... | Find the entities that have the appropriate keywords in their searchIndex.
@param string $searchText
@param int $maxResults
@return Collection found entities | [
"Find",
"the",
"entities",
"that",
"have",
"the",
"appropriate",
"keywords",
"in",
"their",
"searchIndex",
"."
] | abd06891fc38922225ab7e4fcb437a286ba2c0c4 | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Search/SearchHandler.php#L113-L141 |
23,170 | blast-project/BaseEntitiesBundle | src/Search/SearchHandler.php | SearchHandler.truncateTable | public function truncateTable()
{
$connection = $this->_em->getConnection();
$dbPlatform = $connection->getDatabasePlatform();
$connection->beginTransaction();
try {
$q = $dbPlatform->getTruncateTableSql($this->getSearchIndexTable());
$connection->executeUpdat... | php | public function truncateTable()
{
$connection = $this->_em->getConnection();
$dbPlatform = $connection->getDatabasePlatform();
$connection->beginTransaction();
try {
$q = $dbPlatform->getTruncateTableSql($this->getSearchIndexTable());
$connection->executeUpdat... | [
"public",
"function",
"truncateTable",
"(",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"_em",
"->",
"getConnection",
"(",
")",
";",
"$",
"dbPlatform",
"=",
"$",
"connection",
"->",
"getDatabasePlatform",
"(",
")",
";",
"$",
"connection",
"->",
... | Truncates the search index table.
@return bool true if success | [
"Truncates",
"the",
"search",
"index",
"table",
"."
] | abd06891fc38922225ab7e4fcb437a286ba2c0c4 | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Search/SearchHandler.php#L148-L164 |
23,171 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.setAttribute | public function setAttribute($key, $value)
{
if ($value instanceof BaseModel || $value instanceof Collection)
$this->setRelationship($value, $key);
elseif ( !is_array($value))
$this->attributes[$key] = $value;
else
$this->setRelationship($value, $key);
} | php | public function setAttribute($key, $value)
{
if ($value instanceof BaseModel || $value instanceof Collection)
$this->setRelationship($value, $key);
elseif ( !is_array($value))
$this->attributes[$key] = $value;
else
$this->setRelationship($value, $key);
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"BaseModel",
"||",
"$",
"value",
"instanceof",
"Collection",
")",
"$",
"this",
"->",
"setRelationship",
"(",
"$",
"value",
",",
"$"... | Sets the attributes for this model
@param mixed $key
@param mixed $value | [
"Sets",
"the",
"attributes",
"for",
"this",
"model"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L115-L123 |
23,172 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.setRelationship | public function setRelationship($value, $key = '')
{
if (is_array($value)) {
$class = __NAMESPACE__ . '\\' . str_singular($key);
if (class_exists($class)) {
// Check to see if the key value is plural or singular
// if it is plural then we create a collection
// otherwise we instantiate the class... | php | public function setRelationship($value, $key = '')
{
if (is_array($value)) {
$class = __NAMESPACE__ . '\\' . str_singular($key);
if (class_exists($class)) {
// Check to see if the key value is plural or singular
// if it is plural then we create a collection
// otherwise we instantiate the class... | [
"public",
"function",
"setRelationship",
"(",
"$",
"value",
",",
"$",
"key",
"=",
"''",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"class",
"=",
"__NAMESPACE__",
".",
"'\\\\'",
".",
"str_singular",
"(",
"$",
"key",
")",
... | Sets the relationships on this model,
which in fact are collections of other models
@param string $key
@param array $value | [
"Sets",
"the",
"relationships",
"on",
"this",
"model",
"which",
"in",
"fact",
"are",
"collections",
"of",
"other",
"models"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L132-L158 |
23,173 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.setAttributes | public function setAttributes(array $data)
{
$data = $this->stripResponseData($data);
foreach ($data as $key => $value) {
$this->setAttribute($key, $value);
}
return $this->getAttributes();
} | php | public function setAttributes(array $data)
{
$data = $this->stripResponseData($data);
foreach ($data as $key => $value) {
$this->setAttribute($key, $value);
}
return $this->getAttributes();
} | [
"public",
"function",
"setAttributes",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"stripResponseData",
"(",
"$",
"data",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"thi... | Set all the attributes from an array.
@param array $data | [
"Set",
"all",
"the",
"attributes",
"from",
"an",
"array",
"."
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L192-L201 |
23,174 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.getSingularEntityName | public static function getSingularEntityName()
{
if ( isset(self::$entity_singular) && ! empty(self::$entity_singular))
return self::$entity_singular;
return str_singular(self::getEntityName());
} | php | public static function getSingularEntityName()
{
if ( isset(self::$entity_singular) && ! empty(self::$entity_singular))
return self::$entity_singular;
return str_singular(self::getEntityName());
} | [
"public",
"static",
"function",
"getSingularEntityName",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"entity_singular",
")",
"&&",
"!",
"empty",
"(",
"self",
"::",
"$",
"entity_singular",
")",
")",
"return",
"self",
"::",
"$",
"entity_singul... | Retrieves the singular name of the entity we are querying.
@return string | [
"Retrieves",
"the",
"singular",
"name",
"of",
"the",
"entity",
"we",
"are",
"querying",
"."
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L285-L291 |
23,175 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.request | public function request($method, $url, $params = array(), $xml = "", $format = "")
{
if ( !$format) $format = $this->format;
$response = $this->api->request($method, $url, $params, $xml, $format);
return $this->parseResponse($response);
} | php | public function request($method, $url, $params = array(), $xml = "", $format = "")
{
if ( !$format) $format = $this->format;
$response = $this->api->request($method, $url, $params, $xml, $format);
return $this->parseResponse($response);
} | [
"public",
"function",
"request",
"(",
"$",
"method",
",",
"$",
"url",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"xml",
"=",
"\"\"",
",",
"$",
"format",
"=",
"\"\"",
")",
"{",
"if",
"(",
"!",
"$",
"format",
")",
"$",
"format",
"=",
... | A high level request method used from static methods.
@param string $method
@param string $url
@param array $params
@param string $xml
@param string $format
@return Daursu\Xero\BaseModel | [
"A",
"high",
"level",
"request",
"method",
"used",
"from",
"static",
"methods",
"."
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L303-L309 |
23,176 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.get | public static function get($params = array())
{
$object = new static;
$data = $object->request('GET', $object->getUrl(), $params);
$data = $object->stripResponseData($data);
// Initialise a collection
$collection = self::newCollection();
if (isset($data[0]) && is_array($data[0])) {
// This should ... | php | public static function get($params = array())
{
$object = new static;
$data = $object->request('GET', $object->getUrl(), $params);
$data = $object->stripResponseData($data);
// Initialise a collection
$collection = self::newCollection();
if (isset($data[0]) && is_array($data[0])) {
// This should ... | [
"public",
"static",
"function",
"get",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"object",
"=",
"new",
"static",
";",
"$",
"data",
"=",
"$",
"object",
"->",
"request",
"(",
"'GET'",
",",
"$",
"object",
"->",
"getUrl",
"(",
")",
"... | Get a collection of items
@param array $params
@return Daursu\Xero\BaseModel | [
"Get",
"a",
"collection",
"of",
"items"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L317-L332 |
23,177 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.find | public static function find($id)
{
$object = new static;
$response = $object->request('GET', sprintf('%s/%s', $object->getUrl(), $id));
return $response ? $object : false;
} | php | public static function find($id)
{
$object = new static;
$response = $object->request('GET', sprintf('%s/%s', $object->getUrl(), $id));
return $response ? $object : false;
} | [
"public",
"static",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"$",
"object",
"=",
"new",
"static",
";",
"$",
"response",
"=",
"$",
"object",
"->",
"request",
"(",
"'GET'",
",",
"sprintf",
"(",
"'%s/%s'",
",",
"$",
"object",
"->",
"getUrl",
"(",
... | Find a single element by its ID
@param mixed $id
@return Daursu\Xero\BaseModel | [
"Find",
"a",
"single",
"element",
"by",
"its",
"ID"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L340-L346 |
23,178 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.create | public function create($params = array())
{
$response = $this->api->request('PUT', $this->getUrl(), $params, $this->toXML(), $this->format);
return $this->parseResponse($response) ? true : false;
} | php | public function create($params = array())
{
$response = $this->api->request('PUT', $this->getUrl(), $params, $this->toXML(), $this->format);
return $this->parseResponse($response) ? true : false;
} | [
"public",
"function",
"create",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"request",
"(",
"'PUT'",
",",
"$",
"this",
"->",
"getUrl",
"(",
")",
",",
"$",
"params",
",",
"$",
"this",... | Creates a new entity in Xero
@param array $data
@return boolean | [
"Creates",
"a",
"new",
"entity",
"in",
"Xero"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L365-L369 |
23,179 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.save | public function save($params = array())
{
if ( isset($this->attributes[$this->primary_column])) {
return $this->update($params);
}
else {
return $this->create($params);
}
} | php | public function save($params = array())
{
if ( isset($this->attributes[$this->primary_column])) {
return $this->update($params);
}
else {
return $this->create($params);
}
} | [
"public",
"function",
"save",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"attributes",
"[",
"$",
"this",
"->",
"primary_column",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"update",
"(",
... | Save an entity. If it doesn't have the primary key set
then it will create it, otherwise it will update it.
@param array $params
@return boolean | [
"Save",
"an",
"entity",
".",
"If",
"it",
"doesn",
"t",
"have",
"the",
"primary",
"key",
"set",
"then",
"it",
"will",
"create",
"it",
"otherwise",
"it",
"will",
"update",
"it",
"."
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L391-L399 |
23,180 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.array_to_xml | public static function array_to_xml($array, &$xml)
{
foreach($array as $key => $value) {
if(is_array($value)) {
if(!is_numeric($key)){
$subnode = $xml->addChild("$key");
self::array_to_xml($value, $subnode);
} elseif ($key == 0) {
self::array_to_xml($value, $xml);
} else {
$name = ... | php | public static function array_to_xml($array, &$xml)
{
foreach($array as $key => $value) {
if(is_array($value)) {
if(!is_numeric($key)){
$subnode = $xml->addChild("$key");
self::array_to_xml($value, $subnode);
} elseif ($key == 0) {
self::array_to_xml($value, $xml);
} else {
$name = ... | [
"public",
"static",
"function",
"array_to_xml",
"(",
"$",
"array",
",",
"&",
"$",
"xml",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
... | Helper function to convert an array to XML
@param array $array
@param SimpleXMLElement $xml
@return string | [
"Helper",
"function",
"to",
"convert",
"an",
"array",
"to",
"XML"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L504-L522 |
23,181 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.stripResponseData | public function stripResponseData(array $data)
{
if (isset($data[self::getEntityName()]) && is_array($data[self::getEntityName()]))
$data = $data[self::getEntityName()];
if (isset($data[self::getSingularEntityName()]) && is_array($data[self::getSingularEntityName()]))
$data = $data[self::getSingularEntityNa... | php | public function stripResponseData(array $data)
{
if (isset($data[self::getEntityName()]) && is_array($data[self::getEntityName()]))
$data = $data[self::getEntityName()];
if (isset($data[self::getSingularEntityName()]) && is_array($data[self::getSingularEntityName()]))
$data = $data[self::getSingularEntityNa... | [
"public",
"function",
"stripResponseData",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"self",
"::",
"getEntityName",
"(",
")",
"]",
")",
"&&",
"is_array",
"(",
"$",
"data",
"[",
"self",
"::",
"getEntityName",
"(",
... | This function removes all the unecessary data from a response
and leaves us with what we need when trying to populate objects or
collections with data
@param array $data
@return array | [
"This",
"function",
"removes",
"all",
"the",
"unecessary",
"data",
"from",
"a",
"response",
"and",
"leaves",
"us",
"with",
"what",
"we",
"need",
"when",
"trying",
"to",
"populate",
"objects",
"or",
"collections",
"with",
"data"
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L532-L541 |
23,182 | Daursu/xero | src/Daursu/Xero/models/BaseModel.php | BaseModel.parseResponse | protected function parseResponse($response, $setAttributes = true)
{
if ($response['code'] == 200)
{
$data = $this->api->parseResponse($response['response'], $response['format']);
if ($response['format'] == 'xml') {
$data = json_encode($data);
$data = json_decode($data, true);
}
// print_r($d... | php | protected function parseResponse($response, $setAttributes = true)
{
if ($response['code'] == 200)
{
$data = $this->api->parseResponse($response['response'], $response['format']);
if ($response['format'] == 'xml') {
$data = json_encode($data);
$data = json_decode($data, true);
}
// print_r($d... | [
"protected",
"function",
"parseResponse",
"(",
"$",
"response",
",",
"$",
"setAttributes",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"response",
"[",
"'code'",
"]",
"==",
"200",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"api",
"->",
"parseResponse",
... | Parses the response retrieved from Xero,
or throws an exception if it fails.
@param array $response
@return array | [
"Parses",
"the",
"response",
"retrieved",
"from",
"Xero",
"or",
"throws",
"an",
"exception",
"if",
"it",
"fails",
"."
] | f6ac2b0cd3123f9667fd07927bee6725d34df4a6 | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/BaseModel.php#L550-L576 |
23,183 | phergie/phergie-irc-plugin-react-nickserv | src/Plugin.php | Plugin.handleNotice | public function handleNotice(UserEvent $event, Queue $queue)
{
// Ignore notices that aren't from the NickServ agent
if (strcasecmp($event->getNick(), $this->botNick) !== 0) {
return;
}
$connection = $event->getConnection();
$params = $event->getParams();
... | php | public function handleNotice(UserEvent $event, Queue $queue)
{
// Ignore notices that aren't from the NickServ agent
if (strcasecmp($event->getNick(), $this->botNick) !== 0) {
return;
}
$connection = $event->getConnection();
$params = $event->getParams();
... | [
"public",
"function",
"handleNotice",
"(",
"UserEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"// Ignore notices that aren't from the NickServ agent",
"if",
"(",
"strcasecmp",
"(",
"$",
"event",
"->",
"getNick",
"(",
")",
",",
"$",
"this",
"->",
... | Responds to authentication requests and notifications of ghost
connections being killed from NickServ.
@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Responds",
"to",
"authentication",
"requests",
"and",
"notifications",
"of",
"ghost",
"connections",
"being",
"killed",
"from",
"NickServ",
"."
] | 0319c79314029bd1ebab0de04a67ff20705e36da | https://github.com/phergie/phergie-irc-plugin-react-nickserv/blob/0319c79314029bd1ebab0de04a67ff20705e36da/src/Plugin.php#L146-L173 |
23,184 | phergie/phergie-irc-plugin-react-nickserv | src/Plugin.php | Plugin.handleNick | public function handleNick(UserEvent $event, Queue $queue)
{
$connection = $event->getConnection();
if (strcasecmp($event->getNick(), $connection->getNickname()) === 0) {
$params = $event->getParams();
$connection->setNickname($params['nickname']);
}
} | php | public function handleNick(UserEvent $event, Queue $queue)
{
$connection = $event->getConnection();
if (strcasecmp($event->getNick(), $connection->getNickname()) === 0) {
$params = $event->getParams();
$connection->setNickname($params['nickname']);
}
} | [
"public",
"function",
"handleNick",
"(",
"UserEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"$",
"connection",
"=",
"$",
"event",
"->",
"getConnection",
"(",
")",
";",
"if",
"(",
"strcasecmp",
"(",
"$",
"event",
"->",
"getNick",
"(",
")",... | Changes the nick associated with the bot in local memory when a change
to it is successfully registered with the server.
@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Changes",
"the",
"nick",
"associated",
"with",
"the",
"bot",
"in",
"local",
"memory",
"when",
"a",
"change",
"to",
"it",
"is",
"successfully",
"registered",
"with",
"the",
"server",
"."
] | 0319c79314029bd1ebab0de04a67ff20705e36da | https://github.com/phergie/phergie-irc-plugin-react-nickserv/blob/0319c79314029bd1ebab0de04a67ff20705e36da/src/Plugin.php#L182-L189 |
23,185 | phergie/phergie-irc-plugin-react-nickserv | src/Plugin.php | Plugin.handleNicknameInUse | public function handleNicknameInUse(ServerEvent $event, Queue $queue)
{
// Don't listen if ghost isn't enabled, or this isn't the first nickname-in-use error
if (!$this->ghostEnabled || $this->ghostNick !== null) {
return;
}
// Save the nick, so that we can send a ghost ... | php | public function handleNicknameInUse(ServerEvent $event, Queue $queue)
{
// Don't listen if ghost isn't enabled, or this isn't the first nickname-in-use error
if (!$this->ghostEnabled || $this->ghostNick !== null) {
return;
}
// Save the nick, so that we can send a ghost ... | [
"public",
"function",
"handleNicknameInUse",
"(",
"ServerEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"// Don't listen if ghost isn't enabled, or this isn't the first nickname-in-use error",
"if",
"(",
"!",
"$",
"this",
"->",
"ghostEnabled",
"||",
"$",
"t... | Kick-starts the ghost process.
@param \Phergie\Irc\Event\ServerEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Kick",
"-",
"starts",
"the",
"ghost",
"process",
"."
] | 0319c79314029bd1ebab0de04a67ff20705e36da | https://github.com/phergie/phergie-irc-plugin-react-nickserv/blob/0319c79314029bd1ebab0de04a67ff20705e36da/src/Plugin.php#L197-L207 |
23,186 | phergie/phergie-irc-plugin-react-nickserv | src/Plugin.php | Plugin.handleGhost | public function handleGhost(ServerEvent $event, Queue $queue)
{
if ($this->ghostNick === null) {
return;
}
// Attempt to kill the ghost connection
$queue->ircPrivmsg($this->botNick, 'GHOST ' . $this->ghostNick . ' ' . $this->password);
} | php | public function handleGhost(ServerEvent $event, Queue $queue)
{
if ($this->ghostNick === null) {
return;
}
// Attempt to kill the ghost connection
$queue->ircPrivmsg($this->botNick, 'GHOST ' . $this->ghostNick . ' ' . $this->password);
} | [
"public",
"function",
"handleGhost",
"(",
"ServerEvent",
"$",
"event",
",",
"Queue",
"$",
"queue",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ghostNick",
"===",
"null",
")",
"{",
"return",
";",
"}",
"// Attempt to kill the ghost connection",
"$",
"queue",
"->"... | Completes the ghost process.
@param \Phergie\Irc\Event\ServerEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue | [
"Completes",
"the",
"ghost",
"process",
"."
] | 0319c79314029bd1ebab0de04a67ff20705e36da | https://github.com/phergie/phergie-irc-plugin-react-nickserv/blob/0319c79314029bd1ebab0de04a67ff20705e36da/src/Plugin.php#L215-L223 |
23,187 | phergie/phergie-irc-plugin-react-nickserv | src/Plugin.php | Plugin.getConfigOption | protected function getConfigOption(array $config, $key)
{
if (empty($config[$key]) || !is_string($config[$key])) {
throw new \DomainException(
"$key must be a non-empty string"
);
}
return $config[$key];
} | php | protected function getConfigOption(array $config, $key)
{
if (empty($config[$key]) || !is_string($config[$key])) {
throw new \DomainException(
"$key must be a non-empty string"
);
}
return $config[$key];
} | [
"protected",
"function",
"getConfigOption",
"(",
"array",
"$",
"config",
",",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"config",
"[",
"$",
"key",
"]",
")",
"||",
"!",
"is_string",
"(",
"$",
"config",
"[",
"$",
"key",
"]",
")",
")",
"{"... | Extracts a string from the config options map.
@param array $config
@param string $key
@return string
@throws \DomainException if password is unspecified or not a string | [
"Extracts",
"a",
"string",
"from",
"the",
"config",
"options",
"map",
"."
] | 0319c79314029bd1ebab0de04a67ff20705e36da | https://github.com/phergie/phergie-irc-plugin-react-nickserv/blob/0319c79314029bd1ebab0de04a67ff20705e36da/src/Plugin.php#L233-L241 |
23,188 | willishq/laravel5-flash | src/Flash.php | Flash.message | protected function message($message, $title = '', $type = 'info')
{
$this->message = $message;
$this->title = $title;
$this->type = $type;
$this->session->flash($this->namespace, (array) $this);
} | php | protected function message($message, $title = '', $type = 'info')
{
$this->message = $message;
$this->title = $title;
$this->type = $type;
$this->session->flash($this->namespace, (array) $this);
} | [
"protected",
"function",
"message",
"(",
"$",
"message",
",",
"$",
"title",
"=",
"''",
",",
"$",
"type",
"=",
"'info'",
")",
"{",
"$",
"this",
"->",
"message",
"=",
"$",
"message",
";",
"$",
"this",
"->",
"title",
"=",
"$",
"title",
";",
"$",
"th... | Setup the flash messsage data.
@param string $message
@param string $title
@param string $level | [
"Setup",
"the",
"flash",
"messsage",
"data",
"."
] | 47f436b30e5a2f5b06a742e8ed9d49251eac5589 | https://github.com/willishq/laravel5-flash/blob/47f436b30e5a2f5b06a742e8ed9d49251eac5589/src/Flash.php#L68-L74 |
23,189 | FrenzelGmbH/cm-address | controllers/AddressController.php | AddressController.actionDelete | public function actionDelete($id)
{
$date = new DateTime('now');
$model = $this->findModel($id);
$model->deleted_at = $date->format("U");
$model->save();
return $this->redirect(['index']);
} | php | public function actionDelete($id)
{
$date = new DateTime('now');
$model = $this->findModel($id);
$model->deleted_at = $date->format("U");
$model->save();
return $this->redirect(['index']);
} | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
")",
"{",
"$",
"date",
"=",
"new",
"DateTime",
"(",
"'now'",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"->",
"deleted_at",
"=",
"$",
... | Deletes an existing Address model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Deletes",
"an",
"existing",
"Address",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/controllers/AddressController.php#L101-L109 |
23,190 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.lookup | public function lookup($context, $path, $require = false)
{
if (empty($path)) {
throw new \InvalidArgumentException("Passed lookup path is empty.");
}
if (empty($context)) {
throw new \InvalidArgumentException("Specified context is empty while resolving path " . json_... | php | public function lookup($context, $path, $require = false)
{
if (empty($path)) {
throw new \InvalidArgumentException("Passed lookup path is empty.");
}
if (empty($context)) {
throw new \InvalidArgumentException("Specified context is empty while resolving path " . json_... | [
"public",
"function",
"lookup",
"(",
"$",
"context",
",",
"$",
"path",
",",
"$",
"require",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Passed lookup path is empty.\... | Looks up a path in the specified context
@param array $context
@param array $path
@param bool $require
@return string
@throws \RuntimeException
@throws \InvalidArgumentException | [
"Looks",
"up",
"a",
"path",
"in",
"the",
"specified",
"context"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L216-L225 |
23,191 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.resolve | public function resolve($id, $required = false)
{
$id = $this->path($id);
try {
if (in_array($id, $this->resolutionStack)) {
$path = array_map(
function ($a) {
return join('.', $a);
},
$t... | php | public function resolve($id, $required = false)
{
$id = $this->path($id);
try {
if (in_array($id, $this->resolutionStack)) {
$path = array_map(
function ($a) {
return join('.', $a);
},
$t... | [
"public",
"function",
"resolve",
"(",
"$",
"id",
",",
"$",
"required",
"=",
"false",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"path",
"(",
"$",
"id",
")",
";",
"try",
"{",
"if",
"(",
"in_array",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"re... | Resolve the specified path. If the resulting value is a Closure, it's assumed a declaration and therefore
executed
@param array|string $id
@param bool $required
@return string
@throws \RuntimeException
@throws CircularReferenceException | [
"Resolve",
"the",
"specified",
"path",
".",
"If",
"the",
"resulting",
"value",
"is",
"a",
"Closure",
"it",
"s",
"assumed",
"a",
"declaration",
"and",
"therefore",
"executed"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L238-L270 |
23,192 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.set | public function set($path, $value)
{
PropertyAccessor::setByPath($this->values, $this->path($path), $value);
} | php | public function set($path, $value)
{
PropertyAccessor::setByPath($this->values, $this->path($path), $value);
} | [
"public",
"function",
"set",
"(",
"$",
"path",
",",
"$",
"value",
")",
"{",
"PropertyAccessor",
"::",
"setByPath",
"(",
"$",
"this",
"->",
"values",
",",
"$",
"this",
"->",
"path",
"(",
"$",
"path",
")",
",",
"$",
"value",
")",
";",
"}"
] | Set the value at the specified path
@param array|string $path
@param mixed $value
@return void
@throws \UnexpectedValueException | [
"Set",
"the",
"value",
"at",
"the",
"specified",
"path"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L282-L285 |
23,193 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.helperExec | public function helperExec($cmd)
{
if ($this->resolve('EXPLAIN')) {
$this->output->writeln("# Task needs the following helper command:");
$this->output->writeln("# " . str_replace("\n", "\\n", $cmd));
}
$ret = '';
$this->executor->execute($cmd, $ret);
... | php | public function helperExec($cmd)
{
if ($this->resolve('EXPLAIN')) {
$this->output->writeln("# Task needs the following helper command:");
$this->output->writeln("# " . str_replace("\n", "\\n", $cmd));
}
$ret = '';
$this->executor->execute($cmd, $ret);
... | [
"public",
"function",
"helperExec",
"(",
"$",
"cmd",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resolve",
"(",
"'EXPLAIN'",
")",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"\"# Task needs the following helper command:\"",
")",
";",
"$",
"th... | This is useful for commands that need the shell regardless of the 'explain' value setting.
@param string $cmd
@return mixed | [
"This",
"is",
"useful",
"for",
"commands",
"that",
"need",
"the",
"shell",
"regardless",
"of",
"the",
"explain",
"value",
"setting",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L293-L302 |
23,194 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.fn | public function fn($id, $callable = null, $needsContainer = false)
{
if ($callable === null) {
$callable = $id;
}
if (!is_callable($callable)) {
throw new \InvalidArgumentException("Not callable");
}
$this->set($id, array($callable, $needsContainer));
... | php | public function fn($id, $callable = null, $needsContainer = false)
{
if ($callable === null) {
$callable = $id;
}
if (!is_callable($callable)) {
throw new \InvalidArgumentException("Not callable");
}
$this->set($id, array($callable, $needsContainer));
... | [
"public",
"function",
"fn",
"(",
"$",
"id",
",",
"$",
"callable",
"=",
"null",
",",
"$",
"needsContainer",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"callable",
"===",
"null",
")",
"{",
"$",
"callable",
"=",
"$",
"id",
";",
"}",
"if",
"(",
"!",
"... | Set a function at the specified path.
@param array|string $id
@param callable $callable
@param bool $needsContainer
@return void
@throws \InvalidArgumentException | [
"Set",
"a",
"function",
"at",
"the",
"specified",
"path",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L331-L340 |
23,195 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.decl | public function decl($id, $callable)
{
if (!is_callable($callable)) {
throw new \InvalidArgumentException("Passed declaration is not callable");
}
$this->set($id, function (Container $c) use($callable, $id) {
Debug::enterScope(join('.', (array)$id));
if (n... | php | public function decl($id, $callable)
{
if (!is_callable($callable)) {
throw new \InvalidArgumentException("Passed declaration is not callable");
}
$this->set($id, function (Container $c) use($callable, $id) {
Debug::enterScope(join('.', (array)$id));
if (n... | [
"public",
"function",
"decl",
"(",
"$",
"id",
",",
"$",
"callable",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callable",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Passed declaration is not callable\"",
")",
";",
"}",
... | Does a declaration, i.e., the first time the declaration is called, it's resulting value overwrites the
declaration.
@param array|string $id
@param callable $callable
@return void
@throws \InvalidArgumentException | [
"Does",
"a",
"declaration",
"i",
".",
"e",
".",
"the",
"first",
"time",
"the",
"declaration",
"is",
"called",
"it",
"s",
"resulting",
"value",
"overwrites",
"the",
"declaration",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L366-L379 |
23,196 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.has | public function has($id)
{
try {
$existing = $this->get($id);
} catch (\OutOfBoundsException $e) {
return false;
}
return Util::typeOf($existing);
} | php | public function has($id)
{
try {
$existing = $this->get($id);
} catch (\OutOfBoundsException $e) {
return false;
}
return Util::typeOf($existing);
} | [
"public",
"function",
"has",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"existing",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"id",
")",
";",
"}",
"catch",
"(",
"\\",
"OutOfBoundsException",
"$",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return... | Checks for existence of the specified path.
@param string $id
@return string | [
"Checks",
"for",
"existence",
"of",
"the",
"specified",
"path",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L421-L429 |
23,197 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.isEmpty | public function isEmpty($path)
{
try {
$value = $this->get($path);
} catch (\OutOfBoundsException $e) {
return true;
}
return '' === $value || null === $value;
} | php | public function isEmpty($path)
{
try {
$value = $this->get($path);
} catch (\OutOfBoundsException $e) {
return true;
}
return '' === $value || null === $value;
} | [
"public",
"function",
"isEmpty",
"(",
"$",
"path",
")",
"{",
"try",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"path",
")",
";",
"}",
"catch",
"(",
"\\",
"OutOfBoundsException",
"$",
"e",
")",
"{",
"return",
"true",
";",
"}",
"re... | Checks if a value is empty.
@param mixed $path
@return bool | [
"Checks",
"if",
"a",
"value",
"is",
"empty",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L438-L446 |
23,198 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.call | public function call()
{
$args = func_get_args();
$service = array_shift($args);
if (!is_array($service)) {
throw new \RuntimeException("Expected an array");
}
if (!is_callable($service[0])) {
throw new \InvalidArgumentException("Can not use service '{... | php | public function call()
{
$args = func_get_args();
$service = array_shift($args);
if (!is_array($service)) {
throw new \RuntimeException("Expected an array");
}
if (!is_callable($service[0])) {
throw new \InvalidArgumentException("Can not use service '{... | [
"public",
"function",
"call",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"service",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"service",
")",
")",
"{",
"throw",
"new",
"\\",
"... | Separate helper for calling a service as a function.
@return mixed
@throws \InvalidArgumentException | [
"Separate",
"helper",
"for",
"calling",
"a",
"service",
"as",
"a",
"function",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L456-L472 |
23,199 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.setOutputPrefix | private function setOutputPrefix($prefix)
{
if (!($this->output->getFormatter() instanceof PrefixFormatter)) {
return;
}
$this->output->getFormatter()->prefix = $prefix;
} | php | private function setOutputPrefix($prefix)
{
if (!($this->output->getFormatter() instanceof PrefixFormatter)) {
return;
}
$this->output->getFormatter()->prefix = $prefix;
} | [
"private",
"function",
"setOutputPrefix",
"(",
"$",
"prefix",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"output",
"->",
"getFormatter",
"(",
")",
"instanceof",
"PrefixFormatter",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"output",
"... | Helper to set prefix if the output if PrefixFormatter
@param string $prefix
@return void | [
"Helper",
"to",
"set",
"prefix",
"if",
"the",
"output",
"if",
"PrefixFormatter"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L480-L487 |
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.