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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
googleapis/google-cloud-php | Dialogflow/src/V2/Intent.php | Intent.setTrainingPhrases | public function setTrainingPhrases($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase::class);
$this->training_phrases = $arr;
return $this;
} | php | public function setTrainingPhrases($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase::class);
$this->training_phrases = $arr;
return $this;
} | [
"public",
"function",
"setTrainingPhrases",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
... | Optional. The collection of examples that the agent is
trained on.
Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase training_phrases = 9;</code>
@param \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Optional",
".",
"The",
"collection",
"of",
"examples",
"that",
"the",
"agent",
"is",
"trained",
"on",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/Intent.php#L494-L500 | train |
googleapis/google-cloud-php | Dialogflow/src/V2/Intent.php | Intent.setMessages | public function setMessages($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class);
$this->messages = $arr;
return $this;
} | php | public function setMessages($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\Message::class);
$this->messages = $arr;
return $this;
} | [
"public",
"function",
"setMessages",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",... | Optional. The collection of rich messages corresponding to the
`Response` field in the Dialogflow console.
Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.Intent.Message messages = 14;</code>
@param \Google\Cloud\Dialogflow\V2\Intent\Message[]|\Google\Protobuf\Internal\RepeatedField $var
@retu... | [
"Optional",
".",
"The",
"collection",
"of",
"rich",
"messages",
"corresponding",
"to",
"the",
"Response",
"field",
"in",
"the",
"Dialogflow",
"console",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/Intent.php#L638-L644 | train |
googleapis/google-cloud-php | Dialogflow/src/V2/Intent.php | Intent.setFollowupIntentInfo | public function setFollowupIntentInfo($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo::class);
$this->followup_intent_info = $arr;
return $this;
} | php | public function setFollowupIntentInfo($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\FollowupIntentInfo::class);
$this->followup_intent_info = $arr;
return $this;
} | [
"public",
"function",
"setFollowupIntentInfo",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google... | Read-only. Information about all followup intents that have this intent as
a direct or indirect parent. We populate this field only in the output.
Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.Intent.FollowupIntentInfo followup_intent_info = 18;</code>
@param \Google\Cloud\Dialogflow\V2\Inte... | [
"Read",
"-",
"only",
".",
"Information",
"about",
"all",
"followup",
"intents",
"that",
"have",
"this",
"intent",
"as",
"a",
"direct",
"or",
"indirect",
"parent",
".",
"We",
"populate",
"this",
"field",
"only",
"in",
"the",
"output",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dialogflow/src/V2/Intent.php#L762-L768 | train |
googleapis/google-cloud-php | BigQuery/src/InsertResponse.php | InsertResponse.failedRows | public function failedRows()
{
$rows = [];
if ($this->isSuccessful()) {
return $rows;
}
foreach ($this->info['insertErrors'] as $error) {
$rows[] = $error + [
'rowData' => $this->rows[$error['index']]['json']
];
}
... | php | public function failedRows()
{
$rows = [];
if ($this->isSuccessful()) {
return $rows;
}
foreach ($this->info['insertErrors'] as $error) {
$rows[] = $error + [
'rowData' => $this->rows[$error['index']]['json']
];
}
... | [
"public",
"function",
"failedRows",
"(",
")",
"{",
"$",
"rows",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"isSuccessful",
"(",
")",
")",
"{",
"return",
"$",
"rows",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"info",
"[",
"'insertErrors'",... | Returns the rows which failed to insert along with their associated
errors and index in the original data set.
Example:
```
$rows = $insertResponse->failedRows();
foreach ($rows as $row) {
print_r($row['rowData']) . PHP_EOL;
foreach ($row['errors'] as $error) {
echo $error['reason'] . ': ' . $error['message'] . PHP_... | [
"Returns",
"the",
"rows",
"which",
"failed",
"to",
"insert",
"along",
"with",
"their",
"associated",
"errors",
"and",
"index",
"in",
"the",
"original",
"data",
"set",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/BigQuery/src/InsertResponse.php#L88-L103 | train |
googleapis/google-cloud-php | Dlp/src/V2/ListDlpJobsResponse.php | ListDlpJobsResponse.setJobs | public function setJobs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\DlpJob::class);
$this->jobs = $arr;
return $this;
} | php | public function setJobs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\DlpJob::class);
$this->jobs = $arr;
return $this;
} | [
"public",
"function",
"setJobs",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
"... | A list of DlpJobs that matches the specified filter in the request.
Generated from protobuf field <code>repeated .google.privacy.dlp.v2.DlpJob jobs = 1;</code>
@param \Google\Cloud\Dlp\V2\DlpJob[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"A",
"list",
"of",
"DlpJobs",
"that",
"matches",
"the",
"specified",
"filter",
"in",
"the",
"request",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/ListDlpJobsResponse.php#L66-L72 | train |
googleapis/google-cloud-php | Dlp/src/V2/RecordKey.php | RecordKey.setIdValues | public function setIdValues($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->id_values = $arr;
return $this;
} | php | public function setIdValues($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->id_values = $arr;
return $this;
} | [
"public",
"function",
"setIdValues",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"STRING",
")",
";",
"$",
"this",
"-... | Values of identifying columns in the given row. Order of values matches
the order of field identifiers specified in the scanning request.
Generated from protobuf field <code>repeated string id_values = 5;</code>
@param string[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Values",
"of",
"identifying",
"columns",
"in",
"the",
"given",
"row",
".",
"Order",
"of",
"values",
"matches",
"the",
"order",
"of",
"field",
"identifiers",
"specified",
"in",
"the",
"scanning",
"request",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/RecordKey.php#L109-L115 | train |
googleapis/google-cloud-php | Bigtable/src/BigtableClient.php | BigtableClient.table | public function table($instanceId, $tableId, array $options = [])
{
return new Table(
$this->gapicClient,
GapicClient::tableName($this->projectId, $instanceId, $tableId),
$options
);
} | php | public function table($instanceId, $tableId, array $options = [])
{
return new Table(
$this->gapicClient,
GapicClient::tableName($this->projectId, $instanceId, $tableId),
$options
);
} | [
"public",
"function",
"table",
"(",
"$",
"instanceId",
",",
"$",
"tableId",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"Table",
"(",
"$",
"this",
"->",
"gapicClient",
",",
"GapicClient",
"::",
"tableName",
"(",
"$",
"this",... | Returns a table instance which can be used to read rows and to perform
insert, update, and delete operations.
Example:
```
$table = $bigtable->table('my-instance', 'my-table');
```
@param string $instanceId The instance ID.
@param string $tableId The table ID.
@param array $options [optional] {
Configuration options.... | [
"Returns",
"a",
"table",
"instance",
"which",
"can",
"be",
"used",
"to",
"read",
"rows",
"and",
"to",
"perform",
"insert",
"update",
"and",
"delete",
"operations",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/BigtableClient.php#L144-L151 | train |
googleapis/google-cloud-php | ErrorReporting/src/V1beta1/ErrorGroupServiceGrpcClient.php | ErrorGroupServiceGrpcClient.UpdateGroup | public function UpdateGroup(\Google\Cloud\ErrorReporting\V1beta1\UpdateGroupRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup',
$argument,
['\Google\Cloud\ErrorReporting\V1beta1\Error... | php | public function UpdateGroup(\Google\Cloud\ErrorReporting\V1beta1\UpdateGroupRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup',
$argument,
['\Google\Cloud\ErrorReporting\V1beta1\Error... | [
"public",
"function",
"UpdateGroup",
"(",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"ErrorReporting",
"\\",
"V1beta1",
"\\",
"UpdateGroupRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$... | Replace the data for the specified group.
Fails if the group does not exist.
@param \Google\Cloud\ErrorReporting\V1beta1\UpdateGroupRequest $argument input argument
@param array $metadata metadata
@param array $options call options | [
"Replace",
"the",
"data",
"for",
"the",
"specified",
"group",
".",
"Fails",
"if",
"the",
"group",
"does",
"not",
"exist",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/ErrorReporting/src/V1beta1/ErrorGroupServiceGrpcClient.php#L56-L62 | train |
googleapis/google-cloud-php | Bigtable/src/V2/Family.php | Family.setColumns | public function setColumns($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Column::class);
$this->columns = $arr;
return $this;
} | php | public function setColumns($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Column::class);
$this->columns = $arr;
return $this;
} | [
"public",
"function",
"setColumns",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",
... | Must not be empty. Sorted in order of increasing "qualifier".
Generated from protobuf field <code>repeated .google.bigtable.v2.Column columns = 2;</code>
@param \Google\Cloud\Bigtable\V2\Column[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Must",
"not",
"be",
"empty",
".",
"Sorted",
"in",
"order",
"of",
"increasing",
"qualifier",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Family.php#L113-L119 | train |
googleapis/google-cloud-php | Dataproc/src/V1beta2/ClusterOperationMetadata.php | ClusterOperationMetadata.setWarnings | public function setWarnings($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->warnings = $arr;
return $this;
} | php | public function setWarnings($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->warnings = $arr;
return $this;
} | [
"public",
"function",
"setWarnings",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"STRING",
")",
";",
"$",
"this",
"-... | Output only. Errors encountered during operation execution.
Generated from protobuf field <code>repeated string warnings = 14;</code>
@param string[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"Output",
"only",
".",
"Errors",
"encountered",
"during",
"operation",
"execution",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1beta2/ClusterOperationMetadata.php#L296-L302 | train |
googleapis/google-cloud-php | Talent/src/V4beta1/RequestMetadata.php | RequestMetadata.setDeviceInfo | public function setDeviceInfo($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\DeviceInfo::class);
$this->device_info = $var;
return $this;
} | php | public function setDeviceInfo($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\DeviceInfo::class);
$this->device_info = $var;
return $this;
} | [
"public",
"function",
"setDeviceInfo",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Talent",
"\\",
"V4beta1",
"\\",
"DeviceInfo",
"::",
"class",
")",
";",
"$",
"this",
"->",
"de... | Optional.
The type of device used by the job seeker at the time of the call to the
service.
Generated from protobuf field <code>.google.cloud.talent.v4beta1.DeviceInfo device_info = 5;</code>
@param \Google\Cloud\Talent\V4beta1\DeviceInfo $var
@return $this | [
"Optional",
".",
"The",
"type",
"of",
"device",
"used",
"by",
"the",
"job",
"seeker",
"at",
"the",
"time",
"of",
"the",
"call",
"to",
"the",
"service",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/RequestMetadata.php#L373-L379 | train |
googleapis/google-cloud-php | PubSub/src/V1/ListSubscriptionsResponse.php | ListSubscriptionsResponse.setSubscriptions | public function setSubscriptions($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Subscription::class);
$this->subscriptions = $arr;
return $this;
} | php | public function setSubscriptions($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\Subscription::class);
$this->subscriptions = $arr;
return $this;
} | [
"public",
"function",
"setSubscriptions",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
... | The subscriptions that match the request.
Generated from protobuf field <code>repeated .google.pubsub.v1.Subscription subscriptions = 1;</code>
@param \Google\Cloud\PubSub\V1\Subscription[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"The",
"subscriptions",
"that",
"match",
"the",
"request",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/V1/ListSubscriptionsResponse.php#L70-L76 | train |
googleapis/google-cloud-php | ErrorReporting/src/V1beta1/ListGroupStatsResponse.php | ListGroupStatsResponse.setErrorGroupStats | public function setErrorGroupStats($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ErrorReporting\V1beta1\ErrorGroupStats::class);
$this->error_group_stats = $arr;
return $this;
} | php | public function setErrorGroupStats($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ErrorReporting\V1beta1\ErrorGroupStats::class);
$this->error_group_stats = $arr;
return $this;
} | [
"public",
"function",
"setErrorGroupStats",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
... | The error group stats which match the given request.
Generated from protobuf field <code>repeated .google.devtools.clouderrorreporting.v1beta1.ErrorGroupStats error_group_stats = 1;</code>
@param \Google\Cloud\ErrorReporting\V1beta1\ErrorGroupStats[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"The",
"error",
"group",
"stats",
"which",
"match",
"the",
"given",
"request",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/ErrorReporting/src/V1beta1/ListGroupStatsResponse.php#L84-L90 | train |
googleapis/google-cloud-php | Bigtable/src/V2/Mutation.php | Mutation.setSetCell | public function setSetCell($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_SetCell::class);
$this->writeOneof(1, $var);
return $this;
} | php | public function setSetCell($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_SetCell::class);
$this->writeOneof(1, $var);
return $this;
} | [
"public",
"function",
"setSetCell",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Bigtable",
"\\",
"V2",
"\\",
"Mutation_SetCell",
"::",
"class",
")",
";",
"$",
"this",
"->",
"wr... | Set a cell's value.
Generated from protobuf field <code>.google.bigtable.v2.Mutation.SetCell set_cell = 1;</code>
@param \Google\Cloud\Bigtable\V2\Mutation\SetCell $var
@return $this | [
"Set",
"a",
"cell",
"s",
"value",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Mutation.php#L59-L65 | train |
googleapis/google-cloud-php | Bigtable/src/V2/Mutation.php | Mutation.setDeleteFromColumn | public function setDeleteFromColumn($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setDeleteFromColumn($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setDeleteFromColumn",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Bigtable",
"\\",
"V2",
"\\",
"Mutation_DeleteFromColumn",
"::",
"class",
")",
";",
"$",
"th... | Deletes cells from a column.
Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2;</code>
@param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn $var
@return $this | [
"Deletes",
"cells",
"from",
"a",
"column",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Mutation.php#L85-L91 | train |
googleapis/google-cloud-php | Bigtable/src/V2/Mutation.php | Mutation.setDeleteFromFamily | public function setDeleteFromFamily($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily::class);
$this->writeOneof(3, $var);
return $this;
} | php | public function setDeleteFromFamily($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily::class);
$this->writeOneof(3, $var);
return $this;
} | [
"public",
"function",
"setDeleteFromFamily",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Bigtable",
"\\",
"V2",
"\\",
"Mutation_DeleteFromFamily",
"::",
"class",
")",
";",
"$",
"th... | Deletes cells from a column family.
Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3;</code>
@param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily $var
@return $this | [
"Deletes",
"cells",
"from",
"a",
"column",
"family",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Mutation.php#L111-L117 | train |
googleapis/google-cloud-php | Bigtable/src/V2/Mutation.php | Mutation.setDeleteFromRow | public function setDeleteFromRow($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow::class);
$this->writeOneof(4, $var);
return $this;
} | php | public function setDeleteFromRow($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow::class);
$this->writeOneof(4, $var);
return $this;
} | [
"public",
"function",
"setDeleteFromRow",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Bigtable",
"\\",
"V2",
"\\",
"Mutation_DeleteFromRow",
"::",
"class",
")",
";",
"$",
"this",
... | Deletes cells from the entire row.
Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4;</code>
@param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow $var
@return $this | [
"Deletes",
"cells",
"from",
"the",
"entire",
"row",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Mutation.php#L137-L143 | train |
googleapis/google-cloud-php | Trace/src/V2/Span/TimeEvent/Annotation.php | Annotation.setDescription | public function setDescription($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Trace\V2\TruncatableString::class);
$this->description = $var;
return $this;
} | php | public function setDescription($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Trace\V2\TruncatableString::class);
$this->description = $var;
return $this;
} | [
"public",
"function",
"setDescription",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Trace",
"\\",
"V2",
"\\",
"TruncatableString",
"::",
"class",
")",
";",
"$",
"this",
"->",
"... | A user-supplied message describing the event. The maximum length for
the description is 256 bytes.
Generated from protobuf field <code>.google.devtools.cloudtrace.v2.TruncatableString description = 1;</code>
@param \Google\Cloud\Trace\V2\TruncatableString $var
@return $this | [
"A",
"user",
"-",
"supplied",
"message",
"describing",
"the",
"event",
".",
"The",
"maximum",
"length",
"for",
"the",
"description",
"is",
"256",
"bytes",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Trace/src/V2/Span/TimeEvent/Annotation.php#L72-L78 | train |
googleapis/google-cloud-php | Dlp/src/V2/Error.php | Error.setTimestamps | public function setTimestamps($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Timestamp::class);
$this->timestamps = $arr;
return $this;
} | php | public function setTimestamps($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Timestamp::class);
$this->timestamps = $arr;
return $this;
} | [
"public",
"function",
"setTimestamps",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\... | The times the error occurred.
Generated from protobuf field <code>repeated .google.protobuf.Timestamp timestamps = 2;</code>
@param \Google\Protobuf\Timestamp[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"The",
"times",
"the",
"error",
"occurred",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/Error.php#L87-L93 | train |
googleapis/google-cloud-php | Core/src/EmulatorTrait.php | EmulatorTrait.emulatorGapicConfig | private function emulatorGapicConfig($emulatorHost)
{
// Strip the URL scheme from the input, if it was provided.
if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) {
$search = $scheme . '://';
$emulatorHost = str_replace($search, '', $emulatorHost);
}
r... | php | private function emulatorGapicConfig($emulatorHost)
{
// Strip the URL scheme from the input, if it was provided.
if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) {
$search = $scheme . '://';
$emulatorHost = str_replace($search, '', $emulatorHost);
}
r... | [
"private",
"function",
"emulatorGapicConfig",
"(",
"$",
"emulatorHost",
")",
"{",
"// Strip the URL scheme from the input, if it was provided.",
"if",
"(",
"$",
"scheme",
"=",
"parse_url",
"(",
"$",
"emulatorHost",
",",
"PHP_URL_SCHEME",
")",
")",
"{",
"$",
"search",
... | Configure the gapic configuration to use a service emulator.
@param string $emulatorHost
@return array | [
"Configure",
"the",
"gapic",
"configuration",
"to",
"use",
"a",
"service",
"emulator",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/EmulatorTrait.php#L31-L49 | train |
googleapis/google-cloud-php | Core/src/EmulatorTrait.php | EmulatorTrait.emulatorBaseUri | private function emulatorBaseUri($emulatorHost)
{
$emulatorUriComponents = parse_url($emulatorHost);
$emulatorUriComponents = array_merge(['scheme' => 'http', 'port' => ''], $emulatorUriComponents);
$baseUri = "{$emulatorUriComponents['scheme']}://{$emulatorUriComponents['host']}";
$... | php | private function emulatorBaseUri($emulatorHost)
{
$emulatorUriComponents = parse_url($emulatorHost);
$emulatorUriComponents = array_merge(['scheme' => 'http', 'port' => ''], $emulatorUriComponents);
$baseUri = "{$emulatorUriComponents['scheme']}://{$emulatorUriComponents['host']}";
$... | [
"private",
"function",
"emulatorBaseUri",
"(",
"$",
"emulatorHost",
")",
"{",
"$",
"emulatorUriComponents",
"=",
"parse_url",
"(",
"$",
"emulatorHost",
")",
";",
"$",
"emulatorUriComponents",
"=",
"array_merge",
"(",
"[",
"'scheme'",
"=>",
"'http'",
",",
"'port'... | Retrieve a valid base uri for a service emulator.
@param string $emulatorHost
@return string | [
"Retrieve",
"a",
"valid",
"base",
"uri",
"for",
"a",
"service",
"emulator",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/EmulatorTrait.php#L56-L64 | train |
googleapis/google-cloud-php | Core/src/EmulatorTrait.php | EmulatorTrait.getEmulatorBaseUri | public function getEmulatorBaseUri($baseUri, $emulatorHost = null)
{
if ($emulatorHost) {
$baseUri = $this->emulatorBaseUri($emulatorHost);
}
return $baseUri;
} | php | public function getEmulatorBaseUri($baseUri, $emulatorHost = null)
{
if ($emulatorHost) {
$baseUri = $this->emulatorBaseUri($emulatorHost);
}
return $baseUri;
} | [
"public",
"function",
"getEmulatorBaseUri",
"(",
"$",
"baseUri",
",",
"$",
"emulatorHost",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"emulatorHost",
")",
"{",
"$",
"baseUri",
"=",
"$",
"this",
"->",
"emulatorBaseUri",
"(",
"$",
"emulatorHost",
")",
";",
"}"... | When emulators are enabled, use them as the service host.
This method is deprecated and will be removed in a future major release.
@param string $baseUri
@param string $emulatorHost [optional]
@return string
@deprecated
@access private | [
"When",
"emulators",
"are",
"enabled",
"use",
"them",
"as",
"the",
"service",
"host",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/EmulatorTrait.php#L78-L85 | train |
googleapis/google-cloud-php | OsLogin/src/V1/ImportSshPublicKeyResponse.php | ImportSshPublicKeyResponse.setLoginProfile | public function setLoginProfile($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\OsLogin\V1\LoginProfile::class);
$this->login_profile = $var;
return $this;
} | php | public function setLoginProfile($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\OsLogin\V1\LoginProfile::class);
$this->login_profile = $var;
return $this;
} | [
"public",
"function",
"setLoginProfile",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"OsLogin",
"\\",
"V1",
"\\",
"LoginProfile",
"::",
"class",
")",
";",
"$",
"this",
"->",
"lo... | The login profile information for the user.
Generated from protobuf field <code>.google.cloud.oslogin.v1.LoginProfile login_profile = 1;</code>
@param \Google\Cloud\OsLogin\V1\LoginProfile $var
@return $this | [
"The",
"login",
"profile",
"information",
"for",
"the",
"user",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/OsLogin/src/V1/ImportSshPublicKeyResponse.php#L58-L64 | train |
googleapis/google-cloud-php | Spanner/src/Batch/BatchSnapshot.php | BatchSnapshot.executePartition | public function executePartition(PartitionInterface $partition, array $options = [])
{
if ($partition instanceof QueryPartition) {
return $this->executeQuery($partition);
} elseif ($partition instanceof ReadPartition) {
return $this->executeRead($partition);
}
... | php | public function executePartition(PartitionInterface $partition, array $options = [])
{
if ($partition instanceof QueryPartition) {
return $this->executeQuery($partition);
} elseif ($partition instanceof ReadPartition) {
return $this->executeRead($partition);
}
... | [
"public",
"function",
"executePartition",
"(",
"PartitionInterface",
"$",
"partition",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"partition",
"instanceof",
"QueryPartition",
")",
"{",
"return",
"$",
"this",
"->",
"executeQuery",
... | Read rows from a partition.
Partitions are created by calling {@see Google\Cloud\Spanner\Batch\BatchSnapshot::partitionRead()}
or {@see Google\Cloud\Spanner\Batch\BatchSnapshot::partitionQuery()}.
Generally, those partitions will be distributed to worker processes, each
of which will call this method with the partitio... | [
"Read",
"rows",
"from",
"a",
"partition",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Batch/BatchSnapshot.php#L219-L228 | train |
googleapis/google-cloud-php | Spanner/src/Batch/BatchSnapshot.php | BatchSnapshot.serialize | public function serialize()
{
return base64_encode(json_encode([
'sessionName' => $this->session->name(),
'transactionId' => $this->transactionId,
'readTimestamp' => $this->readTimestamp->formatAsString()
]));
} | php | public function serialize()
{
return base64_encode(json_encode([
'sessionName' => $this->session->name(),
'transactionId' => $this->transactionId,
'readTimestamp' => $this->readTimestamp->formatAsString()
]));
} | [
"public",
"function",
"serialize",
"(",
")",
"{",
"return",
"base64_encode",
"(",
"json_encode",
"(",
"[",
"'sessionName'",
"=>",
"$",
"this",
"->",
"session",
"->",
"name",
"(",
")",
",",
"'transactionId'",
"=>",
"$",
"this",
"->",
"transactionId",
",",
"... | Return a stringified representation of the BatchSnapshot object.
Example:
```
$snapshotString = $snapshot->serialize();
```
@return string | [
"Return",
"a",
"stringified",
"representation",
"of",
"the",
"BatchSnapshot",
"object",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Batch/BatchSnapshot.php#L240-L247 | train |
googleapis/google-cloud-php | Spanner/src/Batch/BatchSnapshot.php | BatchSnapshot.executeQuery | private function executeQuery(QueryPartition $partition)
{
return $this->execute($partition->sql(), [
'partitionToken' => $partition->token()
] + $partition->options());
} | php | private function executeQuery(QueryPartition $partition)
{
return $this->execute($partition->sql(), [
'partitionToken' => $partition->token()
] + $partition->options());
} | [
"private",
"function",
"executeQuery",
"(",
"QueryPartition",
"$",
"partition",
")",
"{",
"return",
"$",
"this",
"->",
"execute",
"(",
"$",
"partition",
"->",
"sql",
"(",
")",
",",
"[",
"'partitionToken'",
"=>",
"$",
"partition",
"->",
"token",
"(",
")",
... | Run executeStreamingSql with a partition.
@param QueryPartition $partition The partition.
@return Result | [
"Run",
"executeStreamingSql",
"with",
"a",
"partition",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Batch/BatchSnapshot.php#L266-L271 | train |
googleapis/google-cloud-php | Spanner/src/Batch/BatchSnapshot.php | BatchSnapshot.executeRead | private function executeRead(ReadPartition $partition)
{
return $this->read($partition->table(), $partition->keySet(), $partition->columns(), [
'partitionToken' => $partition->token()
] + $partition->options());
} | php | private function executeRead(ReadPartition $partition)
{
return $this->read($partition->table(), $partition->keySet(), $partition->columns(), [
'partitionToken' => $partition->token()
] + $partition->options());
} | [
"private",
"function",
"executeRead",
"(",
"ReadPartition",
"$",
"partition",
")",
"{",
"return",
"$",
"this",
"->",
"read",
"(",
"$",
"partition",
"->",
"table",
"(",
")",
",",
"$",
"partition",
"->",
"keySet",
"(",
")",
",",
"$",
"partition",
"->",
"... | Run streamingRead with a partition.
@param ReadPartition $partition The partition.
@return Result | [
"Run",
"streamingRead",
"with",
"a",
"partition",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Spanner/src/Batch/BatchSnapshot.php#L279-L284 | train |
googleapis/google-cloud-php | Dataproc/src/V1beta2/CreateClusterRequest.php | CreateClusterRequest.setCluster | public function setCluster($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\Cluster::class);
$this->cluster = $var;
return $this;
} | php | public function setCluster($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\Cluster::class);
$this->cluster = $var;
return $this;
} | [
"public",
"function",
"setCluster",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dataproc",
"\\",
"V1beta2",
"\\",
"Cluster",
"::",
"class",
")",
";",
"$",
"this",
"->",
"cluste... | Required. The cluster to create.
Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.Cluster cluster = 2;</code>
@param \Google\Cloud\Dataproc\V1beta2\Cluster $var
@return $this | [
"Required",
".",
"The",
"cluster",
"to",
"create",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1beta2/CreateClusterRequest.php#L156-L162 | train |
googleapis/google-cloud-php | PubSub/src/V1/UpdateTopicRequest.php | UpdateTopicRequest.setTopic | public function setTopic($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Topic::class);
$this->topic = $var;
return $this;
} | php | public function setTopic($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\Topic::class);
$this->topic = $var;
return $this;
} | [
"public",
"function",
"setTopic",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"PubSub",
"\\",
"V1",
"\\",
"Topic",
"::",
"class",
")",
";",
"$",
"this",
"->",
"topic",
"=",
... | The updated topic object.
Generated from protobuf field <code>.google.pubsub.v1.Topic topic = 1;</code>
@param \Google\Cloud\PubSub\V1\Topic $var
@return $this | [
"The",
"updated",
"topic",
"object",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/PubSub/src/V1/UpdateTopicRequest.php#L74-L80 | train |
googleapis/google-cloud-php | Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php | CloudTasksGapicClient.queueName | public static function queueName($project, $location, $queue)
{
return self::getQueueNameTemplate()->render([
'project' => $project,
'location' => $location,
'queue' => $queue,
]);
} | php | public static function queueName($project, $location, $queue)
{
return self::getQueueNameTemplate()->render([
'project' => $project,
'location' => $location,
'queue' => $queue,
]);
} | [
"public",
"static",
"function",
"queueName",
"(",
"$",
"project",
",",
"$",
"location",
",",
"$",
"queue",
")",
"{",
"return",
"self",
"::",
"getQueueNameTemplate",
"(",
")",
"->",
"render",
"(",
"[",
"'project'",
"=>",
"$",
"project",
",",
"'location'",
... | Formats a string containing the fully-qualified path to represent
a queue resource.
@param string $project
@param string $location
@param string $queue
@return string The formatted queue resource.
@experimental | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"queue",
"resource",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php#L259-L266 | train |
googleapis/google-cloud-php | Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php | CloudTasksGapicClient.taskName | public static function taskName($project, $location, $queue, $task)
{
return self::getTaskNameTemplate()->render([
'project' => $project,
'location' => $location,
'queue' => $queue,
'task' => $task,
]);
} | php | public static function taskName($project, $location, $queue, $task)
{
return self::getTaskNameTemplate()->render([
'project' => $project,
'location' => $location,
'queue' => $queue,
'task' => $task,
]);
} | [
"public",
"static",
"function",
"taskName",
"(",
"$",
"project",
",",
"$",
"location",
",",
"$",
"queue",
",",
"$",
"task",
")",
"{",
"return",
"self",
"::",
"getTaskNameTemplate",
"(",
")",
"->",
"render",
"(",
"[",
"'project'",
"=>",
"$",
"project",
... | Formats a string containing the fully-qualified path to represent
a task resource.
@param string $project
@param string $location
@param string $queue
@param string $task
@return string The formatted task resource.
@experimental | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"task",
"resource",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Tasks/src/V2beta2/Gapic/CloudTasksGapicClient.php#L280-L288 | train |
googleapis/google-cloud-php | Dataproc/src/V1/OrderedJob.php | OrderedJob.setHadoopJob | public function setHadoopJob($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\HadoopJob::class);
$this->writeOneof(2, $var);
return $this;
} | php | public function setHadoopJob($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\HadoopJob::class);
$this->writeOneof(2, $var);
return $this;
} | [
"public",
"function",
"setHadoopJob",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dataproc",
"\\",
"V1",
"\\",
"HadoopJob",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOn... | Job is a Hadoop job.
Generated from protobuf field <code>.google.cloud.dataproc.v1.HadoopJob hadoop_job = 2;</code>
@param \Google\Cloud\Dataproc\V1\HadoopJob $var
@return $this | [
"Job",
"is",
"a",
"Hadoop",
"job",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1/OrderedJob.php#L167-L173 | train |
googleapis/google-cloud-php | Dataproc/src/V1/OrderedJob.php | OrderedJob.setSparkJob | public function setSparkJob($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\SparkJob::class);
$this->writeOneof(3, $var);
return $this;
} | php | public function setSparkJob($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\SparkJob::class);
$this->writeOneof(3, $var);
return $this;
} | [
"public",
"function",
"setSparkJob",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dataproc",
"\\",
"V1",
"\\",
"SparkJob",
"::",
"class",
")",
";",
"$",
"this",
"->",
"writeOneo... | Job is a Spark job.
Generated from protobuf field <code>.google.cloud.dataproc.v1.SparkJob spark_job = 3;</code>
@param \Google\Cloud\Dataproc\V1\SparkJob $var
@return $this | [
"Job",
"is",
"a",
"Spark",
"job",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dataproc/src/V1/OrderedJob.php#L193-L199 | train |
googleapis/google-cloud-php | Dlp/src/V2/BucketingConfig/Bucket.php | Bucket.setMin | public function setMin($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
$this->min = $var;
return $this;
} | php | public function setMin($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
$this->min = $var;
return $this;
} | [
"public",
"function",
"setMin",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"Value",
"::",
"class",
")",
";",
"$",
"this",
"->",
"min",
"=",
"$",
... | Lower bound of the range, inclusive. Type should be the same as max if
used.
Generated from protobuf field <code>.google.privacy.dlp.v2.Value min = 1;</code>
@param \Google\Cloud\Dlp\V2\Value $var
@return $this | [
"Lower",
"bound",
"of",
"the",
"range",
"inclusive",
".",
"Type",
"should",
"be",
"the",
"same",
"as",
"max",
"if",
"used",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/BucketingConfig/Bucket.php#L80-L86 | train |
googleapis/google-cloud-php | Dlp/src/V2/BucketingConfig/Bucket.php | Bucket.setMax | public function setMax($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
$this->max = $var;
return $this;
} | php | public function setMax($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
$this->max = $var;
return $this;
} | [
"public",
"function",
"setMax",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"Value",
"::",
"class",
")",
";",
"$",
"this",
"->",
"max",
"=",
"$",
... | Upper bound of the range, exclusive; type must match min.
Generated from protobuf field <code>.google.privacy.dlp.v2.Value max = 2;</code>
@param \Google\Cloud\Dlp\V2\Value $var
@return $this | [
"Upper",
"bound",
"of",
"the",
"range",
"exclusive",
";",
"type",
"must",
"match",
"min",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/BucketingConfig/Bucket.php#L106-L112 | train |
googleapis/google-cloud-php | Dlp/src/V2/BucketingConfig/Bucket.php | Bucket.setReplacementValue | public function setReplacementValue($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
$this->replacement_value = $var;
return $this;
} | php | public function setReplacementValue($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
$this->replacement_value = $var;
return $this;
} | [
"public",
"function",
"setReplacementValue",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"Value",
"::",
"class",
")",
";",
"$",
"this",
"->",
"replaceme... | Replacement value for this bucket. If not provided
the default behavior will be to hyphenate the min-max range.
Generated from protobuf field <code>.google.privacy.dlp.v2.Value replacement_value = 3;</code>
@param \Google\Cloud\Dlp\V2\Value $var
@return $this | [
"Replacement",
"value",
"for",
"this",
"bucket",
".",
"If",
"not",
"provided",
"the",
"default",
"behavior",
"will",
"be",
"to",
"hyphenate",
"the",
"min",
"-",
"max",
"range",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/BucketingConfig/Bucket.php#L134-L140 | train |
googleapis/google-cloud-php | Talent/src/V4beta1/DeviceInfo.php | DeviceInfo.setDeviceType | public function setDeviceType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\DeviceInfo_DeviceType::class);
$this->device_type = $var;
return $this;
} | php | public function setDeviceType($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\DeviceInfo_DeviceType::class);
$this->device_type = $var;
return $this;
} | [
"public",
"function",
"setDeviceType",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Talent",
"\\",
"V4beta1",
"\\",
"DeviceInfo_DeviceType",
"::",
"class",
")",
";",
"$",
"this",
"->... | Optional.
Type of the device.
Generated from protobuf field <code>.google.cloud.talent.v4beta1.DeviceInfo.DeviceType device_type = 1;</code>
@param int $var
@return $this | [
"Optional",
".",
"Type",
"of",
"the",
"device",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Talent/src/V4beta1/DeviceInfo.php#L76-L82 | train |
googleapis/google-cloud-php | Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php | BigtableTableAdminGapicClient.snapshotName | public static function snapshotName($project, $instance, $cluster, $snapshot)
{
return self::getSnapshotNameTemplate()->render([
'project' => $project,
'instance' => $instance,
'cluster' => $cluster,
'snapshot' => $snapshot,
]);
} | php | public static function snapshotName($project, $instance, $cluster, $snapshot)
{
return self::getSnapshotNameTemplate()->render([
'project' => $project,
'instance' => $instance,
'cluster' => $cluster,
'snapshot' => $snapshot,
]);
} | [
"public",
"static",
"function",
"snapshotName",
"(",
"$",
"project",
",",
"$",
"instance",
",",
"$",
"cluster",
",",
"$",
"snapshot",
")",
"{",
"return",
"self",
"::",
"getSnapshotNameTemplate",
"(",
")",
"->",
"render",
"(",
"[",
"'project'",
"=>",
"$",
... | Formats a string containing the fully-qualified path to represent
a snapshot resource.
@param string $project
@param string $instance
@param string $cluster
@param string $snapshot
@return string The formatted snapshot resource.
@experimental | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"snapshot",
"resource",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/Admin/V2/Gapic/BigtableTableAdminGapicClient.php#L259-L267 | train |
googleapis/google-cloud-php | Dlp/src/V2/InspectDataSourceDetails/RequestedOptions.php | RequestedOptions.setSnapshotInspectTemplate | public function setSnapshotInspectTemplate($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\InspectTemplate::class);
$this->snapshot_inspect_template = $var;
return $this;
} | php | public function setSnapshotInspectTemplate($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\InspectTemplate::class);
$this->snapshot_inspect_template = $var;
return $this;
} | [
"public",
"function",
"setSnapshotInspectTemplate",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkMessage",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"Dlp",
"\\",
"V2",
"\\",
"InspectTemplate",
"::",
"class",
")",
";",
"$",
"this",
"... | If run with an InspectTemplate, a snapshot of its state at the time of
this run.
Generated from protobuf field <code>.google.privacy.dlp.v2.InspectTemplate snapshot_inspect_template = 1;</code>
@param \Google\Cloud\Dlp\V2\InspectTemplate $var
@return $this | [
"If",
"run",
"with",
"an",
"InspectTemplate",
"a",
"snapshot",
"of",
"its",
"state",
"at",
"the",
"time",
"of",
"this",
"run",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Dlp/src/V2/InspectDataSourceDetails/RequestedOptions.php#L65-L71 | train |
googleapis/google-cloud-php | TextToSpeech/src/V1/AudioConfig.php | AudioConfig.setAudioEncoding | public function setAudioEncoding($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AudioEncoding::class);
$this->audio_encoding = $var;
return $this;
} | php | public function setAudioEncoding($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\AudioEncoding::class);
$this->audio_encoding = $var;
return $this;
} | [
"public",
"function",
"setAudioEncoding",
"(",
"$",
"var",
")",
"{",
"GPBUtil",
"::",
"checkEnum",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Cloud",
"\\",
"TextToSpeech",
"\\",
"V1",
"\\",
"AudioEncoding",
"::",
"class",
")",
";",
"$",
"this",
"->",
... | Required. The format of the requested audio byte stream.
Generated from protobuf field <code>.google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1;</code>
@param int $var
@return $this | [
"Required",
".",
"The",
"format",
"of",
"the",
"requested",
"audio",
"byte",
"stream",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/TextToSpeech/src/V1/AudioConfig.php#L144-L150 | train |
googleapis/google-cloud-php | Bigtable/src/V2/Row.php | Row.setFamilies | public function setFamilies($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Family::class);
$this->families = $arr;
return $this;
} | php | public function setFamilies($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\Family::class);
$this->families = $arr;
return $this;
} | [
"public",
"function",
"setFamilies",
"(",
"$",
"var",
")",
"{",
"$",
"arr",
"=",
"GPBUtil",
"::",
"checkRepeatedField",
"(",
"$",
"var",
",",
"\\",
"Google",
"\\",
"Protobuf",
"\\",
"Internal",
"\\",
"GPBType",
"::",
"MESSAGE",
",",
"\\",
"Google",
"\\",... | May be empty, but only if the entire row is empty.
The mutual ordering of column families is not specified.
Generated from protobuf field <code>repeated .google.bigtable.v2.Family families = 2;</code>
@param \Google\Cloud\Bigtable\V2\Family[]|\Google\Protobuf\Internal\RepeatedField $var
@return $this | [
"May",
"be",
"empty",
"but",
"only",
"if",
"the",
"entire",
"row",
"is",
"empty",
".",
"The",
"mutual",
"ordering",
"of",
"column",
"families",
"is",
"not",
"specified",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Bigtable/src/V2/Row.php#L105-L111 | train |
googleapis/google-cloud-php | Core/src/LongRunning/OperationResponseTrait.php | OperationResponseTrait.operationToArray | private function operationToArray($operation, $serializer, array $lroMappers)
{
$response = $operation->getLastProtoResponse();
if (is_null($response)) {
return null;
}
$response = $serializer->encodeMessage($response);
$result = null;
if ($operation->is... | php | private function operationToArray($operation, $serializer, array $lroMappers)
{
$response = $operation->getLastProtoResponse();
if (is_null($response)) {
return null;
}
$response = $serializer->encodeMessage($response);
$result = null;
if ($operation->is... | [
"private",
"function",
"operationToArray",
"(",
"$",
"operation",
",",
"$",
"serializer",
",",
"array",
"$",
"lroMappers",
")",
"{",
"$",
"response",
"=",
"$",
"operation",
"->",
"getLastProtoResponse",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"respo... | Convert a ApiCore OperationResponse object to an array.
@param OperationResponse|GaxOperationResponse $operation The operation response
@param Serializer|GaxSerializer $serializer The serializer to use for gRPC serialization/deserialization.
@param array $lroMappers A list of mappers for deserializing operation result... | [
"Convert",
"a",
"ApiCore",
"OperationResponse",
"object",
"to",
"an",
"array",
"."
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/LongRunning/OperationResponseTrait.php#L40-L64 | train |
googleapis/google-cloud-php | Core/src/LongRunning/OperationResponseTrait.php | OperationResponseTrait.deserializeResult | private function deserializeResult($operation, $type, $serializer, array $mappers)
{
$mappers = array_filter($mappers, function ($mapper) use ($type) {
return $mapper['typeUrl'] === $type;
});
if (count($mappers) === 0) {
throw new \RuntimeException(sprintf('No mappe... | php | private function deserializeResult($operation, $type, $serializer, array $mappers)
{
$mappers = array_filter($mappers, function ($mapper) use ($type) {
return $mapper['typeUrl'] === $type;
});
if (count($mappers) === 0) {
throw new \RuntimeException(sprintf('No mappe... | [
"private",
"function",
"deserializeResult",
"(",
"$",
"operation",
",",
"$",
"type",
",",
"$",
"serializer",
",",
"array",
"$",
"mappers",
")",
"{",
"$",
"mappers",
"=",
"array_filter",
"(",
"$",
"mappers",
",",
"function",
"(",
"$",
"mapper",
")",
"use"... | Convert an operation response to an array
@param OperationResponse|GaxOperationResponse $operation The operation to
serialize.
@param string $type The Operation type. The type should correspond to a
member of $mappers.typeUrl.
@param Serializer|GaxSerializer $serializer The gRPC serializer to use
for the deserializati... | [
"Convert",
"an",
"operation",
"response",
"to",
"an",
"array"
] | ff5030ffa1f12904565509a7bc24ecc0bd794a3e | https://github.com/googleapis/google-cloud-php/blob/ff5030ffa1f12904565509a7bc24ecc0bd794a3e/Core/src/LongRunning/OperationResponseTrait.php#L91-L114 | train |
google/recaptcha | src/ReCaptcha/RequestMethod/CurlPost.php | CurlPost.submit | public function submit(RequestParameters $params)
{
$handle = $this->curl->init($this->siteVerifyUrl);
$options = array(
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params->toQueryString(),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/... | php | public function submit(RequestParameters $params)
{
$handle = $this->curl->init($this->siteVerifyUrl);
$options = array(
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params->toQueryString(),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/... | [
"public",
"function",
"submit",
"(",
"RequestParameters",
"$",
"params",
")",
"{",
"$",
"handle",
"=",
"$",
"this",
"->",
"curl",
"->",
"init",
"(",
"$",
"this",
"->",
"siteVerifyUrl",
")",
";",
"$",
"options",
"=",
"array",
"(",
"CURLOPT_POST",
"=>",
... | Submit the cURL request with the specified parameters.
@param RequestParameters $params Request parameters
@return string Body of the reCAPTCHA response | [
"Submit",
"the",
"cURL",
"request",
"with",
"the",
"specified",
"parameters",
"."
] | 9c17232e45d02e864e94bbc80d1dd346f1f7105e | https://github.com/google/recaptcha/blob/9c17232e45d02e864e94bbc80d1dd346f1f7105e/src/ReCaptcha/RequestMethod/CurlPost.php#L70-L95 | train |
google/recaptcha | src/ReCaptcha/ReCaptcha.php | ReCaptcha.verify | public function verify($response, $remoteIp = null)
{
// Discard empty solution submissions
if (empty($response)) {
$recaptchaResponse = new Response(false, array(self::E_MISSING_INPUT_RESPONSE));
return $recaptchaResponse;
}
$params = new RequestParameters($... | php | public function verify($response, $remoteIp = null)
{
// Discard empty solution submissions
if (empty($response)) {
$recaptchaResponse = new Response(false, array(self::E_MISSING_INPUT_RESPONSE));
return $recaptchaResponse;
}
$params = new RequestParameters($... | [
"public",
"function",
"verify",
"(",
"$",
"response",
",",
"$",
"remoteIp",
"=",
"null",
")",
"{",
"// Discard empty solution submissions",
"if",
"(",
"empty",
"(",
"$",
"response",
")",
")",
"{",
"$",
"recaptchaResponse",
"=",
"new",
"Response",
"(",
"false... | Calls the reCAPTCHA siteverify API to verify whether the user passes
CAPTCHA test and additionally runs any specified additional checks
@param string $response The user response token provided by reCAPTCHA, verifying the user on your site.
@param string $remoteIp The end user's IP address.
@return Response Response fr... | [
"Calls",
"the",
"reCAPTCHA",
"siteverify",
"API",
"to",
"verify",
"whether",
"the",
"user",
"passes",
"CAPTCHA",
"test",
"and",
"additionally",
"runs",
"any",
"specified",
"additional",
"checks"
] | 9c17232e45d02e864e94bbc80d1dd346f1f7105e | https://github.com/google/recaptcha/blob/9c17232e45d02e864e94bbc80d1dd346f1f7105e/src/ReCaptcha/ReCaptcha.php#L147-L197 | train |
laravel/homestead | src/MakeCommand.php | MakeCommand.createSettingsFile | protected function createSettingsFile($format, $options)
{
$SettingsClass = ($format === 'json') ? JsonSettings::class : YamlSettings::class;
$filename = $this->exampleSettingsExists($format) ?
"{$this->basePath}/Homestead.{$format}.example" :
__DIR__."/../resources/Homestea... | php | protected function createSettingsFile($format, $options)
{
$SettingsClass = ($format === 'json') ? JsonSettings::class : YamlSettings::class;
$filename = $this->exampleSettingsExists($format) ?
"{$this->basePath}/Homestead.{$format}.example" :
__DIR__."/../resources/Homestea... | [
"protected",
"function",
"createSettingsFile",
"(",
"$",
"format",
",",
"$",
"options",
")",
"{",
"$",
"SettingsClass",
"=",
"(",
"$",
"format",
"===",
"'json'",
")",
"?",
"JsonSettings",
"::",
"class",
":",
"YamlSettings",
"::",
"class",
";",
"$",
"filena... | Create the homestead settings file.
@param string $format
@param array $options
@return void | [
"Create",
"the",
"homestead",
"settings",
"file",
"."
] | 0c7622a3e2bfe442b8062b3150550fd136f76857 | https://github.com/laravel/homestead/blob/0c7622a3e2bfe442b8062b3150550fd136f76857/src/MakeCommand.php#L193-L212 | train |
laravel/homestead | src/Settings/HomesteadSettings.php | HomesteadSettings.update | public function update($attributes)
{
$this->attributes = array_merge($this->attributes, array_filter($attributes, function ($attribute) {
return ! is_null($attribute);
}));
return $this;
} | php | public function update($attributes)
{
$this->attributes = array_merge($this->attributes, array_filter($attributes, function ($attribute) {
return ! is_null($attribute);
}));
return $this;
} | [
"public",
"function",
"update",
"(",
"$",
"attributes",
")",
"{",
"$",
"this",
"->",
"attributes",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"attributes",
",",
"array_filter",
"(",
"$",
"attributes",
",",
"function",
"(",
"$",
"attribute",
")",
"{",
"r... | Update the homestead settings.
@param array $attributes
@return static | [
"Update",
"the",
"homestead",
"settings",
"."
] | 0c7622a3e2bfe442b8062b3150550fd136f76857 | https://github.com/laravel/homestead/blob/0c7622a3e2bfe442b8062b3150550fd136f76857/src/Settings/HomesteadSettings.php#L46-L53 | train |
laravel/homestead | src/Settings/HomesteadSettings.php | HomesteadSettings.configureSites | public function configureSites($projectName, $projectDirectory)
{
$sites = [
[
'map' => "{$projectName}.test",
'to' => "/home/vagrant/{$projectDirectory}/public",
],
];
if (isset($this->attributes['sites']) && ! empty($this->attributes... | php | public function configureSites($projectName, $projectDirectory)
{
$sites = [
[
'map' => "{$projectName}.test",
'to' => "/home/vagrant/{$projectDirectory}/public",
],
];
if (isset($this->attributes['sites']) && ! empty($this->attributes... | [
"public",
"function",
"configureSites",
"(",
"$",
"projectName",
",",
"$",
"projectDirectory",
")",
"{",
"$",
"sites",
"=",
"[",
"[",
"'map'",
"=>",
"\"{$projectName}.test\"",
",",
"'to'",
"=>",
"\"/home/vagrant/{$projectDirectory}/public\"",
",",
"]",
",",
"]",
... | Configure the nginx sites.
@param string $projectName
@param string $projectDirectory
@return static | [
"Configure",
"the",
"nginx",
"sites",
"."
] | 0c7622a3e2bfe442b8062b3150550fd136f76857 | https://github.com/laravel/homestead/blob/0c7622a3e2bfe442b8062b3150550fd136f76857/src/Settings/HomesteadSettings.php#L101-L141 | train |
laravel/homestead | src/Settings/HomesteadSettings.php | HomesteadSettings.configureSharedFolders | public function configureSharedFolders($projectPath, $projectDirectory)
{
$folders = [
[
'map' => $projectPath,
'to' => "/home/vagrant/{$projectDirectory}",
],
];
if (isset($this->attributes['folders']) && ! empty($this->attributes['fo... | php | public function configureSharedFolders($projectPath, $projectDirectory)
{
$folders = [
[
'map' => $projectPath,
'to' => "/home/vagrant/{$projectDirectory}",
],
];
if (isset($this->attributes['folders']) && ! empty($this->attributes['fo... | [
"public",
"function",
"configureSharedFolders",
"(",
"$",
"projectPath",
",",
"$",
"projectDirectory",
")",
"{",
"$",
"folders",
"=",
"[",
"[",
"'map'",
"=>",
"$",
"projectPath",
",",
"'to'",
"=>",
"\"/home/vagrant/{$projectDirectory}\"",
",",
"]",
",",
"]",
"... | Configure the shared folders.
@param string $projectPath
@param string $projectDirectory
@return static | [
"Configure",
"the",
"shared",
"folders",
"."
] | 0c7622a3e2bfe442b8062b3150550fd136f76857 | https://github.com/laravel/homestead/blob/0c7622a3e2bfe442b8062b3150550fd136f76857/src/Settings/HomesteadSettings.php#L150-L178 | train |
zircote/swagger-php | src/Annotations/AbstractAnnotation.php | AbstractAnnotation.mergeProperties | public function mergeProperties($object)
{
$defaultValues = get_class_vars(get_class($this));
$currentValues = get_object_vars($this);
foreach ($object as $property => $value) {
if ($property === '_context') {
continue;
}
if ($currentValues... | php | public function mergeProperties($object)
{
$defaultValues = get_class_vars(get_class($this));
$currentValues = get_object_vars($this);
foreach ($object as $property => $value) {
if ($property === '_context') {
continue;
}
if ($currentValues... | [
"public",
"function",
"mergeProperties",
"(",
"$",
"object",
")",
"{",
"$",
"defaultValues",
"=",
"get_class_vars",
"(",
"get_class",
"(",
"$",
"this",
")",
")",
";",
"$",
"currentValues",
"=",
"get_object_vars",
"(",
"$",
"this",
")",
";",
"foreach",
"(",... | Merge the properties from the given object into this annotation.
Prevents overwriting properties that are already configured.
@param object $object | [
"Merge",
"the",
"properties",
"from",
"the",
"given",
"object",
"into",
"this",
"annotation",
".",
"Prevents",
"overwriting",
"properties",
"that",
"are",
"already",
"configured",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Annotations/AbstractAnnotation.php#L200-L229 | train |
zircote/swagger-php | src/Annotations/AbstractAnnotation.php | AbstractAnnotation._validate | private static function _validate($fields, $parents, $skip, $baseRef)
{
$valid = true;
$blacklist = [];
if (is_object($fields)) {
if (in_array($fields, $skip, true)) {
return true;
}
$skip[] = $fields;
$blacklist = property_exis... | php | private static function _validate($fields, $parents, $skip, $baseRef)
{
$valid = true;
$blacklist = [];
if (is_object($fields)) {
if (in_array($fields, $skip, true)) {
return true;
}
$skip[] = $fields;
$blacklist = property_exis... | [
"private",
"static",
"function",
"_validate",
"(",
"$",
"fields",
",",
"$",
"parents",
",",
"$",
"skip",
",",
"$",
"baseRef",
")",
"{",
"$",
"valid",
"=",
"true",
";",
"$",
"blacklist",
"=",
"[",
"]",
";",
"if",
"(",
"is_object",
"(",
"$",
"fields"... | Recursively validate all annotation properties.
@param array|object $fields
@param array $parents The path of annotations above this annotation in the tree.
@param array [ $skip] Array with objects which are already validated
@return boolean | [
"Recursively",
"validate",
"all",
"annotation",
"properties",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Annotations/AbstractAnnotation.php#L459-L489 | train |
zircote/swagger-php | src/Annotations/AbstractAnnotation.php | AbstractAnnotation.validateType | private function validateType($type, $value): bool
{
if (substr($type, 0, 1) === '[' && substr($type, -1) === ']') { // Array of a specified type?
if ($this->validateType('array', $value) === false) {
return false;
}
$itemType = substr($type, 1, -1);
... | php | private function validateType($type, $value): bool
{
if (substr($type, 0, 1) === '[' && substr($type, -1) === ']') { // Array of a specified type?
if ($this->validateType('array', $value) === false) {
return false;
}
$itemType = substr($type, 1, -1);
... | [
"private",
"function",
"validateType",
"(",
"$",
"type",
",",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"substr",
"(",
"$",
"type",
",",
"0",
",",
"1",
")",
"===",
"'['",
"&&",
"substr",
"(",
"$",
"type",
",",
"-",
"1",
")",
"===",
"']'",... | Validates the matching of the property value to a annotation type
@param string $type The annotations property type
@param mixed $value The property value
@return bool
@throws \Exception | [
"Validates",
"the",
"matching",
"of",
"the",
"property",
"value",
"to",
"a",
"annotation",
"type"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Annotations/AbstractAnnotation.php#L529-L549 | train |
zircote/swagger-php | src/Annotations/AbstractAnnotation.php | AbstractAnnotation.validateDefaultTypes | private function validateDefaultTypes($type, $value): bool
{
switch ($type) {
case 'string':
return is_string($value);
case 'boolean':
return is_bool($value);
case 'integer':
return is_int($value);
case 'number':... | php | private function validateDefaultTypes($type, $value): bool
{
switch ($type) {
case 'string':
return is_string($value);
case 'boolean':
return is_bool($value);
case 'integer':
return is_int($value);
case 'number':... | [
"private",
"function",
"validateDefaultTypes",
"(",
"$",
"type",
",",
"$",
"value",
")",
":",
"bool",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'string'",
":",
"return",
"is_string",
"(",
"$",
"value",
")",
";",
"case",
"'boolean'",
":",
"ret... | Validates default Open Api types
@param string $type The property type
@param mixed $value The value to validate
@return bool
@throws \Exception | [
"Validates",
"default",
"Open",
"Api",
"types"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Annotations/AbstractAnnotation.php#L560-L580 | train |
zircote/swagger-php | src/Annotations/AbstractAnnotation.php | AbstractAnnotation.validateArrayType | private function validateArrayType($value): bool
{
if (is_array($value) === false) {
return false;
}
$count = 0;
foreach ($value as $i => $item) {
//not a array, but a hash/map
if ($count !== $i) {
return false;
}
... | php | private function validateArrayType($value): bool
{
if (is_array($value) === false) {
return false;
}
$count = 0;
foreach ($value as $i => $item) {
//not a array, but a hash/map
if ($count !== $i) {
return false;
}
... | [
"private",
"function",
"validateArrayType",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"value",
"... | Validate array type
@param mixed $value
@return bool | [
"Validate",
"array",
"type"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Annotations/AbstractAnnotation.php#L589-L603 | train |
zircote/swagger-php | src/Annotations/AbstractAnnotation.php | AbstractAnnotation.nested | private function nested($annotation, $nestedContext)
{
if (property_exists($annotation, '_context') && $annotation->_context === $this->_context) {
$annotation->_context = $nestedContext;
}
return $annotation;
} | php | private function nested($annotation, $nestedContext)
{
if (property_exists($annotation, '_context') && $annotation->_context === $this->_context) {
$annotation->_context = $nestedContext;
}
return $annotation;
} | [
"private",
"function",
"nested",
"(",
"$",
"annotation",
",",
"$",
"nestedContext",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"annotation",
",",
"'_context'",
")",
"&&",
"$",
"annotation",
"->",
"_context",
"===",
"$",
"this",
"->",
"_context",
")"... | Wrap the context with a reference to the annotation it is nested in.
@param AbstractAnnotation $annotation
@param Context $nestedContext
@return AbstractAnnotation | [
"Wrap",
"the",
"context",
"with",
"a",
"reference",
"to",
"the",
"annotation",
"it",
"is",
"nested",
"in",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Annotations/AbstractAnnotation.php#L612-L618 | train |
zircote/swagger-php | src/Processors/InheritProperties.php | InheritProperties.addAllOfProperty | private function addAllOfProperty(Schema $childSchema, Schema $parentSchema)
{
$currentSchema = new Schema(['_context' => $childSchema->_context]);
$currentSchema->mergeProperties($childSchema);
$defaultValues = get_class_vars(Schema::class);
foreach (get_object_vars($currentSchem... | php | private function addAllOfProperty(Schema $childSchema, Schema $parentSchema)
{
$currentSchema = new Schema(['_context' => $childSchema->_context]);
$currentSchema->mergeProperties($childSchema);
$defaultValues = get_class_vars(Schema::class);
foreach (get_object_vars($currentSchem... | [
"private",
"function",
"addAllOfProperty",
"(",
"Schema",
"$",
"childSchema",
",",
"Schema",
"$",
"parentSchema",
")",
"{",
"$",
"currentSchema",
"=",
"new",
"Schema",
"(",
"[",
"'_context'",
"=>",
"$",
"childSchema",
"->",
"_context",
"]",
")",
";",
"$",
... | Add to child schema allOf property
@param \OpenApi\Annotations\Schema $childSchema
@param \OpenApi\Annotations\Schema $parentSchema | [
"Add",
"to",
"child",
"schema",
"allOf",
"property"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Processors/InheritProperties.php#L84-L108 | train |
zircote/swagger-php | src/Analyser.php | Analyser.fromComment | public function fromComment($comment, $context = null)
{
if ($context === null) {
$context = new Context(['comment' => $comment]);
} else {
$context->comment = $comment;
}
try {
self::$context = $context;
if ($context->is('annotations')... | php | public function fromComment($comment, $context = null)
{
if ($context === null) {
$context = new Context(['comment' => $comment]);
} else {
$context->comment = $comment;
}
try {
self::$context = $context;
if ($context->is('annotations')... | [
"public",
"function",
"fromComment",
"(",
"$",
"comment",
",",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"context",
"===",
"null",
")",
"{",
"$",
"context",
"=",
"new",
"Context",
"(",
"[",
"'comment'",
"=>",
"$",
"comment",
"]",
")",
... | Use doctrine to parse the comment block and return the detected annotations.
@param string $comment a T_DOC_COMMENT.
@param Context $context
@return array Annotations | [
"Use",
"doctrine",
"to",
"parse",
"the",
"comment",
"block",
"and",
"return",
"the",
"detected",
"annotations",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Analyser.php#L89-L128 | train |
zircote/swagger-php | src/Serializer.php | Serializer.deserialize | public function deserialize($jsonString, $className)
{
if (!$this->isValidClassName($className)) {
throw new \Exception($className.' is not defined in OpenApi PHP Annotations');
}
return $this->doDeserialize(json_decode($jsonString), $className);
} | php | public function deserialize($jsonString, $className)
{
if (!$this->isValidClassName($className)) {
throw new \Exception($className.' is not defined in OpenApi PHP Annotations');
}
return $this->doDeserialize(json_decode($jsonString), $className);
} | [
"public",
"function",
"deserialize",
"(",
"$",
"jsonString",
",",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValidClassName",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"$",
"className",
".",
"'... | Deserialize a string
@param $jsonString
@param $className
@return Annotations\AbstractAnnotation
@throws \Exception | [
"Deserialize",
"a",
"string"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Serializer.php#L83-L89 | train |
zircote/swagger-php | src/Serializer.php | Serializer.deserializeFile | public function deserializeFile($filename, $className = 'OpenApi\Annotations\OpenApi')
{
if (!$this->isValidClassName($className)) {
throw new \Exception($className.' is not defined in OpenApi PHP Annotations');
}
$jsonString = file_get_contents($filename);
return $this->... | php | public function deserializeFile($filename, $className = 'OpenApi\Annotations\OpenApi')
{
if (!$this->isValidClassName($className)) {
throw new \Exception($className.' is not defined in OpenApi PHP Annotations');
}
$jsonString = file_get_contents($filename);
return $this->... | [
"public",
"function",
"deserializeFile",
"(",
"$",
"filename",
",",
"$",
"className",
"=",
"'OpenApi\\Annotations\\OpenApi'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValidClassName",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"new",
"\\",
"Except... | Deserialize a file
@param $filename
@param $className
@return Annotations\AbstractAnnotation
@throws \Exception | [
"Deserialize",
"a",
"file"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Serializer.php#L101-L108 | train |
zircote/swagger-php | src/Serializer.php | Serializer.doDeserialize | private function doDeserialize(\stdClass $c, $class)
{
$annotation = new $class([]);
foreach ($c as $property => $value) {
if ($property === '$ref') {
$property = 'ref';
}
if (substr($property, 0, 2) === 'x-') {
if ($annotation->x ... | php | private function doDeserialize(\stdClass $c, $class)
{
$annotation = new $class([]);
foreach ($c as $property => $value) {
if ($property === '$ref') {
$property = 'ref';
}
if (substr($property, 0, 2) === 'x-') {
if ($annotation->x ... | [
"private",
"function",
"doDeserialize",
"(",
"\\",
"stdClass",
"$",
"c",
",",
"$",
"class",
")",
"{",
"$",
"annotation",
"=",
"new",
"$",
"class",
"(",
"[",
"]",
")",
";",
"foreach",
"(",
"$",
"c",
"as",
"$",
"property",
"=>",
"$",
"value",
")",
... | Do deserialization.
@param \stdClass $c
@param string $class The class name of annotation.
@return Annotations\AbstractAnnotation | [
"Do",
"deserialization",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Serializer.php#L118-L137 | train |
zircote/swagger-php | src/Serializer.php | Serializer.doDeserializeProperty | private function doDeserializeProperty(Annotations\AbstractAnnotation $annotation, $property, $value)
{
// property is primitive type
if (array_key_exists($property, $annotation::$_types)) {
return $this->doDeserializeBaseProperty($annotation::$_types[$property], $value);
}
... | php | private function doDeserializeProperty(Annotations\AbstractAnnotation $annotation, $property, $value)
{
// property is primitive type
if (array_key_exists($property, $annotation::$_types)) {
return $this->doDeserializeBaseProperty($annotation::$_types[$property], $value);
}
... | [
"private",
"function",
"doDeserializeProperty",
"(",
"Annotations",
"\\",
"AbstractAnnotation",
"$",
"annotation",
",",
"$",
"property",
",",
"$",
"value",
")",
"{",
"// property is primitive type",
"if",
"(",
"array_key_exists",
"(",
"$",
"property",
",",
"$",
"a... | Deserialize the annotation's property.
@param Annotations\AbstractAnnotation $annotation
@param string $property
@param mixed $value
@return mixed | [
"Deserialize",
"the",
"annotation",
"s",
"property",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Serializer.php#L148-L184 | train |
zircote/swagger-php | src/Serializer.php | Serializer.doDeserializeBaseProperty | private function doDeserializeBaseProperty($type, $value)
{
$isAnnotationClass = is_string($type) && is_subclass_of(trim($type, '[]'), AbstractAnnotation::class);
if ($isAnnotationClass) {
$isArray = strpos($type, '[') === 0 && substr($type, -1) === ']';
if ($isArray) {
... | php | private function doDeserializeBaseProperty($type, $value)
{
$isAnnotationClass = is_string($type) && is_subclass_of(trim($type, '[]'), AbstractAnnotation::class);
if ($isAnnotationClass) {
$isArray = strpos($type, '[') === 0 && substr($type, -1) === ']';
if ($isArray) {
... | [
"private",
"function",
"doDeserializeBaseProperty",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"$",
"isAnnotationClass",
"=",
"is_string",
"(",
"$",
"type",
")",
"&&",
"is_subclass_of",
"(",
"trim",
"(",
"$",
"type",
",",
"'[]'",
")",
",",
"AbstractAnn... | Deserialize base annotation property
@param string $type The property type
@param mixed $value The value to deserialization
@return array|\OpenApi\Annotations\AbstractAnnotation | [
"Deserialize",
"base",
"annotation",
"property"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Serializer.php#L194-L215 | train |
zircote/swagger-php | src/Context.php | Context.with | public function with($property)
{
if (property_exists($this, $property)) {
return $this;
}
if ($this->_parent) {
return $this->_parent->with($property);
}
return false;
} | php | public function with($property)
{
if (property_exists($this, $property)) {
return $this;
}
if ($this->_parent) {
return $this->_parent->with($property);
}
return false;
} | [
"public",
"function",
"with",
"(",
"$",
"property",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"property",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"_parent",
")",
"{",
"return",
"$",
... | Return the context containing the specified property.
@param string $property
@return boolean|Context | [
"Return",
"the",
"context",
"containing",
"the",
"specified",
"property",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Context.php#L88-L98 | train |
zircote/swagger-php | src/Context.php | Context.getDebugLocation | public function getDebugLocation()
{
$location = '';
if ($this->class && ($this->method || $this->property)) {
$location .= $this->fullyQualifiedName($this->class);
if ($this->method) {
$location .= ($this->static ? '::' : '->') . $this->method . '()';
... | php | public function getDebugLocation()
{
$location = '';
if ($this->class && ($this->method || $this->property)) {
$location .= $this->fullyQualifiedName($this->class);
if ($this->method) {
$location .= ($this->static ? '::' : '->') . $this->method . '()';
... | [
"public",
"function",
"getDebugLocation",
"(",
")",
"{",
"$",
"location",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"class",
"&&",
"(",
"$",
"this",
"->",
"method",
"||",
"$",
"this",
"->",
"property",
")",
")",
"{",
"$",
"location",
".=",
"$",... | Export location for debugging.
@return string Example: "file1.php on line 12" | [
"Export",
"location",
"for",
"debugging",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Context.php#L117-L145 | train |
zircote/swagger-php | src/Context.php | Context.phpdocSummary | public function phpdocSummary()
{
$content = $this->phpdocContent();
if (!$content) {
return UNDEFINED;
}
$lines = preg_split('/(\n|\r\n)/', $content);
$summary = '';
foreach ($lines as $line) {
$summary .= $line . "\n";
if ($line =... | php | public function phpdocSummary()
{
$content = $this->phpdocContent();
if (!$content) {
return UNDEFINED;
}
$lines = preg_split('/(\n|\r\n)/', $content);
$summary = '';
foreach ($lines as $line) {
$summary .= $line . "\n";
if ($line =... | [
"public",
"function",
"phpdocSummary",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"phpdocContent",
"(",
")",
";",
"if",
"(",
"!",
"$",
"content",
")",
"{",
"return",
"UNDEFINED",
";",
"}",
"$",
"lines",
"=",
"preg_split",
"(",
"'/(\\n|\\r\\... | A short piece of text, usually one line, providing the basic function of the associated element.
@return string | [
"A",
"short",
"piece",
"of",
"text",
"usually",
"one",
"line",
"providing",
"the",
"basic",
"function",
"of",
"the",
"associated",
"element",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Context.php#L178-L198 | train |
zircote/swagger-php | src/Context.php | Context.detect | public static function detect($index = 0)
{
$context = new Context();
$backtrace = debug_backtrace();
$position = $backtrace[$index];
if (isset($position['file'])) {
$context->filename = $position['file'];
}
if (isset($position['line'])) {
$con... | php | public static function detect($index = 0)
{
$context = new Context();
$backtrace = debug_backtrace();
$position = $backtrace[$index];
if (isset($position['file'])) {
$context->filename = $position['file'];
}
if (isset($position['line'])) {
$con... | [
"public",
"static",
"function",
"detect",
"(",
"$",
"index",
"=",
"0",
")",
"{",
"$",
"context",
"=",
"new",
"Context",
"(",
")",
";",
"$",
"backtrace",
"=",
"debug_backtrace",
"(",
")",
";",
"$",
"position",
"=",
"$",
"backtrace",
"[",
"$",
"index",... | Create a Context based on the debug_backtrace
@param int $index
@return Context | [
"Create",
"a",
"Context",
"based",
"on",
"the",
"debug_backtrace"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Context.php#L259-L287 | train |
zircote/swagger-php | src/Context.php | Context.fullyQualifiedName | public function fullyQualifiedName($class)
{
if ($this->namespace) {
$namespace = str_replace('\\\\', '\\', '\\' . $this->namespace . '\\');
} else {
$namespace = '\\'; // global namespace
}
if ($this->class === null) {
$this->class = '';
... | php | public function fullyQualifiedName($class)
{
if ($this->namespace) {
$namespace = str_replace('\\\\', '\\', '\\' . $this->namespace . '\\');
} else {
$namespace = '\\'; // global namespace
}
if ($this->class === null) {
$this->class = '';
... | [
"public",
"function",
"fullyQualifiedName",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"namespace",
")",
"{",
"$",
"namespace",
"=",
"str_replace",
"(",
"'\\\\\\\\'",
",",
"'\\\\'",
",",
"'\\\\'",
".",
"$",
"this",
"->",
"namespace",
".",... | Resolve the fully qualified name.
@param string $class The class name
@return string | [
"Resolve",
"the",
"fully",
"qualified",
"name",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Context.php#L296-L341 | train |
zircote/swagger-php | src/Analysis.php | Analysis.getTraitsOfClass | public function getTraitsOfClass($class)
{
$definitions = [];
// in case there is a hierarchy of classes
$classes = $this->getSuperClasses($class);
if (is_array($classes)) {
foreach ($classes as $subClass) {
if (isset($subClass['traits'])) {
... | php | public function getTraitsOfClass($class)
{
$definitions = [];
// in case there is a hierarchy of classes
$classes = $this->getSuperClasses($class);
if (is_array($classes)) {
foreach ($classes as $subClass) {
if (isset($subClass['traits'])) {
... | [
"public",
"function",
"getTraitsOfClass",
"(",
"$",
"class",
")",
"{",
"$",
"definitions",
"=",
"[",
"]",
";",
"// in case there is a hierarchy of classes",
"$",
"classes",
"=",
"$",
"this",
"->",
"getSuperClasses",
"(",
"$",
"class",
")",
";",
"if",
"(",
"i... | Returns an array of traits used by the given class or by classes which it extends
@param string $class
@return array | [
"Returns",
"an",
"array",
"of",
"traits",
"used",
"by",
"the",
"given",
"class",
"or",
"by",
"classes",
"which",
"it",
"extends"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Analysis.php#L207-L244 | train |
zircote/swagger-php | src/Analysis.php | Analysis.merged | public function merged()
{
if (!$this->openapi) {
throw new Exception('No openapi target set. Run the MergeIntoOpenApi processor');
}
$unmerged = $this->openapi->_unmerged;
$this->openapi->_unmerged = [];
$analysis = new Analysis([$this->openapi]);
$this->... | php | public function merged()
{
if (!$this->openapi) {
throw new Exception('No openapi target set. Run the MergeIntoOpenApi processor');
}
$unmerged = $this->openapi->_unmerged;
$this->openapi->_unmerged = [];
$analysis = new Analysis([$this->openapi]);
$this->... | [
"public",
"function",
"merged",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"openapi",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'No openapi target set. Run the MergeIntoOpenApi processor'",
")",
";",
"}",
"$",
"unmerged",
"=",
"$",
"this",
"->",
"o... | Build an analysis with only the annotations that are merged into the OpenAPI annotation.
@return Analysis | [
"Build",
"an",
"analysis",
"with",
"only",
"the",
"annotations",
"that",
"are",
"merged",
"into",
"the",
"OpenAPI",
"annotation",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Analysis.php#L302-L313 | train |
zircote/swagger-php | src/Analysis.php | Analysis.split | public function split()
{
$result = new stdClass();
$result->merged = $this->merged();
$result->unmerged = new Analysis();
foreach ($this->annotations as $annotation) {
if ($result->merged->annotations->contains($annotation) === false) {
$result->unmerged-... | php | public function split()
{
$result = new stdClass();
$result->merged = $this->merged();
$result->unmerged = new Analysis();
foreach ($this->annotations as $annotation) {
if ($result->merged->annotations->contains($annotation) === false) {
$result->unmerged-... | [
"public",
"function",
"split",
"(",
")",
"{",
"$",
"result",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"result",
"->",
"merged",
"=",
"$",
"this",
"->",
"merged",
"(",
")",
";",
"$",
"result",
"->",
"unmerged",
"=",
"new",
"Analysis",
"(",
")",
... | Split the annotation into two analysis.
One with annotations that are merged and one with annotations that are not merged.
@return object {merged: Analysis, unmerged: Analysis} | [
"Split",
"the",
"annotation",
"into",
"two",
"analysis",
".",
"One",
"with",
"annotations",
"that",
"are",
"merged",
"and",
"one",
"with",
"annotations",
"that",
"are",
"not",
"merged",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Analysis.php#L331-L343 | train |
zircote/swagger-php | src/Analysis.php | Analysis.& | public static function &processors()
{
if (!self::$processors) {
// Add default processors.
self::$processors = [
new MergeIntoOpenApi(),
new MergeIntoComponents(),
new ImportTraits(),
new AugmentSchemas(),
... | php | public static function &processors()
{
if (!self::$processors) {
// Add default processors.
self::$processors = [
new MergeIntoOpenApi(),
new MergeIntoComponents(),
new ImportTraits(),
new AugmentSchemas(),
... | [
"public",
"static",
"function",
"&",
"processors",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"processors",
")",
"{",
"// Add default processors.",
"self",
"::",
"$",
"processors",
"=",
"[",
"new",
"MergeIntoOpenApi",
"(",
")",
",",
"new",
"MergeInt... | Get direct access to the processors array.
@return array reference | [
"Get",
"direct",
"access",
"to",
"the",
"processors",
"array",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Analysis.php#L368-L392 | train |
zircote/swagger-php | src/Analysis.php | Analysis.unregisterProcessor | public static function unregisterProcessor($processor)
{
$processors = &self::processors();
$key = array_search($processor, $processors, true);
if ($key === false) {
throw new Exception('Given processor was not registered');
}
unset($processors[$key]);
} | php | public static function unregisterProcessor($processor)
{
$processors = &self::processors();
$key = array_search($processor, $processors, true);
if ($key === false) {
throw new Exception('Given processor was not registered');
}
unset($processors[$key]);
} | [
"public",
"static",
"function",
"unregisterProcessor",
"(",
"$",
"processor",
")",
"{",
"$",
"processors",
"=",
"&",
"self",
"::",
"processors",
"(",
")",
";",
"$",
"key",
"=",
"array_search",
"(",
"$",
"processor",
",",
"$",
"processors",
",",
"true",
"... | Unregister a processor
@param Closure $processor | [
"Unregister",
"a",
"processor"
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Analysis.php#L409-L417 | train |
zircote/swagger-php | src/StaticAnalyser.php | StaticAnalyser.fromFile | public function fromFile($filename)
{
if (function_exists('opcache_get_status') && function_exists('opcache_get_configuration')) {
if (empty($GLOBALS['openapi_opcache_warning'])) {
$GLOBALS['openapi_opcache_warning'] = true;
$status = opcache_get_status();
... | php | public function fromFile($filename)
{
if (function_exists('opcache_get_status') && function_exists('opcache_get_configuration')) {
if (empty($GLOBALS['openapi_opcache_warning'])) {
$GLOBALS['openapi_opcache_warning'] = true;
$status = opcache_get_status();
... | [
"public",
"function",
"fromFile",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'opcache_get_status'",
")",
"&&",
"function_exists",
"(",
"'opcache_get_configuration'",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"GLOBALS",
"[",
"'openap... | Extract and process all doc-comments from a file.
@param string $filename Path to a php file.
@return Analysis | [
"Extract",
"and",
"process",
"all",
"doc",
"-",
"comments",
"from",
"a",
"file",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/StaticAnalyser.php#L31-L46 | train |
zircote/swagger-php | src/StaticAnalyser.php | StaticAnalyser.fromCode | public function fromCode($code, $context)
{
$tokens = token_get_all($code);
return $this->fromTokens($tokens, $context);
} | php | public function fromCode($code, $context)
{
$tokens = token_get_all($code);
return $this->fromTokens($tokens, $context);
} | [
"public",
"function",
"fromCode",
"(",
"$",
"code",
",",
"$",
"context",
")",
"{",
"$",
"tokens",
"=",
"token_get_all",
"(",
"$",
"code",
")",
";",
"return",
"$",
"this",
"->",
"fromTokens",
"(",
"$",
"tokens",
",",
"$",
"context",
")",
";",
"}"
] | Extract and process all doc-comments from the contents.
@param string $code PHP code. (including <?php tags)
@param Context $context The original location of the contents.
@return Analysis | [
"Extract",
"and",
"process",
"all",
"doc",
"-",
"comments",
"from",
"the",
"contents",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/StaticAnalyser.php#L56-L61 | train |
zircote/swagger-php | src/StaticAnalyser.php | StaticAnalyser.nextToken | private function nextToken(&$tokens, $context)
{
while (true) {
$token = next($tokens);
if ($token[0] === T_WHITESPACE) {
continue;
}
if ($token[0] === T_COMMENT) {
$pos = strpos($token[1], '@OA\\');
if ($pos) {
... | php | private function nextToken(&$tokens, $context)
{
while (true) {
$token = next($tokens);
if ($token[0] === T_WHITESPACE) {
continue;
}
if ($token[0] === T_COMMENT) {
$pos = strpos($token[1], '@OA\\');
if ($pos) {
... | [
"private",
"function",
"nextToken",
"(",
"&",
"$",
"tokens",
",",
"$",
"context",
")",
"{",
"while",
"(",
"true",
")",
"{",
"$",
"token",
"=",
"next",
"(",
"$",
"tokens",
")",
";",
"if",
"(",
"$",
"token",
"[",
"0",
"]",
"===",
"T_WHITESPACE",
")... | The next non-whitespace, non-comment token.
@param array $tokens
@param Context $context
@return string|array The next token (or false) | [
"The",
"next",
"non",
"-",
"whitespace",
"non",
"-",
"comment",
"token",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/StaticAnalyser.php#L325-L344 | train |
zircote/swagger-php | src/Annotations/OpenApi.php | OpenApi.saveAs | public function saveAs($filename, $format = 'auto')
{
if ($format === 'auto') {
$format = strtolower(substr($filename, -5)) === '.json' ? 'json' : 'yaml';
}
if (strtolower($format) === 'json') {
$content = $this->toJson();
} else {
$content = $t... | php | public function saveAs($filename, $format = 'auto')
{
if ($format === 'auto') {
$format = strtolower(substr($filename, -5)) === '.json' ? 'json' : 'yaml';
}
if (strtolower($format) === 'json') {
$content = $this->toJson();
} else {
$content = $t... | [
"public",
"function",
"saveAs",
"(",
"$",
"filename",
",",
"$",
"format",
"=",
"'auto'",
")",
"{",
"if",
"(",
"$",
"format",
"===",
"'auto'",
")",
"{",
"$",
"format",
"=",
"strtolower",
"(",
"substr",
"(",
"$",
"filename",
",",
"-",
"5",
")",
")",
... | Save the OpenAPI documentation to a file.
@param string $filename
@throws Exception | [
"Save",
"the",
"OpenAPI",
"documentation",
"to",
"a",
"file",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Annotations/OpenApi.php#L143-L157 | train |
zircote/swagger-php | src/Util.php | Util.removePrefix | private static function removePrefix($str, $prefix)
{
if (substr($str, 0, strlen($prefix)) == $prefix) {
return substr($str, strlen($prefix));
}
return null;
} | php | private static function removePrefix($str, $prefix)
{
if (substr($str, 0, strlen($prefix)) == $prefix) {
return substr($str, strlen($prefix));
}
return null;
} | [
"private",
"static",
"function",
"removePrefix",
"(",
"$",
"str",
",",
"$",
"prefix",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"str",
",",
"0",
",",
"strlen",
"(",
"$",
"prefix",
")",
")",
"==",
"$",
"prefix",
")",
"{",
"return",
"substr",
"(",
"... | Removes a prefix from the start of a string if it exists, or null otherwise.
@param string $str
@param string $prefix
@return null|string | [
"Removes",
"a",
"prefix",
"from",
"the",
"start",
"of",
"a",
"string",
"if",
"it",
"exists",
"or",
"null",
"otherwise",
"."
] | 29e913a345932c7dbe2be531377b58b667ae374f | https://github.com/zircote/swagger-php/blob/29e913a345932c7dbe2be531377b58b667ae374f/src/Util.php#L55-L61 | train |
orchidsoftware/platform | src/Platform/ItemMenu.php | ItemMenu.route | public function route(string $name, array $parameters = [], bool $absolute = true): self
{
$this->route = route($name, $parameters, $absolute);
$this->active([$this->route, $this->route.'/*']);
return $this;
} | php | public function route(string $name, array $parameters = [], bool $absolute = true): self
{
$this->route = route($name, $parameters, $absolute);
$this->active([$this->route, $this->route.'/*']);
return $this;
} | [
"public",
"function",
"route",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"bool",
"$",
"absolute",
"=",
"true",
")",
":",
"self",
"{",
"$",
"this",
"->",
"route",
"=",
"route",
"(",
"$",
"name",
",",
"$",
"pa... | Generate the URL to a named route.
@param string $name
@param array $parameters
@param bool $absolute
@return ItemMenu | [
"Generate",
"the",
"URL",
"to",
"a",
"named",
"route",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/ItemMenu.php#L156-L163 | train |
orchidsoftware/platform | src/Screen/Fields/Picture.php | Picture.targetId | public function targetId(): self
{
$this->set('target', 'id');
$this->addBeforeRender(function () {
$value = (string) $this->get('value');
if (! ctype_digit($value)) {
return;
}
/** @var Attachment $attach */
$attach = Da... | php | public function targetId(): self
{
$this->set('target', 'id');
$this->addBeforeRender(function () {
$value = (string) $this->get('value');
if (! ctype_digit($value)) {
return;
}
/** @var Attachment $attach */
$attach = Da... | [
"public",
"function",
"targetId",
"(",
")",
":",
"self",
"{",
"$",
"this",
"->",
"set",
"(",
"'target'",
",",
"'id'",
")",
";",
"$",
"this",
"->",
"addBeforeRender",
"(",
"function",
"(",
")",
"{",
"$",
"value",
"=",
"(",
"string",
")",
"$",
"this"... | The stored value will be in the form
of id attachment.
@return self | [
"The",
"stored",
"value",
"will",
"be",
"in",
"the",
"form",
"of",
"id",
"attachment",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Screen/Fields/Picture.php#L83-L103 | train |
orchidsoftware/platform | src/Platform/Menu.php | Menu.add | public function add(string $place, ItemMenu $itemMenu)
{
$arg = get_object_vars($itemMenu);
if (array_key_exists('show', $arg) && ! $arg['show']) {
return $this;
}
$this->location = $place;
$this->arg = $arg;
$this->sort = $arg['sort'];
$this->i... | php | public function add(string $place, ItemMenu $itemMenu)
{
$arg = get_object_vars($itemMenu);
if (array_key_exists('show', $arg) && ! $arg['show']) {
return $this;
}
$this->location = $place;
$this->arg = $arg;
$this->sort = $arg['sort'];
$this->i... | [
"public",
"function",
"add",
"(",
"string",
"$",
"place",
",",
"ItemMenu",
"$",
"itemMenu",
")",
"{",
"$",
"arg",
"=",
"get_object_vars",
"(",
"$",
"itemMenu",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'show'",
",",
"$",
"arg",
")",
"&&",
"!",
"... | Adding a new element to the container.
@param string $place
@param ItemMenu $itemMenu
@return $this | [
"Adding",
"a",
"new",
"element",
"to",
"the",
"container",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Menu.php#L79-L100 | train |
orchidsoftware/platform | src/Platform/Menu.php | Menu.render | public function render(string $location, string $template = 'platform::partials.mainMenu'): string
{
$this->checkAccess();
return $this->findAllChildren($location)
->sortBy('sort')
->map(function ($value) use ($template) {
return view($template, $value)->rend... | php | public function render(string $location, string $template = 'platform::partials.mainMenu'): string
{
$this->checkAccess();
return $this->findAllChildren($location)
->sortBy('sort')
->map(function ($value) use ($template) {
return view($template, $value)->rend... | [
"public",
"function",
"render",
"(",
"string",
"$",
"location",
",",
"string",
"$",
"template",
"=",
"'platform::partials.mainMenu'",
")",
":",
"string",
"{",
"$",
"this",
"->",
"checkAccess",
"(",
")",
";",
"return",
"$",
"this",
"->",
"findAllChildren",
"(... | Generate on the menu display.
@param string $location
@param string $template
@return string | [
"Generate",
"on",
"the",
"menu",
"display",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Menu.php#L110-L120 | train |
orchidsoftware/platform | src/Platform/Http/Controllers/Systems/ResourceController.php | ResourceController.show | public function show(string $package, string $path, Dashboard $dashboard)
{
$dir = $dashboard
->getPublicDirectory()
->get($package);
abort_if(is_null($dir), 404);
$resources = (new Finder())
->ignoreUnreadableDirs()
->followLinks()
... | php | public function show(string $package, string $path, Dashboard $dashboard)
{
$dir = $dashboard
->getPublicDirectory()
->get($package);
abort_if(is_null($dir), 404);
$resources = (new Finder())
->ignoreUnreadableDirs()
->followLinks()
... | [
"public",
"function",
"show",
"(",
"string",
"$",
"package",
",",
"string",
"$",
"path",
",",
"Dashboard",
"$",
"dashboard",
")",
"{",
"$",
"dir",
"=",
"$",
"dashboard",
"->",
"getPublicDirectory",
"(",
")",
"->",
"get",
"(",
"$",
"package",
")",
";",
... | Serve the requested resource.
@param string $package
@param string $path
@param Dashboard $dashboard
@return \Symfony\Component\HttpFoundation\BinaryFileResponse | [
"Serve",
"the",
"requested",
"resource",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Http/Controllers/Systems/ResourceController.php#L31-L61 | train |
orchidsoftware/platform | src/Press/Models/Post.php | Post.getEntityObject | public function getEntityObject($slug = null)
{
if (! is_null($this->entity)) {
return $this->entity;
}
return $this->getEntity($slug ?? $this->getAttribute('type'))->entity;
} | php | public function getEntityObject($slug = null)
{
if (! is_null($this->entity)) {
return $this->entity;
}
return $this->getEntity($slug ?? $this->getAttribute('type'))->entity;
} | [
"public",
"function",
"getEntityObject",
"(",
"$",
"slug",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"entity",
")",
")",
"{",
"return",
"$",
"this",
"->",
"entity",
";",
"}",
"return",
"$",
"this",
"->",
"getEntity",
... | Get Behavior Class.
@param string|null $slug
@throws \Throwable|EntityTypeException
@return \Orchid\Press\Entities\Many|\Orchid\Press\Entities\Single|null | [
"Get",
"Behavior",
"Class",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Press/Models/Post.php#L178-L185 | train |
orchidsoftware/platform | src/Press/Builders/TaxonomyBuilder.php | TaxonomyBuilder.slug | public function slug($slug = null): self
{
if (! empty($slug)) {
// set this slug to be used in with callback
$this->slug = $slug;
// exception to filter on specific slug
$exception = function ($query) {
$query->where('slug', '=', $this->slug)... | php | public function slug($slug = null): self
{
if (! empty($slug)) {
// set this slug to be used in with callback
$this->slug = $slug;
// exception to filter on specific slug
$exception = function ($query) {
$query->where('slug', '=', $this->slug)... | [
"public",
"function",
"slug",
"(",
"$",
"slug",
"=",
"null",
")",
":",
"self",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"slug",
")",
")",
"{",
"// set this slug to be used in with callback",
"$",
"this",
"->",
"slug",
"=",
"$",
"slug",
";",
"// exception ... | Get a term taxonomy by specific slug.
@param string
@return \Orchid\Press\Builders\TaxonomyBuilder | [
"Get",
"a",
"term",
"taxonomy",
"by",
"specific",
"slug",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Press/Builders/TaxonomyBuilder.php#L43-L59 | train |
orchidsoftware/platform | src/Screen/Fields/DateTimer.php | DateTimer.noCalendar | public function noCalendar(bool $noCalendar = true) : self
{
$this->enableTime();
$this->set('data-fields--datetime-no-calendar', var_export($noCalendar, true));
return $this;
} | php | public function noCalendar(bool $noCalendar = true) : self
{
$this->enableTime();
$this->set('data-fields--datetime-no-calendar', var_export($noCalendar, true));
return $this;
} | [
"public",
"function",
"noCalendar",
"(",
"bool",
"$",
"noCalendar",
"=",
"true",
")",
":",
"self",
"{",
"$",
"this",
"->",
"enableTime",
"(",
")",
";",
"$",
"this",
"->",
"set",
"(",
"'data-fields--datetime-no-calendar'",
",",
"var_export",
"(",
"$",
"noCa... | Disable calendar for the field and show only time.
@param bool $noCalendar
@return $this | [
"Disable",
"calendar",
"for",
"the",
"field",
"and",
"show",
"only",
"time",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Screen/Fields/DateTimer.php#L169-L175 | train |
orchidsoftware/platform | src/Press/Entities/Many.php | Many.getFilters | public function getFilters(): Collection
{
$filters = collect();
foreach ($this->filters() as $filter) {
$filter = new $filter($this);
$filters->push($filter);
}
return $filters;
} | php | public function getFilters(): Collection
{
$filters = collect();
foreach ($this->filters() as $filter) {
$filter = new $filter($this);
$filters->push($filter);
}
return $filters;
} | [
"public",
"function",
"getFilters",
"(",
")",
":",
"Collection",
"{",
"$",
"filters",
"=",
"collect",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"(",
")",
"as",
"$",
"filter",
")",
"{",
"$",
"filter",
"=",
"new",
"$",
"filter",
"(... | Get all the filters.
@return Collection | [
"Get",
"all",
"the",
"filters",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Press/Entities/Many.php#L66-L75 | train |
orchidsoftware/platform | src/Platform/Updates.php | Updates.getStatus | public function getStatus(): bool
{
foreach ($this->requestVersion() as $key => $version) {
if (! Str::contains($key, 'dev')) {
continue;
}
if (version_compare($version['version'], $this->currentVersion, '>')) {
return true;
}
... | php | public function getStatus(): bool
{
foreach ($this->requestVersion() as $key => $version) {
if (! Str::contains($key, 'dev')) {
continue;
}
if (version_compare($version['version'], $this->currentVersion, '>')) {
return true;
}
... | [
"public",
"function",
"getStatus",
"(",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"requestVersion",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"Str",
"::",
"contains",
"(",
"$",
"key",
",",
"'dev'",
... | Verify that the version of the package
you are using is the latest version.
@return bool | [
"Verify",
"that",
"the",
"version",
"of",
"the",
"package",
"you",
"are",
"using",
"is",
"the",
"latest",
"version",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Updates.php#L93-L106 | train |
orchidsoftware/platform | src/Platform/Updates.php | Updates.requestVersion | public function requestVersion(): array
{
try {
$versions = json_decode(file_get_contents($this->apiURL), true)['packages']['orchid/platform'];
return array_reverse($versions);
} catch (\Exception $exception) {
Log::alert($exception->getMessage());
r... | php | public function requestVersion(): array
{
try {
$versions = json_decode(file_get_contents($this->apiURL), true)['packages']['orchid/platform'];
return array_reverse($versions);
} catch (\Exception $exception) {
Log::alert($exception->getMessage());
r... | [
"public",
"function",
"requestVersion",
"(",
")",
":",
"array",
"{",
"try",
"{",
"$",
"versions",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
"apiURL",
")",
",",
"true",
")",
"[",
"'packages'",
"]",
"[",
"'orchid/platform'",
"]",
... | Make a request for Packagist API.
@return array | [
"Make",
"a",
"request",
"for",
"Packagist",
"API",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Updates.php#L113-L124 | train |
orchidsoftware/platform | src/Screen/Builder.php | Builder.generateForm | public function generateForm(): string
{
foreach ($this->fields as $field) {
if (is_array($field)) {
$this->renderGroup($field);
continue;
}
$this->form .= $this->render($field);
}
return $this->form;
} | php | public function generateForm(): string
{
foreach ($this->fields as $field) {
if (is_array($field)) {
$this->renderGroup($field);
continue;
}
$this->form .= $this->render($field);
}
return $this->form;
} | [
"public",
"function",
"generateForm",
"(",
")",
":",
"string",
"{",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"field",
")",
")",
"{",
"$",
"this",
"->",
"renderGroup",
"(",
"$",
"fie... | Generate a ready-made html form for display to the user.
@throws \Throwable
@return string | [
"Generate",
"a",
"ready",
"-",
"made",
"html",
"form",
"for",
"display",
"to",
"the",
"user",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Screen/Builder.php#L90-L102 | train |
orchidsoftware/platform | src/Screen/Builder.php | Builder.render | private function render(Field $field)
{
$field->set('lang', $this->language);
$field->set('prefix', $this->buildPrefix($field));
foreach ($this->fill($field->getAttributes()) as $key => $value) {
$field->set($key, $value);
}
return $field->render();
} | php | private function render(Field $field)
{
$field->set('lang', $this->language);
$field->set('prefix', $this->buildPrefix($field));
foreach ($this->fill($field->getAttributes()) as $key => $value) {
$field->set($key, $value);
}
return $field->render();
} | [
"private",
"function",
"render",
"(",
"Field",
"$",
"field",
")",
"{",
"$",
"field",
"->",
"set",
"(",
"'lang'",
",",
"$",
"this",
"->",
"language",
")",
";",
"$",
"field",
"->",
"set",
"(",
"'prefix'",
",",
"$",
"this",
"->",
"buildPrefix",
"(",
"... | Render field for forms.
@param Field $field
@throws \Throwable
@return mixed | [
"Render",
"field",
"for",
"forms",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Screen/Builder.php#L133-L143 | train |
orchidsoftware/platform | src/Screen/Builder.php | Builder.getValue | private function getValue(string $key, $value = null)
{
if (! is_null($this->language)) {
$key = $this->language.'.'.$key;
}
if (! is_null($this->prefix)) {
$key = $this->prefix.'.'.$key;
}
$data = $this->data->getContent($key);
// default v... | php | private function getValue(string $key, $value = null)
{
if (! is_null($this->language)) {
$key = $this->language.'.'.$key;
}
if (! is_null($this->prefix)) {
$key = $this->prefix.'.'.$key;
}
$data = $this->data->getContent($key);
// default v... | [
"private",
"function",
"getValue",
"(",
"string",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"language",
")",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"language",
".",
"'.'",
".",... | Gets value of Repository.
@param string $key
@param mixed|null $value
@return mixed | [
"Gets",
"value",
"of",
"Repository",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Screen/Builder.php#L210-L232 | train |
orchidsoftware/platform | src/Platform/Dashboard.php | Dashboard.prefix | public static function prefix(string $path = ''): string
{
$prefix = config('platform.prefix');
return Str::start($prefix.$path, '/');
} | php | public static function prefix(string $path = ''): string
{
$prefix = config('platform.prefix');
return Str::start($prefix.$path, '/');
} | [
"public",
"static",
"function",
"prefix",
"(",
"string",
"$",
"path",
"=",
"''",
")",
":",
"string",
"{",
"$",
"prefix",
"=",
"config",
"(",
"'platform.prefix'",
")",
";",
"return",
"Str",
"::",
"start",
"(",
"$",
"prefix",
".",
"$",
"path",
",",
"'/... | Get the route with the dashboard prefix.
@param string $path
@return string | [
"Get",
"the",
"route",
"with",
"the",
"dashboard",
"prefix",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Dashboard.php#L92-L97 | train |
orchidsoftware/platform | src/Platform/Dashboard.php | Dashboard.model | public static function model(string $key, string $default = null)
{
return Arr::get(static::$options, 'models.'.$key, $default ?? $key);
} | php | public static function model(string $key, string $default = null)
{
return Arr::get(static::$options, 'models.'.$key, $default ?? $key);
} | [
"public",
"static",
"function",
"model",
"(",
"string",
"$",
"key",
",",
"string",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"Arr",
"::",
"get",
"(",
"static",
"::",
"$",
"options",
",",
"'models.'",
".",
"$",
"key",
",",
"$",
"default",
"??",... | Get the class name for a given Dashboard model.
@param string $key
@param null|string $default
@return string | [
"Get",
"the",
"class",
"name",
"for",
"a",
"given",
"Dashboard",
"model",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Dashboard.php#L145-L148 | train |
orchidsoftware/platform | src/Platform/Dashboard.php | Dashboard.getResource | public function getResource($key = null)
{
if (is_null($key)) {
return $this->resources;
}
return $this->resources->get($key);
} | php | public function getResource($key = null)
{
if (is_null($key)) {
return $this->resources;
}
return $this->resources->get($key);
} | [
"public",
"function",
"getResource",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"resources",
";",
"}",
"return",
"$",
"this",
"->",
"resources",
"->",
"get",
"(",
"$",
... | Return CSS\JS.
@param null $key
@return array|\Illuminate\Support\Collection|mixed | [
"Return",
"CSS",
"\\",
"JS",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Dashboard.php#L235-L242 | train |
orchidsoftware/platform | src/Access/UserAccess.php | UserAccess.removeRoleBySlug | public function removeRoleBySlug($slug): int
{
$role = $this->roles()->where('slug', $slug)->first();
return $this->roles()->detach($role);
} | php | public function removeRoleBySlug($slug): int
{
$role = $this->roles()->where('slug', $slug)->first();
return $this->roles()->detach($role);
} | [
"public",
"function",
"removeRoleBySlug",
"(",
"$",
"slug",
")",
":",
"int",
"{",
"$",
"role",
"=",
"$",
"this",
"->",
"roles",
"(",
")",
"->",
"where",
"(",
"'slug'",
",",
"$",
"slug",
")",
"->",
"first",
"(",
")",
";",
"return",
"$",
"this",
"-... | Remove Role Slug.
@param $slug
@return int | [
"Remove",
"Role",
"Slug",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Access/UserAccess.php#L105-L110 | train |
orchidsoftware/platform | src/Platform/Models/Role.php | Role.setPermissionsAttribute | public function setPermissionsAttribute(array $permissions = [])
{
foreach ($permissions as $key => $value) {
$permissions[$key] = (bool) $value;
}
$this->attributes['permissions'] = json_encode($permissions ?? []);
} | php | public function setPermissionsAttribute(array $permissions = [])
{
foreach ($permissions as $key => $value) {
$permissions[$key] = (bool) $value;
}
$this->attributes['permissions'] = json_encode($permissions ?? []);
} | [
"public",
"function",
"setPermissionsAttribute",
"(",
"array",
"$",
"permissions",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"permissions",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"permissions",
"[",
"$",
"key",
"]",
"=",
"(",
"bool",
... | Set permission as boolean.
@param array $permissions | [
"Set",
"permission",
"as",
"boolean",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Platform/Models/Role.php#L63-L69 | train |
orchidsoftware/platform | src/Press/Providers/PressServiceProvider.php | PressServiceProvider.registerConfig | protected function registerConfig()
{
$this->publishes([
realpath(PLATFORM_PATH.'/config/press.php') => config_path('press.php'),
], 'config');
$this->mergeConfigFrom(
realpath(PLATFORM_PATH.'/config/press.php'), 'press'
);
return $this;
} | php | protected function registerConfig()
{
$this->publishes([
realpath(PLATFORM_PATH.'/config/press.php') => config_path('press.php'),
], 'config');
$this->mergeConfigFrom(
realpath(PLATFORM_PATH.'/config/press.php'), 'press'
);
return $this;
} | [
"protected",
"function",
"registerConfig",
"(",
")",
"{",
"$",
"this",
"->",
"publishes",
"(",
"[",
"realpath",
"(",
"PLATFORM_PATH",
".",
"'/config/press.php'",
")",
"=>",
"config_path",
"(",
"'press.php'",
")",
",",
"]",
",",
"'config'",
")",
";",
"$",
"... | Register config.
@return $this | [
"Register",
"config",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Press/Providers/PressServiceProvider.php#L88-L99 | train |
orchidsoftware/platform | install-stubs/Orchid/Entities/Post.php | Post.grid | public function grid(): array
{
return [
TD::set('id', 'ID')
->align(TD::ALIGN_CENTER)
->width('100px')
->filter('numeric')
->sort()
->linkPost(),
TD::set('name', 'Name')
->width('250px')... | php | public function grid(): array
{
return [
TD::set('id', 'ID')
->align(TD::ALIGN_CENTER)
->width('100px')
->filter('numeric')
->sort()
->linkPost(),
TD::set('name', 'Name')
->width('250px')... | [
"public",
"function",
"grid",
"(",
")",
":",
"array",
"{",
"return",
"[",
"TD",
"::",
"set",
"(",
"'id'",
",",
"'ID'",
")",
"->",
"align",
"(",
"TD",
"::",
"ALIGN_CENTER",
")",
"->",
"width",
"(",
"'100px'",
")",
"->",
"filter",
"(",
"'numeric'",
"... | Grid View for post type. | [
"Grid",
"View",
"for",
"post",
"type",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/install-stubs/Orchid/Entities/Post.php#L243-L286 | train |
orchidsoftware/platform | src/Attachment/Models/Attachment.php | Attachment.url | public function url($default = null): ?string
{
$disk = $this->getAttribute('disk');
if (Storage::disk($disk)->exists($this->physicalPath())) {
return Storage::disk($disk)->url($this->physicalPath());
}
return $default;
} | php | public function url($default = null): ?string
{
$disk = $this->getAttribute('disk');
if (Storage::disk($disk)->exists($this->physicalPath())) {
return Storage::disk($disk)->url($this->physicalPath());
}
return $default;
} | [
"public",
"function",
"url",
"(",
"$",
"default",
"=",
"null",
")",
":",
"?",
"string",
"{",
"$",
"disk",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'disk'",
")",
";",
"if",
"(",
"Storage",
"::",
"disk",
"(",
"$",
"disk",
")",
"->",
"exists",
... | Return the address by which you can access the file.
@param string $default
@return string|null | [
"Return",
"the",
"address",
"by",
"which",
"you",
"can",
"access",
"the",
"file",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Attachment/Models/Attachment.php#L68-L77 | train |
orchidsoftware/platform | src/Attachment/Models/Attachment.php | Attachment.getMimeType | public function getMimeType(): string
{
$mimes = new MimeTypes();
$type = $mimes->getMimeType($this->getAttribute('extension'));
return $type ?? 'unknown';
} | php | public function getMimeType(): string
{
$mimes = new MimeTypes();
$type = $mimes->getMimeType($this->getAttribute('extension'));
return $type ?? 'unknown';
} | [
"public",
"function",
"getMimeType",
"(",
")",
":",
"string",
"{",
"$",
"mimes",
"=",
"new",
"MimeTypes",
"(",
")",
";",
"$",
"type",
"=",
"$",
"mimes",
"->",
"getMimeType",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"'extension'",
")",
")",
";",
"... | Get MIME type for file.
@return string | [
"Get",
"MIME",
"type",
"for",
"file",
"."
] | 4930f527629e11c404d0a89592e67c857a29b8ff | https://github.com/orchidsoftware/platform/blob/4930f527629e11c404d0a89592e67c857a29b8ff/src/Attachment/Models/Attachment.php#L152-L159 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.