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 |
|---|---|---|---|---|---|---|---|---|---|---|
huasituo/hstcms | src/Libraries/Fields/FieldAbs.php | FieldAbs.insert_value | public function insert_value(Request $request, $field, $postData = [])
{
$fieldname = $field['fieldname'];
$value = $request->get($fieldname);
if($field['fieldtype'] == 'Date' || $field['fieldtype'] == 'DateTime') {
$value = (int)hst_str2time($value);
}
if (strpos($field['... | php | public function insert_value(Request $request, $field, $postData = [])
{
$fieldname = $field['fieldname'];
$value = $request->get($fieldname);
if($field['fieldtype'] == 'Date' || $field['fieldtype'] == 'DateTime') {
$value = (int)hst_str2time($value);
}
if (strpos($field['... | [
"public",
"function",
"insert_value",
"(",
"Request",
"$",
"request",
",",
"$",
"field",
",",
"$",
"postData",
"=",
"[",
"]",
")",
"{",
"$",
"fieldname",
"=",
"$",
"field",
"[",
"'fieldname'",
"]",
";",
"$",
"value",
"=",
"$",
"request",
"->",
"get",... | 处理输入数据,提供给入库 | [
"处理输入数据,提供给入库"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/FieldAbs.php#L112-L127 |
huasituo/hstcms | src/Libraries/Fields/FieldAbs.php | FieldAbs.field_type | public function field_type($name = NULL, $length = NULL, $fvalue = '')
{
if ($this->fieldtype === TRUE) {
$select = '<option value="">-</option>
<option value="INT" '.($name == 'INT' ? 'selected' : '').'>INT</option>
<option value="TINYINT" '.($name == 'TINYINT' ? 'selected' : '').'>TINYINT</option>
<... | php | public function field_type($name = NULL, $length = NULL, $fvalue = '')
{
if ($this->fieldtype === TRUE) {
$select = '<option value="">-</option>
<option value="INT" '.($name == 'INT' ? 'selected' : '').'>INT</option>
<option value="TINYINT" '.($name == 'TINYINT' ? 'selected' : '').'>TINYINT</option>
<... | [
"public",
"function",
"field_type",
"(",
"$",
"name",
"=",
"NULL",
",",
"$",
"length",
"=",
"NULL",
",",
"$",
"fvalue",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fieldtype",
"===",
"TRUE",
")",
"{",
"$",
"select",
"=",
"'<option value=\"\">... | 字段类型选择
@param string $name
@param string $length
@return string | [
"字段类型选择"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/FieldAbs.php#L196-L252 |
huasituo/hstcms | src/Libraries/Fields/FieldAbs.php | FieldAbs.input_format | public function input_format($name, $text, $value, $tips, $formattr = '')
{
return str_replace(['{name}', '{text}', '{value}', '{tips}', '{formattr}'], [$name, $text, $value, $tips, $formattr], $this->format);
} | php | public function input_format($name, $text, $value, $tips, $formattr = '')
{
return str_replace(['{name}', '{text}', '{value}', '{tips}', '{formattr}'], [$name, $text, $value, $tips, $formattr], $this->format);
} | [
"public",
"function",
"input_format",
"(",
"$",
"name",
",",
"$",
"text",
",",
"$",
"value",
",",
"$",
"tips",
",",
"$",
"formattr",
"=",
"''",
")",
"{",
"return",
"str_replace",
"(",
"[",
"'{name}'",
",",
"'{text}'",
",",
"'{value}'",
",",
"'{tips}'",... | 表单输入格式
@param string $name 字段名称
@param string $text 字段别名
@param string $value 表单输入内容
@return string | [
"表单输入格式"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Fields/FieldAbs.php#L262-L265 |
baleen/cli | src/Config/Definition.php | Definition.addMigrationsNode | protected function addMigrationsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('migrations');
$node->isRequired()
->children()
->scalarNode('directory')->defaultValue('migrations')->end()
->scalarNode('namespace')->defaultValue('Mig... | php | protected function addMigrationsNode()
{
$builder = new TreeBuilder();
$node = $builder->root('migrations');
$node->isRequired()
->children()
->scalarNode('directory')->defaultValue('migrations')->end()
->scalarNode('namespace')->defaultValue('Mig... | [
"protected",
"function",
"addMigrationsNode",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"node",
"=",
"$",
"builder",
"->",
"root",
"(",
"'migrations'",
")",
";",
"$",
"node",
"->",
"isRequired",
"(",
")",
"->",
"chil... | addMigrationsNode.
@return \Symfony\Component\Config\Definition\Builder\NodeDefinition | [
"addMigrationsNode",
"."
] | train | https://github.com/baleen/cli/blob/2ecbc7179c5800c9075fd93204ef25da375536ed/src/Config/Definition.php#L64-L77 |
tequila/mongodb-php-lib | src/OptionsResolver/OptionsResolver.php | OptionsResolver.get | public static function get($resolverClass)
{
if (!is_string($resolverClass)) {
throw new InvalidArgumentException('$resolverClass must be a string.');
}
if (!array_key_exists($resolverClass, self::$cache)) {
if (!class_exists($resolverClass)) {
throw ... | php | public static function get($resolverClass)
{
if (!is_string($resolverClass)) {
throw new InvalidArgumentException('$resolverClass must be a string.');
}
if (!array_key_exists($resolverClass, self::$cache)) {
if (!class_exists($resolverClass)) {
throw ... | [
"public",
"static",
"function",
"get",
"(",
"$",
"resolverClass",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"resolverClass",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'$resolverClass must be a string.'",
")",
";",
"}",
"if",
"(",
... | @param string $resolverClass fully-qualified class name of resolver
@return OptionsResolver | [
"@param",
"string",
"$resolverClass",
"fully",
"-",
"qualified",
"class",
"name",
"of",
"resolver"
] | train | https://github.com/tequila/mongodb-php-lib/blob/49a25f45268df358f5ceb40a655d9a7ddc6db4f7/src/OptionsResolver/OptionsResolver.php#L34-L65 |
czim/laravel-pxlcms | src/Generator/Writer/Model/Steps/StubReplaceSluggableData.php | StubReplaceSluggableData.getSluggableConfigReplace | protected function getSluggableConfigReplace()
{
$setup = $this->data->sluggable_setup;
if ( ! $this->context->modelIsSluggable || ! $this->data->sluggable || empty($setup)) return '';
$replace = $this->tab() . "protected \$sluggable = [\n";
$rows = [];
if (array_get($se... | php | protected function getSluggableConfigReplace()
{
$setup = $this->data->sluggable_setup;
if ( ! $this->context->modelIsSluggable || ! $this->data->sluggable || empty($setup)) return '';
$replace = $this->tab() . "protected \$sluggable = [\n";
$rows = [];
if (array_get($se... | [
"protected",
"function",
"getSluggableConfigReplace",
"(",
")",
"{",
"$",
"setup",
"=",
"$",
"this",
"->",
"data",
"->",
"sluggable_setup",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"context",
"->",
"modelIsSluggable",
"||",
"!",
"$",
"this",
"->",
"data",
... | Returns the replacement for the sluggable config placeholder
@return string | [
"Returns",
"the",
"replacement",
"for",
"the",
"sluggable",
"config",
"placeholder"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceSluggableData.php#L18-L60 |
alexpts/psr15-middlewares | src/ResponseTime.php | ResponseTime.process | public function process(ServerRequestInterface $request, RequestHandlerInterface $next) : ResponseInterface
{
$server = $request->getServerParams();
$startTime = $server['REQUEST_TIME_FLOAT'] ?? microtime(true);
$response = $next->handle($request);
$diff = $this->getDiff($startTime)... | php | public function process(ServerRequestInterface $request, RequestHandlerInterface $next) : ResponseInterface
{
$server = $request->getServerParams();
$startTime = $server['REQUEST_TIME_FLOAT'] ?? microtime(true);
$response = $next->handle($request);
$diff = $this->getDiff($startTime)... | [
"public",
"function",
"process",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"RequestHandlerInterface",
"$",
"next",
")",
":",
"ResponseInterface",
"{",
"$",
"server",
"=",
"$",
"request",
"->",
"getServerParams",
"(",
")",
";",
"$",
"startTime",
"=",
... | @param ServerRequestInterface $request
@param RequestHandlerInterface $next
@return ResponseInterface
@throws \InvalidArgumentException | [
"@param",
"ServerRequestInterface",
"$request",
"@param",
"RequestHandlerInterface",
"$next"
] | train | https://github.com/alexpts/psr15-middlewares/blob/bff2887d5af01c54d9288fd19c20f0f593b69358/src/ResponseTime.php#L28-L37 |
huasituo/hstcms | src/Console/Generators/MakeInstallCommand.php | MakeInstallCommand.stepOne | private function stepOne()
{
if (file_exists(base_path('hstcms.install.lck'))) {
$this->info(hst_lang('hstcms::install.install.already').'HSTCMS'.config('hstcms.version').','.hst_lang('hstcms::install.install.one'));
return true;
}
if (!$this->files->isFile(base_path(... | php | private function stepOne()
{
if (file_exists(base_path('hstcms.install.lck'))) {
$this->info(hst_lang('hstcms::install.install.already').'HSTCMS'.config('hstcms.version').','.hst_lang('hstcms::install.install.one'));
return true;
}
if (!$this->files->isFile(base_path(... | [
"private",
"function",
"stepOne",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"base_path",
"(",
"'hstcms.install.lck'",
")",
")",
")",
"{",
"$",
"this",
"->",
"info",
"(",
"hst_lang",
"(",
"'hstcms::install.install.already'",
")",
".",
"'HSTCMS'",
".",
"co... | Step 1: Configure module manifest.
@return mixed | [
"Step",
"1",
":",
"Configure",
"module",
"manifest",
"."
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Console/Generators/MakeInstallCommand.php#L86-L215 |
jkribeiro/composer-hydration | src/Composer/ComposerHydration.php | ComposerHydration.meatOnBones | public static function meatOnBones(Event $event)
{
$basePath = realpath(".");
$handler = new ComposerHydrationHandler($event, $basePath);
$handler->hydrate();
} | php | public static function meatOnBones(Event $event)
{
$basePath = realpath(".");
$handler = new ComposerHydrationHandler($event, $basePath);
$handler->hydrate();
} | [
"public",
"static",
"function",
"meatOnBones",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"basePath",
"=",
"realpath",
"(",
"\".\"",
")",
";",
"$",
"handler",
"=",
"new",
"ComposerHydrationHandler",
"(",
"$",
"event",
",",
"$",
"basePath",
")",
";",
"$",... | Composer callback method for Hydration process.
@param object $event
Composer Event object. | [
"Composer",
"callback",
"method",
"for",
"Hydration",
"process",
"."
] | train | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydration.php#L24-L30 |
comelyio/comely | src/Comely/IO/Mailer/Messages/Message.php | Message.compile | public function compile(string $separator = ""): string
{
// Boundaries
$uniqueId = md5(uniqid(sprintf("%s-%s", $this->subject, microtime(false))));
$boundaries[] = "--Comely_B1" . $uniqueId;
$boundaries[] = "--Comely_B2" . $uniqueId;
$boundaries[] = "--Comely_B3" . $uniqueId... | php | public function compile(string $separator = ""): string
{
// Boundaries
$uniqueId = md5(uniqid(sprintf("%s-%s", $this->subject, microtime(false))));
$boundaries[] = "--Comely_B1" . $uniqueId;
$boundaries[] = "--Comely_B2" . $uniqueId;
$boundaries[] = "--Comely_B3" . $uniqueId... | [
"public",
"function",
"compile",
"(",
"string",
"$",
"separator",
"=",
"\"\"",
")",
":",
"string",
"{",
"// Boundaries",
"$",
"uniqueId",
"=",
"md5",
"(",
"uniqid",
"(",
"sprintf",
"(",
"\"%s-%s\"",
",",
"$",
"this",
"->",
"subject",
",",
"microtime",
"(... | Get compiled email in MIME format
@param string $separator
@return string | [
"Get",
"compiled",
"email",
"in",
"MIME",
"format"
] | train | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Mailer/Messages/Message.php#L131-L189 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php | StyleRuleSet.setSelectors | public function setSelectors($selectors)
{
$this->selectors = [];
if (!is_array($selectors)) {
$selectors = [$selectors];
}
foreach ($selectors as $selector) {
$this->addSelector($selector);
}
return $this;
} | php | public function setSelectors($selectors)
{
$this->selectors = [];
if (!is_array($selectors)) {
$selectors = [$selectors];
}
foreach ($selectors as $selector) {
$this->addSelector($selector);
}
return $this;
} | [
"public",
"function",
"setSelectors",
"(",
"$",
"selectors",
")",
"{",
"$",
"this",
"->",
"selectors",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"selectors",
")",
")",
"{",
"$",
"selectors",
"=",
"[",
"$",
"selectors",
"]",
";",
"}"... | Sets the selectors for the style rule.
@param StyleSelector[]|StyleSelector $selectors
@return $this | [
"Sets",
"the",
"selectors",
"for",
"the",
"style",
"rule",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php#L43-L54 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php | StyleRuleSet.addDeclaration | public function addDeclaration(DeclarationAbstract $declaration)
{
if ($declaration instanceof StyleDeclaration) {
$this->declarations[] = $declaration;
} else {
throw new \InvalidArgumentException(
"Invalid declaration instance. Instance of 'StyleDeclaration'... | php | public function addDeclaration(DeclarationAbstract $declaration)
{
if ($declaration instanceof StyleDeclaration) {
$this->declarations[] = $declaration;
} else {
throw new \InvalidArgumentException(
"Invalid declaration instance. Instance of 'StyleDeclaration'... | [
"public",
"function",
"addDeclaration",
"(",
"DeclarationAbstract",
"$",
"declaration",
")",
"{",
"if",
"(",
"$",
"declaration",
"instanceof",
"StyleDeclaration",
")",
"{",
"$",
"this",
"->",
"declarations",
"[",
"]",
"=",
"$",
"declaration",
";",
"}",
"else",... | Adds a declaration to the rule.
@param StyleDeclaration $declaration
@return $this | [
"Adds",
"a",
"declaration",
"to",
"the",
"rule",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php#L85-L96 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php | StyleRuleSet.parseRuleString | protected function parseRuleString($ruleString)
{
foreach ($this->getSelectorStrings($ruleString) as $selectorString)
{
// Check for invalid selector (e.g. if starting with a comma, like in this example from
// the spec ",all { body { background:lime } }")
if ($se... | php | protected function parseRuleString($ruleString)
{
foreach ($this->getSelectorStrings($ruleString) as $selectorString)
{
// Check for invalid selector (e.g. if starting with a comma, like in this example from
// the spec ",all { body { background:lime } }")
if ($se... | [
"protected",
"function",
"parseRuleString",
"(",
"$",
"ruleString",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getSelectorStrings",
"(",
"$",
"ruleString",
")",
"as",
"$",
"selectorString",
")",
"{",
"// Check for invalid selector (e.g. if starting with a comma, like... | Parses the selector rule.
@param string $ruleString | [
"Parses",
"the",
"selector",
"rule",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php#L103-L117 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php | StyleRuleSet.getSelectorStrings | protected function getSelectorStrings($selectorList)
{
$charset = $this->getCharset();
$groupsOpened = 0;
$ignoreGroupOpenCloseChar = false;
$enclosedChar = null;
$selectors = [];
$subSelectorList = "";
$currentSelectors = [""];
$currentSelectorKeys ... | php | protected function getSelectorStrings($selectorList)
{
$charset = $this->getCharset();
$groupsOpened = 0;
$ignoreGroupOpenCloseChar = false;
$enclosedChar = null;
$selectors = [];
$subSelectorList = "";
$currentSelectors = [""];
$currentSelectorKeys ... | [
"protected",
"function",
"getSelectorStrings",
"(",
"$",
"selectorList",
")",
"{",
"$",
"charset",
"=",
"$",
"this",
"->",
"getCharset",
"(",
")",
";",
"$",
"groupsOpened",
"=",
"0",
";",
"$",
"ignoreGroupOpenCloseChar",
"=",
"false",
";",
"$",
"enclosedChar... | Helper method to parse the style rule.
@param string $selectorList
@return array | [
"Helper",
"method",
"to",
"parse",
"the",
"style",
"rule",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php#L125-L243 |
movoin/one-swoole | src/Event/OnceListener.php | OnceListener.handle | public function handle(Event $event)
{
$name = $event->getName();
$emitter = $event->getEmitter();
$emitter->removeListener($name, $this);
unset($name, $emitter);
call_user_func_array($this->handler, [$event]);
} | php | public function handle(Event $event)
{
$name = $event->getName();
$emitter = $event->getEmitter();
$emitter->removeListener($name, $this);
unset($name, $emitter);
call_user_func_array($this->handler, [$event]);
} | [
"public",
"function",
"handle",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"name",
"=",
"$",
"event",
"->",
"getName",
"(",
")",
";",
"$",
"emitter",
"=",
"$",
"event",
"->",
"getEmitter",
"(",
")",
";",
"$",
"emitter",
"->",
"removeListener",
"(",
... | 处理事件
@param \One\Event\Event $event | [
"处理事件"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Event/OnceListener.php#L24-L33 |
movoin/one-swoole | src/Event/OnceListener.php | OnceListener.isListener | public function isListener($listener): bool
{
if (Assert::instanceOf($listener, '\\One\\Event\\OnceListener')) {
$listener = $listener->getHandler();
}
return $this->handler === $listener;
} | php | public function isListener($listener): bool
{
if (Assert::instanceOf($listener, '\\One\\Event\\OnceListener')) {
$listener = $listener->getHandler();
}
return $this->handler === $listener;
} | [
"public",
"function",
"isListener",
"(",
"$",
"listener",
")",
":",
"bool",
"{",
"if",
"(",
"Assert",
"::",
"instanceOf",
"(",
"$",
"listener",
",",
"'\\\\One\\\\Event\\\\OnceListener'",
")",
")",
"{",
"$",
"listener",
"=",
"$",
"listener",
"->",
"getHandler... | 判断是否是自己
@param mixed $listener
@return bool | [
"判断是否是自己"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Event/OnceListener.php#L42-L49 |
nick-jones/globby | lib/Globby/Builder/Regex.php | Regex.createFromTokens | public function createFromTokens(array $tokens)
{
$buffer = $this->delimiter . '^';
foreach ($tokens as $token) {
$buffer .= $this->translateToken($token);
}
$buffer .= '$' . $this->delimiter . $this->modifiers;
return $buffer;
} | php | public function createFromTokens(array $tokens)
{
$buffer = $this->delimiter . '^';
foreach ($tokens as $token) {
$buffer .= $this->translateToken($token);
}
$buffer .= '$' . $this->delimiter . $this->modifiers;
return $buffer;
} | [
"public",
"function",
"createFromTokens",
"(",
"array",
"$",
"tokens",
")",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"delimiter",
".",
"'^'",
";",
"foreach",
"(",
"$",
"tokens",
"as",
"$",
"token",
")",
"{",
"$",
"buffer",
".=",
"$",
"this",
"->",... | Creates a regular expression based on the supplied tokens. This return expression will be wrapped by the
value of the 'delimiter' property, and the modifiers contained within the 'modifiers' property will be appended
to the end.
@param array $tokens
@return string | [
"Creates",
"a",
"regular",
"expression",
"based",
"on",
"the",
"supplied",
"tokens",
".",
"This",
"return",
"expression",
"will",
"be",
"wrapped",
"by",
"the",
"value",
"of",
"the",
"delimiter",
"property",
"and",
"the",
"modifiers",
"contained",
"within",
"th... | train | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L79-L90 |
nick-jones/globby | lib/Globby/Builder/Regex.php | Regex.translateToken | protected function translateToken(array $token)
{
$identifier = is_string($token[0]) ? null : $token[0];
$value = $token[2];
$result = $this->translateTokenFromIdentifier($identifier, $value);
if ($result === null) {
throw new BuildException(sprintf('No available transl... | php | protected function translateToken(array $token)
{
$identifier = is_string($token[0]) ? null : $token[0];
$value = $token[2];
$result = $this->translateTokenFromIdentifier($identifier, $value);
if ($result === null) {
throw new BuildException(sprintf('No available transl... | [
"protected",
"function",
"translateToken",
"(",
"array",
"$",
"token",
")",
"{",
"$",
"identifier",
"=",
"is_string",
"(",
"$",
"token",
"[",
"0",
"]",
")",
"?",
"null",
":",
"$",
"token",
"[",
"0",
"]",
";",
"$",
"value",
"=",
"$",
"token",
"[",
... | Translates a token into an appropriate regular expression construct. Various map directly to the same values;
others require some massaging and escaping to make them valid within the constructed in the regular expression.
@param array $token
@return string
@throws BuildException | [
"Translates",
"a",
"token",
"into",
"an",
"appropriate",
"regular",
"expression",
"construct",
".",
"Various",
"map",
"directly",
"to",
"the",
"same",
"values",
";",
"others",
"require",
"some",
"massaging",
"and",
"escaping",
"to",
"make",
"them",
"valid",
"w... | train | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L100-L112 |
nick-jones/globby | lib/Globby/Builder/Regex.php | Regex.translateTokenFromIdentifier | protected function translateTokenFromIdentifier($identifier, $value)
{
$result = null;
if (array_key_exists($identifier, self::$tokenValueMap)) {
$result = $this->translateTokenUsingMap($identifier);
} elseif (array_key_exists($identifier, self::$tokenCallbackMap)) {
... | php | protected function translateTokenFromIdentifier($identifier, $value)
{
$result = null;
if (array_key_exists($identifier, self::$tokenValueMap)) {
$result = $this->translateTokenUsingMap($identifier);
} elseif (array_key_exists($identifier, self::$tokenCallbackMap)) {
... | [
"protected",
"function",
"translateTokenFromIdentifier",
"(",
"$",
"identifier",
",",
"$",
"value",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"identifier",
",",
"self",
"::",
"$",
"tokenValueMap",
")",
")",
"{",
"$... | Translates a token based on the identifier flavour.
@param int $identifier
@param string $value
@return string|null | [
"Translates",
"a",
"token",
"based",
"on",
"the",
"identifier",
"flavour",
"."
] | train | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L121-L132 |
nick-jones/globby | lib/Globby/Builder/Regex.php | Regex.translateTokenUsingCallback | protected function translateTokenUsingCallback($identifier, $value)
{
$method = self::$tokenCallbackMap[$identifier];
return call_user_func(
[$this, $method],
$value
);
} | php | protected function translateTokenUsingCallback($identifier, $value)
{
$method = self::$tokenCallbackMap[$identifier];
return call_user_func(
[$this, $method],
$value
);
} | [
"protected",
"function",
"translateTokenUsingCallback",
"(",
"$",
"identifier",
",",
"$",
"value",
")",
"{",
"$",
"method",
"=",
"self",
"::",
"$",
"tokenCallbackMap",
"[",
"$",
"identifier",
"]",
";",
"return",
"call_user_func",
"(",
"[",
"$",
"this",
",",
... | Calls an internal method to retrieve an appropriate value for use within the regex.
@param int $identifier
@param string $value
@return string | [
"Calls",
"an",
"internal",
"method",
"to",
"retrieve",
"an",
"appropriate",
"value",
"for",
"use",
"within",
"the",
"regex",
"."
] | train | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L152-L160 |
iter8-au/builder | src/Builder/Builders/SpoutBuilder.php | SpoutBuilder.setActiveSheetIndex | public function setActiveSheetIndex(int $sheetIndex = 1)
{
$sheets = $this->writer->getSheets();
if (!isset($sheets[$sheetIndex])) {
throw new SheetNotFoundException(
sprintf(
'The given sheet "%d" does not exist in the workbook.',
... | php | public function setActiveSheetIndex(int $sheetIndex = 1)
{
$sheets = $this->writer->getSheets();
if (!isset($sheets[$sheetIndex])) {
throw new SheetNotFoundException(
sprintf(
'The given sheet "%d" does not exist in the workbook.',
... | [
"public",
"function",
"setActiveSheetIndex",
"(",
"int",
"$",
"sheetIndex",
"=",
"1",
")",
"{",
"$",
"sheets",
"=",
"$",
"this",
"->",
"writer",
"->",
"getSheets",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"sheets",
"[",
"$",
"sheetIndex",
"]... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/SpoutBuilder.php#L107-L123 |
iter8-au/builder | src/Builder/Builders/SpoutBuilder.php | SpoutBuilder.setSheetTitle | public function setSheetTitle(string $title)
{
if ($this->isNotInitialised()) {
$this->initialise();
}
$this->writer->getCurrentSheet()->setName($title);
return $this;
} | php | public function setSheetTitle(string $title)
{
if ($this->isNotInitialised()) {
$this->initialise();
}
$this->writer->getCurrentSheet()->setName($title);
return $this;
} | [
"public",
"function",
"setSheetTitle",
"(",
"string",
"$",
"title",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNotInitialised",
"(",
")",
")",
"{",
"$",
"this",
"->",
"initialise",
"(",
")",
";",
"}",
"$",
"this",
"->",
"writer",
"->",
"getCurrentSheet... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/SpoutBuilder.php#L128-L137 |
iter8-au/builder | src/Builder/Builders/SpoutBuilder.php | SpoutBuilder.buildRowStyle | public function buildRowStyle(array $style)
{
$finalStyle = new StyleBuilder();
// Spout doesn't offer support for changing column alignment.
if (array_key_exists('font', $style)) {
if (array_key_exists('color', $style['font'])) {
$finalStyle->setFontColor(
... | php | public function buildRowStyle(array $style)
{
$finalStyle = new StyleBuilder();
// Spout doesn't offer support for changing column alignment.
if (array_key_exists('font', $style)) {
if (array_key_exists('color', $style['font'])) {
$finalStyle->setFontColor(
... | [
"public",
"function",
"buildRowStyle",
"(",
"array",
"$",
"style",
")",
"{",
"$",
"finalStyle",
"=",
"new",
"StyleBuilder",
"(",
")",
";",
"// Spout doesn't offer support for changing column alignment.",
"if",
"(",
"array_key_exists",
"(",
"'font'",
",",
"$",
"style... | @param array $style
@return Style | [
"@param",
"array",
"$style"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/SpoutBuilder.php#L152-L171 |
iter8-au/builder | src/Builder/Builders/SpoutBuilder.php | SpoutBuilder.buildHeaderRow | public function buildHeaderRow(
array $columns,
$style = null
): void {
if ($this->isNotInitialised()) {
$this->initialise();
}
if ($style instanceof Style) {
$this->writer->addRowWithStyle($columns, $style);
} else {
$this->writer... | php | public function buildHeaderRow(
array $columns,
$style = null
): void {
if ($this->isNotInitialised()) {
$this->initialise();
}
if ($style instanceof Style) {
$this->writer->addRowWithStyle($columns, $style);
} else {
$this->writer... | [
"public",
"function",
"buildHeaderRow",
"(",
"array",
"$",
"columns",
",",
"$",
"style",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"isNotInitialised",
"(",
")",
")",
"{",
"$",
"this",
"->",
"initialise",
"(",
")",
";",
"}",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/SpoutBuilder.php#L176-L191 |
iter8-au/builder | src/Builder/Builders/SpoutBuilder.php | SpoutBuilder.buildRow | public function buildRow(
array $row,
$style = null,
$rowIndex = 1
): void {
if ($this->isNotInitialised()) {
$this->initialise();
}
if ($style instanceof Style) {
$this->writer->addRowWithStyle($row, $style);
} else {
$thi... | php | public function buildRow(
array $row,
$style = null,
$rowIndex = 1
): void {
if ($this->isNotInitialised()) {
$this->initialise();
}
if ($style instanceof Style) {
$this->writer->addRowWithStyle($row, $style);
} else {
$thi... | [
"public",
"function",
"buildRow",
"(",
"array",
"$",
"row",
",",
"$",
"style",
"=",
"null",
",",
"$",
"rowIndex",
"=",
"1",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"isNotInitialised",
"(",
")",
")",
"{",
"$",
"this",
"->",
"initialise"... | {@inheritdoc}
Spout does not require the $rowIndex parameter. | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/SpoutBuilder.php#L198-L214 |
iter8-au/builder | src/Builder/Builders/SpoutBuilder.php | SpoutBuilder.buildRows | public function buildRows(
array $rows,
$style = null
): void {
if ($this->isNotInitialised()) {
$this->initialise();
}
if ($style instanceof Style) {
$this->writer->addRowsWithStyle($rows, $style);
} else {
$this->writer->addRows(... | php | public function buildRows(
array $rows,
$style = null
): void {
if ($this->isNotInitialised()) {
$this->initialise();
}
if ($style instanceof Style) {
$this->writer->addRowsWithStyle($rows, $style);
} else {
$this->writer->addRows(... | [
"public",
"function",
"buildRows",
"(",
"array",
"$",
"rows",
",",
"$",
"style",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"isNotInitialised",
"(",
")",
")",
"{",
"$",
"this",
"->",
"initialise",
"(",
")",
";",
"}",
"if",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builders/SpoutBuilder.php#L219-L234 |
alexpts/psr15-middlewares | src/ErrorToJsonResponse.php | ErrorToJsonResponse.closeOutputBuffers | protected function closeOutputBuffers(int $targetLevel = 0, bool $flush = false): void
{
$status = ob_get_status(true);
$level = \count($status);
while ($level-- > $targetLevel) {
$flush ? ob_end_flush() : ob_end_clean();
}
} | php | protected function closeOutputBuffers(int $targetLevel = 0, bool $flush = false): void
{
$status = ob_get_status(true);
$level = \count($status);
while ($level-- > $targetLevel) {
$flush ? ob_end_flush() : ob_end_clean();
}
} | [
"protected",
"function",
"closeOutputBuffers",
"(",
"int",
"$",
"targetLevel",
"=",
"0",
",",
"bool",
"$",
"flush",
"=",
"false",
")",
":",
"void",
"{",
"$",
"status",
"=",
"ob_get_status",
"(",
"true",
")",
";",
"$",
"level",
"=",
"\\",
"count",
"(",
... | Cleans or flushes output buffers up to target level.
Resulting level can be greater than target level if a non-removable buffer has been encountered.
@param int $targetLevel
@param bool $flush
@see original Symfony Response::closeOutputBuffers | [
"Cleans",
"or",
"flushes",
"output",
"buffers",
"up",
"to",
"target",
"level",
".",
"Resulting",
"level",
"can",
"be",
"greater",
"than",
"target",
"level",
"if",
"a",
"non",
"-",
"removable",
"buffer",
"has",
"been",
"encountered",
"."
] | train | https://github.com/alexpts/psr15-middlewares/blob/bff2887d5af01c54d9288fd19c20f0f593b69358/src/ErrorToJsonResponse.php#L85-L93 |
withfatpanda/illuminate-wordpress | src/Support/Exceptions/Handler.php | Handler.report | public function report(Exception $e)
{
if ($this->shouldntReport($e)) {
return;
}
try {
if ($this->plugin->bound('bugsnag.multi')) {
$logger = $this->plugin->make('bugsnag.multi');
} else {
$logger = $this->plug... | php | public function report(Exception $e)
{
if ($this->shouldntReport($e)) {
return;
}
try {
if ($this->plugin->bound('bugsnag.multi')) {
$logger = $this->plugin->make('bugsnag.multi');
} else {
$logger = $this->plug... | [
"public",
"function",
"report",
"(",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"shouldntReport",
"(",
"$",
"e",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"plugin",
"->",
"bound",
"(",
"'bugs... | Report or log an exception.
This is a great spot to send exceptions to Sentry, Bugsnag, etc.
@param \Exception $e
@return void | [
"Report",
"or",
"log",
"an",
"exception",
"."
] | train | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/Support/Exceptions/Handler.php#L53-L72 |
drunomics/service-utils | src/Core/Render/RendererTrait.php | RendererTrait.getrenderer | public function getrenderer() {
if (empty($this->renderer)) {
$this->renderer = \Drupal::service('renderer');
}
return $this->renderer;
} | php | public function getrenderer() {
if (empty($this->renderer)) {
$this->renderer = \Drupal::service('renderer');
}
return $this->renderer;
} | [
"public",
"function",
"getrenderer",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"renderer",
")",
")",
"{",
"$",
"this",
"->",
"renderer",
"=",
"\\",
"Drupal",
"::",
"service",
"(",
"'renderer'",
")",
";",
"}",
"return",
"$",
"this",
... | Gets the renderer.
@return \Drupal\Core\Render\RendererInterface
The renderer. | [
"Gets",
"the",
"renderer",
"."
] | train | https://github.com/drunomics/service-utils/blob/56761750043132365ef4ae5d9e0cf4263459328f/src/Core/Render/RendererTrait.php#L38-L43 |
verschoof/bunq-api | src/Token/Storage/FileTokenStorage.php | FileTokenStorage.loadToken | private function loadToken(TokenType $type)
{
// take from cache, filesystems are slow
if (isset($this->cache[$type->toString()])) {
return $this->cache[$type->toString()];
}
$token = trim(file_get_contents($this->path . '/' . $type->toString()));
if (!$token) {... | php | private function loadToken(TokenType $type)
{
// take from cache, filesystems are slow
if (isset($this->cache[$type->toString()])) {
return $this->cache[$type->toString()];
}
$token = trim(file_get_contents($this->path . '/' . $type->toString()));
if (!$token) {... | [
"private",
"function",
"loadToken",
"(",
"TokenType",
"$",
"type",
")",
"{",
"// take from cache, filesystems are slow",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"type",
"->",
"toString",
"(",
")",
"]",
")",
")",
"{",
"return",
"$",
... | @param TokenType $type
@return string
@throws TokenNotFoundException | [
"@param",
"TokenType",
"$type"
] | train | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Token/Storage/FileTokenStorage.php#L66-L83 |
model3/model3 | src/Model3/Db/Table.php | Table.describe | protected function describe()
{
if(is_null($this->_tableName) == false)
{
$this->_query = 'DESCRIBE '.$this->_tableName;
if($this->_db->execute($this->_query) !== false)
{
$res = $this->_db->getAllRows();
unset($this->_fields);
unset($this->_primaryKey);
... | php | protected function describe()
{
if(is_null($this->_tableName) == false)
{
$this->_query = 'DESCRIBE '.$this->_tableName;
if($this->_db->execute($this->_query) !== false)
{
$res = $this->_db->getAllRows();
unset($this->_fields);
unset($this->_primaryKey);
... | [
"protected",
"function",
"describe",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_tableName",
")",
"==",
"false",
")",
"{",
"$",
"this",
"->",
"_query",
"=",
"'DESCRIBE '",
".",
"$",
"this",
"->",
"_tableName",
";",
"if",
"(",
"$",
... | for now, this method is intended just for tables with one primary key | [
"for",
"now",
"this",
"method",
"is",
"intended",
"just",
"for",
"tables",
"with",
"one",
"primary",
"key"
] | train | https://github.com/model3/model3/blob/c62858013fce9bac597d47a2475c69aebe7d6209/src/Model3/Db/Table.php#L98-L119 |
model3/model3 | src/Model3/Db/Table.php | Table.insert | public function insert($data)
{
//var_dump($data);
unset($this->_error);
if(is_array($data))
{
$fields = '';
$values = '';
reset($data);
for($counter = 0, $maxIndex = count($data), $valid = true; $counter < $maxIndex && $valid == true; $counter ++)
{
$elementKey = key($data);
$elementKey... | php | public function insert($data)
{
//var_dump($data);
unset($this->_error);
if(is_array($data))
{
$fields = '';
$values = '';
reset($data);
for($counter = 0, $maxIndex = count($data), $valid = true; $counter < $maxIndex && $valid == true; $counter ++)
{
$elementKey = key($data);
$elementKey... | [
"public",
"function",
"insert",
"(",
"$",
"data",
")",
"{",
"//var_dump($data);",
"unset",
"(",
"$",
"this",
"->",
"_error",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"$",
"fields",
"=",
"''",
";",
"$",
"values",
"=",
"''",
... | data is an associative array containing the name of the field and its value | [
"data",
"is",
"an",
"associative",
"array",
"containing",
"the",
"name",
"of",
"the",
"field",
"and",
"its",
"value"
] | train | https://github.com/model3/model3/blob/c62858013fce9bac597d47a2475c69aebe7d6209/src/Model3/Db/Table.php#L122-L179 |
model3/model3 | src/Model3/Db/Table.php | Table.composeQuery | protected function composeQuery($key, $values)
{
$query = '';
for($counter = 0, $maxIndex = count($values); $counter < $maxIndex; $counter ++)
{
if(is_numeric($values[$counter]))
$query .= $key.' = '.$values[$counter];
else
$query .= $key.... | php | protected function composeQuery($key, $values)
{
$query = '';
for($counter = 0, $maxIndex = count($values); $counter < $maxIndex; $counter ++)
{
if(is_numeric($values[$counter]))
$query .= $key.' = '.$values[$counter];
else
$query .= $key.... | [
"protected",
"function",
"composeQuery",
"(",
"$",
"key",
",",
"$",
"values",
")",
"{",
"$",
"query",
"=",
"''",
";",
"for",
"(",
"$",
"counter",
"=",
"0",
",",
"$",
"maxIndex",
"=",
"count",
"(",
"$",
"values",
")",
";",
"$",
"counter",
"<",
"$"... | compose query | [
"compose",
"query"
] | train | https://github.com/model3/model3/blob/c62858013fce9bac597d47a2475c69aebe7d6209/src/Model3/Db/Table.php#L231-L244 |
model3/model3 | src/Model3/Db/Table.php | Table.find | public function find($key, $values, $order = null)
{
if(is_array($values) == false)
$arrayOfValues = array($values);
else
$arrayOfValues = $values;
$orderString = '';
if($this->basicCheck($key, $arrayOfValues) == true)
{
$orderChecked = strcasecmp('DESC', $o... | php | public function find($key, $values, $order = null)
{
if(is_array($values) == false)
$arrayOfValues = array($values);
else
$arrayOfValues = $values;
$orderString = '';
if($this->basicCheck($key, $arrayOfValues) == true)
{
$orderChecked = strcasecmp('DESC', $o... | [
"public",
"function",
"find",
"(",
"$",
"key",
",",
"$",
"values",
",",
"$",
"order",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"values",
")",
"==",
"false",
")",
"$",
"arrayOfValues",
"=",
"array",
"(",
"$",
"values",
")",
";",
"el... | for now this method is just accepting a single key value (no arrays allowed) | [
"for",
"now",
"this",
"method",
"is",
"just",
"accepting",
"a",
"single",
"key",
"value",
"(",
"no",
"arrays",
"allowed",
")"
] | train | https://github.com/model3/model3/blob/c62858013fce9bac597d47a2475c69aebe7d6209/src/Model3/Db/Table.php#L288-L303 |
dragosprotung/stc-core | src/Workout/AbstractSportMapper.php | AbstractSportMapper.sportFromCode | public function sportFromCode($code) : string
{
$code = strtolower($code);
$codes = array_flip(static::getMap());
return $codes[$code] ?? self::OTHER;
} | php | public function sportFromCode($code) : string
{
$code = strtolower($code);
$codes = array_flip(static::getMap());
return $codes[$code] ?? self::OTHER;
} | [
"public",
"function",
"sportFromCode",
"(",
"$",
"code",
")",
":",
"string",
"{",
"$",
"code",
"=",
"strtolower",
"(",
"$",
"code",
")",
";",
"$",
"codes",
"=",
"array_flip",
"(",
"static",
"::",
"getMap",
"(",
")",
")",
";",
"return",
"$",
"codes",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/AbstractSportMapper.php#L24-L30 |
dragosprotung/stc-core | src/Workout/AbstractSportMapper.php | AbstractSportMapper.codeFromSport | public function codeFromSport($sport) : string
{
$sport = strtolower($sport);
$codes = static::getMap();
if (array_key_exists($sport, $codes)) {
return $codes[$sport];
} elseif (array_key_exists(self::OTHER, $codes)) {
return $codes[self::OTHER];
}
... | php | public function codeFromSport($sport) : string
{
$sport = strtolower($sport);
$codes = static::getMap();
if (array_key_exists($sport, $codes)) {
return $codes[$sport];
} elseif (array_key_exists(self::OTHER, $codes)) {
return $codes[self::OTHER];
}
... | [
"public",
"function",
"codeFromSport",
"(",
"$",
"sport",
")",
":",
"string",
"{",
"$",
"sport",
"=",
"strtolower",
"(",
"$",
"sport",
")",
";",
"$",
"codes",
"=",
"static",
"::",
"getMap",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"spo... | {@inheritdoc} | [
"{"
] | train | https://github.com/dragosprotung/stc-core/blob/9783e3414294f4ee555a1d538d2807269deeb9e7/src/Workout/AbstractSportMapper.php#L35-L47 |
ejsmont-artur/phpProxyBuilder | src/PhpProxyBuilder/Adapter/Intrumentor/SimpleArrayIntrumentor.php | SimpleArrayIntrumentor.incrementCounter | public function incrementCounter($name, $value = 1) {
if (!isset($this->counters[$name])) {
$this->counters[$name] = 0;
}
$this->counters[$name] += $value;
} | php | public function incrementCounter($name, $value = 1) {
if (!isset($this->counters[$name])) {
$this->counters[$name] = 0;
}
$this->counters[$name] += $value;
} | [
"public",
"function",
"incrementCounter",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"counters",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"counters",
"[",
"$",
"name",... | Increments named counter by $value
@param string $name name of the counter
@param int $value value to be added to the counter, default 1
@return InstrumentorInterface returns $this for chaining | [
"Increments",
"named",
"counter",
"by",
"$value"
] | train | https://github.com/ejsmont-artur/phpProxyBuilder/blob/ef7ec14e5d18eeba7a93e3617a0fdb5b146d6480/src/PhpProxyBuilder/Adapter/Intrumentor/SimpleArrayIntrumentor.php#L53-L58 |
ejsmont-artur/phpProxyBuilder | src/PhpProxyBuilder/Adapter/Intrumentor/SimpleArrayIntrumentor.php | SimpleArrayIntrumentor.incrementTimer | public function incrementTimer($name, $time) {
if (!isset($this->timers[$name])) {
$this->timers[$name] = 0;
}
$this->timers[$name] += $this->getTime() - $time;
} | php | public function incrementTimer($name, $time) {
if (!isset($this->timers[$name])) {
$this->timers[$name] = 0;
}
$this->timers[$name] += $this->getTime() - $time;
} | [
"public",
"function",
"incrementTimer",
"(",
"$",
"name",
",",
"$",
"time",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"timers",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"timers",
"[",
"$",
"name",
"]",
"=",
"0",... | Increments named timer.
@param string $name name of the timer
@param mixed $time time value acquired from getTime() method
@return InstrumentorInterface returns $this for chaining | [
"Increments",
"named",
"timer",
"."
] | train | https://github.com/ejsmont-artur/phpProxyBuilder/blob/ef7ec14e5d18eeba7a93e3617a0fdb5b146d6480/src/PhpProxyBuilder/Adapter/Intrumentor/SimpleArrayIntrumentor.php#L67-L72 |
movoin/one-swoole | src/Swoole/Traits/HasProtocol.php | HasProtocol.createProtocol | protected function createProtocol(string $protocol): self
{
$this->protocol = Factory::newProtocol($protocol);
$this->protocol->setServer($this);
return $this;
} | php | protected function createProtocol(string $protocol): self
{
$this->protocol = Factory::newProtocol($protocol);
$this->protocol->setServer($this);
return $this;
} | [
"protected",
"function",
"createProtocol",
"(",
"string",
"$",
"protocol",
")",
":",
"self",
"{",
"$",
"this",
"->",
"protocol",
"=",
"Factory",
"::",
"newProtocol",
"(",
"$",
"protocol",
")",
";",
"$",
"this",
"->",
"protocol",
"->",
"setServer",
"(",
"... | 创建协议
@param string $protocol
@return self
@throws \One\Protocol\Exceptions\ProtocolException | [
"创建协议"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Swoole/Traits/HasProtocol.php#L45-L51 |
movoin/one-swoole | src/Swoole/Traits/HasProtocol.php | HasProtocol.callProtocolMethod | protected function callProtocolMethod(string $event, ...$parameters)
{
if (method_exists($this->protocol, $event)) {
call_user_func_array([$this->protocol, $event], $parameters);
}
} | php | protected function callProtocolMethod(string $event, ...$parameters)
{
if (method_exists($this->protocol, $event)) {
call_user_func_array([$this->protocol, $event], $parameters);
}
} | [
"protected",
"function",
"callProtocolMethod",
"(",
"string",
"$",
"event",
",",
"...",
"$",
"parameters",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"protocol",
",",
"$",
"event",
")",
")",
"{",
"call_user_func_array",
"(",
"[",
"$",
... | 调用协议方法
@param string $event
@param array $parameters | [
"调用协议方法"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Swoole/Traits/HasProtocol.php#L59-L64 |
puli/twig-extension | src/NodeVisitor/TemplatePathResolver.php | TemplatePathResolver.processNode | protected function processNode(Twig_Node $node)
{
if ($node instanceof Twig_Node_Module) {
return $this->processModuleNode($node);
}
if ($node instanceof Twig_Node_Include) {
return $this->processIncludeNode($node);
}
if ($node instanceof Twig_Node_I... | php | protected function processNode(Twig_Node $node)
{
if ($node instanceof Twig_Node_Module) {
return $this->processModuleNode($node);
}
if ($node instanceof Twig_Node_Include) {
return $this->processIncludeNode($node);
}
if ($node instanceof Twig_Node_I... | [
"protected",
"function",
"processNode",
"(",
"Twig_Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"Twig_Node_Module",
")",
"{",
"return",
"$",
"this",
"->",
"processModuleNode",
"(",
"$",
"node",
")",
";",
"}",
"if",
"(",
"$",
"node"... | {@inheritdoc} | [
"{"
] | train | https://github.com/puli/twig-extension/blob/b19fce610aa9fda5d86c73045ed5b9d378c47b93/src/NodeVisitor/TemplatePathResolver.php#L65-L84 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/TraitVendorPrefix.php | TraitVendorPrefix.setVendorPrefix | public function setVendorPrefix($vendorPrefix)
{
if (is_string($vendorPrefix)) {
$this->vendorPrefix = $vendorPrefix;
} else {
throw new \InvalidArgumentException(
"Invalid type '" . gettype($vendorPrefix). "' for argument 'vendorPrefix' given."
);... | php | public function setVendorPrefix($vendorPrefix)
{
if (is_string($vendorPrefix)) {
$this->vendorPrefix = $vendorPrefix;
} else {
throw new \InvalidArgumentException(
"Invalid type '" . gettype($vendorPrefix). "' for argument 'vendorPrefix' given."
);... | [
"public",
"function",
"setVendorPrefix",
"(",
"$",
"vendorPrefix",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"vendorPrefix",
")",
")",
"{",
"$",
"this",
"->",
"vendorPrefix",
"=",
"$",
"vendorPrefix",
";",
"}",
"else",
"{",
"throw",
"new",
"\\",
"Inval... | Sets the vendor prefix.
@param $vendorPrefix | [
"Sets",
"the",
"vendor",
"prefix",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/TraitVendorPrefix.php#L13-L22 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/TraitVendorPrefix.php | TraitVendorPrefix.getVendorPrefixRegExp | public static function getVendorPrefixRegExp($delimiter = null)
{
$vendorPrefixValues = self::getVendorPrefixValues();
foreach ($vendorPrefixValues as $vendorPrefixKey => $vendorPrefixValue) {
$vendorPrefixValues[$vendorPrefixKey] = preg_quote($vendorPrefixValue, $delimiter);
}
... | php | public static function getVendorPrefixRegExp($delimiter = null)
{
$vendorPrefixValues = self::getVendorPrefixValues();
foreach ($vendorPrefixValues as $vendorPrefixKey => $vendorPrefixValue) {
$vendorPrefixValues[$vendorPrefixKey] = preg_quote($vendorPrefixValue, $delimiter);
}
... | [
"public",
"static",
"function",
"getVendorPrefixRegExp",
"(",
"$",
"delimiter",
"=",
"null",
")",
"{",
"$",
"vendorPrefixValues",
"=",
"self",
"::",
"getVendorPrefixValues",
"(",
")",
";",
"foreach",
"(",
"$",
"vendorPrefixValues",
"as",
"$",
"vendorPrefixKey",
... | Returns a partial regular expression of known vendor prefixes.
@param string|null $delimiter
@return string | [
"Returns",
"a",
"partial",
"regular",
"expression",
"of",
"known",
"vendor",
"prefixes",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/TraitVendorPrefix.php#L67-L74 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.count | public function count($filters = [], $options = [])
{
return $this->collection->count($this->castQuery($filters), $options);
} | php | public function count($filters = [], $options = [])
{
return $this->collection->count($this->castQuery($filters), $options);
} | [
"public",
"function",
"count",
"(",
"$",
"filters",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"collection",
"->",
"count",
"(",
"$",
"this",
"->",
"castQuery",
"(",
"$",
"filters",
")",
",",
"$",
"o... | Count corresponding documents for filters
@param array $filters Object
@param array $options Options for the query
@return int Number of corresponding documents | [
"Count",
"corresponding",
"documents",
"for",
"filters"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L131-L134 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.distinct | public function distinct($fieldName, $filters = [], $options = [])
{
$field = $fieldName;
$propInfos = $this->classMetadata->getPropertyInfoForField($fieldName);
if (!$propInfos) {
$propInfos = $this->classMetadata->getPropertyInfo($fieldName);
}
if (isset($prop... | php | public function distinct($fieldName, $filters = [], $options = [])
{
$field = $fieldName;
$propInfos = $this->classMetadata->getPropertyInfoForField($fieldName);
if (!$propInfos) {
$propInfos = $this->classMetadata->getPropertyInfo($fieldName);
}
if (isset($prop... | [
"public",
"function",
"distinct",
"(",
"$",
"fieldName",
",",
"$",
"filters",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"field",
"=",
"$",
"fieldName",
";",
"$",
"propInfos",
"=",
"$",
"this",
"->",
"classMetadata",
"->",
"g... | Get distinct value for a field
@param string $fieldName Name of the field
@param array $filters Filters of query
@param array $options Options of query
@return array List of distinct values | [
"Get",
"distinct",
"value",
"for",
"a",
"field"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L144-L165 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.find | public function find($id, $projections = [], $options = [])
{
$options = $this->createOption($projections, null, $options);
$result = $this->collection->findOne(["_id" => $id], $options);
return $this->createObject($result, $options);
} | php | public function find($id, $projections = [], $options = [])
{
$options = $this->createOption($projections, null, $options);
$result = $this->collection->findOne(["_id" => $id], $options);
return $this->createObject($result, $options);
} | [
"public",
"function",
"find",
"(",
"$",
"id",
",",
"$",
"projections",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"createOption",
"(",
"$",
"projections",
",",
"null",
",",
"$",
"options",
... | Find document by ID
Options :
* readOnly : boolean - When false, flush will not update object
@see MongoDB\Operation\FindOne::__construct for more option
@param mixed $id Id of the document
@param array $projections Projection of the query
@param arra... | [
"Find",
"document",
"by",
"ID"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L179-L186 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.findAll | public function findAll($projections = [], $sorts = [], $options = [])
{
$options = $this->createOption($projections, $sorts, $options);
$result = $this->collection->find([], $options);
if (!isset($options['iterator']) || $options['iterator'] === false) {
$objects = [];
... | php | public function findAll($projections = [], $sorts = [], $options = [])
{
$options = $this->createOption($projections, $sorts, $options);
$result = $this->collection->find([], $options);
if (!isset($options['iterator']) || $options['iterator'] === false) {
$objects = [];
... | [
"public",
"function",
"findAll",
"(",
"$",
"projections",
"=",
"[",
"]",
",",
"$",
"sorts",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"createOption",
"(",
"$",
"projections",
",",
"$",
"s... | Find all document of the collection
Options :
* readOnly : boolean - When false, flush will not update object
* iterator : boolean|string - Return DocumentIterator if true (or specified class if is string)
@see MongoDB\Operation\Find::__construct for more option
@param array $projections ... | [
"Find",
"all",
"document",
"of",
"the",
"collection"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L201-L223 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.findOneBy | public function findOneBy($filters = [], $projections = [], $sorts = [], $options = [])
{
$options = $this->createOption($projections, $sorts, $options);
$filters = $this->castQuery($filters);
$result = $this->collection->findOne($filters, $options);
return $this->createObject($re... | php | public function findOneBy($filters = [], $projections = [], $sorts = [], $options = [])
{
$options = $this->createOption($projections, $sorts, $options);
$filters = $this->castQuery($filters);
$result = $this->collection->findOne($filters, $options);
return $this->createObject($re... | [
"public",
"function",
"findOneBy",
"(",
"$",
"filters",
"=",
"[",
"]",
",",
"$",
"projections",
"=",
"[",
"]",
",",
"$",
"sorts",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"createOption",... | Get first document which match the query
Options :
* readOnly : boolean - When false, flush will not update object
@see MongoDB\Operation\Find::__construct for more option
@param array $filters Filters
@param array $projections Projection of the query
@param... | [
"Get",
"first",
"document",
"which",
"match",
"the",
"query"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L279-L288 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.findAndModifyOneBy | public function findAndModifyOneBy($filters = [], $update = [], $projections = [], $sorts = [], $options = [])
{
$options = $this->createOption($projections, $sorts, $options);
$filters = $this->castQuery($filters);
$update = $this->castQuery($update);
$result = (array) $this->col... | php | public function findAndModifyOneBy($filters = [], $update = [], $projections = [], $sorts = [], $options = [])
{
$options = $this->createOption($projections, $sorts, $options);
$filters = $this->castQuery($filters);
$update = $this->castQuery($update);
$result = (array) $this->col... | [
"public",
"function",
"findAndModifyOneBy",
"(",
"$",
"filters",
"=",
"[",
"]",
",",
"$",
"update",
"=",
"[",
"]",
",",
"$",
"projections",
"=",
"[",
"]",
",",
"$",
"sorts",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"opt... | Find a document and make specified update on it
Options :
* readOnly : boolean - When false, flush will not update object
@see MongoDB\Operation\FindAndModify::__construct for more option
@param array $filters Filters
@param array $update Update to perf... | [
"Find",
"a",
"document",
"and",
"make",
"specified",
"update",
"on",
"it"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L305-L316 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.getTailableCursor | public function getTailableCursor($filters = [], $options = [])
{
$options['cursorType'] = \MongoDB\Operation\Find::TAILABLE_AWAIT;
return $this->collection->find($this->castQuery($filters), $options);
} | php | public function getTailableCursor($filters = [], $options = [])
{
$options['cursorType'] = \MongoDB\Operation\Find::TAILABLE_AWAIT;
return $this->collection->find($this->castQuery($filters), $options);
} | [
"public",
"function",
"getTailableCursor",
"(",
"$",
"filters",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"[",
"'cursorType'",
"]",
"=",
"\\",
"MongoDB",
"\\",
"Operation",
"\\",
"Find",
"::",
"TAILABLE_AWAIT",
";",
"... | Get tailable cursor for query
@param array $filters Filters of query
@param array $options Option (Tailable setted as default)
@return \MongoDB\Driver\TailableCursor A tailable cursor | [
"Get",
"tailable",
"cursor",
"for",
"query"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L325-L330 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.insertOne | public function insertOne($document, $options = [])
{
$query = new InsertOne($this->documentManager, $this, $document, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();
}
} | php | public function insertOne($document, $options = [])
{
$query = new InsertOne($this->documentManager, $this, $document, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();
}
} | [
"public",
"function",
"insertOne",
"(",
"$",
"document",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"new",
"InsertOne",
"(",
"$",
"this",
"->",
"documentManager",
",",
"$",
"this",
",",
"$",
"document",
",",
"$",
"options",
")",... | Insert a document in collection
@param mixed $document Document to insert
@param array $options Options
@return void | [
"Insert",
"a",
"document",
"in",
"collection"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L339-L347 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.insertMany | public function insertMany($documents, $options = [])
{
$insertQuery = [];
foreach ($documents as $document) {
$this->classMetadata->getEventManager()->execute(EventManager::EVENT_PRE_INSERT, $document);
$query = $this->hydrator->unhydrate($document);
$idGen = $t... | php | public function insertMany($documents, $options = [])
{
$insertQuery = [];
foreach ($documents as $document) {
$this->classMetadata->getEventManager()->execute(EventManager::EVENT_PRE_INSERT, $document);
$query = $this->hydrator->unhydrate($document);
$idGen = $t... | [
"public",
"function",
"insertMany",
"(",
"$",
"documents",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"insertQuery",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"documents",
"as",
"$",
"document",
")",
"{",
"$",
"this",
"->",
"classMetadata",
"-... | Insert multiple documents in collection
@param mixed $documents Documents to insert
@param array $options Options
@return void | [
"Insert",
"multiple",
"documents",
"in",
"collection"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L356-L398 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.updateOne | public function updateOne($document, $update = [], $options = [])
{
$query = new UpdateOne($this->documentManager, $this, $document, $update, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();
... | php | public function updateOne($document, $update = [], $options = [])
{
$query = new UpdateOne($this->documentManager, $this, $document, $update, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();
... | [
"public",
"function",
"updateOne",
"(",
"$",
"document",
",",
"$",
"update",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"new",
"UpdateOne",
"(",
"$",
"this",
"->",
"documentManager",
",",
"$",
"this",
",",
"$",
... | Update a document in mongoDB
@param mixed $document Document or query to update
@param array $update Update query, let empty to update document based on object changes
@param array $options Options
@return void | [
"Update",
"a",
"document",
"in",
"mongoDB"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L408-L416 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.updateMany | public function updateMany($filters, $update, $options = [])
{
$result = $this->collection->updateMany($this->castQuery($filters), $update, $options);
if ($result->isAcknowledged()) {
return true;
} else {
return false;
}
} | php | public function updateMany($filters, $update, $options = [])
{
$result = $this->collection->updateMany($this->castQuery($filters), $update, $options);
if ($result->isAcknowledged()) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"updateMany",
"(",
"$",
"filters",
",",
"$",
"update",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"collection",
"->",
"updateMany",
"(",
"$",
"this",
"->",
"castQuery",
"(",
"$",
"filter... | Update many document
@param array $filters Filters
@param array $update Update to perform
@param array $options Options
@return void | [
"Update",
"many",
"document"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L426-L435 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.replaceOne | public function replaceOne($document, $replacement, $options = [])
{
$query = new ReplaceOne($this->documentManager, $this, $document, $replacement, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();... | php | public function replaceOne($document, $replacement, $options = [])
{
$query = new ReplaceOne($this->documentManager, $this, $document, $replacement, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();... | [
"public",
"function",
"replaceOne",
"(",
"$",
"document",
",",
"$",
"replacement",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"new",
"ReplaceOne",
"(",
"$",
"this",
"->",
"documentManager",
",",
"$",
"this",
",",
"$",
"document",
... | Update a document in mongoDB
@param mixed $document Document or query to update
@param array $update Update query, let empty to update document based on object changes
@param array $options Options
@return void | [
"Update",
"a",
"document",
"in",
"mongoDB"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L445-L453 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.deleteOne | public function deleteOne($document, $options = [])
{
$query = new DeleteOne($this->documentManager, $this, $document, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();
}
} | php | public function deleteOne($document, $options = [])
{
$query = new DeleteOne($this->documentManager, $this, $document, $options);
if (isset($options['getQuery']) && $options['getQuery']) {
return $query;
} else {
return $query->execute();
}
} | [
"public",
"function",
"deleteOne",
"(",
"$",
"document",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"new",
"DeleteOne",
"(",
"$",
"this",
"->",
"documentManager",
",",
"$",
"this",
",",
"$",
"document",
",",
"$",
"options",
")",... | Delete a document
@param object|array $document Document to delete
@param array $options Options
@return void | [
"Delete",
"a",
"document"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L462-L470 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.deleteMany | public function deleteMany($filter, $options = [])
{
$filter = $this->castQuery($filter);
$result = $this->collection->deleteMany($filter, $options);
if ($result->isAcknowledged()) {
return true;
} else {
return false;
}
} | php | public function deleteMany($filter, $options = [])
{
$filter = $this->castQuery($filter);
$result = $this->collection->deleteMany($filter, $options);
if ($result->isAcknowledged()) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"deleteMany",
"(",
"$",
"filter",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"castQuery",
"(",
"$",
"filter",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"collection",
"->",
"dele... | Delete many document
@param array $filter Filter wich match to objects to delete
@param array $options Options
@return void | [
"Delete",
"many",
"document"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L479-L489 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.createObject | protected function createObject($data, $options = [])
{
$object = null;
if ($data != null) {
$id = isset($data['_id']) ? serialize($data['_id']) . $this->getCollection() : null;
$model = $this->getModelName();
$softHydrate = false;
if (null !== $this-... | php | protected function createObject($data, $options = [])
{
$object = null;
if ($data != null) {
$id = isset($data['_id']) ? serialize($data['_id']) . $this->getCollection() : null;
$model = $this->getModelName();
$softHydrate = false;
if (null !== $this-... | [
"protected",
"function",
"createObject",
"(",
"$",
"data",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"object",
"=",
"null",
";",
"if",
"(",
"$",
"data",
"!=",
"null",
")",
"{",
"$",
"id",
"=",
"isset",
"(",
"$",
"data",
"[",
"'_id'",
"... | Create object based on provided data
@param array $data Array of data which will hydrate object
@param array $options Options
@return void | [
"Create",
"object",
"based",
"on",
"provided",
"data"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L503-L533 |
JoffreyPoreeCoding/MongoDB-ODM | src/Repository.php | Repository.createOption | protected function createOption($projections, $sort, $otherOptions = [])
{
$options = [];
isset($projections) ? $options["projection"] = $this->castQuery($projections) : null;
isset($sort) ? $options["sort"] = $this->castQuery($sort) : null;
$options = array_merge($this->documentMan... | php | protected function createOption($projections, $sort, $otherOptions = [])
{
$options = [];
isset($projections) ? $options["projection"] = $this->castQuery($projections) : null;
isset($sort) ? $options["sort"] = $this->castQuery($sort) : null;
$options = array_merge($this->documentMan... | [
"protected",
"function",
"createOption",
"(",
"$",
"projections",
",",
"$",
"sort",
",",
"$",
"otherOptions",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"isset",
"(",
"$",
"projections",
")",
"?",
"$",
"options",
"[",
"\"projection\""... | Create options based on parameters
@param array $projections Projection specification
@param array $sort Sort specification
@param array $otherOptions Other options
@return void | [
"Create",
"options",
"based",
"on",
"parameters"
] | train | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L543-L551 |
pdefreitas/Laravel-VanillaSSO | src/Pdefreitas/VanillaSSO/VanillaSSO.php | VanillaSSO.WriteJsConnect | public static function WriteJsConnect($User, $Request, $Secure = TRUE)
{
$User = array_change_key_case($User);
$ClientID = Config::get("vanillasso.client_id");
$Secret = Config::get("vanillasso.secret");
// Error checking.
if ($Secure) {
// Check the client.
... | php | public static function WriteJsConnect($User, $Request, $Secure = TRUE)
{
$User = array_change_key_case($User);
$ClientID = Config::get("vanillasso.client_id");
$Secret = Config::get("vanillasso.secret");
// Error checking.
if ($Secure) {
// Check the client.
... | [
"public",
"static",
"function",
"WriteJsConnect",
"(",
"$",
"User",
",",
"$",
"Request",
",",
"$",
"Secure",
"=",
"TRUE",
")",
"{",
"$",
"User",
"=",
"array_change_key_case",
"(",
"$",
"User",
")",
";",
"$",
"ClientID",
"=",
"Config",
"::",
"get",
"(",... | Write the jsConnect string for single sign on.
@param array $User An array containing information about the currently signed on user. If no user is signed in then this should be an empty array.
@param array $Request An array of the $_GET request.
@param string|bool $Secure Whether or not to check for security. This is ... | [
"Write",
"the",
"jsConnect",
"string",
"for",
"single",
"sign",
"on",
"."
] | train | https://github.com/pdefreitas/Laravel-VanillaSSO/blob/f47a7c33eaf392fb6564a909f622b36ffd373759/src/Pdefreitas/VanillaSSO/VanillaSSO.php#L38-L89 |
pdefreitas/Laravel-VanillaSSO | src/Pdefreitas/VanillaSSO/VanillaSSO.php | VanillaSSO.JsHash | protected static function JsHash($String, $Secure = TRUE)
{
if ($Secure === TRUE)
$Secure = 'md5';
switch ($Secure) {
case 'sha1':
return sha1($String);
break;
case 'md5':
case FALSE:
return md5($String)... | php | protected static function JsHash($String, $Secure = TRUE)
{
if ($Secure === TRUE)
$Secure = 'md5';
switch ($Secure) {
case 'sha1':
return sha1($String);
break;
case 'md5':
case FALSE:
return md5($String)... | [
"protected",
"static",
"function",
"JsHash",
"(",
"$",
"String",
",",
"$",
"Secure",
"=",
"TRUE",
")",
"{",
"if",
"(",
"$",
"Secure",
"===",
"TRUE",
")",
"$",
"Secure",
"=",
"'md5'",
";",
"switch",
"(",
"$",
"Secure",
")",
"{",
"case",
"'sha1'",
":... | Return the hash of a string.
@param string $String The string to hash.
@param string|bool $Secure The hash algorithm to use. TRUE means md5.
@return string
@since 1.1b | [
"Return",
"the",
"hash",
"of",
"a",
"string",
"."
] | train | https://github.com/pdefreitas/Laravel-VanillaSSO/blob/f47a7c33eaf392fb6564a909f622b36ffd373759/src/Pdefreitas/VanillaSSO/VanillaSSO.php#L121-L136 |
pdefreitas/Laravel-VanillaSSO | src/Pdefreitas/VanillaSSO/VanillaSSO.php | VanillaSSO.JsSSOString | protected static function JsSSOString($User, $ClientID, $Secret)
{
if (!isset($User['client_id']))
$User['client_id'] = $ClientID;
$String = base64_encode(json_encode($User));
$Timestamp = time();
$Hash = hash_hmac('sha1', "$String $Timestamp", $Secret);
$Result... | php | protected static function JsSSOString($User, $ClientID, $Secret)
{
if (!isset($User['client_id']))
$User['client_id'] = $ClientID;
$String = base64_encode(json_encode($User));
$Timestamp = time();
$Hash = hash_hmac('sha1', "$String $Timestamp", $Secret);
$Result... | [
"protected",
"static",
"function",
"JsSSOString",
"(",
"$",
"User",
",",
"$",
"ClientID",
",",
"$",
"Secret",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"User",
"[",
"'client_id'",
"]",
")",
")",
"$",
"User",
"[",
"'client_id'",
"]",
"=",
"$",
"C... | Generate an SSO string suitible for passing in the url for embedded SSO.
@param array $User The user to sso.
@param string $ClientID Your client ID.
@param string $Secret Your secret.
@return string | [
"Generate",
"an",
"SSO",
"string",
"suitible",
"for",
"passing",
"in",
"the",
"url",
"for",
"embedded",
"SSO",
"."
] | train | https://github.com/pdefreitas/Laravel-VanillaSSO/blob/f47a7c33eaf392fb6564a909f622b36ffd373759/src/Pdefreitas/VanillaSSO/VanillaSSO.php#L151-L162 |
prooph/link-app-core | src/Service/ActionControllerInitializer.php | ActionControllerInitializer.initialize | public function initialize($instance, ServiceLocatorInterface $serviceLocator)
{
if ($instance instanceof ActionController) {
//We are dealing with a ControllerManager so we need to get the main service manger first
$instance->setCommandBus($serviceLocator->getServiceLocator()->get('... | php | public function initialize($instance, ServiceLocatorInterface $serviceLocator)
{
if ($instance instanceof ActionController) {
//We are dealing with a ControllerManager so we need to get the main service manger first
$instance->setCommandBus($serviceLocator->getServiceLocator()->get('... | [
"public",
"function",
"initialize",
"(",
"$",
"instance",
",",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"if",
"(",
"$",
"instance",
"instanceof",
"ActionController",
")",
"{",
"//We are dealing with a ControllerManager so we need to get the main service man... | Initialize
@param $instance
@param ServiceLocatorInterface $serviceLocator
@return mixed | [
"Initialize"
] | train | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Service/ActionControllerInitializer.php#L31-L37 |
fuelphp/display | src/DataContainer.php | DataContainer.getData | public function getData()
{
$data = $this->data;
foreach ($data as $key => $value)
{
if (is_object($value) and $this->isWhitelisted($value))
{
continue;
}
if ($this->shouldBeFiltered($key))
{
if ($value instanceof Sanitize)
{
$data[$key] = $value->sanitize();
}
else
... | php | public function getData()
{
$data = $this->data;
foreach ($data as $key => $value)
{
if (is_object($value) and $this->isWhitelisted($value))
{
continue;
}
if ($this->shouldBeFiltered($key))
{
if ($value instanceof Sanitize)
{
$data[$key] = $value->sanitize();
}
else
... | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"data",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
"and",
"$",
"this",
"... | Retrieves all the view data
@return array | [
"Retrieves",
"all",
"the",
"view",
"data"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L62-L87 |
fuelphp/display | src/DataContainer.php | DataContainer.shouldBeFiltered | protected function shouldBeFiltered($key)
{
if (isset($this->filterIndex[$key]))
{
return $this->filterIndex[$key];
}
return $this->autoFilter;
} | php | protected function shouldBeFiltered($key)
{
if (isset($this->filterIndex[$key]))
{
return $this->filterIndex[$key];
}
return $this->autoFilter;
} | [
"protected",
"function",
"shouldBeFiltered",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"filterIndex",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"filterIndex",
"[",
"$",
"key",
"]",
";",
"}",
"ret... | Checks if a key should be filtered or not
Uses filterIndex and autoFilter
@param string $key
@return boolean | [
"Checks",
"if",
"a",
"key",
"should",
"be",
"filtered",
"or",
"not"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L98-L106 |
fuelphp/display | src/DataContainer.php | DataContainer.isWhitelisted | protected function isWhitelisted($object)
{
foreach ($this->whitelist as $whitelisted)
{
if ($object instanceof $whitelisted)
{
return true;
}
}
return false;
} | php | protected function isWhitelisted($object)
{
foreach ($this->whitelist as $whitelisted)
{
if ($object instanceof $whitelisted)
{
return true;
}
}
return false;
} | [
"protected",
"function",
"isWhitelisted",
"(",
"$",
"object",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"whitelist",
"as",
"$",
"whitelisted",
")",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"$",
"whitelisted",
")",
"{",
"return",
"true",
";",
"}",
... | Checks if an object is whitelisted
@param object $object
@return boolean | [
"Checks",
"if",
"an",
"object",
"is",
"whitelisted"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L115-L126 |
fuelphp/display | src/DataContainer.php | DataContainer.filter | public function filter($value)
{
if (is_array($value) or (is_object($value) and $value instanceof \ArrayAccess))
{
return array_map([$this, 'filter'], $value);
}
return htmlentities($value, ENT_QUOTES | ENT_HTML5);
} | php | public function filter($value)
{
if (is_array($value) or (is_object($value) and $value instanceof \ArrayAccess))
{
return array_map([$this, 'filter'], $value);
}
return htmlentities($value, ENT_QUOTES | ENT_HTML5);
} | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"or",
"(",
"is_object",
"(",
"$",
"value",
")",
"and",
"$",
"value",
"instanceof",
"\\",
"ArrayAccess",
")",
")",
"{",
"return",
"array_map",
... | Filters the output
@param mixed $value
@return string | [
"Filters",
"the",
"output"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L135-L143 |
fuelphp/display | src/DataContainer.php | DataContainer.set | public function set($key, $value = null, $filter = null)
{
parent::set($key, $value);
if (is_array($key))
{
if (is_bool($value))
{
$filter = $value;
}
foreach ($key as $_key => $_value)
{
$this->filterIndex[$_key] = $filter;
}
}
else
{
$this->filterIndex[$key] = $filter;
}
... | php | public function set($key, $value = null, $filter = null)
{
parent::set($key, $value);
if (is_array($key))
{
if (is_bool($value))
{
$filter = $value;
}
foreach ($key as $_key => $_value)
{
$this->filterIndex[$_key] = $filter;
}
}
else
{
$this->filterIndex[$key] = $filter;
}
... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"parent",
"::",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{... | Sets view data
@param string|array $key
@param mixed $value
@param boolean $filter
@return $this | [
"Sets",
"view",
"data"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L154-L176 |
fuelphp/display | src/DataContainer.php | DataContainer.merge | public function merge($arg)
{
call_user_func_array('parent::merge', func_get_args());
$arguments = array_map(function ($array) use (&$valid)
{
if ($array instanceof DataContainer)
{
return $array->filterIndex;
}
return [];
}, func_get_args());
array_unshift($arguments, $this->filterIndex)... | php | public function merge($arg)
{
call_user_func_array('parent::merge', func_get_args());
$arguments = array_map(function ($array) use (&$valid)
{
if ($array instanceof DataContainer)
{
return $array->filterIndex;
}
return [];
}, func_get_args());
array_unshift($arguments, $this->filterIndex)... | [
"public",
"function",
"merge",
"(",
"$",
"arg",
")",
"{",
"call_user_func_array",
"(",
"'parent::merge'",
",",
"func_get_args",
"(",
")",
")",
";",
"$",
"arguments",
"=",
"array_map",
"(",
"function",
"(",
"$",
"array",
")",
"use",
"(",
"&",
"$",
"valid"... | {@inheritdoc} | [
"{"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L181-L200 |
fuelphp/display | src/DataContainer.php | DataContainer.replaceData | public function replaceData(array $data, $filter = null)
{
$this->clearData();
return $this->set($data, $filter);
} | php | public function replaceData(array $data, $filter = null)
{
$this->clearData();
return $this->set($data, $filter);
} | [
"public",
"function",
"replaceData",
"(",
"array",
"$",
"data",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"clearData",
"(",
")",
";",
"return",
"$",
"this",
"->",
"set",
"(",
"$",
"data",
",",
"$",
"filter",
")",
";",
"}"
] | Overwrites all the view data
@param array $data
@param boolean $filter
@return $this | [
"Overwrites",
"all",
"the",
"view",
"data"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L223-L228 |
fuelphp/display | src/DataContainer.php | DataContainer.bind | public function bind($key, &$value, $filter = null)
{
if ($this->readOnly)
{
throw new \RuntimeException('Changing values on this Data Container is not allowed.');
}
$this->data[$key] =& $value;
$this->filterIndex[$key] = $filter;
$this->isModified = true;
return $this;
} | php | public function bind($key, &$value, $filter = null)
{
if ($this->readOnly)
{
throw new \RuntimeException('Changing values on this Data Container is not allowed.');
}
$this->data[$key] =& $value;
$this->filterIndex[$key] = $filter;
$this->isModified = true;
return $this;
} | [
"public",
"function",
"bind",
"(",
"$",
"key",
",",
"&",
"$",
"value",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"readOnly",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Changing values on this Data Container is... | Assigns a value by reference. The benefit of binding is that values can
be altered without re-setting them. It is also possible to bind variables
before they have values. Assigned values will be available as a
variable within the view file:
// This reference can be accessed as $ref within the object
$obj->bind('ref', ... | [
"Assigns",
"a",
"value",
"by",
"reference",
".",
"The",
"benefit",
"of",
"binding",
"is",
"that",
"values",
"can",
"be",
"altered",
"without",
"re",
"-",
"setting",
"them",
".",
"It",
"is",
"also",
"possible",
"to",
"bind",
"variables",
"before",
"they",
... | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L245-L257 |
FrenchFrogs/framework | src/Table/Column/Column.php | Column.setTable | public function setTable(\FrenchFrogs\Table\Table\Table $table)
{
$this->table = $table;
return $this;
} | php | public function setTable(\FrenchFrogs\Table\Table\Table $table)
{
$this->table = $table;
return $this;
} | [
"public",
"function",
"setTable",
"(",
"\\",
"FrenchFrogs",
"\\",
"Table",
"\\",
"Table",
"\\",
"Table",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"table",
"=",
"$",
"table",
";",
"return",
"$",
"this",
";",
"}"
] | Setter for $table property
@param \FrenchFrogs\Table\Table\Table $table
@return $this | [
"Setter",
"for",
"$table",
"property"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Column.php#L154-L158 |
FrenchFrogs/framework | src/Table/Column/Column.php | Column.order | public function order($direction = null)
{
if (is_null($direction)) {
$direction = $this->getOrderDirection();
} else {
$this->setOrderDirection($direction);
}
// if a direction is set
if (!empty($direction)) {
if (!is_string($this->order)... | php | public function order($direction = null)
{
if (is_null($direction)) {
$direction = $this->getOrderDirection();
} else {
$this->setOrderDirection($direction);
}
// if a direction is set
if (!empty($direction)) {
if (!is_string($this->order)... | [
"public",
"function",
"order",
"(",
"$",
"direction",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"direction",
")",
")",
"{",
"$",
"direction",
"=",
"$",
"this",
"->",
"getOrderDirection",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"-... | Order process for the column
@param $direction (asc or desc)
@return $this
@throws \Exception | [
"Order",
"process",
"for",
"the",
"column"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Column.php#L346-L372 |
FrenchFrogs/framework | src/Table/Column/Column.php | Column.setOrderDirection | public function setOrderDirection($direction)
{
$direction = strtolower($direction);
if (!in_array($direction, ['asc', 'desc'])) {
throw new \InvalidArgumentException('$direction must be "asc" or "desc"');
}
$this->orderDirection = $direction;
return $this;
... | php | public function setOrderDirection($direction)
{
$direction = strtolower($direction);
if (!in_array($direction, ['asc', 'desc'])) {
throw new \InvalidArgumentException('$direction must be "asc" or "desc"');
}
$this->orderDirection = $direction;
return $this;
... | [
"public",
"function",
"setOrderDirection",
"(",
"$",
"direction",
")",
"{",
"$",
"direction",
"=",
"strtolower",
"(",
"$",
"direction",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"direction",
",",
"[",
"'asc'",
",",
"'desc'",
"]",
")",
")",
"{",
... | Setter for $orderDirection attribute
@param $direction
@return $this | [
"Setter",
"for",
"$orderDirection",
"attribute"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Column.php#L380-L391 |
FrenchFrogs/framework | src/Table/Column/Column.php | Column.isVisible | public function isVisible($row = null)
{
$callable = !is_bool($this->visible) && !is_string($this->visible) && is_callable($this->visible);
return (bool) ($callable ? call_user_func($this->visible, $this, $row) : $this->visible);
} | php | public function isVisible($row = null)
{
$callable = !is_bool($this->visible) && !is_string($this->visible) && is_callable($this->visible);
return (bool) ($callable ? call_user_func($this->visible, $this, $row) : $this->visible);
} | [
"public",
"function",
"isVisible",
"(",
"$",
"row",
"=",
"null",
")",
"{",
"$",
"callable",
"=",
"!",
"is_bool",
"(",
"$",
"this",
"->",
"visible",
")",
"&&",
"!",
"is_string",
"(",
"$",
"this",
"->",
"visible",
")",
"&&",
"is_callable",
"(",
"$",
... | Return if the columns is visible
@param $row
@return bool | [
"Return",
"if",
"the",
"columns",
"is",
"visible"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Column.php#L466-L470 |
tonicospinelli/class-generation | src/ClassGeneration/CompositionCollection.php | CompositionCollection.toString | public function toString()
{
if ($this->isEmpty()) {
return '';
}
$traitNames = $this->toArray();
$tabulationFormatted = $this->getTabulationFormatted();
$compositionMethods = ';' . PHP_EOL;
if (!$this->getMethods()->isEmpty()) {
$composition... | php | public function toString()
{
if ($this->isEmpty()) {
return '';
}
$traitNames = $this->toArray();
$tabulationFormatted = $this->getTabulationFormatted();
$compositionMethods = ';' . PHP_EOL;
if (!$this->getMethods()->isEmpty()) {
$composition... | [
"public",
"function",
"toString",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"traitNames",
"=",
"$",
"this",
"->",
"toArray",
"(",
")",
";",
"$",
"tabulationFormatted",
"=",
"$",
"this... | Parse the Composition Collection to string.
@return string | [
"Parse",
"the",
"Composition",
"Collection",
"to",
"string",
"."
] | train | https://github.com/tonicospinelli/class-generation/blob/eee63bdb68c066b25b885b57b23656e809381a76/src/ClassGeneration/CompositionCollection.php#L130-L145 |
czim/laravel-pxlcms | src/Generator/Analyzer/Steps/CheckTables.php | CheckTables.checkRequiredTables | protected function checkRequiredTables()
{
// check if relevant tables are present in the list
foreach ([
config('pxlcms.tables.meta.modules'),
config('pxlcms.tables.meta.fields'),
config('pxlcms.tables.meta.field_options_choices'),
... | php | protected function checkRequiredTables()
{
// check if relevant tables are present in the list
foreach ([
config('pxlcms.tables.meta.modules'),
config('pxlcms.tables.meta.fields'),
config('pxlcms.tables.meta.field_options_choices'),
... | [
"protected",
"function",
"checkRequiredTables",
"(",
")",
"{",
"// check if relevant tables are present in the list",
"foreach",
"(",
"[",
"config",
"(",
"'pxlcms.tables.meta.modules'",
")",
",",
"config",
"(",
"'pxlcms.tables.meta.fields'",
")",
",",
"config",
"(",
"'pxl... | Checks if all required tables are present
@throws Exception if a table is not found | [
"Checks",
"if",
"all",
"required",
"tables",
"are",
"present"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L35-L65 |
czim/laravel-pxlcms | src/Generator/Analyzer/Steps/CheckTables.php | CheckTables.detectSlugStructure | protected function detectSlugStructure()
{
$this->context->slugStructurePresent = false;
$slugsTable = config('pxlcms.slugs.table');
if ( ! in_array($slugsTable, $this->tables)) {
$this->context->log("No slugs table detected.");
return;
}
// the ta... | php | protected function detectSlugStructure()
{
$this->context->slugStructurePresent = false;
$slugsTable = config('pxlcms.slugs.table');
if ( ! in_array($slugsTable, $this->tables)) {
$this->context->log("No slugs table detected.");
return;
}
// the ta... | [
"protected",
"function",
"detectSlugStructure",
"(",
")",
"{",
"$",
"this",
"->",
"context",
"->",
"slugStructurePresent",
"=",
"false",
";",
"$",
"slugsTable",
"=",
"config",
"(",
"'pxlcms.slugs.table'",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"slug... | Detects whether this CMS has the 'typical' slug table setup | [
"Detects",
"whether",
"this",
"CMS",
"has",
"the",
"typical",
"slug",
"table",
"setup"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L70-L105 |
czim/laravel-pxlcms | src/Generator/Analyzer/Steps/CheckTables.php | CheckTables.loadTableList | protected function loadTableList()
{
if ($this->getDatabaseDriver() === 'sqlite') {
$statement = "SELECT name FROM sqlite_master WHERE type='table';";
} else {
$statement = 'SHOW TABLES';
}
$tables = DB::select($statement);
$this->tables = [];
... | php | protected function loadTableList()
{
if ($this->getDatabaseDriver() === 'sqlite') {
$statement = "SELECT name FROM sqlite_master WHERE type='table';";
} else {
$statement = 'SHOW TABLES';
}
$tables = DB::select($statement);
$this->tables = [];
... | [
"protected",
"function",
"loadTableList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getDatabaseDriver",
"(",
")",
"===",
"'sqlite'",
")",
"{",
"$",
"statement",
"=",
"\"SELECT name FROM sqlite_master WHERE type='table';\"",
";",
"}",
"else",
"{",
"$",
"state... | Caches the list of tables in the database | [
"Caches",
"the",
"list",
"of",
"tables",
"in",
"the",
"database"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L149-L165 |
czim/laravel-pxlcms | src/Generator/Analyzer/Steps/CheckTables.php | CheckTables.loadColumnListForTable | protected function loadColumnListForTable($table)
{
if ($this->getDatabaseDriver() === 'sqlite') {
$statement = "PRAGMA table_info(`{$table}`)";
} else {
$statement = "SHOW columns FROM `{$table}`";
}
$columnResults = DB::select($statement);
$columns ... | php | protected function loadColumnListForTable($table)
{
if ($this->getDatabaseDriver() === 'sqlite') {
$statement = "PRAGMA table_info(`{$table}`)";
} else {
$statement = "SHOW columns FROM `{$table}`";
}
$columnResults = DB::select($statement);
$columns ... | [
"protected",
"function",
"loadColumnListForTable",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getDatabaseDriver",
"(",
")",
"===",
"'sqlite'",
")",
"{",
"$",
"statement",
"=",
"\"PRAGMA table_info(`{$table}`)\"",
";",
"}",
"else",
"{",
"$",
... | Returns the column names for a table
@param string $table
@return array | [
"Returns",
"the",
"column",
"names",
"for",
"a",
"table"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L173-L190 |
gregorybesson/PlaygroundCore | src/Mail/Service/Message.php | Message.createHtmlMessage | public function createHtmlMessage($from, $to, $subject, $nameOrModel, $values = array())
{
if (is_string($from)) {
$from = array('email' => $from, 'name' => $from);
}
$renderer = $this->getRenderer();
$content = $renderer->render($nameOrModel, $values);
$resolver ... | php | public function createHtmlMessage($from, $to, $subject, $nameOrModel, $values = array())
{
if (is_string($from)) {
$from = array('email' => $from, 'name' => $from);
}
$renderer = $this->getRenderer();
$content = $renderer->render($nameOrModel, $values);
$resolver ... | [
"public",
"function",
"createHtmlMessage",
"(",
"$",
"from",
",",
"$",
"to",
",",
"$",
"subject",
",",
"$",
"nameOrModel",
",",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"from",
")",
")",
"{",
"$",
"from",
... | Return a HTML message ready to be sent
@param array|string $from
A string containing the sender e-mail address, or if array with keys email and name
@param array|string $to
An array containing the recipients of the mail
@param string $subject
Subject of the mail
@param string|\Zend\View\Model\ModelInterface $nameOrMod... | [
"Return",
"a",
"HTML",
"message",
"ready",
"to",
"be",
"sent"
] | train | https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/Mail/Service/Message.php#L51-L94 |
gregorybesson/PlaygroundCore | src/Mail/Service/Message.php | Message.getRenderer | protected function getRenderer()
{
if ($this->renderer === null) {
$this->renderer = $this->serviceLocator->get('ViewRenderer');
}
return $this->renderer;
} | php | protected function getRenderer()
{
if ($this->renderer === null) {
$this->renderer = $this->serviceLocator->get('ViewRenderer');
}
return $this->renderer;
} | [
"protected",
"function",
"getRenderer",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"renderer",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"renderer",
"=",
"$",
"this",
"->",
"serviceLocator",
"->",
"get",
"(",
"'ViewRenderer'",
")",
";",
"}",
"retur... | Get the renderer
@return \Zend\View\Renderer\RendererInterface | [
"Get",
"the",
"renderer"
] | train | https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/Mail/Service/Message.php#L135-L142 |
gregorybesson/PlaygroundCore | src/Mail/Service/Message.php | Message.getTransport | protected function getTransport()
{
if ($this->transport === null) {
$this->transport = $this->serviceLocator->get('playgroundcore_transport');
}
return $this->transport;
} | php | protected function getTransport()
{
if ($this->transport === null) {
$this->transport = $this->serviceLocator->get('playgroundcore_transport');
}
return $this->transport;
} | [
"protected",
"function",
"getTransport",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"transport",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"transport",
"=",
"$",
"this",
"->",
"serviceLocator",
"->",
"get",
"(",
"'playgroundcore_transport'",
")",
";",
... | Get the transport
@return \Zend\Mail\Transport\TransportInterface | [
"Get",
"the",
"transport"
] | train | https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/Mail/Service/Message.php#L149-L156 |
iter8-au/builder | src/Builder/Builder.php | Builder.prepareBuilder | private function prepareBuilder(): void
{
if (!file_exists($this->getReportCacheDir())) {
@mkdir($this->getReportCacheDir(), 0777, true);
}
$this->builder
->setCacheDir($this->getReportCacheDir())
->initialise();
return;
} | php | private function prepareBuilder(): void
{
if (!file_exists($this->getReportCacheDir())) {
@mkdir($this->getReportCacheDir(), 0777, true);
}
$this->builder
->setCacheDir($this->getReportCacheDir())
->initialise();
return;
} | [
"private",
"function",
"prepareBuilder",
"(",
")",
":",
"void",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"getReportCacheDir",
"(",
")",
")",
")",
"{",
"@",
"mkdir",
"(",
"$",
"this",
"->",
"getReportCacheDir",
"(",
")",
",",
"0777",
... | Prepares the builders and creates the cache directory if it doesn't exist.
@return void | [
"Prepares",
"the",
"builders",
"and",
"creates",
"the",
"cache",
"directory",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L112-L123 |
iter8-au/builder | src/Builder/Builder.php | Builder.generate | public function generate($unlinkFlag = true) {
// Determine which format we are using and call the appropriate method.
if ($this->getReportType() === self::REPORT_EXCEL) {
$this->generateExcel();
// Output headers
header('Pragma: public');
header('Expires... | php | public function generate($unlinkFlag = true) {
// Determine which format we are using and call the appropriate method.
if ($this->getReportType() === self::REPORT_EXCEL) {
$this->generateExcel();
// Output headers
header('Pragma: public');
header('Expires... | [
"public",
"function",
"generate",
"(",
"$",
"unlinkFlag",
"=",
"true",
")",
"{",
"// Determine which format we are using and call the appropriate method.",
"if",
"(",
"$",
"this",
"->",
"getReportType",
"(",
")",
"===",
"self",
"::",
"REPORT_EXCEL",
")",
"{",
"$",
... | Generate the final report using whatever the set format is.
@param bool $unlinkFlag
@return void | [
"Generate",
"the",
"final",
"report",
"using",
"whatever",
"the",
"set",
"format",
"is",
"."
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L142-L164 |
iter8-au/builder | src/Builder/Builder.php | Builder.generateExcel | public function generateExcel(): void
{
// Set Document Properties from Service values.
$this->builder
->setCreator($this->getCreator())
->setLastModifiedBy($this->getCreator())
->setTitle($this->getTitle())
->setSubject($this->getTitle())
... | php | public function generateExcel(): void
{
// Set Document Properties from Service values.
$this->builder
->setCreator($this->getCreator())
->setLastModifiedBy($this->getCreator())
->setTitle($this->getTitle())
->setSubject($this->getTitle())
... | [
"public",
"function",
"generateExcel",
"(",
")",
":",
"void",
"{",
"// Set Document Properties from Service values.",
"$",
"this",
"->",
"builder",
"->",
"setCreator",
"(",
"$",
"this",
"->",
"getCreator",
"(",
")",
")",
"->",
"setLastModifiedBy",
"(",
"$",
"thi... | Generates an Excel document.
@return void | [
"Generates",
"an",
"Excel",
"document",
"."
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L171-L203 |
iter8-au/builder | src/Builder/Builder.php | Builder.createSheet | public function createSheet(
array $headers,
array $rows,
string $title
): void {
// Check if we are setting any custom column widths.
if ($this->hasColumnWidths()) {
// We have a numeric index array, so create an array of letters that we can use to map to Excel c... | php | public function createSheet(
array $headers,
array $rows,
string $title
): void {
// Check if we are setting any custom column widths.
if ($this->hasColumnWidths()) {
// We have a numeric index array, so create an array of letters that we can use to map to Excel c... | [
"public",
"function",
"createSheet",
"(",
"array",
"$",
"headers",
",",
"array",
"$",
"rows",
",",
"string",
"$",
"title",
")",
":",
"void",
"{",
"// Check if we are setting any custom column widths.",
"if",
"(",
"$",
"this",
"->",
"hasColumnWidths",
"(",
")",
... | @param array $headers
@param array $rows
@param string $title
@return void | [
"@param",
"array",
"$headers",
"@param",
"array",
"$rows",
"@param",
"string",
"$title"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L255-L293 |
iter8-au/builder | src/Builder/Builder.php | Builder.setTitle | public function setTitle(string $title): self
{
if (strlen($title) > 31) {
$title = mb_substr($title, 0, 31);
}
$this->title = $title;
return $this;
} | php | public function setTitle(string $title): self
{
if (strlen($title) > 31) {
$title = mb_substr($title, 0, 31);
}
$this->title = $title;
return $this;
} | [
"public",
"function",
"setTitle",
"(",
"string",
"$",
"title",
")",
":",
"self",
"{",
"if",
"(",
"strlen",
"(",
"$",
"title",
")",
">",
"31",
")",
"{",
"$",
"title",
"=",
"mb_substr",
"(",
"$",
"title",
",",
"0",
",",
"31",
")",
";",
"}",
"$",
... | Note: if the title is longer than 31 characters it'll be trimmed.
This is due to a limit in Excel.
@param string $title
@return $this | [
"Note",
":",
"if",
"the",
"title",
"is",
"longer",
"than",
"31",
"characters",
"it",
"ll",
"be",
"trimmed",
".",
"This",
"is",
"due",
"to",
"a",
"limit",
"in",
"Excel",
"."
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L424-L433 |
iter8-au/builder | src/Builder/Builder.php | Builder.hasColumnStylesForColumn | public function hasColumnStylesForColumn($columnIndex): bool
{
if (!$this->hasColumnStyles()) {
return false;
}
$columnStyles = $this->getColumnStyles();
return isset($columnStyles[$columnIndex]) ? true : false;
} | php | public function hasColumnStylesForColumn($columnIndex): bool
{
if (!$this->hasColumnStyles()) {
return false;
}
$columnStyles = $this->getColumnStyles();
return isset($columnStyles[$columnIndex]) ? true : false;
} | [
"public",
"function",
"hasColumnStylesForColumn",
"(",
"$",
"columnIndex",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumnStyles",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"columnStyles",
"=",
"$",
"this",
"->",
"getColu... | @param int $columnIndex
@return bool | [
"@param",
"int",
"$columnIndex"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L520-L529 |
iter8-au/builder | src/Builder/Builder.php | Builder.getColumnStylesForColumn | public function getColumnStylesForColumn($columnIndex)
{
if (!$this->hasColumnStylesForColumn($columnIndex)) {
return false;
}
$columnStyles = $this->getColumnStyles();
return $columnStyles[$columnIndex] ?? false;
} | php | public function getColumnStylesForColumn($columnIndex)
{
if (!$this->hasColumnStylesForColumn($columnIndex)) {
return false;
}
$columnStyles = $this->getColumnStyles();
return $columnStyles[$columnIndex] ?? false;
} | [
"public",
"function",
"getColumnStylesForColumn",
"(",
"$",
"columnIndex",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumnStylesForColumn",
"(",
"$",
"columnIndex",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"columnStyles",
"=",
"$",
"this",
... | @param int $columnIndex
@return bool|array | [
"@param",
"int",
"$columnIndex"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L536-L545 |
iter8-au/builder | src/Builder/Builder.php | Builder.getPhpSpreadsheetColumnStylesForColumn | private function getPhpSpreadsheetColumnStylesForColumn($columnIndex) {
$phpExcelStyleArray = [];
$styleArray = $this->getColumnStylesForColumn($columnIndex);
if (empty($styleArray)) {
return $phpExcelStyleArray;
}
// Alignment
if (isset($styleArray['alignm... | php | private function getPhpSpreadsheetColumnStylesForColumn($columnIndex) {
$phpExcelStyleArray = [];
$styleArray = $this->getColumnStylesForColumn($columnIndex);
if (empty($styleArray)) {
return $phpExcelStyleArray;
}
// Alignment
if (isset($styleArray['alignm... | [
"private",
"function",
"getPhpSpreadsheetColumnStylesForColumn",
"(",
"$",
"columnIndex",
")",
"{",
"$",
"phpExcelStyleArray",
"=",
"[",
"]",
";",
"$",
"styleArray",
"=",
"$",
"this",
"->",
"getColumnStylesForColumn",
"(",
"$",
"columnIndex",
")",
";",
"if",
"("... | TODO: Allow specific (col, row) styles
TODO: Allow text styles and colours to be applied
@param $columnIndex
@return array | [
"TODO",
":",
"Allow",
"specific",
"(",
"col",
"row",
")",
"styles",
"TODO",
":",
"Allow",
"text",
"styles",
"and",
"colours",
"to",
"be",
"applied"
] | train | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L554-L595 |
yosmanyga/resource | src/Yosmanyga/Resource/Cacher/Cacher.php | Cacher.store | public function store($data, Resource $resource)
{
$this->checker->add($resource);
$this->storer->add($data, $resource);
} | php | public function store($data, Resource $resource)
{
$this->checker->add($resource);
$this->storer->add($data, $resource);
} | [
"public",
"function",
"store",
"(",
"$",
"data",
",",
"Resource",
"$",
"resource",
")",
"{",
"$",
"this",
"->",
"checker",
"->",
"add",
"(",
"$",
"resource",
")",
";",
"$",
"this",
"->",
"storer",
"->",
"add",
"(",
"$",
"data",
",",
"$",
"resource"... | {@inheritdoc} | [
"{"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Cacher/Cacher.php#L41-L45 |
yosmanyga/resource | src/Yosmanyga/Resource/Cacher/Cacher.php | Cacher.check | public function check(Resource $resource)
{
if ($this->checker->check($resource) && $this->storer->has($resource)) {
return true;
}
return false;
} | php | public function check(Resource $resource)
{
if ($this->checker->check($resource) && $this->storer->has($resource)) {
return true;
}
return false;
} | [
"public",
"function",
"check",
"(",
"Resource",
"$",
"resource",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"checker",
"->",
"check",
"(",
"$",
"resource",
")",
"&&",
"$",
"this",
"->",
"storer",
"->",
"has",
"(",
"$",
"resource",
")",
")",
"{",
"retu... | {@inheritdoc} | [
"{"
] | train | https://github.com/yosmanyga/resource/blob/a8b505c355920a908917a0484f764ddfa63205fa/src/Yosmanyga/Resource/Cacher/Cacher.php#L58-L65 |
datasift/datasift-php | lib/DataSift/User.php | DataSift_User.setApiClient | public function setApiClient($api_client)
{
if (! class_exists($api_client) || ! method_exists($api_client, 'call')) {
throw new DataSift_Exception_InvalidData('Class "' . $api_client . '" does not exist');
}
$this->_api_client = $api_client;
} | php | public function setApiClient($api_client)
{
if (! class_exists($api_client) || ! method_exists($api_client, 'call')) {
throw new DataSift_Exception_InvalidData('Class "' . $api_client . '" does not exist');
}
$this->_api_client = $api_client;
} | [
"public",
"function",
"setApiClient",
"(",
"$",
"api_client",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"api_client",
")",
"||",
"!",
"method_exists",
"(",
"$",
"api_client",
",",
"'call'",
")",
")",
"{",
"throw",
"new",
"DataSift_Exception_Invalid... | Set the class to use when calling the API
@param string $api_client The class to use.
@return void
@throws DataSift_Exception_InvalidData | [
"Set",
"the",
"class",
"to",
"use",
"when",
"calling",
"the",
"API"
] | train | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L173-L180 |
datasift/datasift-php | lib/DataSift/User.php | DataSift_User.createHistoric | public function createHistoric($hash, $start, $end, $sources, $name, $sample = DataSift_Historic::DEFAULT_SAMPLE)
{
return new DataSift_Historic($this, $hash, $start, $end, $sources, $name, $sample);
} | php | public function createHistoric($hash, $start, $end, $sources, $name, $sample = DataSift_Historic::DEFAULT_SAMPLE)
{
return new DataSift_Historic($this, $hash, $start, $end, $sources, $name, $sample);
} | [
"public",
"function",
"createHistoric",
"(",
"$",
"hash",
",",
"$",
"start",
",",
"$",
"end",
",",
"$",
"sources",
",",
"$",
"name",
",",
"$",
"sample",
"=",
"DataSift_Historic",
"::",
"DEFAULT_SAMPLE",
")",
"{",
"return",
"new",
"DataSift_Historic",
"(",
... | Create a historic query based on a stream hash.
@param string $hash The stream hash.
@param int $start The timestamp from which to start the query.
@param int $end The timestamp at which to end the query.
@param array $sources An array of sources required.
@param string $name A friendly name for thi... | [
"Create",
"a",
"historic",
"query",
"based",
"on",
"a",
"stream",
"hash",
"."
] | train | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L286-L289 |
datasift/datasift-php | lib/DataSift/User.php | DataSift_User.getConsumer | public function getConsumer($type, $hash, $eventHandler)
{
return DataSift_StreamConsumer::factory(
$this,
$type,
new DataSift_Definition($this, false, $hash),
$eventHandler
);
} | php | public function getConsumer($type, $hash, $eventHandler)
{
return DataSift_StreamConsumer::factory(
$this,
$type,
new DataSift_Definition($this, false, $hash),
$eventHandler
);
} | [
"public",
"function",
"getConsumer",
"(",
"$",
"type",
",",
"$",
"hash",
",",
"$",
"eventHandler",
")",
"{",
"return",
"DataSift_StreamConsumer",
"::",
"factory",
"(",
"$",
"this",
",",
"$",
"type",
",",
"new",
"DataSift_Definition",
"(",
"$",
"this",
",",... | Returns a DataSift_StreamConsumer-derived object for the given hash,
for the given type.
@param string $type The consumer type for which to construct a consumer.
@param string $hash The hash to be consumed.
@param DataSift_IStreamConsumerEvent... | [
"Returns",
"a",
"DataSift_StreamConsumer",
"-",
"derived",
"object",
"for",
"the",
"given",
"hash",
"for",
"the",
"given",
"type",
"."
] | train | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L344-L352 |
datasift/datasift-php | lib/DataSift/User.php | DataSift_User.getMultiConsumer | public function getMultiConsumer($type, $hashes, $eventHandler)
{
return DataSift_StreamConsumer::factory($this, $type, $hashes, $eventHandler);
} | php | public function getMultiConsumer($type, $hashes, $eventHandler)
{
return DataSift_StreamConsumer::factory($this, $type, $hashes, $eventHandler);
} | [
"public",
"function",
"getMultiConsumer",
"(",
"$",
"type",
",",
"$",
"hashes",
",",
"$",
"eventHandler",
")",
"{",
"return",
"DataSift_StreamConsumer",
"::",
"factory",
"(",
"$",
"this",
",",
"$",
"type",
",",
"$",
"hashes",
",",
"$",
"eventHandler",
")",... | Returns a DataSift_StreamConsumer-derived object for the given hashes,
for the given type.
@param string $type The consumer type for which to construct a consumer.
@param string $hashes An array containing hashes and/or Definition
objects to be ... | [
"Returns",
"a",
"DataSift_StreamConsumer",
"-",
"derived",
"object",
"for",
"the",
"given",
"hashes",
"for",
"the",
"given",
"type",
"."
] | train | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L367-L370 |
datasift/datasift-php | lib/DataSift/User.php | DataSift_User.listPushSubscriptions | public function listPushSubscriptions(
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_CREATED_AT,
$order_dir = DataSift_Push_Subscription::ORDERDIR_ASC,
$include_finished = false
) {
return DataSift_Push_Subscription::listSubscriptions(
... | php | public function listPushSubscriptions(
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_CREATED_AT,
$order_dir = DataSift_Push_Subscription::ORDERDIR_ASC,
$include_finished = false
) {
return DataSift_Push_Subscription::listSubscriptions(
... | [
"public",
"function",
"listPushSubscriptions",
"(",
"$",
"page",
"=",
"1",
",",
"$",
"per_page",
"=",
"100",
",",
"$",
"order_by",
"=",
"DataSift_Push_Subscription",
"::",
"ORDERBY_CREATED_AT",
",",
"$",
"order_dir",
"=",
"DataSift_Push_Subscription",
"::",
"ORDER... | Get a list of push subscriptions in your account.
@param int $page The page number to get.
@param int $per_page The number of items per page.
@param String order_by Which field to sort by.
@param String order_dir In asc[ending] or desc[ending] order.
@param bool $... | [
"Get",
"a",
"list",
"of",
"push",
"subscriptions",
"in",
"your",
"account",
"."
] | train | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L401-L416 |
datasift/datasift-php | lib/DataSift/User.php | DataSift_User.getPushSubscriptionLogs | public function getPushSubscriptionLogs(
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_REQUEST_TIME,
$order_dir = DataSift_Push_Subscription::ORDERDIR_DESC
) {
return DataSift_Push_Subscription::getLogs($this, $page, $per_page, $order_by, $order_... | php | public function getPushSubscriptionLogs(
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_REQUEST_TIME,
$order_dir = DataSift_Push_Subscription::ORDERDIR_DESC
) {
return DataSift_Push_Subscription::getLogs($this, $page, $per_page, $order_by, $order_... | [
"public",
"function",
"getPushSubscriptionLogs",
"(",
"$",
"page",
"=",
"1",
",",
"$",
"per_page",
"=",
"100",
",",
"$",
"order_by",
"=",
"DataSift_Push_Subscription",
"::",
"ORDERBY_REQUEST_TIME",
",",
"$",
"order_dir",
"=",
"DataSift_Push_Subscription",
"::",
"O... | Page through recent push subscription log entries, specifying the sort
order.
@param int page Which page to fetch.
@param int per_page Based on this page size.
@param String order_by Which field to sort by.
@param String order_dir In asc[ending] or desc[ending] order.
@return ArrayList<LogEntry>
@throws ... | [
"Page",
"through",
"recent",
"push",
"subscription",
"log",
"entries",
"specifying",
"the",
"sort",
"order",
"."
] | train | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L432-L439 |
datasift/datasift-php | lib/DataSift/User.php | DataSift_User.post | public function post($endpoint, $params = array(), $headers = array(), $ingest = false)
{
$res = call_user_func(
array($this->_api_client, 'call'),
$this,
$endpoint,
'post',
$params,
$headers,
$this->getUserAgent(),
... | php | public function post($endpoint, $params = array(), $headers = array(), $ingest = false)
{
$res = call_user_func(
array($this->_api_client, 'call'),
$this,
$endpoint,
'post',
$params,
$headers,
$this->getUserAgent(),
... | [
"public",
"function",
"post",
"(",
"$",
"endpoint",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"headers",
"=",
"array",
"(",
")",
",",
"$",
"ingest",
"=",
"false",
")",
"{",
"$",
"res",
"=",
"call_user_func",
"(",
"array",
"(",
"$",
"t... | Make a call to a DataSift API endpoint.
@param string $endpoint The endpoint of the API call.
@param array $params The parameters to be passed along with the request.
@return array The response from the server.
@throws DataSift_Exception_APIError
@throws DataSift_Exception_RateLimitExceeded | [
"Make",
"a",
"call",
"to",
"a",
"DataSift",
"API",
"endpoint",
"."
] | train | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L581-L599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.