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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
225,300 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.asText | public function asText(StringLength $length = null, array $allowedTags = [])
{
return $this->handleFilter(
function() use($length, $allowedTags)
{
$textFilter = new filter\TextFilter();
return filter\RangeFilter::wrap(
... | php | public function asText(StringLength $length = null, array $allowedTags = [])
{
return $this->handleFilter(
function() use($length, $allowedTags)
{
$textFilter = new filter\TextFilter();
return filter\RangeFilter::wrap(
... | [
"public",
"function",
"asText",
"(",
"StringLength",
"$",
"length",
"=",
"null",
",",
"array",
"$",
"allowedTags",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"handleFilter",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"length",
",",
"$",
"... | read as text value
@api
@param \stubbles\input\filter\range\StringLength $length optional allowed length of text
@param string[] $allowedTags optional list of allowed tags
@return string | [
"read",
"as",
"text",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L264-L276 |
225,301 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.asJson | public function asJson(int $maxLength = filter\JsonFilter::DEFAULT_MAX_LENGTH)
{
return $this->withFilter(new filter\JsonFilter($maxLength));
} | php | public function asJson(int $maxLength = filter\JsonFilter::DEFAULT_MAX_LENGTH)
{
return $this->withFilter(new filter\JsonFilter($maxLength));
} | [
"public",
"function",
"asJson",
"(",
"int",
"$",
"maxLength",
"=",
"filter",
"\\",
"JsonFilter",
"::",
"DEFAULT_MAX_LENGTH",
")",
"{",
"return",
"$",
"this",
"->",
"withFilter",
"(",
"new",
"filter",
"\\",
"JsonFilter",
"(",
"$",
"maxLength",
")",
")",
";"... | read as json value
@api
@param int $maxLength maximum allowed length of incoming JSON document in bytes optional
@return \stdClass|array | [
"read",
"as",
"json",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L285-L288 |
225,302 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.asHttpUri | public function asHttpUri()
{
if ($this->value->isEmpty()) {
return null;
}
if ($this->value->isHttpUri()) {
return HttpUri::fromString($this->value->value());
}
$this->paramErrors->append($this->paramName, 'HTTP_URI_INCORRECT');
r... | php | public function asHttpUri()
{
if ($this->value->isEmpty()) {
return null;
}
if ($this->value->isHttpUri()) {
return HttpUri::fromString($this->value->value());
}
$this->paramErrors->append($this->paramName, 'HTTP_URI_INCORRECT');
r... | [
"public",
"function",
"asHttpUri",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isHttpUri",
"(",
")",
")",
"{",
"return",
"Htt... | read as http uri
Return value is null in the following cases:
- Given param value is null or empty string.
- Given param value contains an invalid http uri.
In all other cases an instance of stubbles\peer\http\HttpUri is returned.
@api
@return \stubbles\peer\http\HttpUri | [
"read",
"as",
"http",
"uri"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L313-L325 |
225,303 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.asExistingHttpUri | public function asExistingHttpUri(callable $checkdnsrr = null)
{
$httpUri = $this->asHttpUri();
if (null === $httpUri) {
return null;
}
if ($httpUri->hasDnsRecord($checkdnsrr)) {
return $httpUri;
}
$this->paramErrors->append($this-... | php | public function asExistingHttpUri(callable $checkdnsrr = null)
{
$httpUri = $this->asHttpUri();
if (null === $httpUri) {
return null;
}
if ($httpUri->hasDnsRecord($checkdnsrr)) {
return $httpUri;
}
$this->paramErrors->append($this-... | [
"public",
"function",
"asExistingHttpUri",
"(",
"callable",
"$",
"checkdnsrr",
"=",
"null",
")",
"{",
"$",
"httpUri",
"=",
"$",
"this",
"->",
"asHttpUri",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"httpUri",
")",
"{",
"return",
"null",
";",
"}",
... | read as http uri if it does exist
Return value is null in the following cases:
- Given param value is null or empty string.
- Given param value contains an invalid http uri.
- Given http uri doesn't have a DNS record but DNS record is enforced.
In all other cases an instance of stubbles\peer\http\HttpUri is returned.
... | [
"read",
"as",
"http",
"uri",
"if",
"it",
"does",
"exist"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L340-L353 |
225,304 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.ifIsIpAddress | public function ifIsIpAddress()
{
if ($this->value->isIpAddress()) {
return $this->value->value();
}
$this->paramErrors->append($this->paramName, 'INVALID_IP_ADDRESS');
return null;
} | php | public function ifIsIpAddress()
{
if ($this->value->isIpAddress()) {
return $this->value->value();
}
$this->paramErrors->append($this->paramName, 'INVALID_IP_ADDRESS');
return null;
} | [
"public",
"function",
"ifIsIpAddress",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isIpAddress",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"value",
"->",
"value",
"(",
")",
";",
"}",
"$",
"this",
"->",
"paramErrors",
"->",
"... | returns value if it is an ip address, and null otherwise
@api
@return string | [
"returns",
"value",
"if",
"it",
"is",
"an",
"ip",
"address",
"and",
"null",
"otherwise"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L475-L483 |
225,305 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.ifIsOneOf | public function ifIsOneOf(array $allowedValues)
{
if ($this->value->isOneOf($allowedValues)) {
return $this->value->value();
}
$this->paramErrors->append(
$this->paramName,
'FIELD_NO_SELECT',
['ALLOWED' => join('|', $allow... | php | public function ifIsOneOf(array $allowedValues)
{
if ($this->value->isOneOf($allowedValues)) {
return $this->value->value();
}
$this->paramErrors->append(
$this->paramName,
'FIELD_NO_SELECT',
['ALLOWED' => join('|', $allow... | [
"public",
"function",
"ifIsOneOf",
"(",
"array",
"$",
"allowedValues",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isOneOf",
"(",
"$",
"allowedValues",
")",
")",
"{",
"return",
"$",
"this",
"->",
"value",
"->",
"value",
"(",
")",
";",
"}"... | returns value if it is an allowed value according to list of allowed values, and null otherwise
@api
@param string[] $allowedValues list of allowed values
@return string | [
"returns",
"value",
"if",
"it",
"is",
"an",
"allowed",
"value",
"according",
"to",
"list",
"of",
"allowed",
"values",
"and",
"null",
"otherwise"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L492-L504 |
225,306 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.ifMatches | public function ifMatches(string $regex)
{
if ($this->value->isMatchedBy($regex)) {
return $this->value->value();
}
$this->paramErrors->append($this->paramName, 'FIELD_WRONG_VALUE');
return null;
} | php | public function ifMatches(string $regex)
{
if ($this->value->isMatchedBy($regex)) {
return $this->value->value();
}
$this->paramErrors->append($this->paramName, 'FIELD_WRONG_VALUE');
return null;
} | [
"public",
"function",
"ifMatches",
"(",
"string",
"$",
"regex",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isMatchedBy",
"(",
"$",
"regex",
")",
")",
"{",
"return",
"$",
"this",
"->",
"value",
"->",
"value",
"(",
")",
";",
"}",
"$",
... | returns value if it is matched by given regular expression
@api
@param string $regex regular expression to apply
@return string
@since 6.0.0 | [
"returns",
"value",
"if",
"it",
"is",
"matched",
"by",
"given",
"regular",
"expression"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L514-L522 |
225,307 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.when | public function when(callable $predicate, string $errorId, array $details = [])
{
return $this->handleFilter(
function() use($predicate, $errorId, $details)
{
return new filter\PredicateFilter($predicate, $errorId, $details);
}
... | php | public function when(callable $predicate, string $errorId, array $details = [])
{
return $this->handleFilter(
function() use($predicate, $errorId, $details)
{
return new filter\PredicateFilter($predicate, $errorId, $details);
}
... | [
"public",
"function",
"when",
"(",
"callable",
"$",
"predicate",
",",
"string",
"$",
"errorId",
",",
"array",
"$",
"details",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"handleFilter",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"predicate",... | returns param value when given predicate evaluates to true
If value does not satisfy the predicate return value will be null.
@api
@param callable $predicate predicate to use
@param string $errorId error id to be used in case validation fails
@param array $details optional details for param erro... | [
"returns",
"param",
"value",
"when",
"given",
"predicate",
"evaluates",
"to",
"true"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L536-L544 |
225,308 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.handleFilter | private function handleFilter(\Closure $createFilter)
{
if ($this->value->isNull()) {
return null;
}
return $this->applyFilter($createFilter());
} | php | private function handleFilter(\Closure $createFilter)
{
if ($this->value->isNull()) {
return null;
}
return $this->applyFilter($createFilter());
} | [
"private",
"function",
"handleFilter",
"(",
"\\",
"Closure",
"$",
"createFilter",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"applyFilter",
"(",
"$",
"... | handles a filter
@param \Closure $createFilter
@return mixed | [
"handles",
"a",
"filter"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L570-L577 |
225,309 | stubbles/stubbles-input | src/main/php/ValueReader.php | ValueReader.withCallable | public function withCallable(callable $filter)
{
if ($this->value->isNull()) {
return null;
}
return $this->applyFilter(new filter\WrapCallableFilter($filter));
} | php | public function withCallable(callable $filter)
{
if ($this->value->isNull()) {
return null;
}
return $this->applyFilter(new filter\WrapCallableFilter($filter));
} | [
"public",
"function",
"withCallable",
"(",
"callable",
"$",
"filter",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"->",
"isNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"applyFilter",
"(",
"new",
"filter",
"... | checks value with given callable
The callable must accept an instance of stubbles\input\Param and
return the filtered value. It can add errors to the provided param when
the param value is not satisfying.
<code>
$result = $request->readParam('name')->withCallable(
function(Value $value, array &$errors)
{
if ($value->e... | [
"checks",
"value",
"with",
"given",
"callable"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/ValueReader.php#L626-L633 |
225,310 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderPDO.php | AppenderPDO.activateOptions | public function activateOptions() {
try {
$this->establishConnection();
} catch (\PDOException $e) {
$this->warn("Failed connecting to database. Closing appender. Error: " . $e->getMessage());
$this->close();
return;
}
// Parse the insert patterns; pattern parts are comma delimited
$pie... | php | public function activateOptions() {
try {
$this->establishConnection();
} catch (\PDOException $e) {
$this->warn("Failed connecting to database. Closing appender. Error: " . $e->getMessage());
$this->close();
return;
}
// Parse the insert patterns; pattern parts are comma delimited
$pie... | [
"public",
"function",
"activateOptions",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"establishConnection",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"PDOException",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"warn",
"(",
"\"Failed connecting to database. Closin... | Acquires a database connection based on parameters.
Parses the insert pattern to create a chain of converters which will be
used in forming query parameters from logging events. | [
"Acquires",
"a",
"database",
"connection",
"based",
"on",
"parameters",
".",
"Parses",
"the",
"insert",
"pattern",
"to",
"create",
"a",
"chain",
"of",
"converters",
"which",
"will",
"be",
"used",
"in",
"forming",
"query",
"parameters",
"from",
"logging",
"even... | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderPDO.php#L119-L137 |
225,311 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderPDO.php | AppenderPDO.establishConnection | protected function establishConnection() {
// Acquire database connection
$this->db = new \PDO($this->dsn, $this->user, $this->password);
$this->db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
// Prepare the insert statement
$insertSQL = str_replace('__TABLE__', $this->table, $this->in... | php | protected function establishConnection() {
// Acquire database connection
$this->db = new \PDO($this->dsn, $this->user, $this->password);
$this->db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
// Prepare the insert statement
$insertSQL = str_replace('__TABLE__', $this->table, $this->in... | [
"protected",
"function",
"establishConnection",
"(",
")",
"{",
"// Acquire database connection\r",
"$",
"this",
"->",
"db",
"=",
"new",
"\\",
"PDO",
"(",
"$",
"this",
"->",
"dsn",
",",
"$",
"this",
"->",
"user",
",",
"$",
"this",
"->",
"password",
")",
"... | Connects to the database, and prepares the insert query.
@throws PDOException If connect or prepare fails. | [
"Connects",
"to",
"the",
"database",
"and",
"prepares",
"the",
"insert",
"query",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderPDO.php#L143-L151 |
225,312 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderPDO.php | AppenderPDO.append | public function append(\n2n\log4php\logging\LoggingEvent $event) {
for ($attempt = 1; $attempt <= $this->reconnectAttempts + 1; $attempt++) {
try {
// Attempt to write to database
$this->preparedInsert->execute($this->format($event));
$this->preparedInsert->closeCursor();
break;
} catch... | php | public function append(\n2n\log4php\logging\LoggingEvent $event) {
for ($attempt = 1; $attempt <= $this->reconnectAttempts + 1; $attempt++) {
try {
// Attempt to write to database
$this->preparedInsert->execute($this->format($event));
$this->preparedInsert->closeCursor();
break;
} catch... | [
"public",
"function",
"append",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"logging",
"\\",
"LoggingEvent",
"$",
"event",
")",
"{",
"for",
"(",
"$",
"attempt",
"=",
"1",
";",
"$",
"attempt",
"<=",
"$",
"this",
"->",
"reconnectAttempts",
"+",
"1",
";",
... | Appends a new event to the database.
If writing to database fails, it will retry by re-establishing the
connection up to $reconnectAttempts times. If writing still fails,
the appender will close. | [
"Appends",
"a",
"new",
"event",
"to",
"the",
"database",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderPDO.php#L160-L182 |
225,313 | n2n/n2n-log4php | src/app/n2n/log4php/appender/AppenderPDO.php | AppenderPDO.format | protected function format(\n2n\log4php\logging\LoggingEvent $event) {
$params = array();
foreach($this->converters as $converter) {
$buffer = '';
while ($converter !== null) {
$converter->format($buffer, $event);
$converter = $converter->next;
}
$params[] = $buffer;
}
return $param... | php | protected function format(\n2n\log4php\logging\LoggingEvent $event) {
$params = array();
foreach($this->converters as $converter) {
$buffer = '';
while ($converter !== null) {
$converter->format($buffer, $event);
$converter = $converter->next;
}
$params[] = $buffer;
}
return $param... | [
"protected",
"function",
"format",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"logging",
"\\",
"LoggingEvent",
"$",
"event",
")",
"{",
"$",
"params",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"converters",
"as",
"$",
"converter",
")... | Converts the logging event to a series of database parameters by using
the converter chain which was set up on activation. | [
"Converts",
"the",
"logging",
"event",
"to",
"a",
"series",
"of",
"database",
"parameters",
"by",
"using",
"the",
"converter",
"chain",
"which",
"was",
"set",
"up",
"on",
"activation",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/appender/AppenderPDO.php#L188-L199 |
225,314 | UCSLabs/Pagination | src/EfficientPaginator.php | EfficientPaginator.setOrderBy | public function setOrderBy($sort, $direction = 'ASC')
{
$this->sort = $sort;
$this->direction = $direction;
return $this;
} | php | public function setOrderBy($sort, $direction = 'ASC')
{
$this->sort = $sort;
$this->direction = $direction;
return $this;
} | [
"public",
"function",
"setOrderBy",
"(",
"$",
"sort",
",",
"$",
"direction",
"=",
"'ASC'",
")",
"{",
"$",
"this",
"->",
"sort",
"=",
"$",
"sort",
";",
"$",
"this",
"->",
"direction",
"=",
"$",
"direction",
";",
"return",
"$",
"this",
";",
"}"
] | Sets th order by
@param string $sort the sorting property
@param string $direction the direciton ordering property
@return EfficientPaginator This query object. | [
"Sets",
"th",
"order",
"by"
] | 0e26d054f53ecb20960c409322acb565ce30b675 | https://github.com/UCSLabs/Pagination/blob/0e26d054f53ecb20960c409322acb565ce30b675/src/EfficientPaginator.php#L209-L214 |
225,315 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.get | public function get(): array
{
try {
$query = $this->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileSelect($query);
return $this->database->select($compiled->getSQL(), $compiled->getBindings());
} catch (\Throwable $e... | php | public function get(): array
{
try {
$query = $this->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileSelect($query);
return $this->database->select($compiled->getSQL(), $compiled->getBindings());
} catch (\Throwable $e... | [
"public",
"function",
"get",
"(",
")",
":",
"array",
"{",
"try",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"apply",
"(",
"$",
"this",
"->",
"database",
"->",
"getTablePrefixer",
"(",
")",
")",
";",
"$",
"compiled",
"=",
"$",
"this",
"->",
"databas... | Performs a select query and returns the selected rows. Doesn't modify itself.
@return array[] Array of the result rows. Result row is an array indexed by columns.
@throws DatabaseException
@throws IncorrectQueryException | [
"Performs",
"a",
"select",
"query",
"and",
"returns",
"the",
"selected",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L34-L43 |
225,316 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.first | public function first()
{
try {
$query = (clone $this)->limit(1)->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileSelect($query);
return $this->database->selectFirst($compiled->getSQL(), $compiled->getBindings());
} ca... | php | public function first()
{
try {
$query = (clone $this)->limit(1)->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileSelect($query);
return $this->database->selectFirst($compiled->getSQL(), $compiled->getBindings());
} ca... | [
"public",
"function",
"first",
"(",
")",
"{",
"try",
"{",
"$",
"query",
"=",
"(",
"clone",
"$",
"this",
")",
"->",
"limit",
"(",
"1",
")",
"->",
"apply",
"(",
"$",
"this",
"->",
"database",
"->",
"getTablePrefixer",
"(",
")",
")",
";",
"$",
"comp... | Performs a select query and returns the first selected row. Doesn't modify itself.
@return array|null An array indexed by columns. Null if nothing is found.
@throws DatabaseException
@throws IncorrectQueryException | [
"Performs",
"a",
"select",
"query",
"and",
"returns",
"the",
"first",
"selected",
"row",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L52-L61 |
225,317 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.count | public function count($column = '*'): int
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addCount($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | php | public function count($column = '*'): int
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addCount($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | [
"public",
"function",
"count",
"(",
"$",
"column",
"=",
"'*'",
")",
":",
"int",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getAggregate",
"(",
"function",
"(",
"Query",
"$",
"query",
")",
"use",
"(",
"$",
"column",
")",
"{",
"$",
"query",
"->",... | Gets the count of the target rows. Doesn't modify itself.
@param string|\Closure|self|StatementInterface $column Column to count
@return int
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Gets",
"the",
"count",
"of",
"the",
"target",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L73-L82 |
225,318 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.avg | public function avg($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addAvg($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | php | public function avg($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addAvg($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | [
"public",
"function",
"avg",
"(",
"$",
"column",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getAggregate",
"(",
"function",
"(",
"Query",
"$",
"query",
")",
"use",
"(",
"$",
"column",
")",
"{",
"$",
"query",
"->",
"addAvg",
"(",
"$",
"colu... | Gets the average value of the target rows. Doesn't modify itself.
@param string|\Closure|self|StatementInterface $column Column to get average
@return float|null Null is returned when no target row has a value
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentException
@throws InvalidRet... | [
"Gets",
"the",
"average",
"value",
"of",
"the",
"target",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L94-L103 |
225,319 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.sum | public function sum($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addSum($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | php | public function sum($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addSum($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | [
"public",
"function",
"sum",
"(",
"$",
"column",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getAggregate",
"(",
"function",
"(",
"Query",
"$",
"query",
")",
"use",
"(",
"$",
"column",
")",
"{",
"$",
"query",
"->",
"addSum",
"(",
"$",
"colu... | Gets the sum of the target rows. Doesn't modify itself.
@param string|\Closure|self|StatementInterface $column Column to get sum
@return float|null Null is returned when no target row has a value
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentException
@throws InvalidReturnValueExcept... | [
"Gets",
"the",
"sum",
"of",
"the",
"target",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L115-L124 |
225,320 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.min | public function min($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addMin($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | php | public function min($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addMin($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | [
"public",
"function",
"min",
"(",
"$",
"column",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getAggregate",
"(",
"function",
"(",
"Query",
"$",
"query",
")",
"use",
"(",
"$",
"column",
")",
"{",
"$",
"query",
"->",
"addMin",
"(",
"$",
"colu... | Gets the minimum value of the target rows. Doesn't modify itself.
@param string|\Closure|self|StatementInterface $column Column to get minimum
@return float|null Null is returned when no target row has a value
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentException
@throws InvalidRet... | [
"Gets",
"the",
"minimum",
"value",
"of",
"the",
"target",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L136-L145 |
225,321 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.max | public function max($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addMax($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | php | public function max($column)
{
try {
return $this->getAggregate(function (Query $query) use ($column) {
$query->addMax($column);
});
} catch (\Throwable $exception) {
return $this->handleException($exception);
}
} | [
"public",
"function",
"max",
"(",
"$",
"column",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getAggregate",
"(",
"function",
"(",
"Query",
"$",
"query",
")",
"use",
"(",
"$",
"column",
")",
"{",
"$",
"query",
"->",
"addMax",
"(",
"$",
"colu... | Gets the maximum value of the target rows. Doesn't modify itself.
@param string|\Closure|self|StatementInterface $column Column to get maximum
@return float|null Null is returned when no target row has a value
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentException
@throws InvalidRet... | [
"Gets",
"the",
"maximum",
"value",
"of",
"the",
"target",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L157-L166 |
225,322 | Finesse/MiniDB | src/Parts/SelectTrait.php | SelectTrait.chunk | public function chunk(int $size, callable $callback)
{
if ($size <= 0) {
$this->handleException(new InvalidArgumentException('Chunk size must be greater than zero'));
}
// A copy is made not to mutate this query
$query = clone $this;
for ($offset = 0;; $offset +... | php | public function chunk(int $size, callable $callback)
{
if ($size <= 0) {
$this->handleException(new InvalidArgumentException('Chunk size must be greater than zero'));
}
// A copy is made not to mutate this query
$query = clone $this;
for ($offset = 0;; $offset +... | [
"public",
"function",
"chunk",
"(",
"int",
"$",
"size",
",",
"callable",
"$",
"callback",
")",
"{",
"if",
"(",
"$",
"size",
"<=",
"0",
")",
"{",
"$",
"this",
"->",
"handleException",
"(",
"new",
"InvalidArgumentException",
"(",
"'Chunk size must be greater t... | Walks large amount of rows calling a callback on small portions of rows. Doesn't modify itself.
@param int $size Number of rows per callback call
@param callable $callback The callback. Receives an array of rows as the first argument.
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentExc... | [
"Walks",
"large",
"amount",
"of",
"rows",
"calling",
"a",
"callback",
"on",
"small",
"portions",
"of",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Parts/SelectTrait.php#L177-L198 |
225,323 | yawik/behat | src/UserContext.php | UserContext.tearDown | public static function tearDown()
{
$dm = static::$dm;
if (is_null($dm)) {
return;
}
$documents = [
'Applications\Entity\Application',
'Cv\Entity\Cv',
'Jobs\Entity\Job',
'Organizations\Entity\Organization',
'Au... | php | public static function tearDown()
{
$dm = static::$dm;
if (is_null($dm)) {
return;
}
$documents = [
'Applications\Entity\Application',
'Cv\Entity\Cv',
'Jobs\Entity\Job',
'Organizations\Entity\Organization',
'Au... | [
"public",
"static",
"function",
"tearDown",
"(",
")",
"{",
"$",
"dm",
"=",
"static",
"::",
"$",
"dm",
";",
"if",
"(",
"is_null",
"(",
"$",
"dm",
")",
")",
"{",
"return",
";",
"}",
"$",
"documents",
"=",
"[",
"'Applications\\Entity\\Application'",
",",
... | Empty all data every each tests
@AfterSuite | [
"Empty",
"all",
"data",
"every",
"each",
"tests"
] | 9e776b8aa8a069da13e35d717f7bb35c2f96b277 | https://github.com/yawik/behat/blob/9e776b8aa8a069da13e35d717f7bb35c2f96b277/src/UserContext.php#L87-L115 |
225,324 | stubbles/stubbles-input | src/main/php/filter/PasswordFilter.php | PasswordFilter.parse | private function parse($value): array
{
if (is_array($value)) {
if ($value[0] !== $value[1]) {
return $this->error('PASSWORDS_NOT_EQUAL');
}
$value = $value[0];
}
if (empty($value) === 0) {
return [null, []];
}
... | php | private function parse($value): array
{
if (is_array($value)) {
if ($value[0] !== $value[1]) {
return $this->error('PASSWORDS_NOT_EQUAL');
}
$value = $value[0];
}
if (empty($value) === 0) {
return [null, []];
}
... | [
"private",
"function",
"parse",
"(",
"$",
"value",
")",
":",
"array",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"$",
"value",
"[",
"0",
"]",
"!==",
"$",
"value",
"[",
"1",
"]",
")",
"{",
"return",
"$",
"this",
"... | parses password from given param value
@param string|array $value
@return array | [
"parses",
"password",
"from",
"given",
"param",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/PasswordFilter.php#L78-L93 |
225,325 | SetBased/php-abc-form | src/Cleaner/UrlCleaner.php | UrlCleaner.clean | public function clean($value)
{
// First prune whitespace.
$cleaner = PruneWhitespaceCleaner::get();
$value = $cleaner->clean($value);
// If the value is empty return immediately,
if ($value==='' || $value===null || $value===false)
{
return null;
}
// Split the URL in parts.
... | php | public function clean($value)
{
// First prune whitespace.
$cleaner = PruneWhitespaceCleaner::get();
$value = $cleaner->clean($value);
// If the value is empty return immediately,
if ($value==='' || $value===null || $value===false)
{
return null;
}
// Split the URL in parts.
... | [
"public",
"function",
"clean",
"(",
"$",
"value",
")",
"{",
"// First prune whitespace.",
"$",
"cleaner",
"=",
"PruneWhitespaceCleaner",
"::",
"get",
"(",
")",
";",
"$",
"value",
"=",
"$",
"cleaner",
"->",
"clean",
"(",
"$",
"value",
")",
";",
"// If the v... | Returns a normalized URL if the submitted value is a URL. Otherwise returns the submitted value.
@param string|null $value The submitted URL.
@return string|null
@since 1.0.0
@api | [
"Returns",
"a",
"normalized",
"URL",
"if",
"the",
"submitted",
"value",
"is",
"a",
"URL",
".",
"Otherwise",
"returns",
"the",
"submitted",
"value",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Cleaner/UrlCleaner.php#L45-L65 |
225,326 | railken/amethyst-exporter | src/Managers/ExporterManager.php | ExporterManager.generate | public function generate(Exporter $exporter, array $data = [])
{
$result = (new DataBuilderManager())->validateRaw($exporter->data_builder, $data);
if (!$result->ok()) {
return $result;
}
// We assume this class exists.
$className = $exporter->class_name;
... | php | public function generate(Exporter $exporter, array $data = [])
{
$result = (new DataBuilderManager())->validateRaw($exporter->data_builder, $data);
if (!$result->ok()) {
return $result;
}
// We assume this class exists.
$className = $exporter->class_name;
... | [
"public",
"function",
"generate",
"(",
"Exporter",
"$",
"exporter",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"(",
"new",
"DataBuilderManager",
"(",
")",
")",
"->",
"validateRaw",
"(",
"$",
"exporter",
"->",
"data_builder",
... | Request a exporter.
@param Exporter $exporter
@param array $data
@return \Railken\Lem\Contracts\ResultContract | [
"Request",
"a",
"exporter",
"."
] | ee3ef85f2364d52a76e2e08b6344960892515b94 | https://github.com/railken/amethyst-exporter/blob/ee3ef85f2364d52a76e2e08b6344960892515b94/src/Managers/ExporterManager.php#L26-L44 |
225,327 | SetBased/php-abc-form | src/Formatter/DateFormatter.php | DateFormatter.format | public function format($value)
{
if ($value===null) return null;
$match = preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value, $parts);
$valid = ($match && checkdate((int)$parts[2], (int)$parts[3], (int)$parts[1]));
if ($valid)
{
if ($value===$this->openDate) return '';
$date = new ... | php | public function format($value)
{
if ($value===null) return null;
$match = preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value, $parts);
$valid = ($match && checkdate((int)$parts[2], (int)$parts[3], (int)$parts[1]));
if ($valid)
{
if ($value===$this->openDate) return '';
$date = new ... | [
"public",
"function",
"format",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"return",
"null",
";",
"$",
"match",
"=",
"preg_match",
"(",
"'/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/'",
",",
"$",
"value",
",",
"$",
"parts",
")",
";",... | If the machine value is a valid date returns the date formatted according the format specifier. Otherwise,
returns the machine value unchanged.
@param string|null $value The machine value.
@return string|null
@since 1.0.0
@api | [
"If",
"the",
"machine",
"value",
"is",
"a",
"valid",
"date",
"returns",
"the",
"date",
"formatted",
"according",
"the",
"format",
"specifier",
".",
"Otherwise",
"returns",
"the",
"machine",
"value",
"unchanged",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Formatter/DateFormatter.php#L52-L68 |
225,328 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.parse | public function parse($input) {
// No input - use default configuration
if (!isset($input)) {
$config = self::$defaultConfiguration;
}
// Array input - contains configuration within the array
else if (is_array($input)) {
$config = $input;
}
// String input - contains path to configu... | php | public function parse($input) {
// No input - use default configuration
if (!isset($input)) {
$config = self::$defaultConfiguration;
}
// Array input - contains configuration within the array
else if (is_array($input)) {
$config = $input;
}
// String input - contains path to configu... | [
"public",
"function",
"parse",
"(",
"$",
"input",
")",
"{",
"// No input - use default configuration\r",
"if",
"(",
"!",
"isset",
"(",
"$",
"input",
")",
")",
"{",
"$",
"config",
"=",
"self",
"::",
"$",
"defaultConfiguration",
";",
"}",
"// Array input - conta... | Parses the given configuration and returns the parsed configuration
as a PHP array. Does not perform any configuration.
If no configuration is given, or if the given configuration cannot be
parsed for whatever reason, a warning will be issued, and the default
configuration will be returned ({@link $defaultConfiguratio... | [
"Parses",
"the",
"given",
"configuration",
"and",
"returns",
"the",
"parsed",
"configuration",
"as",
"a",
"PHP",
"array",
".",
"Does",
"not",
"perform",
"any",
"configuration",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L101-L129 |
225,329 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.parseFile | private function parseFile($url) {
if (!file_exists($url)) {
throw new \n2n\log4php\LoggerException("File not found at [$url].");
}
$type = $this->getConfigType($url);
$adapterClass = $this->adapters[$type];
$adapter = new $adapterClass();
return $adapter->convert($url);
} | php | private function parseFile($url) {
if (!file_exists($url)) {
throw new \n2n\log4php\LoggerException("File not found at [$url].");
}
$type = $this->getConfigType($url);
$adapterClass = $this->adapters[$type];
$adapter = new $adapterClass();
return $adapter->convert($url);
} | [
"private",
"function",
"parseFile",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"url",
")",
")",
"{",
"throw",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerException",
"(",
"\"File not found at [$url].\"",
")",
";",
"}",
"$",... | Loads the configuration file from the given URL, determines which
adapter to use, converts the configuration to a PHP array and
returns it.
@param string $url Path to the config file.
@return The configuration from the config file, as a PHP array.
@throws \n2n\log4php\LoggerException If the configuration file cannot b... | [
"Loads",
"the",
"configuration",
"file",
"from",
"the",
"given",
"URL",
"determines",
"which",
"adapter",
"to",
"use",
"converts",
"the",
"configuration",
"to",
"a",
"PHP",
"array",
"and",
"returns",
"it",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L149-L160 |
225,330 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.getConfigType | private function getConfigType($url) {
$info = pathinfo($url);
$ext = strtolower($info['extension']);
switch($ext) {
case 'xml':
return self::FORMAT_XML;
case 'ini':
case 'properties':
return self::FORMAT_INI;
case 'php':
return self::FORMAT_PHP;
default:
... | php | private function getConfigType($url) {
$info = pathinfo($url);
$ext = strtolower($info['extension']);
switch($ext) {
case 'xml':
return self::FORMAT_XML;
case 'ini':
case 'properties':
return self::FORMAT_INI;
case 'php':
return self::FORMAT_PHP;
default:
... | [
"private",
"function",
"getConfigType",
"(",
"$",
"url",
")",
"{",
"$",
"info",
"=",
"pathinfo",
"(",
"$",
"url",
")",
";",
"$",
"ext",
"=",
"strtolower",
"(",
"$",
"info",
"[",
"'extension'",
"]",
")",
";",
"switch",
"(",
"$",
"ext",
")",
"{",
"... | Determines configuration file type based on the file extension. | [
"Determines",
"configuration",
"file",
"type",
"based",
"on",
"the",
"file",
"extension",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L163-L181 |
225,331 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.doConfigure | private function doConfigure(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
if (isset($config['threshold'])) {
$threshold = \n2n\log4php\LoggerLevel::toLevel($config['threshold']);
if (isset($threshold)) {
$hierarchy->setThreshold($threshold);
} else {
$this->warn("Invalid threshold value ... | php | private function doConfigure(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
if (isset($config['threshold'])) {
$threshold = \n2n\log4php\LoggerLevel::toLevel($config['threshold']);
if (isset($threshold)) {
$hierarchy->setThreshold($threshold);
} else {
$this->warn("Invalid threshold value ... | [
"private",
"function",
"doConfigure",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerHierarchy",
"$",
"hierarchy",
",",
"$",
"config",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'threshold'",
"]",
")",
")",
"{",
"$",
"threshold",
"=",
"\\... | Constructs the logger hierarchy based on configuration.
@param \n2n\log4php\LoggerHierarchy $hierarchy
@param array $config | [
"Constructs",
"the",
"logger",
"hierarchy",
"based",
"on",
"configuration",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L189-L228 |
225,332 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.createAppenderFilter | private function createAppenderFilter(\n2n\log4php\LoggerAppender $appender, $config) {
$name = $appender->getName();
$class = $config['class'];
if (!class_exists($class)) {
$this->warn("Nonexistant filter class [$class] specified on appender [$name]. Skipping filter definition.");
return;
}
$... | php | private function createAppenderFilter(\n2n\log4php\LoggerAppender $appender, $config) {
$name = $appender->getName();
$class = $config['class'];
if (!class_exists($class)) {
$this->warn("Nonexistant filter class [$class] specified on appender [$name]. Skipping filter definition.");
return;
}
$... | [
"private",
"function",
"createAppenderFilter",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerAppender",
"$",
"appender",
",",
"$",
"config",
")",
"{",
"$",
"name",
"=",
"$",
"appender",
"->",
"getName",
"(",
")",
";",
"$",
"class",
"=",
"$",
"config",
... | Parses filter config, creates the filter and adds it to the appender's
filter chain.
@param \n2n\log4php\LoggerAppender $appender
@param array $config Filter configuration. | [
"Parses",
"filter",
"config",
"creates",
"the",
"filter",
"and",
"adds",
"it",
"to",
"the",
"appender",
"s",
"filter",
"chain",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L357-L377 |
225,333 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.configureRootLogger | private function configureRootLogger(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
$logger = $hierarchy->getRootLogger();
$this->configureLogger($logger, $config);
} | php | private function configureRootLogger(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
$logger = $hierarchy->getRootLogger();
$this->configureLogger($logger, $config);
} | [
"private",
"function",
"configureRootLogger",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerHierarchy",
"$",
"hierarchy",
",",
"$",
"config",
")",
"{",
"$",
"logger",
"=",
"$",
"hierarchy",
"->",
"getRootLogger",
"(",
")",
";",
"$",
"this",
"->",
"config... | Configures the root logger
@see configureLogger() | [
"Configures",
"the",
"root",
"logger"
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L383-L386 |
225,334 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.configureOtherLogger | private function configureOtherLogger(\n2n\log4php\LoggerHierarchy $hierarchy, $name, $config) {
// Get logger from hierarchy (this creates it if it doesn't already exist)
$logger = $hierarchy->getLogger($name);
$this->configureLogger($logger, $config);
} | php | private function configureOtherLogger(\n2n\log4php\LoggerHierarchy $hierarchy, $name, $config) {
// Get logger from hierarchy (this creates it if it doesn't already exist)
$logger = $hierarchy->getLogger($name);
$this->configureLogger($logger, $config);
} | [
"private",
"function",
"configureOtherLogger",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerHierarchy",
"$",
"hierarchy",
",",
"$",
"name",
",",
"$",
"config",
")",
"{",
"// Get logger from hierarchy (this creates it if it doesn't already exist)\r",
"$",
"logger",
"=... | Configures a logger which is not root.
@see configureLogger() | [
"Configures",
"a",
"logger",
"which",
"is",
"not",
"root",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L392-L396 |
225,335 | n2n/n2n-log4php | src/app/n2n/log4php/configurator/ConfiguratorDefault.php | ConfiguratorDefault.configureLogger | private function configureLogger(\n2n\log4php\Logger $logger, $config) {
$loggerName = $logger->getName();
// Set logger level
if (isset($config['level'])) {
$level = \n2n\log4php\LoggerLevel::toLevel($config['level']);
if (isset($level)) {
$logger->setLevel($level);
} else {
$this->w... | php | private function configureLogger(\n2n\log4php\Logger $logger, $config) {
$loggerName = $logger->getName();
// Set logger level
if (isset($config['level'])) {
$level = \n2n\log4php\LoggerLevel::toLevel($config['level']);
if (isset($level)) {
$logger->setLevel($level);
} else {
$this->w... | [
"private",
"function",
"configureLogger",
"(",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"Logger",
"$",
"logger",
",",
"$",
"config",
")",
"{",
"$",
"loggerName",
"=",
"$",
"logger",
"->",
"getName",
"(",
")",
";",
"// Set logger level\r",
"if",
"(",
"isset",
... | Configures a logger.
@param \n2n\log4php\Logger $logger The logger to configure
@param array $config \n2n\log4php\Logger configuration options. | [
"Configures",
"a",
"logger",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configurator/ConfiguratorDefault.php#L404-L437 |
225,336 | froq/froq-service | src/Service.php | Service.setMethodArguments | public final function setMethodArguments(string $method, array $methodArguments): self
{
$this->methodArguments[$method] = $methodArguments;
return $this;
} | php | public final function setMethodArguments(string $method, array $methodArguments): self
{
$this->methodArguments[$method] = $methodArguments;
return $this;
} | [
"public",
"final",
"function",
"setMethodArguments",
"(",
"string",
"$",
"method",
",",
"array",
"$",
"methodArguments",
")",
":",
"self",
"{",
"$",
"this",
"->",
"methodArguments",
"[",
"$",
"method",
"]",
"=",
"$",
"methodArguments",
";",
"return",
"$",
... | Set method arguments.
@param string $method
@param array $methodArguments
@return self | [
"Set",
"method",
"arguments",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/Service.php#L294-L299 |
225,337 | froq/froq-service | src/Service.php | Service.getMethodArguments | public final function getMethodArguments(string $method = null): ?array
{
return $method ? $this->methodArguments[$method] ?? null : $this->methodArguments;
} | php | public final function getMethodArguments(string $method = null): ?array
{
return $method ? $this->methodArguments[$method] ?? null : $this->methodArguments;
} | [
"public",
"final",
"function",
"getMethodArguments",
"(",
"string",
"$",
"method",
"=",
"null",
")",
":",
"?",
"array",
"{",
"return",
"$",
"method",
"?",
"$",
"this",
"->",
"methodArguments",
"[",
"$",
"method",
"]",
"??",
"null",
":",
"$",
"this",
"-... | Get method arguments.
@param string|null $method
@return ?array | [
"Get",
"method",
"arguments",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/Service.php#L306-L309 |
225,338 | froq/froq-service | src/Service.php | Service.isAllowedRequestMethod | public final function isAllowedRequestMethod(string $method): bool
{
return $this->allowedRequestMethods == null || in_array($method, (array) $this->allowedRequestMethods);
} | php | public final function isAllowedRequestMethod(string $method): bool
{
return $this->allowedRequestMethods == null || in_array($method, (array) $this->allowedRequestMethods);
} | [
"public",
"final",
"function",
"isAllowedRequestMethod",
"(",
"string",
"$",
"method",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"allowedRequestMethods",
"==",
"null",
"||",
"in_array",
"(",
"$",
"method",
",",
"(",
"array",
")",
"$",
"this",
"->... | Is allowed request method.
@param string $method
@return bool | [
"Is",
"allowed",
"request",
"method",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/Service.php#L337-L340 |
225,339 | froq/froq-service | src/Service.php | Service.getShortName | public final function getShortName(): ?string
{
return ($this->name != null) ? substr($this->name, 0, -strlen(self::SERVICE_NAME_SUFFIX)) : null;
} | php | public final function getShortName(): ?string
{
return ($this->name != null) ? substr($this->name, 0, -strlen(self::SERVICE_NAME_SUFFIX)) : null;
} | [
"public",
"final",
"function",
"getShortName",
"(",
")",
":",
"?",
"string",
"{",
"return",
"(",
"$",
"this",
"->",
"name",
"!=",
"null",
")",
"?",
"substr",
"(",
"$",
"this",
"->",
"name",
",",
"0",
",",
"-",
"strlen",
"(",
"self",
"::",
"SERVICE_... | Get short name.
@return ?string | [
"Get",
"short",
"name",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/Service.php#L346-L349 |
225,340 | froq/froq-service | src/Service.php | Service.loadAcl | private final function loadAcl(): void
{
$this->acl = new Acl($this);
$rules = $this->config->get('acl.rules');
if ($rules != null) {
$this->acl->setRules($rules);
}
} | php | private final function loadAcl(): void
{
$this->acl = new Acl($this);
$rules = $this->config->get('acl.rules');
if ($rules != null) {
$this->acl->setRules($rules);
}
} | [
"private",
"final",
"function",
"loadAcl",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"acl",
"=",
"new",
"Acl",
"(",
"$",
"this",
")",
";",
"$",
"rules",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'acl.rules'",
")",
";",
"if",
"(",
... | Load acl.
@return void | [
"Load",
"acl",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/Service.php#L677-L685 |
225,341 | froq/froq-service | src/Service.php | Service.loadValidation | private final function loadValidation(): void
{
$this->validation = new Validation();
$rules = $this->config->get('validation.rules');
if ($rules != null) {
$this->validation->setRules($rules);
}
} | php | private final function loadValidation(): void
{
$this->validation = new Validation();
$rules = $this->config->get('validation.rules');
if ($rules != null) {
$this->validation->setRules($rules);
}
} | [
"private",
"final",
"function",
"loadValidation",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"validation",
"=",
"new",
"Validation",
"(",
")",
";",
"$",
"rules",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'validation.rules'",
")",
";",
"i... | Load validation.
@return void | [
"Load",
"validation",
"."
] | c8fb2009100b27b6a0bd1ff8f8d81e102faadebc | https://github.com/froq/froq-service/blob/c8fb2009100b27b6a0bd1ff8f8d81e102faadebc/src/Service.php#L691-L699 |
225,342 | php-toolkit/obj-utils | src/Traits/StdObjectTrait.php | StdObjectTrait.spaceName | final public static function spaceName(string $fullName = null): string
{
$fullName = $fullName ?: self::fullName();
$fullName = \str_replace('\\', '/', $fullName);
return \strpos($fullName, '/') ? \dirname($fullName) : null;
} | php | final public static function spaceName(string $fullName = null): string
{
$fullName = $fullName ?: self::fullName();
$fullName = \str_replace('\\', '/', $fullName);
return \strpos($fullName, '/') ? \dirname($fullName) : null;
} | [
"final",
"public",
"static",
"function",
"spaceName",
"(",
"string",
"$",
"fullName",
"=",
"null",
")",
":",
"string",
"{",
"$",
"fullName",
"=",
"$",
"fullName",
"?",
":",
"self",
"::",
"fullName",
"(",
")",
";",
"$",
"fullName",
"=",
"\\",
"str_repla... | get called class namespace
@param null|string $fullName
@return string | [
"get",
"called",
"class",
"namespace"
] | 69f860762cd0feb0fb23f9005b0df9ce2732de4a | https://github.com/php-toolkit/obj-utils/blob/69f860762cd0feb0fb23f9005b0df9ce2732de4a/src/Traits/StdObjectTrait.php#L33-L39 |
225,343 | Eve-PHP/Framework | src/Job/Base.php | Base.prepare | public function prepare($item)
{
$prepared = array();
foreach($item as $key => $value) {
//if it's null
if($value === null) {
//set it and continue
$prepared[$key] = null;
continue;
}
//if is array
... | php | public function prepare($item)
{
$prepared = array();
foreach($item as $key => $value) {
//if it's null
if($value === null) {
//set it and continue
$prepared[$key] = null;
continue;
}
//if is array
... | [
"public",
"function",
"prepare",
"(",
"$",
"item",
")",
"{",
"$",
"prepared",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"item",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"//if it's null",
"if",
"(",
"$",
"value",
"===",
"null",
")",
... | Make everything into a string
remove empty strings
@param array $item The item to prepare
@return array | [
"Make",
"everything",
"into",
"a",
"string",
"remove",
"empty",
"strings"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Job/Base.php#L55-L85 |
225,344 | DrNixx/yii2-onix | src/data/ActiveRecordEx.php | ActiveRecordEx.insert | public function insert($runValidation = true, $attributes = null)
{
try {
return parent::insert($runValidation, $attributes);
} catch (\Exception $ex) {
throw new Exception($ex->getMessage(), $ex->getCode(), $ex);
} /** @noinspection PhpUndefinedClassInspection */ cat... | php | public function insert($runValidation = true, $attributes = null)
{
try {
return parent::insert($runValidation, $attributes);
} catch (\Exception $ex) {
throw new Exception($ex->getMessage(), $ex->getCode(), $ex);
} /** @noinspection PhpUndefinedClassInspection */ cat... | [
"public",
"function",
"insert",
"(",
"$",
"runValidation",
"=",
"true",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"try",
"{",
"return",
"parent",
"::",
"insert",
"(",
"$",
"runValidation",
",",
"$",
"attributes",
")",
";",
"}",
"catch",
"(",
"\\",... | Inserts a row into the associated database table using the attribute values of this record.
This method performs the following steps in order:
1. call [[beforeValidate()]] when `$runValidation` is `true`. If [[beforeValidate()]]
returns `false`, the rest of the steps will be skipped;
2. call [[afterValidate()]] when ... | [
"Inserts",
"a",
"row",
"into",
"the",
"associated",
"database",
"table",
"using",
"the",
"attribute",
"values",
"of",
"this",
"record",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/data/ActiveRecordEx.php#L95-L104 |
225,345 | DrNixx/yii2-onix | src/data/ActiveRecordEx.php | ActiveRecordEx.invalidateCache | public function invalidateCache()
{
if (!$this->isNewRecord) {
$cache = Yii::$app->cache;
if ($cache !== null) {
$key = $this->getCacheKey();
if ($key != null) {
Yii::debug(sprintf("Clear cache key %s", $key));
$... | php | public function invalidateCache()
{
if (!$this->isNewRecord) {
$cache = Yii::$app->cache;
if ($cache !== null) {
$key = $this->getCacheKey();
if ($key != null) {
Yii::debug(sprintf("Clear cache key %s", $key));
$... | [
"public",
"function",
"invalidateCache",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isNewRecord",
")",
"{",
"$",
"cache",
"=",
"Yii",
"::",
"$",
"app",
"->",
"cache",
";",
"if",
"(",
"$",
"cache",
"!==",
"null",
")",
"{",
"$",
"key",
"=",... | Invalidate cache related for object | [
"Invalidate",
"cache",
"related",
"for",
"object"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/data/ActiveRecordEx.php#L308-L325 |
225,346 | ricardopedias/report-collection | src/Libs/Styler.php | Styler.applyStyles | protected function applyStyles($row, $col, array $styles) : bool
{
$buffer = $this->getBuffer();
if (!isset($buffer[$row])) {
return false;
}
if (!isset($buffer[$row][$col])) {
return false;
}
$current_styles = $this->buffer[$row][$col]['sty... | php | protected function applyStyles($row, $col, array $styles) : bool
{
$buffer = $this->getBuffer();
if (!isset($buffer[$row])) {
return false;
}
if (!isset($buffer[$row][$col])) {
return false;
}
$current_styles = $this->buffer[$row][$col]['sty... | [
"protected",
"function",
"applyStyles",
"(",
"$",
"row",
",",
"$",
"col",
",",
"array",
"$",
"styles",
")",
":",
"bool",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"getBuffer",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"buffer",
"[",
"$"... | Aplica os estilos com base nos indices PHP.
@param int $row
@param int $col
@param array $styles
@return bool | [
"Aplica",
"os",
"estilos",
"com",
"base",
"nos",
"indices",
"PHP",
"."
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/Styler.php#L210-L261 |
225,347 | ricardopedias/report-collection | src/Libs/Styler.php | Styler.applyBorderStyle | protected function applyBorderStyle($row, $col, string $param, $value) : bool
{
$buffer = $this->getBuffer();
if (!isset($buffer[$row])) {
return false;
}
if (!isset($buffer[$row][$col])) {
return false;
}
// Os estilos de borda são aplicado... | php | protected function applyBorderStyle($row, $col, string $param, $value) : bool
{
$buffer = $this->getBuffer();
if (!isset($buffer[$row])) {
return false;
}
if (!isset($buffer[$row][$col])) {
return false;
}
// Os estilos de borda são aplicado... | [
"protected",
"function",
"applyBorderStyle",
"(",
"$",
"row",
",",
"$",
"col",
",",
"string",
"$",
"param",
",",
"$",
"value",
")",
":",
"bool",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"getBuffer",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
... | Aplica os estilos para bordas com base nos indices PHP.
@param int $row
@param int $col
@param string $param
@param string $value
@return bool | [
"Aplica",
"os",
"estilos",
"para",
"bordas",
"com",
"base",
"nos",
"indices",
"PHP",
"."
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/Styler.php#L272-L310 |
225,348 | SetBased/php-abc-form | src/Control/SelectControl.php | SelectControl.setOptions | public function setOptions(?array &$options, string $keyKey, string $labelKey)
{
$this->options = $options;
$this->keyKey = $keyKey;
$this->labelKey = $labelKey;
} | php | public function setOptions(?array &$options, string $keyKey, string $labelKey)
{
$this->options = $options;
$this->keyKey = $keyKey;
$this->labelKey = $labelKey;
} | [
"public",
"function",
"setOptions",
"(",
"?",
"array",
"&",
"$",
"options",
",",
"string",
"$",
"keyKey",
",",
"string",
"$",
"labelKey",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"$",
"options",
";",
"$",
"this",
"->",
"keyKey",
"=",
"$",
"keyKey... | Sets the options for this select box.
@param array[]|null $options The options of this select box.
@param string $keyKey The key holding the keys of the options.
@param string $labelKey The key holding the labels for the options.
@since 1.0.0
@api | [
"Sets",
"the",
"options",
"for",
"this",
"select",
"box",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/SelectControl.php#L168-L173 |
225,349 | SetBased/php-abc-form | src/Control/SelectControl.php | SelectControl.optionAttributes | private function optionAttributes(array $option): array
{
$attributes = [];
if (is_array($this->optionAttributesMap))
{
foreach ($this->optionAttributesMap as $key => $name)
{
if (isset($option[$key])) $attributes[$name] = $option[$key];
}
}
return $attributes;
} | php | private function optionAttributes(array $option): array
{
$attributes = [];
if (is_array($this->optionAttributesMap))
{
foreach ($this->optionAttributesMap as $key => $name)
{
if (isset($option[$key])) $attributes[$name] = $option[$key];
}
}
return $attributes;
} | [
"private",
"function",
"optionAttributes",
"(",
"array",
"$",
"option",
")",
":",
"array",
"{",
"$",
"attributes",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"optionAttributesMap",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->... | Returns the attributes for the option element.
@param array $option The option.
@return array | [
"Returns",
"the",
"attributes",
"for",
"the",
"option",
"element",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/SelectControl.php#L268-L281 |
225,350 | spiral/translator | src/Config/TranslatorConfig.php | TranslatorConfig.resolveDomain | public function resolveDomain(string $bundle): string
{
$bundle = strtolower(str_replace(['/', '\\'], '-', $bundle));
foreach ($this->config['domains'] as $domain => $patterns) {
foreach ($patterns as $pattern) {
if ($this->matcher->matches($bundle, $pattern)) {
... | php | public function resolveDomain(string $bundle): string
{
$bundle = strtolower(str_replace(['/', '\\'], '-', $bundle));
foreach ($this->config['domains'] as $domain => $patterns) {
foreach ($patterns as $pattern) {
if ($this->matcher->matches($bundle, $pattern)) {
... | [
"public",
"function",
"resolveDomain",
"(",
"string",
"$",
"bundle",
")",
":",
"string",
"{",
"$",
"bundle",
"=",
"strtolower",
"(",
"str_replace",
"(",
"[",
"'/'",
",",
"'\\\\'",
"]",
",",
"'-'",
",",
"$",
"bundle",
")",
")",
";",
"foreach",
"(",
"$... | Get domain name associated with given bundle.
@param string $bundle
@return string | [
"Get",
"domain",
"name",
"associated",
"with",
"given",
"bundle",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Config/TranslatorConfig.php#L104-L118 |
225,351 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.find | public function find(string $pattern, int $flags = 0): Collection
{
$files = glob($this->path.'/'.$pattern, $flags);
foreach ($files as $index => $file) {
if (is_dir($file)) {
$files[$index] = new self($file);
} else {
$files[$index] = new File... | php | public function find(string $pattern, int $flags = 0): Collection
{
$files = glob($this->path.'/'.$pattern, $flags);
foreach ($files as $index => $file) {
if (is_dir($file)) {
$files[$index] = new self($file);
} else {
$files[$index] = new File... | [
"public",
"function",
"find",
"(",
"string",
"$",
"pattern",
",",
"int",
"$",
"flags",
"=",
"0",
")",
":",
"Collection",
"{",
"$",
"files",
"=",
"glob",
"(",
"$",
"this",
"->",
"path",
".",
"'/'",
".",
"$",
"pattern",
",",
"$",
"flags",
")",
";",... | Find sub files and folders matching a pattern.
@param string $pattern the pattern
@param int $flags Glob flags
@return Collection
@throws FileException
@throws FolderException | [
"Find",
"sub",
"files",
"and",
"folders",
"matching",
"a",
"pattern",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L53-L65 |
225,352 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.findFiles | public function findFiles(string $pattern, int $flags = 0): FileCollection
{
$files = glob($this->path.'/'.$pattern, $flags);
foreach ($files as $index => $file) {
if (is_file($file)) {
$files[$index] = new File($file);
} else {
unset($files[$i... | php | public function findFiles(string $pattern, int $flags = 0): FileCollection
{
$files = glob($this->path.'/'.$pattern, $flags);
foreach ($files as $index => $file) {
if (is_file($file)) {
$files[$index] = new File($file);
} else {
unset($files[$i... | [
"public",
"function",
"findFiles",
"(",
"string",
"$",
"pattern",
",",
"int",
"$",
"flags",
"=",
"0",
")",
":",
"FileCollection",
"{",
"$",
"files",
"=",
"glob",
"(",
"$",
"this",
"->",
"path",
".",
"'/'",
".",
"$",
"pattern",
",",
"$",
"flags",
")... | Find sub files matching a pattern.
@param string $pattern glob pattern
@param int $flags Glob flags
@return FileCollection
@throws FileException | [
"Find",
"sub",
"files",
"matching",
"a",
"pattern",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L77-L89 |
225,353 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.findFolders | public function findFolders(string $pattern, int $flags = 0): FolderCollection
{
$folders = glob($this->path.'/'.$pattern, $flags);
foreach ($folders as $index => $folder) {
if (is_dir($folder)) {
$folders[$index] = new self($folder);
} else {
... | php | public function findFolders(string $pattern, int $flags = 0): FolderCollection
{
$folders = glob($this->path.'/'.$pattern, $flags);
foreach ($folders as $index => $folder) {
if (is_dir($folder)) {
$folders[$index] = new self($folder);
} else {
... | [
"public",
"function",
"findFolders",
"(",
"string",
"$",
"pattern",
",",
"int",
"$",
"flags",
"=",
"0",
")",
":",
"FolderCollection",
"{",
"$",
"folders",
"=",
"glob",
"(",
"$",
"this",
"->",
"path",
".",
"'/'",
".",
"$",
"pattern",
",",
"$",
"flags"... | Find sub folders matching a pattern.
@param string $pattern glob pattern
@param int $flags Glob flags
@return FolderCollection
@throws FolderException | [
"Find",
"sub",
"folders",
"matching",
"a",
"pattern",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L101-L113 |
225,354 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.addFile | public function addFile(File $file): self
{
$directory = $this->getPath();
$file->moveToDirectory($directory);
return $this;
} | php | public function addFile(File $file): self
{
$directory = $this->getPath();
$file->moveToDirectory($directory);
return $this;
} | [
"public",
"function",
"addFile",
"(",
"File",
"$",
"file",
")",
":",
"self",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"$",
"file",
"->",
"moveToDirectory",
"(",
"$",
"directory",
")",
";",
"return",
"$",
"this",
";",
... | Add file to the folder.
@param File $file
@return static
@throws FileException
@throws FolderException | [
"Add",
"file",
"to",
"the",
"folder",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L125-L131 |
225,355 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.addFiles | public function addFiles(Collection $files): self
{
foreach ($files as $file) {
$this->addFile($file);
}
return $this;
} | php | public function addFiles(Collection $files): self
{
foreach ($files as $file) {
$this->addFile($file);
}
return $this;
} | [
"public",
"function",
"addFiles",
"(",
"Collection",
"$",
"files",
")",
":",
"self",
"{",
"foreach",
"(",
"$",
"files",
"as",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"addFile",
"(",
"$",
"file",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"
] | Add files to the folder.
@param Collection $files
@return static
@throws FileException
@throws FolderException | [
"Add",
"files",
"to",
"the",
"folder",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L143-L150 |
225,356 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.rename | public function rename(string $newFolderName): self
{
$newFolderPath = normalize_path($this->getDirectory().DIRECTORY_SEPARATOR.$newFolderName);
if ($newFolderPath === $this->getPath() || (!is_dir($newFolderPath) && $this->move($newFolderPath))) {
return self::load($newFolderPath);
... | php | public function rename(string $newFolderName): self
{
$newFolderPath = normalize_path($this->getDirectory().DIRECTORY_SEPARATOR.$newFolderName);
if ($newFolderPath === $this->getPath() || (!is_dir($newFolderPath) && $this->move($newFolderPath))) {
return self::load($newFolderPath);
... | [
"public",
"function",
"rename",
"(",
"string",
"$",
"newFolderName",
")",
":",
"self",
"{",
"$",
"newFolderPath",
"=",
"normalize_path",
"(",
"$",
"this",
"->",
"getDirectory",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"newFolderName",
")",
";",
"if",
... | Rename folder with new folder name.
@param string $newFolderName New folder name
@return static
@throws FolderException | [
"Rename",
"folder",
"with",
"new",
"folder",
"name",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L249-L257 |
225,357 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.move | public function move(string $newFolderPath): self
{
$newFolderPath = normalize_path($newFolderPath);
if (!is_dir($newFolderPath)) {
if (rename($this->path, $newFolderPath)) {
return new self($newFolderPath);
}
throw new FolderException('Cannot mov... | php | public function move(string $newFolderPath): self
{
$newFolderPath = normalize_path($newFolderPath);
if (!is_dir($newFolderPath)) {
if (rename($this->path, $newFolderPath)) {
return new self($newFolderPath);
}
throw new FolderException('Cannot mov... | [
"public",
"function",
"move",
"(",
"string",
"$",
"newFolderPath",
")",
":",
"self",
"{",
"$",
"newFolderPath",
"=",
"normalize_path",
"(",
"$",
"newFolderPath",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"newFolderPath",
")",
")",
"{",
"if",
"(",
"... | Move folder to directory and rename it.
@param string $newFolderPath New folder path
@return static
@throws FolderException | [
"Move",
"folder",
"to",
"directory",
"and",
"rename",
"it",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L268-L280 |
225,358 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.moveToDirectory | public function moveToDirectory(string $newDirectoryPath): self
{
$newDirectoryPath = normalize_path($newDirectoryPath);
if (is_dir($newDirectoryPath)) {
if (is_writeable($newDirectoryPath)) {
$newFolderPath = $newDirectoryPath.DIRECTORY_SEPARATOR.$this->getName();
... | php | public function moveToDirectory(string $newDirectoryPath): self
{
$newDirectoryPath = normalize_path($newDirectoryPath);
if (is_dir($newDirectoryPath)) {
if (is_writeable($newDirectoryPath)) {
$newFolderPath = $newDirectoryPath.DIRECTORY_SEPARATOR.$this->getName();
... | [
"public",
"function",
"moveToDirectory",
"(",
"string",
"$",
"newDirectoryPath",
")",
":",
"self",
"{",
"$",
"newDirectoryPath",
"=",
"normalize_path",
"(",
"$",
"newDirectoryPath",
")",
";",
"if",
"(",
"is_dir",
"(",
"$",
"newDirectoryPath",
")",
")",
"{",
... | Move folder to new directory.
@param string $newDirectoryPath New directory path
@return static
@throws FolderException | [
"Move",
"folder",
"to",
"new",
"directory",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L291-L306 |
225,359 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.copy | public function copy(string $newFolderPath): self
{
$newFolderPath = normalize_path($newFolderPath);
if (!is_dir($newFolderPath)) {
$newFolder = self::create($newFolderPath);
if ($this->copyContent($newFolder->getPath())) {
return $newFolder;
}
... | php | public function copy(string $newFolderPath): self
{
$newFolderPath = normalize_path($newFolderPath);
if (!is_dir($newFolderPath)) {
$newFolder = self::create($newFolderPath);
if ($this->copyContent($newFolder->getPath())) {
return $newFolder;
}
... | [
"public",
"function",
"copy",
"(",
"string",
"$",
"newFolderPath",
")",
":",
"self",
"{",
"$",
"newFolderPath",
"=",
"normalize_path",
"(",
"$",
"newFolderPath",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"newFolderPath",
")",
")",
"{",
"$",
"newFolde... | Copy folder to new directory and rename it.
@param string $newFolderPath New folder path
@return Folder
@throws FolderException | [
"Copy",
"folder",
"to",
"new",
"directory",
"and",
"rename",
"it",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L317-L330 |
225,360 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/Folder.php | Folder.copyToDirectory | public function copyToDirectory(string $newDirectoryPath): self
{
$newDirectoryPath = normalize_path($newDirectoryPath);
if (is_dir($newDirectoryPath)) {
if (is_writeable($newDirectoryPath)) {
$newFolderPath = $newDirectoryPath.DIRECTORY_SEPARATOR.$this->getName();
... | php | public function copyToDirectory(string $newDirectoryPath): self
{
$newDirectoryPath = normalize_path($newDirectoryPath);
if (is_dir($newDirectoryPath)) {
if (is_writeable($newDirectoryPath)) {
$newFolderPath = $newDirectoryPath.DIRECTORY_SEPARATOR.$this->getName();
... | [
"public",
"function",
"copyToDirectory",
"(",
"string",
"$",
"newDirectoryPath",
")",
":",
"self",
"{",
"$",
"newDirectoryPath",
"=",
"normalize_path",
"(",
"$",
"newDirectoryPath",
")",
";",
"if",
"(",
"is_dir",
"(",
"$",
"newDirectoryPath",
")",
")",
"{",
... | Copy folder to new directory path.
@param string $newDirectoryPath New directory path
@return Folder
@throws FolderException | [
"Copy",
"folder",
"to",
"new",
"directory",
"path",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/Folder.php#L341-L355 |
225,361 | OleMchls/PHP-Metrics-Client | src/Metrics/Client.php | Client.request | protected function request($path, $method, array $data = array()) {
$request = new Request();
$response = new Response();
$transport = $this->getTransport();
$request->setMethod($method);
$request->setResource($this->buildPath($path));
$request->setHost(self::URI);
$request->addHeader('Authorization: Bas... | php | protected function request($path, $method, array $data = array()) {
$request = new Request();
$response = new Response();
$transport = $this->getTransport();
$request->setMethod($method);
$request->setResource($this->buildPath($path));
$request->setHost(self::URI);
$request->addHeader('Authorization: Bas... | [
"protected",
"function",
"request",
"(",
"$",
"path",
",",
"$",
"method",
",",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"request",
"=",
"new",
"Request",
"(",
")",
";",
"$",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"... | Helper to send requests to Metrics API.
@param string $path Path after metrics api version.
@param string $method HTTP Mthod, 'GET' or 'POST'.
@param array<string,array> $data Metrics data.
@return stdClass | [
"Helper",
"to",
"send",
"requests",
"to",
"Metrics",
"API",
"."
] | 173e31ee3da814e66976e4c0a73f6660544077cd | https://github.com/OleMchls/PHP-Metrics-Client/blob/173e31ee3da814e66976e4c0a73f6660544077cd/src/Metrics/Client.php#L60-L79 |
225,362 | php-toolkit/file-utils | src/ReadTrait.php | ReadTrait.loadPhp | public static function loadPhp($file, $throwError = true): array
{
$ary = [];
if (is_file($file)) {
$ary = require $file;
if (!\is_array($ary)) {
$ary = [];
}
} elseif ($throwError) {
throw new FileNotFoundException("php file ... | php | public static function loadPhp($file, $throwError = true): array
{
$ary = [];
if (is_file($file)) {
$ary = require $file;
if (!\is_array($ary)) {
$ary = [];
}
} elseif ($throwError) {
throw new FileNotFoundException("php file ... | [
"public",
"static",
"function",
"loadPhp",
"(",
"$",
"file",
",",
"$",
"throwError",
"=",
"true",
")",
":",
"array",
"{",
"$",
"ary",
"=",
"[",
"]",
";",
"if",
"(",
"is_file",
"(",
"$",
"file",
")",
")",
"{",
"$",
"ary",
"=",
"require",
"$",
"f... | load array data form file.
@param string $file
@param bool $throwError
@return array
@throws FileNotFoundException | [
"load",
"array",
"data",
"form",
"file",
"."
] | cf55fa8ce34000731460e8dc705d7006632119a8 | https://github.com/php-toolkit/file-utils/blob/cf55fa8ce34000731460e8dc705d7006632119a8/src/ReadTrait.php#L64-L79 |
225,363 | railken/amethyst-file | src/Managers/FileManager.php | FileManager.uploadFileByContent | public function uploadFileByContent(File $file, string $content)
{
$dir = sys_get_temp_dir();
$tmp = $dir.'/'.Uuid::uuid4()->toString();
file_put_contents($tmp, $content);
$filename = $file->name;
if (!$filename) {
$filename = Uuid::uuid4()->toString().'.'.$th... | php | public function uploadFileByContent(File $file, string $content)
{
$dir = sys_get_temp_dir();
$tmp = $dir.'/'.Uuid::uuid4()->toString();
file_put_contents($tmp, $content);
$filename = $file->name;
if (!$filename) {
$filename = Uuid::uuid4()->toString().'.'.$th... | [
"public",
"function",
"uploadFileByContent",
"(",
"File",
"$",
"file",
",",
"string",
"$",
"content",
")",
"{",
"$",
"dir",
"=",
"sys_get_temp_dir",
"(",
")",
";",
"$",
"tmp",
"=",
"$",
"dir",
".",
"'/'",
".",
"Uuid",
"::",
"uuid4",
"(",
")",
"->",
... | Upload file By content.
@param File $file
@param string $content
@return \Railken\Lem\Contracts\ResultContract | [
"Upload",
"file",
"By",
"content",
"."
] | 732916420373fd2ad1a80393d86f8a4d26e47768 | https://github.com/railken/amethyst-file/blob/732916420373fd2ad1a80393d86f8a4d26e47768/src/Managers/FileManager.php#L52-L71 |
225,364 | railken/amethyst-file | src/Managers/FileManager.php | FileManager.uploadFileFromFilesystem | public function uploadFileFromFilesystem(File $file, string $path)
{
$dir = sys_get_temp_dir();
$filename = $dir.'/'.Uuid::uuid4()->toString().'.'.$this->guessExtension($path);
rename($path, $filename);
$file->path = $filename;
$file->save();
$file->addMedia($file... | php | public function uploadFileFromFilesystem(File $file, string $path)
{
$dir = sys_get_temp_dir();
$filename = $dir.'/'.Uuid::uuid4()->toString().'.'.$this->guessExtension($path);
rename($path, $filename);
$file->path = $filename;
$file->save();
$file->addMedia($file... | [
"public",
"function",
"uploadFileFromFilesystem",
"(",
"File",
"$",
"file",
",",
"string",
"$",
"path",
")",
"{",
"$",
"dir",
"=",
"sys_get_temp_dir",
"(",
")",
";",
"$",
"filename",
"=",
"$",
"dir",
".",
"'/'",
".",
"Uuid",
"::",
"uuid4",
"(",
")",
... | Upload a file from filesystem.
@param File $file
@param string $path
@return \Railken\Lem\Contracts\ResultContract | [
"Upload",
"a",
"file",
"from",
"filesystem",
"."
] | 732916420373fd2ad1a80393d86f8a4d26e47768 | https://github.com/railken/amethyst-file/blob/732916420373fd2ad1a80393d86f8a4d26e47768/src/Managers/FileManager.php#L81-L98 |
225,365 | cmsgears/module-cart | common/models/resources/Order.php | Order.getBase | public function getBase() {
$orderTable = CartTables::getTableName( CartTables::TABLE_ORDER );
return $this->hasOne( Order::class, [ 'id' => 'baseId' ] )->from( "$orderTable as base" );
} | php | public function getBase() {
$orderTable = CartTables::getTableName( CartTables::TABLE_ORDER );
return $this->hasOne( Order::class, [ 'id' => 'baseId' ] )->from( "$orderTable as base" );
} | [
"public",
"function",
"getBase",
"(",
")",
"{",
"$",
"orderTable",
"=",
"CartTables",
"::",
"getTableName",
"(",
"CartTables",
"::",
"TABLE_ORDER",
")",
";",
"return",
"$",
"this",
"->",
"hasOne",
"(",
"Order",
"::",
"class",
",",
"[",
"'id'",
"=>",
"'ba... | Returns the parent order.
@return Order | [
"Returns",
"the",
"parent",
"order",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L273-L278 |
225,366 | cmsgears/module-cart | common/models/resources/Order.php | Order.getTransaction | public function getTransaction() {
$transactionTable = PaymentTables::getTableName( PaymentTables::TABLE_TRANSACTION );
$transactionSuccess = Transaction::STATUS_SUCCESS;
return $this->hasOne( Transaction::class, [ 'orderId' => 'id' ] )->where( "$transactionTable.status=$transactionSuccess" );
} | php | public function getTransaction() {
$transactionTable = PaymentTables::getTableName( PaymentTables::TABLE_TRANSACTION );
$transactionSuccess = Transaction::STATUS_SUCCESS;
return $this->hasOne( Transaction::class, [ 'orderId' => 'id' ] )->where( "$transactionTable.status=$transactionSuccess" );
} | [
"public",
"function",
"getTransaction",
"(",
")",
"{",
"$",
"transactionTable",
"=",
"PaymentTables",
"::",
"getTableName",
"(",
"PaymentTables",
"::",
"TABLE_TRANSACTION",
")",
";",
"$",
"transactionSuccess",
"=",
"Transaction",
"::",
"STATUS_SUCCESS",
";",
"return... | Returns the successful transaction associated with the order.
It's useful in the cases where only one transaction is required for an order.
@return Transaction | [
"Returns",
"the",
"successful",
"transaction",
"associated",
"with",
"the",
"order",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L307-L313 |
225,367 | cmsgears/module-cart | common/models/resources/Order.php | Order.isApproved | public function isApproved( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_APPROVED;
}
return $this->status >= self::STATUS_APPROVED;
} | php | public function isApproved( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_APPROVED;
}
return $this->status >= self::STATUS_APPROVED;
} | [
"public",
"function",
"isApproved",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_APPROVED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
"s... | Check whether order is approved.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"approved",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L371-L379 |
225,368 | cmsgears/module-cart | common/models/resources/Order.php | Order.isPlaced | public function isPlaced( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_PLACED;
}
return $this->status >= self::STATUS_PLACED;
} | php | public function isPlaced( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_PLACED;
}
return $this->status >= self::STATUS_PLACED;
} | [
"public",
"function",
"isPlaced",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_PLACED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
"self"... | Check whether order is placed.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"placed",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L387-L395 |
225,369 | cmsgears/module-cart | common/models/resources/Order.php | Order.isCancelled | public function isCancelled( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_CANCELLED;
}
return $this->status >= self::STATUS_CANCELLED;
} | php | public function isCancelled( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_CANCELLED;
}
return $this->status >= self::STATUS_CANCELLED;
} | [
"public",
"function",
"isCancelled",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_CANCELLED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
... | Check whether order is cancelled.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"cancelled",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L403-L411 |
225,370 | cmsgears/module-cart | common/models/resources/Order.php | Order.isPaid | public function isPaid( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_PAID;
}
return $this->status >= self::STATUS_PAID;
} | php | public function isPaid( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_PAID;
}
return $this->status >= self::STATUS_PAID;
} | [
"public",
"function",
"isPaid",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_PAID",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
"self",
... | Check whether order is paid.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"paid",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L419-L427 |
225,371 | cmsgears/module-cart | common/models/resources/Order.php | Order.isRefunded | public function isRefunded( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_REFUNDED;
}
return $this->status >= self::STATUS_REFUNDED;
} | php | public function isRefunded( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_REFUNDED;
}
return $this->status >= self::STATUS_REFUNDED;
} | [
"public",
"function",
"isRefunded",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_REFUNDED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
"s... | Check whether order is refunded.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"refunded",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L435-L443 |
225,372 | cmsgears/module-cart | common/models/resources/Order.php | Order.isConfirmed | public function isConfirmed( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_CONFIRMED;
}
return $this->status >= self::STATUS_CONFIRMED;
} | php | public function isConfirmed( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_CONFIRMED;
}
return $this->status >= self::STATUS_CONFIRMED;
} | [
"public",
"function",
"isConfirmed",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_CONFIRMED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
... | Check whether order is confirmed.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"confirmed",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L451-L459 |
225,373 | cmsgears/module-cart | common/models/resources/Order.php | Order.isProcessed | public function isProcessed( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_PROCESSED;
}
return $this->status >= self::STATUS_PROCESSED;
} | php | public function isProcessed( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_PROCESSED;
}
return $this->status >= self::STATUS_PROCESSED;
} | [
"public",
"function",
"isProcessed",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_PROCESSED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
... | Check whether order is processed.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"processed",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L467-L475 |
225,374 | cmsgears/module-cart | common/models/resources/Order.php | Order.isShipped | public function isShipped( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_SHIPPED;
}
return $this->status >= self::STATUS_SHIPPED;
} | php | public function isShipped( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_SHIPPED;
}
return $this->status >= self::STATUS_SHIPPED;
} | [
"public",
"function",
"isShipped",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_SHIPPED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
"sel... | Check whether order is shipped.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"shipped",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L483-L491 |
225,375 | cmsgears/module-cart | common/models/resources/Order.php | Order.isDelivered | public function isDelivered( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_DELIVERED;
}
return $this->status >= self::STATUS_DELIVERED;
} | php | public function isDelivered( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_DELIVERED;
}
return $this->status >= self::STATUS_DELIVERED;
} | [
"public",
"function",
"isDelivered",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_DELIVERED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
... | Check whether order is delivered.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"delivered",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L499-L507 |
225,376 | cmsgears/module-cart | common/models/resources/Order.php | Order.isReturned | public function isReturned( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_RETURNED;
}
return $this->status >= self::STATUS_RETURNED;
} | php | public function isReturned( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_RETURNED;
}
return $this->status >= self::STATUS_RETURNED;
} | [
"public",
"function",
"isReturned",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_RETURNED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
"s... | Check whether order is returned.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"returned",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L515-L523 |
225,377 | cmsgears/module-cart | common/models/resources/Order.php | Order.isDispute | public function isDispute( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_DISPUTE;
}
return $this->status >= self::STATUS_DISPUTE;
} | php | public function isDispute( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_DISPUTE;
}
return $this->status >= self::STATUS_DISPUTE;
} | [
"public",
"function",
"isDispute",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_DISPUTE",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
"sel... | Check whether order is under dispute.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"under",
"dispute",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L531-L539 |
225,378 | cmsgears/module-cart | common/models/resources/Order.php | Order.isCompleted | public function isCompleted( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_COMPLETED;
}
return $this->status >= self::STATUS_COMPLETED;
} | php | public function isCompleted( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_COMPLETED;
}
return $this->status >= self::STATUS_COMPLETED;
} | [
"public",
"function",
"isCompleted",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_COMPLETED",
";",
"}",
"return",
"$",
"this",
"->",
"status",
">=",
... | Check whether order is completed.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"completed",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L547-L555 |
225,379 | cmsgears/module-cart | common/models/resources/Order.php | Order.isPrintable | public function isPrintable( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_COMPLETED;
}
return in_array( $this->status, [ self::STATUS_PAID, self::STATUS_DELIVERED, self::STATUS_COMPLETED ] );
} | php | public function isPrintable( $strict = true ) {
if( $strict ) {
return $this->status == self::STATUS_COMPLETED;
}
return in_array( $this->status, [ self::STATUS_PAID, self::STATUS_DELIVERED, self::STATUS_COMPLETED ] );
} | [
"public",
"function",
"isPrintable",
"(",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"strict",
")",
"{",
"return",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_COMPLETED",
";",
"}",
"return",
"in_array",
"(",
"$",
"this",
"->",
... | Check whether order is printable.
$param boolean $strict
@return boolean | [
"Check",
"whether",
"order",
"is",
"printable",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Order.php#L563-L571 |
225,380 | cloudcreativity/utils-object | src/ObjectProxyTrait.php | ObjectProxyTrait.getMany | public function getMany(...$keys)
{
$ret = [];
foreach ($this->normalizeKeys($keys) as $key) {
if ($this->has($key)) {
$ret[$key] = $this->proxy->{$key};
}
}
return $ret;
} | php | public function getMany(...$keys)
{
$ret = [];
foreach ($this->normalizeKeys($keys) as $key) {
if ($this->has($key)) {
$ret[$key] = $this->proxy->{$key};
}
}
return $ret;
} | [
"public",
"function",
"getMany",
"(",
"...",
"$",
"keys",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"normalizeKeys",
"(",
"$",
"keys",
")",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",... | Get properties if they exist.
@param array ...$keys
@return array | [
"Get",
"properties",
"if",
"they",
"exist",
"."
] | 4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2 | https://github.com/cloudcreativity/utils-object/blob/4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2/src/ObjectProxyTrait.php#L65-L76 |
225,381 | cloudcreativity/utils-object | src/ObjectProxyTrait.php | ObjectProxyTrait.addProperties | public function addProperties(array $values)
{
foreach ($values as $key => $value) {
$this->add($key, $value);
}
return $this;
} | php | public function addProperties(array $values)
{
foreach ($values as $key => $value) {
$this->add($key, $value);
}
return $this;
} | [
"public",
"function",
"addProperties",
"(",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"return",
"$... | Add many properties.
@param array $values
@return $this | [
"Add",
"many",
"properties",
"."
] | 4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2 | https://github.com/cloudcreativity/utils-object/blob/4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2/src/ObjectProxyTrait.php#L125-L132 |
225,382 | cloudcreativity/utils-object | src/ObjectProxyTrait.php | ObjectProxyTrait.reduce | public function reduce(...$keys)
{
$keys = $this->normalizeKeys($keys);
foreach ($this->keys() as $key) {
if (!in_array($key, $keys, true)) {
$this->remove($key);
}
}
return $this;
} | php | public function reduce(...$keys)
{
$keys = $this->normalizeKeys($keys);
foreach ($this->keys() as $key) {
if (!in_array($key, $keys, true)) {
$this->remove($key);
}
}
return $this;
} | [
"public",
"function",
"reduce",
"(",
"...",
"$",
"keys",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"normalizeKeys",
"(",
"$",
"keys",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"keys",
"(",
")",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"!"... | Reduce this object so that it only has the supplied allowed keys.
@param array ...$keys
@return $this | [
"Reduce",
"this",
"object",
"so",
"that",
"it",
"only",
"has",
"the",
"supplied",
"allowed",
"keys",
"."
] | 4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2 | https://github.com/cloudcreativity/utils-object/blob/4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2/src/ObjectProxyTrait.php#L183-L194 |
225,383 | cloudcreativity/utils-object | src/ObjectProxyTrait.php | ObjectProxyTrait.rename | public function rename($currentKey, $newKey)
{
if ($this->has($currentKey)) {
$this->set($newKey, $this->proxy->{$currentKey})->remove($currentKey);
}
return $this;
} | php | public function rename($currentKey, $newKey)
{
if ($this->has($currentKey)) {
$this->set($newKey, $this->proxy->{$currentKey})->remove($currentKey);
}
return $this;
} | [
"public",
"function",
"rename",
"(",
"$",
"currentKey",
",",
"$",
"newKey",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"currentKey",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"newKey",
",",
"$",
"this",
"->",
"proxy",
"->",... | If the object has the current key, rename it to the new key name.
@param $currentKey
@param $newKey
@return $this | [
"If",
"the",
"object",
"has",
"the",
"current",
"key",
"rename",
"it",
"to",
"the",
"new",
"key",
"name",
"."
] | 4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2 | https://github.com/cloudcreativity/utils-object/blob/4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2/src/ObjectProxyTrait.php#L211-L218 |
225,384 | cloudcreativity/utils-object | src/ObjectProxyTrait.php | ObjectProxyTrait.renameKeys | public function renameKeys(array $mapping)
{
foreach ($mapping as $currentKey => $newKey) {
$this->rename($currentKey, $newKey);
}
return $this;
} | php | public function renameKeys(array $mapping)
{
foreach ($mapping as $currentKey => $newKey) {
$this->rename($currentKey, $newKey);
}
return $this;
} | [
"public",
"function",
"renameKeys",
"(",
"array",
"$",
"mapping",
")",
"{",
"foreach",
"(",
"$",
"mapping",
"as",
"$",
"currentKey",
"=>",
"$",
"newKey",
")",
"{",
"$",
"this",
"->",
"rename",
"(",
"$",
"currentKey",
",",
"$",
"newKey",
")",
";",
"}"... | Rename many current keys to new keys.
@param array $mapping
@return $this | [
"Rename",
"many",
"current",
"keys",
"to",
"new",
"keys",
"."
] | 4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2 | https://github.com/cloudcreativity/utils-object/blob/4b12016a0a6e5412d26472b2ffcdeadc5dd43ec2/src/ObjectProxyTrait.php#L226-L233 |
225,385 | SetBased/php-abc-table-detail | src/TableRow/TextTableRow.php | TextTableRow.addRow | public static function addRow(DetailTable $table, $header, ?string $text): void
{
if ($text!==null && $text!=='')
{
$table->addRow($header, ['class' => 'text'], $text);
}
else
{
$table->addRow($header);
}
} | php | public static function addRow(DetailTable $table, $header, ?string $text): void
{
if ($text!==null && $text!=='')
{
$table->addRow($header, ['class' => 'text'], $text);
}
else
{
$table->addRow($header);
}
} | [
"public",
"static",
"function",
"addRow",
"(",
"DetailTable",
"$",
"table",
",",
"$",
"header",
",",
"?",
"string",
"$",
"text",
")",
":",
"void",
"{",
"if",
"(",
"$",
"text",
"!==",
"null",
"&&",
"$",
"text",
"!==",
"''",
")",
"{",
"$",
"table",
... | Adds a row with a text value to a detail table.
@param DetailTable $table The detail table.
@param string|int|null $header The header text of this table row.
@param string|null $text The text. | [
"Adds",
"a",
"row",
"with",
"a",
"text",
"value",
"to",
"a",
"detail",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/TableRow/TextTableRow.php#L20-L30 |
225,386 | DrNixx/yii2-onix | src/Env.php | Env.getCurrentDir | public static function getCurrentDir($object)
{
if (empty($object)) {
return '';
}
$child = new \ReflectionClass($object);
return dirname($child->getFileName());
} | php | public static function getCurrentDir($object)
{
if (empty($object)) {
return '';
}
$child = new \ReflectionClass($object);
return dirname($child->getFileName());
} | [
"public",
"static",
"function",
"getCurrentDir",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"object",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"child",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"object",
")",
";",
"return",... | Get the current directory of the extended class object
@param object $object the called object instance
@return string | [
"Get",
"the",
"current",
"directory",
"of",
"the",
"extended",
"class",
"object"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/Env.php#L33-L41 |
225,387 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.lower | public function lower($key)
{
if ($this->root) {
$lower = $this->root->find($key, $this->comparator, -2);
} else {
$lower = null;
}
if ($lower) {
return $lower;
} else {
throw new \OutOfBoundsException('Lower element unexisting... | php | public function lower($key)
{
if ($this->root) {
$lower = $this->root->find($key, $this->comparator, -2);
} else {
$lower = null;
}
if ($lower) {
return $lower;
} else {
throw new \OutOfBoundsException('Lower element unexisting... | [
"public",
"function",
"lower",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"lower",
"=",
"$",
"this",
"->",
"root",
"->",
"find",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"comparator",
",",
"-",
"2",
")",
"... | Returns the element whose key is the greatest key lesser than the given key or
throw an exception if there is no such element
@param mixed $key The searched key
@return mixed The found element
@throws \OutOfBoundsException If there is no lower element | [
"Returns",
"the",
"element",
"whose",
"key",
"is",
"the",
"greatest",
"key",
"lesser",
"than",
"the",
"given",
"key",
"or",
"throw",
"an",
"exception",
"if",
"there",
"is",
"no",
"such",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L132-L145 |
225,388 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.floor | public function floor($key)
{
if ($this->root) {
$floor = $this->root->find($key, $this->comparator, -1);
} else {
$floor = null;
}
if ($floor) {
return $floor;
} else {
throw new \OutOfBoundsException('Floor element unexisting... | php | public function floor($key)
{
if ($this->root) {
$floor = $this->root->find($key, $this->comparator, -1);
} else {
$floor = null;
}
if ($floor) {
return $floor;
} else {
throw new \OutOfBoundsException('Floor element unexisting... | [
"public",
"function",
"floor",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"floor",
"=",
"$",
"this",
"->",
"root",
"->",
"find",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"comparator",
",",
"-",
"1",
")",
"... | Returns the element whose key is the greatest key lesser than or equal to the given key or throw
an exception if there is no such element
@param mixed $key The searched key
@return mixed The found element
@throws \OutOfBoundsException If there is no floor element | [
"Returns",
"the",
"element",
"whose",
"key",
"is",
"the",
"greatest",
"key",
"lesser",
"than",
"or",
"equal",
"to",
"the",
"given",
"key",
"or",
"throw",
"an",
"exception",
"if",
"there",
"is",
"no",
"such",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L155-L168 |
225,389 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.find | public function find($key)
{
if ($this->root) {
$find = $this->root->find($key, $this->comparator, 0);
} else {
$find = null;
}
if ($find) {
return $find;
} else {
throw new \OutOfBoundsException('Element unexisting');
... | php | public function find($key)
{
if ($this->root) {
$find = $this->root->find($key, $this->comparator, 0);
} else {
$find = null;
}
if ($find) {
return $find;
} else {
throw new \OutOfBoundsException('Element unexisting');
... | [
"public",
"function",
"find",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"find",
"=",
"$",
"this",
"->",
"root",
"->",
"find",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"comparator",
",",
"0",
")",
";",
"}"... | Returns the element whose key is equal to the given key or throw an exception if there is no such element
@param mixed $key The searched key
@return TreeNode|null The found element
@throws \OutOfBoundsException If there is no such element | [
"Returns",
"the",
"element",
"whose",
"key",
"is",
"equal",
"to",
"the",
"given",
"key",
"or",
"throw",
"an",
"exception",
"if",
"there",
"is",
"no",
"such",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L176-L189 |
225,390 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.ceiling | public function ceiling($key)
{
if ($this->root) {
$ceiling = $this->root->find($key, $this->comparator, 1);
} else {
$ceiling = null;
}
if ($ceiling) {
return $ceiling;
} else {
throw new \OutOfBoundsException('Ceiling element... | php | public function ceiling($key)
{
if ($this->root) {
$ceiling = $this->root->find($key, $this->comparator, 1);
} else {
$ceiling = null;
}
if ($ceiling) {
return $ceiling;
} else {
throw new \OutOfBoundsException('Ceiling element... | [
"public",
"function",
"ceiling",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"ceiling",
"=",
"$",
"this",
"->",
"root",
"->",
"find",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"comparator",
",",
"1",
")",
";",... | Returns the element whose key is the lowest key greater than or equal to the given key or
throw an exception if there is no such element
@param mixed $key The searched key
@return mixed The found element
@throws \OutOfBoundsException If there is no ceiling element | [
"Returns",
"the",
"element",
"whose",
"key",
"is",
"the",
"lowest",
"key",
"greater",
"than",
"or",
"equal",
"to",
"the",
"given",
"key",
"or",
"throw",
"an",
"exception",
"if",
"there",
"is",
"no",
"such",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L199-L212 |
225,391 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.higher | public function higher($key)
{
if ($this->root) {
$higher = $this->root->find($key, $this->comparator, 2);
} else {
$higher = null;
}
if ($higher) {
return $higher;
} else {
throw new \OutOfBoundsException('Higher element unexi... | php | public function higher($key)
{
if ($this->root) {
$higher = $this->root->find($key, $this->comparator, 2);
} else {
$higher = null;
}
if ($higher) {
return $higher;
} else {
throw new \OutOfBoundsException('Higher element unexi... | [
"public",
"function",
"higher",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"higher",
"=",
"$",
"this",
"->",
"root",
"->",
"find",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"comparator",
",",
"2",
")",
";",
... | Returns the element whose key is the lowest key greater than to the given key or
throw an exception if there is no such element
@param mixed $key The searched key
@return mixed The found element
@throws \OutOfBoundsException If there is no higher element | [
"Returns",
"the",
"element",
"whose",
"key",
"is",
"the",
"lowest",
"key",
"greater",
"than",
"to",
"the",
"given",
"key",
"or",
"throw",
"an",
"exception",
"if",
"there",
"is",
"no",
"such",
"element"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L222-L235 |
225,392 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.putAll | public function putAll($map)
{
foreach ($map as $key => $val) {
$this->put($key, $val);
}
return $this;
} | php | public function putAll($map)
{
foreach ($map as $key => $val) {
$this->put($key, $val);
}
return $this;
} | [
"public",
"function",
"putAll",
"(",
"$",
"map",
")",
"{",
"foreach",
"(",
"$",
"map",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"put",
"(",
"$",
"key",
",",
"$",
"val",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"
] | Initialise the map
@param MapInterface|array $map Values to initialise the map
@return TreeMap $this for chaining | [
"Initialise",
"the",
"map"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L255-L262 |
225,393 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.offsetSet | public function offsetSet($key, $value)
{
if ($this->root) {
$this->root = $this->root->insert($key, $value, $this->comparator);
} else {
$this->root = TreeNode::create($key, $value);
}
} | php | public function offsetSet($key, $value)
{
if ($this->root) {
$this->root = $this->root->insert($key, $value, $this->comparator);
} else {
$this->root = TreeNode::create($key, $value);
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"this",
"->",
"root",
"=",
"$",
"this",
"->",
"root",
"->",
"insert",
"(",
"$",
"key",
",",
"$",
"value",
",",... | Set the value for a key
@param mixed $key The key
@param mixed $value The value
@return void | [
"Set",
"the",
"value",
"for",
"a",
"key"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L313-L320 |
225,394 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.offsetUnset | public function offsetUnset($key)
{
if ($this->root) {
$this->root = $this->root->remove($key, $this->comparator);
}
} | php | public function offsetUnset($key)
{
if ($this->root) {
$this->root = $this->root->remove($key, $this->comparator);
}
} | [
"public",
"function",
"offsetUnset",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"root",
")",
"{",
"$",
"this",
"->",
"root",
"=",
"$",
"this",
"->",
"root",
"->",
"remove",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"comparator",
")",... | Unset the existence of a key
@param mixed $key The key
@return void | [
"Unset",
"the",
"existence",
"of",
"a",
"key"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L327-L332 |
225,395 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.containsValue | public function containsValue($value)
{
foreach ($this->values() as $v) {
if ($v === $value) {
return true;
}
}
return false;
} | php | public function containsValue($value)
{
foreach ($this->values() as $v) {
if ($v === $value) {
return true;
}
}
return false;
} | [
"public",
"function",
"containsValue",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"values",
"(",
")",
"as",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"$",
"value",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
... | Returns `true` if this map maps one or more keys to the specified value.
@param mixed $value Value whose presence in this map is to be tested.
@return bool `true` if this map maps one or more keys to the value, otherwise `false`.
@throws NullPointerException If the value is null and this map does not permit null... | [
"Returns",
"true",
"if",
"this",
"map",
"maps",
"one",
"or",
"more",
"keys",
"to",
"the",
"specified",
"value",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L461-L470 |
225,396 | DrNixx/yii2-onix | src/collections/TreeMap.php | TreeMap.keySet | public function keySet()
{
$result = [];
$keys = $this->keys();
foreach ($keys as $key) {
$result[] = $key;
}
return $result;
} | php | public function keySet()
{
$result = [];
$keys = $this->keys();
foreach ($keys as $key) {
$result[] = $key;
}
return $result;
} | [
"public",
"function",
"keySet",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"keys",
"=",
"$",
"this",
"->",
"keys",
"(",
")",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"$",
"key",
... | Returns a set view of the keys contained in this map.
@return array Set view of the keys contained in this map. | [
"Returns",
"a",
"set",
"view",
"of",
"the",
"keys",
"contained",
"in",
"this",
"map",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/collections/TreeMap.php#L499-L508 |
225,397 | SetBased/php-abc-html | src/HtmlElement.php | HtmlElement.addClass | public function addClass(?string $class): void
{
// If class is empty return immediately.
if ($class===null || $class==='') return;
if (isset($this->attributes['class']))
{
$this->attributes['class'] .= ' ';
$this->attributes['class'] .= $class;
}
else
{
$this->attribute... | php | public function addClass(?string $class): void
{
// If class is empty return immediately.
if ($class===null || $class==='') return;
if (isset($this->attributes['class']))
{
$this->attributes['class'] .= ' ';
$this->attributes['class'] .= $class;
}
else
{
$this->attribute... | [
"public",
"function",
"addClass",
"(",
"?",
"string",
"$",
"class",
")",
":",
"void",
"{",
"// If class is empty return immediately.",
"if",
"(",
"$",
"class",
"===",
"null",
"||",
"$",
"class",
"===",
"''",
")",
"return",
";",
"if",
"(",
"isset",
"(",
"... | Adds a class to the list of classes.
@param string|null $class The class.
@since 1.0.0
@api | [
"Adds",
"a",
"class",
"to",
"the",
"list",
"of",
"classes",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/HtmlElement.php#L45-L59 |
225,398 | SetBased/php-abc-html | src/HtmlElement.php | HtmlElement.removeClass | public function removeClass(?string $class): void
{
// If class is empty or no classes are set return immediately.
if ($class===null || $class==='' || !isset($this->attributes['class'])) return;
// Remove the class from the list of classes.
$this->attributes['class'] = implode(' ', array_diff(explode... | php | public function removeClass(?string $class): void
{
// If class is empty or no classes are set return immediately.
if ($class===null || $class==='' || !isset($this->attributes['class'])) return;
// Remove the class from the list of classes.
$this->attributes['class'] = implode(' ', array_diff(explode... | [
"public",
"function",
"removeClass",
"(",
"?",
"string",
"$",
"class",
")",
":",
"void",
"{",
"// If class is empty or no classes are set return immediately.",
"if",
"(",
"$",
"class",
"===",
"null",
"||",
"$",
"class",
"===",
"''",
"||",
"!",
"isset",
"(",
"$... | Removes a class from the list of classes.
@param string|null $class The class to be removed.
@since 1.0.0
@api | [
"Removes",
"a",
"class",
"from",
"the",
"list",
"of",
"classes",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/HtmlElement.php#L86-L93 |
225,399 | SetBased/php-abc-html | src/HtmlElement.php | HtmlElement.setFakeAttribute | public function setFakeAttribute(string $name, $value): void
{
if (strpos($name, '_')!==0)
{
throw new LogicException("Attribute '%s' is not a valid fake attribute.", $name);
}
$this->attributes[$name] = $value;
} | php | public function setFakeAttribute(string $name, $value): void
{
if (strpos($name, '_')!==0)
{
throw new LogicException("Attribute '%s' is not a valid fake attribute.", $name);
}
$this->attributes[$name] = $value;
} | [
"public",
"function",
"setFakeAttribute",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'_'",
")",
"!==",
"0",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"\"Attribute '%s' is not ... | Sets a fake attribute. A fake attribute has a name that starts with an underscore. Fake attributes will not be
included in the generated HTML code.
@param string $name The name of the fake attribute.
@param mixed $value The value of the fake attribute.
@since 1.0.0
@api | [
"Sets",
"a",
"fake",
"attribute",
".",
"A",
"fake",
"attribute",
"has",
"a",
"name",
"that",
"starts",
"with",
"an",
"underscore",
".",
"Fake",
"attributes",
"will",
"not",
"be",
"included",
"in",
"the",
"generated",
"HTML",
"code",
"."
] | 4e123c3b477bcd76ed82239711653b85ad5f4b26 | https://github.com/SetBased/php-abc-html/blob/4e123c3b477bcd76ed82239711653b85ad5f4b26/src/HtmlElement.php#L387-L395 |
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.