id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
224,900 | pdeans/http | src/Builders/ResponseBuilder.php | ResponseBuilder.addHeader | public function addHeader($header_line)
{
$header_parts = explode(':', $header_line, 2);
if (count($header_parts) !== 2) {
throw new InvalidArgumentException("'$header_line' is not a valid HTTP header line");
}
$header_name = trim($header_parts[0]);
$header_value = trim($header_parts[1]);
if ($this-... | php | public function addHeader($header_line)
{
$header_parts = explode(':', $header_line, 2);
if (count($header_parts) !== 2) {
throw new InvalidArgumentException("'$header_line' is not a valid HTTP header line");
}
$header_name = trim($header_parts[0]);
$header_value = trim($header_parts[1]);
if ($this-... | [
"public",
"function",
"addHeader",
"(",
"$",
"header_line",
")",
"{",
"$",
"header_parts",
"=",
"explode",
"(",
"':'",
",",
"$",
"header_line",
",",
"2",
")",
";",
"if",
"(",
"count",
"(",
"$",
"header_parts",
")",
"!==",
"2",
")",
"{",
"throw",
"new... | Add response header from header line string
@param string $header_line Response header line string
@return \pdeans\Http\Builders\ResponseBuilder $this
@throws \InvalidArgumentException Invalid header line argument | [
"Add",
"response",
"header",
"from",
"header",
"line",
"string"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Builders/ResponseBuilder.php#L67-L86 |
224,901 | pdeans/http | src/Builders/ResponseBuilder.php | ResponseBuilder.setHeadersFromArray | public function setHeadersFromArray(array $headers)
{
$status = array_shift($headers);
$this->setStatus($status);
foreach ($headers as $header) {
$header_line = trim($header);
if ($header_line === '') {
continue;
}
$this->addHeader($header_line);
}
return $this;
} | php | public function setHeadersFromArray(array $headers)
{
$status = array_shift($headers);
$this->setStatus($status);
foreach ($headers as $header) {
$header_line = trim($header);
if ($header_line === '') {
continue;
}
$this->addHeader($header_line);
}
return $this;
} | [
"public",
"function",
"setHeadersFromArray",
"(",
"array",
"$",
"headers",
")",
"{",
"$",
"status",
"=",
"array_shift",
"(",
"$",
"headers",
")",
";",
"$",
"this",
"->",
"setStatus",
"(",
"$",
"status",
")",
";",
"foreach",
"(",
"$",
"headers",
"as",
"... | Set response headers from header line array
@param array $headers Array of header lines
@return \pdeans\Http\Builders\ResponseBuilder $this
@throws \InvalidArgumentException Invalid status code argument value
@throws \UnexpectedValueException Invalid header value(s) | [
"Set",
"response",
"headers",
"from",
"header",
"line",
"array"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Builders/ResponseBuilder.php#L96-L113 |
224,902 | pdeans/http | src/Builders/ResponseBuilder.php | ResponseBuilder.setHeadersFromString | public function setHeadersFromString($headers)
{
if (is_string($headers) || (is_object($headers) && method_exists($headers, '__toString'))) {
$this->setHeadersFromArray(explode("\r\n", $headers));
return $this;
}
throw new InvalidArgumentException(
sprintf(
'%s expects parameter 1 to be a string, ... | php | public function setHeadersFromString($headers)
{
if (is_string($headers) || (is_object($headers) && method_exists($headers, '__toString'))) {
$this->setHeadersFromArray(explode("\r\n", $headers));
return $this;
}
throw new InvalidArgumentException(
sprintf(
'%s expects parameter 1 to be a string, ... | [
"public",
"function",
"setHeadersFromString",
"(",
"$",
"headers",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"headers",
")",
"||",
"(",
"is_object",
"(",
"$",
"headers",
")",
"&&",
"method_exists",
"(",
"$",
"headers",
",",
"'__toString'",
")",
")",
")... | Set response headers from header line string
@param string $headers String of header lines
@return \pdeans\Http\Builders\ResponseBuilder $this
@throws \InvalidArgumentException Header string is not a string on object with __toString()
@throws \UnexpectedValueException Invalid header value(s) | [
"Set",
"response",
"headers",
"from",
"header",
"line",
"string"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Builders/ResponseBuilder.php#L123-L138 |
224,903 | pdeans/http | src/Builders/ResponseBuilder.php | ResponseBuilder.setStatus | public function setStatus($status_line)
{
$status_parts = explode(' ', $status_line, 3);
$parts_count = count($status_parts);
if ($parts_count < 2 || strpos(strtoupper($status_parts[0]), 'HTTP/') !== 0) {
throw new InvalidArgumentException("'$status_line' is not a valid HTTP status line");
}
$reason_ph... | php | public function setStatus($status_line)
{
$status_parts = explode(' ', $status_line, 3);
$parts_count = count($status_parts);
if ($parts_count < 2 || strpos(strtoupper($status_parts[0]), 'HTTP/') !== 0) {
throw new InvalidArgumentException("'$status_line' is not a valid HTTP status line");
}
$reason_ph... | [
"public",
"function",
"setStatus",
"(",
"$",
"status_line",
")",
"{",
"$",
"status_parts",
"=",
"explode",
"(",
"' '",
",",
"$",
"status_line",
",",
"3",
")",
";",
"$",
"parts_count",
"=",
"count",
"(",
"$",
"status_parts",
")",
";",
"if",
"(",
"$",
... | Set reponse status
@param string $status_line Response status line string
@return \pdeans\Http\Builders\ResponseBuilder $this
@throws \InvalidArgumentException Invalid status line argument | [
"Set",
"reponse",
"status"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Builders/ResponseBuilder.php#L151-L167 |
224,904 | seancheung/laravel-vuforia | src/VuforiaWebService.php | VuforiaWebService.updateTarget | function updateTarget($id, $target) {
if(is_array($target)) {
$target = new Target($target);
}
else if(!($target instanceof Target)) {
throw new Exception("Invalid target type. Only array and VuforiaWebService/Target are supported");
}
if(!emp... | php | function updateTarget($id, $target) {
if(is_array($target)) {
$target = new Target($target);
}
else if(!($target instanceof Target)) {
throw new Exception("Invalid target type. Only array and VuforiaWebService/Target are supported");
}
if(!emp... | [
"function",
"updateTarget",
"(",
"$",
"id",
",",
"$",
"target",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"target",
")",
")",
"{",
"$",
"target",
"=",
"new",
"Target",
"(",
"$",
"target",
")",
";",
"}",
"else",
"if",
"(",
"!",
"(",
"$",
"targe... | Update target with info by ID
@param string $id Target Unique ID
@param mixed $target Target to update from
@return array
@example ['status' => 200, 'body' => "--JSON--"]
@example ['status' => 400, 'body' => "--ERROR--"]
@example ['status' => 500, 'body' => "--EXCEPTION--"] | [
"Update",
"target",
"with",
"info",
"by",
"ID"
] | cecc57a457a25b7b5fa4ad39fe14b15b7389d136 | https://github.com/seancheung/laravel-vuforia/blob/cecc57a457a25b7b5fa4ad39fe14b15b7389d136/src/VuforiaWebService.php#L152-L185 |
224,905 | ongr-io/TranslationsBundle | Service/TranslationManager.php | TranslationManager.edit | public function edit($id, Request $request)
{
$content = json_decode($request->getContent(), true);
if (empty($content)) {
return;
}
$document = $this->get($id);
if (isset($content['messages'])) {
$this->updateMessages($document, $content['messages'... | php | public function edit($id, Request $request)
{
$content = json_decode($request->getContent(), true);
if (empty($content)) {
return;
}
$document = $this->get($id);
if (isset($content['messages'])) {
$this->updateMessages($document, $content['messages'... | [
"public",
"function",
"edit",
"(",
"$",
"id",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"content",
"=",
"json_decode",
"(",
"$",
"request",
"->",
"getContent",
"(",
")",
",",
"true",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"content",
")",
")",... | Edits object from translation.
@param string $id
@param Request $request Http request object. | [
"Edits",
"object",
"from",
"translation",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/TranslationManager.php#L64-L91 |
224,906 | ongr-io/TranslationsBundle | Service/TranslationManager.php | TranslationManager.getAll | public function getAll(array $filters = null)
{
$search = $this->repository->createSearch();
$search->addQuery(new MatchAllQuery());
$search->setScroll('2m');
if ($filters) {
foreach ($filters as $field => $value) {
$search->addQuery(new TermsQuery($field... | php | public function getAll(array $filters = null)
{
$search = $this->repository->createSearch();
$search->addQuery(new MatchAllQuery());
$search->setScroll('2m');
if ($filters) {
foreach ($filters as $field => $value) {
$search->addQuery(new TermsQuery($field... | [
"public",
"function",
"getAll",
"(",
"array",
"$",
"filters",
"=",
"null",
")",
"{",
"$",
"search",
"=",
"$",
"this",
"->",
"repository",
"->",
"createSearch",
"(",
")",
";",
"$",
"search",
"->",
"addQuery",
"(",
"new",
"MatchAllQuery",
"(",
")",
")",
... | Returns all translations if filters are not specified
@param array $filters An array with specified limitations for results
@return DocumentIterator | [
"Returns",
"all",
"translations",
"if",
"filters",
"are",
"not",
"specified"
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/TranslationManager.php#L128-L141 |
224,907 | ongr-io/TranslationsBundle | Service/TranslationManager.php | TranslationManager.getGroupTypeInfo | private function getGroupTypeInfo($type)
{
$search = $this->repository->createSearch();
$search->addAggregation(new TermsAggregation($type, $type));
$result = $this->repository->findDocuments($search);
$aggregation = $result->getAggregation($type);
$items = [];
forea... | php | private function getGroupTypeInfo($type)
{
$search = $this->repository->createSearch();
$search->addAggregation(new TermsAggregation($type, $type));
$result = $this->repository->findDocuments($search);
$aggregation = $result->getAggregation($type);
$items = [];
forea... | [
"private",
"function",
"getGroupTypeInfo",
"(",
"$",
"type",
")",
"{",
"$",
"search",
"=",
"$",
"this",
"->",
"repository",
"->",
"createSearch",
"(",
")",
";",
"$",
"search",
"->",
"addAggregation",
"(",
"new",
"TermsAggregation",
"(",
"$",
"type",
",",
... | Returns a list of available tags or domains.
@param string $type
@return array | [
"Returns",
"a",
"list",
"of",
"available",
"tags",
"or",
"domains",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/TranslationManager.php#L211-L224 |
224,908 | valga/fbns-react | src/Lite.php | Lite.establishConnection | private function establishConnection($host, $port, Connection $connection, $timeout)
{
$this->logger->info(sprintf('Connecting to %s:%d...', $host, $port));
return $this->client->connect($host, $port, $connection, $timeout);
} | php | private function establishConnection($host, $port, Connection $connection, $timeout)
{
$this->logger->info(sprintf('Connecting to %s:%d...', $host, $port));
return $this->client->connect($host, $port, $connection, $timeout);
} | [
"private",
"function",
"establishConnection",
"(",
"$",
"host",
",",
"$",
"port",
",",
"Connection",
"$",
"connection",
",",
"$",
"timeout",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"sprintf",
"(",
"'Connecting to %s:%d...'",
",",
"$",
"ho... | Establishes a connection to the FBNS server.
@param string $host
@param int $port
@param Connection $connection
@param int $timeout
@return PromiseInterface | [
"Establishes",
"a",
"connection",
"to",
"the",
"FBNS",
"server",
"."
] | 4bbf513a8ffed7e0c9ca10776033d34515bb8b37 | https://github.com/valga/fbns-react/blob/4bbf513a8ffed7e0c9ca10776033d34515bb8b37/src/Lite.php#L235-L240 |
224,909 | valga/fbns-react | src/Lite.php | Lite.connect | public function connect($host, $port, Connection $connection, $timeout = 5)
{
$deferred = new Deferred();
$this->disconnect()
->then(function () use ($deferred, $host, $port, $connection, $timeout) {
$this->establishConnection($host, $port, $connection, $timeout)
... | php | public function connect($host, $port, Connection $connection, $timeout = 5)
{
$deferred = new Deferred();
$this->disconnect()
->then(function () use ($deferred, $host, $port, $connection, $timeout) {
$this->establishConnection($host, $port, $connection, $timeout)
... | [
"public",
"function",
"connect",
"(",
"$",
"host",
",",
"$",
"port",
",",
"Connection",
"$",
"connection",
",",
"$",
"timeout",
"=",
"5",
")",
"{",
"$",
"deferred",
"=",
"new",
"Deferred",
"(",
")",
";",
"$",
"this",
"->",
"disconnect",
"(",
")",
"... | Connects to a FBNS server.
@param string $host
@param int $port
@param Connection $connection
@param int $timeout
@return PromiseInterface | [
"Connects",
"to",
"a",
"FBNS",
"server",
"."
] | 4bbf513a8ffed7e0c9ca10776033d34515bb8b37 | https://github.com/valga/fbns-react/blob/4bbf513a8ffed7e0c9ca10776033d34515bb8b37/src/Lite.php#L252-L270 |
224,910 | valga/fbns-react | src/Lite.php | Lite.mapTopic | private function mapTopic($topic)
{
if (array_key_exists($topic, self::TOPIC_TO_ID_ENUM)) {
$result = self::TOPIC_TO_ID_ENUM[$topic];
$this->logger->debug(sprintf('Topic "%s" has been mapped to "%s".', $topic, $result));
} else {
$result = $topic;
$thi... | php | private function mapTopic($topic)
{
if (array_key_exists($topic, self::TOPIC_TO_ID_ENUM)) {
$result = self::TOPIC_TO_ID_ENUM[$topic];
$this->logger->debug(sprintf('Topic "%s" has been mapped to "%s".', $topic, $result));
} else {
$result = $topic;
$thi... | [
"private",
"function",
"mapTopic",
"(",
"$",
"topic",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"topic",
",",
"self",
"::",
"TOPIC_TO_ID_ENUM",
")",
")",
"{",
"$",
"result",
"=",
"self",
"::",
"TOPIC_TO_ID_ENUM",
"[",
"$",
"topic",
"]",
";",
"... | Maps human readable topic to its ID.
@param string $topic
@return string | [
"Maps",
"human",
"readable",
"topic",
"to",
"its",
"ID",
"."
] | 4bbf513a8ffed7e0c9ca10776033d34515bb8b37 | https://github.com/valga/fbns-react/blob/4bbf513a8ffed7e0c9ca10776033d34515bb8b37/src/Lite.php#L300-L311 |
224,911 | valga/fbns-react | src/Lite.php | Lite.unmapTopic | private function unmapTopic($topic)
{
if (array_key_exists($topic, self::ID_TO_TOPIC_ENUM)) {
$result = self::ID_TO_TOPIC_ENUM[$topic];
$this->logger->debug(sprintf('Topic ID "%s" has been unmapped to "%s".', $topic, $result));
} else {
$result = $topic;
... | php | private function unmapTopic($topic)
{
if (array_key_exists($topic, self::ID_TO_TOPIC_ENUM)) {
$result = self::ID_TO_TOPIC_ENUM[$topic];
$this->logger->debug(sprintf('Topic ID "%s" has been unmapped to "%s".', $topic, $result));
} else {
$result = $topic;
... | [
"private",
"function",
"unmapTopic",
"(",
"$",
"topic",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"topic",
",",
"self",
"::",
"ID_TO_TOPIC_ENUM",
")",
")",
"{",
"$",
"result",
"=",
"self",
"::",
"ID_TO_TOPIC_ENUM",
"[",
"$",
"topic",
"]",
";",
... | Maps topic ID to human readable name.
@param string $topic
@return string | [
"Maps",
"topic",
"ID",
"to",
"human",
"readable",
"name",
"."
] | 4bbf513a8ffed7e0c9ca10776033d34515bb8b37 | https://github.com/valga/fbns-react/blob/4bbf513a8ffed7e0c9ca10776033d34515bb8b37/src/Lite.php#L320-L331 |
224,912 | valga/fbns-react | src/Lite.php | Lite.register | public function register($packageName, $appId)
{
$this->logger->info(sprintf('Registering application "%s" (%s).', $packageName, $appId));
$message = json_encode([
'pkg_name' => (string) $packageName,
'appid' => (string) $appId,
]);
return $this->publish(self... | php | public function register($packageName, $appId)
{
$this->logger->info(sprintf('Registering application "%s" (%s).', $packageName, $appId));
$message = json_encode([
'pkg_name' => (string) $packageName,
'appid' => (string) $appId,
]);
return $this->publish(self... | [
"public",
"function",
"register",
"(",
"$",
"packageName",
",",
"$",
"appId",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"sprintf",
"(",
"'Registering application \"%s\" (%s).'",
",",
"$",
"packageName",
",",
"$",
"appId",
")",
")",
";",
"$"... | Registers an application.
@param string $packageName
@param string|int $appId
@return PromiseInterface | [
"Registers",
"an",
"application",
"."
] | 4bbf513a8ffed7e0c9ca10776033d34515bb8b37 | https://github.com/valga/fbns-react/blob/4bbf513a8ffed7e0c9ca10776033d34515bb8b37/src/Lite.php#L359-L368 |
224,913 | theofidry/LoopBackApiBundle | src/Filter/WhereFilter.php | WhereFilter.handleFilter | private function handleFilter(
QueryBuilder $queryBuilder,
ClassMetadata $resourceMetadata,
array $aliases,
array $associationsMetadata,
$property,
$value,
$parameter = null
) {
$queryExpr = [];
/*
* simple (case 1):
* $prope... | php | private function handleFilter(
QueryBuilder $queryBuilder,
ClassMetadata $resourceMetadata,
array $aliases,
array $associationsMetadata,
$property,
$value,
$parameter = null
) {
$queryExpr = [];
/*
* simple (case 1):
* $prope... | [
"private",
"function",
"handleFilter",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"ClassMetadata",
"$",
"resourceMetadata",
",",
"array",
"$",
"aliases",
",",
"array",
"$",
"associationsMetadata",
",",
"$",
"property",
",",
"$",
"value",
",",
"$",
"parameter... | Handles the given filter to call the proper operator. At this point, it's unclear if the value passed is the real
value operator.
@param QueryBuilder $queryBuilder
@param ClassMetadata $resourceMetadata
@param string[] $aliases
@param ClassMetadata[] $associationsMetadata
@param string $property
@... | [
"Handles",
"the",
"given",
"filter",
"to",
"call",
"the",
"proper",
"operator",
".",
"At",
"this",
"point",
"it",
"s",
"unclear",
"if",
"the",
"value",
"passed",
"is",
"the",
"real",
"value",
"operator",
"."
] | b66b295088b364e3c4aba5b0feb8d660c4141730 | https://github.com/theofidry/LoopBackApiBundle/blob/b66b295088b364e3c4aba5b0feb8d660c4141730/src/Filter/WhereFilter.php#L197-L266 |
224,914 | theofidry/LoopBackApiBundle | src/Filter/WhereFilter.php | WhereFilter.normalizeValue | private function normalizeValue(ClassMetadata $metadata, $property, $value)
{
if (self::PARAMETER_ID_KEY === $property) {
return $this->getFilterValueFromUrl($value);
}
if (self::PARAMETER_NULL_VALUE === $value) {
return null;
}
switch ($metadata->ge... | php | private function normalizeValue(ClassMetadata $metadata, $property, $value)
{
if (self::PARAMETER_ID_KEY === $property) {
return $this->getFilterValueFromUrl($value);
}
if (self::PARAMETER_NULL_VALUE === $value) {
return null;
}
switch ($metadata->ge... | [
"private",
"function",
"normalizeValue",
"(",
"ClassMetadata",
"$",
"metadata",
",",
"$",
"property",
",",
"$",
"value",
")",
"{",
"if",
"(",
"self",
"::",
"PARAMETER_ID_KEY",
"===",
"$",
"property",
")",
"{",
"return",
"$",
"this",
"->",
"getFilterValueFrom... | Normalizes the value. If the key is an ID, get the real ID value. If is null, set the value to null. Otherwise
return unchanged value.
@param ClassMetadata $metadata
@param string $property
@param string $value
@return null|string | [
"Normalizes",
"the",
"value",
".",
"If",
"the",
"key",
"is",
"an",
"ID",
"get",
"the",
"real",
"ID",
"value",
".",
"If",
"is",
"null",
"set",
"the",
"value",
"to",
"null",
".",
"Otherwise",
"return",
"unchanged",
"value",
"."
] | b66b295088b364e3c4aba5b0feb8d660c4141730 | https://github.com/theofidry/LoopBackApiBundle/blob/b66b295088b364e3c4aba5b0feb8d660c4141730/src/Filter/WhereFilter.php#L385-L412 |
224,915 | theofidry/LoopBackApiBundle | src/Filter/WhereFilter.php | WhereFilter.getFilterValueFromUrl | protected function getFilterValueFromUrl($value)
{
try {
if ($item = $this->iriConverter->getItemFromIri($value)) {
return $this->propertyAccessor->getValue($item, 'id');
}
} catch (\InvalidArgumentException $e) {
// Do nothing, return the raw valu... | php | protected function getFilterValueFromUrl($value)
{
try {
if ($item = $this->iriConverter->getItemFromIri($value)) {
return $this->propertyAccessor->getValue($item, 'id');
}
} catch (\InvalidArgumentException $e) {
// Do nothing, return the raw valu... | [
"protected",
"function",
"getFilterValueFromUrl",
"(",
"$",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"item",
"=",
"$",
"this",
"->",
"iriConverter",
"->",
"getItemFromIri",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"this",
"->",
"propertyAcc... | Gets the ID from an URI or a raw ID.
@param string $value
@return string | [
"Gets",
"the",
"ID",
"from",
"an",
"URI",
"or",
"a",
"raw",
"ID",
"."
] | b66b295088b364e3c4aba5b0feb8d660c4141730 | https://github.com/theofidry/LoopBackApiBundle/blob/b66b295088b364e3c4aba5b0feb8d660c4141730/src/Filter/WhereFilter.php#L431-L442 |
224,916 | theofidry/LoopBackApiBundle | src/Filter/WhereFilter.php | WhereFilter.getResourceAliasForProperty | private function getResourceAliasForProperty(array &$aliases, array $explodedProperty)
{
if (0 === count($explodedProperty)) {
return 'o';
}
foreach ($explodedProperty as $property) {
if (false === isset($aliases[$property])) {
$aliases[$property] = s... | php | private function getResourceAliasForProperty(array &$aliases, array $explodedProperty)
{
if (0 === count($explodedProperty)) {
return 'o';
}
foreach ($explodedProperty as $property) {
if (false === isset($aliases[$property])) {
$aliases[$property] = s... | [
"private",
"function",
"getResourceAliasForProperty",
"(",
"array",
"&",
"$",
"aliases",
",",
"array",
"$",
"explodedProperty",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"explodedProperty",
")",
")",
"{",
"return",
"'o'",
";",
"}",
"foreach",
"("... | Gets the alias used for the entity to which the property belongs.
@example
$property was `name`
$explodedProperty then is []
=> 'o'
$property was `relatedDummy_name`
$explodedProperty then is ['relatedDummy']
=> WhereFilter_relatedDummyAlias
$property was `relatedDummy_anotherDummy_name`
$explodedProperty then is ['... | [
"Gets",
"the",
"alias",
"used",
"for",
"the",
"entity",
"to",
"which",
"the",
"property",
"belongs",
"."
] | b66b295088b364e3c4aba5b0feb8d660c4141730 | https://github.com/theofidry/LoopBackApiBundle/blob/b66b295088b364e3c4aba5b0feb8d660c4141730/src/Filter/WhereFilter.php#L466-L479 |
224,917 | theofidry/LoopBackApiBundle | src/Filter/WhereFilter.php | WhereFilter.getAssociationMetadataForProperty | private function getAssociationMetadataForProperty(
ClassMetadata $resourceMetadata,
array &$associationsMetadata,
array
$explodedProperty
) {
if (0 === count($explodedProperty)) {
return $resourceMetadata;
}
$parentResourceMetadata = $resourceMet... | php | private function getAssociationMetadataForProperty(
ClassMetadata $resourceMetadata,
array &$associationsMetadata,
array
$explodedProperty
) {
if (0 === count($explodedProperty)) {
return $resourceMetadata;
}
$parentResourceMetadata = $resourceMet... | [
"private",
"function",
"getAssociationMetadataForProperty",
"(",
"ClassMetadata",
"$",
"resourceMetadata",
",",
"array",
"&",
"$",
"associationsMetadata",
",",
"array",
"$",
"explodedProperty",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"explodedProperty",
... | Gets the metadata to which belongs the property.
@example
$property was `name`
$explodedProperty then is []
=> $resourceMetadata
$property was `relatedDummy_name`
$explodedProperty then is ['relatedDummy']
=> metadata of relatedDummy
$property was `relatedDummy_anotherDummy_name`
$explodedProperty then is ['relatedD... | [
"Gets",
"the",
"metadata",
"to",
"which",
"belongs",
"the",
"property",
"."
] | b66b295088b364e3c4aba5b0feb8d660c4141730 | https://github.com/theofidry/LoopBackApiBundle/blob/b66b295088b364e3c4aba5b0feb8d660c4141730/src/Filter/WhereFilter.php#L503-L536 |
224,918 | ongr-io/TranslationsBundle | DependencyInjection/ONGRTranslationsExtension.php | ONGRTranslationsExtension.setFiltersManager | private function setFiltersManager($repository, ContainerBuilder $container)
{
$definition = new Definition(
'ONGR\FilterManagerBundle\Search\FilterManager',
[
new Reference('ongr_translations.filters_container'),
new Reference($repository),
... | php | private function setFiltersManager($repository, ContainerBuilder $container)
{
$definition = new Definition(
'ONGR\FilterManagerBundle\Search\FilterManager',
[
new Reference('ongr_translations.filters_container'),
new Reference($repository),
... | [
"private",
"function",
"setFiltersManager",
"(",
"$",
"repository",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"'ONGR\\FilterManagerBundle\\Search\\FilterManager'",
",",
"[",
"new",
"Reference",
"(",
"'ongr_t... | Adds filter manager for displaying translations gui.
@param string $repository Elasticsearch repository id.
@param ContainerBuilder $container Service container. | [
"Adds",
"filter",
"manager",
"for",
"displaying",
"translations",
"gui",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/DependencyInjection/ONGRTranslationsExtension.php#L54-L67 |
224,919 | Nyholm/google-api-php-client | src/GoogleApi/Auth/OAuth2.php | OAuth2.verifySignedJwtWithCerts | function verifySignedJwtWithCerts($jwt, $certs, $required_audience) {
$segments = explode(".", $jwt);
if (count($segments) != 3) {
throw new AuthException("Wrong number of segments in token: $jwt");
}
$signed = $segments[0] . "." . $segments[1];
$signature = Utils::urlSafeB64Decode($segments[2... | php | function verifySignedJwtWithCerts($jwt, $certs, $required_audience) {
$segments = explode(".", $jwt);
if (count($segments) != 3) {
throw new AuthException("Wrong number of segments in token: $jwt");
}
$signed = $segments[0] . "." . $segments[1];
$signature = Utils::urlSafeB64Decode($segments[2... | [
"function",
"verifySignedJwtWithCerts",
"(",
"$",
"jwt",
",",
"$",
"certs",
",",
"$",
"required_audience",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"\".\"",
",",
"$",
"jwt",
")",
";",
"if",
"(",
"count",
"(",
"$",
"segments",
")",
"!=",
"3",
"... | Visible for testing. | [
"Visible",
"for",
"testing",
"."
] | 249743b90f165f0159a748d3b9ca507b98b2d496 | https://github.com/Nyholm/google-api-php-client/blob/249743b90f165f0159a748d3b9ca507b98b2d496/src/GoogleApi/Auth/OAuth2.php#L375-L454 |
224,920 | bem/bh-php | src/BH.php | BH.groupBy | public static function groupBy($data, $key)
{
$res = [];
for ($i = 0, $l = sizeof($data); $i < $l; $i++) {
$item = $data[$i];
$value = empty($item[$key]) ? __undefined : $item[$key];
if (empty($res[$value])) {
$res[$value] = [];
}
... | php | public static function groupBy($data, $key)
{
$res = [];
for ($i = 0, $l = sizeof($data); $i < $l; $i++) {
$item = $data[$i];
$value = empty($item[$key]) ? __undefined : $item[$key];
if (empty($res[$value])) {
$res[$value] = [];
}
... | [
"public",
"static",
"function",
"groupBy",
"(",
"$",
"data",
",",
"$",
"key",
")",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"l",
"=",
"sizeof",
"(",
"$",
"data",
")",
";",
"$",
"i",
"<",
"$",
"l",
";"... | Group up selectors by some key
@param array $data
@param string $key
@return array | [
"Group",
"up",
"selectors",
"by",
"some",
"key"
] | 2f46ccb3f32cba1836ed70d28ee0d02b0e7684e2 | https://github.com/bem/bh-php/blob/2f46ccb3f32cba1836ed70d28ee0d02b0e7684e2/src/BH.php#L788-L800 |
224,921 | ongr-io/TranslationsBundle | Document/Translation.php | Translation.getId | public function getId()
{
if (!$this->id) {
$this->setId(sha1($this->getDomain() . $this->getKey()));
}
return $this->id;
} | php | public function getId()
{
if (!$this->id) {
$this->setId(sha1($this->getDomain() . $this->getKey()));
}
return $this->id;
} | [
"public",
"function",
"getId",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"id",
")",
"{",
"$",
"this",
"->",
"setId",
"(",
"sha1",
"(",
"$",
"this",
"->",
"getDomain",
"(",
")",
".",
"$",
"this",
"->",
"getKey",
"(",
")",
")",
")",
";"... | Returns document id.
@return string | [
"Returns",
"document",
"id",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Document/Translation.php#L123-L130 |
224,922 | ongr-io/TranslationsBundle | Document/Translation.php | Translation.getMessagesArray | public function getMessagesArray()
{
$result = [];
foreach ($this->getMessages() as $message) {
$result[$message->getLocale()] = $message;
}
return $result;
} | php | public function getMessagesArray()
{
$result = [];
foreach ($this->getMessages() as $message) {
$result[$message->getLocale()] = $message;
}
return $result;
} | [
"public",
"function",
"getMessagesArray",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getMessages",
"(",
")",
"as",
"$",
"message",
")",
"{",
"$",
"result",
"[",
"$",
"message",
"->",
"getLocale",
"(",
")",
... | Returns messages as array.
Format: ['locale' => 'message'].
@return array | [
"Returns",
"messages",
"as",
"array",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Document/Translation.php#L317-L325 |
224,923 | kapersoft/sharefile-api | src/Client.php | Client.copyItem | public function copyItem(string $targetId, string $itemId, bool $overwrite = false):array
{
$parameters = $this->buildHttpQuery(
[
'targetid' => $targetId,
'overwrite' => $overwrite,
]
);
return $this->post("Items({$itemId})/Copy?{$pa... | php | public function copyItem(string $targetId, string $itemId, bool $overwrite = false):array
{
$parameters = $this->buildHttpQuery(
[
'targetid' => $targetId,
'overwrite' => $overwrite,
]
);
return $this->post("Items({$itemId})/Copy?{$pa... | [
"public",
"function",
"copyItem",
"(",
"string",
"$",
"targetId",
",",
"string",
"$",
"itemId",
",",
"bool",
"$",
"overwrite",
"=",
"false",
")",
":",
"array",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"buildHttpQuery",
"(",
"[",
"'targetid'",
"=>"... | Copy an item.
@param string $targetId Id of the target folder
@param string $itemId Id of the copied item
@param bool $overwrite Indicates whether items with the same name will be overwritten or not (optional)
@return array | [
"Copy",
"an",
"item",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L222-L232 |
224,924 | kapersoft/sharefile-api | src/Client.php | Client.getItemDownloadUrl | public function getItemDownloadUrl(string $itemId, bool $includeallversions = false):array
{
$parameters = $this->buildHttpQuery(
[
'includeallversions' => $includeallversions,
'redirect' => false,
]
);
return $this->get("Ite... | php | public function getItemDownloadUrl(string $itemId, bool $includeallversions = false):array
{
$parameters = $this->buildHttpQuery(
[
'includeallversions' => $includeallversions,
'redirect' => false,
]
);
return $this->get("Ite... | [
"public",
"function",
"getItemDownloadUrl",
"(",
"string",
"$",
"itemId",
",",
"bool",
"$",
"includeallversions",
"=",
"false",
")",
":",
"array",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"buildHttpQuery",
"(",
"[",
"'includeallversions'",
"=>",
"$",
... | Get temporary download URL for an item.
@param string $itemId Item id
@param bool $includeallversions For folder downloads only, includes old versions of files in the folder in the zip when true, current versions only when false (default)
@return array | [
"Get",
"temporary",
"download",
"URL",
"for",
"an",
"item",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L285-L295 |
224,925 | kapersoft/sharefile-api | src/Client.php | Client.getItemContents | public function getItemContents(string $itemId, bool $includeallversions = false)
{
$parameters = $this->buildHttpQuery(
[
'includeallversions' => $includeallversions,
'redirect' => true,
]
);
return $this->get("Items({$itemI... | php | public function getItemContents(string $itemId, bool $includeallversions = false)
{
$parameters = $this->buildHttpQuery(
[
'includeallversions' => $includeallversions,
'redirect' => true,
]
);
return $this->get("Items({$itemI... | [
"public",
"function",
"getItemContents",
"(",
"string",
"$",
"itemId",
",",
"bool",
"$",
"includeallversions",
"=",
"false",
")",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"buildHttpQuery",
"(",
"[",
"'includeallversions'",
"=>",
"$",
"includeallversions",... | Get contents of and item.
@param string $itemId Item id
@param bool $includeallversions $includeallversions For folder downloads only, includes old versions of files in the folder in the zip when true, current versions only when false (default)
@return mixed | [
"Get",
"contents",
"of",
"and",
"item",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L305-L315 |
224,926 | kapersoft/sharefile-api | src/Client.php | Client.getChunkUri | public function getChunkUri(string $method, string $filename, string $folderId, bool $unzip = false, $overwrite = true, bool $notify = true, bool $raw = false, $stream = null):array
{
$parameters = $this->buildHttpQuery(
[
'method' => $method,
'raw'... | php | public function getChunkUri(string $method, string $filename, string $folderId, bool $unzip = false, $overwrite = true, bool $notify = true, bool $raw = false, $stream = null):array
{
$parameters = $this->buildHttpQuery(
[
'method' => $method,
'raw'... | [
"public",
"function",
"getChunkUri",
"(",
"string",
"$",
"method",
",",
"string",
"$",
"filename",
",",
"string",
"$",
"folderId",
",",
"bool",
"$",
"unzip",
"=",
"false",
",",
"$",
"overwrite",
"=",
"true",
",",
"bool",
"$",
"notify",
"=",
"true",
","... | Get the Chunk Uri to start a file-upload.
@param string $method Upload method (Standard or Streamed)
@param string $filename Name of file
@param string $folderId Id of the parent folder
@param bool $unzip Indicates that the upload is a Zip file, and contents must be extracted at the end of upload. T... | [
"Get",
"the",
"Chunk",
"Uri",
"to",
"start",
"a",
"file",
"-",
"upload",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L331-L354 |
224,927 | kapersoft/sharefile-api | src/Client.php | Client.uploadFileStandard | public function uploadFileStandard(string $filename, string $folderId, bool $unzip = false, bool $overwrite = true, bool $notify = true):string
{
$chunkUri = $this->getChunkUri('standard', $filename, $folderId, $unzip, $overwrite, $notify);
$response = $this->client->request(
'POST',
... | php | public function uploadFileStandard(string $filename, string $folderId, bool $unzip = false, bool $overwrite = true, bool $notify = true):string
{
$chunkUri = $this->getChunkUri('standard', $filename, $folderId, $unzip, $overwrite, $notify);
$response = $this->client->request(
'POST',
... | [
"public",
"function",
"uploadFileStandard",
"(",
"string",
"$",
"filename",
",",
"string",
"$",
"folderId",
",",
"bool",
"$",
"unzip",
"=",
"false",
",",
"bool",
"$",
"overwrite",
"=",
"true",
",",
"bool",
"$",
"notify",
"=",
"true",
")",
":",
"string",
... | Upload a file using a single HTTP POST.
@param string $filename Name of file
@param string $folderId Id of the parent folder
@param bool $unzip Indicates that the upload is a Zip file, and contents must be extracted at the end of upload. The resulting files and directories will be placed in the target folder. ... | [
"Upload",
"a",
"file",
"using",
"a",
"single",
"HTTP",
"POST",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L367-L385 |
224,928 | kapersoft/sharefile-api | src/Client.php | Client.uploadFileStreamed | public function uploadFileStreamed($stream, string $folderId, string $filename = null, bool $unzip = false, bool $overwrite = true, bool $notify = true, int $chunkSize = null):string
{
$filename = $filename ?? stream_get_meta_data($stream)['uri'];
if (empty($filename)) {
return 'Error: n... | php | public function uploadFileStreamed($stream, string $folderId, string $filename = null, bool $unzip = false, bool $overwrite = true, bool $notify = true, int $chunkSize = null):string
{
$filename = $filename ?? stream_get_meta_data($stream)['uri'];
if (empty($filename)) {
return 'Error: n... | [
"public",
"function",
"uploadFileStreamed",
"(",
"$",
"stream",
",",
"string",
"$",
"folderId",
",",
"string",
"$",
"filename",
"=",
"null",
",",
"bool",
"$",
"unzip",
"=",
"false",
",",
"bool",
"$",
"overwrite",
"=",
"true",
",",
"bool",
"$",
"notify",
... | Upload a file using multiple HTTP POSTs.
@param mixed $stream Stream resource
@param string $folderId Id of the parent folder
@param string $filename Filename (optional)
@param bool $unzip Indicates that the upload is a Zip file, and contents must be extracted at the end of upload. The resulting fi... | [
"Upload",
"a",
"file",
"using",
"multiple",
"HTTP",
"POSTs",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L400-L445 |
224,929 | kapersoft/sharefile-api | src/Client.php | Client.getThumbnailUrl | public function getThumbnailUrl(string $itemId, int $size = 75):array
{
$parameters = $this->buildHttpQuery(
[
'size' => $size,
'redirect' => false,
]
);
return $this->get("Items({$itemId})/Thumbnail?{$parameters}");
} | php | public function getThumbnailUrl(string $itemId, int $size = 75):array
{
$parameters = $this->buildHttpQuery(
[
'size' => $size,
'redirect' => false,
]
);
return $this->get("Items({$itemId})/Thumbnail?{$parameters}");
} | [
"public",
"function",
"getThumbnailUrl",
"(",
"string",
"$",
"itemId",
",",
"int",
"$",
"size",
"=",
"75",
")",
":",
"array",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"buildHttpQuery",
"(",
"[",
"'size'",
"=>",
"$",
"size",
",",
"'redirect'",
"=... | Get Thumbnail of an item.
@param string $itemId Item id
@param int $size Thumbnail size: THUMBNAIL_SIZE_M or THUMBNAIL_SIZE_L (optional)
@return array | [
"Get",
"Thumbnail",
"of",
"an",
"item",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L455-L465 |
224,930 | kapersoft/sharefile-api | src/Client.php | Client.createShare | public function createShare(array $options, $notify = false):array
{
$parameters = $this->buildHttpQuery(
[
'notify' => $notify,
'direct' => true,
]
);
return $this->post("Shares?{$parameters}", $options);
} | php | public function createShare(array $options, $notify = false):array
{
$parameters = $this->buildHttpQuery(
[
'notify' => $notify,
'direct' => true,
]
);
return $this->post("Shares?{$parameters}", $options);
} | [
"public",
"function",
"createShare",
"(",
"array",
"$",
"options",
",",
"$",
"notify",
"=",
"false",
")",
":",
"array",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"buildHttpQuery",
"(",
"[",
"'notify'",
"=>",
"$",
"notify",
",",
"'direct'",
"=>",
... | Share Share for external user.
@param array $options Share options
@param bool $notify Indicates whether user will be notified if item is downloaded (optional)
@return array | [
"Share",
"Share",
"for",
"external",
"user",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L487-L497 |
224,931 | kapersoft/sharefile-api | src/Client.php | Client.getItemAccessControls | public function getItemAccessControls(string $itemId, string $userId = ''):array
{
if (! empty($userId)) {
return $this->get("AccessControls(principalid={$userId},itemid={$itemId})");
} else {
return $this->get("Items({$itemId})/AccessControls");
}
} | php | public function getItemAccessControls(string $itemId, string $userId = ''):array
{
if (! empty($userId)) {
return $this->get("AccessControls(principalid={$userId},itemid={$itemId})");
} else {
return $this->get("Items({$itemId})/AccessControls");
}
} | [
"public",
"function",
"getItemAccessControls",
"(",
"string",
"$",
"itemId",
",",
"string",
"$",
"userId",
"=",
"''",
")",
":",
"array",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"userId",
")",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"\"Acce... | Get AccessControl List for an item.
@param string $itemId Id of an item
@param string $userId Id of an user
@return array | [
"Get",
"AccessControl",
"List",
"for",
"an",
"item",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L507-L514 |
224,932 | kapersoft/sharefile-api | src/Client.php | Client.uploadChunk | protected function uploadChunk($uri, $data)
{
$response = $this->client->request(
'POST',
$uri,
[
'headers' => [
'Content-Length' => strlen($data),
'Content-Type' => 'application/octet-stream',
],
... | php | protected function uploadChunk($uri, $data)
{
$response = $this->client->request(
'POST',
$uri,
[
'headers' => [
'Content-Length' => strlen($data),
'Content-Type' => 'application/octet-stream',
],
... | [
"protected",
"function",
"uploadChunk",
"(",
"$",
"uri",
",",
"$",
"data",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'POST'",
",",
"$",
"uri",
",",
"[",
"'headers'",
"=>",
"[",
"'Content-Length'",
"=>",
"strlen... | Upload a chunk of data using HTTP POST body.
@param string $uri Upload URI
@param string $data Contents to upload
@return string|array | [
"Upload",
"a",
"chunk",
"of",
"data",
"using",
"HTTP",
"POST",
"body",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L613-L628 |
224,933 | kapersoft/sharefile-api | src/Client.php | Client.determineException | protected function determineException(ClientException $exception): Exception
{
if (in_array($exception->getResponse()->getStatusCode(), [400, 403, 404, 409])) {
return new BadRequest($exception->getResponse());
}
return $exception;
} | php | protected function determineException(ClientException $exception): Exception
{
if (in_array($exception->getResponse()->getStatusCode(), [400, 403, 404, 409])) {
return new BadRequest($exception->getResponse());
}
return $exception;
} | [
"protected",
"function",
"determineException",
"(",
"ClientException",
"$",
"exception",
")",
":",
"Exception",
"{",
"if",
"(",
"in_array",
"(",
"$",
"exception",
"->",
"getResponse",
"(",
")",
"->",
"getStatusCode",
"(",
")",
",",
"[",
"400",
",",
"403",
... | Handle ClientException.
@param ClientException $exception ClientException
@return Exception | [
"Handle",
"ClientException",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L663-L670 |
224,934 | kapersoft/sharefile-api | src/Client.php | Client.buildHttpQuery | protected function buildHttpQuery(array $parameters):string
{
return http_build_query(
array_map(
function ($parameter) {
if (! is_bool($parameter)) {
return $parameter;
}
return $parameter ? 'tr... | php | protected function buildHttpQuery(array $parameters):string
{
return http_build_query(
array_map(
function ($parameter) {
if (! is_bool($parameter)) {
return $parameter;
}
return $parameter ? 'tr... | [
"protected",
"function",
"buildHttpQuery",
"(",
"array",
"$",
"parameters",
")",
":",
"string",
"{",
"return",
"http_build_query",
"(",
"array_map",
"(",
"function",
"(",
"$",
"parameter",
")",
"{",
"if",
"(",
"!",
"is_bool",
"(",
"$",
"parameter",
")",
")... | Build HTTP query.
@param array $parameters Query parameters
@return string | [
"Build",
"HTTP",
"query",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L679-L693 |
224,935 | kapersoft/sharefile-api | src/Client.php | Client.jsonValidator | protected function jsonValidator($data = null):bool
{
if (! empty($data)) {
@json_decode($data);
return json_last_error() === JSON_ERROR_NONE;
}
return false;
} | php | protected function jsonValidator($data = null):bool
{
if (! empty($data)) {
@json_decode($data);
return json_last_error() === JSON_ERROR_NONE;
}
return false;
} | [
"protected",
"function",
"jsonValidator",
"(",
"$",
"data",
"=",
"null",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"@",
"json_decode",
"(",
"$",
"data",
")",
";",
"return",
"json_last_error",
"(",
")",
"===",
... | Validate JSON.
@param mixed $data JSON variable
@return bool | [
"Validate",
"JSON",
"."
] | b2e8e0fce018e102a914aa4323d41ff3a953d3b9 | https://github.com/kapersoft/sharefile-api/blob/b2e8e0fce018e102a914aa4323d41ff3a953d3b9/src/Client.php#L702-L711 |
224,936 | moeen-basra/laravel-passport-mongodb | src/Passport.php | Passport.routes | public static function routes($callback = null, array $options = [])
{
$callback = $callback ?: function ($router) {
$router->all();
};
$defaultOptions = [
'prefix' => 'oauth',
'namespace' => '\MoeenBasra\LaravelPassportMongoDB\Http\Controllers',
... | php | public static function routes($callback = null, array $options = [])
{
$callback = $callback ?: function ($router) {
$router->all();
};
$defaultOptions = [
'prefix' => 'oauth',
'namespace' => '\MoeenBasra\LaravelPassportMongoDB\Http\Controllers',
... | [
"public",
"static",
"function",
"routes",
"(",
"$",
"callback",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"callback",
"=",
"$",
"callback",
"?",
":",
"function",
"(",
"$",
"router",
")",
"{",
"$",
"router",
"->",
"all... | Binds the Passport routes into the controller.
@param callable|null $callback
@param array $options
@return void | [
"Binds",
"the",
"Passport",
"routes",
"into",
"the",
"controller",
"."
] | 738261912672e39f9f4f4e5bf420b99dbe303ef8 | https://github.com/moeen-basra/laravel-passport-mongodb/blob/738261912672e39f9f4f4e5bf420b99dbe303ef8/src/Passport.php#L104-L120 |
224,937 | moeen-basra/laravel-passport-mongodb | src/Passport.php | Passport.scopesFor | public static function scopesFor(array $ids)
{
return collect($ids)->map(function ($id) {
if (isset(static::$scopes[$id])) {
return new Scope($id, static::$scopes[$id]);
}
return;
})->filter()->values()->all();
} | php | public static function scopesFor(array $ids)
{
return collect($ids)->map(function ($id) {
if (isset(static::$scopes[$id])) {
return new Scope($id, static::$scopes[$id]);
}
return;
})->filter()->values()->all();
} | [
"public",
"static",
"function",
"scopesFor",
"(",
"array",
"$",
"ids",
")",
"{",
"return",
"collect",
"(",
"$",
"ids",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"scopes",
"[",
"$",
... | Get all of the scopes matching the given IDs.
@param array $ids
@return array | [
"Get",
"all",
"of",
"the",
"scopes",
"matching",
"the",
"given",
"IDs",
"."
] | 738261912672e39f9f4f4e5bf420b99dbe303ef8 | https://github.com/moeen-basra/laravel-passport-mongodb/blob/738261912672e39f9f4f4e5bf420b99dbe303ef8/src/Passport.php#L198-L207 |
224,938 | ongr-io/TranslationsBundle | Service/Export/YmlExport.php | YmlExport.export | public function export($file, $translations)
{
$bytes = false;
if (pathinfo($file, PATHINFO_EXTENSION) === 'yml') {
$ymlDumper = new Dumper();
$ymlContent = '';
$ymlContent .= $ymlDumper->dump($translations, 10);
$bytes = file_put_contents($file, $yml... | php | public function export($file, $translations)
{
$bytes = false;
if (pathinfo($file, PATHINFO_EXTENSION) === 'yml') {
$ymlDumper = new Dumper();
$ymlContent = '';
$ymlContent .= $ymlDumper->dump($translations, 10);
$bytes = file_put_contents($file, $yml... | [
"public",
"function",
"export",
"(",
"$",
"file",
",",
"$",
"translations",
")",
"{",
"$",
"bytes",
"=",
"false",
";",
"if",
"(",
"pathinfo",
"(",
"$",
"file",
",",
"PATHINFO_EXTENSION",
")",
"===",
"'yml'",
")",
"{",
"$",
"ymlDumper",
"=",
"new",
"D... | Export translations in to the given file.
@param string $file
@param array $translations
@return bool | [
"Export",
"translations",
"in",
"to",
"the",
"given",
"file",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/Export/YmlExport.php#L29-L41 |
224,939 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.get_recorders | function get_recorders($page, $perpage) {
try {
$pagination = new \Panopto\RemoteRecorderManagement\Pagination();
$pagination->setPageNumber($page);
$pagination->setMaxNumberResults($perpage);
$param = new \Panopto\RemoteRecorderManagement\ListRecorders($this->aut... | php | function get_recorders($page, $perpage) {
try {
$pagination = new \Panopto\RemoteRecorderManagement\Pagination();
$pagination->setPageNumber($page);
$pagination->setMaxNumberResults($perpage);
$param = new \Panopto\RemoteRecorderManagement\ListRecorders($this->aut... | [
"function",
"get_recorders",
"(",
"$",
"page",
",",
"$",
"perpage",
")",
"{",
"try",
"{",
"$",
"pagination",
"=",
"new",
"\\",
"Panopto",
"\\",
"RemoteRecorderManagement",
"\\",
"Pagination",
"(",
")",
";",
"$",
"pagination",
"->",
"setPageNumber",
"(",
"$... | Get the list of remote recorders.
@param int $page The number of page for pagination.
@param int $perpage The number of items per page for pagination.
@return array of the structure ('count' => int total number of records, 'recorders' => array of RemoteRecorder instances). | [
"Get",
"the",
"list",
"of",
"remote",
"recorders",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L87-L98 |
224,940 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.get_recorder | function get_recorder($id) {
try {
$param = new \Panopto\RemoteRecorderManagement\GetRemoteRecordersById($this->auth, array($id));
$recorder = $this->rrmclient->GetRemoteRecordersById($param)->getGetRemoteRecordersByIdResult();
} catch(Exception $e) {
throw new SoapFa... | php | function get_recorder($id) {
try {
$param = new \Panopto\RemoteRecorderManagement\GetRemoteRecordersById($this->auth, array($id));
$recorder = $this->rrmclient->GetRemoteRecordersById($param)->getGetRemoteRecordersByIdResult();
} catch(Exception $e) {
throw new SoapFa... | [
"function",
"get_recorder",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"param",
"=",
"new",
"\\",
"Panopto",
"\\",
"RemoteRecorderManagement",
"\\",
"GetRemoteRecordersById",
"(",
"$",
"this",
"->",
"auth",
",",
"array",
"(",
"$",
"id",
")",
")",
";",
... | Get the single remote recorder instance.
@param string $id The Id of remote recorder.
@return stdClass RemoteRecorder instance. | [
"Get",
"the",
"single",
"remote",
"recorder",
"instance",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L106-L114 |
224,941 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.get_recorders_by_external_id | function get_recorders_by_external_id($externalid) {
try {
$param = new \Panopto\RemoteRecorderManagement\GetRemoteRecordersByExternalId($this->auth, array($externalid));
$recorders = $this->rrmclient->GetRemoteRecordersByExternalId($param)->getGetRemoteRecordersByExternalIdResult();
... | php | function get_recorders_by_external_id($externalid) {
try {
$param = new \Panopto\RemoteRecorderManagement\GetRemoteRecordersByExternalId($this->auth, array($externalid));
$recorders = $this->rrmclient->GetRemoteRecordersByExternalId($param)->getGetRemoteRecordersByExternalIdResult();
... | [
"function",
"get_recorders_by_external_id",
"(",
"$",
"externalid",
")",
"{",
"try",
"{",
"$",
"param",
"=",
"new",
"\\",
"Panopto",
"\\",
"RemoteRecorderManagement",
"\\",
"GetRemoteRecordersByExternalId",
"(",
"$",
"this",
"->",
"auth",
",",
"array",
"(",
"$",... | Get the remote recorders instances by ExternalID.
@param string $externalid External Id of remote recorder.
@return stdClass ArrayOfRemoteRecorder instance. | [
"Get",
"the",
"remote",
"recorders",
"instances",
"by",
"ExternalID",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L122-L133 |
224,942 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.set_recorder_externalid | function set_recorder_externalid($id, $externalid) {
if ($externalid === 'NULL') {
$externalid = null;
}
try {
$param = new \Panopto\RemoteRecorderManagement\UpdateRemoteRecorderExternalId($this->auth, $id, $externalid);
$result = $this->rrmclient->UpdateRemot... | php | function set_recorder_externalid($id, $externalid) {
if ($externalid === 'NULL') {
$externalid = null;
}
try {
$param = new \Panopto\RemoteRecorderManagement\UpdateRemoteRecorderExternalId($this->auth, $id, $externalid);
$result = $this->rrmclient->UpdateRemot... | [
"function",
"set_recorder_externalid",
"(",
"$",
"id",
",",
"$",
"externalid",
")",
"{",
"if",
"(",
"$",
"externalid",
"===",
"'NULL'",
")",
"{",
"$",
"externalid",
"=",
"null",
";",
"}",
"try",
"{",
"$",
"param",
"=",
"new",
"\\",
"Panopto",
"\\",
"... | Set ExternalID for remote recorder.
@param string $id Remote recorder id.
@param string $externalid External Id of remote recorder.
@return stdClass RemoteRecorder instance. | [
"Set",
"ExternalID",
"for",
"remote",
"recorder",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L143-L154 |
224,943 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.schedule_recording | function schedule_recording($name, $folderid, $start, $end, $primaryrecorderid, $secondaryrecorderid = '', $isbroadcast = false) {
$recordersettings = array();
$primaryrecorder = $this->get_recorder($primaryrecorderid);
$recordersetting = new \Panopto\RemoteRecorderManagement\RecorderSettings()... | php | function schedule_recording($name, $folderid, $start, $end, $primaryrecorderid, $secondaryrecorderid = '', $isbroadcast = false) {
$recordersettings = array();
$primaryrecorder = $this->get_recorder($primaryrecorderid);
$recordersetting = new \Panopto\RemoteRecorderManagement\RecorderSettings()... | [
"function",
"schedule_recording",
"(",
"$",
"name",
",",
"$",
"folderid",
",",
"$",
"start",
",",
"$",
"end",
",",
"$",
"primaryrecorderid",
",",
"$",
"secondaryrecorderid",
"=",
"''",
",",
"$",
"isbroadcast",
"=",
"false",
")",
"{",
"$",
"recordersettings... | Schedule a new recording.
@param string $name Session name
@param string $folderid Remote folder id.
@param string $start Session start time.
@param string $end Session end time.
@param string $primaryrecorderid Remote recorder id to be used as primary.
@param string $secondaryrecorderid Remote recorder id to be used ... | [
"Schedule",
"a",
"new",
"recording",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L168-L190 |
224,944 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.add_folder | function add_folder($name, $externalid, $parentfolderid = '') {
// Check parent folder existense first.
if (empty($parentfolderid)) {
$parentfolderid = null;
} else {
$param = new \Panopto\SessionManagement\GetFoldersById($this->auth, array($parentfolderid));
... | php | function add_folder($name, $externalid, $parentfolderid = '') {
// Check parent folder existense first.
if (empty($parentfolderid)) {
$parentfolderid = null;
} else {
$param = new \Panopto\SessionManagement\GetFoldersById($this->auth, array($parentfolderid));
... | [
"function",
"add_folder",
"(",
"$",
"name",
",",
"$",
"externalid",
",",
"$",
"parentfolderid",
"=",
"''",
")",
"{",
"// Check parent folder existense first.",
"if",
"(",
"empty",
"(",
"$",
"parentfolderid",
")",
")",
"{",
"$",
"parentfolderid",
"=",
"null",
... | Create a new folder and assign it an external id.
@param str $name Folder name.
@param str $externalid External ID of the folder.
@param str $parentfolderid Parent folder internal id.
@return str $folderid Folder id. | [
"Create",
"a",
"new",
"folder",
"and",
"assign",
"it",
"an",
"external",
"id",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L200-L229 |
224,945 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.get_folderid_by_externalid | function get_folderid_by_externalid($externalid) {
try {
$param = new \Panopto\SessionManagement\GetFoldersByExternalId($this->auth, array($externalid));
$folders = $this->smclient->GetFoldersByExternalId($param)->getGetFoldersByExternalIdResult();
} catch(Exception $e) {
... | php | function get_folderid_by_externalid($externalid) {
try {
$param = new \Panopto\SessionManagement\GetFoldersByExternalId($this->auth, array($externalid));
$folders = $this->smclient->GetFoldersByExternalId($param)->getGetFoldersByExternalIdResult();
} catch(Exception $e) {
... | [
"function",
"get_folderid_by_externalid",
"(",
"$",
"externalid",
")",
"{",
"try",
"{",
"$",
"param",
"=",
"new",
"\\",
"Panopto",
"\\",
"SessionManagement",
"\\",
"GetFoldersByExternalId",
"(",
"$",
"this",
"->",
"auth",
",",
"array",
"(",
"$",
"externalid",
... | Get the single folderid by external id.
@param string $externalid Folder external id.
@return mixed $folderid Folder id or false if no folder is found. | [
"Get",
"the",
"single",
"folderid",
"by",
"external",
"id",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L237-L248 |
224,946 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.delete_session | function delete_session($sessionid) {
try {
$param = new \Panopto\SessionManagement\DeleteSessions($this->auth, array($sessionid));
$this->smclient->DeleteSessions($param);
} catch (Exception $e) {
throw new SoapFault('client', $e->getMessage());
}
ret... | php | function delete_session($sessionid) {
try {
$param = new \Panopto\SessionManagement\DeleteSessions($this->auth, array($sessionid));
$this->smclient->DeleteSessions($param);
} catch (Exception $e) {
throw new SoapFault('client', $e->getMessage());
}
ret... | [
"function",
"delete_session",
"(",
"$",
"sessionid",
")",
"{",
"try",
"{",
"$",
"param",
"=",
"new",
"\\",
"Panopto",
"\\",
"SessionManagement",
"\\",
"DeleteSessions",
"(",
"$",
"this",
"->",
"auth",
",",
"array",
"(",
"$",
"sessionid",
")",
")",
";",
... | Delete session.
@param string $sessionid Remote session id.
@param string $externalid External Id of remote recorder.
@return bool true. | [
"Delete",
"session",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L347-L355 |
224,947 | lucisgit/php-panopto-api | examples/samplelib.php | panopto_interface.get_session_by_id | function get_session_by_id($sessionid) {
try {
$param = new \Panopto\SessionManagement\GetSessionsById($this->auth, array($sessionid));
$sessions = $this->smclient->GetSessionsById($param)->getGetSessionsByIdResult()->getSession();
} catch (Exception $e) {
return fals... | php | function get_session_by_id($sessionid) {
try {
$param = new \Panopto\SessionManagement\GetSessionsById($this->auth, array($sessionid));
$sessions = $this->smclient->GetSessionsById($param)->getGetSessionsByIdResult()->getSession();
} catch (Exception $e) {
return fals... | [
"function",
"get_session_by_id",
"(",
"$",
"sessionid",
")",
"{",
"try",
"{",
"$",
"param",
"=",
"new",
"\\",
"Panopto",
"\\",
"SessionManagement",
"\\",
"GetSessionsById",
"(",
"$",
"this",
"->",
"auth",
",",
"array",
"(",
"$",
"sessionid",
")",
")",
";... | Get session by id.
@param string $sessionid Remote session id.
@return mixed Session object on success, false on failure. | [
"Get",
"session",
"by",
"id",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/examples/samplelib.php#L363-L374 |
224,948 | thephpleague/di | src/League/Di/Container.php | Container.build | public function build($concrete)
{
$reflection = new \ReflectionClass($concrete);
if (! $reflection->isInstantiable()) {
throw new \InvalidArgumentException(sprintf('Class %s is not instantiable.', $concrete));
}
$constructor = $reflection->getConstructor();
if... | php | public function build($concrete)
{
$reflection = new \ReflectionClass($concrete);
if (! $reflection->isInstantiable()) {
throw new \InvalidArgumentException(sprintf('Class %s is not instantiable.', $concrete));
}
$constructor = $reflection->getConstructor();
if... | [
"public",
"function",
"build",
"(",
"$",
"concrete",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"concrete",
")",
";",
"if",
"(",
"!",
"$",
"reflection",
"->",
"isInstantiable",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
... | Build a concrete instance of a class.
@param string $concrete The name of the class to buld.
@return mixed The instantiated class.
@throws \InvalidArgumentException | [
"Build",
"a",
"concrete",
"instance",
"of",
"a",
"class",
"."
] | 5ab97529cc687d65733fc8feb96a8331c4eda4e1 | https://github.com/thephpleague/di/blob/5ab97529cc687d65733fc8feb96a8331c4eda4e1/src/League/Di/Container.php#L99-L116 |
224,949 | thephpleague/di | src/League/Di/Container.php | Container.extend | public function extend($binding, \Closure $closure)
{
$rawObject = $this->getRaw($binding);
if (is_null($rawObject)) {
throw new \InvalidArgumentException(sprintf('Cannot extend %s because it has not yet been bound.', $binding));
}
$this->bind($binding, function ($conta... | php | public function extend($binding, \Closure $closure)
{
$rawObject = $this->getRaw($binding);
if (is_null($rawObject)) {
throw new \InvalidArgumentException(sprintf('Cannot extend %s because it has not yet been bound.', $binding));
}
$this->bind($binding, function ($conta... | [
"public",
"function",
"extend",
"(",
"$",
"binding",
",",
"\\",
"Closure",
"$",
"closure",
")",
"{",
"$",
"rawObject",
"=",
"$",
"this",
"->",
"getRaw",
"(",
"$",
"binding",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"rawObject",
")",
")",
"{",
"thr... | Extend an existing binding.
@param string $binding The name of the binding to extend.
@param \Closure $closure The function to use to extend the existing binding.
@return void
@throws \InvalidArgumentException | [
"Extend",
"an",
"existing",
"binding",
"."
] | 5ab97529cc687d65733fc8feb96a8331c4eda4e1 | https://github.com/thephpleague/di/blob/5ab97529cc687d65733fc8feb96a8331c4eda4e1/src/League/Di/Container.php#L127-L138 |
224,950 | thephpleague/di | src/League/Di/Container.php | Container.getDependencies | protected function getDependencies(\ReflectionMethod $method)
{
$dependencies = array();
foreach ($method->getParameters() as $param) {
$dependency = $param->getClass();
if (is_null($dependency)) {
if ($param->isOptional()) {
$dependencie... | php | protected function getDependencies(\ReflectionMethod $method)
{
$dependencies = array();
foreach ($method->getParameters() as $param) {
$dependency = $param->getClass();
if (is_null($dependency)) {
if ($param->isOptional()) {
$dependencie... | [
"protected",
"function",
"getDependencies",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
")",
"{",
"$",
"dependencies",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"method",
"->",
"getParameters",
"(",
")",
"as",
"$",
"param",
")",
"{",
"$",
"depe... | Recursively build the dependency list for the provided method.
@param \ReflectionMethod $method The method for which to obtain dependencies.
@return array An array containing the method dependencies.
@throws \InvalidArgumentException | [
"Recursively",
"build",
"the",
"dependency",
"list",
"for",
"the",
"provided",
"method",
"."
] | 5ab97529cc687d65733fc8feb96a8331c4eda4e1 | https://github.com/thephpleague/di/blob/5ab97529cc687d65733fc8feb96a8331c4eda4e1/src/League/Di/Container.php#L148-L169 |
224,951 | thephpleague/di | src/League/Di/Container.php | Container.getRaw | public function getRaw($binding)
{
if (isset($this->bindings[$binding])) {
return $this->bindings[$binding];
} elseif (isset($this->parent)) {
return $this->parent->getRaw($binding);
}
return null;
} | php | public function getRaw($binding)
{
if (isset($this->bindings[$binding])) {
return $this->bindings[$binding];
} elseif (isset($this->parent)) {
return $this->parent->getRaw($binding);
}
return null;
} | [
"public",
"function",
"getRaw",
"(",
"$",
"binding",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"bindings",
"[",
"$",
"binding",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"bindings",
"[",
"$",
"binding",
"]",
";",
"}",
"elseif",
... | Get the raw object prior to resolution.
@param string $binding The $binding key to get the raw value from.
@return Definition|\Closure Value of the $binding. | [
"Get",
"the",
"raw",
"object",
"prior",
"to",
"resolution",
"."
] | 5ab97529cc687d65733fc8feb96a8331c4eda4e1 | https://github.com/thephpleague/di/blob/5ab97529cc687d65733fc8feb96a8331c4eda4e1/src/League/Di/Container.php#L178-L187 |
224,952 | ongr-io/TranslationsBundle | Service/Export/ExportManager.php | ExportManager.export | public function export($domains = [], $force = null)
{
foreach ($this->formExportList($domains, $force) as $file => $translations) {
if (!file_exists($file)) {
(new Filesystem())->touch($file);
}
$currentTranslations = $this->parser->parse(file_get_conten... | php | public function export($domains = [], $force = null)
{
foreach ($this->formExportList($domains, $force) as $file => $translations) {
if (!file_exists($file)) {
(new Filesystem())->touch($file);
}
$currentTranslations = $this->parser->parse(file_get_conten... | [
"public",
"function",
"export",
"(",
"$",
"domains",
"=",
"[",
"]",
",",
"$",
"force",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"formExportList",
"(",
"$",
"domains",
",",
"$",
"force",
")",
"as",
"$",
"file",
"=>",
"$",
"translati... | Exports translations from ES to files.
@param array $domains To export.
@param bool $force | [
"Exports",
"translations",
"from",
"ES",
"to",
"files",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/Export/ExportManager.php#L86-L104 |
224,953 | ongr-io/TranslationsBundle | Service/Export/ExportManager.php | ExportManager.flatten | private function flatten($array, $prefix = '') {
$result = [];
foreach($array as $key=>$value) {
if(is_array($value)) {
$result = $result + $this->flatten($value, $prefix . $key . '.');
}
else {
$result[$prefix . $key] = $value;
... | php | private function flatten($array, $prefix = '') {
$result = [];
foreach($array as $key=>$value) {
if(is_array($value)) {
$result = $result + $this->flatten($value, $prefix . $key . '.');
}
else {
$result[$prefix . $key] = $value;
... | [
"private",
"function",
"flatten",
"(",
"$",
"array",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"val... | Flatten multidimensional array and concatenating keys
@param $array
@return array | [
"Flatten",
"multidimensional",
"array",
"and",
"concatenating",
"keys"
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/Export/ExportManager.php#L113-L124 |
224,954 | ongr-io/TranslationsBundle | Service/Export/ExportManager.php | ExportManager.formExportList | private function formExportList($domains, $force)
{
$output = [];
$filters = array_filter([
'messages.locale' => $this->getLocales(),
'domain' => $domains
]);
$translations = $this->translationManager->getAll($filters);
/** @var Translation $translat... | php | private function formExportList($domains, $force)
{
$output = [];
$filters = array_filter([
'messages.locale' => $this->getLocales(),
'domain' => $domains
]);
$translations = $this->translationManager->getAll($filters);
/** @var Translation $translat... | [
"private",
"function",
"formExportList",
"(",
"$",
"domains",
",",
"$",
"force",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"filters",
"=",
"array_filter",
"(",
"[",
"'messages.locale'",
"=>",
"$",
"this",
"->",
"getLocales",
"(",
")",
",",
"'do... | Get translations for export.
@param array $domains To read from storage.
@param bool $force Determines if the message status is relevant.
@return array | [
"Get",
"translations",
"for",
"export",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/Export/ExportManager.php#L134-L166 |
224,955 | kzykhys/PHPCsvParser | src/KzykHys/CsvParser/Iterator/CsvIterator.php | CsvIterator.processEnclosedField | private function processEnclosedField($value, array $option)
{
// then, remove enclosure and line feed
$cell = $this->trimEnclosure($value, $option['enclosure']);
// replace the escape sequence "" to "
$cell = $this->unescapeEnclosure($cell, $option['enclosure']);
$this->set... | php | private function processEnclosedField($value, array $option)
{
// then, remove enclosure and line feed
$cell = $this->trimEnclosure($value, $option['enclosure']);
// replace the escape sequence "" to "
$cell = $this->unescapeEnclosure($cell, $option['enclosure']);
$this->set... | [
"private",
"function",
"processEnclosedField",
"(",
"$",
"value",
",",
"array",
"$",
"option",
")",
"{",
"// then, remove enclosure and line feed",
"$",
"cell",
"=",
"$",
"this",
"->",
"trimEnclosure",
"(",
"$",
"value",
",",
"$",
"option",
"[",
"'enclosure'",
... | Process enclosed field
example: "value"
@param string $value Current token
@param array $option Option | [
"Process",
"enclosed",
"field"
] | a7d20bbfe1ec6402d736975571d8f4dcece6b489 | https://github.com/kzykhys/PHPCsvParser/blob/a7d20bbfe1ec6402d736975571d8f4dcece6b489/src/KzykHys/CsvParser/Iterator/CsvIterator.php#L133-L143 |
224,956 | kzykhys/PHPCsvParser | src/KzykHys/CsvParser/Iterator/CsvIterator.php | CsvIterator.processContinuousField | private function processContinuousField($value, array $option)
{
$cell = $this->trimLeftEnclosure($value, $option['enclosure']);
$cell = $this->unescapeEnclosure($cell, $option['enclosure']);
$this->setCell($cell);
$this->continue = true;
} | php | private function processContinuousField($value, array $option)
{
$cell = $this->trimLeftEnclosure($value, $option['enclosure']);
$cell = $this->unescapeEnclosure($cell, $option['enclosure']);
$this->setCell($cell);
$this->continue = true;
} | [
"private",
"function",
"processContinuousField",
"(",
"$",
"value",
",",
"array",
"$",
"option",
")",
"{",
"$",
"cell",
"=",
"$",
"this",
"->",
"trimLeftEnclosure",
"(",
"$",
"value",
",",
"$",
"option",
"[",
"'enclosure'",
"]",
")",
";",
"$",
"cell",
... | Process enclosed and multiple line field
example: "value\n
@param string $value Current token
@param array $option Option | [
"Process",
"enclosed",
"and",
"multiple",
"line",
"field"
] | a7d20bbfe1ec6402d736975571d8f4dcece6b489 | https://github.com/kzykhys/PHPCsvParser/blob/a7d20bbfe1ec6402d736975571d8f4dcece6b489/src/KzykHys/CsvParser/Iterator/CsvIterator.php#L153-L160 |
224,957 | kzykhys/PHPCsvParser | src/KzykHys/CsvParser/Iterator/CsvIterator.php | CsvIterator.processClosingField | private function processClosingField($value, array $option)
{
$cell = $this->trimRightEnclosure($value, $option['enclosure']);
$cell = $this->unescapeEnclosure($cell, $option['enclosure']);
$this->joinCell($this->revert . $cell);
$this->continue = false;
$this->col++;
} | php | private function processClosingField($value, array $option)
{
$cell = $this->trimRightEnclosure($value, $option['enclosure']);
$cell = $this->unescapeEnclosure($cell, $option['enclosure']);
$this->joinCell($this->revert . $cell);
$this->continue = false;
$this->col++;
} | [
"private",
"function",
"processClosingField",
"(",
"$",
"value",
",",
"array",
"$",
"option",
")",
"{",
"$",
"cell",
"=",
"$",
"this",
"->",
"trimRightEnclosure",
"(",
"$",
"value",
",",
"$",
"option",
"[",
"'enclosure'",
"]",
")",
";",
"$",
"cell",
"=... | Process end of enclosure
example: value"
If previous token was not closed, this token is joined,
otherwise this token is a new cell.
@param string $value Current token
@param array $option Option | [
"Process",
"end",
"of",
"enclosure"
] | a7d20bbfe1ec6402d736975571d8f4dcece6b489 | https://github.com/kzykhys/PHPCsvParser/blob/a7d20bbfe1ec6402d736975571d8f4dcece6b489/src/KzykHys/CsvParser/Iterator/CsvIterator.php#L173-L181 |
224,958 | kzykhys/PHPCsvParser | src/KzykHys/CsvParser/Iterator/CsvIterator.php | CsvIterator.processField | private function processField($value, array $option)
{
if($this->continue) {
$cell = $this->unescapeEnclosure($value, $option['enclosure']);
$this->joinCell($this->revert . $cell);
} else {
$cell = rtrim($value);
$cell = $this->unescapeEnclosure($cell,... | php | private function processField($value, array $option)
{
if($this->continue) {
$cell = $this->unescapeEnclosure($value, $option['enclosure']);
$this->joinCell($this->revert . $cell);
} else {
$cell = rtrim($value);
$cell = $this->unescapeEnclosure($cell,... | [
"private",
"function",
"processField",
"(",
"$",
"value",
",",
"array",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"continue",
")",
"{",
"$",
"cell",
"=",
"$",
"this",
"->",
"unescapeEnclosure",
"(",
"$",
"value",
",",
"$",
"option",
"[",... | Process unenclosed field
example: value
@param string $value Current token
@param array $option Option | [
"Process",
"unenclosed",
"field"
] | a7d20bbfe1ec6402d736975571d8f4dcece6b489 | https://github.com/kzykhys/PHPCsvParser/blob/a7d20bbfe1ec6402d736975571d8f4dcece6b489/src/KzykHys/CsvParser/Iterator/CsvIterator.php#L191-L202 |
224,959 | kzykhys/PHPCsvParser | src/KzykHys/CsvParser/Iterator/CsvIterator.php | CsvIterator.trimEnclosure | private function trimEnclosure($value, $enclosure)
{
$value = $this->trimLeftEnclosure($value, $enclosure);
$value = $this->trimRightEnclosure($value, $enclosure);
return $value;
} | php | private function trimEnclosure($value, $enclosure)
{
$value = $this->trimLeftEnclosure($value, $enclosure);
$value = $this->trimRightEnclosure($value, $enclosure);
return $value;
} | [
"private",
"function",
"trimEnclosure",
"(",
"$",
"value",
",",
"$",
"enclosure",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"trimLeftEnclosure",
"(",
"$",
"value",
",",
"$",
"enclosure",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"trimRightE... | String enclosure string from beginning and end of the string
@param string $value
@param string $enclosure
@return string | [
"String",
"enclosure",
"string",
"from",
"beginning",
"and",
"end",
"of",
"the",
"string"
] | a7d20bbfe1ec6402d736975571d8f4dcece6b489 | https://github.com/kzykhys/PHPCsvParser/blob/a7d20bbfe1ec6402d736975571d8f4dcece6b489/src/KzykHys/CsvParser/Iterator/CsvIterator.php#L244-L250 |
224,960 | kzykhys/PHPCsvParser | src/KzykHys/CsvParser/Iterator/CsvIterator.php | CsvIterator.trimLeftEnclosure | private function trimLeftEnclosure($value, $enclosure)
{
if (substr($value, 0, 1) == $enclosure) {
$value = substr($value, 1);
}
return $value;
} | php | private function trimLeftEnclosure($value, $enclosure)
{
if (substr($value, 0, 1) == $enclosure) {
$value = substr($value, 1);
}
return $value;
} | [
"private",
"function",
"trimLeftEnclosure",
"(",
"$",
"value",
",",
"$",
"enclosure",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"value",
",",
"0",
",",
"1",
")",
"==",
"$",
"enclosure",
")",
"{",
"$",
"value",
"=",
"substr",
"(",
"$",
"value",
",",
... | Strip an enclosure string from beginning of the string
@param string $value
@param string $enclosure
@return string | [
"Strip",
"an",
"enclosure",
"string",
"from",
"beginning",
"of",
"the",
"string"
] | a7d20bbfe1ec6402d736975571d8f4dcece6b489 | https://github.com/kzykhys/PHPCsvParser/blob/a7d20bbfe1ec6402d736975571d8f4dcece6b489/src/KzykHys/CsvParser/Iterator/CsvIterator.php#L259-L266 |
224,961 | kzykhys/PHPCsvParser | src/KzykHys/CsvParser/Iterator/CsvIterator.php | CsvIterator.trimRightEnclosure | private function trimRightEnclosure($value, $enclosure)
{
if (substr($value, -1) == $enclosure) {
$value = substr($value, 0, -1);
}
return $value;
} | php | private function trimRightEnclosure($value, $enclosure)
{
if (substr($value, -1) == $enclosure) {
$value = substr($value, 0, -1);
}
return $value;
} | [
"private",
"function",
"trimRightEnclosure",
"(",
"$",
"value",
",",
"$",
"enclosure",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"value",
",",
"-",
"1",
")",
"==",
"$",
"enclosure",
")",
"{",
"$",
"value",
"=",
"substr",
"(",
"$",
"value",
",",
"0",... | Strip an enclosure string from end of the string
@param string $value
@param string $enclosure
@return string | [
"Strip",
"an",
"enclosure",
"string",
"from",
"end",
"of",
"the",
"string"
] | a7d20bbfe1ec6402d736975571d8f4dcece6b489 | https://github.com/kzykhys/PHPCsvParser/blob/a7d20bbfe1ec6402d736975571d8f4dcece6b489/src/KzykHys/CsvParser/Iterator/CsvIterator.php#L275-L282 |
224,962 | valga/fbns-react | src/Lite/ReactMqttClient.php | ReactMqttClient.connect | public function connect($host, $port, Connection $connection, $timeout = 5)
{
if ($this->isConnected || $this->isConnecting) {
return new RejectedPromise(new \LogicException('The client is already connected.'));
}
$this->isConnecting = true;
$this->isConnected = false;
... | php | public function connect($host, $port, Connection $connection, $timeout = 5)
{
if ($this->isConnected || $this->isConnecting) {
return new RejectedPromise(new \LogicException('The client is already connected.'));
}
$this->isConnecting = true;
$this->isConnected = false;
... | [
"public",
"function",
"connect",
"(",
"$",
"host",
",",
"$",
"port",
",",
"Connection",
"$",
"connection",
",",
"$",
"timeout",
"=",
"5",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isConnected",
"||",
"$",
"this",
"->",
"isConnecting",
")",
"{",
"retur... | Connects to a broker.
@param string $host
@param int $port
@param Connection $connection
@param int $timeout
@return ExtendedPromiseInterface | [
"Connects",
"to",
"a",
"broker",
"."
] | 4bbf513a8ffed7e0c9ca10776033d34515bb8b37 | https://github.com/valga/fbns-react/blob/4bbf513a8ffed7e0c9ca10776033d34515bb8b37/src/Lite/ReactMqttClient.php#L174-L224 |
224,963 | valga/fbns-react | src/Lite/ReactMqttClient.php | ReactMqttClient.cleanPreviousSession | private function cleanPreviousSession()
{
$error = new \RuntimeException('Connection has been closed.');
foreach ($this->receivingFlows as $receivingFlow) {
$receivingFlow->getDeferred()->reject($error);
}
$this->receivingFlows = [];
foreach ($this->sendingFlows a... | php | private function cleanPreviousSession()
{
$error = new \RuntimeException('Connection has been closed.');
foreach ($this->receivingFlows as $receivingFlow) {
$receivingFlow->getDeferred()->reject($error);
}
$this->receivingFlows = [];
foreach ($this->sendingFlows a... | [
"private",
"function",
"cleanPreviousSession",
"(",
")",
"{",
"$",
"error",
"=",
"new",
"\\",
"RuntimeException",
"(",
"'Connection has been closed.'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"receivingFlows",
"as",
"$",
"receivingFlow",
")",
"{",
"$",
"r... | Cleans previous session by rejecting all pending flows. | [
"Cleans",
"previous",
"session",
"by",
"rejecting",
"all",
"pending",
"flows",
"."
] | 4bbf513a8ffed7e0c9ca10776033d34515bb8b37 | https://github.com/valga/fbns-react/blob/4bbf513a8ffed7e0c9ca10776033d34515bb8b37/src/Lite/ReactMqttClient.php#L683-L694 |
224,964 | ongr-io/TranslationsBundle | Service/HistoryManager.php | HistoryManager.getHistory | public function getHistory(Translation $translation)
{
$ordered = [];
$histories = $this->getUnorderedHistory($translation);
/** @var History $history */
foreach ($histories as $history) {
$ordered[$history->getLocale()][] = $history;
}
return $ordered;
... | php | public function getHistory(Translation $translation)
{
$ordered = [];
$histories = $this->getUnorderedHistory($translation);
/** @var History $history */
foreach ($histories as $history) {
$ordered[$history->getLocale()][] = $history;
}
return $ordered;
... | [
"public",
"function",
"getHistory",
"(",
"Translation",
"$",
"translation",
")",
"{",
"$",
"ordered",
"=",
"[",
"]",
";",
"$",
"histories",
"=",
"$",
"this",
"->",
"getUnorderedHistory",
"(",
"$",
"translation",
")",
";",
"/** @var History $history */",
"forea... | Returns an array of history objects grouped by locales
@param Translation $translation
@return array | [
"Returns",
"an",
"array",
"of",
"history",
"objects",
"grouped",
"by",
"locales"
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/HistoryManager.php#L47-L58 |
224,965 | ongr-io/TranslationsBundle | Service/HistoryManager.php | HistoryManager.getUnorderedHistory | private function getUnorderedHistory(Translation $translation)
{
$search = $this->repository->createSearch();
$search->addQuery(new TermQuery('key', $translation->getKey()));
$search->addQuery(new TermQuery('domain', $translation->getDomain()));
$search->addSort(new FieldSort('create... | php | private function getUnorderedHistory(Translation $translation)
{
$search = $this->repository->createSearch();
$search->addQuery(new TermQuery('key', $translation->getKey()));
$search->addQuery(new TermQuery('domain', $translation->getDomain()));
$search->addSort(new FieldSort('create... | [
"private",
"function",
"getUnorderedHistory",
"(",
"Translation",
"$",
"translation",
")",
"{",
"$",
"search",
"=",
"$",
"this",
"->",
"repository",
"->",
"createSearch",
"(",
")",
";",
"$",
"search",
"->",
"addQuery",
"(",
"new",
"TermQuery",
"(",
"'key'",
... | Returns message history.
@param Translation $translation
@return DocumentIterator | [
"Returns",
"message",
"history",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/HistoryManager.php#L83-L91 |
224,966 | lucisgit/php-panopto-api | lib/Client.php | Client.setAuthenticationInfo | public function setAuthenticationInfo($userkey = '', $password = '', $applicationkey = '') {
// Create AuthenticationInfo instance.
$this->authinfo = new \Panopto\Auth\AuthenticationInfo();
// Populate authentication settings.
if (!empty($userkey)) {
$this->authinfo->setUser... | php | public function setAuthenticationInfo($userkey = '', $password = '', $applicationkey = '') {
// Create AuthenticationInfo instance.
$this->authinfo = new \Panopto\Auth\AuthenticationInfo();
// Populate authentication settings.
if (!empty($userkey)) {
$this->authinfo->setUser... | [
"public",
"function",
"setAuthenticationInfo",
"(",
"$",
"userkey",
"=",
"''",
",",
"$",
"password",
"=",
"''",
",",
"$",
"applicationkey",
"=",
"''",
")",
"{",
"// Create AuthenticationInfo instance.",
"$",
"this",
"->",
"authinfo",
"=",
"new",
"\\",
"Panopto... | Sets AuthenticationInfo object for using in requests.
This creates an instance of \Panopto\Auth\AuthenticationInfo that
has been pre-configured with provided credentials.
@param string $userkey User on the server to use for API calls. If used with Application Key from Identity Provider, user needs to be preceed with ... | [
"Sets",
"AuthenticationInfo",
"object",
"for",
"using",
"in",
"requests",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/lib/Client.php#L126-L141 |
224,967 | lucisgit/php-panopto-api | lib/Client.php | Client.createAuthCode | protected function createAuthCode($userkey, $applicationkey) {
$payload = $userkey . "@" . strtolower($this->serverhostname) . "|" . strtolower($applicationkey);
return strtoupper(sha1($payload));
} | php | protected function createAuthCode($userkey, $applicationkey) {
$payload = $userkey . "@" . strtolower($this->serverhostname) . "|" . strtolower($applicationkey);
return strtoupper(sha1($payload));
} | [
"protected",
"function",
"createAuthCode",
"(",
"$",
"userkey",
",",
"$",
"applicationkey",
")",
"{",
"$",
"payload",
"=",
"$",
"userkey",
".",
"\"@\"",
".",
"strtolower",
"(",
"$",
"this",
"->",
"serverhostname",
")",
".",
"\"|\"",
".",
"strtolower",
"(",... | Generates authentication code.
For using with \Panopto\Auth\AuthenticationInfo.
@param string $userkey
@param string $applicationkey
@return string Authentication code. | [
"Generates",
"authentication",
"code",
"."
] | 2996184eff11bf69932c69074e0b225498c17574 | https://github.com/lucisgit/php-panopto-api/blob/2996184eff11bf69932c69074e0b225498c17574/lib/Client.php#L152-L155 |
224,968 | pdeans/http | src/Client.php | Client.trace | public function trace($uri, array $headers = [])
{
return $this->sendRequest(
$this->message->createRequest('TRACE', $uri, $headers, null)
);
} | php | public function trace($uri, array $headers = [])
{
return $this->sendRequest(
$this->message->createRequest('TRACE', $uri, $headers, null)
);
} | [
"public",
"function",
"trace",
"(",
"$",
"uri",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"sendRequest",
"(",
"$",
"this",
"->",
"message",
"->",
"createRequest",
"(",
"'TRACE'",
",",
"$",
"uri",
",",
"$",
... | Send a TRACE request
@param \Psr\Http\Message\UriInterface|string $uri
@param array $headers
@return \Psr\Http\Message\ResponseInterface | [
"Send",
"a",
"TRACE",
"request"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Client.php#L210-L215 |
224,969 | pdeans/http | src/Client.php | Client.sendRequest | public function sendRequest(RequestInterface $request)
{
$response = $this->createResponse();
$options = $this->createOptions($request, $response);
// Reset cURL handler
if (is_resource($this->ch)) {
if (function_exists('curl_reset')) {
curl_reset($this->ch);
}
else {
curl_close($this->ch);
... | php | public function sendRequest(RequestInterface $request)
{
$response = $this->createResponse();
$options = $this->createOptions($request, $response);
// Reset cURL handler
if (is_resource($this->ch)) {
if (function_exists('curl_reset')) {
curl_reset($this->ch);
}
else {
curl_close($this->ch);
... | [
"public",
"function",
"sendRequest",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"createResponse",
"(",
")",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"createOptions",
"(",
"$",
"request",
",",
"$",
"res... | Send a PSR-7 Request
@param \Psr\Http\Message\RequestInterface $request
@return \Psr\Http\Message\ResponseInterface
@throws \pdeans\Http\Exceptions\NetworkException Invalid request due to network issue
@throws \pdeans\Http\Exceptions\RequestException Invalid request
@throws \InvalidArgumentException Invalid heade... | [
"Send",
"a",
"PSR",
"-",
"7",
"Request"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Client.php#L232-L278 |
224,970 | pdeans/http | src/Client.php | Client.createResponse | protected function createResponse()
{
try {
$body = $this->stream->createStream(fopen('php://temp', 'w+b'));
}
catch (InvalidArgumentException $e) {
throw new RuntimeException('Unable to create stream "php://temp"');
}
return new ResponseBuilder(
$this->message->createResponse(200, null, [], $body)... | php | protected function createResponse()
{
try {
$body = $this->stream->createStream(fopen('php://temp', 'w+b'));
}
catch (InvalidArgumentException $e) {
throw new RuntimeException('Unable to create stream "php://temp"');
}
return new ResponseBuilder(
$this->message->createResponse(200, null, [], $body)... | [
"protected",
"function",
"createResponse",
"(",
")",
"{",
"try",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"stream",
"->",
"createStream",
"(",
"fopen",
"(",
"'php://temp'",
",",
"'w+b'",
")",
")",
";",
"}",
"catch",
"(",
"InvalidArgumentException",
"$",
... | Create a new http response
@return \pdeans\Http\Builders\ResponseBuilder
@throws \RuntimeException Failure to create stream | [
"Create",
"a",
"new",
"http",
"response"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Client.php#L291-L303 |
224,971 | pdeans/http | src/Client.php | Client.createHeaders | protected function createHeaders(RequestInterface $request, array $options)
{
$headers = [];
$request_headers = $request->getHeaders();
foreach ($request_headers as $name => $values) {
$header = strtoupper($name);
// cURL does not support 'Expect-Continue', skip all 'EXPECT' headers
if ($heade... | php | protected function createHeaders(RequestInterface $request, array $options)
{
$headers = [];
$request_headers = $request->getHeaders();
foreach ($request_headers as $name => $values) {
$header = strtoupper($name);
// cURL does not support 'Expect-Continue', skip all 'EXPECT' headers
if ($heade... | [
"protected",
"function",
"createHeaders",
"(",
"RequestInterface",
"$",
"request",
",",
"array",
"$",
"options",
")",
"{",
"$",
"headers",
"=",
"[",
"]",
";",
"$",
"request_headers",
"=",
"$",
"request",
"->",
"getHeaders",
"(",
")",
";",
"foreach",
"(",
... | Create array of headers to pass to CURLOPT_HTTPHEADER
@param \Psr\Http\Message\RequestInterface $request Request object
@param array $options cURL options
@return array Array of http header lines | [
"Create",
"array",
"of",
"headers",
"to",
"pass",
"to",
"CURLOPT_HTTPHEADER"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Client.php#L316-L349 |
224,972 | pdeans/http | src/Client.php | Client.createOptions | protected function createOptions(RequestInterface $request, ResponseBuilder $response)
{
$options = $this->options;
// These options default to false and cannot be changed on set up.
// The options should be provided with the request instead.
$options[CURLOPT_FOLLOWLOCATION] = false;
$options[CURLOPT_HEADER... | php | protected function createOptions(RequestInterface $request, ResponseBuilder $response)
{
$options = $this->options;
// These options default to false and cannot be changed on set up.
// The options should be provided with the request instead.
$options[CURLOPT_FOLLOWLOCATION] = false;
$options[CURLOPT_HEADER... | [
"protected",
"function",
"createOptions",
"(",
"RequestInterface",
"$",
"request",
",",
"ResponseBuilder",
"$",
"response",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"options",
";",
"// These options default to false and cannot be changed on set up.",
"// The opti... | Create cURL request options
@param \Psr\Http\Message\RequestInterface $request
@param \pdeans\Http\Builders\ResponseBuilder $response
@return array cURL options
@throws \pdeans\Http\Exceptions\RequestException Invalid request
@throws \InvalidArgumentException Invalid header names and/or values
@throws \RuntimeEx... | [
"Create",
"cURL",
"request",
"options"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Client.php#L366-L413 |
224,973 | pdeans/http | src/Client.php | Client.addRequestBodyOptions | protected function addRequestBodyOptions(RequestInterface $request, array $options)
{
/*
* HTTP methods that cannot have payload:
* - GET => cURL will automatically change method to PUT or POST if we
* set CURLOPT_UPLOAD or CURLOPT_POSTFIELDS.
* - HEAD => cURL treats HEAD as GET request wit... | php | protected function addRequestBodyOptions(RequestInterface $request, array $options)
{
/*
* HTTP methods that cannot have payload:
* - GET => cURL will automatically change method to PUT or POST if we
* set CURLOPT_UPLOAD or CURLOPT_POSTFIELDS.
* - HEAD => cURL treats HEAD as GET request wit... | [
"protected",
"function",
"addRequestBodyOptions",
"(",
"RequestInterface",
"$",
"request",
",",
"array",
"$",
"options",
")",
"{",
"/*\n\t\t * HTTP methods that cannot have payload:\n\t\t * - GET => cURL will automatically change method to PUT or POST if we\n\t\t * set CURLOPT... | Add cURL options related to the request body
@param \Psr\Http\Message\RequestInterface $request Request object
@param array $options cURL options | [
"Add",
"cURL",
"options",
"related",
"to",
"the",
"request",
"body"
] | 6ebd9d9926ed815d85d47c8808ca87b236e49d88 | https://github.com/pdeans/http/blob/6ebd9d9926ed815d85d47c8808ca87b236e49d88/src/Client.php#L421-L471 |
224,974 | theofidry/LoopBackApiBundle | features/bootstrap/FeatureContext.php | FeatureContext.theJsonNodeShouldBeNull | public function theJsonNodeShouldBeNull($node)
{
$actual = $this->getJsonNodeValue($node);
PHPUnit::assertNull($actual, sprintf('The node value is `%s`', json_encode($actual)));
} | php | public function theJsonNodeShouldBeNull($node)
{
$actual = $this->getJsonNodeValue($node);
PHPUnit::assertNull($actual, sprintf('The node value is `%s`', json_encode($actual)));
} | [
"public",
"function",
"theJsonNodeShouldBeNull",
"(",
"$",
"node",
")",
"{",
"$",
"actual",
"=",
"$",
"this",
"->",
"getJsonNodeValue",
"(",
"$",
"node",
")",
";",
"PHPUnit",
"::",
"assertNull",
"(",
"$",
"actual",
",",
"sprintf",
"(",
"'The node value is `%... | Checks that given JSON node is null
@Then the JSON node :node should be null | [
"Checks",
"that",
"given",
"JSON",
"node",
"is",
"null"
] | b66b295088b364e3c4aba5b0feb8d660c4141730 | https://github.com/theofidry/LoopBackApiBundle/blob/b66b295088b364e3c4aba5b0feb8d660c4141730/features/bootstrap/FeatureContext.php#L76-L80 |
224,975 | silverstripe/silverstripe-mathspamprotection | code/MathSpamProtectorField.php | MathSpamProtectorField.Title | public function Title()
{
$prefix = $this->config()->get('question_prefix');
if (!$prefix) {
$prefix = _t('MathSpamProtectionField.SPAMQUESTION', "Spam protection question: %s");
}
return sprintf(
$prefix,
$this->getMathsQuestion()
);
... | php | public function Title()
{
$prefix = $this->config()->get('question_prefix');
if (!$prefix) {
$prefix = _t('MathSpamProtectionField.SPAMQUESTION', "Spam protection question: %s");
}
return sprintf(
$prefix,
$this->getMathsQuestion()
);
... | [
"public",
"function",
"Title",
"(",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"get",
"(",
"'question_prefix'",
")",
";",
"if",
"(",
"!",
"$",
"prefix",
")",
"{",
"$",
"prefix",
"=",
"_t",
"(",
"'MathSpamProtectionFiel... | Returns the spam question
@return string | [
"Returns",
"the",
"spam",
"question"
] | 570eec324c89578f299e2340681b74edb7b3c712 | https://github.com/silverstripe/silverstripe-mathspamprotection/blob/570eec324c89578f299e2340681b74edb7b3c712/code/MathSpamProtectorField.php#L61-L73 |
224,976 | silverstripe/silverstripe-mathspamprotection | code/MathSpamProtectorField.php | MathSpamProtectorField.getMathsQuestion | public function getMathsQuestion()
{
/** @var Session $session */
$session = Controller::curr()->getRequest()->getSession();
if (!$session->get("mathQuestionV1") && !$session->get("mathQuestionV2")) {
$v1 = rand(1, 9);
$v2 = rand(1, 9);
$session->set("ma... | php | public function getMathsQuestion()
{
/** @var Session $session */
$session = Controller::curr()->getRequest()->getSession();
if (!$session->get("mathQuestionV1") && !$session->get("mathQuestionV2")) {
$v1 = rand(1, 9);
$v2 = rand(1, 9);
$session->set("ma... | [
"public",
"function",
"getMathsQuestion",
"(",
")",
"{",
"/** @var Session $session */",
"$",
"session",
"=",
"Controller",
"::",
"curr",
"(",
")",
"->",
"getRequest",
"(",
")",
"->",
"getSession",
"(",
")",
";",
"if",
"(",
"!",
"$",
"session",
"->",
"get"... | Creates the question from random variables, which are also saved to the session.
@return string | [
"Creates",
"the",
"question",
"from",
"random",
"variables",
"which",
"are",
"also",
"saved",
"to",
"the",
"session",
"."
] | 570eec324c89578f299e2340681b74edb7b3c712 | https://github.com/silverstripe/silverstripe-mathspamprotection/blob/570eec324c89578f299e2340681b74edb7b3c712/code/MathSpamProtectorField.php#L110-L131 |
224,977 | silverstripe/silverstripe-mathspamprotection | code/MathSpamProtectorField.php | MathSpamProtectorField.isCorrectAnswer | public function isCorrectAnswer($answer)
{
$session = Controller::curr()->getRequest()->getSession();
$v1 = $session->get("mathQuestionV1");
$v2 = $session->get("mathQuestionV2");
$session->clear('mathQuestionV1');
$session->clear('mathQuestionV2');
$word = MathSp... | php | public function isCorrectAnswer($answer)
{
$session = Controller::curr()->getRequest()->getSession();
$v1 = $session->get("mathQuestionV1");
$v2 = $session->get("mathQuestionV2");
$session->clear('mathQuestionV1');
$session->clear('mathQuestionV2');
$word = MathSp... | [
"public",
"function",
"isCorrectAnswer",
"(",
"$",
"answer",
")",
"{",
"$",
"session",
"=",
"Controller",
"::",
"curr",
"(",
")",
"->",
"getRequest",
"(",
")",
"->",
"getSession",
"(",
")",
";",
"$",
"v1",
"=",
"$",
"session",
"->",
"get",
"(",
"\"ma... | Checks the given answer if it matches the addition of the saved session
variables.
Users can answer using words or digits.
@return bool | [
"Checks",
"the",
"given",
"answer",
"if",
"it",
"matches",
"the",
"addition",
"of",
"the",
"saved",
"session",
"variables",
"."
] | 570eec324c89578f299e2340681b74edb7b3c712 | https://github.com/silverstripe/silverstripe-mathspamprotection/blob/570eec324c89578f299e2340681b74edb7b3c712/code/MathSpamProtectorField.php#L141-L155 |
224,978 | silverstripe/silverstripe-mathspamprotection | code/MathSpamProtectorField.php | MathSpamProtectorField.digit_to_word | public static function digit_to_word($num)
{
$numbers = array(_t('MathSpamProtection.ZERO', 'zero'),
_t('MathSpamProtection.ONE', 'one'),
_t('MathSpamProtection.TWO', 'two'),
_t('MathSpamProtection.THREE', 'three'),
_t('MathSpamProtection.FOUR', 'four'),
... | php | public static function digit_to_word($num)
{
$numbers = array(_t('MathSpamProtection.ZERO', 'zero'),
_t('MathSpamProtection.ONE', 'one'),
_t('MathSpamProtection.TWO', 'two'),
_t('MathSpamProtection.THREE', 'three'),
_t('MathSpamProtection.FOUR', 'four'),
... | [
"public",
"static",
"function",
"digit_to_word",
"(",
"$",
"num",
")",
"{",
"$",
"numbers",
"=",
"array",
"(",
"_t",
"(",
"'MathSpamProtection.ZERO'",
",",
"'zero'",
")",
",",
"_t",
"(",
"'MathSpamProtection.ONE'",
",",
"'one'",
")",
",",
"_t",
"(",
"'Math... | Helper method for converting digits to their equivalent english words
@return string | [
"Helper",
"method",
"for",
"converting",
"digits",
"to",
"their",
"equivalent",
"english",
"words"
] | 570eec324c89578f299e2340681b74edb7b3c712 | https://github.com/silverstripe/silverstripe-mathspamprotection/blob/570eec324c89578f299e2340681b74edb7b3c712/code/MathSpamProtectorField.php#L162-L189 |
224,979 | moeen-basra/laravel-passport-mongodb | src/PassportServiceProvider.php | PassportServiceProvider.registerMigrations | protected function registerMigrations()
{
if (Passport::$runsMigrations) {
return $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}
$this->publishes([
__DIR__.'/../database/migrations' => database_path('migrations'),
], 'passport-migrations');
... | php | protected function registerMigrations()
{
if (Passport::$runsMigrations) {
return $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}
$this->publishes([
__DIR__.'/../database/migrations' => database_path('migrations'),
], 'passport-migrations');
... | [
"protected",
"function",
"registerMigrations",
"(",
")",
"{",
"if",
"(",
"Passport",
"::",
"$",
"runsMigrations",
")",
"{",
"return",
"$",
"this",
"->",
"loadMigrationsFrom",
"(",
"__DIR__",
".",
"'/../database/migrations'",
")",
";",
"}",
"$",
"this",
"->",
... | Register Passport's migration files.
@return void | [
"Register",
"Passport",
"s",
"migration",
"files",
"."
] | 738261912672e39f9f4f4e5bf420b99dbe303ef8 | https://github.com/moeen-basra/laravel-passport-mongodb/blob/738261912672e39f9f4f4e5bf420b99dbe303ef8/src/PassportServiceProvider.php#L62-L71 |
224,980 | moeen-basra/laravel-passport-mongodb | src/PassportServiceProvider.php | PassportServiceProvider.registerResourceServer | protected function registerResourceServer()
{
$this->app->singleton(ResourceServer::class, function () {
return new ResourceServer(
$this->app->make(Bridge\AccessTokenRepository::class),
$this->makeCryptKey('oauth-public.key')
);
});
} | php | protected function registerResourceServer()
{
$this->app->singleton(ResourceServer::class, function () {
return new ResourceServer(
$this->app->make(Bridge\AccessTokenRepository::class),
$this->makeCryptKey('oauth-public.key')
);
});
} | [
"protected",
"function",
"registerResourceServer",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"ResourceServer",
"::",
"class",
",",
"function",
"(",
")",
"{",
"return",
"new",
"ResourceServer",
"(",
"$",
"this",
"->",
"app",
"->",
"ma... | Register the resource server.
@return void | [
"Register",
"the",
"resource",
"server",
"."
] | 738261912672e39f9f4f4e5bf420b99dbe303ef8 | https://github.com/moeen-basra/laravel-passport-mongodb/blob/738261912672e39f9f4f4e5bf420b99dbe303ef8/src/PassportServiceProvider.php#L213-L221 |
224,981 | daylerees/kurenai | src/Parser.php | Parser.parse | public function parse($path)
{
$rawDocument = $this->loadDocument($path);
list($rawMetadata, $rawContent) = $this->splitDocument($rawDocument);
return $this->createDocument($rawDocument, $rawMetadata, $rawContent);
} | php | public function parse($path)
{
$rawDocument = $this->loadDocument($path);
list($rawMetadata, $rawContent) = $this->splitDocument($rawDocument);
return $this->createDocument($rawDocument, $rawMetadata, $rawContent);
} | [
"public",
"function",
"parse",
"(",
"$",
"path",
")",
"{",
"$",
"rawDocument",
"=",
"$",
"this",
"->",
"loadDocument",
"(",
"$",
"path",
")",
";",
"list",
"(",
"$",
"rawMetadata",
",",
"$",
"rawContent",
")",
"=",
"$",
"this",
"->",
"splitDocument",
... | Parse a document from string or file path.
@param string $path
@return void | [
"Parse",
"a",
"document",
"from",
"string",
"or",
"file",
"path",
"."
] | 1f8b42709666ae1d6735a970627a76fa63ed0d27 | https://github.com/daylerees/kurenai/blob/1f8b42709666ae1d6735a970627a76fa63ed0d27/src/Parser.php#L55-L60 |
224,982 | daylerees/kurenai | src/Parser.php | Parser.createDocument | protected function createDocument($raw, $rawMetadata, $rawContent)
{
return new Document(
$raw,
$this->parseMetadata(trim($rawMetadata)),
$this->parseContent(trim($rawContent))
);
} | php | protected function createDocument($raw, $rawMetadata, $rawContent)
{
return new Document(
$raw,
$this->parseMetadata(trim($rawMetadata)),
$this->parseContent(trim($rawContent))
);
} | [
"protected",
"function",
"createDocument",
"(",
"$",
"raw",
",",
"$",
"rawMetadata",
",",
"$",
"rawContent",
")",
"{",
"return",
"new",
"Document",
"(",
"$",
"raw",
",",
"$",
"this",
"->",
"parseMetadata",
"(",
"trim",
"(",
"$",
"rawMetadata",
")",
")",
... | Create a new parsed document instance.
@param string $raw
@param string $rawMetadata
@param string $rawContent
@return \Kurenai\Document | [
"Create",
"a",
"new",
"parsed",
"document",
"instance",
"."
] | 1f8b42709666ae1d6735a970627a76fa63ed0d27 | https://github.com/daylerees/kurenai/blob/1f8b42709666ae1d6735a970627a76fa63ed0d27/src/Parser.php#L99-L106 |
224,983 | kevinem/lime-light-crm-php | src/LimeLightCRM.php | LimeLightCRM.parseResponse | public function parseResponse($response)
{
$array = [];
$exploded = explode('&', $response);
foreach ($exploded as $explode) {
$line = explode('=', $explode);
if (isset($line[1])) {
$array[$line[0]] = urldecode($line[1]);
} else {
... | php | public function parseResponse($response)
{
$array = [];
$exploded = explode('&', $response);
foreach ($exploded as $explode) {
$line = explode('=', $explode);
if (isset($line[1])) {
$array[$line[0]] = urldecode($line[1]);
} else {
... | [
"public",
"function",
"parseResponse",
"(",
"$",
"response",
")",
"{",
"$",
"array",
"=",
"[",
"]",
";",
"$",
"exploded",
"=",
"explode",
"(",
"'&'",
",",
"$",
"response",
")",
";",
"foreach",
"(",
"$",
"exploded",
"as",
"$",
"explode",
")",
"{",
"... | Parse response returned by LimeLightCRM into an array
@param $response
@return array | [
"Parse",
"response",
"returned",
"by",
"LimeLightCRM",
"into",
"an",
"array"
] | 33d542782ebdcee30077b9f8b35247ddf13fb5c8 | https://github.com/kevinem/lime-light-crm-php/blob/33d542782ebdcee30077b9f8b35247ddf13fb5c8/src/LimeLightCRM.php#L134-L151 |
224,984 | ongr-io/TranslationsBundle | Service/Import/ImportManager.php | ImportManager.writeToStorage | public function writeToStorage($domain, $translations)
{
foreach ($translations as $keys) {
foreach ($keys as $key => $transMeta) {
$search = $this->repository->createSearch();
$search->addQuery(new MatchQuery('key', $key));
$results = $this->repos... | php | public function writeToStorage($domain, $translations)
{
foreach ($translations as $keys) {
foreach ($keys as $key => $transMeta) {
$search = $this->repository->createSearch();
$search->addQuery(new MatchQuery('key', $key));
$results = $this->repos... | [
"public",
"function",
"writeToStorage",
"(",
"$",
"domain",
",",
"$",
"translations",
")",
"{",
"foreach",
"(",
"$",
"translations",
"as",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
"=>",
"$",
"transMeta",
")",
"{",
"$",
"s... | Write translations to storage.
@param $translations | [
"Write",
"translations",
"to",
"storage",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/Import/ImportManager.php#L91-L118 |
224,985 | ongr-io/TranslationsBundle | Service/Import/ImportManager.php | ImportManager.importTranslationFiles | public function importTranslationFiles($domain, $dir)
{
$translations = $this->getTranslationsFromFiles($domain, $dir);
$this->writeToStorage($domain, $translations);
} | php | public function importTranslationFiles($domain, $dir)
{
$translations = $this->getTranslationsFromFiles($domain, $dir);
$this->writeToStorage($domain, $translations);
} | [
"public",
"function",
"importTranslationFiles",
"(",
"$",
"domain",
",",
"$",
"dir",
")",
"{",
"$",
"translations",
"=",
"$",
"this",
"->",
"getTranslationsFromFiles",
"(",
"$",
"domain",
",",
"$",
"dir",
")",
";",
"$",
"this",
"->",
"writeToStorage",
"(",... | Imports translation files from a directory.
@param string $dir | [
"Imports",
"translation",
"files",
"from",
"a",
"directory",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Service/Import/ImportManager.php#L139-L143 |
224,986 | hendrikmaus/drafter-php | src/Drafter.php | Drafter.getProcessCommand | private function getProcessCommand()
{
$options = $this->transformOptions();
$options[] = escapeshellarg($this->input);
$command = $this->binary . ' ' . implode(' ', $options);
return $command;
} | php | private function getProcessCommand()
{
$options = $this->transformOptions();
$options[] = escapeshellarg($this->input);
$command = $this->binary . ' ' . implode(' ', $options);
return $command;
} | [
"private",
"function",
"getProcessCommand",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"transformOptions",
"(",
")",
";",
"$",
"options",
"[",
"]",
"=",
"escapeshellarg",
"(",
"$",
"this",
"->",
"input",
")",
";",
"$",
"command",
"=",
"$",
... | Get command to pass it into the process.
The method will append the input file path argument to the end, like
described in the `drafter --help` output.
@return string | [
"Get",
"command",
"to",
"pass",
"it",
"into",
"the",
"process",
"."
] | c6f91b2472c7dfb23ac63a6a69515280ccc227ed | https://github.com/hendrikmaus/drafter-php/blob/c6f91b2472c7dfb23ac63a6a69515280ccc227ed/src/Drafter.php#L247-L255 |
224,987 | hendrikmaus/drafter-php | src/Drafter.php | Drafter.transformOptions | private function transformOptions()
{
$processOptions = [];
foreach ($this->options as $key => $value) {
$option = $key;
if ($value) {
$option .= '=' . escapeshellarg($value);
}
$processOptions[] = $option;
}
return ... | php | private function transformOptions()
{
$processOptions = [];
foreach ($this->options as $key => $value) {
$option = $key;
if ($value) {
$option .= '=' . escapeshellarg($value);
}
$processOptions[] = $option;
}
return ... | [
"private",
"function",
"transformOptions",
"(",
")",
"{",
"$",
"processOptions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"option",
"=",
"$",
"key",
";",
"if",
"(",
"$",
... | Return options prepared to be passed into the Process.
E.g.: ["--output" => "path/to/file"] -> ["--output=path/to/file"]
The original format is an associative array, where the key is the
option name and the value is the respective value.
The process will want those as single strings to escape them
for the command lin... | [
"Return",
"options",
"prepared",
"to",
"be",
"passed",
"into",
"the",
"Process",
"."
] | c6f91b2472c7dfb23ac63a6a69515280ccc227ed | https://github.com/hendrikmaus/drafter-php/blob/c6f91b2472c7dfb23ac63a6a69515280ccc227ed/src/Drafter.php#L270-L285 |
224,988 | moeen-basra/laravel-passport-mongodb | src/Http/Controllers/HandlesOAuthErrors.php | HandlesOAuthErrors.withErrorHandling | protected function withErrorHandling($callback)
{
try {
return $callback();
} catch (OAuthServerException $e) {
$this->exceptionHandler()->report($e);
return $this->convertResponse(
$e->generateHttpResponse(new Psr7Response)
);
... | php | protected function withErrorHandling($callback)
{
try {
return $callback();
} catch (OAuthServerException $e) {
$this->exceptionHandler()->report($e);
return $this->convertResponse(
$e->generateHttpResponse(new Psr7Response)
);
... | [
"protected",
"function",
"withErrorHandling",
"(",
"$",
"callback",
")",
"{",
"try",
"{",
"return",
"$",
"callback",
"(",
")",
";",
"}",
"catch",
"(",
"OAuthServerException",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"exceptionHandler",
"(",
")",
"->",
"rep... | Perform the given callback with exception handling.
@param \Closure $callback
@return \Illuminate\Http\Response | [
"Perform",
"the",
"given",
"callback",
"with",
"exception",
"handling",
"."
] | 738261912672e39f9f4f4e5bf420b99dbe303ef8 | https://github.com/moeen-basra/laravel-passport-mongodb/blob/738261912672e39f9f4f4e5bf420b99dbe303ef8/src/Http/Controllers/HandlesOAuthErrors.php#L24-L43 |
224,989 | unholyknight/active-directory-authenticate | src/Auth/AdldapAuthenticate.php | AdldapAuthenticate._cleanAttributes | protected function _cleanAttributes($attributes)
{
foreach ($attributes as $key => $value) {
if (is_int($key) || in_array($key, $this->_config['ignored'])) {
unset($attributes[$key]);
} else if ($key != 'memberof' && is_array($value) && count($value) == 1) {
... | php | protected function _cleanAttributes($attributes)
{
foreach ($attributes as $key => $value) {
if (is_int($key) || in_array($key, $this->_config['ignored'])) {
unset($attributes[$key]);
} else if ($key != 'memberof' && is_array($value) && count($value) == 1) {
... | [
"protected",
"function",
"_cleanAttributes",
"(",
"$",
"attributes",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"key",
")",
"||",
"in_array",
"(",
"$",
"key",
",",
"$",
... | Clean an array of user attributes
@param array $attributes Array of attributes to clean up against the ignored setting.
@return array An array of attributes stripped of ignored keys. | [
"Clean",
"an",
"array",
"of",
"user",
"attributes"
] | 73c34c5ebfded0e6e9b8148dd9350e8c9c59473e | https://github.com/unholyknight/active-directory-authenticate/blob/73c34c5ebfded0e6e9b8148dd9350e8c9c59473e/src/Auth/AdldapAuthenticate.php#L50-L61 |
224,990 | unholyknight/active-directory-authenticate | src/Auth/AdldapAuthenticate.php | AdldapAuthenticate._cleanGroups | protected function _cleanGroups($memberships)
{
$groups = [];
foreach ($memberships as $group) {
$parts = explode(',', $group);
foreach ($parts as $part) {
if (substr($part, 0, 3) == 'CN=') {
$groups[] = substr($part, 3);
... | php | protected function _cleanGroups($memberships)
{
$groups = [];
foreach ($memberships as $group) {
$parts = explode(',', $group);
foreach ($parts as $part) {
if (substr($part, 0, 3) == 'CN=') {
$groups[] = substr($part, 3);
... | [
"protected",
"function",
"_cleanGroups",
"(",
"$",
"memberships",
")",
"{",
"$",
"groups",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"memberships",
"as",
"$",
"group",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"','",
",",
"$",
"group",
")",
";",
... | Create a friendly, formatted groups array
@param array $memberships Array of memberships to create a friendly array for.
@return array An array of friendly group names. | [
"Create",
"a",
"friendly",
"formatted",
"groups",
"array"
] | 73c34c5ebfded0e6e9b8148dd9350e8c9c59473e | https://github.com/unholyknight/active-directory-authenticate/blob/73c34c5ebfded0e6e9b8148dd9350e8c9c59473e/src/Auth/AdldapAuthenticate.php#L69-L84 |
224,991 | unholyknight/active-directory-authenticate | src/Auth/AdldapAuthenticate.php | AdldapAuthenticate.findAdUser | public function findAdUser($username, $password)
{
try {
$this->ad->connect('default');
if ($this->provider->auth()->attempt($username, $password, true)) {
$search = $this->provider->search();
if (is_array($this->_config['select'])) {
... | php | public function findAdUser($username, $password)
{
try {
$this->ad->connect('default');
if ($this->provider->auth()->attempt($username, $password, true)) {
$search = $this->provider->search();
if (is_array($this->_config['select'])) {
... | [
"public",
"function",
"findAdUser",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"ad",
"->",
"connect",
"(",
"'default'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"provider",
"->",
"auth",
"(",
")",
"->",
"att... | Connect to Active Directory on behalf of a user and return that user's data.
@param string $username The username (samaccountname).
@param string $password The password.
@return mixed False on failure. An array of user data on success. | [
"Connect",
"to",
"Active",
"Directory",
"on",
"behalf",
"of",
"a",
"user",
"and",
"return",
"that",
"user",
"s",
"data",
"."
] | 73c34c5ebfded0e6e9b8148dd9350e8c9c59473e | https://github.com/unholyknight/active-directory-authenticate/blob/73c34c5ebfded0e6e9b8148dd9350e8c9c59473e/src/Auth/AdldapAuthenticate.php#L109-L141 |
224,992 | bem/bh-php | src/JsonCollection.php | JsonCollection.normalize | public static function normalize($bemJson)
{
switch (true) {
// instance of JsonCollection
case $bemJson instanceof self:
return $bemJson;
// casual list
case isList($bemJson);
$bemJson = static::flattenList($bemJson);
... | php | public static function normalize($bemJson)
{
switch (true) {
// instance of JsonCollection
case $bemJson instanceof self:
return $bemJson;
// casual list
case isList($bemJson);
$bemJson = static::flattenList($bemJson);
... | [
"public",
"static",
"function",
"normalize",
"(",
"$",
"bemJson",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"// instance of JsonCollection",
"case",
"$",
"bemJson",
"instanceof",
"self",
":",
"return",
"$",
"bemJson",
";",
"// casual list",
"case",
"isList",
... | Normalize bemJson node or list or tree
@param array|object $bemJson
@return JsonCollection | [
"Normalize",
"bemJson",
"node",
"or",
"list",
"or",
"tree"
] | 2f46ccb3f32cba1836ed70d28ee0d02b0e7684e2 | https://github.com/bem/bh-php/blob/2f46ccb3f32cba1836ed70d28ee0d02b0e7684e2/src/JsonCollection.php#L48-L92 |
224,993 | bem/bh-php | src/JsonCollection.php | JsonCollection.flattenList | public static function flattenList($a)
{
if (!isList($a)) {
return $a;
}
do {
$flatten = false;
for ($i = 0, $l = sizeof($a); $i < $l; $i++) {
if (isList($a[$i])) {
$flatten = true;
break;
... | php | public static function flattenList($a)
{
if (!isList($a)) {
return $a;
}
do {
$flatten = false;
for ($i = 0, $l = sizeof($a); $i < $l; $i++) {
if (isList($a[$i])) {
$flatten = true;
break;
... | [
"public",
"static",
"function",
"flattenList",
"(",
"$",
"a",
")",
"{",
"if",
"(",
"!",
"isList",
"(",
"$",
"a",
")",
")",
"{",
"return",
"$",
"a",
";",
"}",
"do",
"{",
"$",
"flatten",
"=",
"false",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
... | Brings items of inner simple arrays to root level if exists
@param array $a
@return array | [
"Brings",
"items",
"of",
"inner",
"simple",
"arrays",
"to",
"root",
"level",
"if",
"exists"
] | 2f46ccb3f32cba1836ed70d28ee0d02b0e7684e2 | https://github.com/bem/bh-php/blob/2f46ccb3f32cba1836ed70d28ee0d02b0e7684e2/src/JsonCollection.php#L120-L152 |
224,994 | auraphp/Aura.Uri | src/Aura/Uri/PublicSuffixList.php | PublicSuffixList.getPublicSuffix | public function getPublicSuffix($host)
{
if (strpos($host, '.') === 0) {
return null;
}
if (strpos($host, '.') === false) {
return null;
}
$host = strtolower($host);
$parts = array_reverse(explode('.', $host));
$publicSuffix = array()... | php | public function getPublicSuffix($host)
{
if (strpos($host, '.') === 0) {
return null;
}
if (strpos($host, '.') === false) {
return null;
}
$host = strtolower($host);
$parts = array_reverse(explode('.', $host));
$publicSuffix = array()... | [
"public",
"function",
"getPublicSuffix",
"(",
"$",
"host",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"host",
",",
"'.'",
")",
"===",
"0",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"strpos",
"(",
"$",
"host",
",",
"'.'",
")",
"===",
"false",... | Returns the public suffix portion of provided host
@param string $host host
@return string public suffix | [
"Returns",
"the",
"public",
"suffix",
"portion",
"of",
"provided",
"host"
] | e3b4ae381daaa8737f0a23ba9c7e2c9f52219a3a | https://github.com/auraphp/Aura.Uri/blob/e3b4ae381daaa8737f0a23ba9c7e2c9f52219a3a/src/Aura/Uri/PublicSuffixList.php#L49-L93 |
224,995 | auraphp/Aura.Uri | src/Aura/Uri/PublicSuffixList.php | PublicSuffixList.getRegisterableDomain | public function getRegisterableDomain($host)
{
if (strpos($host, '.') === false) {
return null;
}
$host = strtolower($host);
$publicSuffix = $this->getPublicSuffix($host);
if ($publicSuffix === null || $host == $publicSuffix) {
return null;
}... | php | public function getRegisterableDomain($host)
{
if (strpos($host, '.') === false) {
return null;
}
$host = strtolower($host);
$publicSuffix = $this->getPublicSuffix($host);
if ($publicSuffix === null || $host == $publicSuffix) {
return null;
}... | [
"public",
"function",
"getRegisterableDomain",
"(",
"$",
"host",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"host",
",",
"'.'",
")",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"$",
"host",
"=",
"strtolower",
"(",
"$",
"host",
")",
";",
"$"... | Returns registerable domain portion of provided host
Per the test cases provided by Mozilla
(http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1),
this method should return null if the domain provided is a public suffix.
@param string $host host
@return string registerable domain | [
"Returns",
"registerable",
"domain",
"portion",
"of",
"provided",
"host"
] | e3b4ae381daaa8737f0a23ba9c7e2c9f52219a3a | https://github.com/auraphp/Aura.Uri/blob/e3b4ae381daaa8737f0a23ba9c7e2c9f52219a3a/src/Aura/Uri/PublicSuffixList.php#L105-L123 |
224,996 | auraphp/Aura.Uri | src/Aura/Uri/PublicSuffixList.php | PublicSuffixList.getSubdomain | public function getSubdomain($host)
{
$host = strtolower($host);
$registerableDomain = $this->getRegisterableDomain($host);
if ($registerableDomain === null || $host == $registerableDomain) {
return null;
}
$registerableDomainParts = array_reverse(explode('.', $... | php | public function getSubdomain($host)
{
$host = strtolower($host);
$registerableDomain = $this->getRegisterableDomain($host);
if ($registerableDomain === null || $host == $registerableDomain) {
return null;
}
$registerableDomainParts = array_reverse(explode('.', $... | [
"public",
"function",
"getSubdomain",
"(",
"$",
"host",
")",
"{",
"$",
"host",
"=",
"strtolower",
"(",
"$",
"host",
")",
";",
"$",
"registerableDomain",
"=",
"$",
"this",
"->",
"getRegisterableDomain",
"(",
"$",
"host",
")",
";",
"if",
"(",
"$",
"regis... | Returns the subdomain portion of provided host
@param string $host host
@return string subdomain | [
"Returns",
"the",
"subdomain",
"portion",
"of",
"provided",
"host"
] | e3b4ae381daaa8737f0a23ba9c7e2c9f52219a3a | https://github.com/auraphp/Aura.Uri/blob/e3b4ae381daaa8737f0a23ba9c7e2c9f52219a3a/src/Aura/Uri/PublicSuffixList.php#L131-L145 |
224,997 | ongr-io/TranslationsBundle | Controller/ApiController.php | ApiController.updateAction | public function updateAction(Request $request, $id)
{
$response = ['error' => false];
try {
$this->get('ongr_translations.translation_manager')->edit($id, $request);
} catch (\LogicException $e) {
$response = ['error' => true];
}
return new JsonRespo... | php | public function updateAction(Request $request, $id)
{
$response = ['error' => false];
try {
$this->get('ongr_translations.translation_manager')->edit($id, $request);
} catch (\LogicException $e) {
$response = ['error' => true];
}
return new JsonRespo... | [
"public",
"function",
"updateAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"response",
"=",
"[",
"'error'",
"=>",
"false",
"]",
";",
"try",
"{",
"$",
"this",
"->",
"get",
"(",
"'ongr_translations.translation_manager'",
")",
"->",
... | Action for editing translation objects.
@param Request $request Http request object.
@param string $id
@return JsonResponse | [
"Action",
"for",
"editing",
"translation",
"objects",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Controller/ApiController.php#L33-L44 |
224,998 | ongr-io/TranslationsBundle | Controller/ApiController.php | ApiController.exportAction | public function exportAction()
{
$cwd = getcwd();
if (substr($cwd, -3) === 'web') {
chdir($cwd . DIRECTORY_SEPARATOR . '..');
}
$output = ['error' => false];
if ($this->get('ongr_translations.command.export')->run(new ArrayInput([]), new NullOutput()) != 0) {
... | php | public function exportAction()
{
$cwd = getcwd();
if (substr($cwd, -3) === 'web') {
chdir($cwd . DIRECTORY_SEPARATOR . '..');
}
$output = ['error' => false];
if ($this->get('ongr_translations.command.export')->run(new ArrayInput([]), new NullOutput()) != 0) {
... | [
"public",
"function",
"exportAction",
"(",
")",
"{",
"$",
"cwd",
"=",
"getcwd",
"(",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"cwd",
",",
"-",
"3",
")",
"===",
"'web'",
")",
"{",
"chdir",
"(",
"$",
"cwd",
".",
"DIRECTORY_SEPARATOR",
".",
"'..'",
... | Action for executing export command.
@return JsonResponse | [
"Action",
"for",
"executing",
"export",
"command",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Controller/ApiController.php#L73-L87 |
224,999 | ongr-io/TranslationsBundle | Controller/ApiController.php | ApiController.historyAction | public function historyAction(Request $request, $id)
{
$document = $this->get('ongr_translations.translation_manager')->get($id);
if (empty($document)) {
return new JsonResponse(['error' => true, 'message' => 'translation not found']);
}
return new JsonResponse($this->g... | php | public function historyAction(Request $request, $id)
{
$document = $this->get('ongr_translations.translation_manager')->get($id);
if (empty($document)) {
return new JsonResponse(['error' => true, 'message' => 'translation not found']);
}
return new JsonResponse($this->g... | [
"public",
"function",
"historyAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"document",
"=",
"$",
"this",
"->",
"get",
"(",
"'ongr_translations.translation_manager'",
")",
"->",
"get",
"(",
"$",
"id",
")",
";",
"if",
"(",
"empty... | Action for executing history command.
@param Request $request Http request object.
@param string $id
@return JsonResponse | [
"Action",
"for",
"executing",
"history",
"command",
"."
] | a441d7641144eddf3d75d930270d87428b791c0a | https://github.com/ongr-io/TranslationsBundle/blob/a441d7641144eddf3d75d930270d87428b791c0a/Controller/ApiController.php#L97-L106 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.