id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,800 | teneleven/GeolocatorBundle | Controller/GeolocatorController.php | GeolocatorController.buildMap | protected function buildMap($template, Search $result)
{
$map = $this->getMap();
if (!$result->hasResults()) { //in case of no result we center on the searched location
$map->setCenter(
new Coordinate(
$result->getCenter()->getLatitude(),
... | php | protected function buildMap($template, Search $result)
{
$map = $this->getMap();
if (!$result->hasResults()) { //in case of no result we center on the searched location
$map->setCenter(
new Coordinate(
$result->getCenter()->getLatitude(),
... | [
"protected",
"function",
"buildMap",
"(",
"$",
"template",
",",
"Search",
"$",
"result",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"getMap",
"(",
")",
";",
"if",
"(",
"!",
"$",
"result",
"->",
"hasResults",
"(",
")",
")",
"{",
"//in case of no re... | Builds a map of locations
@param string $template
@param Search $result
@return \Ivory\GoogleMap\Map | [
"Builds",
"a",
"map",
"of",
"locations"
] | 4ead8e783a91577f2a67aa302b79641d4b9e99ad | https://github.com/teneleven/GeolocatorBundle/blob/4ead8e783a91577f2a67aa302b79641d4b9e99ad/Controller/GeolocatorController.php#L108-L157 |
19,801 | arsengoian/viper-framework | src/Viper/Core/Model/DB/MySQL/Types/StringType.php | StringType.validate | public function validate ($value): void
{
switch ($this -> sqlType) {
case 'ENUM':
case 'SET':
// Not implemented;
break;
default:
$common = self::TYPES[$this -> sqlType];
if (!$this -> size)
... | php | public function validate ($value): void
{
switch ($this -> sqlType) {
case 'ENUM':
case 'SET':
// Not implemented;
break;
default:
$common = self::TYPES[$this -> sqlType];
if (!$this -> size)
... | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
":",
"void",
"{",
"switch",
"(",
"$",
"this",
"->",
"sqlType",
")",
"{",
"case",
"'ENUM'",
":",
"case",
"'SET'",
":",
"// Not implemented;",
"break",
";",
"default",
":",
"$",
"common",
"=",
"se... | Checks if the type is correspondent | [
"Checks",
"if",
"the",
"type",
"is",
"correspondent"
] | 22796c5cc219cae3ca0b4af370a347ba2acab0f2 | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Core/Model/DB/MySQL/Types/StringType.php#L36-L51 |
19,802 | 2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderNavigation | protected function renderNavigation()
{
$nav = array();
if (!empty($this->wrapperOptions)) {
$nav[] = \CHtml::openTag('div', $this->wrapperOptions);
}
$nav[] = \CHtml::openTag('nav', $this->htmlOptions);
$nav[] = $this->renderTitle();
$nav[] = $this->rende... | php | protected function renderNavigation()
{
$nav = array();
if (!empty($this->wrapperOptions)) {
$nav[] = \CHtml::openTag('div', $this->wrapperOptions);
}
$nav[] = \CHtml::openTag('nav', $this->htmlOptions);
$nav[] = $this->renderTitle();
$nav[] = $this->rende... | [
"protected",
"function",
"renderNavigation",
"(",
")",
"{",
"$",
"nav",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"wrapperOptions",
")",
")",
"{",
"$",
"nav",
"[",
"]",
"=",
"\\",
"CHtml",
"::",
"openTag",
"(",
... | Renders the navigation | [
"Renders",
"the",
"navigation"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L168-L183 |
19,803 | 2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderTitle | protected function renderTitle()
{
$items = array();
$title = \CHtml::tag('h1', array(), \CHtml::link($this->title, $this->titleUrl, $this->titleOptions));
$items[] = \CHtml::tag('li', array('class' => 'name'), $title);
$items[] = \CHtml::tag(
'li',
array(... | php | protected function renderTitle()
{
$items = array();
$title = \CHtml::tag('h1', array(), \CHtml::link($this->title, $this->titleUrl, $this->titleOptions));
$items[] = \CHtml::tag('li', array('class' => 'name'), $title);
$items[] = \CHtml::tag(
'li',
array(... | [
"protected",
"function",
"renderTitle",
"(",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"$",
"title",
"=",
"\\",
"CHtml",
"::",
"tag",
"(",
"'h1'",
",",
"array",
"(",
")",
",",
"\\",
"CHtml",
"::",
"link",
"(",
"$",
"this",
"->",
"title... | Renders the title of navigation
@return string | [
"Renders",
"the",
"title",
"of",
"navigation"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L189-L200 |
19,804 | 2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderItems | protected function renderItems()
{
$items = array();
if (!empty($this->leftItems)) {
$tItems = array();
foreach ($this->leftItems as $item) {
$tItems[] = $this->renderItem($item);
}
$items[] = \CHtml::openTag('ul', array('class' => Enum... | php | protected function renderItems()
{
$items = array();
if (!empty($this->leftItems)) {
$tItems = array();
foreach ($this->leftItems as $item) {
$tItems[] = $this->renderItem($item);
}
$items[] = \CHtml::openTag('ul', array('class' => Enum... | [
"protected",
"function",
"renderItems",
"(",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"leftItems",
")",
")",
"{",
"$",
"tItems",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this"... | Renders widget's items.
@return string | [
"Renders",
"widget",
"s",
"items",
"."
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L206-L235 |
19,805 | 2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderItem | protected function renderItem($item)
{
if (is_string($item)) {
return $item;
}
if (!isset($item['label'])) {
throw new InvalidConfigException("The 'label' option is required.");
}
$label = $this->encodeLabels ? \CHtml::encode($item['label']) : $i... | php | protected function renderItem($item)
{
if (is_string($item)) {
return $item;
}
if (!isset($item['label'])) {
throw new InvalidConfigException("The 'label' option is required.");
}
$label = $this->encodeLabels ? \CHtml::encode($item['label']) : $i... | [
"protected",
"function",
"renderItem",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"item",
")",
")",
"{",
"return",
"$",
"item",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"item",
"[",
"'label'",
"]",
")",
")",
"{",
"throw",
... | Renders a widget's item
@param mixed $item the item to render
@return string the rendering result.
@throws InvalidConfigException | [
"Renders",
"a",
"widget",
"s",
"item"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L243-L269 |
19,806 | afrittella/back-project | src/app/Http/ViewComposers/AdminMenuComposer.php | AdminMenuComposer.menu | function menu($menus)
{
// Retrieve current user (for permissions)
$user = Auth::user();
$templates = [
"menu" => '
<ul class="sidebar-menu" data-widget="tree">
%s
</ul>
',
"menu_row" => '
<li class="%s">... | php | function menu($menus)
{
// Retrieve current user (for permissions)
$user = Auth::user();
$templates = [
"menu" => '
<ul class="sidebar-menu" data-widget="tree">
%s
</ul>
',
"menu_row" => '
<li class="%s">... | [
"function",
"menu",
"(",
"$",
"menus",
")",
"{",
"// Retrieve current user (for permissions)",
"$",
"user",
"=",
"Auth",
"::",
"user",
"(",
")",
";",
"$",
"templates",
"=",
"[",
"\"menu\"",
"=>",
"'\n <ul class=\"sidebar-menu\" data-widget=\"tree\">\n ... | Format an AdminLTE Menu
$menus must be formatted in this way:
Menu
children
children
@param array $menus
@return string | [
"Format",
"an",
"AdminLTE",
"Menu"
] | e1aa2e3ee03d453033f75a4b16f073c60b5f32d1 | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Http/ViewComposers/AdminMenuComposer.php#L39-L119 |
19,807 | xinix-technology/norm | src/Norm/Cursor/OCICursor.php | OCICursor.prepareCriteria | public function prepareCriteria($criteria)
{
if (is_null($criteria)) {
$criteria = array();
}
if (array_key_exists('$id', $criteria)) {
$criteria['id'] = $criteria['$id'];
unset($criteria['$id']);
}
return $criteria ? : array();
} | php | public function prepareCriteria($criteria)
{
if (is_null($criteria)) {
$criteria = array();
}
if (array_key_exists('$id', $criteria)) {
$criteria['id'] = $criteria['$id'];
unset($criteria['$id']);
}
return $criteria ? : array();
} | [
"public",
"function",
"prepareCriteria",
"(",
"$",
"criteria",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"criteria",
")",
")",
"{",
"$",
"criteria",
"=",
"array",
"(",
")",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"'$id'",
",",
"$",
"criteria",
... | comment for other criteria | [
"comment",
"for",
"other",
"criteria"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/OCICursor.php#L244-L256 |
19,808 | xinix-technology/norm | src/Norm/Cursor/OCICursor.php | OCICursor.getQueryReference | public function getQueryReference($key = '', $foreign = '', $foreignLabel = '', $foreignKey = '', &$i)
{
$model = Norm::factory($foreign);
$refSchemes = $model->schema();
$foreignKey = $foreignKey ?: 'id';
if ($foreignKey == '$id') {
$foreignKey = 'id';
}
... | php | public function getQueryReference($key = '', $foreign = '', $foreignLabel = '', $foreignKey = '', &$i)
{
$model = Norm::factory($foreign);
$refSchemes = $model->schema();
$foreignKey = $foreignKey ?: 'id';
if ($foreignKey == '$id') {
$foreignKey = 'id';
}
... | [
"public",
"function",
"getQueryReference",
"(",
"$",
"key",
"=",
"''",
",",
"$",
"foreign",
"=",
"''",
",",
"$",
"foreignLabel",
"=",
"''",
",",
"$",
"foreignKey",
"=",
"''",
",",
"&",
"$",
"i",
")",
"{",
"$",
"model",
"=",
"Norm",
"::",
"factory",... | Find reference of a foreign key.
@param string $key
@param string $foreign
@param string $foreignLabel
@param string $foreignKey
@param int &$i
@return string | [
"Find",
"reference",
"of",
"a",
"foreign",
"key",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/OCICursor.php#L450-L464 |
19,809 | webforge-labs/psc-cms | lib/Psc/System/File.php | File.replaceContents | public function replaceContents(Array $replacements) {
$this->writeContents(
str_replace(
array_keys($replacements),
array_values($replacements),
$this->getContents()
)
);
return $this;
} | php | public function replaceContents(Array $replacements) {
$this->writeContents(
str_replace(
array_keys($replacements),
array_values($replacements),
$this->getContents()
)
);
return $this;
} | [
"public",
"function",
"replaceContents",
"(",
"Array",
"$",
"replacements",
")",
"{",
"$",
"this",
"->",
"writeContents",
"(",
"str_replace",
"(",
"array_keys",
"(",
"$",
"replacements",
")",
",",
"array_values",
"(",
"$",
"replacements",
")",
",",
"$",
"thi... | Replaces the contents of the file
@deprecated | [
"Replaces",
"the",
"contents",
"of",
"the",
"file"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/System/File.php#L11-L20 |
19,810 | askupasoftware/amarkal | Extensions/WordPress/Widget/Widget.php | Widget.set_field_names | private function set_field_names()
{
foreach ( $this->config->fields as $field )
{
$field->init_name = $field->name;
}
} | php | private function set_field_names()
{
foreach ( $this->config->fields as $field )
{
$field->init_name = $field->name;
}
} | [
"private",
"function",
"set_field_names",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"field",
"->",
"init_name",
"=",
"$",
"field",
"->",
"name",
";",
"}",
"}"
] | Since the widget's form sets custom names and ids to each field,
the original field name must be stored seperately using this function. | [
"Since",
"the",
"widget",
"s",
"form",
"sets",
"custom",
"names",
"and",
"ids",
"to",
"each",
"field",
"the",
"original",
"field",
"name",
"must",
"be",
"stored",
"seperately",
"using",
"this",
"function",
"."
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Widget/Widget.php#L85-L91 |
19,811 | askupasoftware/amarkal | Extensions/WordPress/Widget/Widget.php | Widget.form | public function form( $instance )
{
// Reset the names so that the form's update function works properly
foreach ( $this->config->fields as $field )
{
$field->name = $field->init_name;
}
// Update values
$this->form->updater->set_new_instance( $instance )... | php | public function form( $instance )
{
// Reset the names so that the form's update function works properly
foreach ( $this->config->fields as $field )
{
$field->name = $field->init_name;
}
// Update values
$this->form->updater->set_new_instance( $instance )... | [
"public",
"function",
"form",
"(",
"$",
"instance",
")",
"{",
"// Reset the names so that the form's update function works properly",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"field",
"->",
"name",
"=",
"$",... | Generates the administration form for the widget
@param array $instance The array of keys and
values for the widget | [
"Generates",
"the",
"administration",
"form",
"for",
"the",
"widget"
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Widget/Widget.php#L99-L119 |
19,812 | askupasoftware/amarkal | Extensions/WordPress/Widget/Widget.php | Widget.update | public function update( $new_instance, $old_instance )
{
$this->form->updater->set_new_instance( $new_instance );
return $this->form->updater->update( $old_instance );
} | php | public function update( $new_instance, $old_instance )
{
$this->form->updater->set_new_instance( $new_instance );
return $this->form->updater->update( $old_instance );
} | [
"public",
"function",
"update",
"(",
"$",
"new_instance",
",",
"$",
"old_instance",
")",
"{",
"$",
"this",
"->",
"form",
"->",
"updater",
"->",
"set_new_instance",
"(",
"$",
"new_instance",
")",
";",
"return",
"$",
"this",
"->",
"form",
"->",
"updater",
... | Processes the widget's options to be saved.
@param array new_instance The previous instance
of values before the update.
@param array old_instance The new instance of
values to be generated via the update. | [
"Processes",
"the",
"widget",
"s",
"options",
"to",
"be",
"saved",
"."
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Widget/Widget.php#L129-L133 |
19,813 | askupasoftware/amarkal | Form/Form.php | Form.validate_components | private function validate_components( $components )
{
foreach( $components as $component )
{
if( ! $component instanceof UI\AbstractComponent )
{
throw new WrongTypeException( \gettype( $component ) );
}
if( $component inst... | php | private function validate_components( $components )
{
foreach( $components as $component )
{
if( ! $component instanceof UI\AbstractComponent )
{
throw new WrongTypeException( \gettype( $component ) );
}
if( $component inst... | [
"private",
"function",
"validate_components",
"(",
"$",
"components",
")",
"{",
"foreach",
"(",
"$",
"components",
"as",
"$",
"component",
")",
"{",
"if",
"(",
"!",
"$",
"component",
"instanceof",
"UI",
"\\",
"AbstractComponent",
")",
"{",
"throw",
"new",
... | Internally used to validate each form component.
@param \Amarkal\UI\AbstractComponent[] $components
@throws \Amarkal\Form\DuplicateNameException | [
"Internally",
"used",
"to",
"validate",
"each",
"form",
"component",
"."
] | fe8283e2d6847ef697abec832da7ee741a85058c | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Form.php#L42-L64 |
19,814 | digitalkaoz/versioneye-php | src/Console/CommandFactory.php | CommandFactory.generateCommands | public function generateCommands(array $classes = [])
{
$classes = $this->readApis($classes);
$token = $this->token->read();
$commands = [];
foreach ($classes as $class) {
$api = new \ReflectionClass($class);
foreach ($api->getMethods(\ReflectionMethod::... | php | public function generateCommands(array $classes = [])
{
$classes = $this->readApis($classes);
$token = $this->token->read();
$commands = [];
foreach ($classes as $class) {
$api = new \ReflectionClass($class);
foreach ($api->getMethods(\ReflectionMethod::... | [
"public",
"function",
"generateCommands",
"(",
"array",
"$",
"classes",
"=",
"[",
"]",
")",
"{",
"$",
"classes",
"=",
"$",
"this",
"->",
"readApis",
"(",
"$",
"classes",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"token",
"->",
"read",
"(",
")... | generates Commands from all Api Methods.
@param array $classes
@return Command[] | [
"generates",
"Commands",
"from",
"all",
"Api",
"Methods",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Console/CommandFactory.php#L48-L66 |
19,815 | digitalkaoz/versioneye-php | src/Console/CommandFactory.php | CommandFactory.buildDefinition | private function buildDefinition(\ReflectionMethod $method, $token = null)
{
$definition = new InputDefinition();
foreach ($method->getParameters() as $parameter) {
if ($parameter->isDefaultValueAvailable()) {
//option
$definition->addOption(new InputOpti... | php | private function buildDefinition(\ReflectionMethod $method, $token = null)
{
$definition = new InputDefinition();
foreach ($method->getParameters() as $parameter) {
if ($parameter->isDefaultValueAvailable()) {
//option
$definition->addOption(new InputOpti... | [
"private",
"function",
"buildDefinition",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"definition",
"=",
"new",
"InputDefinition",
"(",
")",
";",
"foreach",
"(",
"$",
"method",
"->",
"getParameters",
"(",
")... | builds the Input Definition based upon Api Method Parameters.
@param \ReflectionMethod $method
@param string $token
@return InputDefinition | [
"builds",
"the",
"Input",
"Definition",
"based",
"upon",
"Api",
"Method",
"Parameters",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Console/CommandFactory.php#L99-L117 |
19,816 | ClanCats/Core | src/bundles/UI/Builder.php | Builder.handle | public static function handle()
{
$args = func_get_args();
$key = array_shift( $args );
return call_user_func_array( array( static::$builder, 'build_'.$key ), $args );
} | php | public static function handle()
{
$args = func_get_args();
$key = array_shift( $args );
return call_user_func_array( array( static::$builder, 'build_'.$key ), $args );
} | [
"public",
"static",
"function",
"handle",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"key",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"static",
"::",
"$",
"builder",
... | Handle a build request
@param string $key
@param mixed ... | [
"Handle",
"a",
"build",
"request"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Builder.php#L48-L54 |
19,817 | simple-php-mvc/simple-php-mvc | src/MVC/Server/Route.php | Route.getInstance | static function getInstance($methods, $patternUri, $action, $name = null)
{
if (!self::$instance) {
self::$instance = new self($methods, $patternUri, $action, $name);
}
return self::$instance;
} | php | static function getInstance($methods, $patternUri, $action, $name = null)
{
if (!self::$instance) {
self::$instance = new self($methods, $patternUri, $action, $name);
}
return self::$instance;
} | [
"static",
"function",
"getInstance",
"(",
"$",
"methods",
",",
"$",
"patternUri",
",",
"$",
"action",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"instance",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"self... | Get Route instance
@param string|array $methods
@param string $patternUri
@param string|\callable $action
@param string $name
@return Route | [
"Get",
"Route",
"instance"
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Server/Route.php#L88-L95 |
19,818 | simple-php-mvc/simple-php-mvc | src/MVC/Server/Route.php | Route.setAction | public function setAction($action)
{
if (!is_string($action) && !is_callable($action)) {
throw new \LogicException(sprintf('Route action given "%s" is invalid. String or Callable expected.', gettype($action)));
}
$this->action = $action;
return $this;
} | php | public function setAction($action)
{
if (!is_string($action) && !is_callable($action)) {
throw new \LogicException(sprintf('Route action given "%s" is invalid. String or Callable expected.', gettype($action)));
}
$this->action = $action;
return $this;
} | [
"public",
"function",
"setAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"action",
")",
"&&",
"!",
"is_callable",
"(",
"$",
"action",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"sprintf",
"(",
"'Route act... | Set action callback
@param string|\callable $action
@return Route
@throws \LogicException | [
"Set",
"action",
"callback"
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Server/Route.php#L144-L152 |
19,819 | slashworks/control-bundle | src/Slashworks/AppBundle/Command/ApiCommand.php | ApiCommand.configure | protected function configure()
{
// get systemname
$sAppName = SystemSettings::get('app_name');
// set cli options
$this->setName($sAppName . ':remote:cron')->addOption('app', null, InputOption::VALUE_REQUIRED, 'run only for specific remote app', false)->addOpti... | php | protected function configure()
{
// get systemname
$sAppName = SystemSettings::get('app_name');
// set cli options
$this->setName($sAppName . ':remote:cron')->addOption('app', null, InputOption::VALUE_REQUIRED, 'run only for specific remote app', false)->addOpti... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"// get systemname",
"$",
"sAppName",
"=",
"SystemSettings",
"::",
"get",
"(",
"'app_name'",
")",
";",
"// set cli options",
"$",
"this",
"->",
"setName",
"(",
"$",
"sAppName",
".",
"':remote:cron'",
")",
"-... | configure cli command for making api calls | [
"configure",
"cli",
"command",
"for",
"making",
"api",
"calls"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Command/ApiCommand.php#L45-L53 |
19,820 | slashworks/control-bundle | src/Slashworks/AppBundle/Command/ApiCommand.php | ApiCommand._parseCrontab | private function _parseCrontab($sDatetime, $sCrontab)
{
$aTime = explode(' ', date('i G j n w', strtotime($sDatetime)));
$sCrontab = explode(' ', $sCrontab);
foreach ($sCrontab as $k => &$v) {
$v = explode(',', $v);
foreach ($v as &$v1) {
... | php | private function _parseCrontab($sDatetime, $sCrontab)
{
$aTime = explode(' ', date('i G j n w', strtotime($sDatetime)));
$sCrontab = explode(' ', $sCrontab);
foreach ($sCrontab as $k => &$v) {
$v = explode(',', $v);
foreach ($v as &$v1) {
... | [
"private",
"function",
"_parseCrontab",
"(",
"$",
"sDatetime",
",",
"$",
"sCrontab",
")",
"{",
"$",
"aTime",
"=",
"explode",
"(",
"' '",
",",
"date",
"(",
"'i G j n w'",
",",
"strtotime",
"(",
"$",
"sDatetime",
")",
")",
")",
";",
"$",
"sCrontab",
"=",... | Parse cron time string
@param $sDatetime
@param $sCrontab
@return mixed | [
"Parse",
"cron",
"time",
"string"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Command/ApiCommand.php#L180-L205 |
19,821 | slashworks/control-bundle | src/Slashworks/AppBundle/Command/ApiCommand.php | ApiCommand._makeCall | private function _makeCall($oRemoteApp)
{
// get class
$this->getContainer()->get('API');
// do call
Api::$_container = $this->getContainer();
$aReturn = Api::call('getData', array(
array(
'log' => $oRemoteApp->g... | php | private function _makeCall($oRemoteApp)
{
// get class
$this->getContainer()->get('API');
// do call
Api::$_container = $this->getContainer();
$aReturn = Api::call('getData', array(
array(
'log' => $oRemoteApp->g... | [
"private",
"function",
"_makeCall",
"(",
"$",
"oRemoteApp",
")",
"{",
"// get class",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'API'",
")",
";",
"// do call",
"Api",
"::",
"$",
"_container",
"=",
"$",
"this",
"->",
"getContainer",
... | perform api call
@param RemoteApp $oRemoteApp
@return mixed | [
"perform",
"api",
"call"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Command/ApiCommand.php#L215-L245 |
19,822 | slashworks/control-bundle | src/Slashworks/AppBundle/Command/ApiCommand.php | ApiCommand._saveResponse | private function _saveResponse($aResponse, $oRemoteApp)
{
// get model by app-type
$sClassName = '\Slashworks\AppBundle\Model\RemoteHistory' . ucfirst($oRemoteApp->getType());
$sQueryClassName = '\Slashworks\AppBundle\Model\RemoteHistory' . ucfirst($oRemoteApp->getType(... | php | private function _saveResponse($aResponse, $oRemoteApp)
{
// get model by app-type
$sClassName = '\Slashworks\AppBundle\Model\RemoteHistory' . ucfirst($oRemoteApp->getType());
$sQueryClassName = '\Slashworks\AppBundle\Model\RemoteHistory' . ucfirst($oRemoteApp->getType(... | [
"private",
"function",
"_saveResponse",
"(",
"$",
"aResponse",
",",
"$",
"oRemoteApp",
")",
"{",
"// get model by app-type",
"$",
"sClassName",
"=",
"'\\Slashworks\\AppBundle\\Model\\RemoteHistory'",
".",
"ucfirst",
"(",
"$",
"oRemoteApp",
"->",
"getType",
"(",
")",
... | Save response to database
@param array $aResponse
@param RemoteApp $oRemoteApp
@throws \Exception
@return void | [
"Save",
"response",
"to",
"database"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Command/ApiCommand.php#L258-L331 |
19,823 | slashworks/control-bundle | src/Slashworks/AppBundle/Command/ApiCommand.php | ApiCommand._sendErrorNotification | private function _sendErrorNotification(&$oRemoteApp, $aResponse)
{
$iStatusCode = $aResponse['statuscode'];
/*
* Parse template by statuscode
*/
if ($iStatusCode === 404) {
$sHtml = $this->getContainer()->get('templating')->render('... | php | private function _sendErrorNotification(&$oRemoteApp, $aResponse)
{
$iStatusCode = $aResponse['statuscode'];
/*
* Parse template by statuscode
*/
if ($iStatusCode === 404) {
$sHtml = $this->getContainer()->get('templating')->render('... | [
"private",
"function",
"_sendErrorNotification",
"(",
"&",
"$",
"oRemoteApp",
",",
"$",
"aResponse",
")",
"{",
"$",
"iStatusCode",
"=",
"$",
"aResponse",
"[",
"'statuscode'",
"]",
";",
"/*\n * Parse template by statuscode\n */",
"if",
"(",
"$",... | Send Error-Notification to user
@param $oRemoteApp
@param $aResponse | [
"Send",
"Error",
"-",
"Notification",
"to",
"user"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Command/ApiCommand.php#L340-L383 |
19,824 | slashworks/control-bundle | src/Slashworks/AppBundle/Command/ApiCommand.php | ApiCommand._sendNotification | private function _sendNotification($aDiff, &$oRemoteApp, $aNewHistory)
{
// parse template
$sHtml = $this->getContainer()->get('templating')->render('SlashworksAppBundle:Email:cron_notification.html.twig', array(
'diff' => $aDiff,
'log' => $a... | php | private function _sendNotification($aDiff, &$oRemoteApp, $aNewHistory)
{
// parse template
$sHtml = $this->getContainer()->get('templating')->render('SlashworksAppBundle:Email:cron_notification.html.twig', array(
'diff' => $aDiff,
'log' => $a... | [
"private",
"function",
"_sendNotification",
"(",
"$",
"aDiff",
",",
"&",
"$",
"oRemoteApp",
",",
"$",
"aNewHistory",
")",
"{",
"// parse template",
"$",
"sHtml",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'templating'",
")",
"->",... | Send Notification to user
@param array $aDiff
@param RemoteApp $oRemoteApp
@param RemoteHistoryContao $aNewHistory
@return void | [
"Send",
"Notification",
"to",
"user"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Command/ApiCommand.php#L395-L416 |
19,825 | JBZoo/Less | src/Cache.php | Cache.isExpired | public function isExpired()
{
if (!FS::isFile($this->_resultFile)) {
return true;
}
$fileAge = abs(time() - filemtime($this->_resultFile));
if ($fileAge >= $this->_cache_ttl) {
return true;
}
$firstLine = trim(FS::firstLine($this->_resultFile... | php | public function isExpired()
{
if (!FS::isFile($this->_resultFile)) {
return true;
}
$fileAge = abs(time() - filemtime($this->_resultFile));
if ($fileAge >= $this->_cache_ttl) {
return true;
}
$firstLine = trim(FS::firstLine($this->_resultFile... | [
"public",
"function",
"isExpired",
"(",
")",
"{",
"if",
"(",
"!",
"FS",
"::",
"isFile",
"(",
"$",
"this",
"->",
"_resultFile",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"fileAge",
"=",
"abs",
"(",
"time",
"(",
")",
"-",
"filemtime",
"(",
"$... | Check is current cache is expired | [
"Check",
"is",
"current",
"cache",
"is",
"expired"
] | 9e9c41e3c7b76222c0d81379dead222413f2f042 | https://github.com/JBZoo/Less/blob/9e9c41e3c7b76222c0d81379dead222413f2f042/src/Cache.php#L86-L104 |
19,826 | JBZoo/Less | src/Cache.php | Cache.save | public function save($content)
{
$content = $this->_getHeader() . $content;
$result = file_put_contents($this->_resultFile, $content);
if (!$result) {
throw new Exception('JBZoo/Less: File not save - ' . $this->_resultFile); // @codeCoverageIgnore
}
} | php | public function save($content)
{
$content = $this->_getHeader() . $content;
$result = file_put_contents($this->_resultFile, $content);
if (!$result) {
throw new Exception('JBZoo/Less: File not save - ' . $this->_resultFile); // @codeCoverageIgnore
}
} | [
"public",
"function",
"save",
"(",
"$",
"content",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"_getHeader",
"(",
")",
".",
"$",
"content",
";",
"$",
"result",
"=",
"file_put_contents",
"(",
"$",
"this",
"->",
"_resultFile",
",",
"$",
"content",
... | Save result to cache
@param string $content
@throws Exception | [
"Save",
"result",
"to",
"cache"
] | 9e9c41e3c7b76222c0d81379dead222413f2f042 | https://github.com/JBZoo/Less/blob/9e9c41e3c7b76222c0d81379dead222413f2f042/src/Cache.php#L169-L177 |
19,827 | claroline/ForumBundle | Manager/Manager.php | Manager.subscribe | public function subscribe(Forum $forum, User $user, $selfActivation = true)
{
$this->om->startFlushSuite();
$notification = new Notification();
$notification->setUser($user);
$notification->setForum($forum);
$notification->setSelfActivation($selfActivation);
$this->om... | php | public function subscribe(Forum $forum, User $user, $selfActivation = true)
{
$this->om->startFlushSuite();
$notification = new Notification();
$notification->setUser($user);
$notification->setForum($forum);
$notification->setSelfActivation($selfActivation);
$this->om... | [
"public",
"function",
"subscribe",
"(",
"Forum",
"$",
"forum",
",",
"User",
"$",
"user",
",",
"$",
"selfActivation",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"notification",
"=",
"new",
"Notification",
... | Subscribe a user to a forum. A mail will be sent to the user each time
a message is posted.
@param \Claroline\ForumBundle\Entity\Forum $forum
@param \Claroline\CoreBundle\Entity\User $user | [
"Subscribe",
"a",
"user",
"to",
"a",
"forum",
".",
"A",
"mail",
"will",
"be",
"sent",
"to",
"the",
"user",
"each",
"time",
"a",
"message",
"is",
"posted",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L133-L143 |
19,828 | claroline/ForumBundle | Manager/Manager.php | Manager.sendMessageNotification | public function sendMessageNotification(Message $message, User $user)
{
$forum = $message->getSubject()->getCategory()->getForum();
$notifications = $this->notificationRepo->findBy(array('forum' => $forum));
$users = array();
foreach ($notifications as $notification) {
$... | php | public function sendMessageNotification(Message $message, User $user)
{
$forum = $message->getSubject()->getCategory()->getForum();
$notifications = $this->notificationRepo->findBy(array('forum' => $forum));
$users = array();
foreach ($notifications as $notification) {
$... | [
"public",
"function",
"sendMessageNotification",
"(",
"Message",
"$",
"message",
",",
"User",
"$",
"user",
")",
"{",
"$",
"forum",
"=",
"$",
"message",
"->",
"getSubject",
"(",
")",
"->",
"getCategory",
"(",
")",
"->",
"getForum",
"(",
")",
";",
"$",
"... | Send a notification to a user about a message.
@param \Claroline\ForumBundle\Entity\Message $message
@param \Claroline\CoreBundle\Entity\User $user | [
"Send",
"a",
"notification",
"to",
"a",
"user",
"about",
"a",
"message",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L284-L307 |
19,829 | claroline/ForumBundle | Manager/Manager.php | Manager.moveMessage | public function moveMessage(Message $message, Subject $newSubject)
{
$this->om->startFlushSuite();
$oldSubject = $message->getSubject();
$message->setSubject($newSubject);
$this->om->persist($message);
$this->dispatch(new MoveMessageEvent($message, $oldSubject, $newSubject));... | php | public function moveMessage(Message $message, Subject $newSubject)
{
$this->om->startFlushSuite();
$oldSubject = $message->getSubject();
$message->setSubject($newSubject);
$this->om->persist($message);
$this->dispatch(new MoveMessageEvent($message, $oldSubject, $newSubject));... | [
"public",
"function",
"moveMessage",
"(",
"Message",
"$",
"message",
",",
"Subject",
"$",
"newSubject",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"oldSubject",
"=",
"$",
"message",
"->",
"getSubject",
"(",
")",
";",
... | Move a message to an other subject.
@param \Claroline\ForumBundle\Entity\Message $message
@param \Claroline\ForumBundle\Entity\Subject $newSubject | [
"Move",
"a",
"message",
"to",
"an",
"other",
"subject",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L342-L350 |
19,830 | claroline/ForumBundle | Manager/Manager.php | Manager.moveSubject | public function moveSubject(Subject $subject, Category $newCategory)
{
$this->om->startFlushSuite();
$oldCategory = $subject->getCategory();
$subject->setCategory($newCategory);
$this->om->persist($subject);
$this->dispatch(new MoveSubjectEvent($subject, $oldCategory, $newCat... | php | public function moveSubject(Subject $subject, Category $newCategory)
{
$this->om->startFlushSuite();
$oldCategory = $subject->getCategory();
$subject->setCategory($newCategory);
$this->om->persist($subject);
$this->dispatch(new MoveSubjectEvent($subject, $oldCategory, $newCat... | [
"public",
"function",
"moveSubject",
"(",
"Subject",
"$",
"subject",
",",
"Category",
"$",
"newCategory",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"oldCategory",
"=",
"$",
"subject",
"->",
"getCategory",
"(",
")",
"... | Move a subject to an other category.
@param \Claroline\ForumBundle\Entity\Subject $subject
@param \Claroline\ForumBundle\Entity\Category $newCategory | [
"Move",
"a",
"subject",
"to",
"an",
"other",
"category",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L358-L366 |
19,831 | claroline/ForumBundle | Manager/Manager.php | Manager.stickSubject | public function stickSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsSticked(true);
$this->om->persist($subject);
$this->dispatch(new StickSubjectEvent($subject));
$this->om->endFlushSuite();
} | php | public function stickSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsSticked(true);
$this->om->persist($subject);
$this->dispatch(new StickSubjectEvent($subject));
$this->om->endFlushSuite();
} | [
"public",
"function",
"stickSubject",
"(",
"Subject",
"$",
"subject",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"subject",
"->",
"setIsSticked",
"(",
"true",
")",
";",
"$",
"this",
"->",
"om",
"->",
"persist",
"(",... | Stick a subject at the top of the subject list.
@param \Claroline\ForumBundle\Entity\Subject $subject | [
"Stick",
"a",
"subject",
"at",
"the",
"top",
"of",
"the",
"subject",
"list",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L373-L380 |
19,832 | claroline/ForumBundle | Manager/Manager.php | Manager.unstickSubject | public function unstickSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsSticked(false);
$this->om->persist($subject);
$this->dispatch(new UnstickSubjectEvent($subject));
$this->om->endFlushSuite();
} | php | public function unstickSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsSticked(false);
$this->om->persist($subject);
$this->dispatch(new UnstickSubjectEvent($subject));
$this->om->endFlushSuite();
} | [
"public",
"function",
"unstickSubject",
"(",
"Subject",
"$",
"subject",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"subject",
"->",
"setIsSticked",
"(",
"false",
")",
";",
"$",
"this",
"->",
"om",
"->",
"persist",
"... | Unstick a subject from the top of the subject list.
@param \Claroline\ForumBundle\Entity\Subject $subject | [
"Unstick",
"a",
"subject",
"from",
"the",
"top",
"of",
"the",
"subject",
"list",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L387-L394 |
19,833 | claroline/ForumBundle | Manager/Manager.php | Manager.closeSubject | public function closeSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsClosed(true);
$this->om->persist($subject);
$this->dispatch(new CloseSubjectEvent($subject));
$this->om->endFlushSuite();
} | php | public function closeSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsClosed(true);
$this->om->persist($subject);
$this->dispatch(new CloseSubjectEvent($subject));
$this->om->endFlushSuite();
} | [
"public",
"function",
"closeSubject",
"(",
"Subject",
"$",
"subject",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"subject",
"->",
"setIsClosed",
"(",
"true",
")",
";",
"$",
"this",
"->",
"om",
"->",
"persist",
"(",
... | Close a subject and no one can write in it.
@param \Claroline\ForumBundle\Entity\Subject $subject | [
"Close",
"a",
"subject",
"and",
"no",
"one",
"can",
"write",
"in",
"it",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L401-L408 |
19,834 | claroline/ForumBundle | Manager/Manager.php | Manager.openSubject | public function openSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsClosed(false);
$this->om->persist($subject);
$this->dispatch(new OpenSubjectEvent($subject));
$this->om->endFlushSuite();
} | php | public function openSubject(Subject $subject)
{
$this->om->startFlushSuite();
$subject->setIsClosed(false);
$this->om->persist($subject);
$this->dispatch(new OpenSubjectEvent($subject));
$this->om->endFlushSuite();
} | [
"public",
"function",
"openSubject",
"(",
"Subject",
"$",
"subject",
")",
"{",
"$",
"this",
"->",
"om",
"->",
"startFlushSuite",
"(",
")",
";",
"$",
"subject",
"->",
"setIsClosed",
"(",
"false",
")",
";",
"$",
"this",
"->",
"om",
"->",
"persist",
"(",
... | Open a subject.
@param \Claroline\ForumBundle\Entity\Subject $subject | [
"Open",
"a",
"subject",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L415-L422 |
19,835 | claroline/ForumBundle | Manager/Manager.php | Manager.getSubjectsPager | public function getSubjectsPager(Category $category, $page = 1, $max = 20)
{
$subjects = $this->forumRepo->findSubjects($category);
return $this->pagerFactory->createPagerFromArray($subjects, $page, $max);
} | php | public function getSubjectsPager(Category $category, $page = 1, $max = 20)
{
$subjects = $this->forumRepo->findSubjects($category);
return $this->pagerFactory->createPagerFromArray($subjects, $page, $max);
} | [
"public",
"function",
"getSubjectsPager",
"(",
"Category",
"$",
"category",
",",
"$",
"page",
"=",
"1",
",",
"$",
"max",
"=",
"20",
")",
"{",
"$",
"subjects",
"=",
"$",
"this",
"->",
"forumRepo",
"->",
"findSubjects",
"(",
"$",
"category",
")",
";",
... | Get the pager for the subject list of a category.
@param \Claroline\ForumBundle\Entity\Category $category
@param integer $page
@param integer $max
@return \Pagerfanta\Pagerfanta | [
"Get",
"the",
"pager",
"for",
"the",
"subject",
"list",
"of",
"a",
"category",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L433-L438 |
19,836 | claroline/ForumBundle | Manager/Manager.php | Manager.getMessagesPager | public function getMessagesPager(Subject $subject, $page = 1, $max = 20)
{
$messages = $this->messageRepo->findBySubject($subject);
return $this->pagerFactory->createPagerFromArray($messages, $page, $max);
} | php | public function getMessagesPager(Subject $subject, $page = 1, $max = 20)
{
$messages = $this->messageRepo->findBySubject($subject);
return $this->pagerFactory->createPagerFromArray($messages, $page, $max);
} | [
"public",
"function",
"getMessagesPager",
"(",
"Subject",
"$",
"subject",
",",
"$",
"page",
"=",
"1",
",",
"$",
"max",
"=",
"20",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"messageRepo",
"->",
"findBySubject",
"(",
"$",
"subject",
")",
";",
... | Get the pager for the message list of a subject.
@param \Claroline\ForumBundle\Entity\Subject $subject
@param integer $page
@param integer $max
@return \Pagerfanta\Pagerfanta | [
"Get",
"the",
"pager",
"for",
"the",
"message",
"list",
"of",
"a",
"subject",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L449-L454 |
19,837 | claroline/ForumBundle | Manager/Manager.php | Manager.searchPager | public function searchPager(Forum $forum, $search, $page)
{
$query = $this->forumRepo->search($forum, $search);
return $this->pagerFactory->createPager($query, $page);
} | php | public function searchPager(Forum $forum, $search, $page)
{
$query = $this->forumRepo->search($forum, $search);
return $this->pagerFactory->createPager($query, $page);
} | [
"public",
"function",
"searchPager",
"(",
"Forum",
"$",
"forum",
",",
"$",
"search",
",",
"$",
"page",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"forumRepo",
"->",
"search",
"(",
"$",
"forum",
",",
"$",
"search",
")",
";",
"return",
"$",
"thi... | Get the pager for the forum search.
@param \Claroline\ForumBundle\Entity\Forum $forum
@param string $search
@param integer $page
@return \Pagerfanta\Pagerfanta | [
"Get",
"the",
"pager",
"for",
"the",
"forum",
"search",
"."
] | bd85dfd870cacee541ea94fec8e59744bf90eaf4 | https://github.com/claroline/ForumBundle/blob/bd85dfd870cacee541ea94fec8e59744bf90eaf4/Manager/Manager.php#L465-L470 |
19,838 | nyeholt/silverstripe-external-content | thirdparty/Zend/Http/Client.php | Zend_Http_Client._prepareHeaders | protected function _prepareHeaders()
{
$headers = array();
// Set the host header
if (! isset($this->headers['host'])) {
$host = $this->uri->getHost();
// If the port is not default, add it
if (! (($this->uri->getScheme() == 'http' && $this->uri->getPort... | php | protected function _prepareHeaders()
{
$headers = array();
// Set the host header
if (! isset($this->headers['host'])) {
$host = $this->uri->getHost();
// If the port is not default, add it
if (! (($this->uri->getScheme() == 'http' && $this->uri->getPort... | [
"protected",
"function",
"_prepareHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"// Set the host header",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"headers",
"[",
"'host'",
"]",
")",
")",
"{",
"$",
"host",
"=",
"$",
"t... | Prepare the request headers
@return array | [
"Prepare",
"the",
"request",
"headers"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Http/Client.php#L942-L1015 |
19,839 | fyuze/framework | src/Fyuze/Http/Kernel.php | Kernel.resolve | protected function resolve($action, $params)
{
if ($action instanceof Closure) {
return $action($params);
}
list($controller, $method) = $action;
$reflect = new ReflectionClass($controller);
foreach (array_filter($reflect->getMethod($method)->getParameters(), ... | php | protected function resolve($action, $params)
{
if ($action instanceof Closure) {
return $action($params);
}
list($controller, $method) = $action;
$reflect = new ReflectionClass($controller);
foreach (array_filter($reflect->getMethod($method)->getParameters(), ... | [
"protected",
"function",
"resolve",
"(",
"$",
"action",
",",
"$",
"params",
")",
"{",
"if",
"(",
"$",
"action",
"instanceof",
"Closure",
")",
"{",
"return",
"$",
"action",
"(",
"$",
"params",
")",
";",
"}",
"list",
"(",
"$",
"controller",
",",
"$",
... | Method injection resolver
@param $action
@param $params
@return mixed | [
"Method",
"injection",
"resolver"
] | 89b3984f7225e24bfcdafb090ee197275b3222c9 | https://github.com/fyuze/framework/blob/89b3984f7225e24bfcdafb090ee197275b3222c9/src/Fyuze/Http/Kernel.php#L76-L97 |
19,840 | simplisti/jasper-starter | src/Starter.php | Starter.compile | public function compile (Report $report, bool $skipExec = false)
{
$sourceFullPath = $report->getSourceFile(); // $this->sourcePath . DIRECTORY_SEPARATOR . $report->getSourceFile();
$compiledPath = $this->compiledPath;
$this->shellCommand = $this->executablePath . " cp -o $compiledP... | php | public function compile (Report $report, bool $skipExec = false)
{
$sourceFullPath = $report->getSourceFile(); // $this->sourcePath . DIRECTORY_SEPARATOR . $report->getSourceFile();
$compiledPath = $this->compiledPath;
$this->shellCommand = $this->executablePath . " cp -o $compiledP... | [
"public",
"function",
"compile",
"(",
"Report",
"$",
"report",
",",
"bool",
"$",
"skipExec",
"=",
"false",
")",
"{",
"$",
"sourceFullPath",
"=",
"$",
"report",
"->",
"getSourceFile",
"(",
")",
";",
"// $this->sourcePath . DIRECTORY_SEPARATOR . $report->getSourceFile... | Compile JRXML files into JASPER for processing.
@return self | [
"Compile",
"JRXML",
"files",
"into",
"JASPER",
"for",
"processing",
"."
] | e03e24663e983710fb4f1afad6c85bde8553de65 | https://github.com/simplisti/jasper-starter/blob/e03e24663e983710fb4f1afad6c85bde8553de65/src/Starter.php#L75-L95 |
19,841 | simplisti/jasper-starter | src/Starter.php | Starter.process | public function process (Report $report, bool $skipExec = false)
{
$compiledFullPath = $this->compiledPath . DIRECTORY_SEPARATOR . pathinfo($report->getSourceFile(), PATHINFO_FILENAME) . '.jasper';
$processedFullPath = $this->processedPath . DIRECTORY_SEPARATOR . uniqid('ASB');
$format... | php | public function process (Report $report, bool $skipExec = false)
{
$compiledFullPath = $this->compiledPath . DIRECTORY_SEPARATOR . pathinfo($report->getSourceFile(), PATHINFO_FILENAME) . '.jasper';
$processedFullPath = $this->processedPath . DIRECTORY_SEPARATOR . uniqid('ASB');
$format... | [
"public",
"function",
"process",
"(",
"Report",
"$",
"report",
",",
"bool",
"$",
"skipExec",
"=",
"false",
")",
"{",
"$",
"compiledFullPath",
"=",
"$",
"this",
"->",
"compiledPath",
".",
"DIRECTORY_SEPARATOR",
".",
"pathinfo",
"(",
"$",
"report",
"->",
"ge... | Process JASPER file into PDF or similar output format.
@return $this | [
"Process",
"JASPER",
"file",
"into",
"PDF",
"or",
"similar",
"output",
"format",
"."
] | e03e24663e983710fb4f1afad6c85bde8553de65 | https://github.com/simplisti/jasper-starter/blob/e03e24663e983710fb4f1afad6c85bde8553de65/src/Starter.php#L102-L134 |
19,842 | simplisti/jasper-starter | src/Starter.php | Starter.processCsvFileOptions | protected function processCsvFileOptions (Report $report)
{
$value = $report->getFile('file');
$csvSwitch = "--data-file $value ";
// NOTE: If column headers array is empty than we assume CSV first row
$value = $report->getCsvfile('columnHeaderNames');
if (empty($valu... | php | protected function processCsvFileOptions (Report $report)
{
$value = $report->getFile('file');
$csvSwitch = "--data-file $value ";
// NOTE: If column headers array is empty than we assume CSV first row
$value = $report->getCsvfile('columnHeaderNames');
if (empty($valu... | [
"protected",
"function",
"processCsvFileOptions",
"(",
"Report",
"$",
"report",
")",
"{",
"$",
"value",
"=",
"$",
"report",
"->",
"getFile",
"(",
"'file'",
")",
";",
"$",
"csvSwitch",
"=",
"\"--data-file $value \"",
";",
"// NOTE: If column headers array is empty th... | Process CSV file details
@return $this | [
"Process",
"CSV",
"file",
"details"
] | e03e24663e983710fb4f1afad6c85bde8553de65 | https://github.com/simplisti/jasper-starter/blob/e03e24663e983710fb4f1afad6c85bde8553de65/src/Starter.php#L141-L165 |
19,843 | webforge-labs/psc-cms | lib/Psc/PSC.php | PSC.getRoot | public static function getRoot() {
if (!isset(self::$root)) {
try {
$root = getenv('PSC_CMS');
if (!empty($root)) {
return self::$root = new Dir($root);
}
} catch (\Webforge\Common\System\Exception $e) {}
throw MissingEnvironmentVariableException::factory('P... | php | public static function getRoot() {
if (!isset(self::$root)) {
try {
$root = getenv('PSC_CMS');
if (!empty($root)) {
return self::$root = new Dir($root);
}
} catch (\Webforge\Common\System\Exception $e) {}
throw MissingEnvironmentVariableException::factory('P... | [
"public",
"static",
"function",
"getRoot",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"root",
")",
")",
"{",
"try",
"{",
"$",
"root",
"=",
"getenv",
"(",
"'PSC_CMS'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"root",
")"... | Returns the root directory of the host where the host-config lives
@return Psc\System\Directory
@throws Psc\MissingEnvironmentVariableException | [
"Returns",
"the",
"root",
"directory",
"of",
"the",
"host",
"where",
"the",
"host",
"-",
"config",
"lives"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/PSC.php#L90-L106 |
19,844 | geekwright/Po | src/PoFile.php | PoFile.createKey | public static function createKey(?string $msgid, ?string $msgctxt = null, ?string $msgid_plural = null): string
{
$key = '';
if (!empty($msgctxt)) {
$key .= $msgctxt . '|';
}
$key .= (string) $msgid;
if (!empty($msgid_plural)) {
$key .= '|' . $msgid_pl... | php | public static function createKey(?string $msgid, ?string $msgctxt = null, ?string $msgid_plural = null): string
{
$key = '';
if (!empty($msgctxt)) {
$key .= $msgctxt . '|';
}
$key .= (string) $msgid;
if (!empty($msgid_plural)) {
$key .= '|' . $msgid_pl... | [
"public",
"static",
"function",
"createKey",
"(",
"?",
"string",
"$",
"msgid",
",",
"?",
"string",
"$",
"msgctxt",
"=",
"null",
",",
"?",
"string",
"$",
"msgid_plural",
"=",
"null",
")",
":",
"string",
"{",
"$",
"key",
"=",
"''",
";",
"if",
"(",
"!... | Build the internal entries array key from id, context and plural id
@param string|null $msgid the untranslated message of the entry
@param string|null $msgctxt the context of the entry, if any
@param string|null $msgid_plural the untranslated plural message of the entry, if any
@return string | [
"Build",
"the",
"internal",
"entries",
"array",
"key",
"from",
"id",
"context",
"and",
"plural",
"id"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L72-L83 |
19,845 | geekwright/Po | src/PoFile.php | PoFile.createKeyFromEntry | public function createKeyFromEntry(PoEntry $entry): string
{
return $this->createKey(
$entry->getAsString(PoTokens::MESSAGE),
$entry->getAsString(PoTokens::CONTEXT),
$entry->getAsString(PoTokens::PLURAL)
);
} | php | public function createKeyFromEntry(PoEntry $entry): string
{
return $this->createKey(
$entry->getAsString(PoTokens::MESSAGE),
$entry->getAsString(PoTokens::CONTEXT),
$entry->getAsString(PoTokens::PLURAL)
);
} | [
"public",
"function",
"createKeyFromEntry",
"(",
"PoEntry",
"$",
"entry",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"createKey",
"(",
"$",
"entry",
"->",
"getAsString",
"(",
"PoTokens",
"::",
"MESSAGE",
")",
",",
"$",
"entry",
"->",
"getAsStrin... | Build an internal entries array key from a PoEntry
@param PoEntry $entry the PoEntry to build key from
@return string | [
"Build",
"an",
"internal",
"entries",
"array",
"key",
"from",
"a",
"PoEntry"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L92-L99 |
19,846 | geekwright/Po | src/PoFile.php | PoFile.addEntry | public function addEntry(PoEntry $entry, bool $replace = true): bool
{
$key = $this->createKeyFromEntry($entry);
// some entires, such as obsolete entries, have no key
// for some uses, these are dead weight - need better strategy for that case
if (empty($key)) {
$this->... | php | public function addEntry(PoEntry $entry, bool $replace = true): bool
{
$key = $this->createKeyFromEntry($entry);
// some entires, such as obsolete entries, have no key
// for some uses, these are dead weight - need better strategy for that case
if (empty($key)) {
$this->... | [
"public",
"function",
"addEntry",
"(",
"PoEntry",
"$",
"entry",
",",
"bool",
"$",
"replace",
"=",
"true",
")",
":",
"bool",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"createKeyFromEntry",
"(",
"$",
"entry",
")",
";",
"// some entires, such as obsolete entries... | Add an entry to the PoFile using internal key
@param PoEntry $entry the PoEntry to add
@param boolean $replace true to replace any existing entry matching this key,
false to not change the PoFile for a duplicated key
@return boolean true if added, false if not | [
"Add",
"an",
"entry",
"to",
"the",
"PoFile",
"using",
"internal",
"key"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L164-L181 |
19,847 | geekwright/Po | src/PoFile.php | PoFile.mergeEntry | public function mergeEntry(PoEntry $newEntry): bool
{
$key = $this->createKeyFromEntry($newEntry);
// keyed entries only
if (empty($key)) {
return false;
}
if (isset($this->entries[$key])) {
$existingEntry = $this->entries[$key];
$mergeTo... | php | public function mergeEntry(PoEntry $newEntry): bool
{
$key = $this->createKeyFromEntry($newEntry);
// keyed entries only
if (empty($key)) {
return false;
}
if (isset($this->entries[$key])) {
$existingEntry = $this->entries[$key];
$mergeTo... | [
"public",
"function",
"mergeEntry",
"(",
"PoEntry",
"$",
"newEntry",
")",
":",
"bool",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"createKeyFromEntry",
"(",
"$",
"newEntry",
")",
";",
"// keyed entries only",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
... | Merge an entry with any existing entry with the same key. If the key does
not exist, add the entry, otherwise merge comments, references, and flags.
This is intended for use in building a POT, where the handling of translated
strings is not a factor.
@param PoEntry $newEntry the PoEntry to merge
@return boolean true... | [
"Merge",
"an",
"entry",
"with",
"any",
"existing",
"entry",
"with",
"the",
"same",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"add",
"the",
"entry",
"otherwise",
"merge",
"comments",
"references",
"and",
"flags",
"."
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L194-L219 |
19,848 | geekwright/Po | src/PoFile.php | PoFile.findEntry | public function findEntry(string $msgid, ?string $msgctxt = null, ?string $msgid_plural = null): ?PoEntry
{
$key = $this->createKey($msgid, $msgctxt, $msgid_plural);
$entry = null;
if (!empty($key) && isset($this->entries[$key])) {
$entry = $this->entries[$key];
}
... | php | public function findEntry(string $msgid, ?string $msgctxt = null, ?string $msgid_plural = null): ?PoEntry
{
$key = $this->createKey($msgid, $msgctxt, $msgid_plural);
$entry = null;
if (!empty($key) && isset($this->entries[$key])) {
$entry = $this->entries[$key];
}
... | [
"public",
"function",
"findEntry",
"(",
"string",
"$",
"msgid",
",",
"?",
"string",
"$",
"msgctxt",
"=",
"null",
",",
"?",
"string",
"$",
"msgid_plural",
"=",
"null",
")",
":",
"?",
"PoEntry",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"createKey",
"("... | Get an entry based on key values - msgid, msgctxt and msgid_plural
@param string $msgid the untranslated message of the entry
@param string|null $msgctxt the context of the entry, if any
@param string|null $msgid_plural the untranslated plural message of the entry, if any
@return PoEntry|null matchin... | [
"Get",
"an",
"entry",
"based",
"on",
"key",
"values",
"-",
"msgid",
"msgctxt",
"and",
"msgid_plural"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L230-L240 |
19,849 | geekwright/Po | src/PoFile.php | PoFile.removeEntry | public function removeEntry(PoEntry $entry): bool
{
$key = $this->createKeyFromEntry($entry);
// try by the key first.
if (!empty($key) && isset($this->entries[$key])) {
if ($entry === $this->entries[$key]) {
unset($this->entries[$key]);
return tr... | php | public function removeEntry(PoEntry $entry): bool
{
$key = $this->createKeyFromEntry($entry);
// try by the key first.
if (!empty($key) && isset($this->entries[$key])) {
if ($entry === $this->entries[$key]) {
unset($this->entries[$key]);
return tr... | [
"public",
"function",
"removeEntry",
"(",
"PoEntry",
"$",
"entry",
")",
":",
"bool",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"createKeyFromEntry",
"(",
"$",
"entry",
")",
";",
"// try by the key first.",
"if",
"(",
"!",
"empty",
"(",
"$",
"key",
")",
... | Remove an entry from the PoFile
In simple cases, the entry can be found by key. There are several cases
where it is not that easy to locate the PoEntry to be removed:
- the PoEntry was altered, making the generated and stored key different
- the entry is not keyed and is in unkeyedEntries
In any of these cases, we mu... | [
"Remove",
"an",
"entry",
"from",
"the",
"PoFile"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L257-L286 |
19,850 | geekwright/Po | src/PoFile.php | PoFile.writePoFile | public function writePoFile(string $file): void
{
$source = $this->dumpString();
$testName = file_exists($file) ? $file : dirname($file);
$status = is_writable($testName);
if ($status === true) {
$status = file_put_contents($file, $source);
}
if (false ===... | php | public function writePoFile(string $file): void
{
$source = $this->dumpString();
$testName = file_exists($file) ? $file : dirname($file);
$status = is_writable($testName);
if ($status === true) {
$status = file_put_contents($file, $source);
}
if (false ===... | [
"public",
"function",
"writePoFile",
"(",
"string",
"$",
"file",
")",
":",
"void",
"{",
"$",
"source",
"=",
"$",
"this",
"->",
"dumpString",
"(",
")",
";",
"$",
"testName",
"=",
"file_exists",
"(",
"$",
"file",
")",
"?",
"$",
"file",
":",
"dirname",
... | Write any current contents to a po file
@param string $file po file to write
@return void
@throws FileNotWritableException | [
"Write",
"any",
"current",
"contents",
"to",
"a",
"po",
"file"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L297-L308 |
19,851 | geekwright/Po | src/PoFile.php | PoFile.dumpString | public function dumpString(): string
{
if ($this->header === null) {
$this->header = new PoHeader;
$this->header->buildDefaultHeader();
}
$output = '';
$output .= $this->header->dumpEntry();
foreach ($this->entries as $entry) {
$output .= ... | php | public function dumpString(): string
{
if ($this->header === null) {
$this->header = new PoHeader;
$this->header->buildDefaultHeader();
}
$output = '';
$output .= $this->header->dumpEntry();
foreach ($this->entries as $entry) {
$output .= ... | [
"public",
"function",
"dumpString",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"header",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"header",
"=",
"new",
"PoHeader",
";",
"$",
"this",
"->",
"header",
"->",
"buildDefaultHeader",
"(",
... | Dump the current contents in PO format to a string
@return string | [
"Dump",
"the",
"current",
"contents",
"in",
"PO",
"format",
"to",
"a",
"string"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L315-L333 |
19,852 | geekwright/Po | src/PoFile.php | PoFile.readPoFile | public function readPoFile(string $file, ?resource $context = null): void
{
$oldEr = error_reporting(E_ALL ^ E_WARNING);
$source = file_get_contents($file, false, $context);
error_reporting($oldEr);
if (false===$source) {
throw new FileNotReadableException($file);
... | php | public function readPoFile(string $file, ?resource $context = null): void
{
$oldEr = error_reporting(E_ALL ^ E_WARNING);
$source = file_get_contents($file, false, $context);
error_reporting($oldEr);
if (false===$source) {
throw new FileNotReadableException($file);
... | [
"public",
"function",
"readPoFile",
"(",
"string",
"$",
"file",
",",
"?",
"resource",
"$",
"context",
"=",
"null",
")",
":",
"void",
"{",
"$",
"oldEr",
"=",
"error_reporting",
"(",
"E_ALL",
"^",
"E_WARNING",
")",
";",
"$",
"source",
"=",
"file_get_conten... | Replace any current contents with entries from a file
@param string $file po file/stream to read
@param resource|null $context context for stream if required
@return void
@throws FileNotReadableException | [
"Replace",
"any",
"current",
"contents",
"with",
"entries",
"from",
"a",
"file"
] | 9474d059a83b64e6242cc41e5c5b7a08bc57e4e2 | https://github.com/geekwright/Po/blob/9474d059a83b64e6242cc41e5c5b7a08bc57e4e2/src/PoFile.php#L346-L355 |
19,853 | simple-php-mvc/simple-php-mvc | src/MVC/View.php | View.addTemplatePath | public function addTemplatePath($path)
{
if (is_array($this->templatesPath)) {
if (array_search($path, $this->templatesPath)) {
throw new \LogicException(sprintf('Templates path "%s" exists.', $path));
} else {
$this->templatesPath[] = $path;
... | php | public function addTemplatePath($path)
{
if (is_array($this->templatesPath)) {
if (array_search($path, $this->templatesPath)) {
throw new \LogicException(sprintf('Templates path "%s" exists.', $path));
} else {
$this->templatesPath[] = $path;
... | [
"public",
"function",
"addTemplatePath",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"templatesPath",
")",
")",
"{",
"if",
"(",
"array_search",
"(",
"$",
"path",
",",
"$",
"this",
"->",
"templatesPath",
")",
")",
"{",
"... | Add Template Path
@param string $path Templates path | [
"Add",
"Template",
"Path"
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/View.php#L26-L40 |
19,854 | simple-php-mvc/simple-php-mvc | src/MVC/View.php | View.render | public function render($file, $vars = null)
{
$template = '';
if (is_null($this->templatesPath)) {
throw new \LogicException('Variable "templatesPath" can\'t be NULL.');
} else if (is_string($this->templatesPath) && !file_exists($this->templatesPath)) {
throw new \L... | php | public function render($file, $vars = null)
{
$template = '';
if (is_null($this->templatesPath)) {
throw new \LogicException('Variable "templatesPath" can\'t be NULL.');
} else if (is_string($this->templatesPath) && !file_exists($this->templatesPath)) {
throw new \L... | [
"public",
"function",
"render",
"(",
"$",
"file",
",",
"$",
"vars",
"=",
"null",
")",
"{",
"$",
"template",
"=",
"''",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"templatesPath",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"... | Renders a given file with the supplied variables.
@access public
@param string $file The file to be rendered.
@param mixed $vars The variables to be substituted in the view.
@return string
@throws \LogicException | [
"Renders",
"a",
"given",
"file",
"with",
"the",
"supplied",
"variables",
"."
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/View.php#L76-L110 |
19,855 | zodream/thirdparty | src/OAuth/PayPal.php | PayPal.setMode | public function setMode($arg) {
$this->mode = strtolower($arg) == self::LIVE ? self::LIVE : self::SANDBOX;
return $this;
} | php | public function setMode($arg) {
$this->mode = strtolower($arg) == self::LIVE ? self::LIVE : self::SANDBOX;
return $this;
} | [
"public",
"function",
"setMode",
"(",
"$",
"arg",
")",
"{",
"$",
"this",
"->",
"mode",
"=",
"strtolower",
"(",
"$",
"arg",
")",
"==",
"self",
"::",
"LIVE",
"?",
"self",
"::",
"LIVE",
":",
"self",
"::",
"SANDBOX",
";",
"return",
"$",
"this",
";",
... | IS TEST OR LIVE
@param string $arg
@return $this | [
"IS",
"TEST",
"OR",
"LIVE"
] | b9d39087913850f1c5c7c9165105fec22a128f8f | https://github.com/zodream/thirdparty/blob/b9d39087913850f1c5c7c9165105fec22a128f8f/src/OAuth/PayPal.php#L95-L98 |
19,856 | anime-db/app-bundle | src/Service/WidgetsContainer.php | WidgetsContainer.registr | public function registr($place, $controller)
{
if (preg_match('/^[a-z0-9]+:[a-z0-9]+:[_a-z0-9]+$/i', $controller)) {
if (!isset($this->widgets[$place])) {
$this->widgets[$place][] = $controller;
} elseif (!in_array($controller, $this->widgets[$place])) {
... | php | public function registr($place, $controller)
{
if (preg_match('/^[a-z0-9]+:[a-z0-9]+:[_a-z0-9]+$/i', $controller)) {
if (!isset($this->widgets[$place])) {
$this->widgets[$place][] = $controller;
} elseif (!in_array($controller, $this->widgets[$place])) {
... | [
"public",
"function",
"registr",
"(",
"$",
"place",
",",
"$",
"controller",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^[a-z0-9]+:[a-z0-9]+:[_a-z0-9]+$/i'",
",",
"$",
"controller",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"widgets",
... | Regist widget.
Controller example:
AcmeDemoBundle:Welcome:index
AcmeArticleBundle:Article:show
@param string $place
@param string $controller
@return bool | [
"Regist",
"widget",
"."
] | ca3b342081719d41ba018792a75970cbb1f1fe22 | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/WidgetsContainer.php#L60-L73 |
19,857 | redaigbaria/oauth2 | src/TokenType/MAC.php | MAC.hash_equals | private function hash_equals($knownString, $userString)
{
if (function_exists('\hash_equals')) {
return \hash_equals($knownString, $userString);
}
if (strlen($knownString) !== strlen($userString)) {
return false;
}
$len = strlen($knownString);
... | php | private function hash_equals($knownString, $userString)
{
if (function_exists('\hash_equals')) {
return \hash_equals($knownString, $userString);
}
if (strlen($knownString) !== strlen($userString)) {
return false;
}
$len = strlen($knownString);
... | [
"private",
"function",
"hash_equals",
"(",
"$",
"knownString",
",",
"$",
"userString",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'\\hash_equals'",
")",
")",
"{",
"return",
"\\",
"hash_equals",
"(",
"$",
"knownString",
",",
"$",
"userString",
")",
";",
... | Prevent timing attack
@param string $knownString
@param string $userString
@return bool | [
"Prevent",
"timing",
"attack"
] | 54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/TokenType/MAC.php#L140-L155 |
19,858 | aedart/config-loader | src/Traits/ParserFactoryTrait.php | ParserFactoryTrait.getParserFactory | public function getParserFactory(): ?ParserFactory
{
if (!$this->hasParserFactory()) {
$this->setParserFactory($this->getDefaultParserFactory());
}
return $this->parserFactory;
} | php | public function getParserFactory(): ?ParserFactory
{
if (!$this->hasParserFactory()) {
$this->setParserFactory($this->getDefaultParserFactory());
}
return $this->parserFactory;
} | [
"public",
"function",
"getParserFactory",
"(",
")",
":",
"?",
"ParserFactory",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasParserFactory",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setParserFactory",
"(",
"$",
"this",
"->",
"getDefaultParserFactory",
"(",
")... | Get parser factory
If no parser factory has been set, this method will
set and return a default parser factory, if any such
value is available
@see getDefaultParserFactory()
@return ParserFactory|null parser factory or null if none parser factory has been set | [
"Get",
"parser",
"factory"
] | 9e1cf592bee46ba4930bb9c352aaf475d81266ea | https://github.com/aedart/config-loader/blob/9e1cf592bee46ba4930bb9c352aaf475d81266ea/src/Traits/ParserFactoryTrait.php#L53-L59 |
19,859 | CakeCMS/Core | src/View/Helper/FilterHelper.php | FilterHelper.render | public function render($model, array $fields = [], $element = self::DEFAULT_ELEMENT, array $data = [])
{
$data = Hash::merge([
'clearUrl' => [],
'model' => $model,
'formFields' => $fields,
], $data);
return $this->_View->element($element, $data);
... | php | public function render($model, array $fields = [], $element = self::DEFAULT_ELEMENT, array $data = [])
{
$data = Hash::merge([
'clearUrl' => [],
'model' => $model,
'formFields' => $fields,
], $data);
return $this->_View->element($element, $data);
... | [
"public",
"function",
"render",
"(",
"$",
"model",
",",
"array",
"$",
"fields",
"=",
"[",
"]",
",",
"$",
"element",
"=",
"self",
"::",
"DEFAULT_ELEMENT",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"=",
"Hash",
"::",
"merge",
... | Render filter element.
@param string $model
@param array $fields
@param string $element
@param array $data
@return string | [
"Render",
"filter",
"element",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/FilterHelper.php#L39-L48 |
19,860 | qcubed/orm | src/Database/Mysqli5/Database.php | Database.executeProcedure | public function executeProcedure($strProcName, $params = null)
{
$strParams = '';
if ($params) {
$a = array_map(function ($val) {
return $this->sqlVariable($val);
}, $params);
$strParams = implode(',', $a);
}
$strSql = "call {$strPr... | php | public function executeProcedure($strProcName, $params = null)
{
$strParams = '';
if ($params) {
$a = array_map(function ($val) {
return $this->sqlVariable($val);
}, $params);
$strParams = implode(',', $a);
}
$strSql = "call {$strPr... | [
"public",
"function",
"executeProcedure",
"(",
"$",
"strProcName",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"strParams",
"=",
"''",
";",
"if",
"(",
"$",
"params",
")",
"{",
"$",
"a",
"=",
"array_map",
"(",
"function",
"(",
"$",
"val",
")",
"... | Generic stored procedure executor. For Mysql 5, you can have your stored procedure return results by
"SELECT"ing the results. The results will be returned as an array.
@param string $strProcName Name of stored procedure
@param array|null $params
@return Result[]
@throws MysqliException | [
"Generic",
"stored",
"procedure",
"executor",
".",
"For",
"Mysql",
"5",
"you",
"can",
"have",
"your",
"stored",
"procedure",
"return",
"results",
"by",
"SELECT",
"ing",
"the",
"results",
".",
"The",
"results",
"will",
"be",
"returned",
"as",
"an",
"array",
... | f320eba671f20874b1f3809c5293f8c02d5b1204 | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Database/Mysqli5/Database.php#L122-L133 |
19,861 | spiral-modules/scaffolder | source/Scaffolder/Declarations/EntityDeclaration.php | EntityDeclaration.addField | public function addField(string $name, $value)
{
$schema = $this->constant('SCHEMA')->getValue();
$schema[$name] = $value;
$this->constant('SCHEMA')->setValue($schema);
} | php | public function addField(string $name, $value)
{
$schema = $this->constant('SCHEMA')->getValue();
$schema[$name] = $value;
$this->constant('SCHEMA')->setValue($schema);
} | [
"public",
"function",
"addField",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"constant",
"(",
"'SCHEMA'",
")",
"->",
"getValue",
"(",
")",
";",
"$",
"schema",
"[",
"$",
"name",
"]",
"=",
"$",
"... | Add field into schema.
@param string $name
@param mixed $value | [
"Add",
"field",
"into",
"schema",
"."
] | 9be9dd0da6e4b02232db24e797fe5c288afbbddf | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Declarations/EntityDeclaration.php#L44-L49 |
19,862 | parsnick/steak | src/Boot/RunBootstrapsFromConfig.php | RunBootstrapsFromConfig.boot | public function boot(Container $app)
{
$toBoot = (array) $app['config']->get('bootstrap', []);
foreach ($toBoot as $bootstrapClass) {
$app->make($bootstrapClass)->boot($app);
}
} | php | public function boot(Container $app)
{
$toBoot = (array) $app['config']->get('bootstrap', []);
foreach ($toBoot as $bootstrapClass) {
$app->make($bootstrapClass)->boot($app);
}
} | [
"public",
"function",
"boot",
"(",
"Container",
"$",
"app",
")",
"{",
"$",
"toBoot",
"=",
"(",
"array",
")",
"$",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'bootstrap'",
",",
"[",
"]",
")",
";",
"foreach",
"(",
"$",
"toBoot",
"as",
"$",
"bo... | Call any other bootstraps defined by config.
@param Container $app | [
"Call",
"any",
"other",
"bootstraps",
"defined",
"by",
"config",
"."
] | 461869189a640938438187330f6c50aca97c5ccc | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Boot/RunBootstrapsFromConfig.php#L14-L21 |
19,863 | picamator/CacheManager | src/ObjectManager.php | ObjectManager.getReflection | private function getReflection(string $className) : \ReflectionClass
{
if (empty($this->reflectionContainer[$className])) {
$this->reflectionContainer[$className] = new \ReflectionClass($className);
}
return $this->reflectionContainer[$className];
} | php | private function getReflection(string $className) : \ReflectionClass
{
if (empty($this->reflectionContainer[$className])) {
$this->reflectionContainer[$className] = new \ReflectionClass($className);
}
return $this->reflectionContainer[$className];
} | [
"private",
"function",
"getReflection",
"(",
"string",
"$",
"className",
")",
":",
"\\",
"ReflectionClass",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"reflectionContainer",
"[",
"$",
"className",
"]",
")",
")",
"{",
"$",
"this",
"->",
"reflectionCon... | Retrieve reflection.
@param string $className
@return \ReflectionClass | [
"Retrieve",
"reflection",
"."
] | 5e5493910610b65ae31a362786d7963ba3e33806 | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/ObjectManager.php#L47-L54 |
19,864 | steeffeen/FancyManiaLinks | FML/Elements/Dico.php | Dico.getEntry | public function getEntry($language, $entryId)
{
if (isset($this->entries[$language]) && isset($this->entries[$language][$entryId])) {
return $this->entries[$language][$entryId];
}
return null;
} | php | public function getEntry($language, $entryId)
{
if (isset($this->entries[$language]) && isset($this->entries[$language][$entryId])) {
return $this->entries[$language][$entryId];
}
return null;
} | [
"public",
"function",
"getEntry",
"(",
"$",
"language",
",",
"$",
"entryId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"entries",
"[",
"$",
"language",
"]",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"entries",
"[",
"$",
"language",
"]... | Get the translatable entry
@api
@param string $language Language id
@param string $entryId Entry id
@return string | [
"Get",
"the",
"translatable",
"entry"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Elements/Dico.php#L179-L185 |
19,865 | steeffeen/FancyManiaLinks | FML/Elements/Dico.php | Dico.setEntry | public function setEntry($language, $entryId, $entryValue)
{
$language = (string)$language;
$entryId = (string)$entryId;
$entryValue = (string)$entryValue;
if (!isset($this->entries[$language]) && $entryValue) {
$this->entries[$language] = array();
}
... | php | public function setEntry($language, $entryId, $entryValue)
{
$language = (string)$language;
$entryId = (string)$entryId;
$entryValue = (string)$entryValue;
if (!isset($this->entries[$language]) && $entryValue) {
$this->entries[$language] = array();
}
... | [
"public",
"function",
"setEntry",
"(",
"$",
"language",
",",
"$",
"entryId",
",",
"$",
"entryValue",
")",
"{",
"$",
"language",
"=",
"(",
"string",
")",
"$",
"language",
";",
"$",
"entryId",
"=",
"(",
"string",
")",
"$",
"entryId",
";",
"$",
"entryVa... | Set the translatable entry for the specific language
@api
@param string $language Language id
@param string $entryId Entry id
@param string $entryValue Translated entry value
@return static | [
"Set",
"the",
"translatable",
"entry",
"for",
"the",
"specific",
"language"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Elements/Dico.php#L196-L212 |
19,866 | steeffeen/FancyManiaLinks | FML/Elements/Dico.php | Dico.removeEntry | public function removeEntry($entryId, $language = null)
{
$entryId = (string)$entryId;
foreach ($this->entries as $languageKey => $entries) {
if ($language && $language !== $languageKey) {
continue;
}
if (isset($this->entries[$languageKey][$entryId... | php | public function removeEntry($entryId, $language = null)
{
$entryId = (string)$entryId;
foreach ($this->entries as $languageKey => $entries) {
if ($language && $language !== $languageKey) {
continue;
}
if (isset($this->entries[$languageKey][$entryId... | [
"public",
"function",
"removeEntry",
"(",
"$",
"entryId",
",",
"$",
"language",
"=",
"null",
")",
"{",
"$",
"entryId",
"=",
"(",
"string",
")",
"$",
"entryId",
";",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"languageKey",
"=>",
"$",
"e... | Remove entries of the given id
@api
@param string $entryId Entry id that should be removed
@param string $language (optional) Only remove entry from the given language
@return static | [
"Remove",
"entries",
"of",
"the",
"given",
"id"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Elements/Dico.php#L222-L234 |
19,867 | steeffeen/FancyManiaLinks | FML/Elements/Dico.php | Dico.removeLanguage | public function removeLanguage($language)
{
$language = (string)$language;
if (isset($this->entries[$language])) {
unset($this->entries[$language]);
}
return $this;
} | php | public function removeLanguage($language)
{
$language = (string)$language;
if (isset($this->entries[$language])) {
unset($this->entries[$language]);
}
return $this;
} | [
"public",
"function",
"removeLanguage",
"(",
"$",
"language",
")",
"{",
"$",
"language",
"=",
"(",
"string",
")",
"$",
"language",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"entries",
"[",
"$",
"language",
"]",
")",
")",
"{",
"unset",
"(",
"... | Remove entries of the given language
@api
@param string $language Language which entries should be removed
@return static | [
"Remove",
"entries",
"of",
"the",
"given",
"language"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Elements/Dico.php#L243-L250 |
19,868 | steeffeen/FancyManiaLinks | FML/Elements/Dico.php | Dico.render | public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement("dico");
foreach ($this->entries as $language => $entries) {
$languageElement = $domDocument->createElement("language");
$languageElement->setAttribute("id", $language);
... | php | public function render(\DOMDocument $domDocument)
{
$domElement = $domDocument->createElement("dico");
foreach ($this->entries as $language => $entries) {
$languageElement = $domDocument->createElement("language");
$languageElement->setAttribute("id", $language);
... | [
"public",
"function",
"render",
"(",
"\\",
"DOMDocument",
"$",
"domDocument",
")",
"{",
"$",
"domElement",
"=",
"$",
"domDocument",
"->",
"createElement",
"(",
"\"dico\"",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"language",
"=>",... | Render the Dico
@param \DOMDocument $domDocument DOMDocument for which the Dico should be rendered
@return \DOMElement | [
"Render",
"the",
"Dico"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Elements/Dico.php#L283-L296 |
19,869 | gries/rcon | src/ConnectionFactory.php | ConnectionFactory.create | public static function create($host, $port, $password)
{
$factory = new \Socket\Raw\Factory();
$socket = $factory->createClient(sprintf('%s:%s', $host, $port));
return new \gries\Rcon\Connection($socket, $password);
} | php | public static function create($host, $port, $password)
{
$factory = new \Socket\Raw\Factory();
$socket = $factory->createClient(sprintf('%s:%s', $host, $port));
return new \gries\Rcon\Connection($socket, $password);
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"host",
",",
"$",
"port",
",",
"$",
"password",
")",
"{",
"$",
"factory",
"=",
"new",
"\\",
"Socket",
"\\",
"Raw",
"\\",
"Factory",
"(",
")",
";",
"$",
"socket",
"=",
"$",
"factory",
"->",
"create... | Create a new RconConnection
@param $host
@param $port
@param $password
@return \gries\Rcon\Connection | [
"Create",
"a",
"new",
"RconConnection"
] | 7fada05b329d89542692af00ab80db02ad59d45d | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/ConnectionFactory.php#L21-L27 |
19,870 | maniaplanet/maniaplanet-ws-sdk | libraries/Maniaplanet/WebServices/ManiaConnect/Client.php | Client.getLoginURL | function getLoginURL($scope = null, $redirectURI = null)
{
$redirectURI = $redirectURI ? : $this->getCurrentURI();
self::$persistance->setVariable('redirect_uri', $redirectURI);
return $this->getAuthorizationURL($redirectURI, $scope);
} | php | function getLoginURL($scope = null, $redirectURI = null)
{
$redirectURI = $redirectURI ? : $this->getCurrentURI();
self::$persistance->setVariable('redirect_uri', $redirectURI);
return $this->getAuthorizationURL($redirectURI, $scope);
} | [
"function",
"getLoginURL",
"(",
"$",
"scope",
"=",
"null",
",",
"$",
"redirectURI",
"=",
"null",
")",
"{",
"$",
"redirectURI",
"=",
"$",
"redirectURI",
"?",
":",
"$",
"this",
"->",
"getCurrentURI",
"(",
")",
";",
"self",
"::",
"$",
"persistance",
"->",... | When a user is not authentified, you need to create a link to the URL
returned by this method.
@param string $scope Space-separated list of scopes. Leave empty if you just need the basic one
@param string $redirectURI Where to redirect the user after auth. Leave empty for the current URI
@return string Login URL | [
"When",
"a",
"user",
"is",
"not",
"authentified",
"you",
"need",
"to",
"create",
"a",
"link",
"to",
"the",
"URL",
"returned",
"by",
"this",
"method",
"."
] | 027a458388035fe66f2f56ff3ea1f85eff2a5a4e | https://github.com/maniaplanet/maniaplanet-ws-sdk/blob/027a458388035fe66f2f56ff3ea1f85eff2a5a4e/libraries/Maniaplanet/WebServices/ManiaConnect/Client.php#L72-L77 |
19,871 | maniaplanet/maniaplanet-ws-sdk | libraries/Maniaplanet/WebServices/ManiaConnect/Client.php | Client.getLogoutURL | function getLogoutURL($redirectURI = null)
{
$redirectURI = $redirectURI ? : $this->getCurrentURI();
return $this->logoutURL.'?'.http_build_query(array('redirect_uri' => $redirectURI),
'', '&');
} | php | function getLogoutURL($redirectURI = null)
{
$redirectURI = $redirectURI ? : $this->getCurrentURI();
return $this->logoutURL.'?'.http_build_query(array('redirect_uri' => $redirectURI),
'', '&');
} | [
"function",
"getLogoutURL",
"(",
"$",
"redirectURI",
"=",
"null",
")",
"{",
"$",
"redirectURI",
"=",
"$",
"redirectURI",
"?",
":",
"$",
"this",
"->",
"getCurrentURI",
"(",
")",
";",
"return",
"$",
"this",
"->",
"logoutURL",
".",
"'?'",
".",
"http_build_q... | If you want to place a "logout" button, you can use this link to log the
user out of the player page too. Don't forget to empty your sessions .
@see \Maniaplanet\WebServices\ManiaConnect\Client::logout()
@param string $redirectURI Where to redirect the user after he logged out. Leave empty for current URI
@return stri... | [
"If",
"you",
"want",
"to",
"place",
"a",
"logout",
"button",
"you",
"can",
"use",
"this",
"link",
"to",
"log",
"the",
"user",
"out",
"of",
"the",
"player",
"page",
"too",
".",
"Don",
"t",
"forget",
"to",
"empty",
"your",
"sessions",
"."
] | 027a458388035fe66f2f56ff3ea1f85eff2a5a4e | https://github.com/maniaplanet/maniaplanet-ws-sdk/blob/027a458388035fe66f2f56ff3ea1f85eff2a5a4e/libraries/Maniaplanet/WebServices/ManiaConnect/Client.php#L87-L92 |
19,872 | maniaplanet/maniaplanet-ws-sdk | libraries/Maniaplanet/WebServices/ManiaConnect/Client.php | Client.getAccessToken | protected function getAccessToken()
{
$token = self::$persistance->getVariable('token');
if(!$this->isAccessTokenExpired($token))
{
return $token->access_token;
}
else if ($token !== null && $token->refresh_token !== null)
{
$token = $this->getTokenFromRefreshToken($token->refresh_token);
return $... | php | protected function getAccessToken()
{
$token = self::$persistance->getVariable('token');
if(!$this->isAccessTokenExpired($token))
{
return $token->access_token;
}
else if ($token !== null && $token->refresh_token !== null)
{
$token = $this->getTokenFromRefreshToken($token->refresh_token);
return $... | [
"protected",
"function",
"getAccessToken",
"(",
")",
"{",
"$",
"token",
"=",
"self",
"::",
"$",
"persistance",
"->",
"getVariable",
"(",
"'token'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isAccessTokenExpired",
"(",
"$",
"token",
")",
")",
"{",
"... | Tries to get an access token.
If one is found in the session, it returns it.
If a code is found in the request, it tries to exchange it for an access
token on the OAuth2 Token Endpoint
Else it returns false
@return string An OAuth2 access token, or false if none is found | [
"Tries",
"to",
"get",
"an",
"access",
"token",
".",
"If",
"one",
"is",
"found",
"in",
"the",
"session",
"it",
"returns",
"it",
".",
"If",
"a",
"code",
"is",
"found",
"in",
"the",
"request",
"it",
"tries",
"to",
"exchange",
"it",
"for",
"an",
"access"... | 027a458388035fe66f2f56ff3ea1f85eff2a5a4e | https://github.com/maniaplanet/maniaplanet-ws-sdk/blob/027a458388035fe66f2f56ff3ea1f85eff2a5a4e/libraries/Maniaplanet/WebServices/ManiaConnect/Client.php#L193-L221 |
19,873 | digitalkaoz/versioneye-php | src/Output/Projects.php | Projects.all | public function all(OutputInterface $output, array $response)
{
$this->printTable($output,
['Key', 'Name', 'Type', 'Public', 'Dependencies', 'Outdated', 'Updated At', 'Bad Licenses', 'Unknown Licenses'],
['ids', 'name', 'project_type', 'public', 'dep_number', 'out_number', 'updated_a... | php | public function all(OutputInterface $output, array $response)
{
$this->printTable($output,
['Key', 'Name', 'Type', 'Public', 'Dependencies', 'Outdated', 'Updated At', 'Bad Licenses', 'Unknown Licenses'],
['ids', 'name', 'project_type', 'public', 'dep_number', 'out_number', 'updated_a... | [
"public",
"function",
"all",
"(",
"OutputInterface",
"$",
"output",
",",
"array",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"printTable",
"(",
"$",
"output",
",",
"[",
"'Key'",
",",
"'Name'",
",",
"'Type'",
",",
"'Public'",
",",
"'Dependencies'",
","... | output for projects API.
@param OutputInterface $output
@param array $response | [
"output",
"for",
"projects",
"API",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/Projects.php#L20-L38 |
19,874 | digitalkaoz/versioneye-php | src/Output/Projects.php | Projects.licenses | public function licenses(OutputInterface $output, array $response)
{
$table = $this->createTable($output);
$table->setHeaders(['license', 'name']);
foreach ($response['licenses'] as $license => $projects) {
foreach ($projects as $project) {
$name = $license ==... | php | public function licenses(OutputInterface $output, array $response)
{
$table = $this->createTable($output);
$table->setHeaders(['license', 'name']);
foreach ($response['licenses'] as $license => $projects) {
foreach ($projects as $project) {
$name = $license ==... | [
"public",
"function",
"licenses",
"(",
"OutputInterface",
"$",
"output",
",",
"array",
"$",
"response",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"createTable",
"(",
"$",
"output",
")",
";",
"$",
"table",
"->",
"setHeaders",
"(",
"[",
"'license'",
... | output for licenses API.
@param OutputInterface $output
@param array $response | [
"output",
"for",
"licenses",
"API",
"."
] | 7b8eb9cdc83e01138dda0e709c07e3beb6aad136 | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/Projects.php#L46-L61 |
19,875 | sebastiaanluca/laravel-unbreakable-migrations | src/TransactionalMigration.php | TransactionalMigration.executeInTransaction | protected function executeInTransaction(string $method) : void
{
try {
$this->database->beginTransaction();
$this->{$method}();
$this->database->commit();
} catch (Exception $exception) {
$this->database->rollBack();
$this->handleExcepti... | php | protected function executeInTransaction(string $method) : void
{
try {
$this->database->beginTransaction();
$this->{$method}();
$this->database->commit();
} catch (Exception $exception) {
$this->database->rollBack();
$this->handleExcepti... | [
"protected",
"function",
"executeInTransaction",
"(",
"string",
"$",
"method",
")",
":",
"void",
"{",
"try",
"{",
"$",
"this",
"->",
"database",
"->",
"beginTransaction",
"(",
")",
";",
"$",
"this",
"->",
"{",
"$",
"method",
"}",
"(",
")",
";",
"$",
... | Execute the migration command inside a transaction layer.
@param string $method
@return void | [
"Execute",
"the",
"migration",
"command",
"inside",
"a",
"transaction",
"layer",
"."
] | 3c831b204770b80c97351c3b881dcbf924236a13 | https://github.com/sebastiaanluca/laravel-unbreakable-migrations/blob/3c831b204770b80c97351c3b881dcbf924236a13/src/TransactionalMigration.php#L38-L51 |
19,876 | datasift/php_webdriver | src/php/DataSift/WebDriver/WebDriverContainer.php | WebDriverContainer.getElement | public function getElement($using, $value)
{
// try to get the requested element from the open session
try {
$results = $this->curl(
'POST',
'/element',
array(
'using' => $using,
'value' => $value
... | php | public function getElement($using, $value)
{
// try to get the requested element from the open session
try {
$results = $this->curl(
'POST',
'/element',
array(
'using' => $using,
'value' => $value
... | [
"public",
"function",
"getElement",
"(",
"$",
"using",
",",
"$",
"value",
")",
"{",
"// try to get the requested element from the open session",
"try",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"curl",
"(",
"'POST'",
",",
"'/element'",
",",
"array",
"(",
"'... | retrieve an element from the currently loaded page
@param string $using the search strategy
@param string $value the term to search for
@return WebDriverElement the element that has been searched for | [
"retrieve",
"an",
"element",
"from",
"the",
"currently",
"loaded",
"page"
] | efca991198616b53c8f40b59ad05306e2b10e7f0 | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/WebDriver/WebDriverContainer.php#L51-L80 |
19,877 | datasift/php_webdriver | src/php/DataSift/WebDriver/WebDriverContainer.php | WebDriverContainer.getElements | public function getElements($using, $value)
{
try {
$results = $this->curl(
'POST',
'/elements',
array(
'using' => $using,
'value' => $value
)
);
}
catch (E5xx_NoSu... | php | public function getElements($using, $value)
{
try {
$results = $this->curl(
'POST',
'/elements',
array(
'using' => $using,
'value' => $value
)
);
}
catch (E5xx_NoSu... | [
"public",
"function",
"getElements",
"(",
"$",
"using",
",",
"$",
"value",
")",
"{",
"try",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"curl",
"(",
"'POST'",
",",
"'/elements'",
",",
"array",
"(",
"'using'",
"=>",
"$",
"using",
",",
"'value'",
"=>"... | Find all occurances of an element on the current page
@param string $using the search strategy
@param string $value the term to search for
@return array(WebDriverElement) | [
"Find",
"all",
"occurances",
"of",
"an",
"element",
"on",
"the",
"current",
"page"
] | efca991198616b53c8f40b59ad05306e2b10e7f0 | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/WebDriver/WebDriverContainer.php#L90-L125 |
19,878 | datasift/php_webdriver | src/php/DataSift/WebDriver/WebDriverContainer.php | WebDriverContainer.newWebDriverElement | protected function newWebDriverElement($value)
{
// is the returned element in the format we expect?
if (!array_key_exists('ELEMENT', (array) $value)) {
// no, it is not
return null;
}
return new WebDriverElement(
$this->getElementPath($value['ELE... | php | protected function newWebDriverElement($value)
{
// is the returned element in the format we expect?
if (!array_key_exists('ELEMENT', (array) $value)) {
// no, it is not
return null;
}
return new WebDriverElement(
$this->getElementPath($value['ELE... | [
"protected",
"function",
"newWebDriverElement",
"(",
"$",
"value",
")",
"{",
"// is the returned element in the format we expect?",
"if",
"(",
"!",
"array_key_exists",
"(",
"'ELEMENT'",
",",
"(",
"array",
")",
"$",
"value",
")",
")",
"{",
"// no, it is not",
"return... | helper method to wrap an element inside the WebDriverElement
object
@param array $value the raw element data returned from webdriver
@return WebDriverElement the WebDriverElement object for the raw
element | [
"helper",
"method",
"to",
"wrap",
"an",
"element",
"inside",
"the",
"WebDriverElement",
"object"
] | efca991198616b53c8f40b59ad05306e2b10e7f0 | https://github.com/datasift/php_webdriver/blob/efca991198616b53c8f40b59ad05306e2b10e7f0/src/php/DataSift/WebDriver/WebDriverContainer.php#L136-L148 |
19,879 | xinix-technology/norm | src/Norm/Collection.php | Collection.schema | public function schema($key = null, $value = null)
{
$numArgs = func_num_args();
if (0 === $numArgs) {
return $this->schema;
} elseif (1 === $numArgs) {
if (is_array($key)) {
$this->schema = new NObject($key);
} elseif ($this->schema->offse... | php | public function schema($key = null, $value = null)
{
$numArgs = func_num_args();
if (0 === $numArgs) {
return $this->schema;
} elseif (1 === $numArgs) {
if (is_array($key)) {
$this->schema = new NObject($key);
} elseif ($this->schema->offse... | [
"public",
"function",
"schema",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"numArgs",
"=",
"func_num_args",
"(",
")",
";",
"if",
"(",
"0",
"===",
"$",
"numArgs",
")",
"{",
"return",
"$",
"this",
"->",
"schema",
"... | Getter and setter of collection schema. If there is no argument specified, the method will set and override schema. If argument specified, method will act as getter to specific field schema.
@param string $schema
@return mixed | [
"Getter",
"and",
"setter",
"of",
"collection",
"schema",
".",
"If",
"there",
"is",
"no",
"argument",
"specified",
"the",
"method",
"will",
"set",
"and",
"override",
"schema",
".",
"If",
"argument",
"specified",
"method",
"will",
"act",
"as",
"getter",
"to",
... | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L172-L186 |
19,880 | xinix-technology/norm | src/Norm/Collection.php | Collection.prepare | public function prepare($key, $value, $schema = null)
{
if (is_null($schema)) {
$schema = $this->schema($key);
if (is_null($schema)) {
return $value;
// throw new \Exception('Cannot prepare data to set. Schema not found for key ['.$key.'].');
... | php | public function prepare($key, $value, $schema = null)
{
if (is_null($schema)) {
$schema = $this->schema($key);
if (is_null($schema)) {
return $value;
// throw new \Exception('Cannot prepare data to set. Schema not found for key ['.$key.'].');
... | [
"public",
"function",
"prepare",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"schema",
")",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"schema",
"(",
"$",
"key",
")",
";",... | Prepare data value for specific field name
@param string $key Field name
@param mixed $value Original data value
@param Norm\Schema\Field $schema If specified will override default schema
@return mixed Prepared data value | [
"Prepare",
"data",
"value",
"for",
"specific",
"field",
"name"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L197-L207 |
19,881 | xinix-technology/norm | src/Norm/Collection.php | Collection.attach | public function attach($document)
{
if (isset($this->connection)) {
$document = $this->connection->unmarshall($document);
}
// wrap document as NObject instance to make sure it can be override by hooks
$document = new NObject($document);
$this->applyHook('attach... | php | public function attach($document)
{
if (isset($this->connection)) {
$document = $this->connection->unmarshall($document);
}
// wrap document as NObject instance to make sure it can be override by hooks
$document = new NObject($document);
$this->applyHook('attach... | [
"public",
"function",
"attach",
"(",
"$",
"document",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"connection",
")",
")",
"{",
"$",
"document",
"=",
"$",
"this",
"->",
"connection",
"->",
"unmarshall",
"(",
"$",
"document",
")",
";",
"}",
... | Attach document to Norm system as model.
@param mixed document Raw document data
@return Norm\Model Attached model | [
"Attach",
"document",
"to",
"Norm",
"system",
"as",
"model",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L216-L241 |
19,882 | xinix-technology/norm | src/Norm/Collection.php | Collection.find | public function find($criteria = array())
{
if (!is_array($criteria)) {
$criteria = array(
'$id' => $criteria,
);
}
// wrap criteria as NObject instance to make sure it can be override by hooks
$criteria = new NObject($criteria);
$thi... | php | public function find($criteria = array())
{
if (!is_array($criteria)) {
$criteria = array(
'$id' => $criteria,
);
}
// wrap criteria as NObject instance to make sure it can be override by hooks
$criteria = new NObject($criteria);
$thi... | [
"public",
"function",
"find",
"(",
"$",
"criteria",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"criteria",
")",
")",
"{",
"$",
"criteria",
"=",
"array",
"(",
"'$id'",
"=>",
"$",
"criteria",
",",
")",
";",
"}",
"// wra... | Find data with specified criteria
@param array $criteria
@return Norm\Cursor | [
"Find",
"data",
"with",
"specified",
"criteria"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L250-L266 |
19,883 | xinix-technology/norm | src/Norm/Collection.php | Collection.findOne | public function findOne($criteria = array())
{
$model = $this->fetchCache($criteria);
if (is_null($model)) {
$cursor = $this->find($criteria);
$model = $cursor->getNext();
$this->rememberCache($criteria, $model);
}
return $model;
} | php | public function findOne($criteria = array())
{
$model = $this->fetchCache($criteria);
if (is_null($model)) {
$cursor = $this->find($criteria);
$model = $cursor->getNext();
$this->rememberCache($criteria, $model);
}
return $model;
} | [
"public",
"function",
"findOne",
"(",
"$",
"criteria",
"=",
"array",
"(",
")",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"fetchCache",
"(",
"$",
"criteria",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"model",
")",
")",
"{",
"$",
"cursor",
"=... | Find one document from collection
@param array|mixed $criteria Criteria to search
@return Norm\Model | [
"Find",
"one",
"document",
"from",
"collection"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L275-L286 |
19,884 | xinix-technology/norm | src/Norm/Collection.php | Collection.newInstance | public function newInstance($cloned = array())
{
if ($cloned instanceof Model) {
$cloned = $cloned->toArray(Model::FETCH_PUBLISHED);
}
if (isset($this->options['model'])) {
$Model = $this->options['model'];
return new $Model($cloned, array('collection' =>... | php | public function newInstance($cloned = array())
{
if ($cloned instanceof Model) {
$cloned = $cloned->toArray(Model::FETCH_PUBLISHED);
}
if (isset($this->options['model'])) {
$Model = $this->options['model'];
return new $Model($cloned, array('collection' =>... | [
"public",
"function",
"newInstance",
"(",
"$",
"cloned",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"cloned",
"instanceof",
"Model",
")",
"{",
"$",
"cloned",
"=",
"$",
"cloned",
"->",
"toArray",
"(",
"Model",
"::",
"FETCH_PUBLISHED",
")",
";",
... | Create new instance of model
@param array|\Norm\Model $cloned Model to clone
@return \Norm\Model | [
"Create",
"new",
"instance",
"of",
"model"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L295-L307 |
19,885 | xinix-technology/norm | src/Norm/Collection.php | Collection.filter | public function filter(Model $model, $key = null)
{
if (is_null($this->filter)) {
$this->filter = Filter::fromSchema($this->schema());
}
$this->applyHook('filtering', $model, $key);
$result = $this->filter->run($model, $key);
$this->applyHook('filtered', $model, ... | php | public function filter(Model $model, $key = null)
{
if (is_null($this->filter)) {
$this->filter = Filter::fromSchema($this->schema());
}
$this->applyHook('filtering', $model, $key);
$result = $this->filter->run($model, $key);
$this->applyHook('filtered', $model, ... | [
"public",
"function",
"filter",
"(",
"Model",
"$",
"model",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"filter",
")",
")",
"{",
"$",
"this",
"->",
"filter",
"=",
"Filter",
"::",
"fromSchema",
"(",
"$",
"... | Filter model data with functions to cleanse, prepare and validate data. When key argument specified, filter will run partially for specified key only.
@param \Norm\Model $model
@param string $key Key field of model
@return bool True if success and false if fail | [
"Filter",
"model",
"data",
"with",
"functions",
"to",
"cleanse",
"prepare",
"and",
"validate",
"data",
".",
"When",
"key",
"argument",
"specified",
"filter",
"will",
"run",
"partially",
"for",
"specified",
"key",
"only",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L318-L329 |
19,886 | xinix-technology/norm | src/Norm/Collection.php | Collection.save | public function save(Model $model, $options = array())
{
$options = array_merge(array(
'filter' => true,
'observer' => true,
), $options);
if ($options['filter']) {
$this->filter($model);
}
if ($options['observer']) {
$this->a... | php | public function save(Model $model, $options = array())
{
$options = array_merge(array(
'filter' => true,
'observer' => true,
), $options);
if ($options['filter']) {
$this->filter($model);
}
if ($options['observer']) {
$this->a... | [
"public",
"function",
"save",
"(",
"Model",
"$",
"model",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"array",
"(",
"'filter'",
"=>",
"true",
",",
"'observer'",
"=>",
"true",
",",
")",
",",
"$",
"... | Save model to persistent state
@param \Norm\Model $model
@param array $options
@return void | [
"Save",
"model",
"to",
"persistent",
"state"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L339-L363 |
19,887 | xinix-technology/norm | src/Norm/Collection.php | Collection.remove | public function remove(Model $model = null)
{
if (func_num_args() === 0) {
$this->connection->remove($this);
} else {
// avoid remove empty model
if (is_null($model)) {
throw new \Exception('[Norm/Collection] Cannot remove null model');
... | php | public function remove(Model $model = null)
{
if (func_num_args() === 0) {
$this->connection->remove($this);
} else {
// avoid remove empty model
if (is_null($model)) {
throw new \Exception('[Norm/Collection] Cannot remove null model');
... | [
"public",
"function",
"remove",
"(",
"Model",
"$",
"model",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"0",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"remove",
"(",
"$",
"this",
")",
";",
"}",
"else",
"{",
"// avoid ... | Remove single model
@param \Norm\Model $model
@return void | [
"Remove",
"single",
"model"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L372-L391 |
19,888 | xinix-technology/norm | src/Norm/Collection.php | Collection.rememberCache | protected function rememberCache($criteria, $model)
{
$ser = serialize($criteria);
$this->cache[$ser] = $model;
} | php | protected function rememberCache($criteria, $model)
{
$ser = serialize($criteria);
$this->cache[$ser] = $model;
} | [
"protected",
"function",
"rememberCache",
"(",
"$",
"criteria",
",",
"$",
"model",
")",
"{",
"$",
"ser",
"=",
"serialize",
"(",
"$",
"criteria",
")",
";",
"$",
"this",
"->",
"cache",
"[",
"$",
"ser",
"]",
"=",
"$",
"model",
";",
"}"
] | Put item in cache bags.
@method rememberCache
@param mixed $criteria
@param \Norm\Model $model [description]
@return void | [
"Put",
"item",
"in",
"cache",
"bags",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L468-L473 |
19,889 | xinix-technology/norm | src/Norm/Collection.php | Collection.fetchCache | protected function fetchCache($criteria)
{
$ser = serialize($criteria);
if (isset($this->cache[$ser])) {
return $this->cache[$ser];
}
} | php | protected function fetchCache($criteria)
{
$ser = serialize($criteria);
if (isset($this->cache[$ser])) {
return $this->cache[$ser];
}
} | [
"protected",
"function",
"fetchCache",
"(",
"$",
"criteria",
")",
"{",
"$",
"ser",
"=",
"serialize",
"(",
"$",
"criteria",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"ser",
"]",
")",
")",
"{",
"return",
"$",
"this",
... | Get item from cache.
@method fetchCache
@param NObject $criteria
@return void|\Norm\Model | [
"Get",
"item",
"from",
"cache",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Collection.php#L484-L491 |
19,890 | Josantonius/WP_Menu | src/class-wp-menu.php | WP_Menu.add | public static function add( $type, $data = [], $function = 0, $styles = 0, $scripts = 0 ) {
if ( ! is_admin() || ! self::required_params_exist( $type, $data ) ) {
return false;
}
$data = self::set_params( $data, $function, $styles, $scripts );
$slug = $data['slug'];
self::$data[ $type ][ $slug ] = $dat... | php | public static function add( $type, $data = [], $function = 0, $styles = 0, $scripts = 0 ) {
if ( ! is_admin() || ! self::required_params_exist( $type, $data ) ) {
return false;
}
$data = self::set_params( $data, $function, $styles, $scripts );
$slug = $data['slug'];
self::$data[ $type ][ $slug ] = $dat... | [
"public",
"static",
"function",
"add",
"(",
"$",
"type",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"function",
"=",
"0",
",",
"$",
"styles",
"=",
"0",
",",
"$",
"scripts",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_admin",
"(",
")",
"||",
"!",
... | Add menu or submenu.
@param string $type → menu | submenu.
@param array $data → settings.
@param mixed $function → method to be called to output page content.
@param mixed $styles → method to be called to load page styles.
@param mixed $scripts → method to be called to load page scripts.
@see https://github.co... | [
"Add",
"menu",
"or",
"submenu",
"."
] | 90df3355007083cc156353dde94ee73d3fea0ce5 | https://github.com/Josantonius/WP_Menu/blob/90df3355007083cc156353dde94ee73d3fea0ce5/src/class-wp-menu.php#L40-L59 |
19,891 | Josantonius/WP_Menu | src/class-wp-menu.php | WP_Menu.required_params_exist | private static function required_params_exist( $type, $data ) {
$required = [ 'name', 'slug' ];
if ( 'submenu' === $type ) {
array_push( $required, 'parent' );
}
foreach ( $required as $field ) {
if ( ! isset( $data[ $field ] ) || empty( $data[ $field ] ) ) {
return false;
}
}
return true;
... | php | private static function required_params_exist( $type, $data ) {
$required = [ 'name', 'slug' ];
if ( 'submenu' === $type ) {
array_push( $required, 'parent' );
}
foreach ( $required as $field ) {
if ( ! isset( $data[ $field ] ) || empty( $data[ $field ] ) ) {
return false;
}
}
return true;
... | [
"private",
"static",
"function",
"required_params_exist",
"(",
"$",
"type",
",",
"$",
"data",
")",
"{",
"$",
"required",
"=",
"[",
"'name'",
",",
"'slug'",
"]",
";",
"if",
"(",
"'submenu'",
"===",
"$",
"type",
")",
"{",
"array_push",
"(",
"$",
"require... | Validate if the required parameters exist.
@since 1.0.4
@param string $type → menu | submenu.
@param array $data → settings.
@return boolean | [
"Validate",
"if",
"the",
"required",
"parameters",
"exist",
"."
] | 90df3355007083cc156353dde94ee73d3fea0ce5 | https://github.com/Josantonius/WP_Menu/blob/90df3355007083cc156353dde94ee73d3fea0ce5/src/class-wp-menu.php#L121-L136 |
19,892 | Josantonius/WP_Menu | src/class-wp-menu.php | WP_Menu.set | private static function set( $type, $slug ) {
global $pagenow;
$data = self::$data[ $type ][ $slug ];
do_action( 'wp_menu_pre_add_' . $type . '_page' );
if ( 'menu' === $type ) {
$page = add_menu_page(
$data['title'],
$data['name'],
$data['capability'],
$data['slug'],
$data['function... | php | private static function set( $type, $slug ) {
global $pagenow;
$data = self::$data[ $type ][ $slug ];
do_action( 'wp_menu_pre_add_' . $type . '_page' );
if ( 'menu' === $type ) {
$page = add_menu_page(
$data['title'],
$data['name'],
$data['capability'],
$data['slug'],
$data['function... | [
"private",
"static",
"function",
"set",
"(",
"$",
"type",
",",
"$",
"slug",
")",
"{",
"global",
"$",
"pagenow",
";",
"$",
"data",
"=",
"self",
"::",
"$",
"data",
"[",
"$",
"type",
"]",
"[",
"$",
"slug",
"]",
";",
"do_action",
"(",
"'wp_menu_pre_add... | Set menu and submenu admin.
@since 1.0.1
@param string $type → menu|submenu.
@param string $slug → menu|submenu slug. | [
"Set",
"menu",
"and",
"submenu",
"admin",
"."
] | 90df3355007083cc156353dde94ee73d3fea0ce5 | https://github.com/Josantonius/WP_Menu/blob/90df3355007083cc156353dde94ee73d3fea0ce5/src/class-wp-menu.php#L146-L184 |
19,893 | Josantonius/WP_Menu | src/class-wp-menu.php | WP_Menu.validate_method | private static function validate_method( $method ) {
if ( $method && isset( $method[0] ) && isset( $method[1] ) ) {
if ( method_exists( $method[0], $method[1] ) ) {
return true;
}
}
return false;
} | php | private static function validate_method( $method ) {
if ( $method && isset( $method[0] ) && isset( $method[1] ) ) {
if ( method_exists( $method[0], $method[1] ) ) {
return true;
}
}
return false;
} | [
"private",
"static",
"function",
"validate_method",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"$",
"method",
"&&",
"isset",
"(",
"$",
"method",
"[",
"0",
"]",
")",
"&&",
"isset",
"(",
"$",
"method",
"[",
"1",
"]",
")",
")",
"{",
"if",
"(",
"method... | Check if method exists.
@since 1.0.2
@param array $method → [class|object, method].
@return boolean | [
"Check",
"if",
"method",
"exists",
"."
] | 90df3355007083cc156353dde94ee73d3fea0ce5 | https://github.com/Josantonius/WP_Menu/blob/90df3355007083cc156353dde94ee73d3fea0ce5/src/class-wp-menu.php#L195-L204 |
19,894 | cohesion/cohesion-core | src/Structure/DTO.php | DTO.getVarsWithoutCircularReferences | private function getVarsWithoutCircularReferences($showNulls, &$previousDTOs = []) {
$previousDTOs[spl_object_hash($this)] = true;
$classProperties = $this->reflection->getProperties(\ReflectionProperty::IS_PROTECTED);
$vars = array();
foreach ($classProperties as $property) {
... | php | private function getVarsWithoutCircularReferences($showNulls, &$previousDTOs = []) {
$previousDTOs[spl_object_hash($this)] = true;
$classProperties = $this->reflection->getProperties(\ReflectionProperty::IS_PROTECTED);
$vars = array();
foreach ($classProperties as $property) {
... | [
"private",
"function",
"getVarsWithoutCircularReferences",
"(",
"$",
"showNulls",
",",
"&",
"$",
"previousDTOs",
"=",
"[",
"]",
")",
"{",
"$",
"previousDTOs",
"[",
"spl_object_hash",
"(",
"$",
"this",
")",
"]",
"=",
"true",
";",
"$",
"classProperties",
"=",
... | Export protected class parameters as an associative array.
This function will make sure that even if the object has a circular
reference it won't crash the system by calling the `getVars` function.
If there is a circular reference the later one will be left out of the
output | [
"Export",
"protected",
"class",
"parameters",
"as",
"an",
"associative",
"array",
"."
] | c6352aef7336e06285f0943da68235dc45523998 | https://github.com/cohesion/cohesion-core/blob/c6352aef7336e06285f0943da68235dc45523998/src/Structure/DTO.php#L120-L158 |
19,895 | aedart/laravel-helpers | src/Traits/Redis/RedisTrait.php | RedisTrait.getDefaultRedis | public function getDefaultRedis(): ?Connection
{
// From Laravel 5.4, the redis facade now returns the
// Redis Manager, which is why we must use it to obtain
// the default Redis connection. Thus, the
// "Illuminate\Contracts\Redis\Database" interface is no
// longer used.
... | php | public function getDefaultRedis(): ?Connection
{
// From Laravel 5.4, the redis facade now returns the
// Redis Manager, which is why we must use it to obtain
// the default Redis connection. Thus, the
// "Illuminate\Contracts\Redis\Database" interface is no
// longer used.
... | [
"public",
"function",
"getDefaultRedis",
"(",
")",
":",
"?",
"Connection",
"{",
"// From Laravel 5.4, the redis facade now returns the",
"// Redis Manager, which is why we must use it to obtain",
"// the default Redis connection. Thus, the",
"// \"Illuminate\\Contracts\\Redis\\Database\" int... | Get a default redis value, if any is available
@return Connection|null A default redis value or Null if no default value is available | [
"Get",
"a",
"default",
"redis",
"value",
"if",
"any",
"is",
"available"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Redis/RedisTrait.php#L76-L88 |
19,896 | steeffeen/FancyManiaLinks | FML/UniqueID.php | UniqueID.check | public static function check(Identifiable $element)
{
$elementId = $element->getId();
if (!$elementId) {
$element->setId(new static());
return $element->getId();
}
$dangerousCharacters = array(' ', '|', PHP_EOL);
$danger = false;
... | php | public static function check(Identifiable $element)
{
$elementId = $element->getId();
if (!$elementId) {
$element->setId(new static());
return $element->getId();
}
$dangerousCharacters = array(' ', '|', PHP_EOL);
$danger = false;
... | [
"public",
"static",
"function",
"check",
"(",
"Identifiable",
"$",
"element",
")",
"{",
"$",
"elementId",
"=",
"$",
"element",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"$",
"elementId",
")",
"{",
"$",
"element",
"->",
"setId",
"(",
"new",
"stati... | Check and return the Id of an Identifable Element
@param Identifiable $element Identifable element
@return string | [
"Check",
"and",
"return",
"the",
"Id",
"of",
"an",
"Identifable",
"Element"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/UniqueID.php#L48-L73 |
19,897 | simple-php-mvc/simple-php-mvc | src/MVC/Server/HttpRequest.php | HttpRequest.is | public function is($characteristic)
{
switch ( strtolower($characteristic) ) {
case "ajax":
return (
isset($this->_env['HTTP_X_REQUESTED_WITH']) &&
$this->_env['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest"
);
cas... | php | public function is($characteristic)
{
switch ( strtolower($characteristic) ) {
case "ajax":
return (
isset($this->_env['HTTP_X_REQUESTED_WITH']) &&
$this->_env['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest"
);
cas... | [
"public",
"function",
"is",
"(",
"$",
"characteristic",
")",
"{",
"switch",
"(",
"strtolower",
"(",
"$",
"characteristic",
")",
")",
"{",
"case",
"\"ajax\"",
":",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"_env",
"[",
"'HTTP_X_REQUESTED_WITH'",
"]",
... | Checks for request characteristics.
The full list of request characteristics is as follows:
* "ajax" - XHR
* "delete" - DELETE REQUEST_METHOD
* "flash" - "Shockwave Flash" HTTP_USER_AGENT
* "get" - GET REQUEST_METHOD
* "head" - HEAD REQUEST_METHOD
* "mobile" - any one of the following HTTP_USER_AGENTS:
1. "Android"... | [
"Checks",
"for",
"request",
"characteristics",
"."
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Server/HttpRequest.php#L277-L318 |
19,898 | simple-php-mvc/simple-php-mvc | src/MVC/Server/HttpRequest.php | HttpRequest.parseUrl | protected function parseUrl($url = "")
{
$parsed = ($url) ? parse_url($url) : parse_url($this->_env['REQUEST_URI']);
if (preg_match('/[a-zA-Z0-9_]+\.php/i', $parsed['path'], $matches)) {
$parsed['path'] = preg_replace("/$matches[0]/", '/', $parsed['path']);
}
... | php | protected function parseUrl($url = "")
{
$parsed = ($url) ? parse_url($url) : parse_url($this->_env['REQUEST_URI']);
if (preg_match('/[a-zA-Z0-9_]+\.php/i', $parsed['path'], $matches)) {
$parsed['path'] = preg_replace("/$matches[0]/", '/', $parsed['path']);
}
... | [
"protected",
"function",
"parseUrl",
"(",
"$",
"url",
"=",
"\"\"",
")",
"{",
"$",
"parsed",
"=",
"(",
"$",
"url",
")",
"?",
"parse_url",
"(",
"$",
"url",
")",
":",
"parse_url",
"(",
"$",
"this",
"->",
"_env",
"[",
"'REQUEST_URI'",
"]",
")",
";",
... | Get parsed url
@param string $url Url to parse
@return array Parsed Url | [
"Get",
"parsed",
"url"
] | e319eb09d29afad6993acb4a7e35f32a87dd0841 | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Server/HttpRequest.php#L396-L405 |
19,899 | steeffeen/FancyManiaLinks | FML/Script/Features/ControlScript.php | ControlScript.setControl | public function setControl(Control $control)
{
$control->checkId();
$control->addScriptFeature($this);
$this->control = $control;
$this->updateScriptEvents();
return $this;
} | php | public function setControl(Control $control)
{
$control->checkId();
$control->addScriptFeature($this);
$this->control = $control;
$this->updateScriptEvents();
return $this;
} | [
"public",
"function",
"setControl",
"(",
"Control",
"$",
"control",
")",
"{",
"$",
"control",
"->",
"checkId",
"(",
")",
";",
"$",
"control",
"->",
"addScriptFeature",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"control",
"=",
"$",
"control",
";",
... | Set the Control
@api
@param Control $control Control
@return static | [
"Set",
"the",
"Control"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ControlScript.php#L75-L82 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.