repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
expectation-php/expect | src/matcher/ToContain.php | ToContain.reportFailed | public function reportFailed(FailedMessage $message)
{
$unmatchResults = $this->matchResult->getUnmatchResults();
$message->appendText('Expected ')
->appendText($this->type)
->appendText(' to contain ')
->appendValues($unmatchResults);
} | php | public function reportFailed(FailedMessage $message)
{
$unmatchResults = $this->matchResult->getUnmatchResults();
$message->appendText('Expected ')
->appendText($this->type)
->appendText(' to contain ')
->appendValues($unmatchResults);
} | [
"public",
"function",
"reportFailed",
"(",
"FailedMessage",
"$",
"message",
")",
"{",
"$",
"unmatchResults",
"=",
"$",
"this",
"->",
"matchResult",
"->",
"getUnmatchResults",
"(",
")",
";",
"$",
"message",
"->",
"appendText",
"(",
"'Expected '",
")",
"->",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToContain.php#L81-L89 |
expectation-php/expect | src/matcher/ToContain.php | ToContain.reportNegativeFailed | public function reportNegativeFailed(FailedMessage $message)
{
$matchResults = $this->matchResult->getMatchResults();
$message->appendText('Expected ')
->appendText($this->type)
->appendText(' not to contain ')
->appendValues($matchResults);
} | php | public function reportNegativeFailed(FailedMessage $message)
{
$matchResults = $this->matchResult->getMatchResults();
$message->appendText('Expected ')
->appendText($this->type)
->appendText(' not to contain ')
->appendValues($matchResults);
} | [
"public",
"function",
"reportNegativeFailed",
"(",
"FailedMessage",
"$",
"message",
")",
"{",
"$",
"matchResults",
"=",
"$",
"this",
"->",
"matchResult",
"->",
"getMatchResults",
"(",
")",
";",
"$",
"message",
"->",
"appendText",
"(",
"'Expected '",
")",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToContain.php#L94-L102 |
CalderaWP/metaplate-core | src/render.php | render.render_metaplate | public function render_metaplate( $content, $meta_stack = null, $template_data = null, $placement = null ) {
if ( is_null( $meta_stack ) ) {
$meta_stack = data::get_active_metaplates();
}
// clear out <!--metaplate-->
$content = str_replace( '<p><!--metaplate--></p>', '', $content );
// in case the wpa... | php | public function render_metaplate( $content, $meta_stack = null, $template_data = null, $placement = null ) {
if ( is_null( $meta_stack ) ) {
$meta_stack = data::get_active_metaplates();
}
// clear out <!--metaplate-->
$content = str_replace( '<p><!--metaplate--></p>', '', $content );
// in case the wpa... | [
"public",
"function",
"render_metaplate",
"(",
"$",
"content",
",",
"$",
"meta_stack",
"=",
"null",
",",
"$",
"template_data",
"=",
"null",
",",
"$",
"placement",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"meta_stack",
")",
")",
"{",
"$",
... | Return the content with metaplate applied.
@uses "the_content" filter
@param string $content Post content
@param array|null $meta_stalk Optional. The metaplate to use to render the data. If is null, the default, one will be load, if possible, based on current global $post object.
@param array|null $template_data Opti... | [
"Return",
"the",
"content",
"with",
"metaplate",
"applied",
"."
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/render.php#L38-L172 |
CalderaWP/metaplate-core | src/render.php | render.helpers | private function helpers( $handlebars ) {
$helpers = $this->default_helpers();
/**
*
* @param array $helpers {
* Name, class & callback for the helper.
*
* @type string $name Name of helper to use in Handlebars.
* @type string $class Class containing callback function.
* @type ... | php | private function helpers( $handlebars ) {
$helpers = $this->default_helpers();
/**
*
* @param array $helpers {
* Name, class & callback for the helper.
*
* @type string $name Name of helper to use in Handlebars.
* @type string $class Class containing callback function.
* @type ... | [
"private",
"function",
"helpers",
"(",
"$",
"handlebars",
")",
"{",
"$",
"helpers",
"=",
"$",
"this",
"->",
"default_helpers",
"(",
")",
";",
"/**\n\t\t *\n\t\t * @param array $helpers {\n\t\t * Name, class & callback for the helper.\n\t\t *\n\t\t * @type string $name Nam... | Register helpers.
Adds the default helpers, plus any set on "caldera_metaplate_handlebars_helpers" filter.
@param obj|\Handlebars\Handlebars $handlebars Current instance of Handlebars.
@return \Handlebars\Handlebars Current instance of Handlebars with the additional helpers added on. | [
"Register",
"helpers",
"."
] | train | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/render.php#L183-L207 |
KodiComponents/Support | src/HtmlAttributes.php | HtmlAttributes.setHtmlAttribute | public function setHtmlAttribute($key, $attribute)
{
$attribute = $this->prepareHtmlAttributeValue($attribute);
if ($key == 'class') {
$this->htmlAttributes[$key][] = $attribute;
} else {
$this->htmlAttributes[$key] = $attribute;
}
return $this;
... | php | public function setHtmlAttribute($key, $attribute)
{
$attribute = $this->prepareHtmlAttributeValue($attribute);
if ($key == 'class') {
$this->htmlAttributes[$key][] = $attribute;
} else {
$this->htmlAttributes[$key] = $attribute;
}
return $this;
... | [
"public",
"function",
"setHtmlAttribute",
"(",
"$",
"key",
",",
"$",
"attribute",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"prepareHtmlAttributeValue",
"(",
"$",
"attribute",
")",
";",
"if",
"(",
"$",
"key",
"==",
"'class'",
")",
"{",
"$",
"... | @param string $key
@param string|array $attribute
@return $this | [
"@param",
"string",
"$key",
"@param",
"string|array",
"$attribute"
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/HtmlAttributes.php#L42-L53 |
KodiComponents/Support | src/HtmlAttributes.php | HtmlAttributes.setHtmlAttributes | public function setHtmlAttributes(array $attributes)
{
foreach ($attributes as $key => $attribute) {
if (is_numeric($key)) {
$key = $attribute;
}
$this->setHtmlAttribute($key, $attribute);
}
return $this;
} | php | public function setHtmlAttributes(array $attributes)
{
foreach ($attributes as $key => $attribute) {
if (is_numeric($key)) {
$key = $attribute;
}
$this->setHtmlAttribute($key, $attribute);
}
return $this;
} | [
"public",
"function",
"setHtmlAttributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"attribute",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"$",
"key",
"=",
"$"... | @param array $attributes
@return $this | [
"@param",
"array",
"$attributes"
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/HtmlAttributes.php#L60-L71 |
KodiComponents/Support | src/HtmlAttributes.php | HtmlAttributes.replaceHtmlAttribute | public function replaceHtmlAttribute($key, $attribute)
{
$attribute = $this->prepareHtmlAttributeValue($attribute);
$this->htmlAttributes[$key] = $attribute;
return $this;
} | php | public function replaceHtmlAttribute($key, $attribute)
{
$attribute = $this->prepareHtmlAttributeValue($attribute);
$this->htmlAttributes[$key] = $attribute;
return $this;
} | [
"public",
"function",
"replaceHtmlAttribute",
"(",
"$",
"key",
",",
"$",
"attribute",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"prepareHtmlAttributeValue",
"(",
"$",
"attribute",
")",
";",
"$",
"this",
"->",
"htmlAttributes",
"[",
"$",
"key",
"]... | @param string $key
@param string|array $attribute
@return $this | [
"@param",
"string",
"$key",
"@param",
"string|array",
"$attribute"
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/HtmlAttributes.php#L79-L85 |
KodiComponents/Support | src/HtmlAttributes.php | HtmlAttributes.hasClassProperty | public function hasClassProperty($class)
{
if (! is_array($class)) {
$class = func_get_args();
}
if (isset($this->htmlAttributes['class']) && is_array($this->htmlAttributes['class'])) {
foreach ($this->htmlAttributes['class'] as $i => $string) {
forea... | php | public function hasClassProperty($class)
{
if (! is_array($class)) {
$class = func_get_args();
}
if (isset($this->htmlAttributes['class']) && is_array($this->htmlAttributes['class'])) {
foreach ($this->htmlAttributes['class'] as $i => $string) {
forea... | [
"public",
"function",
"hasClassProperty",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"class",
")",
")",
"{",
"$",
"class",
"=",
"func_get_args",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"htmlAttributes",... | @param string $class
@return bool | [
"@param",
"string",
"$class"
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/HtmlAttributes.php#L92-L109 |
ShaoZeMing/laravel-merchant | src/Middleware/Permission.php | Permission.handle | public function handle(Request $request, \Closure $next)
{
if (!Merchant::user()) {
return $next($request);
}
if (!Merchant::user()->allPermissions()->first(function ($permission) use ($request) {
return $permission->shouldPassThrough($request);
})) {
... | php | public function handle(Request $request, \Closure $next)
{
if (!Merchant::user()) {
return $next($request);
}
if (!Merchant::user()->allPermissions()->first(function ($permission) use ($request) {
return $permission->shouldPassThrough($request);
})) {
... | [
"public",
"function",
"handle",
"(",
"Request",
"$",
"request",
",",
"\\",
"Closure",
"$",
"next",
")",
"{",
"if",
"(",
"!",
"Merchant",
"::",
"user",
"(",
")",
")",
"{",
"return",
"$",
"next",
"(",
"$",
"request",
")",
";",
"}",
"if",
"(",
"!",
... | Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Middleware/Permission.php#L18-L31 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.getTypeExtensions | public function getTypeExtensions($name)
{
if (null === $this->typeExtensions) {
$this->initTypeExtensions();
}
return !empty($this->typeExtensions[$name])
? $this->typeExtensions[$name]
: [];
} | php | public function getTypeExtensions($name)
{
if (null === $this->typeExtensions) {
$this->initTypeExtensions();
}
return !empty($this->typeExtensions[$name])
? $this->typeExtensions[$name]
: [];
} | [
"public",
"function",
"getTypeExtensions",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"typeExtensions",
")",
"{",
"$",
"this",
"->",
"initTypeExtensions",
"(",
")",
";",
"}",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L101-L110 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.hasTypeExtensions | public function hasTypeExtensions($name)
{
if (null === $this->typeExtensions) {
$this->initTypeExtensions();
}
return !empty($this->typeExtensions[$name]);
} | php | public function hasTypeExtensions($name)
{
if (null === $this->typeExtensions) {
$this->initTypeExtensions();
}
return !empty($this->typeExtensions[$name]);
} | [
"public",
"function",
"hasTypeExtensions",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"typeExtensions",
")",
"{",
"$",
"this",
"->",
"initTypeExtensions",
"(",
")",
";",
"}",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L115-L122 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.getLayoutUpdates | public function getLayoutUpdates(LayoutItemInterface $item)
{
$idOrAlias = $item->getAlias() ? : $item->getId();
if (null === $this->layoutUpdates) {
$this->initLayoutUpdates($item->getContext());
}
return !empty($this->layoutUpdates[$idOrAlias])
? $this->la... | php | public function getLayoutUpdates(LayoutItemInterface $item)
{
$idOrAlias = $item->getAlias() ? : $item->getId();
if (null === $this->layoutUpdates) {
$this->initLayoutUpdates($item->getContext());
}
return !empty($this->layoutUpdates[$idOrAlias])
? $this->la... | [
"public",
"function",
"getLayoutUpdates",
"(",
"LayoutItemInterface",
"$",
"item",
")",
"{",
"$",
"idOrAlias",
"=",
"$",
"item",
"->",
"getAlias",
"(",
")",
"?",
":",
"$",
"item",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"this",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L127-L138 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.hasDataProvider | public function hasDataProvider($name)
{
if (null === $this->dataProviders) {
$this->initDataProviders();
}
return isset($this->dataProviders[$name]);
} | php | public function hasDataProvider($name)
{
if (null === $this->dataProviders) {
$this->initDataProviders();
}
return isset($this->dataProviders[$name]);
} | [
"public",
"function",
"hasDataProvider",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"dataProviders",
")",
"{",
"$",
"this",
"->",
"initDataProviders",
"(",
")",
";",
"}",
"return",
"isset",
"(",
"$",
"this",
"->",
"dataPro... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L199-L206 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initTypes | private function initTypes()
{
$this->types = [];
foreach ($this->loadTypes() as $type) {
if (!$type instanceof BlockTypeInterface) {
throw new Exception\UnexpectedTypeException(
$type,
'Oro\Component\Layout\BlockTypeInterface'
... | php | private function initTypes()
{
$this->types = [];
foreach ($this->loadTypes() as $type) {
if (!$type instanceof BlockTypeInterface) {
throw new Exception\UnexpectedTypeException(
$type,
'Oro\Component\Layout\BlockTypeInterface'
... | [
"private",
"function",
"initTypes",
"(",
")",
"{",
"$",
"this",
"->",
"types",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadTypes",
"(",
")",
"as",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"$",
"type",
"instanceof",
"BlockTypeInterface",... | Initializes block types.
@throws Exception\UnexpectedTypeException if any registered block type is not
an instance of BlockTypeInterface | [
"Initializes",
"block",
"types",
"."
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L278-L292 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initTypeExtensions | private function initTypeExtensions()
{
$this->typeExtensions = [];
foreach ($this->loadTypeExtensions() as $extension) {
if (!$extension instanceof BlockTypeExtensionInterface) {
throw new Exception\UnexpectedTypeException(
$extension,
... | php | private function initTypeExtensions()
{
$this->typeExtensions = [];
foreach ($this->loadTypeExtensions() as $extension) {
if (!$extension instanceof BlockTypeExtensionInterface) {
throw new Exception\UnexpectedTypeException(
$extension,
... | [
"private",
"function",
"initTypeExtensions",
"(",
")",
"{",
"$",
"this",
"->",
"typeExtensions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadTypeExtensions",
"(",
")",
"as",
"$",
"extension",
")",
"{",
"if",
"(",
"!",
"$",
"extension",
... | Initializes block type extensions.
@throws Exception\UnexpectedTypeException if any registered block type extension is not
an instance of BlockTypeExtensionInterface | [
"Initializes",
"block",
"type",
"extensions",
"."
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L300-L316 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initLayoutUpdates | private function initLayoutUpdates(ContextInterface $context)
{
$loadedLayoutUpdates = $this->loadLayoutUpdates($context);
foreach ($loadedLayoutUpdates as $id => $layoutUpdates) {
if (!is_string($id)) {
throw new Exception\UnexpectedTypeException(
$id... | php | private function initLayoutUpdates(ContextInterface $context)
{
$loadedLayoutUpdates = $this->loadLayoutUpdates($context);
foreach ($loadedLayoutUpdates as $id => $layoutUpdates) {
if (!is_string($id)) {
throw new Exception\UnexpectedTypeException(
$id... | [
"private",
"function",
"initLayoutUpdates",
"(",
"ContextInterface",
"$",
"context",
")",
"{",
"$",
"loadedLayoutUpdates",
"=",
"$",
"this",
"->",
"loadLayoutUpdates",
"(",
"$",
"context",
")",
";",
"foreach",
"(",
"$",
"loadedLayoutUpdates",
"as",
"$",
"id",
... | Initializes layout updates.
@param ContextInterface $context
@throws Exception\UnexpectedTypeException if any registered layout update is not
an instance of LayoutUpdateInterface
or layout item id is not a string | [
"Initializes",
"layout",
"updates",
"."
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L327-L355 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initContextConfigurators | private function initContextConfigurators()
{
$this->contextConfigurators = [];
foreach ($this->loadContextConfigurators() as $configurator) {
if (!$configurator instanceof ContextConfiguratorInterface) {
throw new Exception\UnexpectedTypeException(
$... | php | private function initContextConfigurators()
{
$this->contextConfigurators = [];
foreach ($this->loadContextConfigurators() as $configurator) {
if (!$configurator instanceof ContextConfiguratorInterface) {
throw new Exception\UnexpectedTypeException(
$... | [
"private",
"function",
"initContextConfigurators",
"(",
")",
"{",
"$",
"this",
"->",
"contextConfigurators",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadContextConfigurators",
"(",
")",
"as",
"$",
"configurator",
")",
"{",
"if",
"(",
"!",
"... | Initializes layout context configurators.
@throws Exception\UnexpectedTypeException if any registered context configurators is not
an instance of ContextConfiguratorInterface | [
"Initializes",
"layout",
"context",
"configurators",
"."
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L363-L377 |
oroinc/OroLayoutComponent | Extension/AbstractExtension.php | AbstractExtension.initDataProviders | private function initDataProviders()
{
$this->dataProviders = [];
foreach ($this->loadDataProviders() as $name => $dataProvider) {
$this->dataProviders[$name] = $dataProvider;
}
} | php | private function initDataProviders()
{
$this->dataProviders = [];
foreach ($this->loadDataProviders() as $name => $dataProvider) {
$this->dataProviders[$name] = $dataProvider;
}
} | [
"private",
"function",
"initDataProviders",
"(",
")",
"{",
"$",
"this",
"->",
"dataProviders",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"loadDataProviders",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"dataProvider",
")",
"{",
"$",
"this",
"-... | Initializes data providers. | [
"Initializes",
"data",
"providers",
"."
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/AbstractExtension.php#L382-L389 |
php-lug/lug | src/Bundle/GridBundle/Form/Type/Batch/GridBatchAllType.php | GridBatchAllType.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefaults([
'label' => function (Options $options) {
return 'lug.'.$options['grid']->getDefinition()->getResource()->getName().'.batch.all';
},
'label_t... | php | public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefaults([
'label' => function (Options $options) {
return 'lug.'.$options['grid']->getDefinition()->getResource()->getName().'.batch.all';
},
'label_t... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'label'",
"=>",
"function",
"(",
"Options",
"$",
"options",
")",
"{",
"return",
"'lug.'",
".",
"$",
"options",
"[",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/Type/Batch/GridBatchAllType.php#L28-L41 |
rem42/scraper | HttpClient/HttpClient.php | HttpClient.get | public function get($path, array $parameters = [], array $headers = [])
{
$this->setHeaders($headers);
$this->setQuery($parameters);
return $this->client->request('GET', $path, $this->headers);
} | php | public function get($path, array $parameters = [], array $headers = [])
{
$this->setHeaders($headers);
$this->setQuery($parameters);
return $this->client->request('GET', $path, $this->headers);
} | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setHeaders",
"(",
"$",
"headers",
")",
";",
"$",
"this",
"->",
"setQuery",
"... | @param string $path
@param array $parameters
@param array $headers
@return Response|mixed|\Psr\Http\Message\ResponseInterface
@throws \GuzzleHttp\Exception\GuzzleException | [
"@param",
"string",
"$path",
"@param",
"array",
"$parameters",
"@param",
"array",
"$headers"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/HttpClient/HttpClient.php#L62-L67 |
rem42/scraper | HttpClient/HttpClient.php | HttpClient.post | public function post($path, array $parameters = [], array $headers = [], $body = null)
{
$this->setQuery($parameters);
$this->setHeaders($headers);
if ($body instanceof BodyMultipart) {
$this->setMultipart($body);
} elseif (is_array($body)) {
$this->setFormParams($body);
}
return $this->client->req... | php | public function post($path, array $parameters = [], array $headers = [], $body = null)
{
$this->setQuery($parameters);
$this->setHeaders($headers);
if ($body instanceof BodyMultipart) {
$this->setMultipart($body);
} elseif (is_array($body)) {
$this->setFormParams($body);
}
return $this->client->req... | [
"public",
"function",
"post",
"(",
"$",
"path",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"$",
"body",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setQuery",
"(",
"$",
"parameters",
")",
";",... | @param string $path
@param array $parameters
@param array $headers
@param null $body
@return Response|mixed|\Psr\Http\Message\ResponseInterface
@throws \GuzzleHttp\Exception\GuzzleException | [
"@param",
"string",
"$path",
"@param",
"array",
"$parameters",
"@param",
"array",
"$headers",
"@param",
"null",
"$body"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/HttpClient/HttpClient.php#L78-L89 |
rem42/scraper | HttpClient/HttpClient.php | HttpClient.request | public function request($path, $body, $httpMethod = 'GET', array $headers = [], array $options = [])
{
$request = $this->createRequest($httpMethod, $path, $body, $headers);
try {
$response = $this->client->send($request, $options);
} catch (\LogicException $e) {
throw new \ErrorException($e->getMessage(),... | php | public function request($path, $body, $httpMethod = 'GET', array $headers = [], array $options = [])
{
$request = $this->createRequest($httpMethod, $path, $body, $headers);
try {
$response = $this->client->send($request, $options);
} catch (\LogicException $e) {
throw new \ErrorException($e->getMessage(),... | [
"public",
"function",
"request",
"(",
"$",
"path",
",",
"$",
"body",
",",
"$",
"httpMethod",
"=",
"'GET'",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",... | @param string $path
@param mixed $body
@param string $httpMethod
@param array $headers
@param array $options
@return Response|mixed|\Psr\Http\Message\ResponseInterface
@throws \ErrorException
@throws \GuzzleHttp\Exception\GuzzleException | [
"@param",
"string",
"$path",
"@param",
"mixed",
"$body",
"@param",
"string",
"$httpMethod",
"@param",
"array",
"$headers",
"@param",
"array",
"$options"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/HttpClient/HttpClient.php#L102-L118 |
rem42/scraper | HttpClient/HttpClient.php | HttpClient.createRequest | public function createRequest($httpMethod, $path, $body = null, array $headers = [])
{
return new Request(
$httpMethod,
$path,
array_merge($this->headers, $headers),
$body
);
} | php | public function createRequest($httpMethod, $path, $body = null, array $headers = [])
{
return new Request(
$httpMethod,
$path,
array_merge($this->headers, $headers),
$body
);
} | [
"public",
"function",
"createRequest",
"(",
"$",
"httpMethod",
",",
"$",
"path",
",",
"$",
"body",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"Request",
"(",
"$",
"httpMethod",
",",
"$",
"path",
",",
"array_m... | @param $httpMethod
@param $path
@param null $body
@param array $headers
@return Request | [
"@param",
"$httpMethod",
"@param",
"$path",
"@param",
"null",
"$body",
"@param",
"array",
"$headers"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/HttpClient/HttpClient.php#L167-L175 |
alevilar/ristorantino-vendor | Compras/Controller/RubrosController.php | RubrosController.add | public function add() {
if ($this->request->is('post')) {
$this->Rubro->create();
if ($this->Rubro->save($this->request->data)) {
$this->Session->setFlash(__('The rubro has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The rubro could no... | php | public function add() {
if ($this->request->is('post')) {
$this->Rubro->create();
if ($this->Rubro->save($this->request->data)) {
$this->Session->setFlash(__('The rubro has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The rubro could no... | [
"public",
"function",
"add",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"is",
"(",
"'post'",
")",
")",
"{",
"$",
"this",
"->",
"Rubro",
"->",
"create",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"Rubro",
"->",
"save",
"(",
... | add method
@return void | [
"add",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Compras/Controller/RubrosController.php#L43-L55 |
alevilar/ristorantino-vendor | Compras/Controller/RubrosController.php | RubrosController.edit | public function edit($id = null) {
if (!$this->Rubro->exists($id)) {
throw new NotFoundException(__('Invalid rubro'));
}
if ($this->request->is(array('post', 'put'))) {
if ($this->Rubro->save($this->request->data)) {
$this->Flash->success(__('The rubro has been saved.'));
return $this->redirect(arra... | php | public function edit($id = null) {
if (!$this->Rubro->exists($id)) {
throw new NotFoundException(__('Invalid rubro'));
}
if ($this->request->is(array('post', 'put'))) {
if ($this->Rubro->save($this->request->data)) {
$this->Flash->success(__('The rubro has been saved.'));
return $this->redirect(arra... | [
"public",
"function",
"edit",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"Rubro",
"->",
"exists",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"NotFoundException",
"(",
"__",
"(",
"'Invalid rubro'",
")",
")",
";",
... | edit method
@throws NotFoundException
@param string $id
@return void | [
"edit",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Compras/Controller/RubrosController.php#L64-L81 |
josh-taylor/migrations-generator | src/SchemaArgumentBuilder.php | SchemaArgumentBuilder.create | public function create($schema)
{
$types = array_map(function ($column) {
return $column['name'] . ':' . $column['type'];
}, $schema);
return implode(', ', $types);
} | php | public function create($schema)
{
$types = array_map(function ($column) {
return $column['name'] . ':' . $column['type'];
}, $schema);
return implode(', ', $types);
} | [
"public",
"function",
"create",
"(",
"$",
"schema",
")",
"{",
"$",
"types",
"=",
"array_map",
"(",
"function",
"(",
"$",
"column",
")",
"{",
"return",
"$",
"column",
"[",
"'name'",
"]",
".",
"':'",
".",
"$",
"column",
"[",
"'type'",
"]",
";",
"}",
... | Return the argument string to use for the migration command.
@param $schema
@return string | [
"Return",
"the",
"argument",
"string",
"to",
"use",
"for",
"the",
"migration",
"command",
"."
] | train | https://github.com/josh-taylor/migrations-generator/blob/bb6edc78773d11491881f12265a658bf058cb218/src/SchemaArgumentBuilder.php#L13-L20 |
nabab/bbn | src/bbn/mvc/router.php | router.find_controller | private function find_controller($path, $mode){
/** @var string $root Where the files will be searched for by default */
$root = $this->get_root($mode);
/** @var boolean|string $file Once found, full path and filename */
$file = false;
/** @var string $tmp Will contain the different states of the pa... | php | private function find_controller($path, $mode){
/** @var string $root Where the files will be searched for by default */
$root = $this->get_root($mode);
/** @var boolean|string $file Once found, full path and filename */
$file = false;
/** @var string $tmp Will contain the different states of the pa... | [
"private",
"function",
"find_controller",
"(",
"$",
"path",
",",
"$",
"mode",
")",
"{",
"/** @var string $root Where the files will be searched for by default */",
"$",
"root",
"=",
"$",
"this",
"->",
"get_root",
"(",
"$",
"mode",
")",
";",
"/** @var boolean|string $f... | Return the actual controller file corresponding to a gievn path
@param string $path
@param string $mode
@return mixed | [
"Return",
"the",
"actual",
"controller",
"file",
"corresponding",
"to",
"a",
"gievn",
"path"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/router.php#L264-L405 |
PHPPowertools/HTML5 | src/PowerTools/HTML5/Parser/Scanner.php | HTML5_Parser_Scanner.next | public function next() {
$this->is->next();
if ($this->is->valid()) {
if ($this->debug)
fprintf(STDOUT, "> %s\n", $this->is->current());
return $this->is->current();
}
return false;
} | php | public function next() {
$this->is->next();
if ($this->is->valid()) {
if ($this->debug)
fprintf(STDOUT, "> %s\n", $this->is->current());
return $this->is->current();
}
return false;
} | [
"public",
"function",
"next",
"(",
")",
"{",
"$",
"this",
"->",
"is",
"->",
"next",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"is",
"->",
"valid",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"fprintf",
"(",
"STDOUT",
",... | Get the next character.
Note: This advances the pointer.
@return string The next character. | [
"Get",
"the",
"next",
"character",
"."
] | train | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Scanner.php#L138-L147 |
i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.init | public function init()
{
parent::init();
// Check we are logged in as a user who can access front end management
if (!Permission::check("USERS_MANAGE_ACCOUNT")) {
Security::permissionFailure();
}
// Set our member object
$member = Member::currentUser();
... | php | public function init()
{
parent::init();
// Check we are logged in as a user who can access front end management
if (!Permission::check("USERS_MANAGE_ACCOUNT")) {
Security::permissionFailure();
}
// Set our member object
$member = Member::currentUser();
... | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"// Check we are logged in as a user who can access front end management",
"if",
"(",
"!",
"Permission",
"::",
"check",
"(",
"\"USERS_MANAGE_ACCOUNT\"",
")",
")",
"{",
"Security",
":... | Perorm setup when this controller is initialised
@return void | [
"Perorm",
"setup",
"when",
"this",
"controller",
"is",
"initialised"
] | train | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L83-L98 |
i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.index | public function index()
{
// Setup default profile summary sections
$sections = ArrayList::create();
$sections->push(
ArrayData::create(
array(
"Title" => "",
"Content" => $this->renderWith(
"UsersProfileSummary... | php | public function index()
{
// Setup default profile summary sections
$sections = ArrayList::create();
$sections->push(
ArrayData::create(
array(
"Title" => "",
"Content" => $this->renderWith(
"UsersProfileSummary... | [
"public",
"function",
"index",
"(",
")",
"{",
"// Setup default profile summary sections",
"$",
"sections",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"$",
"sections",
"->",
"push",
"(",
"ArrayData",
"::",
"create",
"(",
"array",
"(",
"\"Title\"",
"=>",
... | Display the currently outstanding orders for the current user
@return HTMLText | [
"Display",
"the",
"currently",
"outstanding",
"orders",
"for",
"the",
"current",
"user"
] | train | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L174-L214 |
i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.ChangePasswordForm | public function ChangePasswordForm()
{
$form = ChangePasswordForm::create($this, "ChangePasswordForm");
$form
->Actions()
->find("name", "action_doChangePassword")
->addExtraClass("btn")
->addExtraClass("btn-green");
$cancel_btn = LiteralFiel... | php | public function ChangePasswordForm()
{
$form = ChangePasswordForm::create($this, "ChangePasswordForm");
$form
->Actions()
->find("name", "action_doChangePassword")
->addExtraClass("btn")
->addExtraClass("btn-green");
$cancel_btn = LiteralFiel... | [
"public",
"function",
"ChangePasswordForm",
"(",
")",
"{",
"$",
"form",
"=",
"ChangePasswordForm",
"::",
"create",
"(",
"$",
"this",
",",
"\"ChangePasswordForm\"",
")",
";",
"$",
"form",
"->",
"Actions",
"(",
")",
"->",
"find",
"(",
"\"name\"",
",",
"\"act... | Factory for generating a change password form. The form can be expanded
using an extension class and calling the updateChangePasswordForm method.
@return Form | [
"Factory",
"for",
"generating",
"a",
"change",
"password",
"form",
".",
"The",
"form",
"can",
"be",
"expanded",
"using",
"an",
"extension",
"class",
"and",
"calling",
"the",
"updateChangePasswordForm",
"method",
"."
] | train | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L305-L327 |
i-lateral/silverstripe-users | code/control/Users_Account_Controller.php | Users_Account_Controller.getAccountMenu | public function getAccountMenu()
{
$menu = ArrayList::create();
$curr_action = $this->request->param("Action");
$menu->add(
ArrayData::create(
array(
"ID" => 0,
"Title" => _t('Users.PROFILESUMMARY', "Profile Summary"),
... | php | public function getAccountMenu()
{
$menu = ArrayList::create();
$curr_action = $this->request->param("Action");
$menu->add(
ArrayData::create(
array(
"ID" => 0,
"Title" => _t('Users.PROFILESUMMARY', "Profile Summary"),
... | [
"public",
"function",
"getAccountMenu",
"(",
")",
"{",
"$",
"menu",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"$",
"curr_action",
"=",
"$",
"this",
"->",
"request",
"->",
"param",
"(",
"\"Action\"",
")",
";",
"$",
"menu",
"->",
"add",
"(",
"Ar... | Return a list of nav items for managing a users profile. You can add new
items to this menu using the "updateAccountMenu" extension
@return ArrayList | [
"Return",
"a",
"list",
"of",
"nav",
"items",
"for",
"managing",
"a",
"users",
"profile",
".",
"You",
"can",
"add",
"new",
"items",
"to",
"this",
"menu",
"using",
"the",
"updateAccountMenu",
"extension"
] | train | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/control/Users_Account_Controller.php#L335-L377 |
songshenzong/log | src/TokenMiddleware.php | TokenMiddleware.handle | public function handle($request, Closure $next)
{
if (isset($request->token)) {
$tokens = config('songshenzong-log.token', ['songshenzong']);
if (in_array($request->token, $tokens, true)) {
return $next($request);
}
return $this->songshenzong->... | php | public function handle($request, Closure $next)
{
if (isset($request->token)) {
$tokens = config('songshenzong-log.token', ['songshenzong']);
if (in_array($request->token, $tokens, true)) {
return $next($request);
}
return $this->songshenzong->... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"request",
"->",
"token",
")",
")",
"{",
"$",
"tokens",
"=",
"config",
"(",
"'songshenzong-log.token'",
",",
"[",
"'songshenzong'",
... | Handle an incoming request.
@param Request $request
@param Closure $next
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/TokenMiddleware.php#L54-L64 |
arndtteunissen/column-layout | Classes/Hook/ColumnConfigurationGridsystemFlexFormHook.php | ColumnConfigurationGridsystemFlexFormHook.getDataStructureIdentifierPreProcess | public function getDataStructureIdentifierPreProcess(array $fieldTca, string $tableName, string $fieldName, array $row): array
{
if ($tableName != 'tt_content' || $fieldName != 'tx_column_layout_column_config') {
return [];
}
return [
'type' => 'tca',
'ta... | php | public function getDataStructureIdentifierPreProcess(array $fieldTca, string $tableName, string $fieldName, array $row): array
{
if ($tableName != 'tt_content' || $fieldName != 'tx_column_layout_column_config') {
return [];
}
return [
'type' => 'tca',
'ta... | [
"public",
"function",
"getDataStructureIdentifierPreProcess",
"(",
"array",
"$",
"fieldTca",
",",
"string",
"$",
"tableName",
",",
"string",
"$",
"fieldName",
",",
"array",
"$",
"row",
")",
":",
"array",
"{",
"if",
"(",
"$",
"tableName",
"!=",
"'tt_content'",
... | Generates a DataStructureIdentifier for the flexform in column configuration field
@param array $fieldTca
@param string $tableName
@param string $fieldName
@param array $row
@return array
@throws \TYPO3\CMS\Core\Exception | [
"Generates",
"a",
"DataStructureIdentifier",
"for",
"the",
"flexform",
"in",
"column",
"configuration",
"field"
] | train | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Hook/ColumnConfigurationGridsystemFlexFormHook.php#L32-L44 |
ShaoZeMing/laravel-merchant | src/Controllers/UserController.php | UserController.grid | protected function grid()
{
return Administrator::grid(function (Grid $grid) {
$grid->model()->where('merchant_id', auth('merchant')->user()->merchant_id);
$grid->mobile(trans('merchant.mobile'));
$grid->name(trans('merchant.name'));
$grid->roles(trans('mercha... | php | protected function grid()
{
return Administrator::grid(function (Grid $grid) {
$grid->model()->where('merchant_id', auth('merchant')->user()->merchant_id);
$grid->mobile(trans('merchant.mobile'));
$grid->name(trans('merchant.name'));
$grid->roles(trans('mercha... | [
"protected",
"function",
"grid",
"(",
")",
"{",
"return",
"Administrator",
"::",
"grid",
"(",
"function",
"(",
"Grid",
"$",
"grid",
")",
"{",
"$",
"grid",
"->",
"model",
"(",
")",
"->",
"where",
"(",
"'merchant_id'",
",",
"auth",
"(",
"'merchant'",
")"... | Make a grid builder.
@return Grid | [
"Make",
"a",
"grid",
"builder",
"."
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Controllers/UserController.php#L67-L88 |
ShaoZeMing/laravel-merchant | src/Controllers/UserController.php | UserController.form | public function form()
{
return Administrator::form(function (Form $form) {
$form->mobile('mobile', trans('merchant.mobile'))->rules('required');
$form->email('email', trans('merchant.email'))->default('');
$form->text('name', trans('merchant.name'))->rules('required');
... | php | public function form()
{
return Administrator::form(function (Form $form) {
$form->mobile('mobile', trans('merchant.mobile'))->rules('required');
$form->email('email', trans('merchant.email'))->default('');
$form->text('name', trans('merchant.name'))->rules('required');
... | [
"public",
"function",
"form",
"(",
")",
"{",
"return",
"Administrator",
"::",
"form",
"(",
"function",
"(",
"Form",
"$",
"form",
")",
"{",
"$",
"form",
"->",
"mobile",
"(",
"'mobile'",
",",
"trans",
"(",
"'merchant.mobile'",
")",
")",
"->",
"rules",
"(... | Make a form builder.
@return Form | [
"Make",
"a",
"form",
"builder",
"."
] | train | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Controllers/UserController.php#L95-L122 |
geosocio/slugger | src/Slugger.php | Slugger.slug | public function slug(string $text) : string
{
$slug = trim($text);
$slug = mb_strtolower($slug);
$slug = str_replace(' ', '-', $slug);
$slug = str_replace(['.', '(', ')'], '', $slug);
$slug = preg_replace('/-{2,}/u', '-', $slug);
$slug = trim($slug, '-');
ret... | php | public function slug(string $text) : string
{
$slug = trim($text);
$slug = mb_strtolower($slug);
$slug = str_replace(' ', '-', $slug);
$slug = str_replace(['.', '(', ')'], '', $slug);
$slug = preg_replace('/-{2,}/u', '-', $slug);
$slug = trim($slug, '-');
ret... | [
"public",
"function",
"slug",
"(",
"string",
"$",
"text",
")",
":",
"string",
"{",
"$",
"slug",
"=",
"trim",
"(",
"$",
"text",
")",
";",
"$",
"slug",
"=",
"mb_strtolower",
"(",
"$",
"slug",
")",
";",
"$",
"slug",
"=",
"str_replace",
"(",
"' '",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/geosocio/slugger/blob/230b0564bd75a5c009ce68be88e1b1d828bac5c3/src/Slugger.php#L14-L24 |
blast-project/BaseEntitiesBundle | src/Entity/Repository/SortableRepository.php | SortableRepository.moveObjectAfter | public function moveObjectAfter($id, $after_rank)
{
$object = $this->find($id);
if (!$object) {
return false;
}
$old_rank = $object->getSortRank();
$qb = $this->_em->createQueryBuilder()
->select('MIN(n.sortRank)')
->from($this->_entityNam... | php | public function moveObjectAfter($id, $after_rank)
{
$object = $this->find($id);
if (!$object) {
return false;
}
$old_rank = $object->getSortRank();
$qb = $this->_em->createQueryBuilder()
->select('MIN(n.sortRank)')
->from($this->_entityNam... | [
"public",
"function",
"moveObjectAfter",
"(",
"$",
"id",
",",
"$",
"after_rank",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"object",
")",
"{",
"return",
"false",
";",
"}",
"$",
"old_ra... | Move an object after a given sort rank
(add 1024 to the rank if the object is moved beyond the highest existing rank).
@param string $id Id of the object to move
@param int $after_rank
@return int | false the new rank or false if the object could not be moved | [
"Move",
"an",
"object",
"after",
"a",
"given",
"sort",
"rank",
"(",
"add",
"1024",
"to",
"the",
"rank",
"if",
"the",
"object",
"is",
"moved",
"beyond",
"the",
"highest",
"existing",
"rank",
")",
"."
] | train | https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Entity/Repository/SortableRepository.php#L50-L79 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php | Xsl.transform | public function transform(ProjectDescriptor $project, Transformation $transformation)
{
$structure = $this->loadAst($this->getAstPath($transformation));
$proc = $this->getXslProcessor($transformation);
$proc->registerPHPFunctions();
$this->registerDefaultVariables($transformation, $... | php | public function transform(ProjectDescriptor $project, Transformation $transformation)
{
$structure = $this->loadAst($this->getAstPath($transformation));
$proc = $this->getXslProcessor($transformation);
$proc->registerPHPFunctions();
$this->registerDefaultVariables($transformation, $... | [
"public",
"function",
"transform",
"(",
"ProjectDescriptor",
"$",
"project",
",",
"Transformation",
"$",
"transformation",
")",
"{",
"$",
"structure",
"=",
"$",
"this",
"->",
"loadAst",
"(",
"$",
"this",
"->",
"getAstPath",
"(",
"$",
"transformation",
")",
"... | This method combines the structure.xml and the given target template
and creates a static html page at the artifact location.
@param ProjectDescriptor $project Document containing the structure.
@param Transformation $transformation Transformation to execute.
@throws \RuntimeException if the structure.xml f... | [
"This",
"method",
"combines",
"the",
"structure",
".",
"xml",
"and",
"the",
"given",
"target",
"template",
"and",
"creates",
"a",
"static",
"html",
"page",
"at",
"the",
"artifact",
"location",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php#L96-L158 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php | Xsl.getXsltUriFromFilename | protected function getXsltUriFromFilename($filename)
{
// Windows requires an additional / after the scheme. If not provided then errno 22 (I/O Error: Invalid
// Argument) will be raised. Thanks to @FnTmLV for finding the cause. See issue #284 for more information.
// An exception to the abo... | php | protected function getXsltUriFromFilename($filename)
{
// Windows requires an additional / after the scheme. If not provided then errno 22 (I/O Error: Invalid
// Argument) will be raised. Thanks to @FnTmLV for finding the cause. See issue #284 for more information.
// An exception to the abo... | [
"protected",
"function",
"getXsltUriFromFilename",
"(",
"$",
"filename",
")",
"{",
"// Windows requires an additional / after the scheme. If not provided then errno 22 (I/O Error: Invalid",
"// Argument) will be raised. Thanks to @FnTmLV for finding the cause. See issue #284 for more information."... | Takes the filename and converts it into a correct URI for XSLTProcessor.
@param string $filename
@return string | [
"Takes",
"the",
"filename",
"and",
"converts",
"it",
"into",
"a",
"correct",
"URI",
"for",
"XSLTProcessor",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xsl.php#L167-L178 |
php-lug/lug | src/Bundle/GridBundle/Form/DataTransformer/Filter/BooleanFilterTransformer.php | BooleanFilterTransformer.transform | public function transform($value)
{
if ($value === null) {
return;
}
if ($value === true) {
return 'true';
}
if ($value === false) {
return 'false';
}
throw new TransformationFailedException(sprintf(
'The bool... | php | public function transform($value)
{
if ($value === null) {
return;
}
if ($value === true) {
return 'true';
}
if ($value === false) {
return 'false';
}
throw new TransformationFailedException(sprintf(
'The bool... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"value",
"===",
"true",
")",
"{",
"return",
"'true'",
";",
"}",
"if",
"(",
"$",
"value",
"===",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/DataTransformer/Filter/BooleanFilterTransformer.php#L25-L43 |
php-lug/lug | src/Bundle/GridBundle/Form/DataTransformer/Filter/BooleanFilterTransformer.php | BooleanFilterTransformer.reverseTransform | public function reverseTransform($value)
{
if ($value === null) {
return;
}
if ($value === 'true') {
return true;
}
if ($value === 'false') {
return false;
}
throw new TransformationFailedException(sprintf(
'T... | php | public function reverseTransform($value)
{
if ($value === null) {
return;
}
if ($value === 'true') {
return true;
}
if ($value === 'false') {
return false;
}
throw new TransformationFailedException(sprintf(
'T... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"value",
"===",
"'true'",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"value",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/DataTransformer/Filter/BooleanFilterTransformer.php#L48-L66 |
david-mk/mail-map | src/MailMap/ConnectionFactory.php | ConnectionFactory.create | public function create($inbox = 'INBOX')
{
$stream = imap_open($this->connectionString($inbox), $this->user, $this->password);
return new Connection($stream);
} | php | public function create($inbox = 'INBOX')
{
$stream = imap_open($this->connectionString($inbox), $this->user, $this->password);
return new Connection($stream);
} | [
"public",
"function",
"create",
"(",
"$",
"inbox",
"=",
"'INBOX'",
")",
"{",
"$",
"stream",
"=",
"imap_open",
"(",
"$",
"this",
"->",
"connectionString",
"(",
"$",
"inbox",
")",
",",
"$",
"this",
"->",
"user",
",",
"$",
"this",
"->",
"password",
")",... | Create new IMAP connection
@param string $inbox
@return \MailMap\Contracts\ConnectionContract | [
"Create",
"new",
"IMAP",
"connection"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/ConnectionFactory.php#L88-L93 |
david-mk/mail-map | src/MailMap/ConnectionFactory.php | ConnectionFactory.mailboxes | public function mailboxes($mailboxSearch = '*', $withConnection = false)
{
$connectionString = $this->connectionString();
$stream = imap_open($connectionString, $this->user, $this->password);
$mailboxes = imap_list($stream, $connectionString, $mailboxSearch);
if ($withConnection) {
... | php | public function mailboxes($mailboxSearch = '*', $withConnection = false)
{
$connectionString = $this->connectionString();
$stream = imap_open($connectionString, $this->user, $this->password);
$mailboxes = imap_list($stream, $connectionString, $mailboxSearch);
if ($withConnection) {
... | [
"public",
"function",
"mailboxes",
"(",
"$",
"mailboxSearch",
"=",
"'*'",
",",
"$",
"withConnection",
"=",
"false",
")",
"{",
"$",
"connectionString",
"=",
"$",
"this",
"->",
"connectionString",
"(",
")",
";",
"$",
"stream",
"=",
"imap_open",
"(",
"$",
"... | Get a list of mailboxes on the mail server.
@param string $mailboxSearch Pattern from http://php.net/manual/en/function.imap-list.php
@param bool $withConnection Will strip off connection string from mailboxes by default
@return array List of mailboxes | [
"Get",
"a",
"list",
"of",
"mailboxes",
"on",
"the",
"mail",
"server",
"."
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/ConnectionFactory.php#L102-L115 |
david-mk/mail-map | src/MailMap/ConnectionFactory.php | ConnectionFactory.connectionString | protected function connectionString($inbox = '')
{
return sprintf(static::$connectionFormat, $this->host, $this->port, $this->service, $this->enc, $inbox);
} | php | protected function connectionString($inbox = '')
{
return sprintf(static::$connectionFormat, $this->host, $this->port, $this->service, $this->enc, $inbox);
} | [
"protected",
"function",
"connectionString",
"(",
"$",
"inbox",
"=",
"''",
")",
"{",
"return",
"sprintf",
"(",
"static",
"::",
"$",
"connectionFormat",
",",
"$",
"this",
"->",
"host",
",",
"$",
"this",
"->",
"port",
",",
"$",
"this",
"->",
"service",
"... | Make the IMAP connection string from configuration
@param string $inbox
@return string The connection string | [
"Make",
"the",
"IMAP",
"connection",
"string",
"from",
"configuration"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/ConnectionFactory.php#L123-L126 |
mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File.open | public function open($mode = 'w+', $chmod = 0666)
{
if ($this->_isWritableMode($mode)) {
if (!is_writable($this->_fileLocation)) {
throw new Mage_Exception('Permission denied to write to ' . $this->_fileLocation);
}
if (is_file($this->_filePath) && !is_wr... | php | public function open($mode = 'w+', $chmod = 0666)
{
if ($this->_isWritableMode($mode)) {
if (!is_writable($this->_fileLocation)) {
throw new Mage_Exception('Permission denied to write to ' . $this->_fileLocation);
}
if (is_file($this->_filePath) && !is_wr... | [
"public",
"function",
"open",
"(",
"$",
"mode",
"=",
"'w+'",
",",
"$",
"chmod",
"=",
"0666",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_isWritableMode",
"(",
"$",
"mode",
")",
")",
"{",
"if",
"(",
"!",
"is_writable",
"(",
"$",
"this",
"->",
"_file... | Open file
@param string $mode
@param int $chmod
@throws Mage_Exception | [
"Open",
"file"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L102-L127 |
mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File.read | public function read($length = 4096)
{
$data = false;
$this->_checkFileOpened();
if ($length > 0) {
$data = $this->_read($length);
}
return $data;
} | php | public function read($length = 4096)
{
$data = false;
$this->_checkFileOpened();
if ($length > 0) {
$data = $this->_read($length);
}
return $data;
} | [
"public",
"function",
"read",
"(",
"$",
"length",
"=",
"4096",
")",
"{",
"$",
"data",
"=",
"false",
";",
"$",
"this",
"->",
"_checkFileOpened",
"(",
")",
";",
"if",
"(",
"$",
"length",
">",
"0",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"_... | Read data from file
@param int $length
@return string|boolean | [
"Read",
"data",
"from",
"file"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L146-L155 |
mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File.close | public function close()
{
$this->_checkFileOpened();
$this->_close();
$this->_fileHandler = false;
@chmod($this->_filePath, $this->_chmod);
} | php | public function close()
{
$this->_checkFileOpened();
$this->_close();
$this->_fileHandler = false;
@chmod($this->_filePath, $this->_chmod);
} | [
"public",
"function",
"close",
"(",
")",
"{",
"$",
"this",
"->",
"_checkFileOpened",
"(",
")",
";",
"$",
"this",
"->",
"_close",
"(",
")",
";",
"$",
"this",
"->",
"_fileHandler",
"=",
"false",
";",
"@",
"chmod",
"(",
"$",
"this",
"->",
"_filePath",
... | Close file | [
"Close",
"file"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L171-L177 |
mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File._open | protected function _open($mode)
{
$this->_fileHandler = @fopen($this->_filePath, $mode);
if (false === $this->_fileHandler) {
throw new Mage_Exception('Failed to open file ' . $this->_filePath);
}
} | php | protected function _open($mode)
{
$this->_fileHandler = @fopen($this->_filePath, $mode);
if (false === $this->_fileHandler) {
throw new Mage_Exception('Failed to open file ' . $this->_filePath);
}
} | [
"protected",
"function",
"_open",
"(",
"$",
"mode",
")",
"{",
"$",
"this",
"->",
"_fileHandler",
"=",
"@",
"fopen",
"(",
"$",
"this",
"->",
"_filePath",
",",
"$",
"mode",
")",
";",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"_fileHandler",
")",
... | Implementation of file opening
@param string $mode
@throws Mage_Exception | [
"Implementation",
"of",
"file",
"opening"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L185-L192 |
mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File._write | protected function _write($data)
{
$result = @fwrite($this->_fileHandler, $data);
if (false === $result) {
throw new Mage_Exception('Failed to write data to ' . $this->_filePath);
}
} | php | protected function _write($data)
{
$result = @fwrite($this->_fileHandler, $data);
if (false === $result) {
throw new Mage_Exception('Failed to write data to ' . $this->_filePath);
}
} | [
"protected",
"function",
"_write",
"(",
"$",
"data",
")",
"{",
"$",
"result",
"=",
"@",
"fwrite",
"(",
"$",
"this",
"->",
"_fileHandler",
",",
"$",
"data",
")",
";",
"if",
"(",
"false",
"===",
"$",
"result",
")",
"{",
"throw",
"new",
"Mage_Exception"... | Implementation of writing data to file
@param string $data
@throws Mage_Exception | [
"Implementation",
"of",
"writing",
"data",
"to",
"file"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L200-L207 |
mridang/magazine | lib/magento/Archive/Helper/File.php | Mage_Archive_Helper_File._read | protected function _read($length)
{
$result = fread($this->_fileHandler, $length);
if (false === $result) {
throw new Mage_Exception('Failed to read data from ' . $this->_filePath);
}
return $result;
} | php | protected function _read($length)
{
$result = fread($this->_fileHandler, $length);
if (false === $result) {
throw new Mage_Exception('Failed to read data from ' . $this->_filePath);
}
return $result;
} | [
"protected",
"function",
"_read",
"(",
"$",
"length",
")",
"{",
"$",
"result",
"=",
"fread",
"(",
"$",
"this",
"->",
"_fileHandler",
",",
"$",
"length",
")",
";",
"if",
"(",
"false",
"===",
"$",
"result",
")",
"{",
"throw",
"new",
"Mage_Exception",
"... | Implementation of file reading
@param int $length
@throws Mage_Exception | [
"Implementation",
"of",
"file",
"reading"
] | train | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Archive/Helper/File.php#L215-L224 |
highday/glitter | src/Audit/Listeners/Product/LogSave.php | LogSave.handle | public function handle(ProductSaved $event)
{
if (is_null($event->actor)) {
return;
}
$data = [
'ip' => request()->ip(),
'ua' => request()->header('User-Agent'),
'product_id' => $event->product->getKey(),
'dirty' ... | php | public function handle(ProductSaved $event)
{
if (is_null($event->actor)) {
return;
}
$data = [
'ip' => request()->ip(),
'ua' => request()->header('User-Agent'),
'product_id' => $event->product->getKey(),
'dirty' ... | [
"public",
"function",
"handle",
"(",
"ProductSaved",
"$",
"event",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"event",
"->",
"actor",
")",
")",
"{",
"return",
";",
"}",
"$",
"data",
"=",
"[",
"'ip'",
"=>",
"request",
"(",
")",
"->",
"ip",
"(",
")"... | Handle the event.
@param ProductSaved $event
@return void | [
"Handle",
"the",
"event",
"."
] | train | https://github.com/highday/glitter/blob/d1c7a227fd2343806bd3ec0314e621ced57dfe66/src/Audit/Listeners/Product/LogSave.php#L26-L40 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multipart.php | ezcMailMultipart.__isset | public function __isset( $name )
{
switch ( $name )
{
case 'boundary':
case 'noMimeMessage':
return isset( $this->properties[$name] );
default:
return parent::__isset( $name );
}
} | php | public function __isset( $name )
{
switch ( $name )
{
case 'boundary':
case 'noMimeMessage':
return isset( $this->properties[$name] );
default:
return parent::__isset( $name );
}
} | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'boundary'",
":",
"case",
"'noMimeMessage'",
":",
"return",
"isset",
"(",
"$",
"this",
"->",
"properties",
"[",
"$",
"name",
"]",
")",
";",
"d... | Returns true if the property $name is set, otherwise false.
@param string $name
@return bool
@ignore | [
"Returns",
"true",
"if",
"the",
"property",
"$name",
"is",
"set",
"otherwise",
"false",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multipart.php#L149-L160 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multipart.php | ezcMailMultipart.generateBody | public function generateBody()
{
$data = $this->noMimeMessage . ezcMailTools::lineBreak();
foreach ( $this->parts as $part )
{
$data .= ezcMailTools::lineBreak() . '--' . $this->boundary . ezcMailTools::lineBreak();
$data .= $part->generate();
}
$data ... | php | public function generateBody()
{
$data = $this->noMimeMessage . ezcMailTools::lineBreak();
foreach ( $this->parts as $part )
{
$data .= ezcMailTools::lineBreak() . '--' . $this->boundary . ezcMailTools::lineBreak();
$data .= $part->generate();
}
$data ... | [
"public",
"function",
"generateBody",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"noMimeMessage",
".",
"ezcMailTools",
"::",
"lineBreak",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"as",
"$",
"part",
")",
"{",
"$",
"data",
".... | Returns the generated body for all multipart types.
@return string | [
"Returns",
"the",
"generated",
"body",
"for",
"all",
"multipart",
"types",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multipart.php#L167-L177 |
flint/Antenna | src/Coder.php | Coder.decode | public function decode($encoded)
{
$defaults = [
'sub' => null,
'iat' => null,
'exp' => null,
];
$payload = (array) JWT::decode($encoded, $this->secret, [$this->algoritm]) + $defaults;
$claims = array_diff_key($payload, $defaults);
$expi... | php | public function decode($encoded)
{
$defaults = [
'sub' => null,
'iat' => null,
'exp' => null,
];
$payload = (array) JWT::decode($encoded, $this->secret, [$this->algoritm]) + $defaults;
$claims = array_diff_key($payload, $defaults);
$expi... | [
"public",
"function",
"decode",
"(",
"$",
"encoded",
")",
"{",
"$",
"defaults",
"=",
"[",
"'sub'",
"=>",
"null",
",",
"'iat'",
"=>",
"null",
",",
"'exp'",
"=>",
"null",
",",
"]",
";",
"$",
"payload",
"=",
"(",
"array",
")",
"JWT",
"::",
"decode",
... | @param string $encoded
@return WebToken | [
"@param",
"string",
"$encoded"
] | train | https://github.com/flint/Antenna/blob/282bafa99bf75bade965b00ef43fc421674048a5/src/Coder.php#L44-L60 |
sauls/widget | src/View/StringView.php | StringView.render | public function render(string $viewFile, array $viewData = []): string
{
return strtr(
$viewFile,
array_combine(
array_map(
function ($key) {
return '{'.$key.'}';
},
array_keys($viewDa... | php | public function render(string $viewFile, array $viewData = []): string
{
return strtr(
$viewFile,
array_combine(
array_map(
function ($key) {
return '{'.$key.'}';
},
array_keys($viewDa... | [
"public",
"function",
"render",
"(",
"string",
"$",
"viewFile",
",",
"array",
"$",
"viewData",
"=",
"[",
"]",
")",
":",
"string",
"{",
"return",
"strtr",
"(",
"$",
"viewFile",
",",
"array_combine",
"(",
"array_map",
"(",
"function",
"(",
"$",
"key",
")... | @param string $viewFile
@param array $viewData
@return string | [
"@param",
"string",
"$viewFile",
"@param",
"array",
"$viewData"
] | train | https://github.com/sauls/widget/blob/552c8118e92565f3f54969779269855b6a1d076a/src/View/StringView.php#L25-L39 |
Laralum/Events | src/Models/Event.php | Event.hasResponsible | public function hasResponsible($user)
{
return $this->users()->where('user_id', $user->id)->first()->pivot->responsible;
} | php | public function hasResponsible($user)
{
return $this->users()->where('user_id', $user->id)->first()->pivot->responsible;
} | [
"public",
"function",
"hasResponsible",
"(",
"$",
"user",
")",
"{",
"return",
"$",
"this",
"->",
"users",
"(",
")",
"->",
"where",
"(",
"'user_id'",
",",
"$",
"user",
"->",
"id",
")",
"->",
"first",
"(",
")",
"->",
"pivot",
"->",
"responsible",
";",
... | Returns true if the event have the specified user as responsible.
@param mixed $user | [
"Returns",
"true",
"if",
"the",
"event",
"have",
"the",
"specified",
"user",
"as",
"responsible",
"."
] | train | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Models/Event.php#L58-L61 |
Laralum/Events | src/Models/Event.php | Event.startDatetime | public function startDatetime()
{
$date = explode('-', $this->start_date);
$time = explode(':', $this->start_time);
$start_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $start_datetime;
} | php | public function startDatetime()
{
$date = explode('-', $this->start_date);
$time = explode(':', $this->start_time);
$start_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $start_datetime;
} | [
"public",
"function",
"startDatetime",
"(",
")",
"{",
"$",
"date",
"=",
"explode",
"(",
"'-'",
",",
"$",
"this",
"->",
"start_date",
")",
";",
"$",
"time",
"=",
"explode",
"(",
"':'",
",",
"$",
"this",
"->",
"start_time",
")",
";",
"$",
"start_dateti... | Get Carbon start datetime.
@return \Carbon\Carbon | [
"Get",
"Carbon",
"start",
"datetime",
"."
] | train | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Models/Event.php#L150-L157 |
Laralum/Events | src/Models/Event.php | Event.endDatetime | public function endDatetime()
{
$date = explode('-', $this->end_date);
$time = explode(':', $this->end_time);
$end_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $end_datetime;
} | php | public function endDatetime()
{
$date = explode('-', $this->end_date);
$time = explode(':', $this->end_time);
$end_datetime = Carbon::create($date[0], $date[1], $date[2], $time[0], $time[1]);
return $end_datetime;
} | [
"public",
"function",
"endDatetime",
"(",
")",
"{",
"$",
"date",
"=",
"explode",
"(",
"'-'",
",",
"$",
"this",
"->",
"end_date",
")",
";",
"$",
"time",
"=",
"explode",
"(",
"':'",
",",
"$",
"this",
"->",
"end_time",
")",
";",
"$",
"end_datetime",
"... | Get Carbon end datetime.
@return \Carbon\Carbon | [
"Get",
"Carbon",
"end",
"datetime",
"."
] | train | https://github.com/Laralum/Events/blob/9dc36468f4253e7d040863a115ea94cded0e6aa5/src/Models/Event.php#L164-L171 |
xiewulong/yii2-fileupload | oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ApcClassLoader.php | ApcClassLoader.findFile | public function findFile($class)
{
if (false === $file = apc_fetch($this->prefix.$class)) {
apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
}
return $file;
} | php | public function findFile($class)
{
if (false === $file = apc_fetch($this->prefix.$class)) {
apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
}
return $file;
} | [
"public",
"function",
"findFile",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"file",
"=",
"apc_fetch",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
"class",
")",
")",
"{",
"apc_store",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
... | Finds a file by class name while caching lookups to APC.
@param string $class A class name to resolve to file
@return string|null | [
"Finds",
"a",
"file",
"by",
"class",
"name",
"while",
"caching",
"lookups",
"to",
"APC",
"."
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ApcClassLoader.php#L120-L127 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Adapter/ServerQuery.php | ServerQuery.syn | protected function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
Profiler::init(spl_object_hash($this));
$rdy = $this->getTransport()->readLine();
if(!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(define... | php | protected function syn()
{
$this->initTransport($this->options);
$this->transport->setAdapter($this);
Profiler::init(spl_object_hash($this));
$rdy = $this->getTransport()->readLine();
if(!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(define... | [
"protected",
"function",
"syn",
"(",
")",
"{",
"$",
"this",
"->",
"initTransport",
"(",
"$",
"this",
"->",
"options",
")",
";",
"$",
"this",
"->",
"transport",
"->",
"setAdapter",
"(",
"$",
"this",
")",
";",
"Profiler",
"::",
"init",
"(",
"spl_object_h... | Connects the Transport object and performs initial actions on the remote
server.
@throws AdapterException
@return void | [
"Connects",
"the",
"Transport",
"object",
"and",
"performs",
"initial",
"actions",
"on",
"the",
"remote",
"server",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Adapter/ServerQuery.php#L81-L96 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Adapter/ServerQuery.php | ServerQuery.wait | public function wait()
{
if($this->getTransport()->getConfig("blocking"))
{
throw new AdapterException("only available in non-blocking mode");
}
do {
$evt = $this->getTransport()->readLine();
} while($evt instanceof Str && !$evt->section(TeamSpeak3::SEPARATOR_CELL)->startsWith(TeamSpe... | php | public function wait()
{
if($this->getTransport()->getConfig("blocking"))
{
throw new AdapterException("only available in non-blocking mode");
}
do {
$evt = $this->getTransport()->readLine();
} while($evt instanceof Str && !$evt->section(TeamSpeak3::SEPARATOR_CELL)->startsWith(TeamSpe... | [
"public",
"function",
"wait",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getTransport",
"(",
")",
"->",
"getConfig",
"(",
"\"blocking\"",
")",
")",
"{",
"throw",
"new",
"AdapterException",
"(",
"\"only available in non-blocking mode\"",
")",
";",
"}",
"do... | Waits for the server to send a notification message and returns the result.
@throws AdapterException
@return Event | [
"Waits",
"for",
"the",
"server",
"to",
"send",
"a",
"notification",
"message",
"and",
"returns",
"the",
"result",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Adapter/ServerQuery.php#L168-L180 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Adapter/ServerQuery.php | ServerQuery.prepare | public function prepare($cmd, array $params = array())
{
$args = array();
$cells = array();
foreach($params as $ident => $value)
{
$ident = is_numeric($ident) ? "" : strtolower($ident) . TeamSpeak3::SEPARATOR_PAIR;
if(is_array($value))
{
$value = array_values($value);
... | php | public function prepare($cmd, array $params = array())
{
$args = array();
$cells = array();
foreach($params as $ident => $value)
{
$ident = is_numeric($ident) ? "" : strtolower($ident) . TeamSpeak3::SEPARATOR_PAIR;
if(is_array($value))
{
$value = array_values($value);
... | [
"public",
"function",
"prepare",
"(",
"$",
"cmd",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"args",
"=",
"array",
"(",
")",
";",
"$",
"cells",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"ide... | Uses given parameters and returns a prepared ServerQuery command.
@param string $cmd
@param array $params
@return string | [
"Uses",
"given",
"parameters",
"and",
"returns",
"a",
"prepared",
"ServerQuery",
"command",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Adapter/ServerQuery.php#L189-L229 |
ronaldborla/chikka | src/Borla/Chikka/Models/Cost.php | Cost.adjust | public function adjust(Carrier $carrier = null) {
// If there's carrier
if ($carrier !== null) {
// Set carrier
$this->carrier = $carrier;
}
// If there's no carrier
if ( ! isset($this->carrier)) {
// Throw error
throw new MissingCarrier('Carrier is required to adjust cost');... | php | public function adjust(Carrier $carrier = null) {
// If there's carrier
if ($carrier !== null) {
// Set carrier
$this->carrier = $carrier;
}
// If there's no carrier
if ( ! isset($this->carrier)) {
// Throw error
throw new MissingCarrier('Carrier is required to adjust cost');... | [
"public",
"function",
"adjust",
"(",
"Carrier",
"$",
"carrier",
"=",
"null",
")",
"{",
"// If there's carrier",
"if",
"(",
"$",
"carrier",
"!==",
"null",
")",
"{",
"// Set carrier",
"$",
"this",
"->",
"carrier",
"=",
"$",
"carrier",
";",
"}",
"// If there'... | Adjust cost amount for a given carrier | [
"Adjust",
"cost",
"amount",
"for",
"a",
"given",
"carrier"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Cost.php#L79-L109 |
ronaldborla/chikka | src/Borla/Chikka/Models/Cost.php | Cost.fix | public function fix($mobileOrCarrier) {
// If instance of carrier
if ($mobileOrCarrier instanceof Carrier) {
// Use
$this->carrier = $mobileOrCarrier;
}
// If instance of mobile
elseif ($mobileOrCarrier instanceof Mobile) {
// Get carrier
$this->carrier = $mobileOrCarrier->ca... | php | public function fix($mobileOrCarrier) {
// If instance of carrier
if ($mobileOrCarrier instanceof Carrier) {
// Use
$this->carrier = $mobileOrCarrier;
}
// If instance of mobile
elseif ($mobileOrCarrier instanceof Mobile) {
// Get carrier
$this->carrier = $mobileOrCarrier->ca... | [
"public",
"function",
"fix",
"(",
"$",
"mobileOrCarrier",
")",
"{",
"// If instance of carrier",
"if",
"(",
"$",
"mobileOrCarrier",
"instanceof",
"Carrier",
")",
"{",
"// Use",
"$",
"this",
"->",
"carrier",
"=",
"$",
"mobileOrCarrier",
";",
"}",
"// If instance ... | Fix cost by mobile or carrier
@param int|string|Mobile|Carrier $mobileOrCarrier Can be mobile number or instance of Mobile or Carrier | [
"Fix",
"cost",
"by",
"mobile",
"or",
"carrier"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Cost.php#L115-L133 |
railt/reflection | src/Type.php | Type.instanceOf | public function instanceOf(TypeInterface $type): bool
{
$needle = $type->getName();
return $this->is($needle) || \in_array($needle, $this->parent, true);
} | php | public function instanceOf(TypeInterface $type): bool
{
$needle = $type->getName();
return $this->is($needle) || \in_array($needle, $this->parent, true);
} | [
"public",
"function",
"instanceOf",
"(",
"TypeInterface",
"$",
"type",
")",
":",
"bool",
"{",
"$",
"needle",
"=",
"$",
"type",
"->",
"getName",
"(",
")",
";",
"return",
"$",
"this",
"->",
"is",
"(",
"$",
"needle",
")",
"||",
"\\",
"in_array",
"(",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/railt/reflection/blob/3f86cd0cc5f0a0895eaca0def0cb3a3afd7ab377/src/Type.php#L144-L149 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_set.php | ezcMailImapSet.getNextLine | public function getNextLine()
{
if ( $this->currentMessage === null )
{
// instead of calling $this->nextMail() in the constructor, it is called
// here, to avoid sending commands to the server when creating the set, and
// instead send the server commands when pa... | php | public function getNextLine()
{
if ( $this->currentMessage === null )
{
// instead of calling $this->nextMail() in the constructor, it is called
// here, to avoid sending commands to the server when creating the set, and
// instead send the server commands when pa... | [
"public",
"function",
"getNextLine",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currentMessage",
"===",
"null",
")",
"{",
"// instead of calling $this->nextMail() in the constructor, it is called",
"// here, to avoid sending commands to the server when creating the set, and",
... | Returns one line of data from the current mail in the set.
Null is returned if there is no current mail in the set or
the end of the mail is reached,
@return string | [
"Returns",
"one",
"line",
"of",
"data",
"from",
"the",
"current",
"mail",
"in",
"the",
"set",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_set.php#L160-L212 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_set.php | ezcMailImapSet.nextMail | public function nextMail()
{
if ( $this->currentMessage === null )
{
$this->currentMessage = reset( $this->messages );
}
else
{
$this->currentMessage = next( $this->messages );
}
$this->nextData = null;
$this->bytesToRead = fals... | php | public function nextMail()
{
if ( $this->currentMessage === null )
{
$this->currentMessage = reset( $this->messages );
}
else
{
$this->currentMessage = next( $this->messages );
}
$this->nextData = null;
$this->bytesToRead = fals... | [
"public",
"function",
"nextMail",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currentMessage",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"currentMessage",
"=",
"reset",
"(",
"$",
"this",
"->",
"messages",
")",
";",
"}",
"else",
"{",
"$",
"this",
... | Moves the set to the next mail and returns true upon success.
False is returned if there are no more mail in the set.
@throws ezcMailTransportException
if the server sent a negative response
@return bool | [
"Moves",
"the",
"set",
"to",
"the",
"next",
"mail",
"and",
"returns",
"true",
"upon",
"success",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_set.php#L223-L272 |
dave-redfern/laravel-doctrine-entity-audit | src/Utils/ArrayDiff.php | ArrayDiff.diff | public function diff(array $oldData, array $newData)
{
$diff = [];
$keys = array_keys($oldData + $newData);
foreach ($keys as $field) {
$old = array_key_exists($field, $oldData) ? $oldData[$field] : null;
$new = array_key_exists($field, $newData) ? $newData[$... | php | public function diff(array $oldData, array $newData)
{
$diff = [];
$keys = array_keys($oldData + $newData);
foreach ($keys as $field) {
$old = array_key_exists($field, $oldData) ? $oldData[$field] : null;
$new = array_key_exists($field, $newData) ? $newData[$... | [
"public",
"function",
"diff",
"(",
"array",
"$",
"oldData",
",",
"array",
"$",
"newData",
")",
"{",
"$",
"diff",
"=",
"[",
"]",
";",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"oldData",
"+",
"$",
"newData",
")",
";",
"foreach",
"(",
"$",
"keys",
... | @param array $oldData
@param array $newData
@return array | [
"@param",
"array",
"$oldData",
"@param",
"array",
"$newData"
] | train | https://github.com/dave-redfern/laravel-doctrine-entity-audit/blob/ab79e305fe512ceefbc14d585fefe0a40cf911ab/src/Utils/ArrayDiff.php#L40-L59 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/Canonical.php | Canonical.canonicalRedirectQueryStringStrategy | protected function canonicalRedirectQueryStringStrategy () {
/** @var $request \MvcCore\Request */
$request = & $this->request;
$redirectToCanonicalUrl = FALSE;
$requestGlobalGet = & $request->GetGlobalCollection('get');
$requestedCtrlDc = isset($requestGlobalGet[static::URL_PARAM_CONTROLLER]) ? $requestGloba... | php | protected function canonicalRedirectQueryStringStrategy () {
/** @var $request \MvcCore\Request */
$request = & $this->request;
$redirectToCanonicalUrl = FALSE;
$requestGlobalGet = & $request->GetGlobalCollection('get');
$requestedCtrlDc = isset($requestGlobalGet[static::URL_PARAM_CONTROLLER]) ? $requestGloba... | [
"protected",
"function",
"canonicalRedirectQueryStringStrategy",
"(",
")",
"{",
"/** @var $request \\MvcCore\\Request */",
"$",
"request",
"=",
"&",
"$",
"this",
"->",
"request",
";",
"$",
"redirectToCanonicalUrl",
"=",
"FALSE",
";",
"$",
"requestGlobalGet",
"=",
"&",... | If request is routed by query string strategy, check if request controller
or request action is the same as default values. Then redirect to shorter
canonical URL. Check also if there is routed/defined any module domain
route and if there is any, try to complete base URL domain part and also
compare this part with requ... | [
"If",
"request",
"is",
"routed",
"by",
"query",
"string",
"strategy",
"check",
"if",
"request",
"controller",
"or",
"request",
"action",
"is",
"the",
"same",
"as",
"default",
"values",
".",
"Then",
"redirect",
"to",
"shorter",
"canonical",
"URL",
".",
"Check... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/Canonical.php#L27-L66 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/Canonical.php | Canonical.canonicalRedirectRewriteRoutesStrategy | protected function canonicalRedirectRewriteRoutesStrategy () {
/** @var $request \MvcCore\Request */
$request = & $this->request;
$redirectToCanonicalUrl = FALSE;
$defaultParams = $this->GetDefaultParams() ?: [];
if ($this->currentDomainRoute !== NULL) {
$targetDomainRoute = $this->currentDomainRoute;
... | php | protected function canonicalRedirectRewriteRoutesStrategy () {
/** @var $request \MvcCore\Request */
$request = & $this->request;
$redirectToCanonicalUrl = FALSE;
$defaultParams = $this->GetDefaultParams() ?: [];
if ($this->currentDomainRoute !== NULL) {
$targetDomainRoute = $this->currentDomainRoute;
... | [
"protected",
"function",
"canonicalRedirectRewriteRoutesStrategy",
"(",
")",
"{",
"/** @var $request \\MvcCore\\Request */",
"$",
"request",
"=",
"&",
"$",
"this",
"->",
"request",
";",
"$",
"redirectToCanonicalUrl",
"=",
"FALSE",
";",
"$",
"defaultParams",
"=",
"$",
... | If request is routed by rewrite routes strategy, try to complete canonical
URL by current route. Then compare completed base URL part with requested
base URL part or completed path and query part with requested path and query
part. Check also if there is routed/defined any module domain route and
if there is any, try t... | [
"If",
"request",
"is",
"routed",
"by",
"rewrite",
"routes",
"strategy",
"try",
"to",
"complete",
"canonical",
"URL",
"by",
"current",
"route",
".",
"Then",
"compare",
"completed",
"base",
"URL",
"part",
"with",
"requested",
"base",
"URL",
"part",
"or",
"comp... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/Canonical.php#L78-L132 |
KodiComponents/Support | src/Http/CollectionFilters.php | CollectionFilters.apply | public function apply(Collection $collection)
{
$this->collection = $collection;
foreach ($this->filters() as $name => $value) {
if (! method_exists($this, $name)) {
continue;
}
if (is_array($value) or trim($value)) {
$this->colle... | php | public function apply(Collection $collection)
{
$this->collection = $collection;
foreach ($this->filters() as $name => $value) {
if (! method_exists($this, $name)) {
continue;
}
if (is_array($value) or trim($value)) {
$this->colle... | [
"public",
"function",
"apply",
"(",
"Collection",
"$",
"collection",
")",
"{",
"$",
"this",
"->",
"collection",
"=",
"$",
"collection",
";",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if"... | Apply the filters to the collection.
@param Collection $collection
@return Collection | [
"Apply",
"the",
"filters",
"to",
"the",
"collection",
"."
] | train | https://github.com/KodiComponents/Support/blob/9090543605a2354c7454d707650a0abdb815b60a/src/Http/CollectionFilters.php#L41-L58 |
ekuiter/feature-php | FeaturePhp/Generator/FileGenerator.php | FileGenerator.getFileOrDirectorySettings | private function getFileOrDirectorySettings($settings, $key) {
$filesOrDirectories = $settings->getOptional($key, array());
if (!is_array($filesOrDirectories))
$filesOrDirectories = array($filesOrDirectories);
return $filesOrDirectories;
} | php | private function getFileOrDirectorySettings($settings, $key) {
$filesOrDirectories = $settings->getOptional($key, array());
if (!is_array($filesOrDirectories))
$filesOrDirectories = array($filesOrDirectories);
return $filesOrDirectories;
} | [
"private",
"function",
"getFileOrDirectorySettings",
"(",
"$",
"settings",
",",
"$",
"key",
")",
"{",
"$",
"filesOrDirectories",
"=",
"$",
"settings",
"->",
"getOptional",
"(",
"$",
"key",
",",
"array",
"(",
")",
")",
";",
"if",
"(",
"!",
"is_array",
"("... | Returns plain settings arrays with file or directory specifications.
@param Settings $settings
@param string $key
@return array[] | [
"Returns",
"plain",
"settings",
"arrays",
"with",
"file",
"or",
"directory",
"specifications",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/FileGenerator.php#L35-L40 |
ekuiter/feature-php | FeaturePhp/Generator/FileGenerator.php | FileGenerator._generateFiles | protected function _generateFiles() {
foreach ($this->selectedArtifacts as $artifact) {
$settings = $artifact->getGeneratorSettings(static::getKey());
foreach ($this->getFileOrDirectorySettings($settings, "files") as $file)
$this->_processFileSpecification(
... | php | protected function _generateFiles() {
foreach ($this->selectedArtifacts as $artifact) {
$settings = $artifact->getGeneratorSettings(static::getKey());
foreach ($this->getFileOrDirectorySettings($settings, "files") as $file)
$this->_processFileSpecification(
... | [
"protected",
"function",
"_generateFiles",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"selectedArtifacts",
"as",
"$",
"artifact",
")",
"{",
"$",
"settings",
"=",
"$",
"artifact",
"->",
"getGeneratorSettings",
"(",
"static",
"::",
"getKey",
"(",
")",
... | Processes the files and directories. | [
"Processes",
"the",
"files",
"and",
"directories",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/FileGenerator.php#L45-L60 |
ekuiter/feature-php | FeaturePhp/Generator/FileGenerator.php | FileGenerator._processFileSpecification | private function _processFileSpecification($artifact, $fileSpecification) {
if (!in_array(basename($fileSpecification->getSource()), $this->exclude))
$this->processFileSpecification($artifact, $fileSpecification);
} | php | private function _processFileSpecification($artifact, $fileSpecification) {
if (!in_array(basename($fileSpecification->getSource()), $this->exclude))
$this->processFileSpecification($artifact, $fileSpecification);
} | [
"private",
"function",
"_processFileSpecification",
"(",
"$",
"artifact",
",",
"$",
"fileSpecification",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"basename",
"(",
"$",
"fileSpecification",
"->",
"getSource",
"(",
")",
")",
",",
"$",
"this",
"->",
"exclude"... | Processes a file from a specification.
Considers globally excluded files. Only exact file names are supported.
@param \FeaturePhp\Artifact\Artifact $artifact
@param \FeaturePhp\Specification\FileSpecification $fileSpecification | [
"Processes",
"a",
"file",
"from",
"a",
"specification",
".",
"Considers",
"globally",
"excluded",
"files",
".",
"Only",
"exact",
"file",
"names",
"are",
"supported",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/FileGenerator.php#L68-L71 |
ajgarlag/AjglCsv | src/Io/IoAbstract.php | IoAbstract.close | public function close()
{
if (is_resource($this->fileHandler)) {
$res = @fclose($this->fileHandler);
if (false === $res) {
throw new \RuntimeException('Cannot close the given resource');
}
}
} | php | public function close()
{
if (is_resource($this->fileHandler)) {
$res = @fclose($this->fileHandler);
if (false === $res) {
throw new \RuntimeException('Cannot close the given resource');
}
}
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"fileHandler",
")",
")",
"{",
"$",
"res",
"=",
"@",
"fclose",
"(",
"$",
"this",
"->",
"fileHandler",
")",
";",
"if",
"(",
"false",
"===",
"$",
"res",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/ajgarlag/AjglCsv/blob/28872f58b9ef864893cac6faddfcb1229c2c2047/src/Io/IoAbstract.php#L129-L137 |
ajgarlag/AjglCsv | src/Io/IoAbstract.php | IoAbstract.setMode | protected function setMode($mode)
{
$mode = substr((string) $mode, 0, 2);
if (!in_array($mode, $this->validModes, true)) {
throw new \InvalidArgumentException("The given mode '$mode' is not valid for the requested operation");
}
$this->mode = $mode;
return $this;... | php | protected function setMode($mode)
{
$mode = substr((string) $mode, 0, 2);
if (!in_array($mode, $this->validModes, true)) {
throw new \InvalidArgumentException("The given mode '$mode' is not valid for the requested operation");
}
$this->mode = $mode;
return $this;... | [
"protected",
"function",
"setMode",
"(",
"$",
"mode",
")",
"{",
"$",
"mode",
"=",
"substr",
"(",
"(",
"string",
")",
"$",
"mode",
",",
"0",
",",
"2",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"mode",
",",
"$",
"this",
"->",
"validModes",
... | @param string $mode
@throws \InvalidArgumentException
@return \Ajgl\Csv\Io\IoAbstract | [
"@param",
"string",
"$mode"
] | train | https://github.com/ajgarlag/AjglCsv/blob/28872f58b9ef864893cac6faddfcb1229c2c2047/src/Io/IoAbstract.php#L151-L160 |
ajgarlag/AjglCsv | src/Io/IoAbstract.php | IoAbstract.openHandler | protected function openHandler($filePath, $mode)
{
$fileHandler = @fopen($filePath, $mode);
if (false === $fileHandler) {
throw new \RuntimeException("Cannot open the file '$filePath' in '$mode' mode");
}
return $fileHandler;
} | php | protected function openHandler($filePath, $mode)
{
$fileHandler = @fopen($filePath, $mode);
if (false === $fileHandler) {
throw new \RuntimeException("Cannot open the file '$filePath' in '$mode' mode");
}
return $fileHandler;
} | [
"protected",
"function",
"openHandler",
"(",
"$",
"filePath",
",",
"$",
"mode",
")",
"{",
"$",
"fileHandler",
"=",
"@",
"fopen",
"(",
"$",
"filePath",
",",
"$",
"mode",
")",
";",
"if",
"(",
"false",
"===",
"$",
"fileHandler",
")",
"{",
"throw",
"new"... | @param string $filePath
@param string $mode
@throws \RuntimeException
@return resource | [
"@param",
"string",
"$filePath",
"@param",
"string",
"$mode"
] | train | https://github.com/ajgarlag/AjglCsv/blob/28872f58b9ef864893cac6faddfcb1229c2c2047/src/Io/IoAbstract.php#L182-L190 |
ajgarlag/AjglCsv | src/Io/IoAbstract.php | IoAbstract.convertRowCharset | protected function convertRowCharset(array $row, $inputCharset, $fileCharset)
{
foreach ($row as $k => $v) {
$row[$k] = $this->getConverter()->convert($v, $inputCharset, $fileCharset);
}
return $row;
} | php | protected function convertRowCharset(array $row, $inputCharset, $fileCharset)
{
foreach ($row as $k => $v) {
$row[$k] = $this->getConverter()->convert($v, $inputCharset, $fileCharset);
}
return $row;
} | [
"protected",
"function",
"convertRowCharset",
"(",
"array",
"$",
"row",
",",
"$",
"inputCharset",
",",
"$",
"fileCharset",
")",
"{",
"foreach",
"(",
"$",
"row",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"row",
"[",
"$",
"k",
"]",
"=",
"$",
"... | @param array $row
@param string $inputCharset
@param string $fileCharset
@return array | [
"@param",
"array",
"$row",
"@param",
"string",
"$inputCharset",
"@param",
"string",
"$fileCharset"
] | train | https://github.com/ajgarlag/AjglCsv/blob/28872f58b9ef864893cac6faddfcb1229c2c2047/src/Io/IoAbstract.php#L199-L206 |
inhere/php-librarys | src/Traits/LiteContainerStaticTrait.php | LiteContainerStaticTrait.set | public static function set($name, $service, $replace = false)
{
// have been used.
if (isset(self::$instances[$name])) {
throw new \LogicException("The service [$name] have been instanced, don't allow override it.");
}
// setting
if ($replace || !isset(self::$ser... | php | public static function set($name, $service, $replace = false)
{
// have been used.
if (isset(self::$instances[$name])) {
throw new \LogicException("The service [$name] have been instanced, don't allow override it.");
}
// setting
if ($replace || !isset(self::$ser... | [
"public",
"static",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"service",
",",
"$",
"replace",
"=",
"false",
")",
"{",
"// have been used.",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"instances",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
... | register a app service
@param string $name
@param mixed $service service
@param bool $replace replace exists service
@return bool
@throws \LogicException | [
"register",
"a",
"app",
"service"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteContainerStaticTrait.php#L53-L66 |
inhere/php-librarys | src/Traits/LiteContainerStaticTrait.php | LiteContainerStaticTrait.get | public static function get($name, $call = true)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && $service instanceof \Closure && $call) {
... | php | public static function get($name, $call = true)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && $service instanceof \Closure && $call) {
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"call",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"services",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\... | get a app service by name
if is a closure, only run once.
@param string $name
@param bool $call if service is 'Closure', call it.
@return mixed
@throws \RuntimeException | [
"get",
"a",
"app",
"service",
"by",
"name",
"if",
"is",
"a",
"closure",
"only",
"run",
"once",
"."
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteContainerStaticTrait.php#L76-L93 |
inhere/php-librarys | src/Traits/LiteContainerStaticTrait.php | LiteContainerStaticTrait.factory | public static function factory($name)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && method_exists($service, '__invoke')) {
return $... | php | public static function factory($name)
{
if (!isset(self::$services[$name])) {
throw new \RuntimeException("The service [$name] don't register.");
}
$service = self::$services[$name];
if (\is_object($service) && method_exists($service, '__invoke')) {
return $... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"services",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\"The service [$name] don't register.\... | create a app service by name
it always return a new instance.
@param string $name
@return mixed
@throws \RuntimeException | [
"create",
"a",
"app",
"service",
"by",
"name",
"it",
"always",
"return",
"a",
"new",
"instance",
"."
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteContainerStaticTrait.php#L116-L129 |
i-lateral/silverstripe-modeladminplus | src/ModelAdminSnippet.php | ModelAdminSnippet.addExtraClasses | public function addExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
$this->extra_classes = array_merge(
$this->extra_classes,
$classes
);
return $this;
} | php | public function addExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
$this->extra_classes = array_merge(
$this->extra_classes,
$classes
);
return $this;
} | [
"public",
"function",
"addExtraClasses",
"(",
"$",
"classes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"classes",
")",
")",
"{",
"$",
"classes",
"=",
"explode",
"(",
"\" \"",
",",
"$",
"classes",
")",
";",
"}",
"$",
"this",
"->",
"extra_classe... | Add additional css classes
@param array|string $extra_classes extra CSS classes
@return self | [
"Add",
"additional",
"css",
"classes"
] | train | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/ModelAdminSnippet.php#L170-L182 |
i-lateral/silverstripe-modeladminplus | src/ModelAdminSnippet.php | ModelAdminSnippet.removeExtraClasses | public function removeExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
foreach ($classes as $class) {
if (isset($this->extra_classes[$class])) {
unset($this->extra_classes[$class]);
}
}
... | php | public function removeExtraClasses($classes)
{
if (!is_array($classes)) {
$classes = explode(" ", $classes);
}
foreach ($classes as $class) {
if (isset($this->extra_classes[$class])) {
unset($this->extra_classes[$class]);
}
}
... | [
"public",
"function",
"removeExtraClasses",
"(",
"$",
"classes",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"classes",
")",
")",
"{",
"$",
"classes",
"=",
"explode",
"(",
"\" \"",
",",
"$",
"classes",
")",
";",
"}",
"foreach",
"(",
"$",
"classes... | Remove provided CSS classes
@param array|string $extra_classes extra CSS classes
@return self | [
"Remove",
"provided",
"CSS",
"classes"
] | train | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/ModelAdminSnippet.php#L191-L204 |
rem42/scraper | Client.php | Client.api | public function api(Request $request)
{
$reflectClassRequest = new \ReflectionClass($request);
$className = $reflectClassRequest->getShortName();
$className = str_replace('Request', 'Api', $className);
$namespace = str_replace('\Request', '\Api\\', $reflectClassRequest->getNamespa... | php | public function api(Request $request)
{
$reflectClassRequest = new \ReflectionClass($request);
$className = $reflectClassRequest->getShortName();
$className = str_replace('Request', 'Api', $className);
$namespace = str_replace('\Request', '\Api\\', $reflectClassRequest->getNamespa... | [
"public",
"function",
"api",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"reflectClassRequest",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"request",
")",
";",
"$",
"className",
"=",
"$",
"reflectClassRequest",
"->",
"getShortName",
"(",
")",
";",
"... | @param Request $request
@return mixed
@throws \Doctrine\Common\Annotations\AnnotationException
@throws \ReflectionException | [
"@param",
"Request",
"$request"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/Client.php#L32-L45 |
rem42/scraper | Client.php | Client.fetchData | private function fetchData(Request $request, \ReflectionClass $reflectionClass, UrlAnnotation $urlAnnotation)
{
if($this->cache && $this->cacheModel instanceof Cache){
$this->cacheModel->setRequest($request);
$this->cacheModel->setReflectionClass($reflectionClass);
}else{
$this->cache = false;
}
try {... | php | private function fetchData(Request $request, \ReflectionClass $reflectionClass, UrlAnnotation $urlAnnotation)
{
if($this->cache && $this->cacheModel instanceof Cache){
$this->cacheModel->setRequest($request);
$this->cacheModel->setReflectionClass($reflectionClass);
}else{
$this->cache = false;
}
try {... | [
"private",
"function",
"fetchData",
"(",
"Request",
"$",
"request",
",",
"\\",
"ReflectionClass",
"$",
"reflectionClass",
",",
"UrlAnnotation",
"$",
"urlAnnotation",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
"&&",
"$",
"this",
"->",
"cacheModel",
"ins... | @param Request $request
@param \ReflectionClass $reflectionClass
@param UrlAnnotation $urlAnnotation
@return Response | [
"@param",
"Request",
"$request",
"@param",
"\\",
"ReflectionClass",
"$reflectionClass",
"@param",
"UrlAnnotation",
"$urlAnnotation"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/Client.php#L64-L107 |
kusanagi/katana-sdk-php7 | src/Api/Factory/MiddlewareApiFactory.php | MiddlewareApiFactory.build | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
)
{
$payloadMeta = $this->mapper->getPayloadMeta($data);
if ($action === 'request') {
return new RequestApi(
$this->logger->getRequestLogger($payloadMeta->ge... | php | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
)
{
$payloadMeta = $this->mapper->getPayloadMeta($data);
if ($action === 'request') {
return new RequestApi(
$this->logger->getRequestLogger($payloadMeta->ge... | [
"public",
"function",
"build",
"(",
"$",
"action",
",",
"array",
"$",
"data",
",",
"CliInput",
"$",
"input",
",",
"Mapping",
"$",
"mapping",
")",
"{",
"$",
"payloadMeta",
"=",
"$",
"this",
"->",
"mapper",
"->",
"getPayloadMeta",
"(",
"$",
"data",
")",
... | Build a Request Api class instance
@param string $action
@param array $data
@param CliInput $input
@param Mapping $mapping
@return Api | [
"Build",
"a",
"Request",
"Api",
"class",
"instance"
] | train | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/Factory/MiddlewareApiFactory.php#L38-L82 |
NuclearCMS/Hierarchy | src/NodeSourceExtension.php | NodeSourceExtension.getAttribute | public function getAttribute($key)
{
if (isset($this->mutations[$key]))
{
return $this->mutations[$key];
}
if (array_key_exists($key, $mutatables = static::getMutatables()))
{
return $this->mutateExtensionAttribute($key, $mutatables[$key]);
}
... | php | public function getAttribute($key)
{
if (isset($this->mutations[$key]))
{
return $this->mutations[$key];
}
if (array_key_exists($key, $mutatables = static::getMutatables()))
{
return $this->mutateExtensionAttribute($key, $mutatables[$key]);
}
... | [
"public",
"function",
"getAttribute",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"mutations",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"mutations",
"[",
"$",
"key",
"]",
";",
"}",
"if",
"(",
... | Get an attribute from the model with custom accessor.
@param string $key
@return mixed | [
"Get",
"an",
"attribute",
"from",
"the",
"model",
"with",
"custom",
"accessor",
"."
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSourceExtension.php#L42-L55 |
NuclearCMS/Hierarchy | src/NodeSourceExtension.php | NodeSourceExtension.setAttribute | public function setAttribute($key, $value)
{
if (isset($this->mutations[$key]))
{
unset($this->mutations[$key]);
}
return parent::setAttribute($key, $value);
} | php | public function setAttribute($key, $value)
{
if (isset($this->mutations[$key]))
{
unset($this->mutations[$key]);
}
return parent::setAttribute($key, $value);
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"mutations",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"mutations",
"[",
"$",
"key",
"]",
... | Set a given attribute on the model.
@param string $key
@param mixed $value
@return $this | [
"Set",
"a",
"given",
"attribute",
"on",
"the",
"model",
"."
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSourceExtension.php#L64-L72 |
NuclearCMS/Hierarchy | src/NodeSourceExtension.php | NodeSourceExtension.mutateExtensionAttribute | protected function mutateExtensionAttribute($key, $type)
{
$value = $this->getAttributeFromArray($key);
$mutation = $this->{'make' . studly_case($type) . 'TypeMutation'}($value);
$this->mutations[$key] = $mutation;
return $mutation;
} | php | protected function mutateExtensionAttribute($key, $type)
{
$value = $this->getAttributeFromArray($key);
$mutation = $this->{'make' . studly_case($type) . 'TypeMutation'}($value);
$this->mutations[$key] = $mutation;
return $mutation;
} | [
"protected",
"function",
"mutateExtensionAttribute",
"(",
"$",
"key",
",",
"$",
"type",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getAttributeFromArray",
"(",
"$",
"key",
")",
";",
"$",
"mutation",
"=",
"$",
"this",
"->",
"{",
"'make'",
".",
"st... | Mutates and stores an attribute in array
@param string $key
@param string $type
@return mixed | [
"Mutates",
"and",
"stores",
"an",
"attribute",
"in",
"array"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSourceExtension.php#L81-L90 |
NuclearCMS/Hierarchy | src/NodeSourceExtension.php | NodeSourceExtension.toArray | public function toArray()
{
$attributes = [];
foreach ($this->fillable as $attribute)
{
$attributes[$attribute] = $this->getAttributeFromArray($attribute);
}
return $attributes;
} | php | public function toArray()
{
$attributes = [];
foreach ($this->fillable as $attribute)
{
$attributes[$attribute] = $this->getAttributeFromArray($attribute);
}
return $attributes;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"attributes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"fillable",
"as",
"$",
"attribute",
")",
"{",
"$",
"attributes",
"[",
"$",
"attribute",
"]",
"=",
"$",
"this",
"->",
"getAttribu... | Convert the model instance to an array.
@return array | [
"Convert",
"the",
"model",
"instance",
"to",
"an",
"array",
"."
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeSourceExtension.php#L152-L162 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/sqlite/reader.php | ezcDbSchemaSqliteReader.convertToGenericType | static function convertToGenericType( $typeString, &$typeLength, &$typePrecision )
{
preg_match( "@([a-z ]*)(\((\d*)(,(\d+))?\))?@", strtolower( $typeString ), $matches );
if ( !isset( self::$typeMap[$matches[1]] ) )
{
throw new ezcDbSchemaUnsupportedTypeException( 'SQLite', $mat... | php | static function convertToGenericType( $typeString, &$typeLength, &$typePrecision )
{
preg_match( "@([a-z ]*)(\((\d*)(,(\d+))?\))?@", strtolower( $typeString ), $matches );
if ( !isset( self::$typeMap[$matches[1]] ) )
{
throw new ezcDbSchemaUnsupportedTypeException( 'SQLite', $mat... | [
"static",
"function",
"convertToGenericType",
"(",
"$",
"typeString",
",",
"&",
"$",
"typeLength",
",",
"&",
"$",
"typePrecision",
")",
"{",
"preg_match",
"(",
"\"@([a-z ]*)(\\((\\d*)(,(\\d+))?\\))?@\"",
",",
"strtolower",
"(",
"$",
"typeString",
")",
",",
"$",
... | Converts the native SQLite type in $typeString to a generic DbSchema type.
This method converts a string like "float(5,10)" to the generic DbSchema
type and uses the by-reference parameters $typeLength and $typePrecision
to communicate the optional length and precision of the field's type.
@param string $typeString
... | [
"Converts",
"the",
"native",
"SQLite",
"type",
"in",
"$typeString",
"to",
"a",
"generic",
"DbSchema",
"type",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/sqlite/reader.php#L136-L164 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/sqlite/reader.php | ezcDbSchemaSqliteReader.fetchTableIndexes | protected function fetchTableIndexes( $tableName )
{
$indexBuffer = array();
$indexNamesArray = $this->db->query( "PRAGMA INDEX_LIST ('$tableName')" );
$primaryFound = false;
foreach ( $indexNamesArray as $row )
{
$row = $this->lowercase($row);
$keyNa... | php | protected function fetchTableIndexes( $tableName )
{
$indexBuffer = array();
$indexNamesArray = $this->db->query( "PRAGMA INDEX_LIST ('$tableName')" );
$primaryFound = false;
foreach ( $indexNamesArray as $row )
{
$row = $this->lowercase($row);
$keyNa... | [
"protected",
"function",
"fetchTableIndexes",
"(",
"$",
"tableName",
")",
"{",
"$",
"indexBuffer",
"=",
"array",
"(",
")",
";",
"$",
"indexNamesArray",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"\"PRAGMA INDEX_LIST ('$tableName')\"",
")",
";",
"$",
"... | Loops over all the indexes in the table $table and extracts information.
This method extracts information about the table $tableName's indexes
from the database and returns this schema as an array of
ezcDbSchemaIndex objects. The key in the array is the index' name.
@param string $tableName
@return array(string=>ezc... | [
"Loops",
"over",
"all",
"the",
"indexes",
"in",
"the",
"table",
"$table",
"and",
"extracts",
"information",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/sqlite/reader.php#L213-L267 |
surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.setLogger | public function setLogger(\sb\Logger\Base $logger, $logname=''){
$this->logger = $logger;
$this->log_name = $logname ? $logname : get_called_class();
$this->log_name = preg_replace("~[^\w+]~", "_", $this->log_name);
} | php | public function setLogger(\sb\Logger\Base $logger, $logname=''){
$this->logger = $logger;
$this->log_name = $logname ? $logname : get_called_class();
$this->log_name = preg_replace("~[^\w+]~", "_", $this->log_name);
} | [
"public",
"function",
"setLogger",
"(",
"\\",
"sb",
"\\",
"Logger",
"\\",
"Base",
"$",
"logger",
",",
"$",
"logname",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"logger",
"=",
"$",
"logger",
";",
"$",
"this",
"->",
"log_name",
"=",
"$",
"logname",
"?"... | Set the logger that logs the full log message stream
when the destructor runs
@param \sb\Logger\Base $logger | [
"Set",
"the",
"logger",
"that",
"logs",
"the",
"full",
"log",
"message",
"stream",
"when",
"the",
"destructor",
"runs"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L141-L145 |
surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.log | public function log($message, $type = "MESSAGE", $text_attributes = [])
{
$type = strtoupper($type);
switch ($type) {
case 'RAW':
break;
case 'ERROR':
$this->number_of_errors++;
$this->onError($message);
default:... | php | public function log($message, $type = "MESSAGE", $text_attributes = [])
{
$type = strtoupper($type);
switch ($type) {
case 'RAW':
break;
case 'ERROR':
$this->number_of_errors++;
$this->onError($message);
default:... | [
"public",
"function",
"log",
"(",
"$",
"message",
",",
"$",
"type",
"=",
"\"MESSAGE\"",
",",
"$",
"text_attributes",
"=",
"[",
"]",
")",
"{",
"$",
"type",
"=",
"strtoupper",
"(",
"$",
"type",
")",
";",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
... | Logs to std out
@param string $message The message of the line
@param string $type The prefix of the line, if ERROR, encrements error count
@param array|string $text_attributes, used to describe how output should look
e.g. ['fgcolor' => 'red', 'bgcolor' => 'yellow', 'bold' => true, 'underline' => true, 'keep' => false]... | [
"Logs",
"to",
"std",
"out"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L202-L262 |
surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.logToFile | protected function logToFile($message){
if(isset($this->logger) && $this->logger instanceof \sb\Logger\Base){
return $this->logger->{$this->log_name}($message);
}
} | php | protected function logToFile($message){
if(isset($this->logger) && $this->logger instanceof \sb\Logger\Base){
return $this->logger->{$this->log_name}($message);
}
} | [
"protected",
"function",
"logToFile",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"logger",
")",
"&&",
"$",
"this",
"->",
"logger",
"instanceof",
"\\",
"sb",
"\\",
"Logger",
"\\",
"Base",
")",
"{",
"return",
"$",
"this"... | Logs to file
@param string $message
@return string | [
"Logs",
"to",
"file"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L269-L273 |
surebert/surebert-framework | src/sb/Controller/Command/Line.php | Line.getCommandlineInvocation | public function getCommandlineInvocation($method_name, $http_host=null, $http_args=[])
{
$command_prefix = "php " . ROOT . "/public/index.php";
// Match fully-qualified method name: e.g. \Foo\Controllers\Jobs\Bar::baz()
preg_match('/Controllers.([^:]+)::([A-Za-z_]+)/', $method_name, $matche... | php | public function getCommandlineInvocation($method_name, $http_host=null, $http_args=[])
{
$command_prefix = "php " . ROOT . "/public/index.php";
// Match fully-qualified method name: e.g. \Foo\Controllers\Jobs\Bar::baz()
preg_match('/Controllers.([^:]+)::([A-Za-z_]+)/', $method_name, $matche... | [
"public",
"function",
"getCommandlineInvocation",
"(",
"$",
"method_name",
",",
"$",
"http_host",
"=",
"null",
",",
"$",
"http_args",
"=",
"[",
"]",
")",
"{",
"$",
"command_prefix",
"=",
"\"php \"",
".",
"ROOT",
".",
"\"/public/index.php\"",
";",
"// Match ful... | Returns the name of a controller method in a format that can
be used in a commandline invocation.
@param string $method_name Fully qualified name to method whose invocation is being generated
@param string $http_host --http_host arg, optional, defaults to Gateway::$http_host
@param array $http_args Query stri... | [
"Returns",
"the",
"name",
"of",
"a",
"controller",
"method",
"in",
"a",
"format",
"that",
"can",
"be",
"used",
"in",
"a",
"commandline",
"invocation",
"."
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Command/Line.php#L316-L341 |
Eresus/EresusCMS | src/core/PluginInfo.php | Eresus_PluginInfo.loadFromFile | public static function loadFromFile($filename)
{
$xmlFile = substr($filename, 0, -4) . '/plugin.xml';
if (file_exists($xmlFile))
{
return self::loadFromXmlFile($xmlFile);
}
else
{
return self::loadFromPhpFile($filename);
}
} | php | public static function loadFromFile($filename)
{
$xmlFile = substr($filename, 0, -4) . '/plugin.xml';
if (file_exists($xmlFile))
{
return self::loadFromXmlFile($xmlFile);
}
else
{
return self::loadFromPhpFile($filename);
}
} | [
"public",
"static",
"function",
"loadFromFile",
"(",
"$",
"filename",
")",
"{",
"$",
"xmlFile",
"=",
"substr",
"(",
"$",
"filename",
",",
"0",
",",
"-",
"4",
")",
".",
"'/plugin.xml'",
";",
"if",
"(",
"file_exists",
"(",
"$",
"xmlFile",
")",
")",
"{"... | Создаёт объект из файла
@param string $filename
@throws RuntimeException если файл содержит ошибки
@return Eresus_PluginInfo
@since 2.16 | [
"Создаёт",
"объект",
"из",
"файла"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/PluginInfo.php#L102-L113 |
Eresus/EresusCMS | src/core/PluginInfo.php | Eresus_PluginInfo.loadFromXmlFile | private static function loadFromXmlFile($filename)
{
/* Это временное решение до полного отказа от PHP-файла */
$info = self::loadFromPhpFile(substr($filename, 0, -11) . '.php');
libxml_use_internal_errors(true);
libxml_clear_errors();
$xml = new SimpleXMLElement($filename, 0, true);
$errors = libxml_get_... | php | private static function loadFromXmlFile($filename)
{
/* Это временное решение до полного отказа от PHP-файла */
$info = self::loadFromPhpFile(substr($filename, 0, -11) . '.php');
libxml_use_internal_errors(true);
libxml_clear_errors();
$xml = new SimpleXMLElement($filename, 0, true);
$errors = libxml_get_... | [
"private",
"static",
"function",
"loadFromXmlFile",
"(",
"$",
"filename",
")",
"{",
"/* Это временное решение до полного отказа от PHP-файла */",
"$",
"info",
"=",
"self",
"::",
"loadFromPhpFile",
"(",
"substr",
"(",
"$",
"filename",
",",
"0",
",",
"-",
"11",
")",... | Создаёт объект из файла XML
@param string $filename
@throws RuntimeException если XML содержит ошибки
@return Eresus_PluginInfo
@since 2.16 | [
"Создаёт",
"объект",
"из",
"файла",
"XML"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/PluginInfo.php#L232-L276 |
Eresus/EresusCMS | src/core/PluginInfo.php | Eresus_PluginInfo.loadFromPhpFile | private static function loadFromPhpFile($filename)
{
$source = file_get_contents($filename);
$tokens = token_get_all($source);
$skipTokens = array(T_COMMENT, T_DOC_COMMENT);
$props = array('$version', '$kernel', '$title', '$description');
$info = new self;
$state = null;
foreach ($tokens as $token)
{... | php | private static function loadFromPhpFile($filename)
{
$source = file_get_contents($filename);
$tokens = token_get_all($source);
$skipTokens = array(T_COMMENT, T_DOC_COMMENT);
$props = array('$version', '$kernel', '$title', '$description');
$info = new self;
$state = null;
foreach ($tokens as $token)
{... | [
"private",
"static",
"function",
"loadFromPhpFile",
"(",
"$",
"filename",
")",
"{",
"$",
"source",
"=",
"file_get_contents",
"(",
"$",
"filename",
")",
";",
"$",
"tokens",
"=",
"token_get_all",
"(",
"$",
"source",
")",
";",
"$",
"skipTokens",
"=",
"array",... | Создаёт объект из файла PHP
@param string $filename
@return Eresus_PluginInfo
@since 2.16 | [
"Создаёт",
"объект",
"из",
"файла",
"PHP"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/PluginInfo.php#L287-L345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.