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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
224,400 | Flowpack/Flowpack.SimpleSearch | Classes/Search/SqLiteQueryBuilder.php | SqLiteQueryBuilder.like | public function like($propertyName, $propertyValue) {
$parameterName = ':' . md5($propertyName . '#' . count($this->where));
$this->where[] = '(`' . $propertyName . '` LIKE ' . $parameterName . ')';
$this->parameterMap[$parameterName] = '%' . $propertyValue . '%';
return $this;
} | php | public function like($propertyName, $propertyValue) {
$parameterName = ':' . md5($propertyName . '#' . count($this->where));
$this->where[] = '(`' . $propertyName . '` LIKE ' . $parameterName . ')';
$this->parameterMap[$parameterName] = '%' . $propertyValue . '%';
return $this;
} | [
"public",
"function",
"like",
"(",
"$",
"propertyName",
",",
"$",
"propertyValue",
")",
"{",
"$",
"parameterName",
"=",
"':'",
".",
"md5",
"(",
"$",
"propertyName",
".",
"'#'",
".",
"count",
"(",
"$",
"this",
"->",
"where",
")",
")",
";",
"$",
"this"... | add an like query for a given property
@param $propertyName
@param $propertyValue
@return QueryBuilderInterface | [
"add",
"an",
"like",
"query",
"for",
"a",
"given",
"property"
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Search/SqLiteQueryBuilder.php#L128-L134 |
224,401 | Flowpack/Flowpack.SimpleSearch | Classes/Search/SqLiteQueryBuilder.php | SqLiteQueryBuilder.execute | public function execute() {
$query = $this->buildQueryString();
$result = $this->indexClient->executeStatement($query, $this->parameterMap);
if (empty($result)) {
return array();
}
return array_values($result);
} | php | public function execute() {
$query = $this->buildQueryString();
$result = $this->indexClient->executeStatement($query, $this->parameterMap);
if (empty($result)) {
return array();
}
return array_values($result);
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"buildQueryString",
"(",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"indexClient",
"->",
"executeStatement",
"(",
"$",
"query",
",",
"$",
"this",
"->",
"paramet... | Execute the query and return the list of results
@return array | [
"Execute",
"the",
"query",
"and",
"return",
"the",
"list",
"of",
"results"
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Search/SqLiteQueryBuilder.php#L198-L207 |
224,402 | Flowpack/Flowpack.SimpleSearch | Classes/Search/SqLiteQueryBuilder.php | SqLiteQueryBuilder.fulltextMatchResult | public function fulltextMatchResult($searchword, $resultTokens = 60, $ellipsis = '...', $beginModifier = '<b>', $endModifier = '</b>') {
$query = $this->buildQueryString();
$results = $this->indexClient->query($query);
// SQLite3 has a hard-coded limit of 999 query variables, so we split the $result in chunks
... | php | public function fulltextMatchResult($searchword, $resultTokens = 60, $ellipsis = '...', $beginModifier = '<b>', $endModifier = '</b>') {
$query = $this->buildQueryString();
$results = $this->indexClient->query($query);
// SQLite3 has a hard-coded limit of 999 query variables, so we split the $result in chunks
... | [
"public",
"function",
"fulltextMatchResult",
"(",
"$",
"searchword",
",",
"$",
"resultTokens",
"=",
"60",
",",
"$",
"ellipsis",
"=",
"'...'",
",",
"$",
"beginModifier",
"=",
"'<b>'",
",",
"$",
"endModifier",
"=",
"'</b>'",
")",
"{",
"$",
"query",
"=",
"$... | Produces a snippet with the first match result for the search term.
@param string $searchword The search word
@param integer $resultTokens The amount of tokens (words) to get surrounding the match hit. (defaults to 60)
@param string $ellipsis added to the end of the string if the text was longer than the snippet produ... | [
"Produces",
"a",
"snippet",
"with",
"the",
"first",
"match",
"result",
"for",
"the",
"search",
"term",
"."
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Search/SqLiteQueryBuilder.php#L229-L262 |
224,403 | Flowpack/Flowpack.SimpleSearch | Classes/Search/SqLiteQueryBuilder.php | SqLiteQueryBuilder.anyMatch | public function anyMatch($propertyName, $propertyValues) {
if ($propertyValues === null || empty($propertyValues) || $propertyValues[0] === null) {
return $this;
}
$queryString = null;
$lastElemtentKey = count($propertyValues) - 1;
foreach($propertyValues as $key => $propertyValue) {
$parameterName = '... | php | public function anyMatch($propertyName, $propertyValues) {
if ($propertyValues === null || empty($propertyValues) || $propertyValues[0] === null) {
return $this;
}
$queryString = null;
$lastElemtentKey = count($propertyValues) - 1;
foreach($propertyValues as $key => $propertyValue) {
$parameterName = '... | [
"public",
"function",
"anyMatch",
"(",
"$",
"propertyName",
",",
"$",
"propertyValues",
")",
"{",
"if",
"(",
"$",
"propertyValues",
"===",
"null",
"||",
"empty",
"(",
"$",
"propertyValues",
")",
"||",
"$",
"propertyValues",
"[",
"0",
"]",
"===",
"null",
... | Match any value in the given array for the property
@param string $propertyName
@param array $propertyValues
@return QueryBuilder | [
"Match",
"any",
"value",
"in",
"the",
"given",
"array",
"for",
"the",
"property"
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Search/SqLiteQueryBuilder.php#L271-L295 |
224,404 | joomla-framework/language | src/Language.php | Language.getPaths | public function getPaths($extension = null)
{
if (isset($extension))
{
if (isset($this->paths[$extension]))
{
return $this->paths[$extension];
}
return;
}
return $this->paths;
} | php | public function getPaths($extension = null)
{
if (isset($extension))
{
if (isset($this->paths[$extension]))
{
return $this->paths[$extension];
}
return;
}
return $this->paths;
} | [
"public",
"function",
"getPaths",
"(",
"$",
"extension",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"extension",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"paths",
"[",
"$",
"extension",
"]",
")",
")",
"{",
"return",
"$... | Get a list of language files that have been loaded.
@param string $extension An optional extension name.
@return array
@since 1.0 | [
"Get",
"a",
"list",
"of",
"language",
"files",
"that",
"have",
"been",
"loaded",
"."
] | 94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf | https://github.com/joomla-framework/language/blob/94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf/src/Language.php#L1032-L1045 |
224,405 | tomloprod/ionic-push-php | src/Api/DeviceTokens.php | DeviceTokens.paginatedList | public function paginatedList($parameters = [])
{
return $this->sendRequest(
self::METHOD_GET,
self::$endPoints['list'] . '?' . http_build_query($parameters)
);
} | php | public function paginatedList($parameters = [])
{
return $this->sendRequest(
self::METHOD_GET,
self::$endPoints['list'] . '?' . http_build_query($parameters)
);
} | [
"public",
"function",
"paginatedList",
"(",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"sendRequest",
"(",
"self",
"::",
"METHOD_GET",
",",
"self",
"::",
"$",
"endPoints",
"[",
"'list'",
"]",
".",
"'?'",
".",
"http_build_que... | Paginated listing of tokens.
@link https://docs.ionic.io/api/endpoints/push.html#get-tokens Ionic documentation
@param array $parameters
@return object $response | [
"Paginated",
"listing",
"of",
"tokens",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/DeviceTokens.php#L35-L41 |
224,406 | tomloprod/ionic-push-php | src/Api/DeviceTokens.php | DeviceTokens.listAssociatedUsers | public function listAssociatedUsers($deviceToken, $parameters = [])
{
return $this->prepareRequest(
self::METHOD_GET,
$deviceToken,
self::$endPoints['listAssociatedUsers'] . '?' . http_build_query($parameters)
);
} | php | public function listAssociatedUsers($deviceToken, $parameters = [])
{
return $this->prepareRequest(
self::METHOD_GET,
$deviceToken,
self::$endPoints['listAssociatedUsers'] . '?' . http_build_query($parameters)
);
} | [
"public",
"function",
"listAssociatedUsers",
"(",
"$",
"deviceToken",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"prepareRequest",
"(",
"self",
"::",
"METHOD_GET",
",",
"$",
"deviceToken",
",",
"self",
"::",
"$",
"endPoin... | List users associated with the indicated token
@link https://docs.ionic.io/api/endpoints/push.html#get-tokens-token_id-users Ionic documentation
@param string $deviceToken - Device token
@param array $parameters - Query parameters (pagination).
@return object $response | [
"List",
"users",
"associated",
"with",
"the",
"indicated",
"token"
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/DeviceTokens.php#L116-L123 |
224,407 | tomloprod/ionic-push-php | src/Api/DeviceTokens.php | DeviceTokens.associateUser | public function associateUser($deviceToken, $userId)
{
// Replace :user_id by $userId
$endPoint = str_replace(':user_id', $userId, self::$endPoints['associateUser']);
return $this->prepareRequest(
self::METHOD_POST,
$deviceToken,
$endPoint
);
} | php | public function associateUser($deviceToken, $userId)
{
// Replace :user_id by $userId
$endPoint = str_replace(':user_id', $userId, self::$endPoints['associateUser']);
return $this->prepareRequest(
self::METHOD_POST,
$deviceToken,
$endPoint
);
} | [
"public",
"function",
"associateUser",
"(",
"$",
"deviceToken",
",",
"$",
"userId",
")",
"{",
"// Replace :user_id by $userId",
"$",
"endPoint",
"=",
"str_replace",
"(",
"':user_id'",
",",
"$",
"userId",
",",
"self",
"::",
"$",
"endPoints",
"[",
"'associateUser'... | Associate the indicated user with the indicated device token
@link https://docs.ionic.io/api/endpoints/push.html#post-tokens-token_id-users-user_id Ionic documentation
@param string $deviceToken - Device token
@param string $userId - User id
@return object $response | [
"Associate",
"the",
"indicated",
"user",
"with",
"the",
"indicated",
"device",
"token"
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/DeviceTokens.php#L133-L142 |
224,408 | tomloprod/ionic-push-php | src/Api/DeviceTokens.php | DeviceTokens.dissociateUser | public function dissociateUser($deviceToken, $userId)
{
// Replace :user_id by $userId
$endPoint = str_replace(':user_id', $userId, self::$endPoints['dissociateUser']);
return $this->prepareRequest(
self::METHOD_DELETE,
$deviceToken,
$endPoint
);
... | php | public function dissociateUser($deviceToken, $userId)
{
// Replace :user_id by $userId
$endPoint = str_replace(':user_id', $userId, self::$endPoints['dissociateUser']);
return $this->prepareRequest(
self::METHOD_DELETE,
$deviceToken,
$endPoint
);
... | [
"public",
"function",
"dissociateUser",
"(",
"$",
"deviceToken",
",",
"$",
"userId",
")",
"{",
"// Replace :user_id by $userId",
"$",
"endPoint",
"=",
"str_replace",
"(",
"':user_id'",
",",
"$",
"userId",
",",
"self",
"::",
"$",
"endPoints",
"[",
"'dissociateUse... | Dissociate the indicated user with the indicated device token
@link https://docs.ionic.io/api/endpoints/push.html#delete-tokens-token_id-users-user_id Ionic documentation
@param string $deviceToken - Device token
@param string $userId - User id
@return object $response | [
"Dissociate",
"the",
"indicated",
"user",
"with",
"the",
"indicated",
"device",
"token"
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/DeviceTokens.php#L152-L161 |
224,409 | projek-xyz/slim-framework | src/Database/Models.php | Models.show | public static function show($terms = null, array $columns = [])
{
$self = self::newSelf();
if (!$self->table()) {
return false;
}
$query = $self->select($columns);
$self->normalizeTerms($query, $terms);
$model = $self->attributes? static::class : $self... | php | public static function show($terms = null, array $columns = [])
{
$self = self::newSelf();
if (!$self->table()) {
return false;
}
$query = $self->select($columns);
$self->normalizeTerms($query, $terms);
$model = $self->attributes? static::class : $self... | [
"public",
"static",
"function",
"show",
"(",
"$",
"terms",
"=",
"null",
",",
"array",
"$",
"columns",
"=",
"[",
"]",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"newSelf",
"(",
")",
";",
"if",
"(",
"!",
"$",
"self",
"->",
"table",
"(",
")",
")",
... | Show specific or all data
@param mixed $terms
@param array $columns
@return Results|false | [
"Show",
"specific",
"or",
"all",
"data"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L69-L84 |
224,410 | projek-xyz/slim-framework | src/Database/Models.php | Models.create | public static function create(array $pairs = null)
{
$self = self::newSelf($pairs);
if (!empty($self->attributes) && null === $pairs) {
$pairs = $self->attributes;
}
if (!$self->table()) {
return false;
}
if (empty($pairs)) {
thr... | php | public static function create(array $pairs = null)
{
$self = self::newSelf($pairs);
if (!empty($self->attributes) && null === $pairs) {
$pairs = $self->attributes;
}
if (!$self->table()) {
return false;
}
if (empty($pairs)) {
thr... | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"pairs",
"=",
"null",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"newSelf",
"(",
"$",
"pairs",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"self",
"->",
"attributes",
")",
"&&",
"null",
... | Create new data
@param array $pairs
@return int|false | [
"Create",
"new",
"data"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L93-L122 |
224,411 | projek-xyz/slim-framework | src/Database/Models.php | Models.patch | public static function patch($pairs = null, $terms = null)
{
$self = self::newSelf();
if (!$self->table()) {
return false;
}
if (!empty($self->attributes) && null === $terms) {
$terms = $self->attributes;
}
if (empty($pairs)) {
t... | php | public static function patch($pairs = null, $terms = null)
{
$self = self::newSelf();
if (!$self->table()) {
return false;
}
if (!empty($self->attributes) && null === $terms) {
$terms = $self->attributes;
}
if (empty($pairs)) {
t... | [
"public",
"static",
"function",
"patch",
"(",
"$",
"pairs",
"=",
"null",
",",
"$",
"terms",
"=",
"null",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"newSelf",
"(",
")",
";",
"if",
"(",
"!",
"$",
"self",
"->",
"table",
"(",
")",
")",
"{",
"return... | Update spesific data
@param array $pairs
@param mixed $terms
@return int|false | [
"Update",
"spesific",
"data"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L132-L163 |
224,412 | projek-xyz/slim-framework | src/Database/Models.php | Models.delete | public static function delete($terms = null)
{
$self = static::newSelf($terms);
if (!empty($self->attributes) && null === $terms) {
$terms = $self->attributes[$self->primary()];
}
if (empty($terms)) {
throw new \LogicException('Could not delete empty data');... | php | public static function delete($terms = null)
{
$self = static::newSelf($terms);
if (!empty($self->attributes) && null === $terms) {
$terms = $self->attributes[$self->primary()];
}
if (empty($terms)) {
throw new \LogicException('Could not delete empty data');... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"terms",
"=",
"null",
")",
"{",
"$",
"self",
"=",
"static",
"::",
"newSelf",
"(",
"$",
"terms",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"self",
"->",
"attributes",
")",
"&&",
"null",
"===",
... | Delete specific data
@param mixed $terms
@return int|false | [
"Delete",
"specific",
"data"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L172-L197 |
224,413 | projek-xyz/slim-framework | src/Database/Models.php | Models.restore | public static function restore($terms = null)
{
$self = self::newSelf();
if ($self->softDeletes) {
return $self->patch([self::DELETED => '0000-00-00 00:00:00'], $terms);
}
return false;
} | php | public static function restore($terms = null)
{
$self = self::newSelf();
if ($self->softDeletes) {
return $self->patch([self::DELETED => '0000-00-00 00:00:00'], $terms);
}
return false;
} | [
"public",
"static",
"function",
"restore",
"(",
"$",
"terms",
"=",
"null",
")",
"{",
"$",
"self",
"=",
"self",
"::",
"newSelf",
"(",
")",
";",
"if",
"(",
"$",
"self",
"->",
"softDeletes",
")",
"{",
"return",
"$",
"self",
"->",
"patch",
"(",
"[",
... | Restore soft-deleted data
@param mixed $terms
@return int|false | [
"Restore",
"soft",
"-",
"deleted",
"data"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L206-L215 |
224,414 | projek-xyz/slim-framework | src/Database/Models.php | Models.count | public function count($terms = null)
{
if (!$this->table()) {
return 0;
}
$query = $this->select(['count(*) count']);
$this->normalizeTerms($query, $terms);
return (int) $query->execute()->fetch()['count'];
} | php | public function count($terms = null)
{
if (!$this->table()) {
return 0;
}
$query = $this->select(['count(*) count']);
$this->normalizeTerms($query, $terms);
return (int) $query->execute()->fetch()['count'];
} | [
"public",
"function",
"count",
"(",
"$",
"terms",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"table",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"$",
"query",
"=",
"$",
"this",
"->",
"select",
"(",
"[",
"'count(*) count'",
"]",
... | Count all data
@param callable|array|int $terms
@return int | [
"Count",
"all",
"data"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L224-L235 |
224,415 | projek-xyz/slim-framework | src/Database/Models.php | Models.select | protected function select(array $columns = [])
{
$columns = !is_array($columns) ? func_get_args() : $columns;
if (empty($columns)) {
$columns = ['*'];
}
return static::db()->select($columns)->from($this->table());
} | php | protected function select(array $columns = [])
{
$columns = !is_array($columns) ? func_get_args() : $columns;
if (empty($columns)) {
$columns = ['*'];
}
return static::db()->select($columns)->from($this->table());
} | [
"protected",
"function",
"select",
"(",
"array",
"$",
"columns",
"=",
"[",
"]",
")",
"{",
"$",
"columns",
"=",
"!",
"is_array",
"(",
"$",
"columns",
")",
"?",
"func_get_args",
"(",
")",
":",
"$",
"columns",
";",
"if",
"(",
"empty",
"(",
"$",
"colum... | Select data from table
@param array $columns
@return \Slim\PDO\Statement\SelectStatement | [
"Select",
"data",
"from",
"table"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L284-L293 |
224,416 | projek-xyz/slim-framework | src/Database/Models.php | Models.normalizeTerms | protected function normalizeTerms(StatementContainer $stmt, $terms)
{
if ($terms instanceof Models) {
$terms = $terms->key();
}
if (is_callable($terms)) {
$terms($stmt);
} elseif (is_numeric($terms) && !is_float($terms)) {
$stmt->where($this->prim... | php | protected function normalizeTerms(StatementContainer $stmt, $terms)
{
if ($terms instanceof Models) {
$terms = $terms->key();
}
if (is_callable($terms)) {
$terms($stmt);
} elseif (is_numeric($terms) && !is_float($terms)) {
$stmt->where($this->prim... | [
"protected",
"function",
"normalizeTerms",
"(",
"StatementContainer",
"$",
"stmt",
",",
"$",
"terms",
")",
"{",
"if",
"(",
"$",
"terms",
"instanceof",
"Models",
")",
"{",
"$",
"terms",
"=",
"$",
"terms",
"->",
"key",
"(",
")",
";",
"}",
"if",
"(",
"i... | Normalize query terms
@param \Slim\PDO\Statement\StatementContainer $stmt
@param Models|array|int|callable $terms
@return void | [
"Normalize",
"query",
"terms"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Database/Models.php#L387-L413 |
224,417 | coderatio/phpfirebase | src/PhpFirebase.php | PhpFirebase.getRecord | public function getRecord(int $recordID)
{
foreach ($this->getRecords() as $key => $record) {
if ($record[$this->primaryKey] == $recordID) {
return $record;
}
}
return null;
} | php | public function getRecord(int $recordID)
{
foreach ($this->getRecords() as $key => $record) {
if ($record[$this->primaryKey] == $recordID) {
return $record;
}
}
return null;
} | [
"public",
"function",
"getRecord",
"(",
"int",
"$",
"recordID",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRecords",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"record",
"[",
"$",
"this",
"->",
"primaryKey",
"]... | This function returns a specific record by id
@param int $recordID
@return null|array | [
"This",
"function",
"returns",
"a",
"specific",
"record",
"by",
"id"
] | f9342ef6bf755abc7610c853c958659f5671cd8f | https://github.com/coderatio/phpfirebase/blob/f9342ef6bf755abc7610c853c958659f5671cd8f/src/PhpFirebase.php#L98-L107 |
224,418 | coderatio/phpfirebase | src/PhpFirebase.php | PhpFirebase.updateRecord | public function updateRecord(int $recordID, array $data)
{
foreach ($this->getRecords() as $key => $record) {
if ($recordID == $record[$this->primaryKey]) {
foreach ($data as $dataKey => $dataValue) {
if (isset($record[$dataKey])) {
... | php | public function updateRecord(int $recordID, array $data)
{
foreach ($this->getRecords() as $key => $record) {
if ($recordID == $record[$this->primaryKey]) {
foreach ($data as $dataKey => $dataValue) {
if (isset($record[$dataKey])) {
... | [
"public",
"function",
"updateRecord",
"(",
"int",
"$",
"recordID",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRecords",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"recordID",
"==",
"$... | This function updates a record
It will return updated records
@param int $recordID
@param array $data
@return array | [
"This",
"function",
"updates",
"a",
"record",
"It",
"will",
"return",
"updated",
"records"
] | f9342ef6bf755abc7610c853c958659f5671cd8f | https://github.com/coderatio/phpfirebase/blob/f9342ef6bf755abc7610c853c958659f5671cd8f/src/PhpFirebase.php#L142-L160 |
224,419 | coderatio/phpfirebase | src/PhpFirebase.php | PhpFirebase.deleteRecord | public function deleteRecord(int $recordID) {
foreach ($this->getRecords() as $key => $record) {
if ($record['id'] == $recordID) {
$this->database->getReference()
->getChild($this->table)
->getChild($key)
->set(null);
... | php | public function deleteRecord(int $recordID) {
foreach ($this->getRecords() as $key => $record) {
if ($record['id'] == $recordID) {
$this->database->getReference()
->getChild($this->table)
->getChild($key)
->set(null);
... | [
"public",
"function",
"deleteRecord",
"(",
"int",
"$",
"recordID",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRecords",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"record",
"[",
"'id'",
"]",
"==",
"$",
"recordI... | This function deletes a record from your database.
It will return boolean after action was commited
@param int $recordID
@return bool | [
"This",
"function",
"deletes",
"a",
"record",
"from",
"your",
"database",
".",
"It",
"will",
"return",
"boolean",
"after",
"action",
"was",
"commited"
] | f9342ef6bf755abc7610c853c958659f5671cd8f | https://github.com/coderatio/phpfirebase/blob/f9342ef6bf755abc7610c853c958659f5671cd8f/src/PhpFirebase.php#L169-L182 |
224,420 | projek-xyz/slim-framework | src/Console/Input.php | Input.input | public function input($prompt, $default = '', $acceptable = null, $strict = false)
{
if ($this->hasSttyAvailable()) {
$input = $this->climate->input($prompt);
if (! empty($default)) {
$input->defaultTo($default);
}
if (null !== $acceptable) {... | php | public function input($prompt, $default = '', $acceptable = null, $strict = false)
{
if ($this->hasSttyAvailable()) {
$input = $this->climate->input($prompt);
if (! empty($default)) {
$input->defaultTo($default);
}
if (null !== $acceptable) {... | [
"public",
"function",
"input",
"(",
"$",
"prompt",
",",
"$",
"default",
"=",
"''",
",",
"$",
"acceptable",
"=",
"null",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasSttyAvailable",
"(",
")",
")",
"{",
"$",
"input",
... | Wanna ask something
@param string $prompt The question you want to ask for
@param string $default Default answer
@param array|callable $acceptable Acceptable answer
@param bool $strict Case-sensitife?
@return string | [
"Wanna",
"ask",
"something"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Console/Input.php#L20-L40 |
224,421 | projek-xyz/slim-framework | src/Console/Input.php | Input.password | public function password($prompt)
{
if ($this->hasSttyAvailable()) {
$password = $this->climate->password($prompt);
return $password->prompt();
}
return '';
} | php | public function password($prompt)
{
if ($this->hasSttyAvailable()) {
$password = $this->climate->password($prompt);
return $password->prompt();
}
return '';
} | [
"public",
"function",
"password",
"(",
"$",
"prompt",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasSttyAvailable",
"(",
")",
")",
"{",
"$",
"password",
"=",
"$",
"this",
"->",
"climate",
"->",
"password",
"(",
"$",
"prompt",
")",
";",
"return",
"$",
... | Ask something secretly?
@param string $prompt The question you want to ask for
@return string | [
"Ask",
"something",
"secretly?"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Console/Input.php#L48-L56 |
224,422 | projek-xyz/slim-framework | src/Console/Input.php | Input.confirm | public function confirm($prompt)
{
if ($this->hasSttyAvailable()) {
$confirm = $this->climate->confirm($prompt);
return $confirm->confirmed();
}
return '';
} | php | public function confirm($prompt)
{
if ($this->hasSttyAvailable()) {
$confirm = $this->climate->confirm($prompt);
return $confirm->confirmed();
}
return '';
} | [
"public",
"function",
"confirm",
"(",
"$",
"prompt",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasSttyAvailable",
"(",
")",
")",
"{",
"$",
"confirm",
"=",
"$",
"this",
"->",
"climate",
"->",
"confirm",
"(",
"$",
"prompt",
")",
";",
"return",
"$",
"c... | Choise between yes or no?
@param string $prompt The question you want to ask for
@return bool | [
"Choise",
"between",
"yes",
"or",
"no?"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Console/Input.php#L64-L72 |
224,423 | projek-xyz/slim-framework | src/Console/Input.php | Input.checkboxes | public function checkboxes($prompt, array $options)
{
if ($this->hasSttyAvailable()) {
$checkboxes = $this->climate->checkboxes($prompt, $options);
return $checkboxes->prompt();
}
return '';
} | php | public function checkboxes($prompt, array $options)
{
if ($this->hasSttyAvailable()) {
$checkboxes = $this->climate->checkboxes($prompt, $options);
return $checkboxes->prompt();
}
return '';
} | [
"public",
"function",
"checkboxes",
"(",
"$",
"prompt",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasSttyAvailable",
"(",
")",
")",
"{",
"$",
"checkboxes",
"=",
"$",
"this",
"->",
"climate",
"->",
"checkboxes",
"(",
"$",
... | Choise multiple answer from given options?
@param string $prompt The question you want to ask for
@param array $options Available options
@return string | [
"Choise",
"multiple",
"answer",
"from",
"given",
"options?"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Console/Input.php#L81-L89 |
224,424 | projek-xyz/slim-framework | src/Console/Input.php | Input.radio | public function radio($prompt, array $options)
{
if ($this->hasSttyAvailable()) {
$radio = $this->climate->radio($prompt, $options);
return $radio->prompt();
}
return '';
} | php | public function radio($prompt, array $options)
{
if ($this->hasSttyAvailable()) {
$radio = $this->climate->radio($prompt, $options);
return $radio->prompt();
}
return '';
} | [
"public",
"function",
"radio",
"(",
"$",
"prompt",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasSttyAvailable",
"(",
")",
")",
"{",
"$",
"radio",
"=",
"$",
"this",
"->",
"climate",
"->",
"radio",
"(",
"$",
"prompt",
","... | Choise an answer from given options?
@param string $prompt The question you want to ask for
@param array $options Available options
@return string | [
"Choise",
"an",
"answer",
"from",
"given",
"options?"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Console/Input.php#L98-L106 |
224,425 | tomloprod/ionic-push-php | src/Api/Notifications.php | Notifications.setConfig | public function setConfig($notificationData, $payloadData = [], $silentNotification = false, $scheduledDateTime = '', $sound = 'default')
{
if (!is_array($notificationData)) {
$notificationData = [$notificationData];
}
if (count($notificationData) > 0) {
$this->reques... | php | public function setConfig($notificationData, $payloadData = [], $silentNotification = false, $scheduledDateTime = '', $sound = 'default')
{
if (!is_array($notificationData)) {
$notificationData = [$notificationData];
}
if (count($notificationData) > 0) {
$this->reques... | [
"public",
"function",
"setConfig",
"(",
"$",
"notificationData",
",",
"$",
"payloadData",
"=",
"[",
"]",
",",
"$",
"silentNotification",
"=",
"false",
",",
"$",
"scheduledDateTime",
"=",
"''",
",",
"$",
"sound",
"=",
"'default'",
")",
"{",
"if",
"(",
"!"... | Set notification config.
@link https://docs.ionic.io/api/endpoints/push.html#post-notifications Ionic documentation
@param array $notificationData
@param array $payloadData - Custom extra data
@param boolean $silentNotification - Determines if the message should be delivered as a silent notification.
@param string $sc... | [
"Set",
"notification",
"config",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Notifications.php#L51-L86 |
224,426 | tomloprod/ionic-push-php | src/Api/Notifications.php | Notifications.paginatedList | public function paginatedList($parameters = [])
{
$response = $this->sendRequest(
self::METHOD_GET,
self::$endPoints['list'] . '?' . http_build_query($parameters),
$this->requestData
);
$this->resetRequestData();
return $response;
} | php | public function paginatedList($parameters = [])
{
$response = $this->sendRequest(
self::METHOD_GET,
self::$endPoints['list'] . '?' . http_build_query($parameters),
$this->requestData
);
$this->resetRequestData();
return $response;
} | [
"public",
"function",
"paginatedList",
"(",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"sendRequest",
"(",
"self",
"::",
"METHOD_GET",
",",
"self",
"::",
"$",
"endPoints",
"[",
"'list'",
"]",
".",
"'?'",
".",
... | Paginated listing of Push Notifications.
@link https://docs.ionic.io/api/endpoints/push.html#get-notifications Ionic documentation
@param array $parameters
@return object $response | [
"Paginated",
"listing",
"of",
"Push",
"Notifications",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Notifications.php#L95-L104 |
224,427 | tomloprod/ionic-push-php | src/Api/Notifications.php | Notifications.retrieve | public function retrieve($notificationId)
{
$response = $this->sendRequest(
self::METHOD_GET,
str_replace(':notification_id', $notificationId, self::$endPoints['retrieve']),
$this->requestData
);
$this->resetRequestData();
return $response;
} | php | public function retrieve($notificationId)
{
$response = $this->sendRequest(
self::METHOD_GET,
str_replace(':notification_id', $notificationId, self::$endPoints['retrieve']),
$this->requestData
);
$this->resetRequestData();
return $response;
} | [
"public",
"function",
"retrieve",
"(",
"$",
"notificationId",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"sendRequest",
"(",
"self",
"::",
"METHOD_GET",
",",
"str_replace",
"(",
"':notification_id'",
",",
"$",
"notificationId",
",",
"self",
"::",
"$"... | Get a Notification.
@link https://docs.ionic.io/api/endpoints/push.html#get-notifications-notification_id Ionic documentation
@param string $notificationId - Notification id
@return object $response | [
"Get",
"a",
"Notification",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Notifications.php#L113-L122 |
224,428 | tomloprod/ionic-push-php | src/Api/Notifications.php | Notifications.delete | public function delete($notificationId)
{
return $this->sendRequest(
self::METHOD_DELETE,
str_replace(':notification_id', $notificationId, self::$endPoints['delete'])
);
} | php | public function delete($notificationId)
{
return $this->sendRequest(
self::METHOD_DELETE,
str_replace(':notification_id', $notificationId, self::$endPoints['delete'])
);
} | [
"public",
"function",
"delete",
"(",
"$",
"notificationId",
")",
"{",
"return",
"$",
"this",
"->",
"sendRequest",
"(",
"self",
"::",
"METHOD_DELETE",
",",
"str_replace",
"(",
"':notification_id'",
",",
"$",
"notificationId",
",",
"self",
"::",
"$",
"endPoints"... | Deletes a notification.
@link https://docs.ionic.io/api/endpoints/push.html#delete-notifications-notification_id Ionic documentation
@param $notificationId
@return object $response | [
"Deletes",
"a",
"notification",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Notifications.php#L149-L155 |
224,429 | tomloprod/ionic-push-php | src/Api/Notifications.php | Notifications.deleteAll | public function deleteAll()
{
$responses = array();
$notifications = self::paginatedList();
if ($notifications['success']) {
foreach ($notifications['response']['data'] as $notification) {
$responses[] = self::delete($notification->uuid);
}
} e... | php | public function deleteAll()
{
$responses = array();
$notifications = self::paginatedList();
if ($notifications['success']) {
foreach ($notifications['response']['data'] as $notification) {
$responses[] = self::delete($notification->uuid);
}
} e... | [
"public",
"function",
"deleteAll",
"(",
")",
"{",
"$",
"responses",
"=",
"array",
"(",
")",
";",
"$",
"notifications",
"=",
"self",
"::",
"paginatedList",
"(",
")",
";",
"if",
"(",
"$",
"notifications",
"[",
"'success'",
"]",
")",
"{",
"foreach",
"(",
... | Deletes all notifications
@return array - array of responses | [
"Deletes",
"all",
"notifications"
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Notifications.php#L162-L174 |
224,430 | tomloprod/ionic-push-php | src/Api/Notifications.php | Notifications.listMessages | public function listMessages($notificationId, $parameters = [])
{
$endPoint = str_replace(':notification_id', $notificationId, self::$endPoints['listMessages']);
$response = $this->sendRequest(
self::METHOD_GET,
$endPoint . '?' . http_build_query($parameters),
$t... | php | public function listMessages($notificationId, $parameters = [])
{
$endPoint = str_replace(':notification_id', $notificationId, self::$endPoints['listMessages']);
$response = $this->sendRequest(
self::METHOD_GET,
$endPoint . '?' . http_build_query($parameters),
$t... | [
"public",
"function",
"listMessages",
"(",
"$",
"notificationId",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"endPoint",
"=",
"str_replace",
"(",
"':notification_id'",
",",
"$",
"notificationId",
",",
"self",
"::",
"$",
"endPoints",
"[",
"'listMes... | List messages of the indicated notification.
@link https://docs.ionic.io/api/endpoints/push.html#get-notifications-notification_id-messages Ionic documentation
@param string $notificationId - Notification id
@param array $parameters
@return object $response | [
"List",
"messages",
"of",
"the",
"indicated",
"notification",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Notifications.php#L184-L194 |
224,431 | tomloprod/ionic-push-php | src/Api/Notifications.php | Notifications.create | private function create()
{
$response = $this->sendRequest(
self::METHOD_POST,
self::$endPoints['create'],
$this->requestData
);
$this->resetRequestData();
return $response;
} | php | private function create()
{
$response = $this->sendRequest(
self::METHOD_POST,
self::$endPoints['create'],
$this->requestData
);
$this->resetRequestData();
return $response;
} | [
"private",
"function",
"create",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"sendRequest",
"(",
"self",
"::",
"METHOD_POST",
",",
"self",
"::",
"$",
"endPoints",
"[",
"'create'",
"]",
",",
"$",
"this",
"->",
"requestData",
")",
";",
"$",
... | Create a Push Notification.
Used by "sendNotification" and "sendNotificationToAll".
@private
@return object $response | [
"Create",
"a",
"Push",
"Notification",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Notifications.php#L232-L241 |
224,432 | joomla-framework/language | src/Transliterate.php | Transliterate.utf8_latin_to_ascii | public static function utf8_latin_to_ascii($string, $case = 0)
{
if ($case <= 0)
{
$string = str_replace(array_keys(self::$utf8LowerAccents), array_values(self::$utf8LowerAccents), $string);
}
if ($case >= 0)
{
$string = str_replace(array_keys(self::$utf8UpperAccents), array_values(self::$utf8UpperAcc... | php | public static function utf8_latin_to_ascii($string, $case = 0)
{
if ($case <= 0)
{
$string = str_replace(array_keys(self::$utf8LowerAccents), array_values(self::$utf8LowerAccents), $string);
}
if ($case >= 0)
{
$string = str_replace(array_keys(self::$utf8UpperAccents), array_values(self::$utf8UpperAcc... | [
"public",
"static",
"function",
"utf8_latin_to_ascii",
"(",
"$",
"string",
",",
"$",
"case",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"case",
"<=",
"0",
")",
"{",
"$",
"string",
"=",
"str_replace",
"(",
"array_keys",
"(",
"self",
"::",
"$",
"utf8LowerAccent... | Returns strings transliterated from UTF-8 to Latin
@param string $string String to transliterate
@param int $case Optionally specify upper or lower case. Default to 0 (both).
@return string Transliterated string
@since 1.0 | [
"Returns",
"strings",
"transliterated",
"from",
"UTF",
"-",
"8",
"to",
"Latin"
] | 94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf | https://github.com/joomla-framework/language/blob/94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf/src/Transliterate.php#L255-L268 |
224,433 | tomloprod/ionic-push-php | src/Api/Messages.php | Messages.retrieve | public function retrieve($messageId)
{
return $this->sendRequest(
self::METHOD_GET,
str_replace(':message_id', $messageId, self::$endPoints['retrieve'])
);
} | php | public function retrieve($messageId)
{
return $this->sendRequest(
self::METHOD_GET,
str_replace(':message_id', $messageId, self::$endPoints['retrieve'])
);
} | [
"public",
"function",
"retrieve",
"(",
"$",
"messageId",
")",
"{",
"return",
"$",
"this",
"->",
"sendRequest",
"(",
"self",
"::",
"METHOD_GET",
",",
"str_replace",
"(",
"':message_id'",
",",
"$",
"messageId",
",",
"self",
"::",
"$",
"endPoints",
"[",
"'ret... | Get Message details. Use this method to check the current status of a message or to lookup the error code for failures.
@link https://docs.ionic.io/api/endpoints/push.html#get-messages-message_id Ionic documentation
@param string $messageId - Message ID
@return object $response | [
"Get",
"Message",
"details",
".",
"Use",
"this",
"method",
"to",
"check",
"the",
"current",
"status",
"of",
"a",
"message",
"or",
"to",
"lookup",
"the",
"error",
"code",
"for",
"failures",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Messages.php#L29-L35 |
224,434 | projek-xyz/slim-framework | src/DefaultServicesProvider.php | DefaultServicesProvider.initializeDatabase | private function initializeDatabase(array $settings)
{
if (!isset($settings['dsn']) || !$settings['dsn']) {
$settings['charset'] = isset($settings['charset']) ? $settings['charset'] : 'utf8';
$settings['dsn'] = sprintf(
'%s:host=%s;dbname=%s;charset=%s',
... | php | private function initializeDatabase(array $settings)
{
if (!isset($settings['dsn']) || !$settings['dsn']) {
$settings['charset'] = isset($settings['charset']) ? $settings['charset'] : 'utf8';
$settings['dsn'] = sprintf(
'%s:host=%s;dbname=%s;charset=%s',
... | [
"private",
"function",
"initializeDatabase",
"(",
"array",
"$",
"settings",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"settings",
"[",
"'dsn'",
"]",
")",
"||",
"!",
"$",
"settings",
"[",
"'dsn'",
"]",
")",
"{",
"$",
"settings",
"[",
"'charset'",
"... | Initialize database settings
@param array $settings
@return array | [
"Initialize",
"database",
"settings"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/DefaultServicesProvider.php#L263-L277 |
224,435 | petebrowne/slim-layout-view | Slim/LayoutView.php | LayoutView.fetch | public function fetch($template, $data = null) {
$layout = $this->getLayout($data);
$result = $this->render($template, $data);
if (is_string($layout)) {
$result = $this->renderLayout($layout, $result, $data);
}
return $result;
} | php | public function fetch($template, $data = null) {
$layout = $this->getLayout($data);
$result = $this->render($template, $data);
if (is_string($layout)) {
$result = $this->renderLayout($layout, $result, $data);
}
return $result;
} | [
"public",
"function",
"fetch",
"(",
"$",
"template",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"layout",
"=",
"$",
"this",
"->",
"getLayout",
"(",
"$",
"data",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"render",
"(",
"$",
"template",
"... | Override the default fetch mechanism to render a layout if set.
@param string $template Path to template file relative to templates directory
@param array $data Any additonal data to be passed to the template.
@return string The fully rendered view as a string. | [
"Override",
"the",
"default",
"fetch",
"mechanism",
"to",
"render",
"a",
"layout",
"if",
"set",
"."
] | 5690a052221f3f7d20c5e93e82608fbf2b0ff330 | https://github.com/petebrowne/slim-layout-view/blob/5690a052221f3f7d20c5e93e82608fbf2b0ff330/Slim/LayoutView.php#L42-L50 |
224,436 | petebrowne/slim-layout-view | Slim/LayoutView.php | LayoutView.getLayout | public function getLayout($data = null) {
$layout = null;
// 1) Check the passed in data
if (is_array($data) && array_key_exists(self::LAYOUT_KEY, $data)) {
$layout = $data[self::LAYOUT_KEY];
unset($data[self::LAYOUT_KEY]);
}
// 2) Check the data on the View
if ($this->has(self::LA... | php | public function getLayout($data = null) {
$layout = null;
// 1) Check the passed in data
if (is_array($data) && array_key_exists(self::LAYOUT_KEY, $data)) {
$layout = $data[self::LAYOUT_KEY];
unset($data[self::LAYOUT_KEY]);
}
// 2) Check the data on the View
if ($this->has(self::LA... | [
"public",
"function",
"getLayout",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"layout",
"=",
"null",
";",
"// 1) Check the passed in data",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
"&&",
"array_key_exists",
"(",
"self",
"::",
"LAYOUT_KEY",
",",
"$"... | Returns the layout for this view. This will be either
the 'layout' data value, the applications 'layout' configuration
value, or 'layout.php'.
@param array $data Any additonal data to be passed to the template.
@return string|null | [
"Returns",
"the",
"layout",
"for",
"this",
"view",
".",
"This",
"will",
"be",
"either",
"the",
"layout",
"data",
"value",
"the",
"applications",
"layout",
"configuration",
"value",
"or",
"layout",
".",
"php",
"."
] | 5690a052221f3f7d20c5e93e82608fbf2b0ff330 | https://github.com/petebrowne/slim-layout-view/blob/5690a052221f3f7d20c5e93e82608fbf2b0ff330/Slim/LayoutView.php#L61-L90 |
224,437 | maxmind/ccfd-api-php | src/HTTPBase.php | HTTPBase.query | public function query()
{
// Query every server using it's domain name.
for ($i = 0; $i < $this->numservers; $i++) {
$result = $this->querySingleServer($this->server[$i]);
if ($this->debug) {
echo "server: {$this->server[$i]}\n";
echo "result: ... | php | public function query()
{
// Query every server using it's domain name.
for ($i = 0; $i < $this->numservers; $i++) {
$result = $this->querySingleServer($this->server[$i]);
if ($this->debug) {
echo "server: {$this->server[$i]}\n";
echo "result: ... | [
"public",
"function",
"query",
"(",
")",
"{",
"// Query every server using it's domain name.",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"numservers",
";",
"$",
"i",
"++",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
... | Query each server.
@return false|string | [
"Query",
"each",
"server",
"."
] | 5f6c2a5454e755f1c56be17a1fc0c97576ff010e | https://github.com/maxmind/ccfd-api-php/blob/5f6c2a5454e755f1c56be17a1fc0c97576ff010e/src/HTTPBase.php#L187-L202 |
224,438 | maxmind/ccfd-api-php | src/HTTPBase.php | HTTPBase.input | public function input($inputVars)
{
foreach ($inputVars as $key => $val) {
if (empty($this->allowed_fields[$key])) {
echo "Invalid input $key - perhaps misspelled field?\n";
return false;
}
$this->queries[$key] = urlencode($this->filter_fie... | php | public function input($inputVars)
{
foreach ($inputVars as $key => $val) {
if (empty($this->allowed_fields[$key])) {
echo "Invalid input $key - perhaps misspelled field?\n";
return false;
}
$this->queries[$key] = urlencode($this->filter_fie... | [
"public",
"function",
"input",
"(",
"$",
"inputVars",
")",
"{",
"foreach",
"(",
"$",
"inputVars",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"allowed_fields",
"[",
"$",
"key",
"]",
")",
")",
"{",
"ec... | Validates and stores the inputVars in the queries array.
@param $inputVars | [
"Validates",
"and",
"stores",
"the",
"inputVars",
"in",
"the",
"queries",
"array",
"."
] | 5f6c2a5454e755f1c56be17a1fc0c97576ff010e | https://github.com/maxmind/ccfd-api-php/blob/5f6c2a5454e755f1c56be17a1fc0c97576ff010e/src/HTTPBase.php#L209-L219 |
224,439 | mocdk/MOC.ImageOptimizer | Classes/Aspects/ThumbnailAspect.php | ThumbnailAspect.optimizeThumbnail | public function optimizeThumbnail(JoinPointInterface $joinPoint)
{
/** @var \Neos\Media\Domain\Model\Thumbnail $thumbnail */
$thumbnail = $joinPoint->getProxy();
$thumbnailResource = $thumbnail->getResource();
if (!$thumbnailResource) {
return;
}
$streamM... | php | public function optimizeThumbnail(JoinPointInterface $joinPoint)
{
/** @var \Neos\Media\Domain\Model\Thumbnail $thumbnail */
$thumbnail = $joinPoint->getProxy();
$thumbnailResource = $thumbnail->getResource();
if (!$thumbnailResource) {
return;
}
$streamM... | [
"public",
"function",
"optimizeThumbnail",
"(",
"JoinPointInterface",
"$",
"joinPoint",
")",
"{",
"/** @var \\Neos\\Media\\Domain\\Model\\Thumbnail $thumbnail */",
"$",
"thumbnail",
"=",
"$",
"joinPoint",
"->",
"getProxy",
"(",
")",
";",
"$",
"thumbnailResource",
"=",
"... | After a thumbnail has been refreshed the resource is optimized, meaning the
image is only optimized once when created.
A new resource is generated for every thumbnail, meaning the original is
never touched.
Only local file system target is supported to keep it from being blocking.
It would however be possible to crea... | [
"After",
"a",
"thumbnail",
"has",
"been",
"refreshed",
"the",
"resource",
"is",
"optimized",
"meaning",
"the",
"image",
"is",
"only",
"optimized",
"once",
"when",
"created",
"."
] | c1eb87061fa2c8ffd9f7651229a7719263c0721a | https://github.com/mocdk/MOC.ImageOptimizer/blob/c1eb87061fa2c8ffd9f7651229a7719263c0721a/Classes/Aspects/ThumbnailAspect.php#L71-L115 |
224,440 | php-http/laravel-httplug | src/HttplugServiceProvider.php | HttplugServiceProvider.registerHttplugFactories | protected function registerHttplugFactories()
{
$this->app->bind('httplug.message_factory.default', function ($app) {
return MessageFactoryDiscovery::find();
});
$this->app->alias('httplug.message_factory.default', MessageFactory::class);
$this->app->alias('httplug.messag... | php | protected function registerHttplugFactories()
{
$this->app->bind('httplug.message_factory.default', function ($app) {
return MessageFactoryDiscovery::find();
});
$this->app->alias('httplug.message_factory.default', MessageFactory::class);
$this->app->alias('httplug.messag... | [
"protected",
"function",
"registerHttplugFactories",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"'httplug.message_factory.default'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"MessageFactoryDiscovery",
"::",
"find",
"(",
")",
";",
... | Register php-http interfaces to container. | [
"Register",
"php",
"-",
"http",
"interfaces",
"to",
"container",
"."
] | fae3d1b2a653f645cbe09f32aaff4bab34de14fc | https://github.com/php-http/laravel-httplug/blob/fae3d1b2a653f645cbe09f32aaff4bab34de14fc/src/HttplugServiceProvider.php#L45-L62 |
224,441 | php-http/laravel-httplug | src/HttplugServiceProvider.php | HttplugServiceProvider.registerHttplug | protected function registerHttplug()
{
$this->app->singleton('httplug', function ($app) {
return new HttplugManager($app);
});
$this->app->alias('httplug', HttplugManager::class);
$this->app->singleton('httplug.default', function ($app) {
return $app['httplug... | php | protected function registerHttplug()
{
$this->app->singleton('httplug', function ($app) {
return new HttplugManager($app);
});
$this->app->alias('httplug', HttplugManager::class);
$this->app->singleton('httplug.default', function ($app) {
return $app['httplug... | [
"protected",
"function",
"registerHttplug",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'httplug'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"HttplugManager",
"(",
"$",
"app",
")",
";",
"}",
")",
";",
"$",
"t... | Register httplug to container. | [
"Register",
"httplug",
"to",
"container",
"."
] | fae3d1b2a653f645cbe09f32aaff4bab34de14fc | https://github.com/php-http/laravel-httplug/blob/fae3d1b2a653f645cbe09f32aaff4bab34de14fc/src/HttplugServiceProvider.php#L67-L77 |
224,442 | projek-xyz/slim-framework | src/Mailer/SmtpDriver.php | SmtpDriver.debugMode | public function debugMode($mode)
{
if (!isset($this->debugMode[$mode])) {
$mode = 'production';
}
$this->mail->SMTPDebug = $this->debugMode[$mode];
$this->mail->Debugoutput = function ($str, $mode) {
logger(LogLevel::DEBUG, $str, ['debugMode' => $mode]);
... | php | public function debugMode($mode)
{
if (!isset($this->debugMode[$mode])) {
$mode = 'production';
}
$this->mail->SMTPDebug = $this->debugMode[$mode];
$this->mail->Debugoutput = function ($str, $mode) {
logger(LogLevel::DEBUG, $str, ['debugMode' => $mode]);
... | [
"public",
"function",
"debugMode",
"(",
"$",
"mode",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"debugMode",
"[",
"$",
"mode",
"]",
")",
")",
"{",
"$",
"mode",
"=",
"'production'",
";",
"}",
"$",
"this",
"->",
"mail",
"->",
"SMTPD... | Set mailer debug mode
@param string $mode
@return $this | [
"Set",
"mailer",
"debug",
"mode"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Mailer/SmtpDriver.php#L65-L77 |
224,443 | robrogers3/laravel-jsonaware-exception-handler | src/ServiceProvider.php | ServiceProvider.boot | public function boot()
{
$path = __DIR__ . '/../resources/lang/en/exceptionmessages.php';
$this->publishes([
$path => resource_path("lang/vendor/{$this->namespace}/en/exceptionmessages.php"),
]);
$this->loadTranslationsFrom($path, $this->namespace);
} | php | public function boot()
{
$path = __DIR__ . '/../resources/lang/en/exceptionmessages.php';
$this->publishes([
$path => resource_path("lang/vendor/{$this->namespace}/en/exceptionmessages.php"),
]);
$this->loadTranslationsFrom($path, $this->namespace);
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"path",
"=",
"__DIR__",
".",
"'/../resources/lang/en/exceptionmessages.php'",
";",
"$",
"this",
"->",
"publishes",
"(",
"[",
"$",
"path",
"=>",
"resource_path",
"(",
"\"lang/vendor/{$this->namespace}/en/exceptionmessag... | Registers resources for the package. | [
"Registers",
"resources",
"for",
"the",
"package",
"."
] | 6821b2f25762e0a7df9d0ecff49448361aea449c | https://github.com/robrogers3/laravel-jsonaware-exception-handler/blob/6821b2f25762e0a7df9d0ecff49448361aea449c/src/ServiceProvider.php#L26-L35 |
224,444 | minimalcode-org/search | src/Internal/Node.php | Node.append | public function append($operator, Criteria $criteria)
{
$this->children[] = new Node(self::TYPE_LEAF, $operator, $criteria);
$this->mostRecentCriteria = $criteria;
return $this;
} | php | public function append($operator, Criteria $criteria)
{
$this->children[] = new Node(self::TYPE_LEAF, $operator, $criteria);
$this->mostRecentCriteria = $criteria;
return $this;
} | [
"public",
"function",
"append",
"(",
"$",
"operator",
",",
"Criteria",
"$",
"criteria",
")",
"{",
"$",
"this",
"->",
"children",
"[",
"]",
"=",
"new",
"Node",
"(",
"self",
"::",
"TYPE_LEAF",
",",
"$",
"operator",
",",
"$",
"criteria",
")",
";",
"$",
... | Appends a leaf node to the children of this node.
@param string $operator ("AND"|"OR"|"")
@param Criteria $criteria
@return $this | [
"Appends",
"a",
"leaf",
"node",
"to",
"the",
"children",
"of",
"this",
"node",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Internal/Node.php#L106-L112 |
224,445 | minimalcode-org/search | src/Internal/Node.php | Node.connect | public function connect()
{
$crotch = new Node(self::TYPE_CROTCH, self::OPERATOR_BLANK, null);
$crotch->children = \array_merge($crotch->children, $this->children);
$crotch->isNegatingWholeChildren = $this->isNegatingWholeChildren;
$this->isNegatingWholeChildren = false;
$thi... | php | public function connect()
{
$crotch = new Node(self::TYPE_CROTCH, self::OPERATOR_BLANK, null);
$crotch->children = \array_merge($crotch->children, $this->children);
$crotch->isNegatingWholeChildren = $this->isNegatingWholeChildren;
$this->isNegatingWholeChildren = false;
$thi... | [
"public",
"function",
"connect",
"(",
")",
"{",
"$",
"crotch",
"=",
"new",
"Node",
"(",
"self",
"::",
"TYPE_CROTCH",
",",
"self",
"::",
"OPERATOR_BLANK",
",",
"null",
")",
";",
"$",
"crotch",
"->",
"children",
"=",
"\\",
"array_merge",
"(",
"$",
"crotc... | Connects the children to a new parent tree.
@return $this | [
"Connects",
"the",
"children",
"to",
"a",
"new",
"parent",
"tree",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Internal/Node.php#L119-L128 |
224,446 | Flowpack/Flowpack.SimpleSearch | Classes/Domain/Service/SqLiteIndex.php | SqLiteIndex.bindFulltextParametersToStatement | protected function bindFulltextParametersToStatement(\SQLite3Stmt $preparedStatement, $fulltext) {
$preparedStatement->bindValue(':h1', isset($fulltext['h1']) ? $fulltext['h1'] : '');
$preparedStatement->bindValue(':h2', isset($fulltext['h2']) ? $fulltext['h2'] : '');
$preparedStatement->bindValue(':h3', isset($f... | php | protected function bindFulltextParametersToStatement(\SQLite3Stmt $preparedStatement, $fulltext) {
$preparedStatement->bindValue(':h1', isset($fulltext['h1']) ? $fulltext['h1'] : '');
$preparedStatement->bindValue(':h2', isset($fulltext['h2']) ? $fulltext['h2'] : '');
$preparedStatement->bindValue(':h3', isset($f... | [
"protected",
"function",
"bindFulltextParametersToStatement",
"(",
"\\",
"SQLite3Stmt",
"$",
"preparedStatement",
",",
"$",
"fulltext",
")",
"{",
"$",
"preparedStatement",
"->",
"bindValue",
"(",
"':h1'",
",",
"isset",
"(",
"$",
"fulltext",
"[",
"'h1'",
"]",
")"... | Binds fulltext parameters to a prepared statement as this happens in multiple places.
@param \SQLite3Stmt $preparedStatement
@param $fulltext | [
"Binds",
"fulltext",
"parameters",
"to",
"a",
"prepared",
"statement",
"as",
"this",
"happens",
"in",
"multiple",
"places",
"."
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Domain/Service/SqLiteIndex.php#L164-L172 |
224,447 | Flowpack/Flowpack.SimpleSearch | Classes/Domain/Service/SqLiteIndex.php | SqLiteIndex.findOneByIdentifier | public function findOneByIdentifier($identifier) {
$statement = $this->connection->prepare('SELECT * FROM objects WHERE __identifier__ = :identifier LIMIT 1');
$statement->bindValue(':identifier', $identifier);
return $statement->execute()->fetchArray(SQLITE3_ASSOC);
} | php | public function findOneByIdentifier($identifier) {
$statement = $this->connection->prepare('SELECT * FROM objects WHERE __identifier__ = :identifier LIMIT 1');
$statement->bindValue(':identifier', $identifier);
return $statement->execute()->fetchArray(SQLITE3_ASSOC);
} | [
"public",
"function",
"findOneByIdentifier",
"(",
"$",
"identifier",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"'SELECT * FROM objects WHERE __identifier__ = :identifier LIMIT 1'",
")",
";",
"$",
"statement",
"->",
"bindVa... | Returns an index entry by identifier or NULL if it doesn't exist.
@param string $identifier
@return array|FALSE | [
"Returns",
"an",
"index",
"entry",
"by",
"identifier",
"or",
"NULL",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Domain/Service/SqLiteIndex.php#L180-L185 |
224,448 | Flowpack/Flowpack.SimpleSearch | Classes/Domain/Service/SqLiteIndex.php | SqLiteIndex.executeStatement | public function executeStatement($statementQuery, array $parameters) {
$statement = $this->connection->prepare($statementQuery);
foreach ($parameters as $parameterName => $parameterValue) {
$statement->bindValue($parameterName, $parameterValue);
}
$result = $statement->execute();
$resultArray = array();
... | php | public function executeStatement($statementQuery, array $parameters) {
$statement = $this->connection->prepare($statementQuery);
foreach ($parameters as $parameterName => $parameterValue) {
$statement->bindValue($parameterName, $parameterValue);
}
$result = $statement->execute();
$resultArray = array();
... | [
"public",
"function",
"executeStatement",
"(",
"$",
"statementQuery",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"$",
"statementQuery",
")",
";",
"foreach",
"(",
"$",
"parameters",... | Execute a prepared statement.
@param string $statementQuery The statement query
@param array $parameters The statement parameters as map
@return \SQLite3Stmt | [
"Execute",
"a",
"prepared",
"statement",
"."
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Domain/Service/SqLiteIndex.php#L213-L226 |
224,449 | joomla-framework/language | src/Stemmer/Porteren.php | Porteren.stem | public function stem($token, $lang)
{
// Check if the token is long enough to merit stemming.
if (\strlen($token) <= 2)
{
return $token;
}
// Check if the language is English or All.
if ($lang !== 'en')
{
return $token;
}
// Stem the token if it is not in the cache.
if (!isset($this->cache[... | php | public function stem($token, $lang)
{
// Check if the token is long enough to merit stemming.
if (\strlen($token) <= 2)
{
return $token;
}
// Check if the language is English or All.
if ($lang !== 'en')
{
return $token;
}
// Stem the token if it is not in the cache.
if (!isset($this->cache[... | [
"public",
"function",
"stem",
"(",
"$",
"token",
",",
"$",
"lang",
")",
"{",
"// Check if the token is long enough to merit stemming.",
"if",
"(",
"\\",
"strlen",
"(",
"$",
"token",
")",
"<=",
"2",
")",
"{",
"return",
"$",
"token",
";",
"}",
"// Check if the... | Method to stem a token and return the root.
@param string $token The token to stem.
@param string $lang The language of the token.
@return string The root token.
@since 1.0 | [
"Method",
"to",
"stem",
"a",
"token",
"and",
"return",
"the",
"root",
"."
] | 94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf | https://github.com/joomla-framework/language/blob/94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf/src/Stemmer/Porteren.php#L50-L81 |
224,450 | joomla-framework/language | src/Stemmer/Porteren.php | Porteren.replace | private static function replace(&$str, $check, $repl, $m = null)
{
$len = 0 - \strlen($check);
if (substr($str, $len) == $check)
{
$substr = substr($str, 0, $len);
if ($m === null || self::m($substr) > $m)
{
$str = $substr . $repl;
}
return true;
}
return false;
} | php | private static function replace(&$str, $check, $repl, $m = null)
{
$len = 0 - \strlen($check);
if (substr($str, $len) == $check)
{
$substr = substr($str, 0, $len);
if ($m === null || self::m($substr) > $m)
{
$str = $substr . $repl;
}
return true;
}
return false;
} | [
"private",
"static",
"function",
"replace",
"(",
"&",
"$",
"str",
",",
"$",
"check",
",",
"$",
"repl",
",",
"$",
"m",
"=",
"null",
")",
"{",
"$",
"len",
"=",
"0",
"-",
"\\",
"strlen",
"(",
"$",
"check",
")",
";",
"if",
"(",
"substr",
"(",
"$"... | Replaces the first string with the second, at the end of the string. If third
arg is given, then the preceding string must match that m count at least.
@param string $str String to check
@param string $check Ending to check for
@param string $repl Replacement string
@param integer $m Optional... | [
"Replaces",
"the",
"first",
"string",
"with",
"the",
"second",
"at",
"the",
"end",
"of",
"the",
"string",
".",
"If",
"third",
"arg",
"is",
"given",
"then",
"the",
"preceding",
"string",
"must",
"match",
"that",
"m",
"count",
"at",
"least",
"."
] | 94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf | https://github.com/joomla-framework/language/blob/94c81b65b73b69a72214fbc5b2f1d9d4fc4429cf/src/Stemmer/Porteren.php#L413-L430 |
224,451 | projek-xyz/slim-framework | src/View.php | View.directory | public function directory($path = null)
{
if (null === $path) {
return $this->plates->getDirectory();
}
return $this->plates->getDirectory().'/'.$path;
} | php | public function directory($path = null)
{
if (null === $path) {
return $this->plates->getDirectory();
}
return $this->plates->getDirectory().'/'.$path;
} | [
"public",
"function",
"directory",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"path",
")",
"{",
"return",
"$",
"this",
"->",
"plates",
"->",
"getDirectory",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"plates",
"->... | Get view directory
@param string|null $path
@return string | [
"Get",
"view",
"directory"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/View.php#L49-L56 |
224,452 | adman9000/laravel-binance | src/BinanceAPI.php | BinanceAPI.getRecentTrades | public function getRecentTrades($symbol = 'BNBBTC', $limit = 500)
{
$data = [
'symbol' => $symbol,
'limit' => $limit,
];
$b = $this->privateRequest('v3/myTrades', $data);
return $b;
} | php | public function getRecentTrades($symbol = 'BNBBTC', $limit = 500)
{
$data = [
'symbol' => $symbol,
'limit' => $limit,
];
$b = $this->privateRequest('v3/myTrades', $data);
return $b;
} | [
"public",
"function",
"getRecentTrades",
"(",
"$",
"symbol",
"=",
"'BNBBTC'",
",",
"$",
"limit",
"=",
"500",
")",
"{",
"$",
"data",
"=",
"[",
"'symbol'",
"=>",
"$",
"symbol",
",",
"'limit'",
"=>",
"$",
"limit",
",",
"]",
";",
"$",
"b",
"=",
"$",
... | Get trades for a specific account and symbol
@param string $symbol Currency pair
@param int $limit Limit of trades. Max. 500
@return mixed
@throws \Exception | [
"Get",
"trades",
"for",
"a",
"specific",
"account",
"and",
"symbol"
] | d0e1acf8fb2af42597156e0baaeeac0f029bf912 | https://github.com/adman9000/laravel-binance/blob/d0e1acf8fb2af42597156e0baaeeac0f029bf912/src/BinanceAPI.php#L153-L163 |
224,453 | adman9000/laravel-binance | src/BinanceAPI.php | BinanceAPI.trade | public function trade($symbol, $quantity, $side, $type = 'MARKET', $price = false)
{
$data = [
'symbol' => $symbol,
'side' => $side,
'type' => $type,
'quantity' => $quantity
];
if($price !== false)
{
$dat... | php | public function trade($symbol, $quantity, $side, $type = 'MARKET', $price = false)
{
$data = [
'symbol' => $symbol,
'side' => $side,
'type' => $type,
'quantity' => $quantity
];
if($price !== false)
{
$dat... | [
"public",
"function",
"trade",
"(",
"$",
"symbol",
",",
"$",
"quantity",
",",
"$",
"side",
",",
"$",
"type",
"=",
"'MARKET'",
",",
"$",
"price",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"[",
"'symbol'",
"=>",
"$",
"symbol",
",",
"'side'",
"=>",
... | Base trade function
@param string $symbol Asset pair to trade
@param string $quantity Amount of trade asset
@param string $side BUY, SELL
@param string $type MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT, LIMIT_MAKER
@param bool $price Limit price
@return mixed
@throws \Excep... | [
"Base",
"trade",
"function"
] | d0e1acf8fb2af42597156e0baaeeac0f029bf912 | https://github.com/adman9000/laravel-binance/blob/d0e1acf8fb2af42597156e0baaeeac0f029bf912/src/BinanceAPI.php#L196-L212 |
224,454 | JDGrimes/wpppb | src/WPPPB/Loader.php | WPPPB_Loader.install_plugins | public function install_plugins() {
$result = system(
WP_PHP_BINARY
. ' ' . escapeshellarg( dirname( dirname( __FILE__ ) ) . '/bin/install-plugins.php' )
. ' ' . escapeshellarg( json_encode( $this->plugins ) )
. ' ' . escapeshellarg( $this->locate_wp_tests_config() )
. ' ' . (int) is_multisite()
. ... | php | public function install_plugins() {
$result = system(
WP_PHP_BINARY
. ' ' . escapeshellarg( dirname( dirname( __FILE__ ) ) . '/bin/install-plugins.php' )
. ' ' . escapeshellarg( json_encode( $this->plugins ) )
. ' ' . escapeshellarg( $this->locate_wp_tests_config() )
. ' ' . (int) is_multisite()
. ... | [
"public",
"function",
"install_plugins",
"(",
")",
"{",
"$",
"result",
"=",
"system",
"(",
"WP_PHP_BINARY",
".",
"' '",
".",
"escapeshellarg",
"(",
"dirname",
"(",
"dirname",
"(",
"__FILE__",
")",
")",
".",
"'/bin/install-plugins.php'",
")",
".",
"' '",
".",... | Installs the plugins via a separate PHP process.
You do not need to call this directly, it is only public because it is hooked
to an action by self::hook_up_installer().
@since 0.1.0 | [
"Installs",
"the",
"plugins",
"via",
"a",
"separate",
"PHP",
"process",
"."
] | cc117cfe2e28c8e7d49fa4e02313ce00490d07ec | https://github.com/JDGrimes/wpppb/blob/cc117cfe2e28c8e7d49fa4e02313ce00490d07ec/src/WPPPB/Loader.php#L141-L167 |
224,455 | JDGrimes/wpppb | src/WPPPB/Loader.php | WPPPB_Loader.phpunit_compat | public function phpunit_compat() {
if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
$tests_dir = $this->get_wp_tests_dir();
// Back-compat for older WP versions.
if ( file_exists( $tests_dir . '/includes/phpunit6-compat.php' ) ) {
/**
* Compatibility with PHPUnit 6+.
*
* @since ... | php | public function phpunit_compat() {
if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
$tests_dir = $this->get_wp_tests_dir();
// Back-compat for older WP versions.
if ( file_exists( $tests_dir . '/includes/phpunit6-compat.php' ) ) {
/**
* Compatibility with PHPUnit 6+.
*
* @since ... | [
"public",
"function",
"phpunit_compat",
"(",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'PHPUnit\\Runner\\Version'",
")",
")",
"{",
"$",
"tests_dir",
"=",
"$",
"this",
"->",
"get_wp_tests_dir",
"(",
")",
";",
"// Back-compat for older WP versions.",
"if",
"(",
"... | Ensures compatibility with the current PHPUnit version.
@since 0.3.2 | [
"Ensures",
"compatibility",
"with",
"the",
"current",
"PHPUnit",
"version",
"."
] | cc117cfe2e28c8e7d49fa4e02313ce00490d07ec | https://github.com/JDGrimes/wpppb/blob/cc117cfe2e28c8e7d49fa4e02313ce00490d07ec/src/WPPPB/Loader.php#L227-L258 |
224,456 | nWidart/forecast-php | src/Forecast.php | Forecast.get | public function get($latitude = null, $longitude = null, $time = null)
{
$this->guardAgainstEmptyArgument($latitude, 'latitude');
$this->guardAgainstEmptyArgument($longitude, 'longitude');
$url = $this->getUrl($latitude, $longitude, $time);
$forecast = $this->getClient()->get($url)... | php | public function get($latitude = null, $longitude = null, $time = null)
{
$this->guardAgainstEmptyArgument($latitude, 'latitude');
$this->guardAgainstEmptyArgument($longitude, 'longitude');
$url = $this->getUrl($latitude, $longitude, $time);
$forecast = $this->getClient()->get($url)... | [
"public",
"function",
"get",
"(",
"$",
"latitude",
"=",
"null",
",",
"$",
"longitude",
"=",
"null",
",",
"$",
"time",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"guardAgainstEmptyArgument",
"(",
"$",
"latitude",
",",
"'latitude'",
")",
";",
"$",
"this",... | Get the weather for the given latitude and longitude
Optionally pass in a time for the query
@param null|string $latitude
@param null|string $longitude
@param null|string $time
@return array | [
"Get",
"the",
"weather",
"for",
"the",
"given",
"latitude",
"and",
"longitude",
"Optionally",
"pass",
"in",
"a",
"time",
"for",
"the",
"query"
] | 70203d9f01996e404916ee9a6b257ab640ddfaaa | https://github.com/nWidart/forecast-php/blob/70203d9f01996e404916ee9a6b257ab640ddfaaa/src/Forecast.php#L39-L49 |
224,457 | minimalcode-org/search | src/Criteria.php | Criteria.where | public static function where($field)
{
$root = new Node(Node::TYPE_CROTCH, Node::OPERATOR_BLANK);
$criteria = new Criteria($field, $root);
$root->append(Node::OPERATOR_BLANK, $criteria);
return $criteria;
} | php | public static function where($field)
{
$root = new Node(Node::TYPE_CROTCH, Node::OPERATOR_BLANK);
$criteria = new Criteria($field, $root);
$root->append(Node::OPERATOR_BLANK, $criteria);
return $criteria;
} | [
"public",
"static",
"function",
"where",
"(",
"$",
"field",
")",
"{",
"$",
"root",
"=",
"new",
"Node",
"(",
"Node",
"::",
"TYPE_CROTCH",
",",
"Node",
"::",
"OPERATOR_BLANK",
")",
";",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"$",
"field",
",",
"... | Static factory method to create a new Criteria for the provided field.
@param string $field
@return $this
@throws \InvalidArgumentException if the field param is not a string | [
"Static",
"factory",
"method",
"to",
"create",
"a",
"new",
"Criteria",
"for",
"the",
"provided",
"field",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L83-L90 |
224,458 | minimalcode-org/search | src/Criteria.php | Criteria.is | public function is($value)
{
if ($value === null) {
return $this->isNull();
}
if (\is_array($value)) {
return $this->in($value);
}
$this->predicates[] = $this->processValue($value);
return $this;
} | php | public function is($value)
{
if ($value === null) {
return $this->isNull();
}
if (\is_array($value)) {
return $this->in($value);
}
$this->predicates[] = $this->processValue($value);
return $this;
} | [
"public",
"function",
"is",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"isNull",
"(",
")",
";",
"}",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
... | Creates new predicate without any wildcards for each entry.
For arrays the Criteria::in() method is equivalent but more performant.
@param mixed|array $value
@return $this | [
"Creates",
"new",
"predicate",
"without",
"any",
"wildcards",
"for",
"each",
"entry",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L195-L208 |
224,459 | minimalcode-org/search | src/Criteria.php | Criteria.withinBox | public function withinBox($startLatitude, $startLongitude, $endLatitude, $endLongitude)
{
$this->predicates[] = '[' . $this->processFloat($startLatitude) . ',' . $this->processFloat($startLongitude) .
' TO ' . $this->processFloat($endLatitude) . ',' . $this->processFloat($endLongitude) . ']';
... | php | public function withinBox($startLatitude, $startLongitude, $endLatitude, $endLongitude)
{
$this->predicates[] = '[' . $this->processFloat($startLatitude) . ',' . $this->processFloat($startLongitude) .
' TO ' . $this->processFloat($endLatitude) . ',' . $this->processFloat($endLongitude) . ']';
... | [
"public",
"function",
"withinBox",
"(",
"$",
"startLatitude",
",",
"$",
"startLongitude",
",",
"$",
"endLatitude",
",",
"$",
"endLongitude",
")",
"{",
"$",
"this",
"->",
"predicates",
"[",
"]",
"=",
"'['",
".",
"$",
"this",
"->",
"processFloat",
"(",
"$"... | Creates new predicate for a RANGE spatial search.
Finds exactly everything in a rectangular area, such as the area covered by a map the user is looking at.
@param float $startLatitude
@param float $startLongitude
@param float $endLatitude
@param float $endLongitude
@return $this | [
"Creates",
"new",
"predicate",
"for",
"a",
"RANGE",
"spatial",
"search",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L263-L269 |
224,460 | minimalcode-org/search | src/Criteria.php | Criteria.nearCircle | public function nearCircle($latitude, $longitude, $distance)
{
$this->assertPositiveFloat($distance);
$this->predicates[] = '{!bbox pt=' . $this->processFloat($latitude) . ',' . $this->processFloat($longitude) .
' sfield=' . $this->field . ' d=' . $this->processFloat($distance) . '}';
... | php | public function nearCircle($latitude, $longitude, $distance)
{
$this->assertPositiveFloat($distance);
$this->predicates[] = '{!bbox pt=' . $this->processFloat($latitude) . ',' . $this->processFloat($longitude) .
' sfield=' . $this->field . ' d=' . $this->processFloat($distance) . '}';
... | [
"public",
"function",
"nearCircle",
"(",
"$",
"latitude",
",",
"$",
"longitude",
",",
"$",
"distance",
")",
"{",
"$",
"this",
"->",
"assertPositiveFloat",
"(",
"$",
"distance",
")",
";",
"$",
"this",
"->",
"predicates",
"[",
"]",
"=",
"'{!bbox pt='",
"."... | Creates new predicate for !bbox filter.
The !bbox filter is very similar to !geofilt except it uses the bounding box of the calculated circle.
The rectangular shape is faster to compute and so it's sometimes used as an alternative to !geofilt
when it's acceptable to return points outside of the radius.
@param float $... | [
"Creates",
"new",
"predicate",
"for",
"!bbox",
"filter",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L284-L293 |
224,461 | minimalcode-org/search | src/Criteria.php | Criteria.contains | public function contains($value)
{
if (\is_array($value)) {
/** @noinspection ForeachSourceInspection */
foreach ($value as $item) {
$this->contains($item);
}
} else {
$this->predicates[] = '*' . $this->processValue($value) . '*';
... | php | public function contains($value)
{
if (\is_array($value)) {
/** @noinspection ForeachSourceInspection */
foreach ($value as $item) {
$this->contains($item);
}
} else {
$this->predicates[] = '*' . $this->processValue($value) . '*';
... | [
"public",
"function",
"contains",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"/** @noinspection ForeachSourceInspection */",
"foreach",
"(",
"$",
"value",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"c... | Crates new predicate with leading and trailing wildcards for each entry.
@param string|string[] $value
@return $this | [
"Crates",
"new",
"predicate",
"with",
"leading",
"and",
"trailing",
"wildcards",
"for",
"each",
"entry",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L321-L333 |
224,462 | minimalcode-org/search | src/Criteria.php | Criteria.startsWith | public function startsWith($prefix)
{
if (\is_array($prefix)) {
/** @noinspection ForeachSourceInspection */
foreach ($prefix as $item) {
$this->startsWith($item);
}
} else {
$this->assertNotBlanks($prefix);
$this->predicate... | php | public function startsWith($prefix)
{
if (\is_array($prefix)) {
/** @noinspection ForeachSourceInspection */
foreach ($prefix as $item) {
$this->startsWith($item);
}
} else {
$this->assertNotBlanks($prefix);
$this->predicate... | [
"public",
"function",
"startsWith",
"(",
"$",
"prefix",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"prefix",
")",
")",
"{",
"/** @noinspection ForeachSourceInspection */",
"foreach",
"(",
"$",
"prefix",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->",... | Crates new predicate with trailing wildcard for each entry.
@param string|string[] $prefix
@return $this
@throws \InvalidArgumentException if prefix contains blank char | [
"Crates",
"new",
"predicate",
"with",
"trailing",
"wildcard",
"for",
"each",
"entry",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L342-L355 |
224,463 | minimalcode-org/search | src/Criteria.php | Criteria.endsWith | public function endsWith($postfix)
{
if (\is_array($postfix)) {
/** @noinspection ForeachSourceInspection */
foreach ($postfix as $item) {
$this->endsWith($item);
}
} else {
$this->assertNotBlanks($postfix);
$this->predicate... | php | public function endsWith($postfix)
{
if (\is_array($postfix)) {
/** @noinspection ForeachSourceInspection */
foreach ($postfix as $item) {
$this->endsWith($item);
}
} else {
$this->assertNotBlanks($postfix);
$this->predicate... | [
"public",
"function",
"endsWith",
"(",
"$",
"postfix",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"postfix",
")",
")",
"{",
"/** @noinspection ForeachSourceInspection */",
"foreach",
"(",
"$",
"postfix",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->"... | Crates new predicate with leading wildcard for each entry.
@param string|string[] $postfix
@return $this
@throws \InvalidArgumentException if postfix contains blank char | [
"Crates",
"new",
"predicate",
"with",
"leading",
"wildcard",
"for",
"each",
"entry",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L364-L377 |
224,464 | minimalcode-org/search | src/Criteria.php | Criteria.fuzzy | public function fuzzy($value, $levenshteinDistance = null)
{
if ($levenshteinDistance !== null && ($levenshteinDistance < 0)) {
throw new InvalidArgumentException('Levenshtein Distance has to be 0 or above');
}
/** Float deprecated in Solr */
$this->predicates[] = $this-... | php | public function fuzzy($value, $levenshteinDistance = null)
{
if ($levenshteinDistance !== null && ($levenshteinDistance < 0)) {
throw new InvalidArgumentException('Levenshtein Distance has to be 0 or above');
}
/** Float deprecated in Solr */
$this->predicates[] = $this-... | [
"public",
"function",
"fuzzy",
"(",
"$",
"value",
",",
"$",
"levenshteinDistance",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"levenshteinDistance",
"!==",
"null",
"&&",
"(",
"$",
"levenshteinDistance",
"<",
"0",
")",
")",
"{",
"throw",
"new",
"InvalidArgument... | Crates new predicate with trailing ~ optionally followed by levensteinDistance.
@param string $value
@param int|float $levenshteinDistance optional
@return $this
@throws \InvalidArgumentException if levensteinDistance with wrong bounds | [
"Crates",
"new",
"predicate",
"with",
"trailing",
"~",
"optionally",
"followed",
"by",
"levensteinDistance",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L411-L423 |
224,465 | minimalcode-org/search | src/Criteria.php | Criteria.sloppy | public function sloppy($phrase, $distance)
{
if ($distance <= 0) {
throw new InvalidArgumentException('Slop distance has to be greater than 0.');
}
if (\strpos($phrase, ' ') === false) {
throw new InvalidArgumentException('Sloppy phrase must consist of multiple terms... | php | public function sloppy($phrase, $distance)
{
if ($distance <= 0) {
throw new InvalidArgumentException('Slop distance has to be greater than 0.');
}
if (\strpos($phrase, ' ') === false) {
throw new InvalidArgumentException('Sloppy phrase must consist of multiple terms... | [
"public",
"function",
"sloppy",
"(",
"$",
"phrase",
",",
"$",
"distance",
")",
"{",
"if",
"(",
"$",
"distance",
"<=",
"0",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Slop distance has to be greater than 0.'",
")",
";",
"}",
"if",
"(",
"\\",... | Crates new precidate with trailing ~ followed by distance.
@param string $phrase
@param int $distance
@return $this
@throws \InvalidArgumentException if sloppy distance < 0
@throws \InvalidArgumentException if sloppy phrase without multiple terms | [
"Crates",
"new",
"precidate",
"with",
"trailing",
"~",
"followed",
"by",
"distance",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L434-L447 |
224,466 | minimalcode-org/search | src/Criteria.php | Criteria.boost | public function boost($value)
{
if ($value < 0) {
throw new InvalidArgumentException('Boost must not be negative.');
}
$this->boost = $this->processFloat($value);
return $this;
} | php | public function boost($value)
{
if ($value < 0) {
throw new InvalidArgumentException('Boost must not be negative.');
}
$this->boost = $this->processFloat($value);
return $this;
} | [
"public",
"function",
"boost",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"<",
"0",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Boost must not be negative.'",
")",
";",
"}",
"$",
"this",
"->",
"boost",
"=",
"$",
"this",
"->",
... | Boost positive hit with given factor. eg. ^2.3 value.
@param float $value
@return $this
@throws \InvalidArgumentException if provided boost is negative | [
"Boost",
"positive",
"hit",
"with",
"given",
"factor",
".",
"eg",
".",
"^2",
".",
"3",
"value",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L481-L490 |
224,467 | minimalcode-org/search | src/Criteria.php | Criteria.traverse | private function traverse(Node $node)
{
$query = '';
if ($node->getOperator() !== Node::OPERATOR_BLANK) {
$query .= ' ' . $node->getOperator() . ' ';
}
if ($node->getType() === Node::TYPE_CROTCH) {
$addsParentheses = $node->isNegatingWholeChildren()
... | php | private function traverse(Node $node)
{
$query = '';
if ($node->getOperator() !== Node::OPERATOR_BLANK) {
$query .= ' ' . $node->getOperator() . ' ';
}
if ($node->getType() === Node::TYPE_CROTCH) {
$addsParentheses = $node->isNegatingWholeChildren()
... | [
"private",
"function",
"traverse",
"(",
"Node",
"$",
"node",
")",
"{",
"$",
"query",
"=",
"''",
";",
"if",
"(",
"$",
"node",
"->",
"getOperator",
"(",
")",
"!==",
"Node",
"::",
"OPERATOR_BLANK",
")",
"{",
"$",
"query",
".=",
"' '",
".",
"$",
"node"... | Parses and manages the current node tree of predicates.
@param Node $node
@return string | [
"Parses",
"and",
"manages",
"the",
"current",
"node",
"tree",
"of",
"predicates",
"."
] | f225300618b6567056196508298a9e7e6b5b484f | https://github.com/minimalcode-org/search/blob/f225300618b6567056196508298a9e7e6b5b484f/src/Criteria.php#L518-L588 |
224,468 | tomloprod/ionic-push-php | src/Api/Request.php | Request.sendRequest | public function sendRequest($method, $endPoint, $data = '')
{
$data = json_encode($data);
$headers = [
'Authorization: Bearer ' . $this->ionicAPIToken,
'Content-Type: application/json',
'Content-Length: ' . strlen($data),
];
$curlHandler = curl_i... | php | public function sendRequest($method, $endPoint, $data = '')
{
$data = json_encode($data);
$headers = [
'Authorization: Bearer ' . $this->ionicAPIToken,
'Content-Type: application/json',
'Content-Length: ' . strlen($data),
];
$curlHandler = curl_i... | [
"public",
"function",
"sendRequest",
"(",
"$",
"method",
",",
"$",
"endPoint",
",",
"$",
"data",
"=",
"''",
")",
"{",
"$",
"data",
"=",
"json_encode",
"(",
"$",
"data",
")",
";",
"$",
"headers",
"=",
"[",
"'Authorization: Bearer '",
".",
"$",
"this",
... | Send requests to the Ionic Push API.
INFO: https://docs.ionic.io/api/http.html#response-structure
@param string $method
@param string $endPoint
@param string $data
@throws RequestException
@return object | [
"Send",
"requests",
"to",
"the",
"Ionic",
"Push",
"API",
"."
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Request.php#L58-L110 |
224,469 | tomloprod/ionic-push-php | src/Api/Request.php | Request.throwRequestException | private function throwRequestException($statusCode, $response)
{
if ($response && isset($response->error)) {
$type = $response->error->type;
$message = $this->getResponseErrorMessage($response->error);
$link = $response->error->link;
} elseif ($this->isServerError... | php | private function throwRequestException($statusCode, $response)
{
if ($response && isset($response->error)) {
$type = $response->error->type;
$message = $this->getResponseErrorMessage($response->error);
$link = $response->error->link;
} elseif ($this->isServerError... | [
"private",
"function",
"throwRequestException",
"(",
"$",
"statusCode",
",",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"response",
"&&",
"isset",
"(",
"$",
"response",
"->",
"error",
")",
")",
"{",
"$",
"type",
"=",
"$",
"response",
"->",
"error",
"->... | Throw the RequestException error with error detail
@private
@param number $statusCode
@param mixed $response
@throws RequestException
@return void | [
"Throw",
"the",
"RequestException",
"error",
"with",
"error",
"detail"
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Request.php#L182-L199 |
224,470 | tomloprod/ionic-push-php | src/Api/Request.php | Request.getResponseErrorMessage | private function getResponseErrorMessage($error)
{
$message = $error->message;
if (isset($error->details) && is_array($error->details)) {
foreach ($error->details as $detail) {
$message .= implode(' - ', $detail->errors).' ['.$detail->error_type.' in '.$detail->parameter... | php | private function getResponseErrorMessage($error)
{
$message = $error->message;
if (isset($error->details) && is_array($error->details)) {
foreach ($error->details as $detail) {
$message .= implode(' - ', $detail->errors).' ['.$detail->error_type.' in '.$detail->parameter... | [
"private",
"function",
"getResponseErrorMessage",
"(",
"$",
"error",
")",
"{",
"$",
"message",
"=",
"$",
"error",
"->",
"message",
";",
"if",
"(",
"isset",
"(",
"$",
"error",
"->",
"details",
")",
"&&",
"is_array",
"(",
"$",
"error",
"->",
"details",
"... | Generate a full message from response error request
@private
@param object $error
@return string | [
"Generate",
"a",
"full",
"message",
"from",
"response",
"error",
"request"
] | ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa | https://github.com/tomloprod/ionic-push-php/blob/ad4f545b58d1c839960c3c1e7c16e8e04fe9e4aa/src/Api/Request.php#L209-L220 |
224,471 | webfactory/doctrine-orm-test-infrastructure | src/Webfactory/Doctrine/Config/FileDatabaseConnectionConfiguration.php | FileDatabaseConnectionConfiguration.toDatabaseFilePath | private function toDatabaseFilePath($filePath)
{
if ($filePath === null) {
$temporaryFile = sys_get_temp_dir() . '/' . uniqid('db-', true) . '.sqlite';
// Ensure that the temporary file is removed on shutdown, otherwise the filesystem
// might be cluttered with database ... | php | private function toDatabaseFilePath($filePath)
{
if ($filePath === null) {
$temporaryFile = sys_get_temp_dir() . '/' . uniqid('db-', true) . '.sqlite';
// Ensure that the temporary file is removed on shutdown, otherwise the filesystem
// might be cluttered with database ... | [
"private",
"function",
"toDatabaseFilePath",
"(",
"$",
"filePath",
")",
"{",
"if",
"(",
"$",
"filePath",
"===",
"null",
")",
"{",
"$",
"temporaryFile",
"=",
"sys_get_temp_dir",
"(",
")",
".",
"'/'",
".",
"uniqid",
"(",
"'db-'",
",",
"true",
")",
".",
"... | Returns a file path for the database file.
Generates a unique file name if the given $filePath is null.
@param string|null $filePath
@return string | [
"Returns",
"a",
"file",
"path",
"for",
"the",
"database",
"file",
"."
] | 7385fd39d8d2a609cc1edebe9375c2c9bb6da84a | https://github.com/webfactory/doctrine-orm-test-infrastructure/blob/7385fd39d8d2a609cc1edebe9375c2c9bb6da84a/src/Webfactory/Doctrine/Config/FileDatabaseConnectionConfiguration.php#L68-L78 |
224,472 | artkonekt/address | src/Models/Province.php | Province.findByCountryAndCode | public static function findByCountryAndCode($country, $code)
{
$country = is_object($country) ? $country->id : $country;
return ProvinceProxy::byCountry($country)
->where('code', $code)
->take(1)
->get()
... | php | public static function findByCountryAndCode($country, $code)
{
$country = is_object($country) ? $country->id : $country;
return ProvinceProxy::byCountry($country)
->where('code', $code)
->take(1)
->get()
... | [
"public",
"static",
"function",
"findByCountryAndCode",
"(",
"$",
"country",
",",
"$",
"code",
")",
"{",
"$",
"country",
"=",
"is_object",
"(",
"$",
"country",
")",
"?",
"$",
"country",
"->",
"id",
":",
"$",
"country",
";",
"return",
"ProvinceProxy",
"::... | Returns a single province object by country and code
@param \Konekt\Address\Contracts\Country|string $country
@param string $code
@return \Konekt\Address\Contracts\Province | [
"Returns",
"a",
"single",
"province",
"object",
"by",
"country",
"and",
"code"
] | 1804292674b02dbb02a7f76bffdfd260b6a5d841 | https://github.com/artkonekt/address/blob/1804292674b02dbb02a7f76bffdfd260b6a5d841/src/Models/Province.php#L60-L69 |
224,473 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.executeUpdates | private function executeUpdates(ClassMetadata $class, array $options = array())
{
$className = $class->name;
$persister = $this->getXmlEntityPersister($className);
$hasPreUpdateLifecycleCallbacks = isset($class->lifecycleCallbacks[Events::preUpdate]);
$hasPreUpdateListeners = $this-... | php | private function executeUpdates(ClassMetadata $class, array $options = array())
{
$className = $class->name;
$persister = $this->getXmlEntityPersister($className);
$hasPreUpdateLifecycleCallbacks = isset($class->lifecycleCallbacks[Events::preUpdate]);
$hasPreUpdateListeners = $this-... | [
"private",
"function",
"executeUpdates",
"(",
"ClassMetadata",
"$",
"class",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"className",
"=",
"$",
"class",
"->",
"name",
";",
"$",
"persister",
"=",
"$",
"this",
"->",
"getXmlEntityPe... | Executes all xml entity updates for documents of the specified type.
@param Doctrine\OXM\Mapping\ClassMetadata $class
@param array $options Array of options to be used with update() | [
"Executes",
"all",
"xml",
"entity",
"updates",
"for",
"documents",
"of",
"the",
"specified",
"type",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L342-L378 |
224,474 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.doRefresh | private function doRefresh($xmlEntity, array &$visited)
{
$oid = spl_object_hash($xmlEntity);
if (isset($visited[$oid])) {
return; // Prevent infinite recursion
}
$visited[$oid] = $xmlEntity; // mark visited
$class = $this->xem->getClassMetadata(get_class($xmlEn... | php | private function doRefresh($xmlEntity, array &$visited)
{
$oid = spl_object_hash($xmlEntity);
if (isset($visited[$oid])) {
return; // Prevent infinite recursion
}
$visited[$oid] = $xmlEntity; // mark visited
$class = $this->xem->getClassMetadata(get_class($xmlEn... | [
"private",
"function",
"doRefresh",
"(",
"$",
"xmlEntity",
",",
"array",
"&",
"$",
"visited",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"xmlEntity",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"visited",
"[",
"$",
"oid",
"]",
")",
")",
"{... | Executes a refresh operation on an xml-entity.
@param object $xmlEntity The xml-entity to refresh.
@param array $visited The already visited xml-entities during cascades.
@throws InvalidArgumentException If the xml-entity is not MANAGED. | [
"Executes",
"a",
"refresh",
"operation",
"on",
"an",
"xml",
"-",
"entity",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L393-L408 |
224,475 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.doDetach | private function doDetach($xmlEntity, array &$visited)
{
$oid = spl_object_hash($xmlEntity);
if (isset($visited[$oid])) {
return; // Prevent infinite recursion
}
$visited[$oid] = $xmlEntity; // mark visited
switch ($this->getXmlEntityState($xmlEntity, self::STAT... | php | private function doDetach($xmlEntity, array &$visited)
{
$oid = spl_object_hash($xmlEntity);
if (isset($visited[$oid])) {
return; // Prevent infinite recursion
}
$visited[$oid] = $xmlEntity; // mark visited
switch ($this->getXmlEntityState($xmlEntity, self::STAT... | [
"private",
"function",
"doDetach",
"(",
"$",
"xmlEntity",
",",
"array",
"&",
"$",
"visited",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"xmlEntity",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"visited",
"[",
"$",
"oid",
"]",
")",
")",
"{"... | Executes a detach operation on the given xml-entity.
@param object $xmlEntity
@param array $visited
@internal This method always considers xml-entities with an assigned identifier as DETACHED. | [
"Executes",
"a",
"detach",
"operation",
"on",
"the",
"given",
"xml",
"-",
"entity",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L429-L451 |
224,476 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.persist | public function persist($xmlEntity)
{
$class = $this->xem->getClassMetadata(get_class($xmlEntity));
if ($class->isMappedSuperclass) {
throw OXMException::cannotPersistMappedSuperclass($class->name);
}
if (!$class->isRoot) {
throw OXMException::canOnlyPersistR... | php | public function persist($xmlEntity)
{
$class = $this->xem->getClassMetadata(get_class($xmlEntity));
if ($class->isMappedSuperclass) {
throw OXMException::cannotPersistMappedSuperclass($class->name);
}
if (!$class->isRoot) {
throw OXMException::canOnlyPersistR... | [
"public",
"function",
"persist",
"(",
"$",
"xmlEntity",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"xem",
"->",
"getClassMetadata",
"(",
"get_class",
"(",
"$",
"xmlEntity",
")",
")",
";",
"if",
"(",
"$",
"class",
"->",
"isMappedSuperclass",
")",
"... | Persists an xml entity as part of the current unit of work.
@param object $xmlEntity The xml entity to persist. | [
"Persists",
"an",
"xml",
"entity",
"as",
"part",
"of",
"the",
"current",
"unit",
"of",
"work",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L589-L601 |
224,477 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.scheduleForDirtyCheck | public function scheduleForDirtyCheck($xmlEntity)
{
$rootClassName = $this->xem->getClassMetadata(get_class($xmlEntity))->rootXmlEntityName;
$this->scheduledForDirtyCheck[$rootClassName][spl_object_hash($xmlEntity)] = $xmlEntity;
} | php | public function scheduleForDirtyCheck($xmlEntity)
{
$rootClassName = $this->xem->getClassMetadata(get_class($xmlEntity))->rootXmlEntityName;
$this->scheduledForDirtyCheck[$rootClassName][spl_object_hash($xmlEntity)] = $xmlEntity;
} | [
"public",
"function",
"scheduleForDirtyCheck",
"(",
"$",
"xmlEntity",
")",
"{",
"$",
"rootClassName",
"=",
"$",
"this",
"->",
"xem",
"->",
"getClassMetadata",
"(",
"get_class",
"(",
"$",
"xmlEntity",
")",
")",
"->",
"rootXmlEntityName",
";",
"$",
"this",
"->... | Schedules a xml entity for dirty-checking at commit-time.
@param object $xmlEntity The xml entity to schedule for dirty-checking.
@todo Rename: scheduleForSynchronization | [
"Schedules",
"a",
"xml",
"entity",
"for",
"dirty",
"-",
"checking",
"at",
"commit",
"-",
"time",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L663-L667 |
224,478 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.scheduleForInsert | public function scheduleForInsert($xmlEntity)
{
$oid = spl_object_hash($xmlEntity);
if (isset($this->entityUpdates[$oid])) {
throw new \InvalidArgumentException("Dirty xml entity can not be scheduled for insertion.");
}
if (isset($this->entityDeletions[$oid])) {
... | php | public function scheduleForInsert($xmlEntity)
{
$oid = spl_object_hash($xmlEntity);
if (isset($this->entityUpdates[$oid])) {
throw new \InvalidArgumentException("Dirty xml entity can not be scheduled for insertion.");
}
if (isset($this->entityDeletions[$oid])) {
... | [
"public",
"function",
"scheduleForInsert",
"(",
"$",
"xmlEntity",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"xmlEntity",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"entityUpdates",
"[",
"$",
"oid",
"]",
")",
")",
"{",
"throw",
... | Schedules an document for insertion into the database.
If the document already has an identifier, it will be added to the identity map.
@param object $xmlEntity The document to schedule for insertion. | [
"Schedules",
"an",
"document",
"for",
"insertion",
"into",
"the",
"database",
".",
"If",
"the",
"document",
"already",
"has",
"an",
"identifier",
"it",
"will",
"be",
"added",
"to",
"the",
"identity",
"map",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L706-L725 |
224,479 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.getXmlEntityState | public function getXmlEntityState($xmlEntity, $assume = null)
{
$oid = spl_object_hash($xmlEntity);
if ( ! isset($this->entityStates[$oid])) {
$class = $this->xem->getClassMetadata(get_class($xmlEntity));
// State can only be NEW or DETACHED, because MANAGED/REMOVED states a... | php | public function getXmlEntityState($xmlEntity, $assume = null)
{
$oid = spl_object_hash($xmlEntity);
if ( ! isset($this->entityStates[$oid])) {
$class = $this->xem->getClassMetadata(get_class($xmlEntity));
// State can only be NEW or DETACHED, because MANAGED/REMOVED states a... | [
"public",
"function",
"getXmlEntityState",
"(",
"$",
"xmlEntity",
",",
"$",
"assume",
"=",
"null",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"xmlEntity",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"entityStates",
"[",
"$",... | Gets the state of an xml entity within the current unit of work.
NOTE: This method sees xml entities that are not MANAGED or REMOVED and have a
populated identifier, whether it is generated or manually assigned, as
DETACHED. This can be incorrect for manually assigned identifiers.
@param object $xmlEntity
@param inte... | [
"Gets",
"the",
"state",
"of",
"an",
"xml",
"entity",
"within",
"the",
"current",
"unit",
"of",
"work",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L782-L815 |
224,480 | doctrine/oxm | lib/Doctrine/OXM/UnitOfWork.php | UnitOfWork.propertyChanged | function propertyChanged($entity, $propertyName, $oldValue, $newValue)
{
$oid = spl_object_hash($entity);
$class = $this->xem->getClassMetadata(get_class($entity));
if ( ! isset($class->fieldMappings[$propertyName])) {
return; // ignore non-persistent fields
}
/... | php | function propertyChanged($entity, $propertyName, $oldValue, $newValue)
{
$oid = spl_object_hash($entity);
$class = $this->xem->getClassMetadata(get_class($entity));
if ( ! isset($class->fieldMappings[$propertyName])) {
return; // ignore non-persistent fields
}
/... | [
"function",
"propertyChanged",
"(",
"$",
"entity",
",",
"$",
"propertyName",
",",
"$",
"oldValue",
",",
"$",
"newValue",
")",
"{",
"$",
"oid",
"=",
"spl_object_hash",
"(",
"$",
"entity",
")",
";",
"$",
"class",
"=",
"$",
"this",
"->",
"xem",
"->",
"g... | Notifies the listener of a property change.
@param object $sender The object on which the property changed.
@param string $propertyName The name of the property that changed.
@param mixed $oldValue The old value of the property that changed.
@param mixed $newValue The new value of the property that changed. | [
"Notifies",
"the",
"listener",
"of",
"a",
"property",
"change",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/UnitOfWork.php#L841-L855 |
224,481 | bramstroker/zf2-fullpage-cache | src/Strategy/Route.php | Route.checkParams | protected function checkParams(RouteMatch $match, $routeConfig)
{
if (!isset($routeConfig['params'])) {
return true;
}
$params = (array) $routeConfig['params'];
foreach ($params as $name => $value) {
$param = $match->getParam($name, null);
if (nu... | php | protected function checkParams(RouteMatch $match, $routeConfig)
{
if (!isset($routeConfig['params'])) {
return true;
}
$params = (array) $routeConfig['params'];
foreach ($params as $name => $value) {
$param = $match->getParam($name, null);
if (nu... | [
"protected",
"function",
"checkParams",
"(",
"RouteMatch",
"$",
"match",
",",
"$",
"routeConfig",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"routeConfig",
"[",
"'params'",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"params",
"=",
"(",
"a... | Check if we should cache the request based on the params in the routematch
@param RouteMatch $match
@param array $routeConfig
@return bool | [
"Check",
"if",
"we",
"should",
"cache",
"the",
"request",
"based",
"on",
"the",
"params",
"in",
"the",
"routematch"
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Strategy/Route.php#L55-L75 |
224,482 | bramstroker/zf2-fullpage-cache | src/Strategy/Route.php | Route.checkHttpMethod | protected function checkHttpMethod(MvcEvent $event, $routeConfig)
{
$request = $event->getRequest();
if (!$request instanceof HttpRequest) {
return false;
}
if (isset($routeConfig['http_methods'])) {
$methods = (array) $routeConfig['http_methods'];
... | php | protected function checkHttpMethod(MvcEvent $event, $routeConfig)
{
$request = $event->getRequest();
if (!$request instanceof HttpRequest) {
return false;
}
if (isset($routeConfig['http_methods'])) {
$methods = (array) $routeConfig['http_methods'];
... | [
"protected",
"function",
"checkHttpMethod",
"(",
"MvcEvent",
"$",
"event",
",",
"$",
"routeConfig",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"!",
"$",
"request",
"instanceof",
"HttpRequest",
")",
"{",
"re... | Check if we should cache the request based on http method requested
@param MvcEvent $event
@param $routeConfig
@return bool | [
"Check",
"if",
"we",
"should",
"cache",
"the",
"request",
"based",
"on",
"http",
"method",
"requested"
] | ae2cf413e445163a6725afbca597d6fb98c38f0d | https://github.com/bramstroker/zf2-fullpage-cache/blob/ae2cf413e445163a6725afbca597d6fb98c38f0d/src/Strategy/Route.php#L105-L120 |
224,483 | doctrine/oxm | lib/Doctrine/OXM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getReflectionClass | public function getReflectionClass()
{
if ( ! $this->reflClass) {
$this->reflClass = new \ReflectionClass($this->name);
}
return $this->reflClass;
} | php | public function getReflectionClass()
{
if ( ! $this->reflClass) {
$this->reflClass = new \ReflectionClass($this->name);
}
return $this->reflClass;
} | [
"public",
"function",
"getReflectionClass",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"reflClass",
")",
"{",
"$",
"this",
"->",
"reflClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"name",
")",
";",
"}",
"return",
"$",
"t... | Gets the ReflectionClass instance of the mapped class.
@return \ReflectionClass | [
"Gets",
"the",
"ReflectionClass",
"instance",
"of",
"the",
"mapped",
"class",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/ClassMetadataInfo.php#L342-L348 |
224,484 | doctrine/oxm | lib/Doctrine/OXM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getFieldXmlNode | public function getFieldXmlNode($fieldName)
{
return isset($this->fieldMappings[$fieldName]) ?
$this->fieldMappings[$fieldName]['node'] : null;
} | php | public function getFieldXmlNode($fieldName)
{
return isset($this->fieldMappings[$fieldName]) ?
$this->fieldMappings[$fieldName]['node'] : null;
} | [
"public",
"function",
"getFieldXmlNode",
"(",
"$",
"fieldName",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"fieldMappings",
"[",
"$",
"fieldName",
"]",
")",
"?",
"$",
"this",
"->",
"fieldMappings",
"[",
"$",
"fieldName",
"]",
"[",
"'node'",
"]"... | Gets the type of an xml name.
@return string one of ("node", "attribute", "text") | [
"Gets",
"the",
"type",
"of",
"an",
"xml",
"name",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/ClassMetadataInfo.php#L775-L779 |
224,485 | doctrine/oxm | lib/Doctrine/OXM/Mapping/ClassMetadataInfo.php | ClassMetadataInfo.getFieldName | public function getFieldName($xmlName)
{
return isset($this->xmlFieldMap[$xmlName]) ?
$this->xmlFieldMap[$xmlName] : null;
} | php | public function getFieldName($xmlName)
{
return isset($this->xmlFieldMap[$xmlName]) ?
$this->xmlFieldMap[$xmlName] : null;
} | [
"public",
"function",
"getFieldName",
"(",
"$",
"xmlName",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"xmlFieldMap",
"[",
"$",
"xmlName",
"]",
")",
"?",
"$",
"this",
"->",
"xmlFieldMap",
"[",
"$",
"xmlName",
"]",
":",
"null",
";",
"}"
] | Gets the field name for a xml name.
If no field name can be found the xml name is returned.
@param string $xmlName xml name
@return string field name | [
"Gets",
"the",
"field",
"name",
"for",
"a",
"xml",
"name",
".",
"If",
"no",
"field",
"name",
"can",
"be",
"found",
"the",
"xml",
"name",
"is",
"returned",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Mapping/ClassMetadataInfo.php#L801-L805 |
224,486 | ry167/twig-gravatar | src/TwigGravatar.php | TwigGravatar.avatar | public function avatar($email) {
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$baseUrl = $this->useHttps ? $this->https($this->baseUrl) : $this->baseUrl;
$url = $baseUrl . "avatar/" . $this->generateHash($email);
} else {
throw new InvalidArgumentException("The avatar filter must be passed a valid Emai... | php | public function avatar($email) {
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$baseUrl = $this->useHttps ? $this->https($this->baseUrl) : $this->baseUrl;
$url = $baseUrl . "avatar/" . $this->generateHash($email);
} else {
throw new InvalidArgumentException("The avatar filter must be passed a valid Emai... | [
"public",
"function",
"avatar",
"(",
"$",
"email",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"email",
",",
"FILTER_VALIDATE_EMAIL",
")",
")",
"{",
"$",
"baseUrl",
"=",
"$",
"this",
"->",
"useHttps",
"?",
"$",
"this",
"->",
"https",
"(",
"$",
"this... | Get a Gravatar Avatar URL
@param string $email Gravatar Email address
@return string Gravatar Avatar URL
@throws \InvalidArgumentException If $email is invalid | [
"Get",
"a",
"Gravatar",
"Avatar",
"URL"
] | baea4afdd3024bddc3b5682446c9951e0256c3b0 | https://github.com/ry167/twig-gravatar/blob/baea4afdd3024bddc3b5682446c9951e0256c3b0/src/TwigGravatar.php#L60-L81 |
224,487 | ry167/twig-gravatar | src/TwigGravatar.php | TwigGravatar.https | public function https($value) {
if (strpos($value, $this->baseUrl) === false) {
throw new InvalidArgumentException("You can only convert existing Gravatar URLs to HTTPS");
}
else {
return str_replace($this->baseUrl, $this->httpsUrl, $value);
}
} | php | public function https($value) {
if (strpos($value, $this->baseUrl) === false) {
throw new InvalidArgumentException("You can only convert existing Gravatar URLs to HTTPS");
}
else {
return str_replace($this->baseUrl, $this->httpsUrl, $value);
}
} | [
"public",
"function",
"https",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"baseUrl",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"You can only convert existing Gravatar URL... | Change a Gravatar URL to its Secure version
@param string $value URL to convert
@return string Converted URL
@throws \InvalidArgumentException If $value isn't an existing Gravatar URL | [
"Change",
"a",
"Gravatar",
"URL",
"to",
"its",
"Secure",
"version"
] | baea4afdd3024bddc3b5682446c9951e0256c3b0 | https://github.com/ry167/twig-gravatar/blob/baea4afdd3024bddc3b5682446c9951e0256c3b0/src/TwigGravatar.php#L89-L96 |
224,488 | ry167/twig-gravatar | src/TwigGravatar.php | TwigGravatar.size | public function size($value, $px) {
if (!is_numeric($px) || $px < 0 || $px > 2048) {
throw new InvalidArgumentException("You must pass the size filter a valid number between 0 and 2048");
}
else if (strpos($value, $this->baseUrl) === false
&& strpos($value, $this->httpsUrl) === false) {
throw new Invalid... | php | public function size($value, $px) {
if (!is_numeric($px) || $px < 0 || $px > 2048) {
throw new InvalidArgumentException("You must pass the size filter a valid number between 0 and 2048");
}
else if (strpos($value, $this->baseUrl) === false
&& strpos($value, $this->httpsUrl) === false) {
throw new Invalid... | [
"public",
"function",
"size",
"(",
"$",
"value",
",",
"$",
"px",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"px",
")",
"||",
"$",
"px",
"<",
"0",
"||",
"$",
"px",
">",
"2048",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Y... | Change the Size of a Gravatar URL
@param string $value
@param integer $px
@return string Sized Gravatar URL | [
"Change",
"the",
"Size",
"of",
"a",
"Gravatar",
"URL"
] | baea4afdd3024bddc3b5682446c9951e0256c3b0 | https://github.com/ry167/twig-gravatar/blob/baea4afdd3024bddc3b5682446c9951e0256c3b0/src/TwigGravatar.php#L104-L115 |
224,489 | ry167/twig-gravatar | src/TwigGravatar.php | TwigGravatar.def | public function def($value, $default, $force = false) {
if (strpos($value, $this->baseUrl) === false && strpos($value, $this->httpsUrl) === false) {
throw new InvalidArgumentException("You can only a default to existing Gravatar URLs");
}
else if (!filter_var($default, FILTER_VALIDATE_URL) && !in_array($defaul... | php | public function def($value, $default, $force = false) {
if (strpos($value, $this->baseUrl) === false && strpos($value, $this->httpsUrl) === false) {
throw new InvalidArgumentException("You can only a default to existing Gravatar URLs");
}
else if (!filter_var($default, FILTER_VALIDATE_URL) && !in_array($defaul... | [
"public",
"function",
"def",
"(",
"$",
"value",
",",
"$",
"default",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"baseUrl",
")",
"===",
"false",
"&&",
"strpos",
"(",
"$",
"value",
","... | Specify a default Image for when there is no matching Gravatar image.
@param string $value
@param string $default
@param boolean $force Always load the default image
@return string Gravatar URL with a default image. | [
"Specify",
"a",
"default",
"Image",
"for",
"when",
"there",
"is",
"no",
"matching",
"Gravatar",
"image",
"."
] | baea4afdd3024bddc3b5682446c9951e0256c3b0 | https://github.com/ry167/twig-gravatar/blob/baea4afdd3024bddc3b5682446c9951e0256c3b0/src/TwigGravatar.php#L124-L142 |
224,490 | ry167/twig-gravatar | src/TwigGravatar.php | TwigGravatar.rating | public function rating($value, $rating) {
if (strpos($value, $this->baseUrl) === false && strpos($value, $this->httpsUrl) === false) {
throw new InvalidArgumentException("You can only add a rating to an existing Gravatar URL");
}
else if (!in_array(strtolower($rating), $this->ratings)) {
throw new InvalidAr... | php | public function rating($value, $rating) {
if (strpos($value, $this->baseUrl) === false && strpos($value, $this->httpsUrl) === false) {
throw new InvalidArgumentException("You can only add a rating to an existing Gravatar URL");
}
else if (!in_array(strtolower($rating), $this->ratings)) {
throw new InvalidAr... | [
"public",
"function",
"rating",
"(",
"$",
"value",
",",
"$",
"rating",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"baseUrl",
")",
"===",
"false",
"&&",
"strpos",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"httpsUrl",
... | Specify the maximum rating for an avatar
@param string $value
@param string $rating Expects g,pg,r or x
@return string Gravatar URL with a rating specified | [
"Specify",
"the",
"maximum",
"rating",
"for",
"an",
"avatar"
] | baea4afdd3024bddc3b5682446c9951e0256c3b0 | https://github.com/ry167/twig-gravatar/blob/baea4afdd3024bddc3b5682446c9951e0256c3b0/src/TwigGravatar.php#L150-L160 |
224,491 | ry167/twig-gravatar | src/TwigGravatar.php | TwigGravatar.query | private function query($string, array $addition) {
parse_str(parse_url( $string, PHP_URL_QUERY), $queryList);
foreach ($addition as $key => $value) {
$queryList[$key] = $value;
}
$url = sprintf(
'%s://%s%s%s',
parse_url($string, PHP_URL_SCHEME),
parse_url($string, PHP_URL_HOST),
parse_url($stri... | php | private function query($string, array $addition) {
parse_str(parse_url( $string, PHP_URL_QUERY), $queryList);
foreach ($addition as $key => $value) {
$queryList[$key] = $value;
}
$url = sprintf(
'%s://%s%s%s',
parse_url($string, PHP_URL_SCHEME),
parse_url($string, PHP_URL_HOST),
parse_url($stri... | [
"private",
"function",
"query",
"(",
"$",
"string",
",",
"array",
"$",
"addition",
")",
"{",
"parse_str",
"(",
"parse_url",
"(",
"$",
"string",
",",
"PHP_URL_QUERY",
")",
",",
"$",
"queryList",
")",
";",
"foreach",
"(",
"$",
"addition",
"as",
"$",
"key... | Generate the query string
@param string $string
@param array $addition Array of what parameters to add
@return string | [
"Generate",
"the",
"query",
"string"
] | baea4afdd3024bddc3b5682446c9951e0256c3b0 | https://github.com/ry167/twig-gravatar/blob/baea4afdd3024bddc3b5682446c9951e0256c3b0/src/TwigGravatar.php#L178-L194 |
224,492 | doctrine/oxm | lib/Doctrine/OXM/XmlEntityManager.php | XmlEntityManager.getRepository | public function getRepository($entityName)
{
$entityName = ltrim($entityName, '\\');
if (isset($this->repositories[$entityName])) {
return $this->repositories[$entityName];
}
$metadata = $this->getClassMetadata($entityName);
$customRepositoryClassName = $metadata... | php | public function getRepository($entityName)
{
$entityName = ltrim($entityName, '\\');
if (isset($this->repositories[$entityName])) {
return $this->repositories[$entityName];
}
$metadata = $this->getClassMetadata($entityName);
$customRepositoryClassName = $metadata... | [
"public",
"function",
"getRepository",
"(",
"$",
"entityName",
")",
"{",
"$",
"entityName",
"=",
"ltrim",
"(",
"$",
"entityName",
",",
"'\\\\'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"repositories",
"[",
"$",
"entityName",
"]",
")",
")"... | Gets the repository for a class.
@param string $entityName
@return \Doctrine\Common\Persistence\ObjectRepository | [
"Gets",
"the",
"repository",
"for",
"a",
"class",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/XmlEntityManager.php#L241-L260 |
224,493 | doctrine/oxm | lib/Doctrine/OXM/XmlEntityManager.php | XmlEntityManager.refresh | public function refresh($entity)
{
if ( ! is_object($entity)) {
throw new \InvalidArgumentException(gettype($entity));
}
$this->errorIfClosed();
$this->unitOfWork->refresh($entity);
} | php | public function refresh($entity)
{
if ( ! is_object($entity)) {
throw new \InvalidArgumentException(gettype($entity));
}
$this->errorIfClosed();
$this->unitOfWork->refresh($entity);
} | [
"public",
"function",
"refresh",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"entity",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"gettype",
"(",
"$",
"entity",
")",
")",
";",
"}",
"$",
"this",
"->"... | Refreshes the persistent state of an entity from the filesystem,
overriding any local changes that have not yet been persisted.
@param object $entity The entity to refresh. | [
"Refreshes",
"the",
"persistent",
"state",
"of",
"an",
"entity",
"from",
"the",
"filesystem",
"overriding",
"any",
"local",
"changes",
"that",
"have",
"not",
"yet",
"been",
"persisted",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/XmlEntityManager.php#L310-L317 |
224,494 | doctrine/oxm | lib/Doctrine/OXM/XmlEntityManager.php | XmlEntityManager.persist | public function persist($entity)
{
if ( ! is_object($entity)) {
throw new \InvalidArgumentException(gettype($entity));
}
$this->errorIfClosed();
$this->unitOfWork->persist($entity);
} | php | public function persist($entity)
{
if ( ! is_object($entity)) {
throw new \InvalidArgumentException(gettype($entity));
}
$this->errorIfClosed();
$this->unitOfWork->persist($entity);
} | [
"public",
"function",
"persist",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"entity",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"gettype",
"(",
"$",
"entity",
")",
")",
";",
"}",
"$",
"this",
"->"... | Tells the XmlEntityManager to make an instance managed and persistent.
The entity will be entered into the filesystem at or before transaction
commit or as a result of the flush operation.
NOTE: The persist operation always considers entities that are not yet known to
this XmlEntityManager as NEW. Do not pass detache... | [
"Tells",
"the",
"XmlEntityManager",
"to",
"make",
"an",
"instance",
"managed",
"and",
"persistent",
"."
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/XmlEntityManager.php#L381-L388 |
224,495 | artkonekt/address | src/Utils/PersonNameSplitter.php | PersonNameSplitter.split | public static function split($name, NameOrder $nameOrder = null)
{
$name = trim($name);
$parts = explode(' ', $name);
$nameOrder = $nameOrder ?: NameOrderProxy::create(); // create default if none was given
switch (count($parts)) {
case 1:
return... | php | public static function split($name, NameOrder $nameOrder = null)
{
$name = trim($name);
$parts = explode(' ', $name);
$nameOrder = $nameOrder ?: NameOrderProxy::create(); // create default if none was given
switch (count($parts)) {
case 1:
return... | [
"public",
"static",
"function",
"split",
"(",
"$",
"name",
",",
"NameOrder",
"$",
"nameOrder",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"trim",
"(",
"$",
"name",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"' '",
",",
"$",
"name",
")",
";",
"$",... | Parse and split a fullname into firstname & lastname.
Returns an array with attributes as keys eg.:
$name = 'Charlie Firpo' -> [ 'firstname' => 'Charlie', 'lastname' => 'Firpo']
Note that these are just rough guesses
@param string $name
@param NameOrder $nameOrder
@return array | [
"Parse",
"and",
"split",
"a",
"fullname",
"into",
"firstname",
"&",
"lastname",
"."
] | 1804292674b02dbb02a7f76bffdfd260b6a5d841 | https://github.com/artkonekt/address/blob/1804292674b02dbb02a7f76bffdfd260b6a5d841/src/Utils/PersonNameSplitter.php#L32-L81 |
224,496 | doctrine/oxm | lib/Doctrine/OXM/Id/UuidGenerator.php | UuidGenerator.generate | public function generate(XmlEntityManager $xem, $xmlEntity)
{
if (!$this->salt) {
throw new \Exception('Guid Generator requires a salt to be provided.');
}
$guid = $this->generateV4();
return $this->generateV5($guid, $this->salt);
} | php | public function generate(XmlEntityManager $xem, $xmlEntity)
{
if (!$this->salt) {
throw new \Exception('Guid Generator requires a salt to be provided.');
}
$guid = $this->generateV4();
return $this->generateV5($guid, $this->salt);
} | [
"public",
"function",
"generate",
"(",
"XmlEntityManager",
"$",
"xem",
",",
"$",
"xmlEntity",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"salt",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Guid Generator requires a salt to be provided.'",
")",
";",
... | Generates a new GUID
@return string | [
"Generates",
"a",
"new",
"GUID"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Id/UuidGenerator.php#L78-L86 |
224,497 | doctrine/oxm | lib/Doctrine/OXM/Id/UuidGenerator.php | UuidGenerator.generateV4 | public function generateV4()
{
return sprintf('%04x%04x%04x%04x%04x%04x%04x%04x',
// 32 bits for "time_low"
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
// 16 bits for "time_mid"
mt_rand(0, 0xffff),
// 16 bits for "time_hi_and_version",
//... | php | public function generateV4()
{
return sprintf('%04x%04x%04x%04x%04x%04x%04x%04x',
// 32 bits for "time_low"
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
// 16 bits for "time_mid"
mt_rand(0, 0xffff),
// 16 bits for "time_hi_and_version",
//... | [
"public",
"function",
"generateV4",
"(",
")",
"{",
"return",
"sprintf",
"(",
"'%04x%04x%04x%04x%04x%04x%04x%04x'",
",",
"// 32 bits for \"time_low\"",
"mt_rand",
"(",
"0",
",",
"0xffff",
")",
",",
"mt_rand",
"(",
"0",
",",
"0xffff",
")",
",",
"// 16 bits for \"tim... | Generates a v4 GUID
@return string | [
"Generates",
"a",
"v4",
"GUID"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Id/UuidGenerator.php#L93-L113 |
224,498 | doctrine/oxm | lib/Doctrine/OXM/Id/UuidGenerator.php | UuidGenerator.generateV5 | public function generateV5($namespace, $salt)
{
if (!$this->isValid($namespace)) {
throw new \Exception('Provided $namespace is invalid: ' . $namespace);
}
// Get hexadecimal components of namespace
$nhex = str_replace(array('-','{','}'), '', $namespace);
// Bin... | php | public function generateV5($namespace, $salt)
{
if (!$this->isValid($namespace)) {
throw new \Exception('Provided $namespace is invalid: ' . $namespace);
}
// Get hexadecimal components of namespace
$nhex = str_replace(array('-','{','}'), '', $namespace);
// Bin... | [
"public",
"function",
"generateV5",
"(",
"$",
"namespace",
",",
"$",
"salt",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
"$",
"namespace",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Provided $namespace is invalid: '",
".",
... | Generates a v5 GUID
@param string $namespace The GUID to seed with
@param string $salt The string to salt this new UUID with
@return string | [
"Generates",
"a",
"v5",
"GUID"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Id/UuidGenerator.php#L122-L163 |
224,499 | doctrine/oxm | lib/Doctrine/OXM/Tools/XmlEntityGenerator.php | XmlEntityGenerator.generate | public function generate(array $metadatas, $outputDirectory)
{
foreach ($metadatas as $metadata) {
$this->writeXmlEntityClass($metadata, $outputDirectory);
}
} | php | public function generate(array $metadatas, $outputDirectory)
{
foreach ($metadatas as $metadata) {
$this->writeXmlEntityClass($metadata, $outputDirectory);
}
} | [
"public",
"function",
"generate",
"(",
"array",
"$",
"metadatas",
",",
"$",
"outputDirectory",
")",
"{",
"foreach",
"(",
"$",
"metadatas",
"as",
"$",
"metadata",
")",
"{",
"$",
"this",
"->",
"writeXmlEntityClass",
"(",
"$",
"metadata",
",",
"$",
"outputDir... | Generate and write xml-entity classes for the given array of ClassMetadataInfo instances
@param array $metadatas
@param string $outputDirectory
@return void | [
"Generate",
"and",
"write",
"xml",
"-",
"entity",
"classes",
"for",
"the",
"given",
"array",
"of",
"ClassMetadataInfo",
"instances"
] | dec0f71d8219975165ba52cad6f0d538d8d2ffee | https://github.com/doctrine/oxm/blob/dec0f71d8219975165ba52cad6f0d538d8d2ffee/lib/Doctrine/OXM/Tools/XmlEntityGenerator.php#L147-L152 |
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.