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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
193,500 | congraphcms/core | Repositories/DataTransferObject.php | DataTransferObject.offsetExists | public function offsetExists($offset) {
return ($this->isCollection)?
isset($this->data[$offset])
:isset($this->data->{$offset});
} | php | public function offsetExists($offset) {
return ($this->isCollection)?
isset($this->data[$offset])
:isset($this->data->{$offset});
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"offset",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"isCollection",
")",
"?",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"offset",
"]",
")",
":",
"isset",
"(",
"$",
"this",
"->",
"data",
"->... | Check if provided offset exists
@param string $offset
@return boolean | [
"Check",
"if",
"provided",
"offset",
"exists"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L587-L591 |
193,501 | congraphcms/core | Repositories/DataTransferObject.php | DataTransferObject.offsetUnset | public function offsetUnset($offset) {
if($this->isCollection)
{
unset($this->data[$offset]);
}
else
{
unset($this->data->{$offset});
}
} | php | public function offsetUnset($offset) {
if($this->isCollection)
{
unset($this->data[$offset]);
}
else
{
unset($this->data->{$offset});
}
} | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isCollection",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"offset",
"]",
")",
";",
"}",
"else",
"{",
"unset",
"(",
"$",
"this",
"-... | Unset the provided offset
@param string $offset
@return boolean | [
"Unset",
"the",
"provided",
"offset"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L600-L609 |
193,502 | congraphcms/core | Repositories/DataTransferObject.php | DataTransferObject.toJson | public function toJson($options = 0, $includeMetaData = false, $nestedInclude = true, $callback = null)
{
$data = $this->toArray($includeMetaData, $nestedInclude, $callback);
return json_encode($data, $options);
} | php | public function toJson($options = 0, $includeMetaData = false, $nestedInclude = true, $callback = null)
{
$data = $this->toArray($includeMetaData, $nestedInclude, $callback);
return json_encode($data, $options);
} | [
"public",
"function",
"toJson",
"(",
"$",
"options",
"=",
"0",
",",
"$",
"includeMetaData",
"=",
"false",
",",
"$",
"nestedInclude",
"=",
"true",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"toArray",
"(",
"$",
... | Get the instance as an json string.
@param int $optinos json options
@param boolean $includeMetaData
@return string | [
"Get",
"the",
"instance",
"as",
"an",
"json",
"string",
"."
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L677-L681 |
193,503 | congraphcms/core | Repositories/DataTransferObject.php | DataTransferObject.transformToArray | public function transformToArray($data, $nestedInclude = true, $extraIncludes = [], $callback = null)
{
if (is_object($data))
{
if( $nestedInclude && ! $this->resolved($data) )
{
$objectKey = $this->objectKey($data);
if(array_key_exists($objectKey, $extraIncludes))
{
$data = $extraInc... | php | public function transformToArray($data, $nestedInclude = true, $extraIncludes = [], $callback = null)
{
if (is_object($data))
{
if( $nestedInclude && ! $this->resolved($data) )
{
$objectKey = $this->objectKey($data);
if(array_key_exists($objectKey, $extraIncludes))
{
$data = $extraInc... | [
"public",
"function",
"transformToArray",
"(",
"$",
"data",
",",
"$",
"nestedInclude",
"=",
"true",
",",
"$",
"extraIncludes",
"=",
"[",
"]",
",",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"if",
... | Convert Object to array deep
@param object $data
@return array | [
"Convert",
"Object",
"to",
"array",
"deep"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L708-L762 |
193,504 | congraphcms/core | Repositories/DataTransferObject.php | DataTransferObject.resolve | protected function resolve($obj)
{
if(Trunk::has($obj->id, $obj->type))
{
return $data = Trunk::get($obj->id, $obj->type);
}
return $obj;
} | php | protected function resolve($obj)
{
if(Trunk::has($obj->id, $obj->type))
{
return $data = Trunk::get($obj->id, $obj->type);
}
return $obj;
} | [
"protected",
"function",
"resolve",
"(",
"$",
"obj",
")",
"{",
"if",
"(",
"Trunk",
"::",
"has",
"(",
"$",
"obj",
"->",
"id",
",",
"$",
"obj",
"->",
"type",
")",
")",
"{",
"return",
"$",
"data",
"=",
"Trunk",
"::",
"get",
"(",
"$",
"obj",
"->",
... | Get resolved object form trunk if possible
@param object $obj
@return object | [
"Get",
"resolved",
"object",
"form",
"trunk",
"if",
"possible"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L831-L839 |
193,505 | congraphcms/core | Repositories/DataTransferObject.php | DataTransferObject.getIncluded | public function getIncluded($obj)
{
$includes = $this->getIncludes(true);
$objectKey = $this->objectKey($obj);
if(array_key_exists($objectKey, $includes))
{
return $includes[$objectKey];
}
return $obj;
} | php | public function getIncluded($obj)
{
$includes = $this->getIncludes(true);
$objectKey = $this->objectKey($obj);
if(array_key_exists($objectKey, $includes))
{
return $includes[$objectKey];
}
return $obj;
} | [
"public",
"function",
"getIncluded",
"(",
"$",
"obj",
")",
"{",
"$",
"includes",
"=",
"$",
"this",
"->",
"getIncludes",
"(",
"true",
")",
";",
"$",
"objectKey",
"=",
"$",
"this",
"->",
"objectKey",
"(",
"$",
"obj",
")",
";",
"if",
"(",
"array_key_exi... | Get resolved object from included
@param object $obj
@return object | [
"Get",
"resolved",
"object",
"from",
"included"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L848-L859 |
193,506 | congraphcms/core | Repositories/DataTransferObject.php | DataTransferObject.objectKey | protected function objectKey($object)
{
return base64_encode(json_encode(['id' => $object->id, 'type' => $object->type, 'relations' => $this->relations]));
} | php | protected function objectKey($object)
{
return base64_encode(json_encode(['id' => $object->id, 'type' => $object->type, 'relations' => $this->relations]));
} | [
"protected",
"function",
"objectKey",
"(",
"$",
"object",
")",
"{",
"return",
"base64_encode",
"(",
"json_encode",
"(",
"[",
"'id'",
"=>",
"$",
"object",
"->",
"id",
",",
"'type'",
"=>",
"$",
"object",
"->",
"type",
",",
"'relations'",
"=>",
"$",
"this",... | Make base64 key from object
@param object $object
@return string | [
"Make",
"base64",
"key",
"from",
"object"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L873-L876 |
193,507 | RSQueue/RSQueue | src/RSQueue/Resolver/QueueAliasResolver.php | QueueAliasResolver.getQueues | public function getQueues(array $queueAlias): array
{
$queues = [];
foreach ($queueAlias as $alias) {
$queues[] = $this->getQueue($alias);
}
return $queues;
} | php | public function getQueues(array $queueAlias): array
{
$queues = [];
foreach ($queueAlias as $alias) {
$queues[] = $this->getQueue($alias);
}
return $queues;
} | [
"public",
"function",
"getQueues",
"(",
"array",
"$",
"queueAlias",
")",
":",
"array",
"{",
"$",
"queues",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"queueAlias",
"as",
"$",
"alias",
")",
"{",
"$",
"queues",
"[",
"]",
"=",
"$",
"this",
"->",
"getQue... | Given an array of queueAliases, return a valid queueNames array.
@param array $queueAlias Queue alias array
@return array valid queueName array | [
"Given",
"an",
"array",
"of",
"queueAliases",
"return",
"a",
"valid",
"queueNames",
"array",
"."
] | 1a8d72a2b025ed65684644febf9493d4f6ac9333 | https://github.com/RSQueue/RSQueue/blob/1a8d72a2b025ed65684644febf9493d4f6ac9333/src/RSQueue/Resolver/QueueAliasResolver.php#L53-L61 |
193,508 | RSQueue/RSQueue | src/RSQueue/Resolver/QueueAliasResolver.php | QueueAliasResolver.getQueueAliasByQueueName | public function getQueueAliasByQueueName(string $queueName): string
{
return is_array($this->queues)
? ((array_flip($this->queues)[$queueName]) ?? $queueName)
: $queueName;
} | php | public function getQueueAliasByQueueName(string $queueName): string
{
return is_array($this->queues)
? ((array_flip($this->queues)[$queueName]) ?? $queueName)
: $queueName;
} | [
"public",
"function",
"getQueueAliasByQueueName",
"(",
"string",
"$",
"queueName",
")",
":",
"string",
"{",
"return",
"is_array",
"(",
"$",
"this",
"->",
"queues",
")",
"?",
"(",
"(",
"array_flip",
"(",
"$",
"this",
"->",
"queues",
")",
"[",
"$",
"queueN... | Return queue alias by queue name.
@param string $queueName
@return string | [
"Return",
"queue",
"alias",
"by",
"queue",
"name",
"."
] | 1a8d72a2b025ed65684644febf9493d4f6ac9333 | https://github.com/RSQueue/RSQueue/blob/1a8d72a2b025ed65684644febf9493d4f6ac9333/src/RSQueue/Resolver/QueueAliasResolver.php#L82-L87 |
193,509 | mpf-soft/admin-widgets | form/Form.php | Form.getButton | public function getButton($details)
{
if (is_string($details)) {
return HtmlHelper::get()->noContentElement('input', array(
'type' => 'submit',
'name' => $details,
'value' => $this->translate(ucwords(str_replace('_', ' ', $details)))
))... | php | public function getButton($details)
{
if (is_string($details)) {
return HtmlHelper::get()->noContentElement('input', array(
'type' => 'submit',
'name' => $details,
'value' => $this->translate(ucwords(str_replace('_', ' ', $details)))
))... | [
"public",
"function",
"getButton",
"(",
"$",
"details",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"details",
")",
")",
"{",
"return",
"HtmlHelper",
"::",
"get",
"(",
")",
"->",
"noContentElement",
"(",
"'input'",
",",
"array",
"(",
"'type'",
"=>",
"'... | Return html code for a button.
@param string|array $details
@return string | [
"Return",
"html",
"code",
"for",
"a",
"button",
"."
] | 92597f9a09d086664268d6b7e0111d5a5586d8c7 | https://github.com/mpf-soft/admin-widgets/blob/92597f9a09d086664268d6b7e0111d5a5586d8c7/form/Form.php#L250-L267 |
193,510 | cmsgears/module-sns-connect | common/components/Factory.php | Factory.registerSystemServices | public function registerSystemServices() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'cmsgears\social\connect\common\services\interfaces\system\IFacebookService', 'cmsgears\social\connect\common\services\system\FacebookService' );
$factory->set( 'cmsgears\social\connect\common\services\inter... | php | public function registerSystemServices() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'cmsgears\social\connect\common\services\interfaces\system\IFacebookService', 'cmsgears\social\connect\common\services\system\FacebookService' );
$factory->set( 'cmsgears\social\connect\common\services\inter... | [
"public",
"function",
"registerSystemServices",
"(",
")",
"{",
"$",
"factory",
"=",
"Yii",
"::",
"$",
"app",
"->",
"factory",
"->",
"getContainer",
"(",
")",
";",
"$",
"factory",
"->",
"set",
"(",
"'cmsgears\\social\\connect\\common\\services\\interfaces\\system\\IF... | Registers system services. | [
"Registers",
"system",
"services",
"."
] | 753ee4157d41c81a701689624f4c44760a6cada3 | https://github.com/cmsgears/module-sns-connect/blob/753ee4157d41c81a701689624f4c44760a6cada3/common/components/Factory.php#L69-L77 |
193,511 | cmsgears/module-sns-connect | common/components/Factory.php | Factory.registerSystemAliases | public function registerSystemAliases() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'facebookService', 'cmsgears\social\connect\common\services\system\FacebookService' );
$factory->set( 'googleService', 'cmsgears\social\connect\common\services\system\GoogleService' );
$factory->set( 'twitt... | php | public function registerSystemAliases() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'facebookService', 'cmsgears\social\connect\common\services\system\FacebookService' );
$factory->set( 'googleService', 'cmsgears\social\connect\common\services\system\GoogleService' );
$factory->set( 'twitt... | [
"public",
"function",
"registerSystemAliases",
"(",
")",
"{",
"$",
"factory",
"=",
"Yii",
"::",
"$",
"app",
"->",
"factory",
"->",
"getContainer",
"(",
")",
";",
"$",
"factory",
"->",
"set",
"(",
"'facebookService'",
",",
"'cmsgears\\social\\connect\\common\\ser... | Registers system aliases. | [
"Registers",
"system",
"aliases",
"."
] | 753ee4157d41c81a701689624f4c44760a6cada3 | https://github.com/cmsgears/module-sns-connect/blob/753ee4157d41c81a701689624f4c44760a6cada3/common/components/Factory.php#L95-L103 |
193,512 | zapheus/zapheus | src/Http/Server/ResolverHandler.php | ResolverHandler.response | protected function response($result)
{
$response = $this->container->get(Application::RESPONSE);
if ($result instanceof ResponseInterface)
{
return $result;
}
$response->stream()->write($result);
return $response;
} | php | protected function response($result)
{
$response = $this->container->get(Application::RESPONSE);
if ($result instanceof ResponseInterface)
{
return $result;
}
$response->stream()->write($result);
return $response;
} | [
"protected",
"function",
"response",
"(",
"$",
"result",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"Application",
"::",
"RESPONSE",
")",
";",
"if",
"(",
"$",
"result",
"instanceof",
"ResponseInterface",
")",
"{",
"... | Converts the given result into a ResponseInterface.
@param mixed $result
@return \Zapheus\Http\Message\ResponseInterface | [
"Converts",
"the",
"given",
"result",
"into",
"a",
"ResponseInterface",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Server/ResolverHandler.php#L71-L83 |
193,513 | chalasr/RCHCapistranoBundle | Service/Capitalizer.php | Capitalizer.camelize | public function camelize($base)
{
$callback = create_function('$c', 'return strtoupper($c[1]);');
if (!is_array($base)) {
return preg_replace_callback('/_([a-z])/', $callback, $base);
}
foreach ($base as $key => $val) {
unset($base[$key]);
$newKe... | php | public function camelize($base)
{
$callback = create_function('$c', 'return strtoupper($c[1]);');
if (!is_array($base)) {
return preg_replace_callback('/_([a-z])/', $callback, $base);
}
foreach ($base as $key => $val) {
unset($base[$key]);
$newKe... | [
"public",
"function",
"camelize",
"(",
"$",
"base",
")",
"{",
"$",
"callback",
"=",
"create_function",
"(",
"'$c'",
",",
"'return strtoupper($c[1]);'",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"base",
")",
")",
"{",
"return",
"preg_replace_callback",
... | Convert strings from under_scores to CamelCase.
@param mixed $base
@return mixed | [
"Convert",
"strings",
"from",
"under_scores",
"to",
"CamelCase",
"."
] | c4a4cbaa2bc05f33bf431fd3afe6cac39947640e | https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Service/Capitalizer.php#L28-L43 |
193,514 | chalasr/RCHCapistranoBundle | Service/Capitalizer.php | Capitalizer.uncamelize | public function uncamelize($base)
{
$callback = create_function('$c', 'return "_" . strtolower($c[1]);');
if (!is_array($base)) {
$base[0] = strtolower($base[0]);
return preg_replace_callback('/([A-Z])/', $callback, $base);
}
foreach ($base as $key => $val)... | php | public function uncamelize($base)
{
$callback = create_function('$c', 'return "_" . strtolower($c[1]);');
if (!is_array($base)) {
$base[0] = strtolower($base[0]);
return preg_replace_callback('/([A-Z])/', $callback, $base);
}
foreach ($base as $key => $val)... | [
"public",
"function",
"uncamelize",
"(",
"$",
"base",
")",
"{",
"$",
"callback",
"=",
"create_function",
"(",
"'$c'",
",",
"'return \"_\" . strtolower($c[1]);'",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"base",
")",
")",
"{",
"$",
"base",
"[",
"0"... | Converts strings from camelCase to under_score.
@param mixed $base
@return mixed | [
"Converts",
"strings",
"from",
"camelCase",
"to",
"under_score",
"."
] | c4a4cbaa2bc05f33bf431fd3afe6cac39947640e | https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Service/Capitalizer.php#L52-L69 |
193,515 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.addIn | public function addIn($field, $values, $whereConcat = 'AND')
{
if (!is_array($values)) {
return $this;
}
$field = (0 < count($this->wheres) ? ' ' . $whereConcat . ' ' . $field : $field);
//~ Bind values (more safety)
$index = 1;
$fields = array();
... | php | public function addIn($field, $values, $whereConcat = 'AND')
{
if (!is_array($values)) {
return $this;
}
$field = (0 < count($this->wheres) ? ' ' . $whereConcat . ' ' . $field : $field);
//~ Bind values (more safety)
$index = 1;
$fields = array();
... | [
"public",
"function",
"addIn",
"(",
"$",
"field",
",",
"$",
"values",
",",
"$",
"whereConcat",
"=",
"'AND'",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"field",
"=",
"(",
"0",
... | Add In list item.
@param string $field Field name
@param array $values List of values (integer)
@param string $whereConcat Concat type with other where elements
@return self | [
"Add",
"In",
"list",
"item",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L192-L216 |
193,516 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.addWhere | public function addWhere($field, $value, $sign = '=', $whereConcat = 'AND')
{
$fieldWhere = (0 < count($this->wheres) ? ' ' . $whereConcat . ' ' . $field : $field);
$fieldBind = ':' . strtolower($field);
if (isset($this->binds[$fieldBind])) {
$counter = 0;
while ($c... | php | public function addWhere($field, $value, $sign = '=', $whereConcat = 'AND')
{
$fieldWhere = (0 < count($this->wheres) ? ' ' . $whereConcat . ' ' . $field : $field);
$fieldBind = ':' . strtolower($field);
if (isset($this->binds[$fieldBind])) {
$counter = 0;
while ($c... | [
"public",
"function",
"addWhere",
"(",
"$",
"field",
",",
"$",
"value",
",",
"$",
"sign",
"=",
"'='",
",",
"$",
"whereConcat",
"=",
"'AND'",
")",
"{",
"$",
"fieldWhere",
"=",
"(",
"0",
"<",
"count",
"(",
"$",
"this",
"->",
"wheres",
")",
"?",
"' ... | Add where clause.
@param string $field
@param string|integer $value
@param string $sign
@param string $whereConcat
@return self | [
"Add",
"where",
"clause",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L241-L263 |
193,517 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.clear | public function clear()
{
$this->wheres = array();
$this->sets = array();
$this->havings = array();
$this->orders = array();
$this->binds = array();
$this->limit = null;
$this->offset = null;
return $this;
} | php | public function clear()
{
$this->wheres = array();
$this->sets = array();
$this->havings = array();
$this->orders = array();
$this->binds = array();
$this->limit = null;
$this->offset = null;
return $this;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"wheres",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"sets",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"havings",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"order... | Clear query params
@return self | [
"Clear",
"query",
"params"
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L298-L309 |
193,518 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.getQueryFields | public function getQueryFields($usePrefix = false, $prefix = '')
{
$fields = $this->fields;
if ($usePrefix) {
$prefix = (empty($prefix) ? $this->getTable() : $prefix);
$fields = array();
foreach ($this->fields as $field) {
$fields[] = $prefix . '.... | php | public function getQueryFields($usePrefix = false, $prefix = '')
{
$fields = $this->fields;
if ($usePrefix) {
$prefix = (empty($prefix) ? $this->getTable() : $prefix);
$fields = array();
foreach ($this->fields as $field) {
$fields[] = $prefix . '.... | [
"public",
"function",
"getQueryFields",
"(",
"$",
"usePrefix",
"=",
"false",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"fields",
";",
"if",
"(",
"$",
"usePrefix",
")",
"{",
"$",
"prefix",
"=",
"(",
"empty",
"("... | Get fields to select
@param bool $usePrefix
@param string $prefix
@return string | [
"Get",
"fields",
"to",
"select"
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L328-L341 |
193,519 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.getQueryLimit | public function getQueryLimit()
{
if ($this->limit !== null && $this->offset !== null) {
return 'LIMIT ' . $this->offset . ', ' . $this->limit;
} else {
if (null !== $this->limit) {
return 'LIMIT ' . $this->limit;
} else {
return ''... | php | public function getQueryLimit()
{
if ($this->limit !== null && $this->offset !== null) {
return 'LIMIT ' . $this->offset . ', ' . $this->limit;
} else {
if (null !== $this->limit) {
return 'LIMIT ' . $this->limit;
} else {
return ''... | [
"public",
"function",
"getQueryLimit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"limit",
"!==",
"null",
"&&",
"$",
"this",
"->",
"offset",
"!==",
"null",
")",
"{",
"return",
"'LIMIT '",
".",
"$",
"this",
"->",
"offset",
".",
"', '",
".",
"$",
"... | Get limit clause.
@return string | [
"Get",
"limit",
"clause",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L417-L428 |
193,520 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.count | public function count($field = '*')
{
if ($field !== '*' && !in_array($field, $this->getFields())) {
throw new \DomainException(__METHOD__ . '|Field is not allowed ! (field: ' . $field . ')');
}
$query = 'SELECT COUNT(' . $field . ') AS NB_RESULTS FROM ' . $this->table . ' ' . $... | php | public function count($field = '*')
{
if ($field !== '*' && !in_array($field, $this->getFields())) {
throw new \DomainException(__METHOD__ . '|Field is not allowed ! (field: ' . $field . ')');
}
$query = 'SELECT COUNT(' . $field . ') AS NB_RESULTS FROM ' . $this->table . ' ' . $... | [
"public",
"function",
"count",
"(",
"$",
"field",
"=",
"'*'",
")",
"{",
"if",
"(",
"$",
"field",
"!==",
"'*'",
"&&",
"!",
"in_array",
"(",
"$",
"field",
",",
"$",
"this",
"->",
"getFields",
"(",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"DomainEx... | Count number of results for query.
@param string $field
@return integer
@throws \DomainException | [
"Count",
"number",
"of",
"results",
"for",
"query",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L466-L480 |
193,521 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.rowExists | public function rowExists($field, $value)
{
$this->addWhere($field, $value);
try {
$this->selectOne();
return true;
} catch (ExceptionNoData $exception) {
return false;
}
} | php | public function rowExists($field, $value)
{
$this->addWhere($field, $value);
try {
$this->selectOne();
return true;
} catch (ExceptionNoData $exception) {
return false;
}
} | [
"public",
"function",
"rowExists",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addWhere",
"(",
"$",
"field",
",",
"$",
"value",
")",
";",
"try",
"{",
"$",
"this",
"->",
"selectOne",
"(",
")",
";",
"return",
"true",
";",
"}... | Check if value row exists in database..
@param string $field
@param mixed $value Value
@return bool | [
"Check",
"if",
"value",
"row",
"exists",
"in",
"database",
".."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L489-L500 |
193,522 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.query | public function query($query)
{
$statement = $this->db->prepare($query);
$statement->execute($this->binds);
$this->clear();
$collection = array();
while (false !== ($row = $statement->fetchObject())) {
$collection[] = $this->newDataInstance($row, true);
... | php | public function query($query)
{
$statement = $this->db->prepare($query);
$statement->execute($this->binds);
$this->clear();
$collection = array();
while (false !== ($row = $statement->fetchObject())) {
$collection[] = $this->newDataInstance($row, true);
... | [
"public",
"function",
"query",
"(",
"$",
"query",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"db",
"->",
"prepare",
"(",
"$",
"query",
")",
";",
"$",
"statement",
"->",
"execute",
"(",
"$",
"this",
"->",
"binds",
")",
";",
"$",
"this",
"... | Fetch rows for specified query.
@param string $query
@return array Array of model_base object for query. | [
"Fetch",
"rows",
"for",
"specified",
"query",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L508-L522 |
193,523 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.delete | public function delete(DataAbstract $data)
{
foreach ($this->primaryKeys as $key) {
$this->addWhere($key, $this->getDataValue($data, $key));
}
$where = $this->getQueryWhere();
if (empty($where)) {
throw new \LogicException(__METHOD__ . '| Where restriction i... | php | public function delete(DataAbstract $data)
{
foreach ($this->primaryKeys as $key) {
$this->addWhere($key, $this->getDataValue($data, $key));
}
$where = $this->getQueryWhere();
if (empty($where)) {
throw new \LogicException(__METHOD__ . '| Where restriction i... | [
"public",
"function",
"delete",
"(",
"DataAbstract",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"primaryKeys",
"as",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"addWhere",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"getDataValue",
"(",
"$"... | Delete data from database.
@param DataAbstract $data
@return self
@throws \LogicException | [
"Delete",
"data",
"from",
"database",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L553-L578 |
193,524 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.persist | public function persist(DataAbstract $data)
{
if ($data->exists()) {
return $this->update($data);
} else {
return $this->insert($data);
}
} | php | public function persist(DataAbstract $data)
{
if ($data->exists()) {
return $this->update($data);
} else {
return $this->insert($data);
}
} | [
"public",
"function",
"persist",
"(",
"DataAbstract",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"->",
"exists",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"update",
"(",
"$",
"data",
")",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"... | Persist data in database.
@param DataAbstract $data
@return bool | [
"Persist",
"data",
"in",
"database",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L586-L593 |
193,525 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.update | public function update(DataAbstract $data)
{
if (!$data->isUpdated()) {
return false;
}
//~ Reset binded fields
$this->binds = array();
foreach ($this->primaryKeys as $key) {
$this->addWhere($key, $this->getDataValue($data, $key));
}
... | php | public function update(DataAbstract $data)
{
if (!$data->isUpdated()) {
return false;
}
//~ Reset binded fields
$this->binds = array();
foreach ($this->primaryKeys as $key) {
$this->addWhere($key, $this->getDataValue($data, $key));
}
... | [
"public",
"function",
"update",
"(",
"DataAbstract",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"data",
"->",
"isUpdated",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"//~ Reset binded fields",
"$",
"this",
"->",
"binds",
"=",
"array",
"(",
")",
... | Update data into database
@param $data
@return bool
@throws \LogicException | [
"Update",
"data",
"into",
"database"
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L661-L696 |
193,526 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.select | public function select()
{
$query = 'SELECT ' . $this->getQueryFields() . ' FROM ' . $this->getTable() . ' ' . $this->getQueryWhere() . ' ' . $this->getQueryOrderBy() . ' ' . $this->getQueryLimit();
$statement = $this->db->prepare($query);
$statement->execute($this->binds);
$thi... | php | public function select()
{
$query = 'SELECT ' . $this->getQueryFields() . ' FROM ' . $this->getTable() . ' ' . $this->getQueryWhere() . ' ' . $this->getQueryOrderBy() . ' ' . $this->getQueryLimit();
$statement = $this->db->prepare($query);
$statement->execute($this->binds);
$thi... | [
"public",
"function",
"select",
"(",
")",
"{",
"$",
"query",
"=",
"'SELECT '",
".",
"$",
"this",
"->",
"getQueryFields",
"(",
")",
".",
"' FROM '",
".",
"$",
"this",
"->",
"getTable",
"(",
")",
".",
"' '",
".",
"$",
"this",
"->",
"getQueryWhere",
"("... | Select all rows corresponding of where clause.
@return DataAbstract[] List of row. | [
"Select",
"all",
"rows",
"corresponding",
"of",
"where",
"clause",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L759-L774 |
193,527 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.selectOne | public function selectOne()
{
$this->setLimit(1);
$query = 'SELECT ' . $this->getQueryFields() . ' FROM ' . $this->getTable() . ' ' . $this->getQueryWhere() . ' ' . $this->getQueryOrderBy() . ' ' . $this->getQueryLimit();
$statement = $this->db->prepare($query);
$statement->execute... | php | public function selectOne()
{
$this->setLimit(1);
$query = 'SELECT ' . $this->getQueryFields() . ' FROM ' . $this->getTable() . ' ' . $this->getQueryWhere() . ' ' . $this->getQueryOrderBy() . ' ' . $this->getQueryLimit();
$statement = $this->db->prepare($query);
$statement->execute... | [
"public",
"function",
"selectOne",
"(",
")",
"{",
"$",
"this",
"->",
"setLimit",
"(",
"1",
")",
";",
"$",
"query",
"=",
"'SELECT '",
".",
"$",
"this",
"->",
"getQueryFields",
"(",
")",
".",
"' FROM '",
".",
"$",
"this",
"->",
"getTable",
"(",
")",
... | Select first rows corresponding to where clause.
@return DataAbstract
@throws ExceptionNoData | [
"Select",
"first",
"rows",
"corresponding",
"to",
"where",
"clause",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L782-L799 |
193,528 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.getCache | protected function getCache(DataAbstract $data)
{
if (!$this->isCacheEnabled) {
return false;
}
return $this->cache->get($data->getCacheKey());
} | php | protected function getCache(DataAbstract $data)
{
if (!$this->isCacheEnabled) {
return false;
}
return $this->cache->get($data->getCacheKey());
} | [
"protected",
"function",
"getCache",
"(",
"DataAbstract",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isCacheEnabled",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"cache",
"->",
"get",
"(",
"$",
"data",
"->",
"g... | Get Data object from cache if is enabled.
@param DataAbstract $data
@return bool|DataAbstract | [
"Get",
"Data",
"object",
"from",
"cache",
"if",
"is",
"enabled",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L822-L829 |
193,529 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.setCache | protected function setCache(DataAbstract $data)
{
if (!$this->isCacheEnabled) {
return $this;
}
$this->cache->set($data->getCacheKey(), $data);
return $this;
} | php | protected function setCache(DataAbstract $data)
{
if (!$this->isCacheEnabled) {
return $this;
}
$this->cache->set($data->getCacheKey(), $data);
return $this;
} | [
"protected",
"function",
"setCache",
"(",
"DataAbstract",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isCacheEnabled",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"cache",
"->",
"set",
"(",
"$",
"data",
"->",
"getCach... | Set data into cache if enabled.
@param DataAbstract $data
@return self | [
"Set",
"data",
"into",
"cache",
"if",
"enabled",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L837-L846 |
193,530 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.isDataUpdated | protected function isDataUpdated($data, $field)
{
if (!isset($this->dataNamesMap[$field]['property'])) {
throw new \DomainException('Field have not mapping with Data instance (field: ' . $field . ')');
}
$property = $this->dataNamesMap[$field]['property'];
return $data-... | php | protected function isDataUpdated($data, $field)
{
if (!isset($this->dataNamesMap[$field]['property'])) {
throw new \DomainException('Field have not mapping with Data instance (field: ' . $field . ')');
}
$property = $this->dataNamesMap[$field]['property'];
return $data-... | [
"protected",
"function",
"isDataUpdated",
"(",
"$",
"data",
",",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataNamesMap",
"[",
"$",
"field",
"]",
"[",
"'property'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"DomainExce... | Check if data value is updated or not
@param DataAbstract $data
@param string $field
@return bool
@throws \DomainException | [
"Check",
"if",
"data",
"value",
"is",
"updated",
"or",
"not"
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L856-L865 |
193,531 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.getDataValue | protected function getDataValue($data, $field)
{
if (!isset($this->dataNamesMap[$field]['get'])) {
throw new \DomainException('Field have not mapping with Data instance (field: ' . $field . ')');
}
$method = $this->dataNamesMap[$field]['get'];
return $data->{$method}();... | php | protected function getDataValue($data, $field)
{
if (!isset($this->dataNamesMap[$field]['get'])) {
throw new \DomainException('Field have not mapping with Data instance (field: ' . $field . ')');
}
$method = $this->dataNamesMap[$field]['get'];
return $data->{$method}();... | [
"protected",
"function",
"getDataValue",
"(",
"$",
"data",
",",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataNamesMap",
"[",
"$",
"field",
"]",
"[",
"'get'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"DomainException"... | Get value from DataAbstract instance based on field value
@param DataAbstract $data
@param string $field
@return mixed
@throws \DomainException | [
"Get",
"value",
"from",
"DataAbstract",
"instance",
"based",
"on",
"field",
"value"
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L875-L884 |
193,532 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.setDataValue | protected function setDataValue($data, $field, $value)
{
if (!isset($this->dataNamesMap[$field]['set'])) {
if (true === $this->ignoreNotMappedFields) {
return $this;
}
throw new \DomainException('Field have not mapping with Data instance (field: ' . $fie... | php | protected function setDataValue($data, $field, $value)
{
if (!isset($this->dataNamesMap[$field]['set'])) {
if (true === $this->ignoreNotMappedFields) {
return $this;
}
throw new \DomainException('Field have not mapping with Data instance (field: ' . $fie... | [
"protected",
"function",
"setDataValue",
"(",
"$",
"data",
",",
"$",
"field",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataNamesMap",
"[",
"$",
"field",
"]",
"[",
"'set'",
"]",
")",
")",
"{",
"if",
"(",
"true... | Set value into DataAbstract instance based on field value
@param DataAbstract $data
@param string $field
@param mixed $value
@return mixed
@throws \DomainException | [
"Set",
"value",
"into",
"DataAbstract",
"instance",
"based",
"on",
"field",
"value"
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L895-L911 |
193,533 | eureka-framework/component-orm | src/Orm/DataMapper/MapperAbstract.php | MapperAbstract.initCache | public function initCache(Cache $cache, $enableCache = false)
{
$this->cache = $cache;
$this->isCacheEnabled = $enableCache;
if ($enableCache) {
$this->cache->enable();
} else {
$this->cache->disable();
}
return $this;
} | php | public function initCache(Cache $cache, $enableCache = false)
{
$this->cache = $cache;
$this->isCacheEnabled = $enableCache;
if ($enableCache) {
$this->cache->enable();
} else {
$this->cache->disable();
}
return $this;
} | [
"public",
"function",
"initCache",
"(",
"Cache",
"$",
"cache",
",",
"$",
"enableCache",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"cache",
"=",
"$",
"cache",
";",
"$",
"this",
"->",
"isCacheEnabled",
"=",
"$",
"enableCache",
";",
"if",
"(",
"$",
"en... | Set cache instance & enable cache if it is specified.
@param Cache $cache
@param bool $enableCache
@return self | [
"Set",
"cache",
"instance",
"&",
"enable",
"cache",
"if",
"it",
"is",
"specified",
"."
] | bce48121d26c4e923534f9dc70da597634184316 | https://github.com/eureka-framework/component-orm/blob/bce48121d26c4e923534f9dc70da597634184316/src/Orm/DataMapper/MapperAbstract.php#L933-L945 |
193,534 | rougin/blueprint | src/Console.php | Console.boot | public static function boot($filename = null, Injector $injector = null, $directory = null)
{
$directory = $directory === null ? getcwd() : $directory;
$injector = $injector === null ? new Injector : $injector;
$system = new Filesystem(new Local($directory));
$injector->share($sys... | php | public static function boot($filename = null, Injector $injector = null, $directory = null)
{
$directory = $directory === null ? getcwd() : $directory;
$injector = $injector === null ? new Injector : $injector;
$system = new Filesystem(new Local($directory));
$injector->share($sys... | [
"public",
"static",
"function",
"boot",
"(",
"$",
"filename",
"=",
"null",
",",
"Injector",
"$",
"injector",
"=",
"null",
",",
"$",
"directory",
"=",
"null",
")",
"{",
"$",
"directory",
"=",
"$",
"directory",
"===",
"null",
"?",
"getcwd",
"(",
")",
"... | Prepares the console application.
@param string|null $filename
@param \Auryn\Injector|null $injector
@param string|null $directory
@return \Rougin\Blueprint\Blueprint | [
"Prepares",
"the",
"console",
"application",
"."
] | 02dab857b0fab60e060632f11f73e24467483e5b | https://github.com/rougin/blueprint/blob/02dab857b0fab60e060632f11f73e24467483e5b/src/Console.php#L39-L54 |
193,535 | rougin/blueprint | src/Console.php | Console.paths | protected static function paths(Blueprint $blueprint, $directory, $filename = null)
{
$yaml = file_exists($filename) ? file_get_contents($filename) : '';
$yaml = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $yaml);
$yaml = str_replace('%%CURRENT_DIRECTORY%%', $directory, $yaml);
... | php | protected static function paths(Blueprint $blueprint, $directory, $filename = null)
{
$yaml = file_exists($filename) ? file_get_contents($filename) : '';
$yaml = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $yaml);
$yaml = str_replace('%%CURRENT_DIRECTORY%%', $directory, $yaml);
... | [
"protected",
"static",
"function",
"paths",
"(",
"Blueprint",
"$",
"blueprint",
",",
"$",
"directory",
",",
"$",
"filename",
"=",
"null",
")",
"{",
"$",
"yaml",
"=",
"file_exists",
"(",
"$",
"filename",
")",
"?",
"file_get_contents",
"(",
"$",
"filename",
... | Prepares the paths that are defined from a YAML file.
@param \Rougin\Blueprint\Blueprint $blueprint
@param string $directory
@param string|null $filename
@return \Rougin\Blueprint\Blueprint | [
"Prepares",
"the",
"paths",
"that",
"are",
"defined",
"from",
"a",
"YAML",
"file",
"."
] | 02dab857b0fab60e060632f11f73e24467483e5b | https://github.com/rougin/blueprint/blob/02dab857b0fab60e060632f11f73e24467483e5b/src/Console.php#L82-L99 |
193,536 | cogentParadigm/behat-starbug-extension | src/Context/ShellContext.php | ShellContext.iShouldSeeInTheOutput | public function iShouldSeeInTheOutput($string) {
if (strpos($this->output, $string) === false) {
throw new Exception(sprintf('Did not see "%s" in output "%s"', $string, $this->output));
}
} | php | public function iShouldSeeInTheOutput($string) {
if (strpos($this->output, $string) === false) {
throw new Exception(sprintf('Did not see "%s" in output "%s"', $string, $this->output));
}
} | [
"public",
"function",
"iShouldSeeInTheOutput",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"this",
"->",
"output",
",",
"$",
"string",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"Exception",
"(",
"sprintf",
"(",
"'Did not see \"%s\" in... | Validate command output.
@Then I should see :string in the output
@throws Exception if output does not contain phrase. | [
"Validate",
"command",
"output",
"."
] | 76da5d943773857ad2388a7cccb6632176b452a9 | https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/ShellContext.php#L27-L31 |
193,537 | AmericanCouncils/WebServicesBundle | Controller.php | Controller.decodeRequest | protected function decodeRequest($class, Context $ctx = null)
{
$container = $this->container;
$request = $container->get('request');
$serializerFormat = $this->container->get('ac_web_services.negotiator')->negotiateRequestFormat($request);
$data = $request->getContent();
/... | php | protected function decodeRequest($class, Context $ctx = null)
{
$container = $this->container;
$request = $container->get('request');
$serializerFormat = $this->container->get('ac_web_services.negotiator')->negotiateRequestFormat($request);
$data = $request->getContent();
/... | [
"protected",
"function",
"decodeRequest",
"(",
"$",
"class",
",",
"Context",
"$",
"ctx",
"=",
"null",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"container",
";",
"$",
"request",
"=",
"$",
"container",
"->",
"get",
"(",
"'request'",
")",
";",
... | Convenience method for decoding incoming API data. The data format is determined via
a negotiation service, and then deserialized.
@return mixed | [
"Convenience",
"method",
"for",
"decoding",
"incoming",
"API",
"data",
".",
"The",
"data",
"format",
"is",
"determined",
"via",
"a",
"negotiation",
"service",
"and",
"then",
"deserialized",
"."
] | 3f6270ecf31138ba2271a94a407c0d1a05542929 | https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Controller.php#L18-L45 |
193,538 | AmericanCouncils/WebServicesBundle | Controller.php | Controller.validate | protected function validate($obj)
{
$errors = $this->container->get('validator')->validate($obj);
if (count($errors) > 0) {
throw new ValidationException($errors);
}
} | php | protected function validate($obj)
{
$errors = $this->container->get('validator')->validate($obj);
if (count($errors) > 0) {
throw new ValidationException($errors);
}
} | [
"protected",
"function",
"validate",
"(",
"$",
"obj",
")",
"{",
"$",
"errors",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'validator'",
")",
"->",
"validate",
"(",
"$",
"obj",
")",
";",
"if",
"(",
"count",
"(",
"$",
"errors",
")",
">",... | Convenience validation method that will automatically throw custom ValidationExceptions
when validation fails.
@throws ValidationException | [
"Convenience",
"validation",
"method",
"that",
"will",
"automatically",
"throw",
"custom",
"ValidationExceptions",
"when",
"validation",
"fails",
"."
] | 3f6270ecf31138ba2271a94a407c0d1a05542929 | https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Controller.php#L76-L83 |
193,539 | Wedeto/DB | src/Query/GroupByClause.php | GroupByClause.toSQL | public function toSQL(Parameters $params, bool $inner_clause)
{
$groups = $this->getGroups();
$having = $this->getHaving();
if (count($groups) === 0)
throw new QueryException("No groups in GROUP BY clause");
$drv = $params->getDriver();
$parts = arr... | php | public function toSQL(Parameters $params, bool $inner_clause)
{
$groups = $this->getGroups();
$having = $this->getHaving();
if (count($groups) === 0)
throw new QueryException("No groups in GROUP BY clause");
$drv = $params->getDriver();
$parts = arr... | [
"public",
"function",
"toSQL",
"(",
"Parameters",
"$",
"params",
",",
"bool",
"$",
"inner_clause",
")",
"{",
"$",
"groups",
"=",
"$",
"this",
"->",
"getGroups",
"(",
")",
";",
"$",
"having",
"=",
"$",
"this",
"->",
"getHaving",
"(",
")",
";",
"if",
... | Write a GROUPBY clause as SQL query syntax
@param Parameters $params The query parameters: tables and placeholder values
@param bool $inner_clause Unused
@return string The generated SQL | [
"Write",
"a",
"GROUPBY",
"clause",
"as",
"SQL",
"query",
"syntax"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/GroupByClause.php#L91-L110 |
193,540 | WellCommerce/CartBundle | Manager/Front/CartProductManager.php | CartProductManager.getCartProductInCart | protected function getCartProductInCart(CartProductInterface $cartProduct, CartInterface $cart)
{
return $this->getRepository()->findOneBy([
'id' => $cartProduct->getId(),
'cart' => $cart
]);
} | php | protected function getCartProductInCart(CartProductInterface $cartProduct, CartInterface $cart)
{
return $this->getRepository()->findOneBy([
'id' => $cartProduct->getId(),
'cart' => $cart
]);
} | [
"protected",
"function",
"getCartProductInCart",
"(",
"CartProductInterface",
"$",
"cartProduct",
",",
"CartInterface",
"$",
"cart",
")",
"{",
"return",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"findOneBy",
"(",
"[",
"'id'",
"=>",
"$",
"cartProduct",
... | Returns an item from cart
@param CartProductInterface $cartProduct
@param CartInterface $cart
@return null|CartProductInterface | [
"Returns",
"an",
"item",
"from",
"cart"
] | 77c1e12b36bde008dca61260481b21135e339396 | https://github.com/WellCommerce/CartBundle/blob/77c1e12b36bde008dca61260481b21135e339396/Manager/Front/CartProductManager.php#L118-L124 |
193,541 | Wedeto/Auth | src/Authentication.php | Authentication.setUserClass | public function setUserClass(string $classname)
{
if (!class_exists($classname) || !is_subclass_of($classname, UserInterface::class))
throw new DomainException("Invalid user class: $classname");
$this->user_class = $classname;
return $this;
} | php | public function setUserClass(string $classname)
{
if (!class_exists($classname) || !is_subclass_of($classname, UserInterface::class))
throw new DomainException("Invalid user class: $classname");
$this->user_class = $classname;
return $this;
} | [
"public",
"function",
"setUserClass",
"(",
"string",
"$",
"classname",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"classname",
")",
"||",
"!",
"is_subclass_of",
"(",
"$",
"classname",
",",
"UserInterface",
"::",
"class",
")",
")",
"throw",
"new",
... | Set the UserInterface class that represents users.
@param string $classname The class to use for users. This should implement
Wedeto\Auth\UserInterface.
@return Wedeto\Auth\Authentication Provides fluent interface | [
"Set",
"the",
"UserInterface",
"class",
"that",
"represents",
"users",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L67-L73 |
193,542 | Wedeto/Auth | src/Authentication.php | Authentication.setGroupClass | public function setGroupClass(string $classname)
{
if (!class_exists($classname) || !is_subclass_of($classname, GroupInterface::class))
throw new DomainException("Invalid group class: $classname");
$this->group_class = $classname;
return $this;
} | php | public function setGroupClass(string $classname)
{
if (!class_exists($classname) || !is_subclass_of($classname, GroupInterface::class))
throw new DomainException("Invalid group class: $classname");
$this->group_class = $classname;
return $this;
} | [
"public",
"function",
"setGroupClass",
"(",
"string",
"$",
"classname",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"classname",
")",
"||",
"!",
"is_subclass_of",
"(",
"$",
"classname",
",",
"GroupInterface",
"::",
"class",
")",
")",
"throw",
"new"... | Set the GroupInterface class that represents groups.
@param string $classname the class to use for gruops. This should implement
Wedeto\Auth\GroupInterface.
@return Wedeto\Auth\Authentication PRovides fluent interface | [
"Set",
"the",
"GroupInterface",
"class",
"that",
"represents",
"groups",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L81-L87 |
193,543 | Wedeto/Auth | src/Authentication.php | Authentication.getUserFromSession | public function getUserFromSession(Session $session)
{
$cl = $this->getUserClass();
$this->user = new $cl;
$this->user->obtainFromSession($session);
return $this->user;
} | php | public function getUserFromSession(Session $session)
{
$cl = $this->getUserClass();
$this->user = new $cl;
$this->user->obtainFromSession($session);
return $this->user;
} | [
"public",
"function",
"getUserFromSession",
"(",
"Session",
"$",
"session",
")",
"{",
"$",
"cl",
"=",
"$",
"this",
"->",
"getUserClass",
"(",
")",
";",
"$",
"this",
"->",
"user",
"=",
"new",
"$",
"cl",
";",
"$",
"this",
"->",
"user",
"->",
"obtainFro... | Obtain the current user from the active session
@param Wedeto\HTTP\Session $session The session object
@return Wedeto\Auth\UserInteface The current user. Can be anonymous if
noone is logged in. | [
"Obtain",
"the",
"current",
"user",
"from",
"the",
"active",
"session"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L139-L145 |
193,544 | Wedeto/Auth | src/Authentication.php | Authentication.getUser | public function getUser(string $userid)
{
$cl = $this->getUserClass();
$user = new $cl;
return $user->obtainByUserID($userid);
} | php | public function getUser(string $userid)
{
$cl = $this->getUserClass();
$user = new $cl;
return $user->obtainByUserID($userid);
} | [
"public",
"function",
"getUser",
"(",
"string",
"$",
"userid",
")",
"{",
"$",
"cl",
"=",
"$",
"this",
"->",
"getUserClass",
"(",
")",
";",
"$",
"user",
"=",
"new",
"$",
"cl",
";",
"return",
"$",
"user",
"->",
"obtainByUserID",
"(",
"$",
"userid",
"... | Obtain a user by its user ID.
@param string $userID The User ID to load
@return Wedeto\Auth\UserInterface The user
@throws Wedeto\Auth\NotFoundException When the user does not exist | [
"Obtain",
"a",
"user",
"by",
"its",
"user",
"ID",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L153-L158 |
193,545 | Wedeto/Auth | src/Authentication.php | Authentication.getGroup | public function getGroup(string $groupid)
{
$cl = $this->getGroupClass();
$group = new $cl;
return $group->obtainByGroupID($groupid);
} | php | public function getGroup(string $groupid)
{
$cl = $this->getGroupClass();
$group = new $cl;
return $group->obtainByGroupID($groupid);
} | [
"public",
"function",
"getGroup",
"(",
"string",
"$",
"groupid",
")",
"{",
"$",
"cl",
"=",
"$",
"this",
"->",
"getGroupClass",
"(",
")",
";",
"$",
"group",
"=",
"new",
"$",
"cl",
";",
"return",
"$",
"group",
"->",
"obtainByGroupID",
"(",
"$",
"groupi... | Obtain a group by its group ID.
@param string $groupid The group ID to load
@return Wedeto\Auth\GroupInterface The loaded group
@throws Wedeto\Auth\NotFoundException When the group does not exist | [
"Obtain",
"a",
"group",
"by",
"its",
"group",
"ID",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L166-L171 |
193,546 | Wedeto/Auth | src/Authentication.php | Authentication.login | public function login(string $username, string $password, Session $session)
{
if ($session->has('authentication', 'user_id'))
{
throw new AuthenticationError(
"Already logged in",
AuthenticationError::DUPLICATE_SESSION
);
}
$cl... | php | public function login(string $username, string $password, Session $session)
{
if ($session->has('authentication', 'user_id'))
{
throw new AuthenticationError(
"Already logged in",
AuthenticationError::DUPLICATE_SESSION
);
}
$cl... | [
"public",
"function",
"login",
"(",
"string",
"$",
"username",
",",
"string",
"$",
"password",
",",
"Session",
"$",
"session",
")",
"{",
"if",
"(",
"$",
"session",
"->",
"has",
"(",
"'authentication'",
",",
"'user_id'",
")",
")",
"{",
"throw",
"new",
"... | Check if the provided details contain a valid login.
@param string $username The user to log in
@param string $password The password to verify
@param Wedeto\HTTP\Session $session The session to log into
@throws Wedeto\Auth\AuthenticationError When logging in fails
@return Wedeto\Auth\UserInterface The logged in user | [
"Check",
"if",
"the",
"provided",
"details",
"contain",
"a",
"valid",
"login",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L189-L216 |
193,547 | Wedeto/Auth | src/Authentication.php | Authentication.hash | public function hash(string $password)
{
$algorithm = $this->config->dget('algorithm', PASSWORD_DEFAULT);
$options['cost'] = $this->config->dget('cost', 10);
return password_hash($password, $algorithm, $options);
} | php | public function hash(string $password)
{
$algorithm = $this->config->dget('algorithm', PASSWORD_DEFAULT);
$options['cost'] = $this->config->dget('cost', 10);
return password_hash($password, $algorithm, $options);
} | [
"public",
"function",
"hash",
"(",
"string",
"$",
"password",
")",
"{",
"$",
"algorithm",
"=",
"$",
"this",
"->",
"config",
"->",
"dget",
"(",
"'algorithm'",
",",
"PASSWORD_DEFAULT",
")",
";",
"$",
"options",
"[",
"'cost'",
"]",
"=",
"$",
"this",
"->",... | Create a hash of the password
@param string $password The password to hash
@return string The hashed password | [
"Create",
"a",
"hash",
"of",
"the",
"password"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L223-L229 |
193,548 | Wedeto/Auth | src/Authentication.php | Authentication.verify | public function verify(string $password, string $hash)
{
if (substr($hash, 0, 1) !== "$")
{
$salt = $this->config->dget('salt', '');
$append = $this->config->dget('salt_placement', 'append') === 'append';
$to_hash = $append ? $password . $salt : $salt . $password;... | php | public function verify(string $password, string $hash)
{
if (substr($hash, 0, 1) !== "$")
{
$salt = $this->config->dget('salt', '');
$append = $this->config->dget('salt_placement', 'append') === 'append';
$to_hash = $append ? $password . $salt : $salt . $password;... | [
"public",
"function",
"verify",
"(",
"string",
"$",
"password",
",",
"string",
"$",
"hash",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"hash",
",",
"0",
",",
"1",
")",
"!==",
"\"$\"",
")",
"{",
"$",
"salt",
"=",
"$",
"this",
"->",
"config",
"->",
... | Check if the password matches the provided hash. The password
should come from user input, the hash from persistent storage.
@param string $password The password to verify
@param string $hash The hash of the correct password
@return bool True if the password matches the hash, false if it does
not. | [
"Check",
"if",
"the",
"password",
"matches",
"the",
"provided",
"hash",
".",
"The",
"password",
"should",
"come",
"from",
"user",
"input",
"the",
"hash",
"from",
"persistent",
"storage",
"."
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L239-L251 |
193,549 | Wedeto/Auth | src/Authentication.php | Authentication.needsRehash | public function needsRehash(string $hash)
{
if (substr($hash, 0, 1) !== "$")
return true;
$algorithm = $this->config->dget('algorithm', PASSWORD_DEFAULT);
$options['cost'] = $this->config->dget('cost', 10);
return password_needs_rehash($hash, $algorithm, $options);
} | php | public function needsRehash(string $hash)
{
if (substr($hash, 0, 1) !== "$")
return true;
$algorithm = $this->config->dget('algorithm', PASSWORD_DEFAULT);
$options['cost'] = $this->config->dget('cost', 10);
return password_needs_rehash($hash, $algorithm, $options);
} | [
"public",
"function",
"needsRehash",
"(",
"string",
"$",
"hash",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"hash",
",",
"0",
",",
"1",
")",
"!==",
"\"$\"",
")",
"return",
"true",
";",
"$",
"algorithm",
"=",
"$",
"this",
"->",
"config",
"->",
"dget",... | Check if the password needs a rehash
@param string $hash The hash to check
@return bool True if the password needs to be rehashed, false if not | [
"Check",
"if",
"the",
"password",
"needs",
"a",
"rehash"
] | d53777d860a9e67154b84b425e29da5d4dcd28e0 | https://github.com/Wedeto/Auth/blob/d53777d860a9e67154b84b425e29da5d4dcd28e0/src/Authentication.php#L258-L266 |
193,550 | joegreen88/zf1-component-validate | src/Zend/Validate/Barcode/Upce.php | Zend_Validate_Barcode_Upce.checkLength | public function checkLength($value)
{
if (strlen($value) != 8) {
$this->setCheck(false);
} else {
$this->setCheck(true);
}
return parent::checkLength($value);
} | php | public function checkLength($value)
{
if (strlen($value) != 8) {
$this->setCheck(false);
} else {
$this->setCheck(true);
}
return parent::checkLength($value);
} | [
"public",
"function",
"checkLength",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"value",
")",
"!=",
"8",
")",
"{",
"$",
"this",
"->",
"setCheck",
"(",
"false",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setCheck",
"(",
"true... | Overrides parent checkLength
@param string $value Value
@return boolean | [
"Overrides",
"parent",
"checkLength"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/Barcode/Upce.php#L59-L68 |
193,551 | gilbertsoft/typo3-gswarranty | Classes/Backend/ToolbarItems/WarrantyLinkToolbarItem.php | WarrantyLinkToolbarItem.getFluidTemplateObject | protected function getFluidTemplateObject($filename)
{
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']);
if (\Gilbertsoft\Warranty\Utility\Adapter::isCompatVersion('8.7')) {
$view->setPartialRootPath... | php | protected function getFluidTemplateObject($filename)
{
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']);
if (\Gilbertsoft\Warranty\Utility\Adapter::isCompatVersion('8.7')) {
$view->setPartialRootPath... | [
"protected",
"function",
"getFluidTemplateObject",
"(",
"$",
"filename",
")",
"{",
"$",
"view",
"=",
"GeneralUtility",
"::",
"makeInstance",
"(",
"StandaloneView",
"::",
"class",
")",
";",
"$",
"view",
"->",
"setLayoutRootPaths",
"(",
"[",
"'EXT:backend/Resources/... | Returns a new standalone view, shorthand function
@param string $filename Which templateFile should be used.
@return StandaloneView | [
"Returns",
"a",
"new",
"standalone",
"view",
"shorthand",
"function"
] | 2026dd04e6df9db61b56df3860e1f3462db54c69 | https://github.com/gilbertsoft/typo3-gswarranty/blob/2026dd04e6df9db61b56df3860e1f3462db54c69/Classes/Backend/ToolbarItems/WarrantyLinkToolbarItem.php#L100-L119 |
193,552 | Erebot/Module_Wordlists | src/Wordlists/Wordlist.php | Wordlist.parseFile | protected function parseFile($file)
{
$this->file = $file;
// When running as a PHAR, copy the SQLite database
// to a temporary file. Required as the SQLite3 driver
// does not support streams (and it can"t, see #55154).
if (!strncasecmp(__FILE__, 'phar://', 7)) {
... | php | protected function parseFile($file)
{
$this->file = $file;
// When running as a PHAR, copy the SQLite database
// to a temporary file. Required as the SQLite3 driver
// does not support streams (and it can"t, see #55154).
if (!strncasecmp(__FILE__, 'phar://', 7)) {
... | [
"protected",
"function",
"parseFile",
"(",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"file",
"=",
"$",
"file",
";",
"// When running as a PHAR, copy the SQLite database",
"// to a temporary file. Required as the SQLite3 driver",
"// does not support streams (and it can\"t, see #5... | Parse the content of a SQLite file representing
a list of words.
\param string $file
The full path to the SQLite file containing
the list of words to use.
\throw Erebot::InvalidValueException
The locale indicated in the file was invalid. | [
"Parse",
"the",
"content",
"of",
"a",
"SQLite",
"file",
"representing",
"a",
"list",
"of",
"words",
"."
] | 121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7 | https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists/Wordlist.php#L145-L210 |
193,553 | Erebot/Module_Wordlists | src/Wordlists/Wordlist.php | Wordlist.count | public function count()
{
$this->countQuery->execute();
$res = $this->countQuery->fetchColumn();
$this->countQuery->closeCursor();
return (int) $res;
} | php | public function count()
{
$this->countQuery->execute();
$res = $this->countQuery->fetchColumn();
$this->countQuery->closeCursor();
return (int) $res;
} | [
"public",
"function",
"count",
"(",
")",
"{",
"$",
"this",
"->",
"countQuery",
"->",
"execute",
"(",
")",
";",
"$",
"res",
"=",
"$",
"this",
"->",
"countQuery",
"->",
"fetchColumn",
"(",
")",
";",
"$",
"this",
"->",
"countQuery",
"->",
"closeCursor",
... | Returns the number of words in the list.
\retval int
Number of words in the list. | [
"Returns",
"the",
"number",
"of",
"words",
"in",
"the",
"list",
"."
] | 121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7 | https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists/Wordlist.php#L238-L244 |
193,554 | Erebot/Module_Wordlists | src/Wordlists/Wordlist.php | Wordlist.findWord | public function findWord($word)
{
$key = $this->collator->getSortKey($word);
/* In intl > 3.0.0a1, the key now ends with a trailing NUL byte.
* We remove it for backward-compatibility with older releases. */
if (substr($key, -1) === "\0") {
$key = substr($key, 0, -1);
... | php | public function findWord($word)
{
$key = $this->collator->getSortKey($word);
/* In intl > 3.0.0a1, the key now ends with a trailing NUL byte.
* We remove it for backward-compatibility with older releases. */
if (substr($key, -1) === "\0") {
$key = substr($key, 0, -1);
... | [
"public",
"function",
"findWord",
"(",
"$",
"word",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"collator",
"->",
"getSortKey",
"(",
"$",
"word",
")",
";",
"/* In intl > 3.0.0a1, the key now ends with a trailing NUL byte.\n * We remove it for backward-compatibil... | Look for a word in the list.
\param string $word
The word to look for.
\retval mixed
If the given word was found, it is returned
as it appears in the list (this may include
case or accentuation variations).
Otherwise, \b null is returned. | [
"Look",
"for",
"a",
"word",
"in",
"the",
"list",
"."
] | 121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7 | https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists/Wordlist.php#L258-L275 |
193,555 | Erebot/Module_Wordlists | src/Wordlists/Wordlist.php | Wordlist.offsetGet | public function offsetGet($offset)
{
if (!is_int($offset)) {
throw new \Erebot\InvalidValueException('An integer was expected');
}
$this->getQuery->execute(array(':offset' => $offset));
$res = $this->getQuery->fetchColumn();
$this->getQuery->closeCursor();
... | php | public function offsetGet($offset)
{
if (!is_int($offset)) {
throw new \Erebot\InvalidValueException('An integer was expected');
}
$this->getQuery->execute(array(':offset' => $offset));
$res = $this->getQuery->fetchColumn();
$this->getQuery->closeCursor();
... | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"InvalidValueException",
"(",
"'An integer was expected'",
")",
";",
"}",
"$",
"this",
"->... | Returns the word at the given offset.
\param int $offset
Offset of the word to retrieve.
\retval string
The word at the given $offset.
\throw Erebot::InvalidValueException
The given offset is not an integer. | [
"Returns",
"the",
"word",
"at",
"the",
"given",
"offset",
"."
] | 121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7 | https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists/Wordlist.php#L308-L322 |
193,556 | Erebot/Module_Wordlists | src/Wordlists/Wordlist.php | Wordlist.getMetadata | public function getMetadata($type)
{
// Handle special cases here: name and path to file.
if ($type == self::METADATA_NAME) {
return $this->name;
}
if ($type == self::METADATA_FILE) {
return $this->file;
}
if (!array_key_exists($type, $this->m... | php | public function getMetadata($type)
{
// Handle special cases here: name and path to file.
if ($type == self::METADATA_NAME) {
return $this->name;
}
if ($type == self::METADATA_FILE) {
return $this->file;
}
if (!array_key_exists($type, $this->m... | [
"public",
"function",
"getMetadata",
"(",
"$",
"type",
")",
"{",
"// Handle special cases here: name and path to file.",
"if",
"(",
"$",
"type",
"==",
"self",
"::",
"METADATA_NAME",
")",
"{",
"return",
"$",
"this",
"->",
"name",
";",
"}",
"if",
"(",
"$",
"ty... | Returns metadata associated with the list.
\param string $type
Type of metadata to return. See the constants
named METADATA_* from this class for valid types.
\retval mixed
The requested metadata. This is a string for types
that accept a single value (or \b null if the list does
not provide any value) or an array for... | [
"Returns",
"metadata",
"associated",
"with",
"the",
"list",
"."
] | 121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7 | https://github.com/Erebot/Module_Wordlists/blob/121d1cc72619ec0be2ddf0f3d6a66bac0a5bd1b7/src/Wordlists/Wordlist.php#L342-L358 |
193,557 | irfantoor/database | src/Database/AbstractDatabase.php | AbstractDatabase.insert | public function insert($q, $data)
{
if (is_string($q)) {
$this->defaults['table'] = $q;
$q = [];
}
extract($this->defaults);
extract($q);
if (!$table)
throw new Exception("table [$tabel] not defined", 1);
$sql = 'INSERT INTO ' . ... | php | public function insert($q, $data)
{
if (is_string($q)) {
$this->defaults['table'] = $q;
$q = [];
}
extract($this->defaults);
extract($q);
if (!$table)
throw new Exception("table [$tabel] not defined", 1);
$sql = 'INSERT INTO ' . ... | [
"public",
"function",
"insert",
"(",
"$",
"q",
",",
"$",
"data",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"q",
")",
")",
"{",
"$",
"this",
"->",
"defaults",
"[",
"'table'",
"]",
"=",
"$",
"q",
";",
"$",
"q",
"=",
"[",
"]",
";",
"}",
"ext... | inserts a record
@param string|array $q name of table or array containg additional
information as well
@param array $data associative array with binding data | [
"inserts",
"a",
"record"
] | 0e01e2f265b95f17b1a888137c4364714c367128 | https://github.com/irfantoor/database/blob/0e01e2f265b95f17b1a888137c4364714c367128/src/Database/AbstractDatabase.php#L102-L119 |
193,558 | irfantoor/database | src/Database/AbstractDatabase.php | AbstractDatabase.query | public function query($sql, $data = [])
{
$this->_init();
try {
$q = $this->db->prepare($sql);
} catch (PDOException $e) {
throw new Exception($e->getMessage());
}
foreach ($data as $k => $v) {
$$k = $v;
$q->bindPara... | php | public function query($sql, $data = [])
{
$this->_init();
try {
$q = $this->db->prepare($sql);
} catch (PDOException $e) {
throw new Exception($e->getMessage());
}
foreach ($data as $k => $v) {
$$k = $v;
$q->bindPara... | [
"public",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"_init",
"(",
")",
";",
"try",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"db",
"->",
"prepare",
"(",
"$",
"sql",
")",
";",
"}",
"catc... | Verifies if a condition can return records
@param string $where | [
"Verifies",
"if",
"a",
"condition",
"can",
"return",
"records"
] | 0e01e2f265b95f17b1a888137c4364714c367128 | https://github.com/irfantoor/database/blob/0e01e2f265b95f17b1a888137c4364714c367128/src/Database/AbstractDatabase.php#L197-L223 |
193,559 | koolkode/context | src/Scope/ScopedProxyGenerator.php | ScopedProxyGenerator.generateProxyCode | public function generateProxyCode(\ReflectionClass $ref)
{
$methods = $this->collectProxyMethods($ref);
$implements = ['\KoolKode\Context\Scope\ScopedProxyInterface'];
$code = 'namespace ' . $ref->getNamespaceName() . ' { ';
$code .= 'if(!class_exists(' . var_export($ref->name . '__scoped', true) . ', fal... | php | public function generateProxyCode(\ReflectionClass $ref)
{
$methods = $this->collectProxyMethods($ref);
$implements = ['\KoolKode\Context\Scope\ScopedProxyInterface'];
$code = 'namespace ' . $ref->getNamespaceName() . ' { ';
$code .= 'if(!class_exists(' . var_export($ref->name . '__scoped', true) . ', fal... | [
"public",
"function",
"generateProxyCode",
"(",
"\\",
"ReflectionClass",
"$",
"ref",
")",
"{",
"$",
"methods",
"=",
"$",
"this",
"->",
"collectProxyMethods",
"(",
"$",
"ref",
")",
";",
"$",
"implements",
"=",
"[",
"'\\KoolKode\\Context\\Scope\\ScopedProxyInterface... | Generates the PHP code of a scoped proxy for the given type.
@param \ReflectionClass $type
@return string | [
"Generates",
"the",
"PHP",
"code",
"of",
"a",
"scoped",
"proxy",
"for",
"the",
"given",
"type",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Scope/ScopedProxyGenerator.php#L31-L89 |
193,560 | koolkode/context | src/Scope/ScopedProxyGenerator.php | ScopedProxyGenerator.collectProxyMethods | protected function collectProxyMethods(\ReflectionClass $ref)
{
$methods = [];
foreach($ref->getMethods() as $method)
{
if($method->isStatic() || $method->isPrivate())
{
continue;
}
if(substr($method->getName(), 0, 2) == '__')
{
continue;
}
if($method->isFinal())
{
... | php | protected function collectProxyMethods(\ReflectionClass $ref)
{
$methods = [];
foreach($ref->getMethods() as $method)
{
if($method->isStatic() || $method->isPrivate())
{
continue;
}
if(substr($method->getName(), 0, 2) == '__')
{
continue;
}
if($method->isFinal())
{
... | [
"protected",
"function",
"collectProxyMethods",
"(",
"\\",
"ReflectionClass",
"$",
"ref",
")",
"{",
"$",
"methods",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"ref",
"->",
"getMethods",
"(",
")",
"as",
"$",
"method",
")",
"{",
"if",
"(",
"$",
"method",
... | Collects all public instance methods of the given type using reflection.
@param \ReflectionClass $ref
@return array<string, \ReflectionMethod>
@throws ScopedProxyException | [
"Collects",
"all",
"public",
"instance",
"methods",
"of",
"the",
"given",
"type",
"using",
"reflection",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Scope/ScopedProxyGenerator.php#L99-L124 |
193,561 | fulgurio/LightCMSBundle | DataFixtures/ORM/LoadHomePage.php | LoadHomePage.addMeta | private function addMeta($page, $key, $value)
{
$meta = new PageMeta();
$meta->setMetaKey($key);
$meta->setMetaValue($value);
$meta->setPage($page);
return $meta;
} | php | private function addMeta($page, $key, $value)
{
$meta = new PageMeta();
$meta->setMetaKey($key);
$meta->setMetaValue($value);
$meta->setPage($page);
return $meta;
} | [
"private",
"function",
"addMeta",
"(",
"$",
"page",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"meta",
"=",
"new",
"PageMeta",
"(",
")",
";",
"$",
"meta",
"->",
"setMetaKey",
"(",
"$",
"key",
")",
";",
"$",
"meta",
"->",
"setMetaValue",
"... | Add meta to page
@param \Fulgurio\LightCMSBundle\Entity\Page $page
@param string $key
@param string $value
@return \Fulgurio\LightCMSBundle\Entity\PageMeta | [
"Add",
"meta",
"to",
"page"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/DataFixtures/ORM/LoadHomePage.php#L64-L71 |
193,562 | PenoaksDev/Milky-Framework | src/Milky/Cache/RedisTaggedCache.php | RedisTaggedCache.pushKeys | protected function pushKeys( $namespace, $key, $reference )
{
$fullKey = $this->getPrefix() . sha1( $namespace ) . ':' . $key;
foreach ( explode( '|', $namespace ) as $segment )
{
$this->store->connection()->sadd( $this->referenceKey( $segment, $reference ), $fullKey );
}
} | php | protected function pushKeys( $namespace, $key, $reference )
{
$fullKey = $this->getPrefix() . sha1( $namespace ) . ':' . $key;
foreach ( explode( '|', $namespace ) as $segment )
{
$this->store->connection()->sadd( $this->referenceKey( $segment, $reference ), $fullKey );
}
} | [
"protected",
"function",
"pushKeys",
"(",
"$",
"namespace",
",",
"$",
"key",
",",
"$",
"reference",
")",
"{",
"$",
"fullKey",
"=",
"$",
"this",
"->",
"getPrefix",
"(",
")",
".",
"sha1",
"(",
"$",
"namespace",
")",
".",
"':'",
".",
"$",
"key",
";",
... | Store a reference to the cache key against the reference key.
@param string $namespace
@param string $key
@param string $reference | [
"Store",
"a",
"reference",
"to",
"the",
"cache",
"key",
"against",
"the",
"reference",
"key",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Cache/RedisTaggedCache.php#L86-L94 |
193,563 | mvccore/ext-router-media | src/MvcCore/Ext/Routers/Media/UrlByRouteSectionsMedia.php | UrlByRouteSectionsMedia.urlByRouteSectionsMedia | protected function urlByRouteSectionsMedia (\MvcCore\IRoute & $route, array & $params = [], array & $defaultParams = [], $routeMethod = NULL) {
// separate `$mediaSiteVersion` from `$params` to work with the version more specifically
$mediaVersionUrlParam = static::URL_PARAM_MEDIA_VERSION;
if (isset($params[$medi... | php | protected function urlByRouteSectionsMedia (\MvcCore\IRoute & $route, array & $params = [], array & $defaultParams = [], $routeMethod = NULL) {
// separate `$mediaSiteVersion` from `$params` to work with the version more specifically
$mediaVersionUrlParam = static::URL_PARAM_MEDIA_VERSION;
if (isset($params[$medi... | [
"protected",
"function",
"urlByRouteSectionsMedia",
"(",
"\\",
"MvcCore",
"\\",
"IRoute",
"&",
"$",
"route",
",",
"array",
"&",
"$",
"params",
"=",
"[",
"]",
",",
"array",
"&",
"$",
"defaultParams",
"=",
"[",
"]",
",",
"$",
"routeMethod",
"=",
"NULL",
... | Return media site version for result URL as media site version param name
string and media site version param value string.
If media site version is specified in given params array, return this
media site version. If there is not any specific media site version in
params array, try to look into given default params ar... | [
"Return",
"media",
"site",
"version",
"for",
"result",
"URL",
"as",
"media",
"site",
"version",
"param",
"name",
"string",
"and",
"media",
"site",
"version",
"param",
"value",
"string",
"."
] | 976e83290cf25ad6bc32e4824790b5e0d5d4c08b | https://github.com/mvccore/ext-router-media/blob/976e83290cf25ad6bc32e4824790b5e0d5d4c08b/src/MvcCore/Ext/Routers/Media/UrlByRouteSectionsMedia.php#L36-L70 |
193,564 | bseries/cms_core | extensions/helper/Editor.php | Editor.field | public function field($name, array $options = []) {
$options += [
'features' => null,
'size' => 'beta',
'help' => true
];
$classes = [];
$classes[] = 'use-editor';
$classes[] = 'editor-size--' . $options['size'];
if (is_string($options['features'])) {
$options['features'] = Settings::read('edi... | php | public function field($name, array $options = []) {
$options += [
'features' => null,
'size' => 'beta',
'help' => true
];
$classes = [];
$classes[] = 'use-editor';
$classes[] = 'editor-size--' . $options['size'];
if (is_string($options['features'])) {
$options['features'] = Settings::read('edi... | [
"public",
"function",
"field",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'features'",
"=>",
"null",
",",
"'size'",
"=>",
"'beta'",
",",
"'help'",
"=>",
"true",
"]",
";",
"$",
"classes",
"="... | as `features`. | [
"as",
"features",
"."
] | 5a2b861de6916cad83512d20f790068ffa41319e | https://github.com/bseries/cms_core/blob/5a2b861de6916cad83512d20f790068ffa41319e/extensions/helper/Editor.php#L26-L74 |
193,565 | MindyPHP/OrmNestedSet | TreeModel.php | TreeModel.save | public function save(array $fields = [])
{
if ($this->getIsNewRecord()) {
if ($this->parent) {
$this->appendTo($this->parent);
} else {
$this->makeRoot();
}
return parent::save($fields);
}
if (in_array('parent_... | php | public function save(array $fields = [])
{
if ($this->getIsNewRecord()) {
if ($this->parent) {
$this->appendTo($this->parent);
} else {
$this->makeRoot();
}
return parent::save($fields);
}
if (in_array('parent_... | [
"public",
"function",
"save",
"(",
"array",
"$",
"fields",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getIsNewRecord",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parent",
")",
"{",
"$",
"this",
"->",
"appendTo",
"(",
"$",
"... | Create root node if multiple-root tree mode. Update node if it's not new.
@param array $fields
@throws \Exception
@return bool whether the saving succeeds | [
"Create",
"root",
"node",
"if",
"multiple",
"-",
"root",
"tree",
"mode",
".",
"Update",
"node",
"if",
"it",
"s",
"not",
"new",
"."
] | 8231c55f9b95314789983c0b0ec83a9eb70adf79 | https://github.com/MindyPHP/OrmNestedSet/blob/8231c55f9b95314789983c0b0ec83a9eb70adf79/TreeModel.php#L112-L147 |
193,566 | MindyPHP/OrmNestedSet | TreeModel.php | TreeModel.moveAsRoot | public function moveAsRoot()
{
if ($this->getIsNewRecord()) {
throw new Exception('The node should not be new record.');
}
if ($this->isRoot()) {
throw new Exception('The node already is root node.');
}
$delta = 1 - $this->lft;
$this
... | php | public function moveAsRoot()
{
if ($this->getIsNewRecord()) {
throw new Exception('The node should not be new record.');
}
if ($this->isRoot()) {
throw new Exception('The node already is root node.');
}
$delta = 1 - $this->lft;
$this
... | [
"public",
"function",
"moveAsRoot",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getIsNewRecord",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The node should not be new record.'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isRoot",
"(",
"... | Move node as new root.
@throws Exception
@throws \Exception
@return $this | [
"Move",
"node",
"as",
"new",
"root",
"."
] | 8231c55f9b95314789983c0b0ec83a9eb70adf79 | https://github.com/MindyPHP/OrmNestedSet/blob/8231c55f9b95314789983c0b0ec83a9eb70adf79/TreeModel.php#L317-L346 |
193,567 | MindyPHP/OrmNestedSet | TreeModel.php | TreeModel.isDescendantOf | public function isDescendantOf($subj)
{
return ($this->lft > $subj->lft) && ($this->rgt < $subj->rgt) && ($this->root === $subj->root);
} | php | public function isDescendantOf($subj)
{
return ($this->lft > $subj->lft) && ($this->rgt < $subj->rgt) && ($this->root === $subj->root);
} | [
"public",
"function",
"isDescendantOf",
"(",
"$",
"subj",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"lft",
">",
"$",
"subj",
"->",
"lft",
")",
"&&",
"(",
"$",
"this",
"->",
"rgt",
"<",
"$",
"subj",
"->",
"rgt",
")",
"&&",
"(",
"$",
"this",
"-... | Determines if node is descendant of subject node.
@param TreeModel $subj the subject node
@return bool whether the node is descendant of subject node | [
"Determines",
"if",
"node",
"is",
"descendant",
"of",
"subject",
"node",
"."
] | 8231c55f9b95314789983c0b0ec83a9eb70adf79 | https://github.com/MindyPHP/OrmNestedSet/blob/8231c55f9b95314789983c0b0ec83a9eb70adf79/TreeModel.php#L355-L358 |
193,568 | Fenzland/http-api-gluer | src/Gluer/TMakeInstance_.php | TMakeInstance_.make_ | static public function make_(
string $url
,
string $method
,
array $request_transformer_meta
,
array $response_transformer_meta
,
string $request_content_type
,
string $response_content_type= null
):self
{
return new static(
$url
,
$method
,
Transformer::make_( $request_transformer_m... | php | static public function make_(
string $url
,
string $method
,
array $request_transformer_meta
,
array $response_transformer_meta
,
string $request_content_type
,
string $response_content_type= null
):self
{
return new static(
$url
,
$method
,
Transformer::make_( $request_transformer_m... | [
"static",
"public",
"function",
"make_",
"(",
"string",
"$",
"url",
",",
"string",
"$",
"method",
",",
"array",
"$",
"request_transformer_meta",
",",
"array",
"$",
"response_transformer_meta",
",",
"string",
"$",
"request_content_type",
",",
"string",
"$",
"resp... | Static method make_
@static
@access public
@param string $url
@param string $method
@param array $request_transformer_meta
@param array $response_transformer_meta
@param string $request_content_type
@param string $response_content_type
@return self | [
"Static",
"method",
"make_"
] | 3488de28b7f54fb444ec47f84034473a7d86e17e | https://github.com/Fenzland/http-api-gluer/blob/3488de28b7f54fb444ec47f84034473a7d86e17e/src/Gluer/TMakeInstance_.php#L29-L56 |
193,569 | raframework/rapkg | src/Rapkg/Retry/Retry.php | Retry.checkOptions | private static function checkOptions($options)
{
if (!isset($options['retries']) || !is_int($options['retries']) || $options['retries'] <= 0) {
throw new \InvalidArgumentException(
'retry: the options.retries must be an integer with a positive value'
);
}
... | php | private static function checkOptions($options)
{
if (!isset($options['retries']) || !is_int($options['retries']) || $options['retries'] <= 0) {
throw new \InvalidArgumentException(
'retry: the options.retries must be an integer with a positive value'
);
}
... | [
"private",
"static",
"function",
"checkOptions",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'retries'",
"]",
")",
"||",
"!",
"is_int",
"(",
"$",
"options",
"[",
"'retries'",
"]",
")",
"||",
"$",
"options",
"[",... | Check the options, throw an `InvalidArgumentException` on invalid format value.
@param $options
@throws \InvalidArgumentException | [
"Check",
"the",
"options",
"throw",
"an",
"InvalidArgumentException",
"on",
"invalid",
"format",
"value",
"."
] | 7c4371911369d7c9d4463127bcd285144d7347ee | https://github.com/raframework/rapkg/blob/7c4371911369d7c9d4463127bcd285144d7347ee/src/Rapkg/Retry/Retry.php#L82-L94 |
193,570 | kherge-abandoned/Entities | src/lib/KevinGH/Entities/EntitiesServiceProvider.php | EntitiesServiceProvider.createCache | public function createCache(Application $app)
{
$cache = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$cache[$name] = $cache->share(
function () use ($app, $cache, $options) {
$class = 'Doctrine\Common\Cache\\' . $options['caching_... | php | public function createCache(Application $app)
{
$cache = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$cache[$name] = $cache->share(
function () use ($app, $cache, $options) {
$class = 'Doctrine\Common\Cache\\' . $options['caching_... | [
"public",
"function",
"createCache",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"cache",
"=",
"new",
"Pimple",
";",
"foreach",
"(",
"$",
"app",
"[",
"'ems.options'",
"]",
"as",
"$",
"name",
"=>",
"$",
"options",
")",
"{",
"$",
"cache",
"[",
"$",
... | Creates the cache instances for the entity managers.
@param Application $app The application.
@return Pimple The cache instance manager. | [
"Creates",
"the",
"cache",
"instances",
"for",
"the",
"entity",
"managers",
"."
] | 0d8558a437c7390b50b6b4b617037766465bb12f | https://github.com/kherge-abandoned/Entities/blob/0d8558a437c7390b50b6b4b617037766465bb12f/src/lib/KevinGH/Entities/EntitiesServiceProvider.php#L43-L101 |
193,571 | kherge-abandoned/Entities | src/lib/KevinGH/Entities/EntitiesServiceProvider.php | EntitiesServiceProvider.createConfig | public function createConfig(Application $app)
{
$config = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$config[$name] = $config->share(
function () use ($app, $name, $options) {
$config = new Configuration;
$c... | php | public function createConfig(Application $app)
{
$config = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$config[$name] = $config->share(
function () use ($app, $name, $options) {
$config = new Configuration;
$c... | [
"public",
"function",
"createConfig",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"config",
"=",
"new",
"Pimple",
";",
"foreach",
"(",
"$",
"app",
"[",
"'ems.options'",
"]",
"as",
"$",
"name",
"=>",
"$",
"options",
")",
"{",
"$",
"config",
"[",
"$... | Creates the configuration instances for the entity managers.
@param Application $app The application.
@return Pimple The config instance manager. | [
"Creates",
"the",
"configuration",
"instances",
"for",
"the",
"entity",
"managers",
"."
] | 0d8558a437c7390b50b6b4b617037766465bb12f | https://github.com/kherge-abandoned/Entities/blob/0d8558a437c7390b50b6b4b617037766465bb12f/src/lib/KevinGH/Entities/EntitiesServiceProvider.php#L110-L135 |
193,572 | kherge-abandoned/Entities | src/lib/KevinGH/Entities/EntitiesServiceProvider.php | EntitiesServiceProvider.createEntityManager | public function createEntityManager(Application $app)
{
$ems = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$ems[$name] = $ems->share(
function () use ($app, $name, $options) {
if (false === isset($options['db'])) {
... | php | public function createEntityManager(Application $app)
{
$ems = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$ems[$name] = $ems->share(
function () use ($app, $name, $options) {
if (false === isset($options['db'])) {
... | [
"public",
"function",
"createEntityManager",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"ems",
"=",
"new",
"Pimple",
";",
"foreach",
"(",
"$",
"app",
"[",
"'ems.options'",
"]",
"as",
"$",
"name",
"=>",
"$",
"options",
")",
"{",
"$",
"ems",
"[",
"... | Creates the entity manager instances.
@param Application $app The application.
@return Pimple The entity manager instance manager. | [
"Creates",
"the",
"entity",
"manager",
"instances",
"."
] | 0d8558a437c7390b50b6b4b617037766465bb12f | https://github.com/kherge-abandoned/Entities/blob/0d8558a437c7390b50b6b4b617037766465bb12f/src/lib/KevinGH/Entities/EntitiesServiceProvider.php#L144-L186 |
193,573 | kherge-abandoned/Entities | src/lib/KevinGH/Entities/EntitiesServiceProvider.php | EntitiesServiceProvider.createMapping | public function createMapping(Application $app)
{
$mapping = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$mapping[$name] = $mapping->share(
function () use ($app, $options) {
$class = 'Doctrine\ORM\Mapping\Driver\\'
... | php | public function createMapping(Application $app)
{
$mapping = new Pimple;
foreach ($app['ems.options'] as $name => $options) {
$mapping[$name] = $mapping->share(
function () use ($app, $options) {
$class = 'Doctrine\ORM\Mapping\Driver\\'
... | [
"public",
"function",
"createMapping",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"mapping",
"=",
"new",
"Pimple",
";",
"foreach",
"(",
"$",
"app",
"[",
"'ems.options'",
"]",
"as",
"$",
"name",
"=>",
"$",
"options",
")",
"{",
"$",
"mapping",
"[",
... | Creates the mapping instances for the entity managers.
@param Application $app The application.
@return Pimple The mapping instance manager. | [
"Creates",
"the",
"mapping",
"instances",
"for",
"the",
"entity",
"managers",
"."
] | 0d8558a437c7390b50b6b4b617037766465bb12f | https://github.com/kherge-abandoned/Entities/blob/0d8558a437c7390b50b6b4b617037766465bb12f/src/lib/KevinGH/Entities/EntitiesServiceProvider.php#L195-L234 |
193,574 | sndsgd/sndsgd-event | src/event/Handler.php | Handler.canHandle | public function canHandle($type, $namespace)
{
# no type; namespace must match
if ($type === null) {
if ($this->namespace === null || $namespace !== $this->namespace) {
return false;
}
}
else {
if ($this->type !== $type) {
return false;
... | php | public function canHandle($type, $namespace)
{
# no type; namespace must match
if ($type === null) {
if ($this->namespace === null || $namespace !== $this->namespace) {
return false;
}
}
else {
if ($this->type !== $type) {
return false;
... | [
"public",
"function",
"canHandle",
"(",
"$",
"type",
",",
"$",
"namespace",
")",
"{",
"# no type; namespace must match",
"if",
"(",
"$",
"type",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"namespace",
"===",
"null",
"||",
"$",
"namespace",
"!... | Determine if the handler can handle an event type and namespace
@param string|null $type An event type
@param string|null $namespace An event namespace
@return boolean | [
"Determine",
"if",
"the",
"handler",
"can",
"handle",
"an",
"event",
"type",
"and",
"namespace"
] | 531bd348fd77db6a27346aa6dfec43e99ecd3eef | https://github.com/sndsgd/sndsgd-event/blob/531bd348fd77db6a27346aa6dfec43e99ecd3eef/src/event/Handler.php#L38-L59 |
193,575 | phpffcms/ffcms-core | src/App.php | App.loadNativeServices | private function loadNativeServices(): void
{
// initialize memory and properties controllers
self::$Memory = MemoryObject::instance();
self::$Properties = new Properties();
// initialize debugger
if (isset($this->_services['Debug']) && $this->_services['Debug'] === true && D... | php | private function loadNativeServices(): void
{
// initialize memory and properties controllers
self::$Memory = MemoryObject::instance();
self::$Properties = new Properties();
// initialize debugger
if (isset($this->_services['Debug']) && $this->_services['Debug'] === true && D... | [
"private",
"function",
"loadNativeServices",
"(",
")",
":",
"void",
"{",
"// initialize memory and properties controllers",
"self",
"::",
"$",
"Memory",
"=",
"MemoryObject",
"::",
"instance",
"(",
")",
";",
"self",
"::",
"$",
"Properties",
"=",
"new",
"Properties"... | Prepare native static symbolic links for app services
@throws NativeException | [
"Prepare",
"native",
"static",
"symbolic",
"links",
"for",
"app",
"services"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/App.php#L123-L147 |
193,576 | phpffcms/ffcms-core | src/App.php | App.loadDynamicServices | private function loadDynamicServices(): void
{
$this->startMeasure(__METHOD__);
/** @var array $objects */
$objects = App::$Properties->getAll('object');
if (!Any::isArray($objects)) {
throw new NativeException('Object configurations is not loaded: /Private/Config/Object... | php | private function loadDynamicServices(): void
{
$this->startMeasure(__METHOD__);
/** @var array $objects */
$objects = App::$Properties->getAll('object');
if (!Any::isArray($objects)) {
throw new NativeException('Object configurations is not loaded: /Private/Config/Object... | [
"private",
"function",
"loadDynamicServices",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"startMeasure",
"(",
"__METHOD__",
")",
";",
"/** @var array $objects */",
"$",
"objects",
"=",
"App",
"::",
"$",
"Properties",
"->",
"getAll",
"(",
"'object'",
")",
... | Prepare dynamic static links from object configurations as anonymous functions
@throws NativeException | [
"Prepare",
"dynamic",
"static",
"links",
"from",
"object",
"configurations",
"as",
"anonymous",
"functions"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/App.php#L153-L178 |
193,577 | phpffcms/ffcms-core | src/App.php | App.run | public function run(): void
{
try {
/** @var \Ffcms\Core\Arch\Controller $callClass */
$callClass = $this->getCallbackClass();
$callMethod = 'action' . self::$Request->getAction();
$arguments = self::$Request->getArguments();
// check if callback ... | php | public function run(): void
{
try {
/** @var \Ffcms\Core\Arch\Controller $callClass */
$callClass = $this->getCallbackClass();
$callMethod = 'action' . self::$Request->getAction();
$arguments = self::$Request->getArguments();
// check if callback ... | [
"public",
"function",
"run",
"(",
")",
":",
"void",
"{",
"try",
"{",
"/** @var \\Ffcms\\Core\\Arch\\Controller $callClass */",
"$",
"callClass",
"=",
"$",
"this",
"->",
"getCallbackClass",
"(",
")",
";",
"$",
"callMethod",
"=",
"'action'",
".",
"self",
"::",
"... | Run applications and display output. Main entry point of system.
@return void | [
"Run",
"applications",
"and",
"display",
"output",
".",
"Main",
"entry",
"point",
"of",
"system",
"."
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/App.php#L184-L234 |
193,578 | phpffcms/ffcms-core | src/App.php | App.getCallbackClass | private function getCallbackClass()
{
// define callback class namespace/name full path
$cName = (self::$Request->getCallbackAlias() ?? '\Apps\Controller\\' . env_name . '\\' . self::$Request->getController());
if (!class_exists($cName)) {
throw new NotFoundException('Callback cl... | php | private function getCallbackClass()
{
// define callback class namespace/name full path
$cName = (self::$Request->getCallbackAlias() ?? '\Apps\Controller\\' . env_name . '\\' . self::$Request->getController());
if (!class_exists($cName)) {
throw new NotFoundException('Callback cl... | [
"private",
"function",
"getCallbackClass",
"(",
")",
"{",
"// define callback class namespace/name full path",
"$",
"cName",
"=",
"(",
"self",
"::",
"$",
"Request",
"->",
"getCallbackAlias",
"(",
")",
"??",
"'\\Apps\\Controller\\\\'",
".",
"env_name",
".",
"'\\\\'",
... | Get callback class instance
@return Controller
@throws NotFoundException | [
"Get",
"callback",
"class",
"instance"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/App.php#L241-L250 |
193,579 | locomotivemtl/charcoal-config | src/Charcoal/Config/DelegatesAwareTrait.php | DelegatesAwareTrait.setDelegates | final public function setDelegates(array $delegates)
{
$this->delegates = [];
foreach ($delegates as $delegate) {
$this->addDelegate($delegate);
}
return $this;
} | php | final public function setDelegates(array $delegates)
{
$this->delegates = [];
foreach ($delegates as $delegate) {
$this->addDelegate($delegate);
}
return $this;
} | [
"final",
"public",
"function",
"setDelegates",
"(",
"array",
"$",
"delegates",
")",
"{",
"$",
"this",
"->",
"delegates",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"delegates",
"as",
"$",
"delegate",
")",
"{",
"$",
"this",
"->",
"addDelegate",
"(",
"$",
... | Assigns a collection of delegare objects.
@param EntityInterface[] $delegates One or more delegate objects to register.
@return self | [
"Assigns",
"a",
"collection",
"of",
"delegare",
"objects",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/DelegatesAwareTrait.php#L27-L34 |
193,580 | locomotivemtl/charcoal-config | src/Charcoal/Config/DelegatesAwareTrait.php | DelegatesAwareTrait.hasInDelegates | final protected function hasInDelegates($key)
{
foreach ($this->delegates as $delegate) {
if (isset($delegate[$key])) {
return true;
}
}
return false;
} | php | final protected function hasInDelegates($key)
{
foreach ($this->delegates as $delegate) {
if (isset($delegate[$key])) {
return true;
}
}
return false;
} | [
"final",
"protected",
"function",
"hasInDelegates",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"delegates",
"as",
"$",
"delegate",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"delegate",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
... | Determines if a delegate object contains the specified key and if its value is not NULL.
Iterates over each object in the delegate stack and stops on
the first match containing the specified key.
@param string $key The data key to check.
@return boolean TRUE if $key exists and has a value other than NULL, FALSE othe... | [
"Determines",
"if",
"a",
"delegate",
"object",
"contains",
"the",
"specified",
"key",
"and",
"if",
"its",
"value",
"is",
"not",
"NULL",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/DelegatesAwareTrait.php#L69-L77 |
193,581 | locomotivemtl/charcoal-config | src/Charcoal/Config/DelegatesAwareTrait.php | DelegatesAwareTrait.getInDelegates | final protected function getInDelegates($key)
{
foreach ($this->delegates as $delegate) {
if (isset($delegate[$key])) {
return $delegate[$key];
}
}
return null;
} | php | final protected function getInDelegates($key)
{
foreach ($this->delegates as $delegate) {
if (isset($delegate[$key])) {
return $delegate[$key];
}
}
return null;
} | [
"final",
"protected",
"function",
"getInDelegates",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"delegates",
"as",
"$",
"delegate",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"delegate",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
... | Returns the value from the specified key found on the first delegate object.
Iterates over each object in the delegate stack and stops on
the first match containing a value that is not NULL.
@param string $key The data key to retrieve.
@return mixed Value of the requested $key on success, NULL if the $key is not set... | [
"Returns",
"the",
"value",
"from",
"the",
"specified",
"key",
"found",
"on",
"the",
"first",
"delegate",
"object",
"."
] | 722b34955360c287dea8fffb3b5491866ce5f6cb | https://github.com/locomotivemtl/charcoal-config/blob/722b34955360c287dea8fffb3b5491866ce5f6cb/src/Charcoal/Config/DelegatesAwareTrait.php#L88-L96 |
193,582 | spoom-php/core | src/extension/Helper/Collection.php | Collection.merge | public static function merge( $destination, $source, bool $deep = true, bool $assoc = false ) {
if( !static::is( $destination, false, true ) ) throw new \TypeError( 'Destination must be array(like)' );
else if( !static::is( $source, true ) ) throw new \TypeError( 'Source must be iterable' );
else {
... | php | public static function merge( $destination, $source, bool $deep = true, bool $assoc = false ) {
if( !static::is( $destination, false, true ) ) throw new \TypeError( 'Destination must be array(like)' );
else if( !static::is( $source, true ) ) throw new \TypeError( 'Source must be iterable' );
else {
... | [
"public",
"static",
"function",
"merge",
"(",
"$",
"destination",
",",
"$",
"source",
",",
"bool",
"$",
"deep",
"=",
"true",
",",
"bool",
"$",
"assoc",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"destination",
",",
"fal... | Recursive merge of two arrays
This is like the array_merge_recursive() without the strange array-creating thing
@param array|object $destination
@param array|object $source
@param bool $deep
@param bool $assoc Handle numeric arrays like associative (overwrite keys, not extend)
@return array|object Th... | [
"Recursive",
"merge",
"of",
"two",
"arrays"
] | ea7184213352fa2fad7636927a019e5798734e04 | https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Helper/Collection.php#L59-L82 |
193,583 | spoom-php/core | src/extension/Helper/Collection.php | Collection.mapList | public static function mapList( $list, $map, ?string $key = null ): array {
if( !static::is( $list, true ) ) throw new \TypeError( 'The $list must be iterable' );
else {
$_list = [];
foreach( $list as $index => $item ) {
if( !static::is( $item, false, true ) ) throw new \TypeError( 'All $... | php | public static function mapList( $list, $map, ?string $key = null ): array {
if( !static::is( $list, true ) ) throw new \TypeError( 'The $list must be iterable' );
else {
$_list = [];
foreach( $list as $index => $item ) {
if( !static::is( $item, false, true ) ) throw new \TypeError( 'All $... | [
"public",
"static",
"function",
"mapList",
"(",
"$",
"list",
",",
"$",
"map",
",",
"?",
"string",
"$",
"key",
"=",
"null",
")",
":",
"array",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"list",
",",
"true",
")",
")",
"throw",
"new",
"\... | Re-map an array of arraylikes into a new array
@param array[] $list
@param string|array|array[] $map
@param string|null $key
@return array[] | [
"Re",
"-",
"map",
"an",
"array",
"of",
"arraylikes",
"into",
"a",
"new",
"array"
] | ea7184213352fa2fad7636927a019e5798734e04 | https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Helper/Collection.php#L92-L111 |
193,584 | spoom-php/core | src/extension/Helper/Collection.php | Collection.copy | public static function copy( $input, bool $deep = true ) {
if( !static::is( $input ) ) return $input;
else {
if( is_array( $input ) ) {
$result = [];
foreach( $input as $k => $e ) {
$result[ $k ] = $deep ? static::copy( $e, $deep ) : $e;
}
} else {
// h... | php | public static function copy( $input, bool $deep = true ) {
if( !static::is( $input ) ) return $input;
else {
if( is_array( $input ) ) {
$result = [];
foreach( $input as $k => $e ) {
$result[ $k ] = $deep ? static::copy( $e, $deep ) : $e;
}
} else {
// h... | [
"public",
"static",
"function",
"copy",
"(",
"$",
"input",
",",
"bool",
"$",
"deep",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"input",
")",
")",
"return",
"$",
"input",
";",
"else",
"{",
"if",
"(",
"is_array",
"(",
... | Deep copy of a collection
@param array|object $input
@param bool $deep Deep copy or not
@return array|object | [
"Deep",
"copy",
"of",
"a",
"collection"
] | ea7184213352fa2fad7636927a019e5798734e04 | https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Helper/Collection.php#L150-L178 |
193,585 | agentmedia/phine-core | src/Core/Logic/Caching/FileCacher.php | FileCacher.MustUseCache | function MustUseCache()
{
if ($this->cacheLifetime == 0)
{
return false;
}
if (!File::Exists($this->file))
{
return false;
}
$now = Date::Now();
$lastMod = File::GetLastModified($this->file);
if ($now->TimeStamp() - $las... | php | function MustUseCache()
{
if ($this->cacheLifetime == 0)
{
return false;
}
if (!File::Exists($this->file))
{
return false;
}
$now = Date::Now();
$lastMod = File::GetLastModified($this->file);
if ($now->TimeStamp() - $las... | [
"function",
"MustUseCache",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cacheLifetime",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"File",
"::",
"Exists",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"return",
"false",
... | Calculates if the cache content needs to be used
@return boolean | [
"Calculates",
"if",
"the",
"cache",
"content",
"needs",
"to",
"be",
"used"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Caching/FileCacher.php#L48-L65 |
193,586 | Wedeto/DB | src/DB.php | DB.setupDriver | protected function setupDriver(string $type)
{
// A full namespaced class name may be provided
$driver = null;
$driver_class = null;
if (is_a($type, Driver::class, true))
{
$driver_class = $type;
$driver = new $type($this);
}
else
... | php | protected function setupDriver(string $type)
{
// A full namespaced class name may be provided
$driver = null;
$driver_class = null;
if (is_a($type, Driver::class, true))
{
$driver_class = $type;
$driver = new $type($this);
}
else
... | [
"protected",
"function",
"setupDriver",
"(",
"string",
"$",
"type",
")",
"{",
"// A full namespaced class name may be provided",
"$",
"driver",
"=",
"null",
";",
"$",
"driver_class",
"=",
"null",
";",
"if",
"(",
"is_a",
"(",
"$",
"type",
",",
"Driver",
"::",
... | Find a proper driver based on the 'type' parameter in the configuration.
@param string $type The type / driver name.
@return Wedeto\DB\Driver\Driver A initialized driver object
@throws Wedeto\DB\Exception\DriverException When no driver could be found | [
"Find",
"a",
"proper",
"driver",
"based",
"on",
"the",
"type",
"parameter",
"in",
"the",
"configuration",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DB.php#L90-L125 |
193,587 | Wedeto/DB | src/DB.php | DB.getDAO | public function getDAO(string $class)
{
if (!isset($this->dao[$class]))
{
if (!is_subclass_of($class, Model::class))
throw new DAOException("$class is not a valid Model");
$tablename = $class::getTablename();
$dao = DI::getInjector()->newInstance(... | php | public function getDAO(string $class)
{
if (!isset($this->dao[$class]))
{
if (!is_subclass_of($class, Model::class))
throw new DAOException("$class is not a valid Model");
$tablename = $class::getTablename();
$dao = DI::getInjector()->newInstance(... | [
"public",
"function",
"getDAO",
"(",
"string",
"$",
"class",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dao",
"[",
"$",
"class",
"]",
")",
")",
"{",
"if",
"(",
"!",
"is_subclass_of",
"(",
"$",
"class",
",",
"Model",
"::",
"class"... | Get a DAO for a model. When none is available, a new one will be instantiated.
@param string $class The name of the Model class
@return DAO An instantiated DAO for the class. | [
"Get",
"a",
"DAO",
"for",
"a",
"model",
".",
"When",
"none",
"is",
"available",
"a",
"new",
"one",
"will",
"be",
"instantiated",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DB.php#L222-L238 |
193,588 | Wedeto/DB | src/DB.php | DB.clearCache | public function clearCache()
{
if (!empty($this->schema))
{
$this->schema->clearCache();
}
$this->dao = [];
$this->schema = null;
return $this;
} | php | public function clearCache()
{
if (!empty($this->schema))
{
$this->schema->clearCache();
}
$this->dao = [];
$this->schema = null;
return $this;
} | [
"public",
"function",
"clearCache",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"$",
"this",
"->",
"schema",
"->",
"clearCache",
"(",
")",
";",
"}",
"$",
"this",
"->",
"dao",
"=",
"[",
"]",
";",
"$",... | Flush all cached DAOs and schema - useful after a schema alteration
@return DB Provides fluent interface | [
"Flush",
"all",
"cached",
"DAOs",
"and",
"schema",
"-",
"useful",
"after",
"a",
"schema",
"alteration"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DB.php#L244-L254 |
193,589 | Wedeto/DB | src/DB.php | DB.setDAO | public function setDAO(string $class, DAO $dao = null)
{
if (!is_subclass_of($class, Model::class))
throw new DAOException("$class is not a valid Model");
$this->dao[$class] = $dao;
return $this;
} | php | public function setDAO(string $class, DAO $dao = null)
{
if (!is_subclass_of($class, Model::class))
throw new DAOException("$class is not a valid Model");
$this->dao[$class] = $dao;
return $this;
} | [
"public",
"function",
"setDAO",
"(",
"string",
"$",
"class",
",",
"DAO",
"$",
"dao",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_subclass_of",
"(",
"$",
"class",
",",
"Model",
"::",
"class",
")",
")",
"throw",
"new",
"DAOException",
"(",
"\"$class is no... | Set the DAO for a model manually.
@param string $class The name of the Model class
@param DAO $dao The DAO to set. Omit to reset - a new one will be instantiated on request
@return DB Provides fluent interface | [
"Set",
"the",
"DAO",
"for",
"a",
"model",
"manually",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DB.php#L262-L269 |
193,590 | Wedeto/DB | src/DB.php | DB.prepareQuery | public function prepareQuery(Query $query)
{
$parameters = new Parameters($this->driver);
if ($this->pdo === null)
$this->connect();
$sql = $this->driver->toSQL($parameters, $query);
$statement = $this->prepare($sql);
$parameters->bindParameters($statement);
... | php | public function prepareQuery(Query $query)
{
$parameters = new Parameters($this->driver);
if ($this->pdo === null)
$this->connect();
$sql = $this->driver->toSQL($parameters, $query);
$statement = $this->prepare($sql);
$parameters->bindParameters($statement);
... | [
"public",
"function",
"prepareQuery",
"(",
"Query",
"$",
"query",
")",
"{",
"$",
"parameters",
"=",
"new",
"Parameters",
"(",
"$",
"this",
"->",
"driver",
")",
";",
"if",
"(",
"$",
"this",
"->",
"pdo",
"===",
"null",
")",
"$",
"this",
"->",
"connect"... | Prepare a query and return the PDOStatement
@param Wedeto\DB\Query\Query The query to prepare
@return PDOStatement The prepared statement | [
"Prepare",
"a",
"query",
"and",
"return",
"the",
"PDOStatement"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DB.php#L307-L319 |
193,591 | Wedeto/DB | src/DB.php | DB.executeSQL | public function executeSQL(string $filename)
{
$fh = @fopen($filename, "r");
if ($fh === false)
throw new IOException("Unable to open file '$filename'");
$prefix = $this->driver->getTablePrefix();
$statement = '';
while (!feof($fh))
{
... | php | public function executeSQL(string $filename)
{
$fh = @fopen($filename, "r");
if ($fh === false)
throw new IOException("Unable to open file '$filename'");
$prefix = $this->driver->getTablePrefix();
$statement = '';
while (!feof($fh))
{
... | [
"public",
"function",
"executeSQL",
"(",
"string",
"$",
"filename",
")",
"{",
"$",
"fh",
"=",
"@",
"fopen",
"(",
"$",
"filename",
",",
"\"r\"",
")",
";",
"if",
"(",
"$",
"fh",
"===",
"false",
")",
"throw",
"new",
"IOException",
"(",
"\"Unable to open f... | Execute a SQL file in the database.
This will scan the file for statements, skipping comment-only lines.
Occurences of %PREFIX% will be replaced with the configured table
prefix. YOU ARE STRONGLY ADVISED TO ENCLOSE ALL TABLE REFERENCES
WITH IDENTIFIER QUOTES. For MySQL use backticks, for PostgreSQL
use double quotes.... | [
"Execute",
"a",
"SQL",
"file",
"in",
"the",
"database",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DB.php#L354-L384 |
193,592 | MARCspec/php-marc-spec | src/MARCspec.php | MARCspec.addSubfield | private function addSubfield($_subfield)
{
if (array_key_exists('subfieldtagrange', $_subfield)) {
$_subfieldRange = $this->handleSubfieldRanges($_subfield['subfieldtagrange']);
} else {
$_subfieldRange[] = $_subfield['subfieldtag'];
}
foreach ($_subfieldRang... | php | private function addSubfield($_subfield)
{
if (array_key_exists('subfieldtagrange', $_subfield)) {
$_subfieldRange = $this->handleSubfieldRanges($_subfield['subfieldtagrange']);
} else {
$_subfieldRange[] = $_subfield['subfieldtag'];
}
foreach ($_subfieldRang... | [
"private",
"function",
"addSubfield",
"(",
"$",
"_subfield",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'subfieldtagrange'",
",",
"$",
"_subfield",
")",
")",
"{",
"$",
"_subfieldRange",
"=",
"$",
"this",
"->",
"handleSubfieldRanges",
"(",
"$",
"_subfield",... | Creates and adds a single subfield from the MARCspecParser result.
@param array $_subfield The MARCspecParser result array | [
"Creates",
"and",
"adds",
"a",
"single",
"subfield",
"from",
"the",
"MARCspecParser",
"result",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspec.php#L206-L251 |
193,593 | MARCspec/php-marc-spec | src/MARCspec.php | MARCspec.handleSubfieldRanges | private function handleSubfieldRanges($arg)
{
if (strlen($arg) < 3) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SF.
InvalidMARCspecException::LENGTH3,
$arg
);
}
if (preg_match('/[a-z]/', $arg[0]) && ... | php | private function handleSubfieldRanges($arg)
{
if (strlen($arg) < 3) {
throw new InvalidMARCspecException(
InvalidMARCspecException::SF.
InvalidMARCspecException::LENGTH3,
$arg
);
}
if (preg_match('/[a-z]/', $arg[0]) && ... | [
"private",
"function",
"handleSubfieldRanges",
"(",
"$",
"arg",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"arg",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"InvalidMARCspecException",
"(",
"InvalidMARCspecException",
"::",
"SF",
".",
"InvalidMARCspecException",
"... | Parses subfield ranges into single subfields.
@internal
@param string $arg The assumed subfield range
@throws CK\MARCspec\Exception\InvalidMARCspecException
@return array $_range[string] An array of subfield tags | [
"Parses",
"subfield",
"ranges",
"into",
"single",
"subfields",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspec.php#L317-L357 |
193,594 | MARCspec/php-marc-spec | src/MARCspec.php | MARCspec.validatePos | public static function validatePos($pos)
{
$posLength = strlen($pos);
if (1 > $posLength) {
throw new InvalidMARCspecException(
InvalidMARCspecException::PR.
InvalidMARCspecException::PR1,
$pos
);
}
if (preg_ma... | php | public static function validatePos($pos)
{
$posLength = strlen($pos);
if (1 > $posLength) {
throw new InvalidMARCspecException(
InvalidMARCspecException::PR.
InvalidMARCspecException::PR1,
$pos
);
}
if (preg_ma... | [
"public",
"static",
"function",
"validatePos",
"(",
"$",
"pos",
")",
"{",
"$",
"posLength",
"=",
"strlen",
"(",
"$",
"pos",
")",
";",
"if",
"(",
"1",
">",
"$",
"posLength",
")",
"{",
"throw",
"new",
"InvalidMARCspecException",
"(",
"InvalidMARCspecExceptio... | validate a position or range.
@param string $pos The position or range
@throws CK\MARCspec\Exception\InvalidMARCspecException
@return array $_pos[string] An numeric array of character or index positions.
$_pos[1] might be empty. | [
"validate",
"a",
"position",
"or",
"range",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/MARCspec.php#L387-L446 |
193,595 | anonymframework/Events | EventDispatcher.php | EventDispatcher.resolveResponseArray | private function resolveResponseArray(array $response)
{
if ($count = count($response)) {
if ($count === 1) {
$response = $response[0];
}
}
$this->firing[] = $response;
return $response;
} | php | private function resolveResponseArray(array $response)
{
if ($count = count($response)) {
if ($count === 1) {
$response = $response[0];
}
}
$this->firing[] = $response;
return $response;
} | [
"private",
"function",
"resolveResponseArray",
"(",
"array",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"count",
"=",
"count",
"(",
"$",
"response",
")",
")",
"{",
"if",
"(",
"$",
"count",
"===",
"1",
")",
"{",
"$",
"response",
"=",
"$",
"response",
... | resolve the return parameter
@param array $response
@return mixed | [
"resolve",
"the",
"return",
"parameter"
] | efee1ead21cdfae00b128e3ea73aae07dc1ede2d | https://github.com/anonymframework/Events/blob/efee1ead21cdfae00b128e3ea73aae07dc1ede2d/EventDispatcher.php#L90-L100 |
193,596 | anonymframework/Events | EventDispatcher.php | EventDispatcher.resolveEventAndListeners | private function resolveEventAndListeners($event)
{
if (is_object($event) && $event instanceof EventDispatch) {
$name = get_class($event);
} else {
$name = $event;
}
if (is_string($name)) {
if ($this->hasListiner($name) && $listeners = $this->get... | php | private function resolveEventAndListeners($event)
{
if (is_object($event) && $event instanceof EventDispatch) {
$name = get_class($event);
} else {
$name = $event;
}
if (is_string($name)) {
if ($this->hasListiner($name) && $listeners = $this->get... | [
"private",
"function",
"resolveEventAndListeners",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"event",
")",
"&&",
"$",
"event",
"instanceof",
"EventDispatch",
")",
"{",
"$",
"name",
"=",
"get_class",
"(",
"$",
"event",
")",
";",
"}",
... | resolve the event and listener
@param mixed $event
@throws EventListenerException
@return null|string|EventDispatch | [
"resolve",
"the",
"event",
"and",
"listener"
] | efee1ead21cdfae00b128e3ea73aae07dc1ede2d | https://github.com/anonymframework/Events/blob/efee1ead21cdfae00b128e3ea73aae07dc1ede2d/EventDispatcher.php#L161-L182 |
193,597 | RudyMas/Emvc_Core | src/Core.php | Core.settingUpRootMapping | private function settingUpRootMapping()
{
$arrayServerName = explode('.', $_SERVER['SERVER_NAME']);
$scriptName = rtrim(str_replace($arrayServerName, '', dirname($_SERVER['SCRIPT_NAME'])), '/\\');
define('BASE_URL', $scriptName);
define('SYSTEM_ROOT', $_SERVER['DOCUMENT_ROOT'] . BASE... | php | private function settingUpRootMapping()
{
$arrayServerName = explode('.', $_SERVER['SERVER_NAME']);
$scriptName = rtrim(str_replace($arrayServerName, '', dirname($_SERVER['SCRIPT_NAME'])), '/\\');
define('BASE_URL', $scriptName);
define('SYSTEM_ROOT', $_SERVER['DOCUMENT_ROOT'] . BASE... | [
"private",
"function",
"settingUpRootMapping",
"(",
")",
"{",
"$",
"arrayServerName",
"=",
"explode",
"(",
"'.'",
",",
"$",
"_SERVER",
"[",
"'SERVER_NAME'",
"]",
")",
";",
"$",
"scriptName",
"=",
"rtrim",
"(",
"str_replace",
"(",
"$",
"arrayServerName",
",",... | Creating BASE_URL & SYSTEM_ROOT
BASE_URL = Path to the root of the website
SYSTEM_ROOT = Full system path to the root of the website | [
"Creating",
"BASE_URL",
"&",
"SYSTEM_ROOT"
] | f7c89a2562eed5535f350a90f71a928e3504aeac | https://github.com/RudyMas/Emvc_Core/blob/f7c89a2562eed5535f350a90f71a928e3504aeac/src/Core.php#L50-L56 |
193,598 | RudyMas/Emvc_Core | src/Core.php | Core.loadingConfig | private function loadingConfig()
{
if ($_SERVER['HTTP_HOST'] == SERVER_DEVELOP) {
if (!is_file(SYSTEM_ROOT . '/config/config.local.php'))
@copy(SYSTEM_ROOT . '/config/config.sample.php', SYSTEM_ROOT . '/config/config.local.php');
require_once('config/config.local.php'... | php | private function loadingConfig()
{
if ($_SERVER['HTTP_HOST'] == SERVER_DEVELOP) {
if (!is_file(SYSTEM_ROOT . '/config/config.local.php'))
@copy(SYSTEM_ROOT . '/config/config.sample.php', SYSTEM_ROOT . '/config/config.local.php');
require_once('config/config.local.php'... | [
"private",
"function",
"loadingConfig",
"(",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'HTTP_HOST'",
"]",
"==",
"SERVER_DEVELOP",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"SYSTEM_ROOT",
".",
"'/config/config.local.php'",
")",
")",
"@",
"copy",
"(",
"SYST... | Loading the configuration files for the website
Checks if certain files exist, if not, it uses the standard config file by copying it | [
"Loading",
"the",
"configuration",
"files",
"for",
"the",
"website"
] | f7c89a2562eed5535f350a90f71a928e3504aeac | https://github.com/RudyMas/Emvc_Core/blob/f7c89a2562eed5535f350a90f71a928e3504aeac/src/Core.php#L63-L74 |
193,599 | RudyMas/Emvc_Core | src/Core.php | Core.loadingDatabases | private function loadingDatabases()
{
$database = [];
if ($_SERVER['HTTP_HOST'] == SERVER_DEVELOP) {
if (!is_file(SYSTEM_ROOT . '/config/database.local.php'))
@copy(SYSTEM_ROOT . '/config/database.sample.php', SYSTEM_ROOT . '/config/database.local.php');
requi... | php | private function loadingDatabases()
{
$database = [];
if ($_SERVER['HTTP_HOST'] == SERVER_DEVELOP) {
if (!is_file(SYSTEM_ROOT . '/config/database.local.php'))
@copy(SYSTEM_ROOT . '/config/database.sample.php', SYSTEM_ROOT . '/config/database.local.php');
requi... | [
"private",
"function",
"loadingDatabases",
"(",
")",
"{",
"$",
"database",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"_SERVER",
"[",
"'HTTP_HOST'",
"]",
"==",
"SERVER_DEVELOP",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"SYSTEM_ROOT",
".",
"'/config/database.loca... | Loading the databases for the websites | [
"Loading",
"the",
"databases",
"for",
"the",
"websites"
] | f7c89a2562eed5535f350a90f71a928e3504aeac | https://github.com/RudyMas/Emvc_Core/blob/f7c89a2562eed5535f350a90f71a928e3504aeac/src/Core.php#L79-L96 |
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.