repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
jnaxo/country-codes | database/seeds/WorldCountriesSeeder.php | WorldCountriesSeeder.run | public function run()
{
DB::table('ctrystore_countries')->delete();
$today = date('Y-m-d H:i:s');
DB::table('ctrystore_countries')->insert([
'id'=>20,
'zone_id'=>1,
'name'=>"Andorra",
'alpha2'=>"AD",
'alpha3'=>"AND",
'... | php | public function run()
{
DB::table('ctrystore_countries')->delete();
$today = date('Y-m-d H:i:s');
DB::table('ctrystore_countries')->insert([
'id'=>20,
'zone_id'=>1,
'name'=>"Andorra",
'alpha2'=>"AD",
'alpha3'=>"AND",
'... | [
"public",
"function",
"run",
"(",
")",
"{",
"DB",
"::",
"table",
"(",
"'ctrystore_countries'",
")",
"->",
"delete",
"(",
")",
";",
"$",
"today",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
")",
";",
"DB",
"::",
"table",
"(",
"'ctrystore_countries'",
")",
"->",
... | Run the database seeds.
@return void | [
"Run",
"the",
"database",
"seeds",
"."
] | train | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/database/seeds/WorldCountriesSeeder.php#L13-L2470 |
LeaseCloud/leasecloud-php-sdk | src/Order.php | Order.status | public static function status($orderId)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/status';
list($ret) = parent::staticRequest('get', $url, []);
return $ret;
} | php | public static function status($orderId)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/status';
list($ret) = parent::staticRequest('get', $url, []);
return $ret;
} | [
"public",
"static",
"function",
"status",
"(",
"$",
"orderId",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
";",
"$",
"url",
"=",
"$",
"url",
".",
"'/'",
".",
"$",
"orderId",
".",
"'/status'",
";",
"list",
"(",
"$",
"ret",
")"... | Get status information about an order
@param string $orderId
@return mixed | [
"Get",
"status",
"information",
"about",
"an",
"order"
] | train | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/Order.php#L27-L34 |
LeaseCloud/leasecloud-php-sdk | src/Order.php | Order.cancel | public static function cancel($orderId)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/cancel';
list($ret, $code) = parent::staticRequest('post', $url, []);
return (object)[
'code' => $code,
'status' => $code === 200? 'success' : 'failed'
... | php | public static function cancel($orderId)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/cancel';
list($ret, $code) = parent::staticRequest('post', $url, []);
return (object)[
'code' => $code,
'status' => $code === 200? 'success' : 'failed'
... | [
"public",
"static",
"function",
"cancel",
"(",
"$",
"orderId",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
";",
"$",
"url",
"=",
"$",
"url",
".",
"'/'",
".",
"$",
"orderId",
".",
"'/cancel'",
";",
"list",
"(",
"$",
"ret",
","... | Cancel an order
@param string $orderId
@return object | [
"Cancel",
"an",
"order"
] | train | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/Order.php#L42-L52 |
LeaseCloud/leasecloud-php-sdk | src/Order.php | Order.shipped | public static function shipped($orderId, $shippedAt = 0)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/shipped';
list($ret, $code) = parent::staticRequest('post', $url, [
'shippedAt' => date('c', $shippedAt ? $shippedAt : time()),
]);
return (obje... | php | public static function shipped($orderId, $shippedAt = 0)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/shipped';
list($ret, $code) = parent::staticRequest('post', $url, [
'shippedAt' => date('c', $shippedAt ? $shippedAt : time()),
]);
return (obje... | [
"public",
"static",
"function",
"shipped",
"(",
"$",
"orderId",
",",
"$",
"shippedAt",
"=",
"0",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
";",
"$",
"url",
"=",
"$",
"url",
".",
"'/'",
".",
"$",
"orderId",
".",
"'/shipped'",
... | Tell LeaseCloud that an order is shipped
@param string $orderId
@param int $shippedAt Unix timestamp
@return object | [
"Tell",
"LeaseCloud",
"that",
"an",
"order",
"is",
"shipped"
] | train | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/Order.php#L61-L73 |
ntd/silverstripe-carousel | code/CarouselPage.php | CarouselImageExtension.generateMaybeCroppedImage | public function generateMaybeCroppedImage(Image_Backend $backend, $width, $height)
{
if ($width > 0 && $height > 0) {
return $backend->croppedResize($width, $height);
} elseif ($width > 0) {
return $backend->resizeByWidth($width);
} elseif ($height > 0) {
... | php | public function generateMaybeCroppedImage(Image_Backend $backend, $width, $height)
{
if ($width > 0 && $height > 0) {
return $backend->croppedResize($width, $height);
} elseif ($width > 0) {
return $backend->resizeByWidth($width);
} elseif ($height > 0) {
... | [
"public",
"function",
"generateMaybeCroppedImage",
"(",
"Image_Backend",
"$",
"backend",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"if",
"(",
"$",
"width",
">",
"0",
"&&",
"$",
"height",
">",
"0",
")",
"{",
"return",
"$",
"backend",
"->",
"cropp... | Low level function for CarouselImageExtension::MaybeCroppedImage().
@param Image_Backend $backend
@param integer $width
@param integer $height
@return Image_Backend | [
"Low",
"level",
"function",
"for",
"CarouselImageExtension",
"::",
"MaybeCroppedImage",
"()",
"."
] | train | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L41-L52 |
ntd/silverstripe-carousel | code/CarouselPage.php | CarouselImageExtension.getCarouselEditFields | public function getCarouselEditFields()
{
// This is *required* otherwise TinyMCE in SilverStripe 3.3 will
// not be enabled and the <textarea> will simply disappear
// without apparent reasons
if (method_exists('HtmlEditorConfig', 'require_js')) {
HtmlEditorConfig::requi... | php | public function getCarouselEditFields()
{
// This is *required* otherwise TinyMCE in SilverStripe 3.3 will
// not be enabled and the <textarea> will simply disappear
// without apparent reasons
if (method_exists('HtmlEditorConfig', 'require_js')) {
HtmlEditorConfig::requi... | [
"public",
"function",
"getCarouselEditFields",
"(",
")",
"{",
"// This is *required* otherwise TinyMCE in SilverStripe 3.3 will",
"// not be enabled and the <textarea> will simply disappear",
"// without apparent reasons",
"if",
"(",
"method_exists",
"(",
"'HtmlEditorConfig'",
",",
"'r... | Retrieve the fields used by SortableUploadField internal form.
@return FieldList | [
"Retrieve",
"the",
"fields",
"used",
"by",
"SortableUploadField",
"internal",
"form",
"."
] | train | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L59-L71 |
ntd/silverstripe-carousel | code/CarouselPage.php | CarouselPage.getClassFolder | protected function getClassFolder()
{
for ($class = $this->class; $class; $class = get_parent_class($class)) {
$folder = preg_replace('/Page$/', '', $class);
if ($folder != $class && is_dir(ASSETS_PATH . '/' . $folder)) {
return $folder;
}
}
... | php | protected function getClassFolder()
{
for ($class = $this->class; $class; $class = get_parent_class($class)) {
$folder = preg_replace('/Page$/', '', $class);
if ($folder != $class && is_dir(ASSETS_PATH . '/' . $folder)) {
return $folder;
}
}
... | [
"protected",
"function",
"getClassFolder",
"(",
")",
"{",
"for",
"(",
"$",
"class",
"=",
"$",
"this",
"->",
"class",
";",
"$",
"class",
";",
"$",
"class",
"=",
"get_parent_class",
"(",
"$",
"class",
")",
")",
"{",
"$",
"folder",
"=",
"preg_replace",
... | Search the first class name (that must have a 'Page' suffix) in
the object hierarchy that has a correspoding folder in
ASSETS_PATH, that is a folder with the same name with the 'Page'
suffix stripped out. This folder will be returned and used as
custom folder in the upload field.
For example, if this class is `HomePag... | [
"Search",
"the",
"first",
"class",
"name",
"(",
"that",
"must",
"have",
"a",
"Page",
"suffix",
")",
"in",
"the",
"object",
"hierarchy",
"that",
"has",
"a",
"correspoding",
"folder",
"in",
"ASSETS_PATH",
"that",
"is",
"a",
"folder",
"with",
"the",
"same",
... | train | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L161-L173 |
ntd/silverstripe-carousel | code/CarouselPage.php | CarouselPage.getCMSFields | public function getCMSFields()
{
$fields = parent::getCMSFields();
$field = SortableUploadField::create('Images', _t('CarouselPage.db_Images'));
$field->setFolderName($this->getClassFolder());
$field->setFileEditFields('getCarouselEditFields');
$root = $fields->fieldByName(... | php | public function getCMSFields()
{
$fields = parent::getCMSFields();
$field = SortableUploadField::create('Images', _t('CarouselPage.db_Images'));
$field->setFolderName($this->getClassFolder());
$field->setFileEditFields('getCarouselEditFields');
$root = $fields->fieldByName(... | [
"public",
"function",
"getCMSFields",
"(",
")",
"{",
"$",
"fields",
"=",
"parent",
"::",
"getCMSFields",
"(",
")",
";",
"$",
"field",
"=",
"SortableUploadField",
"::",
"create",
"(",
"'Images'",
",",
"_t",
"(",
"'CarouselPage.db_Images'",
")",
")",
";",
"$... | Add the "Images" tab to the content form of the page.
The images are linked to the page with a many-many relationship,
so if an image is shared among different carousels there is no
need to upload it multiple times.
@return FieldList | [
"Add",
"the",
"Images",
"tab",
"to",
"the",
"content",
"form",
"of",
"the",
"page",
"."
] | train | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L184-L202 |
ntd/silverstripe-carousel | code/CarouselPage.php | CarouselPage.getSettingsFields | public function getSettingsFields()
{
$fields = parent::getSettingsFields();
$settings = FieldGroup::create(
FieldGroup::create(
NumericField::create('Width', _t('CarouselPage.db_Width')),
NumericField::create('Height', _t('CarouselPage.db_Height')),
... | php | public function getSettingsFields()
{
$fields = parent::getSettingsFields();
$settings = FieldGroup::create(
FieldGroup::create(
NumericField::create('Width', _t('CarouselPage.db_Width')),
NumericField::create('Height', _t('CarouselPage.db_Height')),
... | [
"public",
"function",
"getSettingsFields",
"(",
")",
"{",
"$",
"fields",
"=",
"parent",
"::",
"getSettingsFields",
"(",
")",
";",
"$",
"settings",
"=",
"FieldGroup",
"::",
"create",
"(",
"FieldGroup",
"::",
"create",
"(",
"NumericField",
"::",
"create",
"(",... | Add carousel related fields to the page settings.
Every CarouselPage instance can have its own settings, that is
different pages can own carousels of different sizes.
@return FieldList | [
"Add",
"carousel",
"related",
"fields",
"to",
"the",
"page",
"settings",
"."
] | train | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L212-L228 |
ntd/silverstripe-carousel | code/CarouselPage.php | CarouselPage.onTranslatableCreate | public function onTranslatableCreate($save)
{
// Chain up the parent method, if it exists
if (method_exists('Page', 'onTranslatableCreate')) {
parent::onTranslatableCreate($save);
}
$master = $this->getTranslation(Translatable::default_locale());
foreach ($maste... | php | public function onTranslatableCreate($save)
{
// Chain up the parent method, if it exists
if (method_exists('Page', 'onTranslatableCreate')) {
parent::onTranslatableCreate($save);
}
$master = $this->getTranslation(Translatable::default_locale());
foreach ($maste... | [
"public",
"function",
"onTranslatableCreate",
"(",
"$",
"save",
")",
"{",
"// Chain up the parent method, if it exists",
"if",
"(",
"method_exists",
"(",
"'Page'",
",",
"'onTranslatableCreate'",
")",
")",
"{",
"parent",
"::",
"onTranslatableCreate",
"(",
"$",
"save",
... | Out of the box support for silverstripe/silverstripe-translatable.
Duplicate the image list whenever a new translation is created.
It the translatable module is not used, this will simply be a
dead method.
@param boolean $save Whether the new page should be saved to the
database. | [
"Out",
"of",
"the",
"box",
"support",
"for",
"silverstripe",
"/",
"silverstripe",
"-",
"translatable",
"."
] | train | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L257-L270 |
Eresus/EresusCMS | src/core/Plugin/Controller/Admin/Content.php | Eresus_Plugin_Controller_Admin_Content.getHtml | public function getHtml(Eresus_CMS_Request $request)
{
$action = 'action' . $this->getAction($request);
if (!method_exists($this, $action))
{
throw new Eresus_CMS_Exception_NotFound;
}
return $this->{$action}($request);
} | php | public function getHtml(Eresus_CMS_Request $request)
{
$action = 'action' . $this->getAction($request);
if (!method_exists($this, $action))
{
throw new Eresus_CMS_Exception_NotFound;
}
return $this->{$action}($request);
} | [
"public",
"function",
"getHtml",
"(",
"Eresus_CMS_Request",
"$",
"request",
")",
"{",
"$",
"action",
"=",
"'action'",
".",
"$",
"this",
"->",
"getAction",
"(",
"$",
"request",
")",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"$",
"acti... | Возвращает разметку области контента
Метод вызывает{@link getAction()} чтобы определить запрошенное пользователем действие. К
полученному результату добавляется префикс «action», затем в классе ищется метод с
получившимся названием. Если такого метода нет, вбрасывается исключение. Если метод есть,
он вызывается, а его... | [
"Возвращает",
"разметку",
"области",
"контента"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin/Controller/Admin/Content.php#L53-L62 |
Eresus/EresusCMS | src/core/Plugin/Controller/Admin/Content.php | Eresus_Plugin_Controller_Admin_Content.getAction | protected function getAction(Eresus_CMS_Request $request)
{
$args = $request->getMethod() == 'GET' ? $request->query : $request->request;
return $args->has('action') ? $args->get('action') : 'index';
} | php | protected function getAction(Eresus_CMS_Request $request)
{
$args = $request->getMethod() == 'GET' ? $request->query : $request->request;
return $args->has('action') ? $args->get('action') : 'index';
} | [
"protected",
"function",
"getAction",
"(",
"Eresus_CMS_Request",
"$",
"request",
")",
"{",
"$",
"args",
"=",
"$",
"request",
"->",
"getMethod",
"(",
")",
"==",
"'GET'",
"?",
"$",
"request",
"->",
"query",
":",
"$",
"request",
"->",
"request",
";",
"retur... | Возвращает запрошенное пользователем действие
Действие определяется на основе аргумента «action» из запроса HTTP. Если аргумент не указан,
возвращается действие «index».
@param Eresus_CMS_Request $request
@return string
@since 3.01 | [
"Возвращает",
"запрошенное",
"пользователем",
"действие"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin/Controller/Admin/Content.php#L75-L79 |
unclecheese/silverstripe-blubber | code/CSSBlubberFile.php | CSSBlubberFile.parse | public function parse() {
$css = new Parser(file_get_contents($this->path));
$this->leanCSS = $css->parse();
$this->blubberCSS = clone $this->leanCSS;
} | php | public function parse() {
$css = new Parser(file_get_contents($this->path));
$this->leanCSS = $css->parse();
$this->blubberCSS = clone $this->leanCSS;
} | [
"public",
"function",
"parse",
"(",
")",
"{",
"$",
"css",
"=",
"new",
"Parser",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
"path",
")",
")",
";",
"$",
"this",
"->",
"leanCSS",
"=",
"$",
"css",
"->",
"parse",
"(",
")",
";",
"$",
"this",
"->... | Begins parsing the CSS file | [
"Begins",
"parsing",
"the",
"CSS",
"file"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberFile.php#L44-L49 |
unclecheese/silverstripe-blubber | code/CSSBlubberFile.php | CSSBlubberFile.saveBlubber | public function saveBlubber() {
$fh = fopen($this->getDirname().'/'.$this->getBlubberName(),'w');
fwrite($fh, $this->blubberCSS->render());
} | php | public function saveBlubber() {
$fh = fopen($this->getDirname().'/'.$this->getBlubberName(),'w');
fwrite($fh, $this->blubberCSS->render());
} | [
"public",
"function",
"saveBlubber",
"(",
")",
"{",
"$",
"fh",
"=",
"fopen",
"(",
"$",
"this",
"->",
"getDirname",
"(",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getBlubberName",
"(",
")",
",",
"'w'",
")",
";",
"fwrite",
"(",
"$",
"fh",
",",
"$",... | Saves the "blubber" CSS to the filesystem | [
"Saves",
"the",
"blubber",
"CSS",
"to",
"the",
"filesystem"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberFile.php#L102-L105 |
unclecheese/silverstripe-blubber | code/CSSBlubberFile.php | CSSBlubberFile.saveLean | public function saveLean() {
$fh = fopen($this->getDirname().'/'.$this->getLeanName(),'w');
fwrite($fh, $this->leanCSS->render());
} | php | public function saveLean() {
$fh = fopen($this->getDirname().'/'.$this->getLeanName(),'w');
fwrite($fh, $this->leanCSS->render());
} | [
"public",
"function",
"saveLean",
"(",
")",
"{",
"$",
"fh",
"=",
"fopen",
"(",
"$",
"this",
"->",
"getDirname",
"(",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getLeanName",
"(",
")",
",",
"'w'",
")",
";",
"fwrite",
"(",
"$",
"fh",
",",
"$",
"th... | Saves the "lean" CSS to the filesystem | [
"Saves",
"the",
"lean",
"CSS",
"to",
"the",
"filesystem"
] | train | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberFile.php#L110-L113 |
Eresus/EresusCMS | src/core/Content/Helper/Replace.php | Eresus_Content_Helper_Replace.replace | public function replace($text)
{
preg_match_all($this->pattern, $text, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
$delta = 0;
foreach ($matches as $match)
{
$stringsOnly = array();
foreach ($match as $info)
{
$stringsOnly []= ... | php | public function replace($text)
{
preg_match_all($this->pattern, $text, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
$delta = 0;
foreach ($matches as $match)
{
$stringsOnly = array();
foreach ($match as $info)
{
$stringsOnly []= ... | [
"public",
"function",
"replace",
"(",
"$",
"text",
")",
"{",
"preg_match_all",
"(",
"$",
"this",
"->",
"pattern",
",",
"$",
"text",
",",
"$",
"matches",
",",
"PREG_SET_ORDER",
"|",
"PREG_OFFSET_CAPTURE",
")",
";",
"$",
"delta",
"=",
"0",
";",
"foreach",
... | Производит замены в переданном тексте и возвращает изменённый текст
@param string $text
@return string
@since 3.01 | [
"Производит",
"замены",
"в",
"переданном",
"тексте",
"и",
"возвращает",
"изменённый",
"текст"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Content/Helper/Replace.php#L89-L111 |
antaresproject/notifications | src/Console/NotificationTypesCommand.php | NotificationTypesCommand.fire | public function fire()
{
$types = NotificationTypes::all();
$flatten = [];
foreach ($types as $type) {
$flatten[] = ['<info>' . $type->id . '</info>', '<fg=red>' . $type->name . '</fg=red>', '<info>' . $type->title . '</info>'];
}
if (count($flatten) > 0) {
... | php | public function fire()
{
$types = NotificationTypes::all();
$flatten = [];
foreach ($types as $type) {
$flatten[] = ['<info>' . $type->id . '</info>', '<fg=red>' . $type->name . '</fg=red>', '<info>' . $type->title . '</info>'];
}
if (count($flatten) > 0) {
... | [
"public",
"function",
"fire",
"(",
")",
"{",
"$",
"types",
"=",
"NotificationTypes",
"::",
"all",
"(",
")",
";",
"$",
"flatten",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"types",
"as",
"$",
"type",
")",
"{",
"$",
"flatten",
"[",
"]",
"=",
"[",
... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Console/NotificationTypesCommand.php#L49-L62 |
oroinc/OroLayoutComponent | Extension/Theme/DataProvider/ThemeProvider.php | ThemeProvider.getStylesOutput | public function getStylesOutput($themeName, $sectionName = 'styles')
{
$assets = $this->getTheme($themeName)->getConfigByKey('assets');
if ($assets && array_key_exists($sectionName, $assets)) {
return array_key_exists('output', $assets[$sectionName]) ? $assets[$sectionName]['output'] : n... | php | public function getStylesOutput($themeName, $sectionName = 'styles')
{
$assets = $this->getTheme($themeName)->getConfigByKey('assets');
if ($assets && array_key_exists($sectionName, $assets)) {
return array_key_exists('output', $assets[$sectionName]) ? $assets[$sectionName]['output'] : n... | [
"public",
"function",
"getStylesOutput",
"(",
"$",
"themeName",
",",
"$",
"sectionName",
"=",
"'styles'",
")",
"{",
"$",
"assets",
"=",
"$",
"this",
"->",
"getTheme",
"(",
"$",
"themeName",
")",
"->",
"getConfigByKey",
"(",
"'assets'",
")",
";",
"if",
"(... | @param string $themeName
@param string $sectionName
@return string|null | [
"@param",
"string",
"$themeName",
"@param",
"string",
"$sectionName"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/Theme/DataProvider/ThemeProvider.php#L43-L56 |
oroinc/OroLayoutComponent | Extension/Theme/DataProvider/ThemeProvider.php | ThemeProvider.getTheme | private function getTheme($themeName)
{
if (!array_key_exists($themeName, $this->themes)) {
$this->themes[$themeName] = $this->themeManager->getTheme($themeName);
}
return $this->themes[$themeName];
} | php | private function getTheme($themeName)
{
if (!array_key_exists($themeName, $this->themes)) {
$this->themes[$themeName] = $this->themeManager->getTheme($themeName);
}
return $this->themes[$themeName];
} | [
"private",
"function",
"getTheme",
"(",
"$",
"themeName",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"themeName",
",",
"$",
"this",
"->",
"themes",
")",
")",
"{",
"$",
"this",
"->",
"themes",
"[",
"$",
"themeName",
"]",
"=",
"$",
"this",... | @param string $themeName
@return Theme | [
"@param",
"string",
"$themeName"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/Theme/DataProvider/ThemeProvider.php#L63-L70 |
mothership-ec/composer | src/Composer/Console/Application.php | Application.doRun | public function doRun(InputInterface $input, OutputInterface $output)
{
$this->io = new ConsoleIO($input, $output, $this->getHelperSet());
ErrorHandler::register($this->io);
if (PHP_VERSION_ID < 50302) {
$this->getIO()->writeError('<warning>Composer only officially supports PHP ... | php | public function doRun(InputInterface $input, OutputInterface $output)
{
$this->io = new ConsoleIO($input, $output, $this->getHelperSet());
ErrorHandler::register($this->io);
if (PHP_VERSION_ID < 50302) {
$this->getIO()->writeError('<warning>Composer only officially supports PHP ... | [
"public",
"function",
"doRun",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"io",
"=",
"new",
"ConsoleIO",
"(",
"$",
"input",
",",
"$",
"output",
",",
"$",
"this",
"->",
"getHelperSet",
"(",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Console/Application.php#L88-L157 |
mothership-ec/composer | src/Composer/Console/Application.php | Application.renderException | public function renderException($exception, $output)
{
try {
$composer = $this->getComposer(false, true);
if ($composer) {
$config = $composer->getConfig();
$minSpaceFree = 1024*1024;
if ((($df = @disk_free_space($dir = $config->get('h... | php | public function renderException($exception, $output)
{
try {
$composer = $this->getComposer(false, true);
if ($composer) {
$config = $composer->getConfig();
$minSpaceFree = 1024*1024;
if ((($df = @disk_free_space($dir = $config->get('h... | [
"public",
"function",
"renderException",
"(",
"$",
"exception",
",",
"$",
"output",
")",
"{",
"try",
"{",
"$",
"composer",
"=",
"$",
"this",
"->",
"getComposer",
"(",
"false",
",",
"true",
")",
";",
"if",
"(",
"$",
"composer",
")",
"{",
"$",
"config"... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Console/Application.php#L177-L210 |
mothership-ec/composer | src/Composer/Console/Application.php | Application.getDefaultCommands | protected function getDefaultCommands()
{
$commands = parent::getDefaultCommands();
$commands[] = new Command\AboutCommand();
$commands[] = new Command\ConfigCommand();
$commands[] = new Command\DependsCommand();
$commands[] = new Command\InitCommand();
$commands[] = ... | php | protected function getDefaultCommands()
{
$commands = parent::getDefaultCommands();
$commands[] = new Command\AboutCommand();
$commands[] = new Command\ConfigCommand();
$commands[] = new Command\DependsCommand();
$commands[] = new Command\InitCommand();
$commands[] = ... | [
"protected",
"function",
"getDefaultCommands",
"(",
")",
"{",
"$",
"commands",
"=",
"parent",
"::",
"getDefaultCommands",
"(",
")",
";",
"$",
"commands",
"[",
"]",
"=",
"new",
"Command",
"\\",
"AboutCommand",
"(",
")",
";",
"$",
"commands",
"[",
"]",
"="... | Initializes all the composer commands | [
"Initializes",
"all",
"the",
"composer",
"commands"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Console/Application.php#L262-L292 |
mothership-ec/composer | src/Composer/Console/Application.php | Application.getLongVersion | public function getLongVersion()
{
if (Composer::BRANCH_ALIAS_VERSION) {
return sprintf(
'<info>%s</info> version <comment>%s (%s)</comment> %s',
$this->getName(),
Composer::BRANCH_ALIAS_VERSION,
$this->getVersion(),
... | php | public function getLongVersion()
{
if (Composer::BRANCH_ALIAS_VERSION) {
return sprintf(
'<info>%s</info> version <comment>%s (%s)</comment> %s',
$this->getName(),
Composer::BRANCH_ALIAS_VERSION,
$this->getVersion(),
... | [
"public",
"function",
"getLongVersion",
"(",
")",
"{",
"if",
"(",
"Composer",
"::",
"BRANCH_ALIAS_VERSION",
")",
"{",
"return",
"sprintf",
"(",
"'<info>%s</info> version <comment>%s (%s)</comment> %s'",
",",
"$",
"this",
"->",
"getName",
"(",
")",
",",
"Composer",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Console/Application.php#L297-L310 |
robrogers3/laraldap-auth | src/HashServiceProvider.php | HashServiceProvider.register | public function register()
{
$this->app->singleton('hash', function ($app) {
return new AESHashManager($app);
});
$this->app->singleton('hash.driver', function ($app) {
return $app['hash']->driver();
});
} | php | public function register()
{
$this->app->singleton('hash', function ($app) {
return new AESHashManager($app);
});
$this->app->singleton('hash.driver', function ($app) {
return $app['hash']->driver();
});
} | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'hash'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"AESHashManager",
"(",
"$",
"app",
")",
";",
"}",
")",
";",
"$",
"this",
"->",... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/robrogers3/laraldap-auth/blob/f1b8d001f8b230389c7fbc5fdd59e39663d8ad36/src/HashServiceProvider.php#L21-L30 |
php-lug/lug | src/Bundle/GridBundle/Form/DataTransformer/GridSortingTransformer.php | GridSortingTransformer.transform | public function transform($value)
{
if ($value === null) {
return;
}
if (!is_array($value)) {
throw new TransformationFailedException(sprintf(
'The grid sorting value should be an array, got "%s".',
is_object($value) ? get_class($value... | php | public function transform($value)
{
if ($value === null) {
return;
}
if (!is_array($value)) {
throw new TransformationFailedException(sprintf(
'The grid sorting value should be an array, got "%s".',
is_object($value) ? get_class($value... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"TransformationFailedException",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/DataTransformer/GridSortingTransformer.php#L26-L57 |
php-lug/lug | src/Bundle/GridBundle/Form/DataTransformer/GridSortingTransformer.php | GridSortingTransformer.reverseTransform | public function reverseTransform($value)
{
$exploded = explode(',', $value);
if ($exploded === false) {
throw new TransformationFailedException(sprintf(
'The grid sorting should be comma-separated, got "%s".',
$value
));
}
$so... | php | public function reverseTransform($value)
{
$exploded = explode(',', $value);
if ($exploded === false) {
throw new TransformationFailedException(sprintf(
'The grid sorting should be comma-separated, got "%s".',
$value
));
}
$so... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"value",
")",
"{",
"$",
"exploded",
"=",
"explode",
"(",
"','",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"exploded",
"===",
"false",
")",
"{",
"throw",
"new",
"TransformationFailedException",
"(",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/DataTransformer/GridSortingTransformer.php#L62-L88 |
mustardandrew/muan-laravel-acl | src/Commands/Permission/RenameCommand.php | RenameCommand.handle | public function handle()
{
$permissionName = $this->argument('permission');
$newPermissionName = $this->argument('newPermission');
if (! $permission = Permission::whereName($permissionName)->first()) {
$this->warn("Permission {$permissionName} not exists.");
return 1... | php | public function handle()
{
$permissionName = $this->argument('permission');
$newPermissionName = $this->argument('newPermission');
if (! $permission = Permission::whereName($permissionName)->first()) {
$this->warn("Permission {$permissionName} not exists.");
return 1... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"permissionName",
"=",
"$",
"this",
"->",
"argument",
"(",
"'permission'",
")",
";",
"$",
"newPermissionName",
"=",
"$",
"this",
"->",
"argument",
"(",
"'newPermission'",
")",
";",
"if",
"(",
"!",
"$",
... | Execute the console command.
@return mixed | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/mustardandrew/muan-laravel-acl/blob/b5f23340b5536babb98d9fd0d727a7a3371c97d5/src/Commands/Permission/RenameCommand.php#L34-L53 |
ClementIV/yii-rest-rbac2.0 | models/BizRule.php | BizRule.classExists | public function classExists()
{
if (!class_exists($this->className)) {
return self::NOCLASS;
}
if (!is_subclass_of($this->className, Rule::className())) {
return $self::ERRORCLASS;
}
return self::RIGHTCLASS;
} | php | public function classExists()
{
if (!class_exists($this->className)) {
return self::NOCLASS;
}
if (!is_subclass_of($this->className, Rule::className())) {
return $self::ERRORCLASS;
}
return self::RIGHTCLASS;
} | [
"public",
"function",
"classExists",
"(",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"this",
"->",
"className",
")",
")",
"{",
"return",
"self",
"::",
"NOCLASS",
";",
"}",
"if",
"(",
"!",
"is_subclass_of",
"(",
"$",
"this",
"->",
"className",
... | Validate class exists | [
"Validate",
"class",
"exists"
] | train | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/models/BizRule.php#L77-L86 |
uiii/pw-core | src/PW/Composer/Installer.php | Installer.installCode | public function installCode(PackageInterface $package)
{
$downloadPath = $this->download($package);
$installPath = $this->getInstallPath($package);
if (! file_exists($installPath . '/site/assets/installed.php')) {
// site profile not created - creating new PW project
// copy files needed for installation... | php | public function installCode(PackageInterface $package)
{
$downloadPath = $this->download($package);
$installPath = $this->getInstallPath($package);
if (! file_exists($installPath . '/site/assets/installed.php')) {
// site profile not created - creating new PW project
// copy files needed for installation... | [
"public",
"function",
"installCode",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"downloadPath",
"=",
"$",
"this",
"->",
"download",
"(",
"$",
"package",
")",
";",
"$",
"installPath",
"=",
"$",
"this",
"->",
"getInstallPath",
"(",
"$",
"package... | {@inheritDoc} | [
"{"
] | train | https://github.com/uiii/pw-core/blob/503a5457c6f5ba33448996ab515a53e4cf2131e5/src/PW/Composer/Installer.php#L49-L70 |
uiii/pw-core | src/PW/Composer/Installer.php | Installer.removeCode | public function removeCode(PackageInterface $package)
{
$installPath = $this->getInstallPath($package);
foreach(glob($installPath . '/site-*') as $dir) {
$this->filesystem->remove($dir);
}
$this->filesystem->remove($installPath . '/wire');
$this->filesystem->remove($installPath . '/install.php');
$th... | php | public function removeCode(PackageInterface $package)
{
$installPath = $this->getInstallPath($package);
foreach(glob($installPath . '/site-*') as $dir) {
$this->filesystem->remove($dir);
}
$this->filesystem->remove($installPath . '/wire');
$this->filesystem->remove($installPath . '/install.php');
$th... | [
"public",
"function",
"removeCode",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"installPath",
"=",
"$",
"this",
"->",
"getInstallPath",
"(",
"$",
"package",
")",
";",
"foreach",
"(",
"glob",
"(",
"$",
"installPath",
".",
"'/site-*'",
")",
"as"... | {@inheritDoc} | [
"{"
] | train | https://github.com/uiii/pw-core/blob/503a5457c6f5ba33448996ab515a53e4cf2131e5/src/PW/Composer/Installer.php#L83-L96 |
dlehren/omnipay-cardknox | src/Message/AbstractRequest.php | AbstractRequest.getBaseData | protected function getBaseData()
{
$data = array();
$data['xKey'] = $this->getCardknoxKey();
$data['xVersion'] = '4.5.4';
$data['xSoftwareName'] = 'omnipay';
$data['xSoftwareVersion'] = '1';
$data['xCommand'] = $this->action;
return $data;
} | php | protected function getBaseData()
{
$data = array();
$data['xKey'] = $this->getCardknoxKey();
$data['xVersion'] = '4.5.4';
$data['xSoftwareName'] = 'omnipay';
$data['xSoftwareVersion'] = '1';
$data['xCommand'] = $this->action;
return $data;
} | [
"protected",
"function",
"getBaseData",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"data",
"[",
"'xKey'",
"]",
"=",
"$",
"this",
"->",
"getCardknoxKey",
"(",
")",
";",
"$",
"data",
"[",
"'xVersion'",
"]",
"=",
"'4.5.4'",
";",
"$"... | Base data used only for the API. | [
"Base",
"data",
"used",
"only",
"for",
"the",
"API",
"."
] | train | https://github.com/dlehren/omnipay-cardknox/blob/69af1f5bffafa6e27957a7114bd6c9c454854985/src/Message/AbstractRequest.php#L81-L91 |
aobozhang/rongcloud-facades | src/RongCloudServiceProvider.php | RongCloudServiceProvider.register | public function register()
{
$this->publishes([
__DIR__.'/config/rongcloud.php' => config_path('rongcloud.php'),
]);
$this->app->singleton('rongcloud', function($app) {
return new RongCloudClass (
$app['config']['rongcloud']['AppKey'],
... | php | public function register()
{
$this->publishes([
__DIR__.'/config/rongcloud.php' => config_path('rongcloud.php'),
]);
$this->app->singleton('rongcloud', function($app) {
return new RongCloudClass (
$app['config']['rongcloud']['AppKey'],
... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"publishes",
"(",
"[",
"__DIR__",
".",
"'/config/rongcloud.php'",
"=>",
"config_path",
"(",
"'rongcloud.php'",
")",
",",
"]",
")",
";",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/aobozhang/rongcloud-facades/blob/8b9a86f69f6fbf84ca204a7faeb6744edc910b8a/src/RongCloudServiceProvider.php#L23-L51 |
caffeinated/beverage | src/Vendor/Stringy.php | Stringy.namespacedStudly | public function namespacedStudly()
{
$str = implode('\\', array_map('studly_case', explode('/', $this->str)));
return static::create($str, $this->encoding);
} | php | public function namespacedStudly()
{
$str = implode('\\', array_map('studly_case', explode('/', $this->str)));
return static::create($str, $this->encoding);
} | [
"public",
"function",
"namespacedStudly",
"(",
")",
"{",
"$",
"str",
"=",
"implode",
"(",
"'\\\\'",
",",
"array_map",
"(",
"'studly_case'",
",",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"str",
")",
")",
")",
";",
"return",
"static",
"::",
"create... | Studly Namespace
Transforms "vendor-name/package-name" into "VendorName/PackageName".
@return Stringy | [
"Studly",
"Namespace"
] | train | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Vendor/Stringy.php#L35-L40 |
canax/database-query-builder | src/DatabaseQueryBuilder/QueryBuilderTrait.php | QueryBuilderTrait.build | protected function build()
{
$sql = $this->start . "\n"
. ($this->from ? $this->from . "\n" : null)
. ($this->join ? $this->join : null)
. ($this->set ? $this->set . "\n" : null)
. ($this->where ? $this->where . "\n" : null)
... | php | protected function build()
{
$sql = $this->start . "\n"
. ($this->from ? $this->from . "\n" : null)
. ($this->join ? $this->join : null)
. ($this->set ? $this->set . "\n" : null)
. ($this->where ? $this->where . "\n" : null)
... | [
"protected",
"function",
"build",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"start",
".",
"\"\\n\"",
".",
"(",
"$",
"this",
"->",
"from",
"?",
"$",
"this",
"->",
"from",
".",
"\"\\n\"",
":",
"null",
")",
".",
"(",
"$",
"this",
"->",
"j... | Build the SQL query from its parts.
@return string as SQL query | [
"Build",
"the",
"SQL",
"query",
"from",
"its",
"parts",
"."
] | train | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/QueryBuilderTrait.php#L64-L78 |
canax/database-query-builder | src/DatabaseQueryBuilder/QueryBuilderTrait.php | QueryBuilderTrait.clear | protected function clear()
{
$this->sql = null;
$this->start = null;
$this->from = null;
$this->join = null;
$this->set = null;
$this->where = null;
$this->groupby = null;
$this->orderby = null;
$this->limit = null;... | php | protected function clear()
{
$this->sql = null;
$this->start = null;
$this->from = null;
$this->join = null;
$this->set = null;
$this->where = null;
$this->groupby = null;
$this->orderby = null;
$this->limit = null;... | [
"protected",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"sql",
"=",
"null",
";",
"$",
"this",
"->",
"start",
"=",
"null",
";",
"$",
"this",
"->",
"from",
"=",
"null",
";",
"$",
"this",
"->",
"join",
"=",
"null",
";",
"$",
"this",
"-... | Clear all previous sql-code.
@return void | [
"Clear",
"all",
"previous",
"sql",
"-",
"code",
"."
] | train | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/QueryBuilderTrait.php#L87-L99 |
canax/database-query-builder | src/DatabaseQueryBuilder/QueryBuilderTrait.php | QueryBuilderTrait.update | public function update($table, $columns, $values = null)
{
$this->clear();
list($columns, $values) = $this->mapColumnsWithValues($columns, $values);
if (count($columns) != count($values)) {
throw new BuildException("Columns does not match values, not equal items.");
}
... | php | public function update($table, $columns, $values = null)
{
$this->clear();
list($columns, $values) = $this->mapColumnsWithValues($columns, $values);
if (count($columns) != count($values)) {
throw new BuildException("Columns does not match values, not equal items.");
}
... | [
"public",
"function",
"update",
"(",
"$",
"table",
",",
"$",
"columns",
",",
"$",
"values",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"list",
"(",
"$",
"columns",
",",
"$",
"values",
")",
"=",
"$",
"this",
"->",
"mapColumn... | Build an update-query.
@param string $table the table name.
@param array $columns to update or key=>value with columns and values.
@param array $values to update or empty if $columns has bot columns and values.
@throws \Anax\Database\BuildException
@return void | [
"Build",
"an",
"update",
"-",
"query",
"."
] | train | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/QueryBuilderTrait.php#L272-L306 |
canax/database-query-builder | src/DatabaseQueryBuilder/QueryBuilderTrait.php | QueryBuilderTrait.deleteFrom | public function deleteFrom($table, $where = null)
{
$this->clear();
if (isset($where)) {
$this->where = "WHERE\n\t(" . $where . ")";
}
$this->start = "DELETE";
$this->from($table);
return $this;
} | php | public function deleteFrom($table, $where = null)
{
$this->clear();
if (isset($where)) {
$this->where = "WHERE\n\t(" . $where . ")";
}
$this->start = "DELETE";
$this->from($table);
return $this;
} | [
"public",
"function",
"deleteFrom",
"(",
"$",
"table",
",",
"$",
"where",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"where",
")",
")",
"{",
"$",
"this",
"->",
"where",
"=",
"\"WHERE\\n\\t(\"",
... | Build a delete-query.
@param string $table the table name.
@param array $where limit which rows are updated.
@return self | [
"Build",
"a",
"delete",
"-",
"query",
"."
] | train | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/QueryBuilderTrait.php#L318-L329 |
canax/database-query-builder | src/DatabaseQueryBuilder/QueryBuilderTrait.php | QueryBuilderTrait.rightJoin | public function rightJoin($table, $condition)
{
if ($this->dialect == 'sqlite') {
throw new BuildException("SQLite does not support RIGHT JOIN");
}
return $this->createJoin($table, $condition, 'RIGHT OUTER');
} | php | public function rightJoin($table, $condition)
{
if ($this->dialect == 'sqlite') {
throw new BuildException("SQLite does not support RIGHT JOIN");
}
return $this->createJoin($table, $condition, 'RIGHT OUTER');
} | [
"public",
"function",
"rightJoin",
"(",
"$",
"table",
",",
"$",
"condition",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dialect",
"==",
"'sqlite'",
")",
"{",
"throw",
"new",
"BuildException",
"(",
"\"SQLite does not support RIGHT JOIN\"",
")",
";",
"}",
"retur... | Build the right join part.
@param string $table name of table.
@param string $condition to join.
@throws \Anax\Database\BuildException when dialect does not support.
@return $this | [
"Build",
"the",
"right",
"join",
"part",
"."
] | train | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/QueryBuilderTrait.php#L390-L397 |
alevilar/ristorantino-vendor | Stats/Model/CustomQuery.php | CustomQuery.paginateCount | function paginateCount($conditions, $recursive){
$sql = $this->sql;
return count($this->query($sql));
} | php | function paginateCount($conditions, $recursive){
$sql = $this->sql;
return count($this->query($sql));
} | [
"function",
"paginateCount",
"(",
"$",
"conditions",
",",
"$",
"recursive",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"sql",
";",
"return",
"count",
"(",
"$",
"this",
"->",
"query",
"(",
"$",
"sql",
")",
")",
";",
"}"
] | Esta funcion sobreescribe a la del paginador. Como son
consultas guardadas en la tabla query, tengo que calcular
la cantidad de registros para que pagine bien.
@param $conditions, $recursive
@return cantidad de registro. | [
"Esta",
"funcion",
"sobreescribe",
"a",
"la",
"del",
"paginador",
".",
"Como",
"son",
"consultas",
"guardadas",
"en",
"la",
"tabla",
"query",
"tengo",
"que",
"calcular",
"la",
"cantidad",
"de",
"registros",
"para",
"que",
"pagine",
"bien",
"."
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Stats/Model/CustomQuery.php#L25-L29 |
alevilar/ristorantino-vendor | Stats/Model/CustomQuery.php | CustomQuery.paginate | function paginate($conditions, $fields, $order, $limit, $page, $recursive){
$sql = $this->sql;
$sql .= " LIMIT " . $this->limit . " ";
$sql .= " OFFSET " . (($page - 1) * $this->limit);
return $this->query($sql);
} | php | function paginate($conditions, $fields, $order, $limit, $page, $recursive){
$sql = $this->sql;
$sql .= " LIMIT " . $this->limit . " ";
$sql .= " OFFSET " . (($page - 1) * $this->limit);
return $this->query($sql);
} | [
"function",
"paginate",
"(",
"$",
"conditions",
",",
"$",
"fields",
",",
"$",
"order",
",",
"$",
"limit",
",",
"$",
"page",
",",
"$",
"recursive",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"sql",
";",
"$",
"sql",
".=",
"\" LIMIT \"",
".",
"$"... | Esta funcion sobreescribe a la del paginador. Como son
consultas guardadas en la tabla query, tengo que
reescribir el limit y el offset para poder mostrar por pantalla
@param $conditions, $recursive
@return registros paginados. | [
"Esta",
"funcion",
"sobreescribe",
"a",
"la",
"del",
"paginador",
".",
"Como",
"son",
"consultas",
"guardadas",
"en",
"la",
"tabla",
"query",
"tengo",
"que",
"reescribir",
"el",
"limit",
"y",
"el",
"offset",
"para",
"poder",
"mostrar",
"por",
"pantalla"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Stats/Model/CustomQuery.php#L39-L46 |
jnaxo/country-codes | src/Store/ApiManager.php | ApiManager.respondWithItem | protected function respondWithItem(
$item,
$resource_name = '',
array $links = [],
array $included = []
) {
$resource = new Item($item, $resource_name, $links, $included);
return $this->respondWithArray($resource->toArray());
} | php | protected function respondWithItem(
$item,
$resource_name = '',
array $links = [],
array $included = []
) {
$resource = new Item($item, $resource_name, $links, $included);
return $this->respondWithArray($resource->toArray());
} | [
"protected",
"function",
"respondWithItem",
"(",
"$",
"item",
",",
"$",
"resource_name",
"=",
"''",
",",
"array",
"$",
"links",
"=",
"[",
"]",
",",
"array",
"$",
"included",
"=",
"[",
"]",
")",
"{",
"$",
"resource",
"=",
"new",
"Item",
"(",
"$",
"i... | Response with item
@param Object $item
@param $resource_name
@param array $links
@param array $included
@return Json Object | [
"Response",
"with",
"item"
] | train | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/src/Store/ApiManager.php#L20-L28 |
songshenzong/log | src/DataCollector/TimeDataCollector.php | TimeDataCollector.startMeasure | public function startMeasure($name, $label = null, $collector = null)
{
$start = microtime(true);
$this->startedMeasures[$name] = [
'label' => $label ?: $name,
'start' => $start,
'collector' => $collector,
];
} | php | public function startMeasure($name, $label = null, $collector = null)
{
$start = microtime(true);
$this->startedMeasures[$name] = [
'label' => $label ?: $name,
'start' => $start,
'collector' => $collector,
];
} | [
"public",
"function",
"startMeasure",
"(",
"$",
"name",
",",
"$",
"label",
"=",
"null",
",",
"$",
"collector",
"=",
"null",
")",
"{",
"$",
"start",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"this",
"->",
"startedMeasures",
"[",
"$",
"name",
"]",
... | Starts a measure
@param string $name Internal name, used to stop the measure
@param string|null $label Public name
@param string|null $collector The source of the collector | [
"Starts",
"a",
"measure"
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/TimeDataCollector.php#L63-L71 |
mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/PageToIntegerTransformer.php | PageToIntegerTransformer.transform | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof Page)) {
throw new TransformationFailedException('Expected an instance of a concrete5 page object.');
}
return intval($value->getCollectio... | php | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof Page)) {
throw new TransformationFailedException('Expected an instance of a concrete5 page object.');
}
return intval($value->getCollectio... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"==",
"''",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"(",
"$",
"value",
"instanceof",
"Page",
")",
")",
"{",
... | Converts a concrete5 page object to an integer.
@param \Concrete\Core\Page\Page $value The page object value
@return int The integer value
@throws TransformationFailedException If the given value is not an
instance of Concrete\Core\Page\Page. | [
"Converts",
"a",
"concrete5",
"page",
"object",
"to",
"an",
"integer",
"."
] | train | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/PageToIntegerTransformer.php#L33-L42 |
mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/PageToIntegerTransformer.php | PageToIntegerTransformer.reverseTransform | public function reverseTransform($cID)
{
if (!is_numeric($cID) || $cID == 0) {
return null;
}
$rep = $this->entityManager->getRepository('Concrete\Core\Page\Page');
$c = $rep->find($cID);
if (!is_object($c) || $c->isError()) {
throw new Transformatio... | php | public function reverseTransform($cID)
{
if (!is_numeric($cID) || $cID == 0) {
return null;
}
$rep = $this->entityManager->getRepository('Concrete\Core\Page\Page');
$c = $rep->find($cID);
if (!is_object($c) || $c->isError()) {
throw new Transformatio... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"cID",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"cID",
")",
"||",
"$",
"cID",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"$",
"rep",
"=",
"$",
"this",
"->",
"entityManager",
"->",
... | Converts an integer to a concrete5 page object.
@param int $cID
@return mixed The value
@throws TransformationFailedException If the given value is not a proper
concrete5 page ID. | [
"Converts",
"an",
"integer",
"to",
"a",
"concrete5",
"page",
"object",
"."
] | train | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/PageToIntegerTransformer.php#L52-L66 |
Opifer/EavBundle | DependencyInjection/OpiferEavExtension.php | OpiferEavExtension.getParameters | public function getParameters(array $config)
{
$params = [
'opifer_eav.attribute_class' => $config['attribute_class'],
'opifer_eav.media_class' => $config['media_class'],
'opifer_eav.nestable_class' => $config['nestable_class'],
'opifer_eav.option_class' ... | php | public function getParameters(array $config)
{
$params = [
'opifer_eav.attribute_class' => $config['attribute_class'],
'opifer_eav.media_class' => $config['media_class'],
'opifer_eav.nestable_class' => $config['nestable_class'],
'opifer_eav.option_class' ... | [
"public",
"function",
"getParameters",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"params",
"=",
"[",
"'opifer_eav.attribute_class'",
"=>",
"$",
"config",
"[",
"'attribute_class'",
"]",
",",
"'opifer_eav.media_class'",
"=>",
"$",
"config",
"[",
"'media_class'",
... | Simplifying parameter syntax
@param array $config
@return array | [
"Simplifying",
"parameter",
"syntax"
] | train | https://github.com/Opifer/EavBundle/blob/4236fdc28b7574dac43f420704d0fc3c04905a4c/DependencyInjection/OpiferEavExtension.php#L35-L51 |
Opifer/EavBundle | DependencyInjection/OpiferEavExtension.php | OpiferEavExtension.prepend | public function prepend(ContainerBuilder $container)
{
$configs = $container->getExtensionConfig($this->getAlias());
$config = $this->processConfiguration(new Configuration(), $configs);
$parameters = $this->getParameters($config);
foreach ($parameters as $key => $value) {
... | php | public function prepend(ContainerBuilder $container)
{
$configs = $container->getExtensionConfig($this->getAlias());
$config = $this->processConfiguration(new Configuration(), $configs);
$parameters = $this->getParameters($config);
foreach ($parameters as $key => $value) {
... | [
"public",
"function",
"prepend",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configs",
"=",
"$",
"container",
"->",
"getExtensionConfig",
"(",
"$",
"this",
"->",
"getAlias",
"(",
")",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"proce... | Prepend our config before other bundles, so we can preset
their config with our parameters
@param ContainerBuilder $container
@return void | [
"Prepend",
"our",
"config",
"before",
"other",
"bundles",
"so",
"we",
"can",
"preset",
"their",
"config",
"with",
"our",
"parameters"
] | train | https://github.com/Opifer/EavBundle/blob/4236fdc28b7574dac43f420704d0fc3c04905a4c/DependencyInjection/OpiferEavExtension.php#L61-L97 |
inhere/php-librarys | src/Files/Parsers/IniParser.php | IniParser.doParse | protected static function doParse($string, $enhancement = false, callable $pathHandler = null, $fileDir = '')
{
if (!$string) {
return [];
}
if (!\is_string($string)) {
throw new \InvalidArgumentException('parameter type error! must is string.');
}
/... | php | protected static function doParse($string, $enhancement = false, callable $pathHandler = null, $fileDir = '')
{
if (!$string) {
return [];
}
if (!\is_string($string)) {
throw new \InvalidArgumentException('parameter type error! must is string.');
}
/... | [
"protected",
"static",
"function",
"doParse",
"(",
"$",
"string",
",",
"$",
"enhancement",
"=",
"false",
",",
"callable",
"$",
"pathHandler",
"=",
"null",
",",
"$",
"fileDir",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"string",
")",
"{",
"return",
"[... | parse INI
@param string $string Waiting for the parse data
@param bool $enhancement 启用增强功能,支持通过关键字 继承、导入、参考
@param callable $pathHandler When the second param is true, this param is valid.
@param string $fileDir When the second param is true, this param is valid.
@return array
@throws \InvalidArgumentException
@throws ... | [
"parse",
"INI"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Files/Parsers/IniParser.php#L27-L100 |
MASNathan/Parser | src/Type/Json.php | Json.encode | public static function encode($data, $prettyPrint = false)
{
if ($prettyPrint) {
// Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant
if (version_compare(PHP_VERSION, '5.4.0', '>=') && defined('JSON_PRETTY_PRINT')) {
return json_encode($data, J... | php | public static function encode($data, $prettyPrint = false)
{
if ($prettyPrint) {
// Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant
if (version_compare(PHP_VERSION, '5.4.0', '>=') && defined('JSON_PRETTY_PRINT')) {
return json_encode($data, J... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"prettyPrint",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"prettyPrint",
")",
"{",
"// Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant",
"if",
"(",
"version_compare",
"(",
"... | Encodes an array to json strutcture
@param array $data Data to encode
@param boolean $prettyPrint True to output the encoded data a little bit more readable for the humans
@return string | [
"Encodes",
"an",
"array",
"to",
"json",
"strutcture"
] | train | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Json.php#L15-L28 |
MASNathan/Parser | src/Type/Json.php | Json.decode | public static function decode($string)
{
$result = json_decode($string, true);
switch (json_last_error()) {
case JSON_ERROR_NONE:
return $result;
case JSON_ERROR_DEPTH:
throw new \Exception("Maximum stack depth exceeded");
case J... | php | public static function decode($string)
{
$result = json_decode($string, true);
switch (json_last_error()) {
case JSON_ERROR_NONE:
return $result;
case JSON_ERROR_DEPTH:
throw new \Exception("Maximum stack depth exceeded");
case J... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"string",
")",
"{",
"$",
"result",
"=",
"json_decode",
"(",
"$",
"string",
",",
"true",
")",
";",
"switch",
"(",
"json_last_error",
"(",
")",
")",
"{",
"case",
"JSON_ERROR_NONE",
":",
"return",
"$",
"... | Decodes a json file string
@param string $string File contents
@return array | [
"Decodes",
"a",
"json",
"file",
"string"
] | train | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Json.php#L35-L61 |
mslib/resource-proxy | Msl/ResourceProxy/Source/Email/AbstractAccount.php | AbstractAccount.setConfig | public function setConfig(SourceConfig $sourceConfig)
{
// Setting the source config
$this->sourceConfig = $sourceConfig;
// Setting object fields from configuration
$this->name = $sourceConfig->getName();
// Checking if crypt protocol is accepted
$cryptProtocol = $... | php | public function setConfig(SourceConfig $sourceConfig)
{
// Setting the source config
$this->sourceConfig = $sourceConfig;
// Setting object fields from configuration
$this->name = $sourceConfig->getName();
// Checking if crypt protocol is accepted
$cryptProtocol = $... | [
"public",
"function",
"setConfig",
"(",
"SourceConfig",
"$",
"sourceConfig",
")",
"{",
"// Setting the source config",
"$",
"this",
"->",
"sourceConfig",
"=",
"$",
"sourceConfig",
";",
"// Setting object fields from configuration",
"$",
"this",
"->",
"name",
"=",
"$",... | Sets all the required parameters to configure a given Source instance.
@param SourceConfig $sourceConfig
@throws \Msl\ResourceProxy\Exception\BadSourceConfigurationException
@return void | [
"Sets",
"all",
"the",
"required",
"parameters",
"to",
"configure",
"a",
"given",
"Source",
"instance",
"."
] | train | https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Source/Email/AbstractAccount.php#L86-L124 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/ServiceProvider.php | ServiceProvider.register | public function register(Application $app)
{
if (!isset($app['descriptor.builder'])) {
throw new Exception\MissingDependencyException(
'The builder object that is used to construct the ProjectDescriptor is missing'
);
}
if (!isset($app['serializer'])) ... | php | public function register(Application $app)
{
if (!isset($app['descriptor.builder'])) {
throw new Exception\MissingDependencyException(
'The builder object that is used to construct the ProjectDescriptor is missing'
);
}
if (!isset($app['serializer'])) ... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"app",
"[",
"'descriptor.builder'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"MissingDependencyException",
"(",
"'The builder object th... | Registers services on the given app.
@param Application $app An Application instance.
@throws Exception\MissingDependencyException if the application does not have a descriptor.builder service.
@throws Exception\MissingDependencyException if the application does not have a serializer service. | [
"Registers",
"services",
"on",
"the",
"given",
"app",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/ServiceProvider.php#L47-L198 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/ServiceProvider.php | ServiceProvider.provideTemplatingSystem | protected function provideTemplatingSystem(Application $app)
{
$templateDir = __DIR__ . '/../../../data/templates';
// when installed using composer the templates are in a different folder
$composerTemplatePath = __DIR__ . '/../../../../templates';
if (file_exists($composerTemplateP... | php | protected function provideTemplatingSystem(Application $app)
{
$templateDir = __DIR__ . '/../../../data/templates';
// when installed using composer the templates are in a different folder
$composerTemplatePath = __DIR__ . '/../../../../templates';
if (file_exists($composerTemplateP... | [
"protected",
"function",
"provideTemplatingSystem",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"templateDir",
"=",
"__DIR__",
".",
"'/../../../data/templates'",
";",
"// when installed using composer the templates are in a different folder",
"$",
"composerTemplatePath",
"="... | Initializes the templating system in the container.
@param Application $app
@return void | [
"Initializes",
"the",
"templating",
"system",
"in",
"the",
"container",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/ServiceProvider.php#L207-L244 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Transformation.php | Transformation.getParametersWithKey | public function getParametersWithKey($name)
{
$parameters = array();
/** @var Parameter $parameter */
foreach ($this->parameters as $parameter) {
if ($parameter->getKey() == $name) {
$parameters[] = $parameter;
}
}
return $parameters;... | php | public function getParametersWithKey($name)
{
$parameters = array();
/** @var Parameter $parameter */
foreach ($this->parameters as $parameter) {
if ($parameter->getKey() == $name) {
$parameters[] = $parameter;
}
}
return $parameters;... | [
"public",
"function",
"getParametersWithKey",
"(",
"$",
"name",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"/** @var Parameter $parameter */",
"foreach",
"(",
"$",
"this",
"->",
"parameters",
"as",
"$",
"parameter",
")",
"{",
"if",
"(",
"$",
... | Returns a specific parameter, or $default if none exists.
@param string $name Name of the parameter to return.
@return Parameter | [
"Returns",
"a",
"specific",
"parameter",
"or",
"$default",
"if",
"none",
"exists",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Transformation.php#L283-L295 |
j-d/draggy | src/Draggy/Autocode/Templates/Template.php | Template.getIndentationPrefix | public function getIndentationPrefix($times = 1)
{
if (!is_integer($times)) {
throw new \InvalidArgumentException('The times parameter has to be an integer');
}
$indentation = '';
for ($i = 0; $i < $times; $i++) {
$indentation .= $this->getTemplate()->getInd... | php | public function getIndentationPrefix($times = 1)
{
if (!is_integer($times)) {
throw new \InvalidArgumentException('The times parameter has to be an integer');
}
$indentation = '';
for ($i = 0; $i < $times; $i++) {
$indentation .= $this->getTemplate()->getInd... | [
"public",
"function",
"getIndentationPrefix",
"(",
"$",
"times",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"is_integer",
"(",
"$",
"times",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The times parameter has to be an integer'",
")",
";",
... | Returns all the indentation that should be put before the current line
@param int $times
@return string
@throws \InvalidArgumentException | [
"Returns",
"all",
"the",
"indentation",
"that",
"should",
"be",
"put",
"before",
"the",
"current",
"line"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Template.php#L88-L101 |
j-d/draggy | src/Draggy/Autocode/Templates/Template.php | Template.convertLinesToCode | public function convertLinesToCode(array $lines) {
if (0 === count($lines)) {
return '';
}
if (0 !== strlen($this->getTemplate()->getIndentationPrefix())) {
foreach ($lines as $lineNumber => $line) {
if (null === $line) {
unset($lines[... | php | public function convertLinesToCode(array $lines) {
if (0 === count($lines)) {
return '';
}
if (0 !== strlen($this->getTemplate()->getIndentationPrefix())) {
foreach ($lines as $lineNumber => $line) {
if (null === $line) {
unset($lines[... | [
"public",
"function",
"convertLinesToCode",
"(",
"array",
"$",
"lines",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"lines",
")",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"0",
"!==",
"strlen",
"(",
"$",
"this",
"->",
"getTemplate",
"(... | Converts an array of lines into code, including the current indentation
@param array $lines
@return string | [
"Converts",
"an",
"array",
"of",
"lines",
"into",
"code",
"including",
"the",
"current",
"indentation"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Template.php#L110-L126 |
j-d/draggy | src/Draggy/Autocode/Templates/Template.php | Template.getBlurbLines | public function getBlurbLines()
{
$lines = [];
$lines[] = '';
$lines[] = '/************************************************************************************************';
$lines[] = ' ** THIS IS AN AUTOMATICALLY GENERATED BASE FILE AND SHOULD NOT BE MANUALLY EDITED **... | php | public function getBlurbLines()
{
$lines = [];
$lines[] = '';
$lines[] = '/************************************************************************************************';
$lines[] = ' ** THIS IS AN AUTOMATICALLY GENERATED BASE FILE AND SHOULD NOT BE MANUALLY EDITED **... | [
"public",
"function",
"getBlurbLines",
"(",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"lines",
"[",
"]",
"=",
"''",
";",
"$",
"lines",
"[",
"]",
"=",
"'/************************************************************************************************'",
";",
... | Get the default Blurb
@return string | [
"Get",
"the",
"default",
"Blurb"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Template.php#L133-L153 |
prooph/link-monitor | src/Service/DbalProcessLogger.php | DbalProcessLogger.getLastLoggedProcesses | public function getLastLoggedProcesses($offset = 0, $limit = 10)
{
$query = $this->connection->createQueryBuilder();
$query->select('*')->from(self::TABLE)->orderBy('started_at', 'DESC')->setFirstResult($offset)->setMaxResults($limit);
return $query->execute()->fetchAll();
} | php | public function getLastLoggedProcesses($offset = 0, $limit = 10)
{
$query = $this->connection->createQueryBuilder();
$query->select('*')->from(self::TABLE)->orderBy('started_at', 'DESC')->setFirstResult($offset)->setMaxResults($limit);
return $query->execute()->fetchAll();
} | [
"public",
"function",
"getLastLoggedProcesses",
"(",
"$",
"offset",
"=",
"0",
",",
"$",
"limit",
"=",
"10",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"connection",
"->",
"createQueryBuilder",
"(",
")",
";",
"$",
"query",
"->",
"select",
"(",
"'*'... | Orders process logs by started_at DESC
Returns array of process log entry arrays.
Each process log contains the information:
- process_id => UUID string
- status => running|succeed|failed
- start_message => string|null
- started_at => \DateTime::ISO8601 formatted
- finished_at => \DateTime::ISO8601 formatted
@param ... | [
"Orders",
"process",
"logs",
"by",
"started_at",
"DESC",
"Returns",
"array",
"of",
"process",
"log",
"entry",
"arrays",
".",
"Each",
"process",
"log",
"contains",
"the",
"information",
":"
] | train | https://github.com/prooph/link-monitor/blob/5dd12a4bda48eb05471181bf4dab43938cf39df8/src/Service/DbalProcessLogger.php#L161-L168 |
frdl/webfan | .ApplicationComposer/lib/frdl/Flow/ComponentType.php | ComponentType.& | public function &__get($name)
{
$retval = null;
if('name' === $name){
return $this->name;
}elseif('dump' === $name){
$retval = $this->_dump();
return $retval;
}elseif (isset($this->data[$name])){
$retval = $this->data[$name];
return $retval;
... | php | public function &__get($name)
{
$retval = null;
if('name' === $name){
return $this->name;
}elseif('dump' === $name){
$retval = $this->_dump();
return $retval;
}elseif (isset($this->data[$name])){
$retval = $this->data[$name];
return $retval;
... | [
"public",
"function",
"&",
"__get",
"(",
"$",
"name",
")",
"{",
"$",
"retval",
"=",
"null",
";",
"if",
"(",
"'name'",
"===",
"$",
"name",
")",
"{",
"return",
"$",
"this",
"->",
"name",
";",
"}",
"elseif",
"(",
"'dump'",
"===",
"$",
"name",
")",
... | /*
public function __toString()
{
return $this->name;
} | [
"/",
"*",
"public",
"function",
"__toString",
"()",
"{",
"return",
"$this",
"-",
">",
"name",
";",
"}"
] | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/Flow/ComponentType.php#L62-L77 |
nabab/bbn | src/bbn/user/permissions.php | permissions.from_path | public function from_path(string $path, $type = 'page'): ?string
{
$parent = null;
if ( $root = $this->opt->from_code($type, self::$option_root_id) ){
$parts = explode('/', $path);
$parent = $root;
foreach ( $parts as $i => $p ){
$is_not_last = $i < (\count($parts) - 1);
if (... | php | public function from_path(string $path, $type = 'page'): ?string
{
$parent = null;
if ( $root = $this->opt->from_code($type, self::$option_root_id) ){
$parts = explode('/', $path);
$parent = $root;
foreach ( $parts as $i => $p ){
$is_not_last = $i < (\count($parts) - 1);
if (... | [
"public",
"function",
"from_path",
"(",
"string",
"$",
"path",
",",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"string",
"{",
"$",
"parent",
"=",
"null",
";",
"if",
"(",
"$",
"root",
"=",
"$",
"this",
"->",
"opt",
"->",
"from_code",
"(",
"$",
"ty... | Returns the option's ID corresponds to the given path.
@param string $path
@param string $type
@return null|string | [
"Returns",
"the",
"option",
"s",
"ID",
"corresponds",
"to",
"the",
"given",
"path",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L76-L96 |
nabab/bbn | src/bbn/user/permissions.php | permissions.options | public function options(string $id_option = null, string $type = 'page'): ?array
{
if (
($id_option = $this->_get_id_option($id_option, $type)) &&
($os = $this->opt->options(\func_get_args()))
){
$res = [];
foreach ( $os as $o ){
if ( $this->pref->has($o['id']) ){
$re... | php | public function options(string $id_option = null, string $type = 'page'): ?array
{
if (
($id_option = $this->_get_id_option($id_option, $type)) &&
($os = $this->opt->options(\func_get_args()))
){
$res = [];
foreach ( $os as $o ){
if ( $this->pref->has($o['id']) ){
$re... | [
"public",
"function",
"options",
"(",
"string",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"array",
"{",
"if",
"(",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
... | Returns the result of appui\options::options filtered with only the ones authorized to the current user.
@param string|null $id_option
@param string $type
@return array|null | [
"Returns",
"the",
"result",
"of",
"appui",
"\\",
"options",
"::",
"options",
"filtered",
"with",
"only",
"the",
"ones",
"authorized",
"to",
"the",
"current",
"user",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L105-L120 |
nabab/bbn | src/bbn/user/permissions.php | permissions.full_options | public function full_options(string $id_option = null, string $type = 'page'): ?array
{
if (
($id_option = $this->_get_id_option($id_option, $type)) &&
($os = $this->opt->full_options(\func_get_args()))
){
$res = [];
foreach ( $os as $o ){
if ( ($ids = $this->pref->retrieve_ids... | php | public function full_options(string $id_option = null, string $type = 'page'): ?array
{
if (
($id_option = $this->_get_id_option($id_option, $type)) &&
($os = $this->opt->full_options(\func_get_args()))
){
$res = [];
foreach ( $os as $o ){
if ( ($ids = $this->pref->retrieve_ids... | [
"public",
"function",
"full_options",
"(",
"string",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"array",
"{",
"if",
"(",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option... | Returns the result of appui\options::full_options filtered with only the ones authorized to the current user.
@param string|null $id_option
@param string $type
@return array|null | [
"Returns",
"the",
"result",
"of",
"appui",
"\\",
"options",
"::",
"full_options",
"filtered",
"with",
"only",
"the",
"ones",
"authorized",
"to",
"the",
"current",
"user",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L129-L144 |
nabab/bbn | src/bbn/user/permissions.php | permissions.get_all | public function get_all(string $id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->options($id_option ?: $this->get_current());
}
return null;
} | php | public function get_all(string $id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->options($id_option ?: $this->get_current());
}
return null;
} | [
"public",
"function",
"get_all",
"(",
"string",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"array",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
... | Returns the full list of permissions existing in the given option
@param null|string $id_option
@param string $type
@return null|array | [
"Returns",
"the",
"full",
"list",
"of",
"permissions",
"existing",
"in",
"the",
"given",
"option"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L153-L159 |
nabab/bbn | src/bbn/user/permissions.php | permissions.get_full | public function get_full($id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->full_options($id_option ?: $this->get_current());
}
return null;
} | php | public function get_full($id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->full_options($id_option ?: $this->get_current());
}
return null;
} | [
"public",
"function",
"get_full",
"(",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"array",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
"$",
"typ... | Returns the full list of permissions existing in the given option with all the current user's preferences
@param null|string $id_option
@param string $type
@return array|bool|false | [
"Returns",
"the",
"full",
"list",
"of",
"permissions",
"existing",
"in",
"the",
"given",
"option",
"with",
"all",
"the",
"current",
"user",
"s",
"preferences"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L168-L174 |
nabab/bbn | src/bbn/user/permissions.php | permissions.get | public function get(string $id_option = null, string $type = 'page', bool $force = false): ?array
{
/*
if ( $all = $this->get_all($id_option, $type) ){
$r = [];
foreach ( $all as $a ){
if ( $this->has($a['id'], '', $force) ){
$r[] = $a;
}
}
return $r;
}
... | php | public function get(string $id_option = null, string $type = 'page', bool $force = false): ?array
{
/*
if ( $all = $this->get_all($id_option, $type) ){
$r = [];
foreach ( $all as $a ){
if ( $this->has($a['id'], '', $force) ){
$r[] = $a;
}
}
return $r;
}
... | [
"public",
"function",
"get",
"(",
"string",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
",",
"bool",
"$",
"force",
"=",
"false",
")",
":",
"?",
"array",
"{",
"/*\n if ( $all = $this->get_all($id_option, $type) ){\n $r = [];\n ... | Returns an option combined with its sole/first permission
@param string $id_option
@param string $type
@param bool $force
@return array|bool | [
"Returns",
"an",
"option",
"combined",
"with",
"its",
"sole",
"/",
"first",
"permission"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L184-L204 |
nabab/bbn | src/bbn/user/permissions.php | permissions.has | public function has(string $id_option = null, string $type = 'page', bool $force = false): bool
{
if ( !$force && $this->user && $this->user->is_dev() ){
return true;
}
if ( $id_option = $this->_get_id_option($id_option, $type) ){
$option = $this->opt->option($id_option);
if ( !empty($op... | php | public function has(string $id_option = null, string $type = 'page', bool $force = false): bool
{
if ( !$force && $this->user && $this->user->is_dev() ){
return true;
}
if ( $id_option = $this->_get_id_option($id_option, $type) ){
$option = $this->opt->option($id_option);
if ( !empty($op... | [
"public",
"function",
"has",
"(",
"string",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
",",
"bool",
"$",
"force",
"=",
"false",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"force",
"&&",
"$",
"this",
"->",
"user",
"... | Checks if a user and/or a group has a permission.
@param mixed $id_option
@param string $type
@param bool $force
@return bool | [
"Checks",
"if",
"a",
"user",
"and",
"/",
"or",
"a",
"group",
"has",
"a",
"permission",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L214-L227 |
nabab/bbn | src/bbn/user/permissions.php | permissions.is | public function is(string $path, string $type = 'page'): ?string
{
return $this->from_path($path, $type);
} | php | public function is(string $path, string $type = 'page'): ?string
{
return $this->from_path($path, $type);
} | [
"public",
"function",
"is",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"string",
"{",
"return",
"$",
"this",
"->",
"from_path",
"(",
"$",
"path",
",",
"$",
"type",
")",
";",
"}"
] | Checks if an option corresponds to the given path.
@param string $path
@param string $type
@return null|string | [
"Checks",
"if",
"an",
"option",
"corresponds",
"to",
"the",
"given",
"path",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L236-L239 |
nabab/bbn | src/bbn/user/permissions.php | permissions.customize | public function customize(array $arr): array
{
$res = [];
if ( isset($arr[0]) ){
foreach ( $arr as $a ){
if ( isset($a['id']) && $this->has($a['id']) ){
$res[] = $a;
}
}
}
else if ( isset($arr['items']) ){
$res = $arr;
unset($res['items']);
forea... | php | public function customize(array $arr): array
{
$res = [];
if ( isset($arr[0]) ){
foreach ( $arr as $a ){
if ( isset($a['id']) && $this->has($a['id']) ){
$res[] = $a;
}
}
}
else if ( isset($arr['items']) ){
$res = $arr;
unset($res['items']);
forea... | [
"public",
"function",
"customize",
"(",
"array",
"$",
"arr",
")",
":",
"array",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"arr",
"[",
"0",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"a",
")",
"{",
"i... | Adapts a given array of options' to user's permissions
@param array $arr
@return array | [
"Adapts",
"a",
"given",
"array",
"of",
"options",
"to",
"user",
"s",
"permissions"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L247-L270 |
nabab/bbn | src/bbn/user/permissions.php | permissions.add | public function add(string $id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->set_by_option($id_option, []);
}
return null;
} | php | public function add(string $id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->set_by_option($id_option, []);
}
return null;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"id_option",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"int",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
"$",
"type",
")",
... | Grants a new permission to a user or a group
@param null|string $id_option
@param string $type
@return int | [
"Grants",
"a",
"new",
"permission",
"to",
"a",
"user",
"or",
"a",
"group"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L278-L284 |
nabab/bbn | src/bbn/user/permissions.php | permissions.remove | public function remove($id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->delete($id_option);
}
return null;
} | php | public function remove($id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->delete($id_option);
}
return null;
} | [
"public",
"function",
"remove",
"(",
"$",
"id_option",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"int",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
"$",
"type",
")",
")",
"... | Deletes a preference for a path or an ID.
@param null|string $id_option
@param string $type
@return null|int | [
"Deletes",
"a",
"preference",
"for",
"a",
"path",
"or",
"an",
"ID",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L293-L299 |
nabab/bbn | src/bbn/user/permissions.php | permissions.read_option | public function read_option(string $id_option = null): ?bool
{
if ( bbn\str::is_uid($id_option) ){
$root = self::get_option_id('options');
$id_to_check = $this->opt->from_code('opt'.$id_option, $root);
return $this->has($id_to_check, 'options');
}
return null;
} | php | public function read_option(string $id_option = null): ?bool
{
if ( bbn\str::is_uid($id_option) ){
$root = self::get_option_id('options');
$id_to_check = $this->opt->from_code('opt'.$id_option, $root);
return $this->has($id_to_check, 'options');
}
return null;
} | [
"public",
"function",
"read_option",
"(",
"string",
"$",
"id_option",
"=",
"null",
")",
":",
"?",
"bool",
"{",
"if",
"(",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id_option",
")",
")",
"{",
"$",
"root",
"=",
"self",
"::",
"get_option_id",
"(",
... | Checks if the category represented by the given option ID is readable by the current user
@param string|null $id_option
@return bool|null | [
"Checks",
"if",
"the",
"category",
"represented",
"by",
"the",
"given",
"option",
"ID",
"is",
"readable",
"by",
"the",
"current",
"user"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L307-L315 |
Erdiko/core | src/View.php | View.renderMustache | public function renderMustache($filename, $data) {
// This is for mustache compatibility
$data['getView'] = function($name, $data) {
return $this->getView($name, $data);
};
return parent::renderMustache($filename, $data);
} | php | public function renderMustache($filename, $data) {
// This is for mustache compatibility
$data['getView'] = function($name, $data) {
return $this->getView($name, $data);
};
return parent::renderMustache($filename, $data);
} | [
"public",
"function",
"renderMustache",
"(",
"$",
"filename",
",",
"$",
"data",
")",
"{",
"// This is for mustache compatibility",
"$",
"data",
"[",
"'getView'",
"]",
"=",
"function",
"(",
"$",
"name",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->... | Attach getView function to the mustache view | [
"Attach",
"getView",
"function",
"to",
"the",
"mustache",
"view"
] | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/View.php#L31-L37 |
Erdiko/core | src/View.php | View.getView | public function getView($filename, $data = null)
{
// $data = ($data === null) ? $this->_data : $data;
return $this->getTemplateFile($this->getTemplateFolder().$filename, $data);
} | php | public function getView($filename, $data = null)
{
// $data = ($data === null) ? $this->_data : $data;
return $this->getTemplateFile($this->getTemplateFolder().$filename, $data);
} | [
"public",
"function",
"getView",
"(",
"$",
"filename",
",",
"$",
"data",
"=",
"null",
")",
"{",
"// $data = ($data === null) ? $this->_data : $data;",
"return",
"$",
"this",
"->",
"getTemplateFile",
"(",
"$",
"this",
"->",
"getTemplateFolder",
"(",
")",
".",
"$"... | Get a view, for nesting views
This is a convenience wrapper for inherited getTemplateFile() method
Notes: expects this sub view to be in the same views folder (or nested below this folder relative to views/). | [
"Get",
"a",
"view",
"for",
"nesting",
"views",
"This",
"is",
"a",
"convenience",
"wrapper",
"for",
"inherited",
"getTemplateFile",
"()",
"method",
"Notes",
":",
"expects",
"this",
"sub",
"view",
"to",
"be",
"in",
"the",
"same",
"views",
"folder",
"(",
"or"... | train | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/View.php#L45-L49 |
stk2k/net-driver | src/NetDriver/Php/PhpNetDriver.php | PhpNetDriver.sendRequest | public function sendRequest(NetDriverHandleInterface $handle, HttpRequest $request)
{
$url = $request->getUrl();
try{
// fire event after received HTTP response
$request = $this->fireOnSendingRequest($request);
// context
$context = [];
... | php | public function sendRequest(NetDriverHandleInterface $handle, HttpRequest $request)
{
$url = $request->getUrl();
try{
// fire event after received HTTP response
$request = $this->fireOnSendingRequest($request);
// context
$context = [];
... | [
"public",
"function",
"sendRequest",
"(",
"NetDriverHandleInterface",
"$",
"handle",
",",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"url",
"=",
"$",
"request",
"->",
"getUrl",
"(",
")",
";",
"try",
"{",
"// fire event after received HTTP response",
"$",
"req... | Send HTTP request
@param NetDriverHandleInterface $handle
@param HttpRequest $request
@return HttpResponse
@throws NetDriverException | [
"Send",
"HTTP",
"request"
] | train | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/Php/PhpNetDriver.php#L37-L111 |
Eresus/EresusCMS | src/core/FS/NameFilter.php | Eresus_FS_NameFilter.setAllowedChars | public function setAllowedChars($pcreCharSet)
{
assert('is_string($pcreCharSet)');
if (@preg_match('/[^' . $pcreCharSet . ']/', '') === false)
{
throw new InvalidArgumentException(
sprintf('"%s" must be a valid PCRE character class (without square brackets)',
... | php | public function setAllowedChars($pcreCharSet)
{
assert('is_string($pcreCharSet)');
if (@preg_match('/[^' . $pcreCharSet . ']/', '') === false)
{
throw new InvalidArgumentException(
sprintf('"%s" must be a valid PCRE character class (without square brackets)',
... | [
"public",
"function",
"setAllowedChars",
"(",
"$",
"pcreCharSet",
")",
"{",
"assert",
"(",
"'is_string($pcreCharSet)'",
")",
";",
"if",
"(",
"@",
"preg_match",
"(",
"'/[^'",
".",
"$",
"pcreCharSet",
".",
"']/'",
",",
"''",
")",
"===",
"false",
")",
"{",
... | Задаёт набор допустимых символов
Набор символов по умолчанию задан в {@link $allowedChars}.
Примеры:
- setAllowedChars('a-z') — только строчные латинские буквы
- setAllowedChars('0-1\-') — только цифры и дефис
@param string $pcreCharSet набор допустимых символов в формате PCRE
@throws InvalidArgumentException ес... | [
"Задаёт",
"набор",
"допустимых",
"символов"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/FS/NameFilter.php#L62-L74 |
scaytrase/websms-php | src/ScayTrase/WebSMS/Connection/AbstractWebSMSConnection.php | AbstractWebSMSConnection.doSendRequest | protected function doSendRequest(MessageInterface $message)
{
$status = $this->driver->doSendRequest(
array(
static::PARAM_Username => $this->username,
static::PARAM_Password => $this->password,
static::PARAM_Test => $this->test,
... | php | protected function doSendRequest(MessageInterface $message)
{
$status = $this->driver->doSendRequest(
array(
static::PARAM_Username => $this->username,
static::PARAM_Password => $this->password,
static::PARAM_Test => $this->test,
... | [
"protected",
"function",
"doSendRequest",
"(",
"MessageInterface",
"$",
"message",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"driver",
"->",
"doSendRequest",
"(",
"array",
"(",
"static",
"::",
"PARAM_Username",
"=>",
"$",
"this",
"->",
"username",
","... | @param MessageInterface $message
@return bool
@throws DeliveryException | [
"@param",
"MessageInterface",
"$message"
] | train | https://github.com/scaytrase/websms-php/blob/afdce1b58cd1bda8a0a0130f8c937bd41b434731/src/ScayTrase/WebSMS/Connection/AbstractWebSMSConnection.php#L69-L92 |
technote-space/wordpress-plugin-base | src/classes/models/lib/input.php | Input.get | public function get( $key = null, $default = null ) {
return func_num_args() === 0 ? $_GET : $this->app->utility->array_get( $_GET, $key, $default );
} | php | public function get( $key = null, $default = null ) {
return func_num_args() === 0 ? $_GET : $this->app->utility->array_get( $_GET, $key, $default );
} | [
"public",
"function",
"get",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"func_num_args",
"(",
")",
"===",
"0",
"?",
"$",
"_GET",
":",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"array_get",
"(",
"$",
... | @param string $key
@param mixed $default
@return mixed | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/input.php#L66-L68 |
technote-space/wordpress-plugin-base | src/classes/models/lib/input.php | Input.post | public function post( $key = null, $default = null ) {
return func_num_args() === 0 ? $_POST : $this->app->utility->array_get( $_POST, $key, $default );
} | php | public function post( $key = null, $default = null ) {
return func_num_args() === 0 ? $_POST : $this->app->utility->array_get( $_POST, $key, $default );
} | [
"public",
"function",
"post",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"func_num_args",
"(",
")",
"===",
"0",
"?",
"$",
"_POST",
":",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"array_get",
"(",
"$",... | @param string $key
@param mixed $default
@return mixed | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/input.php#L76-L78 |
technote-space/wordpress-plugin-base | src/classes/models/lib/input.php | Input.request | public function request( $key = null, $default = null ) {
return func_num_args() === 0 ? $_REQUEST : $this->app->utility->array_get( $_REQUEST, $key, $default );
} | php | public function request( $key = null, $default = null ) {
return func_num_args() === 0 ? $_REQUEST : $this->app->utility->array_get( $_REQUEST, $key, $default );
} | [
"public",
"function",
"request",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"func_num_args",
"(",
")",
"===",
"0",
"?",
"$",
"_REQUEST",
":",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"array_get",
"(",
... | @param string $key
@param mixed $default
@return mixed | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/input.php#L86-L88 |
technote-space/wordpress-plugin-base | src/classes/models/lib/input.php | Input.file | public function file( $key = null, $default = null ) {
return func_num_args() === 0 ? $_FILES : $this->app->utility->array_get( $_FILES, $key, $default );
} | php | public function file( $key = null, $default = null ) {
return func_num_args() === 0 ? $_FILES : $this->app->utility->array_get( $_FILES, $key, $default );
} | [
"public",
"function",
"file",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"func_num_args",
"(",
")",
"===",
"0",
"?",
"$",
"_FILES",
":",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"array_get",
"(",
"$"... | @param string $key
@param mixed $default
@return mixed | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/input.php#L96-L98 |
technote-space/wordpress-plugin-base | src/classes/models/lib/input.php | Input.cookie | public function cookie( $key = null, $default = null ) {
return func_num_args() === 0 ? $_COOKIE : $this->app->utility->array_get( $_COOKIE, $key, $default );
} | php | public function cookie( $key = null, $default = null ) {
return func_num_args() === 0 ? $_COOKIE : $this->app->utility->array_get( $_COOKIE, $key, $default );
} | [
"public",
"function",
"cookie",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"func_num_args",
"(",
")",
"===",
"0",
"?",
"$",
"_COOKIE",
":",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"array_get",
"(",
... | @param string $key
@param mixed $default
@return mixed | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/input.php#L106-L108 |
technote-space/wordpress-plugin-base | src/classes/models/lib/input.php | Input.server | public function server( $key = null, $default = null ) {
return func_num_args() === 0 ? $_SERVER : $this->app->utility->array_get( $_SERVER, strtoupper( $key ), $default );
} | php | public function server( $key = null, $default = null ) {
return func_num_args() === 0 ? $_SERVER : $this->app->utility->array_get( $_SERVER, strtoupper( $key ), $default );
} | [
"public",
"function",
"server",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"func_num_args",
"(",
")",
"===",
"0",
"?",
"$",
"_SERVER",
":",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"array_get",
"(",
... | @param string $key
@param mixed $default
@return mixed | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/input.php#L116-L118 |
technote-space/wordpress-plugin-base | src/classes/models/lib/input.php | Input.get_current_url | public function get_current_url( $args = [] ) {
$url = $this->get_current_host() . $this->get_current_path();
if ( ! empty( $args ) ) {
$url = add_query_arg( $args, $url );
}
return $url;
} | php | public function get_current_url( $args = [] ) {
$url = $this->get_current_host() . $this->get_current_path();
if ( ! empty( $args ) ) {
$url = add_query_arg( $args, $url );
}
return $url;
} | [
"public",
"function",
"get_current_url",
"(",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"get_current_host",
"(",
")",
".",
"$",
"this",
"->",
"get_current_path",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"arg... | @param array $args
@return string | [
"@param",
"array",
"$args"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/input.php#L173-L180 |
PayBreak/foundation | src/Decision/Condition/AbstractCondition.php | AbstractCondition.availableTypes | public static function availableTypes()
{
return [
self::CONDITION_EQUAL,
self::CONDITION_NOT_EQUAL,
self::CONDITION_GREATER_THAN,
self::CONDITION_LESS_THAN,
self::CONDITION_GREATER_THAN_OR_EQUAL_TO,
self::CONDITION_LESS_THAN_OR_EQUAL_T... | php | public static function availableTypes()
{
return [
self::CONDITION_EQUAL,
self::CONDITION_NOT_EQUAL,
self::CONDITION_GREATER_THAN,
self::CONDITION_LESS_THAN,
self::CONDITION_GREATER_THAN_OR_EQUAL_TO,
self::CONDITION_LESS_THAN_OR_EQUAL_T... | [
"public",
"static",
"function",
"availableTypes",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"CONDITION_EQUAL",
",",
"self",
"::",
"CONDITION_NOT_EQUAL",
",",
"self",
"::",
"CONDITION_GREATER_THAN",
",",
"self",
"::",
"CONDITION_LESS_THAN",
",",
"self",
"::",
"... | All Available ConditionInterface Types
@return array | [
"All",
"Available",
"ConditionInterface",
"Types"
] | train | https://github.com/PayBreak/foundation/blob/3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4/src/Decision/Condition/AbstractCondition.php#L166-L179 |
eghojansu/moe | src/Silet.php | Silet.render | function render($file,$mime='text/html',array $hive=NULL,$ttl=0) {
$fw=Base::instance();
$cache=Cache::instance();
if (!is_dir($tmp=$fw->get('TEMP')))
mkdir($tmp,Base::MODE,TRUE);
foreach ($fw->split($fw->get('UI')) as $dir) {
$cached=$cache->exists($hash=$fw->has... | php | function render($file,$mime='text/html',array $hive=NULL,$ttl=0) {
$fw=Base::instance();
$cache=Cache::instance();
if (!is_dir($tmp=$fw->get('TEMP')))
mkdir($tmp,Base::MODE,TRUE);
foreach ($fw->split($fw->get('UI')) as $dir) {
$cached=$cache->exists($hash=$fw->has... | [
"function",
"render",
"(",
"$",
"file",
",",
"$",
"mime",
"=",
"'text/html'",
",",
"array",
"$",
"hive",
"=",
"NULL",
",",
"$",
"ttl",
"=",
"0",
")",
"{",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"$",
"cache",
"=",
"Cache",
"::"... | Render template
@return string
@param $file string
@param $mime string
@param $hive array
@param $ttl int | [
"Render",
"template"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L48-L86 |
eghojansu/moe | src/Silet.php | Silet.esc | function esc($arg) {
$fw=Base::instance();
return $fw->recursive($arg,
function($val) use($fw) {
return is_string($val)?$fw->encode($val):$val;
}
);
} | php | function esc($arg) {
$fw=Base::instance();
return $fw->recursive($arg,
function($val) use($fw) {
return is_string($val)?$fw->encode($val):$val;
}
);
} | [
"function",
"esc",
"(",
"$",
"arg",
")",
"{",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"return",
"$",
"fw",
"->",
"recursive",
"(",
"$",
"arg",
",",
"function",
"(",
"$",
"val",
")",
"use",
"(",
"$",
"fw",
")",
"{",
"return",
... | Encode characters to equivalent HTML entities
@return string
@param $arg mixed | [
"Encode",
"characters",
"to",
"equivalent",
"HTML",
"entities"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L93-L100 |
eghojansu/moe | src/Silet.php | Silet.raw | function raw($arg) {
$fw=Base::instance();
return $fw->recursive($arg,
function($val) use($fw) {
return is_string($val)?$fw->decode($val):$val;
}
);
} | php | function raw($arg) {
$fw=Base::instance();
return $fw->recursive($arg,
function($val) use($fw) {
return is_string($val)?$fw->decode($val):$val;
}
);
} | [
"function",
"raw",
"(",
"$",
"arg",
")",
"{",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"return",
"$",
"fw",
"->",
"recursive",
"(",
"$",
"arg",
",",
"function",
"(",
"$",
"val",
")",
"use",
"(",
"$",
"fw",
")",
"{",
"return",
... | Decode HTML entities to equivalent characters
@return string
@param $arg mixed | [
"Decode",
"HTML",
"entities",
"to",
"equivalent",
"characters"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L107-L114 |
eghojansu/moe | src/Silet.php | Silet.filter | function filter($key=NULL,$func=NULL) {
if (!$key)
return array_keys($this->filter);
if (!$func)
return $this->filter[$key];
$this->filter[$key]=$func;
} | php | function filter($key=NULL,$func=NULL) {
if (!$key)
return array_keys($this->filter);
if (!$func)
return $this->filter[$key];
$this->filter[$key]=$func;
} | [
"function",
"filter",
"(",
"$",
"key",
"=",
"NULL",
",",
"$",
"func",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"key",
")",
"return",
"array_keys",
"(",
"$",
"this",
"->",
"filter",
")",
";",
"if",
"(",
"!",
"$",
"func",
")",
"return",
"$",
... | register token filter
@param string $key
@param string $func
@return array | [
"register",
"token",
"filter"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L132-L138 |
eghojansu/moe | src/Silet.php | Silet._include | protected function _include(array $node) {
$attrib=$node['@attrib'];
$hive='get_defined_vars()';
$if = false;
$include = $attrib[0];
if (isset($attrib[1]) && strpos($attrib[0], 'if ')) {
$if = substr($attrib[0], 3);
$include = $attrib[1];
}
... | php | protected function _include(array $node) {
$attrib=$node['@attrib'];
$hive='get_defined_vars()';
$if = false;
$include = $attrib[0];
if (isset($attrib[1]) && strpos($attrib[0], 'if ')) {
$if = substr($attrib[0], 3);
$include = $attrib[1];
}
... | [
"protected",
"function",
"_include",
"(",
"array",
"$",
"node",
")",
"{",
"$",
"attrib",
"=",
"$",
"node",
"[",
"'@attrib'",
"]",
";",
"$",
"hive",
"=",
"'get_defined_vars()'",
";",
"$",
"if",
"=",
"false",
";",
"$",
"include",
"=",
"$",
"attrib",
"[... | Template -include- tag handler
@return string
@param $node array | [
"Template",
"-",
"include",
"-",
"tag",
"handler"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L261-L279 |
eghojansu/moe | src/Silet.php | Silet.buildString | protected function buildString($node) {
$self=$this;
return preg_replace_callback(
'/\{\-(.+?)\-\}|\{\{(.+?)\}\}(\n+)?/s',
function($expr) use($self) {
if ($expr[1])
return $expr[1];
$str=trim($self->token($expr[2]));
... | php | protected function buildString($node) {
$self=$this;
return preg_replace_callback(
'/\{\-(.+?)\-\}|\{\{(.+?)\}\}(\n+)?/s',
function($expr) use($self) {
if ($expr[1])
return $expr[1];
$str=trim($self->token($expr[2]));
... | [
"protected",
"function",
"buildString",
"(",
"$",
"node",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"return",
"preg_replace_callback",
"(",
"'/\\{\\-(.+?)\\-\\}|\\{\\{(.+?)\\}\\}(\\n+)?/s'",
",",
"function",
"(",
"$",
"expr",
")",
"use",
"(",
"$",
"self",
... | Assemble markup
@return string
@param $node string | [
"Assemble",
"markup"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L301-L327 |
eghojansu/moe | src/Silet.php | Silet.parse | protected function parse($text) {
// Build tree structure
$in = array();
for ($ptr=0,$len=strlen($text),$tree=array(),$node=&$tree,
$stack=array(),$depth=0,$tmp='';$ptr<$len;)
if (preg_match('/^@(end)?('.$this->tags.')\b(.*)/i', substr($text,$ptr),$match)) {
... | php | protected function parse($text) {
// Build tree structure
$in = array();
for ($ptr=0,$len=strlen($text),$tree=array(),$node=&$tree,
$stack=array(),$depth=0,$tmp='';$ptr<$len;)
if (preg_match('/^@(end)?('.$this->tags.')\b(.*)/i', substr($text,$ptr),$match)) {
... | [
"protected",
"function",
"parse",
"(",
"$",
"text",
")",
"{",
"// Build tree structure",
"$",
"in",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"ptr",
"=",
"0",
",",
"$",
"len",
"=",
"strlen",
"(",
"$",
"text",
")",
",",
"$",
"tree",
"=",
"arra... | Parse string for template directives and tokens
@return string|array
@param $text string | [
"Parse",
"string",
"for",
"template",
"directives",
"and",
"tokens"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L334-L399 |
eghojansu/moe | src/Silet.php | Silet.sandbox | protected function sandbox(array $hive=NULL) {
$this->level++;
$fw=Base::instance();
$implicit=false;
if ($hive === null) {
$implicit=true;
$hive=$fw->hive();
}
if ($this->level<2 || $implicit) {
if ($fw->get('ESCAPE'))
... | php | protected function sandbox(array $hive=NULL) {
$this->level++;
$fw=Base::instance();
$implicit=false;
if ($hive === null) {
$implicit=true;
$hive=$fw->hive();
}
if ($this->level<2 || $implicit) {
if ($fw->get('ESCAPE'))
... | [
"protected",
"function",
"sandbox",
"(",
"array",
"$",
"hive",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"level",
"++",
";",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"$",
"implicit",
"=",
"false",
";",
"if",
"(",
"$",
"hive",
"===... | Create sandbox for template execution
@return string
@param $hive array | [
"Create",
"sandbox",
"for",
"template",
"execution"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L432-L453 |
alevilar/ristorantino-vendor | Printers/Controller/AfipFacturasController.php | AfipFacturasController.index | public function index() {
$this->AfipFactura->recursive = 0;
$this->AfipFactura->contain(array(
'Mesa' => array(
'Cliente' => array(
'TipoDocumento',
'IvaResponsabilidad'
),
'Mozo'
)
));
$this->set('afipFacturas', $this->Paginator->paginate());
} | php | public function index() {
$this->AfipFactura->recursive = 0;
$this->AfipFactura->contain(array(
'Mesa' => array(
'Cliente' => array(
'TipoDocumento',
'IvaResponsabilidad'
),
'Mozo'
)
));
$this->set('afipFacturas', $this->Paginator->paginate());
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"AfipFactura",
"->",
"recursive",
"=",
"0",
";",
"$",
"this",
"->",
"AfipFactura",
"->",
"contain",
"(",
"array",
"(",
"'Mesa'",
"=>",
"array",
"(",
"'Cliente'",
"=>",
"array",
"(",
"'Tip... | index method
@return void | [
"index",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Controller/AfipFacturasController.php#L44-L57 |
alevilar/ristorantino-vendor | Printers/Controller/AfipFacturasController.php | AfipFacturasController.view | public function view($id = null) {
$this->layout = 'Printers.factura';
if (!$this->AfipFactura->exists($id)) {
throw new NotFoundException(__('Factura inexistente'));
}
$options = array(
'conditions' => array(
'AfipFactura.' . $this->AfipFactura->primaryKey => $id
),
'contain' => array(
'... | php | public function view($id = null) {
$this->layout = 'Printers.factura';
if (!$this->AfipFactura->exists($id)) {
throw new NotFoundException(__('Factura inexistente'));
}
$options = array(
'conditions' => array(
'AfipFactura.' . $this->AfipFactura->primaryKey => $id
),
'contain' => array(
'... | [
"public",
"function",
"view",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"layout",
"=",
"'Printers.factura'",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"AfipFactura",
"->",
"exists",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"NotF... | view method
@throws NotFoundException
@param string $id
@return void | [
"view",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Controller/AfipFacturasController.php#L66-L81 |
alevilar/ristorantino-vendor | Printers/Controller/AfipFacturasController.php | AfipFacturasController.add | public function add() {
if ($this->request->is('post')) {
$this->AfipFactura->create();
if ($this->AfipFactura->save($this->request->data)) {
$this->Session->setFlash(__('The afip factura has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__(... | php | public function add() {
if ($this->request->is('post')) {
$this->AfipFactura->create();
if ($this->AfipFactura->save($this->request->data)) {
$this->Session->setFlash(__('The afip factura has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__(... | [
"public",
"function",
"add",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"is",
"(",
"'post'",
")",
")",
"{",
"$",
"this",
"->",
"AfipFactura",
"->",
"create",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"AfipFactura",
"->",
"sa... | add method
@return void | [
"add",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Controller/AfipFacturasController.php#L88-L100 |
alevilar/ristorantino-vendor | Printers/Controller/AfipFacturasController.php | AfipFacturasController.edit | public function edit($id = null) {
if (!$this->AfipFactura->exists($id)) {
throw new NotFoundException(__('Invalid afip factura'));
}
if ($this->request->is(array('post', 'put'))) {
if ($this->AfipFactura->save($this->request->data)) {
$this->Session->setFlash(__('The afip factura has been saved.'));
... | php | public function edit($id = null) {
if (!$this->AfipFactura->exists($id)) {
throw new NotFoundException(__('Invalid afip factura'));
}
if ($this->request->is(array('post', 'put'))) {
if ($this->AfipFactura->save($this->request->data)) {
$this->Session->setFlash(__('The afip factura has been saved.'));
... | [
"public",
"function",
"edit",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"AfipFactura",
"->",
"exists",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"NotFoundException",
"(",
"__",
"(",
"'Invalid afip factura'",
")",
... | edit method
@throws NotFoundException
@param string $id
@return void | [
"edit",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Controller/AfipFacturasController.php#L109-L126 |
alevilar/ristorantino-vendor | Printers/Controller/AfipFacturasController.php | AfipFacturasController.delete | public function delete($id = null) {
$this->AfipFactura->id = $id;
if (!$this->AfipFactura->exists()) {
throw new NotFoundException(__('Invalid afip factura'));
}
$this->request->allowMethod('post', 'delete');
if ($this->AfipFactura->delete()) {
$this->Session->setFlash(__('The afip factura has been del... | php | public function delete($id = null) {
$this->AfipFactura->id = $id;
if (!$this->AfipFactura->exists()) {
throw new NotFoundException(__('Invalid afip factura'));
}
$this->request->allowMethod('post', 'delete');
if ($this->AfipFactura->delete()) {
$this->Session->setFlash(__('The afip factura has been del... | [
"public",
"function",
"delete",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"AfipFactura",
"->",
"id",
"=",
"$",
"id",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"AfipFactura",
"->",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"NotFo... | delete method
@throws NotFoundException
@param string $id
@return void | [
"delete",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Controller/AfipFacturasController.php#L135-L147 |
tttptd/laravel-responder | src/Traits/MakesApiRequests.php | MakesApiRequests.seeSuccess | protected function seeSuccess($data = null, $status = 200)
{
$response = $this->seeSuccessResponse($data, $status);
$this->seeSuccessData($response->getData(true)['data']);
return $this;
} | php | protected function seeSuccess($data = null, $status = 200)
{
$response = $this->seeSuccessResponse($data, $status);
$this->seeSuccessData($response->getData(true)['data']);
return $this;
} | [
"protected",
"function",
"seeSuccess",
"(",
"$",
"data",
"=",
"null",
",",
"$",
"status",
"=",
"200",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"seeSuccessResponse",
"(",
"$",
"data",
",",
"$",
"status",
")",
";",
"$",
"this",
"->",
"seeSucc... | Assert that the response is a valid success response.
@param mixed $data
@param int $status
@return $this | [
"Assert",
"that",
"the",
"response",
"is",
"a",
"valid",
"success",
"response",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/MakesApiRequests.php#L25-L31 |
tttptd/laravel-responder | src/Traits/MakesApiRequests.php | MakesApiRequests.seeSuccessEquals | protected function seeSuccessEquals($data = null, $status = 200)
{
$response = $this->seeSuccessResponse($data, $status);
$this->seeJsonEquals($response->getData(true));
return $this;
} | php | protected function seeSuccessEquals($data = null, $status = 200)
{
$response = $this->seeSuccessResponse($data, $status);
$this->seeJsonEquals($response->getData(true));
return $this;
} | [
"protected",
"function",
"seeSuccessEquals",
"(",
"$",
"data",
"=",
"null",
",",
"$",
"status",
"=",
"200",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"seeSuccessResponse",
"(",
"$",
"data",
",",
"$",
"status",
")",
";",
"$",
"this",
"->",
"s... | Assert that the response is a valid success response.
@param mixed $data
@param int $status
@return $this | [
"Assert",
"that",
"the",
"response",
"is",
"a",
"valid",
"success",
"response",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/MakesApiRequests.php#L40-L46 |
tttptd/laravel-responder | src/Traits/MakesApiRequests.php | MakesApiRequests.seeSuccessResponse | protected function seeSuccessResponse($data = null, $status = 200):JsonResponse
{
$response = app(Responder::class)->success($data, $status);
$this->seeStatusCode($response->getStatusCode())->seeJson([
'success' => true,
'status' => $response->getStatusCode()
])->see... | php | protected function seeSuccessResponse($data = null, $status = 200):JsonResponse
{
$response = app(Responder::class)->success($data, $status);
$this->seeStatusCode($response->getStatusCode())->seeJson([
'success' => true,
'status' => $response->getStatusCode()
])->see... | [
"protected",
"function",
"seeSuccessResponse",
"(",
"$",
"data",
"=",
"null",
",",
"$",
"status",
"=",
"200",
")",
":",
"JsonResponse",
"{",
"$",
"response",
"=",
"app",
"(",
"Responder",
"::",
"class",
")",
"->",
"success",
"(",
"$",
"data",
",",
"$",... | Assert that the response is a valid success response.
@param mixed $data
@param int $status
@return JsonResponse | [
"Assert",
"that",
"the",
"response",
"is",
"a",
"valid",
"success",
"response",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/MakesApiRequests.php#L70-L80 |
tttptd/laravel-responder | src/Traits/MakesApiRequests.php | MakesApiRequests.seeSuccessData | protected function seeSuccessData($data = null)
{
collect($data)->each(function ($value, $key) {
if (is_array($value)) {
$this->seeSuccessData($value);
} else {
$this->seeJson([$key => $value]);
}
});
return $this;
} | php | protected function seeSuccessData($data = null)
{
collect($data)->each(function ($value, $key) {
if (is_array($value)) {
$this->seeSuccessData($value);
} else {
$this->seeJson([$key => $value]);
}
});
return $this;
} | [
"protected",
"function",
"seeSuccessData",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"collect",
"(",
"$",
"data",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
... | Assert that the response data contains given values.
@param mixed $data
@return $this | [
"Assert",
"that",
"the",
"response",
"data",
"contains",
"given",
"values",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/MakesApiRequests.php#L88-L99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.