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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
187,900 | tomwalder/php-gds | src/GDS/Schema.php | Schema.addDatetime | public function addDatetime($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_DATETIME, $bol_index);
} | php | public function addDatetime($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_DATETIME, $bol_index);
} | [
"public",
"function",
"addDatetime",
"(",
"$",
"str_name",
",",
"$",
"bol_index",
"=",
"TRUE",
")",
"{",
"return",
"$",
"this",
"->",
"addProperty",
"(",
"$",
"str_name",
",",
"self",
"::",
"PROPERTY_DATETIME",
",",
"$",
"bol_index",
")",
";",
"}"
] | Add a datetime field to the schema
@param $str_name
@param bool $bol_index
@return Schema | [
"Add",
"a",
"datetime",
"field",
"to",
"the",
"schema"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Schema.php#L124-L127 |
187,901 | tomwalder/php-gds | src/GDS/Schema.php | Schema.addFloat | public function addFloat($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_FLOAT, $bol_index);
} | php | public function addFloat($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_FLOAT, $bol_index);
} | [
"public",
"function",
"addFloat",
"(",
"$",
"str_name",
",",
"$",
"bol_index",
"=",
"TRUE",
")",
"{",
"return",
"$",
"this",
"->",
"addProperty",
"(",
"$",
"str_name",
",",
"self",
"::",
"PROPERTY_FLOAT",
",",
"$",
"bol_index",
")",
";",
"}"
] | Add a float|double field to the schema
@param $str_name
@param bool $bol_index
@return Schema | [
"Add",
"a",
"float|double",
"field",
"to",
"the",
"schema"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Schema.php#L136-L139 |
187,902 | tomwalder/php-gds | src/GDS/Schema.php | Schema.addBoolean | public function addBoolean($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_BOOLEAN, $bol_index);
} | php | public function addBoolean($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_BOOLEAN, $bol_index);
} | [
"public",
"function",
"addBoolean",
"(",
"$",
"str_name",
",",
"$",
"bol_index",
"=",
"TRUE",
")",
"{",
"return",
"$",
"this",
"->",
"addProperty",
"(",
"$",
"str_name",
",",
"self",
"::",
"PROPERTY_BOOLEAN",
",",
"$",
"bol_index",
")",
";",
"}"
] | Add a boolean field to the schema
@param $str_name
@param bool $bol_index
@return Schema | [
"Add",
"a",
"boolean",
"field",
"to",
"the",
"schema"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Schema.php#L148-L151 |
187,903 | tomwalder/php-gds | src/GDS/Schema.php | Schema.addGeopoint | public function addGeopoint($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_GEOPOINT, $bol_index);
} | php | public function addGeopoint($str_name, $bol_index = TRUE)
{
return $this->addProperty($str_name, self::PROPERTY_GEOPOINT, $bol_index);
} | [
"public",
"function",
"addGeopoint",
"(",
"$",
"str_name",
",",
"$",
"bol_index",
"=",
"TRUE",
")",
"{",
"return",
"$",
"this",
"->",
"addProperty",
"(",
"$",
"str_name",
",",
"self",
"::",
"PROPERTY_GEOPOINT",
",",
"$",
"bol_index",
")",
";",
"}"
] | Add a geopoint field to the schema
@param $str_name
@param bool $bol_index
@return Schema | [
"Add",
"a",
"geopoint",
"field",
"to",
"the",
"schema"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Schema.php#L160-L163 |
187,904 | tomwalder/php-gds | src/GDS/Schema.php | Schema.setEntityClass | public final function setEntityClass($str_class)
{
if(class_exists($str_class)) {
if(is_a($str_class, '\\GDS\\Entity', TRUE)) {
$this->str_entity_class = $str_class;
} else {
throw new \InvalidArgumentException('Cannot set an Entity class that does not... | php | public final function setEntityClass($str_class)
{
if(class_exists($str_class)) {
if(is_a($str_class, '\\GDS\\Entity', TRUE)) {
$this->str_entity_class = $str_class;
} else {
throw new \InvalidArgumentException('Cannot set an Entity class that does not... | [
"public",
"final",
"function",
"setEntityClass",
"(",
"$",
"str_class",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"str_class",
")",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"str_class",
",",
"'\\\\GDS\\\\Entity'",
",",
"TRUE",
")",
")",
"{",
"$",
"t... | Set the class to use when instantiating new Entity objects
Must be GDS\Entity, or a sub-class of it
@param $str_class
@return $this
@throws \InvalidArgumentException | [
"Set",
"the",
"class",
"to",
"use",
"when",
"instantiating",
"new",
"Entity",
"objects"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Schema.php#L206-L218 |
187,905 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.httpClient | protected function httpClient()
{
if (null === $this->obj_http_client) {
$this->obj_http_client = $this->initHttpClient();
}
return $this->obj_http_client;
} | php | protected function httpClient()
{
if (null === $this->obj_http_client) {
$this->obj_http_client = $this->initHttpClient();
}
return $this->obj_http_client;
} | [
"protected",
"function",
"httpClient",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"obj_http_client",
")",
"{",
"$",
"this",
"->",
"obj_http_client",
"=",
"$",
"this",
"->",
"initHttpClient",
"(",
")",
";",
"}",
"return",
"$",
"this",
"... | Lazily initialise the HTTP Client when needed. Once.
@return ClientInterface | [
"Lazily",
"initialise",
"the",
"HTTP",
"Client",
"when",
"needed",
".",
"Once",
"."
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L80-L86 |
187,906 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.initHttpClient | protected function initHttpClient()
{
// Middleware
$obj_stack = HandlerStack::create();
$obj_stack->push(ApplicationDefaultCredentials::getMiddleware(['https://www.googleapis.com/auth/datastore']));
$str_base_url = self::DEFAULT_BASE_URL;
if (getenv("DATASTORE_EMULATOR_HO... | php | protected function initHttpClient()
{
// Middleware
$obj_stack = HandlerStack::create();
$obj_stack->push(ApplicationDefaultCredentials::getMiddleware(['https://www.googleapis.com/auth/datastore']));
$str_base_url = self::DEFAULT_BASE_URL;
if (getenv("DATASTORE_EMULATOR_HO... | [
"protected",
"function",
"initHttpClient",
"(",
")",
"{",
"// Middleware",
"$",
"obj_stack",
"=",
"HandlerStack",
"::",
"create",
"(",
")",
";",
"$",
"obj_stack",
"->",
"push",
"(",
"ApplicationDefaultCredentials",
"::",
"getMiddleware",
"(",
"[",
"'https://www.go... | Configure HTTP Client
@return ClientInterface | [
"Configure",
"HTTP",
"Client"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L93-L112 |
187,907 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.executePostRequest | private function executePostRequest($str_action, $obj_request_body = null)
{
$arr_options = [];
if(null !== $obj_request_body) {
$arr_options['json'] = $obj_request_body;
}
$obj_response = $this->httpClient()->post($this->actionUrl($str_action), $arr_options);
$th... | php | private function executePostRequest($str_action, $obj_request_body = null)
{
$arr_options = [];
if(null !== $obj_request_body) {
$arr_options['json'] = $obj_request_body;
}
$obj_response = $this->httpClient()->post($this->actionUrl($str_action), $arr_options);
$th... | [
"private",
"function",
"executePostRequest",
"(",
"$",
"str_action",
",",
"$",
"obj_request_body",
"=",
"null",
")",
"{",
"$",
"arr_options",
"=",
"[",
"]",
";",
"if",
"(",
"null",
"!==",
"$",
"obj_request_body",
")",
"{",
"$",
"arr_options",
"[",
"'json'"... | Execute a POST request against the API
@param $str_action
@param null $obj_request_body | [
"Execute",
"a",
"POST",
"request",
"against",
"the",
"API"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L159-L167 |
187,908 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.deleteMulti | public function deleteMulti(array $arr_entities)
{
// Build the base request
$obj_request = $this->buildCommitRequest();
// Create JSON keys for each delete mutation
foreach($arr_entities as $obj_gds_entity) {
$obj_rest_key = (object)['path' => $this->createMapper()->bu... | php | public function deleteMulti(array $arr_entities)
{
// Build the base request
$obj_request = $this->buildCommitRequest();
// Create JSON keys for each delete mutation
foreach($arr_entities as $obj_gds_entity) {
$obj_rest_key = (object)['path' => $this->createMapper()->bu... | [
"public",
"function",
"deleteMulti",
"(",
"array",
"$",
"arr_entities",
")",
"{",
"// Build the base request",
"$",
"obj_request",
"=",
"$",
"this",
"->",
"buildCommitRequest",
"(",
")",
";",
"// Create JSON keys for each delete mutation",
"foreach",
"(",
"$",
"arr_en... | Delete 1-many entities
@param array $arr_entities
@return mixed | [
"Delete",
"1",
"-",
"many",
"entities"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L216-L233 |
187,909 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.applyPartition | private function applyPartition(\stdClass $obj_request) {
$obj_request->partitionId = (object)[
'projectId' => $this->str_dataset_id
];
if(null !== $this->str_namespace) {
$obj_request->partitionId->namespaceId = $this->str_namespace;
}
return $obj_request... | php | private function applyPartition(\stdClass $obj_request) {
$obj_request->partitionId = (object)[
'projectId' => $this->str_dataset_id
];
if(null !== $this->str_namespace) {
$obj_request->partitionId->namespaceId = $this->str_namespace;
}
return $obj_request... | [
"private",
"function",
"applyPartition",
"(",
"\\",
"stdClass",
"$",
"obj_request",
")",
"{",
"$",
"obj_request",
"->",
"partitionId",
"=",
"(",
"object",
")",
"[",
"'projectId'",
"=>",
"$",
"this",
"->",
"str_dataset_id",
"]",
";",
"if",
"(",
"null",
"!==... | Apply project and namespace to a query
@param \stdClass $obj_request
@return \stdClass | [
"Apply",
"project",
"and",
"namespace",
"to",
"a",
"query"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L324-L332 |
187,910 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.applyTransaction | private function applyTransaction(\stdClass $obj_request) {
if(null !== $this->str_next_transaction) {
$obj_request->readOptions = (object)[
// 'readConsistency' => $options->getReadConsistency(),
"transaction" => $this->str_next_transaction
];
... | php | private function applyTransaction(\stdClass $obj_request) {
if(null !== $this->str_next_transaction) {
$obj_request->readOptions = (object)[
// 'readConsistency' => $options->getReadConsistency(),
"transaction" => $this->str_next_transaction
];
... | [
"private",
"function",
"applyTransaction",
"(",
"\\",
"stdClass",
"$",
"obj_request",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"str_next_transaction",
")",
"{",
"$",
"obj_request",
"->",
"readOptions",
"=",
"(",
"object",
")",
"[",
"// 'readCon... | If we are in a transaction, apply it to the request object
@todo Deal with read consistency
@param $obj_request
@return mixed | [
"If",
"we",
"are",
"in",
"a",
"transaction",
"apply",
"it",
"to",
"the",
"request",
"object"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L342-L351 |
187,911 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.buildQueryParamValue | private function buildQueryParamValue($mix_value)
{
$obj_val = new \stdClass();
$str_type = gettype($mix_value);
switch($str_type) {
case 'boolean':
$obj_val->booleanValue = $mix_value;
break;
case 'integer':
$obj_val->... | php | private function buildQueryParamValue($mix_value)
{
$obj_val = new \stdClass();
$str_type = gettype($mix_value);
switch($str_type) {
case 'boolean':
$obj_val->booleanValue = $mix_value;
break;
case 'integer':
$obj_val->... | [
"private",
"function",
"buildQueryParamValue",
"(",
"$",
"mix_value",
")",
"{",
"$",
"obj_val",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"str_type",
"=",
"gettype",
"(",
"$",
"mix_value",
")",
";",
"switch",
"(",
"$",
"str_type",
")",
"{",
"ca... | Build a JSON representation of a value
@param $mix_value
@return \stdClass | [
"Build",
"a",
"JSON",
"representation",
"of",
"a",
"value"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L380-L418 |
187,912 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.getEndCursor | public function getEndCursor()
{
if(isset($this->obj_last_response->batch) && isset($this->obj_last_response->batch->endCursor)) {
return $this->obj_last_response->batch->endCursor;
}
return null;
} | php | public function getEndCursor()
{
if(isset($this->obj_last_response->batch) && isset($this->obj_last_response->batch->endCursor)) {
return $this->obj_last_response->batch->endCursor;
}
return null;
} | [
"public",
"function",
"getEndCursor",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"obj_last_response",
"->",
"batch",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"obj_last_response",
"->",
"batch",
"->",
"endCursor",
")",
")",
"{",
"return... | Get the end cursor from the last response
@return mixed | [
"Get",
"the",
"end",
"cursor",
"from",
"the",
"last",
"response"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L445-L451 |
187,913 | tomwalder/php-gds | src/GDS/Gateway/RESTv1.php | RESTv1.getBaseUrl | protected function getBaseUrl() {
$str_base_url = $this->obj_http_client->getConfig(self::CONFIG_CLIENT_BASE_URL);
if (!empty($str_base_url)) {
return $str_base_url;
}
return self::DEFAULT_BASE_URL;
} | php | protected function getBaseUrl() {
$str_base_url = $this->obj_http_client->getConfig(self::CONFIG_CLIENT_BASE_URL);
if (!empty($str_base_url)) {
return $str_base_url;
}
return self::DEFAULT_BASE_URL;
} | [
"protected",
"function",
"getBaseUrl",
"(",
")",
"{",
"$",
"str_base_url",
"=",
"$",
"this",
"->",
"obj_http_client",
"->",
"getConfig",
"(",
"self",
"::",
"CONFIG_CLIENT_BASE_URL",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"str_base_url",
")",
")",
"{"... | Get the base url from the client object.
Note: If for some reason the client's base URL is not set then we will return the default endpoint.
@return string | [
"Get",
"the",
"base",
"url",
"from",
"the",
"client",
"object",
"."
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/RESTv1.php#L491-L498 |
187,914 | tomwalder/php-gds | src/GDS/Gateway/ProtoBuf.php | ProtoBuf.applyTransaction | private function applyTransaction($obj)
{
if(null !== $this->str_next_transaction) {
$obj->setTransaction($this->str_next_transaction);
$this->str_next_transaction = null;
}
return $obj;
} | php | private function applyTransaction($obj)
{
if(null !== $this->str_next_transaction) {
$obj->setTransaction($this->str_next_transaction);
$this->str_next_transaction = null;
}
return $obj;
} | [
"private",
"function",
"applyTransaction",
"(",
"$",
"obj",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"str_next_transaction",
")",
"{",
"$",
"obj",
"->",
"setTransaction",
"(",
"$",
"this",
"->",
"str_next_transaction",
")",
";",
"$",
"this",
... | Apply a transaction to an object
@param $obj
@return mixed | [
"Apply",
"a",
"transaction",
"to",
"an",
"object"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/ProtoBuf.php#L146-L153 |
187,915 | tomwalder/php-gds | src/GDS/Gateway/ProtoBuf.php | ProtoBuf.setupRunQuery | private function setupRunQuery()
{
$obj_request = ($this->applyNamespace(new RunQueryRequest()));
$obj_request->setSuggestedBatchSize(self::BATCH_SIZE); // Avoid having to run multiple batches
$this->applyTransaction($obj_request->mutableReadOptions()); // ->setReadConsistency('some-val');
... | php | private function setupRunQuery()
{
$obj_request = ($this->applyNamespace(new RunQueryRequest()));
$obj_request->setSuggestedBatchSize(self::BATCH_SIZE); // Avoid having to run multiple batches
$this->applyTransaction($obj_request->mutableReadOptions()); // ->setReadConsistency('some-val');
... | [
"private",
"function",
"setupRunQuery",
"(",
")",
"{",
"$",
"obj_request",
"=",
"(",
"$",
"this",
"->",
"applyNamespace",
"(",
"new",
"RunQueryRequest",
"(",
")",
")",
")",
";",
"$",
"obj_request",
"->",
"setSuggestedBatchSize",
"(",
"self",
"::",
"BATCH_SIZ... | Set up a RunQueryRequest
@todo setReadConsistency
@todo Be more intelligent about when we set the suggested batch size (e.g. on LIMITed queries)
@return RunQueryRequest | [
"Set",
"up",
"a",
"RunQueryRequest"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/ProtoBuf.php#L163-L169 |
187,916 | tomwalder/php-gds | src/GDS/Gateway/ProtoBuf.php | ProtoBuf.setupCommit | private function setupCommit()
{
$obj_commit_request = new CommitRequest();
if(null === $this->str_next_transaction) {
$obj_commit_request->setMode(Mode::NON_TRANSACTIONAL);
} else {
$obj_commit_request->setMode(Mode::TRANSACTIONAL);
$this->applyTransactio... | php | private function setupCommit()
{
$obj_commit_request = new CommitRequest();
if(null === $this->str_next_transaction) {
$obj_commit_request->setMode(Mode::NON_TRANSACTIONAL);
} else {
$obj_commit_request->setMode(Mode::TRANSACTIONAL);
$this->applyTransactio... | [
"private",
"function",
"setupCommit",
"(",
")",
"{",
"$",
"obj_commit_request",
"=",
"new",
"CommitRequest",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"str_next_transaction",
")",
"{",
"$",
"obj_commit_request",
"->",
"setMode",
"(",
"Mode"... | Set up a commit request
@return CommitRequest | [
"Set",
"up",
"a",
"commit",
"request"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/ProtoBuf.php#L190-L200 |
187,917 | tomwalder/php-gds | src/GDS/Gateway/ProtoBuf.php | ProtoBuf.execute | private function execute($str_method, ProtocolMessage $obj_request, ProtocolMessage $obj_response)
{
try {
ApiProxy::makeSyncCall('datastore_v4', $str_method, $obj_request, $obj_response, 60);
$this->obj_last_response = $obj_response;
} catch (ApplicationError $obj_exception)... | php | private function execute($str_method, ProtocolMessage $obj_request, ProtocolMessage $obj_response)
{
try {
ApiProxy::makeSyncCall('datastore_v4', $str_method, $obj_request, $obj_response, 60);
$this->obj_last_response = $obj_response;
} catch (ApplicationError $obj_exception)... | [
"private",
"function",
"execute",
"(",
"$",
"str_method",
",",
"ProtocolMessage",
"$",
"obj_request",
",",
"ProtocolMessage",
"$",
"obj_response",
")",
"{",
"try",
"{",
"ApiProxy",
"::",
"makeSyncCall",
"(",
"'datastore_v4'",
",",
"$",
"str_method",
",",
"$",
... | Execute a method against the Datastore
Use Google's static ApiProxy method
Will attempt to convert GQL queries in local development environments
@param $str_method
@param ProtocolMessage $obj_request
@param ProtocolMessage $obj_response
@return mixed
@throws ApplicationError
@throws \google\appengine\runtime\Capabil... | [
"Execute",
"a",
"method",
"against",
"the",
"Datastore"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/ProtoBuf.php#L218-L235 |
187,918 | tomwalder/php-gds | src/GDS/Gateway/ProtoBuf.php | ProtoBuf.deleteMulti | public function deleteMulti(array $arr_entities)
{
$obj_mapper = $this->createMapper();
$obj_request = $this->setupCommit();
$obj_mutation = $obj_request->mutableDeprecatedMutation();
foreach($arr_entities as $obj_gds_entity) {
$this->applyNamespace(
$obj_... | php | public function deleteMulti(array $arr_entities)
{
$obj_mapper = $this->createMapper();
$obj_request = $this->setupCommit();
$obj_mutation = $obj_request->mutableDeprecatedMutation();
foreach($arr_entities as $obj_gds_entity) {
$this->applyNamespace(
$obj_... | [
"public",
"function",
"deleteMulti",
"(",
"array",
"$",
"arr_entities",
")",
"{",
"$",
"obj_mapper",
"=",
"$",
"this",
"->",
"createMapper",
"(",
")",
";",
"$",
"obj_request",
"=",
"$",
"this",
"->",
"setupCommit",
"(",
")",
";",
"$",
"obj_mutation",
"="... | Delete 1 or many entities, using their Keys
Consumes Schema
@todo Determine success. Not 100% how to do this from the response yet.
@param array $arr_entities
@return bool | [
"Delete",
"1",
"or",
"many",
"entities",
"using",
"their",
"Keys"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/ProtoBuf.php#L270-L285 |
187,919 | tomwalder/php-gds | src/GDS/Gateway/ProtoBuf.php | ProtoBuf.executeGqlAsBasicQuery | private function executeGqlAsBasicQuery(ProtocolMessage $obj_gql_request)
{
// Set up the new request
$obj_query_request = $this->setupRunQuery();
$obj_query = $obj_query_request->mutableQuery();
// Transfer any transaction data to the new request
/** @var RunQueryRequest $o... | php | private function executeGqlAsBasicQuery(ProtocolMessage $obj_gql_request)
{
// Set up the new request
$obj_query_request = $this->setupRunQuery();
$obj_query = $obj_query_request->mutableQuery();
// Transfer any transaction data to the new request
/** @var RunQueryRequest $o... | [
"private",
"function",
"executeGqlAsBasicQuery",
"(",
"ProtocolMessage",
"$",
"obj_gql_request",
")",
"{",
"// Set up the new request",
"$",
"obj_query_request",
"=",
"$",
"this",
"->",
"setupRunQuery",
"(",
")",
";",
"$",
"obj_query",
"=",
"$",
"obj_query_request",
... | Take a GQL RunQuery request and convert to a standard RunQuery request
Always expected to be called in the stack ->gql()->execute()->runGqlAsBasicQuery()
@param ProtocolMessage $obj_gql_request
@return null
@throws \GDS\Exception\GQL | [
"Take",
"a",
"GQL",
"RunQuery",
"request",
"and",
"convert",
"to",
"a",
"standard",
"RunQuery",
"request"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway/ProtoBuf.php#L323-L363 |
187,920 | tomwalder/php-gds | src/GDS/Entity.php | Entity.setSchema | public function setSchema(Schema $obj_schema)
{
$this->obj_schema = $obj_schema;
$this->setKind($obj_schema->getKind());
return $this;
} | php | public function setSchema(Schema $obj_schema)
{
$this->obj_schema = $obj_schema;
$this->setKind($obj_schema->getKind());
return $this;
} | [
"public",
"function",
"setSchema",
"(",
"Schema",
"$",
"obj_schema",
")",
"{",
"$",
"this",
"->",
"obj_schema",
"=",
"$",
"obj_schema",
";",
"$",
"this",
"->",
"setKind",
"(",
"$",
"obj_schema",
"->",
"getKind",
"(",
")",
")",
";",
"return",
"$",
"this... | Set the Schema for the Entity
@param Schema $obj_schema
@return $this | [
"Set",
"the",
"Schema",
"for",
"the",
"Entity"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Entity.php#L220-L225 |
187,921 | tomwalder/php-gds | src/GDS/Mapper/ProtoBufGQLParser.php | ProtoBufGQLParser.parse | public function parse($str_gql, $arr_named_params = [])
{
// Record our input params
foreach($arr_named_params as $obj_param) {
if($obj_param->hasValue()) {
$this->arr_named_params[$obj_param->getName()] = $obj_param->getValue();
} else if ($obj_param->hasCurs... | php | public function parse($str_gql, $arr_named_params = [])
{
// Record our input params
foreach($arr_named_params as $obj_param) {
if($obj_param->hasValue()) {
$this->arr_named_params[$obj_param->getName()] = $obj_param->getValue();
} else if ($obj_param->hasCurs... | [
"public",
"function",
"parse",
"(",
"$",
"str_gql",
",",
"$",
"arr_named_params",
"=",
"[",
"]",
")",
"{",
"// Record our input params",
"foreach",
"(",
"$",
"arr_named_params",
"as",
"$",
"obj_param",
")",
"{",
"if",
"(",
"$",
"obj_param",
"->",
"hasValue",... | Turn a GQL string and parameter array into a "lookup" query
We use preg_replace_callback to "prune" down the GQL string so we are left with nothing
@param $str_gql
@param \google\appengine\datastore\v4\GqlQueryArg[] $arr_named_params
@throws GQL | [
"Turn",
"a",
"GQL",
"string",
"and",
"parameter",
"array",
"into",
"a",
"lookup",
"query"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Mapper/ProtoBufGQLParser.php#L162-L204 |
187,922 | tomwalder/php-gds | src/GDS/Mapper/ProtoBufGQLParser.php | ProtoBufGQLParser.tokenizeQuoted | private function tokenizeQuoted($arr)
{
$str_token = self::TOKEN_PREFIX . ++$this->int_token_count;
$this->arr_tokens[$str_token] = $arr['quoted'];
return $str_token;
} | php | private function tokenizeQuoted($arr)
{
$str_token = self::TOKEN_PREFIX . ++$this->int_token_count;
$this->arr_tokens[$str_token] = $arr['quoted'];
return $str_token;
} | [
"private",
"function",
"tokenizeQuoted",
"(",
"$",
"arr",
")",
"{",
"$",
"str_token",
"=",
"self",
"::",
"TOKEN_PREFIX",
".",
"++",
"$",
"this",
"->",
"int_token_count",
";",
"$",
"this",
"->",
"arr_tokens",
"[",
"$",
"str_token",
"]",
"=",
"$",
"arr",
... | Record quoted strings, return simple tokens
@param $arr
@return string | [
"Record",
"quoted",
"strings",
"return",
"simple",
"tokens"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Mapper/ProtoBufGQLParser.php#L212-L217 |
187,923 | tomwalder/php-gds | src/GDS/Mapper/ProtoBufGQLParser.php | ProtoBufGQLParser.recordOffset | private function recordOffset($arr)
{
list($this->int_offset, $this->str_start_cursor) = $this->getIntStringFromValue($this->lookupToken($arr['offset']));
return '';
} | php | private function recordOffset($arr)
{
list($this->int_offset, $this->str_start_cursor) = $this->getIntStringFromValue($this->lookupToken($arr['offset']));
return '';
} | [
"private",
"function",
"recordOffset",
"(",
"$",
"arr",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"int_offset",
",",
"$",
"this",
"->",
"str_start_cursor",
")",
"=",
"$",
"this",
"->",
"getIntStringFromValue",
"(",
"$",
"this",
"->",
"lookupToken",
"(",
... | Record the offset
@param $arr
@return string | [
"Record",
"the",
"offset"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Mapper/ProtoBufGQLParser.php#L237-L241 |
187,924 | tomwalder/php-gds | src/GDS/Mapper/ProtoBufGQLParser.php | ProtoBufGQLParser.recordLimit | private function recordLimit($arr)
{
list($this->int_limit, $this->str_end_cursor) = $this->getIntStringFromValue($this->lookupToken($arr['limit']));
return '';
} | php | private function recordLimit($arr)
{
list($this->int_limit, $this->str_end_cursor) = $this->getIntStringFromValue($this->lookupToken($arr['limit']));
return '';
} | [
"private",
"function",
"recordLimit",
"(",
"$",
"arr",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"int_limit",
",",
"$",
"this",
"->",
"str_end_cursor",
")",
"=",
"$",
"this",
"->",
"getIntStringFromValue",
"(",
"$",
"this",
"->",
"lookupToken",
"(",
"$",... | Record the limit
@param $arr
@return string | [
"Record",
"the",
"limit"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Mapper/ProtoBufGQLParser.php#L249-L253 |
187,925 | tomwalder/php-gds | src/GDS/Mapper/ProtoBufGQLParser.php | ProtoBufGQLParser.recordOrder | private function recordOrder($arr)
{
$arr_order_bys = explode(',', $arr['order']);
foreach($arr_order_bys as $str_order_by) {
$arr_matches = [];
preg_match('/\s?(?<field>[^\s]*)\s*(?<dir>ASC|DESC)?/i', $str_order_by, $arr_matches);
if(isset($arr_matches['field']))... | php | private function recordOrder($arr)
{
$arr_order_bys = explode(',', $arr['order']);
foreach($arr_order_bys as $str_order_by) {
$arr_matches = [];
preg_match('/\s?(?<field>[^\s]*)\s*(?<dir>ASC|DESC)?/i', $str_order_by, $arr_matches);
if(isset($arr_matches['field']))... | [
"private",
"function",
"recordOrder",
"(",
"$",
"arr",
")",
"{",
"$",
"arr_order_bys",
"=",
"explode",
"(",
"','",
",",
"$",
"arr",
"[",
"'order'",
"]",
")",
";",
"foreach",
"(",
"$",
"arr_order_bys",
"as",
"$",
"str_order_by",
")",
"{",
"$",
"arr_matc... | Process the ORDER BY clause
@param $arr
@return string
@throws GQL | [
"Process",
"the",
"ORDER",
"BY",
"clause"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Mapper/ProtoBufGQLParser.php#L288-L308 |
187,926 | tomwalder/php-gds | src/GDS/Mapper/ProtoBufGQLParser.php | ProtoBufGQLParser.recordWhere | private function recordWhere($arr)
{
$arr_conditions = explode('AND', $arr['where']);
$str_regex = '/(?<lhs>[^\s<>=]*)\s*(?<comp>=|<|<=|>|>=|IN|CONTAINS|HAS ANCESTOR|HAS DESCENDANT)\s*(?<rhs>[^\s<>=]+)/i';
foreach($arr_conditions as $str_condition) {
$arr_matches = [];
... | php | private function recordWhere($arr)
{
$arr_conditions = explode('AND', $arr['where']);
$str_regex = '/(?<lhs>[^\s<>=]*)\s*(?<comp>=|<|<=|>|>=|IN|CONTAINS|HAS ANCESTOR|HAS DESCENDANT)\s*(?<rhs>[^\s<>=]+)/i';
foreach($arr_conditions as $str_condition) {
$arr_matches = [];
... | [
"private",
"function",
"recordWhere",
"(",
"$",
"arr",
")",
"{",
"$",
"arr_conditions",
"=",
"explode",
"(",
"'AND'",
",",
"$",
"arr",
"[",
"'where'",
"]",
")",
";",
"$",
"str_regex",
"=",
"'/(?<lhs>[^\\s<>=]*)\\s*(?<comp>=|<|<=|>|>=|IN|CONTAINS|HAS ANCESTOR|HAS DES... | Process the WHERE clause
@param $arr
@return string
@throws GQL | [
"Process",
"the",
"WHERE",
"clause"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Mapper/ProtoBufGQLParser.php#L317-L367 |
187,927 | tomwalder/php-gds | src/GDS/Mapper/ProtoBufGQLParser.php | ProtoBufGQLParser.lookupToken | private function lookupToken($str_val)
{
if('__key__' === $str_val) {
return $str_val;
}
if('_' === $str_val[0]) {
if(isset($this->arr_tokens[$str_val])) {
return $this->arr_tokens[$str_val];
}
}
if('@' === $str_val[0]) {
... | php | private function lookupToken($str_val)
{
if('__key__' === $str_val) {
return $str_val;
}
if('_' === $str_val[0]) {
if(isset($this->arr_tokens[$str_val])) {
return $this->arr_tokens[$str_val];
}
}
if('@' === $str_val[0]) {
... | [
"private",
"function",
"lookupToken",
"(",
"$",
"str_val",
")",
"{",
"if",
"(",
"'__key__'",
"===",
"$",
"str_val",
")",
"{",
"return",
"$",
"str_val",
";",
"}",
"if",
"(",
"'_'",
"===",
"$",
"str_val",
"[",
"0",
"]",
")",
"{",
"if",
"(",
"isset",
... | Lookup the field in our token & named parameter list
Use array index string access for fast initial check
@param $str_val
@return mixed | [
"Lookup",
"the",
"field",
"in",
"our",
"token",
"&",
"named",
"parameter",
"list"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Mapper/ProtoBufGQLParser.php#L377-L394 |
187,928 | tomwalder/php-gds | src/GDS/Gateway.php | Gateway.fetchById | public function fetchById($int_key_id)
{
$arr_results = $this->fetchByIds([$int_key_id]);
if(count($arr_results) > 0) {
return $arr_results[0];
}
return null;
} | php | public function fetchById($int_key_id)
{
$arr_results = $this->fetchByIds([$int_key_id]);
if(count($arr_results) > 0) {
return $arr_results[0];
}
return null;
} | [
"public",
"function",
"fetchById",
"(",
"$",
"int_key_id",
")",
"{",
"$",
"arr_results",
"=",
"$",
"this",
"->",
"fetchByIds",
"(",
"[",
"$",
"int_key_id",
"]",
")",
";",
"if",
"(",
"count",
"(",
"$",
"arr_results",
")",
">",
"0",
")",
"{",
"return",... | Fetch one entity by Key ID
@param $int_key_id
@return mixed | [
"Fetch",
"one",
"entity",
"by",
"Key",
"ID"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway.php#L105-L112 |
187,929 | tomwalder/php-gds | src/GDS/Gateway.php | Gateway.fetchByName | public function fetchByName($str_key_name)
{
$arr_results = $this->fetchByNames([$str_key_name]);
if(count($arr_results) > 0) {
return $arr_results[0];
}
return null;
} | php | public function fetchByName($str_key_name)
{
$arr_results = $this->fetchByNames([$str_key_name]);
if(count($arr_results) > 0) {
return $arr_results[0];
}
return null;
} | [
"public",
"function",
"fetchByName",
"(",
"$",
"str_key_name",
")",
"{",
"$",
"arr_results",
"=",
"$",
"this",
"->",
"fetchByNames",
"(",
"[",
"$",
"str_key_name",
"]",
")",
";",
"if",
"(",
"count",
"(",
"$",
"arr_results",
")",
">",
"0",
")",
"{",
"... | Fetch entity data by Key Name
@param $str_key_name
@return mixed | [
"Fetch",
"entity",
"data",
"by",
"Key",
"Name"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway.php#L120-L127 |
187,930 | tomwalder/php-gds | src/GDS/Gateway.php | Gateway.putMulti | public function putMulti(array $arr_entities)
{
// Ensure all the supplied are Entities and have a Kind & Schema
$this->ensureSchema($arr_entities);
// Record the Auto-generated Key IDs against the GDS Entities.
$this->mapAutoIDs($this->upsert($arr_entities));
// Consume sc... | php | public function putMulti(array $arr_entities)
{
// Ensure all the supplied are Entities and have a Kind & Schema
$this->ensureSchema($arr_entities);
// Record the Auto-generated Key IDs against the GDS Entities.
$this->mapAutoIDs($this->upsert($arr_entities));
// Consume sc... | [
"public",
"function",
"putMulti",
"(",
"array",
"$",
"arr_entities",
")",
"{",
"// Ensure all the supplied are Entities and have a Kind & Schema",
"$",
"this",
"->",
"ensureSchema",
"(",
"$",
"arr_entities",
")",
";",
"// Record the Auto-generated Key IDs against the GDS Entiti... | Put an array of Entities into the Datastore
Consumes Schema
@param \GDS\Entity[] $arr_entities
@throws \Exception | [
"Put",
"an",
"array",
"of",
"Entities",
"into",
"the",
"Datastore"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway.php#L158-L169 |
187,931 | tomwalder/php-gds | src/GDS/Gateway.php | Gateway.ensureSchema | protected function ensureSchema($arr_entities)
{
foreach($arr_entities as $obj_gds_entity) {
if($obj_gds_entity instanceof Entity) {
if (null === $obj_gds_entity->getKind()) {
$obj_gds_entity->setSchema($this->obj_schema);
}
} else ... | php | protected function ensureSchema($arr_entities)
{
foreach($arr_entities as $obj_gds_entity) {
if($obj_gds_entity instanceof Entity) {
if (null === $obj_gds_entity->getKind()) {
$obj_gds_entity->setSchema($this->obj_schema);
}
} else ... | [
"protected",
"function",
"ensureSchema",
"(",
"$",
"arr_entities",
")",
"{",
"foreach",
"(",
"$",
"arr_entities",
"as",
"$",
"obj_gds_entity",
")",
"{",
"if",
"(",
"$",
"obj_gds_entity",
"instanceof",
"Entity",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"obj... | Default Kind & Schema support for "new" Entities
@param \GDS\Entity[] $arr_entities | [
"Default",
"Kind",
"&",
"Schema",
"support",
"for",
"new",
"Entities"
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway.php#L202-L213 |
187,932 | tomwalder/php-gds | src/GDS/Gateway.php | Gateway.mapAutoIDs | protected function mapAutoIDs(array $arr_auto_id_requested)
{
if (!empty($arr_auto_id_requested)) {
$arr_auto_ids = $this->extractAutoIDs();
if(count($arr_auto_id_requested) === count($arr_auto_ids)) {
foreach ($arr_auto_id_requested as $int_idx => $obj_gds_entity) {
... | php | protected function mapAutoIDs(array $arr_auto_id_requested)
{
if (!empty($arr_auto_id_requested)) {
$arr_auto_ids = $this->extractAutoIDs();
if(count($arr_auto_id_requested) === count($arr_auto_ids)) {
foreach ($arr_auto_id_requested as $int_idx => $obj_gds_entity) {
... | [
"protected",
"function",
"mapAutoIDs",
"(",
"array",
"$",
"arr_auto_id_requested",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"arr_auto_id_requested",
")",
")",
"{",
"$",
"arr_auto_ids",
"=",
"$",
"this",
"->",
"extractAutoIDs",
"(",
")",
";",
"if",
"(",... | Record the Auto-generated Key IDs against the GDS Entities.
@param \GDS\Entity[] $arr_auto_id_requested
@throws \Exception | [
"Record",
"the",
"Auto",
"-",
"generated",
"Key",
"IDs",
"against",
"the",
"GDS",
"Entities",
"."
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway.php#L239-L251 |
187,933 | tomwalder/php-gds | src/GDS/Gateway.php | Gateway.configureValueParamForQuery | protected function configureValueParamForQuery($obj_val, $mix_value)
{
$str_type = gettype($mix_value);
switch($str_type) {
case 'boolean':
$obj_val->setBooleanValue($mix_value);
break;
case 'integer':
$obj_val->setIntegerValue... | php | protected function configureValueParamForQuery($obj_val, $mix_value)
{
$str_type = gettype($mix_value);
switch($str_type) {
case 'boolean':
$obj_val->setBooleanValue($mix_value);
break;
case 'integer':
$obj_val->setIntegerValue... | [
"protected",
"function",
"configureValueParamForQuery",
"(",
"$",
"obj_val",
",",
"$",
"mix_value",
")",
"{",
"$",
"str_type",
"=",
"gettype",
"(",
"$",
"mix_value",
")",
";",
"switch",
"(",
"$",
"str_type",
")",
"{",
"case",
"'boolean'",
":",
"$",
"obj_va... | Part of our "add parameters to query" sequence.
Shared between multiple Gateway implementations.
@param $obj_val
@param $mix_value
@return $obj_val | [
"Part",
"of",
"our",
"add",
"parameters",
"to",
"query",
"sequence",
"."
] | 65fbafffbb36d864f245f3405da6d683c1ca2265 | https://github.com/tomwalder/php-gds/blob/65fbafffbb36d864f245f3405da6d683c1ca2265/src/GDS/Gateway.php#L262-L299 |
187,934 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/IP/DHCPServer.php | DHCPServer.setConfig | public function setConfig($store_leases_disk) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ip/dhcp-server/config/set");
$sentence->setAttribute("store-leases-disk", $store_leases_disk);
$this->talker->send($sentence);
return "Sucsess";
} | php | public function setConfig($store_leases_disk) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ip/dhcp-server/config/set");
$sentence->setAttribute("store-leases-disk", $store_leases_disk);
$this->talker->send($sentence);
return "Sucsess";
} | [
"public",
"function",
"setConfig",
"(",
"$",
"store_leases_disk",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"addCommand",
"(",
"\"/ip/dhcp-server/config/set\"",
")",
";",
"$",
"sentence",
"->",
"setAttribute",
... | This methode is used to set ip dhcp server config
@param type $store_leases_disk string
@return type array | [
"This",
"methode",
"is",
"used",
"to",
"set",
"ip",
"dhcp",
"server",
"config"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/IP/DHCPServer.php#L63-L69 |
187,935 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/IP/Accounting.php | Accounting.setAccounting | public function setAccounting($account_local_traffic, $enabled, $threshold) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ip/accounting/set");
$sentence->setAttribute("account-local-traffic", $account_local_traffic);
$sentence->setAttribute("enabled", $enabled);
$sent... | php | public function setAccounting($account_local_traffic, $enabled, $threshold) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ip/accounting/set");
$sentence->setAttribute("account-local-traffic", $account_local_traffic);
$sentence->setAttribute("enabled", $enabled);
$sent... | [
"public",
"function",
"setAccounting",
"(",
"$",
"account_local_traffic",
",",
"$",
"enabled",
",",
"$",
"threshold",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"addCommand",
"(",
"\"/ip/accounting/set\"",
")",... | This method is used to set or edit ip accountng
@param type $account_local_traffic string
@param type $enabled string
@param type $threshold string
@return type array | [
"This",
"method",
"is",
"used",
"to",
"set",
"or",
"edit",
"ip",
"accountng"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/IP/Accounting.php#L35-L43 |
187,936 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/System/System.php | System.set_identity | public function set_identity($name) {
$sentence = new SentenceUtil();
$sentence->addCommand("/system/identity/set");
$sentence->setAttribute("name", $name);
$this->talker->send($sentence);
return "Sucsess";
} | php | public function set_identity($name) {
$sentence = new SentenceUtil();
$sentence->addCommand("/system/identity/set");
$sentence->setAttribute("name", $name);
$this->talker->send($sentence);
return "Sucsess";
} | [
"public",
"function",
"set_identity",
"(",
"$",
"name",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"addCommand",
"(",
"\"/system/identity/set\"",
")",
";",
"$",
"sentence",
"->",
"setAttribute",
"(",
"\"name\... | This method is used to set systemn identity
@param type $name string
@return type array | [
"This",
"method",
"is",
"used",
"to",
"set",
"systemn",
"identity"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/System/System.php#L33-L39 |
187,937 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/System/System.php | System.get_all_identity | public function get_all_identity() {
$sentence = new SentenceUtil();
$sentence->fromCommand("/system/identity/getall");
$this->talker->send($sentence);
$rs = $this->talker->getResult();
return $rs->getResultArray();
} | php | public function get_all_identity() {
$sentence = new SentenceUtil();
$sentence->fromCommand("/system/identity/getall");
$this->talker->send($sentence);
$rs = $this->talker->getResult();
return $rs->getResultArray();
} | [
"public",
"function",
"get_all_identity",
"(",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"fromCommand",
"(",
"\"/system/identity/getall\"",
")",
";",
"$",
"this",
"->",
"talker",
"->",
"send",
"(",
"$",
"s... | This method is used to display all system identiy
@return type array | [
"This",
"method",
"is",
"used",
"to",
"display",
"all",
"system",
"identiy"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/System/System.php#L45-L51 |
187,938 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/System/System.php | System.reset | public function reset($keep_users, $no_defaults, $skip_backup) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ip/address/add");
$sentence->setAttribute("keep-users", $keep_users);
$sentence->setAttribute("no-defaults", $no_defaults);
$sentence->setAttribute("skip-backu... | php | public function reset($keep_users, $no_defaults, $skip_backup) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ip/address/add");
$sentence->setAttribute("keep-users", $keep_users);
$sentence->setAttribute("no-defaults", $no_defaults);
$sentence->setAttribute("skip-backu... | [
"public",
"function",
"reset",
"(",
"$",
"keep_users",
",",
"$",
"no_defaults",
",",
"$",
"skip_backup",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"addCommand",
"(",
"\"/ip/address/add\"",
")",
";",
"$",
... | This method is used to system reset configuration
@param type $keep_users string (yes or no)
@param type $no_defaults string (yes or no)
@param type $skip_backup string (yes or no)
@return type array | [
"This",
"method",
"is",
"used",
"to",
"system",
"reset",
"configuration"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/System/System.php#L148-L156 |
187,939 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/PPP/AAA.php | AAA.set | public function set($use_radius, $accounting, $interim_update) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ppp/aaa/set");
$sentence->setAttribute("use-radius", $use_radius);
$sentence->setAttribute("accounting", $accounting);
$sentence->setAttribute("interim-update"... | php | public function set($use_radius, $accounting, $interim_update) {
$sentence = new SentenceUtil();
$sentence->addCommand("/ppp/aaa/set");
$sentence->setAttribute("use-radius", $use_radius);
$sentence->setAttribute("accounting", $accounting);
$sentence->setAttribute("interim-update"... | [
"public",
"function",
"set",
"(",
"$",
"use_radius",
",",
"$",
"accounting",
",",
"$",
"interim_update",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"addCommand",
"(",
"\"/ppp/aaa/set\"",
")",
";",
"$",
"s... | This method is used to set ppp aaa
@param type $use_radius string
@param type $accounting string
@param type $interim_update string
@return type array | [
"This",
"method",
"is",
"used",
"to",
"set",
"ppp",
"aaa"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/PPP/AAA.php#L52-L60 |
187,940 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/Interfaces/Bridge.php | Bridge.set_bridge_settings | public function set_bridge_settings($use_ip_firewall, $use_ip_firewall_for_vlan, $use_ip_firewall_for_pppoe) {
$sentence = new SentenceUtil();
$sentence->fromCommand("/interface/bridge/settings/set");
$sentence->setAttribute("use-ip-firewall", $use_ip_firewall);
$sentence->setAttribute("... | php | public function set_bridge_settings($use_ip_firewall, $use_ip_firewall_for_vlan, $use_ip_firewall_for_pppoe) {
$sentence = new SentenceUtil();
$sentence->fromCommand("/interface/bridge/settings/set");
$sentence->setAttribute("use-ip-firewall", $use_ip_firewall);
$sentence->setAttribute("... | [
"public",
"function",
"set_bridge_settings",
"(",
"$",
"use_ip_firewall",
",",
"$",
"use_ip_firewall_for_vlan",
",",
"$",
"use_ip_firewall_for_pppoe",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"fromCommand",
"(",
... | This method used for set interface Bridge Settings
@param type $use_ip_firewall string (default : yes or no)
@param type $use_ip_firewall_for_vlan string (default : yes or no)
@param type $use_ip_firewall_for_pppoe string (default : yes or no)
@return type array | [
"This",
"method",
"used",
"for",
"set",
"interface",
"Bridge",
"Settings"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/Interfaces/Bridge.php#L240-L248 |
187,941 | nunenuh/mikrotik-api | src/MikrotikAPI/Commands/Interfaces/Bridge.php | Bridge.get_all_bridge_settings | public function get_all_bridge_settings() {
$sentence = new SentenceUtil();
$sentence->fromCommand("/interface/bridge/settings/getall");
$this->talker->send($sentence);
$rs = $this->talker->getResult();
$i = 0;
if ($i < $rs->size()) {
return $rs->getResultArra... | php | public function get_all_bridge_settings() {
$sentence = new SentenceUtil();
$sentence->fromCommand("/interface/bridge/settings/getall");
$this->talker->send($sentence);
$rs = $this->talker->getResult();
$i = 0;
if ($i < $rs->size()) {
return $rs->getResultArra... | [
"public",
"function",
"get_all_bridge_settings",
"(",
")",
"{",
"$",
"sentence",
"=",
"new",
"SentenceUtil",
"(",
")",
";",
"$",
"sentence",
"->",
"fromCommand",
"(",
"\"/interface/bridge/settings/getall\"",
")",
";",
"$",
"this",
"->",
"talker",
"->",
"send",
... | This method used for get all interface Bridge Settings
@return type array | [
"This",
"method",
"used",
"for",
"get",
"all",
"interface",
"Bridge",
"Settings"
] | 82ad5e43e8d06fb534508d66d161705ee258bf46 | https://github.com/nunenuh/mikrotik-api/blob/82ad5e43e8d06fb534508d66d161705ee258bf46/src/MikrotikAPI/Commands/Interfaces/Bridge.php#L254-L266 |
187,942 | bshaffer/oauth2-server-bundle | Storage/UserCredentials.php | UserCredentials.checkUserCredentials | public function checkUserCredentials($username, $password)
{
// Load user by username
try {
$user = $this->up->loadUserByUsername($username);
} catch (\Symfony\Component\Security\Core\Exception\UsernameNotFoundException $e) {
return false;
}
// Do ext... | php | public function checkUserCredentials($username, $password)
{
// Load user by username
try {
$user = $this->up->loadUserByUsername($username);
} catch (\Symfony\Component\Security\Core\Exception\UsernameNotFoundException $e) {
return false;
}
// Do ext... | [
"public",
"function",
"checkUserCredentials",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"// Load user by username",
"try",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"up",
"->",
"loadUserByUsername",
"(",
"$",
"username",
")",
";",
"}",
"catch",
... | Grant access tokens for basic user credentials.
Check the supplied username and password for validity.
You can also use the $client_id param to do any checks required based
on a client, if you need that.
Required for OAuth2::GRANT_TYPE_USER_CREDENTIALS.
@param $username
Username to be check with.
@param $password
P... | [
"Grant",
"access",
"tokens",
"for",
"basic",
"user",
"credentials",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/UserCredentials.php#L49-L72 |
187,943 | bshaffer/oauth2-server-bundle | Storage/Scope.php | Scope.scopeExists | public function scopeExists($scope, $client_id = null)
{
$scopes = explode(' ', $scope);
if ($client_id) {
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}... | php | public function scopeExists($scope, $client_id = null)
{
$scopes = explode(' ', $scope);
if ($client_id) {
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}... | [
"public",
"function",
"scopeExists",
"(",
"$",
"scope",
",",
"$",
"client_id",
"=",
"null",
")",
"{",
"$",
"scopes",
"=",
"explode",
"(",
"' '",
",",
"$",
"scope",
")",
";",
"if",
"(",
"$",
"client_id",
")",
"{",
"// Get Client",
"$",
"client",
"=",
... | Check if the provided scope exists.
@param $scope
A space-separated string of scopes.
@param $client_id
The requesting client.
@return
TRUE if it exists, FALSE otherwise. | [
"Check",
"if",
"the",
"provided",
"scope",
"exists",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/Scope.php#L35-L60 |
187,944 | bshaffer/oauth2-server-bundle | Storage/Scope.php | Scope.getDescriptionForScope | public function getDescriptionForScope($scope)
{
// Get Scope
$scopeObject = $this->sm->findScopeByScope($scope);
if (!$scopeObject) {
return $scope;
}
return $scopeObject->getDescription();
} | php | public function getDescriptionForScope($scope)
{
// Get Scope
$scopeObject = $this->sm->findScopeByScope($scope);
if (!$scopeObject) {
return $scope;
}
return $scopeObject->getDescription();
} | [
"public",
"function",
"getDescriptionForScope",
"(",
"$",
"scope",
")",
"{",
"// Get Scope",
"$",
"scopeObject",
"=",
"$",
"this",
"->",
"sm",
"->",
"findScopeByScope",
"(",
"$",
"scope",
")",
";",
"if",
"(",
"!",
"$",
"scopeObject",
")",
"{",
"return",
... | Gets the description of a given scope key, if
available, otherwise the key is returned.
@return
string description of the scope key. | [
"Gets",
"the",
"description",
"of",
"a",
"given",
"scope",
"key",
"if",
"available",
"otherwise",
"the",
"key",
"is",
"returned",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/Scope.php#L91-L101 |
187,945 | bshaffer/oauth2-server-bundle | Entity/Client.php | Client.setPublicKey | public function setPublicKey(\OAuth2\ServerBundle\Entity\ClientPublicKey $public_key = null)
{
$this->public_key = $public_key;
return $this;
} | php | public function setPublicKey(\OAuth2\ServerBundle\Entity\ClientPublicKey $public_key = null)
{
$this->public_key = $public_key;
return $this;
} | [
"public",
"function",
"setPublicKey",
"(",
"\\",
"OAuth2",
"\\",
"ServerBundle",
"\\",
"Entity",
"\\",
"ClientPublicKey",
"$",
"public_key",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"public_key",
"=",
"$",
"public_key",
";",
"return",
"$",
"this",
";",
"}... | Set public key
@param \OAuth2\ServerBundle\Entity\ClientPublicKey $public_key
@return Client | [
"Set",
"public",
"key"
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Entity/Client.php#L160-L165 |
187,946 | bshaffer/oauth2-server-bundle | Storage/ClientCredentials.php | ClientCredentials.checkClientCredentials | public function checkClientCredentials($client_id, $client_secret = null)
{
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
// If client exists check secret
if ($client) {
return $client->getClientSecret() === $client_secr... | php | public function checkClientCredentials($client_id, $client_secret = null)
{
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
// If client exists check secret
if ($client) {
return $client->getClientSecret() === $client_secr... | [
"public",
"function",
"checkClientCredentials",
"(",
"$",
"client_id",
",",
"$",
"client_secret",
"=",
"null",
")",
"{",
"// Get Client",
"$",
"client",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:Client'",
")",
"->",
"find",
... | Make sure that the client credentials is valid.
@param $client_id
Client identifier to be check with.
@param $client_secret
(optional) If a secret is required, check that they've given the right one.
@return
TRUE if the client credentials are valid, and MUST return FALSE if it isn't.
@endcode
@see http://tools.ietf.... | [
"Make",
"sure",
"that",
"the",
"client",
"credentials",
"is",
"valid",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/ClientCredentials.php#L34-L45 |
187,947 | bshaffer/oauth2-server-bundle | Storage/ClientCredentials.php | ClientCredentials.getClientDetails | public function getClientDetails($client_id)
{
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}
return array(
'redirect_uri' => implode(' ', $client->getRedirectUri()),
... | php | public function getClientDetails($client_id)
{
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}
return array(
'redirect_uri' => implode(' ', $client->getRedirectUri()),
... | [
"public",
"function",
"getClientDetails",
"(",
"$",
"client_id",
")",
"{",
"// Get Client",
"$",
"client",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:Client'",
")",
"->",
"find",
"(",
"$",
"client_id",
")",
";",
"if",
"(",... | Get client details corresponding client_id.
OAuth says we should store request URIs for each registered client.
Implement this function to grab the stored URI for a given client id.
@param $client_id
Client identifier to be check with.
@return array
Client details. The only mandatory key in the array is "redirect_ur... | [
"Get",
"client",
"details",
"corresponding",
"client_id",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/ClientCredentials.php#L70-L84 |
187,948 | bshaffer/oauth2-server-bundle | Storage/ClientCredentials.php | ClientCredentials.checkRestrictedGrantType | public function checkRestrictedGrantType($client_id, $grant_type)
{
$client = $this->getClientDetails($client_id);
if (!$client) {
return false;
}
if (empty($client['grant_types'])) {
return true;
}
if (in_array($grant_type, $client['grant_t... | php | public function checkRestrictedGrantType($client_id, $grant_type)
{
$client = $this->getClientDetails($client_id);
if (!$client) {
return false;
}
if (empty($client['grant_types'])) {
return true;
}
if (in_array($grant_type, $client['grant_t... | [
"public",
"function",
"checkRestrictedGrantType",
"(",
"$",
"client_id",
",",
"$",
"grant_type",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"getClientDetails",
"(",
"$",
"client_id",
")",
";",
"if",
"(",
"!",
"$",
"client",
")",
"{",
"return",
"fal... | Check restricted grant types of corresponding client identifier.
If you want to restrict clients to certain grant types, override this
function.
@param $client_id
Client identifier to be check with.
@param $grant_type
Grant type to be check with
@return
TRUE if the grant type is supported by this client identifier, ... | [
"Check",
"restricted",
"grant",
"types",
"of",
"corresponding",
"client",
"identifier",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/ClientCredentials.php#L103-L120 |
187,949 | bshaffer/oauth2-server-bundle | Storage/ClientCredentials.php | ClientCredentials.isPublicClient | public function isPublicClient($client_id)
{
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}
$secret = $client->getClientSecret();
return empty($secret);
} | php | public function isPublicClient($client_id)
{
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}
$secret = $client->getClientSecret();
return empty($secret);
} | [
"public",
"function",
"isPublicClient",
"(",
"$",
"client_id",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:Client'",
")",
"->",
"find",
"(",
"$",
"client_id",
")",
";",
"if",
"(",
"!",
"$",
"cli... | Determine if the client is a "public" client, and therefore
does not require passing credentials for certain grant types
@param $client_id
Client identifier to be check with.
@return
TRUE if the client is public, and FALSE if it isn't.
@endcode
@see http://tools.ietf.org/html/rfc6749#section-2.3
@see https://github.... | [
"Determine",
"if",
"the",
"client",
"is",
"a",
"public",
"client",
"and",
"therefore",
"does",
"not",
"require",
"passing",
"credentials",
"for",
"certain",
"grant",
"types"
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/ClientCredentials.php#L138-L149 |
187,950 | bshaffer/oauth2-server-bundle | Storage/ClientCredentials.php | ClientCredentials.getClientScope | public function getClientScope($client_id)
{
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}
return implode(' ', $client->getScopes());
} | php | public function getClientScope($client_id)
{
// Get Client
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return false;
}
return implode(' ', $client->getScopes());
} | [
"public",
"function",
"getClientScope",
"(",
"$",
"client_id",
")",
"{",
"// Get Client",
"$",
"client",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:Client'",
")",
"->",
"find",
"(",
"$",
"client_id",
")",
";",
"if",
"(",
... | Get the scope associated with this client
@return
STRING the space-delineated scope list for the specified client_id | [
"Get",
"the",
"scope",
"associated",
"with",
"this",
"client"
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/ClientCredentials.php#L157-L167 |
187,951 | bshaffer/oauth2-server-bundle | Manager/ScopeManager.php | ScopeManager.createScope | public function createScope($scope, $description = null)
{
if ($scopeObject = $this->findScopeByScope($scope)) {
return $scopeObject;
}
$scopeObject = new \OAuth2\ServerBundle\Entity\Scope();
$scopeObject->setScope($scope);
$scopeObject->setDescription($description... | php | public function createScope($scope, $description = null)
{
if ($scopeObject = $this->findScopeByScope($scope)) {
return $scopeObject;
}
$scopeObject = new \OAuth2\ServerBundle\Entity\Scope();
$scopeObject->setScope($scope);
$scopeObject->setDescription($description... | [
"public",
"function",
"createScope",
"(",
"$",
"scope",
",",
"$",
"description",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"scopeObject",
"=",
"$",
"this",
"->",
"findScopeByScope",
"(",
"$",
"scope",
")",
")",
"{",
"return",
"$",
"scopeObject",
";",
"}",... | Creates a new scope
@param string $scope
@param string $description
@return Scope | [
"Creates",
"a",
"new",
"scope"
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Manager/ScopeManager.php#L25-L40 |
187,952 | bshaffer/oauth2-server-bundle | Manager/ScopeManager.php | ScopeManager.findScopesByScopes | public function findScopesByScopes(array $scopes)
{
$scopeObjects = $this->em->getRepository('OAuth2ServerBundle:Scope')
->createQueryBuilder('a')
->where('a.scope in (?1)')
->setParameter(1, $scopes)
->getQuery()->getResult();
return $scopeObjects;
... | php | public function findScopesByScopes(array $scopes)
{
$scopeObjects = $this->em->getRepository('OAuth2ServerBundle:Scope')
->createQueryBuilder('a')
->where('a.scope in (?1)')
->setParameter(1, $scopes)
->getQuery()->getResult();
return $scopeObjects;
... | [
"public",
"function",
"findScopesByScopes",
"(",
"array",
"$",
"scopes",
")",
"{",
"$",
"scopeObjects",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:Scope'",
")",
"->",
"createQueryBuilder",
"(",
"'a'",
")",
"->",
"where",
"("... | Find all the scopes by an array of scopes
@param array $scopes
@return mixed|void | [
"Find",
"all",
"the",
"scopes",
"by",
"an",
"array",
"of",
"scopes"
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Manager/ScopeManager.php#L61-L70 |
187,953 | bshaffer/oauth2-server-bundle | Manager/ClientManager.php | ClientManager.createClient | public function createClient($identifier, array $redirect_uris = array(), array $grant_types = array(), array $scopes = array())
{
$client = new \OAuth2\ServerBundle\Entity\Client();
$client->setClientId($identifier);
$client->setClientSecret($this->generateSecret());
$client->setRed... | php | public function createClient($identifier, array $redirect_uris = array(), array $grant_types = array(), array $scopes = array())
{
$client = new \OAuth2\ServerBundle\Entity\Client();
$client->setClientId($identifier);
$client->setClientSecret($this->generateSecret());
$client->setRed... | [
"public",
"function",
"createClient",
"(",
"$",
"identifier",
",",
"array",
"$",
"redirect_uris",
"=",
"array",
"(",
")",
",",
"array",
"$",
"grant_types",
"=",
"array",
"(",
")",
",",
"array",
"$",
"scopes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"c... | Creates a new client
@param string $identifier
@param array $redirect_uris
@param array $grant_type
@param array $scopes
@return Client | [
"Creates",
"a",
"new",
"client"
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Manager/ClientManager.php#L36-L60 |
187,954 | bshaffer/oauth2-server-bundle | Storage/AuthorizationCode.php | AuthorizationCode.setAuthorizationCode | public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null)
{
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) throw new \Exception('Unknown client identifier');
$authorizationCode = new \OAuth2\S... | php | public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null)
{
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) throw new \Exception('Unknown client identifier');
$authorizationCode = new \OAuth2\S... | [
"public",
"function",
"setAuthorizationCode",
"(",
"$",
"code",
",",
"$",
"client_id",
",",
"$",
"user_id",
",",
"$",
"redirect_uri",
",",
"$",
"expires",
",",
"$",
"scope",
"=",
"null",
")",
"{",
"$",
"client",
"=",
"$",
"this",
"->",
"em",
"->",
"g... | Take the provided authorization code values and store them somewhere.
This function should be the storage counterpart to getAuthCode().
If storage fails for some reason, we're not currently checking for
any sort of success/failure, so you should bail out of the script
and provide a descriptive fail message.
Required... | [
"Take",
"the",
"provided",
"authorization",
"code",
"values",
"and",
"store",
"them",
"somewhere",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/AuthorizationCode.php#L88-L104 |
187,955 | bshaffer/oauth2-server-bundle | Storage/AuthorizationCode.php | AuthorizationCode.expireAuthorizationCode | public function expireAuthorizationCode($code)
{
$code = $this->em->getRepository('OAuth2ServerBundle:AuthorizationCode')->find($code);
$this->em->remove($code);
$this->em->flush();
} | php | public function expireAuthorizationCode($code)
{
$code = $this->em->getRepository('OAuth2ServerBundle:AuthorizationCode')->find($code);
$this->em->remove($code);
$this->em->flush();
} | [
"public",
"function",
"expireAuthorizationCode",
"(",
"$",
"code",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:AuthorizationCode'",
")",
"->",
"find",
"(",
"$",
"code",
")",
";",
"$",
"this",
"->",
... | once an Authorization Code is used, it must be exipired
@see http://tools.ietf.org/html/rfc6749#section-4.1.2
The client MUST NOT use the authorization code
more than once. If an authorization code is used more than
once, the authorization server MUST deny the request and SHOULD
revoke (when possible) all tokens pre... | [
"once",
"an",
"Authorization",
"Code",
"is",
"used",
"it",
"must",
"be",
"exipired"
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/AuthorizationCode.php#L118-L123 |
187,956 | bshaffer/oauth2-server-bundle | Storage/RefreshToken.php | RefreshToken.getRefreshToken | public function getRefreshToken($refresh_token)
{
$refreshToken = $this->em->getRepository('OAuth2ServerBundle:RefreshToken')->find($refresh_token);
if (!$refreshToken) {
return null;
}
// Get Client
$client = $refreshToken->getClient();
return array(
... | php | public function getRefreshToken($refresh_token)
{
$refreshToken = $this->em->getRepository('OAuth2ServerBundle:RefreshToken')->find($refresh_token);
if (!$refreshToken) {
return null;
}
// Get Client
$client = $refreshToken->getClient();
return array(
... | [
"public",
"function",
"getRefreshToken",
"(",
"$",
"refresh_token",
")",
"{",
"$",
"refreshToken",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:RefreshToken'",
")",
"->",
"find",
"(",
"$",
"refresh_token",
")",
";",
"if",
"(",... | Grant refresh access tokens.
Retrieve the stored data for the given refresh token.
Required for OAuth2::GRANT_TYPE_REFRESH_TOKEN.
@param $refresh_token
Refresh token to be check with.
@return
An associative array as below, and NULL if the refresh_token is
invalid:
- refresh_token: Stored refresh token identifier.
-... | [
"Grant",
"refresh",
"access",
"tokens",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/RefreshToken.php#L40-L58 |
187,957 | bshaffer/oauth2-server-bundle | Storage/RefreshToken.php | RefreshToken.setRefreshToken | public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = null)
{
// Get Client Entity
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return null;
}
// Create Refresh Token
... | php | public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = null)
{
// Get Client Entity
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return null;
}
// Create Refresh Token
... | [
"public",
"function",
"setRefreshToken",
"(",
"$",
"refresh_token",
",",
"$",
"client_id",
",",
"$",
"user_id",
",",
"$",
"expires",
",",
"$",
"scope",
"=",
"null",
")",
"{",
"// Get Client Entity",
"$",
"client",
"=",
"$",
"this",
"->",
"em",
"->",
"get... | Take the provided refresh token values and store them somewhere.
This function should be the storage counterpart to getRefreshToken().
If storage fails for some reason, we're not currently checking for
any sort of success/failure, so you should bail out of the script
and provide a descriptive fail message.
Required ... | [
"Take",
"the",
"provided",
"refresh",
"token",
"values",
"and",
"store",
"them",
"somewhere",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/RefreshToken.php#L84-L103 |
187,958 | bshaffer/oauth2-server-bundle | Storage/RefreshToken.php | RefreshToken.unsetRefreshToken | public function unsetRefreshToken($refresh_token)
{
$refreshToken = $this->em->getRepository('OAuth2ServerBundle:RefreshToken')->find($refresh_token);
$this->em->remove($refreshToken);
$this->em->flush();
} | php | public function unsetRefreshToken($refresh_token)
{
$refreshToken = $this->em->getRepository('OAuth2ServerBundle:RefreshToken')->find($refresh_token);
$this->em->remove($refreshToken);
$this->em->flush();
} | [
"public",
"function",
"unsetRefreshToken",
"(",
"$",
"refresh_token",
")",
"{",
"$",
"refreshToken",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:RefreshToken'",
")",
"->",
"find",
"(",
"$",
"refresh_token",
")",
";",
"$",
"th... | Expire a used refresh token.
This is not explicitly required in the spec, but is almost implied.
After granting a new refresh token, the old one is no longer useful and
so should be forcibly expired in the data store so it can't be used again.
If storage fails for some reason, we're not currently checking for
any sor... | [
"Expire",
"a",
"used",
"refresh",
"token",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/RefreshToken.php#L121-L126 |
187,959 | bshaffer/oauth2-server-bundle | Controller/VerifyController.php | VerifyController.verifyAction | public function verifyAction()
{
$server = $this->get('oauth2.server');
if (!$server->verifyResourceRequest($this->get('oauth2.request'), $this->get('oauth2.response'))) {
return $server->getResponse();
}
$tokenData = $server->getAccessTokenData($this->get('oauth2.reque... | php | public function verifyAction()
{
$server = $this->get('oauth2.server');
if (!$server->verifyResourceRequest($this->get('oauth2.request'), $this->get('oauth2.response'))) {
return $server->getResponse();
}
$tokenData = $server->getAccessTokenData($this->get('oauth2.reque... | [
"public",
"function",
"verifyAction",
"(",
")",
"{",
"$",
"server",
"=",
"$",
"this",
"->",
"get",
"(",
"'oauth2.server'",
")",
";",
"if",
"(",
"!",
"$",
"server",
"->",
"verifyResourceRequest",
"(",
"$",
"this",
"->",
"get",
"(",
"'oauth2.request'",
")"... | This is called with an access token, details
about the access token are then returned.
Used for verification purposes.
@Route("/verify", name="_verify_token") | [
"This",
"is",
"called",
"with",
"an",
"access",
"token",
"details",
"about",
"the",
"access",
"token",
"are",
"then",
"returned",
".",
"Used",
"for",
"verification",
"purposes",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Controller/VerifyController.php#L18-L29 |
187,960 | bshaffer/oauth2-server-bundle | Storage/AccessToken.php | AccessToken.getAccessToken | public function getAccessToken($oauth_token)
{
$accessToken = $this->em->getRepository('OAuth2ServerBundle:AccessToken')->find($oauth_token);
if (!$accessToken) {
return null;
}
// Get Client
$client = $accessToken->getClient();
return array(
... | php | public function getAccessToken($oauth_token)
{
$accessToken = $this->em->getRepository('OAuth2ServerBundle:AccessToken')->find($oauth_token);
if (!$accessToken) {
return null;
}
// Get Client
$client = $accessToken->getClient();
return array(
... | [
"public",
"function",
"getAccessToken",
"(",
"$",
"oauth_token",
")",
"{",
"$",
"accessToken",
"=",
"$",
"this",
"->",
"em",
"->",
"getRepository",
"(",
"'OAuth2ServerBundle:AccessToken'",
")",
"->",
"find",
"(",
"$",
"oauth_token",
")",
";",
"if",
"(",
"!",... | Look up the supplied oauth_token from storage.
We need to retrieve access token data as we create and verify tokens.
@param $oauth_token
oauth_token to be check with.
@return
An associative array as below, and return NULL if the supplied oauth_token
is invalid:
- client_id: Stored client identifier.
- expires: Store... | [
"Look",
"up",
"the",
"supplied",
"oauth_token",
"from",
"storage",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/AccessToken.php#L35-L52 |
187,961 | bshaffer/oauth2-server-bundle | Storage/AccessToken.php | AccessToken.setAccessToken | public function setAccessToken($oauth_token, $client_id, $user_id, $expires, $scope = null)
{
// Get Client Entity
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return null;
}
// Create Access Token
$a... | php | public function setAccessToken($oauth_token, $client_id, $user_id, $expires, $scope = null)
{
// Get Client Entity
$client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);
if (!$client) {
return null;
}
// Create Access Token
$a... | [
"public",
"function",
"setAccessToken",
"(",
"$",
"oauth_token",
",",
"$",
"client_id",
",",
"$",
"user_id",
",",
"$",
"expires",
",",
"$",
"scope",
"=",
"null",
")",
"{",
"// Get Client Entity",
"$",
"client",
"=",
"$",
"this",
"->",
"em",
"->",
"getRep... | Store the supplied access token values to storage.
We need to store access token data as we create and verify tokens.
@param $oauth_token
oauth_token to be stored.
@param $client_id
Client identifier to be stored.
@param $user_id
User identifier to be stored.
@param int $expires
Expiration to be stored as a Unix t... | [
"Store",
"the",
"supplied",
"access",
"token",
"values",
"to",
"storage",
"."
] | bb951b7606a44afbb29d0123a72e1f8bb54efc74 | https://github.com/bshaffer/oauth2-server-bundle/blob/bb951b7606a44afbb29d0123a72e1f8bb54efc74/Storage/AccessToken.php#L72-L92 |
187,962 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.getRoute | public function getRoute(string $routeKey, array $params = []): string
{
$this->checkRouteIsDefined($routeKey);
return route(
$this->getAttribute('routes')[$routeKey]['alias'],
array_merge($this->getAttribute('routes')[$routeKey]['parameters'], $params)
);
} | php | public function getRoute(string $routeKey, array $params = []): string
{
$this->checkRouteIsDefined($routeKey);
return route(
$this->getAttribute('routes')[$routeKey]['alias'],
array_merge($this->getAttribute('routes')[$routeKey]['parameters'], $params)
);
} | [
"public",
"function",
"getRoute",
"(",
"string",
"$",
"routeKey",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"this",
"->",
"checkRouteIsDefined",
"(",
"$",
"routeKey",
")",
";",
"return",
"route",
"(",
"$",
"this",
"->",
... | Get the route from its key.
@param string $routeKey
@param array $params
@return string | [
"Get",
"the",
"route",
"from",
"its",
"key",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L237-L245 |
187,963 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.navigationStatus | public function navigationStatus(): string
{
return trans('tablelist::tablelist.tfoot.nav', [
'start' => ($this->getAttribute('list')->perPage()
* ($this->getAttribute('list')->currentPage() - 1))
+ 1,
'stop' => $this->getAttribute('lis... | php | public function navigationStatus(): string
{
return trans('tablelist::tablelist.tfoot.nav', [
'start' => ($this->getAttribute('list')->perPage()
* ($this->getAttribute('list')->currentPage() - 1))
+ 1,
'stop' => $this->getAttribute('lis... | [
"public",
"function",
"navigationStatus",
"(",
")",
":",
"string",
"{",
"return",
"trans",
"(",
"'tablelist::tablelist.tfoot.nav'",
",",
"[",
"'start'",
"=>",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"'list'",
")",
"->",
"perPage",
"(",
")",
"*",
"(",
... | Get the navigation status from the table list.
@return string | [
"Get",
"the",
"navigation",
"status",
"from",
"the",
"table",
"list",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L252-L263 |
187,964 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.render | public function render(): string
{
$this->checkRoutesValidity($this->getAttribute('routes'));
$this->checkIfAtLeastOneColumnIsDeclared();
$this->checkDestroyAttributesDefinition();
$this->handleRequest();
$this->generateEntitiesListFromQuery();
return view('tablelist... | php | public function render(): string
{
$this->checkRoutesValidity($this->getAttribute('routes'));
$this->checkIfAtLeastOneColumnIsDeclared();
$this->checkDestroyAttributesDefinition();
$this->handleRequest();
$this->generateEntitiesListFromQuery();
return view('tablelist... | [
"public",
"function",
"render",
"(",
")",
":",
"string",
"{",
"$",
"this",
"->",
"checkRoutesValidity",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"'routes'",
")",
")",
";",
"$",
"this",
"->",
"checkIfAtLeastOneColumnIsDeclared",
"(",
")",
";",
"$",
"thi... | Generate the table list html.
@return string
@throws ErrorException | [
"Generate",
"the",
"table",
"list",
"html",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L282-L291 |
187,965 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.handleRequest | protected function handleRequest(): void
{
$validator = Validator::make(
$this->getAttribute('request')->only('rowsNumber', 'search', 'sortBy', 'sortDir'),
[
'rowsNumber' => 'required|numeric',
'search' => 'nullable|string',
'sortBy... | php | protected function handleRequest(): void
{
$validator = Validator::make(
$this->getAttribute('request')->only('rowsNumber', 'search', 'sortBy', 'sortDir'),
[
'rowsNumber' => 'required|numeric',
'search' => 'nullable|string',
'sortBy... | [
"protected",
"function",
"handleRequest",
"(",
")",
":",
"void",
"{",
"$",
"validator",
"=",
"Validator",
"::",
"make",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"'request'",
")",
"->",
"only",
"(",
"'rowsNumber'",
",",
"'search'",
",",
"'sortBy'",
",",... | Handle the request treatments.
@return void | [
"Handle",
"the",
"request",
"treatments",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L298-L322 |
187,966 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.generateEntitiesListFromQuery | protected function generateEntitiesListFromQuery(): void
{
$query = $this->getAttribute('tableModel')->query();
$this->applyQueryClosure($query);
$this->checkColumnsValidity();
$this->applySearchClauses($query);
$this->applySortClauses($query);
$this->paginateList($qu... | php | protected function generateEntitiesListFromQuery(): void
{
$query = $this->getAttribute('tableModel')->query();
$this->applyQueryClosure($query);
$this->checkColumnsValidity();
$this->applySearchClauses($query);
$this->applySortClauses($query);
$this->paginateList($qu... | [
"protected",
"function",
"generateEntitiesListFromQuery",
"(",
")",
":",
"void",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'tableModel'",
")",
"->",
"query",
"(",
")",
";",
"$",
"this",
"->",
"applyQueryClosure",
"(",
"$",
"query",
"... | Generate the entities list.
@return void | [
"Generate",
"the",
"entities",
"list",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L329-L338 |
187,967 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.applySearchClauses | protected function applySearchClauses(Builder $query): void
{
if ($searched = $this->getAttribute('request')->search) {
$this->getAttribute('searchableColumns')
->map(function (TableListColumn $column, int $key) use (&$query, $searched) {
$table = $column->get... | php | protected function applySearchClauses(Builder $query): void
{
if ($searched = $this->getAttribute('request')->search) {
$this->getAttribute('searchableColumns')
->map(function (TableListColumn $column, int $key) use (&$query, $searched) {
$table = $column->get... | [
"protected",
"function",
"applySearchClauses",
"(",
"Builder",
"$",
"query",
")",
":",
"void",
"{",
"if",
"(",
"$",
"searched",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'request'",
")",
"->",
"search",
")",
"{",
"$",
"this",
"->",
"getAttribute",
"(... | Apply search clauses
@param \Illuminate\Database\Eloquent\Builder $query
@return void | [
"Apply",
"search",
"clauses"
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L361-L377 |
187,968 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.applySortClauses | protected function applySortClauses(Builder $query): void
{
$sortBy = $this->getAttribute('request')->get('sortBy', $this->getAttribute('sortBy'));
$sortDir = $this->getAttribute('request')->get('sortDir', $this->getAttribute('sortDir'));
if ($sortBy && $sortDir) {
$query->orderB... | php | protected function applySortClauses(Builder $query): void
{
$sortBy = $this->getAttribute('request')->get('sortBy', $this->getAttribute('sortBy'));
$sortDir = $this->getAttribute('request')->get('sortDir', $this->getAttribute('sortDir'));
if ($sortBy && $sortDir) {
$query->orderB... | [
"protected",
"function",
"applySortClauses",
"(",
"Builder",
"$",
"query",
")",
":",
"void",
"{",
"$",
"sortBy",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'request'",
")",
"->",
"get",
"(",
"'sortBy'",
",",
"$",
"this",
"->",
"getAttribute",
"(",
"'s... | Apply sort clauses.
@param \Illuminate\Database\Eloquent\Builder $query
@return void | [
"Apply",
"sort",
"clauses",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L386-L395 |
187,969 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.paginateList | protected function paginateList(Builder $query): void
{
$this->setAttribute('list', $query->paginate($this->getAttribute('rowsNumber')));
$this->getAttribute('list')->appends([
'rowsNumber' => $this->getAttribute('rowsNumber'),
'search' => $this->getAttribute('search'),
... | php | protected function paginateList(Builder $query): void
{
$this->setAttribute('list', $query->paginate($this->getAttribute('rowsNumber')));
$this->getAttribute('list')->appends([
'rowsNumber' => $this->getAttribute('rowsNumber'),
'search' => $this->getAttribute('search'),
... | [
"protected",
"function",
"paginateList",
"(",
"Builder",
"$",
"query",
")",
":",
"void",
"{",
"$",
"this",
"->",
"setAttribute",
"(",
"'list'",
",",
"$",
"query",
"->",
"paginate",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"'rowsNumber'",
")",
")",
")... | Paginate the list from the query.
@param \Illuminate\Database\Eloquent\Builder $query
@return void | [
"Paginate",
"the",
"list",
"from",
"the",
"query",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L404-L413 |
187,970 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.applyClosuresOnPaginatedList | protected function applyClosuresOnPaginatedList(): void
{
$disableLinesClosure = $this->getAttribute('disableLinesClosure');
$highlightLinesClosure = $this->getAttribute('highlightLinesClosure');
$this->getAttribute('list')->getCollection()->transform(function ($model) use (
$dis... | php | protected function applyClosuresOnPaginatedList(): void
{
$disableLinesClosure = $this->getAttribute('disableLinesClosure');
$highlightLinesClosure = $this->getAttribute('highlightLinesClosure');
$this->getAttribute('list')->getCollection()->transform(function ($model) use (
$dis... | [
"protected",
"function",
"applyClosuresOnPaginatedList",
"(",
")",
":",
"void",
"{",
"$",
"disableLinesClosure",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'disableLinesClosure'",
")",
";",
"$",
"highlightLinesClosure",
"=",
"$",
"this",
"->",
"getAttribute",
"... | Apply the closures on the paginated list.
@return void | [
"Apply",
"the",
"closures",
"on",
"the",
"paginated",
"list",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L420-L437 |
187,971 | Okipa/laravel-bootstrap-table-list | src/TableList.php | TableList.isRouteDefined | public function isRouteDefined(string $routeKey): bool
{
return (isset($this->getAttribute('routes')[$routeKey]) || ! empty($this->getAttribute('routes')[$routeKey]));
} | php | public function isRouteDefined(string $routeKey): bool
{
return (isset($this->getAttribute('routes')[$routeKey]) || ! empty($this->getAttribute('routes')[$routeKey]));
} | [
"public",
"function",
"isRouteDefined",
"(",
"string",
"$",
"routeKey",
")",
":",
"bool",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"'routes'",
")",
"[",
"$",
"routeKey",
"]",
")",
"||",
"!",
"empty",
"(",
"$",
"this",
... | Check if a route is defined from its key.
@param string $routeKey
@return bool | [
"Check",
"if",
"a",
"route",
"is",
"defined",
"from",
"its",
"key",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/TableList.php#L446-L449 |
187,972 | Okipa/laravel-bootstrap-table-list | src/Traits/RoutesValidationChecks.php | RoutesValidationChecks.checkRoutesValidity | protected function checkRoutesValidity(array $routes): void
{
$requiredRouteKeys = ['index'];
$optionalRouteKeys = ['create', 'edit', 'destroy'];
$allowedRouteKeys = array_merge($requiredRouteKeys, $optionalRouteKeys);
$this->checkRequiredRoutesValidity($routes, $requiredRouteKeys);
... | php | protected function checkRoutesValidity(array $routes): void
{
$requiredRouteKeys = ['index'];
$optionalRouteKeys = ['create', 'edit', 'destroy'];
$allowedRouteKeys = array_merge($requiredRouteKeys, $optionalRouteKeys);
$this->checkRequiredRoutesValidity($routes, $requiredRouteKeys);
... | [
"protected",
"function",
"checkRoutesValidity",
"(",
"array",
"$",
"routes",
")",
":",
"void",
"{",
"$",
"requiredRouteKeys",
"=",
"[",
"'index'",
"]",
";",
"$",
"optionalRouteKeys",
"=",
"[",
"'create'",
",",
"'edit'",
",",
"'destroy'",
"]",
";",
"$",
"al... | Check routes validity.
@param array $routes
@return void
@throws \ErrorException | [
"Check",
"routes",
"validity",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/Traits/RoutesValidationChecks.php#L27-L35 |
187,973 | Okipa/laravel-bootstrap-table-list | src/Traits/RoutesValidationChecks.php | RoutesValidationChecks.checkRequiredRoutesValidity | protected function checkRequiredRoutesValidity(array $routes, array $requiredRouteKeys): void
{
$routeKeys = array_keys($routes);
foreach ($requiredRouteKeys as $requiredRouteKey) {
if (! in_array($requiredRouteKey, $routeKeys)) {
throw new ErrorException(
... | php | protected function checkRequiredRoutesValidity(array $routes, array $requiredRouteKeys): void
{
$routeKeys = array_keys($routes);
foreach ($requiredRouteKeys as $requiredRouteKey) {
if (! in_array($requiredRouteKey, $routeKeys)) {
throw new ErrorException(
... | [
"protected",
"function",
"checkRequiredRoutesValidity",
"(",
"array",
"$",
"routes",
",",
"array",
"$",
"requiredRouteKeys",
")",
":",
"void",
"{",
"$",
"routeKeys",
"=",
"array_keys",
"(",
"$",
"routes",
")",
";",
"foreach",
"(",
"$",
"requiredRouteKeys",
"as... | Check required routes validity.
@param array $routes
@param array $requiredRouteKeys
@return void
@throws \ErrorException | [
"Check",
"required",
"routes",
"validity",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/Traits/RoutesValidationChecks.php#L46-L57 |
187,974 | Okipa/laravel-bootstrap-table-list | src/Traits/RoutesValidationChecks.php | RoutesValidationChecks.checkRoutesStructureValidity | protected function checkRoutesStructureValidity(array $routes): void
{
$requiredRouteParams = ['alias', 'parameters'];
foreach ($routes as $routeKey => $route) {
foreach ($requiredRouteParams as $requiredRouteParam) {
if (! in_array($requiredRouteParam, array_keys($route)... | php | protected function checkRoutesStructureValidity(array $routes): void
{
$requiredRouteParams = ['alias', 'parameters'];
foreach ($routes as $routeKey => $route) {
foreach ($requiredRouteParams as $requiredRouteParam) {
if (! in_array($requiredRouteParam, array_keys($route)... | [
"protected",
"function",
"checkRoutesStructureValidity",
"(",
"array",
"$",
"routes",
")",
":",
"void",
"{",
"$",
"requiredRouteParams",
"=",
"[",
"'alias'",
",",
"'parameters'",
"]",
";",
"foreach",
"(",
"$",
"routes",
"as",
"$",
"routeKey",
"=>",
"$",
"rou... | Check routes structure validity.
@param array $routes
@return void
@throws \ErrorException | [
"Check",
"routes",
"structure",
"validity",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/Traits/RoutesValidationChecks.php#L88-L104 |
187,975 | Okipa/laravel-bootstrap-table-list | src/Traits/ColumnsValidationChecks.php | ColumnsValidationChecks.checkColumnsValidity | protected function checkColumnsValidity(): void
{
$this->getAttribute('columns')->map(function (TableListColumn $column) {
$this->checkSortableColumnHasAttribute($column);
$isSearchable = in_array(
$column->getAttribute('attribute'),
$this->getAttribut... | php | protected function checkColumnsValidity(): void
{
$this->getAttribute('columns')->map(function (TableListColumn $column) {
$this->checkSortableColumnHasAttribute($column);
$isSearchable = in_array(
$column->getAttribute('attribute'),
$this->getAttribut... | [
"protected",
"function",
"checkColumnsValidity",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"getAttribute",
"(",
"'columns'",
")",
"->",
"map",
"(",
"function",
"(",
"TableListColumn",
"$",
"column",
")",
"{",
"$",
"this",
"->",
"checkSortableColumnHasAttr... | Check the columns validity.
@return void | [
"Check",
"the",
"columns",
"validity",
"."
] | 4701b0e738b4f047a5003033f9998d9585b42c5d | https://github.com/Okipa/laravel-bootstrap-table-list/blob/4701b0e738b4f047a5003033f9998d9585b42c5d/src/Traits/ColumnsValidationChecks.php#L50-L63 |
187,976 | CircleOfNice/CiRestClientBundle | Services/Curl.php | Curl.createResponse | private function createResponse($content, $headers, \stdClass $curlMetaData) {
$response = new Response();
$response->setContent($content);
$response->headers->add($headers);
$response->setStatusCode($curlMetaData->http_code);
return $response;
} | php | private function createResponse($content, $headers, \stdClass $curlMetaData) {
$response = new Response();
$response->setContent($content);
$response->headers->add($headers);
$response->setStatusCode($curlMetaData->http_code);
return $response;
} | [
"private",
"function",
"createResponse",
"(",
"$",
"content",
",",
"$",
"headers",
",",
"\\",
"stdClass",
"$",
"curlMetaData",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"response",
"->",
"setContent",
"(",
"$",
"content",
")"... | Maps the curl response to a Symfony response
@SuppressWarnings("PHPMD.StaticAccess");
@param string $content
@param array $headers
@param \stdClass $curlMetaData
@return Response | [
"Maps",
"the",
"curl",
"response",
"to",
"a",
"Symfony",
"response"
] | f1d01e9eaf0f1d48a0f2dad470680a747e13d462 | https://github.com/CircleOfNice/CiRestClientBundle/blob/f1d01e9eaf0f1d48a0f2dad470680a747e13d462/Services/Curl.php#L137-L144 |
187,977 | CircleOfNice/CiRestClientBundle | Services/Curl.php | Curl.getError | private function getError() {
if (!curl_errno($this->curl)) return array();
return array('error_no' => curl_errno($this->curl), 'error' => curl_error($this->curl));
} | php | private function getError() {
if (!curl_errno($this->curl)) return array();
return array('error_no' => curl_errno($this->curl), 'error' => curl_error($this->curl));
} | [
"private",
"function",
"getError",
"(",
")",
"{",
"if",
"(",
"!",
"curl_errno",
"(",
"$",
"this",
"->",
"curl",
")",
")",
"return",
"array",
"(",
")",
";",
"return",
"array",
"(",
"'error_no'",
"=>",
"curl_errno",
"(",
"$",
"this",
"->",
"curl",
")",... | Returns the errors
@return array | [
"Returns",
"the",
"errors"
] | f1d01e9eaf0f1d48a0f2dad470680a747e13d462 | https://github.com/CircleOfNice/CiRestClientBundle/blob/f1d01e9eaf0f1d48a0f2dad470680a747e13d462/Services/Curl.php#L194-L197 |
187,978 | CircleOfNice/CiRestClientBundle | Parsers/HTTPHeadersParser.php | HTTPHeadersParser.parse | public static function parse($headers) {
$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $headers));
if(empty($fields)) return [];
return array_reduce($fields, function($carry, $field) {
$match = [];
if (!preg_match('/([^:]+): (.+)/m', $field, $match)) r... | php | public static function parse($headers) {
$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $headers));
if(empty($fields)) return [];
return array_reduce($fields, function($carry, $field) {
$match = [];
if (!preg_match('/([^:]+): (.+)/m', $field, $match)) r... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"headers",
")",
"{",
"$",
"fields",
"=",
"explode",
"(",
"\"\\r\\n\"",
",",
"preg_replace",
"(",
"'/\\x0D\\x0A[\\x09\\x20]+/'",
",",
"' '",
",",
"$",
"headers",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$... | Parse Http Headers in array
@param string $headers
@return array | [
"Parse",
"Http",
"Headers",
"in",
"array"
] | f1d01e9eaf0f1d48a0f2dad470680a747e13d462 | https://github.com/CircleOfNice/CiRestClientBundle/blob/f1d01e9eaf0f1d48a0f2dad470680a747e13d462/Parsers/HTTPHeadersParser.php#L35-L62 |
187,979 | CircleOfNice/CiRestClientBundle | Services/CurlOptionsHandler.php | CurlOptionsHandler.validateOptions | private function validateOptions(array $options) {
foreach ($options as $key => $value) {
if (!is_int($key)) return $this->invalidArgumentException('Error while setting a curl option (http://php.net/manual/de/function.curl-setopt.php). Tried to set ' . $key . ' on curl resource.');
}
... | php | private function validateOptions(array $options) {
foreach ($options as $key => $value) {
if (!is_int($key)) return $this->invalidArgumentException('Error while setting a curl option (http://php.net/manual/de/function.curl-setopt.php). Tried to set ' . $key . ' on curl resource.');
}
... | [
"private",
"function",
"validateOptions",
"(",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"key",
")",
")",
"return",
"$",
"this",
"->",
"inv... | validates the given options
@param array $options
@return $this | [
"validates",
"the",
"given",
"options"
] | f1d01e9eaf0f1d48a0f2dad470680a747e13d462 | https://github.com/CircleOfNice/CiRestClientBundle/blob/f1d01e9eaf0f1d48a0f2dad470680a747e13d462/Services/CurlOptionsHandler.php#L92-L97 |
187,980 | CircleOfNice/CiRestClientBundle | Traits/Exceptions.php | Exceptions.curlException | private function curlException($message, $code) {
if (!array_key_exists($code, $this->getExceptionCodeMappings())) throw new CurlExceptions\CurlException("Error: {$message} and the Error no is: {$code} ", $code);
$exceptionClass = $this->exceptionsNamespace . '\\' . $this->getExceptionCodeMappings()[$c... | php | private function curlException($message, $code) {
if (!array_key_exists($code, $this->getExceptionCodeMappings())) throw new CurlExceptions\CurlException("Error: {$message} and the Error no is: {$code} ", $code);
$exceptionClass = $this->exceptionsNamespace . '\\' . $this->getExceptionCodeMappings()[$c... | [
"private",
"function",
"curlException",
"(",
"$",
"message",
",",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"code",
",",
"$",
"this",
"->",
"getExceptionCodeMappings",
"(",
")",
")",
")",
"throw",
"new",
"CurlExceptions",
"\\",
... | throws a curl exception
@param string $message
@param int $code
@throws CurlExceptions\CurlException | \RuntimeException | [
"throws",
"a",
"curl",
"exception"
] | f1d01e9eaf0f1d48a0f2dad470680a747e13d462 | https://github.com/CircleOfNice/CiRestClientBundle/blob/f1d01e9eaf0f1d48a0f2dad470680a747e13d462/Traits/Exceptions.php#L131-L140 |
187,981 | CircleOfNice/CiRestClientBundle | Types/ResponseHeaders.php | ResponseHeaders.create | public static function create($curlResponse, $headerSize) {
$headers = substr($curlResponse, 0, $headerSize);
return function_exists('http_parse_headers') ? http_parse_headers($headers) : HTTPHeadersParser::parse($headers);
} | php | public static function create($curlResponse, $headerSize) {
$headers = substr($curlResponse, 0, $headerSize);
return function_exists('http_parse_headers') ? http_parse_headers($headers) : HTTPHeadersParser::parse($headers);
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"curlResponse",
",",
"$",
"headerSize",
")",
"{",
"$",
"headers",
"=",
"substr",
"(",
"$",
"curlResponse",
",",
"0",
",",
"$",
"headerSize",
")",
";",
"return",
"function_exists",
"(",
"'http_parse_headers'... | Creates Header array from a Response string
@see https://pecl.php.net/
@param string $curlResponse
@param string $headerSize
@return array | [
"Creates",
"Header",
"array",
"from",
"a",
"Response",
"string"
] | f1d01e9eaf0f1d48a0f2dad470680a747e13d462 | https://github.com/CircleOfNice/CiRestClientBundle/blob/f1d01e9eaf0f1d48a0f2dad470680a747e13d462/Types/ResponseHeaders.php#L38-L42 |
187,982 | CircleOfNice/CiRestClientBundle | Traits/Assertions.php | Assertions.assertHttpMethod | private function assertHttpMethod($method) {
if (!$this->assertString($method)) return false;
$validHttpMethods = array(
'GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT', 'PATCH', 'LINK', 'UNLINK'
);
if (!in_array($method, $validHttpMethods)) return false... | php | private function assertHttpMethod($method) {
if (!$this->assertString($method)) return false;
$validHttpMethods = array(
'GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT', 'PATCH', 'LINK', 'UNLINK'
);
if (!in_array($method, $validHttpMethods)) return false... | [
"private",
"function",
"assertHttpMethod",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"assertString",
"(",
"$",
"method",
")",
")",
"return",
"false",
";",
"$",
"validHttpMethods",
"=",
"array",
"(",
"'GET'",
",",
"'POST'",
",",
"... | asserts a http method
@param string $method
@return $this | [
"asserts",
"a",
"http",
"method"
] | f1d01e9eaf0f1d48a0f2dad470680a747e13d462 | https://github.com/CircleOfNice/CiRestClientBundle/blob/f1d01e9eaf0f1d48a0f2dad470680a747e13d462/Traits/Assertions.php#L57-L64 |
187,983 | getsentry/symfony-amg-sentry-plugin | lib/amgSentry.class.php | amgSentry.getInstance | static public function getInstance(){
if (!isset(self::$_instance)) {
if (!sfConfig::get('app_amg_sentry_dsn')) {
throw new Exception('Please configure amgSentryPlugin in your app.yml (use model in "amgSentryPlugin/config/app.yml")');
}
self::$_instance = new amgSentry(sfConfig::get('app_amg_sentry_dsn')... | php | static public function getInstance(){
if (!isset(self::$_instance)) {
if (!sfConfig::get('app_amg_sentry_dsn')) {
throw new Exception('Please configure amgSentryPlugin in your app.yml (use model in "amgSentryPlugin/config/app.yml")');
}
self::$_instance = new amgSentry(sfConfig::get('app_amg_sentry_dsn')... | [
"static",
"public",
"function",
"getInstance",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_instance",
")",
")",
"{",
"if",
"(",
"!",
"sfConfig",
"::",
"get",
"(",
"'app_amg_sentry_dsn'",
")",
")",
"{",
"throw",
"new",
"Exception",... | Retrieves the singleton instance of this class.
@return amgSentry A amgSentry implementation instance. | [
"Retrieves",
"the",
"singleton",
"instance",
"of",
"this",
"class",
"."
] | fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78 | https://github.com/getsentry/symfony-amg-sentry-plugin/blob/fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78/lib/amgSentry.class.php#L21-L29 |
187,984 | getsentry/symfony-amg-sentry-plugin | lib/amgSentry.class.php | amgSentry.sendMessage | static public function sendMessage($title, $description = '', $level = self::INFO){
if (!sfConfig::get('app_amg_sentry_enabled', false)) {
return true;
}
return self::getInstance()->captureMessage($title, array('description' => $description), $level);
} | php | static public function sendMessage($title, $description = '', $level = self::INFO){
if (!sfConfig::get('app_amg_sentry_enabled', false)) {
return true;
}
return self::getInstance()->captureMessage($title, array('description' => $description), $level);
} | [
"static",
"public",
"function",
"sendMessage",
"(",
"$",
"title",
",",
"$",
"description",
"=",
"''",
",",
"$",
"level",
"=",
"self",
"::",
"INFO",
")",
"{",
"if",
"(",
"!",
"sfConfig",
"::",
"get",
"(",
"'app_amg_sentry_enabled'",
",",
"false",
")",
"... | Send a message to Sentry.
@param string $title Message title
@param string $description Message description
@param string $level Message level
@return integer Sentry event ID | [
"Send",
"a",
"message",
"to",
"Sentry",
"."
] | fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78 | https://github.com/getsentry/symfony-amg-sentry-plugin/blob/fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78/lib/amgSentry.class.php#L40-L45 |
187,985 | getsentry/symfony-amg-sentry-plugin | lib/amgSentry.class.php | amgSentry.sendException | static public function sendException($exception, $description = ''){
if (!sfConfig::get('app_amg_sentry_enabled', false)) {
return true;
}
return self::getInstance()->captureException($exception, $description);
} | php | static public function sendException($exception, $description = ''){
if (!sfConfig::get('app_amg_sentry_enabled', false)) {
return true;
}
return self::getInstance()->captureException($exception, $description);
} | [
"static",
"public",
"function",
"sendException",
"(",
"$",
"exception",
",",
"$",
"description",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"sfConfig",
"::",
"get",
"(",
"'app_amg_sentry_enabled'",
",",
"false",
")",
")",
"{",
"return",
"true",
";",
"}",
"retu... | Send an exception to Sentry.
@param Exception $exception Exception
@param string $description Exception description
@return integer Sentry event ID | [
"Send",
"an",
"exception",
"to",
"Sentry",
"."
] | fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78 | https://github.com/getsentry/symfony-amg-sentry-plugin/blob/fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78/lib/amgSentry.class.php#L55-L60 |
187,986 | getsentry/symfony-amg-sentry-plugin | lib/amgSentryLogger.class.php | amgSentryLogger._getSentryLevelFromLoggerPriority | protected function _getSentryLevelFromLoggerPriority($priority){
switch ($priority) {
case self::EMERG:
case self::ALERT:
case self::CRIT:
return amgSentry::FATAL;
case self::ERR:
return amgSentry::ERROR;
case self::WARNING:
return amgSentry::WARNING;
case self::NOTICE:
case self::INF... | php | protected function _getSentryLevelFromLoggerPriority($priority){
switch ($priority) {
case self::EMERG:
case self::ALERT:
case self::CRIT:
return amgSentry::FATAL;
case self::ERR:
return amgSentry::ERROR;
case self::WARNING:
return amgSentry::WARNING;
case self::NOTICE:
case self::INF... | [
"protected",
"function",
"_getSentryLevelFromLoggerPriority",
"(",
"$",
"priority",
")",
"{",
"switch",
"(",
"$",
"priority",
")",
"{",
"case",
"self",
"::",
"EMERG",
":",
"case",
"self",
"::",
"ALERT",
":",
"case",
"self",
"::",
"CRIT",
":",
"return",
"am... | Map symfony logger error priority to Sentry level.
@param integer $priority Logger priority
@return string Sentry level | [
"Map",
"symfony",
"logger",
"error",
"priority",
"to",
"Sentry",
"level",
"."
] | fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78 | https://github.com/getsentry/symfony-amg-sentry-plugin/blob/fa0a526bbd4b763d50bac41f51adbf1cf7a2ed78/lib/amgSentryLogger.class.php#L31-L49 |
187,987 | ZF-Commons/zfc-rbac | src/ZfcRbac/Options/ModuleOptions.php | ModuleOptions.setProtectionPolicy | public function setProtectionPolicy($protectionPolicy)
{
if ($protectionPolicy !== GuardInterface::POLICY_ALLOW && $protectionPolicy !== GuardInterface::POLICY_DENY) {
throw new Exception\RuntimeException(sprintf(
'An invalid protection policy was set. Can only be "deny" or "allo... | php | public function setProtectionPolicy($protectionPolicy)
{
if ($protectionPolicy !== GuardInterface::POLICY_ALLOW && $protectionPolicy !== GuardInterface::POLICY_DENY) {
throw new Exception\RuntimeException(sprintf(
'An invalid protection policy was set. Can only be "deny" or "allo... | [
"public",
"function",
"setProtectionPolicy",
"(",
"$",
"protectionPolicy",
")",
"{",
"if",
"(",
"$",
"protectionPolicy",
"!==",
"GuardInterface",
"::",
"POLICY_ALLOW",
"&&",
"$",
"protectionPolicy",
"!==",
"GuardInterface",
"::",
"POLICY_DENY",
")",
"{",
"throw",
... | Set the protection policy for guards
@param string $protectionPolicy
@throws Exception\RuntimeException
@return void | [
"Set",
"the",
"protection",
"policy",
"for",
"guards"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Options/ModuleOptions.php#L191-L201 |
187,988 | bosnadev/database | src/Bosnadev/Database/Schema/Grammars/PostgresGrammar.php | PostgresGrammar.compileGin | public function compileGin(Blueprint $blueprint, Fluent $command)
{
$columns = $this->columnize($command->columns);
return sprintf('CREATE INDEX %s ON %s USING GIN(%s)', $command->index, $this->wrapTable($blueprint), $columns);
} | php | public function compileGin(Blueprint $blueprint, Fluent $command)
{
$columns = $this->columnize($command->columns);
return sprintf('CREATE INDEX %s ON %s USING GIN(%s)', $command->index, $this->wrapTable($blueprint), $columns);
} | [
"public",
"function",
"compileGin",
"(",
"Blueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"command",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"columnize",
"(",
"$",
"command",
"->",
"columns",
")",
";",
"return",
"sprintf",
"(",
"'CREATE INDEX %... | Compile a gin index key command.
@param \Bosnadev\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $command
@return string | [
"Compile",
"a",
"gin",
"index",
"key",
"command",
"."
] | 397c0e269d4402bd95eaf99694fa8d43d05b9553 | https://github.com/bosnadev/database/blob/397c0e269d4402bd95eaf99694fa8d43d05b9553/src/Bosnadev/Database/Schema/Grammars/PostgresGrammar.php#L295-L300 |
187,989 | bosnadev/database | src/Bosnadev/Database/Schema/Grammars/PostgresGrammar.php | PostgresGrammar.compileCreate | public function compileCreate(BaseBlueprint $blueprint, Fluent $command)
{
$sql = parent::compileCreate($blueprint, $command);
if (isset($blueprint->inherits)) {
$sql .= ' INHERITS ("'.$blueprint->inherits.'")';
}
return $sql;
} | php | public function compileCreate(BaseBlueprint $blueprint, Fluent $command)
{
$sql = parent::compileCreate($blueprint, $command);
if (isset($blueprint->inherits)) {
$sql .= ' INHERITS ("'.$blueprint->inherits.'")';
}
return $sql;
} | [
"public",
"function",
"compileCreate",
"(",
"BaseBlueprint",
"$",
"blueprint",
",",
"Fluent",
"$",
"command",
")",
"{",
"$",
"sql",
"=",
"parent",
"::",
"compileCreate",
"(",
"$",
"blueprint",
",",
"$",
"command",
")",
";",
"if",
"(",
"isset",
"(",
"$",
... | Compile create table query.
@param Illuminate\Database\Schema\Blueprint $blueprint
@param \Illuminate\Support\Fluent $command
@return string | [
"Compile",
"create",
"table",
"query",
"."
] | 397c0e269d4402bd95eaf99694fa8d43d05b9553 | https://github.com/bosnadev/database/blob/397c0e269d4402bd95eaf99694fa8d43d05b9553/src/Bosnadev/Database/Schema/Grammars/PostgresGrammar.php#L323-L331 |
187,990 | ZF-Commons/zfc-rbac | src/ZfcRbac/Service/AuthorizationService.php | AuthorizationService.isGranted | public function isGranted($permission, $context = null)
{
$roles = $this->roleService->getIdentityRoles();
if (empty($roles)) {
return false;
}
if (!$this->rbac->isGranted($roles, $permission)) {
return false;
}
if ($this->hasAssertion($perm... | php | public function isGranted($permission, $context = null)
{
$roles = $this->roleService->getIdentityRoles();
if (empty($roles)) {
return false;
}
if (!$this->rbac->isGranted($roles, $permission)) {
return false;
}
if ($this->hasAssertion($perm... | [
"public",
"function",
"isGranted",
"(",
"$",
"permission",
",",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"roles",
"=",
"$",
"this",
"->",
"roleService",
"->",
"getIdentityRoles",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"roles",
")",
")",
"{",... | Check if the permission is granted to the current identity
@param string|PermissionInterface $permission
@param mixed $context
@return bool | [
"Check",
"if",
"the",
"permission",
"is",
"granted",
"to",
"the",
"current",
"identity"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Service/AuthorizationService.php#L122-L139 |
187,991 | ZF-Commons/zfc-rbac | src/ZfcRbac/Role/InMemoryRoleProvider.php | InMemoryRoleProvider.getRole | protected function getRole($roleName)
{
if (isset($this->roles[$roleName])) {
return $this->roles[$roleName];
}
// If no config, we create a simple role with no permission
if (!isset($this->rolesConfig[$roleName])) {
$role = new Role($roleName);
$... | php | protected function getRole($roleName)
{
if (isset($this->roles[$roleName])) {
return $this->roles[$roleName];
}
// If no config, we create a simple role with no permission
if (!isset($this->rolesConfig[$roleName])) {
$role = new Role($roleName);
$... | [
"protected",
"function",
"getRole",
"(",
"$",
"roleName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"roles",
"[",
"$",
"roleName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"roles",
"[",
"$",
"roleName",
"]",
";",
"}",
"// If no ... | Get role by role name
@param $roleName
@return RoleInterface | [
"Get",
"role",
"by",
"role",
"name"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Role/InMemoryRoleProvider.php#L86-L120 |
187,992 | ZF-Commons/zfc-rbac | src/ZfcRbac/Service/RoleService.php | RoleService.getIdentityRoles | public function getIdentityRoles()
{
if (!$identity = $this->getIdentity()) {
return $this->convertRoles([$this->guestRole]);
}
if (!$identity instanceof IdentityInterface) {
throw new Exception\RuntimeException(sprintf(
'ZfcRbac expects your identity... | php | public function getIdentityRoles()
{
if (!$identity = $this->getIdentity()) {
return $this->convertRoles([$this->guestRole]);
}
if (!$identity instanceof IdentityInterface) {
throw new Exception\RuntimeException(sprintf(
'ZfcRbac expects your identity... | [
"public",
"function",
"getIdentityRoles",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"identity",
"=",
"$",
"this",
"->",
"getIdentity",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"convertRoles",
"(",
"[",
"$",
"this",
"->",
"guestRole",
"]",
")",
";",... | Get the identity roles from the current identity, applying some more logic
@return RoleInterface[]
@throws Exception\RuntimeException | [
"Get",
"the",
"identity",
"roles",
"from",
"the",
"current",
"identity",
"applying",
"some",
"more",
"logic"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Service/RoleService.php#L131-L145 |
187,993 | ZF-Commons/zfc-rbac | src/ZfcRbac/Service/RoleService.php | RoleService.flattenRoles | protected function flattenRoles(array $roles)
{
$roleNames = [];
$iterator = $this->traversalStrategy->getRolesIterator($roles);
foreach ($iterator as $role) {
$roleNames[] = $role->getName();
}
return array_unique($roleNames);
} | php | protected function flattenRoles(array $roles)
{
$roleNames = [];
$iterator = $this->traversalStrategy->getRolesIterator($roles);
foreach ($iterator as $role) {
$roleNames[] = $role->getName();
}
return array_unique($roleNames);
} | [
"protected",
"function",
"flattenRoles",
"(",
"array",
"$",
"roles",
")",
"{",
"$",
"roleNames",
"=",
"[",
"]",
";",
"$",
"iterator",
"=",
"$",
"this",
"->",
"traversalStrategy",
"->",
"getRolesIterator",
"(",
"$",
"roles",
")",
";",
"foreach",
"(",
"$",... | Flatten an array of role with role names
This method iterates through the list of roles, and convert any RoleInterface to a string. For any
role, it also extracts all the children
@param array|RoleInterface[] $roles
@return string[] | [
"Flatten",
"an",
"array",
"of",
"role",
"with",
"role",
"names"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Service/RoleService.php#L218-L228 |
187,994 | bosnadev/database | src/Bosnadev/Database/Traits/UuidTrait.php | UuidTrait.provideUuidKey | protected function provideUuidKey($model)
{
// provide a UUID only if increment is disabled
if ($model->incrementing === false) {
$key = $model->getKeyName();
if (empty($model->$key)) {
$model->$key = (string)Uuid::uuid4();
}
} else {
... | php | protected function provideUuidKey($model)
{
// provide a UUID only if increment is disabled
if ($model->incrementing === false) {
$key = $model->getKeyName();
if (empty($model->$key)) {
$model->$key = (string)Uuid::uuid4();
}
} else {
... | [
"protected",
"function",
"provideUuidKey",
"(",
"$",
"model",
")",
"{",
"// provide a UUID only if increment is disabled",
"if",
"(",
"$",
"model",
"->",
"incrementing",
"===",
"false",
")",
"{",
"$",
"key",
"=",
"$",
"model",
"->",
"getKeyName",
"(",
")",
";"... | Provide a UUID
@param $model | [
"Provide",
"a",
"UUID"
] | 397c0e269d4402bd95eaf99694fa8d43d05b9553 | https://github.com/bosnadev/database/blob/397c0e269d4402bd95eaf99694fa8d43d05b9553/src/Bosnadev/Database/Traits/UuidTrait.php#L32-L46 |
187,995 | ZF-Commons/zfc-rbac | src/ZfcRbac/Guard/ControllerPermissionsGuard.php | ControllerPermissionsGuard.setRules | public function setRules(array $rules)
{
$this->rules = [];
foreach ($rules as $rule) {
$controller = strtolower($rule['controller']);
$actions = isset($rule['actions']) ? (array)$rule['actions'] : [];
$permissions = (array)$rule['permissions'];
... | php | public function setRules(array $rules)
{
$this->rules = [];
foreach ($rules as $rule) {
$controller = strtolower($rule['controller']);
$actions = isset($rule['actions']) ? (array)$rule['actions'] : [];
$permissions = (array)$rule['permissions'];
... | [
"public",
"function",
"setRules",
"(",
"array",
"$",
"rules",
")",
"{",
"$",
"this",
"->",
"rules",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"rule",
")",
"{",
"$",
"controller",
"=",
"strtolower",
"(",
"$",
"rule",
"[",
"'contro... | Set the rules
A controller rule is made the following way:
[
'controller' => 'ControllerName',
'actions' => []/string
'roles' => []/string
]
@param array $rules
@return void | [
"Set",
"the",
"rules"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Guard/ControllerPermissionsGuard.php#L78-L96 |
187,996 | ZF-Commons/zfc-rbac | src/ZfcRbac/Collector/RbacCollector.php | RbacCollector.collectIdentityRolesAndPermissions | private function collectIdentityRolesAndPermissions(RoleService $roleService)
{
$identityRoles = $roleService->getIdentityRoles();
foreach ($identityRoles as $role) {
$roleName = $role->getName();
if (!$role instanceof HierarchicalRoleInterface) {
$this->col... | php | private function collectIdentityRolesAndPermissions(RoleService $roleService)
{
$identityRoles = $roleService->getIdentityRoles();
foreach ($identityRoles as $role) {
$roleName = $role->getName();
if (!$role instanceof HierarchicalRoleInterface) {
$this->col... | [
"private",
"function",
"collectIdentityRolesAndPermissions",
"(",
"RoleService",
"$",
"roleService",
")",
"{",
"$",
"identityRoles",
"=",
"$",
"roleService",
"->",
"getIdentityRoles",
"(",
")",
";",
"foreach",
"(",
"$",
"identityRoles",
"as",
"$",
"role",
")",
"... | Collect roles and permissions
@param RoleService $roleService
@return void | [
"Collect",
"roles",
"and",
"permissions"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Collector/RbacCollector.php#L147-L170 |
187,997 | ZF-Commons/zfc-rbac | src/ZfcRbac/Collector/RbacCollector.php | RbacCollector.collectPermissions | private function collectPermissions(RoleInterface $role)
{
if (method_exists($role, 'getPermissions')) {
$permissions = $role->getPermissions();
} else {
// Gather the permissions for the given role. We have to use reflection as
// the RoleInterface does not have ... | php | private function collectPermissions(RoleInterface $role)
{
if (method_exists($role, 'getPermissions')) {
$permissions = $role->getPermissions();
} else {
// Gather the permissions for the given role. We have to use reflection as
// the RoleInterface does not have ... | [
"private",
"function",
"collectPermissions",
"(",
"RoleInterface",
"$",
"role",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"role",
",",
"'getPermissions'",
")",
")",
"{",
"$",
"permissions",
"=",
"$",
"role",
"->",
"getPermissions",
"(",
")",
";",
"}"... | Collect permissions for the given role
@param RoleInterface $role
@return void | [
"Collect",
"permissions",
"for",
"the",
"given",
"role"
] | 8a28d65df63d9991cbef24eaf219061b6c2890ed | https://github.com/ZF-Commons/zfc-rbac/blob/8a28d65df63d9991cbef24eaf219061b6c2890ed/src/ZfcRbac/Collector/RbacCollector.php#L178-L200 |
187,998 | silverstripe/silverstripe-dms | code/cms/DMSGridFieldAddNewButton.php | DMSGridFieldAddNewButton.getHTMLFragments | public function getHTMLFragments($gridField)
{
$singleton = singleton($gridField->getModelClass());
if (!$singleton->canCreate()) {
return array();
}
if (!$this->buttonName) {
// provide a default button name, can be changed by calling {@link setButtonName()... | php | public function getHTMLFragments($gridField)
{
$singleton = singleton($gridField->getModelClass());
if (!$singleton->canCreate()) {
return array();
}
if (!$this->buttonName) {
// provide a default button name, can be changed by calling {@link setButtonName()... | [
"public",
"function",
"getHTMLFragments",
"(",
"$",
"gridField",
")",
"{",
"$",
"singleton",
"=",
"singleton",
"(",
"$",
"gridField",
"->",
"getModelClass",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"singleton",
"->",
"canCreate",
"(",
")",
")",
"{",
"r... | Overriding the parent method to change the template that the DMS add button will be rendered with
@param GridField $gridField
@return array | [
"Overriding",
"the",
"parent",
"method",
"to",
"change",
"the",
"template",
"that",
"the",
"DMS",
"add",
"button",
"will",
"be",
"rendered",
"with"
] | 945119a1da62bb57cbbbea288fafdccdbd20cdce | https://github.com/silverstripe/silverstripe-dms/blob/945119a1da62bb57cbbbea288fafdccdbd20cdce/code/cms/DMSGridFieldAddNewButton.php#L18-L53 |
187,999 | rexxars/html-validator | library/HtmlValidator/Response.php | Response.validateResponse | private function validateResponse($response) {
if ($response->getStatusCode() !== 200) {
$statusCode = $response->getStatusCode();
throw new ServerException('Server responded with HTTP status ' . $statusCode, $statusCode);
} else if (strpos($response->getHeader('Content-Type')[0]... | php | private function validateResponse($response) {
if ($response->getStatusCode() !== 200) {
$statusCode = $response->getStatusCode();
throw new ServerException('Server responded with HTTP status ' . $statusCode, $statusCode);
} else if (strpos($response->getHeader('Content-Type')[0]... | [
"private",
"function",
"validateResponse",
"(",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
"!==",
"200",
")",
"{",
"$",
"statusCode",
"=",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
";",
"throw",
"new",... | Validate the HTTP response and throw exceptions on errors
@param HttpResponse $response
@throws ServerException | [
"Validate",
"the",
"HTTP",
"response",
"and",
"throw",
"exceptions",
"on",
"errors"
] | feebdfc624b6fef6f54d5c84489dff952fb3a3db | https://github.com/rexxars/html-validator/blob/feebdfc624b6fef6f54d5c84489dff952fb3a3db/library/HtmlValidator/Response.php#L73-L90 |
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.