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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
190,800 | fordnox/php-queue-manager | Queue/Manager.php | Manager.getTotalMessages | public function getTotalMessages()
{
$sql = 'SELECT COUNT(message_id) FROM ' . $this->messageTable . ' WHERE 1';
$stmt = $this->getDb()->prepare($sql);
$stmt->execute();
return $stmt->fetchColumn();
} | php | public function getTotalMessages()
{
$sql = 'SELECT COUNT(message_id) FROM ' . $this->messageTable . ' WHERE 1';
$stmt = $this->getDb()->prepare($sql);
$stmt->execute();
return $stmt->fetchColumn();
} | [
"public",
"function",
"getTotalMessages",
"(",
")",
"{",
"$",
"sql",
"=",
"'SELECT COUNT(message_id) FROM '",
".",
"$",
"this",
"->",
"messageTable",
".",
"' WHERE 1'",
";",
"$",
"stmt",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
"->",
"prepare",
"(",
"$",... | Get total messages in all queues
@return int | [
"Get",
"total",
"messages",
"in",
"all",
"queues"
] | 68f8918a367e672eea1d95a98e3f5a82f20724f9 | https://github.com/fordnox/php-queue-manager/blob/68f8918a367e672eea1d95a98e3f5a82f20724f9/Queue/Manager.php#L397-L403 |
190,801 | flagrow/flarum-ext-image-upload | src/Listeners/LoadSettingsFromDatabase.php | LoadSettingsFromDatabase.addUploadMethods | public function addUploadMethods(PrepareUnserializedSettings $event)
{
// these are the upload methods that doesn't require external libraries
$methods = [
'local',
'imgur'
];
// check for Cloudinary, if present add the method
if (class_exists(Cloudin... | php | public function addUploadMethods(PrepareUnserializedSettings $event)
{
// these are the upload methods that doesn't require external libraries
$methods = [
'local',
'imgur'
];
// check for Cloudinary, if present add the method
if (class_exists(Cloudin... | [
"public",
"function",
"addUploadMethods",
"(",
"PrepareUnserializedSettings",
"$",
"event",
")",
"{",
"// these are the upload methods that doesn't require external libraries",
"$",
"methods",
"=",
"[",
"'local'",
",",
"'imgur'",
"]",
";",
"// check for Cloudinary, if present a... | Check for installed packages and provide the upload methods option
in the admin page-
@param PrepareUnserializedSettings $event | [
"Check",
"for",
"installed",
"packages",
"and",
"provide",
"the",
"upload",
"methods",
"option",
"in",
"the",
"admin",
"page",
"-"
] | fd23bdef9b37272243b6bd4cbf0aa2ada477c6ca | https://github.com/flagrow/flarum-ext-image-upload/blob/fd23bdef9b37272243b6bd4cbf0aa2ada477c6ca/src/Listeners/LoadSettingsFromDatabase.php#L78-L96 |
190,802 | paylike/php-api | src/Data/Currencies.php | Currencies.getPaylikeMultiplier | public function getPaylikeMultiplier( $currency_iso_code ) {
$currency = $this->getCurrency( $currency_iso_code );
if ( isset( $currency['exponent'] ) ) {
return pow( 10, $currency['exponent'] );
} else {
return pow( 10, 2 );
}
} | php | public function getPaylikeMultiplier( $currency_iso_code ) {
$currency = $this->getCurrency( $currency_iso_code );
if ( isset( $currency['exponent'] ) ) {
return pow( 10, $currency['exponent'] );
} else {
return pow( 10, 2 );
}
} | [
"public",
"function",
"getPaylikeMultiplier",
"(",
"$",
"currency_iso_code",
")",
"{",
"$",
"currency",
"=",
"$",
"this",
"->",
"getCurrency",
"(",
"$",
"currency_iso_code",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"currency",
"[",
"'exponent'",
"]",
")",
"... | Return the number that should be used to compute cents from the total amount
@param $currency_iso_code
@return int|number | [
"Return",
"the",
"number",
"that",
"should",
"be",
"used",
"to",
"compute",
"cents",
"from",
"the",
"total",
"amount"
] | 1da4f6ecf21412b289564955e965293bc512f1b6 | https://github.com/paylike/php-api/blob/1da4f6ecf21412b289564955e965293bc512f1b6/src/Data/Currencies.php#L45-L52 |
190,803 | waldo2188/DatatableBundle | Util/Formatter/Renderer.php | Renderer.build | public function build(array $renderers, array $fields)
{
$this->renderers = $renderers;
$this->fields = $fields;
$this->prepare();
return $this;
} | php | public function build(array $renderers, array $fields)
{
$this->renderers = $renderers;
$this->fields = $fields;
$this->prepare();
return $this;
} | [
"public",
"function",
"build",
"(",
"array",
"$",
"renderers",
",",
"array",
"$",
"fields",
")",
"{",
"$",
"this",
"->",
"renderers",
"=",
"$",
"renderers",
";",
"$",
"this",
"->",
"fields",
"=",
"$",
"fields",
";",
"$",
"this",
"->",
"prepare",
"(",... | Build the renderer
@param array $renderers
@param array $fields
@return \Waldo\DatatableBundle\Util\Formatter\Renderer | [
"Build",
"the",
"renderer"
] | 7ed6f754441a561caf1265d102144b15284a9e6a | https://github.com/waldo2188/DatatableBundle/blob/7ed6f754441a561caf1265d102144b15284a9e6a/Util/Formatter/Renderer.php#L48-L55 |
190,804 | paylike/php-api | src/Utils/Cursor.php | Cursor.updateOffset | private function updateOffset()
{
if ($this->after()) {
$this->params['after'] = $this->collection[$this->total_count - 1]['id'];
} else {
$this->params['before'] = $this->collection[$this->total_count - 1]['id'];
}
return $this;
} | php | private function updateOffset()
{
if ($this->after()) {
$this->params['after'] = $this->collection[$this->total_count - 1]['id'];
} else {
$this->params['before'] = $this->collection[$this->total_count - 1]['id'];
}
return $this;
} | [
"private",
"function",
"updateOffset",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"after",
"(",
")",
")",
"{",
"$",
"this",
"->",
"params",
"[",
"'after'",
"]",
"=",
"$",
"this",
"->",
"collection",
"[",
"$",
"this",
"->",
"total_count",
"-",
"1"... | If after is set, then we increment it, otherwise we increment before | [
"If",
"after",
"is",
"set",
"then",
"we",
"increment",
"it",
"otherwise",
"we",
"increment",
"before"
] | 1da4f6ecf21412b289564955e965293bc512f1b6 | https://github.com/paylike/php-api/blob/1da4f6ecf21412b289564955e965293bc512f1b6/src/Utils/Cursor.php#L222-L230 |
190,805 | waldo2188/DatatableBundle | Util/Factory/Query/DoctrineBuilder.php | DoctrineBuilder.isTheIdentifierILookingFor | private function isTheIdentifierILookingFor(Query\Lexer $lexer)
{
if ($lexer->token['type'] === Query\Lexer::T_IDENTIFIER && $lexer->isNextToken(Query\Lexer::T_IDENTIFIER)) {
return true;
}
if ($lexer->token['type'] === Query\Lexer::T_IDENTIFIER && $lexer->isNextToken(Query\Lexe... | php | private function isTheIdentifierILookingFor(Query\Lexer $lexer)
{
if ($lexer->token['type'] === Query\Lexer::T_IDENTIFIER && $lexer->isNextToken(Query\Lexer::T_IDENTIFIER)) {
return true;
}
if ($lexer->token['type'] === Query\Lexer::T_IDENTIFIER && $lexer->isNextToken(Query\Lexe... | [
"private",
"function",
"isTheIdentifierILookingFor",
"(",
"Query",
"\\",
"Lexer",
"$",
"lexer",
")",
"{",
"if",
"(",
"$",
"lexer",
"->",
"token",
"[",
"'type'",
"]",
"===",
"Query",
"\\",
"Lexer",
"::",
"T_IDENTIFIER",
"&&",
"$",
"lexer",
"->",
"isNextToke... | Check if it's the lexer part is the identifier I looking for
@param \Doctrine\ORM\Query\Lexer $lexer
@return boolean | [
"Check",
"if",
"it",
"s",
"the",
"lexer",
"part",
"is",
"the",
"identifier",
"I",
"looking",
"for"
] | 7ed6f754441a561caf1265d102144b15284a9e6a | https://github.com/waldo2188/DatatableBundle/blob/7ed6f754441a561caf1265d102144b15284a9e6a/Util/Factory/Query/DoctrineBuilder.php#L587-L603 |
190,806 | waldo2188/DatatableBundle | Util/Factory/Query/DoctrineBuilder.php | DoctrineBuilder.isStringDQLQuery | private function isStringDQLQuery($value)
{
$keysWord = array(
"SELECT ",
" FROM ",
" WHERE "
);
foreach ($keysWord as $keyWord) {
if (stripos($value, $keyWord) !== false) {
return true;
}
}
return ... | php | private function isStringDQLQuery($value)
{
$keysWord = array(
"SELECT ",
" FROM ",
" WHERE "
);
foreach ($keysWord as $keyWord) {
if (stripos($value, $keyWord) !== false) {
return true;
}
}
return ... | [
"private",
"function",
"isStringDQLQuery",
"(",
"$",
"value",
")",
"{",
"$",
"keysWord",
"=",
"array",
"(",
"\"SELECT \"",
",",
"\" FROM \"",
",",
"\" WHERE \"",
")",
";",
"foreach",
"(",
"$",
"keysWord",
"as",
"$",
"keyWord",
")",
"{",
"if",
"(",
"strip... | Check if a sring is a DQL query
@param string $value
@return boolean | [
"Check",
"if",
"a",
"sring",
"is",
"a",
"DQL",
"query"
] | 7ed6f754441a561caf1265d102144b15284a9e6a | https://github.com/waldo2188/DatatableBundle/blob/7ed6f754441a561caf1265d102144b15284a9e6a/Util/Factory/Query/DoctrineBuilder.php#L611-L626 |
190,807 | chsergey/yii2-rest-client | src/DataProvider.php | DataProvider.prepareModels | protected function prepareModels() {
if(!$this->query instanceof QueryInterface) {
throw new InvalidConfigException(
'The "query" property must be an instance of a class that implements the '.
'chsergey\rest\QueryInterface or its subclasses.'
);
}
$query = clone $this->query;
$this->setPaginatio... | php | protected function prepareModels() {
if(!$this->query instanceof QueryInterface) {
throw new InvalidConfigException(
'The "query" property must be an instance of a class that implements the '.
'chsergey\rest\QueryInterface or its subclasses.'
);
}
$query = clone $this->query;
$this->setPaginatio... | [
"protected",
"function",
"prepareModels",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"query",
"instanceof",
"QueryInterface",
")",
"{",
"throw",
"new",
"InvalidConfigException",
"(",
"'The \"query\" property must be an instance of a class that implements the '",
".... | Prepares the data models that will be made available in the current page.
@return array the available data models
@throws InvalidConfigException | [
"Prepares",
"the",
"data",
"models",
"that",
"will",
"be",
"made",
"available",
"in",
"the",
"current",
"page",
"."
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/DataProvider.php#L25-L46 |
190,808 | chsergey/yii2-rest-client | src/DataProvider.php | DataProvider.prepareKeys | protected function prepareKeys($models) {
$keys = [];
foreach ($models as $model) {
$keys[] = $model->getPrimaryKey();
}
return $keys;
} | php | protected function prepareKeys($models) {
$keys = [];
foreach ($models as $model) {
$keys[] = $model->getPrimaryKey();
}
return $keys;
} | [
"protected",
"function",
"prepareKeys",
"(",
"$",
"models",
")",
"{",
"$",
"keys",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"$",
"keys",
"[",
"]",
"=",
"$",
"model",
"->",
"getPrimaryKey",
"(",
")",
";",
"}... | Prepares the keys associated with the currently available data models.
@param Model[] $models the available data models
@return array the keys | [
"Prepares",
"the",
"keys",
"associated",
"with",
"the",
"currently",
"available",
"data",
"models",
"."
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/DataProvider.php#L53-L59 |
190,809 | waldo2188/DatatableBundle | Util/Datatable.php | Datatable.setGlobalSearch | public function setGlobalSearch($globalSearch)
{
$this->globalSearch = $globalSearch;
$this->queryBuilder->setSearch($globalSearch || $this->search);
return $this;
} | php | public function setGlobalSearch($globalSearch)
{
$this->globalSearch = $globalSearch;
$this->queryBuilder->setSearch($globalSearch || $this->search);
return $this;
} | [
"public",
"function",
"setGlobalSearch",
"(",
"$",
"globalSearch",
")",
"{",
"$",
"this",
"->",
"globalSearch",
"=",
"$",
"globalSearch",
";",
"$",
"this",
"->",
"queryBuilder",
"->",
"setSearch",
"(",
"$",
"globalSearch",
"||",
"$",
"this",
"->",
"search",
... | set global search
@param bool $globalSearch
@return Datatable | [
"set",
"global",
"search"
] | 7ed6f754441a561caf1265d102144b15284a9e6a | https://github.com/waldo2188/DatatableBundle/blob/7ed6f754441a561caf1265d102144b15284a9e6a/Util/Datatable.php#L530-L535 |
190,810 | chsergey/yii2-rest-client | src/Query.php | Query.one | public function one($id) {
if($this->_where) {
throw new InvalidCallException(__METHOD__.'() can not be called with "where" clause');
}
$model = $this->_populate(
$this->_request('get',
$this->_getUrl('element', $id),
[
'query' => $this->_buildQueryParams()
]
),
false
);
return... | php | public function one($id) {
if($this->_where) {
throw new InvalidCallException(__METHOD__.'() can not be called with "where" clause');
}
$model = $this->_populate(
$this->_request('get',
$this->_getUrl('element', $id),
[
'query' => $this->_buildQueryParams()
]
),
false
);
return... | [
"public",
"function",
"one",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_where",
")",
"{",
"throw",
"new",
"InvalidCallException",
"(",
"__METHOD__",
".",
"'() can not be called with \"where\" clause'",
")",
";",
"}",
"$",
"model",
"=",
"$",
... | GET resource element request
@inheritdoc | [
"GET",
"resource",
"element",
"request"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L220-L237 |
190,811 | chsergey/yii2-rest-client | src/Query.php | Query._throwServerError | private function _throwServerError(\Exception $e) {
$uri = (string) $this->httpClient->getConfig('base_uri');
throw new ServerErrorHttpException(get_class($e).': url='.$uri .' '. $e->getMessage(), 500);
} | php | private function _throwServerError(\Exception $e) {
$uri = (string) $this->httpClient->getConfig('base_uri');
throw new ServerErrorHttpException(get_class($e).': url='.$uri .' '. $e->getMessage(), 500);
} | [
"private",
"function",
"_throwServerError",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"uri",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"httpClient",
"->",
"getConfig",
"(",
"'base_uri'",
")",
";",
"throw",
"new",
"ServerErrorHttpException",
"(",
"... | Throw 500 error exception
@param \Exception $e
@throws ServerErrorHttpException | [
"Throw",
"500",
"error",
"exception"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L327-L331 |
190,812 | chsergey/yii2-rest-client | src/Query.php | Query._populate | protected function _populate(ResponseInterface $response, $asCollection = true) {
$models = [];
$statusCode = $response->getStatusCode();
$data = $this->_unserializeResponseBody($response);
// errors
if($statusCode >= 400) {
throw new HttpException(
$statusCode,
is_string($data) ? $data : $data->... | php | protected function _populate(ResponseInterface $response, $asCollection = true) {
$models = [];
$statusCode = $response->getStatusCode();
$data = $this->_unserializeResponseBody($response);
// errors
if($statusCode >= 400) {
throw new HttpException(
$statusCode,
is_string($data) ? $data : $data->... | [
"protected",
"function",
"_populate",
"(",
"ResponseInterface",
"$",
"response",
",",
"$",
"asCollection",
"=",
"true",
")",
"{",
"$",
"models",
"=",
"[",
"]",
";",
"$",
"statusCode",
"=",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
";",
"$",
"data... | Unserialize and create models
@param ResponseInterface $response
@param bool $asCollection
@return $this|Model|array|void
@throws HttpException | [
"Unserialize",
"and",
"create",
"models"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L340-L381 |
190,813 | chsergey/yii2-rest-client | src/Query.php | Query._createModels | protected function _createModels(array $elements) {
$modelClass = $this->modelClass;
$models = [];
foreach ($elements as $element) {
$model = $modelClass::instantiate()->setAttributes($this->_getProps($element));
$models[] = $model->setId(
$model->getAttribute($modelClass::primaryKey()[0])
);
}
... | php | protected function _createModels(array $elements) {
$modelClass = $this->modelClass;
$models = [];
foreach ($elements as $element) {
$model = $modelClass::instantiate()->setAttributes($this->_getProps($element));
$models[] = $model->setId(
$model->getAttribute($modelClass::primaryKey()[0])
);
}
... | [
"protected",
"function",
"_createModels",
"(",
"array",
"$",
"elements",
")",
"{",
"$",
"modelClass",
"=",
"$",
"this",
"->",
"modelClass",
";",
"$",
"models",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"element",
")",
"{",
"$",
... | Create models from array of elements
@param array $elements
@return array | [
"Create",
"models",
"from",
"array",
"of",
"elements"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L388-L399 |
190,814 | chsergey/yii2-rest-client | src/Query.php | Query._unserializeResponseBody | protected function _unserializeResponseBody(ResponseInterface $response) {
$body = (string) $response->getBody();
$contentType = $response->getHeaderLine('Content-type');
try {
if(false !== stripos($contentType, $this->dataType)
&& isset($this->unserializers[$this->dataType])) {
/** @var Unserializer... | php | protected function _unserializeResponseBody(ResponseInterface $response) {
$body = (string) $response->getBody();
$contentType = $response->getHeaderLine('Content-type');
try {
if(false !== stripos($contentType, $this->dataType)
&& isset($this->unserializers[$this->dataType])) {
/** @var Unserializer... | [
"protected",
"function",
"_unserializeResponseBody",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"body",
"=",
"(",
"string",
")",
"$",
"response",
"->",
"getBody",
"(",
")",
";",
"$",
"contentType",
"=",
"$",
"response",
"->",
"getHeaderLine",
... | Try to unserialize response body data
@param ResponseInterface $response
@return object[]|object|string
@throws \yii\base\InvalidConfigException | [
"Try",
"to",
"unserialize",
"response",
"body",
"data"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L407-L428 |
190,815 | chsergey/yii2-rest-client | src/Query.php | Query._setPagination | private function _setPagination(array $pagination) {
foreach ($this->_paginationEnvelopeKeys as $key => $name) {
$this->_pagination[$key] = isset($pagination[$name])
? $pagination[$name]
: null;
}
return $this;
} | php | private function _setPagination(array $pagination) {
foreach ($this->_paginationEnvelopeKeys as $key => $name) {
$this->_pagination[$key] = isset($pagination[$name])
? $pagination[$name]
: null;
}
return $this;
} | [
"private",
"function",
"_setPagination",
"(",
"array",
"$",
"pagination",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_paginationEnvelopeKeys",
"as",
"$",
"key",
"=>",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"_pagination",
"[",
"$",
"key",
"]",
"=",
... | Pagination data setter
If pagination data isset in GET request result
@param array $pagination
@return $this | [
"Pagination",
"data",
"setter",
"If",
"pagination",
"data",
"isset",
"in",
"GET",
"request",
"result"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L436-L444 |
190,816 | chsergey/yii2-rest-client | src/Query.php | Query._buildQueryParams | private function _buildQueryParams() {
$query = [];
$this->_where = is_array($this->_where) ? $this->_where : [];
foreach ($this->_where as $key => $val) {
$query[$key] = is_numeric($val) ? (int) $val : $val;
}
if(count($this->_select)) {
$query[$this->selectFieldsKey] = implode(',', $this->_select);
... | php | private function _buildQueryParams() {
$query = [];
$this->_where = is_array($this->_where) ? $this->_where : [];
foreach ($this->_where as $key => $val) {
$query[$key] = is_numeric($val) ? (int) $val : $val;
}
if(count($this->_select)) {
$query[$this->selectFieldsKey] = implode(',', $this->_select);
... | [
"private",
"function",
"_buildQueryParams",
"(",
")",
"{",
"$",
"query",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"_where",
"=",
"is_array",
"(",
"$",
"this",
"->",
"_where",
")",
"?",
"$",
"this",
"->",
"_where",
":",
"[",
"]",
";",
"foreach",
"(",
... | Build query params
@return array | [
"Build",
"query",
"params"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L460-L479 |
190,817 | chsergey/yii2-rest-client | src/Query.php | Query._getUrl | private function _getUrl($type = 'base', $id = 'null') {
$modelClass = $this->modelClass;
$collection = $modelClass::getResourceName();
switch($type) {
case 'api':
return $this->_trailingSlash($modelClass::getApiUrl());
break;
case 'collection':
return $this->_trailingSlash($collection, false);... | php | private function _getUrl($type = 'base', $id = 'null') {
$modelClass = $this->modelClass;
$collection = $modelClass::getResourceName();
switch($type) {
case 'api':
return $this->_trailingSlash($modelClass::getApiUrl());
break;
case 'collection':
return $this->_trailingSlash($collection, false);... | [
"private",
"function",
"_getUrl",
"(",
"$",
"type",
"=",
"'base'",
",",
"$",
"id",
"=",
"'null'",
")",
"{",
"$",
"modelClass",
"=",
"$",
"this",
"->",
"modelClass",
";",
"$",
"collection",
"=",
"$",
"modelClass",
"::",
"getResourceName",
"(",
")",
";",... | Get url to collection or element of resource
with check base url trailing slash
@param string $type api|collection|element
@param string $id
@return string | [
"Get",
"url",
"to",
"collection",
"or",
"element",
"of",
"resource",
"with",
"check",
"base",
"url",
"trailing",
"slash"
] | b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6 | https://github.com/chsergey/yii2-rest-client/blob/b7f0598ea11a4dbcc3b1890d8acbda17df7c70f6/src/Query.php#L497-L514 |
190,818 | crossjoin/Browscap | src/Parser/Sqlite/Parser.php | Parser.getDataVersionHash | protected function getDataVersionHash()
{
$filter = $this->getPropertyFilter();
$properties = $filter->getProperties();
sort($properties);
return sha1(
static::class . '|' .
static::VERSION . '|' .
get_class($filter) . '|' .
im... | php | protected function getDataVersionHash()
{
$filter = $this->getPropertyFilter();
$properties = $filter->getProperties();
sort($properties);
return sha1(
static::class . '|' .
static::VERSION . '|' .
get_class($filter) . '|' .
im... | [
"protected",
"function",
"getDataVersionHash",
"(",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"getPropertyFilter",
"(",
")",
";",
"$",
"properties",
"=",
"$",
"filter",
"->",
"getProperties",
"(",
")",
";",
"sort",
"(",
"$",
"properties",
")",
";"... | Generates a hash from relevant information that influence the
validity of
@return string | [
"Generates",
"a",
"hash",
"from",
"relevant",
"information",
"that",
"influence",
"the",
"validity",
"of"
] | e39933bd93aecee5019931e352cb91552fb68c30 | https://github.com/crossjoin/Browscap/blob/e39933bd93aecee5019931e352cb91552fb68c30/src/Parser/Sqlite/Parser.php#L193-L205 |
190,819 | winzou/tnt-express | src/Client/SoapClientBuilder.php | SoapClientBuilder.createClient | public function createClient($sandBox = false)
{
$client = new \SoapClient($this->wsdl, array(
'soap_version' => SOAP_1_1,
'classmap' => $this->classmap
));
$login = $sandBox ? self::TEST_LOGIN : $this->login;
$password = $sandBox ? self::TEST_PASSW... | php | public function createClient($sandBox = false)
{
$client = new \SoapClient($this->wsdl, array(
'soap_version' => SOAP_1_1,
'classmap' => $this->classmap
));
$login = $sandBox ? self::TEST_LOGIN : $this->login;
$password = $sandBox ? self::TEST_PASSW... | [
"public",
"function",
"createClient",
"(",
"$",
"sandBox",
"=",
"false",
")",
"{",
"$",
"client",
"=",
"new",
"\\",
"SoapClient",
"(",
"$",
"this",
"->",
"wsdl",
",",
"array",
"(",
"'soap_version'",
"=>",
"SOAP_1_1",
",",
"'classmap'",
"=>",
"$",
"this",... | Return a new instance of SoapClient
@param bool $sandBox
@return \SoapClient | [
"Return",
"a",
"new",
"instance",
"of",
"SoapClient"
] | e0a9e6df1847b086dee1ecf768c892bc78db379c | https://github.com/winzou/tnt-express/blob/e0a9e6df1847b086dee1ecf768c892bc78db379c/src/Client/SoapClientBuilder.php#L76-L89 |
190,820 | winzou/tnt-express | src/Client/SoapClientBuilder.php | SoapClientBuilder.getSecurityHeader | public function getSecurityHeader($login, $password)
{
$authHeader = sprintf(
$this->getSecurityHeaderTemplate(),
htmlspecialchars($login),
htmlspecialchars($password)
);
return new \SoapHeader(
'http://docs.oasis-open.org/wss/2004/01/oasis-20... | php | public function getSecurityHeader($login, $password)
{
$authHeader = sprintf(
$this->getSecurityHeaderTemplate(),
htmlspecialchars($login),
htmlspecialchars($password)
);
return new \SoapHeader(
'http://docs.oasis-open.org/wss/2004/01/oasis-20... | [
"public",
"function",
"getSecurityHeader",
"(",
"$",
"login",
",",
"$",
"password",
")",
"{",
"$",
"authHeader",
"=",
"sprintf",
"(",
"$",
"this",
"->",
"getSecurityHeaderTemplate",
"(",
")",
",",
"htmlspecialchars",
"(",
"$",
"login",
")",
",",
"htmlspecial... | Return an instance of SoapHeader for WS Security
@param string $login
@param string $password
@return \SoapHeader | [
"Return",
"an",
"instance",
"of",
"SoapHeader",
"for",
"WS",
"Security"
] | e0a9e6df1847b086dee1ecf768c892bc78db379c | https://github.com/winzou/tnt-express/blob/e0a9e6df1847b086dee1ecf768c892bc78db379c/src/Client/SoapClientBuilder.php#L99-L112 |
190,821 | loadsys/CakePHP-Sitemap | src/Controller/SitemapsController.php | SitemapsController.index | public function index() {
$tablesToList = [];
$data = [];
if (Configure::check('Sitemap.tables')) {
$tablesToList = Configure::read('Sitemap.tables');
}
foreach ($tablesToList as $table) {
$tableInstance = $this->loadModel($table);
$data[$table] = $tableInstance->find('forSitemap');
}
$this->s... | php | public function index() {
$tablesToList = [];
$data = [];
if (Configure::check('Sitemap.tables')) {
$tablesToList = Configure::read('Sitemap.tables');
}
foreach ($tablesToList as $table) {
$tableInstance = $this->loadModel($table);
$data[$table] = $tableInstance->find('forSitemap');
}
$this->s... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"tablesToList",
"=",
"[",
"]",
";",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"Configure",
"::",
"check",
"(",
"'Sitemap.tables'",
")",
")",
"{",
"$",
"tablesToList",
"=",
"Configure",
"::",
"read"... | Index page for the sitemap.
@return void | [
"Index",
"page",
"for",
"the",
"sitemap",
"."
] | 466043848d06ef69a3c8370d68635f49a3edabf8 | https://github.com/loadsys/CakePHP-Sitemap/blob/466043848d06ef69a3c8370d68635f49a3edabf8/src/Controller/SitemapsController.php#L19-L34 |
190,822 | fkooman/php-oauth2-client | src/Session.php | Session.take | public function take($key)
{
self::requireSession();
if (false === \array_key_exists($key, $_SESSION)) {
throw new SessionException(\sprintf('key "%s" not found in session', $key));
}
$value = $_SESSION[$key];
unset($_SESSION[$key]);
return $value;
} | php | public function take($key)
{
self::requireSession();
if (false === \array_key_exists($key, $_SESSION)) {
throw new SessionException(\sprintf('key "%s" not found in session', $key));
}
$value = $_SESSION[$key];
unset($_SESSION[$key]);
return $value;
} | [
"public",
"function",
"take",
"(",
"$",
"key",
")",
"{",
"self",
"::",
"requireSession",
"(",
")",
";",
"if",
"(",
"false",
"===",
"\\",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"_SESSION",
")",
")",
"{",
"throw",
"new",
"SessionException",
"(",
... | Get value, delete key.
@param string $key
@return mixed | [
"Get",
"value",
"delete",
"key",
"."
] | 2ed008b41a281880453807ca9f0ceb40db239b9e | https://github.com/fkooman/php-oauth2-client/blob/2ed008b41a281880453807ca9f0ceb40db239b9e/src/Session.php#L50-L60 |
190,823 | loadsys/CakePHP-Sitemap | src/Model/Behavior/SitemapBehavior.php | SitemapBehavior.returnUrlForEntity | public function returnUrlForEntity(Entity $entity) {
return Router::url(
[
'plugin' => null,
'prefix' => null,
'controller' => $this->_table->alias(),
'action' => 'view',
$entity->{$this->_table->primaryKey()},
],
true
);
} | php | public function returnUrlForEntity(Entity $entity) {
return Router::url(
[
'plugin' => null,
'prefix' => null,
'controller' => $this->_table->alias(),
'action' => 'view',
$entity->{$this->_table->primaryKey()},
],
true
);
} | [
"public",
"function",
"returnUrlForEntity",
"(",
"Entity",
"$",
"entity",
")",
"{",
"return",
"Router",
"::",
"url",
"(",
"[",
"'plugin'",
"=>",
"null",
",",
"'prefix'",
"=>",
"null",
",",
"'controller'",
"=>",
"$",
"this",
"->",
"_table",
"->",
"alias",
... | Return the URL for the primary view action for an Entity.
@param \Cake\ORM\Entity $entity Entity object passed in to return the url for.
@return string Returns the URL string. | [
"Return",
"the",
"URL",
"for",
"the",
"primary",
"view",
"action",
"for",
"an",
"Entity",
"."
] | 466043848d06ef69a3c8370d68635f49a3edabf8 | https://github.com/loadsys/CakePHP-Sitemap/blob/466043848d06ef69a3c8370d68635f49a3edabf8/src/Model/Behavior/SitemapBehavior.php#L72-L83 |
190,824 | loadsys/CakePHP-Sitemap | src/Model/Behavior/SitemapBehavior.php | SitemapBehavior.findSitemapRecords | public function findSitemapRecords(Query $query, array $options) {
$query = $query
->where($this->_config['conditions'])
->cache("sitemap_{$query->repository()->alias()}", $this->_config['cacheConfigKey'])
->order($this->_config['order'])
->formatResults(function ($results) {
return $this->mapResults(... | php | public function findSitemapRecords(Query $query, array $options) {
$query = $query
->where($this->_config['conditions'])
->cache("sitemap_{$query->repository()->alias()}", $this->_config['cacheConfigKey'])
->order($this->_config['order'])
->formatResults(function ($results) {
return $this->mapResults(... | [
"public",
"function",
"findSitemapRecords",
"(",
"Query",
"$",
"query",
",",
"array",
"$",
"options",
")",
"{",
"$",
"query",
"=",
"$",
"query",
"->",
"where",
"(",
"$",
"this",
"->",
"_config",
"[",
"'conditions'",
"]",
")",
"->",
"cache",
"(",
"\"sit... | Find the Sitemap Records for a Table.
@param \Cake\ORM\Query $query The Query being modified.
@param array $options The array of options for the find.
@return \Cake\ORM\Query Returns the modified Query object. | [
"Find",
"the",
"Sitemap",
"Records",
"for",
"a",
"Table",
"."
] | 466043848d06ef69a3c8370d68635f49a3edabf8 | https://github.com/loadsys/CakePHP-Sitemap/blob/466043848d06ef69a3c8370d68635f49a3edabf8/src/Model/Behavior/SitemapBehavior.php#L92-L106 |
190,825 | loadsys/CakePHP-Sitemap | src/Model/Behavior/SitemapBehavior.php | SitemapBehavior.mapEntity | public function mapEntity(Entity $entity) {
$entity['_loc'] = $this->_table->getUrl($entity);
$entity['_lastmod'] = $entity->{$this->_config['lastmod']};
$entity['_changefreq'] = $this->_config['changefreq'];
$entity['_priority'] = $this->_config['priority'];
return $entity;
} | php | public function mapEntity(Entity $entity) {
$entity['_loc'] = $this->_table->getUrl($entity);
$entity['_lastmod'] = $entity->{$this->_config['lastmod']};
$entity['_changefreq'] = $this->_config['changefreq'];
$entity['_priority'] = $this->_config['priority'];
return $entity;
} | [
"public",
"function",
"mapEntity",
"(",
"Entity",
"$",
"entity",
")",
"{",
"$",
"entity",
"[",
"'_loc'",
"]",
"=",
"$",
"this",
"->",
"_table",
"->",
"getUrl",
"(",
"$",
"entity",
")",
";",
"$",
"entity",
"[",
"'_lastmod'",
"]",
"=",
"$",
"entity",
... | Modify an entity with new `_` fields for the Sitemap display.
@param \Cake\ORM\Entity $entity The entity being modified.
@return \Cake\ORM\Entity Returns the modified entity. | [
"Modify",
"an",
"entity",
"with",
"new",
"_",
"fields",
"for",
"the",
"Sitemap",
"display",
"."
] | 466043848d06ef69a3c8370d68635f49a3edabf8 | https://github.com/loadsys/CakePHP-Sitemap/blob/466043848d06ef69a3c8370d68635f49a3edabf8/src/Model/Behavior/SitemapBehavior.php#L129-L136 |
190,826 | aedart/data-transfer-object-dto | src/DataTransferObject.php | DataTransferObject.resolveValue | protected function resolveValue(string $setterMethodName, $value)
{
$reflection = new ReflectionClass($this);
$method = $reflection->getMethod($setterMethodName);
$parameter = $method->getParameters()[0];
return $this->resolveParameter($parameter, $value);
} | php | protected function resolveValue(string $setterMethodName, $value)
{
$reflection = new ReflectionClass($this);
$method = $reflection->getMethod($setterMethodName);
$parameter = $method->getParameters()[0];
return $this->resolveParameter($parameter, $value);
} | [
"protected",
"function",
"resolveValue",
"(",
"string",
"$",
"setterMethodName",
",",
"$",
"value",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"method",
"=",
"$",
"reflection",
"->",
"getMethod",
"(",
"$",
... | Resolve and return the given value, for the given setter method
@param string $setterMethodName The setter method to be invoked
@param mixed $value The value to be passed to the setter method
@return mixed | [
"Resolve",
"and",
"return",
"the",
"given",
"value",
"for",
"the",
"given",
"setter",
"method"
] | d96eceeae9aa0ef1700402952e42abfd67334ffd | https://github.com/aedart/data-transfer-object-dto/blob/d96eceeae9aa0ef1700402952e42abfd67334ffd/src/DataTransferObject.php#L243-L252 |
190,827 | aedart/data-transfer-object-dto | src/DataTransferObject.php | DataTransferObject.resolveParameter | protected function resolveParameter(ReflectionParameter $parameter, $value)
{
// If there is no class for the given parameter
// then some kind of primitive data has been provided
// and thus we need only to return it.
$paramClass = $parameter->getClass();
if ( ! isset($param... | php | protected function resolveParameter(ReflectionParameter $parameter, $value)
{
// If there is no class for the given parameter
// then some kind of primitive data has been provided
// and thus we need only to return it.
$paramClass = $parameter->getClass();
if ( ! isset($param... | [
"protected",
"function",
"resolveParameter",
"(",
"ReflectionParameter",
"$",
"parameter",
",",
"$",
"value",
")",
"{",
"// If there is no class for the given parameter",
"// then some kind of primitive data has been provided",
"// and thus we need only to return it.",
"$",
"paramCla... | Resolve the given parameter; pass the given value to it
@param ReflectionParameter $parameter The setter method's parameter reflection
@param mixed $value The value to be passed to the setter method
@return mixed
@throws BindingResolutionException a) If no concrete instance could be resolved from the IoC, or
b) If ... | [
"Resolve",
"the",
"given",
"parameter",
";",
"pass",
"the",
"given",
"value",
"to",
"it"
] | d96eceeae9aa0ef1700402952e42abfd67334ffd | https://github.com/aedart/data-transfer-object-dto/blob/d96eceeae9aa0ef1700402952e42abfd67334ffd/src/DataTransferObject.php#L266-L308 |
190,828 | aedart/data-transfer-object-dto | src/DataTransferObject.php | DataTransferObject.resolveInstancePopulation | protected function resolveInstancePopulation($instance, ReflectionParameter $parameter, $value)
{
// Check if instance is populatable and if the given value
// is an array.
if ($instance instanceof Populatable && is_array($value)) {
$instance->populate($value);
retu... | php | protected function resolveInstancePopulation($instance, ReflectionParameter $parameter, $value)
{
// Check if instance is populatable and if the given value
// is an array.
if ($instance instanceof Populatable && is_array($value)) {
$instance->populate($value);
retu... | [
"protected",
"function",
"resolveInstancePopulation",
"(",
"$",
"instance",
",",
"ReflectionParameter",
"$",
"parameter",
",",
"$",
"value",
")",
"{",
"// Check if instance is populatable and if the given value",
"// is an array.",
"if",
"(",
"$",
"instance",
"instanceof",
... | Attempts to populate instance, if possible
@param object $instance The instance that must be populated
@param ReflectionParameter $parameter Setter method's parameter reflection that requires the given instance
@param mixed $value The value to be passed to the setter method
@return mixed
@throws BindingResolutionExce... | [
"Attempts",
"to",
"populate",
"instance",
"if",
"possible"
] | d96eceeae9aa0ef1700402952e42abfd67334ffd | https://github.com/aedart/data-transfer-object-dto/blob/d96eceeae9aa0ef1700402952e42abfd67334ffd/src/DataTransferObject.php#L321-L344 |
190,829 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.addCookie | public function addCookie($name, $value = null)
{
if (is_array($name)) {
$this->cookies = $name + $this->cookies;
} else {
$this->cookies[$name] = $value;
}
} | php | public function addCookie($name, $value = null)
{
if (is_array($name)) {
$this->cookies = $name + $this->cookies;
} else {
$this->cookies[$name] = $value;
}
} | [
"public",
"function",
"addCookie",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"cookies",
"=",
"$",
"name",
"+",
"$",
"this",
"->",
"cookies",
";",
"}",
... | Adds a cookie for a cURL transfer
Examples:
$curl->addCookie('user', 'admin');
$curl->addCookie(array('user'=>'admin', 'test'=>1));
@param string|array $name Name of cookie or array of cookies (name=>value)
@param string $value Value of cookie | [
"Adds",
"a",
"cookie",
"for",
"a",
"cURL",
"transfer"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L103-L110 |
190,830 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.clearCookieFile | public function clearCookieFile()
{
if (!is_writable($this->cookieFile)) {
throw new CurlWrapperException('Cookie file "'.($this->cookieFile).'" is not writable or does\'n exists!');
}
file_put_contents($this->cookieFile, '', LOCK_EX);
} | php | public function clearCookieFile()
{
if (!is_writable($this->cookieFile)) {
throw new CurlWrapperException('Cookie file "'.($this->cookieFile).'" is not writable or does\'n exists!');
}
file_put_contents($this->cookieFile, '', LOCK_EX);
} | [
"public",
"function",
"clearCookieFile",
"(",
")",
"{",
"if",
"(",
"!",
"is_writable",
"(",
"$",
"this",
"->",
"cookieFile",
")",
")",
"{",
"throw",
"new",
"CurlWrapperException",
"(",
"'Cookie file \"'",
".",
"(",
"$",
"this",
"->",
"cookieFile",
")",
"."... | Clears the cookies file | [
"Clears",
"the",
"cookies",
"file"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L175-L182 |
190,831 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.getTransferInfo | public function getTransferInfo($key = null)
{
if (empty($this->transferInfo)) {
throw new CurlWrapperException('There is no transfer info. Did you do the request?');
}
if ($key === null) {
return $this->transferInfo;
}
if (isset($this->transferInfo[... | php | public function getTransferInfo($key = null)
{
if (empty($this->transferInfo)) {
throw new CurlWrapperException('There is no transfer info. Did you do the request?');
}
if ($key === null) {
return $this->transferInfo;
}
if (isset($this->transferInfo[... | [
"public",
"function",
"getTransferInfo",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"transferInfo",
")",
")",
"{",
"throw",
"new",
"CurlWrapperException",
"(",
"'There is no transfer info. Did you do the request?'",
")",
... | Gets the information about the last transfer
If $key is given, returns its value. Otherwise, returns an associative array with the following elements:
url - Last effective URL
content_type - Content-Type: of downloaded object, NULL indicates server did not send valid Content-Type: head... | [
"Gets",
"the",
"information",
"about",
"the",
"last",
"transfer"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L281-L296 |
190,832 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.resetAll | public function resetAll()
{
$this->clearHeaders();
$this->clearOptions();
$this->clearRequestParams();
$this->clearCookies();
$this->clearCookieFile();
$this->reset();
} | php | public function resetAll()
{
$this->clearHeaders();
$this->clearOptions();
$this->clearRequestParams();
$this->clearCookies();
$this->clearCookieFile();
$this->reset();
} | [
"public",
"function",
"resetAll",
"(",
")",
"{",
"$",
"this",
"->",
"clearHeaders",
"(",
")",
";",
"$",
"this",
"->",
"clearOptions",
"(",
")",
";",
"$",
"this",
"->",
"clearRequestParams",
"(",
")",
";",
"$",
"this",
"->",
"clearCookies",
"(",
")",
... | Reinitiates the cURL handle and resets all data
Including headers, options, request parameters, cookies and cookies file | [
"Reinitiates",
"the",
"cURL",
"handle",
"and",
"resets",
"all",
"data",
"Including",
"headers",
"options",
"request",
"parameters",
"cookies",
"and",
"cookies",
"file"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L457-L465 |
190,833 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.setDefaultOptions | public function setDefaultOptions()
{
$this->options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_ENCODING => 'gzip,deflate',
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 15,
CURLO... | php | public function setDefaultOptions()
{
$this->options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_ENCODING => 'gzip,deflate',
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 15,
CURLO... | [
"public",
"function",
"setDefaultOptions",
"(",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"array",
"(",
"CURLOPT_RETURNTRANSFER",
"=>",
"true",
",",
"CURLOPT_HEADER",
"=>",
"false",
",",
"CURLOPT_ENCODING",
"=>",
"'gzip,deflate'",
",",
"CURLOPT_AUTOREFERER",
"=... | Sets the default options | [
"Sets",
"the",
"default",
"options"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L512-L522 |
190,834 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.initOptions | protected function initOptions()
{
if (!empty($this->requestParams)) {
if (isset($this->options[CURLOPT_HTTPGET])) {
$this->prepareGetParams();
} else {
$this->addOption(CURLOPT_POSTFIELDS, http_build_query($this->requestParams));
}
... | php | protected function initOptions()
{
if (!empty($this->requestParams)) {
if (isset($this->options[CURLOPT_HTTPGET])) {
$this->prepareGetParams();
} else {
$this->addOption(CURLOPT_POSTFIELDS, http_build_query($this->requestParams));
}
... | [
"protected",
"function",
"initOptions",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"requestParams",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"CURLOPT_HTTPGET",
"]",
")",
")",
"{",
"$",
"this",
... | Sets the final options and prepares request params, headers and cookies
@throws CurlWrapperCurlException | [
"Sets",
"the",
"final",
"options",
"and",
"prepares",
"request",
"params",
"headers",
"and",
"cookies"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L640-L666 |
190,835 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.prepareCookies | protected function prepareCookies()
{
$cookiesString = '';
foreach ($this->cookies as $cookie => $value) {
$cookiesString .= $cookie.'='.$value.'; ';
}
return $cookiesString;
} | php | protected function prepareCookies()
{
$cookiesString = '';
foreach ($this->cookies as $cookie => $value) {
$cookiesString .= $cookie.'='.$value.'; ';
}
return $cookiesString;
} | [
"protected",
"function",
"prepareCookies",
"(",
")",
"{",
"$",
"cookiesString",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"cookies",
"as",
"$",
"cookie",
"=>",
"$",
"value",
")",
"{",
"$",
"cookiesString",
".=",
"$",
"cookie",
".",
"'='",
".",... | Converts the cookies array to the correct string format
@return string | [
"Converts",
"the",
"cookies",
"array",
"to",
"the",
"correct",
"string",
"format"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L673-L682 |
190,836 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.prepareGetParams | protected function prepareGetParams()
{
$parsedUrl = parse_url($this->options[CURLOPT_URL]);
$query = http_build_query($this->requestParams);
if (isset($parsedUrl['query'])) {
$parsedUrl['query'] .= '&'.$query;
} else {
$parsedUrl['query'] = $query;
}... | php | protected function prepareGetParams()
{
$parsedUrl = parse_url($this->options[CURLOPT_URL]);
$query = http_build_query($this->requestParams);
if (isset($parsedUrl['query'])) {
$parsedUrl['query'] .= '&'.$query;
} else {
$parsedUrl['query'] = $query;
}... | [
"protected",
"function",
"prepareGetParams",
"(",
")",
"{",
"$",
"parsedUrl",
"=",
"parse_url",
"(",
"$",
"this",
"->",
"options",
"[",
"CURLOPT_URL",
"]",
")",
";",
"$",
"query",
"=",
"http_build_query",
"(",
"$",
"this",
"->",
"requestParams",
")",
";",
... | Converts request parameters to the query string and adds it to the request url | [
"Converts",
"request",
"parameters",
"to",
"the",
"query",
"string",
"and",
"adds",
"it",
"to",
"the",
"request",
"url"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L687-L699 |
190,837 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.prepareHeaders | protected function prepareHeaders()
{
$headers = array();
foreach ($this->headers as $header => $value) {
$headers[] = $header.': '.$value;
}
return $headers;
} | php | protected function prepareHeaders()
{
$headers = array();
foreach ($this->headers as $header => $value) {
$headers[] = $header.': '.$value;
}
return $headers;
} | [
"protected",
"function",
"prepareHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"headers",
"as",
"$",
"header",
"=>",
"$",
"value",
")",
"{",
"$",
"headers",
"[",
"]",
"=",
"$",
"header",
".... | Converts the headers array to the cURL's option format array
@return array | [
"Converts",
"the",
"headers",
"array",
"to",
"the",
"cURL",
"s",
"option",
"format",
"array"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L718-L727 |
190,838 | svyatov/CurlWrapper | CurlWrapper.php | CurlWrapper.setRequestMethod | protected function setRequestMethod($method)
{
// Preventing request methods collision
$this->removeOption(CURLOPT_NOBODY);
$this->removeOption(CURLOPT_HTTPGET);
$this->removeOption(CURLOPT_POST);
$this->removeOption(CURLOPT_CUSTOMREQUEST);
switch (strtoupper($method... | php | protected function setRequestMethod($method)
{
// Preventing request methods collision
$this->removeOption(CURLOPT_NOBODY);
$this->removeOption(CURLOPT_HTTPGET);
$this->removeOption(CURLOPT_POST);
$this->removeOption(CURLOPT_CUSTOMREQUEST);
switch (strtoupper($method... | [
"protected",
"function",
"setRequestMethod",
"(",
"$",
"method",
")",
"{",
"// Preventing request methods collision",
"$",
"this",
"->",
"removeOption",
"(",
"CURLOPT_NOBODY",
")",
";",
"$",
"this",
"->",
"removeOption",
"(",
"CURLOPT_HTTPGET",
")",
";",
"$",
"thi... | Sets the HTTP request method
@param string $method | [
"Sets",
"the",
"HTTP",
"request",
"method"
] | a1d64a3e155903927f7d296d679746cd31b5943d | https://github.com/svyatov/CurlWrapper/blob/a1d64a3e155903927f7d296d679746cd31b5943d/CurlWrapper.php#L734-L762 |
190,839 | fkooman/php-oauth2-client | src/OAuthClient.php | OAuthClient.send | public function send(Provider $provider, $userId, $requestScope, Request $request)
{
$accessToken = $this->getAccessToken($provider, $userId, $requestScope);
if (false === $accessToken) {
return false;
}
if ($accessToken->isExpired($this->dateTime)) {
// acce... | php | public function send(Provider $provider, $userId, $requestScope, Request $request)
{
$accessToken = $this->getAccessToken($provider, $userId, $requestScope);
if (false === $accessToken) {
return false;
}
if ($accessToken->isExpired($this->dateTime)) {
// acce... | [
"public",
"function",
"send",
"(",
"Provider",
"$",
"provider",
",",
"$",
"userId",
",",
"$",
"requestScope",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"accessToken",
"=",
"$",
"this",
"->",
"getAccessToken",
"(",
"$",
"provider",
",",
"$",
"userId"... | Perform a HTTP request.
@param Provider $provider
@param string $userId
@param string $requestScope
@param Http\Request $request
@return false|Http\Response | [
"Perform",
"a",
"HTTP",
"request",
"."
] | 2ed008b41a281880453807ca9f0ceb40db239b9e | https://github.com/fkooman/php-oauth2-client/blob/2ed008b41a281880453807ca9f0ceb40db239b9e/src/OAuthClient.php#L139-L177 |
190,840 | fkooman/php-oauth2-client | src/OAuthClient.php | OAuthClient.getAuthorizeUri | public function getAuthorizeUri(Provider $provider, $userId, $scope, $redirectUri)
{
$queryParameters = [
'client_id' => $provider->getClientId(),
'redirect_uri' => $redirectUri,
'scope' => $scope,
'state' => $this->random->getHex(16),
'response_ty... | php | public function getAuthorizeUri(Provider $provider, $userId, $scope, $redirectUri)
{
$queryParameters = [
'client_id' => $provider->getClientId(),
'redirect_uri' => $redirectUri,
'scope' => $scope,
'state' => $this->random->getHex(16),
'response_ty... | [
"public",
"function",
"getAuthorizeUri",
"(",
"Provider",
"$",
"provider",
",",
"$",
"userId",
",",
"$",
"scope",
",",
"$",
"redirectUri",
")",
"{",
"$",
"queryParameters",
"=",
"[",
"'client_id'",
"=>",
"$",
"provider",
"->",
"getClientId",
"(",
")",
",",... | Obtain an authorization request URL to start the authorization process
at the OAuth provider.
@param Provider $provider
@param string $userId
@param string $scope the space separated scope tokens
@param string $redirectUri the URL registered at the OAuth provider, to
be redirected back to
@return string t... | [
"Obtain",
"an",
"authorization",
"request",
"URL",
"to",
"start",
"the",
"authorization",
"process",
"at",
"the",
"OAuth",
"provider",
"."
] | 2ed008b41a281880453807ca9f0ceb40db239b9e | https://github.com/fkooman/php-oauth2-client/blob/2ed008b41a281880453807ca9f0ceb40db239b9e/src/OAuthClient.php#L194-L222 |
190,841 | fkooman/php-oauth2-client | src/OAuthClient.php | OAuthClient.getAccessToken | private function getAccessToken(Provider $provider, $userId, $scope)
{
$accessTokenList = $this->tokenStorage->getAccessTokenList($userId);
foreach ($accessTokenList as $accessToken) {
if ($provider->getProviderId() !== $accessToken->getProviderId()) {
continue;
... | php | private function getAccessToken(Provider $provider, $userId, $scope)
{
$accessTokenList = $this->tokenStorage->getAccessTokenList($userId);
foreach ($accessTokenList as $accessToken) {
if ($provider->getProviderId() !== $accessToken->getProviderId()) {
continue;
... | [
"private",
"function",
"getAccessToken",
"(",
"Provider",
"$",
"provider",
",",
"$",
"userId",
",",
"$",
"scope",
")",
"{",
"$",
"accessTokenList",
"=",
"$",
"this",
"->",
"tokenStorage",
"->",
"getAccessTokenList",
"(",
"$",
"userId",
")",
";",
"foreach",
... | Find an AccessToken in the list that matches this scope, bound to
providerId and userId.
@param Provider $provider
@param string $userId
@param string $scope
@return false|AccessToken | [
"Find",
"an",
"AccessToken",
"in",
"the",
"list",
"that",
"matches",
"this",
"scope",
"bound",
"to",
"providerId",
"and",
"userId",
"."
] | 2ed008b41a281880453807ca9f0ceb40db239b9e | https://github.com/fkooman/php-oauth2-client/blob/2ed008b41a281880453807ca9f0ceb40db239b9e/src/OAuthClient.php#L391-L406 |
190,842 | aedart/data-transfer-object-dto | src/Providers/Bootstrap.php | Bootstrap.getContainer | public static function getContainer() : ?ContainerInterface
{
if (is_null(self::$container)) {
self::setContainer(self::getDefaultContainer());
}
return self::$container;
} | php | public static function getContainer() : ?ContainerInterface
{
if (is_null(self::$container)) {
self::setContainer(self::getDefaultContainer());
}
return self::$container;
} | [
"public",
"static",
"function",
"getContainer",
"(",
")",
":",
"?",
"ContainerInterface",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"container",
")",
")",
"{",
"self",
"::",
"setContainer",
"(",
"self",
"::",
"getDefaultContainer",
"(",
")",
")",
... | Get the IoC service container
If no IoC was set, this method will set and
return a default container
@see getDefaultContainer
@return \Illuminate\Contracts\Container\Container|null | [
"Get",
"the",
"IoC",
"service",
"container"
] | d96eceeae9aa0ef1700402952e42abfd67334ffd | https://github.com/aedart/data-transfer-object-dto/blob/d96eceeae9aa0ef1700402952e42abfd67334ffd/src/Providers/Bootstrap.php#L71-L78 |
190,843 | winzou/tnt-express | src/Model/Events.php | Events.getLastEvent | public function getLastEvent()
{
if (null === $this->{self::$sequence[0]}) {
return self::$sequence[0];
}
foreach (self::$sequence as $i => $event) {
if (null === $this->$event) {
return self::$sequence[$i-1];
}
}
return s... | php | public function getLastEvent()
{
if (null === $this->{self::$sequence[0]}) {
return self::$sequence[0];
}
foreach (self::$sequence as $i => $event) {
if (null === $this->$event) {
return self::$sequence[$i-1];
}
}
return s... | [
"public",
"function",
"getLastEvent",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"{",
"self",
"::",
"$",
"sequence",
"[",
"0",
"]",
"}",
")",
"{",
"return",
"self",
"::",
"$",
"sequence",
"[",
"0",
"]",
";",
"}",
"foreach",
"(",
... | Return the last not null event
@return string | [
"Return",
"the",
"last",
"not",
"null",
"event"
] | e0a9e6df1847b086dee1ecf768c892bc78db379c | https://github.com/winzou/tnt-express/blob/e0a9e6df1847b086dee1ecf768c892bc78db379c/src/Model/Events.php#L91-L104 |
190,844 | brandonwamboldt/wp-orm | src/Admin/AdminHelper.php | AdminHelper.render_list_table_page | public static function render_list_table_page($page_title, $list_table)
{
// We pass the class to filters & actions
$list_table_class = get_class($list_table);
// Get stuff
$pagenum = $list_table->get_pagenum();
$action = $list_table->current_action();
if ($action)... | php | public static function render_list_table_page($page_title, $list_table)
{
// We pass the class to filters & actions
$list_table_class = get_class($list_table);
// Get stuff
$pagenum = $list_table->get_pagenum();
$action = $list_table->current_action();
if ($action)... | [
"public",
"static",
"function",
"render_list_table_page",
"(",
"$",
"page_title",
",",
"$",
"list_table",
")",
"{",
"// We pass the class to filters & actions",
"$",
"list_table_class",
"=",
"get_class",
"(",
"$",
"list_table",
")",
";",
"// Get stuff",
"$",
"pagenum"... | Setup the list table and render the list table page, or call the given
action.
@param string $page_title
@param WordPress\Orm\Admin\ListTable $list_table | [
"Setup",
"the",
"list",
"table",
"and",
"render",
"the",
"list",
"table",
"page",
"or",
"call",
"the",
"given",
"action",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/AdminHelper.php#L43-L120 |
190,845 | springimport/magento2-api-v1 | src/ApiFactory.php | ApiFactory.getApiClient | public function getApiClient()
{
$stack = HandlerStack::create();
$middleware = new Oauth1([
'consumer_key' => $this->configuration->getConsumerKey(),
'consumer_secret' => $this->configuration->getConsumerSecret(),
'token' => $this->configuration->getToken(),
... | php | public function getApiClient()
{
$stack = HandlerStack::create();
$middleware = new Oauth1([
'consumer_key' => $this->configuration->getConsumerKey(),
'consumer_secret' => $this->configuration->getConsumerSecret(),
'token' => $this->configuration->getToken(),
... | [
"public",
"function",
"getApiClient",
"(",
")",
"{",
"$",
"stack",
"=",
"HandlerStack",
"::",
"create",
"(",
")",
";",
"$",
"middleware",
"=",
"new",
"Oauth1",
"(",
"[",
"'consumer_key'",
"=>",
"$",
"this",
"->",
"configuration",
"->",
"getConsumerKey",
"(... | Get new api client.
@return Client | [
"Get",
"new",
"api",
"client",
"."
] | aae8a72d0f166acd6e533086ee2bc3be5fb6f5cd | https://github.com/springimport/magento2-api-v1/blob/aae8a72d0f166acd6e533086ee2bc3be5fb6f5cd/src/ApiFactory.php#L38-L61 |
190,846 | AVATOR/yii2-turbosms | Turbosms.php | Turbosms.send | public function send($text, $phones)
{
if (!is_array($phones)) {
$phones = [$phones];
}
foreach ($phones as $phone) {
if (!$phone) {
continue;
}
$message = $this->sendMessage($text, $phone);
$this->saveToDb($text, $... | php | public function send($text, $phones)
{
if (!is_array($phones)) {
$phones = [$phones];
}
foreach ($phones as $phone) {
if (!$phone) {
continue;
}
$message = $this->sendMessage($text, $phone);
$this->saveToDb($text, $... | [
"public",
"function",
"send",
"(",
"$",
"text",
",",
"$",
"phones",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"phones",
")",
")",
"{",
"$",
"phones",
"=",
"[",
"$",
"phones",
"]",
";",
"}",
"foreach",
"(",
"$",
"phones",
"as",
"$",
"phone... | Send sms and return array of message's ids in database
@param string $text
@param $phones
@return array
@throws InvalidConfigException | [
"Send",
"sms",
"and",
"return",
"array",
"of",
"message",
"s",
"ids",
"in",
"database"
] | 25fefa9cba750bc6f308188b688f872eeb8f272a | https://github.com/AVATOR/yii2-turbosms/blob/25fefa9cba750bc6f308188b688f872eeb8f272a/Turbosms.php#L108-L123 |
190,847 | AVATOR/yii2-turbosms | Turbosms.php | Turbosms.saveToDb | public function saveToDb($text, $phone, $message)
{
if (!$this->saveToDb) {
return false;
}
$model = new TurboSmsSent();
$model->text = $text;
$model->phone = $phone;
$model->message = $message . ($this->debug ? $this->debugSuffixMessage : '');
if ... | php | public function saveToDb($text, $phone, $message)
{
if (!$this->saveToDb) {
return false;
}
$model = new TurboSmsSent();
$model->text = $text;
$model->phone = $phone;
$model->message = $message . ($this->debug ? $this->debugSuffixMessage : '');
if ... | [
"public",
"function",
"saveToDb",
"(",
"$",
"text",
",",
"$",
"phone",
",",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"saveToDb",
")",
"{",
"return",
"false",
";",
"}",
"$",
"model",
"=",
"new",
"TurboSmsSent",
"(",
")",
";",
"... | Save sms to db
@param string $text
@param string $phone
@param string $message
@return bool | [
"Save",
"sms",
"to",
"db"
] | 25fefa9cba750bc6f308188b688f872eeb8f272a | https://github.com/AVATOR/yii2-turbosms/blob/25fefa9cba750bc6f308188b688f872eeb8f272a/Turbosms.php#L163-L183 |
190,848 | AVATOR/yii2-turbosms | Turbosms.php | Turbosms.getMessageStatus | public function getMessageStatus($messageId)
{
if ($this->debug || !$messageId) {
return '';
}
$result = $this->getClient()->GetMessageStatus(['MessageId' => $messageId]);
return $result->GetMessageStatusResult;
} | php | public function getMessageStatus($messageId)
{
if ($this->debug || !$messageId) {
return '';
}
$result = $this->getClient()->GetMessageStatus(['MessageId' => $messageId]);
return $result->GetMessageStatusResult;
} | [
"public",
"function",
"getMessageStatus",
"(",
"$",
"messageId",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
"||",
"!",
"$",
"messageId",
")",
"{",
"return",
"''",
";",
"}",
"$",
"result",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"... | Get message status
@param $messageId
@return string | [
"Get",
"message",
"status"
] | 25fefa9cba750bc6f308188b688f872eeb8f272a | https://github.com/AVATOR/yii2-turbosms/blob/25fefa9cba750bc6f308188b688f872eeb8f272a/Turbosms.php#L202-L210 |
190,849 | texthtml/php-lock | src/FileLock.php | FileLock.tryAcquire | private function tryAcquire($operation, $lock_type)
{
$log_data = [
"lock_file" => $this->lock_file,
"lock_type" => $lock_type
];
if (!$this->flock($operation)) {
$this->logger->debug("could not acquire {lock_type} lock on {lock_file}", $log_data);
... | php | private function tryAcquire($operation, $lock_type)
{
$log_data = [
"lock_file" => $this->lock_file,
"lock_type" => $lock_type
];
if (!$this->flock($operation)) {
$this->logger->debug("could not acquire {lock_type} lock on {lock_file}", $log_data);
... | [
"private",
"function",
"tryAcquire",
"(",
"$",
"operation",
",",
"$",
"lock_type",
")",
"{",
"$",
"log_data",
"=",
"[",
"\"lock_file\"",
"=>",
"$",
"this",
"->",
"lock_file",
",",
"\"lock_type\"",
"=>",
"$",
"lock_type",
"]",
";",
"if",
"(",
"!",
"$",
... | try to acquire lock on file, throw in case of faillure
@param int $operation
@param string $lock_type lock type description
@return void
@see https://php.net/flock | [
"try",
"to",
"acquire",
"lock",
"on",
"file",
"throw",
"in",
"case",
"of",
"faillure"
] | 705b4a8b3ef5c17963077c5f49fc9b26719f57c5 | https://github.com/texthtml/php-lock/blob/705b4a8b3ef5c17963077c5f49fc9b26719f57c5/src/FileLock.php#L74-L91 |
190,850 | brandonwamboldt/wp-orm | src/BaseModel.php | BaseModel.flatten_props | public function flatten_props($props)
{
foreach ($props as $property => $value) {
if (is_object($value) && get_class($value) == 'DateTime') {
$props[$property] = $value->format('Y-m-d H:i:s');
} elseif (is_array($value)) {
$props[$property] = serialize... | php | public function flatten_props($props)
{
foreach ($props as $property => $value) {
if (is_object($value) && get_class($value) == 'DateTime') {
$props[$property] = $value->format('Y-m-d H:i:s');
} elseif (is_array($value)) {
$props[$property] = serialize... | [
"public",
"function",
"flatten_props",
"(",
"$",
"props",
")",
"{",
"foreach",
"(",
"$",
"props",
"as",
"$",
"property",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
"&&",
"get_class",
"(",
"$",
"value",
")",
"==",
... | Convert complex objects to strings to insert into the database.
@param array $props
@return array | [
"Convert",
"complex",
"objects",
"to",
"strings",
"to",
"insert",
"into",
"the",
"database",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/BaseModel.php#L93-L106 |
190,851 | brandonwamboldt/wp-orm | src/BaseModel.php | BaseModel.save | public function save()
{
global $wpdb;
// Get the model's properties
$props = $this->properties();
// Flatten complex objects
$props = $this->flatten_props($props);
// Insert or update?
if (is_null($props[static::get_primary_key()])) {
$wpdb->in... | php | public function save()
{
global $wpdb;
// Get the model's properties
$props = $this->properties();
// Flatten complex objects
$props = $this->flatten_props($props);
// Insert or update?
if (is_null($props[static::get_primary_key()])) {
$wpdb->in... | [
"public",
"function",
"save",
"(",
")",
"{",
"global",
"$",
"wpdb",
";",
"// Get the model's properties",
"$",
"props",
"=",
"$",
"this",
"->",
"properties",
"(",
")",
";",
"// Flatten complex objects",
"$",
"props",
"=",
"$",
"this",
"->",
"flatten_props",
... | Save this model to the database. Will create a new record if the ID
property isn't set, or update an existing record if the ID property is
set.
@return integer | [
"Save",
"this",
"model",
"to",
"the",
"database",
".",
"Will",
"create",
"a",
"new",
"record",
"if",
"the",
"ID",
"property",
"isn",
"t",
"set",
"or",
"update",
"an",
"existing",
"record",
"if",
"the",
"ID",
"property",
"is",
"set",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/BaseModel.php#L126-L146 |
190,852 | brandonwamboldt/wp-orm | src/BaseModel.php | BaseModel.find_one_by | public static function find_one_by($property, $value)
{
global $wpdb;
// Escape the value
$value = esc_sql($value);
// Get the table name
$table = static::get_table();
// Get the item
$obj = $wpdb->get_row("SELECT * FROM `{$table}` WHERE `{$property}` = '{$... | php | public static function find_one_by($property, $value)
{
global $wpdb;
// Escape the value
$value = esc_sql($value);
// Get the table name
$table = static::get_table();
// Get the item
$obj = $wpdb->get_row("SELECT * FROM `{$table}` WHERE `{$property}` = '{$... | [
"public",
"static",
"function",
"find_one_by",
"(",
"$",
"property",
",",
"$",
"value",
")",
"{",
"global",
"$",
"wpdb",
";",
"// Escape the value",
"$",
"value",
"=",
"esc_sql",
"(",
"$",
"value",
")",
";",
"// Get the table name",
"$",
"table",
"=",
"sta... | Find a specific model by a given property value.
@param string $property
@param string $value
@return false|self | [
"Find",
"a",
"specific",
"model",
"by",
"a",
"given",
"property",
"value",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/BaseModel.php#L178-L193 |
190,853 | brandonwamboldt/wp-orm | src/BaseModel.php | BaseModel.query | public static function query()
{
$query = new Query(get_called_class());
$query->set_searchable_fields(static::get_searchable_fields());
$query->set_primary_key(static::get_primary_key());
return $query;
} | php | public static function query()
{
$query = new Query(get_called_class());
$query->set_searchable_fields(static::get_searchable_fields());
$query->set_primary_key(static::get_primary_key());
return $query;
} | [
"public",
"static",
"function",
"query",
"(",
")",
"{",
"$",
"query",
"=",
"new",
"Query",
"(",
"get_called_class",
"(",
")",
")",
";",
"$",
"query",
"->",
"set_searchable_fields",
"(",
"static",
"::",
"get_searchable_fields",
"(",
")",
")",
";",
"$",
"q... | Start a query to find models matching specific criteria.
@return Query | [
"Start",
"a",
"query",
"to",
"find",
"models",
"matching",
"specific",
"criteria",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/BaseModel.php#L211-L218 |
190,854 | brandonwamboldt/wp-orm | src/BaseModel.php | BaseModel.all | public static function all()
{
global $wpdb;
// Get the table name
$table = static::get_table();
// Get the items
$results = $wpdb->get_results("SELECT * FROM `{$table}`");
foreach ($results as $index => $result) {
$results[$index] = static::create((arr... | php | public static function all()
{
global $wpdb;
// Get the table name
$table = static::get_table();
// Get the items
$results = $wpdb->get_results("SELECT * FROM `{$table}`");
foreach ($results as $index => $result) {
$results[$index] = static::create((arr... | [
"public",
"static",
"function",
"all",
"(",
")",
"{",
"global",
"$",
"wpdb",
";",
"// Get the table name",
"$",
"table",
"=",
"static",
"::",
"get_table",
"(",
")",
";",
"// Get the items",
"$",
"results",
"=",
"$",
"wpdb",
"->",
"get_results",
"(",
"\"SEL... | Return EVERY instance of this model from the database, with NO filtering.
@return array | [
"Return",
"EVERY",
"instance",
"of",
"this",
"model",
"from",
"the",
"database",
"with",
"NO",
"filtering",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/BaseModel.php#L225-L240 |
190,855 | LaurentBrieu/TCPDF | src/TCPDF/src/examples/example_010.php | MC_TCPDF.ChapterTitle | public function ChapterTitle($num, $title) {
$this->SetFont('helvetica', '', 14);
$this->SetFillColor(200, 220, 255);
$this->Cell(180, 6, 'Chapter '.$num.' : '.$title, 0, 1, '', 1);
$this->Ln(4);
} | php | public function ChapterTitle($num, $title) {
$this->SetFont('helvetica', '', 14);
$this->SetFillColor(200, 220, 255);
$this->Cell(180, 6, 'Chapter '.$num.' : '.$title, 0, 1, '', 1);
$this->Ln(4);
} | [
"public",
"function",
"ChapterTitle",
"(",
"$",
"num",
",",
"$",
"title",
")",
"{",
"$",
"this",
"->",
"SetFont",
"(",
"'helvetica'",
",",
"''",
",",
"14",
")",
";",
"$",
"this",
"->",
"SetFillColor",
"(",
"200",
",",
"220",
",",
"255",
")",
";",
... | Set chapter title
@param $num (int) chapter number
@param $title (string) chapter title
@public | [
"Set",
"chapter",
"title"
] | 1352a46982eaf61cdeeae25c8440467a5127c2d2 | https://github.com/LaurentBrieu/TCPDF/blob/1352a46982eaf61cdeeae25c8440467a5127c2d2/src/TCPDF/src/examples/example_010.php#L63-L68 |
190,856 | LaurentBrieu/TCPDF | src/TCPDF/src/examples/example_010.php | MC_TCPDF.ChapterBody | public function ChapterBody($file, $mode=false) {
$this->selectColumn();
// get esternal file content
$content = file_get_contents($file, false);
// set font
$this->SetFont('times', '', 9);
$this->SetTextColor(50, 50, 50);
// print content
if ($mode) {
// ------ HTML MODE ------
$this->writeHTML($... | php | public function ChapterBody($file, $mode=false) {
$this->selectColumn();
// get esternal file content
$content = file_get_contents($file, false);
// set font
$this->SetFont('times', '', 9);
$this->SetTextColor(50, 50, 50);
// print content
if ($mode) {
// ------ HTML MODE ------
$this->writeHTML($... | [
"public",
"function",
"ChapterBody",
"(",
"$",
"file",
",",
"$",
"mode",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"selectColumn",
"(",
")",
";",
"// get esternal file content",
"$",
"content",
"=",
"file_get_contents",
"(",
"$",
"file",
",",
"false",
")"... | Print chapter body
@param $file (string) name of the file containing the chapter body
@param $mode (boolean) if true the chapter body is in HTML, otherwise in simple text.
@public | [
"Print",
"chapter",
"body"
] | 1352a46982eaf61cdeeae25c8440467a5127c2d2 | https://github.com/LaurentBrieu/TCPDF/blob/1352a46982eaf61cdeeae25c8440467a5127c2d2/src/TCPDF/src/examples/example_010.php#L76-L92 |
190,857 | brandonwamboldt/wp-orm | src/Model/User.php | User.update_metadata | public function update_metadata($meta_key, $meta_value)
{
$this->meta[$meta_key] = $meta_value;
update_user_meta($this->ID, $meta_key, $meta_value);
} | php | public function update_metadata($meta_key, $meta_value)
{
$this->meta[$meta_key] = $meta_value;
update_user_meta($this->ID, $meta_key, $meta_value);
} | [
"public",
"function",
"update_metadata",
"(",
"$",
"meta_key",
",",
"$",
"meta_value",
")",
"{",
"$",
"this",
"->",
"meta",
"[",
"$",
"meta_key",
"]",
"=",
"$",
"meta_value",
";",
"update_user_meta",
"(",
"$",
"this",
"->",
"ID",
",",
"$",
"meta_key",
... | Update the user's meta data.
@param string $meta_key
@param mixed $meta_value | [
"Update",
"the",
"user",
"s",
"meta",
"data",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Model/User.php#L112-L117 |
190,858 | LaurentBrieu/TCPDF | src/TCPDF/src/include/tcpdf_filters.php | TCPDF_FILTERS.decodeFilterASCIIHexDecode | public static function decodeFilterASCIIHexDecode($data) {
// intialize string to return
$decoded = '';
// all white-space characters shall be ignored
$data = preg_replace('/[\s]/', '', $data);
// check for EOD character: GREATER-THAN SIGN (3Eh)
$eod = strpos($data, '>');
if ($eod !== false) {
// remov... | php | public static function decodeFilterASCIIHexDecode($data) {
// intialize string to return
$decoded = '';
// all white-space characters shall be ignored
$data = preg_replace('/[\s]/', '', $data);
// check for EOD character: GREATER-THAN SIGN (3Eh)
$eod = strpos($data, '>');
if ($eod !== false) {
// remov... | [
"public",
"static",
"function",
"decodeFilterASCIIHexDecode",
"(",
"$",
"data",
")",
"{",
"// intialize string to return",
"$",
"decoded",
"=",
"''",
";",
"// all white-space characters shall be ignored",
"$",
"data",
"=",
"preg_replace",
"(",
"'/[\\s]/'",
",",
"''",
... | ASCIIHexDecode
Decodes data encoded in an ASCII hexadecimal representation, reproducing the original binary data.
@param $data (string) Data to decode.
@return Decoded data string.
@since 1.0.000 (2011-05-23)
@public static | [
"ASCIIHexDecode",
"Decodes",
"data",
"encoded",
"in",
"an",
"ASCII",
"hexadecimal",
"representation",
"reproducing",
"the",
"original",
"binary",
"data",
"."
] | 1352a46982eaf61cdeeae25c8440467a5127c2d2 | https://github.com/LaurentBrieu/TCPDF/blob/1352a46982eaf61cdeeae25c8440467a5127c2d2/src/TCPDF/src/include/tcpdf_filters.php#L150-L180 |
190,859 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.set_pagination_args | protected function set_pagination_args(array $args)
{
$args = wp_parse_args($args, array(
'total_items' => 0,
'total_pages' => 0,
'per_page' => 0
));
if (!$args['total_pages'] && $args['per_page'] > 0) {
$args['total_pages'] = ceil($args['t... | php | protected function set_pagination_args(array $args)
{
$args = wp_parse_args($args, array(
'total_items' => 0,
'total_pages' => 0,
'per_page' => 0
));
if (!$args['total_pages'] && $args['per_page'] > 0) {
$args['total_pages'] = ceil($args['t... | [
"protected",
"function",
"set_pagination_args",
"(",
"array",
"$",
"args",
")",
"{",
"$",
"args",
"=",
"wp_parse_args",
"(",
"$",
"args",
",",
"array",
"(",
"'total_items'",
"=>",
"0",
",",
"'total_pages'",
"=>",
"0",
",",
"'per_page'",
"=>",
"0",
")",
"... | An internal method that sets all the necessary pagination arguments.
@param array $args | [
"An",
"internal",
"method",
"that",
"sets",
"all",
"the",
"necessary",
"pagination",
"arguments",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L97-L116 |
190,860 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.get_pagination_arg | public function get_pagination_arg($key)
{
if ('page' == $key) {
return $this->get_pagenum();
}
if (isset($this->pagination_args[$key])) {
return $this->pagination_args[$key];
}
} | php | public function get_pagination_arg($key)
{
if ('page' == $key) {
return $this->get_pagenum();
}
if (isset($this->pagination_args[$key])) {
return $this->pagination_args[$key];
}
} | [
"public",
"function",
"get_pagination_arg",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"'page'",
"==",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"get_pagenum",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"pagination_args",
"["... | Access the pagination args.
@param string $key
@return array | [
"Access",
"the",
"pagination",
"args",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L124-L133 |
190,861 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.get_search_query | public function get_search_query($escaped = true)
{
$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
$query = apply_filters('get_search_query', $s);
if ($escaped) {
$query = esc_attr($query);
}
return $query;
} | php | public function get_search_query($escaped = true)
{
$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
$query = apply_filters('get_search_query', $s);
if ($escaped) {
$query = esc_attr($query);
}
return $query;
} | [
"public",
"function",
"get_search_query",
"(",
"$",
"escaped",
"=",
"true",
")",
"{",
"$",
"s",
"=",
"isset",
"(",
"$",
"_REQUEST",
"[",
"'s'",
"]",
")",
"?",
"$",
"_REQUEST",
"[",
"'s'",
"]",
":",
"''",
";",
"$",
"query",
"=",
"apply_filters",
"("... | Cause the real one doesn't work. | [
"Cause",
"the",
"real",
"one",
"doesn",
"t",
"work",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L156-L166 |
190,862 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.search_box | public function search_box($text, $input_id)
{
if (empty($_REQUEST['s']) && !$this->has_items()) {
return;
}
$input_id = $input_id . '-search-input';
if (!empty($_REQUEST['orderby'])) {
echo '<input type="hidden" name="orderby" value="' . esc_attr($_REQUEST[... | php | public function search_box($text, $input_id)
{
if (empty($_REQUEST['s']) && !$this->has_items()) {
return;
}
$input_id = $input_id . '-search-input';
if (!empty($_REQUEST['orderby'])) {
echo '<input type="hidden" name="orderby" value="' . esc_attr($_REQUEST[... | [
"public",
"function",
"search_box",
"(",
"$",
"text",
",",
"$",
"input_id",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"_REQUEST",
"[",
"'s'",
"]",
")",
"&&",
"!",
"$",
"this",
"->",
"has_items",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"input_i... | Display the search box.
@param string $text
@param string $input_id | [
"Display",
"the",
"search",
"box",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L174-L204 |
190,863 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.views | public function views()
{
$views = $this->get_views();
$views = apply_filters('views_' . $this->screen->id, $views);
if (empty($views)) {
return;
}
echo "<ul class='subsubsub'>\n";
foreach ( $views as $class => $view ) {
$views[ $class ] = "... | php | public function views()
{
$views = $this->get_views();
$views = apply_filters('views_' . $this->screen->id, $views);
if (empty($views)) {
return;
}
echo "<ul class='subsubsub'>\n";
foreach ( $views as $class => $view ) {
$views[ $class ] = "... | [
"public",
"function",
"views",
"(",
")",
"{",
"$",
"views",
"=",
"$",
"this",
"->",
"get_views",
"(",
")",
";",
"$",
"views",
"=",
"apply_filters",
"(",
"'views_'",
".",
"$",
"this",
"->",
"screen",
"->",
"id",
",",
"$",
"views",
")",
";",
"if",
... | Display the list of views available on this table. | [
"Display",
"the",
"list",
"of",
"views",
"available",
"on",
"this",
"table",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L220-L237 |
190,864 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.bulk_actions | public function bulk_actions()
{
if (is_null($this->actions)) {
$this->actions = $this->get_bulk_actions();
$this->actions = apply_filters('bulk_actions-' . $this->screen->id, $this->actions);
$two = '';
} else {
$two = '2';
}
if (empt... | php | public function bulk_actions()
{
if (is_null($this->actions)) {
$this->actions = $this->get_bulk_actions();
$this->actions = apply_filters('bulk_actions-' . $this->screen->id, $this->actions);
$two = '';
} else {
$two = '2';
}
if (empt... | [
"public",
"function",
"bulk_actions",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"actions",
")",
")",
"{",
"$",
"this",
"->",
"actions",
"=",
"$",
"this",
"->",
"get_bulk_actions",
"(",
")",
";",
"$",
"this",
"->",
"actions",
"=",
... | Display the bulk actions dropdown. | [
"Display",
"the",
"bulk",
"actions",
"dropdown",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L253-L280 |
190,865 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.current_action | public function current_action()
{
if (isset($_REQUEST['action']) && -1 != $_REQUEST['action']) {
return $_REQUEST['action'];
}
if (isset($_REQUEST['action2']) && -1 != $_REQUEST['action2']) {
return $_REQUEST['action2'];
}
return false;
} | php | public function current_action()
{
if (isset($_REQUEST['action']) && -1 != $_REQUEST['action']) {
return $_REQUEST['action'];
}
if (isset($_REQUEST['action2']) && -1 != $_REQUEST['action2']) {
return $_REQUEST['action2'];
}
return false;
} | [
"public",
"function",
"current_action",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_REQUEST",
"[",
"'action'",
"]",
")",
"&&",
"-",
"1",
"!=",
"$",
"_REQUEST",
"[",
"'action'",
"]",
")",
"{",
"return",
"$",
"_REQUEST",
"[",
"'action'",
"]",
";",
... | Get the current action selected from the bulk actions dropdown.
@return string|bool | [
"Get",
"the",
"current",
"action",
"selected",
"from",
"the",
"bulk",
"actions",
"dropdown",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L287-L298 |
190,866 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.row_actions | protected function row_actions($actions, $always_visible = false)
{
$action_count = count($actions);
$i = 0;
if (!$action_count) {
return '';
}
$out = '<div class="' . ($always_visible ? 'row-actions-visible' : 'row-actions') . '">';
foreach ($actions a... | php | protected function row_actions($actions, $always_visible = false)
{
$action_count = count($actions);
$i = 0;
if (!$action_count) {
return '';
}
$out = '<div class="' . ($always_visible ? 'row-actions-visible' : 'row-actions') . '">';
foreach ($actions a... | [
"protected",
"function",
"row_actions",
"(",
"$",
"actions",
",",
"$",
"always_visible",
"=",
"false",
")",
"{",
"$",
"action_count",
"=",
"count",
"(",
"$",
"actions",
")",
";",
"$",
"i",
"=",
"0",
";",
"if",
"(",
"!",
"$",
"action_count",
")",
"{",... | Generate row actions div
@param array $actions
@param bool $always_visible
@return string | [
"Generate",
"row",
"actions",
"div"
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L307-L327 |
190,867 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.view_switcher | protected function view_switcher($current_mode)
{
$modes = array(
'list' => __('List View'),
'excerpt' => __('Excerpt View')
);
?>
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
<div class="view-switch">
<?php
... | php | protected function view_switcher($current_mode)
{
$modes = array(
'list' => __('List View'),
'excerpt' => __('Excerpt View')
);
?>
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
<div class="view-switch">
<?php
... | [
"protected",
"function",
"view_switcher",
"(",
"$",
"current_mode",
")",
"{",
"$",
"modes",
"=",
"array",
"(",
"'list'",
"=>",
"__",
"(",
"'List View'",
")",
",",
"'excerpt'",
"=>",
"__",
"(",
"'Excerpt View'",
")",
")",
";",
"?>\n <input type=\"hidden\... | Display a view switcher | [
"Display",
"a",
"view",
"switcher"
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L376-L394 |
190,868 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.comments_bubble | protected function comments_bubble($post_id, $pending_comments)
{
$pending_phrase = sprintf(__('%s pending'), number_format($pending_comments));
if ($pending_comments) {
echo '<strong>';
}
echo "<a href='" . esc_url(add_query_arg('p', $post_id, admin_url('edit-comments.... | php | protected function comments_bubble($post_id, $pending_comments)
{
$pending_phrase = sprintf(__('%s pending'), number_format($pending_comments));
if ($pending_comments) {
echo '<strong>';
}
echo "<a href='" . esc_url(add_query_arg('p', $post_id, admin_url('edit-comments.... | [
"protected",
"function",
"comments_bubble",
"(",
"$",
"post_id",
",",
"$",
"pending_comments",
")",
"{",
"$",
"pending_phrase",
"=",
"sprintf",
"(",
"__",
"(",
"'%s pending'",
")",
",",
"number_format",
"(",
"$",
"pending_comments",
")",
")",
";",
"if",
"(",... | Display a comment count bubble
@param integer $post_id
@param integer $pending_comments | [
"Display",
"a",
"comment",
"count",
"bubble"
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L402-L415 |
190,869 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.get_pagenum | public function get_pagenum()
{
$pagenum = isset($_REQUEST['paged']) ? absint($_REQUEST['paged']) : 0;
if (isset($this->pagination_args['total_pages']) && $pagenum > $this->pagination_args['total_pages']) {
$pagenum = $this->pagination_args['total_pages'];
}
return max(... | php | public function get_pagenum()
{
$pagenum = isset($_REQUEST['paged']) ? absint($_REQUEST['paged']) : 0;
if (isset($this->pagination_args['total_pages']) && $pagenum > $this->pagination_args['total_pages']) {
$pagenum = $this->pagination_args['total_pages'];
}
return max(... | [
"public",
"function",
"get_pagenum",
"(",
")",
"{",
"$",
"pagenum",
"=",
"isset",
"(",
"$",
"_REQUEST",
"[",
"'paged'",
"]",
")",
"?",
"absint",
"(",
"$",
"_REQUEST",
"[",
"'paged'",
"]",
")",
":",
"0",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
... | Get the current page number
@return integer | [
"Get",
"the",
"current",
"page",
"number"
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L422-L431 |
190,870 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.get_items_per_page | protected function get_items_per_page($option, $default = 20)
{
$per_page = (int) get_user_option($option);
if (empty($per_page) || $per_page < 1) {
$per_page = $default;
}
return (int) apply_filters($option, $per_page);
} | php | protected function get_items_per_page($option, $default = 20)
{
$per_page = (int) get_user_option($option);
if (empty($per_page) || $per_page < 1) {
$per_page = $default;
}
return (int) apply_filters($option, $per_page);
} | [
"protected",
"function",
"get_items_per_page",
"(",
"$",
"option",
",",
"$",
"default",
"=",
"20",
")",
"{",
"$",
"per_page",
"=",
"(",
"int",
")",
"get_user_option",
"(",
"$",
"option",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"per_page",
")",
"||",
... | Get number of items to display on a single page
@return integer | [
"Get",
"number",
"of",
"items",
"to",
"display",
"on",
"a",
"single",
"page"
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L438-L447 |
190,871 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.pagination | protected function pagination($which)
{
if (empty($this->pagination_args)) {
return;
}
extract($this->pagination_args, EXTR_SKIP);
$output = '<span class="displaying-num">' . sprintf(_n('1 item', '%s items', $total_items), number_format_i18n($total_items)) . '</spa... | php | protected function pagination($which)
{
if (empty($this->pagination_args)) {
return;
}
extract($this->pagination_args, EXTR_SKIP);
$output = '<span class="displaying-num">' . sprintf(_n('1 item', '%s items', $total_items), number_format_i18n($total_items)) . '</spa... | [
"protected",
"function",
"pagination",
"(",
"$",
"which",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"pagination_args",
")",
")",
"{",
"return",
";",
"}",
"extract",
"(",
"$",
"this",
"->",
"pagination_args",
",",
"EXTR_SKIP",
")",
";",
"$",... | Display the pagination. | [
"Display",
"the",
"pagination",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L452-L531 |
190,872 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.get_column_info | protected function get_column_info()
{
if (isset($this->column_headers)) {
return $this->column_headers;
}
$columns = get_column_headers($this->screen);
$hidden = get_hidden_columns($this->screen);
$_sortable = apply_filters("manage_{$this->screen->id}_sorta... | php | protected function get_column_info()
{
if (isset($this->column_headers)) {
return $this->column_headers;
}
$columns = get_column_headers($this->screen);
$hidden = get_hidden_columns($this->screen);
$_sortable = apply_filters("manage_{$this->screen->id}_sorta... | [
"protected",
"function",
"get_column_info",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"column_headers",
")",
")",
"{",
"return",
"$",
"this",
"->",
"column_headers",
";",
"}",
"$",
"columns",
"=",
"get_column_headers",
"(",
"$",
"this",
... | Get a list of all, hidden and sortable columns, with filter applied
@return array | [
"Get",
"a",
"list",
"of",
"all",
"hidden",
"and",
"sortable",
"columns",
"with",
"filter",
"applied"
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L560-L588 |
190,873 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.get_column_count | public function get_column_count()
{
list($columns, $hidden) = $this->get_column_info();
$hidden = array_intersect(array_keys($columns), array_filter($hidden));
return count($columns) - count($hidden);
} | php | public function get_column_count()
{
list($columns, $hidden) = $this->get_column_info();
$hidden = array_intersect(array_keys($columns), array_filter($hidden));
return count($columns) - count($hidden);
} | [
"public",
"function",
"get_column_count",
"(",
")",
"{",
"list",
"(",
"$",
"columns",
",",
"$",
"hidden",
")",
"=",
"$",
"this",
"->",
"get_column_info",
"(",
")",
";",
"$",
"hidden",
"=",
"array_intersect",
"(",
"array_keys",
"(",
"$",
"columns",
")",
... | Return number of visible columns.
@return int | [
"Return",
"number",
"of",
"visible",
"columns",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L595-L601 |
190,874 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.print_column_headers | protected function print_column_headers($with_id = true)
{
list($columns, $hidden, $sortable) = $this->get_column_info();
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$current_url = remove_query_arg('paged', $current_url);
if (isset($_... | php | protected function print_column_headers($with_id = true)
{
list($columns, $hidden, $sortable) = $this->get_column_info();
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$current_url = remove_query_arg('paged', $current_url);
if (isset($_... | [
"protected",
"function",
"print_column_headers",
"(",
"$",
"with_id",
"=",
"true",
")",
"{",
"list",
"(",
"$",
"columns",
",",
"$",
"hidden",
",",
"$",
"sortable",
")",
"=",
"$",
"this",
"->",
"get_column_info",
"(",
")",
";",
"$",
"current_url",
"=",
... | Print column headers, accounting for hidden and sortable columns.
@param bool $with_id | [
"Print",
"column",
"headers",
"accounting",
"for",
"hidden",
"and",
"sortable",
"columns",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L608-L675 |
190,875 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.display_tablenav | protected function display_tablenav($which)
{
if ('top' == $which) {
wp_nonce_field('bulk-' . $this->args['plural']);
}
?>
<div class="tablenav <?php echo esc_attr($which) ?>">
<div class="alignleft actions">
<?php $this->bulk_actions() ?>
</div>
<?php
... | php | protected function display_tablenav($which)
{
if ('top' == $which) {
wp_nonce_field('bulk-' . $this->args['plural']);
}
?>
<div class="tablenav <?php echo esc_attr($which) ?>">
<div class="alignleft actions">
<?php $this->bulk_actions() ?>
</div>
<?php
... | [
"protected",
"function",
"display_tablenav",
"(",
"$",
"which",
")",
"{",
"if",
"(",
"'top'",
"==",
"$",
"which",
")",
"{",
"wp_nonce_field",
"(",
"'bulk-'",
".",
"$",
"this",
"->",
"args",
"[",
"'plural'",
"]",
")",
";",
"}",
"?>\n <div class=\"tablena... | Generate the table navigation above or below the table. | [
"Generate",
"the",
"table",
"navigation",
"above",
"or",
"below",
"the",
"table",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L721-L740 |
190,876 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.single_row_columns | protected function single_row_columns($item)
{
list($columns, $hidden) = $this->get_column_info();
foreach ($columns as $column_name => $column_display_name) {
$class = "class='$column_name column-$column_name'";
$style = '';
if (in_array($column_name, $hidden))... | php | protected function single_row_columns($item)
{
list($columns, $hidden) = $this->get_column_info();
foreach ($columns as $column_name => $column_display_name) {
$class = "class='$column_name column-$column_name'";
$style = '';
if (in_array($column_name, $hidden))... | [
"protected",
"function",
"single_row_columns",
"(",
"$",
"item",
")",
"{",
"list",
"(",
"$",
"columns",
",",
"$",
"hidden",
")",
"=",
"$",
"this",
"->",
"get_column_info",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column_name",
"=>",
"... | Generates the columns for a single row of the table.
@param object $item The current item | [
"Generates",
"the",
"columns",
"for",
"a",
"single",
"row",
"of",
"the",
"table",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L795-L823 |
190,877 | brandonwamboldt/wp-orm | src/Admin/ListTable.php | ListTable.js_vars | protected function js_vars()
{
$args = array(
'class' => get_class($this),
'screen' => array(
'id' => $this->screen->id,
'base' => $this->screen->base,
)
);
printf("<script type='text/javascript'>list_args = %s;</script>... | php | protected function js_vars()
{
$args = array(
'class' => get_class($this),
'screen' => array(
'id' => $this->screen->id,
'base' => $this->screen->base,
)
);
printf("<script type='text/javascript'>list_args = %s;</script>... | [
"protected",
"function",
"js_vars",
"(",
")",
"{",
"$",
"args",
"=",
"array",
"(",
"'class'",
"=>",
"get_class",
"(",
"$",
"this",
")",
",",
"'screen'",
"=>",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"screen",
"->",
"id",
",",
"'base'",
"=>",
... | Send required variables to JavaScript land. | [
"Send",
"required",
"variables",
"to",
"JavaScript",
"land",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Admin/ListTable.php#L860-L871 |
190,878 | brandonwamboldt/wp-orm | src/Query.php | Query.find | public function find($only_count = false)
{
global $wpdb;
$model = $this->model;
// Query
if ($only_count) {
return (int) $wpdb->get_var($this->compose_query(true));
}
$results = $wpdb->get_results($this->compose_query(false));
if ($results) {
... | php | public function find($only_count = false)
{
global $wpdb;
$model = $this->model;
// Query
if ($only_count) {
return (int) $wpdb->get_var($this->compose_query(true));
}
$results = $wpdb->get_results($this->compose_query(false));
if ($results) {
... | [
"public",
"function",
"find",
"(",
"$",
"only_count",
"=",
"false",
")",
"{",
"global",
"$",
"wpdb",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
";",
"// Query",
"if",
"(",
"$",
"only_count",
")",
"{",
"return",
"(",
"int",
")",
"$",
"wpdb"... | Compose & execute our query.
@param boolean $only_count Whether to only return the row count
@return array | [
"Compose",
"&",
"execute",
"our",
"query",
"."
] | 17b80105be3ced57a9392b2467f1000ad6c37f7f | https://github.com/brandonwamboldt/wp-orm/blob/17b80105be3ced57a9392b2467f1000ad6c37f7f/src/Query.php#L357-L377 |
190,879 | mmghv/lumen-route-binding | src/RouteBindingServiceProvider.php | RouteBindingServiceProvider.register | public function register()
{
// Register our binding resolver in the service container
$this->binder = new BindingResolver([$this->app, 'make']);
$this->app->instance('bindingResolver', $this->binder);
// Create a new FastRoute dispatcher (our extended one)
// with no routes... | php | public function register()
{
// Register our binding resolver in the service container
$this->binder = new BindingResolver([$this->app, 'make']);
$this->app->instance('bindingResolver', $this->binder);
// Create a new FastRoute dispatcher (our extended one)
// with no routes... | [
"public",
"function",
"register",
"(",
")",
"{",
"// Register our binding resolver in the service container",
"$",
"this",
"->",
"binder",
"=",
"new",
"BindingResolver",
"(",
"[",
"$",
"this",
"->",
"app",
",",
"'make'",
"]",
")",
";",
"$",
"this",
"->",
"app"... | Register the service by registering our custom dispatcher. | [
"Register",
"the",
"service",
"by",
"registering",
"our",
"custom",
"dispatcher",
"."
] | c375be373dd0d5cda8d6b967b18ca8604519ae26 | https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/RouteBindingServiceProvider.php#L28-L49 |
190,880 | mmghv/lumen-route-binding | src/RouteBindingServiceProvider.php | RouteBindingServiceProvider.getRoutesResolver | protected function getRoutesResolver()
{
return function () {
// Create fast-route collector
$routeCollector = new RouteCollector(new RouteParser, new DataGenerator);
// Get routes data from application
foreach ($this->getRoutes() as $route) {
... | php | protected function getRoutesResolver()
{
return function () {
// Create fast-route collector
$routeCollector = new RouteCollector(new RouteParser, new DataGenerator);
// Get routes data from application
foreach ($this->getRoutes() as $route) {
... | [
"protected",
"function",
"getRoutesResolver",
"(",
")",
"{",
"return",
"function",
"(",
")",
"{",
"// Create fast-route collector",
"$",
"routeCollector",
"=",
"new",
"RouteCollector",
"(",
"new",
"RouteParser",
",",
"new",
"DataGenerator",
")",
";",
"// Get routes ... | Get route resolver used to get routes data when the request is dispatched.
@return \Closure | [
"Get",
"route",
"resolver",
"used",
"to",
"get",
"routes",
"data",
"when",
"the",
"request",
"is",
"dispatched",
"."
] | c375be373dd0d5cda8d6b967b18ca8604519ae26 | https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/RouteBindingServiceProvider.php#L56-L69 |
190,881 | mmghv/lumen-route-binding | src/RouteBindingServiceProvider.php | RouteBindingServiceProvider.getRoutes | protected function getRoutes()
{
// Support lumen < 5.5 by checking for the router property.
$router = property_exists($this->app, 'router') ? $this->app->router : $this->app;
return $router->getRoutes();
} | php | protected function getRoutes()
{
// Support lumen < 5.5 by checking for the router property.
$router = property_exists($this->app, 'router') ? $this->app->router : $this->app;
return $router->getRoutes();
} | [
"protected",
"function",
"getRoutes",
"(",
")",
"{",
"// Support lumen < 5.5 by checking for the router property.",
"$",
"router",
"=",
"property_exists",
"(",
"$",
"this",
"->",
"app",
",",
"'router'",
")",
"?",
"$",
"this",
"->",
"app",
"->",
"router",
":",
"$... | Get routes data.
@return array | [
"Get",
"routes",
"data",
"."
] | c375be373dd0d5cda8d6b967b18ca8604519ae26 | https://github.com/mmghv/lumen-route-binding/blob/c375be373dd0d5cda8d6b967b18ca8604519ae26/src/RouteBindingServiceProvider.php#L76-L82 |
190,882 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.validate | public function validate($entity, $entityName = null)
{
$entityName = $entityName ?: 'root';
// Validate root type
$this->validateType($entity, $this->schema, $entityName);
return $this;
} | php | public function validate($entity, $entityName = null)
{
$entityName = $entityName ?: 'root';
// Validate root type
$this->validateType($entity, $this->schema, $entityName);
return $this;
} | [
"public",
"function",
"validate",
"(",
"$",
"entity",
",",
"$",
"entityName",
"=",
"null",
")",
"{",
"$",
"entityName",
"=",
"$",
"entityName",
"?",
":",
"'root'",
";",
"// Validate root type",
"$",
"this",
"->",
"validateType",
"(",
"$",
"entity",
",",
... | Validate schema object
@param mixed $entity
@param string $entityName
@return Validator | [
"Validate",
"schema",
"object"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L53-L61 |
190,883 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkFormat | public function checkFormat($entity, $schema, $entityName)
{
if (!isset($schema->format)) {
return $this;
}
$valid = true;
switch ($schema->format) {
case 'date-time':
if (!preg_match('#^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$#', $entity)) {
... | php | public function checkFormat($entity, $schema, $entityName)
{
if (!isset($schema->format)) {
return $this;
}
$valid = true;
switch ($schema->format) {
case 'date-time':
if (!preg_match('#^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$#', $entity)) {
... | [
"public",
"function",
"checkFormat",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"schema",
"->",
"format",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"valid",
"=",
"true",
... | Check format restriction
@param mixed $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"format",
"restriction"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L72-L131 |
190,884 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.validateProperties | protected function validateProperties($entity, $schema, $entityName)
{
$properties = get_object_vars($entity);
if (!isset($schema->properties)) {
return $this;
//throw new SchemaException(sprintf('No properties defined for [%s]', $entityName));
}
// Check defin... | php | protected function validateProperties($entity, $schema, $entityName)
{
$properties = get_object_vars($entity);
if (!isset($schema->properties)) {
return $this;
//throw new SchemaException(sprintf('No properties defined for [%s]', $entityName));
}
// Check defin... | [
"protected",
"function",
"validateProperties",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"$",
"properties",
"=",
"get_object_vars",
"(",
"$",
"entity",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"schema",
"->",
"properti... | Validate object properties
@param object $entity
@param object $schema
@param string $entityName
@return Validator | [
"Validate",
"object",
"properties"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L142-L174 |
190,885 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.validateType | protected function validateType($entity, $schema, $entityName)
{
if (isset($schema->type)) {
$types = $schema->type;
} else {
$types = 'any';
//throw new ValidationException(sprintf('No type given for [%s]', $entityName));
}
if (!is_array($types)) {
$ty... | php | protected function validateType($entity, $schema, $entityName)
{
if (isset($schema->type)) {
$types = $schema->type;
} else {
$types = 'any';
//throw new ValidationException(sprintf('No type given for [%s]', $entityName));
}
if (!is_array($types)) {
$ty... | [
"protected",
"function",
"validateType",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"type",
")",
")",
"{",
"$",
"types",
"=",
"$",
"schema",
"->",
"type",
";",
"}",
"else"... | Validate entity type
@param mixed $entity
@param object $schema
@param string $entityName
@return Validator | [
"Validate",
"entity",
"type"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L185-L260 |
190,886 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkTypeObject | protected function checkTypeObject($entity, $schema, $entityName)
{
$this->validateProperties($entity, $schema, $entityName);
return $this;
} | php | protected function checkTypeObject($entity, $schema, $entityName)
{
$this->validateProperties($entity, $schema, $entityName);
return $this;
} | [
"protected",
"function",
"checkTypeObject",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"$",
"this",
"->",
"validateProperties",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
";",
"return",
"$",
"this"... | Check object type
@param mixed $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"object",
"type"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L272-L277 |
190,887 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkTypeNumber | protected function checkTypeNumber($entity, $schema, $entityName)
{
$this->checkMinimum($entity, $schema, $entityName);
$this->checkMaximum($entity, $schema, $entityName);
$this->checkExclusiveMinimum($entity, $schema, $entityName);
$this->checkExclusiveMaximum($entity, $schema, $ent... | php | protected function checkTypeNumber($entity, $schema, $entityName)
{
$this->checkMinimum($entity, $schema, $entityName);
$this->checkMaximum($entity, $schema, $entityName);
$this->checkExclusiveMinimum($entity, $schema, $entityName);
$this->checkExclusiveMaximum($entity, $schema, $ent... | [
"protected",
"function",
"checkTypeNumber",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"$",
"this",
"->",
"checkMinimum",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
";",
"$",
"this",
"->",
"check... | Check number type
@param mixed $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"number",
"type"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L288-L300 |
190,888 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkTypeString | protected function checkTypeString($entity, $schema, $entityName)
{
$this->checkPattern($entity, $schema, $entityName);
$this->checkMinLength($entity, $schema, $entityName);
$this->checkMaxLength($entity, $schema, $entityName);
$this->checkFormat($entity, $schema, $entityName);
... | php | protected function checkTypeString($entity, $schema, $entityName)
{
$this->checkPattern($entity, $schema, $entityName);
$this->checkMinLength($entity, $schema, $entityName);
$this->checkMaxLength($entity, $schema, $entityName);
$this->checkFormat($entity, $schema, $entityName);
... | [
"protected",
"function",
"checkTypeString",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"$",
"this",
"->",
"checkPattern",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
";",
"$",
"this",
"->",
"check... | Check string type
@param mixed $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"string",
"type"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L348-L358 |
190,889 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkTypeArray | protected function checkTypeArray($entity, $schema, $entityName)
{
$this->checkMinItems($entity, $schema, $entityName);
$this->checkMaxItems($entity, $schema, $entityName);
$this->checkUniqueItems($entity, $schema, $entityName);
$this->checkEnum($entity, $schema, $entityName);
... | php | protected function checkTypeArray($entity, $schema, $entityName)
{
$this->checkMinItems($entity, $schema, $entityName);
$this->checkMaxItems($entity, $schema, $entityName);
$this->checkUniqueItems($entity, $schema, $entityName);
$this->checkEnum($entity, $schema, $entityName);
... | [
"protected",
"function",
"checkTypeArray",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"$",
"this",
"->",
"checkMinItems",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
";",
"$",
"this",
"->",
"check... | Check array type
@param mixed $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"array",
"type"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L369-L379 |
190,890 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkTypeAny | protected function checkTypeAny($entity, $schema, $entityName)
{
$this->checkDisallow($entity, $schema, $entityName);
return $this;
} | php | protected function checkTypeAny($entity, $schema, $entityName)
{
$this->checkDisallow($entity, $schema, $entityName);
return $this;
} | [
"protected",
"function",
"checkTypeAny",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"$",
"this",
"->",
"checkDisallow",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
";",
"return",
"$",
"this",
";",... | Check any type
@param mixed $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"any",
"type"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L404-L409 |
190,891 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkMinimum | protected function checkMinimum($entity, $schema, $entityName)
{
if (isset($schema->minimum)) {
if ($entity < $schema->minimum) {
throw new ValidationException(sprintf('Invalid value for [%s], minimum is [%s]', $entityName, $schema->minimum));
}
}
ret... | php | protected function checkMinimum($entity, $schema, $entityName)
{
if (isset($schema->minimum)) {
if ($entity < $schema->minimum) {
throw new ValidationException(sprintf('Invalid value for [%s], minimum is [%s]', $entityName, $schema->minimum));
}
}
ret... | [
"protected",
"function",
"checkMinimum",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"minimum",
")",
")",
"{",
"if",
"(",
"$",
"entity",
"<",
"$",
"schema",
"->",
"minimum",
... | Check minimum value
@param int|float $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"minimum",
"value"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L420-L429 |
190,892 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkMaximum | protected function checkMaximum($entity, $schema, $entityName)
{
if (isset($schema->maximum)) {
if ($entity > $schema->maximum) {
throw new ValidationException(sprintf('Invalid value for [%s], maximum is [%s]', $entityName, $schema->maximum));
}
}
ret... | php | protected function checkMaximum($entity, $schema, $entityName)
{
if (isset($schema->maximum)) {
if ($entity > $schema->maximum) {
throw new ValidationException(sprintf('Invalid value for [%s], maximum is [%s]', $entityName, $schema->maximum));
}
}
ret... | [
"protected",
"function",
"checkMaximum",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"maximum",
")",
")",
"{",
"if",
"(",
"$",
"entity",
">",
"$",
"schema",
"->",
"maximum",
... | Check maximum value
@param int|float $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"maximum",
"value"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L440-L449 |
190,893 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkExclusiveMinimum | protected function checkExclusiveMinimum($entity, $schema, $entityName)
{
if (isset($schema->minimum) && isset($schema->exclusiveMinimum) && $schema->exclusiveMinimum) {
if ($entity == $schema->minimum) {
throw new ValidationException(sprintf('Invalid value for [%s], must be grea... | php | protected function checkExclusiveMinimum($entity, $schema, $entityName)
{
if (isset($schema->minimum) && isset($schema->exclusiveMinimum) && $schema->exclusiveMinimum) {
if ($entity == $schema->minimum) {
throw new ValidationException(sprintf('Invalid value for [%s], must be grea... | [
"protected",
"function",
"checkExclusiveMinimum",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"minimum",
")",
"&&",
"isset",
"(",
"$",
"schema",
"->",
"exclusiveMinimum",
")",
"&... | Check exlusive minimum requirement
@param int|float $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"exlusive",
"minimum",
"requirement"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L460-L469 |
190,894 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkExclusiveMaximum | protected function checkExclusiveMaximum($entity, $schema, $entityName)
{
if (isset($schema->maximum) && isset($schema->exclusiveMaximum) && $schema->exclusiveMaximum) {
if ($entity == $schema->maximum) {
throw new ValidationException(sprintf('Invalid value for [%s], must be less... | php | protected function checkExclusiveMaximum($entity, $schema, $entityName)
{
if (isset($schema->maximum) && isset($schema->exclusiveMaximum) && $schema->exclusiveMaximum) {
if ($entity == $schema->maximum) {
throw new ValidationException(sprintf('Invalid value for [%s], must be less... | [
"protected",
"function",
"checkExclusiveMaximum",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"maximum",
")",
"&&",
"isset",
"(",
"$",
"schema",
"->",
"exclusiveMaximum",
")",
"&... | Check exclusive maximum requirement
@param int|float $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"exclusive",
"maximum",
"requirement"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L480-L489 |
190,895 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkPattern | protected function checkPattern($entity, $schema, $entityName)
{
if (isset($schema->pattern) && $schema->pattern) {
if (!preg_match($schema->pattern, $entity)) {
throw new ValidationException(sprintf('String does not match pattern for [%s]', $entityName));
}
}... | php | protected function checkPattern($entity, $schema, $entityName)
{
if (isset($schema->pattern) && $schema->pattern) {
if (!preg_match($schema->pattern, $entity)) {
throw new ValidationException(sprintf('String does not match pattern for [%s]', $entityName));
}
}... | [
"protected",
"function",
"checkPattern",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"pattern",
")",
"&&",
"$",
"schema",
"->",
"pattern",
")",
"{",
"if",
"(",
"!",
"preg_mat... | Check value against regex pattern
@param string $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"value",
"against",
"regex",
"pattern"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L500-L509 |
190,896 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkMinLength | protected function checkMinLength($entity, $schema, $entityName)
{
if (isset($schema->minLength) && $schema->minLength) {
if (strlen($entity) < $schema->minLength) {
throw new ValidationException(sprintf('String too short for [%s], minimum length is [%s]', $entityName, $schema->m... | php | protected function checkMinLength($entity, $schema, $entityName)
{
if (isset($schema->minLength) && $schema->minLength) {
if (strlen($entity) < $schema->minLength) {
throw new ValidationException(sprintf('String too short for [%s], minimum length is [%s]', $entityName, $schema->m... | [
"protected",
"function",
"checkMinLength",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"minLength",
")",
"&&",
"$",
"schema",
"->",
"minLength",
")",
"{",
"if",
"(",
"strlen",
... | Check string minimum length
@param string $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"string",
"minimum",
"length"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L520-L529 |
190,897 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkMaxLength | protected function checkMaxLength($entity, $schema, $entityName)
{
if (isset($schema->maxLength) && $schema->maxLength) {
if (strlen($entity) > $schema->maxLength) {
throw new ValidationException(sprintf('String too long for [%s], maximum length is [%s]', $entityName, $schema->ma... | php | protected function checkMaxLength($entity, $schema, $entityName)
{
if (isset($schema->maxLength) && $schema->maxLength) {
if (strlen($entity) > $schema->maxLength) {
throw new ValidationException(sprintf('String too long for [%s], maximum length is [%s]', $entityName, $schema->ma... | [
"protected",
"function",
"checkMaxLength",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"maxLength",
")",
"&&",
"$",
"schema",
"->",
"maxLength",
")",
"{",
"if",
"(",
"strlen",
... | Check string maximum length
@param string $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"string",
"maximum",
"length"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L540-L549 |
190,898 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkMinItems | protected function checkMinItems($entity, $schema, $entityName)
{
if (isset($schema->minItems) && $schema->minItems) {
if (count($entity) < $schema->minItems) {
throw new ValidationException(sprintf('Not enough array items for [%s], minimum is [%s]', $entityName, $schema->minItem... | php | protected function checkMinItems($entity, $schema, $entityName)
{
if (isset($schema->minItems) && $schema->minItems) {
if (count($entity) < $schema->minItems) {
throw new ValidationException(sprintf('Not enough array items for [%s], minimum is [%s]', $entityName, $schema->minItem... | [
"protected",
"function",
"checkMinItems",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"minItems",
")",
"&&",
"$",
"schema",
"->",
"minItems",
")",
"{",
"if",
"(",
"count",
"(... | Check array minimum items
@param array $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"array",
"minimum",
"items"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L560-L569 |
190,899 | hasbridge/php-json-schema | src/Json/Validator.php | Validator.checkMaxItems | protected function checkMaxItems($entity, $schema, $entityName)
{
if (isset($schema->maxItems) && $schema->maxItems) {
if (count($entity) > $schema->maxItems) {
throw new ValidationException(sprintf('Too many array items for [%s], maximum is [%s]', $entityName, $schema->maxItems)... | php | protected function checkMaxItems($entity, $schema, $entityName)
{
if (isset($schema->maxItems) && $schema->maxItems) {
if (count($entity) > $schema->maxItems) {
throw new ValidationException(sprintf('Too many array items for [%s], maximum is [%s]', $entityName, $schema->maxItems)... | [
"protected",
"function",
"checkMaxItems",
"(",
"$",
"entity",
",",
"$",
"schema",
",",
"$",
"entityName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"schema",
"->",
"maxItems",
")",
"&&",
"$",
"schema",
"->",
"maxItems",
")",
"{",
"if",
"(",
"count",
"(... | Check array maximum items
@param array $entity
@param object $schema
@param string $entityName
@return Validator | [
"Check",
"array",
"maximum",
"items"
] | f12881be0739375994986e7a85896d0fa43e6c88 | https://github.com/hasbridge/php-json-schema/blob/f12881be0739375994986e7a85896d0fa43e6c88/src/Json/Validator.php#L580-L589 |
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.