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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4,600 | easy-system/es-http | src/Uploading/AbstractUploadStrategy.php | AbstractUploadStrategy.decideOnSuccess | protected function decideOnSuccess()
{
$this->state = static::STATE_SUCCESS;
$this->operationError = null;
$this->operationErrorDescription = null;
} | php | protected function decideOnSuccess()
{
$this->state = static::STATE_SUCCESS;
$this->operationError = null;
$this->operationErrorDescription = null;
} | [
"protected",
"function",
"decideOnSuccess",
"(",
")",
"{",
"$",
"this",
"->",
"state",
"=",
"static",
"::",
"STATE_SUCCESS",
";",
"$",
"this",
"->",
"operationError",
"=",
"null",
";",
"$",
"this",
"->",
"operationErrorDescription",
"=",
"null",
";",
"}"
] | Decides on success. | [
"Decides",
"on",
"success",
"."
] | dd5852e94901e147a7546a8715133408ece767a1 | https://github.com/easy-system/es-http/blob/dd5852e94901e147a7546a8715133408ece767a1/src/Uploading/AbstractUploadStrategy.php#L148-L154 |
4,601 | marando/phpSOFA | src/Marando/IAU/iauGd2gc.php | iauGd2gc.Gd2gc | public static function Gd2gc(iauRefEllips $n, $elong, $phi, $height,
array &$xyz) {
$j;
$a;
$f;
/* Obtain reference ellipsoid parameters. */
$j = IAU::Eform($n, $a, $f);
/* If OK, transform longitude, geodetic latitude, height to x,y,z. */
if ($j == 0) {
$j = IAU::Gd2gce($... | php | public static function Gd2gc(iauRefEllips $n, $elong, $phi, $height,
array &$xyz) {
$j;
$a;
$f;
/* Obtain reference ellipsoid parameters. */
$j = IAU::Eform($n, $a, $f);
/* If OK, transform longitude, geodetic latitude, height to x,y,z. */
if ($j == 0) {
$j = IAU::Gd2gce($... | [
"public",
"static",
"function",
"Gd2gc",
"(",
"iauRefEllips",
"$",
"n",
",",
"$",
"elong",
",",
"$",
"phi",
",",
"$",
"height",
",",
"array",
"&",
"$",
"xyz",
")",
"{",
"$",
"j",
";",
"$",
"a",
";",
"$",
"f",
";",
"/* Obtain reference ellipsoid param... | - - - - - - - - -
i a u G d 2 g c
- - - - - - - - -
Transform geodetic coordinates to geocentric using the specified
reference ellipsoid.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical transformation.
Given:
n i... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"G",
"d",
"2",
"g",
"c",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauGd2gc.php#L72-L95 |
4,602 | jmikola/JmikolaInsecureRoutesBundle | Routing/HttpsRemovalLoader.php | HttpsRemovalLoader.load | public function load($resource, $type = null)
{
$collection = $this->loader->load($resource, $type);
foreach ($collection->all() as $route) {
if ('https' === $route->getRequirement('_scheme')) {
$requirements = $route->getRequirements();
unset($requiremen... | php | public function load($resource, $type = null)
{
$collection = $this->loader->load($resource, $type);
foreach ($collection->all() as $route) {
if ('https' === $route->getRequirement('_scheme')) {
$requirements = $route->getRequirements();
unset($requiremen... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"loader",
"->",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
")",
";",
"foreach",
"(",
"$",
"collection",
"->... | Loads a RouteCollection but removes HTTPS scheme requirements from its
routes before returning the collection.
@see Symfony\Component\Config\Loader\LoaderInterface::load() | [
"Loads",
"a",
"RouteCollection",
"but",
"removes",
"HTTPS",
"scheme",
"requirements",
"from",
"its",
"routes",
"before",
"returning",
"the",
"collection",
"."
] | aa8e4438b7743ef69fb0a17442dda31c50a3326f | https://github.com/jmikola/JmikolaInsecureRoutesBundle/blob/aa8e4438b7743ef69fb0a17442dda31c50a3326f/Routing/HttpsRemovalLoader.php#L28-L41 |
4,603 | cityware/city-mvc | src/Controller/Plugins/GetAllParams.php | GetAllParams.getEvent | protected function getEvent() {
if ($this->event) {
return $this->event;
}
$controller = $this->getController();
if (!$controller instanceof InjectApplicationEventInterface) {
throw new Exception\DomainException('getParam plugin requires a controller that implemen... | php | protected function getEvent() {
if ($this->event) {
return $this->event;
}
$controller = $this->getController();
if (!$controller instanceof InjectApplicationEventInterface) {
throw new Exception\DomainException('getParam plugin requires a controller that implemen... | [
"protected",
"function",
"getEvent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"event",
")",
"{",
"return",
"$",
"this",
"->",
"event",
";",
"}",
"$",
"controller",
"=",
"$",
"this",
"->",
"getController",
"(",
")",
";",
"if",
"(",
"!",
"$",
"... | Get the event
@return MvcEvent
@throws Exception\DomainException if unable to find event | [
"Get",
"the",
"event"
] | 2d1bf8b6b6d5411fac9717a1df2b9b43bc92903f | https://github.com/cityware/city-mvc/blob/2d1bf8b6b6d5411fac9717a1df2b9b43bc92903f/src/Controller/Plugins/GetAllParams.php#L65-L81 |
4,604 | ARCANESOFT/Core | src/Helpers/UI/Button.php | Button.setType | public function setType($type)
{
$this->type = in_array($type = strtolower($type), ['button', 'submit', 'reset']) ? $type : 'button';
return $this;
} | php | public function setType($type)
{
$this->type = in_array($type = strtolower($type), ['button', 'submit', 'reset']) ? $type : 'button';
return $this;
} | [
"public",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"type",
"=",
"in_array",
"(",
"$",
"type",
"=",
"strtolower",
"(",
"$",
"type",
")",
",",
"[",
"'button'",
",",
"'submit'",
",",
"'reset'",
"]",
")",
"?",
"$",
"type",
... | Set the button type.
@param string $type
@return self | [
"Set",
"the",
"button",
"type",
"."
] | d0798074d47785cf0a768f51d82c0315363213be | https://github.com/ARCANESOFT/Core/blob/d0798074d47785cf0a768f51d82c0315363213be/src/Helpers/UI/Button.php#L52-L57 |
4,605 | ARCANESOFT/Core | src/Helpers/UI/Button.php | Button.make | public static function make($action, $type = 'button', array $attributes = [], $disabled = false)
{
return new static($action, $type, $attributes, $disabled);
} | php | public static function make($action, $type = 'button', array $attributes = [], $disabled = false)
{
return new static($action, $type, $attributes, $disabled);
} | [
"public",
"static",
"function",
"make",
"(",
"$",
"action",
",",
"$",
"type",
"=",
"'button'",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"disabled",
"=",
"false",
")",
"{",
"return",
"new",
"static",
"(",
"$",
"action",
",",
"$",
"t... | Make a button instance.
@param string $action
@param string $type
@param array $attributes
@param bool $disabled
@return self | [
"Make",
"a",
"button",
"instance",
"."
] | d0798074d47785cf0a768f51d82c0315363213be | https://github.com/ARCANESOFT/Core/blob/d0798074d47785cf0a768f51d82c0315363213be/src/Helpers/UI/Button.php#L74-L77 |
4,606 | ARCANESOFT/Core | src/Helpers/UI/Button.php | Button.renderAttributes | protected function renderAttributes()
{
$attributes = collect();
$attributes->put('type', $this->type);
$attributes->put('class', $this->getStyleClass());
if ($this->withTooltip) {
// This is for Bootstrap
$attributes->put('data-toggle', 'tooltip');
... | php | protected function renderAttributes()
{
$attributes = collect();
$attributes->put('type', $this->type);
$attributes->put('class', $this->getStyleClass());
if ($this->withTooltip) {
// This is for Bootstrap
$attributes->put('data-toggle', 'tooltip');
... | [
"protected",
"function",
"renderAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"collect",
"(",
")",
";",
"$",
"attributes",
"->",
"put",
"(",
"'type'",
",",
"$",
"this",
"->",
"type",
")",
";",
"$",
"attributes",
"->",
"put",
"(",
"'class'",
",",
... | Render the attributes.
@return string | [
"Render",
"the",
"attributes",
"."
] | d0798074d47785cf0a768f51d82c0315363213be | https://github.com/ARCANESOFT/Core/blob/d0798074d47785cf0a768f51d82c0315363213be/src/Helpers/UI/Button.php#L99-L117 |
4,607 | GodsDev/backyard | GodsDev/Backyard/BackyardMysqli.php | BackyardMysqli.query | public function query($sql, $ERROR_LOG_OUTPUT = true)
{
//111010 - function is called even before error_log is initialized, therefore it is necessary to mute my_error_log, hence call make_mysql_query($sql,false); 160625 - is it still necessary?
if ($ERROR_LOG_OUTPUT) {
$this->BackyardErr... | php | public function query($sql, $ERROR_LOG_OUTPUT = true)
{
//111010 - function is called even before error_log is initialized, therefore it is necessary to mute my_error_log, hence call make_mysql_query($sql,false); 160625 - is it still necessary?
if ($ERROR_LOG_OUTPUT) {
$this->BackyardErr... | [
"public",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"ERROR_LOG_OUTPUT",
"=",
"true",
")",
"{",
"//111010 - function is called even before error_log is initialized, therefore it is necessary to mute my_error_log, hence call make_mysql_query($sql,false); 160625 - is it still necessary?... | Query method
if everything is OK, return the mysqli_result object
that is returned from parent query method
120914, inspired by http://www.blrf.net/blog/223/code/php/extending-mysqli-class-with-example/
@param string $sql SQL to execute
@return mysqli_result Object|false
@throws DBQueryException | [
"Query",
"method",
"if",
"everything",
"is",
"OK",
"return",
"the",
"mysqli_result",
"object",
"that",
"is",
"returned",
"from",
"parent",
"query",
"method"
] | 992da766a50fca04e9c6e963cbe98d37e3d47f8f | https://github.com/GodsDev/backyard/blob/992da766a50fca04e9c6e963cbe98d37e3d47f8f/GodsDev/Backyard/BackyardMysqli.php#L92-L123 |
4,608 | docit/core | src/Extensions.php | Extensions.addHook | public static function addHook($point, $handler)
{
if (! $handler instanceof \Closure and ! in_array(Hook::class, class_implements($handler), false)) {
throw new \InvalidArgumentException("Failed adding hook. Provided handler for [{$point}] is not valid. Either provider a \\Closure or classpath ... | php | public static function addHook($point, $handler)
{
if (! $handler instanceof \Closure and ! in_array(Hook::class, class_implements($handler), false)) {
throw new \InvalidArgumentException("Failed adding hook. Provided handler for [{$point}] is not valid. Either provider a \\Closure or classpath ... | [
"public",
"static",
"function",
"addHook",
"(",
"$",
"point",
",",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"$",
"handler",
"instanceof",
"\\",
"Closure",
"and",
"!",
"in_array",
"(",
"Hook",
"::",
"class",
",",
"class_implements",
"(",
"$",
"handler",
... | Register a hook instance.
@param string $point
@param string|\Closure $handler
@return void | [
"Register",
"a",
"hook",
"instance",
"."
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Extensions.php#L61-L69 |
4,609 | docit/core | src/Extensions.php | Extensions.runHook | public static function runHook($name, array $params = [ ])
{
static::ensureHookPoint($name);
foreach (static::$hooks[ $name ] as $handler) {
if ($handler instanceof \Closure) {
call_user_func_array($handler, $params);
} elseif (class_exists($handler)) {
... | php | public static function runHook($name, array $params = [ ])
{
static::ensureHookPoint($name);
foreach (static::$hooks[ $name ] as $handler) {
if ($handler instanceof \Closure) {
call_user_func_array($handler, $params);
} elseif (class_exists($handler)) {
... | [
"public",
"static",
"function",
"runHook",
"(",
"$",
"name",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"static",
"::",
"ensureHookPoint",
"(",
"$",
"name",
")",
";",
"foreach",
"(",
"static",
"::",
"$",
"hooks",
"[",
"$",
"name",
"]",
"... | Run the given hook.
@param string $name
@param array $params
@return void | [
"Run",
"the",
"given",
"hook",
"."
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Extensions.php#L78-L92 |
4,610 | docit/core | src/Extensions.php | Extensions.filter | public static function filter($name, $handler)
{
if (! $handler instanceof \Closure and ! in_array(Filter::class, class_implements($handler), false)) {
throw new \InvalidArgumentException("Failed adding Filter. Provided handler for [{$name}] is not valid. Must either provide a \\Closure or class... | php | public static function filter($name, $handler)
{
if (! $handler instanceof \Closure and ! in_array(Filter::class, class_implements($handler), false)) {
throw new \InvalidArgumentException("Failed adding Filter. Provided handler for [{$name}] is not valid. Must either provide a \\Closure or class... | [
"public",
"static",
"function",
"filter",
"(",
"$",
"name",
",",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"$",
"handler",
"instanceof",
"\\",
"Closure",
"and",
"!",
"in_array",
"(",
"Filter",
"::",
"class",
",",
"class_implements",
"(",
"$",
"handler",
... | Add a new filter to the registered filters list.
@param string $name
@param \Closure|\Docit\Core\Contracts\Filter $handler
@return void | [
"Add",
"a",
"new",
"filter",
"to",
"the",
"registered",
"filters",
"list",
"."
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Extensions.php#L143-L150 |
4,611 | docit/core | src/Extensions.php | Extensions.getFilters | public static function getFilters($filterNames = null)
{
if (! is_null($filterNames)) {
if (! is_array($filterNames)) {
$filterNames = [ $filterNames ];
}
return array_only(static::$filters, $filterNames);
} else {
return static::$filt... | php | public static function getFilters($filterNames = null)
{
if (! is_null($filterNames)) {
if (! is_array($filterNames)) {
$filterNames = [ $filterNames ];
}
return array_only(static::$filters, $filterNames);
} else {
return static::$filt... | [
"public",
"static",
"function",
"getFilters",
"(",
"$",
"filterNames",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"filterNames",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filterNames",
")",
")",
"{",
"$",
"filterNames",
"... | get filters value
@return array | [
"get",
"filters",
"value"
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Extensions.php#L157-L168 |
4,612 | horse-php/horse | src/Horse/Transformers/ElementTransformer.php | ElementTransformer.transform | public function transform(array $element)
{
// argument: [name, mode, description, default]
// option: [name, shortcut, mode, description, default]
$isArgument = $this->isArgument($element[0]);
$class = 'Symfony\Component\Console\Input\Input'.($isArgument ? 'Argument' : 'Option');
... | php | public function transform(array $element)
{
// argument: [name, mode, description, default]
// option: [name, shortcut, mode, description, default]
$isArgument = $this->isArgument($element[0]);
$class = 'Symfony\Component\Console\Input\Input'.($isArgument ? 'Argument' : 'Option');
... | [
"public",
"function",
"transform",
"(",
"array",
"$",
"element",
")",
"{",
"// argument: [name, mode, description, default]",
"// option: [name, shortcut, mode, description, default]",
"$",
"isArgument",
"=",
"$",
"this",
"->",
"isArgument",
"(",
"$",
"element",
"[",
"0",... | Transform the element to an instance of InputArgument or InputOption.
@param array $element
@return mixed | [
"Transform",
"the",
"element",
"to",
"an",
"instance",
"of",
"InputArgument",
"or",
"InputOption",
"."
] | e2b72508dde353de6cacfbed852aa3de3fc06eff | https://github.com/horse-php/horse/blob/e2b72508dde353de6cacfbed852aa3de3fc06eff/src/Horse/Transformers/ElementTransformer.php#L28-L51 |
4,613 | tagadvance/Gilligan | src/tagadvance/gilligan/io/File.php | File.getTotalSpace | function getTotalSpace(): float {
$directory = $this->isDirectory () ? $this->fileName : $this->getParent ();
return disk_total_space ( $directory );
} | php | function getTotalSpace(): float {
$directory = $this->isDirectory () ? $this->fileName : $this->getParent ();
return disk_total_space ( $directory );
} | [
"function",
"getTotalSpace",
"(",
")",
":",
"float",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"isDirectory",
"(",
")",
"?",
"$",
"this",
"->",
"fileName",
":",
"$",
"this",
"->",
"getParent",
"(",
")",
";",
"return",
"disk_total_space",
"(",
"$",... | Returns the size of the partition named by this path.
@return float
@see http://php.net/disk_total_space | [
"Returns",
"the",
"size",
"of",
"the",
"partition",
"named",
"by",
"this",
"path",
"."
] | 470c82b1ef16d0f839ba2245cd96cd414792483b | https://github.com/tagadvance/Gilligan/blob/470c82b1ef16d0f839ba2245cd96cd414792483b/src/tagadvance/gilligan/io/File.php#L89-L92 |
4,614 | tagadvance/Gilligan | src/tagadvance/gilligan/io/File.php | File.getFreeSpace | function getFreeSpace() {
$directory = $this->isDirectory () ? $this->fileName : $this->getParent ();
return disk_free_space ( $directory );
} | php | function getFreeSpace() {
$directory = $this->isDirectory () ? $this->fileName : $this->getParent ();
return disk_free_space ( $directory );
} | [
"function",
"getFreeSpace",
"(",
")",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"isDirectory",
"(",
")",
"?",
"$",
"this",
"->",
"fileName",
":",
"$",
"this",
"->",
"getParent",
"(",
")",
";",
"return",
"disk_free_space",
"(",
"$",
"directory",
")... | Returns the number of unallocated bytes in the partition named by this
path.
@return float
@see http://php.net/disk_free_space | [
"Returns",
"the",
"number",
"of",
"unallocated",
"bytes",
"in",
"the",
"partition",
"named",
"by",
"this",
"path",
"."
] | 470c82b1ef16d0f839ba2245cd96cd414792483b | https://github.com/tagadvance/Gilligan/blob/470c82b1ef16d0f839ba2245cd96cd414792483b/src/tagadvance/gilligan/io/File.php#L101-L104 |
4,615 | antwebes/ChateaClientLib | src/Ant/ChateaClient/Service/Client/ChateaOAuth2Client.php | ChateaOAuth2Client.factory | public static function factory($config = array())
{
// Provide a hash of default client configuration options
$default = array(
'Accept'=>'application/json',
'environment'=>'prod',
'service-description-name' => Client::NAME_SERVICE_AUTH,
'ssl'=>false
... | php | public static function factory($config = array())
{
// Provide a hash of default client configuration options
$default = array(
'Accept'=>'application/json',
'environment'=>'prod',
'service-description-name' => Client::NAME_SERVICE_AUTH,
'ssl'=>false
... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"// Provide a hash of default client configuration options",
"$",
"default",
"=",
"array",
"(",
"'Accept'",
"=>",
"'application/json'",
",",
"'environment'",
"=>",
"'pro... | Build new class ChateaOAuth2Client, this provides user authentication for ApiChateaClient
@param array $config Associative array can configure the client. The parameters are:
client_id The public key of client. This parameter is required
secret The private key of client. This parameter is required
base_url T... | [
"Build",
"new",
"class",
"ChateaOAuth2Client",
"this",
"provides",
"user",
"authentication",
"for",
"ApiChateaClient"
] | b08b207886f4a9f79a0719e8c7b20e79a1b1732d | https://github.com/antwebes/ChateaClientLib/blob/b08b207886f4a9f79a0719e8c7b20e79a1b1732d/src/Ant/ChateaClient/Service/Client/ChateaOAuth2Client.php#L49-L80 |
4,616 | antwebes/ChateaClientLib | src/Ant/ChateaClient/Service/Client/ChateaOAuth2Client.php | ChateaOAuth2Client.withClientCredentials | public function withClientCredentials()
{
$command = $this->getCommand('withClientCredentials',
array('client_id'=>$this->getClientId(),'client_secret'=>$this->getSecret())
);
try{
return $command->execute();
}catch (ServerErrorResponseException $ex){
... | php | public function withClientCredentials()
{
$command = $this->getCommand('withClientCredentials',
array('client_id'=>$this->getClientId(),'client_secret'=>$this->getSecret())
);
try{
return $command->execute();
}catch (ServerErrorResponseException $ex){
... | [
"public",
"function",
"withClientCredentials",
"(",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"getCommand",
"(",
"'withClientCredentials'",
",",
"array",
"(",
"'client_id'",
"=>",
"$",
"this",
"->",
"getClientId",
"(",
")",
",",
"'client_secret'",
"=>"... | Enables the apps to get service credentials as well as service credential
authentication settings for use on the apps side of communication.
@return array|string Associative array with client credentials | Message with error in json format
@throws AuthenticationException This exception is thrown if you do not credent... | [
"Enables",
"the",
"apps",
"to",
"get",
"service",
"credentials",
"as",
"well",
"as",
"service",
"credential",
"authentication",
"settings",
"for",
"use",
"on",
"the",
"apps",
"side",
"of",
"communication",
"."
] | b08b207886f4a9f79a0719e8c7b20e79a1b1732d | https://github.com/antwebes/ChateaClientLib/blob/b08b207886f4a9f79a0719e8c7b20e79a1b1732d/src/Ant/ChateaClient/Service/Client/ChateaOAuth2Client.php#L223-L240 |
4,617 | antwebes/ChateaClientLib | src/Ant/ChateaClient/Service/Client/ChateaOAuth2Client.php | ChateaOAuth2Client.withRefreshToken | public function withRefreshToken($refresh_token)
{
if (!is_string($refresh_token) || 0 >= strlen($refresh_token)) {
throw new InvalidArgumentException("refresh_token must be a non-empty string");
}
$command = $this->getCommand('withRefreshToken',
array('client_id'=>$... | php | public function withRefreshToken($refresh_token)
{
if (!is_string($refresh_token) || 0 >= strlen($refresh_token)) {
throw new InvalidArgumentException("refresh_token must be a non-empty string");
}
$command = $this->getCommand('withRefreshToken',
array('client_id'=>$... | [
"public",
"function",
"withRefreshToken",
"(",
"$",
"refresh_token",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"refresh_token",
")",
"||",
"0",
">=",
"strlen",
"(",
"$",
"refresh_token",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
... | After the client has been authorized for access, they can use a refresh token to get a new access token.
@param string $refresh_token The client refresh token that you obtain in first request of credentials.
@return array|string Associative array with client credentials | Message with error in json format
@throws In... | [
"After",
"the",
"client",
"has",
"been",
"authorized",
"for",
"access",
"they",
"can",
"use",
"a",
"refresh",
"token",
"to",
"get",
"a",
"new",
"access",
"token",
"."
] | b08b207886f4a9f79a0719e8c7b20e79a1b1732d | https://github.com/antwebes/ChateaClientLib/blob/b08b207886f4a9f79a0719e8c7b20e79a1b1732d/src/Ant/ChateaClient/Service/Client/ChateaOAuth2Client.php#L302-L323 |
4,618 | mlocati/composer-patcher | src/PatchExecutor.php | PatchExecutor.applyPatch | public function applyPatch(Patch $patch, $baseDirectory)
{
$error = null;
foreach ($patch->getLevels() as $patchLevel) {
try {
$this->applyPatchLevel($patch, $baseDirectory, $patchLevel);
return;
} catch (Exception\PatchAlreadyApplied $x) {
... | php | public function applyPatch(Patch $patch, $baseDirectory)
{
$error = null;
foreach ($patch->getLevels() as $patchLevel) {
try {
$this->applyPatchLevel($patch, $baseDirectory, $patchLevel);
return;
} catch (Exception\PatchAlreadyApplied $x) {
... | [
"public",
"function",
"applyPatch",
"(",
"Patch",
"$",
"patch",
",",
"$",
"baseDirectory",
")",
"{",
"$",
"error",
"=",
"null",
";",
"foreach",
"(",
"$",
"patch",
"->",
"getLevels",
"(",
")",
"as",
"$",
"patchLevel",
")",
"{",
"try",
"{",
"$",
"this"... | Apply a patch to a base directory.
@param \ComposerPatcher\Patch $patch the patch to be applied
@param string $baseDirectory the directory where the patch should be applied
@throws \ComposerPatcher\Exception\PatchAlreadyApplied if the patch is already applied
@throws \ComposerPatcher\Exception\PatchNotApplied if the ... | [
"Apply",
"a",
"patch",
"to",
"a",
"base",
"directory",
"."
] | d8ba45c10b5cf8ac8da3591e09b6afd47fc10667 | https://github.com/mlocati/composer-patcher/blob/d8ba45c10b5cf8ac8da3591e09b6afd47fc10667/src/PatchExecutor.php#L46-L63 |
4,619 | mlocati/composer-patcher | src/PatchExecutor.php | PatchExecutor.run | protected function run($command, $standardInput = null)
{
$stdOut = '';
$stdErr = '';
$stdOut = array();
$rc = $this->processExecutor->execute($command, $stdOut);
$stdOut = (string) $stdOut;
$stdErr = (string) $this->processExecutor->getErrorOutput();
return ... | php | protected function run($command, $standardInput = null)
{
$stdOut = '';
$stdErr = '';
$stdOut = array();
$rc = $this->processExecutor->execute($command, $stdOut);
$stdOut = (string) $stdOut;
$stdErr = (string) $this->processExecutor->getErrorOutput();
return ... | [
"protected",
"function",
"run",
"(",
"$",
"command",
",",
"$",
"standardInput",
"=",
"null",
")",
"{",
"$",
"stdOut",
"=",
"''",
";",
"$",
"stdErr",
"=",
"''",
";",
"$",
"stdOut",
"=",
"array",
"(",
")",
";",
"$",
"rc",
"=",
"$",
"this",
"->",
... | Run a command and return the exit code.
@param string $command The command to be executed
@param null|mixed $standardInput
@return array First element is the command return code, second element is the standard output, thirg element is the standard error | [
"Run",
"a",
"command",
"and",
"return",
"the",
"exit",
"code",
"."
] | d8ba45c10b5cf8ac8da3591e09b6afd47fc10667 | https://github.com/mlocati/composer-patcher/blob/d8ba45c10b5cf8ac8da3591e09b6afd47fc10667/src/PatchExecutor.php#L85-L95 |
4,620 | mlocati/composer-patcher | src/PatchExecutor.php | PatchExecutor.checkCommandExists | protected function checkCommandExists($commandName, $argument = '--version')
{
$command = $commandName;
$argument = (string) $argument;
if ($argument !== '') {
$command .= ' '.$argument;
}
list($rc, , $stdErr) = $this->run($command);
if ($rc !== 0) {
... | php | protected function checkCommandExists($commandName, $argument = '--version')
{
$command = $commandName;
$argument = (string) $argument;
if ($argument !== '') {
$command .= ' '.$argument;
}
list($rc, , $stdErr) = $this->run($command);
if ($rc !== 0) {
... | [
"protected",
"function",
"checkCommandExists",
"(",
"$",
"commandName",
",",
"$",
"argument",
"=",
"'--version'",
")",
"{",
"$",
"command",
"=",
"$",
"commandName",
";",
"$",
"argument",
"=",
"(",
"string",
")",
"$",
"argument",
";",
"if",
"(",
"$",
"arg... | Check if a command exists.
@param string $commandName the command name
@param string $argument the argument to be used to run the command
@throws \ComposerPatcher\Exception\CommandNotFound | [
"Check",
"if",
"a",
"command",
"exists",
"."
] | d8ba45c10b5cf8ac8da3591e09b6afd47fc10667 | https://github.com/mlocati/composer-patcher/blob/d8ba45c10b5cf8ac8da3591e09b6afd47fc10667/src/PatchExecutor.php#L105-L116 |
4,621 | 0x20h/phloppy | src/Cache/FileCache.php | FileCache.read | private function read()
{
flock($this->file, LOCK_SH);
rewind($this->file);
$content = fgets($this->file);
flock($this->file, LOCK_UN);
$this->records = unserialize($content);
} | php | private function read()
{
flock($this->file, LOCK_SH);
rewind($this->file);
$content = fgets($this->file);
flock($this->file, LOCK_UN);
$this->records = unserialize($content);
} | [
"private",
"function",
"read",
"(",
")",
"{",
"flock",
"(",
"$",
"this",
"->",
"file",
",",
"LOCK_SH",
")",
";",
"rewind",
"(",
"$",
"this",
"->",
"file",
")",
";",
"$",
"content",
"=",
"fgets",
"(",
"$",
"this",
"->",
"file",
")",
";",
"flock",
... | Read cache from disk. | [
"Read",
"cache",
"from",
"disk",
"."
] | d917f0578360395899bd583724046d36ac459535 | https://github.com/0x20h/phloppy/blob/d917f0578360395899bd583724046d36ac459535/src/Cache/FileCache.php#L56-L64 |
4,622 | 0x20h/phloppy | src/Cache/FileCache.php | FileCache.write | private function write()
{
$cache = serialize($this->records);
flock($this->file, LOCK_EX);
rewind($this->file);
ftruncate($this->file, 0);
$bytes = fwrite($this->file, $cache);
flock($this->file, LOCK_UN);
return $bytes === strlen($cache);
} | php | private function write()
{
$cache = serialize($this->records);
flock($this->file, LOCK_EX);
rewind($this->file);
ftruncate($this->file, 0);
$bytes = fwrite($this->file, $cache);
flock($this->file, LOCK_UN);
return $bytes === strlen($cache);
} | [
"private",
"function",
"write",
"(",
")",
"{",
"$",
"cache",
"=",
"serialize",
"(",
"$",
"this",
"->",
"records",
")",
";",
"flock",
"(",
"$",
"this",
"->",
"file",
",",
"LOCK_EX",
")",
";",
"rewind",
"(",
"$",
"this",
"->",
"file",
")",
";",
"ft... | Write cache to disk.
@return bool | [
"Write",
"cache",
"to",
"disk",
"."
] | d917f0578360395899bd583724046d36ac459535 | https://github.com/0x20h/phloppy/blob/d917f0578360395899bd583724046d36ac459535/src/Cache/FileCache.php#L83-L93 |
4,623 | webriq/core | module/Tag/src/Grid/Tag/Controller/ListController.php | ListController.listAction | public function listAction()
{
$params = $this->params();
$page = (int) $params->fromRoute( 'page' );
$mode = $params->fromRoute( 'mode' );
$all = $mode == 'all';
$tags = array_map(
'rawurldecode',
explode( '/', $params->fromRoute( 'tags' ) )
... | php | public function listAction()
{
$params = $this->params();
$page = (int) $params->fromRoute( 'page' );
$mode = $params->fromRoute( 'mode' );
$all = $mode == 'all';
$tags = array_map(
'rawurldecode',
explode( '/', $params->fromRoute( 'tags' ) )
... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"params",
"(",
")",
";",
"$",
"page",
"=",
"(",
"int",
")",
"$",
"params",
"->",
"fromRoute",
"(",
"'page'",
")",
";",
"$",
"mode",
"=",
"$",
"params",
"->"... | List contents by tags | [
"List",
"contents",
"by",
"tags"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Tag/src/Grid/Tag/Controller/ListController.php#L18-L41 |
4,624 | legraxieux53/IO | src/Files/File.php | File.create | public function create()
{
if(!$this->isFile($this->getName())){
$this->createPath($this->path);
$file = fopen($this->getName(), "w");
fclose($file);
}
} | php | public function create()
{
if(!$this->isFile($this->getName())){
$this->createPath($this->path);
$file = fopen($this->getName(), "w");
fclose($file);
}
} | [
"public",
"function",
"create",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isFile",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"createPath",
"(",
"$",
"this",
"->",
"path",
")",
";",
"$",
"file",
"=",... | cree le ficher
@param string $content [description]
@return [type] [description] | [
"cree",
"le",
"ficher"
] | c3f1890f33817642ba9ab52bf247b7cdd5dda9c4 | https://github.com/legraxieux53/IO/blob/c3f1890f33817642ba9ab52bf247b7cdd5dda9c4/src/Files/File.php#L45-L52 |
4,625 | legraxieux53/IO | src/Files/File.php | File.writeOver | public function writeOver($content)
{
$this->createPath($this->path);
file_put_contents($this->getName(), $content);
} | php | public function writeOver($content)
{
$this->createPath($this->path);
file_put_contents($this->getName(), $content);
} | [
"public",
"function",
"writeOver",
"(",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"createPath",
"(",
"$",
"this",
"->",
"path",
")",
";",
"file_put_contents",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",
"$",
"content",
")",
";",
"}"
] | Ecrit dans un fichier En ecrasant son contenu
@param string $content [description]
@return [type] [description] | [
"Ecrit",
"dans",
"un",
"fichier",
"En",
"ecrasant",
"son",
"contenu"
] | c3f1890f33817642ba9ab52bf247b7cdd5dda9c4 | https://github.com/legraxieux53/IO/blob/c3f1890f33817642ba9ab52bf247b7cdd5dda9c4/src/Files/File.php#L59-L63 |
4,626 | legraxieux53/IO | src/Files/File.php | File.write | public function write ($content)
{
$this->createPath($this->path);
file_put_contents($this->getName(), $content, FILE_APPEND);
} | php | public function write ($content)
{
$this->createPath($this->path);
file_put_contents($this->getName(), $content, FILE_APPEND);
} | [
"public",
"function",
"write",
"(",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"createPath",
"(",
"$",
"this",
"->",
"path",
")",
";",
"file_put_contents",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",
"$",
"content",
",",
"FILE_APPEND",
")",
"... | Ecrire dans le fichier
@param string $content [description]
@return [type] [description] | [
"Ecrire",
"dans",
"le",
"fichier"
] | c3f1890f33817642ba9ab52bf247b7cdd5dda9c4 | https://github.com/legraxieux53/IO/blob/c3f1890f33817642ba9ab52bf247b7cdd5dda9c4/src/Files/File.php#L70-L74 |
4,627 | legraxieux53/IO | src/Files/File.php | File.generateName | public function generateName ()
{
$chars = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'];
$cod = self::DE... | php | public function generateName ()
{
$chars = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'];
$cod = self::DE... | [
"public",
"function",
"generateName",
"(",
")",
"{",
"$",
"chars",
"=",
"[",
"'a'",
",",
"'b'",
",",
"'c'",
",",
"'d'",
",",
"'e'",
",",
"'f'",
",",
"'g'",
",",
"'h'",
",",
"'i'",
",",
"'j'",
",",
"'k'",
",",
"'l'",
",",
"'m'",
",",
"'n'",
",... | genere un nom de fichier
@return [type] [description] | [
"genere",
"un",
"nom",
"de",
"fichier"
] | c3f1890f33817642ba9ab52bf247b7cdd5dda9c4 | https://github.com/legraxieux53/IO/blob/c3f1890f33817642ba9ab52bf247b7cdd5dda9c4/src/Files/File.php#L132-L142 |
4,628 | codebobbly/metaseo_vhs | Classes/Signals/MetaseoExtend.php | MetaseoExtend.metatagOutput | public function metatagOutput($args, $obj)
{
// Modify the parameter $args here
// There is a Issue in the mateseo extension. If the pageTitle is replaced, then the meta.title is wrong
$rawTitle = !empty($GLOBALS['TSFE']->altPageTitle) ? $GLOBALS['TSFE']->altPageTitle : $GLOBALS['TSFE']->pa... | php | public function metatagOutput($args, $obj)
{
// Modify the parameter $args here
// There is a Issue in the mateseo extension. If the pageTitle is replaced, then the meta.title is wrong
$rawTitle = !empty($GLOBALS['TSFE']->altPageTitle) ? $GLOBALS['TSFE']->altPageTitle : $GLOBALS['TSFE']->pa... | [
"public",
"function",
"metatagOutput",
"(",
"$",
"args",
",",
"$",
"obj",
")",
"{",
"// Modify the parameter $args here",
"// There is a Issue in the mateseo extension. If the pageTitle is replaced, then the meta.title is wrong",
"$",
"rawTitle",
"=",
"!",
"empty",
"(",
"$",
... | Metaseo Signal for page metadata
see -> \Metaseo\Metaseo\Page\Part\MetatagPart->processMetaTags
@param $args
@param $obj
@return array | [
"Metaseo",
"Signal",
"for",
"page",
"metadata",
"see",
"-",
">",
"\\",
"Metaseo",
"\\",
"Metaseo",
"\\",
"Page",
"\\",
"Part",
"\\",
"MetatagPart",
"-",
">",
"processMetaTags"
] | d5b65576cb24e7e854753adafc6c4bcc01e82634 | https://github.com/codebobbly/metaseo_vhs/blob/d5b65576cb24e7e854753adafc6c4bcc01e82634/Classes/Signals/MetaseoExtend.php#L15-L27 |
4,629 | integratedfordevelopers/integrated-solr-bundle | Command/IndexerQueueCommand.php | IndexerQueueCommand.executeValidation | protected function executeValidation(InputInterface $input, OutputInterface $output)
{
$types = [];
foreach ($this->getResolver()->getTypes() as $type) {
$types[$type->getType()] = $type->getType();
}
$invalid = [];
foreach ($input->getArgument('id') as $id) {
... | php | protected function executeValidation(InputInterface $input, OutputInterface $output)
{
$types = [];
foreach ($this->getResolver()->getTypes() as $type) {
$types[$type->getType()] = $type->getType();
}
$invalid = [];
foreach ($input->getArgument('id') as $id) {
... | [
"protected",
"function",
"executeValidation",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"types",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getResolver",
"(",
")",
"->",
"getTypes",
"(",
")",
... | validate the ids in de input
@param InputInterface $input
@param OutputInterface $output
@return int
@throws InvalidArgumentException | [
"validate",
"the",
"ids",
"in",
"de",
"input"
] | 9d9bb4071e13ed4686fbc97b6286a475ac5b2162 | https://github.com/integratedfordevelopers/integrated-solr-bundle/blob/9d9bb4071e13ed4686fbc97b6286a475ac5b2162/Command/IndexerQueueCommand.php#L114-L151 |
4,630 | integratedfordevelopers/integrated-solr-bundle | Command/IndexerQueueCommand.php | IndexerQueueCommand.executeDelete | protected function executeDelete(InputInterface $input, OutputInterface $output)
{
$this->doIndexCleanup($input->getArgument('id'));
$this->doIndexCommit();
return 0;
} | php | protected function executeDelete(InputInterface $input, OutputInterface $output)
{
$this->doIndexCleanup($input->getArgument('id'));
$this->doIndexCommit();
return 0;
} | [
"protected",
"function",
"executeDelete",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"doIndexCleanup",
"(",
"$",
"input",
"->",
"getArgument",
"(",
"'id'",
")",
")",
";",
"$",
"this",
"->",
"doI... | queue a delete on the solr index
@param InputInterface $input
@param OutputInterface $output
@return int | [
"queue",
"a",
"delete",
"on",
"the",
"solr",
"index"
] | 9d9bb4071e13ed4686fbc97b6286a475ac5b2162 | https://github.com/integratedfordevelopers/integrated-solr-bundle/blob/9d9bb4071e13ed4686fbc97b6286a475ac5b2162/Command/IndexerQueueCommand.php#L161-L167 |
4,631 | integratedfordevelopers/integrated-solr-bundle | Command/IndexerQueueCommand.php | IndexerQueueCommand.executeIndex | protected function executeIndex(InputInterface $input, OutputInterface $output)
{
// Don't hydrate for performance reasons
$builder = $this->getDocumentManager()->createQueryBuilder(Content::class);
$builder->select('id', 'contentType', 'class')->hydrate(false);
if ($input->getOptio... | php | protected function executeIndex(InputInterface $input, OutputInterface $output)
{
// Don't hydrate for performance reasons
$builder = $this->getDocumentManager()->createQueryBuilder(Content::class);
$builder->select('id', 'contentType', 'class')->hydrate(false);
if ($input->getOptio... | [
"protected",
"function",
"executeIndex",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"// Don't hydrate for performance reasons",
"$",
"builder",
"=",
"$",
"this",
"->",
"getDocumentManager",
"(",
")",
"->",
"createQueryBuilder... | queue the indexing of content in to solr
@param InputInterface $input
@param OutputInterface $output
@return int | [
"queue",
"the",
"indexing",
"of",
"content",
"in",
"to",
"solr"
] | 9d9bb4071e13ed4686fbc97b6286a475ac5b2162 | https://github.com/integratedfordevelopers/integrated-solr-bundle/blob/9d9bb4071e13ed4686fbc97b6286a475ac5b2162/Command/IndexerQueueCommand.php#L177-L226 |
4,632 | integratedfordevelopers/integrated-solr-bundle | Command/IndexerQueueCommand.php | IndexerQueueCommand.doIndex | protected function doIndex(Cursor $cursor, ProgressHelper $progress)
{
$queue = $this->getQueue();
// the document manager need to be cleared from time to time so this counter keeps
// track of that.
$count = 0;
$manager = $this->getDocumentManager();
foreach ($cur... | php | protected function doIndex(Cursor $cursor, ProgressHelper $progress)
{
$queue = $this->getQueue();
// the document manager need to be cleared from time to time so this counter keeps
// track of that.
$count = 0;
$manager = $this->getDocumentManager();
foreach ($cur... | [
"protected",
"function",
"doIndex",
"(",
"Cursor",
"$",
"cursor",
",",
"ProgressHelper",
"$",
"progress",
")",
"{",
"$",
"queue",
"=",
"$",
"this",
"->",
"getQueue",
"(",
")",
";",
"// the document manager need to be cleared from time to time so this counter keeps",
"... | Add all the documents in the cursor to the solr queue
@param Cursor $cursor
@param ProgressHelper $progress | [
"Add",
"all",
"the",
"documents",
"in",
"the",
"cursor",
"to",
"the",
"solr",
"queue"
] | 9d9bb4071e13ed4686fbc97b6286a475ac5b2162 | https://github.com/integratedfordevelopers/integrated-solr-bundle/blob/9d9bb4071e13ed4686fbc97b6286a475ac5b2162/Command/IndexerQueueCommand.php#L234-L263 |
4,633 | integratedfordevelopers/integrated-solr-bundle | Command/IndexerQueueCommand.php | IndexerQueueCommand.doIndexCleanup | protected function doIndexCleanup(array $types, DateTime $date = null)
{
$query = [];
if ($types) {
$query[] = 'type_name:("' . implode('" OR "', $types) . '")';
} else {
$query[] = '*:*';
}
if ($date) {
$date = clone $date;
$... | php | protected function doIndexCleanup(array $types, DateTime $date = null)
{
$query = [];
if ($types) {
$query[] = 'type_name:("' . implode('" OR "', $types) . '")';
} else {
$query[] = '*:*';
}
if ($date) {
$date = clone $date;
$... | [
"protected",
"function",
"doIndexCleanup",
"(",
"array",
"$",
"types",
",",
"DateTime",
"$",
"date",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"types",
")",
"{",
"$",
"query",
"[",
"]",
"=",
"'type_name:(\"'",
".",
"i... | delete all the types or everything if none is given
@param array $types
@param DateTime $date | [
"delete",
"all",
"the",
"types",
"or",
"everything",
"if",
"none",
"is",
"given"
] | 9d9bb4071e13ed4686fbc97b6286a475ac5b2162 | https://github.com/integratedfordevelopers/integrated-solr-bundle/blob/9d9bb4071e13ed4686fbc97b6286a475ac5b2162/Command/IndexerQueueCommand.php#L271-L295 |
4,634 | InnoGr/FivePercent-Api | src/Handler/Parameter/ObjectMapperParameterResolverAndExtractor.php | ObjectMapperParameterResolverAndExtractor.resolveRequest | private function resolveRequest(
ActionInterface $action,
CallableInterface $callable,
array $inputArguments,
\ReflectionParameter $parameter
) {
$class = $parameter->getClass();
if ($class->isInterface()) {
throw new \RuntimeException(sprintf(
... | php | private function resolveRequest(
ActionInterface $action,
CallableInterface $callable,
array $inputArguments,
\ReflectionParameter $parameter
) {
$class = $parameter->getClass();
if ($class->isInterface()) {
throw new \RuntimeException(sprintf(
... | [
"private",
"function",
"resolveRequest",
"(",
"ActionInterface",
"$",
"action",
",",
"CallableInterface",
"$",
"callable",
",",
"array",
"$",
"inputArguments",
",",
"\\",
"ReflectionParameter",
"$",
"parameter",
")",
"{",
"$",
"class",
"=",
"$",
"parameter",
"->... | Resolve request parameter
@param ActionInterface $action
@param CallableInterface $callable
@param array $inputArguments
@param \ReflectionParameter $parameter
@return object
@throws \Exception | [
"Resolve",
"request",
"parameter"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/Handler/Parameter/ObjectMapperParameterResolverAndExtractor.php#L264-L343 |
4,635 | InnoGr/FivePercent-Api | src/Handler/Parameter/ObjectMapperParameterResolverAndExtractor.php | ObjectMapperParameterResolverAndExtractor.strictRequestValidate | private function strictRequestValidate(RequestInterface $request)
{
$requestMetadata = $this->validator->getMetadataFor($request);
$useStrictGroup = false;
// Search constraints by group "Strict"
if ($requestMetadata instanceof ClassMetadata) {
foreach ($requestMetadata... | php | private function strictRequestValidate(RequestInterface $request)
{
$requestMetadata = $this->validator->getMetadataFor($request);
$useStrictGroup = false;
// Search constraints by group "Strict"
if ($requestMetadata instanceof ClassMetadata) {
foreach ($requestMetadata... | [
"private",
"function",
"strictRequestValidate",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"requestMetadata",
"=",
"$",
"this",
"->",
"validator",
"->",
"getMetadataFor",
"(",
"$",
"request",
")",
";",
"$",
"useStrictGroup",
"=",
"false",
";",
"//... | Strict request validation
@param RequestInterface $request
@throws ViolationListException | [
"Strict",
"request",
"validation"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/Handler/Parameter/ObjectMapperParameterResolverAndExtractor.php#L352-L396 |
4,636 | InnoGr/FivePercent-Api | src/Handler/Parameter/ObjectMapperParameterResolverAndExtractor.php | ObjectMapperParameterResolverAndExtractor.isPropertyRequired | private function isPropertyRequired(\ReflectionProperty $property, array $groups)
{
if (!$this->validator) {
// Can not check...
return true;
}
$metadata = $this->validator->getMetadataFor($property->getDeclaringClass()->getName());
if (!$metadata instanceof... | php | private function isPropertyRequired(\ReflectionProperty $property, array $groups)
{
if (!$this->validator) {
// Can not check...
return true;
}
$metadata = $this->validator->getMetadataFor($property->getDeclaringClass()->getName());
if (!$metadata instanceof... | [
"private",
"function",
"isPropertyRequired",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
",",
"array",
"$",
"groups",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validator",
")",
"{",
"// Can not check...",
"return",
"true",
";",
"}",
"$",
"metadata"... | Is required property
@param \ReflectionProperty $property
@param array $groups
@return bool | [
"Is",
"required",
"property"
] | 57b78ddc3c9d91a7139c276711e5792824ceab9c | https://github.com/InnoGr/FivePercent-Api/blob/57b78ddc3c9d91a7139c276711e5792824ceab9c/src/Handler/Parameter/ObjectMapperParameterResolverAndExtractor.php#L406-L437 |
4,637 | flowcode/enlace | src/flowcode/enlace/controller/BaseController.php | BaseController.canAccess | public function canAccess(array $user) {
$can = false;
foreach ($user["roles"] as $userRole) {
foreach ($userRole["permissions"] as $permission) {
if (in_array($permission, $this->permissions)) {
$can = true;
break;
}
... | php | public function canAccess(array $user) {
$can = false;
foreach ($user["roles"] as $userRole) {
foreach ($userRole["permissions"] as $permission) {
if (in_array($permission, $this->permissions)) {
$can = true;
break;
}
... | [
"public",
"function",
"canAccess",
"(",
"array",
"$",
"user",
")",
"{",
"$",
"can",
"=",
"false",
";",
"foreach",
"(",
"$",
"user",
"[",
"\"roles\"",
"]",
"as",
"$",
"userRole",
")",
"{",
"foreach",
"(",
"$",
"userRole",
"[",
"\"permissions\"",
"]",
... | Test if the user has the required permissions to access.
@param type $user
@return boolean | [
"Test",
"if",
"the",
"user",
"has",
"the",
"required",
"permissions",
"to",
"access",
"."
] | 2dacd15cd3cf32171a19695c331487e1620eacb8 | https://github.com/flowcode/enlace/blob/2dacd15cd3cf32171a19695c331487e1620eacb8/src/flowcode/enlace/controller/BaseController.php#L56-L67 |
4,638 | tekkla/core-security | Core/Security/Ban/BanLogEntry.php | BanLogEntry.setCode | public function setCode(int $code)
{
$allowed_codes = [
0,
1,
2
];
if (!in_array($code, $allowed_codes)) {
$code = 1;
}
$this->code = $code;
} | php | public function setCode(int $code)
{
$allowed_codes = [
0,
1,
2
];
if (!in_array($code, $allowed_codes)) {
$code = 1;
}
$this->code = $code;
} | [
"public",
"function",
"setCode",
"(",
"int",
"$",
"code",
")",
"{",
"$",
"allowed_codes",
"=",
"[",
"0",
",",
"1",
",",
"2",
"]",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"code",
",",
"$",
"allowed_codes",
")",
")",
"{",
"$",
"code",
"=",
"1"... | Sets banlog code
0 = Notice
1 = Banable event
2 = Enty activates ban
@param int $code | [
"Sets",
"banlog",
"code"
] | 66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582 | https://github.com/tekkla/core-security/blob/66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582/Core/Security/Ban/BanLogEntry.php#L245-L258 |
4,639 | tekkla/core-security | Core/Security/Ban/BanLogEntry.php | BanLogEntry.add | public function add(): int
{
if (empty($this->logdate) || empty($this->logstamp)) {
$time = time();
if (empty($this->logdate)) {
$this->logdate = date('Y-m-d H:i:s', $time);
}
if (empty($this->logstamp)) {
$this->logstamp = $... | php | public function add(): int
{
if (empty($this->logdate) || empty($this->logstamp)) {
$time = time();
if (empty($this->logdate)) {
$this->logdate = date('Y-m-d H:i:s', $time);
}
if (empty($this->logstamp)) {
$this->logstamp = $... | [
"public",
"function",
"add",
"(",
")",
":",
"int",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"logdate",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"logstamp",
")",
")",
"{",
"$",
"time",
"=",
"time",
"(",
")",
";",
"if",
"(",
"empty",
... | Creates log entry in Db and return log id
@return int | [
"Creates",
"log",
"entry",
"in",
"Db",
"and",
"return",
"log",
"id"
] | 66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582 | https://github.com/tekkla/core-security/blob/66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582/Core/Security/Ban/BanLogEntry.php#L265-L307 |
4,640 | jingwu15/phpbeanstalk | src/phpbeanstalk/Client.php | Client.disconnect | public function disconnect() {
if (!is_resource($this->_connection)) {
$this->connected = false;
} else {
$this->connected = !fclose($this->_connection);
if (!$this->connected) {
$this->_connection = null;
}
}
return !$this->connected;
} | php | public function disconnect() {
if (!is_resource($this->_connection)) {
$this->connected = false;
} else {
$this->connected = !fclose($this->_connection);
if (!$this->connected) {
$this->_connection = null;
}
}
return !$this->connected;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"_connection",
")",
")",
"{",
"$",
"this",
"->",
"connected",
"=",
"false",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"connected",
"=",
"!",
"... | Closes the connection to the beanstalk server.
@return boolean `true` if diconnecting was successful. | [
"Closes",
"the",
"connection",
"to",
"the",
"beanstalk",
"server",
"."
] | 1be1810c34883e8a54ced60f748c736af87c9609 | https://github.com/jingwu15/phpbeanstalk/blob/1be1810c34883e8a54ced60f748c736af87c9609/src/phpbeanstalk/Client.php#L133-L144 |
4,641 | jingwu15/phpbeanstalk | src/phpbeanstalk/Client.php | Client.reconnect | public function reconnect() {
$this->disconnect();
$this->connect();
$stats = $this->stats();
return $stats === false ? false : true;
} | php | public function reconnect() {
$this->disconnect();
$this->connect();
$stats = $this->stats();
return $stats === false ? false : true;
} | [
"public",
"function",
"reconnect",
"(",
")",
"{",
"$",
"this",
"->",
"disconnect",
"(",
")",
";",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"stats",
"=",
"$",
"this",
"->",
"stats",
"(",
")",
";",
"return",
"$",
"stats",
"===",
"false",
"... | reset the connection to the beanstalk server.
@return boolean true/false | [
"reset",
"the",
"connection",
"to",
"the",
"beanstalk",
"server",
"."
] | 1be1810c34883e8a54ced60f748c736af87c9609 | https://github.com/jingwu15/phpbeanstalk/blob/1be1810c34883e8a54ced60f748c736af87c9609/src/phpbeanstalk/Client.php#L150-L155 |
4,642 | jingwu15/phpbeanstalk | src/phpbeanstalk/Client.php | Client.usePut | public function usePut($tube, $data, $pri=0, $delay=0, $ttr=30) {
$result = $this->useTube($tube);
if($result === false) return false;
$jobId = $this->put($pri, $delay, $ttr, $data);
return $jobId;
} | php | public function usePut($tube, $data, $pri=0, $delay=0, $ttr=30) {
$result = $this->useTube($tube);
if($result === false) return false;
$jobId = $this->put($pri, $delay, $ttr, $data);
return $jobId;
} | [
"public",
"function",
"usePut",
"(",
"$",
"tube",
",",
"$",
"data",
",",
"$",
"pri",
"=",
"0",
",",
"$",
"delay",
"=",
"0",
",",
"$",
"ttr",
"=",
"30",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"useTube",
"(",
"$",
"tube",
")",
";",
... | useTube and put
@param string $tube
@param integer $pri Jobs with smaller priority values will be scheduled
before jobs with larger priorities. The most urgent priority is
0; the least urgent priority is 4294967295.
@param integer $delay Seconds to wait before putting the job in the
ready queue. The job will be in th... | [
"useTube",
"and",
"put"
] | 1be1810c34883e8a54ced60f748c736af87c9609 | https://github.com/jingwu15/phpbeanstalk/blob/1be1810c34883e8a54ced60f748c736af87c9609/src/phpbeanstalk/Client.php#L308-L313 |
4,643 | ekyna/UserBundle | Controller/Admin/UserController.php | UserController.generatePasswordAction | public function generatePasswordAction(Request $request)
{
$context = $this->loadContext($request);
$resourceName = $this->config->getResourceName();
/** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $resource */
$resource = $context->getResource($resourceName);
$this->i... | php | public function generatePasswordAction(Request $request)
{
$context = $this->loadContext($request);
$resourceName = $this->config->getResourceName();
/** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $resource */
$resource = $context->getResource($resourceName);
$this->i... | [
"public",
"function",
"generatePasswordAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"loadContext",
"(",
"$",
"request",
")",
";",
"$",
"resourceName",
"=",
"$",
"this",
"->",
"config",
"->",
"getResourceName",
... | Generates a new password for the user.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Generates",
"a",
"new",
"password",
"for",
"the",
"user",
"."
] | e38d56aee978148a312a923b9e70bdaad1a381bf | https://github.com/ekyna/UserBundle/blob/e38d56aee978148a312a923b9e70bdaad1a381bf/Controller/Admin/UserController.php#L49-L79 |
4,644 | ekyna/UserBundle | Controller/Admin/UserController.php | UserController.clearPasswordRequestAction | public function clearPasswordRequestAction(Request $request)
{
$context = $this->loadContext($request);
$resourceName = $this->config->getResourceName();
/** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $resource */
$resource = $context->getResource($resourceName);
$thi... | php | public function clearPasswordRequestAction(Request $request)
{
$context = $this->loadContext($request);
$resourceName = $this->config->getResourceName();
/** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $resource */
$resource = $context->getResource($resourceName);
$thi... | [
"public",
"function",
"clearPasswordRequestAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"context",
"=",
"$",
"this",
"->",
"loadContext",
"(",
"$",
"request",
")",
";",
"$",
"resourceName",
"=",
"$",
"this",
"->",
"config",
"->",
"getResourceName"... | Clears the user password request.
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Clears",
"the",
"user",
"password",
"request",
"."
] | e38d56aee978148a312a923b9e70bdaad1a381bf | https://github.com/ekyna/UserBundle/blob/e38d56aee978148a312a923b9e70bdaad1a381bf/Controller/Admin/UserController.php#L87-L111 |
4,645 | oliviermadre/dic-it | src/DICIT/Registry.php | Registry.get | public function get($key, $throwIfNotFound = false)
{
if ($this->has($key)) {
return $this->data[$key];
}
else if ($throwIfNotFound) {
throw new \RuntimeException('Key ' . $key . ' not found in DI Container registry');
}
else {
return null;... | php | public function get($key, $throwIfNotFound = false)
{
if ($this->has($key)) {
return $this->data[$key];
}
else if ($throwIfNotFound) {
throw new \RuntimeException('Key ' . $key . ' not found in DI Container registry');
}
else {
return null;... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"throwIfNotFound",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
";",
"}",
"else",... | Fetches an object from the registry.
@param string $key
@return mixed | [
"Fetches",
"an",
"object",
"from",
"the",
"registry",
"."
] | a3e11305660ca87d296672948ba491b6296cc967 | https://github.com/oliviermadre/dic-it/blob/a3e11305660ca87d296672948ba491b6296cc967/src/DICIT/Registry.php#L28-L39 |
4,646 | SergioMadness/framework | framework/facades/Route.php | Route.to | public static function to($path)
{
$currentLanguage = \Translation::getLanguage();
if (\Translation::getDefaultLanguage() === $currentLanguage) {
$currentLanguage = '';
} else {
$currentLanguage = '/'.$currentLanguage;
}
return $currentLanguage.$path;
... | php | public static function to($path)
{
$currentLanguage = \Translation::getLanguage();
if (\Translation::getDefaultLanguage() === $currentLanguage) {
$currentLanguage = '';
} else {
$currentLanguage = '/'.$currentLanguage;
}
return $currentLanguage.$path;
... | [
"public",
"static",
"function",
"to",
"(",
"$",
"path",
")",
"{",
"$",
"currentLanguage",
"=",
"\\",
"Translation",
"::",
"getLanguage",
"(",
")",
";",
"if",
"(",
"\\",
"Translation",
"::",
"getDefaultLanguage",
"(",
")",
"===",
"$",
"currentLanguage",
")"... | Append with language
@param string $path
@return string | [
"Append",
"with",
"language"
] | a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e | https://github.com/SergioMadness/framework/blob/a5038eb926a5038b9a331d0cb6a68d7fc3cf1f1e/framework/facades/Route.php#L17-L26 |
4,647 | gliverphp/helpers | src/Form/Form.php | Form.open | public static function open($form_attr=array())
{
//this try block is excecuted to enable throwing and catching of errors as appropriate
try {
//this block throwing exception if method argument is not an array
if(! is_array($form... | php | public static function open($form_attr=array())
{
//this try block is excecuted to enable throwing and catching of errors as appropriate
try {
//this block throwing exception if method argument is not an array
if(! is_array($form... | [
"public",
"static",
"function",
"open",
"(",
"$",
"form_attr",
"=",
"array",
"(",
")",
")",
"{",
"//this try block is excecuted to enable throwing and catching of errors as appropriate",
"try",
"{",
"//this block throwing exception if method argument is not an array",
"if",
"(",
... | Ths method create form open tag with attributes in view.
@param array $form_attr Form attributes e.g. $form_attr = array('name'=>'form1','action'=>'post') | [
"Ths",
"method",
"create",
"form",
"open",
"tag",
"with",
"attributes",
"in",
"view",
"."
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/Form/Form.php#L42-L72 |
4,648 | joomlatools/joomlatools-platform-categories | administrator/components/com_categories/controller.php | CategoriesController.display | public function display($cachable = false, $urlparams = array())
{
// Get the document object.
$document = JFactory::getDocument();
// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'categories');
$vFormat = $document->getType();
$lName = $this->input->get('l... | php | public function display($cachable = false, $urlparams = array())
{
// Get the document object.
$document = JFactory::getDocument();
// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'categories');
$vFormat = $document->getType();
$lName = $this->input->get('l... | [
"public",
"function",
"display",
"(",
"$",
"cachable",
"=",
"false",
",",
"$",
"urlparams",
"=",
"array",
"(",
")",
")",
"{",
"// Get the document object.",
"$",
"document",
"=",
"JFactory",
"::",
"getDocument",
"(",
")",
";",
"// Set the default view name and f... | Method to display a view.
@param boolean $cachable If true, the view output will be cached
@param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
@return CategoriesController This object to support chaining.
@since 1.5 | [
"Method",
"to",
"display",
"a",
"view",
"."
] | 9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350 | https://github.com/joomlatools/joomlatools-platform-categories/blob/9fe50b6c4ebe6ebfcf98e50067922fcf4a76d350/administrator/components/com_categories/controller.php#L56-L99 |
4,649 | bkdotcom/Form | src/Output.php | Output.buildOutput | public function buildOutput($form)
{
$this->debug->groupCollapsed(__METHOD__);
$this->debug->groupUncollapse();
$str = '';
foreach ($form->currentFields as $field) {
$str .= $field->build()."\n";
}
$this->debug->groupEnd();
return $str;
} | php | public function buildOutput($form)
{
$this->debug->groupCollapsed(__METHOD__);
$this->debug->groupUncollapse();
$str = '';
foreach ($form->currentFields as $field) {
$str .= $field->build()."\n";
}
$this->debug->groupEnd();
return $str;
} | [
"public",
"function",
"buildOutput",
"(",
"$",
"form",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"this",
"->",
"debug",
"->",
"groupUncollapse",
"(",
")",
";",
"$",
"str",
"=",
"''",
";",
"foreach",... | Default fields builder
@param Form $form form instance
@return string html | [
"Default",
"fields",
"builder"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Output.php#L133-L143 |
4,650 | bkdotcom/Form | src/Output.php | Output.buildHiddenFields | private function buildHiddenFields()
{
$this->debug->groupCollapsed(__METHOD__);
$cfg = $this->form->cfg;
$printOpts = &$cfg['output'];
$hiddenFields = '';
if ($printOpts['inputKey']) { // && $cfg['persist_method'] != 'none'
$hiddenFields .= '<input type="hidde... | php | private function buildHiddenFields()
{
$this->debug->groupCollapsed(__METHOD__);
$cfg = $this->form->cfg;
$printOpts = &$cfg['output'];
$hiddenFields = '';
if ($printOpts['inputKey']) { // && $cfg['persist_method'] != 'none'
$hiddenFields .= '<input type="hidde... | [
"private",
"function",
"buildHiddenFields",
"(",
")",
"{",
"$",
"this",
"->",
"debug",
"->",
"groupCollapsed",
"(",
"__METHOD__",
")",
";",
"$",
"cfg",
"=",
"$",
"this",
"->",
"form",
"->",
"cfg",
";",
"$",
"printOpts",
"=",
"&",
"$",
"cfg",
"[",
"'o... | Generate hidden fields not related to inputs
@return string | [
"Generate",
"hidden",
"fields",
"not",
"related",
"to",
"inputs"
] | 6aa5704b20300e1c8bd1c187a4fa88db9d442cee | https://github.com/bkdotcom/Form/blob/6aa5704b20300e1c8bd1c187a4fa88db9d442cee/src/Output.php#L150-L180 |
4,651 | jhorlima/wp-mocabonita | src/tools/MbPath.php | MbPath.pName | public static function pName()
{
if (is_null(self::$pluginName)) {
self::$pluginName = explode('/', plugin_basename(__FILE__))[0];
}
return self::$pluginName;
} | php | public static function pName()
{
if (is_null(self::$pluginName)) {
self::$pluginName = explode('/', plugin_basename(__FILE__))[0];
}
return self::$pluginName;
} | [
"public",
"static",
"function",
"pName",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"pluginName",
")",
")",
"{",
"self",
"::",
"$",
"pluginName",
"=",
"explode",
"(",
"'/'",
",",
"plugin_basename",
"(",
"__FILE__",
")",
")",
"[",
"0... | Get plugin name
@return string | [
"Get",
"plugin",
"name"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbPath.php#L55-L62 |
4,652 | jhorlima/wp-mocabonita | src/tools/MbPath.php | MbPath.pBaseN | public static function pBaseN()
{
if (is_null(self::$pluginBaseName)) {
self::$pluginBaseName = self::pName() . "/index.php";
}
return self::$pluginBaseName;
} | php | public static function pBaseN()
{
if (is_null(self::$pluginBaseName)) {
self::$pluginBaseName = self::pName() . "/index.php";
}
return self::$pluginBaseName;
} | [
"public",
"static",
"function",
"pBaseN",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"pluginBaseName",
")",
")",
"{",
"self",
"::",
"$",
"pluginBaseName",
"=",
"self",
"::",
"pName",
"(",
")",
".",
"\"/index.php\"",
";",
"}",
"return"... | Get plugin base name
@return string | [
"Get",
"plugin",
"base",
"name"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbPath.php#L69-L76 |
4,653 | jhorlima/wp-mocabonita | src/tools/MbPath.php | MbPath.pDir | public static function pDir($complement = "")
{
if (is_null(self::$pluginDirectory)) {
self::$pluginDirectory = WP_PLUGIN_DIR . "/" . self::pName();
}
return self::$pluginDirectory . $complement;
} | php | public static function pDir($complement = "")
{
if (is_null(self::$pluginDirectory)) {
self::$pluginDirectory = WP_PLUGIN_DIR . "/" . self::pName();
}
return self::$pluginDirectory . $complement;
} | [
"public",
"static",
"function",
"pDir",
"(",
"$",
"complement",
"=",
"\"\"",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"pluginDirectory",
")",
")",
"{",
"self",
"::",
"$",
"pluginDirectory",
"=",
"WP_PLUGIN_DIR",
".",
"\"/\"",
".",
"self",
... | Get plugin directory
@param string $complement
@return string | [
"Get",
"plugin",
"directory"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbPath.php#L85-L92 |
4,654 | jhorlima/wp-mocabonita | src/tools/MbPath.php | MbPath.pUrl | public static function pUrl($complement = "")
{
if (is_null(self::$pluginUrl)) {
self::$pluginUrl = WP_PLUGIN_URL . "/" . self::pName();
}
return self::$pluginUrl . $complement;
} | php | public static function pUrl($complement = "")
{
if (is_null(self::$pluginUrl)) {
self::$pluginUrl = WP_PLUGIN_URL . "/" . self::pName();
}
return self::$pluginUrl . $complement;
} | [
"public",
"static",
"function",
"pUrl",
"(",
"$",
"complement",
"=",
"\"\"",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"pluginUrl",
")",
")",
"{",
"self",
"::",
"$",
"pluginUrl",
"=",
"WP_PLUGIN_URL",
".",
"\"/\"",
".",
"self",
"::",
"p... | Get plugin url
@param string $complement
@return string | [
"Get",
"plugin",
"url"
] | a864b40d5452bc9b892f02a6bb28c02639f25fa8 | https://github.com/jhorlima/wp-mocabonita/blob/a864b40d5452bc9b892f02a6bb28c02639f25fa8/src/tools/MbPath.php#L101-L108 |
4,655 | canis-io/yii2-canis-lib | lib/db/behaviors/ActiveArchivable.php | ActiveArchivable.getArchived | public function getArchived()
{
if (!$this->isArchivable()) {
return false;
}
if (empty($this->owner->{$this->archiveField})) {
return false;
}
return true;
} | php | public function getArchived()
{
if (!$this->isArchivable()) {
return false;
}
if (empty($this->owner->{$this->archiveField})) {
return false;
}
return true;
} | [
"public",
"function",
"getArchived",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isArchivable",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"owner",
"->",
"{",
"$",
"this",
"->",
"archiveField... | Get archived.
@return [[@doctodo return_type:getArchived]] [[@doctodo return_description:getArchived]] | [
"Get",
"archived",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/db/behaviors/ActiveArchivable.php#L79-L89 |
4,656 | teamelf/core | src/Router/Router.php | Router.add | public function add($method, $name, $path, $controller = null, array $requirements = [],
array $options = [], $host = '', array $schemas = [], $condition = '')
{
if (!in_array(strtoupper($method), $this->allowedMethod)) {
throw new HttpMethodNotAllowedException();
... | php | public function add($method, $name, $path, $controller = null, array $requirements = [],
array $options = [], $host = '', array $schemas = [], $condition = '')
{
if (!in_array(strtoupper($method), $this->allowedMethod)) {
throw new HttpMethodNotAllowedException();
... | [
"public",
"function",
"add",
"(",
"$",
"method",
",",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
"=",
"null",
",",
"array",
"$",
"requirements",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"host",
"=",
"''",
... | add a route rule
@param string $method
@param string $name
@param string $path
@param string $controller
@param array $requirements
@param array $options
@param string $host
@param array $schemas
@param string $condition
@return $this
@throws HttpMethodNotAllowedException | [
"add",
"a",
"route",
"rule"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Router/Router.php#L104-L124 |
4,657 | teamelf/core | src/Router/Router.php | Router.get | public function get($name, $path, $controller = null)
{
$this->add('GET', $name, $path, $controller);
return $this;
} | php | public function get($name, $path, $controller = null)
{
$this->add('GET', $name, $path, $controller);
return $this;
} | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"'GET'",
",",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
")",
";",
"return",
"$",
"this",
... | add a get rule in route
@param string $name
@param string $path
@param string $controller
@return $this | [
"add",
"a",
"get",
"rule",
"in",
"route"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Router/Router.php#L134-L138 |
4,658 | teamelf/core | src/Router/Router.php | Router.post | public function post($name, $path, $controller = null)
{
$this->add('POST', $name, $path, $controller);
return $this;
} | php | public function post($name, $path, $controller = null)
{
$this->add('POST', $name, $path, $controller);
return $this;
} | [
"public",
"function",
"post",
"(",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"'POST'",
",",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
")",
";",
"return",
"$",
"this",... | add a post rule in route
@param string $name
@param string $path
@param string $controller
@return $this | [
"add",
"a",
"post",
"rule",
"in",
"route"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Router/Router.php#L148-L152 |
4,659 | teamelf/core | src/Router/Router.php | Router.put | public function put($name, $path, $controller = null)
{
$this->add('PUT', $name, $path, $controller);
return $this;
} | php | public function put($name, $path, $controller = null)
{
$this->add('PUT', $name, $path, $controller);
return $this;
} | [
"public",
"function",
"put",
"(",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"'PUT'",
",",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
")",
";",
"return",
"$",
"this",
... | add a put rule in route
@param string $name
@param string $path
@param string $controller
@return $this | [
"add",
"a",
"put",
"rule",
"in",
"route"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Router/Router.php#L162-L166 |
4,660 | teamelf/core | src/Router/Router.php | Router.delete | public function delete($name, $path, $controller = null)
{
$this->add('DELETE', $name, $path, $controller);
return $this;
} | php | public function delete($name, $path, $controller = null)
{
$this->add('DELETE', $name, $path, $controller);
return $this;
} | [
"public",
"function",
"delete",
"(",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"'DELETE'",
",",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
")",
";",
"return",
"$",
"th... | add a delete rule in route
@param string $name
@param string $path
@param string $controller
@return $this | [
"add",
"a",
"delete",
"rule",
"in",
"route"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Router/Router.php#L176-L180 |
4,661 | teamelf/core | src/Router/Router.php | Router.patch | public function patch($name, $path, $controller = null)
{
$this->add('PATCH', $name, $path, $controller);
return $this;
} | php | public function patch($name, $path, $controller = null)
{
$this->add('PATCH', $name, $path, $controller);
return $this;
} | [
"public",
"function",
"patch",
"(",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"'PATCH'",
",",
"$",
"name",
",",
"$",
"path",
",",
"$",
"controller",
")",
";",
"return",
"$",
"this... | add a patch rule in route
@param string $name
@param string $path
@param string $controller
@return $this | [
"add",
"a",
"patch",
"rule",
"in",
"route"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Router/Router.php#L190-L194 |
4,662 | teamelf/core | src/Router/Router.php | Router.getResponse | public function getResponse()
{
$this->matcher = new UrlMatcher($this->routes, $this->context);
$this->parameters = $this->matcher->matchRequest($this->request);
$controller = $this->parameters['_controller'];
if ($controller === null) {
$response = new Response();
... | php | public function getResponse()
{
$this->matcher = new UrlMatcher($this->routes, $this->context);
$this->parameters = $this->matcher->matchRequest($this->request);
$controller = $this->parameters['_controller'];
if ($controller === null) {
$response = new Response();
... | [
"public",
"function",
"getResponse",
"(",
")",
"{",
"$",
"this",
"->",
"matcher",
"=",
"new",
"UrlMatcher",
"(",
"$",
"this",
"->",
"routes",
",",
"$",
"this",
"->",
"context",
")",
";",
"$",
"this",
"->",
"parameters",
"=",
"$",
"this",
"->",
"match... | get response in controller's handler
@return Response | [
"get",
"response",
"in",
"controller",
"s",
"handler"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Router/Router.php#L201-L216 |
4,663 | Novusvetus/ClassHelper | src/ClassHelper.php | ClassHelper.create | public static function create()
{
$args = func_get_args();
// Class to create should be the calling class if not Object,
// otherwise the first parameter
$class = get_called_class();
if ($class == 'Novusvetus\\ClassHelper\\ClassHelper') {
$class = array_shift($ar... | php | public static function create()
{
$args = func_get_args();
// Class to create should be the calling class if not Object,
// otherwise the first parameter
$class = get_called_class();
if ($class == 'Novusvetus\\ClassHelper\\ClassHelper') {
$class = array_shift($ar... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"// Class to create should be the calling class if not Object,",
"// otherwise the first parameter",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
... | The factory method, allows you to create an instance of a class.
This can be called in two ways - calling via the class directly,
or calling on Object and passing the class name as the first parameter.
@param string $classOrArgument The first argument, or class name (if
called directly on Object).
@param mixed $argum... | [
"The",
"factory",
"method",
"allows",
"you",
"to",
"create",
"an",
"instance",
"of",
"a",
"class",
"."
] | caf06e41ff9825b8ee2b13f85032155246afd2e2 | https://github.com/Novusvetus/ClassHelper/blob/caf06e41ff9825b8ee2b13f85032155246afd2e2/src/ClassHelper.php#L36-L51 |
4,664 | canis-io/yii2-canis-lib | lib/db/behaviors/TagBehavior.php | TagBehavior.getCurrentTags | public function getCurrentTags()
{
if (!isset($this->_currentTags)) {
if (!$this->viaClass) {
return [];
}
$viaClass = $this->viaClass;
$params = [$this->viaLocalField => $this->owner->primaryKey];
$rawTags = $viaClass::find()->disa... | php | public function getCurrentTags()
{
if (!isset($this->_currentTags)) {
if (!$this->viaClass) {
return [];
}
$viaClass = $this->viaClass;
$params = [$this->viaLocalField => $this->owner->primaryKey];
$rawTags = $viaClass::find()->disa... | [
"public",
"function",
"getCurrentTags",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_currentTags",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"viaClass",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"viaClass",
"=",
"$... | Get current tags.
@throws \ [[@doctodo exception_description:\]]
@return [[@doctodo return_type:getCurrentTags]] [[@doctodo return_description:getCurrentTags]] | [
"Get",
"current",
"tags",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/db/behaviors/TagBehavior.php#L194-L211 |
4,665 | MindyPHP/Application | App.php | App.run | public function run()
{
if ('cli' === php_sapi_name()) {
// do run console application
$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = '0' !== getenv('SYMFONY_DEBUG') && !$input->hasParame... | php | public function run()
{
if ('cli' === php_sapi_name()) {
// do run console application
$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = '0' !== getenv('SYMFONY_DEBUG') && !$input->hasParame... | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"'cli'",
"===",
"php_sapi_name",
"(",
")",
")",
"{",
"// do run console application",
"$",
"input",
"=",
"new",
"ArgvInput",
"(",
")",
";",
"$",
"env",
"=",
"$",
"input",
"->",
"getParameterOption",
... | Start application.
@throws \Exception | [
"Start",
"application",
"."
] | 69528a93d68d9bf897382c6afe6f46acda94c076 | https://github.com/MindyPHP/Application/blob/69528a93d68d9bf897382c6afe6f46acda94c076/App.php#L137-L179 |
4,666 | aruberutochan/repository | src/Eloquent/BaseRepository.php | BaseRepository.firstOrCreate | public function firstOrCreate(array $attributes = [])
{
$this->applyCriteria();
$this->applyScope();
$model = $this->model->firstOrCreate($attributes);
$this->resetModel();
return $this->parserResult($model);
} | php | public function firstOrCreate(array $attributes = [])
{
$this->applyCriteria();
$this->applyScope();
$model = $this->model->firstOrCreate($attributes);
$this->resetModel();
return $this->parserResult($model);
} | [
"public",
"function",
"firstOrCreate",
"(",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"applyCriteria",
"(",
")",
";",
"$",
"this",
"->",
"applyScope",
"(",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
"->",
... | Retrieve first data of repository, or create new Entity
@param array $attributes
@return mixed | [
"Retrieve",
"first",
"data",
"of",
"repository",
"or",
"create",
"new",
"Entity"
] | 4ecc5eb37377af8f000af76c886c217479dcf454 | https://github.com/aruberutochan/repository/blob/4ecc5eb37377af8f000af76c886c217479dcf454/src/Eloquent/BaseRepository.php#L276-L285 |
4,667 | chestnut-framework/container | src/Builder.php | Builder.dispatchRequirements | public function dispatchRequirements($dependencies, $parameters) {
$dispatches = [];
foreach ($dependencies as $dependency) {
list($name, $instance) = $this->extractDependency($dependency, $parameters);
$dispatches[$name] = $instance;
}
return $dispatches;
} | php | public function dispatchRequirements($dependencies, $parameters) {
$dispatches = [];
foreach ($dependencies as $dependency) {
list($name, $instance) = $this->extractDependency($dependency, $parameters);
$dispatches[$name] = $instance;
}
return $dispatches;
} | [
"public",
"function",
"dispatchRequirements",
"(",
"$",
"dependencies",
",",
"$",
"parameters",
")",
"{",
"$",
"dispatches",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"dependencies",
"as",
"$",
"dependency",
")",
"{",
"list",
"(",
"$",
"name",
",",
"$",
... | Dispacth require dependencies
@param array $dependencies
@param array $parameters
@return array | [
"Dispacth",
"require",
"dependencies"
] | c64f09256ca316a64adc30c08c0457c49e974f66 | https://github.com/chestnut-framework/container/blob/c64f09256ca316a64adc30c08c0457c49e974f66/src/Builder.php#L63-L73 |
4,668 | chestnut-framework/container | src/Builder.php | Builder.generateReflector | public function generateReflector($type, $factory) {
switch ($type) {
case 'callback':
return $this->generateCallbackReflector($factory);
case 'class':
return $this->generateClassReflector($factory);
}
} | php | public function generateReflector($type, $factory) {
switch ($type) {
case 'callback':
return $this->generateCallbackReflector($factory);
case 'class':
return $this->generateClassReflector($factory);
}
} | [
"public",
"function",
"generateReflector",
"(",
"$",
"type",
",",
"$",
"factory",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'callback'",
":",
"return",
"$",
"this",
"->",
"generateCallbackReflector",
"(",
"$",
"factory",
")",
";",
"case",
... | Generate factory's reflector
@param string $type
@param string|Closure $factory
@return array | [
"Generate",
"factory",
"s",
"reflector"
] | c64f09256ca316a64adc30c08c0457c49e974f66 | https://github.com/chestnut-framework/container/blob/c64f09256ca316a64adc30c08c0457c49e974f66/src/Builder.php#L123-L130 |
4,669 | chestnut-framework/container | src/Builder.php | Builder.generateCallbackReflector | public function generateCallbackReflector($factory) {
$reflector = new ReflectionFunction($factory);
$dependencies = $reflector->getParameters();
return [$factory, $dependencies];
} | php | public function generateCallbackReflector($factory) {
$reflector = new ReflectionFunction($factory);
$dependencies = $reflector->getParameters();
return [$factory, $dependencies];
} | [
"public",
"function",
"generateCallbackReflector",
"(",
"$",
"factory",
")",
"{",
"$",
"reflector",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"factory",
")",
";",
"$",
"dependencies",
"=",
"$",
"reflector",
"->",
"getParameters",
"(",
")",
";",
"return",
"... | Generate callback reflector
@param Closure $factory
@return ReflectionFunction | [
"Generate",
"callback",
"reflector"
] | c64f09256ca316a64adc30c08c0457c49e974f66 | https://github.com/chestnut-framework/container/blob/c64f09256ca316a64adc30c08c0457c49e974f66/src/Builder.php#L139-L145 |
4,670 | chestnut-framework/container | src/Builder.php | Builder.generateClassReflector | public function generateClassReflector($factory) {
$reflector = new ReflectionClass($factory);
$constructor = $reflector->getConstructor();
$dependencies = is_null($constructor) ? [] : $constructor->getParameters();
return [$reflector, $dependencies];
} | php | public function generateClassReflector($factory) {
$reflector = new ReflectionClass($factory);
$constructor = $reflector->getConstructor();
$dependencies = is_null($constructor) ? [] : $constructor->getParameters();
return [$reflector, $dependencies];
} | [
"public",
"function",
"generateClassReflector",
"(",
"$",
"factory",
")",
"{",
"$",
"reflector",
"=",
"new",
"ReflectionClass",
"(",
"$",
"factory",
")",
";",
"$",
"constructor",
"=",
"$",
"reflector",
"->",
"getConstructor",
"(",
")",
";",
"$",
"dependencie... | Generate class reflector
@param string $factory
@return ReflectionClass | [
"Generate",
"class",
"reflector"
] | c64f09256ca316a64adc30c08c0457c49e974f66 | https://github.com/chestnut-framework/container/blob/c64f09256ca316a64adc30c08c0457c49e974f66/src/Builder.php#L154-L161 |
4,671 | samurai-fw/samurai | src/Samurai/Component/Routing/Rule/GroupRule.php | GroupRule.get | public function get($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_GET, $action);
} | php | public function get($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_GET, $action);
} | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"action",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"(",
"$",
"path",
",",
"HttpMethodRule",
"::",
"HTTP_METHOD_GET",
",",
"$",
"action",
")",
";",
"}"
] | get method matching
@param string $path
@param string|Closure $action
@return Rule | [
"get",
"method",
"matching"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Routing/Rule/GroupRule.php#L93-L96 |
4,672 | samurai-fw/samurai | src/Samurai/Component/Routing/Rule/GroupRule.php | GroupRule.post | public function post($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_POST, $action);
} | php | public function post($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_POST, $action);
} | [
"public",
"function",
"post",
"(",
"$",
"path",
",",
"$",
"action",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"(",
"$",
"path",
",",
"HttpMethodRule",
"::",
"HTTP_METHOD_POST",
",",
"$",
"action",
")",
";",
"}"
] | post method matching
@param string $path
@param string|Closure $action
@return Rule | [
"post",
"method",
"matching"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Routing/Rule/GroupRule.php#L105-L108 |
4,673 | samurai-fw/samurai | src/Samurai/Component/Routing/Rule/GroupRule.php | GroupRule.put | public function put($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_PUT, $action);
} | php | public function put($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_PUT, $action);
} | [
"public",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"action",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"(",
"$",
"path",
",",
"HttpMethodRule",
"::",
"HTTP_METHOD_PUT",
",",
"$",
"action",
")",
";",
"}"
] | put method matching
@param string $path
@param string|Closure $action
@return Rule | [
"put",
"method",
"matching"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Routing/Rule/GroupRule.php#L117-L120 |
4,674 | samurai-fw/samurai | src/Samurai/Component/Routing/Rule/GroupRule.php | GroupRule.delete | public function delete($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_DELETE, $action);
} | php | public function delete($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_DELETE, $action);
} | [
"public",
"function",
"delete",
"(",
"$",
"path",
",",
"$",
"action",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"(",
"$",
"path",
",",
"HttpMethodRule",
"::",
"HTTP_METHOD_DELETE",
",",
"$",
"action",
")",
";",
"}"
] | delete method matching
@param string $path
@param string|Closure $action
@return Rule | [
"delete",
"method",
"matching"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Routing/Rule/GroupRule.php#L141-L144 |
4,675 | samurai-fw/samurai | src/Samurai/Component/Routing/Rule/GroupRule.php | GroupRule.any | public function any($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_ANY, $action);
} | php | public function any($path, $action = null)
{
return $this->match($path, HttpMethodRule::HTTP_METHOD_ANY, $action);
} | [
"public",
"function",
"any",
"(",
"$",
"path",
",",
"$",
"action",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"(",
"$",
"path",
",",
"HttpMethodRule",
"::",
"HTTP_METHOD_ANY",
",",
"$",
"action",
")",
";",
"}"
] | any method matching
@param string $path
@param string|Closure $action
@return Rule | [
"any",
"method",
"matching"
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Routing/Rule/GroupRule.php#L153-L156 |
4,676 | white-frame/helloquent | src/Model/IsResource.php | IsResource.controller | public function controller()
{
if(!$this->hasController()) {
throw new InvalidControllerException('Could get controller of ' . get_class($this) . '. Please fill $controller property.');
}
return app()->make($this->controller);
} | php | public function controller()
{
if(!$this->hasController()) {
throw new InvalidControllerException('Could get controller of ' . get_class($this) . '. Please fill $controller property.');
}
return app()->make($this->controller);
} | [
"public",
"function",
"controller",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasController",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidControllerException",
"(",
"'Could get controller of '",
".",
"get_class",
"(",
"$",
"this",
")",
".",
"'. Plea... | Get the controller linked from
@return mixed
@throws InvalidControllerException | [
"Get",
"the",
"controller",
"linked",
"from"
] | 34dddd0fe9b85f038b897497042161251c61f188 | https://github.com/white-frame/helloquent/blob/34dddd0fe9b85f038b897497042161251c61f188/src/Model/IsResource.php#L27-L34 |
4,677 | jeurboy/object-field-selector | src/Util.php | Util._mergeRecursively | private function _mergeRecursively($obj1, $obj2) {
if(empty($obj1))
return $obj2;
if (is_object($obj2)) {
$keys = array_keys(get_object_vars($obj2));
foreach ($keys as $key) {
if (
isset($obj1->{$key})
&& is_ob... | php | private function _mergeRecursively($obj1, $obj2) {
if(empty($obj1))
return $obj2;
if (is_object($obj2)) {
$keys = array_keys(get_object_vars($obj2));
foreach ($keys as $key) {
if (
isset($obj1->{$key})
&& is_ob... | [
"private",
"function",
"_mergeRecursively",
"(",
"$",
"obj1",
",",
"$",
"obj2",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"obj1",
")",
")",
"return",
"$",
"obj2",
";",
"if",
"(",
"is_object",
"(",
"$",
"obj2",
")",
")",
"{",
"$",
"keys",
"=",
"arra... | Recursively merges two objects and returns a resulting object.
@param object $obj1 The base object
@param object $obj2 The merge object
@return object The merged object | [
"Recursively",
"merges",
"two",
"objects",
"and",
"returns",
"a",
"resulting",
"object",
"."
] | 7db12ef511a6099c2b62c1fdf7cf4accb2560c30 | https://github.com/jeurboy/object-field-selector/blob/7db12ef511a6099c2b62c1fdf7cf4accb2560c30/src/Util.php#L32-L74 |
4,678 | andela-womokoro/potato-orm | src/Connection.php | Connection.connect | public static function connect()
{
try
{
/**
* Check if the APP_ENV variable is set. If not found or it has a value of 'local'
* then load variable values from app's .env file. Else load server server environment variables.
*/
if (! getenv('APP_ENV') || getenv('APP_E... | php | public static function connect()
{
try
{
/**
* Check if the APP_ENV variable is set. If not found or it has a value of 'local'
* then load variable values from app's .env file. Else load server server environment variables.
*/
if (! getenv('APP_ENV') || getenv('APP_E... | [
"public",
"static",
"function",
"connect",
"(",
")",
"{",
"try",
"{",
"/**\n * Check if the APP_ENV variable is set. If not found or it has a value of 'local'\n * then load variable values from app's .env file. Else load server server environment variables.\n */",
"if",
... | This method creates and returns a connection to the database | [
"This",
"method",
"creates",
"and",
"returns",
"a",
"connection",
"to",
"the",
"database"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Connection.php#L14-L39 |
4,679 | oaugustus/direct-silex-provider | src/Direct/Api.php | Api.getApi | public function getApi()
{
if ($this->app['debug']){
$exceptionLogStr =
'Ext.direct.Manager.on("exception", function(error){console.error(Ext.util.Format.format("Remote Call: {0}.{1}\n{2}", error.action, error.method, error.message, error.where)); return false;});';
... | php | public function getApi()
{
if ($this->app['debug']){
$exceptionLogStr =
'Ext.direct.Manager.on("exception", function(error){console.error(Ext.util.Format.format("Remote Call: {0}.{1}\n{2}", error.action, error.method, error.message, error.where)); return false;});';
... | [
"public",
"function",
"getApi",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"[",
"'debug'",
"]",
")",
"{",
"$",
"exceptionLogStr",
"=",
"'Ext.direct.Manager.on(\"exception\", function(error){console.error(Ext.util.Format.format(\"Remote Call: {0}.{1}\\n{2}\", error.ac... | Get the ExtDirect API response.
@return String | [
"Get",
"the",
"ExtDirect",
"API",
"response",
"."
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Api.php#L69-L88 |
4,680 | oaugustus/direct-silex-provider | src/Direct/Api.php | Api.getRemoting | public function getRemoting()
{
$apiStr = sprintf("Ext.app.REMOTING_API =%s;", $this);
$response = new Response($apiStr);
// set the response header
$response->headers->set('Content-Type', 'text/javascript');
// return the response
return $response;
} | php | public function getRemoting()
{
$apiStr = sprintf("Ext.app.REMOTING_API =%s;", $this);
$response = new Response($apiStr);
// set the response header
$response->headers->set('Content-Type', 'text/javascript');
// return the response
return $response;
} | [
"public",
"function",
"getRemoting",
"(",
")",
"{",
"$",
"apiStr",
"=",
"sprintf",
"(",
"\"Ext.app.REMOTING_API =%s;\"",
",",
"$",
"this",
")",
";",
"$",
"response",
"=",
"new",
"Response",
"(",
"$",
"apiStr",
")",
";",
"// set the response header",
"$",
"re... | Get the ExtDirect Api response Remoting descriptor.
@return string; | [
"Get",
"the",
"ExtDirect",
"Api",
"response",
"Remoting",
"descriptor",
"."
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Api.php#L95-L106 |
4,681 | oaugustus/direct-silex-provider | src/Direct/Api.php | Api.createApi | private function createApi()
{
$routes = $this->app["routes"];
$actions = $this->getRouteActions($routes);
return array(
'url' => $this->app['request']->getBaseUrl().
$this->app['direct.route.pattern'],
'type' => $this->app['direct.api.type'],
... | php | private function createApi()
{
$routes = $this->app["routes"];
$actions = $this->getRouteActions($routes);
return array(
'url' => $this->app['request']->getBaseUrl().
$this->app['direct.route.pattern'],
'type' => $this->app['direct.api.type'],
... | [
"private",
"function",
"createApi",
"(",
")",
"{",
"$",
"routes",
"=",
"$",
"this",
"->",
"app",
"[",
"\"routes\"",
"]",
";",
"$",
"actions",
"=",
"$",
"this",
"->",
"getRouteActions",
"(",
"$",
"routes",
")",
";",
"return",
"array",
"(",
"'url'",
"=... | Create the ExtDirect API based on controllers files.
@return string JSON description of Direct API | [
"Create",
"the",
"ExtDirect",
"API",
"based",
"on",
"controllers",
"files",
"."
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Api.php#L126-L140 |
4,682 | oaugustus/direct-silex-provider | src/Direct/Api.php | Api.getRouteActions | protected function getRouteActions($routes)
{
$actions = array();
// iterate for all routes
foreach ($routes->all() as $route){
// if route is post and is direct exposed
if (in_array('POST', $route->getMethods()) == true && $route->isDirect()){
$apiP... | php | protected function getRouteActions($routes)
{
$actions = array();
// iterate for all routes
foreach ($routes->all() as $route){
// if route is post and is direct exposed
if (in_array('POST', $route->getMethods()) == true && $route->isDirect()){
$apiP... | [
"protected",
"function",
"getRouteActions",
"(",
"$",
"routes",
")",
"{",
"$",
"actions",
"=",
"array",
"(",
")",
";",
"// iterate for all routes",
"foreach",
"(",
"$",
"routes",
"->",
"all",
"(",
")",
"as",
"$",
"route",
")",
"{",
"// if route is post and i... | Get the route API definition
@param array
@return array Controllers list | [
"Get",
"the",
"route",
"API",
"definition"
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Api.php#L159-L182 |
4,683 | oaugustus/direct-silex-provider | src/Direct/Api.php | Api.getRouteApiParts | protected function getRouteApiParts($route)
{
$name = explode('/', $route->getPattern());
$parts = array(
'exposed' => false
);
// if the name has more than one string pattern
if (count($name) > 2){
// get the method name
$method = array_... | php | protected function getRouteApiParts($route)
{
$name = explode('/', $route->getPattern());
$parts = array(
'exposed' => false
);
// if the name has more than one string pattern
if (count($name) > 2){
// get the method name
$method = array_... | [
"protected",
"function",
"getRouteApiParts",
"(",
"$",
"route",
")",
"{",
"$",
"name",
"=",
"explode",
"(",
"'/'",
",",
"$",
"route",
"->",
"getPattern",
"(",
")",
")",
";",
"$",
"parts",
"=",
"array",
"(",
"'exposed'",
"=>",
"false",
")",
";",
"// i... | Return the route extdirect api parts.
@param $route
@return mixed | [
"Return",
"the",
"route",
"extdirect",
"api",
"parts",
"."
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Api.php#L190-L224 |
4,684 | OWeb/OWeb-Framework | OWeb/defaults/models/programs/Programs.php | Programs.getprogram | public function getprogram($id)
{
if (isset($this->programs[$id]))
return $this->programs[$id];
else {
try {
$programs = $this->getProgramsArray(array($id));
if(isset($programs[$id])){
return $programs[$id];
... | php | public function getprogram($id)
{
if (isset($this->programs[$id]))
return $this->programs[$id];
else {
try {
$programs = $this->getProgramsArray(array($id));
if(isset($programs[$id])){
return $programs[$id];
... | [
"public",
"function",
"getprogram",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"programs",
"[",
"$",
"id",
"]",
")",
")",
"return",
"$",
"this",
"->",
"programs",
"[",
"$",
"id",
"]",
";",
"else",
"{",
"try",
"{",
"$"... | Recovers the Program with the demanded ID
@param $id
@return Program
@throws exception\ProgramNotFound thrown if this program doesn't exist or there is a problem with the DB | [
"Recovers",
"the",
"Program",
"with",
"the",
"demanded",
"ID"
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/defaults/models/programs/Programs.php#L73-L94 |
4,685 | nano7/Database | src/Model/Model.php | Model.toClone | public function toClone()
{
$attributes = $this->toArray(false);
unset($attributes['id']);
unset($attributes['_id']);
return $this->create($attributes, false);
} | php | public function toClone()
{
$attributes = $this->toArray(false);
unset($attributes['id']);
unset($attributes['_id']);
return $this->create($attributes, false);
} | [
"public",
"function",
"toClone",
"(",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"toArray",
"(",
"false",
")",
";",
"unset",
"(",
"$",
"attributes",
"[",
"'id'",
"]",
")",
";",
"unset",
"(",
"$",
"attributes",
"[",
"'_id'",
"]",
")",
";",... | Create clone this model.
@return Model | [
"Create",
"clone",
"this",
"model",
"."
] | 7d8c10af415c469a317f40471f657104e4d5b52a | https://github.com/nano7/Database/blob/7d8c10af415c469a317f40471f657104e4d5b52a/src/Model/Model.php#L171-L179 |
4,686 | nano7/Database | src/Model/Model.php | Model.getCollection | public function getCollection()
{
if (! isset($this->collection)) {
return str_replace(
'\\', '', Str::snake(Str::plural(class_basename($this)))
);
}
return $this->collection;
} | php | public function getCollection()
{
if (! isset($this->collection)) {
return str_replace(
'\\', '', Str::snake(Str::plural(class_basename($this)))
);
}
return $this->collection;
} | [
"public",
"function",
"getCollection",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"collection",
")",
")",
"{",
"return",
"str_replace",
"(",
"'\\\\'",
",",
"''",
",",
"Str",
"::",
"snake",
"(",
"Str",
"::",
"plural",
"(",
"class_... | Get the collection associated with the model.
@return string | [
"Get",
"the",
"collection",
"associated",
"with",
"the",
"model",
"."
] | 7d8c10af415c469a317f40471f657104e4d5b52a | https://github.com/nano7/Database/blob/7d8c10af415c469a317f40471f657104e4d5b52a/src/Model/Model.php#L186-L195 |
4,687 | nano7/Database | src/Model/Model.php | Model.performDelete | protected function performDelete(QueryBuilder $query)
{
// Verificar se documento existe (que já foi carregado ou salvo)
if (! $this->exists) {
return true;
}
// Disparar evento que o documento esta sendo excluido
if ($this->fireModelEvent('deleting') === false) ... | php | protected function performDelete(QueryBuilder $query)
{
// Verificar se documento existe (que já foi carregado ou salvo)
if (! $this->exists) {
return true;
}
// Disparar evento que o documento esta sendo excluido
if ($this->fireModelEvent('deleting') === false) ... | [
"protected",
"function",
"performDelete",
"(",
"QueryBuilder",
"$",
"query",
")",
"{",
"// Verificar se documento existe (que já foi carregado ou salvo)",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
")",
"{",
"return",
"true",
";",
"}",
"// Disparar evento que o docume... | Processar exclusao do documento.
@param QueryBuilder $query
@return bool | [
"Processar",
"exclusao",
"do",
"documento",
"."
] | 7d8c10af415c469a317f40471f657104e4d5b52a | https://github.com/nano7/Database/blob/7d8c10af415c469a317f40471f657104e4d5b52a/src/Model/Model.php#L376-L399 |
4,688 | mszewcz/php-json-schema-validator | src/Validators/StringValidators/PatternValidator.php | PatternValidator.validate | public function validate($subject): bool
{
if (\is_string($this->schema['pattern'])) {
if (!\preg_match(sprintf('/%s/i', $this->schema['pattern']), $subject)) {
return false;
}
}
return true;
} | php | public function validate($subject): bool
{
if (\is_string($this->schema['pattern'])) {
if (!\preg_match(sprintf('/%s/i', $this->schema['pattern']), $subject)) {
return false;
}
}
return true;
} | [
"public",
"function",
"validate",
"(",
"$",
"subject",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"this",
"->",
"schema",
"[",
"'pattern'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"\\",
"preg_match",
"(",
"sprintf",
"(",
"'/%s/i'",
... | Validates subject against pattern
@param $subject
@return bool | [
"Validates",
"subject",
"against",
"pattern"
] | f7768bfe07ce6508bb1ff36163560a5e5791de7d | https://github.com/mszewcz/php-json-schema-validator/blob/f7768bfe07ce6508bb1ff36163560a5e5791de7d/src/Validators/StringValidators/PatternValidator.php#L47-L55 |
4,689 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/cache/storage/redis.php | Cache_Storage_Redis._get_key | protected function _get_key($remove = false)
{
// get the current index information
list($identifier, $sections, $index) = $this->_get_index();
$index = $index === null ? array() : $index = $this->_unserialize($index);
// get the key from the index
$key = isset($index[$identifier][0]) ? $index[$identifier][... | php | protected function _get_key($remove = false)
{
// get the current index information
list($identifier, $sections, $index) = $this->_get_index();
$index = $index === null ? array() : $index = $this->_unserialize($index);
// get the key from the index
$key = isset($index[$identifier][0]) ? $index[$identifier][... | [
"protected",
"function",
"_get_key",
"(",
"$",
"remove",
"=",
"false",
")",
"{",
"// get the current index information",
"list",
"(",
"$",
"identifier",
",",
"$",
"sections",
",",
"$",
"index",
")",
"=",
"$",
"this",
"->",
"_get_index",
"(",
")",
";",
"$",... | get's the redis key belonging to the cache identifier
@param bool if true, remove the key retrieved from the index
@return string | [
"get",
"s",
"the",
"redis",
"key",
"belonging",
"to",
"the",
"cache",
"identifier"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/cache/storage/redis.php#L351-L375 |
4,690 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/cache/storage/redis.php | Cache_Storage_Redis._new_key | protected function _new_key()
{
$key = '';
while (strlen($key) < 32)
{
$key .= mt_rand(0, mt_getrandmax());
}
return md5($this->config['cache_id'].'_'.uniqid($key, TRUE));
} | php | protected function _new_key()
{
$key = '';
while (strlen($key) < 32)
{
$key .= mt_rand(0, mt_getrandmax());
}
return md5($this->config['cache_id'].'_'.uniqid($key, TRUE));
} | [
"protected",
"function",
"_new_key",
"(",
")",
"{",
"$",
"key",
"=",
"''",
";",
"while",
"(",
"strlen",
"(",
"$",
"key",
")",
"<",
"32",
")",
"{",
"$",
"key",
".=",
"mt_rand",
"(",
"0",
",",
"mt_getrandmax",
"(",
")",
")",
";",
"}",
"return",
"... | generate a new unique key for the current identifier
@return string | [
"generate",
"a",
"new",
"unique",
"key",
"for",
"the",
"current",
"identifier"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/cache/storage/redis.php#L382-L390 |
4,691 | loyals-online/silverstripe-jsend | code/service/JSendResponse.php | JSendResponse.parse | public static function parse($json)
{
$json = json_decode($json);
if (!isset($json->status)) {
throw new JSendParseException('Could not parse data; required element \'status\' missing.');
}
$instance = new static($json->status);
if (!isset($json->code)) {
... | php | public static function parse($json)
{
$json = json_decode($json);
if (!isset($json->status)) {
throw new JSendParseException('Could not parse data; required element \'status\' missing.');
}
$instance = new static($json->status);
if (!isset($json->code)) {
... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"json",
")",
"{",
"$",
"json",
"=",
"json_decode",
"(",
"$",
"json",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"json",
"->",
"status",
")",
")",
"{",
"throw",
"new",
"JSendParseException",
"(",
... | Parse a JSend response json
@param $json
@return static
@throws \JSendParseException | [
"Parse",
"a",
"JSend",
"response",
"json"
] | 32a33333e827dc2fe99c83d70109ee116d458bd0 | https://github.com/loyals-online/silverstripe-jsend/blob/32a33333e827dc2fe99c83d70109ee116d458bd0/code/service/JSendResponse.php#L55-L91 |
4,692 | loyals-online/silverstripe-jsend | code/service/JSendResponse.php | JSendResponse.getJson | public function getJson()
{
$response = [
'status' => $this->status,
];
switch ($this->status) {
case self::STATUS_SUCCESS:
case self::STATUS_FAIL:
$response = array_merge(
$response,
[
... | php | public function getJson()
{
$response = [
'status' => $this->status,
];
switch ($this->status) {
case self::STATUS_SUCCESS:
case self::STATUS_FAIL:
$response = array_merge(
$response,
[
... | [
"public",
"function",
"getJson",
"(",
")",
"{",
"$",
"response",
"=",
"[",
"'status'",
"=>",
"$",
"this",
"->",
"status",
",",
"]",
";",
"switch",
"(",
"$",
"this",
"->",
"status",
")",
"{",
"case",
"self",
"::",
"STATUS_SUCCESS",
":",
"case",
"self"... | Retrieve the json response
@return string | [
"Retrieve",
"the",
"json",
"response"
] | 32a33333e827dc2fe99c83d70109ee116d458bd0 | https://github.com/loyals-online/silverstripe-jsend/blob/32a33333e827dc2fe99c83d70109ee116d458bd0/code/service/JSendResponse.php#L120-L167 |
4,693 | loyals-online/silverstripe-jsend | code/service/JSendResponse.php | JSendResponse.setStatus | public function setStatus($status)
{
if (!in_array($status, $this->getStatusses())) {
throw new Exception(sprintf('Illegal status %1$s given. Must be one of %2$s', $status, implode(', ', $this->getStatusses())));
}
$this->status = $status;
return $this;
} | php | public function setStatus($status)
{
if (!in_array($status, $this->getStatusses())) {
throw new Exception(sprintf('Illegal status %1$s given. Must be one of %2$s', $status, implode(', ', $this->getStatusses())));
}
$this->status = $status;
return $this;
} | [
"public",
"function",
"setStatus",
"(",
"$",
"status",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"status",
",",
"$",
"this",
"->",
"getStatusses",
"(",
")",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"sprintf",
"(",
"'Illegal status %1$s give... | Set the status for this response
@param string $status
@throws \Exception
@return $this | [
"Set",
"the",
"status",
"for",
"this",
"response"
] | 32a33333e827dc2fe99c83d70109ee116d458bd0 | https://github.com/loyals-online/silverstripe-jsend/blob/32a33333e827dc2fe99c83d70109ee116d458bd0/code/service/JSendResponse.php#L177-L186 |
4,694 | weew/http-client | src/Weew/HttpClient/Drivers/Curl/RequestBuilder.php | RequestBuilder.setOptions | protected function setOptions() {
$this->resource->setOption(CURLOPT_URL, $this->createUrl());
$this->resource->setOption(CURLOPT_CUSTOMREQUEST, $this->request->getMethod());
$this->resource->setOption(CURLOPT_RETURNTRANSFER, true);
$this->resource->setOption(CURLOPT_HEADER, true);
... | php | protected function setOptions() {
$this->resource->setOption(CURLOPT_URL, $this->createUrl());
$this->resource->setOption(CURLOPT_CUSTOMREQUEST, $this->request->getMethod());
$this->resource->setOption(CURLOPT_RETURNTRANSFER, true);
$this->resource->setOption(CURLOPT_HEADER, true);
... | [
"protected",
"function",
"setOptions",
"(",
")",
"{",
"$",
"this",
"->",
"resource",
"->",
"setOption",
"(",
"CURLOPT_URL",
",",
"$",
"this",
"->",
"createUrl",
"(",
")",
")",
";",
"$",
"this",
"->",
"resource",
"->",
"setOption",
"(",
"CURLOPT_CUSTOMREQUE... | Process and client settings. | [
"Process",
"and",
"client",
"settings",
"."
] | bbe5d9d9dc143cc1a46be53ebd1c294d9390d267 | https://github.com/weew/http-client/blob/bbe5d9d9dc143cc1a46be53ebd1c294d9390d267/src/Weew/HttpClient/Drivers/Curl/RequestBuilder.php#L80-L104 |
4,695 | weew/http-client | src/Weew/HttpClient/Drivers/Curl/RequestBuilder.php | RequestBuilder.setHeaders | protected function setHeaders() {
$headers = $this->request->getHeaders()->toFlatArray();
$this->resource->setOption(CURLOPT_HTTPHEADER, $headers);
} | php | protected function setHeaders() {
$headers = $this->request->getHeaders()->toFlatArray();
$this->resource->setOption(CURLOPT_HTTPHEADER, $headers);
} | [
"protected",
"function",
"setHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"request",
"->",
"getHeaders",
"(",
")",
"->",
"toFlatArray",
"(",
")",
";",
"$",
"this",
"->",
"resource",
"->",
"setOption",
"(",
"CURLOPT_HTTPHEADER",
",",
"... | Process and apply request headers. | [
"Process",
"and",
"apply",
"request",
"headers",
"."
] | bbe5d9d9dc143cc1a46be53ebd1c294d9390d267 | https://github.com/weew/http-client/blob/bbe5d9d9dc143cc1a46be53ebd1c294d9390d267/src/Weew/HttpClient/Drivers/Curl/RequestBuilder.php#L109-L112 |
4,696 | weew/http-client | src/Weew/HttpClient/Drivers/Curl/RequestBuilder.php | RequestBuilder.setContent | protected function setContent() {
$body = null;
if ($this->request->hasContent()) {
$body = $this->request->getContent();
}
if ($body !== null) {
$this->resource->setOption(CURLOPT_POST, true);
$this->resource->setOption(CURLOPT_POSTFIELDS, $body);
... | php | protected function setContent() {
$body = null;
if ($this->request->hasContent()) {
$body = $this->request->getContent();
}
if ($body !== null) {
$this->resource->setOption(CURLOPT_POST, true);
$this->resource->setOption(CURLOPT_POSTFIELDS, $body);
... | [
"protected",
"function",
"setContent",
"(",
")",
"{",
"$",
"body",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"hasContent",
"(",
")",
")",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"request",
"->",
"getContent",
"(",
")",
";",... | Send request content. | [
"Send",
"request",
"content",
"."
] | bbe5d9d9dc143cc1a46be53ebd1c294d9390d267 | https://github.com/weew/http-client/blob/bbe5d9d9dc143cc1a46be53ebd1c294d9390d267/src/Weew/HttpClient/Drivers/Curl/RequestBuilder.php#L117-L128 |
4,697 | open-orchestra/open-orchestra-elastica-admin-bundle | ElasticaAdmin/Mapper/FieldToElasticaTypeMapper.php | FieldToElasticaTypeMapper.map | public function map($formType)
{
$this->mapping = array_merge(array($formType => 'string'), $this->mapping);
return $this->mapping[$formType];
} | php | public function map($formType)
{
$this->mapping = array_merge(array($formType => 'string'), $this->mapping);
return $this->mapping[$formType];
} | [
"public",
"function",
"map",
"(",
"$",
"formType",
")",
"{",
"$",
"this",
"->",
"mapping",
"=",
"array_merge",
"(",
"array",
"(",
"$",
"formType",
"=>",
"'string'",
")",
",",
"$",
"this",
"->",
"mapping",
")",
";",
"return",
"$",
"this",
"->",
"mappi... | Returns the Elastica type linked to a form type
@param string $formType
@return string | [
"Returns",
"the",
"Elastica",
"type",
"linked",
"to",
"a",
"form",
"type"
] | 6d14beec9d78410e62549d6645d213548e4001a3 | https://github.com/open-orchestra/open-orchestra-elastica-admin-bundle/blob/6d14beec9d78410e62549d6645d213548e4001a3/ElasticaAdmin/Mapper/FieldToElasticaTypeMapper.php#L19-L24 |
4,698 | quantaphp/class-names | src/Psr4Namespace.php | Psr4Namespace.directories | private function directories(): \Generator
{
foreach ($this->directories as $root) {
if (is_dir($root)) {
yield $root => new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($root)
);
}
}
} | php | private function directories(): \Generator
{
foreach ($this->directories as $root) {
if (is_dir($root)) {
yield $root => new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($root)
);
}
}
} | [
"private",
"function",
"directories",
"(",
")",
":",
"\\",
"Generator",
"{",
"foreach",
"(",
"$",
"this",
"->",
"directories",
"as",
"$",
"root",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"root",
")",
")",
"{",
"yield",
"$",
"root",
"=>",
"new",
"\\... | Yield an iterator for each directory.
@return \Generator | [
"Yield",
"an",
"iterator",
"for",
"each",
"directory",
"."
] | 2c0aea13ff82aa70df0fe6f78247415d15a994d1 | https://github.com/quantaphp/class-names/blob/2c0aea13ff82aa70df0fe6f78247415d15a994d1/src/Psr4Namespace.php#L62-L71 |
4,699 | quantaphp/class-names | src/Psr4Namespace.php | Psr4Namespace.paths | private function paths(): \Generator
{
foreach ($this->directories() as $root => $directory) {
foreach ($directory as $file) {
if (preg_match(self::PATTERN, $file->getFilename()) === 1) {
yield $root => $file->getPathname();
}
}
... | php | private function paths(): \Generator
{
foreach ($this->directories() as $root => $directory) {
foreach ($directory as $file) {
if (preg_match(self::PATTERN, $file->getFilename()) === 1) {
yield $root => $file->getPathname();
}
}
... | [
"private",
"function",
"paths",
"(",
")",
":",
"\\",
"Generator",
"{",
"foreach",
"(",
"$",
"this",
"->",
"directories",
"(",
")",
"as",
"$",
"root",
"=>",
"$",
"directory",
")",
"{",
"foreach",
"(",
"$",
"directory",
"as",
"$",
"file",
")",
"{",
"... | Yield paths of the files declaring classes for each directory.
@return \Generator | [
"Yield",
"paths",
"of",
"the",
"files",
"declaring",
"classes",
"for",
"each",
"directory",
"."
] | 2c0aea13ff82aa70df0fe6f78247415d15a994d1 | https://github.com/quantaphp/class-names/blob/2c0aea13ff82aa70df0fe6f78247415d15a994d1/src/Psr4Namespace.php#L78-L87 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.