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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
17,900 | ClanCats/Core | src/classes/CCFinder.php | CCFinder.map | public static function map( $name, $path = null )
{
if ( is_array( $name ) )
{
static::$namespaces = array_merge( static::$namespaces, $name ); return;
}
static::$namespaces[$name] = $path;
} | php | public static function map( $name, $path = null )
{
if ( is_array( $name ) )
{
static::$namespaces = array_merge( static::$namespaces, $name ); return;
}
static::$namespaces[$name] = $path;
} | [
"public",
"static",
"function",
"map",
"(",
"$",
"name",
",",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"static",
"::",
"$",
"namespaces",
"=",
"array_merge",
"(",
"static",
"::",
"$",
"namespaces",
... | Add one or more maps
A map is simply a class namepsace
@param string|array $name
@param path $path
@return void | [
"Add",
"one",
"or",
"more",
"maps",
"A",
"map",
"is",
"simply",
"a",
"class",
"namepsace"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFinder.php#L82-L89 |
17,901 | ClanCats/Core | src/classes/CCFinder.php | CCFinder.shadow | public static function shadow( $name, $namespace, $path = null )
{
static::$shadows[$name] = $class = $namespace."\\".$name;
if ( !is_null( $path ) )
{
static::bind( $name, $class );
}
} | php | public static function shadow( $name, $namespace, $path = null )
{
static::$shadows[$name] = $class = $namespace."\\".$name;
if ( !is_null( $path ) )
{
static::bind( $name, $class );
}
} | [
"public",
"static",
"function",
"shadow",
"(",
"$",
"name",
",",
"$",
"namespace",
",",
"$",
"path",
"=",
"null",
")",
"{",
"static",
"::",
"$",
"shadows",
"[",
"$",
"name",
"]",
"=",
"$",
"class",
"=",
"$",
"namespace",
".",
"\"\\\\\"",
".",
"$",
... | Add a shadow class
A shadow class is a global class and gets liftet to the global namespace.
\Some\Longer\Namespace\Foo::bar() -> Foo::bar()
exmpale:
CCFinder::shadow( 'Foo', 'Some\Longer\Namespace', 'myclasses/Foo.php' );
@param string $name The shadow
@param string $namespace The real class namespace
@param s... | [
"Add",
"a",
"shadow",
"class",
"A",
"shadow",
"class",
"is",
"a",
"global",
"class",
"and",
"gets",
"liftet",
"to",
"the",
"global",
"namespace",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFinder.php#L105-L113 |
17,902 | ClanCats/Core | src/classes/CCFinder.php | CCFinder.alias | public static function alias( $name, $path = null )
{
if ( is_array( $name ) )
{
static::$aliases = array_merge( static::$aliases, $name ); return;
}
static::$aliases[$name] = $path;
} | php | public static function alias( $name, $path = null )
{
if ( is_array( $name ) )
{
static::$aliases = array_merge( static::$aliases, $name ); return;
}
static::$aliases[$name] = $path;
} | [
"public",
"static",
"function",
"alias",
"(",
"$",
"name",
",",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"static",
"::",
"$",
"aliases",
"=",
"array_merge",
"(",
"static",
"::",
"$",
"aliases",
","... | Add one or more aliases
An alias can overwrite an shadow. This way we can extend other classes.
example:
CCFinder::alias( 'Foo', '/path/to/my/Foo.php' );
@param string $name
@param path $path
@return void | [
"Add",
"one",
"or",
"more",
"aliases",
"An",
"alias",
"can",
"overwrite",
"an",
"shadow",
".",
"This",
"way",
"we",
"can",
"extend",
"other",
"classes",
"."
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFinder.php#L126-L133 |
17,903 | ClanCats/Core | src/classes/CCFinder.php | CCFinder.bind | public static function bind( $name, $path = null )
{
if ( is_array( $name ) )
{
static::$classes = array_merge( static::$classes, $name ); return;
}
static::$classes[$name] = $path;
} | php | public static function bind( $name, $path = null )
{
if ( is_array( $name ) )
{
static::$classes = array_merge( static::$classes, $name ); return;
}
static::$classes[$name] = $path;
} | [
"public",
"static",
"function",
"bind",
"(",
"$",
"name",
",",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"static",
"::",
"$",
"classes",
"=",
"array_merge",
"(",
"static",
"::",
"$",
"classes",
",",... | Add one or more class to the autoloader
@param string $name
@param path $path
@return void | [
"Add",
"one",
"or",
"more",
"class",
"to",
"the",
"autoloader"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFinder.php#L142-L149 |
17,904 | ClanCats/Core | src/classes/CCFinder.php | CCFinder.package | public static function package( $dir, $classes )
{
foreach( $classes as $name => $path )
{
static::$classes[$name] = $dir.$path;
}
} | php | public static function package( $dir, $classes )
{
foreach( $classes as $name => $path )
{
static::$classes[$name] = $dir.$path;
}
} | [
"public",
"static",
"function",
"package",
"(",
"$",
"dir",
",",
"$",
"classes",
")",
"{",
"foreach",
"(",
"$",
"classes",
"as",
"$",
"name",
"=>",
"$",
"path",
")",
"{",
"static",
"::",
"$",
"classes",
"[",
"$",
"name",
"]",
"=",
"$",
"dir",
"."... | This simply adds some classes with a prefix
@param string $name
@param path $path
@return void | [
"This",
"simply",
"adds",
"some",
"classes",
"with",
"a",
"prefix"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFinder.php#L159-L165 |
17,905 | ClanCats/Core | src/classes/CCFinder.php | CCFinder.shadow_package | public static function shadow_package( $dir, $namespace, $shadows )
{
foreach( $shadows as $name => $path )
{
static::$shadows[$name] = $class = $namespace."\\".$name;
static::$classes[$class] = $dir.$path;
}
} | php | public static function shadow_package( $dir, $namespace, $shadows )
{
foreach( $shadows as $name => $path )
{
static::$shadows[$name] = $class = $namespace."\\".$name;
static::$classes[$class] = $dir.$path;
}
} | [
"public",
"static",
"function",
"shadow_package",
"(",
"$",
"dir",
",",
"$",
"namespace",
",",
"$",
"shadows",
")",
"{",
"foreach",
"(",
"$",
"shadows",
"as",
"$",
"name",
"=>",
"$",
"path",
")",
"{",
"static",
"::",
"$",
"shadows",
"[",
"$",
"name",... | This simply adds some shadows with a prefix
@param string $name
@param path $path
@return void | [
"This",
"simply",
"adds",
"some",
"shadows",
"with",
"a",
"prefix"
] | 9f6ec72c1a439de4b253d0223f1029f7f85b6ef8 | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCFinder.php#L175-L182 |
17,906 | Double-Opt-in/php-client-api | src/Client/Commands/LogCommand.php | LogCommand.setData | public function setData($data, $key = null)
{
if (is_array($data) && $key === null) {
$this->data = $data;
return $this;
}
if ($key === null)
$key = 'data';
$this->data[$key] = $data;
return $this;
} | php | public function setData($data, $key = null)
{
if (is_array($data) && $key === null) {
$this->data = $data;
return $this;
}
if ($key === null)
$key = 'data';
$this->data[$key] = $data;
return $this;
} | [
"public",
"function",
"setData",
"(",
"$",
"data",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
"&&",
"$",
"key",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"data",
";",
"return",
"$",... | setting data to add for the logging action
we suggest setting an array
@param array|mixed $data
@param null $key
@return $this | [
"setting",
"data",
"to",
"add",
"for",
"the",
"logging",
"action"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/LogCommand.php#L101-L115 |
17,907 | Double-Opt-in/php-client-api | src/Client/Commands/LogCommand.php | LogCommand.body | public function body(CryptographyEngine $cryptographyEngine)
{
$body = array(
'hash' => $cryptographyEngine->hash($this->email),
'action' => $this->action,
);
if ( ! empty($this->scope))
$body['scope'] = $this->scope;
if ( ! empty($this->data))
$body['data'] = $cryptographyEngine->encrypt(json_en... | php | public function body(CryptographyEngine $cryptographyEngine)
{
$body = array(
'hash' => $cryptographyEngine->hash($this->email),
'action' => $this->action,
);
if ( ! empty($this->scope))
$body['scope'] = $this->scope;
if ( ! empty($this->data))
$body['data'] = $cryptographyEngine->encrypt(json_en... | [
"public",
"function",
"body",
"(",
"CryptographyEngine",
"$",
"cryptographyEngine",
")",
"{",
"$",
"body",
"=",
"array",
"(",
"'hash'",
"=>",
"$",
"cryptographyEngine",
"->",
"hash",
"(",
"$",
"this",
"->",
"email",
")",
",",
"'action'",
"=>",
"$",
"this",... | returns the body
hash: email will be hashed before requesting the server
action: action will be transmitted in plain text
scope: optional scope will be transmitted in plain text
data: optional data will be encrypted before requesting the server
@param CryptographyEngine $cryptographyEngine
@return array|\Guzzle\Http... | [
"returns",
"the",
"body"
] | 2f17da58ec20a408bbd55b2cdd053bc689f995f4 | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/LogCommand.php#L129-L153 |
17,908 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.getPath | public function getPath($id) {
$node = $this->getNode($id);
if (!$node) {
return [];
}
$left = $this->getConfig('leftField');
$right = $this->getConfig('rightField');
return $this->getRepository()->select()
->where($left, '<', $node[$left])
... | php | public function getPath($id) {
$node = $this->getNode($id);
if (!$node) {
return [];
}
$left = $this->getConfig('leftField');
$right = $this->getConfig('rightField');
return $this->getRepository()->select()
->where($left, '<', $node[$left])
... | [
"public",
"function",
"getPath",
"(",
"$",
"id",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getNode",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"node",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"left",
"=",
"$",
"this",
"->",
"... | Return the hierarchical path to the current node.
@param int $id
@return \Titon\Db\EntityCollection | [
"Return",
"the",
"hierarchical",
"path",
"to",
"the",
"current",
"node",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L145-L160 |
17,909 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.getTree | public function getTree($id = null) {
$parent = $this->getConfig('parentField');
$left = $this->getConfig('leftField');
$right = $this->getConfig('rightField');
$query = $this->getRepository()->select()->orderBy($left, 'asc');
if ($id) {
if ($parentNode = $this->get... | php | public function getTree($id = null) {
$parent = $this->getConfig('parentField');
$left = $this->getConfig('leftField');
$right = $this->getConfig('rightField');
$query = $this->getRepository()->select()->orderBy($left, 'asc');
if ($id) {
if ($parentNode = $this->get... | [
"public",
"function",
"getTree",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'parentField'",
")",
";",
"$",
"left",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'leftField'",
")",
";",
"$",
"right",
... | Return a tree of nested nodes. If no ID is provided, the top level root will be used.
@param int $id
@return array | [
"Return",
"a",
"tree",
"of",
"nested",
"nodes",
".",
"If",
"no",
"ID",
"is",
"provided",
"the",
"top",
"level",
"root",
"will",
"be",
"used",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L168-L208 |
17,910 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.mapList | public function mapList(array $nodes, $key, $value, $spacer) {
$tree = [];
$stack = [];
$key = $key ?: $this->getRepository()->getPrimaryKey();
$value = $value ?: $this->getRepository()->getDisplayField();
$right = $this->getConfig('rightField');
foreach ($nodes as $node... | php | public function mapList(array $nodes, $key, $value, $spacer) {
$tree = [];
$stack = [];
$key = $key ?: $this->getRepository()->getPrimaryKey();
$value = $value ?: $this->getRepository()->getDisplayField();
$right = $this->getConfig('rightField');
foreach ($nodes as $node... | [
"public",
"function",
"mapList",
"(",
"array",
"$",
"nodes",
",",
"$",
"key",
",",
"$",
"value",
",",
"$",
"spacer",
")",
"{",
"$",
"tree",
"=",
"[",
"]",
";",
"$",
"stack",
"=",
"[",
"]",
";",
"$",
"key",
"=",
"$",
"key",
"?",
":",
"$",
"t... | Map a nested tree using the primary key and display field as the values to populate the list.
Nested lists will be prepended with a spacer to indicate indentation.
@param array $nodes
@param string $key
@param string $value
@param string $spacer
@return array | [
"Map",
"a",
"nested",
"tree",
"using",
"the",
"primary",
"key",
"and",
"display",
"field",
"as",
"the",
"values",
"to",
"populate",
"the",
"list",
".",
"Nested",
"lists",
"will",
"be",
"prepended",
"with",
"a",
"spacer",
"to",
"indicate",
"indentation",
".... | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L220-L241 |
17,911 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.mapTree | public function mapTree(array $nodes, array $mappedNodes = []) {
if (!$mappedNodes) {
return $nodes;
}
$tree = [];
$pk = $this->getRepository()->getPrimaryKey();
foreach ($nodes as $node) {
$id = $node[$pk];
if (isset($mappedNodes[$id])) {
... | php | public function mapTree(array $nodes, array $mappedNodes = []) {
if (!$mappedNodes) {
return $nodes;
}
$tree = [];
$pk = $this->getRepository()->getPrimaryKey();
foreach ($nodes as $node) {
$id = $node[$pk];
if (isset($mappedNodes[$id])) {
... | [
"public",
"function",
"mapTree",
"(",
"array",
"$",
"nodes",
",",
"array",
"$",
"mappedNodes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"mappedNodes",
")",
"{",
"return",
"$",
"nodes",
";",
"}",
"$",
"tree",
"=",
"[",
"]",
";",
"$",
"pk",
... | Map a nested tree of arrays using the parent node stack and the mapped nodes by parent ID.
@param array $nodes
@param array $mappedNodes
@return array | [
"Map",
"a",
"nested",
"tree",
"of",
"arrays",
"using",
"the",
"parent",
"node",
"stack",
"and",
"the",
"mapped",
"nodes",
"by",
"parent",
"ID",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L250-L269 |
17,912 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.preDelete | public function preDelete(Event $event, Query $query, $id) {
if (!$this->getConfig('onDelete')) {
return true;
}
if ($node = $this->getNode($id)) {
$count = $this->getRepository()->select()
->where($this->getConfig('parentField'), $id)
->c... | php | public function preDelete(Event $event, Query $query, $id) {
if (!$this->getConfig('onDelete')) {
return true;
}
if ($node = $this->getNode($id)) {
$count = $this->getRepository()->select()
->where($this->getConfig('parentField'), $id)
->c... | [
"public",
"function",
"preDelete",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
"'onDelete'",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"no... | Before a delete, fetch the node and save its left index.
If a node has children, the delete will fail.
@param \Titon\Event\Event $event
@param \Titon\Db\Query $query
@param int|int[] $id
@return bool | [
"Before",
"a",
"delete",
"fetch",
"the",
"node",
"and",
"save",
"its",
"left",
"index",
".",
"If",
"a",
"node",
"has",
"children",
"the",
"delete",
"will",
"fail",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L444-L462 |
17,913 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.postDelete | public function postDelete(Event $event, $id, $count) {
if (!$this->getConfig('onDelete') || !$this->_deleteIndex) {
return;
}
$this->_removeNode($id, $this->_deleteIndex);
$this->_deleteIndex = null;
} | php | public function postDelete(Event $event, $id, $count) {
if (!$this->getConfig('onDelete') || !$this->_deleteIndex) {
return;
}
$this->_removeNode($id, $this->_deleteIndex);
$this->_deleteIndex = null;
} | [
"public",
"function",
"postDelete",
"(",
"Event",
"$",
"event",
",",
"$",
"id",
",",
"$",
"count",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
"'onDelete'",
")",
"||",
"!",
"$",
"this",
"->",
"_deleteIndex",
")",
"{",
"return",
"... | After a delete, shift all nodes up using the base index.
@param \Titon\Event\Event $event
@param int|int[] $id
@param int $count | [
"After",
"a",
"delete",
"shift",
"all",
"nodes",
"up",
"using",
"the",
"base",
"index",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L471-L478 |
17,914 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior.postSave | public function postSave(Event $event, $id, $count) {
if (!$this->getConfig('onSave') || !$this->_saveIndex) {
return;
}
$this->_insertNode($id, $this->_saveIndex);
$this->_saveIndex = null;
} | php | public function postSave(Event $event, $id, $count) {
if (!$this->getConfig('onSave') || !$this->_saveIndex) {
return;
}
$this->_insertNode($id, $this->_saveIndex);
$this->_saveIndex = null;
} | [
"public",
"function",
"postSave",
"(",
"Event",
"$",
"event",
",",
"$",
"id",
",",
"$",
"count",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getConfig",
"(",
"'onSave'",
")",
"||",
"!",
"$",
"this",
"->",
"_saveIndex",
")",
"{",
"return",
";",
... | After an insert, shift all nodes down using the base index.
@param \Titon\Event\Event $event
@param int|int[] $id
@Param int $count | [
"After",
"an",
"insert",
"shift",
"all",
"nodes",
"down",
"using",
"the",
"base",
"index",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L545-L552 |
17,915 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior._moveNode | protected function _moveNode(Closure $callback, array $data) {
return $this->getRepository()->updateMany($data, $callback, [
'before' => false,
'after' => false
]);
} | php | protected function _moveNode(Closure $callback, array $data) {
return $this->getRepository()->updateMany($data, $callback, [
'before' => false,
'after' => false
]);
} | [
"protected",
"function",
"_moveNode",
"(",
"Closure",
"$",
"callback",
",",
"array",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"updateMany",
"(",
"$",
"data",
",",
"$",
"callback",
",",
"[",
"'before'",
"=>",
... | Move a node, or nodes, by applying a where clause to an update query and saving data.
Disable before and after callbacks to recursive events don't trigger.
@param callable $callback
@param array $data
@return int | [
"Move",
"a",
"node",
"or",
"nodes",
"by",
"applying",
"a",
"where",
"clause",
"to",
"an",
"update",
"query",
"and",
"saving",
"data",
".",
"Disable",
"before",
"and",
"after",
"callbacks",
"to",
"recursive",
"events",
"don",
"t",
"trigger",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L608-L613 |
17,916 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior._removeNode | protected function _removeNode($id, $index) {
$pk = $this->getRepository()->getPrimaryKey();
foreach ([$this->getConfig('leftField'), $this->getConfig('rightField')] as $field) {
$this->_moveNode(function(Query $query) use ($field, $index, $id, $pk) {
$query->where($field, '... | php | protected function _removeNode($id, $index) {
$pk = $this->getRepository()->getPrimaryKey();
foreach ([$this->getConfig('leftField'), $this->getConfig('rightField')] as $field) {
$this->_moveNode(function(Query $query) use ($field, $index, $id, $pk) {
$query->where($field, '... | [
"protected",
"function",
"_removeNode",
"(",
"$",
"id",
",",
"$",
"index",
")",
"{",
"$",
"pk",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"getPrimaryKey",
"(",
")",
";",
"foreach",
"(",
"[",
"$",
"this",
"->",
"getConfig",
"(",
"'leftF... | Prepares a node for removal by moving all following nodes up.
@param int $id
@param int $index | [
"Prepares",
"a",
"node",
"for",
"removal",
"by",
"moving",
"all",
"following",
"nodes",
"up",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L621-L635 |
17,917 | titon/db | src/Titon/Db/Behavior/HierarchyBehavior.php | HierarchyBehavior._reOrder | protected function _reOrder($parent_id, $left, array $order = []) {
$parent = $this->getConfig('parentField');
$repo = $this->getRepository();
$pk = $repo->getPrimaryKey();
$right = $left + 1;
// Get children and sort
$children = $repo->select()
->where($pare... | php | protected function _reOrder($parent_id, $left, array $order = []) {
$parent = $this->getConfig('parentField');
$repo = $this->getRepository();
$pk = $repo->getPrimaryKey();
$right = $left + 1;
// Get children and sort
$children = $repo->select()
->where($pare... | [
"protected",
"function",
"_reOrder",
"(",
"$",
"parent_id",
",",
"$",
"left",
",",
"array",
"$",
"order",
"=",
"[",
"]",
")",
"{",
"$",
"parent",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'parentField'",
")",
";",
"$",
"repo",
"=",
"$",
"this",
"-... | Re-order the tree by recursively looping through all parents and children,
ordering the results, and generating the correct left and right indexes.
@param int $parent_id
@param int $left
@param array $order
@return int | [
"Re",
"-",
"order",
"the",
"tree",
"by",
"recursively",
"looping",
"through",
"all",
"parents",
"and",
"children",
"ordering",
"the",
"results",
"and",
"generating",
"the",
"correct",
"left",
"and",
"right",
"indexes",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/HierarchyBehavior.php#L646-L673 |
17,918 | webforge-labs/psc-cms | lib/Psc/Doctrine/NavigationNodeRepository.php | NavigationNodeRepository.getPath | public function getPath($node) {
// ACTIVE ?
$qb = $this->createQueryBuilder('node');
$qb
->where($qb->expr()->lte('node.lft', $node->getLft()))
->andWhere($qb->expr()->gte('node.rgt', $node->getRgt()))
->andWhere('node.context = :context')
->orderBy('node.lft', 'ASC')
... | php | public function getPath($node) {
// ACTIVE ?
$qb = $this->createQueryBuilder('node');
$qb
->where($qb->expr()->lte('node.lft', $node->getLft()))
->andWhere($qb->expr()->gte('node.rgt', $node->getRgt()))
->andWhere('node.context = :context')
->orderBy('node.lft', 'ASC')
... | [
"public",
"function",
"getPath",
"(",
"$",
"node",
")",
"{",
"// ACTIVE ?",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'node'",
")",
";",
"$",
"qb",
"->",
"where",
"(",
"$",
"qb",
"->",
"expr",
"(",
")",
"->",
"lte",
"(",
"'node... | Get the path of a node
the path first element is the root node
the last node is $node itself
@param object $node
@return array() | [
"Get",
"the",
"path",
"of",
"a",
"node"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/NavigationNodeRepository.php#L310-L333 |
17,919 | Kylob/Bootstrap | src/Navbar.php | Navbar.menu | public function menu(array $links, array $options = array())
{
$align = (isset($options['pull'])) ? ' navbar-'.$options['pull'] : '';
unset($options['pull']);
return "\n\t".'<ul class="nav navbar-nav'.$align.'">'.$this->links('li', $links, $options).'</ul>';
} | php | public function menu(array $links, array $options = array())
{
$align = (isset($options['pull'])) ? ' navbar-'.$options['pull'] : '';
unset($options['pull']);
return "\n\t".'<ul class="nav navbar-nav'.$align.'">'.$this->links('li', $links, $options).'</ul>';
} | [
"public",
"function",
"menu",
"(",
"array",
"$",
"links",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"align",
"=",
"(",
"isset",
"(",
"$",
"options",
"[",
"'pull'",
"]",
")",
")",
"?",
"' navbar-'",
".",
"$",
"options",
... | Create a menu of links across your navbar.
@param array $links An ``array($name => $href, ...)`` of links. If ``$href`` is an array unto itself, then it will be turned into a dropdown menu with the same header and divider rules applied as with buttons.
@param array $options The options available here are:
- '**acti... | [
"Create",
"a",
"menu",
"of",
"links",
"across",
"your",
"navbar",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Navbar.php#L87-L93 |
17,920 | Kylob/Bootstrap | src/Navbar.php | Navbar.text | public function text($string, $pull = false)
{
$align = (in_array($pull, array('left', 'right'))) ? ' navbar-'.$pull : '';
return "\n\t".'<p class="navbar-text'.$align.'">'.$this->addClass($string, array('a' => 'navbar-link')).'</p>';
} | php | public function text($string, $pull = false)
{
$align = (in_array($pull, array('left', 'right'))) ? ' navbar-'.$pull : '';
return "\n\t".'<p class="navbar-text'.$align.'">'.$this->addClass($string, array('a' => 'navbar-link')).'</p>';
} | [
"public",
"function",
"text",
"(",
"$",
"string",
",",
"$",
"pull",
"=",
"false",
")",
"{",
"$",
"align",
"=",
"(",
"in_array",
"(",
"$",
"pull",
",",
"array",
"(",
"'left'",
",",
"'right'",
")",
")",
")",
"?",
"' navbar-'",
".",
"$",
"pull",
":"... | Add a string of text to your navbar.
@param string $string The message you would like to get across. It will be wrapped in a ``<p class="navbar-text">`` tag, and any ``<a>``'s will be classed with a '**navbar-link**'.
@param string $pull Either '**left**' or '**right**'.
@return string
@example
```php
echo $bp-... | [
"Add",
"a",
"string",
"of",
"text",
"to",
"your",
"navbar",
"."
] | 0d7677a90656fbc461eabb5512ab16f9d5f728c6 | https://github.com/Kylob/Bootstrap/blob/0d7677a90656fbc461eabb5512ab16f9d5f728c6/src/Navbar.php#L162-L167 |
17,921 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.assets | public function assets($type = 'css')
{
$output = [];
$assets = $this->Assets->getAssets($type);
foreach ($assets as $asset) {
$output[] = $asset['output'];
}
return implode($this->eol, $output);
} | php | public function assets($type = 'css')
{
$output = [];
$assets = $this->Assets->getAssets($type);
foreach ($assets as $asset) {
$output[] = $asset['output'];
}
return implode($this->eol, $output);
} | [
"public",
"function",
"assets",
"(",
"$",
"type",
"=",
"'css'",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"assets",
"=",
"$",
"this",
"->",
"Assets",
"->",
"getAssets",
"(",
"$",
"type",
")",
";",
"foreach",
"(",
"$",
"assets",
"as",
"$",... | Get assets fot layout render.
@param string $type
@return string | [
"Get",
"assets",
"fot",
"layout",
"render",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L118-L127 |
17,922 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.beforeLayout | public function beforeLayout(Event $event, $layoutFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeLayout');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeLayout')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $layoutFile... | php | public function beforeLayout(Event $event, $layoutFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeLayout');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeLayout')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $layoutFile... | [
"public",
"function",
"beforeLayout",
"(",
"Event",
"$",
"event",
",",
"$",
"layoutFile",
")",
"{",
"$",
"pluginEvent",
"=",
"Plugin",
"::",
"getData",
"(",
"'Core'",
",",
"'View.beforeLayout'",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"pluginEvent",
... | Is called before layout rendering starts. Receives the layout filename as an argument.
@param Event $event
@param string $layoutFile
@return void
@throws \JBZoo\Utils\Exception | [
"Is",
"called",
"before",
"layout",
"rendering",
"starts",
".",
"Receives",
"the",
"layout",
"filename",
"as",
"an",
"argument",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L138-L144 |
17,923 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.beforeRenderFile | public function beforeRenderFile(Event $event, $viewFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeRenderFile');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeRenderFile')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $... | php | public function beforeRenderFile(Event $event, $viewFile)
{
$pluginEvent = Plugin::getData('Core', 'View.beforeRenderFile');
if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeRenderFile')) {
call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $... | [
"public",
"function",
"beforeRenderFile",
"(",
"Event",
"$",
"event",
",",
"$",
"viewFile",
")",
"{",
"$",
"pluginEvent",
"=",
"Plugin",
"::",
"getData",
"(",
"'Core'",
",",
"'View.beforeRenderFile'",
")",
";",
"if",
"(",
"is_callable",
"(",
"$",
"pluginEven... | Is called before each view file is rendered. This includes elements, views, parent views and layouts.
@param Event $event
@param string $viewFile
@return void
@throws \JBZoo\Utils\Exception | [
"Is",
"called",
"before",
"each",
"view",
"file",
"is",
"rendered",
".",
"This",
"includes",
"elements",
"views",
"parent",
"views",
"and",
"layouts",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L176-L182 |
17,924 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.getBodyClasses | public function getBodyClasses()
{
$prefix = ($this->request->getParam('prefix')) ? 'prefix-' . $this->request->getParam('prefix') : 'prefix-site';
$classes = [
$prefix,
'theme-' . Str::low($this->_View->theme),
'plugin-' . Str::low($this->_View->plugin),
... | php | public function getBodyClasses()
{
$prefix = ($this->request->getParam('prefix')) ? 'prefix-' . $this->request->getParam('prefix') : 'prefix-site';
$classes = [
$prefix,
'theme-' . Str::low($this->_View->theme),
'plugin-' . Str::low($this->_View->plugin),
... | [
"public",
"function",
"getBodyClasses",
"(",
")",
"{",
"$",
"prefix",
"=",
"(",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'prefix'",
")",
")",
"?",
"'prefix-'",
".",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'prefix'",
")",
":",... | Get body classes by view data.
@return string | [
"Get",
"body",
"classes",
"by",
"view",
"data",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L189-L208 |
17,925 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.head | public function head()
{
$output = [
'meta' => $this->_View->fetch('meta'),
'assets' => $this->assets('css'),
'fetch_css' => $this->_View->fetch('css'),
'fetch_css_bottom' => $this->_View->fetch('css_bottom'),
];
r... | php | public function head()
{
$output = [
'meta' => $this->_View->fetch('meta'),
'assets' => $this->assets('css'),
'fetch_css' => $this->_View->fetch('css'),
'fetch_css_bottom' => $this->_View->fetch('css_bottom'),
];
r... | [
"public",
"function",
"head",
"(",
")",
"{",
"$",
"output",
"=",
"[",
"'meta'",
"=>",
"$",
"this",
"->",
"_View",
"->",
"fetch",
"(",
"'meta'",
")",
",",
"'assets'",
"=>",
"$",
"this",
"->",
"assets",
"(",
"'css'",
")",
",",
"'fetch_css'",
"=>",
"$... | Create head for layout.
@return string | [
"Create",
"head",
"for",
"layout",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L215-L225 |
17,926 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.lang | public function lang($isLang = true)
{
list($lang, $region) = explode('_', $this->locale);
return ($isLang) ? Str::low($lang) : Str::low($region);
} | php | public function lang($isLang = true)
{
list($lang, $region) = explode('_', $this->locale);
return ($isLang) ? Str::low($lang) : Str::low($region);
} | [
"public",
"function",
"lang",
"(",
"$",
"isLang",
"=",
"true",
")",
"{",
"list",
"(",
"$",
"lang",
",",
"$",
"region",
")",
"=",
"explode",
"(",
"'_'",
",",
"$",
"this",
"->",
"locale",
")",
";",
"return",
"(",
"$",
"isLang",
")",
"?",
"Str",
"... | Site language.
@param bool|true $isLang
@return string
@throws \Exception | [
"Site",
"language",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L251-L255 |
17,927 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.meta | public function meta(array $rows, $block = null)
{
$output = [];
foreach ($rows as $row) {
$output[] = trim($row);
}
$output = implode($this->eol, $output) . $this->eol;
if ($block !== null) {
$this->_View->append($block, $output);
return... | php | public function meta(array $rows, $block = null)
{
$output = [];
foreach ($rows as $row) {
$output[] = trim($row);
}
$output = implode($this->eol, $output) . $this->eol;
if ($block !== null) {
$this->_View->append($block, $output);
return... | [
"public",
"function",
"meta",
"(",
"array",
"$",
"rows",
",",
"$",
"block",
"=",
"null",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rows",
"as",
"$",
"row",
")",
"{",
"$",
"output",
"[",
"]",
"=",
"trim",
"(",
"$",
"ro... | Creates a link to an external resource and handles basic meta tags.
@param array $rows
@param null $block
@return null|string | [
"Creates",
"a",
"link",
"to",
"an",
"external",
"resource",
"and",
"handles",
"basic",
"meta",
"tags",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L264-L279 |
17,928 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper.type | public function type()
{
$lang = $this->lang();
$html = [
'<!doctype html>',
'<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7 ie6" '
. 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
'<!--[if IE 7]><html class="no-js lt-ie9 lt-i... | php | public function type()
{
$lang = $this->lang();
$html = [
'<!doctype html>',
'<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7 ie6" '
. 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
'<!--[if IE 7]><html class="no-js lt-ie9 lt-i... | [
"public",
"function",
"type",
"(",
")",
"{",
"$",
"lang",
"=",
"$",
"this",
"->",
"lang",
"(",
")",
";",
"$",
"html",
"=",
"[",
"'<!doctype html>'",
",",
"'<!--[if lt IE 7]><html class=\"no-js lt-ie9 lt-ie8 lt-ie7 ie6\" '",
".",
"'lang=\"'",
".",
"$",
"lang",
... | Create html 5 document type.
@return string
@throws \Exception | [
"Create",
"html",
"5",
"document",
"type",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L288-L305 |
17,929 | CakeCMS/Core | src/View/Helper/DocumentHelper.php | DocumentHelper._assignMeta | protected function _assignMeta($key)
{
if (Arr::key($key, $this->_View->viewVars)) {
$this->_View->assign($key, $this->_View->viewVars[$key]);
}
return $this;
} | php | protected function _assignMeta($key)
{
if (Arr::key($key, $this->_View->viewVars)) {
$this->_View->assign($key, $this->_View->viewVars[$key]);
}
return $this;
} | [
"protected",
"function",
"_assignMeta",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"Arr",
"::",
"key",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"_View",
"->",
"viewVars",
")",
")",
"{",
"$",
"this",
"->",
"_View",
"->",
"assign",
"(",
"$",
"key",
",",... | Assign data from view vars.
@param string $key
@return $this | [
"Assign",
"data",
"from",
"view",
"vars",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/DocumentHelper.php#L313-L320 |
17,930 | lode/fem | src/mysql.php | mysql.select | public static function select($type, $sql, $binds=null) {
if (in_array($type, self::$types) == false) {
$exception = bootstrap::get_library('exception');
throw new $exception('unknown select type');
}
$results = self::query($sql, $binds);
return self::{'as_'.$type}($results);
} | php | public static function select($type, $sql, $binds=null) {
if (in_array($type, self::$types) == false) {
$exception = bootstrap::get_library('exception');
throw new $exception('unknown select type');
}
$results = self::query($sql, $binds);
return self::{'as_'.$type}($results);
} | [
"public",
"static",
"function",
"select",
"(",
"$",
"type",
",",
"$",
"sql",
",",
"$",
"binds",
"=",
"null",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"type",
",",
"self",
"::",
"$",
"types",
")",
"==",
"false",
")",
"{",
"$",
"exception",
"=",
... | executes a SELECT statement, and returns the result as array, row, or single field
@param string $type one of the ::AS_* consts
@param string $sql the base sql statement
@param array $binds bind values for the given sql, @see ::merge()
@return array result set | [
"executes",
"a",
"SELECT",
"statement",
"and",
"returns",
"the",
"result",
"as",
"array",
"row",
"or",
"single",
"field"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L91-L99 |
17,931 | lode/fem | src/mysql.php | mysql.query | public static function query($sql, $binds=null) {
if (!empty($binds)) {
$sql = self::merge($sql, $binds);
}
// secure against wild update/delete statements
if (preg_match('{^(UPDATE|DELETE)\s}', $sql) && preg_match('{\s(WHERE|LIMIT)\s}', $sql) == false) {
$exception = bootstrap::get_library('exception');
th... | php | public static function query($sql, $binds=null) {
if (!empty($binds)) {
$sql = self::merge($sql, $binds);
}
// secure against wild update/delete statements
if (preg_match('{^(UPDATE|DELETE)\s}', $sql) && preg_match('{\s(WHERE|LIMIT)\s}', $sql) == false) {
$exception = bootstrap::get_library('exception');
th... | [
"public",
"static",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"binds",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"binds",
")",
")",
"{",
"$",
"sql",
"=",
"self",
"::",
"merge",
"(",
"$",
"sql",
",",
"$",
"binds",
")",
";... | executes any query on the database
protects against unsafe UPDATE or DELETE statements
blocks when they don't contain a WHERE or LIMIT clause
@param string $sql the base sql statement
@param array $binds bind values for the given sql, @see ::merge()
@return mysqli_result | [
"executes",
"any",
"query",
"on",
"the",
"database"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L111-L123 |
17,932 | lode/fem | src/mysql.php | mysql.merge | private static function merge($sql, $binds) {
if (is_array($binds) == false) {
$binds = (array)$binds;
}
if (is_null(self::$connection)) {
$exception = bootstrap::get_library('exception');
$response = bootstrap::get_library('response');
throw new $exception('no db connection', $response::STATUS_SERVICE_UNAV... | php | private static function merge($sql, $binds) {
if (is_array($binds) == false) {
$binds = (array)$binds;
}
if (is_null(self::$connection)) {
$exception = bootstrap::get_library('exception');
$response = bootstrap::get_library('response');
throw new $exception('no db connection', $response::STATUS_SERVICE_UNAV... | [
"private",
"static",
"function",
"merge",
"(",
"$",
"sql",
",",
"$",
"binds",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"binds",
")",
"==",
"false",
")",
"{",
"$",
"binds",
"=",
"(",
"array",
")",
"$",
"binds",
";",
"}",
"if",
"(",
"is_null",
... | merges bind values while escaping them
$sql can contain printf conversion specifications, i.e.:
- SELECT * WHERE `foo` = '%s';
- SELECT * WHERE `foo` > %d;
@param string $sql the base sql statement
@param array $binds bind values for the given sql
@return string input sql merged with bind values | [
"merges",
"bind",
"values",
"while",
"escaping",
"them"
] | c1c466c1a904d99452b341c5ae7cbc3e22b106e1 | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/mysql.php#L213-L228 |
17,933 | shi-yang/yii2-masonry | Masonry.php | Masonry.registerPlugin | protected function registerPlugin()
{
$id = $this->options['id'];
//get the displayed view and register the needed assets
$view = $this->getView();
MasonryAsset::register($view);
ImagesLoadedAsset::register($view);
$js = [];
$js[] = "var mscontainer$id = $('... | php | protected function registerPlugin()
{
$id = $this->options['id'];
//get the displayed view and register the needed assets
$view = $this->getView();
MasonryAsset::register($view);
ImagesLoadedAsset::register($view);
$js = [];
$js[] = "var mscontainer$id = $('... | [
"protected",
"function",
"registerPlugin",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"options",
"[",
"'id'",
"]",
";",
"//get the displayed view and register the needed assets",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"MasonryAss... | Registers the widget and the related events | [
"Registers",
"the",
"widget",
"and",
"the",
"related",
"events"
] | 7f50f65325af9d7e3a24eb20b99594ed4df14b44 | https://github.com/shi-yang/yii2-masonry/blob/7f50f65325af9d7e3a24eb20b99594ed4df14b44/Masonry.php#L73-L87 |
17,934 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.getError | public static function getError($unset = false)
{
JLog::add('JError::getError() is deprecated.', JLog::WARNING, 'deprecated');
if (!isset(self::$stack[0]))
{
return false;
}
if ($unset)
{
$error = array_shift(self::$stack);
}
else
{
$error = &self::$stack[0];
}
return $error;
} | php | public static function getError($unset = false)
{
JLog::add('JError::getError() is deprecated.', JLog::WARNING, 'deprecated');
if (!isset(self::$stack[0]))
{
return false;
}
if ($unset)
{
$error = array_shift(self::$stack);
}
else
{
$error = &self::$stack[0];
}
return $error;
} | [
"public",
"static",
"function",
"getError",
"(",
"$",
"unset",
"=",
"false",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::getError() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",... | Method for retrieving the last exception object in the error stack
@param boolean $unset True to remove the error from the stack.
@return JException|boolean Last JException object in the error stack or boolean false if none exist
@deprecated 12.1
@since 11.1 | [
"Method",
"for",
"retrieving",
"the",
"last",
"exception",
"object",
"in",
"the",
"error",
"stack"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L123-L142 |
17,935 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.addToStack | public static function addToStack(JException &$e)
{
JLog::add('JError::addToStack() is deprecated.', JLog::WARNING, 'deprecated');
self::$stack[] = &$e;
} | php | public static function addToStack(JException &$e)
{
JLog::add('JError::addToStack() is deprecated.', JLog::WARNING, 'deprecated');
self::$stack[] = &$e;
} | [
"public",
"static",
"function",
"addToStack",
"(",
"JException",
"&",
"$",
"e",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::addToStack() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"self",
"::",
"$",
"stack",
"[",
"]",
... | Method to add non-JError thrown JExceptions to the JError stack for debugging purposes
@param JException &$e Add an exception to the stack.
@return void
@since 11.1
@deprecated 12.1 | [
"Method",
"to",
"add",
"non",
"-",
"JError",
"thrown",
"JExceptions",
"to",
"the",
"JError",
"stack",
"for",
"debugging",
"purposes"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L169-L174 |
17,936 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.raise | public static function raise($level, $code, $msg, $info = null, $backtrace = false)
{
JLog::add('JError::raise() is deprecated.', JLog::WARNING, 'deprecated');
// Build error object
$class = $code == 404 ? 'JExceptionNotFound' : 'JException';
$exception = new $class($msg, $code, $level, $info, $backtrace)... | php | public static function raise($level, $code, $msg, $info = null, $backtrace = false)
{
JLog::add('JError::raise() is deprecated.', JLog::WARNING, 'deprecated');
// Build error object
$class = $code == 404 ? 'JExceptionNotFound' : 'JException';
$exception = new $class($msg, $code, $level, $info, $backtrace)... | [
"public",
"static",
"function",
"raise",
"(",
"$",
"level",
",",
"$",
"code",
",",
"$",
"msg",
",",
"$",
"info",
"=",
"null",
",",
"$",
"backtrace",
"=",
"false",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::raise() is deprecated.'",
",",
"JLog",
"::"... | Create a new JException object given the passed arguments
@param integer $level The error level - use any of PHP's own error levels for
this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR,
E_USER_WARNING, E_USER_NOTICE.
@param string $code The application-internal error code for this error
@param stri... | [
"Create",
"a",
"new",
"JException",
"object",
"given",
"the",
"passed",
"arguments"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L195-L204 |
17,937 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.setErrorHandling | public static function setErrorHandling($level, $mode, $options = null)
{
JLog::add('JError::setErrorHandling() is deprecated.', JLog::WARNING, 'deprecated');
$levels = self::$levels;
$function = 'handle' . ucfirst($mode);
if (!is_callable(array('JError', $function)))
{
return self::raiseError(E_ERROR,... | php | public static function setErrorHandling($level, $mode, $options = null)
{
JLog::add('JError::setErrorHandling() is deprecated.', JLog::WARNING, 'deprecated');
$levels = self::$levels;
$function = 'handle' . ucfirst($mode);
if (!is_callable(array('JError', $function)))
{
return self::raiseError(E_ERROR,... | [
"public",
"static",
"function",
"setErrorHandling",
"(",
"$",
"level",
",",
"$",
"mode",
",",
"$",
"options",
"=",
"null",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::setErrorHandling() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")"... | Method to set the way the JError will handle different error levels. Use this if you want to override the default settings.
Error handling modes:
- ignore
- echo
- verbose
- die
- message
- log
- callback
You may also set the error handling for several modes at once using PHP's bit operations.
Examples:
- E_ALL = Set... | [
"Method",
"to",
"set",
"the",
"way",
"the",
"JError",
"will",
"handle",
"different",
"error",
"levels",
".",
"Use",
"this",
"if",
"you",
"want",
"to",
"override",
"the",
"default",
"settings",
"."
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L370-L431 |
17,938 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.registerErrorLevel | public static function registerErrorLevel($level, $name, $handler = 'ignore')
{
JLog::add('JError::registerErrorLevel() is deprecated.', JLog::WARNING, 'deprecated');
if (isset(self::$levels[$level]))
{
return false;
}
self::$levels[$level] = $name;
self::setErrorHandling($level, $handler);
return ... | php | public static function registerErrorLevel($level, $name, $handler = 'ignore')
{
JLog::add('JError::registerErrorLevel() is deprecated.', JLog::WARNING, 'deprecated');
if (isset(self::$levels[$level]))
{
return false;
}
self::$levels[$level] = $name;
self::setErrorHandling($level, $handler);
return ... | [
"public",
"static",
"function",
"registerErrorLevel",
"(",
"$",
"level",
",",
"$",
"name",
",",
"$",
"handler",
"=",
"'ignore'",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::registerErrorLevel() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'... | Method to register a new error level for handling errors
This allows you to add custom error levels to the built-in
- E_NOTICE
- E_WARNING
- E_NOTICE
@param integer $level Error level to register
@param string $name Human readable name for the error level
@param string $handler Error handler to set... | [
"Method",
"to",
"register",
"a",
"new",
"error",
"level",
"for",
"handling",
"errors"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L482-L495 |
17,939 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.handleEcho | public static function handleEcho(&$error, $options)
{
JLog::add('JError::handleEcho() is deprecated.', JLog::WARNING, 'deprecated');
$level_human = self::translateErrorLevel($error->get('level'));
// If system debug is set, then output some more information.
if (JDEBUG)
{
$backtrace = $error->getTrace(... | php | public static function handleEcho(&$error, $options)
{
JLog::add('JError::handleEcho() is deprecated.', JLog::WARNING, 'deprecated');
$level_human = self::translateErrorLevel($error->get('level'));
// If system debug is set, then output some more information.
if (JDEBUG)
{
$backtrace = $error->getTrace(... | [
"public",
"static",
"function",
"handleEcho",
"(",
"&",
"$",
"error",
",",
"$",
"options",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::handleEcho() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"level_human",
"=",
"sel... | Echo error handler
- Echos the error message to output
@param JException &$error Exception object to handle
@param array $options Handler options
@return JException The exception object
@deprecated 12.1
@see JError::raise()
@since 11.1 | [
"Echo",
"error",
"handler",
"-",
"Echos",
"the",
"error",
"message",
"to",
"output"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L554-L615 |
17,940 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.handleVerbose | public static function handleVerbose(&$error, $options)
{
JLog::add('JError::handleVerbose() is deprecated.', JLog::WARNING, 'deprecated');
$level_human = self::translateErrorLevel($error->get('level'));
$info = $error->get('info');
if (isset($_SERVER['HTTP_HOST']))
{
// Output as html
echo "<br /><b... | php | public static function handleVerbose(&$error, $options)
{
JLog::add('JError::handleVerbose() is deprecated.', JLog::WARNING, 'deprecated');
$level_human = self::translateErrorLevel($error->get('level'));
$info = $error->get('info');
if (isset($_SERVER['HTTP_HOST']))
{
// Output as html
echo "<br /><b... | [
"public",
"static",
"function",
"handleVerbose",
"(",
"&",
"$",
"error",
",",
"$",
"options",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::handleVerbose() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"level_human",
"=",
... | Verbose error handler
- Echos the error message to output as well as related info
@param JException &$error Exception object to handle
@param array $options Handler options
@return JException The exception object
@deprecated 12.1
@see JError::raise()
@since 11.1 | [
"Verbose",
"error",
"handler",
"-",
"Echos",
"the",
"error",
"message",
"to",
"output",
"as",
"well",
"as",
"related",
"info"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L630-L661 |
17,941 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.handleDie | public static function handleDie(&$error, $options)
{
JLog::add('JError::handleDie() is deprecated.', JLog::WARNING, 'deprecated');
$level_human = self::translateErrorLevel($error->get('level'));
if (isset($_SERVER['HTTP_HOST']))
{
// Output as html
jexit("<br /><b>J$level_human</b>: " . $error->get('m... | php | public static function handleDie(&$error, $options)
{
JLog::add('JError::handleDie() is deprecated.', JLog::WARNING, 'deprecated');
$level_human = self::translateErrorLevel($error->get('level'));
if (isset($_SERVER['HTTP_HOST']))
{
// Output as html
jexit("<br /><b>J$level_human</b>: " . $error->get('m... | [
"public",
"static",
"function",
"handleDie",
"(",
"&",
"$",
"error",
",",
"$",
"options",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::handleDie() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"level_human",
"=",
"self"... | Die error handler
- Echos the error message to output and then dies
@param JException &$error Exception object to handle
@param array $options Handler options
@return void Calls die()
@deprecated 12.1
@see JError::raise()
@since 11.1 | [
"Die",
"error",
"handler",
"-",
"Echos",
"the",
"error",
"message",
"to",
"output",
"and",
"then",
"dies"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L676-L702 |
17,942 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.handleMessage | public static function handleMessage(&$error, $options)
{
JLog::add('JError::hanleMessage() is deprecated.', JLog::WARNING, 'deprecated');
$appl = JFactory::getApplication();
$type = ($error->get('level') == E_NOTICE) ? 'notice' : 'error';
$appl->enqueueMessage($error->get('message'), $type);
return $error... | php | public static function handleMessage(&$error, $options)
{
JLog::add('JError::hanleMessage() is deprecated.', JLog::WARNING, 'deprecated');
$appl = JFactory::getApplication();
$type = ($error->get('level') == E_NOTICE) ? 'notice' : 'error';
$appl->enqueueMessage($error->get('message'), $type);
return $error... | [
"public",
"static",
"function",
"handleMessage",
"(",
"&",
"$",
"error",
",",
"$",
"options",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::hanleMessage() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"appl",
"=",
"JFact... | Message error handler
Enqueues the error message into the system queue
@param JException &$error Exception object to handle
@param array $options Handler options
@return JException The exception object
@deprecated 12.1
@see JError::raise()
@since 11.1 | [
"Message",
"error",
"handler",
"Enqueues",
"the",
"error",
"message",
"into",
"the",
"system",
"queue"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L717-L726 |
17,943 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.handleLog | public static function handleLog(&$error, $options)
{
JLog::add('JError::handleLog() is deprecated.', JLog::WARNING, 'deprecated');
static $log;
if ($log == null)
{
$options['text_file'] = date('Y-m-d') . '.error.log';
$options['format'] = "{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}";
JLog::addLogge... | php | public static function handleLog(&$error, $options)
{
JLog::add('JError::handleLog() is deprecated.', JLog::WARNING, 'deprecated');
static $log;
if ($log == null)
{
$options['text_file'] = date('Y-m-d') . '.error.log';
$options['format'] = "{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}";
JLog::addLogge... | [
"public",
"static",
"function",
"handleLog",
"(",
"&",
"$",
"error",
",",
"$",
"options",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::handleLog() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"static",
"$",
"log",
";",
"i... | Log error handler
Logs the error message to a system log file
@param JException &$error Exception object to handle
@param array $options Handler options
@return JException The exception object
@deprecated 12.1
@see JError::raise()
@since 11.1 | [
"Log",
"error",
"handler",
"Logs",
"the",
"error",
"message",
"to",
"a",
"system",
"log",
"file"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L741-L763 |
17,944 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.handleCallback | public static function handleCallback(&$error, $options)
{
JLog::add('JError::handleCallback() is deprecated.', JLog::WARNING, 'deprecated');
return call_user_func($options, $error);
} | php | public static function handleCallback(&$error, $options)
{
JLog::add('JError::handleCallback() is deprecated.', JLog::WARNING, 'deprecated');
return call_user_func($options, $error);
} | [
"public",
"static",
"function",
"handleCallback",
"(",
"&",
"$",
"error",
",",
"$",
"options",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::handleCallback() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"return",
"call_user_func... | Callback error handler
- Send the error object to a callback method for error handling
@param JException &$error Exception object to handle
@param array $options Handler options
@return JException The exception object
@deprecated 12.1
@see JError::raise()
@since 11.1 | [
"Callback",
"error",
"handler",
"-",
"Send",
"the",
"error",
"object",
"to",
"a",
"callback",
"method",
"for",
"error",
"handling"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L778-L783 |
17,945 | joomlatools/joomlatools-platform-legacy | code/error/error.php | JError.customErrorHandler | public static function customErrorHandler($level, $msg)
{
JLog::add('JError::customErrorHandler() is deprecated.', JLog::WARNING, 'deprecated');
self::raise($level, '', $msg);
} | php | public static function customErrorHandler($level, $msg)
{
JLog::add('JError::customErrorHandler() is deprecated.', JLog::WARNING, 'deprecated');
self::raise($level, '', $msg);
} | [
"public",
"static",
"function",
"customErrorHandler",
"(",
"$",
"level",
",",
"$",
"msg",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JError::customErrorHandler() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"self",
"::",
"raise",
"... | Display a message to the user
@param integer $level The error level - use any of PHP's own error levels
for this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR,
E_USER_WARNING, E_USER_NOTICE.
@param string $msg Error message, shown to user if need be.
@return void
@deprecated 12.1
@since 11.1 | [
"Display",
"a",
"message",
"to",
"the",
"user"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/error/error.php#L815-L820 |
17,946 | aedart/laravel-helpers | src/Traits/Filesystem/StorageTrait.php | StorageTrait.getDefaultStorage | public function getDefaultStorage(): ?Filesystem
{
// By default, the Storage Facade does not return the
// any actual storage fisk, but rather an
// instance of \Illuminate\Filesystem\FilesystemManager.
// Therefore, we make sure only to obtain its
// "disk", to make sure th... | php | public function getDefaultStorage(): ?Filesystem
{
// By default, the Storage Facade does not return the
// any actual storage fisk, but rather an
// instance of \Illuminate\Filesystem\FilesystemManager.
// Therefore, we make sure only to obtain its
// "disk", to make sure th... | [
"public",
"function",
"getDefaultStorage",
"(",
")",
":",
"?",
"Filesystem",
"{",
"// By default, the Storage Facade does not return the",
"// any actual storage fisk, but rather an",
"// instance of \\Illuminate\\Filesystem\\FilesystemManager.",
"// Therefore, we make sure only to obtain it... | Get a default storage value, if any is available
@return Filesystem|null A default storage value or Null if no default value is available | [
"Get",
"a",
"default",
"storage",
"value",
"if",
"any",
"is",
"available"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Filesystem/StorageTrait.php#L76-L89 |
17,947 | yuncms/framework | src/sms/gateways/YuntongxunGateway.php | YuntongxunGateway.buildEndpoint | protected function buildEndpoint($type, $resource, $datetime)
{
$accountType = $this->isSubAccount ? 'SubAccounts' : 'Accounts';
$sig = strtoupper(md5($this->accountSid . $this->accountToken . $datetime));
return sprintf(self::ENDPOINT_TEMPLATE, self::SERVER_IP, self::SERVER_PORT, self::SDK_... | php | protected function buildEndpoint($type, $resource, $datetime)
{
$accountType = $this->isSubAccount ? 'SubAccounts' : 'Accounts';
$sig = strtoupper(md5($this->accountSid . $this->accountToken . $datetime));
return sprintf(self::ENDPOINT_TEMPLATE, self::SERVER_IP, self::SERVER_PORT, self::SDK_... | [
"protected",
"function",
"buildEndpoint",
"(",
"$",
"type",
",",
"$",
"resource",
",",
"$",
"datetime",
")",
"{",
"$",
"accountType",
"=",
"$",
"this",
"->",
"isSubAccount",
"?",
"'SubAccounts'",
":",
"'Accounts'",
";",
"$",
"sig",
"=",
"strtoupper",
"(",
... | Build endpoint url.
@param string $type
@param string $resource
@param string $datetime
@return string | [
"Build",
"endpoint",
"url",
"."
] | af42e28ea4ae15ab8eead3f6d119f93863b94154 | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/sms/gateways/YuntongxunGateway.php#L121-L126 |
17,948 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.add | public function add($field, $op, $value) {
$param = new Expr($field, $op, $value);
$this->_params[] = $param;
if ($param->useValue()) {
$this->addBinding($field, $value);
}
return $this;
} | php | public function add($field, $op, $value) {
$param = new Expr($field, $op, $value);
$this->_params[] = $param;
if ($param->useValue()) {
$this->addBinding($field, $value);
}
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"field",
",",
"$",
"op",
",",
"$",
"value",
")",
"{",
"$",
"param",
"=",
"new",
"Expr",
"(",
"$",
"field",
",",
"$",
"op",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"_params",
"[",
"]",
"=",
"$",
... | Process a parameter before adding it to the list.
Set the primary predicate type if it has not been set.
@param string $field
@param string $op
@param mixed $value
@return $this | [
"Process",
"a",
"parameter",
"before",
"adding",
"it",
"to",
"the",
"list",
".",
"Set",
"the",
"primary",
"predicate",
"type",
"if",
"it",
"has",
"not",
"been",
"set",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L58-L68 |
17,949 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.also | public function also(Closure $callback) {
$predicate = new Predicate(self::ALSO);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | php | public function also(Closure $callback) {
$predicate = new Predicate(self::ALSO);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | [
"public",
"function",
"also",
"(",
"Closure",
"$",
"callback",
")",
"{",
"$",
"predicate",
"=",
"new",
"Predicate",
"(",
"self",
"::",
"ALSO",
")",
";",
"$",
"predicate",
"->",
"bindCallback",
"(",
"$",
"callback",
")",
";",
"$",
"this",
"->",
"_params... | Generate a new sub-grouped AND predicate.
@param \Closure $callback
@return $this | [
"Generate",
"a",
"new",
"sub",
"-",
"grouped",
"AND",
"predicate",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L76-L85 |
17,950 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.between | public function between($field, $start, $end) {
$this->add($field, Expr::BETWEEN, [$start, $end]);
return $this;
} | php | public function between($field, $start, $end) {
$this->add($field, Expr::BETWEEN, [$start, $end]);
return $this;
} | [
"public",
"function",
"between",
"(",
"$",
"field",
",",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"field",
",",
"Expr",
"::",
"BETWEEN",
",",
"[",
"$",
"start",
",",
"$",
"end",
"]",
")",
";",
"return",
"$",
... | Adds a between range "BETWEEN" expression.
@param string $field
@param int $start
@param int $end
@return $this | [
"Adds",
"a",
"between",
"range",
"BETWEEN",
"expression",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L95-L99 |
17,951 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.bindCallback | public function bindCallback(Closure $callback, $query = null) {
call_user_func_array($callback, [$this, $query]);
return $this;
} | php | public function bindCallback(Closure $callback, $query = null) {
call_user_func_array($callback, [$this, $query]);
return $this;
} | [
"public",
"function",
"bindCallback",
"(",
"Closure",
"$",
"callback",
",",
"$",
"query",
"=",
"null",
")",
"{",
"call_user_func_array",
"(",
"$",
"callback",
",",
"[",
"$",
"this",
",",
"$",
"query",
"]",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Bind a Closure callback to this predicate and execute it.
@param \Closure $callback
@param \Titon\Db\Query $query
@return $this | [
"Bind",
"a",
"Closure",
"callback",
"to",
"this",
"predicate",
"and",
"execute",
"it",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L108-L112 |
17,952 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.either | public function either(Closure $callback) {
$predicate = new Predicate(self::EITHER);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | php | public function either(Closure $callback) {
$predicate = new Predicate(self::EITHER);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | [
"public",
"function",
"either",
"(",
"Closure",
"$",
"callback",
")",
"{",
"$",
"predicate",
"=",
"new",
"Predicate",
"(",
"self",
"::",
"EITHER",
")",
";",
"$",
"predicate",
"->",
"bindCallback",
"(",
"$",
"callback",
")",
";",
"$",
"this",
"->",
"_pa... | Generate a new sub-grouped OR predicate.
@param \Closure $callback
@return $this | [
"Generate",
"a",
"new",
"sub",
"-",
"grouped",
"OR",
"predicate",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L120-L129 |
17,953 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.eq | public function eq($field, $value) {
if (is_array($value)) {
$this->in($field, $value);
} else if ($value === null) {
$this->null($field);
} else {
$this->add($field, '=', $value);
}
return $this;
} | php | public function eq($field, $value) {
if (is_array($value)) {
$this->in($field, $value);
} else if ($value === null) {
$this->null($field);
} else {
$this->add($field, '=', $value);
}
return $this;
} | [
"public",
"function",
"eq",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"in",
"(",
"$",
"field",
",",
"$",
"value",
")",
";",
"}",
"else",
"if",
"(",
"$",
"value"... | Adds an equals "=" expression.
@param string $field
@param mixed $value
@return $this | [
"Adds",
"an",
"equals",
"=",
"expression",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L138-L150 |
17,954 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.hasParam | public function hasParam($field) {
foreach ($this->getParams() as $param) {
if ($param instanceof Expr && $param->getField() === $field) {
return true;
}
}
return false;
} | php | public function hasParam($field) {
foreach ($this->getParams() as $param) {
if ($param instanceof Expr && $param->getField() === $field) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasParam",
"(",
"$",
"field",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getParams",
"(",
")",
"as",
"$",
"param",
")",
"{",
"if",
"(",
"$",
"param",
"instanceof",
"Expr",
"&&",
"$",
"param",
"->",
"getField",
"(",
")",
"=... | Return true if a field has been used in a param.
@param string $field
@return bool | [
"Return",
"true",
"if",
"a",
"field",
"has",
"been",
"used",
"in",
"a",
"param",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L214-L222 |
17,955 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.like | public function like($field, $value) {
$this->add($field, Expr::LIKE, $value);
return $this;
} | php | public function like($field, $value) {
$this->add($field, Expr::LIKE, $value);
return $this;
} | [
"public",
"function",
"like",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"field",
",",
"Expr",
"::",
"LIKE",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Adds a like wildcard "LIKE" expression.
@param string $field
@param mixed $value
@return $this | [
"Adds",
"a",
"like",
"wildcard",
"LIKE",
"expression",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L244-L248 |
17,956 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.maybe | public function maybe(Closure $callback) {
$predicate = new Predicate(self::MAYBE);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | php | public function maybe(Closure $callback) {
$predicate = new Predicate(self::MAYBE);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | [
"public",
"function",
"maybe",
"(",
"Closure",
"$",
"callback",
")",
"{",
"$",
"predicate",
"=",
"new",
"Predicate",
"(",
"self",
"::",
"MAYBE",
")",
";",
"$",
"predicate",
"->",
"bindCallback",
"(",
"$",
"callback",
")",
";",
"$",
"this",
"->",
"_para... | Generate a new sub-grouped XOR predicate.
@param \Closure $callback
@return $this | [
"Generate",
"a",
"new",
"sub",
"-",
"grouped",
"XOR",
"predicate",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L282-L291 |
17,957 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.neither | public function neither(Closure $callback) {
$predicate = new Predicate(self::NEITHER);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | php | public function neither(Closure $callback) {
$predicate = new Predicate(self::NEITHER);
$predicate->bindCallback($callback);
$this->_params[] = $predicate;
$this->addBinding(null, $predicate);
return $this;
} | [
"public",
"function",
"neither",
"(",
"Closure",
"$",
"callback",
")",
"{",
"$",
"predicate",
"=",
"new",
"Predicate",
"(",
"self",
"::",
"NEITHER",
")",
";",
"$",
"predicate",
"->",
"bindCallback",
"(",
"$",
"callback",
")",
";",
"$",
"this",
"->",
"_... | Generate a new sub-grouped NOR predicate.
@param \Closure $callback
@return $this | [
"Generate",
"a",
"new",
"sub",
"-",
"grouped",
"NOR",
"predicate",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L299-L308 |
17,958 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.notBetween | public function notBetween($field, $start, $end) {
$this->add($field, Expr::NOT_BETWEEN, [$start, $end]);
return $this;
} | php | public function notBetween($field, $start, $end) {
$this->add($field, Expr::NOT_BETWEEN, [$start, $end]);
return $this;
} | [
"public",
"function",
"notBetween",
"(",
"$",
"field",
",",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"field",
",",
"Expr",
"::",
"NOT_BETWEEN",
",",
"[",
"$",
"start",
",",
"$",
"end",
"]",
")",
";",
"return",
... | Adds a not between range "NOT BETWEEN" expression.
@param string $field
@param int $start
@param int $end
@return $this | [
"Adds",
"a",
"not",
"between",
"range",
"NOT",
"BETWEEN",
"expression",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L318-L322 |
17,959 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.notEq | public function notEq($field, $value) {
if (is_array($value)) {
$this->notIn($field, $value);
} else if ($value === null) {
$this->notNull($field);
} else {
$this->add($field, '!=', $value);
}
return $this;
} | php | public function notEq($field, $value) {
if (is_array($value)) {
$this->notIn($field, $value);
} else if ($value === null) {
$this->notNull($field);
} else {
$this->add($field, '!=', $value);
}
return $this;
} | [
"public",
"function",
"notEq",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"notIn",
"(",
"$",
"field",
",",
"$",
"value",
")",
";",
"}",
"else",
"if",
"(",
"$",
"... | Adds a not equals "!=" expression.
@param string $field
@param mixed $value
@return $this | [
"Adds",
"a",
"not",
"equals",
"!",
"=",
"expression",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L331-L343 |
17,960 | titon/db | src/Titon/Db/Query/Predicate.php | Predicate.notLike | public function notLike($field, $value) {
$this->add($field, Expr::NOT_LIKE, $value);
return $this;
} | php | public function notLike($field, $value) {
$this->add($field, Expr::NOT_LIKE, $value);
return $this;
} | [
"public",
"function",
"notLike",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"field",
",",
"Expr",
"::",
"NOT_LIKE",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Adds a not like wildcard "LIKE" expression.
@param string $field
@param mixed $value
@return $this | [
"Adds",
"a",
"not",
"like",
"wildcard",
"LIKE",
"expression",
"."
] | fbc5159d1ce9d2139759c9367565986981485604 | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/Predicate.php#L365-L369 |
17,961 | vorbind/influx-analytics | src/AnalyticsTrait.php | AnalyticsTrait.getTimezoneHourOffset | public function getTimezoneHourOffset($origin_tz = 'UTC', $format = 'h') {
$remote_tz = 'UTC';
if ($origin_tz === 'UTC') {
return 0 . 'h';
}
$origin_dtz = new \DateTimeZone($origin_tz);
$remote_dtz = new \DateTimeZone($remote_tz);
$origin_dt = new \DateTime("n... | php | public function getTimezoneHourOffset($origin_tz = 'UTC', $format = 'h') {
$remote_tz = 'UTC';
if ($origin_tz === 'UTC') {
return 0 . 'h';
}
$origin_dtz = new \DateTimeZone($origin_tz);
$remote_dtz = new \DateTimeZone($remote_tz);
$origin_dt = new \DateTime("n... | [
"public",
"function",
"getTimezoneHourOffset",
"(",
"$",
"origin_tz",
"=",
"'UTC'",
",",
"$",
"format",
"=",
"'h'",
")",
"{",
"$",
"remote_tz",
"=",
"'UTC'",
";",
"if",
"(",
"$",
"origin_tz",
"===",
"'UTC'",
")",
"{",
"return",
"0",
".",
"'h'",
";",
... | Get timezone offset in hours
@param string $origin_tz
@param string $format
@return int | [
"Get",
"timezone",
"offset",
"in",
"hours"
] | 8c0c150351f045ccd3d57063f2b3b50a2c926e3e | https://github.com/vorbind/influx-analytics/blob/8c0c150351f045ccd3d57063f2b3b50a2c926e3e/src/AnalyticsTrait.php#L33-L45 |
17,962 | vorbind/influx-analytics | src/AnalyticsTrait.php | AnalyticsTrait.arrayMultiSearch | public function arrayMultiSearch($needle, $haystack) {
foreach ($haystack as $key => $data) {
if (in_array($needle, $data)) {
return $key;
}
}
return false;
} | php | public function arrayMultiSearch($needle, $haystack) {
foreach ($haystack as $key => $data) {
if (in_array($needle, $data)) {
return $key;
}
}
return false;
} | [
"public",
"function",
"arrayMultiSearch",
"(",
"$",
"needle",
",",
"$",
"haystack",
")",
"{",
"foreach",
"(",
"$",
"haystack",
"as",
"$",
"key",
"=>",
"$",
"data",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"needle",
",",
"$",
"data",
")",
")",
"{"... | Find key by sub value
@param string $needle
@param array $haystack
@return string | [
"Find",
"key",
"by",
"sub",
"value"
] | 8c0c150351f045ccd3d57063f2b3b50a2c926e3e | https://github.com/vorbind/influx-analytics/blob/8c0c150351f045ccd3d57063f2b3b50a2c926e3e/src/AnalyticsTrait.php#L68-L75 |
17,963 | opis/container | src/Container.php | Container.resolve | protected function resolve(string $abstract, array &$stack = []): Dependency
{
if (isset($this->aliases[$abstract])) {
$alias = $this->aliases[$abstract];
if (in_array($alias, $stack)) {
$stack[] = $alias;
$error = implode(' => ', $stack);
... | php | protected function resolve(string $abstract, array &$stack = []): Dependency
{
if (isset($this->aliases[$abstract])) {
$alias = $this->aliases[$abstract];
if (in_array($alias, $stack)) {
$stack[] = $alias;
$error = implode(' => ', $stack);
... | [
"protected",
"function",
"resolve",
"(",
"string",
"$",
"abstract",
",",
"array",
"&",
"$",
"stack",
"=",
"[",
"]",
")",
":",
"Dependency",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"abstract",
"]",
")",
")",
"{",
"$",
... | Resolves an abstract type
@param string $abstract
@param array $stack
@return Dependency | [
"Resolves",
"an",
"abstract",
"type"
] | 3cc9da8392e912ad8854ba584f2899a077e067e7 | https://github.com/opis/container/blob/3cc9da8392e912ad8854ba584f2899a077e067e7/src/Container.php#L179-L199 |
17,964 | opis/container | src/Container.php | Container.build | protected function build($concrete, array $arguments = [])
{
if (is_callable($concrete)) {
return $concrete($this, $arguments);
}
if (isset($this->reflectionClass[$concrete])) {
$reflection = $this->reflectionClass[$concrete];
} else {
try {
... | php | protected function build($concrete, array $arguments = [])
{
if (is_callable($concrete)) {
return $concrete($this, $arguments);
}
if (isset($this->reflectionClass[$concrete])) {
$reflection = $this->reflectionClass[$concrete];
} else {
try {
... | [
"protected",
"function",
"build",
"(",
"$",
"concrete",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"concrete",
")",
")",
"{",
"return",
"$",
"concrete",
"(",
"$",
"this",
",",
"$",
"arguments",
")",
... | Builds an instance of a concrete type
@param string|callable $concrete
@param array $arguments
@return object | [
"Builds",
"an",
"instance",
"of",
"a",
"concrete",
"type"
] | 3cc9da8392e912ad8854ba584f2899a077e067e7 | https://github.com/opis/container/blob/3cc9da8392e912ad8854ba584f2899a077e067e7/src/Container.php#L208-L269 |
17,965 | arsengoian/viper-framework | src/Viper/Template/Viper.php | Viper.parse | public function parse() {
/** @noinspection PhpParamsInspection */
return $this -> execute(Util::cache(
$this -> file,
$this -> raw,
'viper',
function($data): NodeCollection {
$tokens = $this -> tokenize($data);
return $this -> formLogicalTree($tokens);
}
), $this -> data);
} | php | public function parse() {
/** @noinspection PhpParamsInspection */
return $this -> execute(Util::cache(
$this -> file,
$this -> raw,
'viper',
function($data): NodeCollection {
$tokens = $this -> tokenize($data);
return $this -> formLogicalTree($tokens);
}
), $this -> data);
} | [
"public",
"function",
"parse",
"(",
")",
"{",
"/** @noinspection PhpParamsInspection */",
"return",
"$",
"this",
"->",
"execute",
"(",
"Util",
"::",
"cache",
"(",
"$",
"this",
"->",
"file",
",",
"$",
"this",
"->",
"raw",
",",
"'viper'",
",",
"function",
"(... | Chief executive viper function | [
"Chief",
"executive",
"viper",
"function"
] | 22796c5cc219cae3ca0b4af370a347ba2acab0f2 | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Template/Viper.php#L39-L50 |
17,966 | xinix-technology/norm | src/Norm/Connection.php | Connection.factory | public function factory($collection)
{
if ($collection instanceof Collection) {
$collectionName = $collection->getName();
} else {
$collectionName = $collection;
}
if (!isset($this->collections[$collectionName])) {
if (!($collection instanceof Col... | php | public function factory($collection)
{
if ($collection instanceof Collection) {
$collectionName = $collection->getName();
} else {
$collectionName = $collection;
}
if (!isset($this->collections[$collectionName])) {
if (!($collection instanceof Col... | [
"public",
"function",
"factory",
"(",
"$",
"collection",
")",
"{",
"if",
"(",
"$",
"collection",
"instanceof",
"Collection",
")",
"{",
"$",
"collectionName",
"=",
"$",
"collection",
"->",
"getName",
"(",
")",
";",
"}",
"else",
"{",
"$",
"collectionName",
... | Factory to create new collection by its name or instance
@param string|Norm\Collection $collection Collection name or instance
@return Norm\Collection Conllection created by factory | [
"Factory",
"to",
"create",
"new",
"collection",
"by",
"its",
"name",
"or",
"instance"
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection.php#L102-L124 |
17,967 | xinix-technology/norm | src/Norm/Connection.php | Connection.unmarshall | public function unmarshall($object)
{
if (isset($object['id'])) {
$object['$id'] = $object['id'];
unset($object['id']);
}
foreach ($object as $key => $value) {
if ($key[0] === '_') {
$key[0] = '$';
$object[$key] = $value;
... | php | public function unmarshall($object)
{
if (isset($object['id'])) {
$object['$id'] = $object['id'];
unset($object['id']);
}
foreach ($object as $key => $value) {
if ($key[0] === '_') {
$key[0] = '$';
$object[$key] = $value;
... | [
"public",
"function",
"unmarshall",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"object",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"object",
"[",
"'$id'",
"]",
"=",
"$",
"object",
"[",
"'id'",
"]",
";",
"unset",
"(",
"$",
"object",
... | Unmarshall single object from data source to associative array.
The unmarshall process is necessary due to different data type provided
by data source. Proper unmarshall will make sure data from data source
that will be consumed by Norm in the accepted form of data.
@see Norm\Connection::marshall()
@param mixed $obje... | [
"Unmarshall",
"single",
"object",
"from",
"data",
"source",
"to",
"associative",
"array",
".",
"The",
"unmarshall",
"process",
"is",
"necessary",
"due",
"to",
"different",
"data",
"type",
"provided",
"by",
"data",
"source",
".",
"Proper",
"unmarshall",
"will",
... | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection.php#L138-L153 |
17,968 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Entry/Atom.php | Zend_Feed_Entry_Atom.delete | public function delete()
{
// Look for link rel="edit" in the entry object.
$deleteUri = $this->link('edit');
if (!$deleteUri) {
/**
* @see Zend_Feed_Exception
*/
require_once 'Zend/Feed/Exception.php';
throw new Zend_Feed_Excepti... | php | public function delete()
{
// Look for link rel="edit" in the entry object.
$deleteUri = $this->link('edit');
if (!$deleteUri) {
/**
* @see Zend_Feed_Exception
*/
require_once 'Zend/Feed/Exception.php';
throw new Zend_Feed_Excepti... | [
"public",
"function",
"delete",
"(",
")",
"{",
"// Look for link rel=\"edit\" in the entry object.",
"$",
"deleteUri",
"=",
"$",
"this",
"->",
"link",
"(",
"'edit'",
")",
";",
"if",
"(",
"!",
"$",
"deleteUri",
")",
"{",
"/**\n * @see Zend_Feed_Exception\... | Delete an atom entry.
Delete tries to delete this entry from its feed. If the entry
does not contain a link rel="edit", we throw an error (either
the entry does not yet exist or this is not an editable
feed). If we have a link rel="edit", we do the empty-body
HTTP DELETE to that URI and check for a response of 2xx.
Us... | [
"Delete",
"an",
"atom",
"entry",
"."
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Entry/Atom.php#L74-L114 |
17,969 | 2amigos/yiifoundation | widgets/Breadcrumbs.php | Breadcrumbs.initItems | public function initItems()
{
if (!empty($this->items)) {
$links = array();
if ($this->homeLabel !== false) {
$label = $this->homeLabel !== null ? $this->homeLabel : Icon::icon(Enum::ICON_HOME);
$links[$label] = array('href' => $this->homeUrl !... | php | public function initItems()
{
if (!empty($this->items)) {
$links = array();
if ($this->homeLabel !== false) {
$label = $this->homeLabel !== null ? $this->homeLabel : Icon::icon(Enum::ICON_HOME);
$links[$label] = array('href' => $this->homeUrl !... | [
"public",
"function",
"initItems",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"items",
")",
")",
"{",
"$",
"links",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"homeLabel",
"!==",
"false",
")",
"{",
"$",
"lab... | Initializes menu items | [
"Initializes",
"menu",
"items"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Breadcrumbs.php#L71-L96 |
17,970 | 2amigos/yiifoundation | widgets/Breadcrumbs.php | Breadcrumbs.renderItem | public function renderItem($label, $options = array())
{
if ($this->tagName === 'nav') {
$url = ArrayHelper::removeValue($options, 'href', '#');
$htmlOptions = ArrayHelper::removeValue($options, 'options', array());
echo \CHtml::openTag('li', $htmlOptions);
... | php | public function renderItem($label, $options = array())
{
if ($this->tagName === 'nav') {
$url = ArrayHelper::removeValue($options, 'href', '#');
$htmlOptions = ArrayHelper::removeValue($options, 'options', array());
echo \CHtml::openTag('li', $htmlOptions);
... | [
"public",
"function",
"renderItem",
"(",
"$",
"label",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"tagName",
"===",
"'nav'",
")",
"{",
"$",
"url",
"=",
"ArrayHelper",
"::",
"removeValue",
"(",
"$",
"options",... | Generates the rendering of a breadcrumb item
@param string $label
@param array $options | [
"Generates",
"the",
"rendering",
"of",
"a",
"breadcrumb",
"item"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Breadcrumbs.php#L120-L132 |
17,971 | forxer/tao | src/Tao/Html/Modifiers.php | Modifiers.strToSlug | static public function strToSlug($string, $bWithSlashes = true)
{
switch ($GLOBALS['okt']->config->slug_type)
{
case 'utf8':
return self::tidyURL($string, $bWithSlashes);
case 'ascii':
default:
return self::strToLowerURL($string, $bWithSlashes);
}
} | php | static public function strToSlug($string, $bWithSlashes = true)
{
switch ($GLOBALS['okt']->config->slug_type)
{
case 'utf8':
return self::tidyURL($string, $bWithSlashes);
case 'ascii':
default:
return self::strToLowerURL($string, $bWithSlashes);
}
} | [
"static",
"public",
"function",
"strToSlug",
"(",
"$",
"string",
",",
"$",
"bWithSlashes",
"=",
"true",
")",
"{",
"switch",
"(",
"$",
"GLOBALS",
"[",
"'okt'",
"]",
"->",
"config",
"->",
"slug_type",
")",
"{",
"case",
"'utf8'",
":",
"return",
"self",
":... | Transform a string in slug regarding to Okatea configuration.
@param string $string String to transform
@param boolean $bWithSlashes
in URL
@return string | [
"Transform",
"a",
"string",
"in",
"slug",
"regarding",
"to",
"Okatea",
"configuration",
"."
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Html/Modifiers.php#L28-L39 |
17,972 | forxer/tao | src/Tao/Html/Modifiers.php | Modifiers.strToUrl | public static function strToUrl($string, $bWithSlashes = true)
{
$string = self::deaccent($string);
$string = preg_replace('/[^A-Za-z0-9_\s\'\:\/[\]-]/', '', $string);
return self::tidyUrl($string, $bWithSlashes);
} | php | public static function strToUrl($string, $bWithSlashes = true)
{
$string = self::deaccent($string);
$string = preg_replace('/[^A-Za-z0-9_\s\'\:\/[\]-]/', '', $string);
return self::tidyUrl($string, $bWithSlashes);
} | [
"public",
"static",
"function",
"strToUrl",
"(",
"$",
"string",
",",
"$",
"bWithSlashes",
"=",
"true",
")",
"{",
"$",
"string",
"=",
"self",
"::",
"deaccent",
"(",
"$",
"string",
")",
";",
"$",
"string",
"=",
"preg_replace",
"(",
"'/[^A-Za-z0-9_\\s\\'\\:\\... | String to URL
Transforms a string to a proper URL.
@copyright Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
@license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@param string $string String to transform
@param boolean $bWithSlashes in URL
@return string | [
"String",
"to",
"URL"
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Html/Modifiers.php#L53-L59 |
17,973 | forxer/tao | src/Tao/Html/Modifiers.php | Modifiers.strToCamelCase | static public function strToCamelCase($string)
{
$string = self::strToLowerUrl($string, false);
$string = implode('', array_map('ucfirst', explode('_', $string)));
$string = implode('', array_map('ucfirst', explode('-', $string)));
return strtolower(substr($string, 0, 1)) . substr($string, 1);
} | php | static public function strToCamelCase($string)
{
$string = self::strToLowerUrl($string, false);
$string = implode('', array_map('ucfirst', explode('_', $string)));
$string = implode('', array_map('ucfirst', explode('-', $string)));
return strtolower(substr($string, 0, 1)) . substr($string, 1);
} | [
"static",
"public",
"function",
"strToCamelCase",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"self",
"::",
"strToLowerUrl",
"(",
"$",
"string",
",",
"false",
")",
";",
"$",
"string",
"=",
"implode",
"(",
"''",
",",
"array_map",
"(",
"'ucfirst'",
... | Transform a string in a camelCase style.
@param string $string
@return string | [
"Transform",
"a",
"string",
"in",
"a",
"camelCase",
"style",
"."
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Html/Modifiers.php#L81-L89 |
17,974 | forxer/tao | src/Tao/Html/Modifiers.php | Modifiers.deaccent | public static function deaccent($string)
{
$pattern = [];
$pattern['A'] = '\x{00C0}-\x{00C5}';
$pattern['AE'] = '\x{00C6}';
$pattern['C'] = '\x{00C7}';
$pattern['D'] = '\x{00D0}';
$pattern['E'] = '\x{00C8}-\x{00CB}';
$pattern['I'] = '\x{00CC}-\x{00CF}';
$pattern['N'] = '\x{00D1}';
$pattern['O'] = '\... | php | public static function deaccent($string)
{
$pattern = [];
$pattern['A'] = '\x{00C0}-\x{00C5}';
$pattern['AE'] = '\x{00C6}';
$pattern['C'] = '\x{00C7}';
$pattern['D'] = '\x{00D0}';
$pattern['E'] = '\x{00C8}-\x{00CB}';
$pattern['I'] = '\x{00CC}-\x{00CF}';
$pattern['N'] = '\x{00D1}';
$pattern['O'] = '\... | [
"public",
"static",
"function",
"deaccent",
"(",
"$",
"string",
")",
"{",
"$",
"pattern",
"=",
"[",
"]",
";",
"$",
"pattern",
"[",
"'A'",
"]",
"=",
"'\\x{00C0}-\\x{00C5}'",
";",
"$",
"pattern",
"[",
"'AE'",
"]",
"=",
"'\\x{00C6}'",
";",
"$",
"pattern",... | Accents replacement.
Replaces some occidental accentuated characters by their ASCII
representation.
@copyright Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
@license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@param string $string
deaccent
@return string | [
"Accents",
"replacement",
"."
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Html/Modifiers.php#L117-L156 |
17,975 | forxer/tao | src/Tao/Html/Modifiers.php | Modifiers.tidyUrl | public static function tidyUrl($string, $bKeepSlashes = true, $bKeepSpaces = false)
{
$string = strip_tags($string);
$string = str_replace([
'?',
'&',
'#',
'=',
'+',
'<',
'>',
'"',
'%'
], '', $string);
$string = str_replace("'", ' ', $string);
$string = preg_replace('/[\s]+/u', ' '... | php | public static function tidyUrl($string, $bKeepSlashes = true, $bKeepSpaces = false)
{
$string = strip_tags($string);
$string = str_replace([
'?',
'&',
'#',
'=',
'+',
'<',
'>',
'"',
'%'
], '', $string);
$string = str_replace("'", ' ', $string);
$string = preg_replace('/[\s]+/u', ' '... | [
"public",
"static",
"function",
"tidyUrl",
"(",
"$",
"string",
",",
"$",
"bKeepSlashes",
"=",
"true",
",",
"$",
"bKeepSpaces",
"=",
"false",
")",
"{",
"$",
"string",
"=",
"strip_tags",
"(",
"$",
"string",
")",
";",
"$",
"string",
"=",
"str_replace",
"(... | URL cleanup.
@copyright Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
@license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@param string $string
tidy
@param boolean $bKeepSlashes
in URL
@param boolean $bKeepSpaces
in URL
@return string | [
"URL",
"cleanup",
"."
] | b5e9109c244a29a72403ae6a58633ab96a67c660 | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Html/Modifiers.php#L172-L204 |
17,976 | xinix-technology/norm | src/Norm/Norm.php | Norm.init | public static function init($config, $collectionConfig = array())
{
$first = null;
static::$collectionConfig = $collectionConfig;
if (empty($config)) {
return;
}
foreach ($config as $key => $value) {
$value['name'] = $key;
if (!isset($v... | php | public static function init($config, $collectionConfig = array())
{
$first = null;
static::$collectionConfig = $collectionConfig;
if (empty($config)) {
return;
}
foreach ($config as $key => $value) {
$value['name'] = $key;
if (!isset($v... | [
"public",
"static",
"function",
"init",
"(",
"$",
"config",
",",
"$",
"collectionConfig",
"=",
"array",
"(",
")",
")",
"{",
"$",
"first",
"=",
"null",
";",
"static",
"::",
"$",
"collectionConfig",
"=",
"$",
"collectionConfig",
";",
"if",
"(",
"empty",
... | Initialize framework from configuration. First connection registered from config will be the default connection.
@param array $config
@param array $collectionConfig
@return void | [
"Initialize",
"framework",
"from",
"configuration",
".",
"First",
"connection",
"registered",
"from",
"config",
"will",
"be",
"the",
"default",
"connection",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Norm.php#L53-L89 |
17,977 | xinix-technology/norm | src/Norm/Norm.php | Norm.options | public static function options($key, $value = ':get:')
{
if (is_array($key)) {
foreach ($key as $k => $v) {
static::$options($k, $v);
}
return;
}
if ($value === ':get:') {
return isset(static::$options[$key]) ? static::$option... | php | public static function options($key, $value = ':get:')
{
if (is_array($key)) {
foreach ($key as $k => $v) {
static::$options($k, $v);
}
return;
}
if ($value === ':get:') {
return isset(static::$options[$key]) ? static::$option... | [
"public",
"static",
"function",
"options",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"':get:'",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"foreach",
"(",
"$",
"key",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"static",
"::"... | Get the option of Norm configuration.
@method options
@param string $key
@param string $value
@return mixed | [
"Get",
"the",
"option",
"of",
"Norm",
"configuration",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Norm.php#L101-L116 |
17,978 | xinix-technology/norm | src/Norm/Norm.php | Norm.createCollection | public static function createCollection($options)
{
$defaultConfig = isset(static::$collectionConfig['default'])
? static::$collectionConfig['default']
: array();
$config = null;
if (isset(static::$collectionConfig['mapping'][$options['name']])) {
$confi... | php | public static function createCollection($options)
{
$defaultConfig = isset(static::$collectionConfig['default'])
? static::$collectionConfig['default']
: array();
$config = null;
if (isset(static::$collectionConfig['mapping'][$options['name']])) {
$confi... | [
"public",
"static",
"function",
"createCollection",
"(",
"$",
"options",
")",
"{",
"$",
"defaultConfig",
"=",
"isset",
"(",
"static",
"::",
"$",
"collectionConfig",
"[",
"'default'",
"]",
")",
"?",
"static",
"::",
"$",
"collectionConfig",
"[",
"'default'",
"... | Create collection by configuration.
@method createCollection
@param array $options
@return mixed|\Norm\Collection | [
"Create",
"collection",
"by",
"configuration",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Norm.php#L142-L187 |
17,979 | xinix-technology/norm | src/Norm/Norm.php | Norm.getConnection | public static function getConnection($connectionName = '')
{
if (!$connectionName) {
$connectionName = static::$defaultConnection;
}
if (isset(static::$connections[$connectionName])) {
return static::$connections[$connectionName];
}
} | php | public static function getConnection($connectionName = '')
{
if (!$connectionName) {
$connectionName = static::$defaultConnection;
}
if (isset(static::$connections[$connectionName])) {
return static::$connections[$connectionName];
}
} | [
"public",
"static",
"function",
"getConnection",
"(",
"$",
"connectionName",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"connectionName",
")",
"{",
"$",
"connectionName",
"=",
"static",
"::",
"$",
"defaultConnection",
";",
"}",
"if",
"(",
"isset",
"(",
"s... | Get connection by its connection name, if no connection name provided then the function will return default connection.
@param string $connectionName
@return \Norm\Connection | [
"Get",
"connection",
"by",
"its",
"connection",
"name",
"if",
"no",
"connection",
"name",
"provided",
"then",
"the",
"function",
"will",
"return",
"default",
"connection",
"."
] | c357f7d3a75d05324dd84b8f6a968a094c53d603 | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Norm.php#L196-L204 |
17,980 | tableau-mkt/eggs-n-cereal | src/Utils/Data.php | Data.ensureArrayKeys | public static function ensureArrayKeys($key) {
if (empty($key)) {
return array();
}
if (!is_array($key)) {
if (strstr($key, '|')) {
$key = str_replace('|', self::ARRAY_DELIMITER, $key);
}
$key = explode(self::ARRAY_DELIMITER, $key);
}
return $key;
} | php | public static function ensureArrayKeys($key) {
if (empty($key)) {
return array();
}
if (!is_array($key)) {
if (strstr($key, '|')) {
$key = str_replace('|', self::ARRAY_DELIMITER, $key);
}
$key = explode(self::ARRAY_DELIMITER, $key);
}
return $key;
} | [
"public",
"static",
"function",
"ensureArrayKeys",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"if",
"(",
"str... | Converts string keys to array keys.
There are three conventions for data keys in use. This function accepts each
and ensures an array of keys.
@param array|string $key
The key can be either be an array containing the keys of a nested array
hierarchy path or a string with '][' or '|' as delimiter.
@return array
Array... | [
"Converts",
"string",
"keys",
"to",
"array",
"keys",
"."
] | 778b83ddae1dd687724a84545ce8afa1a31e4bcf | https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Utils/Data.php#L40-L51 |
17,981 | tableau-mkt/eggs-n-cereal | src/Utils/Data.php | Data.flattenData | public static function flattenData(array $data, $prefix = NULL, $label = array()) {
$flattened_data = array();
if (isset($data['#label'])) {
$label[] = $data['#label'];
}
// Each element is either a text (has #text property defined) or has children,
// not both.
if (!empty($data['#text']))... | php | public static function flattenData(array $data, $prefix = NULL, $label = array()) {
$flattened_data = array();
if (isset($data['#label'])) {
$label[] = $data['#label'];
}
// Each element is either a text (has #text property defined) or has children,
// not both.
if (!empty($data['#text']))... | [
"public",
"static",
"function",
"flattenData",
"(",
"array",
"$",
"data",
",",
"$",
"prefix",
"=",
"NULL",
",",
"$",
"label",
"=",
"array",
"(",
")",
")",
"{",
"$",
"flattened_data",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"data"... | Converts a nested data array into a flattened structure with a combined key.
This function can be used by translators to help with the data conversion.
Nested keys will be joined together using a colon, so for example
$data['key1']['key2']['key3'] will be converted into
$flattened_data['key1][key2][key3'].
@param ar... | [
"Converts",
"a",
"nested",
"data",
"array",
"into",
"a",
"flattened",
"structure",
"with",
"a",
"combined",
"key",
"."
] | 778b83ddae1dd687724a84545ce8afa1a31e4bcf | https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Utils/Data.php#L77-L95 |
17,982 | tableau-mkt/eggs-n-cereal | src/Utils/Data.php | Data.unflattenData | public static function unflattenData($flattened_data) {
$data = array();
foreach ($flattened_data as $key => $flattened_data_entry) {
self::arraySetNestedValue($data, explode(self::ARRAY_DELIMITER, $key), $flattened_data_entry);
}
return $data;
} | php | public static function unflattenData($flattened_data) {
$data = array();
foreach ($flattened_data as $key => $flattened_data_entry) {
self::arraySetNestedValue($data, explode(self::ARRAY_DELIMITER, $key), $flattened_data_entry);
}
return $data;
} | [
"public",
"static",
"function",
"unflattenData",
"(",
"$",
"flattened_data",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"flattened_data",
"as",
"$",
"key",
"=>",
"$",
"flattened_data_entry",
")",
"{",
"self",
"::",
"arraySetNe... | Converts a flattened data structure into a nested array.
This function can be used by translators to help with the data conversion.
Nested keys will be created based on the colon, so for example
$flattened_data['key1][key2][key3'] will be converted into
$data['key1']['key2']['key3'].
@param array $flattened_data
The... | [
"Converts",
"a",
"flattened",
"data",
"structure",
"into",
"a",
"nested",
"array",
"."
] | 778b83ddae1dd687724a84545ce8afa1a31e4bcf | https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Utils/Data.php#L114-L120 |
17,983 | tableau-mkt/eggs-n-cereal | src/Utils/Data.php | Data.elementChildren | public static function elementChildren($elements) {
// Filter out properties from the element, leaving only children.
$children = array();
foreach ($elements as $key => $value) {
if ($key === '' || $key[0] !== '#') {
$children[$key] = $value;
}
}
return array_keys($children);
} | php | public static function elementChildren($elements) {
// Filter out properties from the element, leaving only children.
$children = array();
foreach ($elements as $key => $value) {
if ($key === '' || $key[0] !== '#') {
$children[$key] = $value;
}
}
return array_keys($children);
} | [
"public",
"static",
"function",
"elementChildren",
"(",
"$",
"elements",
")",
"{",
"// Filter out properties from the element, leaving only children.",
"$",
"children",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"key",
"=>",
"$",
"val... | Identifies the children of an element array.
The children of a element array are those key/value pairs whose key does
not start with a '#'.
@param array $elements
The element array whose children are to be identified.
@return array
The array keys of the element's children. | [
"Identifies",
"the",
"children",
"of",
"an",
"element",
"array",
"."
] | 778b83ddae1dd687724a84545ce8afa1a31e4bcf | https://github.com/tableau-mkt/eggs-n-cereal/blob/778b83ddae1dd687724a84545ce8afa1a31e4bcf/src/Utils/Data.php#L150-L159 |
17,984 | wikimedia/CLDRPluralRuleParser | src/Evaluator.php | Evaluator.evaluate | public static function evaluate( $number, array $rules ) {
$rules = self::compile( $rules );
return self::evaluateCompiled( $number, $rules );
} | php | public static function evaluate( $number, array $rules ) {
$rules = self::compile( $rules );
return self::evaluateCompiled( $number, $rules );
} | [
"public",
"static",
"function",
"evaluate",
"(",
"$",
"number",
",",
"array",
"$",
"rules",
")",
"{",
"$",
"rules",
"=",
"self",
"::",
"compile",
"(",
"$",
"rules",
")",
";",
"return",
"self",
"::",
"evaluateCompiled",
"(",
"$",
"number",
",",
"$",
"... | Evaluate a number against a set of plural rules. If a rule passes,
return the index of plural rule.
@param int $number The number to be evaluated against the rules
@param array $rules The associative array of plural rules in pluralform => rule format.
@return int The index of the plural form which passed the evaluatio... | [
"Evaluate",
"a",
"number",
"against",
"a",
"set",
"of",
"plural",
"rules",
".",
"If",
"a",
"rule",
"passes",
"return",
"the",
"index",
"of",
"plural",
"rule",
"."
] | 4c5d71a3fd62a75871da8562310ca2258647ee6d | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Evaluator.php#L26-L30 |
17,985 | wikimedia/CLDRPluralRuleParser | src/Evaluator.php | Evaluator.compile | public static function compile( array $rules ) {
// We can't use array_map() for this because it generates a warning if
// there is an exception.
foreach ( $rules as &$rule ) {
$rule = Converter::convert( $rule );
}
return $rules;
} | php | public static function compile( array $rules ) {
// We can't use array_map() for this because it generates a warning if
// there is an exception.
foreach ( $rules as &$rule ) {
$rule = Converter::convert( $rule );
}
return $rules;
} | [
"public",
"static",
"function",
"compile",
"(",
"array",
"$",
"rules",
")",
"{",
"// We can't use array_map() for this because it generates a warning if",
"// there is an exception.",
"foreach",
"(",
"$",
"rules",
"as",
"&",
"$",
"rule",
")",
"{",
"$",
"rule",
"=",
... | Convert a set of rules to a compiled form which is optimised for
fast evaluation. The result will be an array of strings, and may be cached.
@param array $rules The rules to compile
@return array An array of compile rules. | [
"Convert",
"a",
"set",
"of",
"rules",
"to",
"a",
"compiled",
"form",
"which",
"is",
"optimised",
"for",
"fast",
"evaluation",
".",
"The",
"result",
"will",
"be",
"an",
"array",
"of",
"strings",
"and",
"may",
"be",
"cached",
"."
] | 4c5d71a3fd62a75871da8562310ca2258647ee6d | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Evaluator.php#L39-L47 |
17,986 | wikimedia/CLDRPluralRuleParser | src/Evaluator.php | Evaluator.doOperation | private static function doOperation( $token, $left, $right ) {
if ( in_array( $token, [ 'in', 'not-in', 'within', 'not-within' ] ) ) {
if ( !$right instanceof Range ) {
$right = new Range( $right );
}
}
switch ( $token ) {
case 'or':
return $left || $right;
case 'and':
return $left && $rig... | php | private static function doOperation( $token, $left, $right ) {
if ( in_array( $token, [ 'in', 'not-in', 'within', 'not-within' ] ) ) {
if ( !$right instanceof Range ) {
$right = new Range( $right );
}
}
switch ( $token ) {
case 'or':
return $left || $right;
case 'and':
return $left && $rig... | [
"private",
"static",
"function",
"doOperation",
"(",
"$",
"token",
",",
"$",
"left",
",",
"$",
"right",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"token",
",",
"[",
"'in'",
",",
"'not-in'",
",",
"'within'",
",",
"'not-within'",
"]",
")",
")",
"{",
... | Do a single operation
@param string $token The token string
@param mixed $left The left operand. If it is an object, its state may be destroyed.
@param mixed $right The right operand
@throws Error
@return mixed The operation result | [
"Do",
"a",
"single",
"operation"
] | 4c5d71a3fd62a75871da8562310ca2258647ee6d | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Evaluator.php#L127-L170 |
17,987 | praxisnetau/silverware-spam-guard | src/Fields/SimpleSpamGuardField.php | SimpleSpamGuardField.setForm | public function setForm($form)
{
// Associate Fields with Form:
$this->honeypot->setForm($form);
$this->timestamp->setForm($form);
// Call Parent Method:
return parent::setForm($form);
} | php | public function setForm($form)
{
// Associate Fields with Form:
$this->honeypot->setForm($form);
$this->timestamp->setForm($form);
// Call Parent Method:
return parent::setForm($form);
} | [
"public",
"function",
"setForm",
"(",
"$",
"form",
")",
"{",
"// Associate Fields with Form:",
"$",
"this",
"->",
"honeypot",
"->",
"setForm",
"(",
"$",
"form",
")",
";",
"$",
"this",
"->",
"timestamp",
"->",
"setForm",
"(",
"$",
"form",
")",
";",
"// Ca... | Defines the form instance for the receiver.
@param Form $form
@return $this | [
"Defines",
"the",
"form",
"instance",
"for",
"the",
"receiver",
"."
] | c5f8836a09141bd675173892a1e3d8c8cc8c1886 | https://github.com/praxisnetau/silverware-spam-guard/blob/c5f8836a09141bd675173892a1e3d8c8cc8c1886/src/Fields/SimpleSpamGuardField.php#L112-L122 |
17,988 | praxisnetau/silverware-spam-guard | src/Fields/SimpleSpamGuardField.php | SimpleSpamGuardField.Field | public function Field($properties = [])
{
Requirements::customCSS('.field.simpleguard { display: none !important; }');
return DBField::create_field('HTMLFragment', $this->honeypot->Field() . $this->timestamp->Field());
} | php | public function Field($properties = [])
{
Requirements::customCSS('.field.simpleguard { display: none !important; }');
return DBField::create_field('HTMLFragment', $this->honeypot->Field() . $this->timestamp->Field());
} | [
"public",
"function",
"Field",
"(",
"$",
"properties",
"=",
"[",
"]",
")",
"{",
"Requirements",
"::",
"customCSS",
"(",
"'.field.simpleguard { display: none !important; }'",
")",
";",
"return",
"DBField",
"::",
"create_field",
"(",
"'HTMLFragment'",
",",
"$",
"thi... | Renders the field for the template.
@param array $properties
@return DBHTMLText | [
"Renders",
"the",
"field",
"for",
"the",
"template",
"."
] | c5f8836a09141bd675173892a1e3d8c8cc8c1886 | https://github.com/praxisnetau/silverware-spam-guard/blob/c5f8836a09141bd675173892a1e3d8c8cc8c1886/src/Fields/SimpleSpamGuardField.php#L161-L166 |
17,989 | praxisnetau/silverware-spam-guard | src/Fields/SimpleSpamGuardField.php | SimpleSpamGuardField.setValue | public function setValue($value, $data = null)
{
// Check Value Type:
if (is_array($value)) {
// Define Field Values:
$this->honeypot->setValue(isset($value['value']) ? $value['value'] : null);
$this->timestamp->setValue(isset($v... | php | public function setValue($value, $data = null)
{
// Check Value Type:
if (is_array($value)) {
// Define Field Values:
$this->honeypot->setValue(isset($value['value']) ? $value['value'] : null);
$this->timestamp->setValue(isset($v... | [
"public",
"function",
"setValue",
"(",
"$",
"value",
",",
"$",
"data",
"=",
"null",
")",
"{",
"// Check Value Type:",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"// Define Field Values:",
"$",
"this",
"->",
"honeypot",
"->",
"setValue",
"(",
... | Defines the field value.
@param mixed $value
@param array $data
@return $this | [
"Defines",
"the",
"field",
"value",
"."
] | c5f8836a09141bd675173892a1e3d8c8cc8c1886 | https://github.com/praxisnetau/silverware-spam-guard/blob/c5f8836a09141bd675173892a1e3d8c8cc8c1886/src/Fields/SimpleSpamGuardField.php#L176-L196 |
17,990 | praxisnetau/silverware-spam-guard | src/Fields/SimpleSpamGuardField.php | SimpleSpamGuardField.validate | public function validate($validator)
{
// Check Value and Timestamp:
if (!empty($this->value) || $this->tooSoon()) {
// Define Validation Error:
$validator->validationError(
$this->name,
_t(
... | php | public function validate($validator)
{
// Check Value and Timestamp:
if (!empty($this->value) || $this->tooSoon()) {
// Define Validation Error:
$validator->validationError(
$this->name,
_t(
... | [
"public",
"function",
"validate",
"(",
"$",
"validator",
")",
"{",
"// Check Value and Timestamp:",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"value",
")",
"||",
"$",
"this",
"->",
"tooSoon",
"(",
")",
")",
"{",
"// Define Validation Error:",
"$",
"... | Answers true if the value is valid for the receiver.
@param Validator $validator
@return boolean | [
"Answers",
"true",
"if",
"the",
"value",
"is",
"valid",
"for",
"the",
"receiver",
"."
] | c5f8836a09141bd675173892a1e3d8c8cc8c1886 | https://github.com/praxisnetau/silverware-spam-guard/blob/c5f8836a09141bd675173892a1e3d8c8cc8c1886/src/Fields/SimpleSpamGuardField.php#L215-L241 |
17,991 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent.getRequestVars | public function getRequestVars($name, $primaryKey = self::PRIMARY_KEY)
{
$name = Str::low(Inflector::singularize($name));
$requestIds = (array) $this->_request->getData($name);
$action = $this->_request->getData('action');
$ids = $this->_getIds($requestIds, $primaryK... | php | public function getRequestVars($name, $primaryKey = self::PRIMARY_KEY)
{
$name = Str::low(Inflector::singularize($name));
$requestIds = (array) $this->_request->getData($name);
$action = $this->_request->getData('action');
$ids = $this->_getIds($requestIds, $primaryK... | [
"public",
"function",
"getRequestVars",
"(",
"$",
"name",
",",
"$",
"primaryKey",
"=",
"self",
"::",
"PRIMARY_KEY",
")",
"{",
"$",
"name",
"=",
"Str",
"::",
"low",
"(",
"Inflector",
"::",
"singularize",
"(",
"$",
"name",
")",
")",
";",
"$",
"requestIds... | Get actual request vars for process.
@param string $name
@param string $primaryKey
@return array | [
"Get",
"actual",
"request",
"vars",
"for",
"process",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L56-L64 |
17,992 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent.make | public function make(Table $table, $action, array $ids = [], array $options = [])
{
$count = count($ids);
$options = $this->_getOptions($options, $count);
$redirectUrl = $options['redirect'];
$messages = new JSON($options['messages']);
$event = EventManager::tri... | php | public function make(Table $table, $action, array $ids = [], array $options = [])
{
$count = count($ids);
$options = $this->_getOptions($options, $count);
$redirectUrl = $options['redirect'];
$messages = new JSON($options['messages']);
$event = EventManager::tri... | [
"public",
"function",
"make",
"(",
"Table",
"$",
"table",
",",
"$",
"action",
",",
"array",
"$",
"ids",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"ids",
")",
";",
"$",
"options",... | Make process.
@param Table $table
@param string $action
@param array $ids
@param array $options
@return \Cake\Http\Response|null
@throws \Aura\Intl\Exception | [
"Make",
"process",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L105-L133 |
17,993 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getDefaultMessages | protected function _getDefaultMessages($count)
{
$context = $this->_configRead('context');
$contextPlural = Inflector::pluralize($context);
$countString = sprintf('<strong>%s</strong>', $count);
return [
'delete' => __dn(
'core',
'O... | php | protected function _getDefaultMessages($count)
{
$context = $this->_configRead('context');
$contextPlural = Inflector::pluralize($context);
$countString = sprintf('<strong>%s</strong>', $count);
return [
'delete' => __dn(
'core',
'O... | [
"protected",
"function",
"_getDefaultMessages",
"(",
"$",
"count",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"_configRead",
"(",
"'context'",
")",
";",
"$",
"contextPlural",
"=",
"Inflector",
"::",
"pluralize",
"(",
"$",
"context",
")",
";",
"$",
... | Setup default action messages.
@param int $count
@return array
@throws \Aura\Intl\Exception | [
"Setup",
"default",
"action",
"messages",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L143-L171 |
17,994 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getEventName | protected function _getEventName($action, $event = self::EVENT_NAME_BEFORE)
{
$details = [];
if ($prefix = $this->_request->getParam('prefix')) {
$details[] = ucfirst($prefix);
}
$details = Hash::merge($details, [
'Controller',
$this->_controller-... | php | protected function _getEventName($action, $event = self::EVENT_NAME_BEFORE)
{
$details = [];
if ($prefix = $this->_request->getParam('prefix')) {
$details[] = ucfirst($prefix);
}
$details = Hash::merge($details, [
'Controller',
$this->_controller-... | [
"protected",
"function",
"_getEventName",
"(",
"$",
"action",
",",
"$",
"event",
"=",
"self",
"::",
"EVENT_NAME_BEFORE",
")",
"{",
"$",
"details",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"prefix",
"=",
"$",
"this",
"->",
"_request",
"->",
"getParam",
"(",
... | Get event name by data.
@param string $action
@param string $event
@return string | [
"Get",
"event",
"name",
"by",
"data",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L180-L195 |
17,995 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getIds | protected function _getIds(array $ids, $primaryKey = self::PRIMARY_KEY)
{
$return = [];
foreach ($ids as $id => $value) {
if (is_array($value) && is_int($id) && (int) $value[$primaryKey] === 1) {
$return[$id] = $id;
}
}
return $return;
} | php | protected function _getIds(array $ids, $primaryKey = self::PRIMARY_KEY)
{
$return = [];
foreach ($ids as $id => $value) {
if (is_array($value) && is_int($id) && (int) $value[$primaryKey] === 1) {
$return[$id] = $id;
}
}
return $return;
} | [
"protected",
"function",
"_getIds",
"(",
"array",
"$",
"ids",
",",
"$",
"primaryKey",
"=",
"self",
"::",
"PRIMARY_KEY",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"ids",
"as",
"$",
"id",
"=>",
"$",
"value",
")",
"{",
"if",
... | Get ids by request.
@param array $ids
@param string $primaryKey
@return array | [
"Get",
"ids",
"by",
"request",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L204-L214 |
17,996 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._getOptions | protected function _getOptions(array $options, $count)
{
$options = Hash::merge($this->_config, $options);
return Hash::merge(['messages' => $this->_getDefaultMessages($count)], $options);
} | php | protected function _getOptions(array $options, $count)
{
$options = Hash::merge($this->_config, $options);
return Hash::merge(['messages' => $this->_getDefaultMessages($count)], $options);
} | [
"protected",
"function",
"_getOptions",
"(",
"array",
"$",
"options",
",",
"$",
"count",
")",
"{",
"$",
"options",
"=",
"Hash",
"::",
"merge",
"(",
"$",
"this",
"->",
"_config",
",",
"$",
"options",
")",
";",
"return",
"Hash",
"::",
"merge",
"(",
"["... | Create and merge actual process options.
@param array $options
@param int|string $count
@return array
@throws \Aura\Intl\Exception | [
"Create",
"and",
"merge",
"actual",
"process",
"options",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L225-L229 |
17,997 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._loadBehavior | protected function _loadBehavior(Table $table)
{
$behaviors = $table->behaviors();
if (!Arr::in('Process', $behaviors->loaded())) {
$behaviors->load('Core.Process');
}
} | php | protected function _loadBehavior(Table $table)
{
$behaviors = $table->behaviors();
if (!Arr::in('Process', $behaviors->loaded())) {
$behaviors->load('Core.Process');
}
} | [
"protected",
"function",
"_loadBehavior",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"behaviors",
"=",
"$",
"table",
"->",
"behaviors",
"(",
")",
";",
"if",
"(",
"!",
"Arr",
"::",
"in",
"(",
"'Process'",
",",
"$",
"behaviors",
"->",
"loaded",
"(",
")... | Load process behavior.
@param Table $table | [
"Load",
"process",
"behavior",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L236-L242 |
17,998 | CakeCMS/Core | src/Controller/Component/ProcessComponent.php | ProcessComponent._process | protected function _process($action, Data $messages, array $redirect, array $ids)
{
$count = count($ids);
$defaultMsg = __dn(
'core',
'One record success processed',
'{0} records processed',
$count,
sprintf('<strong>%s</strong>', $count)
... | php | protected function _process($action, Data $messages, array $redirect, array $ids)
{
$count = count($ids);
$defaultMsg = __dn(
'core',
'One record success processed',
'{0} records processed',
$count,
sprintf('<strong>%s</strong>', $count)
... | [
"protected",
"function",
"_process",
"(",
"$",
"action",
",",
"Data",
"$",
"messages",
",",
"array",
"$",
"redirect",
",",
"array",
"$",
"ids",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"ids",
")",
";",
"$",
"defaultMsg",
"=",
"__dn",
"(",
"'... | Controller process.
@param string $action
@param Data $messages
@param array $redirect
@param array $ids
@return \Cake\Http\Response|null
@throws \Aura\Intl\Exception | [
"Controller",
"process",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Controller/Component/ProcessComponent.php#L255-L272 |
17,999 | aedart/laravel-helpers | src/Traits/Queue/QueueMonitorTrait.php | QueueMonitorTrait.getQueueMonitor | public function getQueueMonitor(): ?Monitor
{
if (!$this->hasQueueMonitor()) {
$this->setQueueMonitor($this->getDefaultQueueMonitor());
}
return $this->queueMonitor;
} | php | public function getQueueMonitor(): ?Monitor
{
if (!$this->hasQueueMonitor()) {
$this->setQueueMonitor($this->getDefaultQueueMonitor());
}
return $this->queueMonitor;
} | [
"public",
"function",
"getQueueMonitor",
"(",
")",
":",
"?",
"Monitor",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasQueueMonitor",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setQueueMonitor",
"(",
"$",
"this",
"->",
"getDefaultQueueMonitor",
"(",
")",
")",
... | Get queue monitor
If no queue monitor has been set, this method will
set and return a default queue monitor, if any such
value is available
@see getDefaultQueueMonitor()
@return Monitor|null queue monitor or null if none queue monitor has been set | [
"Get",
"queue",
"monitor"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Queue/QueueMonitorTrait.php#L53-L59 |
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.