id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15,800 | codeburnerframework/router | src/Group.php | Group.setDefault | public function setDefault($key, $value)
{
foreach ($this->routes as $route)
$route->setDefault($key, $value);
return $this;
} | php | public function setDefault($key, $value)
{
foreach ($this->routes as $route)
$route->setDefault($key, $value);
return $this;
} | [
"public",
"function",
"setDefault",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"route",
")",
"$",
"route",
"->",
"setDefault",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"return",
"$",
... | Set a default parameter to all grouped routes.
@param string $key
@param mixed $value
@return $this | [
"Set",
"a",
"default",
"parameter",
"to",
"all",
"grouped",
"routes",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Group.php#L210-L215 |
15,801 | codeburnerframework/router | src/Group.php | Group.setStrategy | public function setStrategy($strategy)
{
foreach ($this->routes as $route)
$route->setStrategy($strategy);
return $this;
} | php | public function setStrategy($strategy)
{
foreach ($this->routes as $route)
$route->setStrategy($strategy);
return $this;
} | [
"public",
"function",
"setStrategy",
"(",
"$",
"strategy",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"as",
"$",
"route",
")",
"$",
"route",
"->",
"setStrategy",
"(",
"$",
"strategy",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set one dispatch strategy to all grouped routes.
@param string|Strategies\StrategyInterface $strategy
@return self | [
"Set",
"one",
"dispatch",
"strategy",
"to",
"all",
"grouped",
"routes",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Group.php#L224-L229 |
15,802 | codeburnerframework/router | src/Group.php | Group.setName | public function setName($name)
{
if (count($this->routes) > 1) {
throw new \LogicException("You cannot set the same name to several routes.");
}
$this->routes[0]->setName($name);
return $this;
} | php | public function setName($name)
{
if (count($this->routes) > 1) {
throw new \LogicException("You cannot set the same name to several routes.");
}
$this->routes[0]->setName($name);
return $this;
} | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"routes",
")",
">",
"1",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"\"You cannot set the same name to several routes.\"",
")",
";",
"}",
"... | Set a name to a Route.
@param string $name
@return self | [
"Set",
"a",
"name",
"to",
"a",
"Route",
"."
] | 2b0e8030303dd08d3fadfc4c57aa37b184a408cd | https://github.com/codeburnerframework/router/blob/2b0e8030303dd08d3fadfc4c57aa37b184a408cd/src/Group.php#L254-L262 |
15,803 | czim/laravel-pxlcms | src/Generator/Writer/Model/Steps/StubReplaceSimple.php | StubReplaceSimple.determineIfModelIsSluggable | protected function determineIfModelIsSluggable()
{
$this->context->modelIsSluggable = false;
$this->context->modelIsParentOfSluggableTranslation = false;
// if the model is sluggable and not translated, or this is the actual translation
if ($this->data['sluggable'... | php | protected function determineIfModelIsSluggable()
{
$this->context->modelIsSluggable = false;
$this->context->modelIsParentOfSluggableTranslation = false;
// if the model is sluggable and not translated, or this is the actual translation
if ($this->data['sluggable'... | [
"protected",
"function",
"determineIfModelIsSluggable",
"(",
")",
"{",
"$",
"this",
"->",
"context",
"->",
"modelIsSluggable",
"=",
"false",
";",
"$",
"this",
"->",
"context",
"->",
"modelIsParentOfSluggableTranslation",
"=",
"false",
";",
"// if the model is sluggabl... | Determines and stores whether model itself is sluggable
If so, it will have both the trait and implement the interface | [
"Determines",
"and",
"stores",
"whether",
"model",
"itself",
"is",
"sluggable",
"If",
"so",
"it",
"will",
"have",
"both",
"the",
"trait",
"and",
"implement",
"the",
"interface"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceSimple.php#L74-L95 |
15,804 | verschoof/bunq-api | src/Certificate/CertificateType.php | CertificateType.protect | private function protect()
{
if (!in_array($this->certificateType, self::allAsString(), true)) {
throw new \InvalidArgumentException(sprintf('Invalid certificate type %s', $this->certificateType));
}
} | php | private function protect()
{
if (!in_array($this->certificateType, self::allAsString(), true)) {
throw new \InvalidArgumentException(sprintf('Invalid certificate type %s', $this->certificateType));
}
} | [
"private",
"function",
"protect",
"(",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"this",
"->",
"certificateType",
",",
"self",
"::",
"allAsString",
"(",
")",
",",
"true",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprint... | Check if the certificateType exists in our list | [
"Check",
"if",
"the",
"certificateType",
"exists",
"in",
"our",
"list"
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Certificate/CertificateType.php#L113-L118 |
15,805 | elkuku/crowdin-api | src/Package.php | Package.getBasePath | protected function getBasePath(string $action) : string
{
return sprintf(
'project/%s/%s?key=%s',
$this->getProjectId(),
$action,
$this->getApiKey()
);
} | php | protected function getBasePath(string $action) : string
{
return sprintf(
'project/%s/%s?key=%s',
$this->getProjectId(),
$action,
$this->getApiKey()
);
} | [
"protected",
"function",
"getBasePath",
"(",
"string",
"$",
"action",
")",
":",
"string",
"{",
"return",
"sprintf",
"(",
"'project/%s/%s?key=%s'",
",",
"$",
"this",
"->",
"getProjectId",
"(",
")",
",",
"$",
"action",
",",
"$",
"this",
"->",
"getApiKey",
"(... | Get the base path for the command including an action.
@param string $action The action to perform.
@return string | [
"Get",
"the",
"base",
"path",
"for",
"the",
"command",
"including",
"an",
"action",
"."
] | 690f00eed8f91a875b3f288d319750d6d8ae0453 | https://github.com/elkuku/crowdin-api/blob/690f00eed8f91a875b3f288d319750d6d8ae0453/src/Package.php#L89-L97 |
15,806 | drunomics/service-utils | src/Core/State/StateTrait.php | StateTrait.getState | public function getState() {
if (empty($this->state)) {
$this->state = \Drupal::service('state');
}
return $this->state;
} | php | public function getState() {
if (empty($this->state)) {
$this->state = \Drupal::service('state');
}
return $this->state;
} | [
"public",
"function",
"getState",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"state",
")",
")",
"{",
"$",
"this",
"->",
"state",
"=",
"\\",
"Drupal",
"::",
"service",
"(",
"'state'",
")",
";",
"}",
"return",
"$",
"this",
"->",
"st... | Gets the state storage.
@return \Drupal\Core\State\StateInterface
The state storage. | [
"Gets",
"the",
"state",
"storage",
"."
] | 56761750043132365ef4ae5d9e0cf4263459328f | https://github.com/drunomics/service-utils/blob/56761750043132365ef4ae5d9e0cf4263459328f/src/Core/State/StateTrait.php#L38-L43 |
15,807 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Traits/HeadersTrait.php | HeadersTrait.merge | public function merge($headers) {
foreach ($headers as $key => $value) {
$this->set($key, $value);
}
return $this;
} | php | public function merge($headers) {
foreach ($headers as $key => $value) {
$this->set($key, $value);
}
return $this;
} | [
"public",
"function",
"merge",
"(",
"$",
"headers",
")",
"{",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"return",
"$",
"this",
";... | Merge actual headers with an array of headers
@param string $header
@return self | [
"Merge",
"actual",
"headers",
"with",
"an",
"array",
"of",
"headers"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Traits/HeadersTrait.php#L159-L167 |
15,808 | jan-dolata/crude-crud | src/Engine/Traits/FromModelTraitPart/CollectionTrait.php | CollectionTrait.getFiltered | public function getFiltered($page, $numRows, $sortAttr, $sortOrder, $searchAttr, $searchValue, $richFilters = [])
{
$query = $this->prepareQuery();
$query = $this->richFiltersOnQuery($query, $richFilters);
if ($sortAttr && $sortOrder && $this->inScope($sortAttr)) {
$scope = $th... | php | public function getFiltered($page, $numRows, $sortAttr, $sortOrder, $searchAttr, $searchValue, $richFilters = [])
{
$query = $this->prepareQuery();
$query = $this->richFiltersOnQuery($query, $richFilters);
if ($sortAttr && $sortOrder && $this->inScope($sortAttr)) {
$scope = $th... | [
"public",
"function",
"getFiltered",
"(",
"$",
"page",
",",
"$",
"numRows",
",",
"$",
"sortAttr",
",",
"$",
"sortOrder",
",",
"$",
"searchAttr",
",",
"$",
"searchValue",
",",
"$",
"richFilters",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"this"... | Get filtered collection
@param integer $page
@param integer $numRows
@param string $sortAttr
@param string $sortOrder
@param string $searchAttr
@param string $searchValue
@return Collection | [
"Get",
"filtered",
"collection"
] | 9129ea08278835cf5cecfd46a90369226ae6bdd7 | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Traits/FromModelTraitPart/CollectionTrait.php#L71-L122 |
15,809 | jan-dolata/crude-crud | src/Engine/Traits/FromModelTraitPart/CollectionTrait.php | CollectionTrait.countFiltered | public function countFiltered($searchAttr, $searchValue, $richFilters)
{
$collection = $this->getFiltered(null, null, null, null, $searchAttr, $searchValue, $richFilters);
return count($collection);
} | php | public function countFiltered($searchAttr, $searchValue, $richFilters)
{
$collection = $this->getFiltered(null, null, null, null, $searchAttr, $searchValue, $richFilters);
return count($collection);
} | [
"public",
"function",
"countFiltered",
"(",
"$",
"searchAttr",
",",
"$",
"searchValue",
",",
"$",
"richFilters",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"getFiltered",
"(",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"$",
"searchAttr... | Count all rows with condition
@param string $searchAttr
@param string $searchValue
@return integer | [
"Count",
"all",
"rows",
"with",
"condition"
] | 9129ea08278835cf5cecfd46a90369226ae6bdd7 | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Traits/FromModelTraitPart/CollectionTrait.php#L130-L134 |
15,810 | jan-dolata/crude-crud | src/Engine/Traits/FromModelTraitPart/CollectionTrait.php | CollectionTrait.addPermissions | public function addPermissions($collection)
{
$newCollection = collect([]);
$customActions = $this->crudeSetup->getCustomActions();
$collection->each(function ($model) use ($newCollection, $customActions) {
if ($this->permissionView($model)) {
$model = $this->ad... | php | public function addPermissions($collection)
{
$newCollection = collect([]);
$customActions = $this->crudeSetup->getCustomActions();
$collection->each(function ($model) use ($newCollection, $customActions) {
if ($this->permissionView($model)) {
$model = $this->ad... | [
"public",
"function",
"addPermissions",
"(",
"$",
"collection",
")",
"{",
"$",
"newCollection",
"=",
"collect",
"(",
"[",
"]",
")",
";",
"$",
"customActions",
"=",
"$",
"this",
"->",
"crudeSetup",
"->",
"getCustomActions",
"(",
")",
";",
"$",
"collection",... | Filter collection by permissions and add attributes canBeEdited and canBeRemoved
@param Collection $collection
@return Collection | [
"Filter",
"collection",
"by",
"permissions",
"and",
"add",
"attributes",
"canBeEdited",
"and",
"canBeRemoved"
] | 9129ea08278835cf5cecfd46a90369226ae6bdd7 | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Traits/FromModelTraitPart/CollectionTrait.php#L141-L155 |
15,811 | weavephp/weave | src/Dispatch/Dispatch.php | Dispatch.dispatch | public function dispatch($dispatchable, $resolutionType, $dispatchSource, Request $request, ...$rest)
{
return $dispatchable($request, ...$rest);
} | php | public function dispatch($dispatchable, $resolutionType, $dispatchSource, Request $request, ...$rest)
{
return $dispatchable($request, ...$rest);
} | [
"public",
"function",
"dispatch",
"(",
"$",
"dispatchable",
",",
"$",
"resolutionType",
",",
"$",
"dispatchSource",
",",
"Request",
"$",
"request",
",",
"...",
"$",
"rest",
")",
"{",
"return",
"$",
"dispatchable",
"(",
"$",
"request",
",",
"...",
"$",
"r... | Call the callable, providing parameters and returning the returned value.
Override this method in subclasses to easily wrap the actual dispatch callable
and provide pre- and post-dispatch custom functionality.
$resolutionType and $dispatchSource can help in identifying when to conditionally
wrap the dispatch to handl... | [
"Call",
"the",
"callable",
"providing",
"parameters",
"and",
"returning",
"the",
"returned",
"value",
"."
] | 44183a5bcb9e3ed3754cc76aa9e0724d718caeec | https://github.com/weavephp/weave/blob/44183a5bcb9e3ed3754cc76aa9e0724d718caeec/src/Dispatch/Dispatch.php#L31-L34 |
15,812 | arrilot/collectors | src/Collector.php | Collector.scanCollection | public function scanCollection($collection, $fields)
{
$fields = (array) $fields;
foreach ($collection as $item) {
$this->collectIdsFromItem($item, $fields);
}
return $this;
} | php | public function scanCollection($collection, $fields)
{
$fields = (array) $fields;
foreach ($collection as $item) {
$this->collectIdsFromItem($item, $fields);
}
return $this;
} | [
"public",
"function",
"scanCollection",
"(",
"$",
"collection",
",",
"$",
"fields",
")",
"{",
"$",
"fields",
"=",
"(",
"array",
")",
"$",
"fields",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"collectIdsFromI... | Add a collection source.
@param $collection
@param mixed $fields
@return $this | [
"Add",
"a",
"collection",
"source",
"."
] | b2084462070d098f088eccea37bf800097e97807 | https://github.com/arrilot/collectors/blob/b2084462070d098f088eccea37bf800097e97807/src/Collector.php#L52-L60 |
15,813 | arrilot/collectors | src/Collector.php | Collector.scanItem | public function scanItem($item, $fields)
{
$fields = (array) $fields;
$this->collectIdsFromItem($item, $fields);
return $this;
} | php | public function scanItem($item, $fields)
{
$fields = (array) $fields;
$this->collectIdsFromItem($item, $fields);
return $this;
} | [
"public",
"function",
"scanItem",
"(",
"$",
"item",
",",
"$",
"fields",
")",
"{",
"$",
"fields",
"=",
"(",
"array",
")",
"$",
"fields",
";",
"$",
"this",
"->",
"collectIdsFromItem",
"(",
"$",
"item",
",",
"$",
"fields",
")",
";",
"return",
"$",
"th... | Add an item source.
@param $item
@param mixed $fields
@return $this | [
"Add",
"an",
"item",
"source",
"."
] | b2084462070d098f088eccea37bf800097e97807 | https://github.com/arrilot/collectors/blob/b2084462070d098f088eccea37bf800097e97807/src/Collector.php#L69-L75 |
15,814 | arrilot/collectors | src/Collector.php | Collector.addIds | public function addIds($ids)
{
foreach ($ids as $id) {
if ((int) $id) {
$this->ids[] = (int) $id;
}
}
return $this;
} | php | public function addIds($ids)
{
foreach ($ids as $id) {
if ((int) $id) {
$this->ids[] = (int) $id;
}
}
return $this;
} | [
"public",
"function",
"addIds",
"(",
"$",
"ids",
")",
"{",
"foreach",
"(",
"$",
"ids",
"as",
"$",
"id",
")",
"{",
"if",
"(",
"(",
"int",
")",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"ids",
"[",
"]",
"=",
"(",
"int",
")",
"$",
"id",
";",
"... | Add existeing ids array source.
@param array $ids
@return $this | [
"Add",
"existeing",
"ids",
"array",
"source",
"."
] | b2084462070d098f088eccea37bf800097e97807 | https://github.com/arrilot/collectors/blob/b2084462070d098f088eccea37bf800097e97807/src/Collector.php#L83-L92 |
15,815 | arrilot/collectors | src/Collector.php | Collector.collectIdsFromField | protected function collectIdsFromField($item, $field)
{
$ids = Arr::get($item, $field, []);
return is_object($ids) && method_exists($ids, 'toArray') ? $ids->toArray() : (array) $ids;
} | php | protected function collectIdsFromField($item, $field)
{
$ids = Arr::get($item, $field, []);
return is_object($ids) && method_exists($ids, 'toArray') ? $ids->toArray() : (array) $ids;
} | [
"protected",
"function",
"collectIdsFromField",
"(",
"$",
"item",
",",
"$",
"field",
")",
"{",
"$",
"ids",
"=",
"Arr",
"::",
"get",
"(",
"$",
"item",
",",
"$",
"field",
",",
"[",
"]",
")",
";",
"return",
"is_object",
"(",
"$",
"ids",
")",
"&&",
"... | Collect ids from field of item
@param $item
@param string $field
@return array | [
"Collect",
"ids",
"from",
"field",
"of",
"item"
] | b2084462070d098f088eccea37bf800097e97807 | https://github.com/arrilot/collectors/blob/b2084462070d098f088eccea37bf800097e97807/src/Collector.php#L158-L163 |
15,816 | ridvanbaluyos/mmda | src/Ridvanbaluyos/Mmda/MMDA.php | MMDA.segments | public function segments($highway = NULL)
{
if ($highway && isset($this->trafficData[$highway]['segments'])) {
return array_keys($this->trafficData[$highway]['segments']);
}
return null;
} | php | public function segments($highway = NULL)
{
if ($highway && isset($this->trafficData[$highway]['segments'])) {
return array_keys($this->trafficData[$highway]['segments']);
}
return null;
} | [
"public",
"function",
"segments",
"(",
"$",
"highway",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"highway",
"&&",
"isset",
"(",
"$",
"this",
"->",
"trafficData",
"[",
"$",
"highway",
"]",
"[",
"'segments'",
"]",
")",
")",
"{",
"return",
"array_keys",
"(... | This function returns the list of segments in a given highway.
@param $highway
@return array|null | [
"This",
"function",
"returns",
"the",
"list",
"of",
"segments",
"in",
"a",
"given",
"highway",
"."
] | 7aebc360b122fc4fe8d21d482341f5ebe091e7e2 | https://github.com/ridvanbaluyos/mmda/blob/7aebc360b122fc4fe8d21d482341f5ebe091e7e2/src/Ridvanbaluyos/Mmda/MMDA.php#L66-L73 |
15,817 | ridvanbaluyos/mmda | src/Ridvanbaluyos/Mmda/MMDA.php | MMDA.getTrafficData | final private function getTrafficData($feedUrl)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $feedUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($response);
return $this->... | php | final private function getTrafficData($feedUrl)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $feedUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($response);
return $this->... | [
"final",
"private",
"function",
"getTrafficData",
"(",
"$",
"feedUrl",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_URL",
",",
"$",
"feedUrl",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_... | This function retrieves the traffic data from the MMDA Traffic API.
@return array | [
"This",
"function",
"retrieves",
"the",
"traffic",
"data",
"from",
"the",
"MMDA",
"Traffic",
"API",
"."
] | 7aebc360b122fc4fe8d21d482341f5ebe091e7e2 | https://github.com/ridvanbaluyos/mmda/blob/7aebc360b122fc4fe8d21d482341f5ebe091e7e2/src/Ridvanbaluyos/Mmda/MMDA.php#L80-L91 |
15,818 | ridvanbaluyos/mmda | src/Ridvanbaluyos/Mmda/MMDA.php | MMDA.parseTrafficData | final private function parseTrafficData($xml)
{
$traffic = [];
foreach ($xml->channel->item as $item) {
$item = get_object_vars($item);
$title = $item['title'];
$description = $item['description'];
$pubDate = $item['pubDate'];
$highway = ... | php | final private function parseTrafficData($xml)
{
$traffic = [];
foreach ($xml->channel->item as $item) {
$item = get_object_vars($item);
$title = $item['title'];
$description = $item['description'];
$pubDate = $item['pubDate'];
$highway = ... | [
"final",
"private",
"function",
"parseTrafficData",
"(",
"$",
"xml",
")",
"{",
"$",
"traffic",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"xml",
"->",
"channel",
"->",
"item",
"as",
"$",
"item",
")",
"{",
"$",
"item",
"=",
"get_object_vars",
"(",
"$",
... | This function parses the XML response from the MMDA Traffic API into JSON.
@param $xml
@return array | [
"This",
"function",
"parses",
"the",
"XML",
"response",
"from",
"the",
"MMDA",
"Traffic",
"API",
"into",
"JSON",
"."
] | 7aebc360b122fc4fe8d21d482341f5ebe091e7e2 | https://github.com/ridvanbaluyos/mmda/blob/7aebc360b122fc4fe8d21d482341f5ebe091e7e2/src/Ridvanbaluyos/Mmda/MMDA.php#L99-L121 |
15,819 | ridvanbaluyos/mmda | src/Ridvanbaluyos/Mmda/MMDA.php | MMDA.sanitizeTrafficData | final private function sanitizeTrafficData(Array $trafficData)
{
$traffic = [];
foreach ($trafficData as $highway=>$segments) {
$traffic[$highway] = [
'name' => $highway,
'label' => $this->convertToTitle($highway),
];
$traffic[$high... | php | final private function sanitizeTrafficData(Array $trafficData)
{
$traffic = [];
foreach ($trafficData as $highway=>$segments) {
$traffic[$highway] = [
'name' => $highway,
'label' => $this->convertToTitle($highway),
];
$traffic[$high... | [
"final",
"private",
"function",
"sanitizeTrafficData",
"(",
"Array",
"$",
"trafficData",
")",
"{",
"$",
"traffic",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"trafficData",
"as",
"$",
"highway",
"=>",
"$",
"segments",
")",
"{",
"$",
"traffic",
"[",
"$",
... | This function sanitizes the traffic data and organizes them into an envelope
@param array $trafficData
@return array | [
"This",
"function",
"sanitizes",
"the",
"traffic",
"data",
"and",
"organizes",
"them",
"into",
"an",
"envelope"
] | 7aebc360b122fc4fe8d21d482341f5ebe091e7e2 | https://github.com/ridvanbaluyos/mmda/blob/7aebc360b122fc4fe8d21d482341f5ebe091e7e2/src/Ridvanbaluyos/Mmda/MMDA.php#L129-L152 |
15,820 | ridvanbaluyos/mmda | src/Ridvanbaluyos/Mmda/MMDA.php | MMDA.convertToStatus | final private function convertToStatus(Array $data)
{
$statusMatrix = [
'L' => 'Light',
'ML' => 'Light to Moderate',
'M' => 'Moderate',
'MH' => 'Moderate to Heavy',
'H' => 'Heavy'
];
$status = [
'NB' => [
... | php | final private function convertToStatus(Array $data)
{
$statusMatrix = [
'L' => 'Light',
'ML' => 'Light to Moderate',
'M' => 'Moderate',
'MH' => 'Moderate to Heavy',
'H' => 'Heavy'
];
$status = [
'NB' => [
... | [
"final",
"private",
"function",
"convertToStatus",
"(",
"Array",
"$",
"data",
")",
"{",
"$",
"statusMatrix",
"=",
"[",
"'L'",
"=>",
"'Light'",
",",
"'ML'",
"=>",
"'Light to Moderate'",
",",
"'M'",
"=>",
"'Moderate'",
",",
"'MH'",
"=>",
"'Moderate to Heavy'",
... | This function converts traffic data status to readable format.
@param array $data
@return array | [
"This",
"function",
"converts",
"traffic",
"data",
"status",
"to",
"readable",
"format",
"."
] | 7aebc360b122fc4fe8d21d482341f5ebe091e7e2 | https://github.com/ridvanbaluyos/mmda/blob/7aebc360b122fc4fe8d21d482341f5ebe091e7e2/src/Ridvanbaluyos/Mmda/MMDA.php#L160-L184 |
15,821 | ridvanbaluyos/mmda | src/Ridvanbaluyos/Mmda/MMDA.php | MMDA.convertToTitle | final private function convertToTitle($string)
{
$string2 = [];
$string = str_replace(['_', 'AVE.', 'BLVD.'], [' ', 'AVENUE', 'BOULEVARD'], $string);
$words = explode(' ', $string);
foreach ($words as $word) {
if (!in_array($word, ['EDSA', 'U.N.'])) {
$wo... | php | final private function convertToTitle($string)
{
$string2 = [];
$string = str_replace(['_', 'AVE.', 'BLVD.'], [' ', 'AVENUE', 'BOULEVARD'], $string);
$words = explode(' ', $string);
foreach ($words as $word) {
if (!in_array($word, ['EDSA', 'U.N.'])) {
$wo... | [
"final",
"private",
"function",
"convertToTitle",
"(",
"$",
"string",
")",
"{",
"$",
"string2",
"=",
"[",
"]",
";",
"$",
"string",
"=",
"str_replace",
"(",
"[",
"'_'",
",",
"'AVE.'",
",",
"'BLVD.'",
"]",
",",
"[",
"' '",
",",
"'AVENUE'",
",",
"'BOULE... | This function sanitizes certain abbreviations into readable format.
@param $string
@return string | [
"This",
"function",
"sanitizes",
"certain",
"abbreviations",
"into",
"readable",
"format",
"."
] | 7aebc360b122fc4fe8d21d482341f5ebe091e7e2 | https://github.com/ridvanbaluyos/mmda/blob/7aebc360b122fc4fe8d21d482341f5ebe091e7e2/src/Ridvanbaluyos/Mmda/MMDA.php#L192-L206 |
15,822 | chris-schmitz/L5SimpleFM | src/L5SimpleFM.php | L5SimpleFM.findByRecId | public function findByRecId($recId)
{
if (empty($recId)) {
throw new \Exception('No record ID specified');
}
$this->primeCommandArray();
$this->addToCommandArray(['-recid' => $recId]);
$this->addToCommandArray(['-find' => null]);
return $this;
} | php | public function findByRecId($recId)
{
if (empty($recId)) {
throw new \Exception('No record ID specified');
}
$this->primeCommandArray();
$this->addToCommandArray(['-recid' => $recId]);
$this->addToCommandArray(['-find' => null]);
return $this;
} | [
"public",
"function",
"findByRecId",
"(",
"$",
"recId",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"recId",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'No record ID specified'",
")",
";",
"}",
"$",
"this",
"->",
"primeCommandArray",
"(",
")",
... | Find a record based on it's internal FileMaker record ID
@param integer The internal FileMaker Record ID
@return object This object | [
"Find",
"a",
"record",
"based",
"on",
"it",
"s",
"internal",
"FileMaker",
"record",
"ID"
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFM.php#L72-L81 |
15,823 | chris-schmitz/L5SimpleFM | src/L5SimpleFM.php | L5SimpleFM.createRecord | public function createRecord($data)
{
$this->primeCommandArray();
$this->addToCommandArray($data);
$this->addToCommandArray(['-new' => null]);
return $this;
} | php | public function createRecord($data)
{
$this->primeCommandArray();
$this->addToCommandArray($data);
$this->addToCommandArray(['-new' => null]);
return $this;
} | [
"public",
"function",
"createRecord",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"primeCommandArray",
"(",
")",
";",
"$",
"this",
"->",
"addToCommandArray",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"addToCommandArray",
"(",
"[",
"'-new'",
"=>",... | Create a new record and populate it with data.
@param array An associative array of FileName => Values to populate the record with
@return object This object | [
"Create",
"a",
"new",
"record",
"and",
"populate",
"it",
"with",
"data",
"."
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFM.php#L88-L94 |
15,824 | chris-schmitz/L5SimpleFM | src/L5SimpleFM.php | L5SimpleFM.updateRecord | public function updateRecord($recId, $data)
{
if (empty($recId)) {
throw new \Exception('No record ID specified');
}
$this->primeCommandArray();
$this->addToCommandArray($data);
$this->addToCommandArray(['-recid' => $recId]);
$this->addToCommandArray(['-ed... | php | public function updateRecord($recId, $data)
{
if (empty($recId)) {
throw new \Exception('No record ID specified');
}
$this->primeCommandArray();
$this->addToCommandArray($data);
$this->addToCommandArray(['-recid' => $recId]);
$this->addToCommandArray(['-ed... | [
"public",
"function",
"updateRecord",
"(",
"$",
"recId",
",",
"$",
"data",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"recId",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'No record ID specified'",
")",
";",
"}",
"$",
"this",
"->",
"primeComma... | Update data in an existing record per it's internal FileMaker record ID.
@param integer The internal FileMaker record ID.
@param array An associative array of FileName => Values to overwrite the record with
Data in fields not included will not be overwritten.
@return object This object | [
"Update",
"data",
"in",
"an",
"existing",
"record",
"per",
"it",
"s",
"internal",
"FileMaker",
"record",
"ID",
"."
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFM.php#L103-L113 |
15,825 | chris-schmitz/L5SimpleFM | src/L5SimpleFM.php | L5SimpleFM.deleteRecord | public function deleteRecord($recId)
{
if (empty($recId)) {
throw new \Exception('No record ID specified');
}
$this->primeCommandArray();
$this->addToCommandArray(['-recid' => $recId]);
$this->addToCommandArray(['-delete' => null]);
return $this;
} | php | public function deleteRecord($recId)
{
if (empty($recId)) {
throw new \Exception('No record ID specified');
}
$this->primeCommandArray();
$this->addToCommandArray(['-recid' => $recId]);
$this->addToCommandArray(['-delete' => null]);
return $this;
} | [
"public",
"function",
"deleteRecord",
"(",
"$",
"recId",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"recId",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'No record ID specified'",
")",
";",
"}",
"$",
"this",
"->",
"primeCommandArray",
"(",
")",
... | Delete a record per it's internal FileMaker record ID.
@param integer The internal FileMaker record ID.
@return object This object | [
"Delete",
"a",
"record",
"per",
"it",
"s",
"internal",
"FileMaker",
"record",
"ID",
"."
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFM.php#L120-L129 |
15,826 | 100hz/hive | src/Hive/Hive.php | Hive.createDocumentManager | protected function createDocumentManager()
{
AnnotationDriver::registerAnnotationClasses();
$configuration = new Configuration();
$configuration->setProxyDir($this->configuration['doctrine']['proxyDir']);
$configuration->setProxyNamespace($this->configuration['doctrine']['proxyNames... | php | protected function createDocumentManager()
{
AnnotationDriver::registerAnnotationClasses();
$configuration = new Configuration();
$configuration->setProxyDir($this->configuration['doctrine']['proxyDir']);
$configuration->setProxyNamespace($this->configuration['doctrine']['proxyNames... | [
"protected",
"function",
"createDocumentManager",
"(",
")",
"{",
"AnnotationDriver",
"::",
"registerAnnotationClasses",
"(",
")",
";",
"$",
"configuration",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"configuration",
"->",
"setProxyDir",
"(",
"$",
"this",
... | Creates the doctrine document mananger for working on the database
@return DocumentManager | [
"Creates",
"the",
"doctrine",
"document",
"mananger",
"for",
"working",
"on",
"the",
"database"
] | b336b092255ce885b1ff9bf78d49693c4daf1c72 | https://github.com/100hz/hive/blob/b336b092255ce885b1ff9bf78d49693c4daf1c72/src/Hive/Hive.php#L154-L166 |
15,827 | 100hz/hive | src/Hive/Hive.php | Hive.initPromises | protected function initPromises($promisesTrait)
{
return $promisesTrait->findOne($this->createFindOneClosure())
->findMany($this->createFindManyClosure())
->renderResult($this->createRenderResultClosure())
->allowRequest($this->createAllowRequestClosure());
} | php | protected function initPromises($promisesTrait)
{
return $promisesTrait->findOne($this->createFindOneClosure())
->findMany($this->createFindManyClosure())
->renderResult($this->createRenderResultClosure())
->allowRequest($this->createAllowRequestClosure());
} | [
"protected",
"function",
"initPromises",
"(",
"$",
"promisesTrait",
")",
"{",
"return",
"$",
"promisesTrait",
"->",
"findOne",
"(",
"$",
"this",
"->",
"createFindOneClosure",
"(",
")",
")",
"->",
"findMany",
"(",
"$",
"this",
"->",
"createFindManyClosure",
"("... | Method for initializing a PromisesTrait object with the Closures
@param PromisesTrait|Hive|Resource $promisesTrait
@return PromisesTrait|Hive|Resource | [
"Method",
"for",
"initializing",
"a",
"PromisesTrait",
"object",
"with",
"the",
"Closures"
] | b336b092255ce885b1ff9bf78d49693c4daf1c72 | https://github.com/100hz/hive/blob/b336b092255ce885b1ff9bf78d49693c4daf1c72/src/Hive/Hive.php#L174-L180 |
15,828 | 100hz/hive | src/Hive/Hive.php | Hive.createHttpException | protected function createHttpException($code, $message = null)
{
if ($code == 404) {
$message = 'Entity not found';
}
$exception = new HttpException($message, $code);
return $exception;
} | php | protected function createHttpException($code, $message = null)
{
if ($code == 404) {
$message = 'Entity not found';
}
$exception = new HttpException($message, $code);
return $exception;
} | [
"protected",
"function",
"createHttpException",
"(",
"$",
"code",
",",
"$",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"code",
"==",
"404",
")",
"{",
"$",
"message",
"=",
"'Entity not found'",
";",
"}",
"$",
"exception",
"=",
"new",
"HttpException... | Helper method for creating HTTP exceptions
@param int $code
@param string $message
@return HttpException | [
"Helper",
"method",
"for",
"creating",
"HTTP",
"exceptions"
] | b336b092255ce885b1ff9bf78d49693c4daf1c72 | https://github.com/100hz/hive/blob/b336b092255ce885b1ff9bf78d49693c4daf1c72/src/Hive/Hive.php#L769-L777 |
15,829 | 100hz/hive | src/Hive/Hive.php | Hive.resource | public function resource($className, $settings = [])
{
/** @var \Hive\Resource $resource */
$resource = $this->initPromises(Resource::create($className, $settings, $this));
foreach ($resource->settings['actions'] as $action => $actionSettings) {
$methodName = "setup$action";
... | php | public function resource($className, $settings = [])
{
/** @var \Hive\Resource $resource */
$resource = $this->initPromises(Resource::create($className, $settings, $this));
foreach ($resource->settings['actions'] as $action => $actionSettings) {
$methodName = "setup$action";
... | [
"public",
"function",
"resource",
"(",
"$",
"className",
",",
"$",
"settings",
"=",
"[",
"]",
")",
"{",
"/** @var \\Hive\\Resource $resource */",
"$",
"resource",
"=",
"$",
"this",
"->",
"initPromises",
"(",
"Resource",
"::",
"create",
"(",
"$",
"className",
... | The second most important method.
Will create RESTful routes for MongoDB model.
@param string $className
@param array $settings
@return PromisesTrait|Resource | [
"The",
"second",
"most",
"important",
"method",
".",
"Will",
"create",
"RESTful",
"routes",
"for",
"MongoDB",
"model",
"."
] | b336b092255ce885b1ff9bf78d49693c4daf1c72 | https://github.com/100hz/hive/blob/b336b092255ce885b1ff9bf78d49693c4daf1c72/src/Hive/Hive.php#L800-L813 |
15,830 | 100hz/hive | src/Hive/Hive.php | Hive.api | public function api($request = null, $response = null, $sendResponse = true)
{
$this->klein->respond('POST', '/authenticate', $this->authenticate);
$this->klein->onHttpError($this->handleError);
// see https://github.com/klein/klein.php/wiki/Sub-Directory-Installation
if ($request =... | php | public function api($request = null, $response = null, $sendResponse = true)
{
$this->klein->respond('POST', '/authenticate', $this->authenticate);
$this->klein->onHttpError($this->handleError);
// see https://github.com/klein/klein.php/wiki/Sub-Directory-Installation
if ($request =... | [
"public",
"function",
"api",
"(",
"$",
"request",
"=",
"null",
",",
"$",
"response",
"=",
"null",
",",
"$",
"sendResponse",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"klein",
"->",
"respond",
"(",
"'POST'",
",",
"'/authenticate'",
",",
"$",
"this",
"... | The most important method.
Will start the hive engine and listening for requests.
@param Request $request
@param AbstractResponse $response
@param boolean $sendResponse
@return void | [
"The",
"most",
"important",
"method",
".",
"Will",
"start",
"the",
"hive",
"engine",
"and",
"listening",
"for",
"requests",
"."
] | b336b092255ce885b1ff9bf78d49693c4daf1c72 | https://github.com/100hz/hive/blob/b336b092255ce885b1ff9bf78d49693c4daf1c72/src/Hive/Hive.php#L825-L842 |
15,831 | fproject/yii2-flex | fproject/widgets/FlexWidget.php | FlexWidget.getFlexLocale | private function getFlexLocale($language) {
if(!empty($language))
{
$split = explode("-", $language, 2);
if(count($split) == 2 && $split[1] != "") {
$split[1] = strtoupper($split[1]);
} else {
$split = null;
}
}
... | php | private function getFlexLocale($language) {
if(!empty($language))
{
$split = explode("-", $language, 2);
if(count($split) == 2 && $split[1] != "") {
$split[1] = strtoupper($split[1]);
} else {
$split = null;
}
}
... | [
"private",
"function",
"getFlexLocale",
"(",
"$",
"language",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"language",
")",
")",
"{",
"$",
"split",
"=",
"explode",
"(",
"\"-\"",
",",
"$",
"language",
",",
"2",
")",
";",
"if",
"(",
"count",
"(",
"... | Returns locale with format for flex application
@param string $language the app language
@return string | [
"Returns",
"locale",
"with",
"format",
"for",
"flex",
"application"
] | 661c8532484ce90592af9111df3cccf4091b10a7 | https://github.com/fproject/yii2-flex/blob/661c8532484ce90592af9111df3cccf4091b10a7/fproject/widgets/FlexWidget.php#L248-L264 |
15,832 | prooph/link-app-core | src/Command/ConfigureJavascriptTicker.php | ConfigureJavascriptTicker.assertPayload | protected function assertPayload($aPayload = null)
{
if (! array_key_exists('enabled', $aPayload) || ! array_key_exists('interval', $aPayload)) {
throw new \InvalidArgumentException('Payload does not contain a enabled or interval key');
}
if (! is_bool($aPayload['enabled'])) thr... | php | protected function assertPayload($aPayload = null)
{
if (! array_key_exists('enabled', $aPayload) || ! array_key_exists('interval', $aPayload)) {
throw new \InvalidArgumentException('Payload does not contain a enabled or interval key');
}
if (! is_bool($aPayload['enabled'])) thr... | [
"protected",
"function",
"assertPayload",
"(",
"$",
"aPayload",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'enabled'",
",",
"$",
"aPayload",
")",
"||",
"!",
"array_key_exists",
"(",
"'interval'",
",",
"$",
"aPayload",
")",
")",
"{",
... | Assert that payload contains all required information for this command
@param null|array $aPayload
@throws \InvalidArgumentException | [
"Assert",
"that",
"payload",
"contains",
"all",
"required",
"information",
"for",
"this",
"command"
] | 835a5945dfa7be7b2cebfa6e84e757ecfd783357 | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Command/ConfigureJavascriptTicker.php#L60-L68 |
15,833 | ua1-labs/firebug | Fire/Bug/Panel.php | Panel.renderLabel | public function renderLabel($content, $class = '', $style = '')
{
$styleAttr = ($style) ? ' style="' . $style . '"' : '';
$classes = ($class) ? ' ' . $class : '';
$renderLabel = '';
$renderLabel .= '<span class="fs-label' . $classes . '"' . $style . '>';
$renderLabel .= $cont... | php | public function renderLabel($content, $class = '', $style = '')
{
$styleAttr = ($style) ? ' style="' . $style . '"' : '';
$classes = ($class) ? ' ' . $class : '';
$renderLabel = '';
$renderLabel .= '<span class="fs-label' . $classes . '"' . $style . '>';
$renderLabel .= $cont... | [
"public",
"function",
"renderLabel",
"(",
"$",
"content",
",",
"$",
"class",
"=",
"''",
",",
"$",
"style",
"=",
"''",
")",
"{",
"$",
"styleAttr",
"=",
"(",
"$",
"style",
")",
"?",
"' style=\"'",
".",
"$",
"style",
".",
"'\"'",
":",
"''",
";",
"$"... | Returns a label.
@param string $content The content of the label
@param string $class CSV list of classes you want to add
@param string $style Custom styles you want added
@return string HTML code for the separator | [
"Returns",
"a",
"label",
"."
] | 70a45b2c0bbf64978641eb07e5f3cddfc1951162 | https://github.com/ua1-labs/firebug/blob/70a45b2c0bbf64978641eb07e5f3cddfc1951162/Fire/Bug/Panel.php#L90-L99 |
15,834 | ua1-labs/firebug | Fire/Bug/Panel.php | Panel.renderSeparator | public function renderSeparator($bold = true, $class = '', $style = '')
{
$styleAttr = ($style) ? ' style="' . $style . '"' : '';
$classes = ($class) ? ' ' . $class : '';
if ($bold) {
return '<hr class="fs-hr' . $classes . '"' . $styleAttr . '>';
} else {
retu... | php | public function renderSeparator($bold = true, $class = '', $style = '')
{
$styleAttr = ($style) ? ' style="' . $style . '"' : '';
$classes = ($class) ? ' ' . $class : '';
if ($bold) {
return '<hr class="fs-hr' . $classes . '"' . $styleAttr . '>';
} else {
retu... | [
"public",
"function",
"renderSeparator",
"(",
"$",
"bold",
"=",
"true",
",",
"$",
"class",
"=",
"''",
",",
"$",
"style",
"=",
"''",
")",
"{",
"$",
"styleAttr",
"=",
"(",
"$",
"style",
")",
"?",
"' style=\"'",
".",
"$",
"style",
".",
"'\"'",
":",
... | Returns a separator.
@param boolean $bold Do you want a bold separator
@param string $class CSV list of classes you want to add
@param string $style Custom styles you want added
@return string HTML code for the separator. | [
"Returns",
"a",
"separator",
"."
] | 70a45b2c0bbf64978641eb07e5f3cddfc1951162 | https://github.com/ua1-labs/firebug/blob/70a45b2c0bbf64978641eb07e5f3cddfc1951162/Fire/Bug/Panel.php#L108-L117 |
15,835 | ua1-labs/firebug | Fire/Bug/Panel.php | Panel.renderTrace | public function renderTrace($debug_backtrace)
{
$renderTrace = '';
$renderTrace .= '<span class="fs-label">';
foreach ($debug_backtrace as $index => $trace) {
$renderTrace .= '#' . $index . ' ';
if (!empty($trace['file'])) {
$renderTrace .= $trace['fil... | php | public function renderTrace($debug_backtrace)
{
$renderTrace = '';
$renderTrace .= '<span class="fs-label">';
foreach ($debug_backtrace as $index => $trace) {
$renderTrace .= '#' . $index . ' ';
if (!empty($trace['file'])) {
$renderTrace .= $trace['fil... | [
"public",
"function",
"renderTrace",
"(",
"$",
"debug_backtrace",
")",
"{",
"$",
"renderTrace",
"=",
"''",
";",
"$",
"renderTrace",
".=",
"'<span class=\"fs-label\">'",
";",
"foreach",
"(",
"$",
"debug_backtrace",
"as",
"$",
"index",
"=>",
"$",
"trace",
")",
... | Returns a rendered debug_backtrace.
@param array $debug_backtrace
@return string | [
"Returns",
"a",
"rendered",
"debug_backtrace",
"."
] | 70a45b2c0bbf64978641eb07e5f3cddfc1951162 | https://github.com/ua1-labs/firebug/blob/70a45b2c0bbf64978641eb07e5f3cddfc1951162/Fire/Bug/Panel.php#L164-L184 |
15,836 | popovserhii/db | src/Db.php | Db.fetch | public function fetch($query)
{
$result = $this->query($query);
return $result->fetch(\PDO::FETCH_ASSOC);
} | php | public function fetch($query)
{
$result = $this->query($query);
return $result->fetch(\PDO::FETCH_ASSOC);
} | [
"public",
"function",
"fetch",
"(",
"$",
"query",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"query",
"(",
"$",
"query",
")",
";",
"return",
"$",
"result",
"->",
"fetch",
"(",
"\\",
"PDO",
"::",
"FETCH_ASSOC",
")",
";",
"}"
] | Return associate array with all data of one row in table
@param $query
@return mixed | [
"Return",
"associate",
"array",
"with",
"all",
"data",
"of",
"one",
"row",
"in",
"table"
] | 86a1651784eb5763ef5b974233e6356b38b66aaa | https://github.com/popovserhii/db/blob/86a1651784eb5763ef5b974233e6356b38b66aaa/src/Db.php#L173-L178 |
15,837 | popovserhii/db | src/Db.php | Db.addFields | protected function addFields($fields)
{
$fields_array = [];
foreach ($fields as $field => $value) {
$fields_array[] = $field;
}
return '`' . implode('`, `', $fields_array) . '`';
} | php | protected function addFields($fields)
{
$fields_array = [];
foreach ($fields as $field => $value) {
$fields_array[] = $field;
}
return '`' . implode('`, `', $fields_array) . '`';
} | [
"protected",
"function",
"addFields",
"(",
"$",
"fields",
")",
"{",
"$",
"fields_array",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"fields_array",
"[",
"]",
"=",
"$",
"field",
";",
"}"... | Generates a set of fields that need to be updated or inserted.
For the terms "INSERT INTO".
@param $fields
@return string | [
"Generates",
"a",
"set",
"of",
"fields",
"that",
"need",
"to",
"be",
"updated",
"or",
"inserted",
".",
"For",
"the",
"terms",
"INSERT",
"INTO",
"."
] | 86a1651784eb5763ef5b974233e6356b38b66aaa | https://github.com/popovserhii/db/blob/86a1651784eb5763ef5b974233e6356b38b66aaa/src/Db.php#L487-L495 |
15,838 | popovserhii/db | src/Db.php | Db._addValue | protected function _addValue($values)
{
$method = $this->getSaveMode();
$value_array = [];
foreach ($values as $key => $value) {
$value_array[] = $this->$method($key, $value);
}
return implode(',', $value_array);
} | php | protected function _addValue($values)
{
$method = $this->getSaveMode();
$value_array = [];
foreach ($values as $key => $value) {
$value_array[] = $this->$method($key, $value);
}
return implode(',', $value_array);
} | [
"protected",
"function",
"_addValue",
"(",
"$",
"values",
")",
"{",
"$",
"method",
"=",
"$",
"this",
"->",
"getSaveMode",
"(",
")",
";",
"$",
"value_array",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")... | Handles one-dimensional array of data and generates a set for one group.
@param array $values
@return string | [
"Handles",
"one",
"-",
"dimensional",
"array",
"of",
"data",
"and",
"generates",
"a",
"set",
"for",
"one",
"group",
"."
] | 86a1651784eb5763ef5b974233e6356b38b66aaa | https://github.com/popovserhii/db/blob/86a1651784eb5763ef5b974233e6356b38b66aaa/src/Db.php#L519-L528 |
15,839 | 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"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Model/Steps/StubReplaceSluggableData.php#L18-L60 |
15,840 | 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",
"."
] | b0dd7e9c4a966f664c2df08b3067c1b6f263e226 | https://github.com/jkribeiro/composer-hydration/blob/b0dd7e9c4a966f664c2df08b3067c1b6f263e226/src/Composer/ComposerHydration.php#L24-L30 |
15,841 | 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",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php#L43-L54 |
15,842 | 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",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/Style/StyleRuleSet.php#L103-L117 |
15,843 | 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... | 5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4 | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L79-L90 |
15,844 | 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... | 5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4 | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L100-L112 |
15,845 | 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",
"."
] | 5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4 | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L121-L132 |
15,846 | 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",
"."
] | 5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4 | https://github.com/nick-jones/globby/blob/5bfc56fbeb0ff84d71f7144c10cc9215a34d9ea4/lib/Globby/Builder/Regex.php#L152-L160 |
15,847 | 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",
"."
] | bff2887d5af01c54d9288fd19c20f0f593b69358 | https://github.com/alexpts/psr15-middlewares/blob/bff2887d5af01c54d9288fd19c20f0f593b69358/src/ErrorToJsonResponse.php#L85-L93 |
15,848 | 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",
"."
] | 56761750043132365ef4ae5d9e0cf4263459328f | https://github.com/drunomics/service-utils/blob/56761750043132365ef4ae5d9e0cf4263459328f/src/Core/Render/RendererTrait.php#L38-L43 |
15,849 | 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"
] | c62858013fce9bac597d47a2475c69aebe7d6209 | https://github.com/model3/model3/blob/c62858013fce9bac597d47a2475c69aebe7d6209/src/Model3/Db/Table.php#L98-L119 |
15,850 | 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"
] | c62858013fce9bac597d47a2475c69aebe7d6209 | https://github.com/model3/model3/blob/c62858013fce9bac597d47a2475c69aebe7d6209/src/Model3/Db/Table.php#L122-L179 |
15,851 | 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",
"."
] | ef7ec14e5d18eeba7a93e3617a0fdb5b146d6480 | https://github.com/ejsmont-artur/phpProxyBuilder/blob/ef7ec14e5d18eeba7a93e3617a0fdb5b146d6480/src/PhpProxyBuilder/Adapter/Intrumentor/SimpleArrayIntrumentor.php#L67-L72 |
15,852 | 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",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/TraitVendorPrefix.php#L13-L22 |
15,853 | 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",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/TraitVendorPrefix.php#L67-L74 |
15,854 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L131-L134 |
15,855 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L144-L165 |
15,856 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L201-L223 |
15,857 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L305-L316 |
15,858 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L325-L330 |
15,859 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L339-L347 |
15,860 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L356-L398 |
15,861 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L426-L435 |
15,862 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L479-L489 |
15,863 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L503-L533 |
15,864 | 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"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/Repository.php#L543-L551 |
15,865 | 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",
"."
] | f47a7c33eaf392fb6564a909f622b36ffd373759 | https://github.com/pdefreitas/Laravel-VanillaSSO/blob/f47a7c33eaf392fb6564a909f622b36ffd373759/src/Pdefreitas/VanillaSSO/VanillaSSO.php#L38-L89 |
15,866 | 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",
"."
] | f47a7c33eaf392fb6564a909f622b36ffd373759 | https://github.com/pdefreitas/Laravel-VanillaSSO/blob/f47a7c33eaf392fb6564a909f622b36ffd373759/src/Pdefreitas/VanillaSSO/VanillaSSO.php#L121-L136 |
15,867 | 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",
"."
] | f47a7c33eaf392fb6564a909f622b36ffd373759 | https://github.com/pdefreitas/Laravel-VanillaSSO/blob/f47a7c33eaf392fb6564a909f622b36ffd373759/src/Pdefreitas/VanillaSSO/VanillaSSO.php#L151-L162 |
15,868 | 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"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L62-L87 |
15,869 | 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"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L98-L106 |
15,870 | 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"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L115-L126 |
15,871 | 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"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L135-L143 |
15,872 | 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"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L154-L176 |
15,873 | 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"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/DataContainer.php#L223-L228 |
15,874 | 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"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Column.php#L346-L372 |
15,875 | 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"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Column.php#L466-L470 |
15,876 | 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"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L35-L65 |
15,877 | 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"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L70-L105 |
15,878 | 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"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L149-L165 |
15,879 | 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"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Analyzer/Steps/CheckTables.php#L173-L190 |
15,880 | 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",
"."
] | 95105636c2490c5c7a88da466702c523a9d0901c | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L112-L123 |
15,881 | 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",
"."
] | 95105636c2490c5c7a88da466702c523a9d0901c | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L142-L164 |
15,882 | 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",
"."
] | 95105636c2490c5c7a88da466702c523a9d0901c | https://github.com/iter8-au/builder/blob/95105636c2490c5c7a88da466702c523a9d0901c/src/Builder/Builder.php#L171-L203 |
15,883 | 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"
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L173-L180 |
15,884 | 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",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L286-L289 |
15,885 | 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",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L344-L352 |
15,886 | 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",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L367-L370 |
15,887 | 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",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L401-L416 |
15,888 | datasift/datasift-php | lib/DataSift/User.php | DataSift_User.get | public function get($endpoint, $params = array(), $headers = array())
{
$res = call_user_func(
array($this->_api_client, 'call'),
$this,
$endpoint,
'get',
array(),
$headers,
$this->getUserAgent(),
$params
... | php | public function get($endpoint, $params = array(), $headers = array())
{
$res = call_user_func(
array($this->_api_client, 'call'),
$this,
$endpoint,
'get',
array(),
$headers,
$this->getUserAgent(),
$params
... | [
"public",
"function",
"get",
"(",
"$",
"endpoint",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"headers",
"=",
"array",
"(",
")",
")",
"{",
"$",
"res",
"=",
"call_user_func",
"(",
"array",
"(",
"$",
"this",
"->",
"_api_client",
",",
"'cal... | Make a GET 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",
"GET",
"call",
"to",
"a",
"DataSift",
"API",
"endpoint",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/lib/DataSift/User.php#L611-L628 |
15,889 | EcomDev/phpspec-magento-di-adapter | src/GeneratorWrapper.php | GeneratorWrapper.supports | public function supports($className)
{
return (strpos($className, ucfirst($this->classSuffix)) === strlen($className) - strlen($this->classSuffix));
} | php | public function supports($className)
{
return (strpos($className, ucfirst($this->classSuffix)) === strlen($className) - strlen($this->classSuffix));
} | [
"public",
"function",
"supports",
"(",
"$",
"className",
")",
"{",
"return",
"(",
"strpos",
"(",
"$",
"className",
",",
"ucfirst",
"(",
"$",
"this",
"->",
"classSuffix",
")",
")",
"===",
"strlen",
"(",
"$",
"className",
")",
"-",
"strlen",
"(",
"$",
... | Returns true if class has been generated
@param string $className
@return bool | [
"Returns",
"true",
"if",
"class",
"has",
"been",
"generated"
] | b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37 | https://github.com/EcomDev/phpspec-magento-di-adapter/blob/b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37/src/GeneratorWrapper.php#L45-L48 |
15,890 | EcomDev/phpspec-magento-di-adapter | src/GeneratorWrapper.php | GeneratorWrapper.createGenerator | public function createGenerator($className)
{
$factory = $this->generatorFactory;
$sourceClass = rtrim(substr($className, 0, strpos($className, ucfirst($this->classSuffix))), '\\');
$entityGenerator = $factory($sourceClass, $className);
return $entityGenerator;
} | php | public function createGenerator($className)
{
$factory = $this->generatorFactory;
$sourceClass = rtrim(substr($className, 0, strpos($className, ucfirst($this->classSuffix))), '\\');
$entityGenerator = $factory($sourceClass, $className);
return $entityGenerator;
} | [
"public",
"function",
"createGenerator",
"(",
"$",
"className",
")",
"{",
"$",
"factory",
"=",
"$",
"this",
"->",
"generatorFactory",
";",
"$",
"sourceClass",
"=",
"rtrim",
"(",
"substr",
"(",
"$",
"className",
",",
"0",
",",
"strpos",
"(",
"$",
"classNa... | Creates a generator
@param string $className
@return EntityAbstract | [
"Creates",
"a",
"generator"
] | b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37 | https://github.com/EcomDev/phpspec-magento-di-adapter/blob/b39f6f0afbb837dbf0eb4c71e6cdb318b8c9de37/src/GeneratorWrapper.php#L69-L75 |
15,891 | verschoof/bunq-api | src/Resource/MonetaryAccountResource.php | MonetaryAccountResource.listMonetaryAccounts | public function listMonetaryAccounts($userId)
{
$monetaryAccounts = $this->client->get($this->getResourceEndpoint($userId));
return $monetaryAccounts;
} | php | public function listMonetaryAccounts($userId)
{
$monetaryAccounts = $this->client->get($this->getResourceEndpoint($userId));
return $monetaryAccounts;
} | [
"public",
"function",
"listMonetaryAccounts",
"(",
"$",
"userId",
")",
"{",
"$",
"monetaryAccounts",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"this",
"->",
"getResourceEndpoint",
"(",
"$",
"userId",
")",
")",
";",
"return",
"$",
"monetaryAc... | Lists all the Monetary accounts for the current user.
@param integer $userId
@return array | [
"Lists",
"all",
"the",
"Monetary",
"accounts",
"for",
"the",
"current",
"user",
"."
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Resource/MonetaryAccountResource.php#L29-L34 |
15,892 | verschoof/bunq-api | src/Resource/MonetaryAccountResource.php | MonetaryAccountResource.getMonetaryAccount | public function getMonetaryAccount($userId, $id)
{
$monetaryAccount = $this->client->get($this->getResourceEndpoint($userId) . '/' . (int)$id);
return $monetaryAccount['Response'][0]['MonetaryAccountBank'];
} | php | public function getMonetaryAccount($userId, $id)
{
$monetaryAccount = $this->client->get($this->getResourceEndpoint($userId) . '/' . (int)$id);
return $monetaryAccount['Response'][0]['MonetaryAccountBank'];
} | [
"public",
"function",
"getMonetaryAccount",
"(",
"$",
"userId",
",",
"$",
"id",
")",
"{",
"$",
"monetaryAccount",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"this",
"->",
"getResourceEndpoint",
"(",
"$",
"userId",
")",
".",
"'/'",
".",
"(... | Gets a Monetary Account by its identifier.
@param integer $userId
@param integer $id
@return array | [
"Gets",
"a",
"Monetary",
"Account",
"by",
"its",
"identifier",
"."
] | df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd | https://github.com/verschoof/bunq-api/blob/df9aa19f384275f4f0deb26de0cb5e5f8b45ffcd/src/Resource/MonetaryAccountResource.php#L44-L49 |
15,893 | weavephp/weave | src/Router/Router.php | Router.run | protected function run(Request $request)
{
if (!$this->routesConfigured) {
$this->adaptor->configureRoutes($this->routeProvider);
$this->routesConfigured = true;
}
$handler = $this->adaptor->route($request);
if ($handler === false) {
return $this->chain($request);
}
// Setup any remaining chain... | php | protected function run(Request $request)
{
if (!$this->routesConfigured) {
$this->adaptor->configureRoutes($this->routeProvider);
$this->routesConfigured = true;
}
$handler = $this->adaptor->route($request);
if ($handler === false) {
return $this->chain($request);
}
// Setup any remaining chain... | [
"protected",
"function",
"run",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"routesConfigured",
")",
"{",
"$",
"this",
"->",
"adaptor",
"->",
"configureRoutes",
"(",
"$",
"this",
"->",
"routeProvider",
")",
";",
"$",
"t... | Configure and then attempt to route and dispatch for the supplied Request.
@param Request $request The request to route.
@return Response | [
"Configure",
"and",
"then",
"attempt",
"to",
"route",
"and",
"dispatch",
"for",
"the",
"supplied",
"Request",
"."
] | 44183a5bcb9e3ed3754cc76aa9e0724d718caeec | https://github.com/weavephp/weave/blob/44183a5bcb9e3ed3754cc76aa9e0724d718caeec/src/Router/Router.php#L82-L112 |
15,894 | acasademont/wurfl | WURFL/Storage/Base.php | WURFL_Storage_Base.setCacheStorage | public function setCacheStorage(WURFL_Storage_Base $cache)
{
if (!$this->supportsSecondaryCaching()) {
throw new WURFL_Storage_Exception("The storage provider ".get_class($cache)." cannot be used as a cache for ".get_class($this));
}
$this->cache = $cache;
} | php | public function setCacheStorage(WURFL_Storage_Base $cache)
{
if (!$this->supportsSecondaryCaching()) {
throw new WURFL_Storage_Exception("The storage provider ".get_class($cache)." cannot be used as a cache for ".get_class($this));
}
$this->cache = $cache;
} | [
"public",
"function",
"setCacheStorage",
"(",
"WURFL_Storage_Base",
"$",
"cache",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportsSecondaryCaching",
"(",
")",
")",
"{",
"throw",
"new",
"WURFL_Storage_Exception",
"(",
"\"The storage provider \"",
".",
"get_cl... | Sets the cache provider for the persistence provider; this is used to
cache data in a volatile storage system like APC in front of a slow
persistence provider like the filesystem.
@param WURFL_Storage_Base $cache | [
"Sets",
"the",
"cache",
"provider",
"for",
"the",
"persistence",
"provider",
";",
"this",
"is",
"used",
"to",
"cache",
"data",
"in",
"a",
"volatile",
"storage",
"system",
"like",
"APC",
"in",
"front",
"of",
"a",
"slow",
"persistence",
"provider",
"like",
"... | 0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2 | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Storage/Base.php#L129-L135 |
15,895 | acasademont/wurfl | WURFL/Storage/Base.php | WURFL_Storage_Base.setWURFLLoaded | public function setWURFLLoaded($loaded = true)
{
$this->save(self::WURFL_LOADED, $loaded);
$this->cacheSave(self::WURFL_LOADED, new StorageObject($loaded, 0));
} | php | public function setWURFLLoaded($loaded = true)
{
$this->save(self::WURFL_LOADED, $loaded);
$this->cacheSave(self::WURFL_LOADED, new StorageObject($loaded, 0));
} | [
"public",
"function",
"setWURFLLoaded",
"(",
"$",
"loaded",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"save",
"(",
"self",
"::",
"WURFL_LOADED",
",",
"$",
"loaded",
")",
";",
"$",
"this",
"->",
"cacheSave",
"(",
"self",
"::",
"WURFL_LOADED",
",",
"new"... | Sets the WURFL Loaded flag
@param bool $loaded | [
"Sets",
"the",
"WURFL",
"Loaded",
"flag"
] | 0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2 | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Storage/Base.php#L182-L186 |
15,896 | JoffreyPoreeCoding/MongoDB-ODM | src/GridFS/Repository.php | Repository.findAll | public function findAll($projections = array(), $sorts = array(), $options = array())
{
$options = $this->createOption($projections, $sorts, $options);
if (!isset($options['iterator']) || $options['iterator'] === false) {
$objects = parent::findAll($projections, $sorts, $options);
... | php | public function findAll($projections = array(), $sorts = array(), $options = array())
{
$options = $this->createOption($projections, $sorts, $options);
if (!isset($options['iterator']) || $options['iterator'] === false) {
$objects = parent::findAll($projections, $sorts, $options);
... | [
"public",
"function",
"findAll",
"(",
"$",
"projections",
"=",
"array",
"(",
")",
",",
"$",
"sorts",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"createOption",
"(",
"$",
... | Get all documents of 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 Pr... | [
"Get",
"all",
"documents",
"of",
"collection"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/GridFS/Repository.php#L113-L131 |
15,897 | JoffreyPoreeCoding/MongoDB-ODM | src/GridFS/Repository.php | Repository.cacheObject | public function cacheObject($object)
{
if (is_object($object)) {
$unhyd = $this->hydrator->unhydrate($object);
unset($unhyd["stream"]);
$this->objectCache->save(spl_object_hash($object), $unhyd);
}
} | php | public function cacheObject($object)
{
if (is_object($object)) {
$unhyd = $this->hydrator->unhydrate($object);
unset($unhyd["stream"]);
$this->objectCache->save(spl_object_hash($object), $unhyd);
}
} | [
"public",
"function",
"cacheObject",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"$",
"unhyd",
"=",
"$",
"this",
"->",
"hydrator",
"->",
"unhydrate",
"(",
"$",
"object",
")",
";",
"unset",
"(",
"$",
"unh... | Store object in cache to see changes
@param object $object Object to cache
@return void | [
"Store",
"object",
"in",
"cache",
"to",
"see",
"changes"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/GridFS/Repository.php#L242-L249 |
15,898 | JoffreyPoreeCoding/MongoDB-ODM | src/GridFS/Repository.php | Repository.insertOne | public function insertOne($document, $options = [])
{
$objectDatas = $this->hydrator->unhydrate($document);
$stream = $objectDatas["stream"];
unset($objectDatas["stream"]);
if (!isset($objectDatas["filename"])) {
$filename = stream_get_meta_data($stream)["uri"];
... | php | public function insertOne($document, $options = [])
{
$objectDatas = $this->hydrator->unhydrate($document);
$stream = $objectDatas["stream"];
unset($objectDatas["stream"]);
if (!isset($objectDatas["filename"])) {
$filename = stream_get_meta_data($stream)["uri"];
... | [
"public",
"function",
"insertOne",
"(",
"$",
"document",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"objectDatas",
"=",
"$",
"this",
"->",
"hydrator",
"->",
"unhydrate",
"(",
"$",
"document",
")",
";",
"$",
"stream",
"=",
"$",
"objectDatas",
... | Insert a GridFS document
@param object $document Document to insert
@param array $options Useless, just for Repository compatibility
@return boolean | [
"Insert",
"a",
"GridFS",
"document"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/GridFS/Repository.php#L269-L294 |
15,899 | JoffreyPoreeCoding/MongoDB-ODM | src/GridFS/Repository.php | Repository.insertMany | public function insertMany($documents, $options = [])
{
foreach ($documents as $document) {
if (!$this->insertOne($document)) {
return false;
}
}
return true;
} | php | public function insertMany($documents, $options = [])
{
foreach ($documents as $document) {
if (!$this->insertOne($document)) {
return false;
}
}
return true;
} | [
"public",
"function",
"insertMany",
"(",
"$",
"documents",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"documents",
"as",
"$",
"document",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"insertOne",
"(",
"$",
"document",
")",
"... | Insert multiple GridFS documents
@param array $documents Documents to insert
@param array $options Useless, just for Repository compatibility
@return boolean | [
"Insert",
"multiple",
"GridFS",
"documents"
] | 56fd7ab28c22f276573a89d56bb93c8d74ad7f74 | https://github.com/JoffreyPoreeCoding/MongoDB-ODM/blob/56fd7ab28c22f276573a89d56bb93c8d74ad7f74/src/GridFS/Repository.php#L303-L312 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.