id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15,300 | FrenchFrogs/framework | src/Filterer/Filterer.php | Filterer.setFilters | public function setFilters($filters)
{
if (!is_array($filters)) {
$this->clearFilters();
foreach(explode('|', $filters) as $filter) {
// searching for optional params
$params = [];
if (strpos($filter, ':')) {
list(... | php | public function setFilters($filters)
{
if (!is_array($filters)) {
$this->clearFilters();
foreach(explode('|', $filters) as $filter) {
// searching for optional params
$params = [];
if (strpos($filter, ':')) {
list(... | [
"public",
"function",
"setFilters",
"(",
"$",
"filters",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filters",
")",
")",
"{",
"$",
"this",
"->",
"clearFilters",
"(",
")",
";",
"foreach",
"(",
"explode",
"(",
"'|'",
",",
"$",
"filters",
")",
"a... | Set all filter as an array
@param $filters
@return $this | [
"Set",
"all",
"filter",
"as",
"an",
"array"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Filterer/Filterer.php#L43-L64 |
15,301 | FrenchFrogs/framework | src/Filterer/Filterer.php | Filterer.addFilter | public function addFilter($index, $method = null, ...$params)
{
$this->filters[$index] = [$method, $params];
return $this;
} | php | public function addFilter($index, $method = null, ...$params)
{
$this->filters[$index] = [$method, $params];
return $this;
} | [
"public",
"function",
"addFilter",
"(",
"$",
"index",
",",
"$",
"method",
"=",
"null",
",",
"...",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"filters",
"[",
"$",
"index",
"]",
"=",
"[",
"$",
"method",
",",
"$",
"params",
"]",
";",
"return",
"$"... | Add a single filter to the filters container
@param $index
@param null $method
@param ...$params
@return $this | [
"Add",
"a",
"single",
"filter",
"to",
"the",
"filters",
"container"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Filterer/Filterer.php#L74-L78 |
15,302 | FrenchFrogs/framework | src/Filterer/Filterer.php | Filterer.getFilter | public function getFilter($index)
{
if (!$this->hasFilter($index)) {
throw new \Exception('Impossible de trouver le filtre : ' . $index);
}
return $this->filters[$index];
} | php | public function getFilter($index)
{
if (!$this->hasFilter($index)) {
throw new \Exception('Impossible de trouver le filtre : ' . $index);
}
return $this->filters[$index];
} | [
"public",
"function",
"getFilter",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasFilter",
"(",
"$",
"index",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Impossible de trouver le filtre : '",
".",
"$",
"index",
")",
";",... | Return the filter from the filters container from the filter container
@param $index
@return mixed
@throws \Exception | [
"Return",
"the",
"filter",
"from",
"the",
"filters",
"container",
"from",
"the",
"filter",
"container"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Filterer/Filterer.php#L129-L136 |
15,303 | FrenchFrogs/framework | src/Filterer/Filterer.php | Filterer.filter | public function filter($value)
{
foreach($this->getFilters() as $index => $filter) {
// Extract the params
list($method, $params) = $filter;
// If method is null, we use the index as the method name
$method = is_null($method) ? $index : $method;
... | php | public function filter($value)
{
foreach($this->getFilters() as $index => $filter) {
// Extract the params
list($method, $params) = $filter;
// If method is null, we use the index as the method name
$method = is_null($method) ? $index : $method;
... | [
"public",
"function",
"filter",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getFilters",
"(",
")",
"as",
"$",
"index",
"=>",
"$",
"filter",
")",
"{",
"// Extract the params",
"list",
"(",
"$",
"method",
",",
"$",
"params",
")",
"... | Filter de value
Main method of the class
@param $value
@return mixed
@throws \Exception | [
"Filter",
"de",
"value"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Filterer/Filterer.php#L159-L188 |
15,304 | FrenchFrogs/framework | src/Filterer/Filterer.php | Filterer.dateFormat | public function dateFormat($value, $format = 'd/m/Y')
{
if (!empty($value)) {
// passage de la date en datetime
if (strlen($value) == 10) {
$value .= ' 00:00:00';
}
// gestion d'une date vide
if ($value == '0000-00-00 00:00:00') {... | php | public function dateFormat($value, $format = 'd/m/Y')
{
if (!empty($value)) {
// passage de la date en datetime
if (strlen($value) == 10) {
$value .= ' 00:00:00';
}
// gestion d'une date vide
if ($value == '0000-00-00 00:00:00') {... | [
"public",
"function",
"dateFormat",
"(",
"$",
"value",
",",
"$",
"format",
"=",
"'d/m/Y'",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"// passage de la date en datetime",
"if",
"(",
"strlen",
"(",
"$",
"value",
")",
"==",
"10"... | Format a date
@param $value
@param string $format
@return string | [
"Format",
"a",
"date"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Filterer/Filterer.php#L232-L254 |
15,305 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.addServer | public function addServer(int $engine, string $host = "127.0.0.1", int $port = 0): Server
{
$this->servers[] = new Server($engine, $host, $port);
return end($this->servers);
} | php | public function addServer(int $engine, string $host = "127.0.0.1", int $port = 0): Server
{
$this->servers[] = new Server($engine, $host, $port);
return end($this->servers);
} | [
"public",
"function",
"addServer",
"(",
"int",
"$",
"engine",
",",
"string",
"$",
"host",
"=",
"\"127.0.0.1\"",
",",
"int",
"$",
"port",
"=",
"0",
")",
":",
"Server",
"{",
"$",
"this",
"->",
"servers",
"[",
"]",
"=",
"new",
"Server",
"(",
"$",
"eng... | Add a server to connection queue
Multiple cache servers may be added before connection, if connection fails with first server then Comely
Cache component will try to connect to next server.
@param int $engine
@param string $host
@param int $port
@return Server
@throws ConnectionException | [
"Add",
"a",
"server",
"to",
"connection",
"queue"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L84-L88 |
15,306 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.isConnected | public function isConnected(): bool
{
if ($this->engine) {
$connected = $this->engine->isConnected();
if (!$connected) {
$this->engine = null;
}
return $connected;
}
return false;
} | php | public function isConnected(): bool
{
if ($this->engine) {
$connected = $this->engine->isConnected();
if (!$connected) {
$this->engine = null;
}
return $connected;
}
return false;
} | [
"public",
"function",
"isConnected",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"engine",
")",
"{",
"$",
"connected",
"=",
"$",
"this",
"->",
"engine",
"->",
"isConnected",
"(",
")",
";",
"if",
"(",
"!",
"$",
"connected",
")",
"{",
... | Check connection status
@return bool | [
"Check",
"connection",
"status"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L154-L166 |
15,307 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.ping | public function ping(bool $reconnect = false): bool
{
if ($this->engine) {
$ping = $this->engine->ping();
if (!$ping) {
$this->engine = null;
if ($reconnect) {
$this->connect();
}
}
return $p... | php | public function ping(bool $reconnect = false): bool
{
if ($this->engine) {
$ping = $this->engine->ping();
if (!$ping) {
$this->engine = null;
if ($reconnect) {
$this->connect();
}
}
return $p... | [
"public",
"function",
"ping",
"(",
"bool",
"$",
"reconnect",
"=",
"false",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"engine",
")",
"{",
"$",
"ping",
"=",
"$",
"this",
"->",
"engine",
"->",
"ping",
"(",
")",
";",
"if",
"(",
"!",
"$",... | Ping Cache Server
This method will not only check the connection status, but also attempt to ping cache server. On failure,
cache component will be disconnected with cache server/engine. Optional $reconnect param. may be passed to
attempt reconnection on failure.
@param bool $reconnect
@return bool
@throws Connection... | [
"Ping",
"Cache",
"Server"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L180-L195 |
15,308 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.has | public function has(string $key): bool
{
$this->checkConnection(__METHOD__);
return $this->engine->has($key);
} | php | public function has(string $key): bool
{
$this->checkConnection(__METHOD__);
return $this->engine->has($key);
} | [
"public",
"function",
"has",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"checkConnection",
"(",
"__METHOD__",
")",
";",
"return",
"$",
"this",
"->",
"engine",
"->",
"has",
"(",
"$",
"key",
")",
";",
"}"
] | Checks if a data exists on cache server corresponding to provided key
@param string $key
@return bool
@throws CacheException
@throws EngineException | [
"Checks",
"if",
"a",
"data",
"exists",
"on",
"cache",
"server",
"corresponding",
"to",
"provided",
"key"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L295-L299 |
15,309 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.delete | public function delete(string $key): bool
{
$this->checkConnection(__METHOD__);
$delete = $this->engine->delete($key);
if ($delete && $this->index) {
$this->index->events()
->trigger(Indexing::EVENT_ON_DELETE)
->params($key)
->fire(... | php | public function delete(string $key): bool
{
$this->checkConnection(__METHOD__);
$delete = $this->engine->delete($key);
if ($delete && $this->index) {
$this->index->events()
->trigger(Indexing::EVENT_ON_DELETE)
->params($key)
->fire(... | [
"public",
"function",
"delete",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"checkConnection",
"(",
"__METHOD__",
")",
";",
"$",
"delete",
"=",
"$",
"this",
"->",
"engine",
"->",
"delete",
"(",
"$",
"key",
")",
";",
"if",
"... | Delete an stored item with provided key on cache server
@param string $key
@return bool
@throws CacheException
@throws EngineException | [
"Delete",
"an",
"stored",
"item",
"with",
"provided",
"key",
"on",
"cache",
"server"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L309-L321 |
15,310 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.flush | public function flush(): bool
{
$this->checkConnection(__METHOD__);
$flush = $this->engine->flush();
if ($flush && $this->index) {
$this->index->events()->trigger(Indexing::EVENT_ON_FLUSH)
->fire();
}
return $flush;
} | php | public function flush(): bool
{
$this->checkConnection(__METHOD__);
$flush = $this->engine->flush();
if ($flush && $this->index) {
$this->index->events()->trigger(Indexing::EVENT_ON_FLUSH)
->fire();
}
return $flush;
} | [
"public",
"function",
"flush",
"(",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"checkConnection",
"(",
"__METHOD__",
")",
";",
"$",
"flush",
"=",
"$",
"this",
"->",
"engine",
"->",
"flush",
"(",
")",
";",
"if",
"(",
"$",
"flush",
"&&",
"$",
"this",
... | Flushes all stored data from cache server
@return bool
@throws CacheException
@throws EngineException | [
"Flushes",
"all",
"stored",
"data",
"from",
"cache",
"server"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L330-L340 |
15,311 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.countUp | public function countUp(string $key, int $inc = 1): int
{
$this->checkConnection(__METHOD__);
return $this->engine->countUp($key, $inc);
} | php | public function countUp(string $key, int $inc = 1): int
{
$this->checkConnection(__METHOD__);
return $this->engine->countUp($key, $inc);
} | [
"public",
"function",
"countUp",
"(",
"string",
"$",
"key",
",",
"int",
"$",
"inc",
"=",
"1",
")",
":",
"int",
"{",
"$",
"this",
"->",
"checkConnection",
"(",
"__METHOD__",
")",
";",
"return",
"$",
"this",
"->",
"engine",
"->",
"countUp",
"(",
"$",
... | Increase stored integer value
If key doesn't already exist, a new key will be created with value 0 before increment
@param string $key
@param int $inc
@return int
@throws CacheException
@throws EngineException | [
"Increase",
"stored",
"integer",
"value",
"If",
"key",
"doesn",
"t",
"already",
"exist",
"a",
"new",
"key",
"will",
"be",
"created",
"with",
"value",
"0",
"before",
"increment"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L352-L356 |
15,312 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.countDown | public function countDown(string $key, int $dec = 1): int
{
$this->checkConnection(__METHOD__);
return $this->engine->countDown($key, $dec);
} | php | public function countDown(string $key, int $dec = 1): int
{
$this->checkConnection(__METHOD__);
return $this->engine->countDown($key, $dec);
} | [
"public",
"function",
"countDown",
"(",
"string",
"$",
"key",
",",
"int",
"$",
"dec",
"=",
"1",
")",
":",
"int",
"{",
"$",
"this",
"->",
"checkConnection",
"(",
"__METHOD__",
")",
";",
"return",
"$",
"this",
"->",
"engine",
"->",
"countDown",
"(",
"$... | Decrease stored integer value
If key doesn't already exist, a new key will be created with value 0 before decrement
@param string $key
@param int $dec
@return int
@throws CacheException
@throws EngineException | [
"Decrease",
"stored",
"integer",
"value",
"If",
"key",
"doesn",
"t",
"already",
"exist",
"a",
"new",
"key",
"will",
"be",
"created",
"with",
"value",
"0",
"before",
"decrement"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L368-L372 |
15,313 | comelyio/comely | src/Comely/IO/Cache/Cache.php | Cache.setCacheableIdentifier | public function setCacheableIdentifier(string $id = null, int $length = null): self
{
if ($id) {
if (!preg_match('/^[a-zA-Z0-9\_\-\~\.]{8,32}$/', $id)) {
throw new CacheException('Invalid value passed to "setCacheableIdentifier" method');
}
$this->cacheab... | php | public function setCacheableIdentifier(string $id = null, int $length = null): self
{
if ($id) {
if (!preg_match('/^[a-zA-Z0-9\_\-\~\.]{8,32}$/', $id)) {
throw new CacheException('Invalid value passed to "setCacheableIdentifier" method');
}
$this->cacheab... | [
"public",
"function",
"setCacheableIdentifier",
"(",
"string",
"$",
"id",
"=",
"null",
",",
"int",
"$",
"length",
"=",
"null",
")",
":",
"self",
"{",
"if",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[a-zA-Z0-9\\_\\-\\~\\.]{8,32}$/'",
... | Set custom identifier for objects extending CacheableInterface
@param string|null $id
@param int|null $length
@return Cache
@throws CacheException | [
"Set",
"custom",
"identifier",
"for",
"objects",
"extending",
"CacheableInterface"
] | 561ea7aef36fea347a1a79d3ee5597d4057ddf82 | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cache.php#L431-L451 |
15,314 | blackprism/serializer | src/Blackprism/Serializer/Json/Deserialize.php | Deserialize.setObject | private function setObject(array $data)
{
$identifierAttribute = $this->configuration->getIdentifierAttribute();
if ($identifierAttribute === null) {
throw new UndefinedIdentifierAttribute();
}
// We found an identifier attribute, $data is a json object
if (isse... | php | private function setObject(array $data)
{
$identifierAttribute = $this->configuration->getIdentifierAttribute();
if ($identifierAttribute === null) {
throw new UndefinedIdentifierAttribute();
}
// We found an identifier attribute, $data is a json object
if (isse... | [
"private",
"function",
"setObject",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"identifierAttribute",
"=",
"$",
"this",
"->",
"configuration",
"->",
"getIdentifierAttribute",
"(",
")",
";",
"if",
"(",
"$",
"identifierAttribute",
"===",
"null",
")",
"{",
"thro... | Create class object with data
@param mixed[] $data
@return object|object[]
@throws UndefinedIdentifierAttribute
@throws MissingIdentifierAttribute | [
"Create",
"class",
"object",
"with",
"data"
] | f5bd6ebeec802d2ad747daba7c9211b252ee4776 | https://github.com/blackprism/serializer/blob/f5bd6ebeec802d2ad747daba7c9211b252ee4776/src/Blackprism/Serializer/Json/Deserialize.php#L107-L122 |
15,315 | FrenchFrogs/framework | src/Html/Element/Button.php | Button.icon | public function icon($icon, $is_icon_only = true)
{
$this->setIcon($icon);
($is_icon_only) ? $this->enableIconOnly() : $this->disableIconOnly();
return $this;
} | php | public function icon($icon, $is_icon_only = true)
{
$this->setIcon($icon);
($is_icon_only) ? $this->enableIconOnly() : $this->disableIconOnly();
return $this;
} | [
"public",
"function",
"icon",
"(",
"$",
"icon",
",",
"$",
"is_icon_only",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setIcon",
"(",
"$",
"icon",
")",
";",
"(",
"$",
"is_icon_only",
")",
"?",
"$",
"this",
"->",
"enableIconOnly",
"(",
")",
":",
"$",
... | Fast setting for icon
@param $icon
@param bool|true $is_icon_only
@return $this | [
"Fast",
"setting",
"for",
"icon"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Html/Element/Button.php#L48-L53 |
15,316 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Console/Cerberus.php | Cerberus.createDir | public static function createDir($strPath, $rights = 0777)
{
$folderPath = array($strPath);
$oldumask = umask(0);
while (!@is_dir(dirname(end($folderPath)))
&& dirname(end($folderPath)) != "/"
&& dirname(end($folderPath)) != "."
&& dirname(end($folderPath... | php | public static function createDir($strPath, $rights = 0777)
{
$folderPath = array($strPath);
$oldumask = umask(0);
while (!@is_dir(dirname(end($folderPath)))
&& dirname(end($folderPath)) != "/"
&& dirname(end($folderPath)) != "."
&& dirname(end($folderPath... | [
"public",
"static",
"function",
"createDir",
"(",
"$",
"strPath",
",",
"$",
"rights",
"=",
"0777",
")",
"{",
"$",
"folderPath",
"=",
"array",
"(",
"$",
"strPath",
")",
";",
"$",
"oldumask",
"=",
"umask",
"(",
"0",
")",
";",
"while",
"(",
"!",
"@",
... | Creates a directory recursively
@param string $strPath path
@param integer $rights right for new directory
@throws \RuntimeException | [
"Creates",
"a",
"directory",
"recursively"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Console/Cerberus.php#L96-L118 |
15,317 | phramework/validate | src/DatetimeValidator.php | DatetimeValidator.validate | public function validate($value)
{
//Use string's validator
$return = parent::validate($value);
//Apply additional rules
if ($return->status === true && (preg_match(
'/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/',
$value,
... | php | public function validate($value)
{
//Use string's validator
$return = parent::validate($value);
//Apply additional rules
if ($return->status === true && (preg_match(
'/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/',
$value,
... | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
"{",
"//Use string's validator",
"$",
"return",
"=",
"parent",
"::",
"validate",
"(",
"$",
"value",
")",
";",
"//Apply additional rules",
"if",
"(",
"$",
"return",
"->",
"status",
"===",
"true",
"&&",... | Validate value, validates as SQL date or SQL datetime
@see \Phramework\Validate\ValidateResult for ValidateResult object
@see https://dev.mysql.com/doc/refman/5.1/en/datetime.html
@param mixed $value Value to validate
@return ValidateResult
@todo set errorObject | [
"Validate",
"value",
"validates",
"as",
"SQL",
"date",
"or",
"SQL",
"datetime"
] | 22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc | https://github.com/phramework/validate/blob/22dd3c4e5f7a77a1a75d92f98444f3e4b7ce5cfc/src/DatetimeValidator.php#L71-L120 |
15,318 | activecollab/databasestructure | src/Structure.php | Structure.getType | public function getType($type_name)
{
if (isset($this->types[$type_name])) {
return $this->types[$type_name];
} else {
throw new InvalidArgumentException("Type '$type_name' not found");
}
} | php | public function getType($type_name)
{
if (isset($this->types[$type_name])) {
return $this->types[$type_name];
} else {
throw new InvalidArgumentException("Type '$type_name' not found");
}
} | [
"public",
"function",
"getType",
"(",
"$",
"type_name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"type_name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"types",
"[",
"$",
"type_name",
"]",
";",
"}",
"else",
... | Return type by type name.
@param string $type_name
@return Type | [
"Return",
"type",
"by",
"type",
"name",
"."
] | 4b2353c4422186bcfce63b3212da3e70e63eb5df | https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Structure.php#L70-L77 |
15,319 | activecollab/databasestructure | src/Structure.php | Structure.build | public function build($build_path = null, ConnectionInterface $connection = null, array $event_handlers = [])
{
$builders = $this->getBuilders($build_path, $connection, $event_handlers);
foreach ($builders as $builder) {
$builder->preBuild();
}
foreach ($this->types as ... | php | public function build($build_path = null, ConnectionInterface $connection = null, array $event_handlers = [])
{
$builders = $this->getBuilders($build_path, $connection, $event_handlers);
foreach ($builders as $builder) {
$builder->preBuild();
}
foreach ($this->types as ... | [
"public",
"function",
"build",
"(",
"$",
"build_path",
"=",
"null",
",",
"ConnectionInterface",
"$",
"connection",
"=",
"null",
",",
"array",
"$",
"event_handlers",
"=",
"[",
"]",
")",
"{",
"$",
"builders",
"=",
"$",
"this",
"->",
"getBuilders",
"(",
"$"... | Build model at the given path.
If $build_path is null, classes will be generated, evaled and loaded into the memory
@param string|null $build_path
@param ConnectionInterface $connection
@param array|null $event_handlers | [
"Build",
"model",
"at",
"the",
"given",
"path",
"."
] | 4b2353c4422186bcfce63b3212da3e70e63eb5df | https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Structure.php#L187-L204 |
15,320 | activecollab/databasestructure | src/Structure.php | Structure.getBuilders | private function getBuilders($build_path, ConnectionInterface $connection = null, array $event_handlers)
{
if (empty($this->builders)) {
$this->builders[] = new BaseDirBuilder($this);
$this->builders[] = new TypesBuilder($this);
$this->builders[] = new BaseTypeClassBuild... | php | private function getBuilders($build_path, ConnectionInterface $connection = null, array $event_handlers)
{
if (empty($this->builders)) {
$this->builders[] = new BaseDirBuilder($this);
$this->builders[] = new TypesBuilder($this);
$this->builders[] = new BaseTypeClassBuild... | [
"private",
"function",
"getBuilders",
"(",
"$",
"build_path",
",",
"ConnectionInterface",
"$",
"connection",
"=",
"null",
",",
"array",
"$",
"event_handlers",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"builders",
")",
")",
"{",
"$",
"this",
"... | Return a list of prepared builder instances.
@param string|null $build_path
@param ConnectionInterface $connection
@param array $event_handlers
@return BuilderInterface[] | [
"Return",
"a",
"list",
"of",
"prepared",
"builder",
"instances",
"."
] | 4b2353c4422186bcfce63b3212da3e70e63eb5df | https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Structure.php#L219-L266 |
15,321 | WebDevTmas/date-repetition | src/DateRepetition/WeeklyDateRepetition.php | WeeklyDateRepetition.setDay | public function setDay($day)
{
if(! in_array($day, $this->weekDays)) {
throw new InvalidArgumentException('Argument is not a day of the week');
}
$this->day = $day;
return $this;
} | php | public function setDay($day)
{
if(! in_array($day, $this->weekDays)) {
throw new InvalidArgumentException('Argument is not a day of the week');
}
$this->day = $day;
return $this;
} | [
"public",
"function",
"setDay",
"(",
"$",
"day",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"day",
",",
"$",
"this",
"->",
"weekDays",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Argument is not a day of the week'",
")",
";",
"}"... | Sets weekday of the weekly date repetition
@param string day of the week (monday, tuesday, wednesday, thursday, friday, saturday, sunday)
@return this | [
"Sets",
"weekday",
"of",
"the",
"weekly",
"date",
"repetition"
] | 3ebd59f4ab3aab4b7497ebd767a57fad08277c6d | https://github.com/WebDevTmas/date-repetition/blob/3ebd59f4ab3aab4b7497ebd767a57fad08277c6d/src/DateRepetition/WeeklyDateRepetition.php#L66-L73 |
15,322 | vincentchalamon/VinceCmsSonataAdminBundle | Controller/PublishableController.php | PublishableController.batchActionPublish | public function batchActionPublish(ProxyQueryInterface $query)
{
try {
$objects = $query->select('DISTINCT '.$query->getRootAlias())->getQuery()->iterate();
$i = 0;
$em = $this->get('doctrine')->getManager();
foreach ($objects as $object) {
... | php | public function batchActionPublish(ProxyQueryInterface $query)
{
try {
$objects = $query->select('DISTINCT '.$query->getRootAlias())->getQuery()->iterate();
$i = 0;
$em = $this->get('doctrine')->getManager();
foreach ($objects as $object) {
... | [
"public",
"function",
"batchActionPublish",
"(",
"ProxyQueryInterface",
"$",
"query",
")",
"{",
"try",
"{",
"$",
"objects",
"=",
"$",
"query",
"->",
"select",
"(",
"'DISTINCT '",
".",
"$",
"query",
"->",
"getRootAlias",
"(",
")",
")",
"->",
"getQuery",
"("... | Execute a batch publish
@param ProxyQueryInterface $query
@return RedirectResponse | [
"Execute",
"a",
"batch",
"publish"
] | edc768061734a92ba116488dd7b61ad40af21ceb | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Controller/PublishableController.php#L56-L78 |
15,323 | fuelphp/display | src/Parser/Twig.php | Twig.setupTwig | public function setupTwig()
{
$twigLoader = new TwigLoader($this->viewManager);
$config = [];
if ($this->viewManager->cachePath)
{
$config['cache'] = $this->viewManager->cachePath.'twig/';
}
$this->twig = new Twig_Environment($twigLoader, $config);
} | php | public function setupTwig()
{
$twigLoader = new TwigLoader($this->viewManager);
$config = [];
if ($this->viewManager->cachePath)
{
$config['cache'] = $this->viewManager->cachePath.'twig/';
}
$this->twig = new Twig_Environment($twigLoader, $config);
} | [
"public",
"function",
"setupTwig",
"(",
")",
"{",
"$",
"twigLoader",
"=",
"new",
"TwigLoader",
"(",
"$",
"this",
"->",
"viewManager",
")",
";",
"$",
"config",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"viewManager",
"->",
"cachePath",
")",
"{... | Sets the Twig Environment up | [
"Sets",
"the",
"Twig",
"Environment",
"up"
] | d9a3eddbf80f0fd81beb40d9f4507600ac6611a4 | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/Parser/Twig.php#L51-L62 |
15,324 | Teamsisu/contao-mm-frontendInput | src/Teamsisu/MetaModelsFrontendInput/DataContainer/Field/FieldCollection.php | FieldCollection.addItem | public function addItem(BaseField $objItem)
{
$this->items[] = $objItem;
end($this->items);
$key = key($this->items);
$this->index[$key] = $objItem->get('colName');
} | php | public function addItem(BaseField $objItem)
{
$this->items[] = $objItem;
end($this->items);
$key = key($this->items);
$this->index[$key] = $objItem->get('colName');
} | [
"public",
"function",
"addItem",
"(",
"BaseField",
"$",
"objItem",
")",
"{",
"$",
"this",
"->",
"items",
"[",
"]",
"=",
"$",
"objItem",
";",
"end",
"(",
"$",
"this",
"->",
"items",
")",
";",
"$",
"key",
"=",
"key",
"(",
"$",
"this",
"->",
"items"... | Add an item of type BaseField to the field collection
@param BaseField $objItem | [
"Add",
"an",
"item",
"of",
"type",
"BaseField",
"to",
"the",
"field",
"collection"
] | ab92e61c24644f1e61265304b6a35e505007d021 | https://github.com/Teamsisu/contao-mm-frontendInput/blob/ab92e61c24644f1e61265304b6a35e505007d021/src/Teamsisu/MetaModelsFrontendInput/DataContainer/Field/FieldCollection.php#L50-L56 |
15,325 | Teamsisu/contao-mm-frontendInput | src/Teamsisu/MetaModelsFrontendInput/DataContainer/Field/FieldCollection.php | FieldCollection.findItemByColName | public function findItemByColName($colName)
{
if(in_array($colName, $this->index)){
return $this->items[array_search($colName, $this->index)];
}
return false;
} | php | public function findItemByColName($colName)
{
if(in_array($colName, $this->index)){
return $this->items[array_search($colName, $this->index)];
}
return false;
} | [
"public",
"function",
"findItemByColName",
"(",
"$",
"colName",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"colName",
",",
"$",
"this",
"->",
"index",
")",
")",
"{",
"return",
"$",
"this",
"->",
"items",
"[",
"array_search",
"(",
"$",
"colName",
",",
... | Get an item by its colName
@param string $colName
@return BaseField|bool | [
"Get",
"an",
"item",
"by",
"its",
"colName"
] | ab92e61c24644f1e61265304b6a35e505007d021 | https://github.com/Teamsisu/contao-mm-frontendInput/blob/ab92e61c24644f1e61265304b6a35e505007d021/src/Teamsisu/MetaModelsFrontendInput/DataContainer/Field/FieldCollection.php#L63-L72 |
15,326 | FrenchFrogs/framework | src/Table/Column/Button.php | Button.getBindedLabel | public function getBindedLabel($row = [])
{
$bind = isset($row[$this->getName()]) ? $row[$this->getName()] : false;
return sprintf($this->getLabel(), $bind);
} | php | public function getBindedLabel($row = [])
{
$bind = isset($row[$this->getName()]) ? $row[$this->getName()] : false;
return sprintf($this->getLabel(), $bind);
} | [
"public",
"function",
"getBindedLabel",
"(",
"$",
"row",
"=",
"[",
"]",
")",
"{",
"$",
"bind",
"=",
"isset",
"(",
"$",
"row",
"[",
"$",
"this",
"->",
"getName",
"(",
")",
"]",
")",
"?",
"$",
"row",
"[",
"$",
"this",
"->",
"getName",
"(",
")",
... | Return the binded Label
@param array $row
@return string | [
"Return",
"the",
"binded",
"Label"
] | a4838c698a5600437e87dac6d35ba8ebe32c4395 | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Button.php#L31-L35 |
15,327 | prooph/link-app-core | src/Controller/ProcessingSetUpController.php | ProcessingSetUpController.runAction | public function runAction()
{
try {
$this->commandBus->dispatch(CreateDefaultProcessingConfigFile::in(ConfigLocation::fromPath(Definition::getSystemConfigDir())));
$sqliteDbFile = SqliteDbFile::initializeFromDist(Definition::getEventStoreSqliteDbFile());
$esConfigLocati... | php | public function runAction()
{
try {
$this->commandBus->dispatch(CreateDefaultProcessingConfigFile::in(ConfigLocation::fromPath(Definition::getSystemConfigDir())));
$sqliteDbFile = SqliteDbFile::initializeFromDist(Definition::getEventStoreSqliteDbFile());
$esConfigLocati... | [
"public",
"function",
"runAction",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"commandBus",
"->",
"dispatch",
"(",
"CreateDefaultProcessingConfigFile",
"::",
"in",
"(",
"ConfigLocation",
"::",
"fromPath",
"(",
"Definition",
"::",
"getSystemConfigDir",
"(",
")... | Runs the initial set up of the processing system | [
"Runs",
"the",
"initial",
"set",
"up",
"of",
"the",
"processing",
"system"
] | 835a5945dfa7be7b2cebfa6e84e757ecfd783357 | https://github.com/prooph/link-app-core/blob/835a5945dfa7be7b2cebfa6e84e757ecfd783357/src/Controller/ProcessingSetUpController.php#L33-L55 |
15,328 | bestit/commercetools-order-export-bundle | src/DependencyInjection/BestItCtOrderExportExtension.php | BestItCtOrderExportExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yml');
$config = $this->processConfiguration(new Configuration(), $configs);
$container->setAlias... | php | public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yml');
$config = $this->processConfiguration(new Configuration(), $configs);
$container->setAlias... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"loader",
"=",
"new",
"YamlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/../Resources/config'",
")",
... | Loads the bundle config.
@param array $configs
@param ContainerBuilder $container
@return void | [
"Loads",
"the",
"bundle",
"config",
"."
] | 44bd0dedff6edab5ecf5803dcf6d24ffe0dbf845 | https://github.com/bestit/commercetools-order-export-bundle/blob/44bd0dedff6edab5ecf5803dcf6d24ffe0dbf845/src/DependencyInjection/BestItCtOrderExportExtension.php#L25-L71 |
15,329 | gmazzap/Url_To_Query | UrlToQuery.php | UrlToQuery.resolve | function resolve( $url = '', $query_string_vars = [ ] ) {
$url = filter_var( $url, FILTER_SANITIZE_URL );
if ( ! empty( $url ) ) {
$id = md5( $url . serialize( $query_string_vars ) );
if ( ! isset( $this->items[$id] ) || ! $this->items[$id] instanceof UrlToQueryItem ) {
... | php | function resolve( $url = '', $query_string_vars = [ ] ) {
$url = filter_var( $url, FILTER_SANITIZE_URL );
if ( ! empty( $url ) ) {
$id = md5( $url . serialize( $query_string_vars ) );
if ( ! isset( $this->items[$id] ) || ! $this->items[$id] instanceof UrlToQueryItem ) {
... | [
"function",
"resolve",
"(",
"$",
"url",
"=",
"''",
",",
"$",
"query_string_vars",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_SANITIZE_URL",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"url",
")",
")",
"... | Resolve an url to an array of WP_Query arguments for main query
@param string $url Url to resolve
@param type $query_string_vars Query variables to be added to the url
@return array|\WP_Error Resolved query or WP_Error is something goes wrong | [
"Resolve",
"an",
"url",
"to",
"an",
"array",
"of",
"WP_Query",
"arguments",
"for",
"main",
"query"
] | 2537affbbb8b9062d46bb2deec1933acab63d007 | https://github.com/gmazzap/Url_To_Query/blob/2537affbbb8b9062d46bb2deec1933acab63d007/UrlToQuery.php#L57-L69 |
15,330 | stubbles/stubbles-webapp-core | src/main/php/response/mimetypes/Csv.php | Csv.serializeIterable | private function serializeIterable($resource, OutputStream $out)
{
$memory = fopen('php://memory', 'wb');
if (is_array($resource) && is_scalar(current($resource))) {
if (!is_numeric(key($resource))) {
$out->write($this->toCsvLine(array_keys($resource), $memory));
... | php | private function serializeIterable($resource, OutputStream $out)
{
$memory = fopen('php://memory', 'wb');
if (is_array($resource) && is_scalar(current($resource))) {
if (!is_numeric(key($resource))) {
$out->write($this->toCsvLine(array_keys($resource), $memory));
... | [
"private",
"function",
"serializeIterable",
"(",
"$",
"resource",
",",
"OutputStream",
"$",
"out",
")",
"{",
"$",
"memory",
"=",
"fopen",
"(",
"'php://memory'",
",",
"'wb'",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"resource",
")",
"&&",
"is_scalar",
"... | serializes iterable to csv
@param iterable $resource
@param \stubbles\streams\OutputStream $out | [
"serializes",
"iterable",
"to",
"csv"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/mimetypes/Csv.php#L102-L124 |
15,331 | stubbles/stubbles-webapp-core | src/main/php/response/mimetypes/Csv.php | Csv.toCsvLine | private function toCsvLine(array $elements, $memory): string
{
ftruncate($memory, 0);
rewind($memory);
fputcsv($memory, $elements, $this->delimiter, $this->enclosure);
rewind($memory);
return stream_get_contents($memory);
} | php | private function toCsvLine(array $elements, $memory): string
{
ftruncate($memory, 0);
rewind($memory);
fputcsv($memory, $elements, $this->delimiter, $this->enclosure);
rewind($memory);
return stream_get_contents($memory);
} | [
"private",
"function",
"toCsvLine",
"(",
"array",
"$",
"elements",
",",
"$",
"memory",
")",
":",
"string",
"{",
"ftruncate",
"(",
"$",
"memory",
",",
"0",
")",
";",
"rewind",
"(",
"$",
"memory",
")",
";",
"fputcsv",
"(",
"$",
"memory",
",",
"$",
"e... | turns given list of elements into a line suitable for csv
@param string[] $elements
@param resource $memory
@return string | [
"turns",
"given",
"list",
"of",
"elements",
"into",
"a",
"line",
"suitable",
"for",
"csv"
] | 7705f129011a81d5cc3c76b4b150fab3dadac6a3 | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/response/mimetypes/Csv.php#L133-L140 |
15,332 | luyadev/luya-module-styleguide | src/controllers/DefaultController.php | DefaultController.actionIndex | public function actionIndex()
{
if (!$this->hasAccess()) {
return $this->redirect(['login']);
}
foreach ($this->module->assetFiles as $class) {
$this->registerAsset($class);
}
return $this->render('index', [
'title' => 'Styleguide... | php | public function actionIndex()
{
if (!$this->hasAccess()) {
return $this->redirect(['login']);
}
foreach ($this->module->assetFiles as $class) {
$this->registerAsset($class);
}
return $this->render('index', [
'title' => 'Styleguide... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasAccess",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"redirect",
"(",
"[",
"'login'",
"]",
")",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"module",
... | Render Styleguide.
@return \yii\web\Response|string | [
"Render",
"Styleguide",
"."
] | 212ebbd9555ca2e871372b10f3e2399f7ab68e85 | https://github.com/luyadev/luya-module-styleguide/blob/212ebbd9555ca2e871372b10f3e2399f7ab68e85/src/controllers/DefaultController.php#L24-L39 |
15,333 | luyadev/luya-module-styleguide | src/controllers/DefaultController.php | DefaultController.actionLogin | public function actionLogin()
{
$password = Yii::$app->request->post('pass', false);
// check password
if ($password === $this->module->password || $this->hasAccess()) {
Yii::$app->session->set(self::STYLEGUIDE_SESSION_PWNAME, $password);
return $this->redirect(['ind... | php | public function actionLogin()
{
$password = Yii::$app->request->post('pass', false);
// check password
if ($password === $this->module->password || $this->hasAccess()) {
Yii::$app->session->set(self::STYLEGUIDE_SESSION_PWNAME, $password);
return $this->redirect(['ind... | [
"public",
"function",
"actionLogin",
"(",
")",
"{",
"$",
"password",
"=",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
"'pass'",
",",
"false",
")",
";",
"// check password",
"if",
"(",
"$",
"password",
"===",
"$",
"this",
"->",
"module"... | Login action if password is required.
@return \yii\web\Response|string | [
"Login",
"action",
"if",
"password",
"is",
"required",
"."
] | 212ebbd9555ca2e871372b10f3e2399f7ab68e85 | https://github.com/luyadev/luya-module-styleguide/blob/212ebbd9555ca2e871372b10f3e2399f7ab68e85/src/controllers/DefaultController.php#L46-L59 |
15,334 | luyadev/luya-module-styleguide | src/controllers/DefaultController.php | DefaultController.extractElementsFromComponent | protected function extractElementsFromComponent()
{
$elements = [];
foreach (Yii::$app->element->getElements() as $name => $closure) {
$reflection = new \ReflectionFunction($closure);
$args = $reflection->getParameters();
$params = [];
$writtenParams =... | php | protected function extractElementsFromComponent()
{
$elements = [];
foreach (Yii::$app->element->getElements() as $name => $closure) {
$reflection = new \ReflectionFunction($closure);
$args = $reflection->getParameters();
$params = [];
$writtenParams =... | [
"protected",
"function",
"extractElementsFromComponent",
"(",
")",
"{",
"$",
"elements",
"=",
"[",
"]",
";",
"foreach",
"(",
"Yii",
"::",
"$",
"app",
"->",
"element",
"->",
"getElements",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"closure",
")",
"{",
"$"... | Extract the data from the element component
@return array | [
"Extract",
"the",
"data",
"from",
"the",
"element",
"component"
] | 212ebbd9555ca2e871372b10f3e2399f7ab68e85 | https://github.com/luyadev/luya-module-styleguide/blob/212ebbd9555ca2e871372b10f3e2399f7ab68e85/src/controllers/DefaultController.php#L66-L106 |
15,335 | luyadev/luya-module-styleguide | src/controllers/DefaultController.php | DefaultController.defineElement | protected function defineElement($element, $name = null, $description = null, array $values = [], array $options = [], array $params = [])
{
return [
'name' => $name ?: $element,
'description' => $description,
'element' => $element,
'values' => $values,
... | php | protected function defineElement($element, $name = null, $description = null, array $values = [], array $options = [], array $params = [])
{
return [
'name' => $name ?: $element,
'description' => $description,
'element' => $element,
'values' => $values,
... | [
"protected",
"function",
"defineElement",
"(",
"$",
"element",
",",
"$",
"name",
"=",
"null",
",",
"$",
"description",
"=",
"null",
",",
"array",
"$",
"values",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"array",
"$",
"params",
... | Generate the array for a given element.
@return array | [
"Generate",
"the",
"array",
"for",
"a",
"given",
"element",
"."
] | 212ebbd9555ca2e871372b10f3e2399f7ab68e85 | https://github.com/luyadev/luya-module-styleguide/blob/212ebbd9555ca2e871372b10f3e2399f7ab68e85/src/controllers/DefaultController.php#L113-L122 |
15,336 | luyadev/luya-module-styleguide | src/controllers/DefaultController.php | DefaultController.hasAccess | protected function hasAccess()
{
return $this->module->password == Yii::$app->session->get(self::STYLEGUIDE_SESSION_PWNAME, false);
} | php | protected function hasAccess()
{
return $this->module->password == Yii::$app->session->get(self::STYLEGUIDE_SESSION_PWNAME, false);
} | [
"protected",
"function",
"hasAccess",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"module",
"->",
"password",
"==",
"Yii",
"::",
"$",
"app",
"->",
"session",
"->",
"get",
"(",
"self",
"::",
"STYLEGUIDE_SESSION_PWNAME",
",",
"false",
")",
";",
"}"
] | Whether current session contains password or not.
@return boolean | [
"Whether",
"current",
"session",
"contains",
"password",
"or",
"not",
"."
] | 212ebbd9555ca2e871372b10f3e2399f7ab68e85 | https://github.com/luyadev/luya-module-styleguide/blob/212ebbd9555ca2e871372b10f3e2399f7ab68e85/src/controllers/DefaultController.php#L129-L132 |
15,337 | Nayjest/Tree | src/NodeCollection.php | NodeCollection.add | public function add($item, $prepend = false)
{
if (!$item instanceof ChildNodeInterface) {
$details = is_object($item) ? get_class($item) : gettype($item);
throw new InvalidArgumentException(
"NodeCollection accepts only objects implementing ChildNodeInterface, $detai... | php | public function add($item, $prepend = false)
{
if (!$item instanceof ChildNodeInterface) {
$details = is_object($item) ? get_class($item) : gettype($item);
throw new InvalidArgumentException(
"NodeCollection accepts only objects implementing ChildNodeInterface, $detai... | [
"public",
"function",
"add",
"(",
"$",
"item",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"item",
"instanceof",
"ChildNodeInterface",
")",
"{",
"$",
"details",
"=",
"is_object",
"(",
"$",
"item",
")",
"?",
"get_class",
"(",
"$"... | Adds component to collection.
If component is already in collection, it will not be added twice.
@param ChildNodeInterface $item
@param bool $prepend Pass true to add component to the beginning of an array.
@return $this | [
"Adds",
"component",
"to",
"collection",
"."
] | e73da75f939e207b1c25065e9466c28300e7113c | https://github.com/Nayjest/Tree/blob/e73da75f939e207b1c25065e9466c28300e7113c/src/NodeCollection.php#L40-L59 |
15,338 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Service/AbstractService.php | AbstractService.getImplementedMethods | public function getImplementedMethods() {
$supported_methods = $this->getConfiguration()->get('supported-http-methods');
if ( is_null($supported_methods) ) $supported_methods = self::$supported_methods;
if ( method_exists($this, 'any') ) {
return $supported_methods;
}
... | php | public function getImplementedMethods() {
$supported_methods = $this->getConfiguration()->get('supported-http-methods');
if ( is_null($supported_methods) ) $supported_methods = self::$supported_methods;
if ( method_exists($this, 'any') ) {
return $supported_methods;
}
... | [
"public",
"function",
"getImplementedMethods",
"(",
")",
"{",
"$",
"supported_methods",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
"->",
"get",
"(",
"'supported-http-methods'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"supported_methods",
")",
")",... | Get service-implemented HTTP methods
@return array Service implemented methods, in uppercase | [
"Get",
"service",
"-",
"implemented",
"HTTP",
"methods"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Service/AbstractService.php#L75-L97 |
15,339 | comodojo/dispatcher.framework | src/Comodojo/Dispatcher/Service/AbstractService.php | AbstractService.getMethod | public function getMethod($method) {
$method = strtolower($method);
if ( method_exists($this, $method) ) {
return $method;
} else if ( method_exists($this, 'any') ) {
return 'any';
} else {
return null;
}
} | php | public function getMethod($method) {
$method = strtolower($method);
if ( method_exists($this, $method) ) {
return $method;
} else if ( method_exists($this, 'any') ) {
return 'any';
} else {
return null;
}
} | [
"public",
"function",
"getMethod",
"(",
"$",
"method",
")",
"{",
"$",
"method",
"=",
"strtolower",
"(",
"$",
"method",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
"return",
"$",
"method",
";",
"}",
"el... | Return the callable class method that reflect the requested one | [
"Return",
"the",
"callable",
"class",
"method",
"that",
"reflect",
"the",
"requested",
"one"
] | 5093297dcb7441a8d8f79cbb2429c93232e16d1c | https://github.com/comodojo/dispatcher.framework/blob/5093297dcb7441a8d8f79cbb2429c93232e16d1c/src/Comodojo/Dispatcher/Service/AbstractService.php#L103-L121 |
15,340 | czim/laravel-pxlcms | src/Generator/Writer/AbstractProcessStep.php | AbstractProcessStep.stubReplace | protected function stubReplace($placeholder, $replace, $pregReplace = false)
{
if ($pregReplace) {
$this->data->output['content'] = preg_replace(
$placeholder,
$replace,
$this->data->output['content']
);
} else {
... | php | protected function stubReplace($placeholder, $replace, $pregReplace = false)
{
if ($pregReplace) {
$this->data->output['content'] = preg_replace(
$placeholder,
$replace,
$this->data->output['content']
);
} else {
... | [
"protected",
"function",
"stubReplace",
"(",
"$",
"placeholder",
",",
"$",
"replace",
",",
"$",
"pregReplace",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"pregReplace",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"output",
"[",
"'content'",
"]",
"=",
"preg... | Replaces output stub content placeholders with actual content
@param string $placeholder
@param string $replace
@param bool $pregReplace whether to use preg_replace
@return $this | [
"Replaces",
"output",
"stub",
"content",
"placeholders",
"with",
"actual",
"content"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/AbstractProcessStep.php#L17-L37 |
15,341 | czim/laravel-pxlcms | src/Generator/Writer/AbstractProcessStep.php | AbstractProcessStep.getLongestKey | protected function getLongestKey(array $array)
{
$longest = 0;
foreach ($array as $key => $value) {
if ($longest > strlen($key)) continue;
$longest = strlen($key);
}
return $longest;
} | php | protected function getLongestKey(array $array)
{
$longest = 0;
foreach ($array as $key => $value) {
if ($longest > strlen($key)) continue;
$longest = strlen($key);
}
return $longest;
} | [
"protected",
"function",
"getLongestKey",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"longest",
"=",
"0",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"longest",
">",
"strlen",
"(",
"$",
"key",
... | Returns length of longest key in key-value pair array
@param array $array
@return int | [
"Returns",
"length",
"of",
"longest",
"key",
"in",
"key",
"-",
"value",
"pair",
"array"
] | 910297d2a3f2db86dde51b0e10fe5aad45f1aa1a | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/AbstractProcessStep.php#L69-L80 |
15,342 | danmichaelo/quitesimplexmlelement | src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php | QuiteSimpleXMLElement.attr | public function attr($attribute)
{
if (strpos($attribute, ':') !== false) {
list($ns, $attribute) = explode(':', $attribute, 2);
return trim((string) $this->el->attributes($ns, true)->{$attribute});
}
return trim((string) $this->el->attributes()->{$attribute});
} | php | public function attr($attribute)
{
if (strpos($attribute, ':') !== false) {
list($ns, $attribute) = explode(':', $attribute, 2);
return trim((string) $this->el->attributes($ns, true)->{$attribute});
}
return trim((string) $this->el->attributes()->{$attribute});
} | [
"public",
"function",
"attr",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"attribute",
",",
"':'",
")",
"!==",
"false",
")",
"{",
"list",
"(",
"$",
"ns",
",",
"$",
"attribute",
")",
"=",
"explode",
"(",
"':'",
",",
"$",
"attri... | Get a node attribute value. Namespace prefixes are supported.
@param string $attribute
@return string | [
"Get",
"a",
"node",
"attribute",
"value",
".",
"Namespace",
"prefixes",
"are",
"supported",
"."
] | 566261ac5a789d63fda4ffc328501213772c1b27 | https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php#L15-L23 |
15,343 | danmichaelo/quitesimplexmlelement | src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php | QuiteSimpleXMLElement.first | public function first($path)
{
// Convenience method
$x = $this->xpath($path);
return count($x) ? $x[0] : null;
} | php | public function first($path)
{
// Convenience method
$x = $this->xpath($path);
return count($x) ? $x[0] : null;
} | [
"public",
"function",
"first",
"(",
"$",
"path",
")",
"{",
"// Convenience method",
"$",
"x",
"=",
"$",
"this",
"->",
"xpath",
"(",
"$",
"path",
")",
";",
"return",
"count",
"(",
"$",
"x",
")",
"?",
"$",
"x",
"[",
"0",
"]",
":",
"null",
";",
"}... | Get the first node matching an XPath query, or null if no match.
@param string $path
@return QuiteSimpleXMLElement | [
"Get",
"the",
"first",
"node",
"matching",
"an",
"XPath",
"query",
"or",
"null",
"if",
"no",
"match",
"."
] | 566261ac5a789d63fda4ffc328501213772c1b27 | https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php#L31-L37 |
15,344 | danmichaelo/quitesimplexmlelement | src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php | QuiteSimpleXMLElement.has | public function has($path)
{
$x = $this->xpath($path);
return count($x) ? true : false;
} | php | public function has($path)
{
$x = $this->xpath($path);
return count($x) ? true : false;
} | [
"public",
"function",
"has",
"(",
"$",
"path",
")",
"{",
"$",
"x",
"=",
"$",
"this",
"->",
"xpath",
"(",
"$",
"path",
")",
";",
"return",
"count",
"(",
"$",
"x",
")",
"?",
"true",
":",
"false",
";",
"}"
] | Check if the document has at least one node matching an XPath query.
@param string $path
@return bool | [
"Check",
"if",
"the",
"document",
"has",
"at",
"least",
"one",
"node",
"matching",
"an",
"XPath",
"query",
"."
] | 566261ac5a789d63fda4ffc328501213772c1b27 | https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php#L45-L50 |
15,345 | danmichaelo/quitesimplexmlelement | src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php | QuiteSimpleXMLElement.xpath | public function xpath($path)
{
return array_map(function ($el) {
return new QuiteSimpleXMLElement($el, $this);
}, $this->el->xpath($path));
} | php | public function xpath($path)
{
return array_map(function ($el) {
return new QuiteSimpleXMLElement($el, $this);
}, $this->el->xpath($path));
} | [
"public",
"function",
"xpath",
"(",
"$",
"path",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"el",
")",
"{",
"return",
"new",
"QuiteSimpleXMLElement",
"(",
"$",
"el",
",",
"$",
"this",
")",
";",
"}",
",",
"$",
"this",
"->",
"el",
"-... | Get all nodes matching an XPath query.
@param string $path
@return QuiteSimpleXMLElement[] | [
"Get",
"all",
"nodes",
"matching",
"an",
"XPath",
"query",
"."
] | 566261ac5a789d63fda4ffc328501213772c1b27 | https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php#L58-L63 |
15,346 | danmichaelo/quitesimplexmlelement | src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php | QuiteSimpleXMLElement.text | public function text($path = '.', $trim = true)
{
$text = strval($this->first($path));
return $trim ? trim($text) : $text;
} | php | public function text($path = '.', $trim = true)
{
$text = strval($this->first($path));
return $trim ? trim($text) : $text;
} | [
"public",
"function",
"text",
"(",
"$",
"path",
"=",
"'.'",
",",
"$",
"trim",
"=",
"true",
")",
"{",
"$",
"text",
"=",
"strval",
"(",
"$",
"this",
"->",
"first",
"(",
"$",
"path",
")",
")",
";",
"return",
"$",
"trim",
"?",
"trim",
"(",
"$",
"... | Get the text of the first node matching an XPath query. By default,
the text will be trimmed, but if you want the untrimmed text, set
the second parameter to False.
@param string $path
@param bool $trim
@return string | [
"Get",
"the",
"text",
"of",
"the",
"first",
"node",
"matching",
"an",
"XPath",
"query",
".",
"By",
"default",
"the",
"text",
"will",
"be",
"trimmed",
"but",
"if",
"you",
"want",
"the",
"untrimmed",
"text",
"set",
"the",
"second",
"parameter",
"to",
"Fals... | 566261ac5a789d63fda4ffc328501213772c1b27 | https://github.com/danmichaelo/quitesimplexmlelement/blob/566261ac5a789d63fda4ffc328501213772c1b27/src/Danmichaelo/QuiteSimpleXMLElement/QuiteSimpleXMLElement.php#L85-L90 |
15,347 | ekyna/GlsUniBox | Api/Config.php | Config.validateClientConfig | static public function validateClientConfig(array $config)
{
$tags = [static::T8700, static::T8915, static::T8914];
foreach ($tags as $tag) {
if (!array_key_exists($tag, $config) || empty($config[$tag])) {
throw new InvalidArgumentException("Please configure value for ta... | php | static public function validateClientConfig(array $config)
{
$tags = [static::T8700, static::T8915, static::T8914];
foreach ($tags as $tag) {
if (!array_key_exists($tag, $config) || empty($config[$tag])) {
throw new InvalidArgumentException("Please configure value for ta... | [
"static",
"public",
"function",
"validateClientConfig",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"tags",
"=",
"[",
"static",
"::",
"T8700",
",",
"static",
"::",
"T8915",
",",
"static",
"::",
"T8914",
"]",
";",
"foreach",
"(",
"$",
"tags",
"as",
"$",... | Validates the client configuration.
@param array $config | [
"Validates",
"the",
"client",
"configuration",
"."
] | b474271ba355c3917074422306dc64abf09584d0 | https://github.com/ekyna/GlsUniBox/blob/b474271ba355c3917074422306dc64abf09584d0/Api/Config.php#L379-L388 |
15,348 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.initRolePermissions | public function initRolePermissions($overrideExisting = true)
{
if (null !== $this->collRolePermissions && !$overrideExisting) {
return;
}
$this->collRolePermissions = new ObjectCollection();
$this->collRolePermissions->setModel('\Alchemy\Component\Cerberus\Model\RolePerm... | php | public function initRolePermissions($overrideExisting = true)
{
if (null !== $this->collRolePermissions && !$overrideExisting) {
return;
}
$this->collRolePermissions = new ObjectCollection();
$this->collRolePermissions->setModel('\Alchemy\Component\Cerberus\Model\RolePerm... | [
"public",
"function",
"initRolePermissions",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collRolePermissions",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"coll... | Initializes the collRolePermissions collection.
By default this just sets the collRolePermissions collection to an empty array (like clearcollRolePermissions());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array... | [
"Initializes",
"the",
"collRolePermissions",
"collection",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L1726-L1733 |
15,349 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.addRolePermission | public function addRolePermission(ChildRolePermission $l)
{
if ($this->collRolePermissions === null) {
$this->initRolePermissions();
$this->collRolePermissionsPartial = true;
}
if (!$this->collRolePermissions->contains($l)) {
$this->doAddRolePermission($l... | php | public function addRolePermission(ChildRolePermission $l)
{
if ($this->collRolePermissions === null) {
$this->initRolePermissions();
$this->collRolePermissionsPartial = true;
}
if (!$this->collRolePermissions->contains($l)) {
$this->doAddRolePermission($l... | [
"public",
"function",
"addRolePermission",
"(",
"ChildRolePermission",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collRolePermissions",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initRolePermissions",
"(",
")",
";",
"$",
"this",
"->",
"collRolePerm... | Method called to associate a ChildRolePermission object to this object
through the ChildRolePermission foreign key attribute.
@param ChildRolePermission $l ChildRolePermission
@return $this|\Alchemy\Component\Cerberus\Model\Role The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildRolePermission",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildRolePermission",
"foreign",
"key",
"attribute",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L1870-L1882 |
15,350 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.initUsers | public function initUsers()
{
$this->collUsers = new ObjectCollection();
$this->collUsersPartial = true;
$this->collUsers->setModel('\Alchemy\Component\Cerberus\Model\User');
} | php | public function initUsers()
{
$this->collUsers = new ObjectCollection();
$this->collUsersPartial = true;
$this->collUsers->setModel('\Alchemy\Component\Cerberus\Model\User');
} | [
"public",
"function",
"initUsers",
"(",
")",
"{",
"$",
"this",
"->",
"collUsers",
"=",
"new",
"ObjectCollection",
"(",
")",
";",
"$",
"this",
"->",
"collUsersPartial",
"=",
"true",
";",
"$",
"this",
"->",
"collUsers",
"->",
"setModel",
"(",
"'\\Alchemy\\Co... | Initializes the collUsers collection.
By default this just sets the collUsers collection to an empty collection (like clearUsers());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values stored in data... | [
"Initializes",
"the",
"collUsers",
"collection",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L1961-L1967 |
15,351 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.getUsers | public function getUsers(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collUsersPartial && !$this->isNew();
if (null === $this->collUsers || null !== $criteria || $partial) {
if ($this->isNew()) {
// return empty collection
... | php | public function getUsers(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collUsersPartial && !$this->isNew();
if (null === $this->collUsers || null !== $criteria || $partial) {
if ($this->isNew()) {
// return empty collection
... | [
"public",
"function",
"getUsers",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collUsersPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
")",
... | Gets a collection of ChildUser objects related by a many-to-many relationship
to the current object by way of the user_role cross-reference table.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Nex... | [
"Gets",
"a",
"collection",
"of",
"ChildUser",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"user_role",
"cross",
"-",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L1994-L2027 |
15,352 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.countUsers | public function countUsers(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collUsersPartial && !$this->isNew();
if (null === $this->collUsers || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collUsers) {
... | php | public function countUsers(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collUsersPartial && !$this->isNew();
if (null === $this->collUsers || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collUsers) {
... | [
"public",
"function",
"countUsers",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collUsersPartial",
"&&",
"!",
"... | Gets the number of User objects related by a many-to-many relationship
to the current object by way of the user_role cross-reference table.
@param Criteria $criteria Optional query object to filter the query
@param boolean $distinct Set to true to force count distinct
@param ConnectionInterface $con Opt... | [
"Gets",
"the",
"number",
"of",
"User",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"user_role",
"cross",
"-",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2072-L2096 |
15,353 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.addUser | public function addUser(ChildUser $user)
{
if ($this->collUsers === null) {
$this->initUsers();
}
if (!$this->getUsers()->contains($user)) {
// only add it if the **same** object is not already associated
$this->collUsers->push($user);
$this->... | php | public function addUser(ChildUser $user)
{
if ($this->collUsers === null) {
$this->initUsers();
}
if (!$this->getUsers()->contains($user)) {
// only add it if the **same** object is not already associated
$this->collUsers->push($user);
$this->... | [
"public",
"function",
"addUser",
"(",
"ChildUser",
"$",
"user",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collUsers",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initUsers",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"getUsers",
"(",
... | Associate a ChildUser to this object
through the user_role cross reference table.
@param ChildUser $user
@return ChildRole The current object (for fluent API support) | [
"Associate",
"a",
"ChildUser",
"to",
"this",
"object",
"through",
"the",
"user_role",
"cross",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2105-L2118 |
15,354 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.removeUser | public function removeUser(ChildUser $user)
{
if ($this->getUsers()->contains($user)) { $userRole = new ChildUserRole();
$userRole->setUser($user);
if ($user->isRolesLoaded()) {
//remove the back reference if available
$user->getRoles()->removeObject(... | php | public function removeUser(ChildUser $user)
{
if ($this->getUsers()->contains($user)) { $userRole = new ChildUserRole();
$userRole->setUser($user);
if ($user->isRolesLoaded()) {
//remove the back reference if available
$user->getRoles()->removeObject(... | [
"public",
"function",
"removeUser",
"(",
"ChildUser",
"$",
"user",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getUsers",
"(",
")",
"->",
"contains",
"(",
"$",
"user",
")",
")",
"{",
"$",
"userRole",
"=",
"new",
"ChildUserRole",
"(",
")",
";",
"$",
"u... | Remove user of this object
through the user_role cross reference table.
@param ChildUser $user
@return ChildRole The current object (for fluent API support) | [
"Remove",
"user",
"of",
"this",
"object",
"through",
"the",
"user_role",
"cross",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2152-L2178 |
15,355 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.initPermissions | public function initPermissions()
{
$this->collPermissions = new ObjectCollection();
$this->collPermissionsPartial = true;
$this->collPermissions->setModel('\Alchemy\Component\Cerberus\Model\Permission');
} | php | public function initPermissions()
{
$this->collPermissions = new ObjectCollection();
$this->collPermissionsPartial = true;
$this->collPermissions->setModel('\Alchemy\Component\Cerberus\Model\Permission');
} | [
"public",
"function",
"initPermissions",
"(",
")",
"{",
"$",
"this",
"->",
"collPermissions",
"=",
"new",
"ObjectCollection",
"(",
")",
";",
"$",
"this",
"->",
"collPermissionsPartial",
"=",
"true",
";",
"$",
"this",
"->",
"collPermissions",
"->",
"setModel",
... | Initializes the collPermissions collection.
By default this just sets the collPermissions collection to an empty collection (like clearPermissions());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the val... | [
"Initializes",
"the",
"collPermissions",
"collection",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2203-L2209 |
15,356 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.getPermissions | public function getPermissions(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsPartial && !$this->isNew();
if (null === $this->collPermissions || null !== $criteria || $partial) {
if ($this->isNew()) {
// return empty collect... | php | public function getPermissions(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsPartial && !$this->isNew();
if (null === $this->collPermissions || null !== $criteria || $partial) {
if ($this->isNew()) {
// return empty collect... | [
"public",
"function",
"getPermissions",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collPermissionsPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"... | Gets a collection of ChildPermission objects related by a many-to-many relationship
to the current object by way of the role_permission cross-reference table.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then... | [
"Gets",
"a",
"collection",
"of",
"ChildPermission",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"role_permission",
"cross",
"-",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2236-L2269 |
15,357 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.countPermissions | public function countPermissions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsPartial && !$this->isNew();
if (null === $this->collPermissions || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->co... | php | public function countPermissions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsPartial && !$this->isNew();
if (null === $this->collPermissions || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->co... | [
"public",
"function",
"countPermissions",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collPermissionsPartial",
"&&"... | Gets the number of Permission objects related by a many-to-many relationship
to the current object by way of the role_permission cross-reference table.
@param Criteria $criteria Optional query object to filter the query
@param boolean $distinct Set to true to force count distinct
@param ConnectionInterf... | [
"Gets",
"the",
"number",
"of",
"Permission",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"role_permission",
"cross",
"-",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2314-L2338 |
15,358 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.addPermission | public function addPermission(ChildPermission $permission)
{
if ($this->collPermissions === null) {
$this->initPermissions();
}
if (!$this->getPermissions()->contains($permission)) {
// only add it if the **same** object is not already associated
$this->c... | php | public function addPermission(ChildPermission $permission)
{
if ($this->collPermissions === null) {
$this->initPermissions();
}
if (!$this->getPermissions()->contains($permission)) {
// only add it if the **same** object is not already associated
$this->c... | [
"public",
"function",
"addPermission",
"(",
"ChildPermission",
"$",
"permission",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collPermissions",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initPermissions",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
... | Associate a ChildPermission to this object
through the role_permission cross reference table.
@param ChildPermission $permission
@return ChildRole The current object (for fluent API support) | [
"Associate",
"a",
"ChildPermission",
"to",
"this",
"object",
"through",
"the",
"role_permission",
"cross",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2347-L2360 |
15,359 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Role.php | Role.removePermission | public function removePermission(ChildPermission $permission)
{
if ($this->getPermissions()->contains($permission)) { $rolePermission = new ChildRolePermission();
$rolePermission->setPermission($permission);
if ($permission->isRolesLoaded()) {
//remove the back refer... | php | public function removePermission(ChildPermission $permission)
{
if ($this->getPermissions()->contains($permission)) { $rolePermission = new ChildRolePermission();
$rolePermission->setPermission($permission);
if ($permission->isRolesLoaded()) {
//remove the back refer... | [
"public",
"function",
"removePermission",
"(",
"ChildPermission",
"$",
"permission",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getPermissions",
"(",
")",
"->",
"contains",
"(",
"$",
"permission",
")",
")",
"{",
"$",
"rolePermission",
"=",
"new",
"ChildRolePer... | Remove permission of this object
through the role_permission cross reference table.
@param ChildPermission $permission
@return ChildRole The current object (for fluent API support) | [
"Remove",
"permission",
"of",
"this",
"object",
"through",
"the",
"role_permission",
"cross",
"reference",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Role.php#L2394-L2420 |
15,360 | Coercive/Xss | XssUrl.php | XssUrl.detect | private function detect()
{
# Init
$this->xss = false;
# No data
if(!$this->string) { return; }
# Detect
foreach ($this->list as $item) {
if(preg_match("`$item`i", $this->string)) {
$this->xss = true;
}
}
} | php | private function detect()
{
# Init
$this->xss = false;
# No data
if(!$this->string) { return; }
# Detect
foreach ($this->list as $item) {
if(preg_match("`$item`i", $this->string)) {
$this->xss = true;
}
}
} | [
"private",
"function",
"detect",
"(",
")",
"{",
"# Init",
"$",
"this",
"->",
"xss",
"=",
"false",
";",
"# No data",
"if",
"(",
"!",
"$",
"this",
"->",
"string",
")",
"{",
"return",
";",
"}",
"# Detect",
"foreach",
"(",
"$",
"this",
"->",
"list",
"a... | DETECT XSS URL ATTACK
@return void | [
"DETECT",
"XSS",
"URL",
"ATTACK"
] | d47a05347550f7e2c846d7015483a7e91e5a5138 | https://github.com/Coercive/Xss/blob/d47a05347550f7e2c846d7015483a7e91e5a5138/XssUrl.php#L94-L108 |
15,361 | avoo/SerializerTranslation | Expression/ExpressionEvaluator.php | ExpressionEvaluator.registerFunction | public function registerFunction(ExpressionFunctionInterface $function)
{
$this->expressionLanguage->register(
$function->getName(),
$function->getCompiler(),
$function->getEvaluator()
);
foreach ($function->getContextVariables() as $name => $value) {
... | php | public function registerFunction(ExpressionFunctionInterface $function)
{
$this->expressionLanguage->register(
$function->getName(),
$function->getCompiler(),
$function->getEvaluator()
);
foreach ($function->getContextVariables() as $name => $value) {
... | [
"public",
"function",
"registerFunction",
"(",
"ExpressionFunctionInterface",
"$",
"function",
")",
"{",
"$",
"this",
"->",
"expressionLanguage",
"->",
"register",
"(",
"$",
"function",
"->",
"getName",
"(",
")",
",",
"$",
"function",
"->",
"getCompiler",
"(",
... | Register a new new ExpressionLanguage function.
@param ExpressionFunctionInterface $function
@return ExpressionEvaluator | [
"Register",
"a",
"new",
"new",
"ExpressionLanguage",
"function",
"."
] | e66de5482adb944197a36874465ef144b293a157 | https://github.com/avoo/SerializerTranslation/blob/e66de5482adb944197a36874465ef144b293a157/Expression/ExpressionEvaluator.php#L84-L97 |
15,362 | datasift/datasift-php | examples/football.php | EventHandler.onInteraction | public function onInteraction($consumer, $interaction, $hash)
{
echo 'Type: '.$interaction['interaction']['type']."\n";
echo 'Content: '.$interaction['interaction']['content']."\n--\n";
// Stop after 10
if ($this->_num-- == 1) {
echo "Stopping consumer...\n";
$consumer->stop();
}
} | php | public function onInteraction($consumer, $interaction, $hash)
{
echo 'Type: '.$interaction['interaction']['type']."\n";
echo 'Content: '.$interaction['interaction']['content']."\n--\n";
// Stop after 10
if ($this->_num-- == 1) {
echo "Stopping consumer...\n";
$consumer->stop();
}
} | [
"public",
"function",
"onInteraction",
"(",
"$",
"consumer",
",",
"$",
"interaction",
",",
"$",
"hash",
")",
"{",
"echo",
"'Type: '",
".",
"$",
"interaction",
"[",
"'interaction'",
"]",
"[",
"'type'",
"]",
".",
"\"\\n\"",
";",
"echo",
"'Content: '",
".",
... | Called for each interaction consumed.
@param DataSift_StreamConsumer $consumer The consumer sending the
event.
@param array $interaction The interaction data.
@param string $hash The hash of the stream that
matched this interaction.
@return void | [
"Called",
"for",
"each",
"interaction",
"consumed",
"."
] | 35282461ad3e54880e5940bb5afce26c75dc4bb9 | https://github.com/datasift/datasift-php/blob/35282461ad3e54880e5940bb5afce26c75dc4bb9/examples/football.php#L70-L80 |
15,363 | sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/PdfController.php | PdfController.orderConfirmationAction | public function orderConfirmationAction(Request $request, $id)
{
$locale = $this->getLocale($request);
$this->get('translator')->setLocale($locale);
try {
$orderApiEntity = $this->getOrderManager()->findByIdAndLocale($id, $locale);
$order = $orderApiEntity->getEntit... | php | public function orderConfirmationAction(Request $request, $id)
{
$locale = $this->getLocale($request);
$this->get('translator')->setLocale($locale);
try {
$orderApiEntity = $this->getOrderManager()->findByIdAndLocale($id, $locale);
$order = $orderApiEntity->getEntit... | [
"public",
"function",
"orderConfirmationAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"getLocale",
"(",
"$",
"request",
")",
";",
"$",
"this",
"->",
"get",
"(",
"'translator'",
")",
"->",
"set... | Finds a order object by a given id from the url
and returns a rendered pdf in a download window
@param Request $request
@param $id
@throws OrderNotFoundException
@return Response | [
"Finds",
"a",
"order",
"object",
"by",
"a",
"given",
"id",
"from",
"the",
"url",
"and",
"returns",
"a",
"rendered",
"pdf",
"in",
"a",
"download",
"window"
] | 0d39de262d58579e5679db99a77dbf717d600b5e | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/PdfController.php#L49-L74 |
15,364 | kderyabin/logger | src/Handlers/StreamHandler.php | StreamHandler.open | public function open(): bool
{
$path = $this->getOptionOrDefault('path');
if (is_resource($path)) {
$this->resource = $path;
return true;
}
$context = $this->getOptionOrDefault('context');
if (is_resource($context)) {
$this->resource = @fo... | php | public function open(): bool
{
$path = $this->getOptionOrDefault('path');
if (is_resource($path)) {
$this->resource = $path;
return true;
}
$context = $this->getOptionOrDefault('context');
if (is_resource($context)) {
$this->resource = @fo... | [
"public",
"function",
"open",
"(",
")",
":",
"bool",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getOptionOrDefault",
"(",
"'path'",
")",
";",
"if",
"(",
"is_resource",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->",
"resource",
"=",
"$",
"path"... | Open a log destination.
@return bool | [
"Open",
"a",
"log",
"destination",
"."
] | 683890192b37fe9d36611972e12c2994669f5b85 | https://github.com/kderyabin/logger/blob/683890192b37fe9d36611972e12c2994669f5b85/src/Handlers/StreamHandler.php#L41-L57 |
15,365 | siriusphp/middleware | src/FrameRunner.php | FrameRunner.factory | public static function factory(array $middlewares = array())
{
$runner = null;
foreach ($middlewares as $middleware) {
$runner = $runner ? $runner->add($middleware) : new static($middleware);
}
return $runner;
} | php | public static function factory(array $middlewares = array())
{
$runner = null;
foreach ($middlewares as $middleware) {
$runner = $runner ? $runner->add($middleware) : new static($middleware);
}
return $runner;
} | [
"public",
"static",
"function",
"factory",
"(",
"array",
"$",
"middlewares",
"=",
"array",
"(",
")",
")",
"{",
"$",
"runner",
"=",
"null",
";",
"foreach",
"(",
"$",
"middlewares",
"as",
"$",
"middleware",
")",
"{",
"$",
"runner",
"=",
"$",
"runner",
... | Creates a runner based on an array of middleware
@param array $middlewares
@return FrameRunner | [
"Creates",
"a",
"runner",
"based",
"on",
"an",
"array",
"of",
"middleware"
] | e6805639982d2c0ae01dc9e9a1583915b7873782 | https://github.com/siriusphp/middleware/blob/e6805639982d2c0ae01dc9e9a1583915b7873782/src/FrameRunner.php#L26-L33 |
15,366 | fuzz-productions/laravel-api-data | src/Support/CollectionUtility.php | CollectionUtility.collapseSerialized | public static function collapseSerialized(EloquentCollection $collection)
{
return $collection->map(
function (SerializedModel $menu_item) {
return $menu_item->serialized();
}
)->collapse();
} | php | public static function collapseSerialized(EloquentCollection $collection)
{
return $collection->map(
function (SerializedModel $menu_item) {
return $menu_item->serialized();
}
)->collapse();
} | [
"public",
"static",
"function",
"collapseSerialized",
"(",
"EloquentCollection",
"$",
"collection",
")",
"{",
"return",
"$",
"collection",
"->",
"map",
"(",
"function",
"(",
"SerializedModel",
"$",
"menu_item",
")",
"{",
"return",
"$",
"menu_item",
"->",
"serial... | Collapse a keyed Eloquent Collection.
@param \Illuminate\Database\Eloquent\Collection $collection
@return \Illuminate\Support\Collection | [
"Collapse",
"a",
"keyed",
"Eloquent",
"Collection",
"."
] | 25e181860d2f269b3b212195944c2bca95b411bb | https://github.com/fuzz-productions/laravel-api-data/blob/25e181860d2f269b3b212195944c2bca95b411bb/src/Support/CollectionUtility.php#L21-L28 |
15,367 | Laralum/Roles | src/Models/Role.php | Role.addUser | public function addUser($user)
{
if (!$this->hasUser($user)) {
return RoleUser::create(['role_id' => $this->id, 'user_id' => $user->id]);
}
return false;
} | php | public function addUser($user)
{
if (!$this->hasUser($user)) {
return RoleUser::create(['role_id' => $this->id, 'user_id' => $user->id]);
}
return false;
} | [
"public",
"function",
"addUser",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasUser",
"(",
"$",
"user",
")",
")",
"{",
"return",
"RoleUser",
"::",
"create",
"(",
"[",
"'role_id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'user_id'"... | Adds a user into the role.
@param mixed $user | [
"Adds",
"a",
"user",
"into",
"the",
"role",
"."
] | f934967a5dcebebf81915dd50fccdbcb7e23c113 | https://github.com/Laralum/Roles/blob/f934967a5dcebebf81915dd50fccdbcb7e23c113/src/Models/Role.php#L62-L69 |
15,368 | Laralum/Roles | src/Models/Role.php | Role.addPermission | public function addPermission($permission)
{
if (!$this->hasPermission($permission)) {
return PermissionRole::create(['role_id' => $this->id, 'permission_id' => $permission->id]);
}
return false;
} | php | public function addPermission($permission)
{
if (!$this->hasPermission($permission)) {
return PermissionRole::create(['role_id' => $this->id, 'permission_id' => $permission->id]);
}
return false;
} | [
"public",
"function",
"addPermission",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPermission",
"(",
"$",
"permission",
")",
")",
"{",
"return",
"PermissionRole",
"::",
"create",
"(",
"[",
"'role_id'",
"=>",
"$",
"this",
"->"... | Adds a permission into the role.
@param mixed $permission | [
"Adds",
"a",
"permission",
"into",
"the",
"role",
"."
] | f934967a5dcebebf81915dd50fccdbcb7e23c113 | https://github.com/Laralum/Roles/blob/f934967a5dcebebf81915dd50fccdbcb7e23c113/src/Models/Role.php#L76-L83 |
15,369 | Laralum/Roles | src/Models/Role.php | Role.deleteUser | public function deleteUser($user)
{
if ($this->hasUser($user)) {
return RoleUser::where(
['role_id' => $this->id, 'user_id' => $user->id]
)->first()->delete();
}
return false;
} | php | public function deleteUser($user)
{
if ($this->hasUser($user)) {
return RoleUser::where(
['role_id' => $this->id, 'user_id' => $user->id]
)->first()->delete();
}
return false;
} | [
"public",
"function",
"deleteUser",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasUser",
"(",
"$",
"user",
")",
")",
"{",
"return",
"RoleUser",
"::",
"where",
"(",
"[",
"'role_id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'user_id'",
"... | Deletes the specified role user.
@param mixed $user | [
"Deletes",
"the",
"specified",
"role",
"user",
"."
] | f934967a5dcebebf81915dd50fccdbcb7e23c113 | https://github.com/Laralum/Roles/blob/f934967a5dcebebf81915dd50fccdbcb7e23c113/src/Models/Role.php#L118-L127 |
15,370 | Laralum/Roles | src/Models/Role.php | Role.deletePermission | public function deletePermission($permission)
{
if ($this->hasPermission($permission)) {
return PermissionRole::where(
['role_id' => $this->id, 'permission_id' => $permission->id]
)->first()->delete();
}
return false;
} | php | public function deletePermission($permission)
{
if ($this->hasPermission($permission)) {
return PermissionRole::where(
['role_id' => $this->id, 'permission_id' => $permission->id]
)->first()->delete();
}
return false;
} | [
"public",
"function",
"deletePermission",
"(",
"$",
"permission",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasPermission",
"(",
"$",
"permission",
")",
")",
"{",
"return",
"PermissionRole",
"::",
"where",
"(",
"[",
"'role_id'",
"=>",
"$",
"this",
"->",
"... | Deletes the specified role permission.
@param mixed $permission | [
"Deletes",
"the",
"specified",
"role",
"permission",
"."
] | f934967a5dcebebf81915dd50fccdbcb7e23c113 | https://github.com/Laralum/Roles/blob/f934967a5dcebebf81915dd50fccdbcb7e23c113/src/Models/Role.php#L134-L143 |
15,371 | heyday/heystack | src/Storage/Storage.php | Storage.process | public function process(StorableInterface $object)
{
if (is_array($this->backends) && count($this->backends) > 0) {
$results = [];
$identifiers = $object->getStorableBackendIdentifiers();
foreach ($this->backends as $identifier => $backend) {
if (in_arra... | php | public function process(StorableInterface $object)
{
if (is_array($this->backends) && count($this->backends) > 0) {
$results = [];
$identifiers = $object->getStorableBackendIdentifiers();
foreach ($this->backends as $identifier => $backend) {
if (in_arra... | [
"public",
"function",
"process",
"(",
"StorableInterface",
"$",
"object",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"backends",
")",
"&&",
"count",
"(",
"$",
"this",
"->",
"backends",
")",
">",
"0",
")",
"{",
"$",
"results",
"=",
"[",
... | Runs through each storage backend and processes the Storable object
@param StorableInterface $object
@return array
@throws \Exception | [
"Runs",
"through",
"each",
"storage",
"backend",
"and",
"processes",
"the",
"Storable",
"object"
] | 2c051933f8c532d0a9a23be6ee1ff5c619e47dfe | https://github.com/heyday/heystack/blob/2c051933f8c532d0a9a23be6ee1ff5c619e47dfe/src/Storage/Storage.php#L69-L91 |
15,372 | phower/escaper | src/Phower/Escaper/Escaper.php | Escaper.toUtf8 | protected function toUtf8($string)
{
if ($this->getEncoding() === 'utf-8') {
$result = $string;
} else {
$result = $this->convertEncoding($string, 'UTF-8', $this->getEncoding());
}
return $result;
} | php | protected function toUtf8($string)
{
if ($this->getEncoding() === 'utf-8') {
$result = $string;
} else {
$result = $this->convertEncoding($string, 'UTF-8', $this->getEncoding());
}
return $result;
} | [
"protected",
"function",
"toUtf8",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getEncoding",
"(",
")",
"===",
"'utf-8'",
")",
"{",
"$",
"result",
"=",
"$",
"string",
";",
"}",
"else",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"... | Convert string to UTF-8
@param string $string
@return string
@throws RuntimeException | [
"Convert",
"string",
"to",
"UTF",
"-",
"8"
] | 2c74ab507ac8cb272da27d6225c596abd972a0c3 | https://github.com/phower/escaper/blob/2c74ab507ac8cb272da27d6225c596abd972a0c3/src/Phower/Escaper/Escaper.php#L187-L196 |
15,373 | pageon/SlackWebhookMonolog | src/Monolog/Error.php | Error.addParameterFallback | private function addParameterFallback($name, $fallbackData = null)
{
if (!isset($this->parameters[$name]) && !empty($fallbackData)) {
$this->parameters[$name] = $fallbackData;
}
} | php | private function addParameterFallback($name, $fallbackData = null)
{
if (!isset($this->parameters[$name]) && !empty($fallbackData)) {
$this->parameters[$name] = $fallbackData;
}
} | [
"private",
"function",
"addParameterFallback",
"(",
"$",
"name",
",",
"$",
"fallbackData",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"name",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"fallbackData",
... | This will add fallback data to the parameters if the key is not set.
@param string $name
@param mixed $fallbackData | [
"This",
"will",
"add",
"fallback",
"data",
"to",
"the",
"parameters",
"if",
"the",
"key",
"is",
"not",
"set",
"."
] | 6755060ddd6429620fd4c7decbb95f05463fc36b | https://github.com/pageon/SlackWebhookMonolog/blob/6755060ddd6429620fd4c7decbb95f05463fc36b/src/Monolog/Error.php#L127-L132 |
15,374 | wpottier/WizadSettingsBundle | DependencyInjection/ContainerInjectionManager.php | ContainerInjectionManager.inject | public function inject(ContainerBuilder $container)
{
foreach ($this->schema as $parameter) {
$value = $parameter['default'];
if ($this->parametersStorage->has($parameter['key'])) {
$value = $this->parametersStorage->get($parameter['key']);
}
... | php | public function inject(ContainerBuilder $container)
{
foreach ($this->schema as $parameter) {
$value = $parameter['default'];
if ($this->parametersStorage->has($parameter['key'])) {
$value = $this->parametersStorage->get($parameter['key']);
}
... | [
"public",
"function",
"inject",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"schema",
"as",
"$",
"parameter",
")",
"{",
"$",
"value",
"=",
"$",
"parameter",
"[",
"'default'",
"]",
";",
"if",
"(",
"$",
"this",... | Inject dynamic parameters in the container builder
@param ContainerBuilder $container | [
"Inject",
"dynamic",
"parameters",
"in",
"the",
"container",
"builder"
] | 92738c59d4da28d3a7376de854ce8505898159cb | https://github.com/wpottier/WizadSettingsBundle/blob/92738c59d4da28d3a7376de854ce8505898159cb/DependencyInjection/ContainerInjectionManager.php#L39-L51 |
15,375 | wpottier/WizadSettingsBundle | DependencyInjection/ContainerInjectionManager.php | ContainerInjectionManager.rebuild | public function rebuild(Kernel $kernel)
{
$kernelReflectionClass = new \ReflectionClass($kernel);
$buildContainerReflectionMethod = $kernelReflectionClass->getMethod('buildContainer');
$buildContainerReflectionMethod->setAccessible(true);
$dumpContainerReflectionMethod = $kernelRef... | php | public function rebuild(Kernel $kernel)
{
$kernelReflectionClass = new \ReflectionClass($kernel);
$buildContainerReflectionMethod = $kernelReflectionClass->getMethod('buildContainer');
$buildContainerReflectionMethod->setAccessible(true);
$dumpContainerReflectionMethod = $kernelRef... | [
"public",
"function",
"rebuild",
"(",
"Kernel",
"$",
"kernel",
")",
"{",
"$",
"kernelReflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"kernel",
")",
";",
"$",
"buildContainerReflectionMethod",
"=",
"$",
"kernelReflectionClass",
"->",
"getMethod",
... | Rebuild the container and dump it to the cache to apply change on redis stored parameters | [
"Rebuild",
"the",
"container",
"and",
"dump",
"it",
"to",
"the",
"cache",
"to",
"apply",
"change",
"on",
"redis",
"stored",
"parameters"
] | 92738c59d4da28d3a7376de854ce8505898159cb | https://github.com/wpottier/WizadSettingsBundle/blob/92738c59d4da28d3a7376de854ce8505898159cb/DependencyInjection/ContainerInjectionManager.php#L56-L82 |
15,376 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.filterByCreateDate | public function filterByCreateDate($createDate = null, $comparison = null)
{
if (is_array($createDate)) {
$useMinMax = false;
if (isset($createDate['min'])) {
$this->addUsingAlias(RoleTableMap::COL_CREATE_DATE, $createDate['min'], Criteria::GREATER_EQUAL);
... | php | public function filterByCreateDate($createDate = null, $comparison = null)
{
if (is_array($createDate)) {
$useMinMax = false;
if (isset($createDate['min'])) {
$this->addUsingAlias(RoleTableMap::COL_CREATE_DATE, $createDate['min'], Criteria::GREATER_EQUAL);
... | [
"public",
"function",
"filterByCreateDate",
"(",
"$",
"createDate",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"createDate",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
... | Filter the query on the create_date column
Example usage:
<code>
$query->filterByCreateDate('2011-03-14'); // WHERE create_date = '2011-03-14'
$query->filterByCreateDate('now'); // WHERE create_date = '2011-03-14'
$query->filterByCreateDate(array('max' => 'yesterday')); // WHERE create_date > '2011-03-13'
</code>
@pa... | [
"Filter",
"the",
"query",
"on",
"the",
"create_date",
"column"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L366-L387 |
15,377 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.filterByUpdateDate | public function filterByUpdateDate($updateDate = null, $comparison = null)
{
if (is_array($updateDate)) {
$useMinMax = false;
if (isset($updateDate['min'])) {
$this->addUsingAlias(RoleTableMap::COL_UPDATE_DATE, $updateDate['min'], Criteria::GREATER_EQUAL);
... | php | public function filterByUpdateDate($updateDate = null, $comparison = null)
{
if (is_array($updateDate)) {
$useMinMax = false;
if (isset($updateDate['min'])) {
$this->addUsingAlias(RoleTableMap::COL_UPDATE_DATE, $updateDate['min'], Criteria::GREATER_EQUAL);
... | [
"public",
"function",
"filterByUpdateDate",
"(",
"$",
"updateDate",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"updateDate",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
... | Filter the query on the update_date column
Example usage:
<code>
$query->filterByUpdateDate('2011-03-14'); // WHERE update_date = '2011-03-14'
$query->filterByUpdateDate('now'); // WHERE update_date = '2011-03-14'
$query->filterByUpdateDate(array('max' => 'yesterday')); // WHERE update_date > '2011-03-13'
</code>
@pa... | [
"Filter",
"the",
"query",
"on",
"the",
"update_date",
"column"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L409-L430 |
15,378 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.filterByUserRole | public function filterByUserRole($userRole, $comparison = null)
{
if ($userRole instanceof \Alchemy\Component\Cerberus\Model\UserRole) {
return $this
->addUsingAlias(RoleTableMap::COL_ID, $userRole->getRoleId(), $comparison);
} elseif ($userRole instanceof ObjectCollectio... | php | public function filterByUserRole($userRole, $comparison = null)
{
if ($userRole instanceof \Alchemy\Component\Cerberus\Model\UserRole) {
return $this
->addUsingAlias(RoleTableMap::COL_ID, $userRole->getRoleId(), $comparison);
} elseif ($userRole instanceof ObjectCollectio... | [
"public",
"function",
"filterByUserRole",
"(",
"$",
"userRole",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"userRole",
"instanceof",
"\\",
"Alchemy",
"\\",
"Component",
"\\",
"Cerberus",
"\\",
"Model",
"\\",
"UserRole",
")",
"{",
"retur... | Filter the query by a related \Alchemy\Component\Cerberus\Model\UserRole object
@param \Alchemy\Component\Cerberus\Model\UserRole|ObjectCollection $userRole the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildRoleQuery The ... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"Alchemy",
"\\",
"Component",
"\\",
"Cerberus",
"\\",
"Model",
"\\",
"UserRole",
"object"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L469-L482 |
15,379 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.useUserRoleQuery | public function useUserRoleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinUserRole($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'UserRole', '\Alchemy\Component\Cerberus\Model\UserRoleQuery');
} | php | public function useUserRoleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinUserRole($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'UserRole', '\Alchemy\Component\Cerberus\Model\UserRoleQuery');
} | [
"public",
"function",
"useUserRoleQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinUserRole",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
... | Use the UserRole relation UserRole object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \Alchemy\Component\Cerberus\Model\UserRoleQ... | [
"Use",
"the",
"UserRole",
"relation",
"UserRole",
"object"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L527-L532 |
15,380 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.useRolePermissionQuery | public function useRolePermissionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinRolePermission($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'RolePermission', '\Alchemy\Component\Cerberus\Model\RolePermissionQuery');
... | php | public function useRolePermissionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinRolePermission($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'RolePermission', '\Alchemy\Component\Cerberus\Model\RolePermissionQuery');
... | [
"public",
"function",
"useRolePermissionQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinRolePermission",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")"... | Use the RolePermission relation RolePermission object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \Alchemy\Component\Cerberus\Mod... | [
"Use",
"the",
"RolePermission",
"relation",
"RolePermission",
"object"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L600-L605 |
15,381 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.filterByUser | public function filterByUser($user, $comparison = Criteria::EQUAL)
{
return $this
->useUserRoleQuery()
->filterByUser($user, $comparison)
->endUse();
} | php | public function filterByUser($user, $comparison = Criteria::EQUAL)
{
return $this
->useUserRoleQuery()
->filterByUser($user, $comparison)
->endUse();
} | [
"public",
"function",
"filterByUser",
"(",
"$",
"user",
",",
"$",
"comparison",
"=",
"Criteria",
"::",
"EQUAL",
")",
"{",
"return",
"$",
"this",
"->",
"useUserRoleQuery",
"(",
")",
"->",
"filterByUser",
"(",
"$",
"user",
",",
"$",
"comparison",
")",
"->"... | Filter the query by a related User object
using the user_role table as cross reference
@param User $user the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildRoleQuery The current query, for fluid interface | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"User",
"object",
"using",
"the",
"user_role",
"table",
"as",
"cross",
"reference"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L616-L622 |
15,382 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.filterByPermission | public function filterByPermission($permission, $comparison = Criteria::EQUAL)
{
return $this
->useRolePermissionQuery()
->filterByPermission($permission, $comparison)
->endUse();
} | php | public function filterByPermission($permission, $comparison = Criteria::EQUAL)
{
return $this
->useRolePermissionQuery()
->filterByPermission($permission, $comparison)
->endUse();
} | [
"public",
"function",
"filterByPermission",
"(",
"$",
"permission",
",",
"$",
"comparison",
"=",
"Criteria",
"::",
"EQUAL",
")",
"{",
"return",
"$",
"this",
"->",
"useRolePermissionQuery",
"(",
")",
"->",
"filterByPermission",
"(",
"$",
"permission",
",",
"$",... | Filter the query by a related Permission object
using the role_permission table as cross reference
@param Permission $permission the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildRoleQuery The current query, for fluid inte... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"Permission",
"object",
"using",
"the",
"role_permission",
"table",
"as",
"cross",
"reference"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L633-L639 |
15,383 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.doDeleteAll | public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(RoleTableMap::DATABASE_NAME);
}
// use transaction because $criteria could contain info
// for more than one table or we could emu... | php | public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(RoleTableMap::DATABASE_NAME);
}
// use transaction because $criteria could contain info
// for more than one table or we could emu... | [
"public",
"function",
"doDeleteAll",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getWriteConnection",
"(",
"RoleTabl... | Deletes all rows from the role table.
@param ConnectionInterface $con the connection to use
@return int The number of affected rows (if supported by underlying database driver). | [
"Deletes",
"all",
"rows",
"from",
"the",
"role",
"table",
"."
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L663-L682 |
15,384 | phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php | RoleQuery.delete | public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(RoleTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(RoleTableMap::DATABASE_NAME)... | php | public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(RoleTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(RoleTableMap::DATABASE_NAME)... | [
"public",
"function",
"delete",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getWriteConnection",
"(",
"RoleTableMap"... | Performs a DELETE on the database based on the current ModelCriteria
@param ConnectionInterface $con the connection to use
@return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
if supported by native driver or if emulated using Propel.
@th... | [
"Performs",
"a",
"DELETE",
"on",
"the",
"database",
"based",
"on",
"the",
"current",
"ModelCriteria"
] | 3424a360c9bded71eb5b570bc114a7759cb23ec6 | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/RoleQuery.php#L693-L716 |
15,385 | awethemes/wp-session | src/Store.php | Store.start | public function start() {
$data = $this->handler->read( $this->get_id() );
if ( false !== $data && ! is_null( $data ) && is_array( $data ) ) {
$this->attributes = $data;
}
$this->started = true;
} | php | public function start() {
$data = $this->handler->read( $this->get_id() );
if ( false !== $data && ! is_null( $data ) && is_array( $data ) ) {
$this->attributes = $data;
}
$this->started = true;
} | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"handler",
"->",
"read",
"(",
"$",
"this",
"->",
"get_id",
"(",
")",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"data",
"&&",
"!",
"is_null",
"(",
"$",
"data",
")... | Start the session, reading the data from a handler.
@return void | [
"Start",
"the",
"session",
"reading",
"the",
"data",
"from",
"a",
"handler",
"."
] | 4819c6392a0dbcbbf547027b70d5af88e7a89d61 | https://github.com/awethemes/wp-session/blob/4819c6392a0dbcbbf547027b70d5af88e7a89d61/src/Store.php#L63-L71 |
15,386 | awethemes/wp-session | src/Store.php | Store.keep | public function keep( $keys = null ) {
$keys = is_array( $keys ) ? $keys : func_get_args();
$this->merge_new_flashes( $keys );
$this->remove_old_flash_data( $keys );
} | php | public function keep( $keys = null ) {
$keys = is_array( $keys ) ? $keys : func_get_args();
$this->merge_new_flashes( $keys );
$this->remove_old_flash_data( $keys );
} | [
"public",
"function",
"keep",
"(",
"$",
"keys",
"=",
"null",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"keys",
")",
"?",
"$",
"keys",
":",
"func_get_args",
"(",
")",
";",
"$",
"this",
"->",
"merge_new_flashes",
"(",
"$",
"keys",
")",
";",
... | Reflash a subset of the current flash data.
@param array|mixed $keys Keep flash keys.
@return void | [
"Reflash",
"a",
"subset",
"of",
"the",
"current",
"flash",
"data",
"."
] | 4819c6392a0dbcbbf547027b70d5af88e7a89d61 | https://github.com/awethemes/wp-session/blob/4819c6392a0dbcbbf547027b70d5af88e7a89d61/src/Store.php#L292-L298 |
15,387 | awethemes/wp-session | src/Store.php | Store.regenerate | public function regenerate( $destroy = false ) {
if ( $destroy ) {
$this->handler->destroy( $this->get_id() );
}
$this->set_id( $this->generate_session_id() );
return true;
} | php | public function regenerate( $destroy = false ) {
if ( $destroy ) {
$this->handler->destroy( $this->get_id() );
}
$this->set_id( $this->generate_session_id() );
return true;
} | [
"public",
"function",
"regenerate",
"(",
"$",
"destroy",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"destroy",
")",
"{",
"$",
"this",
"->",
"handler",
"->",
"destroy",
"(",
"$",
"this",
"->",
"get_id",
"(",
")",
")",
";",
"}",
"$",
"this",
"->",
"se... | Generate a new session identifier.
@param bool $destroy Destroy current session.
@return bool | [
"Generate",
"a",
"new",
"session",
"identifier",
"."
] | 4819c6392a0dbcbbf547027b70d5af88e7a89d61 | https://github.com/awethemes/wp-session/blob/4819c6392a0dbcbbf547027b70d5af88e7a89d61/src/Store.php#L387-L395 |
15,388 | awethemes/wp-session | src/Store.php | Store.set_id | public function set_id( $id ) {
$this->id = $this->is_valid_id( $id ) ? $id : $this->generate_session_id();
} | php | public function set_id( $id ) {
$this->id = $this->is_valid_id( $id ) ? $id : $this->generate_session_id();
} | [
"public",
"function",
"set_id",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"$",
"this",
"->",
"is_valid_id",
"(",
"$",
"id",
")",
"?",
"$",
"id",
":",
"$",
"this",
"->",
"generate_session_id",
"(",
")",
";",
"}"
] | Set the session ID.
@param string $id A valid session ID.
@return void | [
"Set",
"the",
"session",
"ID",
"."
] | 4819c6392a0dbcbbf547027b70d5af88e7a89d61 | https://github.com/awethemes/wp-session/blob/4819c6392a0dbcbbf547027b70d5af88e7a89d61/src/Store.php#L449-L451 |
15,389 | awethemes/wp-session | src/Store.php | Store.generate_session_id | protected function generate_session_id() {
$length = 40;
require_once ABSPATH . 'wp-includes/class-phpass.php';
$bytes = ( new \PasswordHash( 8, false ) )->get_random_bytes( $length * 2 );
return substr( str_replace( [ '/', '+', '=' ], '', base64_encode( $bytes ) ), 0, $length );
} | php | protected function generate_session_id() {
$length = 40;
require_once ABSPATH . 'wp-includes/class-phpass.php';
$bytes = ( new \PasswordHash( 8, false ) )->get_random_bytes( $length * 2 );
return substr( str_replace( [ '/', '+', '=' ], '', base64_encode( $bytes ) ), 0, $length );
} | [
"protected",
"function",
"generate_session_id",
"(",
")",
"{",
"$",
"length",
"=",
"40",
";",
"require_once",
"ABSPATH",
".",
"'wp-includes/class-phpass.php'",
";",
"$",
"bytes",
"=",
"(",
"new",
"\\",
"PasswordHash",
"(",
"8",
",",
"false",
")",
")",
"->",
... | Get a new, random session ID.
@return string | [
"Get",
"a",
"new",
"random",
"session",
"ID",
"."
] | 4819c6392a0dbcbbf547027b70d5af88e7a89d61 | https://github.com/awethemes/wp-session/blob/4819c6392a0dbcbbf547027b70d5af88e7a89d61/src/Store.php#L468-L475 |
15,390 | drunomics/service-utils | src/Core/Routing/CurrentRouteMatchTrait.php | CurrentRouteMatchTrait.getCurrentRouteMatch | public function getCurrentRouteMatch() {
if (empty($this->currentRouteMatch)) {
$this->currentRouteMatch = \Drupal::service('current_route_match');
}
return $this->currentRouteMatch;
} | php | public function getCurrentRouteMatch() {
if (empty($this->currentRouteMatch)) {
$this->currentRouteMatch = \Drupal::service('current_route_match');
}
return $this->currentRouteMatch;
} | [
"public",
"function",
"getCurrentRouteMatch",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"currentRouteMatch",
")",
")",
"{",
"$",
"this",
"->",
"currentRouteMatch",
"=",
"\\",
"Drupal",
"::",
"service",
"(",
"'current_route_match'",
")",
";",... | Gets the current route match.
@return \Drupal\Core\Routing\ResettableStackedRouteMatchInterface
The alias manager. | [
"Gets",
"the",
"current",
"route",
"match",
"."
] | 56761750043132365ef4ae5d9e0cf4263459328f | https://github.com/drunomics/service-utils/blob/56761750043132365ef4ae5d9e0cf4263459328f/src/Core/Routing/CurrentRouteMatchTrait.php#L38-L43 |
15,391 | crossjoin/Css | src/Crossjoin/Css/Reader/CssString.php | CssString.setCssContent | protected function setCssContent($cssContent)
{
if (is_string($cssContent)) {
$this->content = $cssContent;
} else {
throw new \InvalidArgumentException(
"Invalid type '" . gettype($cssContent). "' for argument 'cssContent' given."
);
}
... | php | protected function setCssContent($cssContent)
{
if (is_string($cssContent)) {
$this->content = $cssContent;
} else {
throw new \InvalidArgumentException(
"Invalid type '" . gettype($cssContent). "' for argument 'cssContent' given."
);
}
... | [
"protected",
"function",
"setCssContent",
"(",
"$",
"cssContent",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"cssContent",
")",
")",
"{",
"$",
"this",
"->",
"content",
"=",
"$",
"cssContent",
";",
"}",
"else",
"{",
"throw",
"new",
"\\",
"InvalidArgument... | Sets the CSS source content.
@param string $cssContent
@return $this | [
"Sets",
"the",
"CSS",
"source",
"content",
"."
] | 7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3 | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Reader/CssString.php#L26-L37 |
15,392 | rinvex/obsolete-module | src/Module.php | Module.migrate | protected function migrate()
{
if (! $this->container['migrator']->repositoryExists()) {
throw new Exception('Migration table not found.');
}
$this->container['migrator']->run($this->getAttribute('path').'/database/migrations');
} | php | protected function migrate()
{
if (! $this->container['migrator']->repositoryExists()) {
throw new Exception('Migration table not found.');
}
$this->container['migrator']->run($this->getAttribute('path').'/database/migrations');
} | [
"protected",
"function",
"migrate",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"[",
"'migrator'",
"]",
"->",
"repositoryExists",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Migration table not found.'",
")",
";",
"}",
"$",
... | Execute module migrations.
@throws \Exception
@return void | [
"Execute",
"module",
"migrations",
"."
] | 95e372ae97ecbe7071c3da397b0afd57f327361f | https://github.com/rinvex/obsolete-module/blob/95e372ae97ecbe7071c3da397b0afd57f327361f/src/Module.php#L160-L167 |
15,393 | rinvex/obsolete-module | src/Module.php | Module.rollback | protected function rollback()
{
if (! $this->container['migrator']->repositoryExists()) {
throw new Exception('Migration table not found.');
}
$this->container['migrator']->rollback($this->getAttribute('path').'/database/migrations');
} | php | protected function rollback()
{
if (! $this->container['migrator']->repositoryExists()) {
throw new Exception('Migration table not found.');
}
$this->container['migrator']->rollback($this->getAttribute('path').'/database/migrations');
} | [
"protected",
"function",
"rollback",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"[",
"'migrator'",
"]",
"->",
"repositoryExists",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Migration table not found.'",
")",
";",
"}",
"$",
... | Rollback module migrations.
@throws \Exception
@return void | [
"Rollback",
"module",
"migrations",
"."
] | 95e372ae97ecbe7071c3da397b0afd57f327361f | https://github.com/rinvex/obsolete-module/blob/95e372ae97ecbe7071c3da397b0afd57f327361f/src/Module.php#L176-L183 |
15,394 | rinvex/obsolete-module | src/Module.php | Module.seed | protected function seed()
{
$seederFilePath = $this->getAttribute('path').'/database/seeds/DatabaseSeeder.php';
if ($this->container['files']->exists($seederFilePath)) {
require_once $seederFilePath;
$namespace = $this->getAttribute('namespace').'Database\\Seeds\\DatabaseSe... | php | protected function seed()
{
$seederFilePath = $this->getAttribute('path').'/database/seeds/DatabaseSeeder.php';
if ($this->container['files']->exists($seederFilePath)) {
require_once $seederFilePath;
$namespace = $this->getAttribute('namespace').'Database\\Seeds\\DatabaseSe... | [
"protected",
"function",
"seed",
"(",
")",
"{",
"$",
"seederFilePath",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'path'",
")",
".",
"'/database/seeds/DatabaseSeeder.php'",
";",
"if",
"(",
"$",
"this",
"->",
"container",
"[",
"'files'",
"]",
"->",
"exists... | Seed the database with module seeders.
@return void | [
"Seed",
"the",
"database",
"with",
"module",
"seeders",
"."
] | 95e372ae97ecbe7071c3da397b0afd57f327361f | https://github.com/rinvex/obsolete-module/blob/95e372ae97ecbe7071c3da397b0afd57f327361f/src/Module.php#L190-L203 |
15,395 | acasademont/wurfl | WURFL/Request/GenericRequest.php | WURFL_Request_GenericRequest.getOriginalHeader | public function getOriginalHeader($name)
{
return array_key_exists($name, $this->_request)? $this->_request[$name]: null;
} | php | public function getOriginalHeader($name)
{
return array_key_exists($name, $this->_request)? $this->_request[$name]: null;
} | [
"public",
"function",
"getOriginalHeader",
"(",
"$",
"name",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"_request",
")",
"?",
"$",
"this",
"->",
"_request",
"[",
"$",
"name",
"]",
":",
"null",
";",
"}"
] | Get the original HTTP header value from the request
@param string $name
@return string | [
"Get",
"the",
"original",
"HTTP",
"header",
"value",
"from",
"the",
"request"
] | 0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2 | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Request/GenericRequest.php#L97-L100 |
15,396 | chris-schmitz/L5SimpleFM | src/L5SimpleFMBase.php | L5SimpleFMBase.primeCommandArray | protected function primeCommandArray()
{
if (empty($this->layoutName)) {
throw new LayoutNameIsMissingException('You must specify a layout name.');
}
$this->commandArray['-db'] = $this->adapter->getHostConnection()->getDbName();
$this->commandArray['-lay'] = $this->layout... | php | protected function primeCommandArray()
{
if (empty($this->layoutName)) {
throw new LayoutNameIsMissingException('You must specify a layout name.');
}
$this->commandArray['-db'] = $this->adapter->getHostConnection()->getDbName();
$this->commandArray['-lay'] = $this->layout... | [
"protected",
"function",
"primeCommandArray",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"layoutName",
")",
")",
"{",
"throw",
"new",
"LayoutNameIsMissingException",
"(",
"'You must specify a layout name.'",
")",
";",
"}",
"$",
"this",
"->",
"c... | Adds the default url parameters needed for any request.
@return none | [
"Adds",
"the",
"default",
"url",
"parameters",
"needed",
"for",
"any",
"request",
"."
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFMBase.php#L39-L46 |
15,397 | chris-schmitz/L5SimpleFM | src/L5SimpleFMBase.php | L5SimpleFMBase.addToCommandArray | protected function addToCommandArray($values)
{
foreach ($values as $key => $value) {
$this->commandArray[$key] = $value;
}
} | php | protected function addToCommandArray($values)
{
foreach ($values as $key => $value) {
$this->commandArray[$key] = $value;
}
} | [
"protected",
"function",
"addToCommandArray",
"(",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"commandArray",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}",
"}"
] | Adds additional Url parameters to the request.
@param array An associative array of url keys and values.
These are normally fields => values or additional FM XML flags => null | [
"Adds",
"additional",
"Url",
"parameters",
"to",
"the",
"request",
"."
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFMBase.php#L54-L59 |
15,398 | chris-schmitz/L5SimpleFM | src/L5SimpleFMBase.php | L5SimpleFMBase.executeCommand | public function executeCommand()
{
$this->adapter->setCommandArray($this->commandArray);
$result = $this->adapter->execute();
$commandArrayUsed = $this->adapter->getCommandArray();
$this->clearCommandArray();
$this->checkResultForError($result, $commandArrayUsed);
ret... | php | public function executeCommand()
{
$this->adapter->setCommandArray($this->commandArray);
$result = $this->adapter->execute();
$commandArrayUsed = $this->adapter->getCommandArray();
$this->clearCommandArray();
$this->checkResultForError($result, $commandArrayUsed);
ret... | [
"public",
"function",
"executeCommand",
"(",
")",
"{",
"$",
"this",
"->",
"adapter",
"->",
"setCommandArray",
"(",
"$",
"this",
"->",
"commandArray",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"adapter",
"->",
"execute",
"(",
")",
";",
"$",
"comm... | Performs the steps necessary to execute a SimpleFM query.
@return object The SimpleFM result Object | [
"Performs",
"the",
"steps",
"necessary",
"to",
"execute",
"a",
"SimpleFM",
"query",
"."
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFMBase.php#L77-L85 |
15,399 | chris-schmitz/L5SimpleFM | src/L5SimpleFMBase.php | L5SimpleFMBase.checkResultForError | protected function checkResultForError($result, $commandArrayUsed)
{
if (empty($result)) {
throw new NoResultReturnedException('The SimpleFM request did not return a result.');
}
if ($result->getErrorCode() == 401) {
throw new RecordsNotFoundException($result->getErro... | php | protected function checkResultForError($result, $commandArrayUsed)
{
if (empty($result)) {
throw new NoResultReturnedException('The SimpleFM request did not return a result.');
}
if ($result->getErrorCode() == 401) {
throw new RecordsNotFoundException($result->getErro... | [
"protected",
"function",
"checkResultForError",
"(",
"$",
"result",
",",
"$",
"commandArrayUsed",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"result",
")",
")",
"{",
"throw",
"new",
"NoResultReturnedException",
"(",
"'The SimpleFM request did not return a result.'",
")... | Parses the SimpleFM result and determines if a FileMaker error was thrown.
@param object A SimpleFM result object
@return none | [
"Parses",
"the",
"SimpleFM",
"result",
"and",
"determines",
"if",
"a",
"FileMaker",
"error",
"was",
"thrown",
"."
] | 9c3250e0918184d537a46c15140f15527e833a4c | https://github.com/chris-schmitz/L5SimpleFM/blob/9c3250e0918184d537a46c15140f15527e833a4c/src/L5SimpleFMBase.php#L93-L105 |
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.