id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
224,300 | logical-and/php-oauth | src/UserData/Arguments/LoadersMap.php | LoadersMap.removeField | public function removeField($field)
{
$this->checkValidLoader();
if (in_array($field, $this->loaders[ $this->contextLoader ])) {
array_splice(
$this->loaders[ $this->contextLoader ],
array_search($field, $this->loaders[ $this->contextLoader ])
... | php | public function removeField($field)
{
$this->checkValidLoader();
if (in_array($field, $this->loaders[ $this->contextLoader ])) {
array_splice(
$this->loaders[ $this->contextLoader ],
array_search($field, $this->loaders[ $this->contextLoader ])
... | [
"public",
"function",
"removeField",
"(",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"checkValidLoader",
"(",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"field",
",",
"$",
"this",
"->",
"loaders",
"[",
"$",
"this",
"->",
"contextLoader",
"]",
")",
")... | Remove field from context loader
@param string $field
@return $this | [
"Remove",
"field",
"from",
"context",
"loader"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/LoadersMap.php#L131-L143 |
224,301 | logical-and/php-oauth | src/UserData/Arguments/LoadersMap.php | LoadersMap.readdField | public function readdField($field)
{
$this->checkValidLoader();
foreach ($this->loaders as $loader => $fields) {
if (in_array($field, $this->loaders[ $loader ])) {
array_splice($this->loaders[ $loader ], array_search($field, $this->loaders[ $loader ]), 1);
}
... | php | public function readdField($field)
{
$this->checkValidLoader();
foreach ($this->loaders as $loader => $fields) {
if (in_array($field, $this->loaders[ $loader ])) {
array_splice($this->loaders[ $loader ], array_search($field, $this->loaders[ $loader ]), 1);
}
... | [
"public",
"function",
"readdField",
"(",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"checkValidLoader",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"loaders",
"as",
"$",
"loader",
"=>",
"$",
"fields",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
... | Add field to context loader and remove field from any other loaders
@param $field
@return $this | [
"Add",
"field",
"to",
"context",
"loader",
"and",
"remove",
"field",
"from",
"any",
"other",
"loaders"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/LoadersMap.php#L168-L181 |
224,302 | logical-and/php-oauth | src/UserData/Arguments/LoadersMap.php | LoadersMap.getLoaderForField | public function getLoaderForField($searchField)
{
foreach ($this->loaders as $loader => $fields) {
if (in_array($searchField, $fields, true)) {
return $loader;
}
}
throw new GenericException("Unable to find loader for field \"$searchField\"");
} | php | public function getLoaderForField($searchField)
{
foreach ($this->loaders as $loader => $fields) {
if (in_array($searchField, $fields, true)) {
return $loader;
}
}
throw new GenericException("Unable to find loader for field \"$searchField\"");
} | [
"public",
"function",
"getLoaderForField",
"(",
"$",
"searchField",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"loaders",
"as",
"$",
"loader",
"=>",
"$",
"fields",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"searchField",
",",
"$",
"fields",
",",
"tr... | Get loader byfield name
@param string $searchField
@return int|string
@throws \OAuth\UserData\Exception\GenericException | [
"Get",
"loader",
"byfield",
"name"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/LoadersMap.php#L207-L216 |
224,303 | oroinc/OroMessageQueueComponent | Job/JobStorage.php | JobStorage.findRootJobByJobNameAndStatuses | public function findRootJobByJobNameAndStatuses($jobName, array $statuses)
{
return $this->createJobQueryBuilder('job')
->where('job.rootJob is NULL and job.name = :jobName and job.status in (:statuses)')
->andWhere('job.interrupted != true')
->setParameter('jobName', $jo... | php | public function findRootJobByJobNameAndStatuses($jobName, array $statuses)
{
return $this->createJobQueryBuilder('job')
->where('job.rootJob is NULL and job.name = :jobName and job.status in (:statuses)')
->andWhere('job.interrupted != true')
->setParameter('jobName', $jo... | [
"public",
"function",
"findRootJobByJobNameAndStatuses",
"(",
"$",
"jobName",
",",
"array",
"$",
"statuses",
")",
"{",
"return",
"$",
"this",
"->",
"createJobQueryBuilder",
"(",
"'job'",
")",
"->",
"where",
"(",
"'job.rootJob is NULL and job.name = :jobName and job.stat... | Finds root non interrupted job by name and given statuses.
@param string $jobName
@param array $statuses
@return Job|null | [
"Finds",
"root",
"non",
"interrupted",
"job",
"by",
"name",
"and",
"given",
"statuses",
"."
] | 6f1fdb12aebcfc6beae074ce492f496ed9847a77 | https://github.com/oroinc/OroMessageQueueComponent/blob/6f1fdb12aebcfc6beae074ce492f496ed9847a77/Job/JobStorage.php#L79-L89 |
224,304 | oroinc/OroMessageQueueComponent | Job/JobStorage.php | JobStorage.getChildJobIdsByRootJobAndStatus | public function getChildJobIdsByRootJobAndStatus(Job $rootJob, $status)
{
$qb = $this->createJobQueryBuilder('job');
$rawChildJobIds = $qb
->select('job.id')
->where(
$qb->expr()->andX(
'job.rootJob = :rootJob',
'job.sta... | php | public function getChildJobIdsByRootJobAndStatus(Job $rootJob, $status)
{
$qb = $this->createJobQueryBuilder('job');
$rawChildJobIds = $qb
->select('job.id')
->where(
$qb->expr()->andX(
'job.rootJob = :rootJob',
'job.sta... | [
"public",
"function",
"getChildJobIdsByRootJobAndStatus",
"(",
"Job",
"$",
"rootJob",
",",
"$",
"status",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createJobQueryBuilder",
"(",
"'job'",
")",
";",
"$",
"rawChildJobIds",
"=",
"$",
"qb",
"->",
"select",
"... | Be warned that
In PGSQL function returns array of ids in DESC order, every id has integer type,
But in MYSQL it will be array of ids in ASC order, every id has string type
@param Job $rootJob
@param string $status
@return array | [
"Be",
"warned",
"that",
"In",
"PGSQL",
"function",
"returns",
"array",
"of",
"ids",
"in",
"DESC",
"order",
"every",
"id",
"has",
"integer",
"type",
"But",
"in",
"MYSQL",
"it",
"will",
"be",
"array",
"of",
"ids",
"in",
"ASC",
"order",
"every",
"id",
"ha... | 6f1fdb12aebcfc6beae074ce492f496ed9847a77 | https://github.com/oroinc/OroMessageQueueComponent/blob/6f1fdb12aebcfc6beae074ce492f496ed9847a77/Job/JobStorage.php#L142-L165 |
224,305 | oroinc/OroMessageQueueComponent | Job/JobStorage.php | JobStorage.resetEntityManager | private function resetEntityManager()
{
$managers = $this->doctrine->getManagers();
foreach ($managers as $name => $manager) {
if (!$manager->getMetadataFactory()->isTransient($this->entityClass)) {
$this->doctrine->resetManager($name);
break;
... | php | private function resetEntityManager()
{
$managers = $this->doctrine->getManagers();
foreach ($managers as $name => $manager) {
if (!$manager->getMetadataFactory()->isTransient($this->entityClass)) {
$this->doctrine->resetManager($name);
break;
... | [
"private",
"function",
"resetEntityManager",
"(",
")",
"{",
"$",
"managers",
"=",
"$",
"this",
"->",
"doctrine",
"->",
"getManagers",
"(",
")",
";",
"foreach",
"(",
"$",
"managers",
"as",
"$",
"name",
"=>",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"... | Replaces the closed entity manager with new instance of entity manager. | [
"Replaces",
"the",
"closed",
"entity",
"manager",
"with",
"new",
"instance",
"of",
"entity",
"manager",
"."
] | 6f1fdb12aebcfc6beae074ce492f496ed9847a77 | https://github.com/oroinc/OroMessageQueueComponent/blob/6f1fdb12aebcfc6beae074ce492f496ed9847a77/Job/JobStorage.php#L303-L312 |
224,306 | A1essandro/perlin-noise-generator | src/PerlinNoiseGenerator.php | PerlinNoiseGenerator.initTerra | protected function initTerra()
{
if (empty($this->mapSeed)) {
$this->setMapSeed(microtime(true));
}
if (!$this->getPersistence()) {
throw new LogicException('Persistence must be set');
}
if (!$this->getSize()) {
throw new LogicException('... | php | protected function initTerra()
{
if (empty($this->mapSeed)) {
$this->setMapSeed(microtime(true));
}
if (!$this->getPersistence()) {
throw new LogicException('Persistence must be set');
}
if (!$this->getSize()) {
throw new LogicException('... | [
"protected",
"function",
"initTerra",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mapSeed",
")",
")",
"{",
"$",
"this",
"->",
"setMapSeed",
"(",
"microtime",
"(",
"true",
")",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"get... | terra array initialization | [
"terra",
"array",
"initialization"
] | dfc97a6ec05572d9a5c7b4c0353df8350554d953 | https://github.com/A1essandro/perlin-noise-generator/blob/dfc97a6ec05572d9a5c7b4c0353df8350554d953/src/PerlinNoiseGenerator.php#L135-L158 |
224,307 | ericmann/sessionz | php/Handlers/DefaultHandler.php | DefaultHandler.delete | public function delete($id, $next)
{
$status = $this->handler->destroy($id);
return $next($id) && $status;
} | php | public function delete($id, $next)
{
$status = $this->handler->destroy($id);
return $next($id) && $status;
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
",",
"$",
"next",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"handler",
"->",
"destroy",
"(",
"$",
"id",
")",
";",
"return",
"$",
"next",
"(",
"$",
"id",
")",
"&&",
"$",
"status",
";",
"}"
] | Delete a session from storage by ID.
@param string $id ID of the session to remove
@param callable $next Callable to invoke the next layer in the stack
@return bool | [
"Delete",
"a",
"session",
"from",
"storage",
"by",
"ID",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Handlers/DefaultHandler.php#L49-L53 |
224,308 | ericmann/sessionz | php/Handlers/DefaultHandler.php | DefaultHandler.clean | public function clean($maxlifetime, $next)
{
$status = $this->handler->gc($maxlifetime);
return $next($maxlifetime) && $status;
} | php | public function clean($maxlifetime, $next)
{
$status = $this->handler->gc($maxlifetime);
return $next($maxlifetime) && $status;
} | [
"public",
"function",
"clean",
"(",
"$",
"maxlifetime",
",",
"$",
"next",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"handler",
"->",
"gc",
"(",
"$",
"maxlifetime",
")",
";",
"return",
"$",
"next",
"(",
"$",
"maxlifetime",
")",
"&&",
"$",
"st... | Clean up all session older than the max lifetime specified.
@param int $maxlifetime Max number of seconds for a valid session
@param callable $next Callable to invoke the next layer in the stack
@return bool | [
"Clean",
"up",
"all",
"session",
"older",
"than",
"the",
"max",
"lifetime",
"specified",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Handlers/DefaultHandler.php#L63-L67 |
224,309 | ericmann/sessionz | php/Handlers/DefaultHandler.php | DefaultHandler.create | public function create($path, $name, $next)
{
$status = $this->handler->open($path, $name);
return $next($path, $name) && $status;
} | php | public function create($path, $name, $next)
{
$status = $this->handler->open($path, $name);
return $next($path, $name) && $status;
} | [
"public",
"function",
"create",
"(",
"$",
"path",
",",
"$",
"name",
",",
"$",
"next",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"handler",
"->",
"open",
"(",
"$",
"path",
",",
"$",
"name",
")",
";",
"return",
"$",
"next",
"(",
"$",
"path... | Create a new session store.
@param string $path Path where the storage lives
@param string $name Name of the session store to create
@param callable $next Callable to invoke the next layer in the stack
@return bool | [
"Create",
"a",
"new",
"session",
"store",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Handlers/DefaultHandler.php#L78-L82 |
224,310 | ericmann/sessionz | php/Handlers/DefaultHandler.php | DefaultHandler.read | public function read($id, $next)
{
return empty($this->handler->read($id)) ? $next($id) : $this->handler->read($id);
} | php | public function read($id, $next)
{
return empty($this->handler->read($id)) ? $next($id) : $this->handler->read($id);
} | [
"public",
"function",
"read",
"(",
"$",
"id",
",",
"$",
"next",
")",
"{",
"return",
"empty",
"(",
"$",
"this",
"->",
"handler",
"->",
"read",
"(",
"$",
"id",
")",
")",
"?",
"$",
"next",
"(",
"$",
"id",
")",
":",
"$",
"this",
"->",
"handler",
... | Read a specific session from storage.
@param string $id ID of the session to read
@param callable $next Callable to invoke the next layer in the stack
@return string | [
"Read",
"a",
"specific",
"session",
"from",
"storage",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Handlers/DefaultHandler.php#L92-L95 |
224,311 | logical-and/php-oauth | src/UserData/Arguments/FieldsValues.php | FieldsValues.fieldValue | public function fieldValue($field, $value)
{
if (!in_array($field, $this->supports)) {
$this->supports[ ] = $field;
}
$this->values[ $field ] = $value;
return $this;
} | php | public function fieldValue($field, $value)
{
if (!in_array($field, $this->supports)) {
$this->supports[ ] = $field;
}
$this->values[ $field ] = $value;
return $this;
} | [
"public",
"function",
"fieldValue",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"field",
",",
"$",
"this",
"->",
"supports",
")",
")",
"{",
"$",
"this",
"->",
"supports",
"[",
"]",
"=",
"$",
"field",
";",... | Set field default value
@param $field
@param $value
@return $this | [
"Set",
"field",
"default",
"value"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/FieldsValues.php#L65-L73 |
224,312 | appkr/api | src/example/AuthorTransformer.php | AuthorTransformer.includeBooks | public function includeBooks(Author $author, ParamBag $paramBag = null)
{
$transformer = new BookTransformer($paramBag);
$books = $author->books()
->limit($transformer->getLimit())
->offset($transformer->getOffset())
->orderBy($transformer->getSortKey(), $transfo... | php | public function includeBooks(Author $author, ParamBag $paramBag = null)
{
$transformer = new BookTransformer($paramBag);
$books = $author->books()
->limit($transformer->getLimit())
->offset($transformer->getOffset())
->orderBy($transformer->getSortKey(), $transfo... | [
"public",
"function",
"includeBooks",
"(",
"Author",
"$",
"author",
",",
"ParamBag",
"$",
"paramBag",
"=",
"null",
")",
"{",
"$",
"transformer",
"=",
"new",
"BookTransformer",
"(",
"$",
"paramBag",
")",
";",
"$",
"books",
"=",
"$",
"author",
"->",
"books... | Include books.
@param \Appkr\Api\Example\Author $author
@param \League\Fractal\ParamBag|null $paramBag
@return \League\Fractal\Resource\Collection | [
"Include",
"books",
"."
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/example/AuthorTransformer.php#L73-L84 |
224,313 | mondalaci/supervisord-php-client | src/SupervisorClient/SupervisorClient.php | SupervisorClient._getSocket | protected function _getSocket()
{
if (is_resource($this->_socket)) {
if (feof($this->_socket)) {
// Supervisor sometimes seems to close the socket after a request is completed, which
// causes the following request made by SupervisorClient to fail mysteriously wit... | php | protected function _getSocket()
{
if (is_resource($this->_socket)) {
if (feof($this->_socket)) {
// Supervisor sometimes seems to close the socket after a request is completed, which
// causes the following request made by SupervisorClient to fail mysteriously wit... | [
"protected",
"function",
"_getSocket",
"(",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"_socket",
")",
")",
"{",
"if",
"(",
"feof",
"(",
"$",
"this",
"->",
"_socket",
")",
")",
"{",
"// Supervisor sometimes seems to close the socket after a re... | Get the socket
@return resource
@throws \Exception | [
"Get",
"the",
"socket"
] | c826f56b6652ab292799e2daed7bda16fbd5ad6a | https://github.com/mondalaci/supervisord-php-client/blob/c826f56b6652ab292799e2daed7bda16fbd5ad6a/src/SupervisorClient/SupervisorClient.php#L650-L680 |
224,314 | mondalaci/supervisord-php-client | src/SupervisorClient/SupervisorClient.php | SupervisorClient._doRequest | protected function _doRequest($namespace, $method, $args)
{
// Create the authorization header.
$authorization = '';
if (!is_null($this->_username) && !is_null($this->_password)) {
$authorization = "\r\nAuthorization: Basic " . base64_encode($this->_username . ':' . $this->_passw... | php | protected function _doRequest($namespace, $method, $args)
{
// Create the authorization header.
$authorization = '';
if (!is_null($this->_username) && !is_null($this->_password)) {
$authorization = "\r\nAuthorization: Basic " . base64_encode($this->_username . ':' . $this->_passw... | [
"protected",
"function",
"_doRequest",
"(",
"$",
"namespace",
",",
"$",
"method",
",",
"$",
"args",
")",
"{",
"// Create the authorization header.",
"$",
"authorization",
"=",
"''",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"_username",
")",
... | Do a request to the supervisor XML-RPC API
@param string $namespace The namespace of the request
@param string $method The method in the namespace
@param mixed $args Optional arguments | [
"Do",
"a",
"request",
"to",
"the",
"supervisor",
"XML",
"-",
"RPC",
"API"
] | c826f56b6652ab292799e2daed7bda16fbd5ad6a | https://github.com/mondalaci/supervisord-php-client/blob/c826f56b6652ab292799e2daed7bda16fbd5ad6a/src/SupervisorClient/SupervisorClient.php#L689-L707 |
224,315 | EvanDotPro/EdpSuperluminal | Module.php | Module.cache | public function cache($e)
{
$request = $e->getRequest();
if ($request instanceof ConsoleRequest ||
$request->getQuery()->get('EDPSUPERLUMINAL_CACHE', null) === null) {
return;
}
if (file_exists(ZF_CLASS_CACHE)) {
$this->reflectClassCache();
... | php | public function cache($e)
{
$request = $e->getRequest();
if ($request instanceof ConsoleRequest ||
$request->getQuery()->get('EDPSUPERLUMINAL_CACHE', null) === null) {
return;
}
if (file_exists(ZF_CLASS_CACHE)) {
$this->reflectClassCache();
... | [
"public",
"function",
"cache",
"(",
"$",
"e",
")",
"{",
"$",
"request",
"=",
"$",
"e",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"$",
"request",
"instanceof",
"ConsoleRequest",
"||",
"$",
"request",
"->",
"getQuery",
"(",
")",
"->",
"get",
"(",
... | Cache declared interfaces and classes to a single file
@param \Zend\Mvc\MvcEvent $e
@return void | [
"Cache",
"declared",
"interfaces",
"and",
"classes",
"to",
"a",
"single",
"file"
] | 59e8b98422bdcb162be397cd2dd181ba6ecdfa36 | https://github.com/EvanDotPro/EdpSuperluminal/blob/59e8b98422bdcb162be397cd2dd181ba6ecdfa36/Module.php#L36-L94 |
224,316 | turtledesign/royalmail-php | src/Validator/Validates.php | Validates.validate | static function validate($schema, $value, $helper = NULL) {
foreach (self::parseConstraints($schema) as $c) { // The constraints are in a numeric array as the order matters.
$constraint = key($c);
$params = $c[$constraint];
if (self::isBlank($value) && ! preg_match('/require|notblank/i', $co... | php | static function validate($schema, $value, $helper = NULL) {
foreach (self::parseConstraints($schema) as $c) { // The constraints are in a numeric array as the order matters.
$constraint = key($c);
$params = $c[$constraint];
if (self::isBlank($value) && ! preg_match('/require|notblank/i', $co... | [
"static",
"function",
"validate",
"(",
"$",
"schema",
",",
"$",
"value",
",",
"$",
"helper",
"=",
"NULL",
")",
"{",
"foreach",
"(",
"self",
"::",
"parseConstraints",
"(",
"$",
"schema",
")",
"as",
"$",
"c",
")",
"{",
"// The constraints are in a numeric ar... | Validate the given values against the constraints given.
@param mixed $value
@param array $constraints
@return mixed $value - validated and cleaned. | [
"Validate",
"the",
"given",
"values",
"against",
"the",
"constraints",
"given",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Validator/Validates.php#L29-L40 |
224,317 | turtledesign/royalmail-php | src/Validator/Validates.php | Validates.parseParams | static function parseParams($params, $schema) {
$params = (array) $params;
foreach (array_diff_key($schema, ['_validate' => 1]) as $k => $v) if (preg_match('/^_/', $k)) $params[$k] = $v;
return $params;
} | php | static function parseParams($params, $schema) {
$params = (array) $params;
foreach (array_diff_key($schema, ['_validate' => 1]) as $k => $v) if (preg_match('/^_/', $k)) $params[$k] = $v;
return $params;
} | [
"static",
"function",
"parseParams",
"(",
"$",
"params",
",",
"$",
"schema",
")",
"{",
"$",
"params",
"=",
"(",
"array",
")",
"$",
"params",
";",
"foreach",
"(",
"array_diff_key",
"(",
"$",
"schema",
",",
"[",
"'_validate'",
"=>",
"1",
"]",
")",
"as"... | Adds extra settings values from the schema as they may be used by the validator as well as other things.
@param mixed $params
@param array $schema
@return array | [
"Adds",
"extra",
"settings",
"values",
"from",
"the",
"schema",
"as",
"they",
"may",
"be",
"used",
"by",
"the",
"validator",
"as",
"well",
"as",
"other",
"things",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Validator/Validates.php#L65-L71 |
224,318 | turtledesign/royalmail-php | src/Validator/Validates.php | Validates.constrain | static function constrain($value, $constraint, $params = [], $helper = NULL) {
$constraint_method = get_called_class() . '::check' . $constraint;
if (! is_callable($constraint_method)) throw new \InvalidArgumentException('Invalid constraint method ' . $constraint_method . ' called');
return call_user_func... | php | static function constrain($value, $constraint, $params = [], $helper = NULL) {
$constraint_method = get_called_class() . '::check' . $constraint;
if (! is_callable($constraint_method)) throw new \InvalidArgumentException('Invalid constraint method ' . $constraint_method . ' called');
return call_user_func... | [
"static",
"function",
"constrain",
"(",
"$",
"value",
",",
"$",
"constraint",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"helper",
"=",
"NULL",
")",
"{",
"$",
"constraint_method",
"=",
"get_called_class",
"(",
")",
".",
"'::check'",
".",
"$",
"constr... | Apply the given constraints with the parameters given.
@param mixed $value
@param string $constraint
@param array $params
@return mixed | [
"Apply",
"the",
"given",
"constraints",
"with",
"the",
"parameters",
"given",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Validator/Validates.php#L84-L90 |
224,319 | turtledesign/royalmail-php | src/Validator/Validates.php | Validates.checkThisRequiredWhenThat | static function checkThisRequiredWhenThat($value, $params, $helper) {
if (self::checkPath($params['that'], ['required' => TRUE, 'in' => (array) $params['is']], $helper)) {
$params = array_merge(['message' => 'required when ' . $params['that'] . ' in (' . implode(', ', (array) $params['is']) . ')'], $params);
... | php | static function checkThisRequiredWhenThat($value, $params, $helper) {
if (self::checkPath($params['that'], ['required' => TRUE, 'in' => (array) $params['is']], $helper)) {
$params = array_merge(['message' => 'required when ' . $params['that'] . ' in (' . implode(', ', (array) $params['is']) . ')'], $params);
... | [
"static",
"function",
"checkThisRequiredWhenThat",
"(",
"$",
"value",
",",
"$",
"params",
",",
"$",
"helper",
")",
"{",
"if",
"(",
"self",
"::",
"checkPath",
"(",
"$",
"params",
"[",
"'that'",
"]",
",",
"[",
"'required'",
"=>",
"TRUE",
",",
"'in'",
"=>... | Check field exists based on the value of another field.
NB: Valitron's equals method checks against a field val, not a string, so 'in' is used for strings and arrays. | [
"Check",
"field",
"exists",
"based",
"on",
"the",
"value",
"of",
"another",
"field",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Validator/Validates.php#L219-L227 |
224,320 | turtledesign/royalmail-php | src/Validator/Validates.php | Validates.checkPath | static function checkPath($path, $constraints, $helper) {
list($where, $path) = explode(':', $path);
if (empty($constraints)) $constraints = ['required' => TRUE];
foreach ($constraints as $con => $params) {
if ($con === 'required') $constraints['required'] = $path;
elseif ($con === 'in') $c... | php | static function checkPath($path, $constraints, $helper) {
list($where, $path) = explode(':', $path);
if (empty($constraints)) $constraints = ['required' => TRUE];
foreach ($constraints as $con => $params) {
if ($con === 'required') $constraints['required'] = $path;
elseif ($con === 'in') $c... | [
"static",
"function",
"checkPath",
"(",
"$",
"path",
",",
"$",
"constraints",
",",
"$",
"helper",
")",
"{",
"list",
"(",
"$",
"where",
",",
"$",
"path",
")",
"=",
"explode",
"(",
"':'",
",",
"$",
"path",
")",
";",
"if",
"(",
"empty",
"(",
"$",
... | Build a Valitron ruleset from a given path and constraints.
@param string $path (input|output):dot.path.to.var.*.vars
@param array $constraints constraints and other settings, defaults to ['required' => TRUE] if empty
@param $helper ArrayObject data checks are run on.
@return Boolean True if rules validate... | [
"Build",
"a",
"Valitron",
"ruleset",
"from",
"a",
"given",
"path",
"and",
"constraints",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Validator/Validates.php#L262-L277 |
224,321 | turtledesign/royalmail-php | src/Validator/Validates.php | Validates.fail | static function fail($value, $params, $defaults = []) {
$params = array_merge(['message' => 'value is invalid'], $defaults, $params);
$show_val = is_scalar($value) ? ' [' . $value . ']' : '';
throw new \RoyalMail\Exception\ValidatorException($params['message'] . $show_val);
} | php | static function fail($value, $params, $defaults = []) {
$params = array_merge(['message' => 'value is invalid'], $defaults, $params);
$show_val = is_scalar($value) ? ' [' . $value . ']' : '';
throw new \RoyalMail\Exception\ValidatorException($params['message'] . $show_val);
} | [
"static",
"function",
"fail",
"(",
"$",
"value",
",",
"$",
"params",
",",
"$",
"defaults",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"array_merge",
"(",
"[",
"'message'",
"=>",
"'value is invalid'",
"]",
",",
"$",
"defaults",
",",
"$",
"params",
"... | Handle failed validation constraint.
@param mixed $value
@param array $params
@param array $defaults
@throws \RoyalMail\Exception\ValidatorException | [
"Handle",
"failed",
"validation",
"constraint",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Validator/Validates.php#L308-L313 |
224,322 | DevGroup-ru/yii2-multilingual | src/controllers/CountryLanguageManageController.php | CountryLanguageManageController.actionIndex | public function actionIndex()
{
$model = new CountryLanguage(['scenario' => 'search']);
$dataProvider = $model->search(Yii::$app->request->queryParams);
return $this->render(
'index',
[
'model' => $model,
'dataProvider' => $dataProvider... | php | public function actionIndex()
{
$model = new CountryLanguage(['scenario' => 'search']);
$dataProvider = $model->search(Yii::$app->request->queryParams);
return $this->render(
'index',
[
'model' => $model,
'dataProvider' => $dataProvider... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"CountryLanguage",
"(",
"[",
"'scenario'",
"=>",
"'search'",
"]",
")",
";",
"$",
"dataProvider",
"=",
"$",
"model",
"->",
"search",
"(",
"Yii",
"::",
"$",
"app",
"->",
"reque... | Lists all CountryLanguage models.
@return mixed | [
"Lists",
"all",
"CountryLanguage",
"models",
"."
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/controllers/CountryLanguageManageController.php#L48-L59 |
224,323 | DevGroup-ru/yii2-multilingual | src/controllers/CountryLanguageManageController.php | CountryLanguageManageController.actionEdit | public function actionEdit($id = null)
{
if ($id === null) {
$model = new CountryLanguage;
} else {
$model = $this->findModel($id);
}
$isLoaded = $model->load(Yii::$app->request->post());
$hasAccess = ($model->isNewRecord && Yii::$app->user->can('multi... | php | public function actionEdit($id = null)
{
if ($id === null) {
$model = new CountryLanguage;
} else {
$model = $this->findModel($id);
}
$isLoaded = $model->load(Yii::$app->request->post());
$hasAccess = ($model->isNewRecord && Yii::$app->user->can('multi... | [
"public",
"function",
"actionEdit",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"model",
"=",
"new",
"CountryLanguage",
";",
"}",
"else",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
... | Updates an existing CountryLanguage model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"CountryLanguage",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/controllers/CountryLanguageManageController.php#L67-L91 |
224,324 | ericmann/sessionz | php/Handlers/EncryptionHandler.php | EncryptionHandler.write | public function write($id, $data, $next)
{
$return = empty( $data ) ? $data : $this->encrypt( $data );
return $next( $id, $return );
} | php | public function write($id, $data, $next)
{
$return = empty( $data ) ? $data : $this->encrypt( $data );
return $next( $id, $return );
} | [
"public",
"function",
"write",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"next",
")",
"{",
"$",
"return",
"=",
"empty",
"(",
"$",
"data",
")",
"?",
"$",
"data",
":",
"$",
"this",
"->",
"encrypt",
"(",
"$",
"data",
")",
";",
"return",
"$",
"... | Encrypt the incoming data payload, then pass it along to the next handler
in the stack.
@param string $id ID of the session to write
@param string $data Data to be written
@param callable $next Callable to invoke the next layer in the stack
@return bool | [
"Encrypt",
"the",
"incoming",
"data",
"payload",
"then",
"pass",
"it",
"along",
"to",
"the",
"next",
"handler",
"in",
"the",
"stack",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Handlers/EncryptionHandler.php#L86-L90 |
224,325 | JeffreyHyer/bamboohr | src/Api/Login.php | Login.login | public function login($username, $password, $appKey, $deviceId = "")
{
return $this->post("login", ['username' => $username, 'password' => $password, 'applicationKey' => $appKey, 'deviceId' => $deviceId]);
} | php | public function login($username, $password, $appKey, $deviceId = "")
{
return $this->post("login", ['username' => $username, 'password' => $password, 'applicationKey' => $appKey, 'deviceId' => $deviceId]);
} | [
"public",
"function",
"login",
"(",
"$",
"username",
",",
"$",
"password",
",",
"$",
"appKey",
",",
"$",
"deviceId",
"=",
"\"\"",
")",
"{",
"return",
"$",
"this",
"->",
"post",
"(",
"\"login\"",
",",
"[",
"'username'",
"=>",
"$",
"username",
",",
"'p... | Login as a given user, identified by the provided username and password.
@param string $username Username
@param string $password Password
@param string $appKey Application Key
@param string $deviceId [Optional] A unique ID specific to a users device
@return \BambooHR\Api\Response | [
"Login",
"as",
"a",
"given",
"user",
"identified",
"by",
"the",
"provided",
"username",
"and",
"password",
"."
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/Login.php#L23-L26 |
224,326 | DevGroup-ru/yii2-multilingual | src/behaviors/MultilingualActiveRecord.php | MultilingualActiveRecord.hasTranslation | public function hasTranslation($language_id = null, $checkIsPublished = true)
{
/** @var \DevGroup\Multilingual\Multilingual $multilingual */
$multilingual = Yii::$app->multilingual;
if ($language_id === null) {
$language_id = $multilingual->language_id;
}
/** @va... | php | public function hasTranslation($language_id = null, $checkIsPublished = true)
{
/** @var \DevGroup\Multilingual\Multilingual $multilingual */
$multilingual = Yii::$app->multilingual;
if ($language_id === null) {
$language_id = $multilingual->language_id;
}
/** @va... | [
"public",
"function",
"hasTranslation",
"(",
"$",
"language_id",
"=",
"null",
",",
"$",
"checkIsPublished",
"=",
"true",
")",
"{",
"/** @var \\DevGroup\\Multilingual\\Multilingual $multilingual */",
"$",
"multilingual",
"=",
"Yii",
"::",
"$",
"app",
"->",
"multilingua... | Returns a value indicating whether the translation model for the specified language exists.
@param string|null $language_id
@param bool $checkIsPublished Check if translation is published
@return boolean | [
"Returns",
"a",
"value",
"indicating",
"whether",
"the",
"translation",
"model",
"for",
"the",
"specified",
"language",
"exists",
"."
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/behaviors/MultilingualActiveRecord.php#L146-L180 |
224,327 | DevGroup-ru/yii2-multilingual | src/behaviors/MultilingualActiveRecord.php | MultilingualActiveRecord.checkIsPublished | public function checkIsPublished(ActiveRecord $translationRecord)
{
if ($this->translationPublishedAttribute === false) {
return true;
}
return
$translationRecord->getAttribute($this->translationPublishedAttribute)
== $this->translationPublishedAttributeVa... | php | public function checkIsPublished(ActiveRecord $translationRecord)
{
if ($this->translationPublishedAttribute === false) {
return true;
}
return
$translationRecord->getAttribute($this->translationPublishedAttribute)
== $this->translationPublishedAttributeVa... | [
"public",
"function",
"checkIsPublished",
"(",
"ActiveRecord",
"$",
"translationRecord",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"translationPublishedAttribute",
"===",
"false",
")",
"{",
"return",
"true",
";",
"}",
"return",
"$",
"translationRecord",
"->",
"get... | Performs a check of publish state for translation record
@param ActiveRecord $translationRecord
@return bool | [
"Performs",
"a",
"check",
"of",
"publish",
"state",
"for",
"translation",
"record"
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/behaviors/MultilingualActiveRecord.php#L187-L195 |
224,328 | ericmann/sessionz | php/Objects/MemoryItem.php | MemoryItem.is_valid | public function is_valid($lifetime = null, $now = null)
{
if (null === $now) $now = time();
if (null === $lifetime) $lifetime = ini_get('session.gc_maxlifetime');
return (int) $now - $this->_time < (int) $lifetime;
} | php | public function is_valid($lifetime = null, $now = null)
{
if (null === $now) $now = time();
if (null === $lifetime) $lifetime = ini_get('session.gc_maxlifetime');
return (int) $now - $this->_time < (int) $lifetime;
} | [
"public",
"function",
"is_valid",
"(",
"$",
"lifetime",
"=",
"null",
",",
"$",
"now",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"now",
")",
"$",
"now",
"=",
"time",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"lifetime",
")",
"$",... | Test whether an item is still valid
@param int [$lifetime]
@param int [$now]
@return bool | [
"Test",
"whether",
"an",
"item",
"is",
"still",
"valid"
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Objects/MemoryItem.php#L73-L79 |
224,329 | eloquent/equality | src/Comparator.php | Comparator.arrayEquals | protected function arrayEquals(array $left, $right)
{
if (!is_array($right)) {
return false;
}
if (array_keys($left) !== array_keys($right)) {
return false;
}
foreach ($left as $key => $value) {
if (!$this->valueEquals($value, $right[$key]... | php | protected function arrayEquals(array $left, $right)
{
if (!is_array($right)) {
return false;
}
if (array_keys($left) !== array_keys($right)) {
return false;
}
foreach ($left as $key => $value) {
if (!$this->valueEquals($value, $right[$key]... | [
"protected",
"function",
"arrayEquals",
"(",
"array",
"$",
"left",
",",
"$",
"right",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"right",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"array_keys",
"(",
"$",
"left",
")",
"!==",
"array... | Compare an array to another arbitrary value.
@param array $left The left value.
@param mixed $right The right value.
@return boolean True if the values are deeply equal. | [
"Compare",
"an",
"array",
"to",
"another",
"arbitrary",
"value",
"."
] | 5af459d2e06e97bbec51c750c691bd2f9d4256cc | https://github.com/eloquent/equality/blob/5af459d2e06e97bbec51c750c691bd2f9d4256cc/src/Comparator.php#L92-L108 |
224,330 | eloquent/equality | src/Comparator.php | Comparator.objectEquals | protected function objectEquals($left, $right)
{
if (!is_object($right)) {
return false;
}
if (get_class($left) !== get_class($right)) {
return false;
}
$stackKey = $this->objectComparisonStackKey($left, $right);
if (array_key_exists($stackKey... | php | protected function objectEquals($left, $right)
{
if (!is_object($right)) {
return false;
}
if (get_class($left) !== get_class($right)) {
return false;
}
$stackKey = $this->objectComparisonStackKey($left, $right);
if (array_key_exists($stackKey... | [
"protected",
"function",
"objectEquals",
"(",
"$",
"left",
",",
"$",
"right",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"right",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"get_class",
"(",
"$",
"left",
")",
"!==",
"get_class",
"... | Compare an object to another arbitrary value.
@param object $left The left value.
@param mixed $right The right value.
@return boolean True if the values are deeply equal. | [
"Compare",
"an",
"object",
"to",
"another",
"arbitrary",
"value",
"."
] | 5af459d2e06e97bbec51c750c691bd2f9d4256cc | https://github.com/eloquent/equality/blob/5af459d2e06e97bbec51c750c691bd2f9d4256cc/src/Comparator.php#L118-L137 |
224,331 | eloquent/equality | src/Comparator.php | Comparator.objectProperties | protected function objectProperties($object)
{
$properties = array();
$reflector = new ReflectionObject($object);
while ($reflector) {
foreach ($reflector->getProperties() as $property) {
if ($property->isStatic()) {
continue;
... | php | protected function objectProperties($object)
{
$properties = array();
$reflector = new ReflectionObject($object);
while ($reflector) {
foreach ($reflector->getProperties() as $property) {
if ($property->isStatic()) {
continue;
... | [
"protected",
"function",
"objectProperties",
"(",
"$",
"object",
")",
"{",
"$",
"properties",
"=",
"array",
"(",
")",
";",
"$",
"reflector",
"=",
"new",
"ReflectionObject",
"(",
"$",
"object",
")",
";",
"while",
"(",
"$",
"reflector",
")",
"{",
"foreach"... | Get the properties of the supplied object, including protected and
private values.
@param object $object The object to inspect.
@return array<string,mixed> The object's properties. | [
"Get",
"the",
"properties",
"of",
"the",
"supplied",
"object",
"including",
"protected",
"and",
"private",
"values",
"."
] | 5af459d2e06e97bbec51c750c691bd2f9d4256cc | https://github.com/eloquent/equality/blob/5af459d2e06e97bbec51c750c691bd2f9d4256cc/src/Comparator.php#L147-L172 |
224,332 | eloquent/equality | src/Comparator.php | Comparator.objectComparisonStackKey | protected function objectComparisonStackKey($left, $right)
{
$ids = array(
spl_object_hash($left),
spl_object_hash($right)
);
sort($ids);
return implode('.', $ids);
} | php | protected function objectComparisonStackKey($left, $right)
{
$ids = array(
spl_object_hash($left),
spl_object_hash($right)
);
sort($ids);
return implode('.', $ids);
} | [
"protected",
"function",
"objectComparisonStackKey",
"(",
"$",
"left",
",",
"$",
"right",
")",
"{",
"$",
"ids",
"=",
"array",
"(",
"spl_object_hash",
"(",
"$",
"left",
")",
",",
"spl_object_hash",
"(",
"$",
"right",
")",
")",
";",
"sort",
"(",
"$",
"id... | Return a unique key for the current comparison, which can be used to
avoid recursion issues.
@param object $left The left value.
@param object $right The right value.
@return string The unique comparison key. | [
"Return",
"a",
"unique",
"key",
"for",
"the",
"current",
"comparison",
"which",
"can",
"be",
"used",
"to",
"avoid",
"recursion",
"issues",
"."
] | 5af459d2e06e97bbec51c750c691bd2f9d4256cc | https://github.com/eloquent/equality/blob/5af459d2e06e97bbec51c750c691bd2f9d4256cc/src/Comparator.php#L183-L192 |
224,333 | jasny/audio | src/Jasny/Audio/Track.php | Track.getStats | public function getStats()
{
if (isset($this->stats)) return $this->stats;
$stats = array();
$stats['channels'] = '1';
foreach (explode("\n", $this->sox('-n', 'stats')) as $line) {
if (empty($line) || preg_match('/^\S+ WARN/', $line)) continue;
... | php | public function getStats()
{
if (isset($this->stats)) return $this->stats;
$stats = array();
$stats['channels'] = '1';
foreach (explode("\n", $this->sox('-n', 'stats')) as $line) {
if (empty($line) || preg_match('/^\S+ WARN/', $line)) continue;
... | [
"public",
"function",
"getStats",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"stats",
")",
")",
"return",
"$",
"this",
"->",
"stats",
";",
"$",
"stats",
"=",
"array",
"(",
")",
";",
"$",
"stats",
"[",
"'channels'",
"]",
"=",
"'1'"... | Get statistics of the audio file
@return array | [
"Get",
"statistics",
"of",
"the",
"audio",
"file"
] | 5c8bcb93ab4243c79971342f4a414747c716fedf | https://github.com/jasny/audio/blob/5c8bcb93ab4243c79971342f4a414747c716fedf/src/Jasny/Audio/Track.php#L84-L125 |
224,334 | jasny/audio | src/Jasny/Audio/Track.php | Track.getStat | private function getStat($stat, $soxi_arg, $cast)
{
if (!isset($this->$stat)) {
$this->$stat = isset($this->stats) ?
(float)$this->stats->$stat :
(float)$this->soxi($soxi_arg);
settype($this->$stat, $cast);
}
r... | php | private function getStat($stat, $soxi_arg, $cast)
{
if (!isset($this->$stat)) {
$this->$stat = isset($this->stats) ?
(float)$this->stats->$stat :
(float)$this->soxi($soxi_arg);
settype($this->$stat, $cast);
}
r... | [
"private",
"function",
"getStat",
"(",
"$",
"stat",
",",
"$",
"soxi_arg",
",",
"$",
"cast",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"$",
"stat",
")",
")",
"{",
"$",
"this",
"->",
"$",
"stat",
"=",
"isset",
"(",
"$",
"this",
... | Get the a stat of the track
@param string $stat
@param string $soxi_arg
@param string $cast
@return mixed | [
"Get",
"the",
"a",
"stat",
"of",
"the",
"track"
] | 5c8bcb93ab4243c79971342f4a414747c716fedf | https://github.com/jasny/audio/blob/5c8bcb93ab4243c79971342f4a414747c716fedf/src/Jasny/Audio/Track.php#L135-L146 |
224,335 | jasny/audio | src/Jasny/Audio/Track.php | Track.combine | public function combine($method, $in, $out)
{
if ($in instanceof self) $in = $in->filename;
$this->sox('--combine', $method, $in, $out);
return new static($out);
} | php | public function combine($method, $in, $out)
{
if ($in instanceof self) $in = $in->filename;
$this->sox('--combine', $method, $in, $out);
return new static($out);
} | [
"public",
"function",
"combine",
"(",
"$",
"method",
",",
"$",
"in",
",",
"$",
"out",
")",
"{",
"if",
"(",
"$",
"in",
"instanceof",
"self",
")",
"$",
"in",
"=",
"$",
"in",
"->",
"filename",
";",
"$",
"this",
"->",
"sox",
"(",
"'--combine'",
",",
... | Combine two audio files
@param string $method 'concatenate', 'merge', 'mix', 'mix-power', 'multiply', 'sequence'
@param string|Track $in File to mix with
@param string $out New filename
@return Track | [
"Combine",
"two",
"audio",
"files"
] | 5c8bcb93ab4243c79971342f4a414747c716fedf | https://github.com/jasny/audio/blob/5c8bcb93ab4243c79971342f4a414747c716fedf/src/Jasny/Audio/Track.php#L247-L253 |
224,336 | jasny/audio | src/Jasny/Audio/Track.php | Track.sox | public function sox()
{
$args = func_get_args();
array_unshift($args, $this->filename);
return self::exec('sox', $args);
} | php | public function sox()
{
$args = func_get_args();
array_unshift($args, $this->filename);
return self::exec('sox', $args);
} | [
"public",
"function",
"sox",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"array_unshift",
"(",
"$",
"args",
",",
"$",
"this",
"->",
"filename",
")",
";",
"return",
"self",
"::",
"exec",
"(",
"'sox'",
",",
"$",
"args",
")",
";",... | Execute sox.
Each argument will be used in the command.
@return string | [
"Execute",
"sox",
".",
"Each",
"argument",
"will",
"be",
"used",
"in",
"the",
"command",
"."
] | 5c8bcb93ab4243c79971342f4a414747c716fedf | https://github.com/jasny/audio/blob/5c8bcb93ab4243c79971342f4a414747c716fedf/src/Jasny/Audio/Track.php#L262-L268 |
224,337 | appkr/api | src/example/BookTransformer.php | BookTransformer.includeAuthor | public function includeAuthor(Book $book, ParamBag $paramBag = null)
{
return $this->item($book->author, new AuthorTransformer($paramBag));
} | php | public function includeAuthor(Book $book, ParamBag $paramBag = null)
{
return $this->item($book->author, new AuthorTransformer($paramBag));
} | [
"public",
"function",
"includeAuthor",
"(",
"Book",
"$",
"book",
",",
"ParamBag",
"$",
"paramBag",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"item",
"(",
"$",
"book",
"->",
"author",
",",
"new",
"AuthorTransformer",
"(",
"$",
"paramBag",
")",
... | Include Author.
@param \Appkr\Api\Example\Book $book
@param \League\Fractal\ParamBag $paramBag
@return \League\Fractal\Resource\Item | [
"Include",
"Author",
"."
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/example/BookTransformer.php#L76-L79 |
224,338 | appkr/api | src/TransformerAbstract.php | TransformerAbstract.buildPayload | public function buildPayload(array $payload)
{
if ($visible = $this->getVisible()) {
$payload = array_only($payload, $visible);
}
if ($hidden = $this->getHidden()) {
$payload = array_except($payload, $hidden);
}
return $payload;
} | php | public function buildPayload(array $payload)
{
if ($visible = $this->getVisible()) {
$payload = array_only($payload, $visible);
}
if ($hidden = $this->getHidden()) {
$payload = array_except($payload, $hidden);
}
return $payload;
} | [
"public",
"function",
"buildPayload",
"(",
"array",
"$",
"payload",
")",
"{",
"if",
"(",
"$",
"visible",
"=",
"$",
"this",
"->",
"getVisible",
"(",
")",
")",
"{",
"$",
"payload",
"=",
"array_only",
"(",
"$",
"payload",
",",
"$",
"visible",
")",
";",
... | Filter fields to respond.
@param array $payload
@return array | [
"Filter",
"fields",
"to",
"respond",
"."
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/TransformerAbstract.php#L224-L235 |
224,339 | appkr/api | src/TransformerAbstract.php | TransformerAbstract.setProperties | protected function setProperties()
{
// Fetch request query string values passed by an API client.
list($limit, $offset) = $this->paramBag->get('limit');
list($sortKey, $sortDirection) = $this->paramBag->get('sort');
// If nothing is passed by API client,
// falling back to ... | php | protected function setProperties()
{
// Fetch request query string values passed by an API client.
list($limit, $offset) = $this->paramBag->get('limit');
list($sortKey, $sortDirection) = $this->paramBag->get('sort');
// If nothing is passed by API client,
// falling back to ... | [
"protected",
"function",
"setProperties",
"(",
")",
"{",
"// Fetch request query string values passed by an API client.",
"list",
"(",
"$",
"limit",
",",
"$",
"offset",
")",
"=",
"$",
"this",
"->",
"paramBag",
"->",
"get",
"(",
"'limit'",
")",
";",
"list",
"(",
... | Set class properties by request query string. | [
"Set",
"class",
"properties",
"by",
"request",
"query",
"string",
"."
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/TransformerAbstract.php#L240-L252 |
224,340 | appkr/api | src/TransformerAbstract.php | TransformerAbstract.validateIncludeParams | protected function validateIncludeParams()
{
$validParams = array_keys($this->config['include']['params']);
$usedParams = array_keys(iterator_to_array($this->paramBag));
if ($invalidParams = array_diff($usedParams, $validParams)) {
// This validates query string KEY passed by an... | php | protected function validateIncludeParams()
{
$validParams = array_keys($this->config['include']['params']);
$usedParams = array_keys(iterator_to_array($this->paramBag));
if ($invalidParams = array_diff($usedParams, $validParams)) {
// This validates query string KEY passed by an... | [
"protected",
"function",
"validateIncludeParams",
"(",
")",
"{",
"$",
"validParams",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"config",
"[",
"'include'",
"]",
"[",
"'params'",
"]",
")",
";",
"$",
"usedParams",
"=",
"array_keys",
"(",
"iterator_to_array",
"... | Validate include params.
We already define the white lists in the config.
@return bool
@throws UnexpectedIncludesParamException | [
"Validate",
"include",
"params",
".",
"We",
"already",
"define",
"the",
"white",
"lists",
"in",
"the",
"config",
"."
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/TransformerAbstract.php#L261-L320 |
224,341 | appkr/api | src/Transformers/SimpleArrayTransformer.php | SimpleArrayTransformer.transform | public function transform($model)
{
if (is_array($model)) {
return $model;
}
if ($model instanceof Collection) {
return $model->toArray();
}
if ($model instanceof JsonSerializable) {
return $model->jsonSerialize();
}
if (... | php | public function transform($model)
{
if (is_array($model)) {
return $model;
}
if ($model instanceof Collection) {
return $model->toArray();
}
if ($model instanceof JsonSerializable) {
return $model->jsonSerialize();
}
if (... | [
"public",
"function",
"transform",
"(",
"$",
"model",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"model",
")",
")",
"{",
"return",
"$",
"model",
";",
"}",
"if",
"(",
"$",
"model",
"instanceof",
"Collection",
")",
"{",
"return",
"$",
"model",
"->",
... | Transform single resource
@param Collection|array $model
@return array
@throws \Exception | [
"Transform",
"single",
"resource"
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/Transformers/SimpleArrayTransformer.php#L18-L41 |
224,342 | JeffreyHyer/bamboohr | src/Api/Photos.php | Photos.getPhotoUrl | public function getPhotoUrl(string $email, bool $secure = true)
{
$hash = md5(strtolower(trim($email)));
$url = ($secure ? "https://" : "http://");
$url .= "{$this->bamboo->domain}.bamboohr.com/employees/photos/?h={$hash}";
return $url;
} | php | public function getPhotoUrl(string $email, bool $secure = true)
{
$hash = md5(strtolower(trim($email)));
$url = ($secure ? "https://" : "http://");
$url .= "{$this->bamboo->domain}.bamboohr.com/employees/photos/?h={$hash}";
return $url;
} | [
"public",
"function",
"getPhotoUrl",
"(",
"string",
"$",
"email",
",",
"bool",
"$",
"secure",
"=",
"true",
")",
"{",
"$",
"hash",
"=",
"md5",
"(",
"strtolower",
"(",
"trim",
"(",
"$",
"email",
")",
")",
")",
";",
"$",
"url",
"=",
"(",
"$",
"secur... | Get the URL of an employee's photo
This works similar to Gravatar where the URL scheme is known
so no API call is made to the BambooHR service when using this
method.
NOTES:
- Returns the URL to a JPEG image that is 150px square
- If an image does not exist for the given employee it
will return customized placeholder... | [
"Get",
"the",
"URL",
"of",
"an",
"employee",
"s",
"photo"
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/Photos.php#L63-L71 |
224,343 | JeffreyHyer/bamboohr | src/Api/Metadata.php | Metadata.addEditList | public function addEditList($listId, array $options)
{
$xml = "<options>";
foreach ($options as $option) {
$xml .= "<option";
if (isset($option['id'])) {
$xml .= " id=\"{$option['id']}\"";
}
if (isset($option['archived'])) {
... | php | public function addEditList($listId, array $options)
{
$xml = "<options>";
foreach ($options as $option) {
$xml .= "<option";
if (isset($option['id'])) {
$xml .= " id=\"{$option['id']}\"";
}
if (isset($option['archived'])) {
... | [
"public",
"function",
"addEditList",
"(",
"$",
"listId",
",",
"array",
"$",
"options",
")",
"{",
"$",
"xml",
"=",
"\"<options>\"",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"option",
")",
"{",
"$",
"xml",
".=",
"\"<option\"",
";",
"if",
"(",
"i... | Add or update values for "list" fields
@param string $listId
@param array $options [['id' => string (optional), 'archived' => 'yes|no' (optional), 'value' => string (required)], ...]
@return BambooHR\Api\Response | [
"Add",
"or",
"update",
"values",
"for",
"list",
"fields"
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/Metadata.php#L51-L72 |
224,344 | DevGroup-ru/yii2-multilingual | src/controllers/ContextManageController.php | ContextManageController.actionEdit | public function actionEdit($id = null)
{
if ($id === null) {
$model = new Context;
$dataProvider = null;
} else {
$model = $this->findModel($id);
$dataProvider = new ActiveDataProvider(
[
'query' => Language::find()-... | php | public function actionEdit($id = null)
{
if ($id === null) {
$model = new Context;
$dataProvider = null;
} else {
$model = $this->findModel($id);
$dataProvider = new ActiveDataProvider(
[
'query' => Language::find()-... | [
"public",
"function",
"actionEdit",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"model",
"=",
"new",
"Context",
";",
"$",
"dataProvider",
"=",
"null",
";",
"}",
"else",
"{",
"$",
"model",
"=",
"$",
... | Updates an existing Context model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Context",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/controllers/ContextManageController.php#L79-L110 |
224,345 | DevGroup-ru/yii2-multilingual | src/controllers/ContextManageController.php | ContextManageController.actionEditLanguage | public function actionEditLanguage($id = null, $contextId = null)
{
if ($id === null) {
$model = new Language();
} else {
$model = $this->findLanguageModel($id);
}
if ($contextId !== null) {
$model->context_id = $contextId;
}
$hasAc... | php | public function actionEditLanguage($id = null, $contextId = null)
{
if ($id === null) {
$model = new Language();
} else {
$model = $this->findLanguageModel($id);
}
if ($contextId !== null) {
$model->context_id = $contextId;
}
$hasAc... | [
"public",
"function",
"actionEditLanguage",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"contextId",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"model",
"=",
"new",
"Language",
"(",
")",
";",
"}",
"else",
"{",
"$",
"mod... | Updates an existing Language model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Language",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/controllers/ContextManageController.php#L118-L145 |
224,346 | DevGroup-ru/yii2-multilingual | src/controllers/ContextManageController.php | ContextManageController.actionDeleteLanguage | public function actionDeleteLanguage($id)
{
$model = $this->findLanguageModel($id);
$model->delete();
return $this->redirect(['edit', 'id' => $model->context_id]);
} | php | public function actionDeleteLanguage($id)
{
$model = $this->findLanguageModel($id);
$model->delete();
return $this->redirect(['edit', 'id' => $model->context_id]);
} | [
"public",
"function",
"actionDeleteLanguage",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findLanguageModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"->",
"delete",
"(",
")",
";",
"return",
"$",
"this",
"->",
"redirect",
"(",
"[... | Deletes an existing Language model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Deletes",
"an",
"existing",
"Language",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/controllers/ContextManageController.php#L165-L170 |
224,347 | logical-and/php-oauth | src/OAuth2/Service/Mailchimp.php | Mailchimp.setBaseApiUri | protected function setBaseApiUri(TokenInterface $token)
{
// Make request uri.
$endpoint = 'https://login.mailchimp.com/oauth2/metadata?oauth_token=' . $token->getAccessToken();
// Grab meta data about the token.
$response = $this->httpRequest($endpoint, [], [], 'GET');
// ... | php | protected function setBaseApiUri(TokenInterface $token)
{
// Make request uri.
$endpoint = 'https://login.mailchimp.com/oauth2/metadata?oauth_token=' . $token->getAccessToken();
// Grab meta data about the token.
$response = $this->httpRequest($endpoint, [], [], 'GET');
// ... | [
"protected",
"function",
"setBaseApiUri",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"// Make request uri.",
"$",
"endpoint",
"=",
"'https://login.mailchimp.com/oauth2/metadata?oauth_token='",
".",
"$",
"token",
"->",
"getAccessToken",
"(",
")",
";",
"// Grab meta dat... | Set the right base endpoint.
@param \OAuth\Common\Token\TokenInterface $token
@return $this | [
"Set",
"the",
"right",
"base",
"endpoint",
"."
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/OAuth2/Service/Mailchimp.php#L71-L87 |
224,348 | darrylkuhn/dialect | src/Dialect/Json.php | Json.inspectJsonColumns | public function inspectJsonColumns()
{
foreach ($this->jsonColumns as $col) {
if (!$this->showJsonColumns) {
$this->hidden[] = $col;
}
if(array_key_exists($col, $this->attributes)) {
$obj = json_decode($this->attributes[$col]);
... | php | public function inspectJsonColumns()
{
foreach ($this->jsonColumns as $col) {
if (!$this->showJsonColumns) {
$this->hidden[] = $col;
}
if(array_key_exists($col, $this->attributes)) {
$obj = json_decode($this->attributes[$col]);
... | [
"public",
"function",
"inspectJsonColumns",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"jsonColumns",
"as",
"$",
"col",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"showJsonColumns",
")",
"{",
"$",
"this",
"->",
"hidden",
"[",
"]",
"=",
"$",
... | Decodes each of the declared JSON attributes and records the attributes
on each. | [
"Decodes",
"each",
"of",
"the",
"declared",
"JSON",
"attributes",
"and",
"records",
"the",
"attributes",
"on",
"each",
"."
] | 3027abf3423f0ba1032b07d5ad34a8d1c97900e8 | https://github.com/darrylkuhn/dialect/blob/3027abf3423f0ba1032b07d5ad34a8d1c97900e8/src/Dialect/Json.php#L79-L102 |
224,349 | darrylkuhn/dialect | src/Dialect/Json.php | Json.hintJsonStructure | public function hintJsonStructure($column, $structure)
{
if (json_decode($structure) === null) {
throw new InvalidJsonException();
}
$this->hintedJsonAttributes[$column] = $structure;
// Run the call to add hinted attributes to the internal json
// attributes ar... | php | public function hintJsonStructure($column, $structure)
{
if (json_decode($structure) === null) {
throw new InvalidJsonException();
}
$this->hintedJsonAttributes[$column] = $structure;
// Run the call to add hinted attributes to the internal json
// attributes ar... | [
"public",
"function",
"hintJsonStructure",
"(",
"$",
"column",
",",
"$",
"structure",
")",
"{",
"if",
"(",
"json_decode",
"(",
"$",
"structure",
")",
"===",
"null",
")",
"{",
"throw",
"new",
"InvalidJsonException",
"(",
")",
";",
"}",
"$",
"this",
"->",
... | Sets a hint for a given column.
@param string $column name of column that we're hinting
@param string $structure json encoded structure
@throws InvalidJsonException | [
"Sets",
"a",
"hint",
"for",
"a",
"given",
"column",
"."
] | 3027abf3423f0ba1032b07d5ad34a8d1c97900e8 | https://github.com/darrylkuhn/dialect/blob/3027abf3423f0ba1032b07d5ad34a8d1c97900e8/src/Dialect/Json.php#L141-L153 |
224,350 | darrylkuhn/dialect | src/Dialect/Json.php | Json.hasGetMutator | public function hasGetMutator($key)
{
$jsonPattern = '/'.implode('|', self::$jsonOperators).'/';
if (array_key_exists($key, $this->jsonAttributes) !== false) {
return true;
} // In some cases the key specified may not be a simple key but rather a
// JSON expression (e.g.... | php | public function hasGetMutator($key)
{
$jsonPattern = '/'.implode('|', self::$jsonOperators).'/';
if (array_key_exists($key, $this->jsonAttributes) !== false) {
return true;
} // In some cases the key specified may not be a simple key but rather a
// JSON expression (e.g.... | [
"public",
"function",
"hasGetMutator",
"(",
"$",
"key",
")",
"{",
"$",
"jsonPattern",
"=",
"'/'",
".",
"implode",
"(",
"'|'",
",",
"self",
"::",
"$",
"jsonOperators",
")",
".",
"'/'",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"th... | Include JSON column in the list of attributes that have a get mutator.
@param string $key
@return bool | [
"Include",
"JSON",
"column",
"in",
"the",
"list",
"of",
"attributes",
"that",
"have",
"a",
"get",
"mutator",
"."
] | 3027abf3423f0ba1032b07d5ad34a8d1c97900e8 | https://github.com/darrylkuhn/dialect/blob/3027abf3423f0ba1032b07d5ad34a8d1c97900e8/src/Dialect/Json.php#L173-L188 |
224,351 | darrylkuhn/dialect | src/Dialect/Json.php | Json.getMutatedAttributes | public function getMutatedAttributes()
{
$attributes = parent::getMutatedAttributes();
$jsonAttributes = array_keys($this->jsonAttributes);
return array_merge($attributes, $jsonAttributes);
} | php | public function getMutatedAttributes()
{
$attributes = parent::getMutatedAttributes();
$jsonAttributes = array_keys($this->jsonAttributes);
return array_merge($attributes, $jsonAttributes);
} | [
"public",
"function",
"getMutatedAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"parent",
"::",
"getMutatedAttributes",
"(",
")",
";",
"$",
"jsonAttributes",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"jsonAttributes",
")",
";",
"return",
"array_merge",
"... | Include the JSON attributes in the list of mutated attributes for a
given instance.
@return array | [
"Include",
"the",
"JSON",
"attributes",
"in",
"the",
"list",
"of",
"mutated",
"attributes",
"for",
"a",
"given",
"instance",
"."
] | 3027abf3423f0ba1032b07d5ad34a8d1c97900e8 | https://github.com/darrylkuhn/dialect/blob/3027abf3423f0ba1032b07d5ad34a8d1c97900e8/src/Dialect/Json.php#L196-L202 |
224,352 | darrylkuhn/dialect | src/Dialect/Json.php | Json.mutateAttribute | protected function mutateAttribute($key, $value)
{
$jsonPattern = '/'.implode('|', self::$jsonOperators).'/';
// Test for JSON operators and reduce to end element
$containsJsonOperator = false;
if (preg_match($jsonPattern, $key)) {
$elems = preg_split($jsonPattern, $key... | php | protected function mutateAttribute($key, $value)
{
$jsonPattern = '/'.implode('|', self::$jsonOperators).'/';
// Test for JSON operators and reduce to end element
$containsJsonOperator = false;
if (preg_match($jsonPattern, $key)) {
$elems = preg_split($jsonPattern, $key... | [
"protected",
"function",
"mutateAttribute",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"jsonPattern",
"=",
"'/'",
".",
"implode",
"(",
"'|'",
",",
"self",
"::",
"$",
"jsonOperators",
")",
".",
"'/'",
";",
"// Test for JSON operators and reduce to end e... | Check if the key is a known json attribute and return that value.
@param string $key
@param mixed $value
@return mixed
@throws InvalidJsonException | [
"Check",
"if",
"the",
"key",
"is",
"a",
"known",
"json",
"attribute",
"and",
"return",
"that",
"value",
"."
] | 3027abf3423f0ba1032b07d5ad34a8d1c97900e8 | https://github.com/darrylkuhn/dialect/blob/3027abf3423f0ba1032b07d5ad34a8d1c97900e8/src/Dialect/Json.php#L214-L260 |
224,353 | jeroendesloovere/distance | src/Distance.php | Distance.between | public static function between(
$latitude1,
$longitude1,
$latitude2,
$longitude2,
$decimals = 1,
$unit = 'km'
) {
// define calculation variables
$theta = $longitude1 - $longitude2;
$distance = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2... | php | public static function between(
$latitude1,
$longitude1,
$latitude2,
$longitude2,
$decimals = 1,
$unit = 'km'
) {
// define calculation variables
$theta = $longitude1 - $longitude2;
$distance = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2... | [
"public",
"static",
"function",
"between",
"(",
"$",
"latitude1",
",",
"$",
"longitude1",
",",
"$",
"latitude2",
",",
"$",
"longitude2",
",",
"$",
"decimals",
"=",
"1",
",",
"$",
"unit",
"=",
"'km'",
")",
"{",
"// define calculation variables",
"$",
"theta... | Get distance between two coordinates
@return float
@param decimal $latitude1
@param decimal $longitude1
@param decimal $latitude2
@param decimal $longitude2
@param int $decimals[optional] The amount of decimals
@param string $unit[optional] | [
"Get",
"distance",
"between",
"two",
"coordinates"
] | 7dd9a9f9d9dbe5687ccc249b84f7dd2c64faf79a | https://github.com/jeroendesloovere/distance/blob/7dd9a9f9d9dbe5687ccc249b84f7dd2c64faf79a/src/Distance.php#L25-L50 |
224,354 | jeroendesloovere/distance | src/Distance.php | Distance.getClosest | public static function getClosest(
$latitude1,
$longitude1,
$items,
$decimals = 1,
$unit = 'km'
) {
// init result
$distances = array();
// loop items
foreach ($items as $key => $item) {
// define second item
$latitude2... | php | public static function getClosest(
$latitude1,
$longitude1,
$items,
$decimals = 1,
$unit = 'km'
) {
// init result
$distances = array();
// loop items
foreach ($items as $key => $item) {
// define second item
$latitude2... | [
"public",
"static",
"function",
"getClosest",
"(",
"$",
"latitude1",
",",
"$",
"longitude1",
",",
"$",
"items",
",",
"$",
"decimals",
"=",
"1",
",",
"$",
"unit",
"=",
"'km'",
")",
"{",
"// init result",
"$",
"distances",
"=",
"array",
"(",
")",
";",
... | Get closest location from all locations
@return array The item which is the closest + 'distance' to it.
@param decimal $latitude1
@param decimal $longitude1
@param array $items = array(array('latitude' => 'x', 'longitude' => 'x'), array(xxx))
@param int $decimals[optional] The amount of decimals
@param st... | [
"Get",
"closest",
"location",
"from",
"all",
"locations"
] | 7dd9a9f9d9dbe5687ccc249b84f7dd2c64faf79a | https://github.com/jeroendesloovere/distance/blob/7dd9a9f9d9dbe5687ccc249b84f7dd2c64faf79a/src/Distance.php#L62-L97 |
224,355 | logical-and/php-oauth | src/UserData/ExtractorFactory.php | ExtractorFactory.searchExtractorClassInLib | protected function searchExtractorClassInLib($serviceFullyQualifiedClass)
{
$parts = explode('\\', $serviceFullyQualifiedClass);
$className = $parts[ sizeof($parts) - 1 ];
$extractorClass = sprintf('\OAuth\UserData\Extractor\%s', $className);
if (class_exists($extractorClass)) {
... | php | protected function searchExtractorClassInLib($serviceFullyQualifiedClass)
{
$parts = explode('\\', $serviceFullyQualifiedClass);
$className = $parts[ sizeof($parts) - 1 ];
$extractorClass = sprintf('\OAuth\UserData\Extractor\%s', $className);
if (class_exists($extractorClass)) {
... | [
"protected",
"function",
"searchExtractorClassInLib",
"(",
"$",
"serviceFullyQualifiedClass",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"serviceFullyQualifiedClass",
")",
";",
"$",
"className",
"=",
"$",
"parts",
"[",
"sizeof",
"(",
"$",
... | Search a mapping on the fly by inspecting the library code
@param string $serviceFullyQualifiedClass
@return null|string | [
"Search",
"a",
"mapping",
"on",
"the",
"fly",
"by",
"inspecting",
"the",
"library",
"code"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/ExtractorFactory.php#L80-L91 |
224,356 | DevGroup-ru/yii2-multilingual | src/traits/FileActiveRecord.php | FileActiveRecord.initFileActiveRecord | public function initFileActiveRecord()
{
if (count(static::primaryKey()) === 1) {
$this->on(self::EVENT_BEFORE_INSERT, function ($event) {
if (empty($event->sender->{$event->data['pkName']})) {
/** @var ActiveRecord $className */
$className... | php | public function initFileActiveRecord()
{
if (count(static::primaryKey()) === 1) {
$this->on(self::EVENT_BEFORE_INSERT, function ($event) {
if (empty($event->sender->{$event->data['pkName']})) {
/** @var ActiveRecord $className */
$className... | [
"public",
"function",
"initFileActiveRecord",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"static",
"::",
"primaryKey",
"(",
")",
")",
"===",
"1",
")",
"{",
"$",
"this",
"->",
"on",
"(",
"self",
"::",
"EVENT_BEFORE_INSERT",
",",
"function",
"(",
"$",
"even... | Init events of this trait. | [
"Init",
"events",
"of",
"this",
"trait",
"."
] | 50682a48e216df1dde48b56096640e2ff579a3e0 | https://github.com/DevGroup-ru/yii2-multilingual/blob/50682a48e216df1dde48b56096640e2ff579a3e0/src/traits/FileActiveRecord.php#L12-L24 |
224,357 | turtledesign/royalmail-php | src/Request/Builder.php | Builder.build | static function build($request_name, $params, $helper = NULL) {
return self::processSchema(self::getRequestSchema($request_name), $params, $helper);
} | php | static function build($request_name, $params, $helper = NULL) {
return self::processSchema(self::getRequestSchema($request_name), $params, $helper);
} | [
"static",
"function",
"build",
"(",
"$",
"request_name",
",",
"$",
"params",
",",
"$",
"helper",
"=",
"NULL",
")",
"{",
"return",
"self",
"::",
"processSchema",
"(",
"self",
"::",
"getRequestSchema",
"(",
"$",
"request_name",
")",
",",
"$",
"params",
","... | Build an individual request from schema and params.
@param string $request_name
@param array $params
@param \ArrayObject $helper
@return array | [
"Build",
"an",
"individual",
"request",
"from",
"schema",
"and",
"params",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Request/Builder.php#L27-L29 |
224,358 | turtledesign/royalmail-php | src/Request/Builder.php | Builder.processSchema | static function processSchema($schema, $params, $helper = NULL) {
$built = [];
$errors = [];
(is_null($helper)) ? $helper = ['input' => $params] : $helper['input'] = $params;
$schema['defaults'] = @$schema['defaults'] ?: [];
if (isset($helper['override_defaults'])) $schema['defaults'] = arra... | php | static function processSchema($schema, $params, $helper = NULL) {
$built = [];
$errors = [];
(is_null($helper)) ? $helper = ['input' => $params] : $helper['input'] = $params;
$schema['defaults'] = @$schema['defaults'] ?: [];
if (isset($helper['override_defaults'])) $schema['defaults'] = arra... | [
"static",
"function",
"processSchema",
"(",
"$",
"schema",
",",
"$",
"params",
",",
"$",
"helper",
"=",
"NULL",
")",
"{",
"$",
"built",
"=",
"[",
"]",
";",
"$",
"errors",
"=",
"[",
"]",
";",
"(",
"is_null",
"(",
"$",
"helper",
")",
")",
"?",
"$... | Process the schema and params to validate and structure a request fragment.
@param array $schema instructions for processing the params.
@param array $params values to work with
@throws \RoyalMail\Exception\RequestException on validation failure with details of all failing field values.
@return array values structur... | [
"Process",
"the",
"schema",
"and",
"params",
"to",
"validate",
"and",
"structure",
"a",
"request",
"fragment",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Request/Builder.php#L42-L69 |
224,359 | logical-and/php-oauth | src/Common/Storage/File.php | File.updateFile | private function updateFile()
{
if (is_null($this->file_path)) {
throw new StorageException('Invalid file path');
}
file_put_contents(
$this->file_path,
serialize(
[
'tokens' => $this->tokens,
'state... | php | private function updateFile()
{
if (is_null($this->file_path)) {
throw new StorageException('Invalid file path');
}
file_put_contents(
$this->file_path,
serialize(
[
'tokens' => $this->tokens,
'state... | [
"private",
"function",
"updateFile",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"file_path",
")",
")",
"{",
"throw",
"new",
"StorageException",
"(",
"'Invalid file path'",
")",
";",
"}",
"file_put_contents",
"(",
"$",
"this",
"->",
"file_... | Update file containing tokens and states | [
"Update",
"file",
"containing",
"tokens",
"and",
"states"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/Common/Storage/File.php#L176-L191 |
224,360 | logical-and/php-oauth | src/Common/Storage/File.php | File.parseFromFile | private function parseFromFile()
{
if (is_null($this->file_path)) {
throw new StorageException('Invalid file path');
}
$data = unserialize(file_get_contents($this->file_path));
if ($data === false) {
throw new StorageException('File contents not unserializeab... | php | private function parseFromFile()
{
if (is_null($this->file_path)) {
throw new StorageException('Invalid file path');
}
$data = unserialize(file_get_contents($this->file_path));
if ($data === false) {
throw new StorageException('File contents not unserializeab... | [
"private",
"function",
"parseFromFile",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"file_path",
")",
")",
"{",
"throw",
"new",
"StorageException",
"(",
"'Invalid file path'",
")",
";",
"}",
"$",
"data",
"=",
"unserialize",
"(",
"file_get_... | Get serialized content from a file | [
"Get",
"serialized",
"content",
"from",
"a",
"file"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/Common/Storage/File.php#L196-L209 |
224,361 | appkr/api | src/example/LinkController.php | LinkController.index | public function index(Response $response)
{
$payload = [
'resources' => route('v1.books.index'),
'authors' => route('v1.authors.index'),
];
return $response->setMeta([
'message' => "Hello, I'm a appkr/api example",
'version' => 1,
... | php | public function index(Response $response)
{
$payload = [
'resources' => route('v1.books.index'),
'authors' => route('v1.authors.index'),
];
return $response->setMeta([
'message' => "Hello, I'm a appkr/api example",
'version' => 1,
... | [
"public",
"function",
"index",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"payload",
"=",
"[",
"'resources'",
"=>",
"route",
"(",
"'v1.books.index'",
")",
",",
"'authors'",
"=>",
"route",
"(",
"'v1.authors.index'",
")",
",",
"]",
";",
"return",
"$",
... | Exposure a listing of the endpoints.
@param \Appkr\Api\Http\Response $response
@return \Illuminate\Contracts\Http\Response | [
"Exposure",
"a",
"listing",
"of",
"the",
"endpoints",
"."
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/example/LinkController.php#L16-L30 |
224,362 | logical-and/php-oauth | src/OAuth1/Service/AbstractService.php | AbstractService.buildAuthorizationHeaderForTokenRequest | protected function buildAuthorizationHeaderForTokenRequest(array $extraParameters = [])
{
$parameters = $this->getBasicAuthorizationHeaderInfo();
$parameters = array_merge($parameters, $extraParameters);
$parameters[ 'oauth_signature' ] = $this->signature->getSignature(
$this->ge... | php | protected function buildAuthorizationHeaderForTokenRequest(array $extraParameters = [])
{
$parameters = $this->getBasicAuthorizationHeaderInfo();
$parameters = array_merge($parameters, $extraParameters);
$parameters[ 'oauth_signature' ] = $this->signature->getSignature(
$this->ge... | [
"protected",
"function",
"buildAuthorizationHeaderForTokenRequest",
"(",
"array",
"$",
"extraParameters",
"=",
"[",
"]",
")",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"getBasicAuthorizationHeaderInfo",
"(",
")",
";",
"$",
"parameters",
"=",
"array_merge",
"... | Builds the authorization header for getting an access or request token.
@param array $extraParameters
@return string | [
"Builds",
"the",
"authorization",
"header",
"for",
"getting",
"an",
"access",
"or",
"request",
"token",
"."
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/OAuth1/Service/AbstractService.php#L173-L192 |
224,363 | logical-and/php-oauth | src/OAuth1/Service/AbstractService.php | AbstractService.buildAuthorizationHeaderForAPIRequest | protected function buildAuthorizationHeaderForAPIRequest(
$method,
Url $uri,
TokenInterface $token,
$bodyParams = null
) {
$this->signature->setTokenSecret($token->getAccessTokenSecret());
$authParameters = $this->getBasicAuthorizationHeaderInfo();
if (isset($... | php | protected function buildAuthorizationHeaderForAPIRequest(
$method,
Url $uri,
TokenInterface $token,
$bodyParams = null
) {
$this->signature->setTokenSecret($token->getAccessTokenSecret());
$authParameters = $this->getBasicAuthorizationHeaderInfo();
if (isset($... | [
"protected",
"function",
"buildAuthorizationHeaderForAPIRequest",
"(",
"$",
"method",
",",
"Url",
"$",
"uri",
",",
"TokenInterface",
"$",
"token",
",",
"$",
"bodyParams",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"signature",
"->",
"setTokenSecret",
"(",
"$",
... | Builds the authorization header for an authenticated API request
@param string $method
@param Url $uri The uri the request is headed
@param TokenInterface $token
@param array $bodyParams Request body if applicable (key/value pairs)
@return string | [
"Builds",
"the",
"authorization",
"header",
"for",
"an",
"authenticated",
"API",
"request"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/OAuth1/Service/AbstractService.php#L204-L230 |
224,364 | logical-and/php-oauth | src/OAuth1/Service/AbstractService.php | AbstractService.getBasicAuthorizationHeaderInfo | protected function getBasicAuthorizationHeaderInfo()
{
$dateTime = new \DateTime();
$headerParameters = [
'oauth_callback' => $this->credentials->getCallbackUrl(),
'oauth_consumer_key' => $this->credentials->getConsumerId(),
'oauth_nonce' =>... | php | protected function getBasicAuthorizationHeaderInfo()
{
$dateTime = new \DateTime();
$headerParameters = [
'oauth_callback' => $this->credentials->getCallbackUrl(),
'oauth_consumer_key' => $this->credentials->getConsumerId(),
'oauth_nonce' =>... | [
"protected",
"function",
"getBasicAuthorizationHeaderInfo",
"(",
")",
"{",
"$",
"dateTime",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"headerParameters",
"=",
"[",
"'oauth_callback'",
"=>",
"$",
"this",
"->",
"credentials",
"->",
"getCallbackUrl",
"(",
... | Builds the authorization header array.
@return array | [
"Builds",
"the",
"authorization",
"header",
"array",
"."
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/OAuth1/Service/AbstractService.php#L237-L250 |
224,365 | logical-and/php-oauth | src/OAuth1/Service/AbstractService.php | AbstractService.generateNonce | protected function generateNonce($length = 32)
{
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
$nonce = '';
$maxRand = strlen($characters) - 1;
for ($i = 0; $i < $length; $i++) {
$nonce .= $characters[ rand(0, $maxRand) ];
}
... | php | protected function generateNonce($length = 32)
{
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
$nonce = '';
$maxRand = strlen($characters) - 1;
for ($i = 0; $i < $length; $i++) {
$nonce .= $characters[ rand(0, $maxRand) ];
}
... | [
"protected",
"function",
"generateNonce",
"(",
"$",
"length",
"=",
"32",
")",
"{",
"$",
"characters",
"=",
"'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'",
";",
"$",
"nonce",
"=",
"''",
";",
"$",
"maxRand",
"=",
"strlen",
"(",
"$",
"characters",... | Pseudo random string generator used to build a unique string to sign each request
@param int $length
@return string | [
"Pseudo",
"random",
"string",
"generator",
"used",
"to",
"build",
"a",
"unique",
"string",
"to",
"sign",
"each",
"request"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/OAuth1/Service/AbstractService.php#L259-L270 |
224,366 | turtledesign/royalmail-php | src/Connector/soapConnector.php | soapConnector.doRequest | function doRequest($action, $params = [], $config = []) {
$this->request_input = ['action' => $action, 'parameters' => $params];
return $this->getSoapClient($config)->__soapCall($action, [$params]);
} | php | function doRequest($action, $params = [], $config = []) {
$this->request_input = ['action' => $action, 'parameters' => $params];
return $this->getSoapClient($config)->__soapCall($action, [$params]);
} | [
"function",
"doRequest",
"(",
"$",
"action",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"request_input",
"=",
"[",
"'action'",
"=>",
"$",
"action",
",",
"'parameters'",
"=>",
"$",
"params",
"]... | Send off the request to the Royal Mail API
@see baseConnector::doRequest()
@return \RoyalMail\Response\baseResponse Response class for the request sent. | [
"Send",
"off",
"the",
"request",
"to",
"the",
"Royal",
"Mail",
"API"
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Connector/soapConnector.php#L35-L39 |
224,367 | appkr/api | src/Commands/OptionParser.php | OptionParser.parseSegments | private function parseSegments($field)
{
$field = starts_with('\\', $field) ? $field : '\\' . $field;
$segments = explode(':', $field);
if (count($segments) < 2) {
throw new \Exception(
'--includes option should be consist of string value of model, separated by ... | php | private function parseSegments($field)
{
$field = starts_with('\\', $field) ? $field : '\\' . $field;
$segments = explode(':', $field);
if (count($segments) < 2) {
throw new \Exception(
'--includes option should be consist of string value of model, separated by ... | [
"private",
"function",
"parseSegments",
"(",
"$",
"field",
")",
"{",
"$",
"field",
"=",
"starts_with",
"(",
"'\\\\'",
",",
"$",
"field",
")",
"?",
"$",
"field",
":",
"'\\\\'",
".",
"$",
"field",
";",
"$",
"segments",
"=",
"explode",
"(",
"':'",
",",
... | Get the segments of the option field.
@param string $field
@return array
@throws \Exception | [
"Get",
"the",
"segments",
"of",
"the",
"option",
"field",
"."
] | 5b676f6cf3bc74c9e429226c87505f7455700716 | https://github.com/appkr/api/blob/5b676f6cf3bc74c9e429226c87505f7455700716/src/Commands/OptionParser.php#L53-L86 |
224,368 | JeffreyHyer/bamboohr | src/Api/Company.php | Company.updateFile | public function updateFile($fileId, array $data)
{
$xml = "<file>";
if (isset($data['name'])) {
$xml .= "<name>{$data['name']}</name>";
}
if (isset($data['categoryId'])) {
$xml .= "<categoryId>{$data['categoryId']}</categoryId>";
}
if (isset... | php | public function updateFile($fileId, array $data)
{
$xml = "<file>";
if (isset($data['name'])) {
$xml .= "<name>{$data['name']}</name>";
}
if (isset($data['categoryId'])) {
$xml .= "<categoryId>{$data['categoryId']}</categoryId>";
}
if (isset... | [
"public",
"function",
"updateFile",
"(",
"$",
"fileId",
",",
"array",
"$",
"data",
")",
"{",
"$",
"xml",
"=",
"\"<file>\"",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'name'",
"]",
")",
")",
"{",
"$",
"xml",
".=",
"\"<name>{$data['name']}</name>\... | Update a given file
@param string $fileId
@param array $data ['name' => string, 'categoryId' => integer, 'shareWithEmployee' => 'yes|no']
@return BambooHR\Api\Response | [
"Update",
"a",
"given",
"file"
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/Company.php#L40-L59 |
224,369 | logical-and/php-oauth | src/UserData/Extractor/LazyExtractor.php | LazyExtractor.getLoaderData | protected function getLoaderData($field)
{
$loaderName = $this->loadersMap->getLoaderForField($field);
if (!isset($this->loadersResults[ $loaderName ])) {
$this->loadersResults[ $loaderName ] = $this->{sprintf('%sLoader', $loaderName)}();
}
return $this->loadersResults[ ... | php | protected function getLoaderData($field)
{
$loaderName = $this->loadersMap->getLoaderForField($field);
if (!isset($this->loadersResults[ $loaderName ])) {
$this->loadersResults[ $loaderName ] = $this->{sprintf('%sLoader', $loaderName)}();
}
return $this->loadersResults[ ... | [
"protected",
"function",
"getLoaderData",
"(",
"$",
"field",
")",
"{",
"$",
"loaderName",
"=",
"$",
"this",
"->",
"loadersMap",
"->",
"getLoaderForField",
"(",
"$",
"field",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"loadersResults",
"["... | Get data from a loader.
A loader is a function who is delegated to fetch a request to get the raw data
@param string $field
@return mixed | [
"Get",
"data",
"from",
"a",
"loader",
".",
"A",
"loader",
"is",
"a",
"function",
"who",
"is",
"delegated",
"to",
"fetch",
"a",
"request",
"to",
"get",
"the",
"raw",
"data"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Extractor/LazyExtractor.php#L141-L149 |
224,370 | logical-and/php-oauth | src/UserData/Extractor/LazyExtractor.php | LazyExtractor.extraNormalizer | protected function extraNormalizer($data, $path = '')
{
if (is_array($data)) {
if (!$path) {
$path = $this->normalizersMap->getPathContext();
}
$path = trim($path, '.');
$pathsFields = [];
foreach ($this->normalizersMap->getPathNor... | php | protected function extraNormalizer($data, $path = '')
{
if (is_array($data)) {
if (!$path) {
$path = $this->normalizersMap->getPathContext();
}
$path = trim($path, '.');
$pathsFields = [];
foreach ($this->normalizersMap->getPathNor... | [
"protected",
"function",
"extraNormalizer",
"(",
"$",
"data",
",",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"if",
"(",
"!",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"normalizersM... | Generic "extra normalizer"
@param $data
@param string $path To be overridden
@return array | [
"Generic",
"extra",
"normalizer"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Extractor/LazyExtractor.php#L181-L199 |
224,371 | ericmann/sessionz | php/Manager.php | Manager.seedHandlerStack | protected function seedHandlerStack()
{
if (!is_null($this->handlers)) {
throw new \RuntimeException('Handler stacks can only be seeded once.');
}
$this->stacks = [];
$base = new BaseHandler();
$this->handlers = [$base];
$this->stacks['delete'] = new \Spl... | php | protected function seedHandlerStack()
{
if (!is_null($this->handlers)) {
throw new \RuntimeException('Handler stacks can only be seeded once.');
}
$this->stacks = [];
$base = new BaseHandler();
$this->handlers = [$base];
$this->stacks['delete'] = new \Spl... | [
"protected",
"function",
"seedHandlerStack",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"handlers",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Handler stacks can only be seeded once.'",
")",
";",
"}",
"$",
"this",
... | Seed handler stack with first callable
@throws \RuntimeException if the stack is seeded more than once | [
"Seed",
"handler",
"stack",
"with",
"first",
"callable"
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Manager.php#L99-L118 |
224,372 | ericmann/sessionz | php/Manager.php | Manager.initialize | public static function initialize()
{
$manager = self::$manager = new self();
$manager->seedHandlerStack();
session_set_save_handler($manager);
return $manager;
} | php | public static function initialize()
{
$manager = self::$manager = new self();
$manager->seedHandlerStack();
session_set_save_handler($manager);
return $manager;
} | [
"public",
"static",
"function",
"initialize",
"(",
")",
"{",
"$",
"manager",
"=",
"self",
"::",
"$",
"manager",
"=",
"new",
"self",
"(",
")",
";",
"$",
"manager",
"->",
"seedHandlerStack",
"(",
")",
";",
"session_set_save_handler",
"(",
"$",
"manager",
"... | Initialize the session manager.
Invoking this function multiple times will reset the manager itself
and purge any handlers already registered with the system.
@return Manager | [
"Initialize",
"the",
"session",
"manager",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Manager.php#L128-L136 |
224,373 | ericmann/sessionz | php/Manager.php | Manager.close | public function close()
{
$this->handlerLock = true;
while (count($this->handlers) > 0) {
array_pop($this->handlers);
$this->stacks['delete']->pop();
$this->stacks['clean']->pop();
$this->stacks['create']->pop();
$this->stacks['read']->pop... | php | public function close()
{
$this->handlerLock = true;
while (count($this->handlers) > 0) {
array_pop($this->handlers);
$this->stacks['delete']->pop();
$this->stacks['clean']->pop();
$this->stacks['create']->pop();
$this->stacks['read']->pop... | [
"public",
"function",
"close",
"(",
")",
"{",
"$",
"this",
"->",
"handlerLock",
"=",
"true",
";",
"while",
"(",
"count",
"(",
"$",
"this",
"->",
"handlers",
")",
">",
"0",
")",
"{",
"array_pop",
"(",
"$",
"this",
"->",
"handlers",
")",
";",
"$",
... | Close the current session.
Will iterate through all handlers registered to the manager and
remove them from the stack. This has the effect of removing the
objects from scope and triggering their destructors. Any cleanup
should happen there.
@return true | [
"Close",
"the",
"current",
"session",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Manager.php#L148-L163 |
224,374 | ericmann/sessionz | php/Manager.php | Manager.destroy | public function destroy($session_id)
{
if (is_null($this->handlers)) {
$this->seedHandlerStack();
}
/** @var callable $start */
$start = $this->stacks['delete']->top();
$this->handlerLock = true;
$data = $start($session_id);
$this->handlerLock = f... | php | public function destroy($session_id)
{
if (is_null($this->handlers)) {
$this->seedHandlerStack();
}
/** @var callable $start */
$start = $this->stacks['delete']->top();
$this->handlerLock = true;
$data = $start($session_id);
$this->handlerLock = f... | [
"public",
"function",
"destroy",
"(",
"$",
"session_id",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"handlers",
")",
")",
"{",
"$",
"this",
"->",
"seedHandlerStack",
"(",
")",
";",
"}",
"/** @var callable $start */",
"$",
"start",
"=",
"$",
... | Destroy a session by either invalidating it or forcibly removing
it from session storage.
@param string $session_id ID of the session to destroy.
@return bool | [
"Destroy",
"a",
"session",
"by",
"either",
"invalidating",
"it",
"or",
"forcibly",
"removing",
"it",
"from",
"session",
"storage",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Manager.php#L173-L185 |
224,375 | ericmann/sessionz | php/Manager.php | Manager.open | public function open($save_path, $name)
{
if (is_null($this->handlers)) {
$this->seedHandlerStack();
}
/** @var callable $start */
$start = $this->stacks['create']->top();
$this->handlerLock = true;
$data = $start($save_path, $name);
$this->handle... | php | public function open($save_path, $name)
{
if (is_null($this->handlers)) {
$this->seedHandlerStack();
}
/** @var callable $start */
$start = $this->stacks['create']->top();
$this->handlerLock = true;
$data = $start($save_path, $name);
$this->handle... | [
"public",
"function",
"open",
"(",
"$",
"save_path",
",",
"$",
"name",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"handlers",
")",
")",
"{",
"$",
"this",
"->",
"seedHandlerStack",
"(",
")",
";",
"}",
"/** @var callable $start */",
"$",
"st... | Create a new session storage.
@param string $save_path File location/path where sessions should be written.
@param string $name Unique name of the storage instance.
@return bool | [
"Create",
"a",
"new",
"session",
"storage",
"."
] | b1a278c54aa13035ed0ca0c297fb117d04036d9b | https://github.com/ericmann/sessionz/blob/b1a278c54aa13035ed0ca0c297fb117d04036d9b/php/Manager.php#L217-L229 |
224,376 | logical-and/php-oauth | src/UserData/Extractor/Extractor.php | Extractor.getField | protected function getField($field)
{
if ($this->isFieldSupported($field) && isset($this->fields[ $field ])) {
return $this->fields[ $field ];
}
return null;
} | php | protected function getField($field)
{
if ($this->isFieldSupported($field) && isset($this->fields[ $field ])) {
return $this->fields[ $field ];
}
return null;
} | [
"protected",
"function",
"getField",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isFieldSupported",
"(",
"$",
"field",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"field",
"]",
")",
")",
"{",
"return",
"$",
"this... | Get the value for a given field
@param string $field the name of the field
@return null|mixed | [
"Get",
"the",
"value",
"for",
"a",
"given",
"field"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Extractor/Extractor.php#L377-L384 |
224,377 | logical-and/php-oauth | src/UserData/Extractor/Extractor.php | Extractor.getAllFields | protected static function getAllFields()
{
return FieldsValues::construct(
[
self::FIELD_UNIQUE_ID,
self::FIELD_USERNAME,
self::FIELD_FIRST_NAME,
self::FIELD_LAST_NAME,
self::FIELD_FULL_NAME,
self::FI... | php | protected static function getAllFields()
{
return FieldsValues::construct(
[
self::FIELD_UNIQUE_ID,
self::FIELD_USERNAME,
self::FIELD_FIRST_NAME,
self::FIELD_LAST_NAME,
self::FIELD_FULL_NAME,
self::FI... | [
"protected",
"static",
"function",
"getAllFields",
"(",
")",
"{",
"return",
"FieldsValues",
"::",
"construct",
"(",
"[",
"self",
"::",
"FIELD_UNIQUE_ID",
",",
"self",
"::",
"FIELD_USERNAME",
",",
"self",
"::",
"FIELD_FIRST_NAME",
",",
"self",
"::",
"FIELD_LAST_N... | Get an array listing all fields names
@return FieldsValues | [
"Get",
"an",
"array",
"listing",
"all",
"fields",
"names"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Extractor/Extractor.php#L403-L422 |
224,378 | JeffreyHyer/bamboohr | src/Api/TimeOff.php | TimeOff.submitRequest | public function submitRequest($employeeId, array $data = [])
{
$xml = "<request>";
if (isset($data['status'])) {
$xml .= "<status>{$data['status']}</status>";
} else {
$xml .= "<status>requested</status>";
}
$xml .= "<start>{$data['start']}</start>
... | php | public function submitRequest($employeeId, array $data = [])
{
$xml = "<request>";
if (isset($data['status'])) {
$xml .= "<status>{$data['status']}</status>";
} else {
$xml .= "<status>requested</status>";
}
$xml .= "<start>{$data['start']}</start>
... | [
"public",
"function",
"submitRequest",
"(",
"$",
"employeeId",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"xml",
"=",
"\"<request>\"",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'status'",
"]",
")",
")",
"{",
"$",
"xml",
".=",
... | Submit a new time off request for a given employeeId
@param string $employeeId
@param array $data An array of data describing the time off request
[
'start' => [ISO-8601 Date],
'end' => [ISO-8601 Date],
'timeOffTypeId' => [integer], // Comes from the Metadata API...
'amount' => [integer], // Ignored if 'dates' is... | [
"Submit",
"a",
"new",
"time",
"off",
"request",
"for",
"a",
"given",
"employeeId"
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/TimeOff.php#L46-L80 |
224,379 | JeffreyHyer/bamboohr | src/Api/TimeOff.php | TimeOff.addHistoryEntry | public function addHistoryEntry($employeeId, $requestId, string $date, string $note)
{
$xml = "
<history>
<date>{$date}</date>
<eventType>used</eventType>
<timeOffRequestId>{$requestId}</timeOffRequestId>
<note>{$note}</note>
... | php | public function addHistoryEntry($employeeId, $requestId, string $date, string $note)
{
$xml = "
<history>
<date>{$date}</date>
<eventType>used</eventType>
<timeOffRequestId>{$requestId}</timeOffRequestId>
<note>{$note}</note>
... | [
"public",
"function",
"addHistoryEntry",
"(",
"$",
"employeeId",
",",
"$",
"requestId",
",",
"string",
"$",
"date",
",",
"string",
"$",
"note",
")",
"{",
"$",
"xml",
"=",
"\"\n <history>\n <date>{$date}</date>\n <eventType>used</ev... | Add a time off history entry
@param string $employeeId
@param string $requestId
@param string $date
@param string $note
@return \BambooHR\Api\Response | [
"Add",
"a",
"time",
"off",
"history",
"entry"
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/TimeOff.php#L113-L125 |
224,380 | JeffreyHyer/bamboohr | src/Api/TimeOff.php | TimeOff.assignedPolicies | public function assignedPolicies($employeeId)
{
$this->bamboo->options['version'] = 'v1_1';
$response = $this->get("employees/{$employeeId}/time_off/policies");
$this->bamboo->options['version'] = 'v1';
return $response;
} | php | public function assignedPolicies($employeeId)
{
$this->bamboo->options['version'] = 'v1_1';
$response = $this->get("employees/{$employeeId}/time_off/policies");
$this->bamboo->options['version'] = 'v1';
return $response;
} | [
"public",
"function",
"assignedPolicies",
"(",
"$",
"employeeId",
")",
"{",
"$",
"this",
"->",
"bamboo",
"->",
"options",
"[",
"'version'",
"]",
"=",
"'v1_1'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"get",
"(",
"\"employees/{$employeeId}/time_off/polici... | List assigned time off policies for a given employee
@param string $employeeId
@return \BambooHR\Api\Response | [
"List",
"assigned",
"time",
"off",
"policies",
"for",
"a",
"given",
"employee"
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/TimeOff.php#L134-L143 |
224,381 | JeffreyHyer/bamboohr | src/Api/TimeOff.php | TimeOff.assignPolicy | public function assignPolicy($employeeId, array $policies)
{
$this->bamboo->options['version'] = 'v1_1';
$response = $this->put("employees/{$employeeId}/time_off/policies", json_encode($policies));
$this->bamboo->options['version'] = 'v1';
return $response;
} | php | public function assignPolicy($employeeId, array $policies)
{
$this->bamboo->options['version'] = 'v1_1';
$response = $this->put("employees/{$employeeId}/time_off/policies", json_encode($policies));
$this->bamboo->options['version'] = 'v1';
return $response;
} | [
"public",
"function",
"assignPolicy",
"(",
"$",
"employeeId",
",",
"array",
"$",
"policies",
")",
"{",
"$",
"this",
"->",
"bamboo",
"->",
"options",
"[",
"'version'",
"]",
"=",
"'v1_1'",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"put",
"(",
"\"empl... | Assign one or more time off policies to a given employee
@link https://www.bamboohr.com/api/documentation/time_off.php#assignTimeOffPolicies1.1
@param string $employeeId
@param array $policies
@return \BambooHR\Api\Response | [
"Assign",
"one",
"or",
"more",
"time",
"off",
"policies",
"to",
"a",
"given",
"employee"
] | bdf8beab6573a818e906e4f0a3516b68f37c3b17 | https://github.com/JeffreyHyer/bamboohr/blob/bdf8beab6573a818e906e4f0a3516b68f37c3b17/src/Api/TimeOff.php#L155-L164 |
224,382 | oroinc/OroMessageQueueComponent | Transport/QueueCollection.php | QueueCollection.get | public function get($queueName)
{
if (!isset($this->queues[$queueName])) {
throw new \OutOfBoundsException(sprintf('The collection does not contain the queue "%s".', $queueName));
}
return $this->queues[$queueName];
} | php | public function get($queueName)
{
if (!isset($this->queues[$queueName])) {
throw new \OutOfBoundsException(sprintf('The collection does not contain the queue "%s".', $queueName));
}
return $this->queues[$queueName];
} | [
"public",
"function",
"get",
"(",
"$",
"queueName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"queues",
"[",
"$",
"queueName",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The collection does n... | Gets the queue by its name.
@param string $queueName
@return QueueInterface | [
"Gets",
"the",
"queue",
"by",
"its",
"name",
"."
] | 6f1fdb12aebcfc6beae074ce492f496ed9847a77 | https://github.com/oroinc/OroMessageQueueComponent/blob/6f1fdb12aebcfc6beae074ce492f496ed9847a77/Transport/QueueCollection.php#L32-L39 |
224,383 | oroinc/OroMessageQueueComponent | Transport/QueueCollection.php | QueueCollection.remove | public function remove($queueName)
{
$queue = null;
if (isset($this->queues[$queueName])) {
$queue = $this->queues[$queueName];
}
unset($this->queues[$queueName]);
return $queue;
} | php | public function remove($queueName)
{
$queue = null;
if (isset($this->queues[$queueName])) {
$queue = $this->queues[$queueName];
}
unset($this->queues[$queueName]);
return $queue;
} | [
"public",
"function",
"remove",
"(",
"$",
"queueName",
")",
"{",
"$",
"queue",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"queues",
"[",
"$",
"queueName",
"]",
")",
")",
"{",
"$",
"queue",
"=",
"$",
"this",
"->",
"queues",
"[",... | Removes the queue from the collection.
@param string $queueName
@return QueueInterface|null The removed queue or NULL,
if the collection did not contain a queue with the given name. | [
"Removes",
"the",
"queue",
"from",
"the",
"collection",
"."
] | 6f1fdb12aebcfc6beae074ce492f496ed9847a77 | https://github.com/oroinc/OroMessageQueueComponent/blob/6f1fdb12aebcfc6beae074ce492f496ed9847a77/Transport/QueueCollection.php#L61-L70 |
224,384 | turtledesign/royalmail-php | src/Filter/Filters.php | Filters.doSkipThisIfThatEmpty | static function doSkipThisIfThatEmpty($val, $settings, $helper = NULL) {
if (is_string($settings)) $settings = ['that' => $settings];
if (! self::checkPath($settings['that'], [], $helper)) throw new SkipException('Skipping as ' . $settings['that'] . ' is blank');
return $val;
} | php | static function doSkipThisIfThatEmpty($val, $settings, $helper = NULL) {
if (is_string($settings)) $settings = ['that' => $settings];
if (! self::checkPath($settings['that'], [], $helper)) throw new SkipException('Skipping as ' . $settings['that'] . ' is blank');
return $val;
} | [
"static",
"function",
"doSkipThisIfThatEmpty",
"(",
"$",
"val",
",",
"$",
"settings",
",",
"$",
"helper",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"settings",
")",
")",
"$",
"settings",
"=",
"[",
"'that'",
"=>",
"$",
"settings",
"]",
... | Skip this field if another field is empty - works on input array so far, can add output test later. | [
"Skip",
"this",
"field",
"if",
"another",
"field",
"is",
"empty",
"-",
"works",
"on",
"input",
"array",
"so",
"far",
"can",
"add",
"output",
"test",
"later",
"."
] | 750c4277bcff5466ac73927ece8aae439b74efde | https://github.com/turtledesign/royalmail-php/blob/750c4277bcff5466ac73927ece8aae439b74efde/src/Filter/Filters.php#L173-L179 |
224,385 | pug-php/pug-assets | src/Pug/Assets.php | Assets.unsetMinify | public function unsetMinify()
{
$this->pug->removeKeyword('assets');
$this->pug->removeKeyword('concat');
$this->pug->removeKeyword('concat-to');
$this->pug->removeKeyword('minify');
$this->pug->removeKeyword('minify-to');
$this->minify = null;
return $this;
... | php | public function unsetMinify()
{
$this->pug->removeKeyword('assets');
$this->pug->removeKeyword('concat');
$this->pug->removeKeyword('concat-to');
$this->pug->removeKeyword('minify');
$this->pug->removeKeyword('minify-to');
$this->minify = null;
return $this;
... | [
"public",
"function",
"unsetMinify",
"(",
")",
"{",
"$",
"this",
"->",
"pug",
"->",
"removeKeyword",
"(",
"'assets'",
")",
";",
"$",
"this",
"->",
"pug",
"->",
"removeKeyword",
"(",
"'concat'",
")",
";",
"$",
"this",
"->",
"pug",
"->",
"removeKeyword",
... | Remove the keywords.
@return self $this | [
"Remove",
"the",
"keywords",
"."
] | 65dcf323517cc1ffa407d5200b50f4910056cf3c | https://github.com/pug-php/pug-assets/blob/65dcf323517cc1ffa407d5200b50f4910056cf3c/src/Pug/Assets.php#L133-L143 |
224,386 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.method | public function method($field, $methodName = null)
{
if (!$methodName) {
$methodName = $field;
}
if (!is_string($field)) {
throw new GenericException('Must be a string!');
}
if (!is_string($methodName)) {
throw new GenericException('Must b... | php | public function method($field, $methodName = null)
{
if (!$methodName) {
$methodName = $field;
}
if (!is_string($field)) {
throw new GenericException('Must be a string!');
}
if (!is_string($methodName)) {
throw new GenericException('Must b... | [
"public",
"function",
"method",
"(",
"$",
"field",
",",
"$",
"methodName",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"methodName",
")",
"{",
"$",
"methodName",
"=",
"$",
"field",
";",
"}",
"if",
"(",
"!",
"is_string",
"(",
"$",
"field",
")",
")... | Add field method
@param $field
@param null $methodName
@return $this
@throws GenericException | [
"Add",
"field",
"method"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L107-L126 |
224,387 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.methods | public function methods(array $fieldsMethods)
{
foreach ($fieldsMethods as $field => $path) {
$this->method($field, $path);
}
return $this;
} | php | public function methods(array $fieldsMethods)
{
foreach ($fieldsMethods as $field => $path) {
$this->method($field, $path);
}
return $this;
} | [
"public",
"function",
"methods",
"(",
"array",
"$",
"fieldsMethods",
")",
"{",
"foreach",
"(",
"$",
"fieldsMethods",
"as",
"$",
"field",
"=>",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"method",
"(",
"$",
"field",
",",
"$",
"path",
")",
";",
"}",
"... | Add fields methods
@param array $fieldsMethods
@return $this | [
"Add",
"fields",
"methods"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L135-L142 |
224,388 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.path | public function path($field, $path, $defaultValue = null)
{
if (!is_string($field)) {
throw new GenericException('Must be a string!');
}
if (!is_string($path)) {
throw new GenericException('Must be not empty string!');
}
$this->fields[ $field ] = [
... | php | public function path($field, $path, $defaultValue = null)
{
if (!is_string($field)) {
throw new GenericException('Must be a string!');
}
if (!is_string($path)) {
throw new GenericException('Must be not empty string!');
}
$this->fields[ $field ] = [
... | [
"public",
"function",
"path",
"(",
"$",
"field",
",",
"$",
"path",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"field",
")",
")",
"{",
"throw",
"new",
"GenericException",
"(",
"'Must be a string!'",
")",
";",... | Add field path
@param $field
@param $path
@param null $defaultValue
@return $this
@throws GenericException | [
"Add",
"field",
"path"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L154-L172 |
224,389 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.paths | public function paths(array $fieldPaths)
{
foreach ($fieldPaths as $field => $path) {
if (is_array($path)) {
$this->path($field, $path[ 0 ], $path[ 1 ]);
} else {
$this->path($field, $path);
}
}
return $this;
} | php | public function paths(array $fieldPaths)
{
foreach ($fieldPaths as $field => $path) {
if (is_array($path)) {
$this->path($field, $path[ 0 ], $path[ 1 ]);
} else {
$this->path($field, $path);
}
}
return $this;
} | [
"public",
"function",
"paths",
"(",
"array",
"$",
"fieldPaths",
")",
"{",
"foreach",
"(",
"$",
"fieldPaths",
"as",
"$",
"field",
"=>",
"$",
"path",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->",
"path",
"(",
... | Add fields paths
@param array $fieldPaths
@return $this | [
"Add",
"fields",
"paths"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L181-L192 |
224,390 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.prefilled | public function prefilled($field, $value)
{
$this->fields[ $field ] = [
'type' => self::TYPE_PREFILLED_VALUE,
'value' => $value
];
return $this;
} | php | public function prefilled($field, $value)
{
$this->fields[ $field ] = [
'type' => self::TYPE_PREFILLED_VALUE,
'value' => $value
];
return $this;
} | [
"public",
"function",
"prefilled",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"fields",
"[",
"$",
"field",
"]",
"=",
"[",
"'type'",
"=>",
"self",
"::",
"TYPE_PREFILLED_VALUE",
",",
"'value'",
"=>",
"$",
"value",
"]",
";",
"ret... | Only return value if data loaded
@param $field
@param $value
@return $this | [
"Only",
"return",
"value",
"if",
"data",
"loaded"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L216-L224 |
224,391 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.getNormalizerForField | public function getNormalizerForField($field)
{
if (!empty($this->fields[ $field ])) {
return $this->fields[ $field ];
} else {
return false;
}
} | php | public function getNormalizerForField($field)
{
if (!empty($this->fields[ $field ])) {
return $this->fields[ $field ];
} else {
return false;
}
} | [
"public",
"function",
"getNormalizerForField",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"field",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"fields",
"[",
"$",
"field",
"]",
";",
"}",
... | Get normalizer for field
@param $field
@return bool|array Array if found or false otherwise | [
"Get",
"normalizer",
"for",
"field"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L235-L242 |
224,392 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.pathContext | public function pathContext($pathContext)
{
if (!is_string($pathContext)) {
throw new GenericException('Must be a string!');
}
$this->contextPath = ltrim($pathContext . '.', '.');
return $this;
} | php | public function pathContext($pathContext)
{
if (!is_string($pathContext)) {
throw new GenericException('Must be a string!');
}
$this->contextPath = ltrim($pathContext . '.', '.');
return $this;
} | [
"public",
"function",
"pathContext",
"(",
"$",
"pathContext",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"pathContext",
")",
")",
"{",
"throw",
"new",
"GenericException",
"(",
"'Must be a string!'",
")",
";",
"}",
"$",
"this",
"->",
"contextPath",
"=... | Set path context. All next fields will be added with prepended path
@see NormalizersMap::prependByPathContext
@param $pathContext
@return $this
@throws \OAuth\UserData\Exception\GenericException | [
"Set",
"path",
"context",
".",
"All",
"next",
"fields",
"will",
"be",
"added",
"with",
"prepended",
"path"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L279-L288 |
224,393 | logical-and/php-oauth | src/UserData/Arguments/NormalizersMap.php | NormalizersMap.prependByPathContext | public function prependByPathContext($pathContext)
{
$this->pathContext($pathContext);
foreach ($this->getPathNormalizers() as $field => $normalizer) {
$this->path($field, $normalizer[ 'pathWithoutContext' ], $normalizer[ 'defaultValue' ]);
}
return $this;
} | php | public function prependByPathContext($pathContext)
{
$this->pathContext($pathContext);
foreach ($this->getPathNormalizers() as $field => $normalizer) {
$this->path($field, $normalizer[ 'pathWithoutContext' ], $normalizer[ 'defaultValue' ]);
}
return $this;
} | [
"public",
"function",
"prependByPathContext",
"(",
"$",
"pathContext",
")",
"{",
"$",
"this",
"->",
"pathContext",
"(",
"$",
"pathContext",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getPathNormalizers",
"(",
")",
"as",
"$",
"field",
"=>",
"$",
"normali... | Prepend all added fields paths
@param $pathContext
@return $this | [
"Prepend",
"all",
"added",
"fields",
"paths"
] | 48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf | https://github.com/logical-and/php-oauth/blob/48fa6e74b147f5a689cb6a03dcf9ea67d1d98bbf/src/UserData/Arguments/NormalizersMap.php#L297-L306 |
224,394 | oroinc/OroMessageQueueComponent | Job/JobProcessor.php | JobProcessor.cancelAllNotStartedChildJobs | public function cancelAllNotStartedChildJobs(Job $job)
{
if (!$job->isRoot() || !$job->getChildJobs()) {
return;
}
foreach ($job->getChildJobs() as $childJob) {
if (in_array($childJob->getStatus(), $this->getNotStartedJobStatuses(), true)) {
$this->ca... | php | public function cancelAllNotStartedChildJobs(Job $job)
{
if (!$job->isRoot() || !$job->getChildJobs()) {
return;
}
foreach ($job->getChildJobs() as $childJob) {
if (in_array($childJob->getStatus(), $this->getNotStartedJobStatuses(), true)) {
$this->ca... | [
"public",
"function",
"cancelAllNotStartedChildJobs",
"(",
"Job",
"$",
"job",
")",
"{",
"if",
"(",
"!",
"$",
"job",
"->",
"isRoot",
"(",
")",
"||",
"!",
"$",
"job",
"->",
"getChildJobs",
"(",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
... | Cancels running for all child jobs that are not in run status.
@param Job $job | [
"Cancels",
"running",
"for",
"all",
"child",
"jobs",
"that",
"are",
"not",
"in",
"run",
"status",
"."
] | 6f1fdb12aebcfc6beae074ce492f496ed9847a77 | https://github.com/oroinc/OroMessageQueueComponent/blob/6f1fdb12aebcfc6beae074ce492f496ed9847a77/Job/JobProcessor.php#L404-L415 |
224,395 | projek-xyz/slim-framework | src/DefaultMiddleware.php | DefaultMiddleware.filterTrailingSlash | protected function filterTrailingSlash(UriInterface $uri)
{
$path = $uri->getPath();
if (strlen($path) > 1 && substr($path, -1) === '/') {
$path = substr($path, 0, -1);
}
return $path;
} | php | protected function filterTrailingSlash(UriInterface $uri)
{
$path = $uri->getPath();
if (strlen($path) > 1 && substr($path, -1) === '/') {
$path = substr($path, 0, -1);
}
return $path;
} | [
"protected",
"function",
"filterTrailingSlash",
"(",
"UriInterface",
"$",
"uri",
")",
"{",
"$",
"path",
"=",
"$",
"uri",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"path",
")",
">",
"1",
"&&",
"substr",
"(",
"$",
"path",
",",
"-... | Provide filter to trim trailing slashes in URI path
@deprecated
@param \Psr\Http\Message\UriInterface $uri
@return string | [
"Provide",
"filter",
"to",
"trim",
"trailing",
"slashes",
"in",
"URI",
"path"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/DefaultMiddleware.php#L50-L59 |
224,396 | projek-xyz/slim-framework | src/DefaultMiddleware.php | DefaultMiddleware.filterRequestMethod | protected function filterRequestMethod(Request $req)
{
$method = strtoupper($req->getMethod());
if ($method != 'POST') {
return $req;
}
$params = $req->getParsedBody();
if (isset($params['_method'])) {
$req = $req->withMethod($params['_method']);
... | php | protected function filterRequestMethod(Request $req)
{
$method = strtoupper($req->getMethod());
if ($method != 'POST') {
return $req;
}
$params = $req->getParsedBody();
if (isset($params['_method'])) {
$req = $req->withMethod($params['_method']);
... | [
"protected",
"function",
"filterRequestMethod",
"(",
"Request",
"$",
"req",
")",
"{",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"req",
"->",
"getMethod",
"(",
")",
")",
";",
"if",
"(",
"$",
"method",
"!=",
"'POST'",
")",
"{",
"return",
"$",
"req",
... | This provide a method-overwrite for GET and POST request
@param \Slim\Http\Request $req
@return \Slim\Http\Request | [
"This",
"provide",
"a",
"method",
"-",
"overwrite",
"for",
"GET",
"and",
"POST",
"request"
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/DefaultMiddleware.php#L67-L82 |
224,397 | maxmind/ccfd-api-php | src/CreditCardFraudDetection.php | CreditCardFraudDetection.filter_field | public function filter_field($key, $value)
{
if ($key == 'emailMD5' && false !== strpos($value, '@')) {
return md5(strtolower($value));
}
if (($key == 'usernameMD5' || $key == 'passwordMD5')
&& strlen($value) != 32
) {
return md5(strtolower($value... | php | public function filter_field($key, $value)
{
if ($key == 'emailMD5' && false !== strpos($value, '@')) {
return md5(strtolower($value));
}
if (($key == 'usernameMD5' || $key == 'passwordMD5')
&& strlen($value) != 32
) {
return md5(strtolower($value... | [
"public",
"function",
"filter_field",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"'emailMD5'",
"&&",
"false",
"!==",
"strpos",
"(",
"$",
"value",
",",
"'@'",
")",
")",
"{",
"return",
"md5",
"(",
"strtolower",
"(",
"$... | If key matches one of 'emailMD5', 'usernameMD5' or 'passwordMD5',
convert value to lowercase and return the md5.
If key does not match one of the above, just return the value.
@see HTTPBase::filter_field()
@param string $key
@param string $value
@return string | [
"If",
"key",
"matches",
"one",
"of",
"emailMD5",
"usernameMD5",
"or",
"passwordMD5",
"convert",
"value",
"to",
"lowercase",
"and",
"return",
"the",
"md5",
"."
] | 5f6c2a5454e755f1c56be17a1fc0c97576ff010e | https://github.com/maxmind/ccfd-api-php/blob/5f6c2a5454e755f1c56be17a1fc0c97576ff010e/src/CreditCardFraudDetection.php#L119-L132 |
224,398 | projek-xyz/slim-framework | src/Mailer.php | Mailer.send | public function send($subject, $content, $data = [], callable $callback = null)
{
$this->driver->subject($subject)->content($content, $data);
if (null !== $callback) {
$callback($this->driver);
}
return $this->driver->send();
} | php | public function send($subject, $content, $data = [], callable $callback = null)
{
$this->driver->subject($subject)->content($content, $data);
if (null !== $callback) {
$callback($this->driver);
}
return $this->driver->send();
} | [
"public",
"function",
"send",
"(",
"$",
"subject",
",",
"$",
"content",
",",
"$",
"data",
"=",
"[",
"]",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"driver",
"->",
"subject",
"(",
"$",
"subject",
")",
"->",
"content... | Send the thing.
@param string $subject
@param string $content
@param array $data
@param callable|null $callback
@return mixed | [
"Send",
"the",
"thing",
"."
] | 733337b7be3db6629a151e2e2cd0068cdb2c1daf | https://github.com/projek-xyz/slim-framework/blob/733337b7be3db6629a151e2e2cd0068cdb2c1daf/src/Mailer.php#L59-L68 |
224,399 | Flowpack/Flowpack.SimpleSearch | Classes/Search/SqLiteQueryBuilder.php | SqLiteQueryBuilder.injectIndexClient | public function injectIndexClient(\Flowpack\SimpleSearch\Domain\Service\IndexInterface $indexClient) {
$this->indexClient = $indexClient;
} | php | public function injectIndexClient(\Flowpack\SimpleSearch\Domain\Service\IndexInterface $indexClient) {
$this->indexClient = $indexClient;
} | [
"public",
"function",
"injectIndexClient",
"(",
"\\",
"Flowpack",
"\\",
"SimpleSearch",
"\\",
"Domain",
"\\",
"Service",
"\\",
"IndexInterface",
"$",
"indexClient",
")",
"{",
"$",
"this",
"->",
"indexClient",
"=",
"$",
"indexClient",
";",
"}"
] | Injection method used by Flow dependency injection
@param \Flowpack\SimpleSearch\Domain\Service\IndexInterface $indexClient | [
"Injection",
"method",
"used",
"by",
"Flow",
"dependency",
"injection"
] | f231fa434a873e6bb60c95e63cf92dc536a0ccb6 | https://github.com/Flowpack/Flowpack.SimpleSearch/blob/f231fa434a873e6bb60c95e63cf92dc536a0ccb6/Classes/Search/SqLiteQueryBuilder.php#L50-L52 |
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.