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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,400 | bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToNextAttribute | public function MoveToNextAttribute()
{
if ( is_null( $this->domNode ) || ! $this->domNode instanceof \DOMAttr )
{
return false;
}
$next = $this->domNode->nextSibling;
if ( is_null( $next ) ) return false;
$this->domNode = $next;
return true;
} | php | public function MoveToNextAttribute()
{
if ( is_null( $this->domNode ) || ! $this->domNode instanceof \DOMAttr )
{
return false;
}
$next = $this->domNode->nextSibling;
if ( is_null( $next ) ) return false;
$this->domNode = $next;
return true;
} | [
"public",
"function",
"MoveToNextAttribute",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"!",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMAttr",
")",
"{",
"return",
"false",
";",
"}",
"$",
"next",
"=",
... | When overridden in a derived class, moves the XPathNavigator
to the next attribute.
@return bool Returns true if the XPathNavigator is successful moving to the next attribute;
false if there are no more attributes. If false, the position of the XPathNavigator is unchanged. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"next",
"attribute",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L924-L937 |
25,401 | bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToNextNamespace | public function MoveToNextNamespace( $namespaceScope = XPathNamespaceScope::Local )
{
if ( is_null( $this->domNode ) ) return false;
if ( $this->domNode->nodeType != XML_NAMESPACE_DECL_NODE ) return false;
$expression = $namespaceScope == XPathNamespaceScope::Local
? 'namespace::*[not(. = ../../namespa... | php | public function MoveToNextNamespace( $namespaceScope = XPathNamespaceScope::Local )
{
if ( is_null( $this->domNode ) ) return false;
if ( $this->domNode->nodeType != XML_NAMESPACE_DECL_NODE ) return false;
$expression = $namespaceScope == XPathNamespaceScope::Local
? 'namespace::*[not(. = ../../namespa... | [
"public",
"function",
"MoveToNextNamespace",
"(",
"$",
"namespaceScope",
"=",
"XPathNamespaceScope",
"::",
"Local",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"domNode"... | When overridden in a derived class, moves the XPathNavigator to the next namespace node matching the
XPathNamespaceScope specified.
@param XPathNamespaceScope $namespaceScope : (optional) An XPathNamespaceScope value describing the namespace scope.
@return bool Returns true if the XPathNavigator is successful moving t... | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"next",
"namespace",
"node",
"matching",
"the",
"XPathNamespaceScope",
"specified",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L947-L980 |
25,402 | bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToParent | public function MoveToParent()
{
if ( is_null( $this->domNode ) ) return false;
$parent = $this->domNode->parentNode;
if ( is_null( $parent ) ) return false;
$this->domNode = $parent;
return true;
} | php | public function MoveToParent()
{
if ( is_null( $this->domNode ) ) return false;
$parent = $this->domNode->parentNode;
if ( is_null( $parent ) ) return false;
$this->domNode = $parent;
return true;
} | [
"public",
"function",
"MoveToParent",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"domNode",
"->",
"parentNode",
";",
"if",
"(",
"is_null",
"(",
"$",... | When overridden in a derived class, moves the XPathNavigator to the parent node of the current node.
@return bool Returns true if the XPathNavigator is successful moving to the parent node of the current node; otherwise,
false. If false, the position of the XPathNavigator is unchanged. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"parent",
"node",
"of",
"the",
"current",
"node",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L988-L997 |
25,403 | bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToPrevious | public function MoveToPrevious()
{
if ( is_null( $this->domNode ) || $this->domNode instanceof \DOMAttr ) return false;
$previous = $this->domNode->previousSibling;
if ( is_null( $previous ) ) return false;
$this->domNode = $previous;
return true;
} | php | public function MoveToPrevious()
{
if ( is_null( $this->domNode ) || $this->domNode instanceof \DOMAttr ) return false;
$previous = $this->domNode->previousSibling;
if ( is_null( $previous ) ) return false;
$this->domNode = $previous;
return true;
} | [
"public",
"function",
"MoveToPrevious",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMAttr",
")",
"return",
"false",
";",
"$",
"previous",
"=",
"$",
"this",
"->"... | When overridden in a derived class, moves the XPathNavigator to the previous sibling node of the current node.
@return bool Returns true if the XPathNavigator is successful moving to the previous sibling node; otherwise,
false if there is no previous sibling node or if the XPathNavigator is currently positioned on an
... | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"previous",
"sibling",
"node",
"of",
"the",
"current",
"node",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1006-L1016 |
25,404 | bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.ToString | public function ToString()
{
if ( is_null( $this->domNode ) ) return "";
if ( $this->domNode instanceof \DOMDocument )
{
$result = $this->domNode->saveXML( null );
// Remove any initial PI
$result = preg_replace( "/^<\?xml.*\?>\s/", "", $result );
return $result;
}
else
{
// Inne... | php | public function ToString()
{
if ( is_null( $this->domNode ) ) return "";
if ( $this->domNode instanceof \DOMDocument )
{
$result = $this->domNode->saveXML( null );
// Remove any initial PI
$result = preg_replace( "/^<\?xml.*\?>\s/", "", $result );
return $result;
}
else
{
// Inne... | [
"public",
"function",
"ToString",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"\"\"",
";",
"if",
"(",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMDocument",
")",
"{",
"$",
"result",
"=",
"$",
... | Gets the text value of the current node.
@return string A string that contains the text value of the current node. | [
"Gets",
"the",
"text",
"value",
"of",
"the",
"current",
"node",
"."
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1105-L1128 |
25,405 | ciims/ciims-plugins-awsuploader | CiiAWSUploader.php | CiiAWSUploader.getCdnURI | private function getCdnURI($path)
{
$cleancdn = explode('/', $path);
unset($cleancdn[0]);
unset($cleancdn[1]);
reset($cleancdn);
return implode($cleancdn, '/');
} | php | private function getCdnURI($path)
{
$cleancdn = explode('/', $path);
unset($cleancdn[0]);
unset($cleancdn[1]);
reset($cleancdn);
return implode($cleancdn, '/');
} | [
"private",
"function",
"getCdnURI",
"(",
"$",
"path",
")",
"{",
"$",
"cleancdn",
"=",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
";",
"unset",
"(",
"$",
"cleancdn",
"[",
"0",
"]",
")",
";",
"unset",
"(",
"$",
"cleancdn",
"[",
"1",
"]",
")",
... | Retrieves a clean version of the CDN URI
@param string $path
@return string | [
"Retrieves",
"a",
"clean",
"version",
"of",
"the",
"CDN",
"URI"
] | 59e447e59f873521ebf966051fab6334696546a2 | https://github.com/ciims/ciims-plugins-awsuploader/blob/59e447e59f873521ebf966051fab6334696546a2/CiiAWSUploader.php#L60-L67 |
25,406 | jkaflik/process-util | src/ProcessUtil/ProcessUtil.php | ProcessUtil.executeCommand | public function executeCommand(array $arguments, $processBuilderCallback = null)
{
$processBuilder = clone $this->processBuilder;
$processBuilder->setArguments($arguments);
if (is_callable($processBuilderCallback)) {
$processBuilderCallback($processBuilder);
}
$... | php | public function executeCommand(array $arguments, $processBuilderCallback = null)
{
$processBuilder = clone $this->processBuilder;
$processBuilder->setArguments($arguments);
if (is_callable($processBuilderCallback)) {
$processBuilderCallback($processBuilder);
}
$... | [
"public",
"function",
"executeCommand",
"(",
"array",
"$",
"arguments",
",",
"$",
"processBuilderCallback",
"=",
"null",
")",
"{",
"$",
"processBuilder",
"=",
"clone",
"$",
"this",
"->",
"processBuilder",
";",
"$",
"processBuilder",
"->",
"setArguments",
"(",
... | Executes given command
@param array $arguments
@param null $processBuilderCallback
@return \Symfony\Component\Process\Process
@throws ExecutableNotFoundException
@throws ProcessFailedException | [
"Executes",
"given",
"command"
] | 8d77f677189980e18e7b57e836d8908b56822bb8 | https://github.com/jkaflik/process-util/blob/8d77f677189980e18e7b57e836d8908b56822bb8/src/ProcessUtil/ProcessUtil.php#L63-L84 |
25,407 | angrycoders/db-driver | src/Db.php | Db.deleteTable | public function deleteTable($tableName)
{
try {
$this->db->deleteTable($tableName);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function deleteTable($tableName)
{
try {
$this->db->deleteTable($tableName);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"deleteTable",
"(",
"$",
"tableName",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"db",
"->",
"deleteTable",
"(",
"$",
"tableName",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"throw",
"new",
"DbException",
... | Delete a table from db
@param string $tableName the name of the table
@throws DbException | [
"Delete",
"a",
"table",
"from",
"db"
] | e5df527ac0ea5fa434cbda79692f37cf6f2abc73 | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L74-L81 |
25,408 | mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.retrieveModels | protected function retrieveModels(array $entity = [])
{
$models = [];
foreach ((array) $entity as $node) {
$models[] = $this->models->get($node);
}
if (empty($models)) {
$models = $this->models->all();
}
return $models;
} | php | protected function retrieveModels(array $entity = [])
{
$models = [];
foreach ((array) $entity as $node) {
$models[] = $this->models->get($node);
}
if (empty($models)) {
$models = $this->models->all();
}
return $models;
} | [
"protected",
"function",
"retrieveModels",
"(",
"array",
"$",
"entity",
"=",
"[",
"]",
")",
"{",
"$",
"models",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"entity",
"as",
"$",
"node",
")",
"{",
"$",
"models",
"[",
"]",
"=",
"$",
... | Returns array with models for operation
@param array $entity
@return ModelInterface[] | [
"Returns",
"array",
"with",
"models",
"for",
"operation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L129-L141 |
25,409 | mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.buildCreate | protected function buildCreate(array $models)
{
$schemaManager = $this->connection->getSchemaManager();
foreach ($models as $model) {
if ($schemaManager->tablesExist([$model->table()])) {
throw new SchemaException(sprintf('Unable to create table, table "%s" already exist... | php | protected function buildCreate(array $models)
{
$schemaManager = $this->connection->getSchemaManager();
foreach ($models as $model) {
if ($schemaManager->tablesExist([$model->table()])) {
throw new SchemaException(sprintf('Unable to create table, table "%s" already exist... | [
"protected",
"function",
"buildCreate",
"(",
"array",
"$",
"models",
")",
"{",
"$",
"schemaManager",
"=",
"$",
"this",
"->",
"connection",
"->",
"getSchemaManager",
"(",
")",
";",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"if",
"(",
... | Builds create table queries
@param ModelInterface[] $models
@throws SchemaException | [
"Builds",
"create",
"table",
"queries"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L150-L166 |
25,410 | mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.createTable | protected function createTable(SchemaAsset $schema, ModelInterface $model)
{
$table = $schema->createTable($this->quoteIdentifier($model->table()));
foreach ($model->fields() as $field) {
$table->addColumn(
$this->quoteIdentifier($field->mappedName()),
$f... | php | protected function createTable(SchemaAsset $schema, ModelInterface $model)
{
$table = $schema->createTable($this->quoteIdentifier($model->table()));
foreach ($model->fields() as $field) {
$table->addColumn(
$this->quoteIdentifier($field->mappedName()),
$f... | [
"protected",
"function",
"createTable",
"(",
"SchemaAsset",
"$",
"schema",
",",
"ModelInterface",
"$",
"model",
")",
"{",
"$",
"table",
"=",
"$",
"schema",
"->",
"createTable",
"(",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"model",
"->",
"table",
"(... | Creates table from model into schema
@param SchemaAsset $schema
@param ModelInterface $model | [
"Creates",
"table",
"from",
"model",
"into",
"schema"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L197-L240 |
25,411 | mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.quoteIdentifier | protected function quoteIdentifier($identifier)
{
if (!is_array($identifier)) {
return $this->connection->quoteIdentifier($identifier);
}
foreach ($identifier as &$value) {
$value = $this->connection->quoteIdentifier($value);
unset($value);
}
... | php | protected function quoteIdentifier($identifier)
{
if (!is_array($identifier)) {
return $this->connection->quoteIdentifier($identifier);
}
foreach ($identifier as &$value) {
$value = $this->connection->quoteIdentifier($value);
unset($value);
}
... | [
"protected",
"function",
"quoteIdentifier",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"identifier",
")",
")",
"{",
"return",
"$",
"this",
"->",
"connection",
"->",
"quoteIdentifier",
"(",
"$",
"identifier",
")",
";",
"}",
"f... | Quotes SQL identifier or array of identifiers
@param string|array $identifier
@return string|array | [
"Quotes",
"SQL",
"identifier",
"or",
"array",
"of",
"identifiers"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L249-L261 |
25,412 | mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.buildDrop | protected function buildDrop(array $models)
{
$fromSchema = $this->connection->getSchemaManager()->createSchema();
$toSchema = clone $fromSchema;
foreach ($models as $model) {
if (!$toSchema->hasTable($model->table())) {
continue;
}
$toSc... | php | protected function buildDrop(array $models)
{
$fromSchema = $this->connection->getSchemaManager()->createSchema();
$toSchema = clone $fromSchema;
foreach ($models as $model) {
if (!$toSchema->hasTable($model->table())) {
continue;
}
$toSc... | [
"protected",
"function",
"buildDrop",
"(",
"array",
"$",
"models",
")",
"{",
"$",
"fromSchema",
"=",
"$",
"this",
"->",
"connection",
"->",
"getSchemaManager",
"(",
")",
"->",
"createSchema",
"(",
")",
";",
"$",
"toSchema",
"=",
"clone",
"$",
"fromSchema",... | Builds drop table query
@param ModelInterface[] $models | [
"Builds",
"drop",
"table",
"query"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L268-L284 |
25,413 | JurJean/SpraySerializer | src/Object/BoundClosureSerializer.php | BoundClosureSerializer.construct | public function construct($subject, &$data = array())
{
if (null === $this->constructed) {
$this->constructed = unserialize(
sprintf(
'O:%d:"%s":0:{}',
strlen($subject),
$subject
)
);
... | php | public function construct($subject, &$data = array())
{
if (null === $this->constructed) {
$this->constructed = unserialize(
sprintf(
'O:%d:"%s":0:{}',
strlen($subject),
$subject
)
);
... | [
"public",
"function",
"construct",
"(",
"$",
"subject",
",",
"&",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"constructed",
")",
"{",
"$",
"this",
"->",
"constructed",
"=",
"unserialize",
"(",
"sprintf... | Construct a new object.
By default a new empty object is deserialized and from then on cloned.
@param string $subject The class name of the object to create
@param array $data The data to deserialize
@return object | [
"Construct",
"a",
"new",
"object",
"."
] | 4d2883efe489cc8716aea3334f622a576f650397 | https://github.com/JurJean/SpraySerializer/blob/4d2883efe489cc8716aea3334f622a576f650397/src/Object/BoundClosureSerializer.php#L65-L77 |
25,414 | JurJean/SpraySerializer | src/Object/BoundClosureSerializer.php | BoundClosureSerializer.serializer | protected function serializer()
{
if (null === $this->serializer) {
$self = $this;
$this->serializer = Closure::bind($this->bindSerializer(), null, $this->class);
}
return $this->serializer;
} | php | protected function serializer()
{
if (null === $this->serializer) {
$self = $this;
$this->serializer = Closure::bind($this->bindSerializer(), null, $this->class);
}
return $this->serializer;
} | [
"protected",
"function",
"serializer",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"serializer",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"$",
"this",
"->",
"serializer",
"=",
"Closure",
"::",
"bind",
"(",
"$",
"this",
"->",
"b... | Get a reference to the bound serialization closure.
@return Closure | [
"Get",
"a",
"reference",
"to",
"the",
"bound",
"serialization",
"closure",
"."
] | 4d2883efe489cc8716aea3334f622a576f650397 | https://github.com/JurJean/SpraySerializer/blob/4d2883efe489cc8716aea3334f622a576f650397/src/Object/BoundClosureSerializer.php#L84-L91 |
25,415 | JurJean/SpraySerializer | src/Object/BoundClosureSerializer.php | BoundClosureSerializer.deserializer | protected function deserializer()
{
if (null === $this->deserializer) {
$self = $this;
$this->deserializer = Closure::bind($this->bindDeserializer(), null, $this->class);
}
return $this->deserializer;
} | php | protected function deserializer()
{
if (null === $this->deserializer) {
$self = $this;
$this->deserializer = Closure::bind($this->bindDeserializer(), null, $this->class);
}
return $this->deserializer;
} | [
"protected",
"function",
"deserializer",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"deserializer",
")",
"{",
"$",
"self",
"=",
"$",
"this",
";",
"$",
"this",
"->",
"deserializer",
"=",
"Closure",
"::",
"bind",
"(",
"$",
"this",
"->"... | Get a reference to the bound deserialization closure.
@return Closure | [
"Get",
"a",
"reference",
"to",
"the",
"bound",
"deserialization",
"closure",
"."
] | 4d2883efe489cc8716aea3334f622a576f650397 | https://github.com/JurJean/SpraySerializer/blob/4d2883efe489cc8716aea3334f622a576f650397/src/Object/BoundClosureSerializer.php#L129-L136 |
25,416 | RocketPropelledTortoise/Core | src/Entities/FieldCollection.php | FieldCollection.initField | public static function initField($configuration = [])
{
if (!array_key_exists('type', $configuration) || !class_exists($configuration['type'])) {
throw new InvalidFieldTypeException('You did not specify a type on this class.');
}
$collection = new static();
$collection->... | php | public static function initField($configuration = [])
{
if (!array_key_exists('type', $configuration) || !class_exists($configuration['type'])) {
throw new InvalidFieldTypeException('You did not specify a type on this class.');
}
$collection = new static();
$collection->... | [
"public",
"static",
"function",
"initField",
"(",
"$",
"configuration",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'type'",
",",
"$",
"configuration",
")",
"||",
"!",
"class_exists",
"(",
"$",
"configuration",
"[",
"'type'",
"]",
... | Initialize a collection with the configuration
@param array $configuration
@throws InvalidFieldTypeException
@return static | [
"Initialize",
"a",
"collection",
"with",
"the",
"configuration"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Entities/FieldCollection.php#L46-L61 |
25,417 | RocketPropelledTortoise/Core | src/Entities/FieldCollection.php | FieldCollection.validateSet | protected function validateSet($key, $value)
{
$maxItems = $this->getMaxItems();
if ((is_null($key) || !array_key_exists($key, $this->items)) && $maxItems != 0 && $this->count() >= $maxItems) {
throw new ItemCountException('The maximum number of items has been reached on this field.');
... | php | protected function validateSet($key, $value)
{
$maxItems = $this->getMaxItems();
if ((is_null($key) || !array_key_exists($key, $this->items)) && $maxItems != 0 && $this->count() >= $maxItems) {
throw new ItemCountException('The maximum number of items has been reached on this field.');
... | [
"protected",
"function",
"validateSet",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"maxItems",
"=",
"$",
"this",
"->",
"getMaxItems",
"(",
")",
";",
"if",
"(",
"(",
"is_null",
"(",
"$",
"key",
")",
"||",
"!",
"array_key_exists",
"(",
"$",
"... | Validate input of OffsetSet
@param $key
@param $value
@throws ItemCountException
@throws NullValueException | [
"Validate",
"input",
"of",
"OffsetSet"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Entities/FieldCollection.php#L71-L81 |
25,418 | RocketPropelledTortoise/Core | src/Entities/FieldCollection.php | FieldCollection.getFieldInstance | protected function getFieldInstance($value)
{
if ($value instanceof Field) {
return $value;
}
$container = new $this->type();
$container->value = $value;
return $container;
} | php | protected function getFieldInstance($value)
{
if ($value instanceof Field) {
return $value;
}
$container = new $this->type();
$container->value = $value;
return $container;
} | [
"protected",
"function",
"getFieldInstance",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Field",
")",
"{",
"return",
"$",
"value",
";",
"}",
"$",
"container",
"=",
"new",
"$",
"this",
"->",
"type",
"(",
")",
";",
"$",
"contai... | Get a field from a value
@param Field|mixed $value
@return Field | [
"Get",
"a",
"field",
"from",
"a",
"value"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Entities/FieldCollection.php#L89-L99 |
25,419 | RocketPropelledTortoise/Core | src/Entities/FieldCollection.php | FieldCollection.clear | public function clear()
{
foreach ($this->items as $item) {
$this->deleted[] = $item;
}
$this->items = [];
} | php | public function clear()
{
foreach ($this->items as $item) {
$this->deleted[] = $item;
}
$this->items = [];
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"deleted",
"[",
"]",
"=",
"$",
"item",
";",
"}",
"$",
"this",
"->",
"items",
"=",
"[",
"]",
";",
"}"
] | Remove all items in this collection
@return void | [
"Remove",
"all",
"items",
"in",
"this",
"collection"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Entities/FieldCollection.php#L179-L186 |
25,420 | RocketPropelledTortoise/Core | src/Entities/FieldCollection.php | FieldCollection.toArray | public function toArray()
{
if ($this->getMaxItems() != 1) {
return parent::toArray();
}
if (!array_key_exists(0, $this->items)) {
return null;
}
return $this->get(0)->toArray();
} | php | public function toArray()
{
if ($this->getMaxItems() != 1) {
return parent::toArray();
}
if (!array_key_exists(0, $this->items)) {
return null;
}
return $this->get(0)->toArray();
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getMaxItems",
"(",
")",
"!=",
"1",
")",
"{",
"return",
"parent",
"::",
"toArray",
"(",
")",
";",
"}",
"if",
"(",
"!",
"array_key_exists",
"(",
"0",
",",
"$",
"this",
"... | As we use a field collection even if we have only one value, we use it that way.
@return array|mixed|null | [
"As",
"we",
"use",
"a",
"field",
"collection",
"even",
"if",
"we",
"have",
"only",
"one",
"value",
"we",
"use",
"it",
"that",
"way",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Entities/FieldCollection.php#L203-L214 |
25,421 | struggle-for-php/SfpStreamView | src/SfpStreamView/View.php | View.getScriptPath | function getScriptPath()
{
$fileName = $this->stack->pop();
if ($this->baseDir) {
return $this->baseDir . \DIRECTORY_SEPARATOR . $fileName;
} else {
return (string)$fileName;
}
} | php | function getScriptPath()
{
$fileName = $this->stack->pop();
if ($this->baseDir) {
return $this->baseDir . \DIRECTORY_SEPARATOR . $fileName;
} else {
return (string)$fileName;
}
} | [
"function",
"getScriptPath",
"(",
")",
"{",
"$",
"fileName",
"=",
"$",
"this",
"->",
"stack",
"->",
"pop",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"baseDir",
")",
"{",
"return",
"$",
"this",
"->",
"baseDir",
".",
"\\",
"DIRECTORY_SEPARATOR",
"."... | Get script file path
@return string | [
"Get",
"script",
"file",
"path"
] | 1ee960e122e4e7754a90cf81452567668ea1b32d | https://github.com/struggle-for-php/SfpStreamView/blob/1ee960e122e4e7754a90cf81452567668ea1b32d/src/SfpStreamView/View.php#L66-L74 |
25,422 | struggle-for-php/SfpStreamView | src/SfpStreamView/View.php | View.assign | function assign($array)
{
if (!is_array($array) && !($array instanceof \Traversable)) {
throw new \InvalidArgumentException('$array must be array or Traversable.');
}
foreach ($array as $key => $value) {
$this->storage[$key] = $value;
}
} | php | function assign($array)
{
if (!is_array($array) && !($array instanceof \Traversable)) {
throw new \InvalidArgumentException('$array must be array or Traversable.');
}
foreach ($array as $key => $value) {
$this->storage[$key] = $value;
}
} | [
"function",
"assign",
"(",
"$",
"array",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
"&&",
"!",
"(",
"$",
"array",
"instanceof",
"\\",
"Traversable",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'$array must be... | assign view vars
@param array|\Traversable $array | [
"assign",
"view",
"vars"
] | 1ee960e122e4e7754a90cf81452567668ea1b32d | https://github.com/struggle-for-php/SfpStreamView/blob/1ee960e122e4e7754a90cf81452567668ea1b32d/src/SfpStreamView/View.php#L89-L98 |
25,423 | eureka-framework/component-response | src/Response/Header/HttpCode.php | HttpCode.getText | public static function getText($code)
{
$code = (int) $code;
if (!self::exists($code)) {
throw new \DomainException('Http Code does not exist!');
}
return self::$httpCodes[$code];
} | php | public static function getText($code)
{
$code = (int) $code;
if (!self::exists($code)) {
throw new \DomainException('Http Code does not exist!');
}
return self::$httpCodes[$code];
} | [
"public",
"static",
"function",
"getText",
"(",
"$",
"code",
")",
"{",
"$",
"code",
"=",
"(",
"int",
")",
"$",
"code",
";",
"if",
"(",
"!",
"self",
"::",
"exists",
"(",
"$",
"code",
")",
")",
"{",
"throw",
"new",
"\\",
"DomainException",
"(",
"'H... | Return text for the specified http code.
@param int $code
@return string
@throws \DomainException | [
"Return",
"text",
"for",
"the",
"specified",
"http",
"code",
"."
] | f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a | https://github.com/eureka-framework/component-response/blob/f34aea3a0aa67b88c5e7f8a3b86af29c550fa99a/src/Response/Header/HttpCode.php#L98-L107 |
25,424 | UWEnrollmentManagement/Connection | src/Connection.php | Connection.execGET | public function execGET($url, array $params = [])
{
$url = $this->baseUrl . $url;
// Build the query from the parameters
if ($params !== []) {
$url .= '?' . http_build_query($params);
}
// Set request options
$this->addOptions([
CURLOPT_URL =... | php | public function execGET($url, array $params = [])
{
$url = $this->baseUrl . $url;
// Build the query from the parameters
if ($params !== []) {
$url .= '?' . http_build_query($params);
}
// Set request options
$this->addOptions([
CURLOPT_URL =... | [
"public",
"function",
"execGET",
"(",
"$",
"url",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"baseUrl",
".",
"$",
"url",
";",
"// Build the query from the parameters",
"if",
"(",
"$",
"params",
"!==",
"[",... | Execute a GET request to a given URL, with optional parameters.
@param string $url
@param string[] $params Array of query parameter $key=>$value pairs.
@return ConnectionReturn The server's response | [
"Execute",
"a",
"GET",
"request",
"to",
"a",
"given",
"URL",
"with",
"optional",
"parameters",
"."
] | 56cadfd9003a3e2d875494a26d9cce69b9b0aa57 | https://github.com/UWEnrollmentManagement/Connection/blob/56cadfd9003a3e2d875494a26d9cce69b9b0aa57/src/Connection.php#L103-L119 |
25,425 | UWEnrollmentManagement/Connection | src/Connection.php | Connection.execPOST | public function execPOST($url, array $params = [])
{
$url = $this->baseUrl . $url;
$this->addOptions([
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params,
]);
return $this->exec();
} | php | public function execPOST($url, array $params = [])
{
$url = $this->baseUrl . $url;
$this->addOptions([
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params,
]);
return $this->exec();
} | [
"public",
"function",
"execPOST",
"(",
"$",
"url",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"baseUrl",
".",
"$",
"url",
";",
"$",
"this",
"->",
"addOptions",
"(",
"[",
"CURLOPT_URL",
"=>",
"$",
"ur... | Execute a POST request to a given URL, with optional parameters.
@param string $url
@param string[] $params Array of POST parameter $key=>$value pairs.
@return ConnectionReturn The server's response. | [
"Execute",
"a",
"POST",
"request",
"to",
"a",
"given",
"URL",
"with",
"optional",
"parameters",
"."
] | 56cadfd9003a3e2d875494a26d9cce69b9b0aa57 | https://github.com/UWEnrollmentManagement/Connection/blob/56cadfd9003a3e2d875494a26d9cce69b9b0aa57/src/Connection.php#L128-L139 |
25,426 | spiral/console | src/Config/ConsoleConfig.php | ConsoleConfig.configureSequence | public function configureSequence(): \Generator
{
$sequence = $this->config['configure'] ?? $this->config['configureSequence'] ?? [];
foreach ($sequence as $item) {
yield $this->parseSequence($item);
}
} | php | public function configureSequence(): \Generator
{
$sequence = $this->config['configure'] ?? $this->config['configureSequence'] ?? [];
foreach ($sequence as $item) {
yield $this->parseSequence($item);
}
} | [
"public",
"function",
"configureSequence",
"(",
")",
":",
"\\",
"Generator",
"{",
"$",
"sequence",
"=",
"$",
"this",
"->",
"config",
"[",
"'configure'",
"]",
"??",
"$",
"this",
"->",
"config",
"[",
"'configureSequence'",
"]",
"??",
"[",
"]",
";",
"foreac... | Get list of configure sequences.
@return \Generator|SequenceInterface[]
@throws ConfigException | [
"Get",
"list",
"of",
"configure",
"sequences",
"."
] | c3d99450ddd32bcc6f87e2b2ed40821054a93da3 | https://github.com/spiral/console/blob/c3d99450ddd32bcc6f87e2b2ed40821054a93da3/src/Config/ConsoleConfig.php#L69-L75 |
25,427 | spiral/console | src/Config/ConsoleConfig.php | ConsoleConfig.updateSequence | public function updateSequence(): \Generator
{
$sequence = $this->config['update'] ?? $this->config['updateSequence'] ?? [];
foreach ($sequence as $item) {
yield $this->parseSequence($item);
}
} | php | public function updateSequence(): \Generator
{
$sequence = $this->config['update'] ?? $this->config['updateSequence'] ?? [];
foreach ($sequence as $item) {
yield $this->parseSequence($item);
}
} | [
"public",
"function",
"updateSequence",
"(",
")",
":",
"\\",
"Generator",
"{",
"$",
"sequence",
"=",
"$",
"this",
"->",
"config",
"[",
"'update'",
"]",
"??",
"$",
"this",
"->",
"config",
"[",
"'updateSequence'",
"]",
"??",
"[",
"]",
";",
"foreach",
"("... | Get list of all update sequences.
@return \Generator|SequenceInterface[]
@throws ConfigException | [
"Get",
"list",
"of",
"all",
"update",
"sequences",
"."
] | c3d99450ddd32bcc6f87e2b2ed40821054a93da3 | https://github.com/spiral/console/blob/c3d99450ddd32bcc6f87e2b2ed40821054a93da3/src/Config/ConsoleConfig.php#L84-L90 |
25,428 | ekyna/Table | Http/Handler/ExportHandler.php | ExportHandler.getAdapter | private function getAdapter(TableInterface $table, $format)
{
$adapters = $table->getConfig()->getExportAdapters();
foreach ($adapters as $adapter) {
if ($adapter->supports($format)) {
return $adapter;
}
}
return null;
} | php | private function getAdapter(TableInterface $table, $format)
{
$adapters = $table->getConfig()->getExportAdapters();
foreach ($adapters as $adapter) {
if ($adapter->supports($format)) {
return $adapter;
}
}
return null;
} | [
"private",
"function",
"getAdapter",
"(",
"TableInterface",
"$",
"table",
",",
"$",
"format",
")",
"{",
"$",
"adapters",
"=",
"$",
"table",
"->",
"getConfig",
"(",
")",
"->",
"getExportAdapters",
"(",
")",
";",
"foreach",
"(",
"$",
"adapters",
"as",
"$",... | Returns the adapter supporting the given format.
@param TableInterface $table
@param string $format
@return \Ekyna\Component\Table\Export\AdapterInterface|null | [
"Returns",
"the",
"adapter",
"supporting",
"the",
"given",
"format",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Http/Handler/ExportHandler.php#L64-L75 |
25,429 | jenskooij/cloudcontrol | src/util/DocumentSorter.php | DocumentSorter.sortDocumentsByField | public static function sortDocumentsByField($documents, $field, $order = 'ASC')
{
self::$orderByField = $field;
self::$order = strtoupper($order) === 'ASC' ? 'ASC' : 'DESC';
usort($documents, '\CloudControl\Cms\util\DocumentSorter::fieldCompare');
if ($order === 'DESC') {
... | php | public static function sortDocumentsByField($documents, $field, $order = 'ASC')
{
self::$orderByField = $field;
self::$order = strtoupper($order) === 'ASC' ? 'ASC' : 'DESC';
usort($documents, '\CloudControl\Cms\util\DocumentSorter::fieldCompare');
if ($order === 'DESC') {
... | [
"public",
"static",
"function",
"sortDocumentsByField",
"(",
"$",
"documents",
",",
"$",
"field",
",",
"$",
"order",
"=",
"'ASC'",
")",
"{",
"self",
"::",
"$",
"orderByField",
"=",
"$",
"field",
";",
"self",
"::",
"$",
"order",
"=",
"strtoupper",
"(",
... | Sorts an array of Document instances
@param array $documents
@param string $field
@param string $order
@return array | [
"Sorts",
"an",
"array",
"of",
"Document",
"instances"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/DocumentSorter.php#L23-L32 |
25,430 | jenskooij/cloudcontrol | src/util/DocumentSorter.php | DocumentSorter.fieldCompare | protected static function fieldCompare(Document $a, Document $b) {
$field = self::$orderByField;
if (property_exists('\CloudControl\Cms\storage\entities\Document', $field)) {
return strcasecmp($a->{$field}, $b->{$field});
}
if (!isset($a->fields->{$field}[0])) {
... | php | protected static function fieldCompare(Document $a, Document $b) {
$field = self::$orderByField;
if (property_exists('\CloudControl\Cms\storage\entities\Document', $field)) {
return strcasecmp($a->{$field}, $b->{$field});
}
if (!isset($a->fields->{$field}[0])) {
... | [
"protected",
"static",
"function",
"fieldCompare",
"(",
"Document",
"$",
"a",
",",
"Document",
"$",
"b",
")",
"{",
"$",
"field",
"=",
"self",
"::",
"$",
"orderByField",
";",
"if",
"(",
"property_exists",
"(",
"'\\CloudControl\\Cms\\storage\\entities\\Document'",
... | Compares two documents
@param Document $a
@param Document $b
@return int | [
"Compares",
"two",
"documents"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/util/DocumentSorter.php#L40-L55 |
25,431 | RhubarbPHP/Module.ImageProcessing | src/Image.php | Image.checkCacheValid | private function checkCacheValid( $cacheFile )
{
if ( file_exists( $cacheFile ) && ( filemtime( $cacheFile ) > filemtime( $this->filePath ) ) )
{
return true;
}
return false;
} | php | private function checkCacheValid( $cacheFile )
{
if ( file_exists( $cacheFile ) && ( filemtime( $cacheFile ) > filemtime( $this->filePath ) ) )
{
return true;
}
return false;
} | [
"private",
"function",
"checkCacheValid",
"(",
"$",
"cacheFile",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"cacheFile",
")",
"&&",
"(",
"filemtime",
"(",
"$",
"cacheFile",
")",
">",
"filemtime",
"(",
"$",
"this",
"->",
"filePath",
")",
")",
")",
"{... | Returns true if the cache file exists and is current.
@param mixed $cacheFile
@return bool | [
"Returns",
"true",
"if",
"the",
"cache",
"file",
"exists",
"and",
"is",
"current",
"."
] | e980ae6b524ce60f550064257eb7318dce331c1a | https://github.com/RhubarbPHP/Module.ImageProcessing/blob/e980ae6b524ce60f550064257eb7318dce331c1a/src/Image.php#L163-L171 |
25,432 | RhubarbPHP/Module.ImageProcessing | src/Image.php | Image.ApplyMetricsToCanvas | public function ApplyMetricsToCanvas()
{
$destinationCanvas = @imageCreateTrueColor( $this->_metrics->frameWidth, $this->_metrics->frameHeight );
$backColor = imagecolorallocate( $destinationCanvas, 255, 255, 255 );
if( $this->_metrics->sourceFormat == 3 )
{
$backColor = imagecolorallocatealpha( $destinat... | php | public function ApplyMetricsToCanvas()
{
$destinationCanvas = @imageCreateTrueColor( $this->_metrics->frameWidth, $this->_metrics->frameHeight );
$backColor = imagecolorallocate( $destinationCanvas, 255, 255, 255 );
if( $this->_metrics->sourceFormat == 3 )
{
$backColor = imagecolorallocatealpha( $destinat... | [
"public",
"function",
"ApplyMetricsToCanvas",
"(",
")",
"{",
"$",
"destinationCanvas",
"=",
"@",
"imageCreateTrueColor",
"(",
"$",
"this",
"->",
"_metrics",
"->",
"frameWidth",
",",
"$",
"this",
"->",
"_metrics",
"->",
"frameHeight",
")",
";",
"$",
"backColor"... | Makes sure that the current image metrics are applied to the canvas, essentially committing the
changes. | [
"Makes",
"sure",
"that",
"the",
"current",
"image",
"metrics",
"are",
"applied",
"to",
"the",
"canvas",
"essentially",
"committing",
"the",
"changes",
"."
] | e980ae6b524ce60f550064257eb7318dce331c1a | https://github.com/RhubarbPHP/Module.ImageProcessing/blob/e980ae6b524ce60f550064257eb7318dce331c1a/src/Image.php#L188-L213 |
25,433 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.HasAnyPageRight | private function HasAnyPageRight(BackendPageRights $pageRights)
{
return $pageRights->GetRemove() ||
$pageRights->GetCreateIn() ||
$pageRights->GetEdit() ||
$pageRights->GetMove();
} | php | private function HasAnyPageRight(BackendPageRights $pageRights)
{
return $pageRights->GetRemove() ||
$pageRights->GetCreateIn() ||
$pageRights->GetEdit() ||
$pageRights->GetMove();
} | [
"private",
"function",
"HasAnyPageRight",
"(",
"BackendPageRights",
"$",
"pageRights",
")",
"{",
"return",
"$",
"pageRights",
"->",
"GetRemove",
"(",
")",
"||",
"$",
"pageRights",
"->",
"GetCreateIn",
"(",
")",
"||",
"$",
"pageRights",
"->",
"GetEdit",
"(",
... | True if any of the page rights is true
@param BackendPageRights $pageRights The page right
@return boolean Returns true if any access action is allowed | [
"True",
"if",
"any",
"of",
"the",
"page",
"rights",
"is",
"true"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L222-L228 |
25,434 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.HasAnyContentRight | private function HasAnyContentRight(BackendContentRights $contentRights)
{
return $contentRights->GetEdit() ||
$contentRights->GetRemove() ||
$contentRights->GetCreateIn() ||
$contentRights->GetMove();
} | php | private function HasAnyContentRight(BackendContentRights $contentRights)
{
return $contentRights->GetEdit() ||
$contentRights->GetRemove() ||
$contentRights->GetCreateIn() ||
$contentRights->GetMove();
} | [
"private",
"function",
"HasAnyContentRight",
"(",
"BackendContentRights",
"$",
"contentRights",
")",
"{",
"return",
"$",
"contentRights",
"->",
"GetEdit",
"(",
")",
"||",
"$",
"contentRights",
"->",
"GetRemove",
"(",
")",
"||",
"$",
"contentRights",
"->",
"GetCr... | True if any of the content rights is true
@param BackendContentRights $contentRights
@return boolean Returns true if any access action is allowed | [
"True",
"if",
"any",
"of",
"the",
"content",
"rights",
"is",
"true"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L247-L253 |
25,435 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantGroupOnContent | private function GrantGroupOnContent(Usergroup $group, Usergroup $contentGroup, BackendContentRights $contentRights, BackendAction $action)
{
if (!$group->Equals($contentGroup))
{
return GrantResult::NoAccess();
}
$allowed = false;
switch ($action)
{
... | php | private function GrantGroupOnContent(Usergroup $group, Usergroup $contentGroup, BackendContentRights $contentRights, BackendAction $action)
{
if (!$group->Equals($contentGroup))
{
return GrantResult::NoAccess();
}
$allowed = false;
switch ($action)
{
... | [
"private",
"function",
"GrantGroupOnContent",
"(",
"Usergroup",
"$",
"group",
",",
"Usergroup",
"$",
"contentGroup",
",",
"BackendContentRights",
"$",
"contentRights",
",",
"BackendAction",
"$",
"action",
")",
"{",
"if",
"(",
"!",
"$",
"group",
"->",
"Equals",
... | Calculates the grant result for a group on a content
@param Usergroup $group The evaluated group
@param Usergroup $contentGroup The group of the content
@param BackendContentRights $contentRights The rights of the content
@param BackendAction $action The action that shall be taken for the content
@return GrantResult Re... | [
"Calculates",
"the",
"grant",
"result",
"for",
"a",
"group",
"on",
"a",
"content"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L400-L431 |
25,436 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantCreateLayout | private function GrantCreateLayout()
{
$groups = $this->GetGroups();
foreach ($groups as $group)
{
if ($group->GetCreateLayouts())
{
return GrantResult::Allowed();
}
}
return GrantResult::NoAccess();
} | php | private function GrantCreateLayout()
{
$groups = $this->GetGroups();
foreach ($groups as $group)
{
if ($group->GetCreateLayouts())
{
return GrantResult::Allowed();
}
}
return GrantResult::NoAccess();
} | [
"private",
"function",
"GrantCreateLayout",
"(",
")",
"{",
"$",
"groups",
"=",
"$",
"this",
"->",
"GetGroups",
"(",
")",
";",
"foreach",
"(",
"$",
"groups",
"as",
"$",
"group",
")",
"{",
"if",
"(",
"$",
"group",
"->",
"GetCreateLayouts",
"(",
")",
")... | Grant access to create a new layout by common group settings
@return GrantResult | [
"Grant",
"access",
"to",
"create",
"a",
"new",
"layout",
"by",
"common",
"group",
"settings"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L437-L448 |
25,437 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantOnContent | private function GrantOnContent(Content $content, BackendAction $action)
{
if ($this->GetUser()->Equals($content->GetUser()))
{
return GrantResult::Allowed();
}
$contentRights = RightsFinder::FindContentRights($content);
$contentGroup = GroupFinder::FindContentGro... | php | private function GrantOnContent(Content $content, BackendAction $action)
{
if ($this->GetUser()->Equals($content->GetUser()))
{
return GrantResult::Allowed();
}
$contentRights = RightsFinder::FindContentRights($content);
$contentGroup = GroupFinder::FindContentGro... | [
"private",
"function",
"GrantOnContent",
"(",
"Content",
"$",
"content",
",",
"BackendAction",
"$",
"action",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"GetUser",
"(",
")",
"->",
"Equals",
"(",
"$",
"content",
"->",
"GetUser",
"(",
")",
")",
")",
"{",
... | Calculates the grant result for a content
@param Content $content The content
@param BackendAction $action The action that shall be taken on the content
@return GrantResult Returns the calculated grant result | [
"Calculates",
"the",
"grant",
"result",
"for",
"a",
"content"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L491-L513 |
25,438 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantAddPageToSite | function GrantAddPageToSite(Site $site)
{
//Dummy page for evaluation
$page = new Page();
$page->SetUserGroup($site->GetUserGroup());
$siteRights = $site->GetUserGroupRights();
if ($siteRights)
{
$page->SetUserGroupRights($siteRights->GetPageRights());
... | php | function GrantAddPageToSite(Site $site)
{
//Dummy page for evaluation
$page = new Page();
$page->SetUserGroup($site->GetUserGroup());
$siteRights = $site->GetUserGroupRights();
if ($siteRights)
{
$page->SetUserGroupRights($siteRights->GetPageRights());
... | [
"function",
"GrantAddPageToSite",
"(",
"Site",
"$",
"site",
")",
"{",
"//Dummy page for evaluation",
"$",
"page",
"=",
"new",
"Page",
"(",
")",
";",
"$",
"page",
"->",
"SetUserGroup",
"(",
"$",
"site",
"->",
"GetUserGroup",
"(",
")",
")",
";",
"$",
"site... | Grant evaluation for adding a page on top of the site
@param Site $site The site
@return GrantResult The result | [
"Grant",
"evaluation",
"for",
"adding",
"a",
"page",
"on",
"top",
"of",
"the",
"site"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L610-L621 |
25,439 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantAddContentToPageArea | function GrantAddContentToPageArea(Page $page, Area $area)
{
$result = $this->Grant(BackendAction::Create(), $area);
if (!$result->ToBool())
{
return $result;
}
return $this->GrantAddContentToPage($page);
} | php | function GrantAddContentToPageArea(Page $page, Area $area)
{
$result = $this->Grant(BackendAction::Create(), $area);
if (!$result->ToBool())
{
return $result;
}
return $this->GrantAddContentToPage($page);
} | [
"function",
"GrantAddContentToPageArea",
"(",
"Page",
"$",
"page",
",",
"Area",
"$",
"area",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"Grant",
"(",
"BackendAction",
"::",
"Create",
"(",
")",
",",
"$",
"area",
")",
";",
"if",
"(",
"!",
"$",
... | Grant evaluation vor a page are
@param Page $page
@param Area $area
@return GrantResult | [
"Grant",
"evaluation",
"vor",
"a",
"page",
"are"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L628-L637 |
25,440 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantAddContentToPage | function GrantAddContentToPage(Page $page)
{
//dummy content for evaluation
$content = new Content();
$content->SetUserGroup(GroupFinder::FindPageGroup($page));
$pageRights = RightsFinder::FindPageRights($page);
if ($pageRights)
{
$content->SetUserGroupRig... | php | function GrantAddContentToPage(Page $page)
{
//dummy content for evaluation
$content = new Content();
$content->SetUserGroup(GroupFinder::FindPageGroup($page));
$pageRights = RightsFinder::FindPageRights($page);
if ($pageRights)
{
$content->SetUserGroupRig... | [
"function",
"GrantAddContentToPage",
"(",
"Page",
"$",
"page",
")",
"{",
"//dummy content for evaluation",
"$",
"content",
"=",
"new",
"Content",
"(",
")",
";",
"$",
"content",
"->",
"SetUserGroup",
"(",
"GroupFinder",
"::",
"FindPageGroup",
"(",
"$",
"page",
... | Grant evaluation for adding content on top of a page area
@param Page $page The page
@return GrantResult GrantResult Returns the grant result telling if creation is allowed | [
"Grant",
"evaluation",
"for",
"adding",
"content",
"on",
"top",
"of",
"a",
"page",
"area"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L643-L654 |
25,441 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantAddContentToLayoutArea | function GrantAddContentToLayoutArea(Area $area)
{
$result = $this->Grant(BackendAction::Create(), $area);
if (!$result->ToBool())
{
return $result;
}
return $this->GrantAddContentToLayout($area->GetLayout());
} | php | function GrantAddContentToLayoutArea(Area $area)
{
$result = $this->Grant(BackendAction::Create(), $area);
if (!$result->ToBool())
{
return $result;
}
return $this->GrantAddContentToLayout($area->GetLayout());
} | [
"function",
"GrantAddContentToLayoutArea",
"(",
"Area",
"$",
"area",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"Grant",
"(",
"BackendAction",
"::",
"Create",
"(",
")",
",",
"$",
"area",
")",
";",
"if",
"(",
"!",
"$",
"result",
"->",
"ToBool",
... | Grant evaluation for adding content to layout area
@param Area $area
@return GrantResult | [
"Grant",
"evaluation",
"for",
"adding",
"content",
"to",
"layout",
"area"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L660-L668 |
25,442 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantAddContentToLayout | function GrantAddContentToLayout(Layout $layout)
{
//dummy content for evaluation
$content = new Content();
$content->SetUserGroup($layout->GetUserGroup());
$layoutRights = $layout->GetUserGroupRights();
if ($layoutRights)
{
$content->SetUserGroupRights($l... | php | function GrantAddContentToLayout(Layout $layout)
{
//dummy content for evaluation
$content = new Content();
$content->SetUserGroup($layout->GetUserGroup());
$layoutRights = $layout->GetUserGroupRights();
if ($layoutRights)
{
$content->SetUserGroupRights($l... | [
"function",
"GrantAddContentToLayout",
"(",
"Layout",
"$",
"layout",
")",
"{",
"//dummy content for evaluation",
"$",
"content",
"=",
"new",
"Content",
"(",
")",
";",
"$",
"content",
"->",
"SetUserGroup",
"(",
"$",
"layout",
"->",
"GetUserGroup",
"(",
")",
")"... | Grant evaluation for adding content on top of a layout area
@param Layout $layout The layout
@return GrantResult Returns the grant result telling if creation is allowed | [
"Grant",
"evaluation",
"for",
"adding",
"content",
"on",
"top",
"of",
"a",
"layout",
"area"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L674-L685 |
25,443 | agentmedia/phine-core | src/Core/Logic/Access/Backend/UserGuard.php | UserGuard.GrantAddContentToContainer | function GrantAddContentToContainer(Container $container)
{
//dummy content for evaluation
$content = new Content();
$content->SetUserGroup($container->GetUserGroup());
$containerRights = $container->GetUserGroupRights();
if ($containerRights)
{
$content->... | php | function GrantAddContentToContainer(Container $container)
{
//dummy content for evaluation
$content = new Content();
$content->SetUserGroup($container->GetUserGroup());
$containerRights = $container->GetUserGroupRights();
if ($containerRights)
{
$content->... | [
"function",
"GrantAddContentToContainer",
"(",
"Container",
"$",
"container",
")",
"{",
"//dummy content for evaluation",
"$",
"content",
"=",
"new",
"Content",
"(",
")",
";",
"$",
"content",
"->",
"SetUserGroup",
"(",
"$",
"container",
"->",
"GetUserGroup",
"(",
... | Grant evaluation for adding content on top of a container
@param Container $container The container
@return GrantResult Returns the grant result telling if creation is allowed | [
"Grant",
"evaluation",
"for",
"adding",
"content",
"on",
"top",
"of",
"a",
"container"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Access/Backend/UserGuard.php#L716-L727 |
25,444 | vaniocz/stdlib | src/UniversalJsonSerializer.php | UniversalJsonSerializer.serialize | public static function serialize($value): string
{
$serialized = json_encode(
self::encode($value, new SplObjectStorage()),
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \InvalidArgumentException... | php | public static function serialize($value): string
{
$serialized = json_encode(
self::encode($value, new SplObjectStorage()),
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \InvalidArgumentException... | [
"public",
"static",
"function",
"serialize",
"(",
"$",
"value",
")",
":",
"string",
"{",
"$",
"serialized",
"=",
"json_encode",
"(",
"self",
"::",
"encode",
"(",
"$",
"value",
",",
"new",
"SplObjectStorage",
"(",
")",
")",
",",
"JSON_UNESCAPED_UNICODE",
"|... | Serialize the given value into a JSON encoded string.
@param mixed $value The value to be serialized.
@return string The JSON encoded string. | [
"Serialize",
"the",
"given",
"value",
"into",
"a",
"JSON",
"encoded",
"string",
"."
] | 06a8343c42829d8fdeecad2bb5c30946fbd73e74 | https://github.com/vaniocz/stdlib/blob/06a8343c42829d8fdeecad2bb5c30946fbd73e74/src/UniversalJsonSerializer.php#L22-L34 |
25,445 | vaniocz/stdlib | src/UniversalJsonSerializer.php | UniversalJsonSerializer.objectProperties | private static function objectProperties($object): array
{
if ($object instanceof Serializable) {
return ['$' => $object->serialize()];
}
$class = get_class($object);
$properties = [];
do {
try {
$properties += Closure::bind(function ... | php | private static function objectProperties($object): array
{
if ($object instanceof Serializable) {
return ['$' => $object->serialize()];
}
$class = get_class($object);
$properties = [];
do {
try {
$properties += Closure::bind(function ... | [
"private",
"static",
"function",
"objectProperties",
"(",
"$",
"object",
")",
":",
"array",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"Serializable",
")",
"{",
"return",
"[",
"'$'",
"=>",
"$",
"object",
"->",
"serialize",
"(",
")",
"]",
";",
"}",
"$... | Get array of all the object properties.
@param object $object
@return mixed[] The array of all the object properties. | [
"Get",
"array",
"of",
"all",
"the",
"object",
"properties",
"."
] | 06a8343c42829d8fdeecad2bb5c30946fbd73e74 | https://github.com/vaniocz/stdlib/blob/06a8343c42829d8fdeecad2bb5c30946fbd73e74/src/UniversalJsonSerializer.php#L72-L94 |
25,446 | wearenolte/wp-acf | src/Acf/Transforms/Repeater.php | Repeater.apply | public static function apply( $field ) {
if ( 'repeater' === $field['type'] && is_array( $field['value'] ) ) {
self::transform_image_fields( $field );
self::transform_to_object( $field );
}
return $field['value'];
} | php | public static function apply( $field ) {
if ( 'repeater' === $field['type'] && is_array( $field['value'] ) ) {
self::transform_image_fields( $field );
self::transform_to_object( $field );
}
return $field['value'];
} | [
"public",
"static",
"function",
"apply",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"'repeater'",
"===",
"$",
"field",
"[",
"'type'",
"]",
"&&",
"is_array",
"(",
"$",
"field",
"[",
"'value'",
"]",
")",
")",
"{",
"self",
"::",
"transform_image_fields",
"("... | Apply the transforms
@param array $field The field.
@return array | [
"Apply",
"the",
"transforms"
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf/Transforms/Repeater.php#L17-L25 |
25,447 | wearenolte/wp-acf | src/Acf/Transforms/Repeater.php | Repeater.transform_image_fields | public static function transform_image_fields( &$field ) {
if ( empty( $field['value'] ) ) {
return $field['value'];
}
foreach ( $field['sub_fields'] as $sub_field ) {
if ( 'image' === $sub_field['type'] && 'id' === $sub_field['return_format'] ) {
foreach ( $field['value'] as $id => $item ) {
$fie... | php | public static function transform_image_fields( &$field ) {
if ( empty( $field['value'] ) ) {
return $field['value'];
}
foreach ( $field['sub_fields'] as $sub_field ) {
if ( 'image' === $sub_field['type'] && 'id' === $sub_field['return_format'] ) {
foreach ( $field['value'] as $id => $item ) {
$fie... | [
"public",
"static",
"function",
"transform_image_fields",
"(",
"&",
"$",
"field",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"field",
"[",
"'value'",
"]",
")",
")",
"{",
"return",
"$",
"field",
"[",
"'value'",
"]",
";",
"}",
"foreach",
"(",
"$",
"field"... | Do the image size transform for an image sub fields.
@param string $field Field.
@return array | [
"Do",
"the",
"image",
"size",
"transform",
"for",
"an",
"image",
"sub",
"fields",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf/Transforms/Repeater.php#L33-L46 |
25,448 | wearenolte/wp-acf | src/Acf/Transforms/Repeater.php | Repeater.transform_to_object | public static function transform_to_object( &$field ) {
if ( 1 !== count( $field['value'] ) ) {
return $field['value'];
}
$as_array = ! ( 1 === $field['min'] && 1 === $field['max'] );
$as_array = apply_filters( Filter::REPEATER_AS_ARRAY, $as_array, $field );
$field['value'] = $as_array ? $field['value'] ... | php | public static function transform_to_object( &$field ) {
if ( 1 !== count( $field['value'] ) ) {
return $field['value'];
}
$as_array = ! ( 1 === $field['min'] && 1 === $field['max'] );
$as_array = apply_filters( Filter::REPEATER_AS_ARRAY, $as_array, $field );
$field['value'] = $as_array ? $field['value'] ... | [
"public",
"static",
"function",
"transform_to_object",
"(",
"&",
"$",
"field",
")",
"{",
"if",
"(",
"1",
"!==",
"count",
"(",
"$",
"field",
"[",
"'value'",
"]",
")",
")",
"{",
"return",
"$",
"field",
"[",
"'value'",
"]",
";",
"}",
"$",
"as_array",
... | Transform to an object if the filter is set and there is only 1 item.
@param array $field Field.
@return mixed | [
"Transform",
"to",
"an",
"object",
"if",
"the",
"filter",
"is",
"set",
"and",
"there",
"is",
"only",
"1",
"item",
"."
] | 2f5093438d637fa0eca42ad6d10f6b433ec078b2 | https://github.com/wearenolte/wp-acf/blob/2f5093438d637fa0eca42ad6d10f6b433ec078b2/src/Acf/Transforms/Repeater.php#L54-L63 |
25,449 | danielgp/browser-agent-info | source/ArchitecturesCpu.php | ArchiecturesCpu.listOfKnownCpuArchitectures | private function listOfKnownCpuArchitectures()
{
$arc = array_merge($this->listOfCpuArchitecturesX86(), $this->listOfCpuArchitecturesX64());
ksort($arc);
return $arc;
} | php | private function listOfKnownCpuArchitectures()
{
$arc = array_merge($this->listOfCpuArchitecturesX86(), $this->listOfCpuArchitecturesX64());
ksort($arc);
return $arc;
} | [
"private",
"function",
"listOfKnownCpuArchitectures",
"(",
")",
"{",
"$",
"arc",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"listOfCpuArchitecturesX86",
"(",
")",
",",
"$",
"this",
"->",
"listOfCpuArchitecturesX64",
"(",
")",
")",
";",
"ksort",
"(",
"$",
"a... | Holds a list of Known CPU Srchitectures as array
@return array | [
"Holds",
"a",
"list",
"of",
"Known",
"CPU",
"Srchitectures",
"as",
"array"
] | 5e4b2c01793ee47ce517be2c799d64abe78d7f8a | https://github.com/danielgp/browser-agent-info/blob/5e4b2c01793ee47ce517be2c799d64abe78d7f8a/source/ArchitecturesCpu.php#L164-L169 |
25,450 | Soneritics/Database | Soneritics/Database/DatabaseConnection/PDOMySQL.php | PDOMySQL.quote | public function quote($value)
{
if (is_array($value)) {
$result = [];
foreach ($value as $single) {
$result[] = $this->quote($single);
}
return sprintf(
'(%s)',
implode(', ', $result)
);
} els... | php | public function quote($value)
{
if (is_array($value)) {
$result = [];
foreach ($value as $single) {
$result[] = $this->quote($single);
}
return sprintf(
'(%s)',
implode(', ', $result)
);
} els... | [
"public",
"function",
"quote",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"single",
")",
"{",
"$",
"result",
"[",
"]",
"=",
... | Quote a value for use in a query.
@param $value
@return string | [
"Quote",
"a",
"value",
"for",
"use",
"in",
"a",
"query",
"."
] | 20cb74f2a2ee8d9161d3144b5c061a6da11cd066 | https://github.com/Soneritics/Database/blob/20cb74f2a2ee8d9161d3144b5c061a6da11cd066/Soneritics/Database/DatabaseConnection/PDOMySQL.php#L67-L81 |
25,451 | miguelibero/meinhof | src/Meinhof/Assetic/DelegatingResourceLoader.php | DelegatingResourceLoader.setLoaders | public function setLoaders(array $loaders)
{
$this->loaders = array();
foreach ($loaders as $type=>$loader) {
if (!$loader instanceof ResourceLoaderInterface) {
throw new \InvalidArgumentException("Not a valid resource loader.");
}
$this->loaders[$... | php | public function setLoaders(array $loaders)
{
$this->loaders = array();
foreach ($loaders as $type=>$loader) {
if (!$loader instanceof ResourceLoaderInterface) {
throw new \InvalidArgumentException("Not a valid resource loader.");
}
$this->loaders[$... | [
"public",
"function",
"setLoaders",
"(",
"array",
"$",
"loaders",
")",
"{",
"$",
"this",
"->",
"loaders",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"loaders",
"as",
"$",
"type",
"=>",
"$",
"loader",
")",
"{",
"if",
"(",
"!",
"$",
"loader",
... | sets the list of available resource loaders
@param array $loaders a list of resource loaders indexed by type | [
"sets",
"the",
"list",
"of",
"available",
"resource",
"loaders"
] | 3a090f08485dc0da3e27463cf349dba374201072 | https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Assetic/DelegatingResourceLoader.php#L56-L65 |
25,452 | miguelibero/meinhof | src/Meinhof/Assetic/DelegatingResourceLoader.php | DelegatingResourceLoader.getLoader | protected function getLoader($type)
{
if (!isset($this->loaders[$type])) {
throw new \InvalidArgumentException("No loader defined for type '${type}'.");
}
return $this->loaders[$type];
} | php | protected function getLoader($type)
{
if (!isset($this->loaders[$type])) {
throw new \InvalidArgumentException("No loader defined for type '${type}'.");
}
return $this->loaders[$type];
} | [
"protected",
"function",
"getLoader",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"loaders",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"No loader defined for type '${type}'... | Get the resource loader for a given type
@param string $type the resource type
@return ResourceLoaderInterface the resource loader
@throws \InvalidArgumentException if no loader defined for the given type | [
"Get",
"the",
"resource",
"loader",
"for",
"a",
"given",
"type"
] | 3a090f08485dc0da3e27463cf349dba374201072 | https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Assetic/DelegatingResourceLoader.php#L87-L94 |
25,453 | miguelibero/meinhof | src/Meinhof/Assetic/DelegatingResourceLoader.php | DelegatingResourceLoader.getResourceType | protected function getResourceType($name)
{
if (!isset($this->types[$name])) {
$template = $this->parser->parse($name);
if ($template instanceof TemplateReferenceInterface) {
$this->types[$name] = $template->get('engine');
}
}
if (!isset($t... | php | protected function getResourceType($name)
{
if (!isset($this->types[$name])) {
$template = $this->parser->parse($name);
if ($template instanceof TemplateReferenceInterface) {
$this->types[$name] = $template->get('engine');
}
}
if (!isset($t... | [
"protected",
"function",
"getResourceType",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"template",
"=",
"$",
"this",
"->",
"parser",
"->",
"parse",
"(",
"$",
"n... | Returns the type of a resource
@param string $name the name of the resource
@return string type of the resource
@throws \RuntimeException if the resource could not be loaded | [
"Returns",
"the",
"type",
"of",
"a",
"resource"
] | 3a090f08485dc0da3e27463cf349dba374201072 | https://github.com/miguelibero/meinhof/blob/3a090f08485dc0da3e27463cf349dba374201072/src/Meinhof/Assetic/DelegatingResourceLoader.php#L104-L117 |
25,454 | praxigento/mobi_mod_downline | Observer/CustomerSaveAfterDataObject/A/GroupSwitch.php | GroupSwitch.registerGroupChange | private function registerGroupChange($custId, $groupIdOld, $groupIdNew)
{
$data = new EChangeGroup();
$data->setCustomerRef($custId);
$data->setGroupOld($groupIdOld);
$data->setGroupNew($groupIdNew);
$dateChanged = $this->hlpDate->getUtcNowForDb();
$data->setDateChang... | php | private function registerGroupChange($custId, $groupIdOld, $groupIdNew)
{
$data = new EChangeGroup();
$data->setCustomerRef($custId);
$data->setGroupOld($groupIdOld);
$data->setGroupNew($groupIdNew);
$dateChanged = $this->hlpDate->getUtcNowForDb();
$data->setDateChang... | [
"private",
"function",
"registerGroupChange",
"(",
"$",
"custId",
",",
"$",
"groupIdOld",
",",
"$",
"groupIdNew",
")",
"{",
"$",
"data",
"=",
"new",
"EChangeGroup",
"(",
")",
";",
"$",
"data",
"->",
"setCustomerRef",
"(",
"$",
"custId",
")",
";",
"$",
... | Save group change event into registry.
@param int $custId
@param int $groupIdOld
@param int $groupIdNew | [
"Save",
"group",
"change",
"event",
"into",
"registry",
"."
] | 0f3c276dfff1aa029f9fd205ccfc56f207a2e75b | https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Observer/CustomerSaveAfterDataObject/A/GroupSwitch.php#L65-L74 |
25,455 | Aviogram/Common | src/Hydrator/ByClassMethods.php | ByClassMethods.getSetters | protected function getSetters($object)
{
// Get the current class
$class = get_class($object);
// Check if we have already parsed this class
if (array_key_exists($class, $this->classMethodsCache) === true) {
return $this->classMethodsCache[$class];
}
... | php | protected function getSetters($object)
{
// Get the current class
$class = get_class($object);
// Check if we have already parsed this class
if (array_key_exists($class, $this->classMethodsCache) === true) {
return $this->classMethodsCache[$class];
}
... | [
"protected",
"function",
"getSetters",
"(",
"$",
"object",
")",
"{",
"// Get the current class\r",
"$",
"class",
"=",
"get_class",
"(",
"$",
"object",
")",
";",
"// Check if we have already parsed this class\r",
"if",
"(",
"array_key_exists",
"(",
"$",
"class",
",",... | Get the setters of an object
@param mixed $object
@return Collection\Method | [
"Get",
"the",
"setters",
"of",
"an",
"object"
] | bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5 | https://github.com/Aviogram/Common/blob/bcff2e409cccd4791a3f9bca0b2cdd70c25ddec5/src/Hydrator/ByClassMethods.php#L136-L221 |
25,456 | geoffadams/bedrest-core | library/BedRest/Content/Negotiation/Negotiator.php | Negotiator.setSupportedMediaTypes | public function setSupportedMediaTypes(array $mediaTypes)
{
foreach ($mediaTypes as $mediaType => $converterClass) {
if (!is_string($mediaType)) {
throw new Exception('Media type must be a string.');
}
if (!is_string($converterClass)) {
th... | php | public function setSupportedMediaTypes(array $mediaTypes)
{
foreach ($mediaTypes as $mediaType => $converterClass) {
if (!is_string($mediaType)) {
throw new Exception('Media type must be a string.');
}
if (!is_string($converterClass)) {
th... | [
"public",
"function",
"setSupportedMediaTypes",
"(",
"array",
"$",
"mediaTypes",
")",
"{",
"foreach",
"(",
"$",
"mediaTypes",
"as",
"$",
"mediaType",
"=>",
"$",
"converterClass",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"mediaType",
")",
")",
"{",
... | Sets the list of supported media types for negotiation.
@param array $mediaTypes
@throws \BedRest\Content\Negotiation\Exception | [
"Sets",
"the",
"list",
"of",
"supported",
"media",
"types",
"for",
"negotiation",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Content/Negotiation/Negotiator.php#L54-L67 |
25,457 | geoffadams/bedrest-core | library/BedRest/Content/Negotiation/Negotiator.php | Negotiator.negotiate | public function negotiate($content, MediaTypeList $mediaTypeList)
{
$contentType = $mediaTypeList->getBestMatch(array_keys($this->supportedMediaTypes));
if (!$contentType) {
throw new Exception('A suitable Content-Type could not be found.');
}
$result = new NegotiatedRes... | php | public function negotiate($content, MediaTypeList $mediaTypeList)
{
$contentType = $mediaTypeList->getBestMatch(array_keys($this->supportedMediaTypes));
if (!$contentType) {
throw new Exception('A suitable Content-Type could not be found.');
}
$result = new NegotiatedRes... | [
"public",
"function",
"negotiate",
"(",
"$",
"content",
",",
"MediaTypeList",
"$",
"mediaTypeList",
")",
"{",
"$",
"contentType",
"=",
"$",
"mediaTypeList",
"->",
"getBestMatch",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"supportedMediaTypes",
")",
")",
";",
... | Negotiates content based on a set of input criteria.
@param mixed $content
@param \BedRest\Content\Negotiation\MediaTypeList $mediaTypeList
@throws \BedRest\Content\Negotiation\Exception
@return \BedRest\Content\Negotiation\NegotiatedResult | [
"Negotiates",
"content",
"based",
"on",
"a",
"set",
"of",
"input",
"criteria",
"."
] | a77bf8b7492dfbfb720b201f7ec91a4f03417b5c | https://github.com/geoffadams/bedrest-core/blob/a77bf8b7492dfbfb720b201f7ec91a4f03417b5c/library/BedRest/Content/Negotiation/Negotiator.php#L78-L90 |
25,458 | zhaoxianfang/tools | src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php | YamlFileLoader.loadFromExtensions | private function loadFromExtensions(array $content)
{
foreach ($content as $namespace => $values) {
if (in_array($namespace, array('imports', 'parameters', 'services'))) {
continue;
}
if (!is_array($values) && null !== $values) {
$values =... | php | private function loadFromExtensions(array $content)
{
foreach ($content as $namespace => $values) {
if (in_array($namespace, array('imports', 'parameters', 'services'))) {
continue;
}
if (!is_array($values) && null !== $values) {
$values =... | [
"private",
"function",
"loadFromExtensions",
"(",
"array",
"$",
"content",
")",
"{",
"foreach",
"(",
"$",
"content",
"as",
"$",
"namespace",
"=>",
"$",
"values",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"namespace",
",",
"array",
"(",
"'imports'",
",",... | Loads from Extensions. | [
"Loads",
"from",
"Extensions",
"."
] | d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7 | https://github.com/zhaoxianfang/tools/blob/d8fc8a9ecd75b5ce4236f0a2e9fdc055108573e7/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php#L817-L830 |
25,459 | rutger-speksnijder/simpleroute | src/SimpleRoute/Router.php | Router.setUrl | public function setUrl($url)
{
$this->url = $url;
// Check if the url ends with a slash
if ($this->url && substr($this->url, -1) !== '/') {
$this->url .= '/';
}
return $this;
} | php | public function setUrl($url)
{
$this->url = $url;
// Check if the url ends with a slash
if ($this->url && substr($this->url, -1) !== '/') {
$this->url .= '/';
}
return $this;
} | [
"public",
"function",
"setUrl",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"url",
"=",
"$",
"url",
";",
"// Check if the url ends with a slash",
"if",
"(",
"$",
"this",
"->",
"url",
"&&",
"substr",
"(",
"$",
"this",
"->",
"url",
",",
"-",
"1",
")"... | Sets the request url.
@param string $url The url.
@return $this The current object. | [
"Sets",
"the",
"request",
"url",
"."
] | b862cea540d515e91d2c3a912b53e5e31939695e | https://github.com/rutger-speksnijder/simpleroute/blob/b862cea540d515e91d2c3a912b53e5e31939695e/src/SimpleRoute/Router.php#L124-L134 |
25,460 | rutger-speksnijder/simpleroute | src/SimpleRoute/Router.php | Router.add | public function add($route, $callable, $type = 'any')
{
// Check if the route ends with a forward slash
if ($route && substr($route, -1) !== '/') {
$route .= '/';
}
// Add the route
$this->routes[strtolower($type)][$route] = $callable;
return $this;
} | php | public function add($route, $callable, $type = 'any')
{
// Check if the route ends with a forward slash
if ($route && substr($route, -1) !== '/') {
$route .= '/';
}
// Add the route
$this->routes[strtolower($type)][$route] = $callable;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"route",
",",
"$",
"callable",
",",
"$",
"type",
"=",
"'any'",
")",
"{",
"// Check if the route ends with a forward slash",
"if",
"(",
"$",
"route",
"&&",
"substr",
"(",
"$",
"route",
",",
"-",
"1",
")",
"!==",
"'/'... | Adds a route to the router.
@param string $route The route.
@param callable $callable The method to execute when this route gets called.
@param string $type The request type to bind this route to.
@return $this The current object. | [
"Adds",
"a",
"route",
"to",
"the",
"router",
"."
] | b862cea540d515e91d2c3a912b53e5e31939695e | https://github.com/rutger-speksnijder/simpleroute/blob/b862cea540d515e91d2c3a912b53e5e31939695e/src/SimpleRoute/Router.php#L155-L165 |
25,461 | rutger-speksnijder/simpleroute | src/SimpleRoute/Router.php | Router.getMethodsByRoute | public function getMethodsByRoute($route)
{
// Check if a route was provided
if (!$route) {
return [];
}
// Loop through our routes
$methods = [];
foreach ($this->routes as $method => $routes) {
foreach ($routes as $availableRoute => $callable... | php | public function getMethodsByRoute($route)
{
// Check if a route was provided
if (!$route) {
return [];
}
// Loop through our routes
$methods = [];
foreach ($this->routes as $method => $routes) {
foreach ($routes as $availableRoute => $callable... | [
"public",
"function",
"getMethodsByRoute",
"(",
"$",
"route",
")",
"{",
"// Check if a route was provided",
"if",
"(",
"!",
"$",
"route",
")",
"{",
"return",
"[",
"]",
";",
"}",
"// Loop through our routes",
"$",
"methods",
"=",
"[",
"]",
";",
"foreach",
"("... | Returns an array of methods defined for a specific route.
Useful for an "OPTIONS" request.
@param string $route The route to get the methods from.
@return array An array with methods. | [
"Returns",
"an",
"array",
"of",
"methods",
"defined",
"for",
"a",
"specific",
"route",
".",
"Useful",
"for",
"an",
"OPTIONS",
"request",
"."
] | b862cea540d515e91d2c3a912b53e5e31939695e | https://github.com/rutger-speksnijder/simpleroute/blob/b862cea540d515e91d2c3a912b53e5e31939695e/src/SimpleRoute/Router.php#L275-L303 |
25,462 | rutger-speksnijder/simpleroute | src/SimpleRoute/Router.php | Router.execute | public function execute()
{
// Check if we have a url
if (!$this->url || trim($this->url) == '') {
$this->url = '/';
}
// Make sure the url starts with a slash
if (substr($this->url, 0, 1) !== '/') {
$this->url = '/' . $this->url;
}
/... | php | public function execute()
{
// Check if we have a url
if (!$this->url || trim($this->url) == '') {
$this->url = '/';
}
// Make sure the url starts with a slash
if (substr($this->url, 0, 1) !== '/') {
$this->url = '/' . $this->url;
}
/... | [
"public",
"function",
"execute",
"(",
")",
"{",
"// Check if we have a url",
"if",
"(",
"!",
"$",
"this",
"->",
"url",
"||",
"trim",
"(",
"$",
"this",
"->",
"url",
")",
"==",
"''",
")",
"{",
"$",
"this",
"->",
"url",
"=",
"'/'",
";",
"}",
"// Make ... | Executes the router based on the url.
@throws Exception Throws an exception if no location was set and no default route was found.
@return mixed The result of the callable method. | [
"Executes",
"the",
"router",
"based",
"on",
"the",
"url",
"."
] | b862cea540d515e91d2c3a912b53e5e31939695e | https://github.com/rutger-speksnijder/simpleroute/blob/b862cea540d515e91d2c3a912b53e5e31939695e/src/SimpleRoute/Router.php#L312-L363 |
25,463 | Stinger-Soft/DoctrineCommons | src/StingerSoft/DoctrineCommons/Utils/JsonImporter.php | JsonImporter.before | protected function before() {
if($this->connection->getDatabasePlatform() instanceof SQLServerPlatform) {
$this->connection->executeUpdate('EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"');
} else if($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$this->connection->execute... | php | protected function before() {
if($this->connection->getDatabasePlatform() instanceof SQLServerPlatform) {
$this->connection->executeUpdate('EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"');
} else if($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$this->connection->execute... | [
"protected",
"function",
"before",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connection",
"->",
"getDatabasePlatform",
"(",
")",
"instanceof",
"SQLServerPlatform",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"executeUpdate",
"(",
"'EXEC sp_msforeachtabl... | Executed before the import is started | [
"Executed",
"before",
"the",
"import",
"is",
"started"
] | 1f0dd56a94654c8de63927d7eec2175aab3cf809 | https://github.com/Stinger-Soft/DoctrineCommons/blob/1f0dd56a94654c8de63927d7eec2175aab3cf809/src/StingerSoft/DoctrineCommons/Utils/JsonImporter.php#L132-L140 |
25,464 | Stinger-Soft/DoctrineCommons | src/StingerSoft/DoctrineCommons/Utils/JsonImporter.php | JsonImporter.after | protected function after() {
if($this->connection->getDatabasePlatform() instanceof SQLServerPlatform) {
$this->connection->executeUpdate('exec sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"');
} else if($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$this->connection-... | php | protected function after() {
if($this->connection->getDatabasePlatform() instanceof SQLServerPlatform) {
$this->connection->executeUpdate('exec sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"');
} else if($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$this->connection-... | [
"protected",
"function",
"after",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connection",
"->",
"getDatabasePlatform",
"(",
")",
"instanceof",
"SQLServerPlatform",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"executeUpdate",
"(",
"'exec sp_msforeachtable... | Executed after the import is finished | [
"Executed",
"after",
"the",
"import",
"is",
"finished"
] | 1f0dd56a94654c8de63927d7eec2175aab3cf809 | https://github.com/Stinger-Soft/DoctrineCommons/blob/1f0dd56a94654c8de63927d7eec2175aab3cf809/src/StingerSoft/DoctrineCommons/Utils/JsonImporter.php#L145-L153 |
25,465 | kambalabs/KmbPmProxy | src/KmbPmProxy/Hydrator/GroupHydrator.php | GroupHydrator.hydrate | public function hydrate($puppetModules, $group)
{
$availableClasses = [];
if (!empty($puppetModules)) {
foreach ($puppetModules as $puppetModule) {
if ($puppetModule->hasClasses()) {
foreach ($puppetModule->getClasses() as $puppetClass) {
... | php | public function hydrate($puppetModules, $group)
{
$availableClasses = [];
if (!empty($puppetModules)) {
foreach ($puppetModules as $puppetModule) {
if ($puppetModule->hasClasses()) {
foreach ($puppetModule->getClasses() as $puppetClass) {
... | [
"public",
"function",
"hydrate",
"(",
"$",
"puppetModules",
",",
"$",
"group",
")",
"{",
"$",
"availableClasses",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"puppetModules",
")",
")",
"{",
"foreach",
"(",
"$",
"puppetModules",
"as",
"$",
... | Hydrate group with the provided puppet modules data.
@param PuppetModule[] $puppetModules
@param GroupInterface $group
@return GroupInterface | [
"Hydrate",
"group",
"with",
"the",
"provided",
"puppet",
"modules",
"data",
"."
] | b4c664ae8b6f29e4e8768461ed99e1b0b80bde18 | https://github.com/kambalabs/KmbPmProxy/blob/b4c664ae8b6f29e4e8768461ed99e1b0b80bde18/src/KmbPmProxy/Hydrator/GroupHydrator.php#L38-L58 |
25,466 | dmitrya2e/filtration-bundle | Manager/FilterSuperManager.php | FilterSuperManager.addFilter | public function addFilter(CollectionInterface $collection, $typeAlias, $name, array $options = [])
{
$filter = $this->filterCreator->create($typeAlias, $name, $options);
$collection->addFilter($filter);
return $filter;
} | php | public function addFilter(CollectionInterface $collection, $typeAlias, $name, array $options = [])
{
$filter = $this->filterCreator->create($typeAlias, $name, $options);
$collection->addFilter($filter);
return $filter;
} | [
"public",
"function",
"addFilter",
"(",
"CollectionInterface",
"$",
"collection",
",",
"$",
"typeAlias",
",",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"filterCreator",
"->",
"create",
"(",... | Adds a filter to the collection.
@param CollectionInterface $collection The filter collection
@param string $typeAlias The alias of the filter service definition
@param string $name The internal name of the filter
@param array $options (Optional) The options of the fil... | [
"Adds",
"a",
"filter",
"to",
"the",
"collection",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Manager/FilterSuperManager.php#L114-L120 |
25,467 | dmitrya2e/filtration-bundle | Manager/FilterSuperManager.php | FilterSuperManager.createNamedForm | public function createNamedForm(
$name,
CollectionInterface $collection,
array $rootFormBuilderOptions = [],
array $filterFormBuilderOptions = [],
Request $request = null
) {
$form = $this->formCreator->createNamed($name, $collection, $rootFormBuilderOptions, $filterF... | php | public function createNamedForm(
$name,
CollectionInterface $collection,
array $rootFormBuilderOptions = [],
array $filterFormBuilderOptions = [],
Request $request = null
) {
$form = $this->formCreator->createNamed($name, $collection, $rootFormBuilderOptions, $filterF... | [
"public",
"function",
"createNamedForm",
"(",
"$",
"name",
",",
"CollectionInterface",
"$",
"collection",
",",
"array",
"$",
"rootFormBuilderOptions",
"=",
"[",
"]",
",",
"array",
"$",
"filterFormBuilderOptions",
"=",
"[",
"]",
",",
"Request",
"$",
"request",
... | Creates a filtration named form.
@param string $name The name of the root form
@param CollectionInterface $collection The filter collection
@param array $rootFormBuilderOptions (Optional)
@param array $filterFormBuilderOptions (Optional)
@par... | [
"Creates",
"a",
"filtration",
"named",
"form",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Manager/FilterSuperManager.php#L164-L178 |
25,468 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.index | public function index($trashed = false)
{
$this->authorize(UsersPolicy::PERMISSION_LIST);
$users = $this->user->with('roles')->protectAdmins()->when($trashed, function ($query) {
return $query->onlyTrashed();
})->paginate(30);
$title = trans('auth::users.titles.users-li... | php | public function index($trashed = false)
{
$this->authorize(UsersPolicy::PERMISSION_LIST);
$users = $this->user->with('roles')->protectAdmins()->when($trashed, function ($query) {
return $query->onlyTrashed();
})->paginate(30);
$title = trans('auth::users.titles.users-li... | [
"public",
"function",
"index",
"(",
"$",
"trashed",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"UsersPolicy",
"::",
"PERMISSION_LIST",
")",
";",
"$",
"users",
"=",
"$",
"this",
"->",
"user",
"->",
"with",
"(",
"'roles'",
")",
"->",
... | List the users.
@param bool $trashed
@return \Illuminate\View\View | [
"List",
"the",
"users",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L71-L84 |
25,469 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.listByRole | public function listByRole(Role $role, $trashed = false)
{
$this->authorize(UsersPolicy::PERMISSION_LIST);
$users = $role->users()->with('roles')
->protectAdmins()
->paginate(30);
$title = trans('auth::users.titles.users-list')." - {$role->name} Role". ($trashed ? '... | php | public function listByRole(Role $role, $trashed = false)
{
$this->authorize(UsersPolicy::PERMISSION_LIST);
$users = $role->users()->with('roles')
->protectAdmins()
->paginate(30);
$title = trans('auth::users.titles.users-list')." - {$role->name} Role". ($trashed ? '... | [
"public",
"function",
"listByRole",
"(",
"Role",
"$",
"role",
",",
"$",
"trashed",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"UsersPolicy",
"::",
"PERMISSION_LIST",
")",
";",
"$",
"users",
"=",
"$",
"role",
"->",
"users",
"(",
")",
... | List the users by a role.
@param \Arcanesoft\Contracts\Auth\Models\Role $role
@param bool $trashed
@return \Illuminate\View\View | [
"List",
"the",
"users",
"by",
"a",
"role",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L104-L117 |
25,470 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.create | public function create(Role $role)
{
$this->authorize(UsersPolicy::PERMISSION_CREATE);
$roles = $role->all();
$this->setTitle($title = trans('auth::users.titles.create-user'));
$this->addBreadcrumb($title);
return $this->view('admin.users.create', compact('roles'));
} | php | public function create(Role $role)
{
$this->authorize(UsersPolicy::PERMISSION_CREATE);
$roles = $role->all();
$this->setTitle($title = trans('auth::users.titles.create-user'));
$this->addBreadcrumb($title);
return $this->view('admin.users.create', compact('roles'));
} | [
"public",
"function",
"create",
"(",
"Role",
"$",
"role",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"UsersPolicy",
"::",
"PERMISSION_CREATE",
")",
";",
"$",
"roles",
"=",
"$",
"role",
"->",
"all",
"(",
")",
";",
"$",
"this",
"->",
"setTitle",
"(... | Show the create a new user form.
@param \Arcanesoft\Contracts\Auth\Models\Role $role
@return \Illuminate\View\View | [
"Show",
"the",
"create",
"a",
"new",
"user",
"form",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L126-L136 |
25,471 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.store | public function store(CreateUserRequest $request, User $user)
{
$this->authorize(UsersPolicy::PERMISSION_CREATE);
$user->fill($request->getValidatedData());
$user->is_active = true;
$user->save();
$user->roles()->sync($request->get('roles'));
$this->transNotificatio... | php | public function store(CreateUserRequest $request, User $user)
{
$this->authorize(UsersPolicy::PERMISSION_CREATE);
$user->fill($request->getValidatedData());
$user->is_active = true;
$user->save();
$user->roles()->sync($request->get('roles'));
$this->transNotificatio... | [
"public",
"function",
"store",
"(",
"CreateUserRequest",
"$",
"request",
",",
"User",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"UsersPolicy",
"::",
"PERMISSION_CREATE",
")",
";",
"$",
"user",
"->",
"fill",
"(",
"$",
"request",
"->",
"g... | Store the new user.
@param \Arcanesoft\Auth\Http\Requests\Admin\Users\CreateUserRequest $request
@param \Arcanesoft\Contracts\Auth\Models\User $user
@return \Illuminate\Http\RedirectResponse | [
"Store",
"the",
"new",
"user",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L146-L158 |
25,472 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.show | public function show(User $user)
{
$this->authorize(UsersPolicy::PERMISSION_SHOW);
$user->load(['roles', 'roles.permissions']);
$this->setTitle($title = trans('auth::users.titles.user-details'));
$this->addBreadcrumb($title);
return $this->view('admin.users.show', compact(... | php | public function show(User $user)
{
$this->authorize(UsersPolicy::PERMISSION_SHOW);
$user->load(['roles', 'roles.permissions']);
$this->setTitle($title = trans('auth::users.titles.user-details'));
$this->addBreadcrumb($title);
return $this->view('admin.users.show', compact(... | [
"public",
"function",
"show",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"UsersPolicy",
"::",
"PERMISSION_SHOW",
")",
";",
"$",
"user",
"->",
"load",
"(",
"[",
"'roles'",
",",
"'roles.permissions'",
"]",
")",
";",
"$",
"th... | Show the user's details.
@param \Arcanesoft\Contracts\Auth\Models\User $user
@return \Illuminate\View\View | [
"Show",
"the",
"user",
"s",
"details",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L167-L177 |
25,473 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.edit | public function edit(User $user, Role $role)
{
$this->authorize(UsersPolicy::PERMISSION_UPDATE);
$user->load(['roles', 'roles.permissions']);
$roles = $role->all();
$this->setTitle($title = trans('auth::users.titles.edit-user'));
$this->addBreadcrumb($title);
retur... | php | public function edit(User $user, Role $role)
{
$this->authorize(UsersPolicy::PERMISSION_UPDATE);
$user->load(['roles', 'roles.permissions']);
$roles = $role->all();
$this->setTitle($title = trans('auth::users.titles.edit-user'));
$this->addBreadcrumb($title);
retur... | [
"public",
"function",
"edit",
"(",
"User",
"$",
"user",
",",
"Role",
"$",
"role",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"UsersPolicy",
"::",
"PERMISSION_UPDATE",
")",
";",
"$",
"user",
"->",
"load",
"(",
"[",
"'roles'",
",",
"'roles.permissions'... | Show the edit the user form.
@param \Arcanesoft\Contracts\Auth\Models\User $user
@param \Arcanesoft\Contracts\Auth\Models\Role $role
@return \Illuminate\View\View | [
"Show",
"the",
"edit",
"the",
"user",
"form",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L187-L198 |
25,474 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.restore | public function restore(User $user)
{
$this->authorize(UsersPolicy::PERMISSION_UPDATE);
try {
$user->restore();
$message = $this->transNotification('restored', ['name' => $user->full_name], $user->toArray());
return $this->jsonResponseSuccess(compact('message')... | php | public function restore(User $user)
{
$this->authorize(UsersPolicy::PERMISSION_UPDATE);
try {
$user->restore();
$message = $this->transNotification('restored', ['name' => $user->full_name], $user->toArray());
return $this->jsonResponseSuccess(compact('message')... | [
"public",
"function",
"restore",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"UsersPolicy",
"::",
"PERMISSION_UPDATE",
")",
";",
"try",
"{",
"$",
"user",
"->",
"restore",
"(",
")",
";",
"$",
"message",
"=",
"$",
"this",
"... | Restore the trashed user.
@param \Arcanesoft\Contracts\Auth\Models\User $user
@return \Illuminate\Http\JsonResponse | [
"Restore",
"the",
"trashed",
"user",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L254-L268 |
25,475 | ARCANESOFT/Auth | src/Http/Controllers/Admin/UsersController.php | UsersController.impersonate | public function impersonate(User $user, Impersonator $impersonator)
{
/** @var \Arcanedev\LaravelImpersonator\Contracts\Impersonatable $user */
if ( ! $impersonator->start(auth()->user(), $user)) {
$this->notifyDanger(
trans('auth::users.messages.impersonation-failed.me... | php | public function impersonate(User $user, Impersonator $impersonator)
{
/** @var \Arcanedev\LaravelImpersonator\Contracts\Impersonatable $user */
if ( ! $impersonator->start(auth()->user(), $user)) {
$this->notifyDanger(
trans('auth::users.messages.impersonation-failed.me... | [
"public",
"function",
"impersonate",
"(",
"User",
"$",
"user",
",",
"Impersonator",
"$",
"impersonator",
")",
"{",
"/** @var \\Arcanedev\\LaravelImpersonator\\Contracts\\Impersonatable $user */",
"if",
"(",
"!",
"$",
"impersonator",
"->",
"start",
"(",
"auth",
"(",
... | Impersonate a user.
@param \Arcanesoft\Contracts\Auth\Models\User $user
@param \Arcanedev\LaravelImpersonator\Contracts\Impersonator $impersonator
@return \Illuminate\Http\RedirectResponse | [
"Impersonate",
"a",
"user",
"."
] | b33ca82597a76b1e395071f71ae3e51f1ec67e62 | https://github.com/ARCANESOFT/Auth/blob/b33ca82597a76b1e395071f71ae3e51f1ec67e62/src/Http/Controllers/Admin/UsersController.php#L305-L318 |
25,476 | squareproton/Bond | src/Bond/Pg/Catalog.php | Catalog.getEnum | private function getEnum()
{
$enumResult = $this->db->query(
new Raw( <<<SQL
SELECT
t.typname as name,
n.nspname as schema,
array_agg( e.enumlabel ORDER BY e.enumsortorder ) as labels
FROM
... | php | private function getEnum()
{
$enumResult = $this->db->query(
new Raw( <<<SQL
SELECT
t.typname as name,
n.nspname as schema,
array_agg( e.enumlabel ORDER BY e.enumsortorder ) as labels
FROM
... | [
"private",
"function",
"getEnum",
"(",
")",
"{",
"$",
"enumResult",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"new",
"Raw",
"(",
" <<<SQL\n SELECT\n t.typname as name,\n n.nspname as schema,\n array... | Get array of enum's and their values from the database
@param Bond\Pg
@return array | [
"Get",
"array",
"of",
"enum",
"s",
"and",
"their",
"values",
"from",
"the",
"database"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Pg/Catalog.php#L75-L107 |
25,477 | Sectorr/Core | Sectorr/Core/Input/Input.php | Input.exists | public static function exists($type = 'post')
{
switch ($type) {
case 'post':
return (!empty($_POST)) ? true : false;
break;
case 'get':
return (!empty($_GET)) ? true : false;
break;
default:
... | php | public static function exists($type = 'post')
{
switch ($type) {
case 'post':
return (!empty($_POST)) ? true : false;
break;
case 'get':
return (!empty($_GET)) ? true : false;
break;
default:
... | [
"public",
"static",
"function",
"exists",
"(",
"$",
"type",
"=",
"'post'",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'post'",
":",
"return",
"(",
"!",
"empty",
"(",
"$",
"_POST",
")",
")",
"?",
"true",
":",
"false",
";",
"break",
"... | Check the given request type exists.
@param string $type
@return bool | [
"Check",
"the",
"given",
"request",
"type",
"exists",
"."
] | 31df852dc6cc61642b0b87d9f0ae56c8e7da5a27 | https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Input/Input.php#L24-L37 |
25,478 | Sectorr/Core | Sectorr/Core/Input/Input.php | Input.get | public static function get($item)
{
if (isset($_POST[$item])) {
return $_POST[$item];
} elseif (isset($_GET[$item])) {
return $_GET[$item];
} else {
return '';
}
} | php | public static function get($item)
{
if (isset($_POST[$item])) {
return $_POST[$item];
} elseif (isset($_GET[$item])) {
return $_GET[$item];
} else {
return '';
}
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_POST",
"[",
"$",
"item",
"]",
")",
")",
"{",
"return",
"$",
"_POST",
"[",
"$",
"item",
"]",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"_GET",
... | Returns the given input item.
@param $item
@return string | [
"Returns",
"the",
"given",
"input",
"item",
"."
] | 31df852dc6cc61642b0b87d9f0ae56c8e7da5a27 | https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Input/Input.php#L45-L54 |
25,479 | brunschgi/TerrificComposerBundle | Form/SkinType.php | SkinType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
global $kernel;
// get all modules
$modules = array();
$dir = $kernel->getRootDir().'/../src/Terrific/Module/';
$finder = new Finder();
$finder->directories()->in($dir)->depth('== 0');
... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
global $kernel;
// get all modules
$modules = array();
$dir = $kernel->getRootDir().'/../src/Terrific/Module/';
$finder = new Finder();
$finder->directories()->in($dir)->depth('== 0');
... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"global",
"$",
"kernel",
";",
"// get all modules",
"$",
"modules",
"=",
"array",
"(",
")",
";",
"$",
"dir",
"=",
"$",
"kernel",
"->",
... | Builds the Skin form.
@param \Symfony\Component\Form\FormBuilder $builder
@param array $options | [
"Builds",
"the",
"Skin",
"form",
"."
] | 6eef4ace887c19ef166ab6654de385bc1ffbf5f1 | https://github.com/brunschgi/TerrificComposerBundle/blob/6eef4ace887c19ef166ab6654de385bc1ffbf5f1/Form/SkinType.php#L29-L58 |
25,480 | Attibee/Bumble-Shell | src/Arg.php | Arg.addOption | public function addOption( $opt, $type ) {
if( $type !== self::OPT_PARAM || $type !== self::OPT_SWITCH ) {
return;
}
$this->options[(string)$opt] = $type;
} | php | public function addOption( $opt, $type ) {
if( $type !== self::OPT_PARAM || $type !== self::OPT_SWITCH ) {
return;
}
$this->options[(string)$opt] = $type;
} | [
"public",
"function",
"addOption",
"(",
"$",
"opt",
",",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"!==",
"self",
"::",
"OPT_PARAM",
"||",
"$",
"type",
"!==",
"self",
"::",
"OPT_SWITCH",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"option... | Adds an option to the argument parser.
@param string $opt The name of the option.
@param string $type Args::SWITCH or Args::PARAM | [
"Adds",
"an",
"option",
"to",
"the",
"argument",
"parser",
"."
] | c42da09654c0f3f5d0c81815ab69b930e1052c55 | https://github.com/Attibee/Bumble-Shell/blob/c42da09654c0f3f5d0c81815ab69b930e1052c55/src/Arg.php#L87-L93 |
25,481 | Attibee/Bumble-Shell | src/Arg.php | Arg.parse | public function parse() {
global $argv;
$options = array();
$parameters = array();
$argc = count( $argv );
$paramCount = count( $this->parameters );
//get parameters
if( $argc - 1 < $paramCount ) {
throw new \Exception("The command requires $... | php | public function parse() {
global $argv;
$options = array();
$parameters = array();
$argc = count( $argv );
$paramCount = count( $this->parameters );
//get parameters
if( $argc - 1 < $paramCount ) {
throw new \Exception("The command requires $... | [
"public",
"function",
"parse",
"(",
")",
"{",
"global",
"$",
"argv",
";",
"$",
"options",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"argc",
"=",
"count",
"(",
"$",
"argv",
")",
";",
"$",
"paramCount",
"=",
... | Parses the parameters and throws an error if the user supplied an invalid format. | [
"Parses",
"the",
"parameters",
"and",
"throws",
"an",
"error",
"if",
"the",
"user",
"supplied",
"an",
"invalid",
"format",
"."
] | c42da09654c0f3f5d0c81815ab69b930e1052c55 | https://github.com/Attibee/Bumble-Shell/blob/c42da09654c0f3f5d0c81815ab69b930e1052c55/src/Arg.php#L118-L176 |
25,482 | kaiohken1982/Neobazaar | src/Neobazaar/Entity/MappedSuperclassBase.php | MappedSuperclassBase.exchangeArray | public function exchangeArray($data)
{
foreach($data as $prop => $value) {
$methodName = 'set' . ucfirst($prop);
if(method_exists ($this, $methodName)) {
call_user_func(array($this, $methodName), $value);
}
}
} | php | public function exchangeArray($data)
{
foreach($data as $prop => $value) {
$methodName = 'set' . ucfirst($prop);
if(method_exists ($this, $methodName)) {
call_user_func(array($this, $methodName), $value);
}
}
} | [
"public",
"function",
"exchangeArray",
"(",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"prop",
"=>",
"$",
"value",
")",
"{",
"$",
"methodName",
"=",
"'set'",
".",
"ucfirst",
"(",
"$",
"prop",
")",
";",
"if",
"(",
"method_exists",
... | Exchange array - used in ZF2 form
@param array $data An array of data | [
"Exchange",
"array",
"-",
"used",
"in",
"ZF2",
"form"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Entity/MappedSuperclassBase.php#L30-L38 |
25,483 | kaiohken1982/NeobazaarDocumentModule | src/Document/Service/Image.php | Image.delete | public function delete($idOrDocument)
{
$cache = $this->getServiceLocator()->get('ClassifiedCache');
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$classifiedService = $this->getServiceLocator()->get('document.service.classified');
$entityManager = $main->getEntityManager();
$documen... | php | public function delete($idOrDocument)
{
$cache = $this->getServiceLocator()->get('ClassifiedCache');
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$classifiedService = $this->getServiceLocator()->get('document.service.classified');
$entityManager = $main->getEntityManager();
$documen... | [
"public",
"function",
"delete",
"(",
"$",
"idOrDocument",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'ClassifiedCache'",
")",
";",
"$",
"main",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
... | Delete an image document and related images.
If there is a parent delete its cache.
@param unknown $idOrDocument
@throws \Exception
@return boolean | [
"Delete",
"an",
"image",
"document",
"and",
"related",
"images",
".",
"If",
"there",
"is",
"a",
"parent",
"delete",
"its",
"cache",
"."
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Service/Image.php#L147-L179 |
25,484 | stubbles/stubbles-dbal | src/main/php/pdo/PdoDatabaseConnection.php | PdoDatabaseConnection.connect | public function connect(): DatabaseConnection
{
if (null !== $this->pdo) {
return $this;
}
try {
$pdoCreator = $this->getPdoCreator();
$this->pdo = $pdoCreator($this->configuration);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EX... | php | public function connect(): DatabaseConnection
{
if (null !== $this->pdo) {
return $this;
}
try {
$pdoCreator = $this->getPdoCreator();
$this->pdo = $pdoCreator($this->configuration);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EX... | [
"public",
"function",
"connect",
"(",
")",
":",
"DatabaseConnection",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"pdo",
")",
"{",
"return",
"$",
"this",
";",
"}",
"try",
"{",
"$",
"pdoCreator",
"=",
"$",
"this",
"->",
"getPdoCreator",
"(",
")"... | establishes the connection
@return \stubbles\db\pdo\PdoDatabaseConnection
@throws \stubbles\db\DatabaseException | [
"establishes",
"the",
"connection"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoDatabaseConnection.php#L105-L124 |
25,485 | stubbles/stubbles-dbal | src/main/php/pdo/PdoDatabaseConnection.php | PdoDatabaseConnection.prepare | public function prepare(string $statement, array $driverOptions = []): Statement
{
if (null === $this->pdo) {
$this->connect();
}
try {
return new PdoStatement(
$this->pdo->prepare($statement, $driverOptions)
);
} catch (PDOExc... | php | public function prepare(string $statement, array $driverOptions = []): Statement
{
if (null === $this->pdo) {
$this->connect();
}
try {
return new PdoStatement(
$this->pdo->prepare($statement, $driverOptions)
);
} catch (PDOExc... | [
"public",
"function",
"prepare",
"(",
"string",
"$",
"statement",
",",
"array",
"$",
"driverOptions",
"=",
"[",
"]",
")",
":",
"Statement",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"pdo",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
"... | creates a prepared statement
@param string $statement SQL statement
@param array $driverOptions optional one or more key=>value pairs to set attribute values for the Statement object
@return \stubbles\db\pdo\PdoStatement
@throws \stubbles\db\DatabaseException
@see http://php.net/pdo-prepare | [
"creates",
"a",
"prepared",
"statement"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoDatabaseConnection.php#L230-L243 |
25,486 | stubbles/stubbles-dbal | src/main/php/pdo/PdoDatabaseConnection.php | PdoDatabaseConnection.query | public function query(string $sql, array $driverOptions = []): QueryResult
{
if (null === $this->pdo) {
$this->connect();
}
try {
if (!isset($driverOptions['fetchMode'])) {
return new PdoQueryResult($this->pdo->query($sql));
}
... | php | public function query(string $sql, array $driverOptions = []): QueryResult
{
if (null === $this->pdo) {
$this->connect();
}
try {
if (!isset($driverOptions['fetchMode'])) {
return new PdoQueryResult($this->pdo->query($sql));
}
... | [
"public",
"function",
"query",
"(",
"string",
"$",
"sql",
",",
"array",
"$",
"driverOptions",
"=",
"[",
"]",
")",
":",
"QueryResult",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"pdo",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
... | executes a SQL statement
The driver options can be:
<code>
fetchMode => one of the PDO::FETCH_* constants
colNo => if fetchMode == PDO::FETCH_COLUMN this denotes the column number to fetch
object => if fetchMode == PDO::FETCH_INTO this denotes the object to fetch the data into
classname => if fetchMode == PDO::... | [
"executes",
"a",
"SQL",
"statement"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoDatabaseConnection.php#L265-L331 |
25,487 | stubbles/stubbles-dbal | src/main/php/pdo/PdoDatabaseConnection.php | PdoDatabaseConnection.exec | public function exec(string $statement): int
{
if (null === $this->pdo) {
$this->connect();
}
try {
return $this->pdo->exec($statement);
} catch (PDOException $pdoe) {
throw new DatabaseException($pdoe->getMessage(), $pdoe);
}
} | php | public function exec(string $statement): int
{
if (null === $this->pdo) {
$this->connect();
}
try {
return $this->pdo->exec($statement);
} catch (PDOException $pdoe) {
throw new DatabaseException($pdoe->getMessage(), $pdoe);
}
} | [
"public",
"function",
"exec",
"(",
"string",
"$",
"statement",
")",
":",
"int",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"pdo",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"try",
"{",
"return",
"$",
"this",
"->",
"pdo",
... | execute an SQL statement and return the number of affected rows
@param string $statement the sql statement to execute d
@return int number of effected rows
@throws \stubbles\db\DatabaseException | [
"execute",
"an",
"SQL",
"statement",
"and",
"return",
"the",
"number",
"of",
"affected",
"rows"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoDatabaseConnection.php#L340-L351 |
25,488 | stubbles/stubbles-dbal | src/main/php/pdo/PdoDatabaseConnection.php | PdoDatabaseConnection.getLastInsertId | public function getLastInsertId(string $name = null)
{
if (null === $this->pdo) {
throw new DatabaseException('Not connected: can not retrieve last insert id');
}
try {
return $this->pdo->lastInsertId($name);
} catch (PDOException $pdoe) {
throw n... | php | public function getLastInsertId(string $name = null)
{
if (null === $this->pdo) {
throw new DatabaseException('Not connected: can not retrieve last insert id');
}
try {
return $this->pdo->lastInsertId($name);
} catch (PDOException $pdoe) {
throw n... | [
"public",
"function",
"getLastInsertId",
"(",
"string",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"pdo",
")",
"{",
"throw",
"new",
"DatabaseException",
"(",
"'Not connected: can not retrieve last insert id'",
")",
";",
"}... | returns the last insert id
@param string $name name of the sequence object from which the ID should be returned.
@return int
@throws \stubbles\db\DatabaseException | [
"returns",
"the",
"last",
"insert",
"id"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoDatabaseConnection.php#L360-L371 |
25,489 | AnonymPHP/Anonym-HttpFoundation | Server.php | Server.get | public function get($name = 'HTTP_HOST')
{
$name = isset($this->references[$name]) ? $this->references[$name]: $this->resolveCase($name);
return $this->has($name) ? $_SERVER[$name] : false;
} | php | public function get($name = 'HTTP_HOST')
{
$name = isset($this->references[$name]) ? $this->references[$name]: $this->resolveCase($name);
return $this->has($name) ? $_SERVER[$name] : false;
} | [
"public",
"function",
"get",
"(",
"$",
"name",
"=",
"'HTTP_HOST'",
")",
"{",
"$",
"name",
"=",
"isset",
"(",
"$",
"this",
"->",
"references",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"references",
"[",
"$",
"name",
"]",
":",
"$",
"this... | get the variable in server
@param string $name
@return string | [
"get",
"the",
"variable",
"in",
"server"
] | 943e5f40f45bc2e11a4b9e1d22c6583c31dc4317 | https://github.com/AnonymPHP/Anonym-HttpFoundation/blob/943e5f40f45bc2e11a4b9e1d22c6583c31dc4317/Server.php#L46-L51 |
25,490 | Wedeto/IO | src/Path.php | Path.rmtree | public static function rmtree(string $path)
{
$path = self::realpath($path);
if (empty($path)) // File/dir does not exist
return true;
if (empty(self::$required_prefix))
throw new \RuntimeException("Safety measure: required prefix needs to be set before running rmtre... | php | public static function rmtree(string $path)
{
$path = self::realpath($path);
if (empty($path)) // File/dir does not exist
return true;
if (empty(self::$required_prefix))
throw new \RuntimeException("Safety measure: required prefix needs to be set before running rmtre... | [
"public",
"static",
"function",
"rmtree",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"realpath",
"(",
"$",
"path",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"path",
")",
")",
"// File/dir does not exist",
"return",
"true",
";",... | Delete a directory and its contents. The provided path must be inside the configured prefix.
@param $path string The path to remove
@return int Amount of files and directories that have been deleted | [
"Delete",
"a",
"directory",
"and",
"its",
"contents",
".",
"The",
"provided",
"path",
"must",
"be",
"inside",
"the",
"configured",
"prefix",
"."
] | 4cfeaedd1bd9bda3097d18cb12233a4afecb2e85 | https://github.com/Wedeto/IO/blob/4cfeaedd1bd9bda3097d18cb12233a4afecb2e85/src/Path.php#L159-L194 |
25,491 | Wedeto/IO | src/Path.php | Path.getPermissions | public static function getPermissions($path)
{
try
{
$mode = @fileperms($path);
if ($mode === false)
throw new IOException();
}
catch (Throwable $e)
{
throw new IOException("Could not stat: " . $path);
}
$pe... | php | public static function getPermissions($path)
{
try
{
$mode = @fileperms($path);
if ($mode === false)
throw new IOException();
}
catch (Throwable $e)
{
throw new IOException("Could not stat: " . $path);
}
$pe... | [
"public",
"static",
"function",
"getPermissions",
"(",
"$",
"path",
")",
"{",
"try",
"{",
"$",
"mode",
"=",
"@",
"fileperms",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"mode",
"===",
"false",
")",
"throw",
"new",
"IOException",
"(",
")",
";",
"}"... | Return the permissions set on the specified file.
@param string $path The path to examine
@return array An associative array containing 'owner', 'group' and 'world',
members, each containing 'read', 'write' and 'execute'
indicating their permissions. | [
"Return",
"the",
"permissions",
"set",
"on",
"the",
"specified",
"file",
"."
] | 4cfeaedd1bd9bda3097d18cb12233a4afecb2e85 | https://github.com/Wedeto/IO/blob/4cfeaedd1bd9bda3097d18cb12233a4afecb2e85/src/Path.php#L279-L312 |
25,492 | Wedeto/IO | src/Path.php | Path.compileMode | public static function compileMode(array $perms)
{
$fmode = 0;
$fmode |= !empty($perms['owner']['read']) ? self::OWNER_READ : 0;
$fmode |= !empty($perms['owner']['write']) ? self::OWNER_WRITE : 0;
$fmode |= !empty($perms['owner']['execute']) ? self::OWNER_EXECUTE : 0;
... | php | public static function compileMode(array $perms)
{
$fmode = 0;
$fmode |= !empty($perms['owner']['read']) ? self::OWNER_READ : 0;
$fmode |= !empty($perms['owner']['write']) ? self::OWNER_WRITE : 0;
$fmode |= !empty($perms['owner']['execute']) ? self::OWNER_EXECUTE : 0;
... | [
"public",
"static",
"function",
"compileMode",
"(",
"array",
"$",
"perms",
")",
"{",
"$",
"fmode",
"=",
"0",
";",
"$",
"fmode",
"|=",
"!",
"empty",
"(",
"$",
"perms",
"[",
"'owner'",
"]",
"[",
"'read'",
"]",
")",
"?",
"self",
"::",
"OWNER_READ",
":... | Create a file mode from an array containing permissions. The array
can have 'owner', 'group' and 'world' members, each which can have
'read', 'write', and 'execute' booleans that indicate whether that
permission is present or not. | [
"Create",
"a",
"file",
"mode",
"from",
"an",
"array",
"containing",
"permissions",
".",
"The",
"array",
"can",
"have",
"owner",
"group",
"and",
"world",
"members",
"each",
"which",
"can",
"have",
"read",
"write",
"and",
"execute",
"booleans",
"that",
"indica... | 4cfeaedd1bd9bda3097d18cb12233a4afecb2e85 | https://github.com/Wedeto/IO/blob/4cfeaedd1bd9bda3097d18cb12233a4afecb2e85/src/Path.php#L320-L336 |
25,493 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/CmsFilterer.php | CmsFilterer.menu | protected function menu()
{
$this->Benchmark->start('getMenu');
try {
$menu = $this->CMSNavItemService->getMenu();
} catch (Exception $e) {
return '';
}
$this->Benchmark->end('getMenu');
$this->Benchmark->start('buildMenu');
$dom_id ... | php | protected function menu()
{
$this->Benchmark->start('getMenu');
try {
$menu = $this->CMSNavItemService->getMenu();
} catch (Exception $e) {
return '';
}
$this->Benchmark->end('getMenu');
$this->Benchmark->start('buildMenu');
$dom_id ... | [
"protected",
"function",
"menu",
"(",
")",
"{",
"$",
"this",
"->",
"Benchmark",
"->",
"start",
"(",
"'getMenu'",
")",
";",
"try",
"{",
"$",
"menu",
"=",
"$",
"this",
"->",
"CMSNavItemService",
"->",
"getMenu",
"(",
")",
";",
"}",
"catch",
"(",
"Excep... | Returns a full HTML rendering of the CMS navigation menu
@return string | [
"Returns",
"a",
"full",
"HTML",
"rendering",
"of",
"the",
"CMS",
"navigation",
"menu"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/CmsFilterer.php#L135-L170 |
25,494 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/CmsFilterer.php | CmsFilterer.lookupElementsForNav | protected function lookupElementsForNav($element_or_aspect)
{
$results = array();
if (substr($element_or_aspect, 0, 1) == '@') {
$elements = $this->ElementService->findAllWithAspect(substr($element_or_aspect, 1));
foreach ( $elements as $element ) {
$results[... | php | protected function lookupElementsForNav($element_or_aspect)
{
$results = array();
if (substr($element_or_aspect, 0, 1) == '@') {
$elements = $this->ElementService->findAllWithAspect(substr($element_or_aspect, 1));
foreach ( $elements as $element ) {
$results[... | [
"protected",
"function",
"lookupElementsForNav",
"(",
"$",
"element_or_aspect",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"element_or_aspect",
",",
"0",
",",
"1",
")",
"==",
"'@'",
")",
"{",
"$",
"elements",
... | REturns all the elements for the specified element or aspect
@param string $element_or_aspect The element or aspect to lookup
@return array | [
"REturns",
"all",
"the",
"elements",
"for",
"the",
"specified",
"element",
"or",
"aspect"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/CmsFilterer.php#L275-L291 |
25,495 | wb-crowdfusion/crowdfusion | system/core/classes/mvc/filters/CmsFilterer.php | CmsFilterer.sortingLink | public function sortingLink()
{
$filterlist = '';
if ($this->getParameter('filter') != null) {
foreach ($this->getParameter('filter') as $get => $value) {
$filterlist .= 'filter['.$get.'][]='.$value.'&';
}
}
if ($this->getParameter('sort') != ... | php | public function sortingLink()
{
$filterlist = '';
if ($this->getParameter('filter') != null) {
foreach ($this->getParameter('filter') as $get => $value) {
$filterlist .= 'filter['.$get.'][]='.$value.'&';
}
}
if ($this->getParameter('sort') != ... | [
"public",
"function",
"sortingLink",
"(",
")",
"{",
"$",
"filterlist",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"'filter'",
")",
"!=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"'filter'",
")",
... | Returns a URL with sort parameters
Expected Params:
filter string the string to operate upon
sort integer (optional) the starting point for our substring, default 0
field integer (optional) the length of the substring. default 1
order integer (optional) the length of the substring. default 1
@return string | [
"Returns",
"a",
"URL",
"with",
"sort",
"parameters"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/filters/CmsFilterer.php#L304-L326 |
25,496 | Vectrex/vxPHP | src/Webpage/DefaultMenuAuthenticator.php | DefaultMenuAuthenticator.authenticateMenuEntries | private function authenticateMenuEntries(Menu $menu, array $userRoles) {
foreach($menu->getEntries() as $e) {
if(!$e->getAuth()) {
$e->setAttribute('display', NULL);
}
else {
$e->setAttribute('display', 'none');
foreach($userRoles as $role) {
if($e->isAuthenticatedByRole($role... | php | private function authenticateMenuEntries(Menu $menu, array $userRoles) {
foreach($menu->getEntries() as $e) {
if(!$e->getAuth()) {
$e->setAttribute('display', NULL);
}
else {
$e->setAttribute('display', 'none');
foreach($userRoles as $role) {
if($e->isAuthenticatedByRole($role... | [
"private",
"function",
"authenticateMenuEntries",
"(",
"Menu",
"$",
"menu",
",",
"array",
"$",
"userRoles",
")",
"{",
"foreach",
"(",
"$",
"menu",
"->",
"getEntries",
"(",
")",
"as",
"$",
"e",
")",
"{",
"if",
"(",
"!",
"$",
"e",
"->",
"getAuth",
"(",... | authenticate menu entries by checking each one against the
user's roles if necessary
@param Menu $menu
@param Role[] $userRoles | [
"authenticate",
"menu",
"entries",
"by",
"checking",
"each",
"one",
"against",
"the",
"user",
"s",
"roles",
"if",
"necessary"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Webpage/DefaultMenuAuthenticator.php#L115-L138 |
25,497 | satori-php/middleware | src/Capsule.php | Capsule.offsetGet | public function offsetGet($key)
{
if (isset($this->granules[$key])) {
return $this->granules[$key];
}
throw new \OutOfBoundsException(sprintf('Granule "%s" is not defined.', $key));
} | php | public function offsetGet($key)
{
if (isset($this->granules[$key])) {
return $this->granules[$key];
}
throw new \OutOfBoundsException(sprintf('Granule "%s" is not defined.', $key));
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"granules",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"granules",
"[",
"$",
"key",
"]",
";",
"}",
"throw",
"new",
... | Returns a granule.
@param string $key The unique key of the granule.
@throws \OutOfBoundsException If the granule is not defined.
@return mixed | [
"Returns",
"a",
"granule",
"."
] | d43051baef9ccd2802e0a09e3b7aaaf72784dc7e | https://github.com/satori-php/middleware/blob/d43051baef9ccd2802e0a09e3b7aaaf72784dc7e/src/Capsule.php#L55-L62 |
25,498 | bytic/orm | src/Relations/HasAndBelongsToMany.php | HasAndBelongsToMany.getLinkQuery | public function getLinkQuery($specific = true)
{
$query = $this->getDB()->newSelect();
$query->from($this->getTable());
if ($specific) {
$query = $this->populateQuerySpecific($query);
}
return $query;
} | php | public function getLinkQuery($specific = true)
{
$query = $this->getDB()->newSelect();
$query->from($this->getTable());
if ($specific) {
$query = $this->populateQuerySpecific($query);
}
return $query;
} | [
"public",
"function",
"getLinkQuery",
"(",
"$",
"specific",
"=",
"true",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getDB",
"(",
")",
"->",
"newSelect",
"(",
")",
";",
"$",
"query",
"->",
"from",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
... | Simple select query from the link table
@param bool $specific
@return SelectQuery | [
"Simple",
"select",
"query",
"from",
"the",
"link",
"table"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Relations/HasAndBelongsToMany.php#L116-L126 |
25,499 | ARCANESOFT/SEO | src/Http/Controllers/Admin/SpammersController.php | SpammersController.index | public function index(Request $request)
{
$spammers = $this->paginate($this->blocker->all(), $request, $this->perPage);
$this->setTitle($title = trans('seo::spammers.titles.spammers-list'));
$this->addBreadcrumb($title);
return $this->view('admin.spammers.index', compact('spammers'... | php | public function index(Request $request)
{
$spammers = $this->paginate($this->blocker->all(), $request, $this->perPage);
$this->setTitle($title = trans('seo::spammers.titles.spammers-list'));
$this->addBreadcrumb($title);
return $this->view('admin.spammers.index', compact('spammers'... | [
"public",
"function",
"index",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"spammers",
"=",
"$",
"this",
"->",
"paginate",
"(",
"$",
"this",
"->",
"blocker",
"->",
"all",
"(",
")",
",",
"$",
"request",
",",
"$",
"this",
"->",
"perPage",
")",
";"... | List all the spammers.
@param \Illuminate\Http\Request $request
@return \Illuminate\View\View | [
"List",
"all",
"the",
"spammers",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Http/Controllers/Admin/SpammersController.php#L67-L75 |
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.