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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
231,400 | fuzz-productions/magic-box | src/Filter.php | Filter.notEquals | protected static function notEquals($column, $filter, $query, $or = false)
{
$method = self::determineMethod('where', $or);
$query->$method($column, '!=', $filter);
} | php | protected static function notEquals($column, $filter, $query, $or = false)
{
$method = self::determineMethod('where', $or);
$query->$method($column, '!=', $filter);
} | [
"protected",
"static",
"function",
"notEquals",
"(",
"$",
"column",
",",
"$",
"filter",
",",
"$",
"query",
",",
"$",
"or",
"=",
"false",
")",
"{",
"$",
"method",
"=",
"self",
"::",
"determineMethod",
"(",
"'where'",
",",
"$",
"or",
")",
";",
"$",
"... | Query for items with a value not equal to a filter.
Ex: users?filters[username]=!=common%20username
@param string $column
@param string $filter
@param \Illuminate\Database\Eloquent\Builder $query
@param bool $or | [
"Query",
"for",
"items",
"with",
"a",
"value",
"not",
"equal",
"to",
"a",
"filter",
"."
] | 996f8a5cf99177216cbab4a82a8ca79b87d05dfe | https://github.com/fuzz-productions/magic-box/blob/996f8a5cf99177216cbab4a82a8ca79b87d05dfe/src/Filter.php#L403-L407 |
231,401 | fuzz-productions/magic-box | src/Filter.php | Filter.nullMethod | protected static function nullMethod($column, $filter, $query, $or = false)
{
if ($filter === 'NULL') {
$method = self::determineMethod('whereNull', $or);
$query->$method($column);
} else {
$method = self::determineMethod('whereNotNull', $or);
$query->$method($column);
}
} | php | protected static function nullMethod($column, $filter, $query, $or = false)
{
if ($filter === 'NULL') {
$method = self::determineMethod('whereNull', $or);
$query->$method($column);
} else {
$method = self::determineMethod('whereNotNull', $or);
$query->$method($column);
}
} | [
"protected",
"static",
"function",
"nullMethod",
"(",
"$",
"column",
",",
"$",
"filter",
",",
"$",
"query",
",",
"$",
"or",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"filter",
"===",
"'NULL'",
")",
"{",
"$",
"method",
"=",
"self",
"::",
"determineMetho... | Query for items that are either null or not null.
Ex: users?filters[email]=NOT_NULL
Ex: users?filters[address]=NULL
@param string $column
@param string $filter
@param \Illuminate\Database\Eloquent\Builder $query
@param bool ... | [
"Query",
"for",
"items",
"that",
"are",
"either",
"null",
"or",
"not",
"null",
"."
] | 996f8a5cf99177216cbab4a82a8ca79b87d05dfe | https://github.com/fuzz-productions/magic-box/blob/996f8a5cf99177216cbab4a82a8ca79b87d05dfe/src/Filter.php#L420-L429 |
231,402 | fuzz-productions/magic-box | src/Filter.php | Filter.in | protected static function in($column, $filter, $query, $or = false)
{
$method = self::determineMethod('whereIn', $or);
$query->$method($column, $filter);
} | php | protected static function in($column, $filter, $query, $or = false)
{
$method = self::determineMethod('whereIn', $or);
$query->$method($column, $filter);
} | [
"protected",
"static",
"function",
"in",
"(",
"$",
"column",
",",
"$",
"filter",
",",
"$",
"query",
",",
"$",
"or",
"=",
"false",
")",
"{",
"$",
"method",
"=",
"self",
"::",
"determineMethod",
"(",
"'whereIn'",
",",
"$",
"or",
")",
";",
"$",
"query... | Query for items that are in a list.
Ex: users?filters[id]=[1,5,10]
@param string $column
@param string|array $filter
@param \Illuminate\Database\Eloquent\Builder $query
@param bool $or | [
"Query",
"for",
"items",
"that",
"are",
"in",
"a",
"list",
"."
] | 996f8a5cf99177216cbab4a82a8ca79b87d05dfe | https://github.com/fuzz-productions/magic-box/blob/996f8a5cf99177216cbab4a82a8ca79b87d05dfe/src/Filter.php#L441-L445 |
231,403 | fuzz-productions/magic-box | src/Filter.php | Filter.notIn | protected static function notIn($column, $filter, $query, $or = false)
{
$method = self::determineMethod('whereNotIn', $or);
$query->$method($column, $filter);
} | php | protected static function notIn($column, $filter, $query, $or = false)
{
$method = self::determineMethod('whereNotIn', $or);
$query->$method($column, $filter);
} | [
"protected",
"static",
"function",
"notIn",
"(",
"$",
"column",
",",
"$",
"filter",
",",
"$",
"query",
",",
"$",
"or",
"=",
"false",
")",
"{",
"$",
"method",
"=",
"self",
"::",
"determineMethod",
"(",
"'whereNotIn'",
",",
"$",
"or",
")",
";",
"$",
... | Query for items that are not in a list.
Ex: users?filters[id]=![1,5,10]
@param string $column
@param string|array $filter
@param \Illuminate\Database\Eloquent\Builder $query
@param bool $or | [
"Query",
"for",
"items",
"that",
"are",
"not",
"in",
"a",
"list",
"."
] | 996f8a5cf99177216cbab4a82a8ca79b87d05dfe | https://github.com/fuzz-productions/magic-box/blob/996f8a5cf99177216cbab4a82a8ca79b87d05dfe/src/Filter.php#L457-L461 |
231,404 | fuzz-productions/magic-box | src/Filter.php | Filter.cleanAndValidateFilter | private static function cleanAndValidateFilter($token, $filter)
{
$filter_should_be_scalar = self::shouldBeScalar($token);
// Format the filter, cutting off the trailing ']' if appropriate
$filter = $filter_should_be_scalar ? explode(',', substr($filter, strlen($token))) :
explode(',', substr($filter, strlen... | php | private static function cleanAndValidateFilter($token, $filter)
{
$filter_should_be_scalar = self::shouldBeScalar($token);
// Format the filter, cutting off the trailing ']' if appropriate
$filter = $filter_should_be_scalar ? explode(',', substr($filter, strlen($token))) :
explode(',', substr($filter, strlen... | [
"private",
"static",
"function",
"cleanAndValidateFilter",
"(",
"$",
"token",
",",
"$",
"filter",
")",
"{",
"$",
"filter_should_be_scalar",
"=",
"self",
"::",
"shouldBeScalar",
"(",
"$",
"token",
")",
";",
"// Format the filter, cutting off the trailing ']' if appropria... | Parse a filter string and confirm that it has a scalar value if it should.
@param string $token
@param string $filter
@return array|bool | [
"Parse",
"a",
"filter",
"string",
"and",
"confirm",
"that",
"it",
"has",
"a",
"scalar",
"value",
"if",
"it",
"should",
"."
] | 996f8a5cf99177216cbab4a82a8ca79b87d05dfe | https://github.com/fuzz-productions/magic-box/blob/996f8a5cf99177216cbab4a82a8ca79b87d05dfe/src/Filter.php#L505-L523 |
231,405 | fuzz-productions/magic-box | src/Middleware/RepositoryMiddleware.php | RepositoryMiddleware.buildRepository | public function buildRepository(Request $request): EloquentRepository
{
$input = [];
/** @var \Illuminate\Routing\Route $route */
$route = $request->route();
// Resolve the model class if possible. And setup the repository.
/** @var \Illuminate\Database\Eloquent\Model $model_class */
$model_class = resol... | php | public function buildRepository(Request $request): EloquentRepository
{
$input = [];
/** @var \Illuminate\Routing\Route $route */
$route = $request->route();
// Resolve the model class if possible. And setup the repository.
/** @var \Illuminate\Database\Eloquent\Model $model_class */
$model_class = resol... | [
"public",
"function",
"buildRepository",
"(",
"Request",
"$",
"request",
")",
":",
"EloquentRepository",
"{",
"$",
"input",
"=",
"[",
"]",
";",
"/** @var \\Illuminate\\Routing\\Route $route */",
"$",
"route",
"=",
"$",
"request",
"->",
"route",
"(",
")",
";",
... | Build a repository based on inbound request data.
@param \Illuminate\Http\Request $request
@return \Fuzz\MagicBox\EloquentRepository | [
"Build",
"a",
"repository",
"based",
"on",
"inbound",
"request",
"data",
"."
] | 996f8a5cf99177216cbab4a82a8ca79b87d05dfe | https://github.com/fuzz-productions/magic-box/blob/996f8a5cf99177216cbab4a82a8ca79b87d05dfe/src/Middleware/RepositoryMiddleware.php#L32-L68 |
231,406 | niklongstone/regex-reverse | src/RegRev/Metacharacter/CharacterHandler.php | CharacterHandler.setSuccessor | final public function setSuccessor(CharacterHandler $handler)
{
$this->successor = $handler;
$this->successor->setPrevious($this);
} | php | final public function setSuccessor(CharacterHandler $handler)
{
$this->successor = $handler;
$this->successor->setPrevious($this);
} | [
"final",
"public",
"function",
"setSuccessor",
"(",
"CharacterHandler",
"$",
"handler",
")",
"{",
"$",
"this",
"->",
"successor",
"=",
"$",
"handler",
";",
"$",
"this",
"->",
"successor",
"->",
"setPrevious",
"(",
"$",
"this",
")",
";",
"}"
] | Sets chain successor.
@param CharacterHandler $handler | [
"Sets",
"chain",
"successor",
"."
] | a93bb266fbc0621094a5d1ad2583b8a54999ea25 | https://github.com/niklongstone/regex-reverse/blob/a93bb266fbc0621094a5d1ad2583b8a54999ea25/src/RegRev/Metacharacter/CharacterHandler.php#L116-L120 |
231,407 | niklongstone/regex-reverse | src/RegRev/Metacharacter/CharacterHandler.php | CharacterHandler.getResult | final public function getResult($result = '')
{
$result.= $this->generate();
if ($this->successor !== null) {
return $this->successor->getResult($result);
}
return $result;
} | php | final public function getResult($result = '')
{
$result.= $this->generate();
if ($this->successor !== null) {
return $this->successor->getResult($result);
}
return $result;
} | [
"final",
"public",
"function",
"getResult",
"(",
"$",
"result",
"=",
"''",
")",
"{",
"$",
"result",
".=",
"$",
"this",
"->",
"generate",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"successor",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",... | Gets the result.
@param string $result
@return string | [
"Gets",
"the",
"result",
"."
] | a93bb266fbc0621094a5d1ad2583b8a54999ea25 | https://github.com/niklongstone/regex-reverse/blob/a93bb266fbc0621094a5d1ad2583b8a54999ea25/src/RegRev/Metacharacter/CharacterHandler.php#L149-L157 |
231,408 | PaymentSuite/paymentsuite | src/PaymentSuite/RedsysBundle/Services/RedsysManager.php | RedsysManager.processPayment | public function processPayment()
{
$redsysMethod = $this
->redsysMethodFactory
->create();
/**
* At this point, order must be created given a cart, and placed in PaymentBridge.
*
* So, $this->paymentBridge->getOrder() must return an object
... | php | public function processPayment()
{
$redsysMethod = $this
->redsysMethodFactory
->create();
/**
* At this point, order must be created given a cart, and placed in PaymentBridge.
*
* So, $this->paymentBridge->getOrder() must return an object
... | [
"public",
"function",
"processPayment",
"(",
")",
"{",
"$",
"redsysMethod",
"=",
"$",
"this",
"->",
"redsysMethodFactory",
"->",
"create",
"(",
")",
";",
"/**\n * At this point, order must be created given a cart, and placed in PaymentBridge.\n *\n * So, $... | Creates form view for Redsys payment.
@return \Symfony\Component\Form\FormView
@throws PaymentOrderNotFoundException | [
"Creates",
"form",
"view",
"for",
"Redsys",
"payment",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/RedsysBundle/Services/RedsysManager.php#L96-L134 |
231,409 | PaymentSuite/paymentsuite | src/PaymentSuite/RedsysBundle/Services/RedsysManager.php | RedsysManager.processResult | public function processResult(array $parameters)
{
$this->checkResultParameters($parameters);
$redsysMethod = new RedsysMethod();
$dsSignature = $parameters['Ds_Signature'];
$dsResponse = $parameters['Ds_Response'];
$dsAmount = $parameters['Ds_Amount'];
$dsOrder = $... | php | public function processResult(array $parameters)
{
$this->checkResultParameters($parameters);
$redsysMethod = new RedsysMethod();
$dsSignature = $parameters['Ds_Signature'];
$dsResponse = $parameters['Ds_Response'];
$dsAmount = $parameters['Ds_Amount'];
$dsOrder = $... | [
"public",
"function",
"processResult",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"this",
"->",
"checkResultParameters",
"(",
"$",
"parameters",
")",
";",
"$",
"redsysMethod",
"=",
"new",
"RedsysMethod",
"(",
")",
";",
"$",
"dsSignature",
"=",
"$",
"p... | Processes the POST request sent by Redsys.
@param array $parameters Array with response parameters
@return RedsysManager Self object
@throws InvalidSignatureException Invalid signature
@throws ParameterNotReceivedException Invalid parameters
@throws PaymentException Payment exception | [
"Processes",
"the",
"POST",
"request",
"sent",
"by",
"Redsys",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/RedsysBundle/Services/RedsysManager.php#L147-L245 |
231,410 | PaymentSuite/paymentsuite | src/PaymentSuite/RedsysBundle/Services/RedsysManager.php | RedsysManager.expectedSignature | private function expectedSignature(
$amount,
$order,
$merchantCode,
$currency,
$response,
$secret
) {
return strtoupper(sha1(implode('', [
$amount,
$order,
$merchantCode,
$currency,
$response,
... | php | private function expectedSignature(
$amount,
$order,
$merchantCode,
$currency,
$response,
$secret
) {
return strtoupper(sha1(implode('', [
$amount,
$order,
$merchantCode,
$currency,
$response,
... | [
"private",
"function",
"expectedSignature",
"(",
"$",
"amount",
",",
"$",
"order",
",",
"$",
"merchantCode",
",",
"$",
"currency",
",",
"$",
"response",
",",
"$",
"secret",
")",
"{",
"return",
"strtoupper",
"(",
"sha1",
"(",
"implode",
"(",
"''",
",",
... | Returns the expected signature.
@param string $amount Amount
@param string $order Order
@param string $merchantCode Merchant Code
@param string $currency Currency
@param string $response Response code
@param string $secret Secret
@return string Signature | [
"Returns",
"the",
"expected",
"signature",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/RedsysBundle/Services/RedsysManager.php#L276-L292 |
231,411 | machour/yii2-swagger-api | ApiGenerator.php | ApiGenerator.parseModels | private function parseModels($definitions)
{
$ret = [];
foreach ($definitions as $definition)
{
$ret[$definition] = $this->parseModel($definition);
}
return $ret;
} | php | private function parseModels($definitions)
{
$ret = [];
foreach ($definitions as $definition)
{
$ret[$definition] = $this->parseModel($definition);
}
return $ret;
} | [
"private",
"function",
"parseModels",
"(",
"$",
"definitions",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"definitions",
"as",
"$",
"definition",
")",
"{",
"$",
"ret",
"[",
"$",
"definition",
"]",
"=",
"$",
"this",
"->",
"parseMod... | Returns the models definition
@param array $definitions
@return array
@throws Exception | [
"Returns",
"the",
"models",
"definition"
] | 577d9877f196a0a94b06d5623a0ea66cf329409b | https://github.com/machour/yii2-swagger-api/blob/577d9877f196a0a94b06d5623a0ea66cf329409b/ApiGenerator.php#L399-L407 |
231,412 | machour/yii2-swagger-api | ApiGenerator.php | ApiGenerator.parseModel | private function parseModel($definition, $xml = true) {
$model = strpos($definition, '\\') === false ?
$this->modelsNamespace . '\\' . $definition :
$definition;
if (!is_subclass_of($model, ApiModel::class)) {
throw new Exception("The model definition for $model was ... | php | private function parseModel($definition, $xml = true) {
$model = strpos($definition, '\\') === false ?
$this->modelsNamespace . '\\' . $definition :
$definition;
if (!is_subclass_of($model, ApiModel::class)) {
throw new Exception("The model definition for $model was ... | [
"private",
"function",
"parseModel",
"(",
"$",
"definition",
",",
"$",
"xml",
"=",
"true",
")",
"{",
"$",
"model",
"=",
"strpos",
"(",
"$",
"definition",
",",
"'\\\\'",
")",
"===",
"false",
"?",
"$",
"this",
"->",
"modelsNamespace",
".",
"'\\\\'",
".",... | Returns a model definition
@param $definition
@param bool $xml
@return array
@throws Exception | [
"Returns",
"a",
"model",
"definition"
] | 577d9877f196a0a94b06d5623a0ea66cf329409b | https://github.com/machour/yii2-swagger-api/blob/577d9877f196a0a94b06d5623a0ea66cf329409b/ApiGenerator.php#L417-L449 |
231,413 | machour/yii2-swagger-api | ApiGenerator.php | ApiGenerator.parseProperties | private function parseProperties($class)
{
$ret = [];
$defaults = $class->getDefaultProperties();
foreach ($class->getProperties() as $property) {
$tags = self::parseDocCommentTags($property->getDocComment());
list($type, $description) = $this->tokenize($tags[self::... | php | private function parseProperties($class)
{
$ret = [];
$defaults = $class->getDefaultProperties();
foreach ($class->getProperties() as $property) {
$tags = self::parseDocCommentTags($property->getDocComment());
list($type, $description) = $this->tokenize($tags[self::... | [
"private",
"function",
"parseProperties",
"(",
"$",
"class",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"$",
"defaults",
"=",
"$",
"class",
"->",
"getDefaultProperties",
"(",
")",
";",
"foreach",
"(",
"$",
"class",
"->",
"getProperties",
"(",
")",
"as",... | Returns the class properties
Used for models
@param ReflectionClass $class
@return array | [
"Returns",
"the",
"class",
"properties"
] | 577d9877f196a0a94b06d5623a0ea66cf329409b | https://github.com/machour/yii2-swagger-api/blob/577d9877f196a0a94b06d5623a0ea66cf329409b/ApiGenerator.php#L459-L512 |
231,414 | machour/yii2-swagger-api | ApiGenerator.php | ApiGenerator.parseMethods | public function parseMethods($class, $produces)
{
$ret = [];
foreach ($class->getMethods() as $method) {
$def = $this->parseMethod($method, $produces);
if ($def) {
$methodDoc = $this->fetchDocComment($method);
$tags = self::parseDocCommentTag... | php | public function parseMethods($class, $produces)
{
$ret = [];
foreach ($class->getMethods() as $method) {
$def = $this->parseMethod($method, $produces);
if ($def) {
$methodDoc = $this->fetchDocComment($method);
$tags = self::parseDocCommentTag... | [
"public",
"function",
"parseMethods",
"(",
"$",
"class",
",",
"$",
"produces",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"class",
"->",
"getMethods",
"(",
")",
"as",
"$",
"method",
")",
"{",
"$",
"def",
"=",
"$",
"this",
"->"... | Returns the methods definition
@param ReflectionClass $class
@param array $produces The class level @produces tags
@return array
@throws Exception | [
"Returns",
"the",
"methods",
"definition"
] | 577d9877f196a0a94b06d5623a0ea66cf329409b | https://github.com/machour/yii2-swagger-api/blob/577d9877f196a0a94b06d5623a0ea66cf329409b/ApiGenerator.php#L522-L544 |
231,415 | machour/yii2-swagger-api | ApiGenerator.php | ApiGenerator.haveParameter | private function haveParameter($method, $parameter)
{
foreach ($method->getParameters() as $param) {
if ($param->name == $parameter) {
return true;
}
}
return false;
} | php | private function haveParameter($method, $parameter)
{
foreach ($method->getParameters() as $param) {
if ($param->name == $parameter) {
return true;
}
}
return false;
} | [
"private",
"function",
"haveParameter",
"(",
"$",
"method",
",",
"$",
"parameter",
")",
"{",
"foreach",
"(",
"$",
"method",
"->",
"getParameters",
"(",
")",
"as",
"$",
"param",
")",
"{",
"if",
"(",
"$",
"param",
"->",
"name",
"==",
"$",
"parameter",
... | Tells if the given method have the given parameter in its signature
@param ReflectionMethod $method The method to inspect
@param string $parameter The parameter name
@return bool Returns TRUE if the parameter is present in the signature, FALSE otherwise | [
"Tells",
"if",
"the",
"given",
"method",
"have",
"the",
"given",
"parameter",
"in",
"its",
"signature"
] | 577d9877f196a0a94b06d5623a0ea66cf329409b | https://github.com/machour/yii2-swagger-api/blob/577d9877f196a0a94b06d5623a0ea66cf329409b/ApiGenerator.php#L698-L706 |
231,416 | machour/yii2-swagger-api | ApiGenerator.php | ApiGenerator.tokenize | private function tokenize($input, $limit = -1)
{
$chunks = preg_split('!\s+!', $input, $limit);
if ($limit !== -1 && count($chunks) != $limit) {
$chunks += array_fill(count($chunks), $limit, '');
}
return $chunks;
} | php | private function tokenize($input, $limit = -1)
{
$chunks = preg_split('!\s+!', $input, $limit);
if ($limit !== -1 && count($chunks) != $limit) {
$chunks += array_fill(count($chunks), $limit, '');
}
return $chunks;
} | [
"private",
"function",
"tokenize",
"(",
"$",
"input",
",",
"$",
"limit",
"=",
"-",
"1",
")",
"{",
"$",
"chunks",
"=",
"preg_split",
"(",
"'!\\s+!'",
",",
"$",
"input",
",",
"$",
"limit",
")",
";",
"if",
"(",
"$",
"limit",
"!==",
"-",
"1",
"&&",
... | Tokenize an input string
@param string $input The string to be tokenized
@param int $limit The number of tokens to generate
@return array | [
"Tokenize",
"an",
"input",
"string"
] | 577d9877f196a0a94b06d5623a0ea66cf329409b | https://github.com/machour/yii2-swagger-api/blob/577d9877f196a0a94b06d5623a0ea66cf329409b/ApiGenerator.php#L871-L878 |
231,417 | machour/yii2-swagger-api | ApiGenerator.php | ApiGenerator.parseDocCommentDetail | public static function parseDocCommentDetail($block)
{
$comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($block, '/'))), "\r", '');
if (preg_match('/^\s*@\w+/m', $comment, $matches, PREG_OFFSET_CAPTURE)) {
$comment = trim(substr($comment, 0, $matches[0][1]));
}
... | php | public static function parseDocCommentDetail($block)
{
$comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($block, '/'))), "\r", '');
if (preg_match('/^\s*@\w+/m', $comment, $matches, PREG_OFFSET_CAPTURE)) {
$comment = trim(substr($comment, 0, $matches[0][1]));
}
... | [
"public",
"static",
"function",
"parseDocCommentDetail",
"(",
"$",
"block",
")",
"{",
"$",
"comment",
"=",
"strtr",
"(",
"trim",
"(",
"preg_replace",
"(",
"'/^\\s*\\**( |\\t)?/m'",
",",
"''",
",",
"trim",
"(",
"$",
"block",
",",
"'/'",
")",
")",
")",
","... | Returns full description from the doc block.
@param string $block
@return string | [
"Returns",
"full",
"description",
"from",
"the",
"doc",
"block",
"."
] | 577d9877f196a0a94b06d5623a0ea66cf329409b | https://github.com/machour/yii2-swagger-api/blob/577d9877f196a0a94b06d5623a0ea66cf329409b/ApiGenerator.php#L901-L919 |
231,418 | fuzz-productions/magic-box | src/Utility/ChecksRelations.php | ChecksRelations.isRelation | protected function isRelation(Model $instance, $key, $model_class)
{
// Not a relation method
if (! method_exists($instance, $key)) {
return false;
}
$relation = null;
$safe_instance = new $model_class;
// Get method, dirty and imperfect
$reflected_method = (new \ReflectionMethod($safe_instance... | php | protected function isRelation(Model $instance, $key, $model_class)
{
// Not a relation method
if (! method_exists($instance, $key)) {
return false;
}
$relation = null;
$safe_instance = new $model_class;
// Get method, dirty and imperfect
$reflected_method = (new \ReflectionMethod($safe_instance... | [
"protected",
"function",
"isRelation",
"(",
"Model",
"$",
"instance",
",",
"$",
"key",
",",
"$",
"model_class",
")",
"{",
"// Not a relation method",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"instance",
",",
"$",
"key",
")",
")",
"{",
"return",
"false",
... | Safely determine if the specified key name is a relation on the model instance
@todo use PHP7 return type reflection solution as well
@param \Illuminate\Database\Eloquent\Model $instance
@param string $key
@param string $model_class
@return \Illuminate\Databas... | [
"Safely",
"determine",
"if",
"the",
"specified",
"key",
"name",
"is",
"a",
"relation",
"on",
"the",
"model",
"instance"
] | 996f8a5cf99177216cbab4a82a8ca79b87d05dfe | https://github.com/fuzz-productions/magic-box/blob/996f8a5cf99177216cbab4a82a8ca79b87d05dfe/src/Utility/ChecksRelations.php#L24-L60 |
231,419 | davin-bao/workflow | src/DavinBao/Workflow/WorkflowNode.php | WorkFlowNode.attachUser | public function attachUser( $user )
{
if( is_object($user))
$user = $user->getKey();
if( is_array($user))
$user = $user['id'];
$this->users()->attach( $user );
} | php | public function attachUser( $user )
{
if( is_object($user))
$user = $user->getKey();
if( is_array($user))
$user = $user['id'];
$this->users()->attach( $user );
} | [
"public",
"function",
"attachUser",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"user",
")",
")",
"$",
"user",
"=",
"$",
"user",
"->",
"getKey",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"user",
")",
")",
"$",
"user",
"=... | Attach user to current role
@param $user | [
"Attach",
"user",
"to",
"current",
"role"
] | 8af8b33ef63e455a2a5a1cdf6ac7bc154d590488 | https://github.com/davin-bao/workflow/blob/8af8b33ef63e455a2a5a1cdf6ac7bc154d590488/src/DavinBao/Workflow/WorkflowNode.php#L121-L130 |
231,420 | davin-bao/workflow | src/DavinBao/Workflow/WorkflowNode.php | WorkFlowNode.detachUser | public function detachUser( $user )
{
if( is_object($user))
$user = $user->getKey();
if( is_array($user))
$user = $user['id'];
$this->users()->detach( $user );
} | php | public function detachUser( $user )
{
if( is_object($user))
$user = $user->getKey();
if( is_array($user))
$user = $user['id'];
$this->users()->detach( $user );
} | [
"public",
"function",
"detachUser",
"(",
"$",
"user",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"user",
")",
")",
"$",
"user",
"=",
"$",
"user",
"->",
"getKey",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"user",
")",
")",
"$",
"user",
"=... | Detach permission form current user
@param $user | [
"Detach",
"permission",
"form",
"current",
"user"
] | 8af8b33ef63e455a2a5a1cdf6ac7bc154d590488 | https://github.com/davin-bao/workflow/blob/8af8b33ef63e455a2a5a1cdf6ac7bc154d590488/src/DavinBao/Workflow/WorkflowNode.php#L136-L145 |
231,421 | PaymentSuite/paymentsuite | src/PaymentSuite/PaypalWebCheckoutBundle/Controller/ProcessController.php | ProcessController.processAction | public function processAction(Request $request)
{
$orderId = $request
->query
->get('order_id');
try {
$this
->paypalWebCheckoutManager
->processPaypalIPNMessage(
$orderId, $request
->request... | php | public function processAction(Request $request)
{
$orderId = $request
->query
->get('order_id');
try {
$this
->paypalWebCheckoutManager
->processPaypalIPNMessage(
$orderId, $request
->request... | [
"public",
"function",
"processAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"orderId",
"=",
"$",
"request",
"->",
"query",
"->",
"get",
"(",
"'order_id'",
")",
";",
"try",
"{",
"$",
"this",
"->",
"paypalWebCheckoutManager",
"->",
"processPaypalIPNM... | Process Paypal IPN notification.
This controller handles the IPN notification.
The notification is sent using POST method. However,
we expect our internal order_id to be passed as a
query parameter 'order_id'. The resulting URL for
IPN callback notification will have the following form:
http://my-domain.com/payment/p... | [
"Process",
"Paypal",
"IPN",
"notification",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/PaypalWebCheckoutBundle/Controller/ProcessController.php#L79-L120 |
231,422 | php-task/TaskBundle | src/Executor/SeparateProcessExecutor.php | SeparateProcessExecutor.getMaximumAttempts | private function getMaximumAttempts($handlerClass)
{
$handler = $this->handlerFactory->create($handlerClass);
if (!$handler instanceof RetryTaskHandlerInterface) {
return 1;
}
return $handler->getMaximumAttempts();
} | php | private function getMaximumAttempts($handlerClass)
{
$handler = $this->handlerFactory->create($handlerClass);
if (!$handler instanceof RetryTaskHandlerInterface) {
return 1;
}
return $handler->getMaximumAttempts();
} | [
"private",
"function",
"getMaximumAttempts",
"(",
"$",
"handlerClass",
")",
"{",
"$",
"handler",
"=",
"$",
"this",
"->",
"handlerFactory",
"->",
"create",
"(",
"$",
"handlerClass",
")",
";",
"if",
"(",
"!",
"$",
"handler",
"instanceof",
"RetryTaskHandlerInterf... | Returns maximum attempts for specified handler.
@param string $handlerClass
@return int | [
"Returns",
"maximum",
"attempts",
"for",
"specified",
"handler",
"."
] | be8f0bbdfa3dc9dcaf0e01814166730a336eea07 | https://github.com/php-task/TaskBundle/blob/be8f0bbdfa3dc9dcaf0e01814166730a336eea07/src/Executor/SeparateProcessExecutor.php#L90-L98 |
231,423 | php-task/TaskBundle | src/Executor/SeparateProcessExecutor.php | SeparateProcessExecutor.handle | private function handle(TaskExecutionInterface $execution)
{
$process = $this->processFactory->create($execution->getUuid());
$process->run();
if (!$process->isSuccessful()) {
throw $this->createException($process->getErrorOutput());
}
return $process->getOutput... | php | private function handle(TaskExecutionInterface $execution)
{
$process = $this->processFactory->create($execution->getUuid());
$process->run();
if (!$process->isSuccessful()) {
throw $this->createException($process->getErrorOutput());
}
return $process->getOutput... | [
"private",
"function",
"handle",
"(",
"TaskExecutionInterface",
"$",
"execution",
")",
"{",
"$",
"process",
"=",
"$",
"this",
"->",
"processFactory",
"->",
"create",
"(",
"$",
"execution",
"->",
"getUuid",
"(",
")",
")",
";",
"$",
"process",
"->",
"run",
... | Handle execution by using console-command.
@param TaskExecutionInterface $execution
@return string
@throws FailedException
@throws SeparateProcessException | [
"Handle",
"execution",
"by",
"using",
"console",
"-",
"command",
"."
] | be8f0bbdfa3dc9dcaf0e01814166730a336eea07 | https://github.com/php-task/TaskBundle/blob/be8f0bbdfa3dc9dcaf0e01814166730a336eea07/src/Executor/SeparateProcessExecutor.php#L110-L120 |
231,424 | php-task/TaskBundle | src/Executor/SeparateProcessExecutor.php | SeparateProcessExecutor.createException | private function createException($errorOutput)
{
if (0 !== strpos($errorOutput, FailedException::class)) {
return new SeparateProcessException($errorOutput);
}
$errorOutput = trim(str_replace(FailedException::class, '', $errorOutput));
return new FailedException(new Sep... | php | private function createException($errorOutput)
{
if (0 !== strpos($errorOutput, FailedException::class)) {
return new SeparateProcessException($errorOutput);
}
$errorOutput = trim(str_replace(FailedException::class, '', $errorOutput));
return new FailedException(new Sep... | [
"private",
"function",
"createException",
"(",
"$",
"errorOutput",
")",
"{",
"if",
"(",
"0",
"!==",
"strpos",
"(",
"$",
"errorOutput",
",",
"FailedException",
"::",
"class",
")",
")",
"{",
"return",
"new",
"SeparateProcessException",
"(",
"$",
"errorOutput",
... | Create the correct exception.
FailedException for failed executions.
SeparateProcessExceptions for any exception during execution.
@param string $errorOutput
@return FailedException|SeparateProcessException | [
"Create",
"the",
"correct",
"exception",
"."
] | be8f0bbdfa3dc9dcaf0e01814166730a336eea07 | https://github.com/php-task/TaskBundle/blob/be8f0bbdfa3dc9dcaf0e01814166730a336eea07/src/Executor/SeparateProcessExecutor.php#L132-L141 |
231,425 | comocode/laravel-ab | src/App/Ab.php | Ab.saveSession | public static function saveSession()
{
if (!empty(self::$instance)) {
foreach (self::$instance as $event) {
$experiment = Experiments::firstOrCreate([
'experiment' => $event->name,
'goal' => $event->goal,
]);
... | php | public static function saveSession()
{
if (!empty(self::$instance)) {
foreach (self::$instance as $event) {
$experiment = Experiments::firstOrCreate([
'experiment' => $event->name,
'goal' => $event->goal,
]);
... | [
"public",
"static",
"function",
"saveSession",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"instance",
"as",
"$",
"event",
")",
"{",
"$",
"experiment",
"=",
"Experiment... | When the view is rendered, this funciton saves all event->firing pairing to storage. | [
"When",
"the",
"view",
"is",
"rendered",
"this",
"funciton",
"saves",
"all",
"event",
"-",
">",
"firing",
"pairing",
"to",
"storage",
"."
] | d46c3af1b7853aaa32a583048f249be0eef02e11 | https://github.com/comocode/laravel-ab/blob/d46c3af1b7853aaa32a583048f249be0eef02e11/src/App/Ab.php#L86-L107 |
231,426 | schemaio/schema-php-client | lib/Record.php | Record.offsetExists | public function offsetExists($index)
{
if (!parent::offsetExists($index) || parent::offsetGet($index) === null) {
if (isset($this->links[$index]['url']) || $index === '$links') {
return true;
}
return false;
}
return true;
} | php | public function offsetExists($index)
{
if (!parent::offsetExists($index) || parent::offsetGet($index) === null) {
if (isset($this->links[$index]['url']) || $index === '$links') {
return true;
}
return false;
}
return true;
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"parent",
"::",
"offsetExists",
"(",
"$",
"index",
")",
"||",
"parent",
"::",
"offsetGet",
"(",
"$",
"index",
")",
"===",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
... | Check if record field value exists
@param string $index
@return bool | [
"Check",
"if",
"record",
"field",
"value",
"exists"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Record.php#L22-L31 |
231,427 | schemaio/schema-php-client | lib/Record.php | Record.offsetGet | public function offsetGet($field)
{
if ($field === null) {
return;
}
$link_result = null;
if (isset($this->links[$field]['url']) || $field === '$links') {
$link_result = $this->offset_get_link($field);
}
if ($link_result !== null) {
... | php | public function offsetGet($field)
{
if ($field === null) {
return;
}
$link_result = null;
if (isset($this->links[$field]['url']) || $field === '$links') {
$link_result = $this->offset_get_link($field);
}
if ($link_result !== null) {
... | [
"public",
"function",
"offsetGet",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"field",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"link_result",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",
"field",
"]... | Get record field value
@param string $field
@return mixed | [
"Get",
"record",
"field",
"value"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Record.php#L39-L53 |
231,428 | schemaio/schema-php-client | lib/Record.php | Record.offsetSet | public function offsetSet($field, $value)
{
if (isset($this->links[$field]['url'])) {
$this->link_data[$field] = $value;
} else {
parent::offsetSet($field, $value);
}
} | php | public function offsetSet($field, $value)
{
if (isset($this->links[$field]['url'])) {
$this->link_data[$field] = $value;
} else {
parent::offsetSet($field, $value);
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"$",
"field",
"]",
"[",
"'url'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"link_data",
"[",
"$",
"field",
... | Set record field value
@param string $field
@param mixed $value
@return void | [
"Set",
"record",
"field",
"value"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Record.php#L62-L69 |
231,429 | schemaio/schema-php-client | lib/Record.php | Record.offset_get_link | public function offset_get_link($field)
{
$header_links = $this->links;
if ($field === '$links') {
$links = array();
foreach ($header_links['*'] ?: $header_links as $key => $link) {
if ($link['url']) {
$links[$key] = $this->link_url($key);... | php | public function offset_get_link($field)
{
$header_links = $this->links;
if ($field === '$links') {
$links = array();
foreach ($header_links['*'] ?: $header_links as $key => $link) {
if ($link['url']) {
$links[$key] = $this->link_url($key);... | [
"public",
"function",
"offset_get_link",
"(",
"$",
"field",
")",
"{",
"$",
"header_links",
"=",
"$",
"this",
"->",
"links",
";",
"if",
"(",
"$",
"field",
"===",
"'$links'",
")",
"{",
"$",
"links",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"... | Get record field value as a link result
@param string $field
@return Resource | [
"Get",
"record",
"field",
"value",
"as",
"a",
"link",
"result"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Record.php#L77-L131 |
231,430 | schemaio/schema-php-client | lib/Record.php | Record.offset_get_result | public function offset_get_result($field)
{
$data_links = null;
if (isset($this->links['*'])) {
$data_links = $this->links['*'];
} else if (isset($this->links[$field]['links'])) {
$data_links = $this->links[$field]['links'];
}
$data_value = parent::of... | php | public function offset_get_result($field)
{
$data_links = null;
if (isset($this->links['*'])) {
$data_links = $this->links['*'];
} else if (isset($this->links[$field]['links'])) {
$data_links = $this->links[$field]['links'];
}
$data_value = parent::of... | [
"public",
"function",
"offset_get_result",
"(",
"$",
"field",
")",
"{",
"$",
"data_links",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"links",
"[",
"'*'",
"]",
")",
")",
"{",
"$",
"data_links",
"=",
"$",
"this",
"->",
"links",
"[... | Get record field value as a record result
@param string $field
@return mixed | [
"Get",
"record",
"field",
"value",
"as",
"a",
"record",
"result"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Record.php#L139-L173 |
231,431 | schemaio/schema-php-client | lib/Record.php | Record.link_url | public function link_url($field, $id = null)
{
if ($qpos = strpos($this->url, '?')) {
$url = substr($this->url, 0, $qpos);
} else {
$url = $this->url;
}
if ($id) {
$url = preg_replace('/[^\/]+$/', $id, rtrim($url, "/"));
}
return ... | php | public function link_url($field, $id = null)
{
if ($qpos = strpos($this->url, '?')) {
$url = substr($this->url, 0, $qpos);
} else {
$url = $this->url;
}
if ($id) {
$url = preg_replace('/[^\/]+$/', $id, rtrim($url, "/"));
}
return ... | [
"public",
"function",
"link_url",
"(",
"$",
"field",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"qpos",
"=",
"strpos",
"(",
"$",
"this",
"->",
"url",
",",
"'?'",
")",
")",
"{",
"$",
"url",
"=",
"substr",
"(",
"$",
"this",
"->",
"u... | Build relative url for a link field
@param string $field
@param string $id | [
"Build",
"relative",
"url",
"for",
"a",
"link",
"field"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Record.php#L191-L204 |
231,432 | schemaio/schema-php-client | lib/Record.php | Record.dump | public function dump($return = false, $print = true, $depth = 1)
{
$dump = $this->data();
$links = $this->links;
foreach ($links as $key => $link) {
if ($depth < 1) {
try {
$related = $this->{$key};
} catch (ServerException $e)... | php | public function dump($return = false, $print = true, $depth = 1)
{
$dump = $this->data();
$links = $this->links;
foreach ($links as $key => $link) {
if ($depth < 1) {
try {
$related = $this->{$key};
} catch (ServerException $e)... | [
"public",
"function",
"dump",
"(",
"$",
"return",
"=",
"false",
",",
"$",
"print",
"=",
"true",
",",
"$",
"depth",
"=",
"1",
")",
"{",
"$",
"dump",
"=",
"$",
"this",
"->",
"data",
"(",
")",
";",
"$",
"links",
"=",
"$",
"this",
"->",
"links",
... | Dump raw record values
@param bool $return
@param bool $print | [
"Dump",
"raw",
"record",
"values"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Record.php#L212-L237 |
231,433 | juliushaertl/phpdoc-to-rst | src/Middleware/ErrorHandlingMiddleware.php | ErrorHandlingMiddleware.execute | public function execute($command, callable $next)
{
$filename = $command->getFile()->path();
$this->apiDocBuilder->debug('Starting to parse file: ' . $filename);
try {
return $next($command);
} catch (\Exception $e) {
$this->apiDocBuilder->log('Unable to parse... | php | public function execute($command, callable $next)
{
$filename = $command->getFile()->path();
$this->apiDocBuilder->debug('Starting to parse file: ' . $filename);
try {
return $next($command);
} catch (\Exception $e) {
$this->apiDocBuilder->log('Unable to parse... | [
"public",
"function",
"execute",
"(",
"$",
"command",
",",
"callable",
"$",
"next",
")",
"{",
"$",
"filename",
"=",
"$",
"command",
"->",
"getFile",
"(",
")",
"->",
"path",
"(",
")",
";",
"$",
"this",
"->",
"apiDocBuilder",
"->",
"debug",
"(",
"'Star... | Executes this middleware class.
@param CreateCommand $command
@param callable $next
@return object | [
"Executes",
"this",
"middleware",
"class",
"."
] | 9a695417d1f3bb709f60cd5c519e46f1ad08c843 | https://github.com/juliushaertl/phpdoc-to-rst/blob/9a695417d1f3bb709f60cd5c519e46f1ad08c843/src/Middleware/ErrorHandlingMiddleware.php#L49-L59 |
231,434 | PaymentSuite/paymentsuite | src/PaymentSuite/PaypalWebCheckoutBundle/Services/PaypalWebCheckoutManager.php | PaypalWebCheckoutManager.generatePaypalForm | public function generatePaypalForm()
{
$paypalMethod = $this
->paymentMethodFactory
->createEmpty();
/**
* We expect listeners for the payment.order.load event
* to store the Order into the bridge.
*
* So, $this->paymentBridge->getOrder() ... | php | public function generatePaypalForm()
{
$paypalMethod = $this
->paymentMethodFactory
->createEmpty();
/**
* We expect listeners for the payment.order.load event
* to store the Order into the bridge.
*
* So, $this->paymentBridge->getOrder() ... | [
"public",
"function",
"generatePaypalForm",
"(",
")",
"{",
"$",
"paypalMethod",
"=",
"$",
"this",
"->",
"paymentMethodFactory",
"->",
"createEmpty",
"(",
")",
";",
"/**\n * We expect listeners for the payment.order.load event\n * to store the Order into the bridge... | Dispatches order load event and prepares paypal form for submission.
This is a synchronous action that takes place on the implementor
side, i.e. right after click the "pay with checkout" button it the
final stage of a checkout process.
See documentation for PaypalWebCheckout Api Integration at
@link https://develope... | [
"Dispatches",
"order",
"load",
"event",
"and",
"prepares",
"paypal",
"form",
"for",
"submission",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/PaypalWebCheckoutBundle/Services/PaypalWebCheckoutManager.php#L102-L141 |
231,435 | PaymentSuite/paymentsuite | src/PaymentSuite/PaypalWebCheckoutBundle/Services/PaypalWebCheckoutManager.php | PaypalWebCheckoutManager.processPaypalIPNMessage | public function processPaypalIPNMessage($orderId, array $parameters)
{
/**
* Retrieving the order object.
*/
$order = $this
->paymentBridge
->findOrder($orderId);
if (!$order) {
throw new PaymentOrderNotFoundException(sprintf(
... | php | public function processPaypalIPNMessage($orderId, array $parameters)
{
/**
* Retrieving the order object.
*/
$order = $this
->paymentBridge
->findOrder($orderId);
if (!$order) {
throw new PaymentOrderNotFoundException(sprintf(
... | [
"public",
"function",
"processPaypalIPNMessage",
"(",
"$",
"orderId",
",",
"array",
"$",
"parameters",
")",
"{",
"/**\n * Retrieving the order object.\n */",
"$",
"order",
"=",
"$",
"this",
"->",
"paymentBridge",
"->",
"findOrder",
"(",
"$",
"orderId",... | Process Paypal IPN response to payment.
When the IPN mesage is validated, a payment success event
should be dispatched.
@param int $orderId Order Id
@param array $parameters parameter array coming from Paypal IPN notification
@throws ParameterNotReceivedException
@throws PaymentException | [
"Process",
"Paypal",
"IPN",
"response",
"to",
"payment",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/PaypalWebCheckoutBundle/Services/PaypalWebCheckoutManager.php#L155-L246 |
231,436 | PaymentSuite/paymentsuite | src/PaymentSuite/PaypalWebCheckoutBundle/Services/PaypalWebCheckoutManager.php | PaypalWebCheckoutManager.transactionSuccessful | private function transactionSuccessful($ipnParameters)
{
/**
* First of all we have to check the validity of the IPN
* message. We need to send back the contents of the query
* string coming from Paypal's IPN message.
*/
$ipnNotifyValidateUrl = $this->urlFactory->... | php | private function transactionSuccessful($ipnParameters)
{
/**
* First of all we have to check the validity of the IPN
* message. We need to send back the contents of the query
* string coming from Paypal's IPN message.
*/
$ipnNotifyValidateUrl = $this->urlFactory->... | [
"private",
"function",
"transactionSuccessful",
"(",
"$",
"ipnParameters",
")",
"{",
"/**\n * First of all we have to check the validity of the IPN\n * message. We need to send back the contents of the query\n * string coming from Paypal's IPN message.\n */",
"$",
... | Check if transaction is complete.
When we receive an IPN response, we should
check that the price paid corresponds to the
amount stored in the PaymentMethod. This double
check is essential since the web checkout form
could be mangled.
@link https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNIntro/
@p... | [
"Check",
"if",
"transaction",
"is",
"complete",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/PaypalWebCheckoutBundle/Services/PaypalWebCheckoutManager.php#L283-L312 |
231,437 | colorfield/mastodon-api-php | src/ConfigurationVO.php | ConfigurationVO.setOAuthCredentials | public function setOAuthCredentials(array $config)
{
// @todo change by using ConfigVO
// Throw exeception for mandatory params
if (!isset($config['client_id'])) {
throw new \InvalidArgumentException('Missing client_id.');
}
// Throw exeception for mandatory par... | php | public function setOAuthCredentials(array $config)
{
// @todo change by using ConfigVO
// Throw exeception for mandatory params
if (!isset($config['client_id'])) {
throw new \InvalidArgumentException('Missing client_id.');
}
// Throw exeception for mandatory par... | [
"public",
"function",
"setOAuthCredentials",
"(",
"array",
"$",
"config",
")",
"{",
"// @todo change by using ConfigVO",
"// Throw exeception for mandatory params",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'client_id'",
"]",
")",
")",
"{",
"throw",
"new",
... | Initializes the Configuration Value Object with oAuth credentials
To be used by the MastodonAPI class after authentication.
It should contain the client_id, client_secret and bearer.
@throws \InvalidArgumentException
@param array $config | [
"Initializes",
"the",
"Configuration",
"Value",
"Object",
"with",
"oAuth",
"credentials"
] | cd9cb946032508e48630fffd5a661f3347d0b84f | https://github.com/colorfield/mastodon-api-php/blob/cd9cb946032508e48630fffd5a661f3347d0b84f/src/ConfigurationVO.php#L186-L203 |
231,438 | colorfield/mastodon-api-php | src/ConfigurationVO.php | ConfigurationVO.getUserAuthenticationConfiguration | public function getUserAuthenticationConfiguration($email, $password)
{
return [
'grant_type' => 'password',
'client_id' => $this->getClientId(),
'client_secret' => $this->getClientSecret(),
'username' => $email,
'password' => $password,
'sco... | php | public function getUserAuthenticationConfiguration($email, $password)
{
return [
'grant_type' => 'password',
'client_id' => $this->getClientId(),
'client_secret' => $this->getClientSecret(),
'username' => $email,
'password' => $password,
'sco... | [
"public",
"function",
"getUserAuthenticationConfiguration",
"(",
"$",
"email",
",",
"$",
"password",
")",
"{",
"return",
"[",
"'grant_type'",
"=>",
"'password'",
",",
"'client_id'",
"=>",
"$",
"this",
"->",
"getClientId",
"(",
")",
",",
"'client_secret'",
"=>",
... | Returns the user authentication configuration.
@param $email
@param $password
@return array | [
"Returns",
"the",
"user",
"authentication",
"configuration",
"."
] | cd9cb946032508e48630fffd5a661f3347d0b84f | https://github.com/colorfield/mastodon-api-php/blob/cd9cb946032508e48630fffd5a661f3347d0b84f/src/ConfigurationVO.php#L256-L266 |
231,439 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.search | public function search($show_name)
{
$relevant_shows = false;
$url = self::APIURL. '/search/shows?q=' . rawurlencode($show_name);
$shows = $this->getFile($url);
if (is_array($shows)) {
$relevant_shows = [];
foreach ($shows as $series) {
$TVShow = new TVShow($series['show']);
$relevant_shows[] =... | php | public function search($show_name)
{
$relevant_shows = false;
$url = self::APIURL. '/search/shows?q=' . rawurlencode($show_name);
$shows = $this->getFile($url);
if (is_array($shows)) {
$relevant_shows = [];
foreach ($shows as $series) {
$TVShow = new TVShow($series['show']);
$relevant_shows[] =... | [
"public",
"function",
"search",
"(",
"$",
"show_name",
")",
"{",
"$",
"relevant_shows",
"=",
"false",
";",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/search/shows?q='",
".",
"rawurlencode",
"(",
"$",
"show_name",
")",
";",
"$",
"shows",
"=",
"$",
... | Takes in a show name
Outputs array of all the related shows for that given name
@param $show_name
@return array | [
"Takes",
"in",
"a",
"show",
"name",
"Outputs",
"array",
"of",
"all",
"the",
"related",
"shows",
"for",
"that",
"given",
"name"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L17-L32 |
231,440 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getPersonByName | public function getPersonByName($name){
$name = strtolower($name);
$url = self::APIURL.'/search/people?q='.$name;
$person = $this->getFile($url);
$people = [];
foreach($person as $peeps){
$people[] = new Actor($peeps['person']);
}
return $people;
} | php | public function getPersonByName($name){
$name = strtolower($name);
$url = self::APIURL.'/search/people?q='.$name;
$person = $this->getFile($url);
$people = [];
foreach($person as $peeps){
$people[] = new Actor($peeps['person']);
}
return $people;
} | [
"public",
"function",
"getPersonByName",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/search/people?q='",
".",
"$",
"name",
";",
"$",
"person",
"=",
"$",
"thi... | Takes in an actors name and outputs their actor object
@param $name
@return array | [
"Takes",
"in",
"an",
"actors",
"name",
"and",
"outputs",
"their",
"actor",
"object"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L102-L113 |
231,441 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getShowByShowID | public function getShowByShowID($ID, $embed_cast=null){
if($embed_cast === true){
$url = self::APIURL.'/shows/'.$ID.'?embed=cast';
}else{
$url = self::APIURL.'/shows/'.$ID;
}
$show = $this->getFile($url);
$cast = [];
foreach($show['_embedded']['cast'] as $person){
$actor = new Actor($person['pers... | php | public function getShowByShowID($ID, $embed_cast=null){
if($embed_cast === true){
$url = self::APIURL.'/shows/'.$ID.'?embed=cast';
}else{
$url = self::APIURL.'/shows/'.$ID;
}
$show = $this->getFile($url);
$cast = [];
foreach($show['_embedded']['cast'] as $person){
$actor = new Actor($person['pers... | [
"public",
"function",
"getShowByShowID",
"(",
"$",
"ID",
",",
"$",
"embed_cast",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"embed_cast",
"===",
"true",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/shows/'",
".",
"$",
"ID",
".",
"'?embed=ca... | Takes in a show ID and outputs the TVShow Object
@param $ID
@param null $embed_cast
@return array | [
"Takes",
"in",
"a",
"show",
"ID",
"and",
"outputs",
"the",
"TVShow",
"Object"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L154-L173 |
231,442 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getShowAKAs | public function getShowAKAs($ID)
{
$url = self::APIURL . '/shows/' . $ID . '/akas';
$akas = $this->getFile($url);
$AKA = new AKA($akas);
if (!empty($akas['name'])) {
return $AKA;
}
return false;
} | php | public function getShowAKAs($ID)
{
$url = self::APIURL . '/shows/' . $ID . '/akas';
$akas = $this->getFile($url);
$AKA = new AKA($akas);
if (!empty($akas['name'])) {
return $AKA;
}
return false;
} | [
"public",
"function",
"getShowAKAs",
"(",
"$",
"ID",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/shows/'",
".",
"$",
"ID",
".",
"'/akas'",
";",
"$",
"akas",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"url",
")",
";",
"$",
"AKA",
... | Takes in a show ID and outputs the AKA Object
@param $ID
@return bool|\JPinkney\TVMaze\AKA | [
"Takes",
"in",
"a",
"show",
"ID",
"and",
"outputs",
"the",
"AKA",
"Object"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L183-L197 |
231,443 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getEpisodesByShowID | public function getEpisodesByShowID($ID){
$url = self::APIURL.'/shows/'.$ID.'/episodes';
$episodes = $this->getFile($url);
$allEpisodes = [];
foreach($episodes as $episode){
$ep = new Episode($episode);
$allEpisodes[] = $ep;
}
return $allEpisodes;
} | php | public function getEpisodesByShowID($ID){
$url = self::APIURL.'/shows/'.$ID.'/episodes';
$episodes = $this->getFile($url);
$allEpisodes = [];
foreach($episodes as $episode){
$ep = new Episode($episode);
$allEpisodes[] = $ep;
}
return $allEpisodes;
} | [
"public",
"function",
"getEpisodesByShowID",
"(",
"$",
"ID",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/shows/'",
".",
"$",
"ID",
".",
"'/episodes'",
";",
"$",
"episodes",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"url",
")",
";",
... | Takes in a show ID and outputs all the episode objects for that show in an array
@param $ID
@return array | [
"Takes",
"in",
"a",
"show",
"ID",
"and",
"outputs",
"all",
"the",
"episode",
"objects",
"for",
"that",
"show",
"in",
"an",
"array"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L206-L219 |
231,444 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getEpisodeByNumber | public function getEpisodeByNumber($ID, $season, $episode)
{
$ep = false;
$url = self::APIURL . '/shows/' . $ID . '/episodebynumber?season='. $season . '&number=' . $episode;
$response = $this->getFile($url);
if (is_array($response)) {
$ep = new Episode($response);
}
return $ep;
} | php | public function getEpisodeByNumber($ID, $season, $episode)
{
$ep = false;
$url = self::APIURL . '/shows/' . $ID . '/episodebynumber?season='. $season . '&number=' . $episode;
$response = $this->getFile($url);
if (is_array($response)) {
$ep = new Episode($response);
}
return $ep;
} | [
"public",
"function",
"getEpisodeByNumber",
"(",
"$",
"ID",
",",
"$",
"season",
",",
"$",
"episode",
")",
"{",
"$",
"ep",
"=",
"false",
";",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/shows/'",
".",
"$",
"ID",
".",
"'/episodebynumber?season='",
"... | Returns a single episodes information by its show ID, season and episode numbers
@param $ID
@param $season
@param $episode
@return Episode|mixed | [
"Returns",
"a",
"single",
"episodes",
"information",
"by",
"its",
"show",
"ID",
"season",
"and",
"episode",
"numbers"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L230-L239 |
231,445 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getEpisodesByAirdate | public function getEpisodesByAirdate($ID, $airdate)
{
$url = self::APIURL . '/shows/' . $ID . '/episodesbydate?date=' . date('Y-m-d', strtotime($airdate));
$episodes = $this->getFile($url);
$allEpisodes = [];
if (is_array($episodes)) {
foreach ($episodes as $episode) {
$ep = new Episode($episode);
... | php | public function getEpisodesByAirdate($ID, $airdate)
{
$url = self::APIURL . '/shows/' . $ID . '/episodesbydate?date=' . date('Y-m-d', strtotime($airdate));
$episodes = $this->getFile($url);
$allEpisodes = [];
if (is_array($episodes)) {
foreach ($episodes as $episode) {
$ep = new Episode($episode);
... | [
"public",
"function",
"getEpisodesByAirdate",
"(",
"$",
"ID",
",",
"$",
"airdate",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/shows/'",
".",
"$",
"ID",
".",
"'/episodesbydate?date='",
".",
"date",
"(",
"'Y-m-d'",
",",
"strtotime",
"(",
"$... | Returns episodes for a given show ID and ISO 8601 airdate
@param $ID
@param $airdate
@return Episode|mixed | [
"Returns",
"episodes",
"for",
"a",
"given",
"show",
"ID",
"and",
"ISO",
"8601",
"airdate"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L249-L262 |
231,446 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getPersonByID | public function getPersonByID($ID){
$url = self::APIURL.'/people/'.$ID;
$show = $this->getFile($url);
return new Actor($show);
} | php | public function getPersonByID($ID){
$url = self::APIURL.'/people/'.$ID;
$show = $this->getFile($url);
return new Actor($show);
} | [
"public",
"function",
"getPersonByID",
"(",
"$",
"ID",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/people/'",
".",
"$",
"ID",
";",
"$",
"show",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"url",
")",
";",
"return",
"new",
"Actor",
... | Gets an actor by their ID
@param $ID
@return Actor | [
"Gets",
"an",
"actor",
"by",
"their",
"ID"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L316-L320 |
231,447 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getCastCreditsByID | public function getCastCreditsByID($ID){
$url = self::APIURL.'/people/'.$ID.'/castcredits?embed=show';
$castCredit = $this->getFile($url);
$shows_appeared = [];
foreach($castCredit as $series){
$TVShow = new TVShow($series['_embedded']['show']);
$shows_appeared[] = $TVShow;
}
return $shows_appeared;
... | php | public function getCastCreditsByID($ID){
$url = self::APIURL.'/people/'.$ID.'/castcredits?embed=show';
$castCredit = $this->getFile($url);
$shows_appeared = [];
foreach($castCredit as $series){
$TVShow = new TVShow($series['_embedded']['show']);
$shows_appeared[] = $TVShow;
}
return $shows_appeared;
... | [
"public",
"function",
"getCastCreditsByID",
"(",
"$",
"ID",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/people/'",
".",
"$",
"ID",
".",
"'/castcredits?embed=show'",
";",
"$",
"castCredit",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"url"... | Gets an array of all the shows a particular actor has been in
@param $ID
@return array | [
"Gets",
"an",
"array",
"of",
"all",
"the",
"shows",
"a",
"particular",
"actor",
"has",
"been",
"in"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L329-L339 |
231,448 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getCrewCreditsByID | public function getCrewCreditsByID($ID){
$url = self::APIURL.'/people/'.$ID.'/crewcredits?embed=show';
$crewCredit = $this->getFile($url);
$shows_appeared = [];
foreach($crewCredit as $series){
$position = $series['type'];
$TVShow = new TVShow($series['_embedded']['show']);
$shows_appeared[] = [$posit... | php | public function getCrewCreditsByID($ID){
$url = self::APIURL.'/people/'.$ID.'/crewcredits?embed=show';
$crewCredit = $this->getFile($url);
$shows_appeared = [];
foreach($crewCredit as $series){
$position = $series['type'];
$TVShow = new TVShow($series['_embedded']['show']);
$shows_appeared[] = [$posit... | [
"public",
"function",
"getCrewCreditsByID",
"(",
"$",
"ID",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"APIURL",
".",
"'/people/'",
".",
"$",
"ID",
".",
"'/crewcredits?embed=show'",
";",
"$",
"crewCredit",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"url"... | Gets the position worked at the tv show in a tuple with the tvshow
@param $ID
@return array | [
"Gets",
"the",
"position",
"worked",
"at",
"the",
"tv",
"show",
"in",
"a",
"tuple",
"with",
"the",
"tvshow"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L348-L359 |
231,449 | JPinkney/TVMaze-PHP-API-Wrapper | TVMaze/TVMaze.php | TVMaze.getFile | private function getFile($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode($result, ... | php | private function getFile($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode($result, ... | [
"private",
"function",
"getFile",
"(",
"$",
"url",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_HEADER",
",",
"false",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_FOLLOWLOCATION",
",",
"t... | Function used to get the data from the URL and return the results in an array
@param $url
@return mixed | [
"Function",
"used",
"to",
"get",
"the",
"data",
"from",
"the",
"URL",
"and",
"return",
"the",
"results",
"in",
"an",
"array"
] | 174429341ef2009a42f77743faa342726d7d8467 | https://github.com/JPinkney/TVMaze-PHP-API-Wrapper/blob/174429341ef2009a42f77743faa342726d7d8467/TVMaze/TVMaze.php#L368-L384 |
231,450 | swoft-cloud/swoft-http-client | src/Adapter/CurlAdapter.php | CurlAdapter.getDefaultUserAgent | public function getDefaultUserAgent(): string
{
$defaultAgent = 'Swoft/' . App::version();
if (\extension_loaded('curl') && \function_exists('curl_version')) {
$defaultAgent .= ' curl/' . \curl_version()['version'];
}
$defaultAgent .= ' PHP/' . PHP_VERSION;
return... | php | public function getDefaultUserAgent(): string
{
$defaultAgent = 'Swoft/' . App::version();
if (\extension_loaded('curl') && \function_exists('curl_version')) {
$defaultAgent .= ' curl/' . \curl_version()['version'];
}
$defaultAgent .= ' PHP/' . PHP_VERSION;
return... | [
"public",
"function",
"getDefaultUserAgent",
"(",
")",
":",
"string",
"{",
"$",
"defaultAgent",
"=",
"'Swoft/'",
".",
"App",
"::",
"version",
"(",
")",
";",
"if",
"(",
"\\",
"extension_loaded",
"(",
"'curl'",
")",
"&&",
"\\",
"function_exists",
"(",
"'curl... | Get the adapter User-Agent string
@return string | [
"Get",
"the",
"adapter",
"User",
"-",
"Agent",
"string"
] | 980ac3701cc100ec605ccb5f7e974861f900d0e9 | https://github.com/swoft-cloud/swoft-http-client/blob/980ac3701cc100ec605ccb5f7e974861f900d0e9/src/Adapter/CurlAdapter.php#L247-L255 |
231,451 | shutterstock/presto | src/Shutterstock/Presto/Response.php | Response.parseHeader | public function parseHeader($header)
{
$parsed_header = array();
$header_lines = explode("\r\n", $header);
if (count($header_lines) > 0) {
foreach ($header_lines as $line) {
$header = explode(':', $line);
if (count($header) > 1) {
... | php | public function parseHeader($header)
{
$parsed_header = array();
$header_lines = explode("\r\n", $header);
if (count($header_lines) > 0) {
foreach ($header_lines as $line) {
$header = explode(':', $line);
if (count($header) > 1) {
... | [
"public",
"function",
"parseHeader",
"(",
"$",
"header",
")",
"{",
"$",
"parsed_header",
"=",
"array",
"(",
")",
";",
"$",
"header_lines",
"=",
"explode",
"(",
"\"\\r\\n\"",
",",
"$",
"header",
")",
";",
"if",
"(",
"count",
"(",
"$",
"header_lines",
")... | Parse response headers into an array
@param string $header headers from request
@return array parsed header array | [
"Parse",
"response",
"headers",
"into",
"an",
"array"
] | 5e030a24ac669f43b84c3a30e1217d08fb3ea6be | https://github.com/shutterstock/presto/blob/5e030a24ac669f43b84c3a30e1217d08fb3ea6be/src/Shutterstock/Presto/Response.php#L80-L101 |
231,452 | Oryzone/PHPoAuthUserData | src/OAuth/UserData/Extractor/LazyExtractor.php | LazyExtractor.getDefaultNormalizersMap | protected static function getDefaultNormalizersMap()
{
return array(
self::FIELD_UNIQUE_ID => self::FIELD_UNIQUE_ID,
self::FIELD_USERNAME => self::FIELD_USERNAME,
self::FIELD_FIRST_NAME => self::FIELD_FIRST_NAME,
self::FIELD_LAST_NAME ... | php | protected static function getDefaultNormalizersMap()
{
return array(
self::FIELD_UNIQUE_ID => self::FIELD_UNIQUE_ID,
self::FIELD_USERNAME => self::FIELD_USERNAME,
self::FIELD_FIRST_NAME => self::FIELD_FIRST_NAME,
self::FIELD_LAST_NAME ... | [
"protected",
"static",
"function",
"getDefaultNormalizersMap",
"(",
")",
"{",
"return",
"array",
"(",
"self",
"::",
"FIELD_UNIQUE_ID",
"=>",
"self",
"::",
"FIELD_UNIQUE_ID",
",",
"self",
"::",
"FIELD_USERNAME",
"=>",
"self",
"::",
"FIELD_USERNAME",
",",
"self",
... | Get a default normalizers map
@return array | [
"Get",
"a",
"default",
"normalizers",
"map"
] | 4f7a3aa482544765c7ffd6a24f5ee01f05b66d2b | https://github.com/Oryzone/PHPoAuthUserData/blob/4f7a3aa482544765c7ffd6a24f5ee01f05b66d2b/src/OAuth/UserData/Extractor/LazyExtractor.php#L139-L156 |
231,453 | PaymentSuite/paymentsuite | src/PaymentSuite/PaylandsBundle/Services/PaylandsApiAdapter.php | PaylandsApiAdapter.createTransaction | public function createTransaction(PaylandsMethod $paymentMethod)
{
$paymentOrder = $this->client->createPayment(
$paymentMethod->getCustomerExternalId(),
$this->paymentBridge->getAmount(),
(string)$this->paymentBridge->getOrder(),
$this->currencyServiceResolve... | php | public function createTransaction(PaylandsMethod $paymentMethod)
{
$paymentOrder = $this->client->createPayment(
$paymentMethod->getCustomerExternalId(),
$this->paymentBridge->getAmount(),
(string)$this->paymentBridge->getOrder(),
$this->currencyServiceResolve... | [
"public",
"function",
"createTransaction",
"(",
"PaylandsMethod",
"$",
"paymentMethod",
")",
"{",
"$",
"paymentOrder",
"=",
"$",
"this",
"->",
"client",
"->",
"createPayment",
"(",
"$",
"paymentMethod",
"->",
"getCustomerExternalId",
"(",
")",
",",
"$",
"this",
... | Sends the payment order to Paylands.
@param PaylandsMethod $paymentMethod | [
"Sends",
"the",
"payment",
"order",
"to",
"Paylands",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/PaylandsBundle/Services/PaylandsApiAdapter.php#L74-L92 |
231,454 | PaymentSuite/paymentsuite | src/PaymentSuite/PaylandsBundle/Services/PaylandsApiAdapter.php | PaylandsApiAdapter.validateCard | public function validateCard(PaylandsMethod $paymentMethod)
{
$response = $this->client->retrieveCustomerCards($paymentMethod->getCustomerExternalId());
foreach ($response['cards'] as $card) {
if ($paymentMethod->getCardUuid() == $card['uuid']) {
$paymentMethod
... | php | public function validateCard(PaylandsMethod $paymentMethod)
{
$response = $this->client->retrieveCustomerCards($paymentMethod->getCustomerExternalId());
foreach ($response['cards'] as $card) {
if ($paymentMethod->getCardUuid() == $card['uuid']) {
$paymentMethod
... | [
"public",
"function",
"validateCard",
"(",
"PaylandsMethod",
"$",
"paymentMethod",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"retrieveCustomerCards",
"(",
"$",
"paymentMethod",
"->",
"getCustomerExternalId",
"(",
")",
")",
";",
"foreach"... | Validates against Paylands that the card is associates with customer.
@param PaylandsMethod $paymentMethod
@throws CardNotFoundException | [
"Validates",
"against",
"Paylands",
"that",
"the",
"card",
"is",
"associates",
"with",
"customer",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/PaylandsBundle/Services/PaylandsApiAdapter.php#L101-L119 |
231,455 | shutterstock/presto | src/Shutterstock/Presto/Presto.php | Presto.setAuth | public function setAuth($username, $password, $auth_type = null)
{
if (is_null($auth_type)) {
$auth_type = CURLAUTH_BASIC;
}
$this->curl_opts[CURLOPT_HTTPAUTH] = $auth_type;
$this->curl_opts[CURLOPT_USERPWD] = "{$username}:{$password}";
} | php | public function setAuth($username, $password, $auth_type = null)
{
if (is_null($auth_type)) {
$auth_type = CURLAUTH_BASIC;
}
$this->curl_opts[CURLOPT_HTTPAUTH] = $auth_type;
$this->curl_opts[CURLOPT_USERPWD] = "{$username}:{$password}";
} | [
"public",
"function",
"setAuth",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"auth_type",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"auth_type",
")",
")",
"{",
"$",
"auth_type",
"=",
"CURLAUTH_BASIC",
";",
"}",
"$",
"this",
"->... | Authorization method and options to use
@param string $username user name to use
@param string $password password to use
@param string $auth_type authentication method to use | [
"Authorization",
"method",
"and",
"options",
"to",
"use"
] | 5e030a24ac669f43b84c3a30e1217d08fb3ea6be | https://github.com/shutterstock/presto/blob/5e030a24ac669f43b84c3a30e1217d08fb3ea6be/src/Shutterstock/Presto/Presto.php#L203-L211 |
231,456 | shutterstock/presto | src/Shutterstock/Presto/Presto.php | Presto.setHeaders | public function setHeaders(array $headers, $overwrite_existing = false)
{
if ($overwrite_existing) {
$this->curl_opts[CURLOPT_HTTPHEADER] = $headers;
} else {
$this->curl_opts[CURLOPT_HTTPHEADER] = array_merge(
$this->curl_opts[CURLOPT_HTTPHEADER],
... | php | public function setHeaders(array $headers, $overwrite_existing = false)
{
if ($overwrite_existing) {
$this->curl_opts[CURLOPT_HTTPHEADER] = $headers;
} else {
$this->curl_opts[CURLOPT_HTTPHEADER] = array_merge(
$this->curl_opts[CURLOPT_HTTPHEADER],
... | [
"public",
"function",
"setHeaders",
"(",
"array",
"$",
"headers",
",",
"$",
"overwrite_existing",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"overwrite_existing",
")",
"{",
"$",
"this",
"->",
"curl_opts",
"[",
"CURLOPT_HTTPHEADER",
"]",
"=",
"$",
"headers",
"... | Set custom headers, with optional overwrite of existing
@param array $headers key/value list of headers to set
@param boolean $overwrite_existing whether to merge or overwrite existing headers | [
"Set",
"custom",
"headers",
"with",
"optional",
"overwrite",
"of",
"existing"
] | 5e030a24ac669f43b84c3a30e1217d08fb3ea6be | https://github.com/shutterstock/presto/blob/5e030a24ac669f43b84c3a30e1217d08fb3ea6be/src/Shutterstock/Presto/Presto.php#L229-L239 |
231,457 | shutterstock/presto | src/Shutterstock/Presto/Presto.php | Presto.queueRequest | public function queueRequest($handle, $url, $callback)
{
if (!is_resource(self::$queue_handle)) {
self::initQueue();
}
self::$request_queue[] = array(
'url' => $url,
'handle' => $handle,
'callback' => $callback,
'response... | php | public function queueRequest($handle, $url, $callback)
{
if (!is_resource(self::$queue_handle)) {
self::initQueue();
}
self::$request_queue[] = array(
'url' => $url,
'handle' => $handle,
'callback' => $callback,
'response... | [
"public",
"function",
"queueRequest",
"(",
"$",
"handle",
",",
"$",
"url",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"self",
"::",
"$",
"queue_handle",
")",
")",
"{",
"self",
"::",
"initQueue",
"(",
")",
";",
"}",
"self",
... | Queue a request for processing when doing simultaneous requests
@param object $handle curl handle for the reqeust
@param string $url URL to use for the request
@param object $callback function to call after request is processed | [
"Queue",
"a",
"request",
"for",
"processing",
"when",
"doing",
"simultaneous",
"requests"
] | 5e030a24ac669f43b84c3a30e1217d08fb3ea6be | https://github.com/shutterstock/presto/blob/5e030a24ac669f43b84c3a30e1217d08fb3ea6be/src/Shutterstock/Presto/Presto.php#L364-L377 |
231,458 | shutterstock/presto | src/Shutterstock/Presto/Presto.php | Presto.processQueue | public static function processQueue()
{
if (count(self::$request_queue) == 0) {
return false;
}
do {
$multi_handle = curl_multi_exec(self::$queue_handle, $active);
} while ($multi_handle == CURLM_CALL_MULTI_PERFORM);
while ($active && $multi_handle =... | php | public static function processQueue()
{
if (count(self::$request_queue) == 0) {
return false;
}
do {
$multi_handle = curl_multi_exec(self::$queue_handle, $active);
} while ($multi_handle == CURLM_CALL_MULTI_PERFORM);
while ($active && $multi_handle =... | [
"public",
"static",
"function",
"processQueue",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"self",
"::",
"$",
"request_queue",
")",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"do",
"{",
"$",
"multi_handle",
"=",
"curl_multi_exec",
"(",
"self",
"::"... | Trigger to execute the curl requests
@return boolean whether or not the queue was processed | [
"Trigger",
"to",
"execute",
"the",
"curl",
"requests"
] | 5e030a24ac669f43b84c3a30e1217d08fb3ea6be | https://github.com/shutterstock/presto/blob/5e030a24ac669f43b84c3a30e1217d08fb3ea6be/src/Shutterstock/Presto/Presto.php#L384-L435 |
231,459 | shutterstock/presto | src/Shutterstock/Presto/Presto.php | Presto.arrayToUrlParams | public static function arrayToUrlParams($params, $delimiter = '&')
{
$url_params = array();
foreach ($params as $key => $value) {
if (is_array($value)) {
foreach ($value as $subvalue) {
$url_params[] = urlencode($key) . '=' . urlencode($subvalue);
... | php | public static function arrayToUrlParams($params, $delimiter = '&')
{
$url_params = array();
foreach ($params as $key => $value) {
if (is_array($value)) {
foreach ($value as $subvalue) {
$url_params[] = urlencode($key) . '=' . urlencode($subvalue);
... | [
"public",
"static",
"function",
"arrayToUrlParams",
"(",
"$",
"params",
",",
"$",
"delimiter",
"=",
"'&'",
")",
"{",
"$",
"url_params",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
... | Convert an array to a flattened URL parameter structure
This will create a URL parameter string with repeating param keys
If this special behavior is not needed, http_build_query should be used
@param array $params key/value list of url parameters to use
@param string $delimiter optional alternative delimi... | [
"Convert",
"an",
"array",
"to",
"a",
"flattened",
"URL",
"parameter",
"structure",
"This",
"will",
"create",
"a",
"URL",
"parameter",
"string",
"with",
"repeating",
"param",
"keys",
"If",
"this",
"special",
"behavior",
"is",
"not",
"needed",
"http_build_query",
... | 5e030a24ac669f43b84c3a30e1217d08fb3ea6be | https://github.com/shutterstock/presto/blob/5e030a24ac669f43b84c3a30e1217d08fb3ea6be/src/Shutterstock/Presto/Presto.php#L570-L583 |
231,460 | shutterstock/presto | src/Shutterstock/Presto/Presto.php | Presto.logProfiling | public static function logProfiling(array $log_data)
{
if (self::$profiling_count > self::$profiling_max) {
return;
}
self::$profiling_count++;
if (isset($log_data['errorno'])) {
self::$profiling[] = array(
'url' => $log_data['url'],
... | php | public static function logProfiling(array $log_data)
{
if (self::$profiling_count > self::$profiling_max) {
return;
}
self::$profiling_count++;
if (isset($log_data['errorno'])) {
self::$profiling[] = array(
'url' => $log_data['url'],
... | [
"public",
"static",
"function",
"logProfiling",
"(",
"array",
"$",
"log_data",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"profiling_count",
">",
"self",
"::",
"$",
"profiling_max",
")",
"{",
"return",
";",
"}",
"self",
"::",
"$",
"profiling_count",
"++",
"... | Log profiling information for service requests
@param array $log_data profiling information to log | [
"Log",
"profiling",
"information",
"for",
"service",
"requests"
] | 5e030a24ac669f43b84c3a30e1217d08fb3ea6be | https://github.com/shutterstock/presto/blob/5e030a24ac669f43b84c3a30e1217d08fb3ea6be/src/Shutterstock/Presto/Presto.php#L604-L627 |
231,461 | opensoft/epl | src/Epl/Command/Image/AsciiTextCommand.php | AsciiTextCommand.rotationConvertFromDegree | private function rotationConvertFromDegree($degree, $asianFont)
{
switch ($degree) {
case 90:
if ($asianFont) {
return 5;
}
return 1;
case 180:
if ($asianFont) {
return 6;
... | php | private function rotationConvertFromDegree($degree, $asianFont)
{
switch ($degree) {
case 90:
if ($asianFont) {
return 5;
}
return 1;
case 180:
if ($asianFont) {
return 6;
... | [
"private",
"function",
"rotationConvertFromDegree",
"(",
"$",
"degree",
",",
"$",
"asianFont",
")",
"{",
"switch",
"(",
"$",
"degree",
")",
"{",
"case",
"90",
":",
"if",
"(",
"$",
"asianFont",
")",
"{",
"return",
"5",
";",
"}",
"return",
"1",
";",
"c... | 0 = normal
1 = 90 degrees
2 = 180 degrees
3 = 270 degrees
@param int $degree
@param $asianFont
@throw ExceptionCommand
@return int | [
"0",
"=",
"normal",
"1",
"=",
"90",
"degrees",
"2",
"=",
"180",
"degrees",
"3",
"=",
"270",
"degrees"
] | 61a1152ed3e292d5bd3ec2758076d605bada0623 | https://github.com/opensoft/epl/blob/61a1152ed3e292d5bd3ec2758076d605bada0623/src/Epl/Command/Image/AsciiTextCommand.php#L163-L190 |
231,462 | bariew/yii2-event-component | EventBootstrap.php | EventBootstrap.getEventManager | public static function getEventManager($app)
{
if (self::$_eventManager) {
return self::$_eventManager;
}
foreach ($app->components as $name => $config) {
$class = is_string($config) ? $config : @$config['class'];
if($class == str_replace('Bootstrap', 'Man... | php | public static function getEventManager($app)
{
if (self::$_eventManager) {
return self::$_eventManager;
}
foreach ($app->components as $name => $config) {
$class = is_string($config) ? $config : @$config['class'];
if($class == str_replace('Bootstrap', 'Man... | [
"public",
"static",
"function",
"getEventManager",
"(",
"$",
"app",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_eventManager",
")",
"{",
"return",
"self",
"::",
"$",
"_eventManager",
";",
"}",
"foreach",
"(",
"$",
"app",
"->",
"components",
"as",
"$",
"n... | finds and creates app event manager from its settings
@param Application $app yii app
@return EventManager app event manager component
@throws Exception Define event manager | [
"finds",
"and",
"creates",
"app",
"event",
"manager",
"from",
"its",
"settings"
] | 0b93904a79b3b39b85832dcbd7131f66f39f976e | https://github.com/bariew/yii2-event-component/blob/0b93904a79b3b39b85832dcbd7131f66f39f976e/EventBootstrap.php#L37-L58 |
231,463 | digilist/dependency-graph | src/DependencyNode.php | DependencyNode.dependsOn | public function dependsOn(self $node)
{
if (!in_array($node, $this->dependencies)) {
$this->dependencies[] = $node;
}
} | php | public function dependsOn(self $node)
{
if (!in_array($node, $this->dependencies)) {
$this->dependencies[] = $node;
}
} | [
"public",
"function",
"dependsOn",
"(",
"self",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"node",
",",
"$",
"this",
"->",
"dependencies",
")",
")",
"{",
"$",
"this",
"->",
"dependencies",
"[",
"]",
"=",
"$",
"node",
";",
"}",
"... | This node as a dependency on the passed node.
@param DependencyNode $node | [
"This",
"node",
"as",
"a",
"dependency",
"on",
"the",
"passed",
"node",
"."
] | dd77f1a81c81d921c135b3c775fed054d4dbd5d2 | https://github.com/digilist/dependency-graph/blob/dd77f1a81c81d921c135b3c775fed054d4dbd5d2/src/DependencyNode.php#L46-L51 |
231,464 | digilist/dependency-graph | src/DependencyGraph.php | DependencyGraph.addNode | public function addNode(DependencyNode $node)
{
if (!$this->dependencies->contains($node)) {
$this->dependencies->attach($node, new ArrayObject());
$this->nodes[] = $node;
foreach ($node->getDependencies() as $depency) {
$this->addDependency($node, $depen... | php | public function addNode(DependencyNode $node)
{
if (!$this->dependencies->contains($node)) {
$this->dependencies->attach($node, new ArrayObject());
$this->nodes[] = $node;
foreach ($node->getDependencies() as $depency) {
$this->addDependency($node, $depen... | [
"public",
"function",
"addNode",
"(",
"DependencyNode",
"$",
"node",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"dependencies",
"->",
"contains",
"(",
"$",
"node",
")",
")",
"{",
"$",
"this",
"->",
"dependencies",
"->",
"attach",
"(",
"$",
"node",
... | Add a new node to the graph and adopt the defined dependencies automatically.
@param DependencyNode $node | [
"Add",
"a",
"new",
"node",
"to",
"the",
"graph",
"and",
"adopt",
"the",
"defined",
"dependencies",
"automatically",
"."
] | dd77f1a81c81d921c135b3c775fed054d4dbd5d2 | https://github.com/digilist/dependency-graph/blob/dd77f1a81c81d921c135b3c775fed054d4dbd5d2/src/DependencyGraph.php#L34-L44 |
231,465 | digilist/dependency-graph | src/DependencyGraph.php | DependencyGraph.addDependency | public function addDependency(DependencyNode $node, DependencyNode $dependsOn)
{
if (!$this->dependencies->contains($node)) {
$this->addNode($node);
}
if (!$this->dependencies->contains($dependsOn)) {
$this->addNode($dependsOn);
}
if (!$this->arrayObj... | php | public function addDependency(DependencyNode $node, DependencyNode $dependsOn)
{
if (!$this->dependencies->contains($node)) {
$this->addNode($node);
}
if (!$this->dependencies->contains($dependsOn)) {
$this->addNode($dependsOn);
}
if (!$this->arrayObj... | [
"public",
"function",
"addDependency",
"(",
"DependencyNode",
"$",
"node",
",",
"DependencyNode",
"$",
"dependsOn",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"dependencies",
"->",
"contains",
"(",
"$",
"node",
")",
")",
"{",
"$",
"this",
"->",
"addNod... | Add a new dependency between two nodes.
If the starting node or the dependend is not added to the graph yet, they will be added automatically.
@param DependencyNode $node
@param DependencyNode $dependsOn | [
"Add",
"a",
"new",
"dependency",
"between",
"two",
"nodes",
".",
"If",
"the",
"starting",
"node",
"or",
"the",
"dependend",
"is",
"not",
"added",
"to",
"the",
"graph",
"yet",
"they",
"will",
"be",
"added",
"automatically",
"."
] | dd77f1a81c81d921c135b3c775fed054d4dbd5d2 | https://github.com/digilist/dependency-graph/blob/dd77f1a81c81d921c135b3c775fed054d4dbd5d2/src/DependencyGraph.php#L53-L67 |
231,466 | digilist/dependency-graph | src/DependencyGraph.php | DependencyGraph.findRootNodes | public function findRootNodes()
{
$possibleRoots = new SplObjectStorage();
foreach ($this->nodes as $node) {
$possibleRoots[$node] = true;
}
// Detect all nodes which couldn't be root
foreach ($this->dependencies as $node) {
$nodeDependencies = $this-... | php | public function findRootNodes()
{
$possibleRoots = new SplObjectStorage();
foreach ($this->nodes as $node) {
$possibleRoots[$node] = true;
}
// Detect all nodes which couldn't be root
foreach ($this->dependencies as $node) {
$nodeDependencies = $this-... | [
"public",
"function",
"findRootNodes",
"(",
")",
"{",
"$",
"possibleRoots",
"=",
"new",
"SplObjectStorage",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"nodes",
"as",
"$",
"node",
")",
"{",
"$",
"possibleRoots",
"[",
"$",
"node",
"]",
"=",
"true"... | Find all connected graphs in the set of all graphs.
@return ArrayObject | [
"Find",
"all",
"connected",
"graphs",
"in",
"the",
"set",
"of",
"all",
"graphs",
"."
] | dd77f1a81c81d921c135b3c775fed054d4dbd5d2 | https://github.com/digilist/dependency-graph/blob/dd77f1a81c81d921c135b3c775fed054d4dbd5d2/src/DependencyGraph.php#L74-L98 |
231,467 | digilist/dependency-graph | src/DependencyGraph.php | DependencyGraph.resolve | public function resolve()
{
if ($this->dependencies->count() === 0) {
return array();
}
$resolved = new ArrayObject();
foreach ($this->findRootNodes() as $rootNode) {
$this->innerResolve($rootNode, $resolved, new ArrayObject());
}
//all resol... | php | public function resolve()
{
if ($this->dependencies->count() === 0) {
return array();
}
$resolved = new ArrayObject();
foreach ($this->findRootNodes() as $rootNode) {
$this->innerResolve($rootNode, $resolved, new ArrayObject());
}
//all resol... | [
"public",
"function",
"resolve",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dependencies",
"->",
"count",
"(",
")",
"===",
"0",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"resolved",
"=",
"new",
"ArrayObject",
"(",
")",
";",
"foreach"... | Resolve this dependency graph. In the end a valid path will be returned.
@return DependencyNode[] | [
"Resolve",
"this",
"dependency",
"graph",
".",
"In",
"the",
"end",
"a",
"valid",
"path",
"will",
"be",
"returned",
"."
] | dd77f1a81c81d921c135b3c775fed054d4dbd5d2 | https://github.com/digilist/dependency-graph/blob/dd77f1a81c81d921c135b3c775fed054d4dbd5d2/src/DependencyGraph.php#L105-L126 |
231,468 | digilist/dependency-graph | src/DependencyGraph.php | DependencyGraph.innerResolve | private function innerResolve(DependencyNode $rootNode, ArrayObject $resolved, ArrayObject $seen)
{
$seen->append($rootNode);
foreach ($rootNode->getDependencies() as $edge) {
if (!$this->arrayObjectContains($edge, $resolved)) {
if ($this->arrayObjectContains($edge, $seen... | php | private function innerResolve(DependencyNode $rootNode, ArrayObject $resolved, ArrayObject $seen)
{
$seen->append($rootNode);
foreach ($rootNode->getDependencies() as $edge) {
if (!$this->arrayObjectContains($edge, $resolved)) {
if ($this->arrayObjectContains($edge, $seen... | [
"private",
"function",
"innerResolve",
"(",
"DependencyNode",
"$",
"rootNode",
",",
"ArrayObject",
"$",
"resolved",
",",
"ArrayObject",
"$",
"seen",
")",
"{",
"$",
"seen",
"->",
"append",
"(",
"$",
"rootNode",
")",
";",
"foreach",
"(",
"$",
"rootNode",
"->... | Inner recursive function.
@param DependencyNode $rootNode
@param ArrayObject|DependencyNode[] $resolved
@param ArrayObject|DependencyNode[] $seen
@return ArrayObject|DependencyNode[]
@throws \Exception | [
"Inner",
"recursive",
"function",
"."
] | dd77f1a81c81d921c135b3c775fed054d4dbd5d2 | https://github.com/digilist/dependency-graph/blob/dd77f1a81c81d921c135b3c775fed054d4dbd5d2/src/DependencyGraph.php#L137-L153 |
231,469 | davin-bao/workflow | src/DavinBao/Workflow/WorkflowResourceflow.php | WorkFlowResourceflow.goFirst | public function goFirst(){
//delete others unAndit nodes
$this->deleteAllUnAuditResourceNodes();
//get first user id, if haven't , point to me
$userId = static::$app['auth']->user()->id;
$resNode = $this->resourcenodes()->where('orders', '=', 0)->get()->first();
if($resNode && $resNode->count() ... | php | public function goFirst(){
//delete others unAndit nodes
$this->deleteAllUnAuditResourceNodes();
//get first user id, if haven't , point to me
$userId = static::$app['auth']->user()->id;
$resNode = $this->resourcenodes()->where('orders', '=', 0)->get()->first();
if($resNode && $resNode->count() ... | [
"public",
"function",
"goFirst",
"(",
")",
"{",
"//delete others unAndit nodes",
"$",
"this",
"->",
"deleteAllUnAuditResourceNodes",
"(",
")",
";",
"//get first user id, if haven't , point to me",
"$",
"userId",
"=",
"static",
"::",
"$",
"app",
"[",
"'auth'",
"]",
"... | return this flow to first | [
"return",
"this",
"flow",
"to",
"first"
] | 8af8b33ef63e455a2a5a1cdf6ac7bc154d590488 | https://github.com/davin-bao/workflow/blob/8af8b33ef63e455a2a5a1cdf6ac7bc154d590488/src/DavinBao/Workflow/WorkflowResourceflow.php#L198-L215 |
231,470 | davin-bao/workflow | src/DavinBao/Workflow/WorkflowResourceflow.php | WorkFlowResourceflow.goNext | public function goNext(){
$currentOrder = $this->node_orders;
$nextNodeOrder = $currentOrder + 1;
$status = 'proceed';
$maxOrder = $this->flow()->first()->nodes()->count();
if($nextNodeOrder > $maxOrder){
$status = 'completed';
$nextNodeOrder = $maxOrder+1;
}
$this->node_orders ... | php | public function goNext(){
$currentOrder = $this->node_orders;
$nextNodeOrder = $currentOrder + 1;
$status = 'proceed';
$maxOrder = $this->flow()->first()->nodes()->count();
if($nextNodeOrder > $maxOrder){
$status = 'completed';
$nextNodeOrder = $maxOrder+1;
}
$this->node_orders ... | [
"public",
"function",
"goNext",
"(",
")",
"{",
"$",
"currentOrder",
"=",
"$",
"this",
"->",
"node_orders",
";",
"$",
"nextNodeOrder",
"=",
"$",
"currentOrder",
"+",
"1",
";",
"$",
"status",
"=",
"'proceed'",
";",
"$",
"maxOrder",
"=",
"$",
"this",
"->"... | go to next node
@param $nextAuditUsers | [
"go",
"to",
"next",
"node"
] | 8af8b33ef63e455a2a5a1cdf6ac7bc154d590488 | https://github.com/davin-bao/workflow/blob/8af8b33ef63e455a2a5a1cdf6ac7bc154d590488/src/DavinBao/Workflow/WorkflowResourceflow.php#L221-L235 |
231,471 | PaymentSuite/paymentsuite | src/PaymentSuite/PaylandsBundle/Services/PaylandsManager.php | PaylandsManager.processPayment | public function processPayment(PaylandsMethod $paymentMethod)
{
/*
* At this point, order must be created given a cart, and placed in PaymentBridge.
*
* So, $this->paymentBridge->getOrder() must return an object
*/
$this
->paymentEventDispatcher
... | php | public function processPayment(PaylandsMethod $paymentMethod)
{
/*
* At this point, order must be created given a cart, and placed in PaymentBridge.
*
* So, $this->paymentBridge->getOrder() must return an object
*/
$this
->paymentEventDispatcher
... | [
"public",
"function",
"processPayment",
"(",
"PaylandsMethod",
"$",
"paymentMethod",
")",
"{",
"/*\n * At this point, order must be created given a cart, and placed in PaymentBridge.\n *\n * So, $this->paymentBridge->getOrder() must return an object\n */",
"$",
... | Tries to process a payment through Paylands.
@param PaylandsMethod $paymentMethod Payment method
@return PaylandsManager Self object
@throws PaymentException
@throws CardInvalidException | [
"Tries",
"to",
"process",
"a",
"payment",
"through",
"Paylands",
"."
] | 8ae57df57fa07aff7e59701a0b3c83c504095b92 | https://github.com/PaymentSuite/paymentsuite/blob/8ae57df57fa07aff7e59701a0b3c83c504095b92/src/PaymentSuite/PaylandsBundle/Services/PaylandsManager.php#L89-L178 |
231,472 | juliushaertl/phpdoc-to-rst | src/Builder/NamespaceIndexBuilder.php | NamespaceIndexBuilder.findChildNamespaces | private function findChildNamespaces() {
$currentNamespaceFqsen = (string)$this->currentNamespace->getFqsen();
/** @var Namespace_ $namespace */
foreach ($this->namespaces as $namespace) {
// check if not root and doesn't start with current namespace
if ($currentNamespace... | php | private function findChildNamespaces() {
$currentNamespaceFqsen = (string)$this->currentNamespace->getFqsen();
/** @var Namespace_ $namespace */
foreach ($this->namespaces as $namespace) {
// check if not root and doesn't start with current namespace
if ($currentNamespace... | [
"private",
"function",
"findChildNamespaces",
"(",
")",
"{",
"$",
"currentNamespaceFqsen",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"currentNamespace",
"->",
"getFqsen",
"(",
")",
";",
"/** @var Namespace_ $namespace */",
"foreach",
"(",
"$",
"this",
"->",
"n... | Find child namespaces for current namespace | [
"Find",
"child",
"namespaces",
"for",
"current",
"namespace"
] | 9a695417d1f3bb709f60cd5c519e46f1ad08c843 | https://github.com/juliushaertl/phpdoc-to-rst/blob/9a695417d1f3bb709f60cd5c519e46f1ad08c843/src/Builder/NamespaceIndexBuilder.php#L76-L92 |
231,473 | coduo/TuTu | src/Coduo/TuTu/Kernel.php | Kernel.getValue | private function getValue($value)
{
if (!is_string($value)) {
return $value;
}
if ($value[0] != '%' || $value[strlen($value) - 1] != '%') {
return $value;
}
$parameter = trim($value, '%');
if ($this->container->hasParameter($parameter)) {
... | php | private function getValue($value)
{
if (!is_string($value)) {
return $value;
}
if ($value[0] != '%' || $value[strlen($value) - 1] != '%') {
return $value;
}
$parameter = trim($value, '%');
if ($this->container->hasParameter($parameter)) {
... | [
"private",
"function",
"getValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(",
"$",
"value",
"[",
"0",
"]",
"!=",
"'%'",
"||",
"$",
"value",
"[",
"strl... | If value is valid string between "%" characters then it might be a parameter
so we need to try take it from container.
@param $value
@return mixed | [
"If",
"value",
"is",
"valid",
"string",
"between",
"%",
"characters",
"then",
"it",
"might",
"be",
"a",
"parameter",
"so",
"we",
"need",
"to",
"try",
"take",
"it",
"from",
"container",
"."
] | 4e5f38ec5ffd0e17c5439c7e12c46d0311b76fdc | https://github.com/coduo/TuTu/blob/4e5f38ec5ffd0e17c5439c7e12c46d0311b76fdc/src/Coduo/TuTu/Kernel.php#L337-L353 |
231,474 | niklongstone/regex-reverse | src/RegRev/Metacharacter/Range/Range.php | Range.generateNegation | private function generateNegation($match)
{
$match = str_split($match);
$chars = str_split($this->getChars());
foreach ($match as $negVal) {
if (($key = array_search($negVal, $chars)) !== false) {
if ($negVal == '\\') {
continue;
... | php | private function generateNegation($match)
{
$match = str_split($match);
$chars = str_split($this->getChars());
foreach ($match as $negVal) {
if (($key = array_search($negVal, $chars)) !== false) {
if ($negVal == '\\') {
continue;
... | [
"private",
"function",
"generateNegation",
"(",
"$",
"match",
")",
"{",
"$",
"match",
"=",
"str_split",
"(",
"$",
"match",
")",
";",
"$",
"chars",
"=",
"str_split",
"(",
"$",
"this",
"->",
"getChars",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"match",... | Removes the negated character from the available chars list.
@param string $match
@return string | [
"Removes",
"the",
"negated",
"character",
"from",
"the",
"available",
"chars",
"list",
"."
] | a93bb266fbc0621094a5d1ad2583b8a54999ea25 | https://github.com/niklongstone/regex-reverse/blob/a93bb266fbc0621094a5d1ad2583b8a54999ea25/src/RegRev/Metacharacter/Range/Range.php#L111-L125 |
231,475 | niklongstone/regex-reverse | src/RegRev/Metacharacter/Range/Range.php | Range.createRange | private function createRange($ranges)
{
$rangeOfString = '';
foreach ($ranges as $range) {
$rangeOfString .= implode('', range($range[0], $range[2]));
}
return $rangeOfString;
} | php | private function createRange($ranges)
{
$rangeOfString = '';
foreach ($ranges as $range) {
$rangeOfString .= implode('', range($range[0], $range[2]));
}
return $rangeOfString;
} | [
"private",
"function",
"createRange",
"(",
"$",
"ranges",
")",
"{",
"$",
"rangeOfString",
"=",
"''",
";",
"foreach",
"(",
"$",
"ranges",
"as",
"$",
"range",
")",
"{",
"$",
"rangeOfString",
".=",
"implode",
"(",
"''",
",",
"range",
"(",
"$",
"range",
... | Creates the characters ranges.
@param array $ranges
@return string | [
"Creates",
"the",
"characters",
"ranges",
"."
] | a93bb266fbc0621094a5d1ad2583b8a54999ea25 | https://github.com/niklongstone/regex-reverse/blob/a93bb266fbc0621094a5d1ad2583b8a54999ea25/src/RegRev/Metacharacter/Range/Range.php#L134-L142 |
231,476 | colorfield/mastodon-api-php | src/MastodonAPI.php | MastodonAPI.getResponse | private function getResponse($endpoint, $operation, array $json)
{
$result = null;
$uri = $this->config->getBaseUrl() . '/api/';
$uri .= ConfigurationVO::API_VERSION . $endpoint;
$allowedOperations = ['get', 'post'];
if(!in_array($operation, $allowedOperations)) {
... | php | private function getResponse($endpoint, $operation, array $json)
{
$result = null;
$uri = $this->config->getBaseUrl() . '/api/';
$uri .= ConfigurationVO::API_VERSION . $endpoint;
$allowedOperations = ['get', 'post'];
if(!in_array($operation, $allowedOperations)) {
... | [
"private",
"function",
"getResponse",
"(",
"$",
"endpoint",
",",
"$",
"operation",
",",
"array",
"$",
"json",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"uri",
"=",
"$",
"this",
"->",
"config",
"->",
"getBaseUrl",
"(",
")",
".",
"'/api/'",
";",
... | Request to an endpoint.
@param $endpoint
@param array $json
@return mixed|null | [
"Request",
"to",
"an",
"endpoint",
"."
] | cd9cb946032508e48630fffd5a661f3347d0b84f | https://github.com/colorfield/mastodon-api-php/blob/cd9cb946032508e48630fffd5a661f3347d0b84f/src/MastodonAPI.php#L55-L86 |
231,477 | schemaio/schema-php-client | lib/Cache.php | Cache.get_path | public function get_path()
{
$cache_path = rtrim($this->params['path'], '/')
.'/client'.'.'.$this->params['client_id'];
foreach (func_get_args() as $arg) {
$cache_path .= '.'.$arg;
}
return $cache_path;
} | php | public function get_path()
{
$cache_path = rtrim($this->params['path'], '/')
.'/client'.'.'.$this->params['client_id'];
foreach (func_get_args() as $arg) {
$cache_path .= '.'.$arg;
}
return $cache_path;
} | [
"public",
"function",
"get_path",
"(",
")",
"{",
"$",
"cache_path",
"=",
"rtrim",
"(",
"$",
"this",
"->",
"params",
"[",
"'path'",
"]",
",",
"'/'",
")",
".",
"'/client'",
".",
"'.'",
".",
"$",
"this",
"->",
"params",
"[",
"'client_id'",
"]",
";",
"... | Get path to a cache file
@return string | [
"Get",
"path",
"to",
"a",
"cache",
"file"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L107-L117 |
231,478 | schemaio/schema-php-client | lib/Cache.php | Cache.get_versions | public function get_versions()
{
if (!$this->versions) {
$this->versions = array();
if ($json = $this->get_cache('versions')) {
$this->versions = json_decode($json, true);
}
}
return $this->versions;
} | php | public function get_versions()
{
if (!$this->versions) {
$this->versions = array();
if ($json = $this->get_cache('versions')) {
$this->versions = json_decode($json, true);
}
}
return $this->versions;
} | [
"public",
"function",
"get_versions",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"versions",
")",
"{",
"$",
"this",
"->",
"versions",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"json",
"=",
"$",
"this",
"->",
"get_cache",
"(",
"'versions'"... | Get cache version info
@return array | [
"Get",
"cache",
"version",
"info"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L124-L134 |
231,479 | schemaio/schema-php-client | lib/Cache.php | Cache.get_index | public function get_index()
{
if (!$this->indexes) {
$this->indexes = array();
if ($json = $this->get_cache('index')) {
$this->indexes = json_decode($json, true);
}
}
return $this->indexes;
} | php | public function get_index()
{
if (!$this->indexes) {
$this->indexes = array();
if ($json = $this->get_cache('index')) {
$this->indexes = json_decode($json, true);
}
}
return $this->indexes;
} | [
"public",
"function",
"get_index",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"indexes",
")",
"{",
"$",
"this",
"->",
"indexes",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"json",
"=",
"$",
"this",
"->",
"get_cache",
"(",
"'index'",
")",... | Get cache index info
@return array | [
"Get",
"cache",
"index",
"info"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L141-L151 |
231,480 | schemaio/schema-php-client | lib/Cache.php | Cache.put | public function put($url, $data, $result)
{
if (!array_key_exists('$data', $result)) {
$result['$data'] = null; // Allows for null response
}
$this->get_versions();
$cache_content = $result;
$cache_content['$cached'] = true;
$cache_key = $this->get_key(... | php | public function put($url, $data, $result)
{
if (!array_key_exists('$data', $result)) {
$result['$data'] = null; // Allows for null response
}
$this->get_versions();
$cache_content = $result;
$cache_content['$cached'] = true;
$cache_key = $this->get_key(... | [
"public",
"function",
"put",
"(",
"$",
"url",
",",
"$",
"data",
",",
"$",
"result",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'$data'",
",",
"$",
"result",
")",
")",
"{",
"$",
"result",
"[",
"'$data'",
"]",
"=",
"null",
";",
"// Allows fo... | Put cache result in file system cache atomicly
@param string $url
@param mixed $data
@param mixed $result
@return void | [
"Put",
"cache",
"result",
"in",
"file",
"system",
"cache",
"atomicly"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L161-L189 |
231,481 | schemaio/schema-php-client | lib/Cache.php | Cache.remove | public function remove($url, $data = null)
{
$cache_key = $this->get_key($url, $data);
$cache_path = $this->get_path($cache_key, 'result');
$this->clear_cache($cache_path);
} | php | public function remove($url, $data = null)
{
$cache_key = $this->get_key($url, $data);
$cache_path = $this->get_path($cache_key, 'result');
$this->clear_cache($cache_path);
} | [
"public",
"function",
"remove",
"(",
"$",
"url",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"cache_key",
"=",
"$",
"this",
"->",
"get_key",
"(",
"$",
"url",
",",
"$",
"data",
")",
";",
"$",
"cache_path",
"=",
"$",
"this",
"->",
"get_path",
"("... | Remove an entry from cache base on url and data
This is mostly used for caching variables as opposed to client results
@param string $url
@param mixed $data
@return void | [
"Remove",
"an",
"entry",
"from",
"cache",
"base",
"on",
"url",
"and",
"data",
"This",
"is",
"mostly",
"used",
"for",
"caching",
"variables",
"as",
"opposed",
"to",
"client",
"results"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L224-L229 |
231,482 | schemaio/schema-php-client | lib/Cache.php | Cache.clear | public function clear($result)
{
$invalid = array();
$this->get_versions();
if (isset($result['$cached'])) {
foreach ((array)$result['$cached'] as $collection => $ver) {
if (!isset($this->versions[$collection]) || $ver != $this->versions[$collection]) {
... | php | public function clear($result)
{
$invalid = array();
$this->get_versions();
if (isset($result['$cached'])) {
foreach ((array)$result['$cached'] as $collection => $ver) {
if (!isset($this->versions[$collection]) || $ver != $this->versions[$collection]) {
... | [
"public",
"function",
"clear",
"(",
"$",
"result",
")",
"{",
"$",
"invalid",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"get_versions",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"result",
"[",
"'$cached'",
"]",
")",
")",
"{",
"foreach",
"... | Clear all cache entries made invalid by result
@param string $url
@param mixed $data
@param mixed $result
@return void | [
"Clear",
"all",
"cache",
"entries",
"made",
"invalid",
"by",
"result"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L274-L299 |
231,483 | schemaio/schema-php-client | lib/Cache.php | Cache.clear_indexes | public function clear_indexes($invalid)
{
if (empty($invalid)) {
return;
}
$this->get_index();
foreach ($invalid as $collection => $key) {
// Clear all indexes per collection
if (isset($this->indexes[$collection])) {
if ($key === tr... | php | public function clear_indexes($invalid)
{
if (empty($invalid)) {
return;
}
$this->get_index();
foreach ($invalid as $collection => $key) {
// Clear all indexes per collection
if (isset($this->indexes[$collection])) {
if ($key === tr... | [
"public",
"function",
"clear_indexes",
"(",
"$",
"invalid",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"invalid",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"get_index",
"(",
")",
";",
"foreach",
"(",
"$",
"invalid",
"as",
"$",
"collection",
... | Clear cache index for a certain collection
@param array $invalid
@return void | [
"Clear",
"cache",
"index",
"for",
"a",
"certain",
"collection"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L307-L333 |
231,484 | schemaio/schema-php-client | lib/Cache.php | Cache.get_cache | public function get_cache()
{
$args = func_get_args();
$cache_path = call_user_func_array(array($this, 'get_path'), $args);
if (is_file($cache_path)) {
return file_get_contents($cache_path);
}
return null;
} | php | public function get_cache()
{
$args = func_get_args();
$cache_path = call_user_func_array(array($this, 'get_path'), $args);
if (is_file($cache_path)) {
return file_get_contents($cache_path);
}
return null;
} | [
"public",
"function",
"get_cache",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"cache_path",
"=",
"call_user_func_array",
"(",
"array",
"(",
"$",
"this",
",",
"'get_path'",
")",
",",
"$",
"args",
")",
";",
"if",
"(",
"is_file"... | Get cache content
@return string | [
"Get",
"cache",
"content"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L340-L349 |
231,485 | schemaio/schema-php-client | lib/Cache.php | Cache.write_cache | public function write_cache($cache_path, $content)
{
$cache_content = json_encode($content);
$cache_size = strlen($cache_content);
$temp = tempnam($this->params['path'], 'temp');
if (!($f = @fopen($temp, 'wb'))) {
$temp = $this->params['path'].'/'.uniqid('temp');
... | php | public function write_cache($cache_path, $content)
{
$cache_content = json_encode($content);
$cache_size = strlen($cache_content);
$temp = tempnam($this->params['path'], 'temp');
if (!($f = @fopen($temp, 'wb'))) {
$temp = $this->params['path'].'/'.uniqid('temp');
... | [
"public",
"function",
"write_cache",
"(",
"$",
"cache_path",
",",
"$",
"content",
")",
"{",
"$",
"cache_content",
"=",
"json_encode",
"(",
"$",
"content",
")",
";",
"$",
"cache_size",
"=",
"strlen",
"(",
"$",
"cache_content",
")",
";",
"$",
"temp",
"=",
... | Write to cache atomically
@param string $cache_path
@param mixed $content
@return int | [
"Write",
"to",
"cache",
"atomically"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L358-L382 |
231,486 | schemaio/schema-php-client | lib/Cache.php | Cache.result_collections | public function result_collections($result)
{
// Combine $collection and $expanded headers
$collections = isset($result['$collection'])
? array($result['$collection'])
: array();
if (isset($result['$expanded'])) {
foreach ($result['$expanded'] as $expande... | php | public function result_collections($result)
{
// Combine $collection and $expanded headers
$collections = isset($result['$collection'])
? array($result['$collection'])
: array();
if (isset($result['$expanded'])) {
foreach ($result['$expanded'] as $expande... | [
"public",
"function",
"result_collections",
"(",
"$",
"result",
")",
"{",
"// Combine $collection and $expanded headers",
"$",
"collections",
"=",
"isset",
"(",
"$",
"result",
"[",
"'$collection'",
"]",
")",
"?",
"array",
"(",
"$",
"result",
"[",
"'$collection'",
... | Get array of collections affected by a result
@param array $result
@return array | [
"Get",
"array",
"of",
"collections",
"affected",
"by",
"a",
"result"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Cache.php#L401-L415 |
231,487 | schemaio/schema-php-client | lib/Client.php | Client.params | public function params($merge = null)
{
if (is_array($merge)) {
$this->params = array_merge($this->params, $merge);
} else if (is_string($key = $merge)) {
return $this->params[$key];
} else {
return $this->params;
}
} | php | public function params($merge = null)
{
if (is_array($merge)) {
$this->params = array_merge($this->params, $merge);
} else if (is_string($key = $merge)) {
return $this->params[$key];
} else {
return $this->params;
}
} | [
"public",
"function",
"params",
"(",
"$",
"merge",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"merge",
")",
")",
"{",
"$",
"this",
"->",
"params",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"params",
",",
"$",
"merge",
")",
";",
"}"... | Get or set client params
@param mixed $merge
@param array | [
"Get",
"or",
"set",
"client",
"params"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Client.php#L126-L135 |
231,488 | schemaio/schema-php-client | lib/Client.php | Client.request_rescue | protected function request_rescue($e)
{
if ($this->params['rescue']
&& $this->params['client_id']
&& $this->params['client_key']) {
if ($this->params['rescued']) {
throw $e; // Prevent recursion
} else {
$this->params(array('rescued'... | php | protected function request_rescue($e)
{
if ($this->params['rescue']
&& $this->params['client_id']
&& $this->params['client_key']) {
if ($this->params['rescued']) {
throw $e; // Prevent recursion
} else {
$this->params(array('rescued'... | [
"protected",
"function",
"request_rescue",
"(",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"params",
"[",
"'rescue'",
"]",
"&&",
"$",
"this",
"->",
"params",
"[",
"'client_id'",
"]",
"&&",
"$",
"this",
"->",
"params",
"[",
"'client_key'",
"]",
... | Request from a rescue server
@param Exception
@return void | [
"Request",
"from",
"a",
"rescue",
"server"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Client.php#L203-L221 |
231,489 | schemaio/schema-php-client | lib/Client.php | Client.request_proxy_data | protected function request_proxy_data($data)
{
if (isset($this->params['rescued'])) {
return $data;
}
$data['$proxy'] = array(
'client' => isset($this->params['route']['client'])
? $this->params['route']['client']
: $this->params['clie... | php | protected function request_proxy_data($data)
{
if (isset($this->params['rescued'])) {
return $data;
}
$data['$proxy'] = array(
'client' => isset($this->params['route']['client'])
? $this->params['route']['client']
: $this->params['clie... | [
"protected",
"function",
"request_proxy_data",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"params",
"[",
"'rescued'",
"]",
")",
")",
"{",
"return",
"$",
"data",
";",
"}",
"$",
"data",
"[",
"'$proxy'",
"]",
"=",
"array",
... | Modify request to pass through an API proxy
@param array $data
@return array | [
"Modify",
"request",
"to",
"pass",
"through",
"an",
"API",
"proxy"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Client.php#L229-L252 |
231,490 | schemaio/schema-php-client | lib/Client.php | Client.response_data | protected function response_data($result, $method, $url)
{
if (isset($result['$data'])) {
if (is_array($result['$data'])) {
return Resource::instance($result, $this);
}
return $result['$data'];
}
return null;
} | php | protected function response_data($result, $method, $url)
{
if (isset($result['$data'])) {
if (is_array($result['$data'])) {
return Resource::instance($result, $this);
}
return $result['$data'];
}
return null;
} | [
"protected",
"function",
"response_data",
"(",
"$",
"result",
",",
"$",
"method",
",",
"$",
"url",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"result",
"[",
"'$data'",
"]",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"result",
"[",
"'$data'",
"]",... | Instantiate resource for response data if applicable
@param array $result
@return mixed | [
"Instantiate",
"resource",
"for",
"response",
"data",
"if",
"applicable"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Client.php#L284-L293 |
231,491 | schemaio/schema-php-client | lib/Client.php | Client.get | public function get($url, $data = null)
{
if ($this->cache) {
$result = $this->cache->get($url, array('$data' => $data));
if (array_key_exists('$data', (array)$result)) {
return $this->response_data($result, 'get', $url);
}
}
return $this-... | php | public function get($url, $data = null)
{
if ($this->cache) {
$result = $this->cache->get($url, array('$data' => $data));
if (array_key_exists('$data', (array)$result)) {
return $this->response_data($result, 'get', $url);
}
}
return $this-... | [
"public",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cache",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"cache",
"->",
"get",
"(",
"$",
"url",
",",
"array",
"(",
"'$data'",
... | Call GET method
@param string $url
@param mixed $data
@return mixed | [
"Call",
"GET",
"method"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Client.php#L302-L312 |
231,492 | schemaio/schema-php-client | lib/Client.php | Client.put | public function put($url, $data = '$undefined')
{
if ($data === '$undefined') {
$data = ($url instanceof Resource)
? $url->data()
: null;
}
return $this->request('put', $url, $data);
} | php | public function put($url, $data = '$undefined')
{
if ($data === '$undefined') {
$data = ($url instanceof Resource)
? $url->data()
: null;
}
return $this->request('put', $url, $data);
} | [
"public",
"function",
"put",
"(",
"$",
"url",
",",
"$",
"data",
"=",
"'$undefined'",
")",
"{",
"if",
"(",
"$",
"data",
"===",
"'$undefined'",
")",
"{",
"$",
"data",
"=",
"(",
"$",
"url",
"instanceof",
"Resource",
")",
"?",
"$",
"url",
"->",
"data",... | Call PUT method
@param string $url
@param mixed $data
@return mixed | [
"Call",
"PUT",
"method"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Client.php#L321-L329 |
231,493 | schemaio/schema-php-client | lib/Client.php | Client.auth | public function auth($nonce = null, $params = null)
{
$params = $params ?: array();
$client_id = $this->params['client_id'];
$client_key = $this->params['client_key'];
// 1) Get nonce
$nonce = $nonce ?: $this->server->request('auth');
// 2) Create key hash
... | php | public function auth($nonce = null, $params = null)
{
$params = $params ?: array();
$client_id = $this->params['client_id'];
$client_key = $this->params['client_key'];
// 1) Get nonce
$nonce = $nonce ?: $this->server->request('auth');
// 2) Create key hash
... | [
"public",
"function",
"auth",
"(",
"$",
"nonce",
"=",
"null",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"params",
"=",
"$",
"params",
"?",
":",
"array",
"(",
")",
";",
"$",
"client_id",
"=",
"$",
"this",
"->",
"params",
"[",
"'client_id'",
... | Call AUTH method
@param string $nonce
@param array $params
@return mixed | [
"Call",
"AUTH",
"method"
] | 20759434a6dd7fcc38910eca5ad228287472751b | https://github.com/schemaio/schema-php-client/blob/20759434a6dd7fcc38910eca5ad228287472751b/lib/Client.php#L362-L409 |
231,494 | colorfield/mastodon-api-php | src/MastodonOAuth.php | MastodonOAuth.getResponse | private function getResponse($endpoint, array $json)
{
$result = null;
// endpoint
$uri = $this->config->getBaseUrl() . $endpoint;
try {
$response = $this->client->post(
$uri, [
'json' => $json,
]
);
... | php | private function getResponse($endpoint, array $json)
{
$result = null;
// endpoint
$uri = $this->config->getBaseUrl() . $endpoint;
try {
$response = $this->client->post(
$uri, [
'json' => $json,
]
);
... | [
"private",
"function",
"getResponse",
"(",
"$",
"endpoint",
",",
"array",
"$",
"json",
")",
"{",
"$",
"result",
"=",
"null",
";",
"// endpoint",
"$",
"uri",
"=",
"$",
"this",
"->",
"config",
"->",
"getBaseUrl",
"(",
")",
".",
"$",
"endpoint",
";",
"t... | Get response from the endpoint.
@param $endpoint
@param array $json
@return mixed|null | [
"Get",
"response",
"from",
"the",
"endpoint",
"."
] | cd9cb946032508e48630fffd5a661f3347d0b84f | https://github.com/colorfield/mastodon-api-php/blob/cd9cb946032508e48630fffd5a661f3347d0b84f/src/MastodonOAuth.php#L47-L69 |
231,495 | colorfield/mastodon-api-php | src/MastodonOAuth.php | MastodonOAuth.registerApplication | public function registerApplication()
{
$options = $this->config->getAppConfiguration();
$credentials = $this->getResponse(
'/api/'.ConfigurationVO::API_VERSION.'/apps',
$options
);
if (isset($credentials["client_id"])
&& isset($credentials["clien... | php | public function registerApplication()
{
$options = $this->config->getAppConfiguration();
$credentials = $this->getResponse(
'/api/'.ConfigurationVO::API_VERSION.'/apps',
$options
);
if (isset($credentials["client_id"])
&& isset($credentials["clien... | [
"public",
"function",
"registerApplication",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"config",
"->",
"getAppConfiguration",
"(",
")",
";",
"$",
"credentials",
"=",
"$",
"this",
"->",
"getResponse",
"(",
"'/api/'",
".",
"ConfigurationVO",
"::",... | Register the Mastodon application.
Appends client_id and client_secret tp the configuration value object. | [
"Register",
"the",
"Mastodon",
"application",
"."
] | cd9cb946032508e48630fffd5a661f3347d0b84f | https://github.com/colorfield/mastodon-api-php/blob/cd9cb946032508e48630fffd5a661f3347d0b84f/src/MastodonOAuth.php#L76-L91 |
231,496 | colorfield/mastodon-api-php | src/MastodonOAuth.php | MastodonOAuth.getAuthorizationUrl | public function getAuthorizationUrl()
{
$result = null;
if (!$this->config->hasCredentials()) {
$this->registerApplication();
}
//Return the Authorization URL
return "https://{$this->config->getMastodonInstance()}/oauth/authorize/?".http_build_query(
... | php | public function getAuthorizationUrl()
{
$result = null;
if (!$this->config->hasCredentials()) {
$this->registerApplication();
}
//Return the Authorization URL
return "https://{$this->config->getMastodonInstance()}/oauth/authorize/?".http_build_query(
... | [
"public",
"function",
"getAuthorizationUrl",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"config",
"->",
"hasCredentials",
"(",
")",
")",
"{",
"$",
"this",
"->",
"registerApplication",
"(",
")",
";",
"}",
"//Retur... | Returns the authorization URL that will provide the authorization code"
after manual approval.
@return string | [
"Returns",
"the",
"authorization",
"URL",
"that",
"will",
"provide",
"the",
"authorization",
"code",
"after",
"manual",
"approval",
"."
] | cd9cb946032508e48630fffd5a661f3347d0b84f | https://github.com/colorfield/mastodon-api-php/blob/cd9cb946032508e48630fffd5a661f3347d0b84f/src/MastodonOAuth.php#L99-L115 |
231,497 | colorfield/mastodon-api-php | src/MastodonOAuth.php | MastodonOAuth.getAccessToken | public function getAccessToken()
{
$result = null;
$options = $this->config->getAccessTokenConfiguration();
$token = $this->getResponse('/oauth/token', $options);
if (isset($token['access_token'])) {
$this->config->setBearer($token['access_token']);
}else {
... | php | public function getAccessToken()
{
$result = null;
$options = $this->config->getAccessTokenConfiguration();
$token = $this->getResponse('/oauth/token', $options);
if (isset($token['access_token'])) {
$this->config->setBearer($token['access_token']);
}else {
... | [
"public",
"function",
"getAccessToken",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"config",
"->",
"getAccessTokenConfiguration",
"(",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"getResponse",
"(",
"'/oau... | Gets the access token.
As a side effect, stores it into the Configuration as bearer. | [
"Gets",
"the",
"access",
"token",
".",
"As",
"a",
"side",
"effect",
"stores",
"it",
"into",
"the",
"Configuration",
"as",
"bearer",
"."
] | cd9cb946032508e48630fffd5a661f3347d0b84f | https://github.com/colorfield/mastodon-api-php/blob/cd9cb946032508e48630fffd5a661f3347d0b84f/src/MastodonOAuth.php#L121-L131 |
231,498 | opensoft/epl | src/Epl/CommandHelper.php | CommandHelper.asciiText | public function asciiText($horizontalStartPosition, $verticalStartPosition, $rotation, $fontSelection,
$horizontalMultiplier, $verticalMultiplier, $reverseImage, $data, $convertRotation = true,
$asianFont = false)
{
$command = new Command\Image\Asc... | php | public function asciiText($horizontalStartPosition, $verticalStartPosition, $rotation, $fontSelection,
$horizontalMultiplier, $verticalMultiplier, $reverseImage, $data, $convertRotation = true,
$asianFont = false)
{
$command = new Command\Image\Asc... | [
"public",
"function",
"asciiText",
"(",
"$",
"horizontalStartPosition",
",",
"$",
"verticalStartPosition",
",",
"$",
"rotation",
",",
"$",
"fontSelection",
",",
"$",
"horizontalMultiplier",
",",
"$",
"verticalMultiplier",
",",
"$",
"reverseImage",
",",
"$",
"data"... | Renders an ASCII text string to the image print buffer.
@param int $horizontalStartPosition
@param int $verticalStartPosition
@param int $rotation
@param int $fontSelection
@param int $horizontalMultiplier
@param int $verticalMultiplier
@param bool $reverseImage
@param string $data
@param bool $convertRotation
@param b... | [
"Renders",
"an",
"ASCII",
"text",
"string",
"to",
"the",
"image",
"print",
"buffer",
"."
] | 61a1152ed3e292d5bd3ec2758076d605bada0623 | https://github.com/opensoft/epl/blob/61a1152ed3e292d5bd3ec2758076d605bada0623/src/Epl/CommandHelper.php#L51-L60 |
231,499 | opensoft/epl | src/Epl/CommandHelper.php | CommandHelper.barCode | public function barCode($horizontalStartPosition, $verticalStartPosition, $rotation, $barCodeSelection,
$narrowBarWidth, $wideBarWidth, $barCodeHeight, $printHumanReadable, $data, $convertRotation = true)
{
$command = new Command\Image\BarCodeCommand($horizontalStartPosition, $ve... | php | public function barCode($horizontalStartPosition, $verticalStartPosition, $rotation, $barCodeSelection,
$narrowBarWidth, $wideBarWidth, $barCodeHeight, $printHumanReadable, $data, $convertRotation = true)
{
$command = new Command\Image\BarCodeCommand($horizontalStartPosition, $ve... | [
"public",
"function",
"barCode",
"(",
"$",
"horizontalStartPosition",
",",
"$",
"verticalStartPosition",
",",
"$",
"rotation",
",",
"$",
"barCodeSelection",
",",
"$",
"narrowBarWidth",
",",
"$",
"wideBarWidth",
",",
"$",
"barCodeHeight",
",",
"$",
"printHumanReada... | Use this command to print standard bar codes
@param int $horizontalStartPosition
@param int $verticalStartPosition
@param int $rotation
@param string $barCodeSelection
@param int $narrowBarWidth
@param int $wideBarWidth
@param int $barCodeHeight
@param bool $printHumanReadable
@param string $data
@param bool $convertRo... | [
"Use",
"this",
"command",
"to",
"print",
"standard",
"bar",
"codes"
] | 61a1152ed3e292d5bd3ec2758076d605bada0623 | https://github.com/opensoft/epl/blob/61a1152ed3e292d5bd3ec2758076d605bada0623/src/Epl/CommandHelper.php#L79-L87 |
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.