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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
196,800 | fxpio/fxp-doctrine-extensions | Util/SqlFilterUtil.php | SqlFilterUtil.findFilters | public static function findFilters($om, array $filters, $all = false)
{
if (!$om instanceof EntityManagerInterface || (empty($filters) && !$all)) {
return [];
}
$all = ($all && !empty($filters)) ? false : $all;
$enabledFilters = self::getEnabledFilters($om);
ret... | php | public static function findFilters($om, array $filters, $all = false)
{
if (!$om instanceof EntityManagerInterface || (empty($filters) && !$all)) {
return [];
}
$all = ($all && !empty($filters)) ? false : $all;
$enabledFilters = self::getEnabledFilters($om);
ret... | [
"public",
"static",
"function",
"findFilters",
"(",
"$",
"om",
",",
"array",
"$",
"filters",
",",
"$",
"all",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"om",
"instanceof",
"EntityManagerInterface",
"||",
"(",
"empty",
"(",
"$",
"filters",
")",
"&&",... | Get the list of SQL Filter name must to be disabled.
@param null|ObjectManager $om The object manager instance
@param string[] $filters The list of SQL Filter
@param bool $all Force all SQL Filter
@return string[] | [
"Get",
"the",
"list",
"of",
"SQL",
"Filter",
"name",
"must",
"to",
"be",
"disabled",
"."
] | 82942f51d47cdd79a20a5725ee1b3ecfc69e9d77 | https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Util/SqlFilterUtil.php#L33-L43 |
196,801 | fxpio/fxp-doctrine-extensions | Util/SqlFilterUtil.php | SqlFilterUtil.getEnabledFilters | public static function getEnabledFilters($om)
{
$filters = [];
if ($om instanceof EntityManagerInterface) {
$enabledFilters = $om->getFilters()->getEnabledFilters();
foreach ($enabledFilters as $name => $filter) {
if (!$filter instanceof EnableFilterInterfac... | php | public static function getEnabledFilters($om)
{
$filters = [];
if ($om instanceof EntityManagerInterface) {
$enabledFilters = $om->getFilters()->getEnabledFilters();
foreach ($enabledFilters as $name => $filter) {
if (!$filter instanceof EnableFilterInterfac... | [
"public",
"static",
"function",
"getEnabledFilters",
"(",
"$",
"om",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"om",
"instanceof",
"EntityManagerInterface",
")",
"{",
"$",
"enabledFilters",
"=",
"$",
"om",
"->",
"getFilters",
"(",
")"... | Get the enabled sql filters.
@param null|ObjectManager $om The object manager instance
@return SQLFilter[] | [
"Get",
"the",
"enabled",
"sql",
"filters",
"."
] | 82942f51d47cdd79a20a5725ee1b3ecfc69e9d77 | https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Util/SqlFilterUtil.php#L52-L68 |
196,802 | fxpio/fxp-doctrine-extensions | Util/SqlFilterUtil.php | SqlFilterUtil.isEnabled | public static function isEnabled($om, $name)
{
if ($om instanceof EntityManagerInterface) {
$sqlFilters = $om->getFilters();
if ($sqlFilters->isEnabled($name)) {
$filter = $sqlFilters->getFilter($name);
return !$filter instanceof EnableFilterInterfac... | php | public static function isEnabled($om, $name)
{
if ($om instanceof EntityManagerInterface) {
$sqlFilters = $om->getFilters();
if ($sqlFilters->isEnabled($name)) {
$filter = $sqlFilters->getFilter($name);
return !$filter instanceof EnableFilterInterfac... | [
"public",
"static",
"function",
"isEnabled",
"(",
"$",
"om",
",",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"om",
"instanceof",
"EntityManagerInterface",
")",
"{",
"$",
"sqlFilters",
"=",
"$",
"om",
"->",
"getFilters",
"(",
")",
";",
"if",
"(",
"$",
"sq... | Check if the filter is enabled.
@param null|ObjectManager $om The object manager instance
@param string $name The filter name
@return bool | [
"Check",
"if",
"the",
"filter",
"is",
"enabled",
"."
] | 82942f51d47cdd79a20a5725ee1b3ecfc69e9d77 | https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Util/SqlFilterUtil.php#L100-L114 |
196,803 | fxpio/fxp-doctrine-extensions | Util/SqlFilterUtil.php | SqlFilterUtil.doFindFilters | protected static function doFindFilters(array $filters, array $enabledFilters, $all)
{
$reactivateFilters = [];
foreach ($enabledFilters as $name => $filter) {
if (\in_array($name, $filters, true) || $all) {
$reactivateFilters[] = $name;
}
}
... | php | protected static function doFindFilters(array $filters, array $enabledFilters, $all)
{
$reactivateFilters = [];
foreach ($enabledFilters as $name => $filter) {
if (\in_array($name, $filters, true) || $all) {
$reactivateFilters[] = $name;
}
}
... | [
"protected",
"static",
"function",
"doFindFilters",
"(",
"array",
"$",
"filters",
",",
"array",
"$",
"enabledFilters",
",",
"$",
"all",
")",
"{",
"$",
"reactivateFilters",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"enabledFilters",
"as",
"$",
"name",
"=>",
... | Do find filters.
@param string[] $filters The filters names to be found
@param SQLFilter[] $enabledFilters The enabled SQL Filters
@param bool $all Force all SQL Filter
@return array | [
"Do",
"find",
"filters",
"."
] | 82942f51d47cdd79a20a5725ee1b3ecfc69e9d77 | https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Util/SqlFilterUtil.php#L125-L136 |
196,804 | Wedeto/HTTP | src/Response/DataResponse.php | DataResponse.setFileFormats | public function setFileFormats(array $formats)
{
$this->file_formats = array();
foreach ($formats as $mime => $writer)
$this->addFileFormat($mime, $writer);
return $this;
} | php | public function setFileFormats(array $formats)
{
$this->file_formats = array();
foreach ($formats as $mime => $writer)
$this->addFileFormat($mime, $writer);
return $this;
} | [
"public",
"function",
"setFileFormats",
"(",
"array",
"$",
"formats",
")",
"{",
"$",
"this",
"->",
"file_formats",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"formats",
"as",
"$",
"mime",
"=>",
"$",
"writer",
")",
"$",
"this",
"->",
"addFileForm... | Set the available file formats - replacing the previous list
@param array $formats Assocative array of mime-type => writer-class pairs
@return DataResponse Provides fluent interface | [
"Set",
"the",
"available",
"file",
"formats",
"-",
"replacing",
"the",
"previous",
"list"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/DataResponse.php#L78-L85 |
196,805 | Wedeto/HTTP | src/Response/DataResponse.php | DataResponse.forceMimeType | public function forceMimeType(string $mime)
{
if (!isset($this->file_formats[$mime]))
{
throw new \InvalidArgumentException(
"Cannot force output without a writer available: " . $mime
);
}
$this->file_formats = [$mime => $this->file_formats[$m... | php | public function forceMimeType(string $mime)
{
if (!isset($this->file_formats[$mime]))
{
throw new \InvalidArgumentException(
"Cannot force output without a writer available: " . $mime
);
}
$this->file_formats = [$mime => $this->file_formats[$m... | [
"public",
"function",
"forceMimeType",
"(",
"string",
"$",
"mime",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"file_formats",
"[",
"$",
"mime",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Cannot force outpu... | Reduce the list of available file formats to a single one
@param string $mime The mime type to output. Must already be known
@return DataResponse Provides fluent interface | [
"Reduce",
"the",
"list",
"of",
"available",
"file",
"formats",
"to",
"a",
"single",
"one"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/DataResponse.php#L92-L103 |
196,806 | Wedeto/HTTP | src/Response/DataResponse.php | DataResponse.addFileFormat | public function addFileFormat(string $mime_type, $writer_class)
{
if (is_string($writer_class))
{
if (!class_exists($writer_class) || !(is_subclass_of($writer_class, AbstractWriter::class, $writer_class)))
{
throw new InvalidArgumentException(
... | php | public function addFileFormat(string $mime_type, $writer_class)
{
if (is_string($writer_class))
{
if (!class_exists($writer_class) || !(is_subclass_of($writer_class, AbstractWriter::class, $writer_class)))
{
throw new InvalidArgumentException(
... | [
"public",
"function",
"addFileFormat",
"(",
"string",
"$",
"mime_type",
",",
"$",
"writer_class",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"writer_class",
")",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"writer_class",
")",
"||",
"!",
"(",
... | Add a file format that this writer can output. This can be used to
add a custom mime-type -> writer mapping. If the format is already
registered, it is overwritten.
@param string $mime_type The mime type to register
@param string $writer_class The writer class. Should subclass AbstractWriter
@return Wedeto\HTTP\DataRe... | [
"Add",
"a",
"file",
"format",
"that",
"this",
"writer",
"can",
"output",
".",
"This",
"can",
"be",
"used",
"to",
"add",
"a",
"custom",
"mime",
"-",
"type",
"-",
">",
"writer",
"mapping",
".",
"If",
"the",
"format",
"is",
"already",
"registered",
"it",
... | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/DataResponse.php#L114-L139 |
196,807 | Wedeto/HTTP | src/Response/DataResponse.php | DataResponse.output | public function output(string $mime)
{
$pprint = $this->pretty_printing;
$classname = $this->file_formats[$mime] ?? "NullWriter";
$output = "";
try
{
if ($classname instanceof AbstractWriter)
$writer = $classname;
elseif (clas... | php | public function output(string $mime)
{
$pprint = $this->pretty_printing;
$classname = $this->file_formats[$mime] ?? "NullWriter";
$output = "";
try
{
if ($classname instanceof AbstractWriter)
$writer = $classname;
elseif (clas... | [
"public",
"function",
"output",
"(",
"string",
"$",
"mime",
")",
"{",
"$",
"pprint",
"=",
"$",
"this",
"->",
"pretty_printing",
";",
"$",
"classname",
"=",
"$",
"this",
"->",
"file_formats",
"[",
"$",
"mime",
"]",
"??",
"\"NullWriter\"",
";",
"$",
"out... | Output the response data in the selected format
@param string $mime The mime type to output | [
"Output",
"the",
"response",
"data",
"in",
"the",
"selected",
"format"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/DataResponse.php#L185-L211 |
196,808 | mtils/cmsable | src/Cmsable/Resource/EloquentRepository.php | EloquentRepository.findOrFail | public function findOrFail($id)
{
if ($model = $this->find($id)) {
return $model;
}
throw (new ModelNotFoundException)->setModel(get_class($this->getModel()));
} | php | public function findOrFail($id)
{
if ($model = $this->find($id)) {
return $model;
}
throw (new ModelNotFoundException)->setModel(get_class($this->getModel()));
} | [
"public",
"function",
"findOrFail",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"model",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"model",
";",
"}",
"throw",
"(",
"new",
"ModelNotFoundException",
")",
"->",
"setMo... | Find and throw an exception if model not found
@return mixed The resource | [
"Find",
"and",
"throw",
"an",
"exception",
"if",
"model",
"not",
"found"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Resource/EloquentRepository.php#L45-L51 |
196,809 | Raphhh/puppy-static-route | src/StaticController.php | StaticController.render | public function render(array $vars = array())
{
$templateFile = $this->getTemplateRouter()->findTemplateFile($this->getRequest());
if ($templateFile) {
return $this->getAppController()->render($templateFile, $vars);
}
return $this->getAppController()->error404();
} | php | public function render(array $vars = array())
{
$templateFile = $this->getTemplateRouter()->findTemplateFile($this->getRequest());
if ($templateFile) {
return $this->getAppController()->render($templateFile, $vars);
}
return $this->getAppController()->error404();
} | [
"public",
"function",
"render",
"(",
"array",
"$",
"vars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"templateFile",
"=",
"$",
"this",
"->",
"getTemplateRouter",
"(",
")",
"->",
"findTemplateFile",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
")",
";",... | renders the template associated with the current route.
@param array $vars
@return mixed | [
"renders",
"the",
"template",
"associated",
"with",
"the",
"current",
"route",
"."
] | 08d94ffdd9cc58fff1b0cae6982cc51b6e4ece5a | https://github.com/Raphhh/puppy-static-route/blob/08d94ffdd9cc58fff1b0cae6982cc51b6e4ece5a/src/StaticController.php#L51-L58 |
196,810 | Raphhh/puppy-static-route | src/StaticController.php | StaticController.redirect | public function redirect(array $flashes = array())
{
foreach($flashes as $type => $message){
$this->getAppController()->flash()->add($type, $message);
}
return $this->getAppController()->redirect($this->getRequest()->getRequestUri());
} | php | public function redirect(array $flashes = array())
{
foreach($flashes as $type => $message){
$this->getAppController()->flash()->add($type, $message);
}
return $this->getAppController()->redirect($this->getRequest()->getRequestUri());
} | [
"public",
"function",
"redirect",
"(",
"array",
"$",
"flashes",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"flashes",
"as",
"$",
"type",
"=>",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"getAppController",
"(",
")",
"->",
"flash",
"(",
... | redirects to the same same uri.
@param array $flashes
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"redirects",
"to",
"the",
"same",
"same",
"uri",
"."
] | 08d94ffdd9cc58fff1b0cae6982cc51b6e4ece5a | https://github.com/Raphhh/puppy-static-route/blob/08d94ffdd9cc58fff1b0cae6982cc51b6e4ece5a/src/StaticController.php#L66-L72 |
196,811 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.setStatusCode | public function setStatusCode($statusCode)
{
$statusCode = (int)$statusCode;
if ($statusCode < 100 || $statusCode >= 600) {
throw new \Exception("Invalid status code: {$statusCode}.");
}
$this->statusCode = $statusCode;
return $this;
} | php | public function setStatusCode($statusCode)
{
$statusCode = (int)$statusCode;
if ($statusCode < 100 || $statusCode >= 600) {
throw new \Exception("Invalid status code: {$statusCode}.");
}
$this->statusCode = $statusCode;
return $this;
} | [
"public",
"function",
"setStatusCode",
"(",
"$",
"statusCode",
")",
"{",
"$",
"statusCode",
"=",
"(",
"int",
")",
"$",
"statusCode",
";",
"if",
"(",
"$",
"statusCode",
"<",
"100",
"||",
"$",
"statusCode",
">=",
"600",
")",
"{",
"throw",
"new",
"\\",
... | Sets the status code.
@param int $statusCode The status code.
@throws Exception Throws an exception when an invalid status code is used.
@return $this The current object. | [
"Sets",
"the",
"status",
"code",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L318-L326 |
196,812 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.getStatusMessage | protected function getStatusMessage($code)
{
return (
isset($this->statusMessages[$code])
? $this->statusMessages[$code] : $this->statusMessages[500]
);
} | php | protected function getStatusMessage($code)
{
return (
isset($this->statusMessages[$code])
? $this->statusMessages[$code] : $this->statusMessages[500]
);
} | [
"protected",
"function",
"getStatusMessage",
"(",
"$",
"code",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"statusMessages",
"[",
"$",
"code",
"]",
")",
"?",
"$",
"this",
"->",
"statusMessages",
"[",
"$",
"code",
"]",
":",
"$",
"this",
... | Gets the HTTP status message for a status code.
@param int $code The status code.
@return string The http status. | [
"Gets",
"the",
"HTTP",
"status",
"message",
"for",
"a",
"status",
"code",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L345-L351 |
196,813 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.removeHypertextRoute | public function removeHypertextRoute($name)
{
if (isset($this->hypertextRoutes[$name])) {
unset($this->hypertextRoutes[$name]);
}
return $this;
} | php | public function removeHypertextRoute($name)
{
if (isset($this->hypertextRoutes[$name])) {
unset($this->hypertextRoutes[$name]);
}
return $this;
} | [
"public",
"function",
"removeHypertextRoute",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"hypertextRoutes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"hypertextRoutes",
"[",
"$",
"name",
"]",
... | Removes a hypertext route by name.
@param string $name The hypertext route's name.
@return $this The current object. | [
"Removes",
"a",
"hypertext",
"route",
"by",
"name",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L403-L409 |
196,814 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.output | public function output($isFinal = false)
{
// Check if final output is true
if ($this->finalOutput) {
return;
}
$this->finalOutput = $isFinal;
// HTTP status header
header("HTTP/1.1 {$this->statusCode} {$this->getStatusMessage($this->statusCode)}");
... | php | public function output($isFinal = false)
{
// Check if final output is true
if ($this->finalOutput) {
return;
}
$this->finalOutput = $isFinal;
// HTTP status header
header("HTTP/1.1 {$this->statusCode} {$this->getStatusMessage($this->statusCode)}");
... | [
"public",
"function",
"output",
"(",
"$",
"isFinal",
"=",
"false",
")",
"{",
"// Check if final output is true",
"if",
"(",
"$",
"this",
"->",
"finalOutput",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"finalOutput",
"=",
"$",
"isFinal",
";",
"// HTTP... | Outputs the current response in the correct response type
and sets the headers.
@param optional boolean $isFinal Whether this output is final or not.
@return $this The current object. | [
"Outputs",
"the",
"current",
"response",
"in",
"the",
"correct",
"response",
"type",
"and",
"sets",
"the",
"headers",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L470-L499 |
196,815 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.process | public function process()
{
// Check if we should verify the request
if ($this->configuration->getUseAuthorization()) {
if (
$this->uri != '/token' &&
$this->uri != '/authorize' &&
!$this->tokenServer->verifyResourceRequest(\OAuth2\Request:... | php | public function process()
{
// Check if we should verify the request
if ($this->configuration->getUseAuthorization()) {
if (
$this->uri != '/token' &&
$this->uri != '/authorize' &&
!$this->tokenServer->verifyResourceRequest(\OAuth2\Request:... | [
"public",
"function",
"process",
"(",
")",
"{",
"// Check if we should verify the request",
"if",
"(",
"$",
"this",
"->",
"configuration",
"->",
"getUseAuthorization",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"uri",
"!=",
"'/token'",
"&&",
"$",
"thi... | Processes the API by calling the execute method on the router.
@return $this The current object. | [
"Processes",
"the",
"API",
"by",
"calling",
"the",
"execute",
"method",
"on",
"the",
"router",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L506-L544 |
196,816 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.handleOptionsRequest | public function handleOptionsRequest()
{
// Generate the "Allow" header
$allow = '';
foreach ($this->router->getMethodsByRoute($this->uri) as $method) {
$allow .= strtoupper($method) . ',';
}
$allow = substr($allow, 0, strlen($allow) - 1);
header('Allow: '... | php | public function handleOptionsRequest()
{
// Generate the "Allow" header
$allow = '';
foreach ($this->router->getMethodsByRoute($this->uri) as $method) {
$allow .= strtoupper($method) . ',';
}
$allow = substr($allow, 0, strlen($allow) - 1);
header('Allow: '... | [
"public",
"function",
"handleOptionsRequest",
"(",
")",
"{",
"// Generate the \"Allow\" header",
"$",
"allow",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"router",
"->",
"getMethodsByRoute",
"(",
"$",
"this",
"->",
"uri",
")",
"as",
"$",
"method",
")... | Handles an HTTP OPTIONS requests.
Returns available methods for the current route.
@return void. | [
"Handles",
"an",
"HTTP",
"OPTIONS",
"requests",
".",
"Returns",
"available",
"methods",
"for",
"the",
"current",
"route",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L552-L562 |
196,817 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.addRoutes | protected function addRoutes()
{
// Define a "not found" route
$this->router->add('/', [$this, 'unknownEndpoint']);
// Only add these routes if we're using authorization
if ($this->configuration->getUseAuthorization()) {
// Token route for requesting tokens
$... | php | protected function addRoutes()
{
// Define a "not found" route
$this->router->add('/', [$this, 'unknownEndpoint']);
// Only add these routes if we're using authorization
if ($this->configuration->getUseAuthorization()) {
// Token route for requesting tokens
$... | [
"protected",
"function",
"addRoutes",
"(",
")",
"{",
"// Define a \"not found\" route",
"$",
"this",
"->",
"router",
"->",
"add",
"(",
"'/'",
",",
"[",
"$",
"this",
",",
"'unknownEndpoint'",
"]",
")",
";",
"// Only add these routes if we're using authorization",
"if... | Adds default routes for the API regarding tokens.
These routes can be overridden in the child API class.
@return $this The current object. | [
"Adds",
"default",
"routes",
"for",
"the",
"API",
"regarding",
"tokens",
".",
"These",
"routes",
"can",
"be",
"overridden",
"in",
"the",
"child",
"API",
"class",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L570-L587 |
196,818 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.createTokenServer | private function createTokenServer()
{
// Catch errors for pdo object creation and creating the server
try {
// Create the server
$storage = new \OAuth2\Storage\Pdo(
[
'dsn' => $this->configuration->getDsn(),
'username' ... | php | private function createTokenServer()
{
// Catch errors for pdo object creation and creating the server
try {
// Create the server
$storage = new \OAuth2\Storage\Pdo(
[
'dsn' => $this->configuration->getDsn(),
'username' ... | [
"private",
"function",
"createTokenServer",
"(",
")",
"{",
"// Catch errors for pdo object creation and creating the server",
"try",
"{",
"// Create the server",
"$",
"storage",
"=",
"new",
"\\",
"OAuth2",
"\\",
"Storage",
"\\",
"Pdo",
"(",
"[",
"'dsn'",
"=>",
"$",
... | Creates the new token server.
Sets the connection to the database and grant types.
@throws @see OAuth2 package.
@return self The current object. | [
"Creates",
"the",
"new",
"token",
"server",
".",
"Sets",
"the",
"connection",
"to",
"the",
"database",
"and",
"grant",
"types",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L610-L641 |
196,819 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.token | public function token()
{
// Handle the token request
$response = $this->tokenServer->handleTokenRequest(\OAuth2\Request::createFromGlobals());
// Get the data as json and convert it to an array,
// - so we can set our own response type.
$data = $response->getResponseBody('j... | php | public function token()
{
// Handle the token request
$response = $this->tokenServer->handleTokenRequest(\OAuth2\Request::createFromGlobals());
// Get the data as json and convert it to an array,
// - so we can set our own response type.
$data = $response->getResponseBody('j... | [
"public",
"function",
"token",
"(",
")",
"{",
"// Handle the token request",
"$",
"response",
"=",
"$",
"this",
"->",
"tokenServer",
"->",
"handleTokenRequest",
"(",
"\\",
"OAuth2",
"\\",
"Request",
"::",
"createFromGlobals",
"(",
")",
")",
";",
"// Get the data... | Handles generating tokens for clients.
@return $this The current object. | [
"Handles",
"generating",
"tokens",
"for",
"clients",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L648-L663 |
196,820 | rutger-speksnijder/restphp | src/RestPHP/BaseAPI.php | BaseAPI.authorize | public function authorize()
{
// Create the request and response objects
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
// Validate the authorize request
if (!$this->tokenServer->validateAuthorizeRequest($request, $response)) {
... | php | public function authorize()
{
// Create the request and response objects
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
// Validate the authorize request
if (!$this->tokenServer->validateAuthorizeRequest($request, $response)) {
... | [
"public",
"function",
"authorize",
"(",
")",
"{",
"// Create the request and response objects",
"$",
"request",
"=",
"\\",
"OAuth2",
"\\",
"Request",
"::",
"createFromGlobals",
"(",
")",
";",
"$",
"response",
"=",
"new",
"\\",
"OAuth2",
"\\",
"Response",
"(",
... | Handles authorizing clients to receive an OAuth2 access token.
@return $this The current object, unless the user gets redirected. | [
"Handles",
"authorizing",
"clients",
"to",
"receive",
"an",
"OAuth2",
"access",
"token",
"."
] | 326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/BaseAPI.php#L670-L734 |
196,821 | PenoaksDev/Milky-Framework | src/Milky/Account/Traits/ThrottlesLogins.php | ThrottlesLogins.secondsRemainingOnLockout | protected function secondsRemainingOnLockout( Request $request )
{
return UniversalBuilder::resolveClass( RateLimiter::class )->availableIn( $this->getThrottleKey( $request ) );
} | php | protected function secondsRemainingOnLockout( Request $request )
{
return UniversalBuilder::resolveClass( RateLimiter::class )->availableIn( $this->getThrottleKey( $request ) );
} | [
"protected",
"function",
"secondsRemainingOnLockout",
"(",
"Request",
"$",
"request",
")",
"{",
"return",
"UniversalBuilder",
"::",
"resolveClass",
"(",
"RateLimiter",
"::",
"class",
")",
"->",
"availableIn",
"(",
"$",
"this",
"->",
"getThrottleKey",
"(",
"$",
"... | Get the lockout seconds.
@param Request $request
@return int | [
"Get",
"the",
"lockout",
"seconds",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Account/Traits/ThrottlesLogins.php#L85-L88 |
196,822 | ARCANESOFT/SEO | src/Helpers/TextReplacer.php | TextReplacer.getShortcodes | public function getShortcodes()
{
$shortcodes = array_map(function ($replacement) {
return "[{$replacement}]";
}, $this->replacements);
return collect(array_combine($shortcodes, $this->replacements));
} | php | public function getShortcodes()
{
$shortcodes = array_map(function ($replacement) {
return "[{$replacement}]";
}, $this->replacements);
return collect(array_combine($shortcodes, $this->replacements));
} | [
"public",
"function",
"getShortcodes",
"(",
")",
"{",
"$",
"shortcodes",
"=",
"array_map",
"(",
"function",
"(",
"$",
"replacement",
")",
"{",
"return",
"\"[{$replacement}]\"",
";",
"}",
",",
"$",
"this",
"->",
"replacements",
")",
";",
"return",
"collect",
... | Get the replacements shortcodes.
@return \Illuminate\Support\Collection | [
"Get",
"the",
"replacements",
"shortcodes",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Helpers/TextReplacer.php#L45-L52 |
196,823 | ARCANESOFT/SEO | src/Helpers/TextReplacer.php | TextReplacer.mergeReplacements | protected function mergeReplacements(array $replacements)
{
return $this->getShortcodes()
->transform(function ($key) use ($replacements) {
return Arr::get($replacements, $key);
})
->filter();
} | php | protected function mergeReplacements(array $replacements)
{
return $this->getShortcodes()
->transform(function ($key) use ($replacements) {
return Arr::get($replacements, $key);
})
->filter();
} | [
"protected",
"function",
"mergeReplacements",
"(",
"array",
"$",
"replacements",
")",
"{",
"return",
"$",
"this",
"->",
"getShortcodes",
"(",
")",
"->",
"transform",
"(",
"function",
"(",
"$",
"key",
")",
"use",
"(",
"$",
"replacements",
")",
"{",
"return"... | Merge replacements.
@param array $replacements
@return \Illuminate\Support\Collection | [
"Merge",
"replacements",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Helpers/TextReplacer.php#L71-L78 |
196,824 | ARCANESOFT/SEO | src/Helpers/TextReplacer.php | TextReplacer.highlight | public function highlight($content, $replacement = '<code>[\1]</code>')
{
return preg_replace(
'/\[('.$this->getShortcodes()->values()->implode('|').')\]/',
$replacement,
$content
);
} | php | public function highlight($content, $replacement = '<code>[\1]</code>')
{
return preg_replace(
'/\[('.$this->getShortcodes()->values()->implode('|').')\]/',
$replacement,
$content
);
} | [
"public",
"function",
"highlight",
"(",
"$",
"content",
",",
"$",
"replacement",
"=",
"'<code>[\\1]</code>'",
")",
"{",
"return",
"preg_replace",
"(",
"'/\\[('",
".",
"$",
"this",
"->",
"getShortcodes",
"(",
")",
"->",
"values",
"(",
")",
"->",
"implode",
... | Highlight the replacement.
@param string $content
@param string $replacement
@return string | [
"Highlight",
"the",
"replacement",
"."
] | ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2 | https://github.com/ARCANESOFT/SEO/blob/ce6d6135d55e8b2fd43cf7923839b4791b7c7ad2/src/Helpers/TextReplacer.php#L118-L125 |
196,825 | TitaPHP/framework | src/TitaPHP/Http/Application.php | Application.processResponseType | protected function processResponseType($response = null)
{
if ($response instanceof Response) {
$this->response = $response;
}
elseif (is_string($response) || is_numeric($response)) {
$this->response->setContent($response);
}
elseif (is_array($response)) {
$this->response = new JsonResponse($respons... | php | protected function processResponseType($response = null)
{
if ($response instanceof Response) {
$this->response = $response;
}
elseif (is_string($response) || is_numeric($response)) {
$this->response->setContent($response);
}
elseif (is_array($response)) {
$this->response = new JsonResponse($respons... | [
"protected",
"function",
"processResponseType",
"(",
"$",
"response",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"response",
"instanceof",
"Response",
")",
"{",
"$",
"this",
"->",
"response",
"=",
"$",
"response",
";",
"}",
"elseif",
"(",
"is_string",
"(",
"... | Process the Response Type.
@param mixed $response
@return void
@throws \Exception | [
"Process",
"the",
"Response",
"Type",
"."
] | 72283a45733a49c1d9c1fc0eba22ff13a802295c | https://github.com/TitaPHP/framework/blob/72283a45733a49c1d9c1fc0eba22ff13a802295c/src/TitaPHP/Http/Application.php#L114-L128 |
196,826 | TeaLabs/collections | src/Key.php | Key.offsetSet | public function offsetSet($offset, $segment)
{
if (is_null($offset)) {
$this->segments[] = (string) $segment;
} else {
$this->segments[$offset] = (string) $segment;
}
} | php | public function offsetSet($offset, $segment)
{
if (is_null($offset)) {
$this->segments[] = (string) $segment;
} else {
$this->segments[$offset] = (string) $segment;
}
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"segment",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"offset",
")",
")",
"{",
"$",
"this",
"->",
"segments",
"[",
"]",
"=",
"(",
"string",
")",
"$",
"segment",
";",
"}",
"else",
"{"... | Set the segment at a given offset.
@param mixed $offset
@param mixed $segment
@return void | [
"Set",
"the",
"segment",
"at",
"a",
"given",
"offset",
"."
] | 5d8885b2799791c0bcbff4e6cbacddb270b4288e | https://github.com/TeaLabs/collections/blob/5d8885b2799791c0bcbff4e6cbacddb270b4288e/src/Key.php#L191-L198 |
196,827 | TeaLabs/collections | src/Key.php | Key.implode | public static function implode($segments, $separator = self::SEPARATOR)
{
return (string) Uzi::join($separator, $segments, true);
} | php | public static function implode($segments, $separator = self::SEPARATOR)
{
return (string) Uzi::join($separator, $segments, true);
} | [
"public",
"static",
"function",
"implode",
"(",
"$",
"segments",
",",
"$",
"separator",
"=",
"self",
"::",
"SEPARATOR",
")",
"{",
"return",
"(",
"string",
")",
"Uzi",
"::",
"join",
"(",
"$",
"separator",
",",
"$",
"segments",
",",
"true",
")",
";",
"... | Join the segments of a key into a string
@param array $segments
@param string $separator
@return string | [
"Join",
"the",
"segments",
"of",
"a",
"key",
"into",
"a",
"string"
] | 5d8885b2799791c0bcbff4e6cbacddb270b4288e | https://github.com/TeaLabs/collections/blob/5d8885b2799791c0bcbff4e6cbacddb270b4288e/src/Key.php#L254-L257 |
196,828 | railken/lem | src/Attributes/MorphToAttribute.php | MorphToAttribute.getRelationManager | public function getRelationManager(EntityContract $entity)
{
$key = $entity->{$this->getRelationKey()};
if (!isset($this->relations[$key])) {
return null;
}
$class = $this->relations[$key];
return new $class($this->getManager()->getAgent());
} | php | public function getRelationManager(EntityContract $entity)
{
$key = $entity->{$this->getRelationKey()};
if (!isset($this->relations[$key])) {
return null;
}
$class = $this->relations[$key];
return new $class($this->getManager()->getAgent());
} | [
"public",
"function",
"getRelationManager",
"(",
"EntityContract",
"$",
"entity",
")",
"{",
"$",
"key",
"=",
"$",
"entity",
"->",
"{",
"$",
"this",
"->",
"getRelationKey",
"(",
")",
"}",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"relations"... | Retrieve relation manager.
@param EntityContract $entity
@return \Railken\Lem\Contracts\ManagerContract | [
"Retrieve",
"relation",
"manager",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Attributes/MorphToAttribute.php#L101-L112 |
196,829 | SlaxWeb/Hooks | src/Container.php | Container.addHook | public function addHook(Hook $hook)
{
if (isset($this->hooks[$hook->name]) === false) {
$this->logger->debug(
"Adding definition for hook '{$hook->name}' for the first time."
);
$this->hooks[$hook->name] = [];
}
$this->hooks[$hook->name][]... | php | public function addHook(Hook $hook)
{
if (isset($this->hooks[$hook->name]) === false) {
$this->logger->debug(
"Adding definition for hook '{$hook->name}' for the first time."
);
$this->hooks[$hook->name] = [];
}
$this->hooks[$hook->name][]... | [
"public",
"function",
"addHook",
"(",
"Hook",
"$",
"hook",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"hooks",
"[",
"$",
"hook",
"->",
"name",
"]",
")",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"\"Addi... | Add hook definition to container
@param \SlaxWeb\Hooks\Hook $hook Hook definition
@return void | [
"Add",
"hook",
"definition",
"to",
"container"
] | 678f4d5425c27e0dd2a61b68d59bfb2793955b91 | https://github.com/SlaxWeb/Hooks/blob/678f4d5425c27e0dd2a61b68d59bfb2793955b91/src/Container.php#L70-L80 |
196,830 | SlaxWeb/Hooks | src/Container.php | Container.exec | public function exec(string $name)
{
if (isset($this->hooks[$name]) === false) {
$this->logger->debug(
"No hook definitions found for '{$name}'. Available hook "
. "definitions",
[array_keys($this->hooks)]
);
return null;
... | php | public function exec(string $name)
{
if (isset($this->hooks[$name]) === false) {
$this->logger->debug(
"No hook definitions found for '{$name}'. Available hook "
. "definitions",
[array_keys($this->hooks)]
);
return null;
... | [
"public",
"function",
"exec",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"hooks",
"[",
"$",
"name",
"]",
")",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"\"No hook definitions fou... | Execute hook definition
Execute all definitions for the retrieved hook names in the order that
they have been inserted, and store their return values in an array, if it
is not null. If only one definition was called, then return that
executions return value directly, if there were more calls, return all the
return val... | [
"Execute",
"hook",
"definition"
] | 678f4d5425c27e0dd2a61b68d59bfb2793955b91 | https://github.com/SlaxWeb/Hooks/blob/678f4d5425c27e0dd2a61b68d59bfb2793955b91/src/Container.php#L94-L125 |
196,831 | oyepez003/YepsuaRADBundle | Controller/Controller.php | Controller.createAndBindForm | public function createAndBindForm(Request $request, $type, $data = null, array $options = array())
{
$form = $this->createForm($type, $data, $options);
$form->submit($request);
return $form;
} | php | public function createAndBindForm(Request $request, $type, $data = null, array $options = array())
{
$form = $this->createForm($type, $data, $options);
$form->submit($request);
return $form;
} | [
"public",
"function",
"createAndBindForm",
"(",
"Request",
"$",
"request",
",",
"$",
"type",
",",
"$",
"data",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"$",
... | Creates, binds and returns a Form instance from the type of the form.
@param string|FormTypeInterface $type The built type of the form
@param mixed $data The initial data for the form
@param array $options Options for the form
@return Form | [
"Creates",
"binds",
"and",
"returns",
"a",
"Form",
"instance",
"from",
"the",
"type",
"of",
"the",
"form",
"."
] | 5e8c79f49201d5b2ba9487f16624a3f245941672 | https://github.com/oyepez003/YepsuaRADBundle/blob/5e8c79f49201d5b2ba9487f16624a3f245941672/Controller/Controller.php#L295-L300 |
196,832 | hiqdev/minii-widgets | src/DetailView.php | DetailView.renderAttribute | protected function renderAttribute($attribute, $index)
{
if (is_string($this->template)) {
return strtr($this->template, [
'{label}' => $attribute['label'],
'{value}' => $this->formatter->format($attribute['value'], $attribute['format']),
]);
}... | php | protected function renderAttribute($attribute, $index)
{
if (is_string($this->template)) {
return strtr($this->template, [
'{label}' => $attribute['label'],
'{value}' => $this->formatter->format($attribute['value'], $attribute['format']),
]);
}... | [
"protected",
"function",
"renderAttribute",
"(",
"$",
"attribute",
",",
"$",
"index",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"template",
")",
")",
"{",
"return",
"strtr",
"(",
"$",
"this",
"->",
"template",
",",
"[",
"'{label}'",
"=>... | Renders a single attribute.
@param array $attribute the specification of the attribute to be rendered.
@param integer $index the zero-based index of the attribute in the [[attributes]] array
@return string the rendering result | [
"Renders",
"a",
"single",
"attribute",
"."
] | b8bc54a3645e9e45c228e3ec81b11ff4775385c3 | https://github.com/hiqdev/minii-widgets/blob/b8bc54a3645e9e45c228e3ec81b11ff4775385c3/src/DetailView.php#L154-L164 |
196,833 | hiqdev/minii-widgets | src/DetailView.php | DetailView.normalizeAttributes | protected function normalizeAttributes()
{
if ($this->attributes === null) {
if ($this->model instanceof Model) {
$this->attributes = $this->model->attributes();
} elseif (is_object($this->model)) {
$this->attributes = $this->model instanceof Arrayable... | php | protected function normalizeAttributes()
{
if ($this->attributes === null) {
if ($this->model instanceof Model) {
$this->attributes = $this->model->attributes();
} elseif (is_object($this->model)) {
$this->attributes = $this->model instanceof Arrayable... | [
"protected",
"function",
"normalizeAttributes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributes",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"model",
"instanceof",
"Model",
")",
"{",
"$",
"this",
"->",
"attributes",
"=",
"$",
"this... | Normalizes the attribute specifications.
@throws InvalidConfigException | [
"Normalizes",
"the",
"attribute",
"specifications",
"."
] | b8bc54a3645e9e45c228e3ec81b11ff4775385c3 | https://github.com/hiqdev/minii-widgets/blob/b8bc54a3645e9e45c228e3ec81b11ff4775385c3/src/DetailView.php#L170-L223 |
196,834 | jenskooij/cloudcontrol | src/storage/storage/UsersStorage.php | UsersStorage.getUserBySlug | public function getUserBySlug($slug)
{
$return = array();
$users = $this->repository->users;
foreach ($users as $user) {
if ($user->slug == $slug) {
$return = $user;
break;
}
}
return $return;
} | php | public function getUserBySlug($slug)
{
$return = array();
$users = $this->repository->users;
foreach ($users as $user) {
if ($user->slug == $slug) {
$return = $user;
break;
}
}
return $return;
} | [
"public",
"function",
"getUserBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"$",
"users",
"=",
"$",
"this",
"->",
"repository",
"->",
"users",
";",
"foreach",
"(",
"$",
"users",
"as",
"$",
"user",
")",
"{",
"if",
... | Get user by slug
@param $slug
@return array | [
"Get",
"user",
"by",
"slug"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/UsersStorage.php#L30-L43 |
196,835 | jenskooij/cloudcontrol | src/storage/storage/UsersStorage.php | UsersStorage.deleteUserBySlug | public function deleteUserBySlug($slug)
{
$userToDelete = $this->getUserBySlug($slug);
if (empty($userToDelete)) {
throw new \Exception('Trying to delete a user that doesn\'t exist.');
}
$users = $this->getUsers();
foreach ($users as $key => $user) {
i... | php | public function deleteUserBySlug($slug)
{
$userToDelete = $this->getUserBySlug($slug);
if (empty($userToDelete)) {
throw new \Exception('Trying to delete a user that doesn\'t exist.');
}
$users = $this->getUsers();
foreach ($users as $key => $user) {
i... | [
"public",
"function",
"deleteUserBySlug",
"(",
"$",
"slug",
")",
"{",
"$",
"userToDelete",
"=",
"$",
"this",
"->",
"getUserBySlug",
"(",
"$",
"slug",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"userToDelete",
")",
")",
"{",
"throw",
"new",
"\\",
"Exceptio... | Delete user by slug
@param $slug
@throws \Exception | [
"Delete",
"user",
"by",
"slug"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/UsersStorage.php#L101-L115 |
196,836 | tedmoyses/glomr-lib | src/Build/BladeBuilder.php | BladeBuilder.buildPathFromSource | private function buildPathFromSource(string $path) :string {
//return $this->buildContext->getPath('build') . '/' .
return str_replace('.', '/', str_replace($this->context . ".", '', $this->viewNameFromSource($path))) .
$this->buildExtension;
} | php | private function buildPathFromSource(string $path) :string {
//return $this->buildContext->getPath('build') . '/' .
return str_replace('.', '/', str_replace($this->context . ".", '', $this->viewNameFromSource($path))) .
$this->buildExtension;
} | [
"private",
"function",
"buildPathFromSource",
"(",
"string",
"$",
"path",
")",
":",
"string",
"{",
"//return $this->buildContext->getPath('build') . '/' .",
"return",
"str_replace",
"(",
"'.'",
",",
"'/'",
",",
"str_replace",
"(",
"$",
"this",
"->",
"context",
".",
... | start with the build path
strip context from view name including first .
replace remaining dots in view name with slashes
add build extension
@param string $path Source file path
@return string destination path | [
"start",
"with",
"the",
"build",
"path",
"strip",
"context",
"from",
"view",
"name",
"including",
"first",
".",
"replace",
"remaining",
"dots",
"in",
"view",
"name",
"with",
"slashes",
"add",
"build",
"extension"
] | 40c577fca0bb120f07a08fc444ed75460bd9021c | https://github.com/tedmoyses/glomr-lib/blob/40c577fca0bb120f07a08fc444ed75460bd9021c/src/Build/BladeBuilder.php#L116-L120 |
196,837 | gr-group/grsupport | src/Classes/Support.php | Support.agent | public function agent($arg = null)
{
$agent = new Agent();
if ($arg) {
return $agent->is($arg);
}
return new Agent();
} | php | public function agent($arg = null)
{
$agent = new Agent();
if ($arg) {
return $agent->is($arg);
}
return new Agent();
} | [
"public",
"function",
"agent",
"(",
"$",
"arg",
"=",
"null",
")",
"{",
"$",
"agent",
"=",
"new",
"Agent",
"(",
")",
";",
"if",
"(",
"$",
"arg",
")",
"{",
"return",
"$",
"agent",
"->",
"is",
"(",
"$",
"arg",
")",
";",
"}",
"return",
"new",
"Ag... | Start Jenssegers Agent
@return Jenssegers\Agent\Agent | [
"Start",
"Jenssegers",
"Agent"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L19-L28 |
196,838 | gr-group/grsupport | src/Classes/Support.php | Support.authRequest | public function authRequest($guard = null)
{
return is_null($guard) ? request()->user() ?? request()->user('api') : request()->user($guard);
} | php | public function authRequest($guard = null)
{
return is_null($guard) ? request()->user() ?? request()->user('api') : request()->user($guard);
} | [
"public",
"function",
"authRequest",
"(",
"$",
"guard",
"=",
"null",
")",
"{",
"return",
"is_null",
"(",
"$",
"guard",
")",
"?",
"request",
"(",
")",
"->",
"user",
"(",
")",
"??",
"request",
"(",
")",
"->",
"user",
"(",
"'api'",
")",
":",
"request"... | Get auth request by guard
@param string $guard Web / Api
@return Illuminate\Database\Eloquent\Model | [
"Get",
"auth",
"request",
"by",
"guard"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L54-L57 |
196,839 | gr-group/grsupport | src/Classes/Support.php | Support.randomNumbers | public function randomNumbers($length = 6)
{
$nums = '0123456789';
$out = $nums[mt_rand(1, strlen($nums)-1)];
for ($p = 0; $p < $length-1; $p++) {
$out .= $nums[mt_rand(0, strlen($nums)-1)];
}
return $out;
} | php | public function randomNumbers($length = 6)
{
$nums = '0123456789';
$out = $nums[mt_rand(1, strlen($nums)-1)];
for ($p = 0; $p < $length-1; $p++) {
$out .= $nums[mt_rand(0, strlen($nums)-1)];
}
return $out;
} | [
"public",
"function",
"randomNumbers",
"(",
"$",
"length",
"=",
"6",
")",
"{",
"$",
"nums",
"=",
"'0123456789'",
";",
"$",
"out",
"=",
"$",
"nums",
"[",
"mt_rand",
"(",
"1",
",",
"strlen",
"(",
"$",
"nums",
")",
"-",
"1",
")",
"]",
";",
"for",
... | Generate random numbers
@param integer $length
@return string | [
"Generate",
"random",
"numbers"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L121-L132 |
196,840 | gr-group/grsupport | src/Classes/Support.php | Support.fileSearch | public function fileSearch($file, $subject)
{
return str_contains(file_get_contents(str_contains($file, '/') ? $file : $file), $subject);
} | php | public function fileSearch($file, $subject)
{
return str_contains(file_get_contents(str_contains($file, '/') ? $file : $file), $subject);
} | [
"public",
"function",
"fileSearch",
"(",
"$",
"file",
",",
"$",
"subject",
")",
"{",
"return",
"str_contains",
"(",
"file_get_contents",
"(",
"str_contains",
"(",
"$",
"file",
",",
"'/'",
")",
"?",
"$",
"file",
":",
"$",
"file",
")",
",",
"$",
"subject... | Search for a content within a file
@param string $file
@param string $subject
@return boolean | [
"Search",
"for",
"a",
"content",
"within",
"a",
"file"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L159-L162 |
196,841 | gr-group/grsupport | src/Classes/Support.php | Support.fileEdit | public function fileEdit($file, $search, $replace)
{
file_put_contents($file, str_replace(
$search,
$replace,
file_get_contents($file)
));
} | php | public function fileEdit($file, $search, $replace)
{
file_put_contents($file, str_replace(
$search,
$replace,
file_get_contents($file)
));
} | [
"public",
"function",
"fileEdit",
"(",
"$",
"file",
",",
"$",
"search",
",",
"$",
"replace",
")",
"{",
"file_put_contents",
"(",
"$",
"file",
",",
"str_replace",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"file_get_contents",
"(",
"$",
"file",
")",
... | Edit part of the contents of a file
@param string $file
@param string $search
@param string $replace
@return void | [
"Edit",
"part",
"of",
"the",
"contents",
"of",
"a",
"file"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L171-L178 |
196,842 | gr-group/grsupport | src/Classes/Support.php | Support.rangeHours | public function rangeHours($start, $end, $interval = 1, $select = true)
{
$tStart = strtotime($start);
$tEnd = strtotime($end);
$tNow = $tStart;
$hours = [];
while ($tNow <= $tEnd) {
$hours[] = date("H:i", $tNow);
$tNow = strtotime('+'.$interval.' hou... | php | public function rangeHours($start, $end, $interval = 1, $select = true)
{
$tStart = strtotime($start);
$tEnd = strtotime($end);
$tNow = $tStart;
$hours = [];
while ($tNow <= $tEnd) {
$hours[] = date("H:i", $tNow);
$tNow = strtotime('+'.$interval.' hou... | [
"public",
"function",
"rangeHours",
"(",
"$",
"start",
",",
"$",
"end",
",",
"$",
"interval",
"=",
"1",
",",
"$",
"select",
"=",
"true",
")",
"{",
"$",
"tStart",
"=",
"strtotime",
"(",
"$",
"start",
")",
";",
"$",
"tEnd",
"=",
"strtotime",
"(",
"... | Interval between two hours
@param string $start 01:00:00
@param string $end 23:00:00
@param integer $interval Interval in hours
@param boolean $select For use in select of a form or array only
@return array | [
"Interval",
"between",
"two",
"hours"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L203-L224 |
196,843 | gr-group/grsupport | src/Classes/Support.php | Support.limtitLines | public function limtitLines($str, $lines = 1)
{
$line = "\n";
for ($i=2; $i<=$lines; $i++) {
$line .= "\n";
}
return preg_replace("/[\r\n]+/", "$line", $str);
} | php | public function limtitLines($str, $lines = 1)
{
$line = "\n";
for ($i=2; $i<=$lines; $i++) {
$line .= "\n";
}
return preg_replace("/[\r\n]+/", "$line", $str);
} | [
"public",
"function",
"limtitLines",
"(",
"$",
"str",
",",
"$",
"lines",
"=",
"1",
")",
"{",
"$",
"line",
"=",
"\"\\n\"",
";",
"for",
"(",
"$",
"i",
"=",
"2",
";",
"$",
"i",
"<=",
"$",
"lines",
";",
"$",
"i",
"++",
")",
"{",
"$",
"line",
".... | Limits the amount of line breaks in a string
@param string $str
@param integer $lines Number of lines to be limited
@return string | [
"Limits",
"the",
"amount",
"of",
"line",
"breaks",
"in",
"a",
"string"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L232-L239 |
196,844 | gr-group/grsupport | src/Classes/Support.php | Support.urlParser | public function urlParser($str, $rule)
{
$linkify = new Linkify(['callback' => function ($url, $caption, $isEmail) use ($rule) {
$rule = str_replace('[url]', $url, $rule);
$rule = str_replace('[caption]', $caption, $rule);
return $rule;
}]);
return $linki... | php | public function urlParser($str, $rule)
{
$linkify = new Linkify(['callback' => function ($url, $caption, $isEmail) use ($rule) {
$rule = str_replace('[url]', $url, $rule);
$rule = str_replace('[caption]', $caption, $rule);
return $rule;
}]);
return $linki... | [
"public",
"function",
"urlParser",
"(",
"$",
"str",
",",
"$",
"rule",
")",
"{",
"$",
"linkify",
"=",
"new",
"Linkify",
"(",
"[",
"'callback'",
"=>",
"function",
"(",
"$",
"url",
",",
"$",
"caption",
",",
"$",
"isEmail",
")",
"use",
"(",
"$",
"rule"... | Parse URLs from string
@param string $str
@param string $rule substitution rule, for example: <a href="[url]">[caption]</a>
@return string | [
"Parse",
"URLs",
"from",
"string"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L257-L266 |
196,845 | gr-group/grsupport | src/Classes/Support.php | Support.urlParserMultiple | public function urlParserMultiple($str, $rule, $html = null)
{
$explode = explode(';', $str);
$url = collect($explode)->map(function ($item) use ($rule) {
return $this->urlParser($item, $rule);
});
if (is_null($html)) {
$url = $url->all();
} else {
... | php | public function urlParserMultiple($str, $rule, $html = null)
{
$explode = explode(';', $str);
$url = collect($explode)->map(function ($item) use ($rule) {
return $this->urlParser($item, $rule);
});
if (is_null($html)) {
$url = $url->all();
} else {
... | [
"public",
"function",
"urlParserMultiple",
"(",
"$",
"str",
",",
"$",
"rule",
",",
"$",
"html",
"=",
"null",
")",
"{",
"$",
"explode",
"=",
"explode",
"(",
"';'",
",",
"$",
"str",
")",
";",
"$",
"url",
"=",
"collect",
"(",
"$",
"explode",
")",
"-... | Parse multiple URLs from string separated by commas or semicolons
@param string $str
@param string $rule substitution rule, for example: <a href="[url]">[caption]</a>
@param string $html if null returns array if filled with an html tag, returns a string separated by the tag
@return mixed | [
"Parse",
"multiple",
"URLs",
"from",
"string",
"separated",
"by",
"commas",
"or",
"semicolons"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L275-L289 |
196,846 | gr-group/grsupport | src/Classes/Support.php | Support.countries | public function countries($by = null, $value = null)
{
$countries = json_decode(file_get_contents(__DIR__ . '/../../data/countries.json'), true);
if (is_null($by) && is_null($value)) {
$countries = collect($countries)->values()->all();
} else {
if ($by == 'locale') {... | php | public function countries($by = null, $value = null)
{
$countries = json_decode(file_get_contents(__DIR__ . '/../../data/countries.json'), true);
if (is_null($by) && is_null($value)) {
$countries = collect($countries)->values()->all();
} else {
if ($by == 'locale') {... | [
"public",
"function",
"countries",
"(",
"$",
"by",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"countries",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"__DIR__",
".",
"'/../../data/countries.json'",
")",
",",
"true",
")",
";",
"if",... | Countries search and list
@param string $by Column to search (locale, name, shortname, slug)
@param string $value Value to search
@return array | [
"Countries",
"search",
"and",
"list"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L317-L345 |
196,847 | gr-group/grsupport | src/Classes/Support.php | Support.countryCodeByLocale | public function countryCodeByLocale($locale)
{
if (str_contains($locale, ' ')) {
$locale = str_replace(' ', '-', $locale);
}
if (strlen($locale) == 2) {
if ($locale == 'en') {
$locale = 'en-US';
} else {
$locale = $locale.'... | php | public function countryCodeByLocale($locale)
{
if (str_contains($locale, ' ')) {
$locale = str_replace(' ', '-', $locale);
}
if (strlen($locale) == 2) {
if ($locale == 'en') {
$locale = 'en-US';
} else {
$locale = $locale.'... | [
"public",
"function",
"countryCodeByLocale",
"(",
"$",
"locale",
")",
"{",
"if",
"(",
"str_contains",
"(",
"$",
"locale",
",",
"' '",
")",
")",
"{",
"$",
"locale",
"=",
"str_replace",
"(",
"' '",
",",
"'-'",
",",
"$",
"locale",
")",
";",
"}",
"if",
... | Get Country code by Locale
@param string $locale pt-BR, en-US, es-ES, ...
@return string | [
"Get",
"Country",
"code",
"by",
"Locale"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L352-L367 |
196,848 | gr-group/grsupport | src/Classes/Support.php | Support.extractHashtags | public function extractHashtags($str, $type = 'arr')
{
preg_match_all("/(#\w+)/", $str, $matches);
$matches = $type == 'arr' ? $matches[0] : implode(', ', $matches[0]);
return $matches;
} | php | public function extractHashtags($str, $type = 'arr')
{
preg_match_all("/(#\w+)/", $str, $matches);
$matches = $type == 'arr' ? $matches[0] : implode(', ', $matches[0]);
return $matches;
} | [
"public",
"function",
"extractHashtags",
"(",
"$",
"str",
",",
"$",
"type",
"=",
"'arr'",
")",
"{",
"preg_match_all",
"(",
"\"/(#\\w+)/\"",
",",
"$",
"str",
",",
"$",
"matches",
")",
";",
"$",
"matches",
"=",
"$",
"type",
"==",
"'arr'",
"?",
"$",
"ma... | Extract hashtags from strings
@param string $str
@param string $type arr || str
@return mixed | [
"Extract",
"hashtags",
"from",
"strings"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L432-L437 |
196,849 | gr-group/grsupport | src/Classes/Support.php | Support.summaryNumbers | public function summaryNumbers($number)
{
$x = round($number);
$x_number_format = number_format($x);
$x_array = explode(',', $x_number_format);
$x_parts = ['k', 'm', 'b', 't'];
$x_count_parts = count($x_array) - 1;
$x_display = $x;
if (!isset($x_array[1])) {
... | php | public function summaryNumbers($number)
{
$x = round($number);
$x_number_format = number_format($x);
$x_array = explode(',', $x_number_format);
$x_parts = ['k', 'm', 'b', 't'];
$x_count_parts = count($x_array) - 1;
$x_display = $x;
if (!isset($x_array[1])) {
... | [
"public",
"function",
"summaryNumbers",
"(",
"$",
"number",
")",
"{",
"$",
"x",
"=",
"round",
"(",
"$",
"number",
")",
";",
"$",
"x_number_format",
"=",
"number_format",
"(",
"$",
"x",
")",
";",
"$",
"x_array",
"=",
"explode",
"(",
"','",
",",
"$",
... | Format numbers in instagram followers style
@param integer $number
@return string | [
"Format",
"numbers",
"in",
"instagram",
"followers",
"style"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L444-L460 |
196,850 | gr-group/grsupport | src/Classes/Support.php | Support.urlWithParams | public function urlWithParams($path = null, $qs = [], $secure = null)
{
$url = app('url')->to($path, $secure);
if (count($qs)){
foreach($qs as $key => $value){
$qs[$key] = sprintf('%s=%s',$key, urlencode($value));
}
$url = sprintf('%s?%s', $url, im... | php | public function urlWithParams($path = null, $qs = [], $secure = null)
{
$url = app('url')->to($path, $secure);
if (count($qs)){
foreach($qs as $key => $value){
$qs[$key] = sprintf('%s=%s',$key, urlencode($value));
}
$url = sprintf('%s?%s', $url, im... | [
"public",
"function",
"urlWithParams",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"qs",
"=",
"[",
"]",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"app",
"(",
"'url'",
")",
"->",
"to",
"(",
"$",
"path",
",",
"$",
"secure",
")",
... | Laravel route with query strings
@param string $path
@param array $qs
@param boolean $secure
@return string | [
"Laravel",
"route",
"with",
"query",
"strings"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L469-L479 |
196,851 | gr-group/grsupport | src/Classes/Support.php | Support.getRoutesName | public function getRoutesName($contains = null, $exact = true)
{
$routeCollection = \Route::getRoutes();
$routes = collect($routeCollection)->map(function($item){
return $item->getName();
})->filter(function($item){
return !is_null($item);
})->values();
... | php | public function getRoutesName($contains = null, $exact = true)
{
$routeCollection = \Route::getRoutes();
$routes = collect($routeCollection)->map(function($item){
return $item->getName();
})->filter(function($item){
return !is_null($item);
})->values();
... | [
"public",
"function",
"getRoutesName",
"(",
"$",
"contains",
"=",
"null",
",",
"$",
"exact",
"=",
"true",
")",
"{",
"$",
"routeCollection",
"=",
"\\",
"Route",
"::",
"getRoutes",
"(",
")",
";",
"$",
"routes",
"=",
"collect",
"(",
"$",
"routeCollection",
... | Get all routes name
@param string $contains Search for a specific word
@param boolean $exact Exact search by word or not
@return array | [
"Get",
"all",
"routes",
"name"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L507-L524 |
196,852 | gr-group/grsupport | src/Classes/Support.php | Support.getAllKeysRoutes | public function getAllKeysRoutes()
{
$routeCollection = \Route::getRoutes();
$routes = collect($routeCollection)->map(function($item){
return explode('/', $item->getPrefix());
})->values()->collapse()->filter(function($item, $key){
return $item !== '';
})->gr... | php | public function getAllKeysRoutes()
{
$routeCollection = \Route::getRoutes();
$routes = collect($routeCollection)->map(function($item){
return explode('/', $item->getPrefix());
})->values()->collapse()->filter(function($item, $key){
return $item !== '';
})->gr... | [
"public",
"function",
"getAllKeysRoutes",
"(",
")",
"{",
"$",
"routeCollection",
"=",
"\\",
"Route",
"::",
"getRoutes",
"(",
")",
";",
"$",
"routes",
"=",
"collect",
"(",
"$",
"routeCollection",
")",
"->",
"map",
"(",
"function",
"(",
"$",
"item",
")",
... | Get all keys of routes
@return array | [
"Get",
"all",
"keys",
"of",
"routes"
] | 2f199dba4f051545bdd8b795be9a840a7f445b47 | https://github.com/gr-group/grsupport/blob/2f199dba4f051545bdd8b795be9a840a7f445b47/src/Classes/Support.php#L563-L576 |
196,853 | infusephp/cron | src/Libs/JobSchedule.php | JobSchedule.getScheduledJobs | public function getScheduledJobs()
{
$jobs = [];
foreach ($this->jobs as $job) {
$model = CronJob::find($job['id']);
// create a new model if this is the job's first run
if (!$model) {
$model = new CronJob();
$model->id = $job['id'... | php | public function getScheduledJobs()
{
$jobs = [];
foreach ($this->jobs as $job) {
$model = CronJob::find($job['id']);
// create a new model if this is the job's first run
if (!$model) {
$model = new CronJob();
$model->id = $job['id'... | [
"public",
"function",
"getScheduledJobs",
"(",
")",
"{",
"$",
"jobs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"jobs",
"as",
"$",
"job",
")",
"{",
"$",
"model",
"=",
"CronJob",
"::",
"find",
"(",
"$",
"job",
"[",
"'id'",
"]",
")",
... | Gets all of the jobs scheduled to run, now.
@return array array(model => CronJob) | [
"Gets",
"all",
"of",
"the",
"jobs",
"scheduled",
"to",
"run",
"now",
"."
] | 783f6078b455a48415efeba0a6ee97ab17a3a903 | https://github.com/infusephp/cron/blob/783f6078b455a48415efeba0a6ee97ab17a3a903/src/Libs/JobSchedule.php#L115-L146 |
196,854 | infusephp/cron | src/Libs/JobSchedule.php | JobSchedule.runScheduled | public function runScheduled(OutputInterface $output)
{
$success = true;
$event = new ScheduleRunBeginEvent();
$this->dispatcher->dispatch($event::NAME, $event);
foreach ($this->getScheduledJobs() as $jobInfo) {
$job = $jobInfo['model'];
$run = $this->runJob... | php | public function runScheduled(OutputInterface $output)
{
$success = true;
$event = new ScheduleRunBeginEvent();
$this->dispatcher->dispatch($event::NAME, $event);
foreach ($this->getScheduledJobs() as $jobInfo) {
$job = $jobInfo['model'];
$run = $this->runJob... | [
"public",
"function",
"runScheduled",
"(",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"success",
"=",
"true",
";",
"$",
"event",
"=",
"new",
"ScheduleRunBeginEvent",
"(",
")",
";",
"$",
"this",
"->",
"dispatcher",
"->",
"dispatch",
"(",
"$",
"event",... | Runs any scheduled tasks.
@param OutputInterface $output
@return bool true if all tasks ran successfully | [
"Runs",
"any",
"scheduled",
"tasks",
"."
] | 783f6078b455a48415efeba0a6ee97ab17a3a903 | https://github.com/infusephp/cron/blob/783f6078b455a48415efeba0a6ee97ab17a3a903/src/Libs/JobSchedule.php#L155-L173 |
196,855 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/AbstractSystemService.php | AbstractSystemService.add | public function add(ModelObject $obj)
{
$obj->CreationDate = $this->DateFactory->newStorageDate();
if(!$obj->hasModifiedDate())
$obj->ModifiedDate = $this->DateFactory->newStorageDate();
$this->validator->validateFor(__FUNCTION__, $obj)->throwOnError();
return $this->da... | php | public function add(ModelObject $obj)
{
$obj->CreationDate = $this->DateFactory->newStorageDate();
if(!$obj->hasModifiedDate())
$obj->ModifiedDate = $this->DateFactory->newStorageDate();
$this->validator->validateFor(__FUNCTION__, $obj)->throwOnError();
return $this->da... | [
"public",
"function",
"add",
"(",
"ModelObject",
"$",
"obj",
")",
"{",
"$",
"obj",
"->",
"CreationDate",
"=",
"$",
"this",
"->",
"DateFactory",
"->",
"newStorageDate",
"(",
")",
";",
"if",
"(",
"!",
"$",
"obj",
"->",
"hasModifiedDate",
"(",
")",
")",
... | Performs an INSERT for the given ModelObject through our DAO.
CreationDate and ModifiedDate are set, and the validator is run,
Validation errors will throw a ValidationException
@param ModelObject $obj The Object to Add
@return mixed See the add() method of our DAO | [
"Performs",
"an",
"INSERT",
"for",
"the",
"given",
"ModelObject",
"through",
"our",
"DAO",
".",
"CreationDate",
"and",
"ModifiedDate",
"are",
"set",
"and",
"the",
"validator",
"is",
"run"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/AbstractSystemService.php#L67-L76 |
196,856 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/AbstractSystemService.php | AbstractSystemService.edit | public function edit(ModelObject $obj)
{
if(!$obj->hasModifiedDate())
$obj->ModifiedDate = $this->DateFactory->newStorageDate();
$this->validator->validateFor(__FUNCTION__, $obj)->throwOnError();
return $this->dao->edit($obj);
} | php | public function edit(ModelObject $obj)
{
if(!$obj->hasModifiedDate())
$obj->ModifiedDate = $this->DateFactory->newStorageDate();
$this->validator->validateFor(__FUNCTION__, $obj)->throwOnError();
return $this->dao->edit($obj);
} | [
"public",
"function",
"edit",
"(",
"ModelObject",
"$",
"obj",
")",
"{",
"if",
"(",
"!",
"$",
"obj",
"->",
"hasModifiedDate",
"(",
")",
")",
"$",
"obj",
"->",
"ModifiedDate",
"=",
"$",
"this",
"->",
"DateFactory",
"->",
"newStorageDate",
"(",
")",
";",
... | Performs an UPDATE for the given ModelObject through our DAO.
ModifiedDate is updated, and the validator is run.
Validation Errors will throw a ValidationException
@param ModelObject $obj The ModelObject to edit
@return mixed See the edit() method of our DAO | [
"Performs",
"an",
"UPDATE",
"for",
"the",
"given",
"ModelObject",
"through",
"our",
"DAO",
".",
"ModifiedDate",
"is",
"updated",
"and",
"the",
"validator",
"is",
"run",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/AbstractSystemService.php#L88-L95 |
196,857 | wb-crowdfusion/crowdfusion | system/core/classes/systemdb/AbstractSystemService.php | AbstractSystemService.delete | public function delete($objSlug)
{
$this->validator->validateFor(__FUNCTION__, $objSlug)->throwOnError();
return $this->dao->delete($objSlug);
} | php | public function delete($objSlug)
{
$this->validator->validateFor(__FUNCTION__, $objSlug)->throwOnError();
return $this->dao->delete($objSlug);
} | [
"public",
"function",
"delete",
"(",
"$",
"objSlug",
")",
"{",
"$",
"this",
"->",
"validator",
"->",
"validateFor",
"(",
"__FUNCTION__",
",",
"$",
"objSlug",
")",
"->",
"throwOnError",
"(",
")",
";",
"return",
"$",
"this",
"->",
"dao",
"->",
"delete",
... | Performs a DELETE for the given slug through our DAO.
The validator is run.
Validation Errors will throw a ValidationException
@param string $objSlug The slug of the item to delete
@return mixed See the delete() method of our DAO | [
"Performs",
"a",
"DELETE",
"for",
"the",
"given",
"slug",
"through",
"our",
"DAO",
".",
"The",
"validator",
"is",
"run",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/systemdb/AbstractSystemService.php#L107-L112 |
196,858 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.getSerializationType | public function getSerializationType()
{
switch ($this->association) {
case self::ASSOCIATION_TYPE_EMBED_ONE:
case self::ASSOCIATION_TYPE_EMBED_MANY:
return TypeFactory::getType(Type::MAP);
case self::ASSOCIATION_TYPE_REFERENCE_ONE:
case self::... | php | public function getSerializationType()
{
switch ($this->association) {
case self::ASSOCIATION_TYPE_EMBED_ONE:
case self::ASSOCIATION_TYPE_EMBED_MANY:
return TypeFactory::getType(Type::MAP);
case self::ASSOCIATION_TYPE_REFERENCE_ONE:
case self::... | [
"public",
"function",
"getSerializationType",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"association",
")",
"{",
"case",
"self",
"::",
"ASSOCIATION_TYPE_EMBED_ONE",
":",
"case",
"self",
"::",
"ASSOCIATION_TYPE_EMBED_MANY",
":",
"return",
"TypeFactory",
"::"... | Return the Type used to serialize individual association values.
@return Type | [
"Return",
"the",
"Type",
"used",
"to",
"serialize",
"individual",
"association",
"values",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L610-L622 |
196,859 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.makeReflection | private function makeReflection()
{
if ($this->reflection === null) {
$this->reflection = new \ReflectionProperty($this->className, $this->name);
$this->reflection->setAccessible(true);
}
} | php | private function makeReflection()
{
if ($this->reflection === null) {
$this->reflection = new \ReflectionProperty($this->className, $this->name);
$this->reflection->setAccessible(true);
}
} | [
"private",
"function",
"makeReflection",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"reflection",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"reflection",
"=",
"new",
"\\",
"ReflectionProperty",
"(",
"$",
"this",
"->",
"className",
",",
"$",
"this",
... | Retrieve and store reflection metadata for this property from php internals.
@return void | [
"Retrieve",
"and",
"store",
"reflection",
"metadata",
"for",
"this",
"property",
"from",
"php",
"internals",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L845-L852 |
196,860 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.mapAttribute | public function mapAttribute(ClassMetadata $class)
{
$this->applyDefaults();
$this->validate();
$this->makeGenerator();
$class->addAttributeMapping($this);
} | php | public function mapAttribute(ClassMetadata $class)
{
$this->applyDefaults();
$this->validate();
$this->makeGenerator();
$class->addAttributeMapping($this);
} | [
"public",
"function",
"mapAttribute",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"applyDefaults",
"(",
")",
";",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"$",
"this",
"->",
"makeGenerator",
"(",
")",
";",
"$",
"class",
"->",
... | Map this property as an attribute.
@param ClassMetadata $class
@return void | [
"Map",
"this",
"property",
"as",
"an",
"attribute",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L861-L868 |
196,861 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.mapManyEmbedded | public function mapManyEmbedded(ClassMetadata $class, $type = Type::LIST_)
{
$this->embedded = true;
$this->type = $type;
$this->mapAttribute($class);
} | php | public function mapManyEmbedded(ClassMetadata $class, $type = Type::LIST_)
{
$this->embedded = true;
$this->type = $type;
$this->mapAttribute($class);
} | [
"public",
"function",
"mapManyEmbedded",
"(",
"ClassMetadata",
"$",
"class",
",",
"$",
"type",
"=",
"Type",
"::",
"LIST_",
")",
"{",
"$",
"this",
"->",
"embedded",
"=",
"true",
";",
"$",
"this",
"->",
"type",
"=",
"$",
"type",
";",
"$",
"this",
"->",... | Map this property as a collection of embedded documents.
@param ClassMetadata $class
@param string $type
@return void | [
"Map",
"this",
"property",
"as",
"a",
"collection",
"of",
"embedded",
"documents",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L878-L884 |
196,862 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.mapManyReference | public function mapManyReference(ClassMetadata $class, $type = Type::LIST_)
{
$this->reference = true;
$this->type = $type;
$this->mapAttribute($class);
} | php | public function mapManyReference(ClassMetadata $class, $type = Type::LIST_)
{
$this->reference = true;
$this->type = $type;
$this->mapAttribute($class);
} | [
"public",
"function",
"mapManyReference",
"(",
"ClassMetadata",
"$",
"class",
",",
"$",
"type",
"=",
"Type",
"::",
"LIST_",
")",
"{",
"$",
"this",
"->",
"reference",
"=",
"true",
";",
"$",
"this",
"->",
"type",
"=",
"$",
"type",
";",
"$",
"this",
"->... | Map this property as a collection of document references.
@param ClassMetadata $class
@param string $type
@return void | [
"Map",
"this",
"property",
"as",
"a",
"collection",
"of",
"document",
"references",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L894-L900 |
196,863 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.mapOneEmbedded | public function mapOneEmbedded(ClassMetadata $class)
{
$this->embedded = true;
$this->type = self::TYPE_ONE;
$this->mapAttribute($class);
} | php | public function mapOneEmbedded(ClassMetadata $class)
{
$this->embedded = true;
$this->type = self::TYPE_ONE;
$this->mapAttribute($class);
} | [
"public",
"function",
"mapOneEmbedded",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"embedded",
"=",
"true",
";",
"$",
"this",
"->",
"type",
"=",
"self",
"::",
"TYPE_ONE",
";",
"$",
"this",
"->",
"mapAttribute",
"(",
"$",
"class",
... | Map this property as a single embedded document.
@param ClassMetadata $class
@return void | [
"Map",
"this",
"property",
"as",
"a",
"single",
"embedded",
"document",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L909-L915 |
196,864 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.mapOneReference | public function mapOneReference(ClassMetadata $class)
{
$this->reference = true;
$this->type = self::TYPE_ONE;
$this->mapAttribute($class);
} | php | public function mapOneReference(ClassMetadata $class)
{
$this->reference = true;
$this->type = self::TYPE_ONE;
$this->mapAttribute($class);
} | [
"public",
"function",
"mapOneReference",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"reference",
"=",
"true",
";",
"$",
"this",
"->",
"type",
"=",
"self",
"::",
"TYPE_ONE",
";",
"$",
"this",
"->",
"mapAttribute",
"(",
"$",
"class",
... | Map this property as a single document reference.
@param ClassMetadata $class
@return void | [
"Map",
"this",
"property",
"as",
"a",
"single",
"document",
"reference",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L924-L930 |
196,865 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php | PropertyMetadata.setValueAndWakeProxy | public function setValueAndWakeProxy($document, $value)
{
if ($document instanceof Proxy && !$document->__isInitialized()) {
//property changes to an uninitialized proxy will not be tracked or persisted,
//so the proxy needs to be loaded first.
$document->__load();
... | php | public function setValueAndWakeProxy($document, $value)
{
if ($document instanceof Proxy && !$document->__isInitialized()) {
//property changes to an uninitialized proxy will not be tracked or persisted,
//so the proxy needs to be loaded first.
$document->__load();
... | [
"public",
"function",
"setValueAndWakeProxy",
"(",
"$",
"document",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"document",
"instanceof",
"Proxy",
"&&",
"!",
"$",
"document",
"->",
"__isInitialized",
"(",
")",
")",
"{",
"//property changes to an uninitialized p... | Sets this mapped attribute to the specified value on the given document,
waking the document if proxied.
@param object $document
@param mixed $value
@return $this | [
"Sets",
"this",
"mapped",
"attribute",
"to",
"the",
"specified",
"value",
"on",
"the",
"given",
"document",
"waking",
"the",
"document",
"if",
"proxied",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Mapping/PropertyMetadata.php#L978-L989 |
196,866 | dspsofts/relaypoint-core | src/Address.php | Address.addOpeningHour | public function addOpeningHour($day, $hours)
{
$openingHour = new OpeningHours($day, $hours);
$this->openingHours[$day] = $openingHour;
} | php | public function addOpeningHour($day, $hours)
{
$openingHour = new OpeningHours($day, $hours);
$this->openingHours[$day] = $openingHour;
} | [
"public",
"function",
"addOpeningHour",
"(",
"$",
"day",
",",
"$",
"hours",
")",
"{",
"$",
"openingHour",
"=",
"new",
"OpeningHours",
"(",
"$",
"day",
",",
"$",
"hours",
")",
";",
"$",
"this",
"->",
"openingHours",
"[",
"$",
"day",
"]",
"=",
"$",
"... | Adds an opening schedule for a day.
@param string $day Day
@param string $hours Opening hours of that day | [
"Adds",
"an",
"opening",
"schedule",
"for",
"a",
"day",
"."
] | a312742724f03b74d058aec2bc02e944a63b2187 | https://github.com/dspsofts/relaypoint-core/blob/a312742724f03b74d058aec2bc02e944a63b2187/src/Address.php#L44-L48 |
196,867 | facile-it/sentry-common | src/Sanitizer/Sanitizer.php | Sanitizer.sanitize | public function sanitize($value)
{
if ($value instanceof Traversable) {
return $this->sanitize(iterator_to_array($value));
} elseif (is_array($value)) {
return array_map([$this, 'sanitize'], $value);
} elseif (is_object($value)) {
return $this->sanitizeObj... | php | public function sanitize($value)
{
if ($value instanceof Traversable) {
return $this->sanitize(iterator_to_array($value));
} elseif (is_array($value)) {
return array_map([$this, 'sanitize'], $value);
} elseif (is_object($value)) {
return $this->sanitizeObj... | [
"public",
"function",
"sanitize",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Traversable",
")",
"{",
"return",
"$",
"this",
"->",
"sanitize",
"(",
"iterator_to_array",
"(",
"$",
"value",
")",
")",
";",
"}",
"elseif",
"(",
"is_... | Sanitize recursively a value
@param mixed $value
@return mixed | [
"Sanitize",
"recursively",
"a",
"value"
] | 63ca40700e19363e6af94c69ef8f0f889ba031bd | https://github.com/facile-it/sentry-common/blob/63ca40700e19363e6af94c69ef8f0f889ba031bd/src/Sanitizer/Sanitizer.php#L18-L31 |
196,868 | xelax90/xelax-site-config | src/XelaxSiteConfig/Controller/SiteConfigController.php | SiteConfigController.indexAction | public function indexAction(){
$configForm = $this->getForm();
$configForm->setData($this->getConfig());
$view = new ViewModel(array('title' => $this->getEditTitle(), 'configForm' => $configForm));
$view->setTemplate('xelax-site-config/site-config/index.phtml');
return $view;
} | php | public function indexAction(){
$configForm = $this->getForm();
$configForm->setData($this->getConfig());
$view = new ViewModel(array('title' => $this->getEditTitle(), 'configForm' => $configForm));
$view->setTemplate('xelax-site-config/site-config/index.phtml');
return $view;
} | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"configForm",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"$",
"configForm",
"->",
"setData",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
")",
";",
"$",
"view",
"=",
"new",
"ViewModel"... | Show current config
@return ViewModel | [
"Show",
"current",
"config"
] | 76c86e2f716fc2c66b59124a69e35c4cadfeb3db | https://github.com/xelax90/xelax-site-config/blob/76c86e2f716fc2c66b59124a69e35c4cadfeb3db/src/XelaxSiteConfig/Controller/SiteConfigController.php#L106-L113 |
196,869 | Finesse/QueryScribe | src/Exceptions/InvalidReturnValueException.php | InvalidReturnValueException.create | public static function create(string $name, $value, array $expectedTypes): self
{
return new static(sprintf(
'%s expected to be %s, %s returned',
ucfirst($name),
implode(' or ', $expectedTypes),
is_object($value) ? get_class($value) : gettype($value)
)... | php | public static function create(string $name, $value, array $expectedTypes): self
{
return new static(sprintf(
'%s expected to be %s, %s returned',
ucfirst($name),
implode(' or ', $expectedTypes),
is_object($value) ? get_class($value) : gettype($value)
)... | [
"public",
"static",
"function",
"create",
"(",
"string",
"$",
"name",
",",
"$",
"value",
",",
"array",
"$",
"expectedTypes",
")",
":",
"self",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'%s expected to be %s, %s returned'",
",",
"ucfirst",
"(",
"$... | Makes an exception instance.
@param string $name Value name
@param mixed $value Actual value
@param string[] $expectedTypes Expected types names
@return static | [
"Makes",
"an",
"exception",
"instance",
"."
] | 4edba721e37693780d142229b3ecb0cd4004c7a5 | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Exceptions/InvalidReturnValueException.php#L20-L28 |
196,870 | WellCommerce/CurrencyBundle | Converter/CurrencyConverter.php | CurrencyConverter.loadExchangeRates | protected function loadExchangeRates($targetCurrency)
{
if (!isset($this->exchangeRates[$targetCurrency])) {
$currencyRates = $this->currencyRateRepository->findBy(['currencyTo' => $targetCurrency]);
if (count($currencyRates) === 0) {
throw new MissingCurrencyRatesExc... | php | protected function loadExchangeRates($targetCurrency)
{
if (!isset($this->exchangeRates[$targetCurrency])) {
$currencyRates = $this->currencyRateRepository->findBy(['currencyTo' => $targetCurrency]);
if (count($currencyRates) === 0) {
throw new MissingCurrencyRatesExc... | [
"protected",
"function",
"loadExchangeRates",
"(",
"$",
"targetCurrency",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"exchangeRates",
"[",
"$",
"targetCurrency",
"]",
")",
")",
"{",
"$",
"currencyRates",
"=",
"$",
"this",
"->",
"currencyRat... | Sets exchange rates for target currency
@param string $targetCurrency | [
"Sets",
"exchange",
"rates",
"for",
"target",
"currency"
] | 48a6995eedb9c1f93d10751a6d1070e4cbca307e | https://github.com/WellCommerce/CurrencyBundle/blob/48a6995eedb9c1f93d10751a6d1070e4cbca307e/Converter/CurrencyConverter.php#L88-L99 |
196,871 | Game-scan/Core | src/Request/Api/GameApiRequest.php | GameApiRequest.get | public function get($ressourceToGrab, array $parameters = null)
{
$this->apiRequest->clean();
$this->apiRequest->setHeaders($this->apiConfiguration->getHeaders());
$this->apiRequest->setParameters($this->apiConfiguration->getParameters());
return $this->apiRequest->get($ressourceToG... | php | public function get($ressourceToGrab, array $parameters = null)
{
$this->apiRequest->clean();
$this->apiRequest->setHeaders($this->apiConfiguration->getHeaders());
$this->apiRequest->setParameters($this->apiConfiguration->getParameters());
return $this->apiRequest->get($ressourceToG... | [
"public",
"function",
"get",
"(",
"$",
"ressourceToGrab",
",",
"array",
"$",
"parameters",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"apiRequest",
"->",
"clean",
"(",
")",
";",
"$",
"this",
"->",
"apiRequest",
"->",
"setHeaders",
"(",
"$",
"this",
"->"... | Request a ressource of an api with the get http method
@param $ressourceToGrab
@param array|null $parameters
@return string | [
"Request",
"a",
"ressource",
"of",
"an",
"api",
"with",
"the",
"get",
"http",
"method"
] | 777652235678bbd9c3ea20344b998a01359339bd | https://github.com/Game-scan/Core/blob/777652235678bbd9c3ea20344b998a01359339bd/src/Request/Api/GameApiRequest.php#L34-L41 |
196,872 | PenoaksDev/Milky-Framework | src/Milky/Http/Routing/Router.php | Router.substituteBindings | protected function substituteBindings( $route )
{
foreach ( $route->parameters() as $key => $value )
{
if ( isset( $this->binders[$key] ) )
{
$route->setParameter( $key, $this->performBinding( $key, $value, $route ) );
}
}
$this->substituteImplicitBindings( $route );
return $route;
} | php | protected function substituteBindings( $route )
{
foreach ( $route->parameters() as $key => $value )
{
if ( isset( $this->binders[$key] ) )
{
$route->setParameter( $key, $this->performBinding( $key, $value, $route ) );
}
}
$this->substituteImplicitBindings( $route );
return $route;
} | [
"protected",
"function",
"substituteBindings",
"(",
"$",
"route",
")",
"{",
"foreach",
"(",
"$",
"route",
"->",
"parameters",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"binders",
"[",
"$",
... | Substitute the route bindings onto the route.
@param Route $route
@return Route | [
"Substitute",
"the",
"route",
"bindings",
"onto",
"the",
"route",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/Router.php#L801-L814 |
196,873 | PenoaksDev/Milky-Framework | src/Milky/Http/Routing/Router.php | Router.substituteImplicitBindings | protected function substituteImplicitBindings( $route )
{
$parameters = $route->parameters();
foreach ( $route->signatureParameters( Model::class ) as $parameter )
{
$class = $parameter->getClass();
if ( array_key_exists( $parameter->name, $parameters ) && !$route->getParameter( $parameter->name ) instan... | php | protected function substituteImplicitBindings( $route )
{
$parameters = $route->parameters();
foreach ( $route->signatureParameters( Model::class ) as $parameter )
{
$class = $parameter->getClass();
if ( array_key_exists( $parameter->name, $parameters ) && !$route->getParameter( $parameter->name ) instan... | [
"protected",
"function",
"substituteImplicitBindings",
"(",
"$",
"route",
")",
"{",
"$",
"parameters",
"=",
"$",
"route",
"->",
"parameters",
"(",
")",
";",
"foreach",
"(",
"$",
"route",
"->",
"signatureParameters",
"(",
"Model",
"::",
"class",
")",
"as",
... | Substitute the implicit Eloquent model bindings for the route.
@param Route $route | [
"Substitute",
"the",
"implicit",
"Eloquent",
"model",
"bindings",
"for",
"the",
"route",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/Router.php#L821-L838 |
196,874 | stubbles/stubbles-dbal | src/main/php/pdo/PdoStatement.php | PdoStatement.bindParam | public function bindParam($param, &$variable, $type = null, int $length = null): bool
{
try {
return $this->pdoStatement->bindParam($param, $variable, $type, $length, null);
} catch (PDOException $pdoe) {
throw new DatabaseException($pdoe->getMessage(), $pdoe);
}
... | php | public function bindParam($param, &$variable, $type = null, int $length = null): bool
{
try {
return $this->pdoStatement->bindParam($param, $variable, $type, $length, null);
} catch (PDOException $pdoe) {
throw new DatabaseException($pdoe->getMessage(), $pdoe);
}
... | [
"public",
"function",
"bindParam",
"(",
"$",
"param",
",",
"&",
"$",
"variable",
",",
"$",
"type",
"=",
"null",
",",
"int",
"$",
"length",
"=",
"null",
")",
":",
"bool",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"pdoStatement",
"->",
"bindParam",... | bind a parameter of a prepared query to the specified variable
The binding will be via reference, so it is evaluated at the time when
the prepared statement is executed meaning that in opposite to
bindValue() the value of the variable at the time of execution will be
used, not the value at the time when this method is... | [
"bind",
"a",
"parameter",
"of",
"a",
"prepared",
"query",
"to",
"the",
"specified",
"variable"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoStatement.php#L56-L63 |
196,875 | stubbles/stubbles-dbal | src/main/php/pdo/PdoStatement.php | PdoStatement.bindValue | public function bindValue($param, $value, $type = null): bool
{
try {
return $this->pdoStatement->bindValue($param, $value, $type);
} catch (PDOException $pdoe) {
throw new DatabaseException($pdoe->getMessage(), $pdoe);
}
} | php | public function bindValue($param, $value, $type = null): bool
{
try {
return $this->pdoStatement->bindValue($param, $value, $type);
} catch (PDOException $pdoe) {
throw new DatabaseException($pdoe->getMessage(), $pdoe);
}
} | [
"public",
"function",
"bindValue",
"(",
"$",
"param",
",",
"$",
"value",
",",
"$",
"type",
"=",
"null",
")",
":",
"bool",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"pdoStatement",
"->",
"bindValue",
"(",
"$",
"param",
",",
"$",
"value",
",",
"$... | bind a value to the parameter of a prepared query
In opposite to bindParam() this will use the value as it is at the time
when this method is called.
@param int|string $param the order number of the parameter or its name
@param mixed $value the value to bind
@param int|string $type optional type of... | [
"bind",
"a",
"value",
"to",
"the",
"parameter",
"of",
"a",
"prepared",
"query"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoStatement.php#L78-L85 |
196,876 | stubbles/stubbles-dbal | src/main/php/pdo/PdoStatement.php | PdoStatement.execute | public function execute(array $values = []): QueryResult
{
try {
if ($this->pdoStatement->execute($values)) {
return new PdoQueryResult($this->pdoStatement);
}
throw new DatabaseException('Executing the prepared statement failed.');
} catch (PDOEx... | php | public function execute(array $values = []): QueryResult
{
try {
if ($this->pdoStatement->execute($values)) {
return new PdoQueryResult($this->pdoStatement);
}
throw new DatabaseException('Executing the prepared statement failed.');
} catch (PDOEx... | [
"public",
"function",
"execute",
"(",
"array",
"$",
"values",
"=",
"[",
"]",
")",
":",
"QueryResult",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"pdoStatement",
"->",
"execute",
"(",
"$",
"values",
")",
")",
"{",
"return",
"new",
"PdoQueryResult",
... | executes a prepared statement
@param array $values optional specifies all necessary information for bindParam()
the array elements must use keys corresponding to the
number of the position or name of the parameter
@return \stubbles\db\pdo\PdoQueryResult
@throws \stubbles\db\DatabaseException
@see http://php... | [
"executes",
"a",
"prepared",
"statement"
] | b42a589025a9e511b40a2798ac84df94d6451c36 | https://github.com/stubbles/stubbles-dbal/blob/b42a589025a9e511b40a2798ac84df94d6451c36/src/main/php/pdo/PdoStatement.php#L97-L108 |
196,877 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/SourceQuery.php | SourceQuery.filterByHost | public function filterByHost($host = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($host)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SourceTableMap::COL_HOST, $host, $comparison);
} | php | public function filterByHost($host = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($host)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SourceTableMap::COL_HOST, $host, $comparison);
} | [
"public",
"function",
"filterByHost",
"(",
"$",
"host",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"host",
")",
")",
"{",
"$",
"comparison",
"=... | Filter the query on the host column
Example usage:
<code>
$query->filterByHost('fooValue'); // WHERE host = 'fooValue'
$query->filterByHost('%fooValue%', Criteria::LIKE); // WHERE host LIKE '%fooValue%'
</code>
@param string $host The value to use as filter.
@param string $comparison Operator to use for the... | [
"Filter",
"the",
"query",
"on",
"the",
"host",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/SourceQuery.php#L372-L381 |
196,878 | attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/SourceQuery.php | SourceQuery.filterByEndpoint | public function filterByEndpoint($endpoint = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($endpoint)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SourceTableMap::COL_ENDPOINT, $endpoint, $comparison);
} | php | public function filterByEndpoint($endpoint = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($endpoint)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SourceTableMap::COL_ENDPOINT, $endpoint, $comparison);
} | [
"public",
"function",
"filterByEndpoint",
"(",
"$",
"endpoint",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"endpoint",
")",
")",
"{",
"$",
"compa... | Filter the query on the endpoint column
Example usage:
<code>
$query->filterByEndpoint('fooValue'); // WHERE endpoint = 'fooValue'
$query->filterByEndpoint('%fooValue%', Criteria::LIKE); // WHERE endpoint LIKE '%fooValue%'
</code>
@param string $endpoint The value to use as filter.
@param string $comparison... | [
"Filter",
"the",
"query",
"on",
"the",
"endpoint",
"column"
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/SourceQuery.php#L397-L406 |
196,879 | ringoteam/RingoPhpRedmonBundle | Controller/CrudController.php | CrudController.indexAction | public function indexAction()
{
// Get all instances
$instances = $this->getManager()->findAll();
$worker = $this->get('ringo_php_redmon.instance_worker');
if(is_array($instances)) {
foreach($instances as $index => $instance) {
// Ping server and ... | php | public function indexAction()
{
// Get all instances
$instances = $this->getManager()->findAll();
$worker = $this->get('ringo_php_redmon.instance_worker');
if(is_array($instances)) {
foreach($instances as $index => $instance) {
// Ping server and ... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"// Get all instances",
"$",
"instances",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"findAll",
"(",
")",
";",
"$",
"worker",
"=",
"$",
"this",
"->",
"get",
"(",
"'ringo_php_redmon.instance_worke... | List of instances action
@return mixed | [
"List",
"of",
"instances",
"action"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/CrudController.php#L30-L51 |
196,880 | ringoteam/RingoPhpRedmonBundle | Controller/CrudController.php | CrudController.editAction | public function editAction($id)
{
$instance = $this->getManager()->find($id);
if(!$instance) {
return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
}
$form = $this->getForm($instance);
return $this->render(
$this->getTemplatePath().'edi... | php | public function editAction($id)
{
$instance = $this->getManager()->find($id);
if(!$instance) {
return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
}
$form = $this->getForm($instance);
return $this->render(
$this->getTemplatePath().'edi... | [
"public",
"function",
"editAction",
"(",
"$",
"id",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"instance",
")",
"{",
"return",
"new",
"RedirectResponse",
"... | Edit instance action
@param string $id The instance ID
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Edit",
"instance",
"action"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/CrudController.php#L109-L124 |
196,881 | ringoteam/RingoPhpRedmonBundle | Controller/CrudController.php | CrudController.updateAction | public function updateAction($id)
{
$form = $this->getForm();
// Get request
$request = $this->get('request');
if ('POST' == $request->getMethod()) {
$form->submit($request);
if ($form->isValid()) {
// Save instance
... | php | public function updateAction($id)
{
$form = $this->getForm();
// Get request
$request = $this->get('request');
if ('POST' == $request->getMethod()) {
$form->submit($request);
if ($form->isValid()) {
// Save instance
... | [
"public",
"function",
"updateAction",
"(",
"$",
"id",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
";",
"// Get request",
"$",
"request",
"=",
"$",
"this",
"->",
"get",
"(",
"'request'",
")",
";",
"if",
"(",
"'POST'",
"==",
"... | Update instance action
@param string $id The instance ID
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Update",
"instance",
"action"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/CrudController.php#L132-L158 |
196,882 | ringoteam/RingoPhpRedmonBundle | Controller/CrudController.php | CrudController.deleteAction | public function deleteAction($id)
{
$instance = $this->getManager()->find($id);
if($instance) {
$this->getManager()->delete($instance);
$this->get('session')->getFlashBag()->add('success', 'Instance Redis has been deleted successfully');
}else {
$this->get... | php | public function deleteAction($id)
{
$instance = $this->getManager()->find($id);
if($instance) {
$this->getManager()->delete($instance);
$this->get('session')->getFlashBag()->add('success', 'Instance Redis has been deleted successfully');
}else {
$this->get... | [
"public",
"function",
"deleteAction",
"(",
"$",
"id",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"instance",
")",
"{",
"$",
"this",
"->",
"getManager",
"(",
"... | Delete instance action
@param string $id The instance ID
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Delete",
"instance",
"action"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/CrudController.php#L166-L177 |
196,883 | ringoteam/RingoPhpRedmonBundle | Controller/CrudController.php | CrudController.getForm | protected function getForm(Instance $instance = null)
{
if($instance == null) {
$instance = $this->getManager()->createNew();
}
return $this->createForm(
$this->container->get('ringo_php_redmon.form.instance_type'),
$instance
);
} | php | protected function getForm(Instance $instance = null)
{
if($instance == null) {
$instance = $this->getManager()->createNew();
}
return $this->createForm(
$this->container->get('ringo_php_redmon.form.instance_type'),
$instance
);
} | [
"protected",
"function",
"getForm",
"(",
"Instance",
"$",
"instance",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"instance",
"==",
"null",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"createNew",
"(",
")",
";",
"}",
... | Create Form instance
@param Instance $instance
@return \Symfony\Component\Form\Form | [
"Create",
"Form",
"instance"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/CrudController.php#L195-L205 |
196,884 | zapheus/zapheus | src/Http/Message/Request.php | Request.attribute | public function attribute($name)
{
$exists = isset($this->attributes[$name]);
return $exists ? $this->attributes[$name] : null;
} | php | public function attribute($name)
{
$exists = isset($this->attributes[$name]);
return $exists ? $this->attributes[$name] : null;
} | [
"public",
"function",
"attribute",
"(",
"$",
"name",
")",
"{",
"$",
"exists",
"=",
"isset",
"(",
"$",
"this",
"->",
"attributes",
"[",
"$",
"name",
"]",
")",
";",
"return",
"$",
"exists",
"?",
"$",
"this",
"->",
"attributes",
"[",
"$",
"name",
"]",... | Returns an instance with the specified derived request attribute.
@param string $name
@return mixed | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"derived",
"request",
"attribute",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Message/Request.php#L103-L108 |
196,885 | zapheus/zapheus | src/Http/Message/Request.php | Request.query | public function query($name)
{
$exists = isset($this->queries[$name]);
return $exists ? $this->queries[$name] : null;
} | php | public function query($name)
{
$exists = isset($this->queries[$name]);
return $exists ? $this->queries[$name] : null;
} | [
"public",
"function",
"query",
"(",
"$",
"name",
")",
"{",
"$",
"exists",
"=",
"isset",
"(",
"$",
"this",
"->",
"queries",
"[",
"$",
"name",
"]",
")",
";",
"return",
"$",
"exists",
"?",
"$",
"this",
"->",
"queries",
"[",
"$",
"name",
"]",
":",
... | Returns the specified query string argument.
@param string $name
@return array | [
"Returns",
"the",
"specified",
"query",
"string",
"argument",
"."
] | 96618b5cee7d20b6700d0475e4334ae4b5163a6b | https://github.com/zapheus/zapheus/blob/96618b5cee7d20b6700d0475e4334ae4b5163a6b/src/Http/Message/Request.php#L208-L213 |
196,886 | squareproton/Bond | lib/SebastianBergmann/Diff.php | Diff.longestCommonSubsequence | protected function longestCommonSubsequence(array $from, array $to)
{
$common = array();
$matrix = array();
$fromLength = count($from);
$toLength = count($to);
for ($i = 0; $i <= $fromLength; ++$i) {
$matrix[$i][0] = 0;
}
for ($j = 0; $... | php | protected function longestCommonSubsequence(array $from, array $to)
{
$common = array();
$matrix = array();
$fromLength = count($from);
$toLength = count($to);
for ($i = 0; $i <= $fromLength; ++$i) {
$matrix[$i][0] = 0;
}
for ($j = 0; $... | [
"protected",
"function",
"longestCommonSubsequence",
"(",
"array",
"$",
"from",
",",
"array",
"$",
"to",
")",
"{",
"$",
"common",
"=",
"array",
"(",
")",
";",
"$",
"matrix",
"=",
"array",
"(",
")",
";",
"$",
"fromLength",
"=",
"count",
"(",
"$",
"fro... | Calculates the longest common subsequence of two arrays.
@param array $from
@param array $to
@return array | [
"Calculates",
"the",
"longest",
"common",
"subsequence",
"of",
"two",
"arrays",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/SebastianBergmann/Diff.php#L257-L302 |
196,887 | praxigento/mobi_mod_downline | Service/Snap/Calc.php | Calc.getDwnlLog | private function getDwnlLog($datestamp)
{
$result = [];
/* prepare query parameters */
$tsFrom = $this->hlpPeriod->getTimestampFrom($datestamp);
$periodTo = $this->hlpPeriod->getPeriodCurrent();
$tsTo = $this->hlpPeriod->getTimestampTo($periodTo);
/* perform query */
... | php | private function getDwnlLog($datestamp)
{
$result = [];
/* prepare query parameters */
$tsFrom = $this->hlpPeriod->getTimestampFrom($datestamp);
$periodTo = $this->hlpPeriod->getPeriodCurrent();
$tsTo = $this->hlpPeriod->getTimestampTo($periodTo);
/* perform query */
... | [
"private",
"function",
"getDwnlLog",
"(",
"$",
"datestamp",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"/* prepare query parameters */",
"$",
"tsFrom",
"=",
"$",
"this",
"->",
"hlpPeriod",
"->",
"getTimestampFrom",
"(",
"$",
"datestamp",
")",
";",
"$",
"... | Load change log starting from the given date.
@param string $datestamp
@return \Praxigento\Downline\Repo\Data\Change[]
@throws \Exception | [
"Load",
"change",
"log",
"starting",
"from",
"the",
"given",
"date",
"."
] | 0f3c276dfff1aa029f9fd205ccfc56f207a2e75b | https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Service/Snap/Calc.php#L89-L111 |
196,888 | praxigento/mobi_mod_downline | Service/Snap/Calc.php | Calc.getDwnlSnap | private function getDwnlSnap($datestamp)
{
$result = [];
$query = $this->qSnapOnDate->build();
$query->order(QSnapOnDate::AS_DWNL_SNAP . '.' . ESnap::A_DEPTH);
$conn = $query->getConnection();
$bind = [
QSnapOnDate::BND_ON_DATE => $datestamp
];
$ro... | php | private function getDwnlSnap($datestamp)
{
$result = [];
$query = $this->qSnapOnDate->build();
$query->order(QSnapOnDate::AS_DWNL_SNAP . '.' . ESnap::A_DEPTH);
$conn = $query->getConnection();
$bind = [
QSnapOnDate::BND_ON_DATE => $datestamp
];
$ro... | [
"private",
"function",
"getDwnlSnap",
"(",
"$",
"datestamp",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"qSnapOnDate",
"->",
"build",
"(",
")",
";",
"$",
"query",
"->",
"order",
"(",
"QSnapOnDate",
"::",
"AS_DW... | Load downline snapshot on the given date.
@param string $datestamp
@return ESnap[]
@throws \Exception | [
"Load",
"downline",
"snapshot",
"on",
"the",
"given",
"date",
"."
] | 0f3c276dfff1aa029f9fd205ccfc56f207a2e75b | https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Service/Snap/Calc.php#L120-L136 |
196,889 | libreworks/caridea-auth | src/Principal.php | Principal.getAnonymous | public static function getAnonymous(): Principal
{
if (self::$anon === null) {
self::$anon = new self(null, [], true);
}
return self::$anon;
} | php | public static function getAnonymous(): Principal
{
if (self::$anon === null) {
self::$anon = new self(null, [], true);
}
return self::$anon;
} | [
"public",
"static",
"function",
"getAnonymous",
"(",
")",
":",
"Principal",
"{",
"if",
"(",
"self",
"::",
"$",
"anon",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"anon",
"=",
"new",
"self",
"(",
"null",
",",
"[",
"]",
",",
"true",
")",
";",
"}",... | Gets a token representing an anonymous authentication.
@return Principal The anonymous principal | [
"Gets",
"a",
"token",
"representing",
"an",
"anonymous",
"authentication",
"."
] | 1bf965c57716942b18ca3204629f6bda99cf876a | https://github.com/libreworks/caridea-auth/blob/1bf965c57716942b18ca3204629f6bda99cf876a/src/Principal.php#L122-L128 |
196,890 | ciims/ciims-modules-install | models/DatabaseForm.php | DatabaseForm.validateConnection | public function validateConnection()
{
// Make sure all fields are provided
if ($this->validate())
{
// Just turning the connection on and off. A CDbException will be thrown if something goes wrong
try
{
$connection = new CDbConnection("mys... | php | public function validateConnection()
{
// Make sure all fields are provided
if ($this->validate())
{
// Just turning the connection on and off. A CDbException will be thrown if something goes wrong
try
{
$connection = new CDbConnection("mys... | [
"public",
"function",
"validateConnection",
"(",
")",
"{",
"// Make sure all fields are provided",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"// Just turning the connection on and off. A CDbException will be thrown if something goes wrong",
"try",
"{",
"$"... | Validator for connection to MySQL
@return bool Whether or not we could connect to MySQL | [
"Validator",
"for",
"connection",
"to",
"MySQL"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/models/DatabaseForm.php#L61-L89 |
196,891 | quantaphp/container-factories | src/Configuration/PhpFileConfiguration.php | PhpFileConfiguration.contents | private function contents(): array
{
if (! $this->contents) {
if (! file_exists($this->path)) {
throw new \LogicException(
vsprintf('The PHP configuration file does not exist (%s)', [
realpath($this->path),
])
... | php | private function contents(): array
{
if (! $this->contents) {
if (! file_exists($this->path)) {
throw new \LogicException(
vsprintf('The PHP configuration file does not exist (%s)', [
realpath($this->path),
])
... | [
"private",
"function",
"contents",
"(",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"contents",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"path",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"vsp... | Return the content of the file and cache it.
@return array[];
@throws \LogicException
@throws \UnexpectedValueException | [
"Return",
"the",
"content",
"of",
"the",
"file",
"and",
"cache",
"it",
"."
] | 5e753d66a18d0ce4418cbf33fe6d6b74948f303d | https://github.com/quantaphp/container-factories/blob/5e753d66a18d0ce4418cbf33fe6d6b74948f303d/src/Configuration/PhpFileConfiguration.php#L208-L242 |
196,892 | quantaphp/container-factories | src/Configuration/PhpFileConfiguration.php | PhpFileConfiguration.keyNotArrayErrorMessage | private function keyNotArrayErrorMessage(array $contents, string ...$path): string
{
$value = array_reduce($path, function (array $arr, string $key) {
return $arr[$key];
}, $contents);
return vsprintf('The key [%s] of the configuration array must be an array, %s given (%s)', [
... | php | private function keyNotArrayErrorMessage(array $contents, string ...$path): string
{
$value = array_reduce($path, function (array $arr, string $key) {
return $arr[$key];
}, $contents);
return vsprintf('The key [%s] of the configuration array must be an array, %s given (%s)', [
... | [
"private",
"function",
"keyNotArrayErrorMessage",
"(",
"array",
"$",
"contents",
",",
"string",
"...",
"$",
"path",
")",
":",
"string",
"{",
"$",
"value",
"=",
"array_reduce",
"(",
"$",
"path",
",",
"function",
"(",
"array",
"$",
"arr",
",",
"string",
"$... | Return the error message of the exception thrown when a key of the
configuration array is not an array.
@param array $contents
@param string ...$path
@return string | [
"Return",
"the",
"error",
"message",
"of",
"the",
"exception",
"thrown",
"when",
"a",
"key",
"of",
"the",
"configuration",
"array",
"is",
"not",
"an",
"array",
"."
] | 5e753d66a18d0ce4418cbf33fe6d6b74948f303d | https://github.com/quantaphp/container-factories/blob/5e753d66a18d0ce4418cbf33fe6d6b74948f303d/src/Configuration/PhpFileConfiguration.php#L252-L263 |
196,893 | quantaphp/container-factories | src/Configuration/PhpFileConfiguration.php | PhpFileConfiguration.arrayKeyTypeErrorMessage | private function arrayKeyTypeErrorMessage(array $contents, string $key, string $type, string ...$path): string
{
$arr = array_reduce($path, function (array $arr, string $key) {
return $arr[$key];
}, $contents);
return vsprintf('The key [%s] of the configuration array must be an ... | php | private function arrayKeyTypeErrorMessage(array $contents, string $key, string $type, string ...$path): string
{
$arr = array_reduce($path, function (array $arr, string $key) {
return $arr[$key];
}, $contents);
return vsprintf('The key [%s] of the configuration array must be an ... | [
"private",
"function",
"arrayKeyTypeErrorMessage",
"(",
"array",
"$",
"contents",
",",
"string",
"$",
"key",
",",
"string",
"$",
"type",
",",
"string",
"...",
"$",
"path",
")",
":",
"string",
"{",
"$",
"arr",
"=",
"array_reduce",
"(",
"$",
"path",
",",
... | Return the error message of the exception thrown when a key of an array
is associated to a value with an unexpected type.
@param array $contents
@param string $key
@param string $type
@param string ...$path
@return string | [
"Return",
"the",
"error",
"message",
"of",
"the",
"exception",
"thrown",
"when",
"a",
"key",
"of",
"an",
"array",
"is",
"associated",
"to",
"a",
"value",
"with",
"an",
"unexpected",
"type",
"."
] | 5e753d66a18d0ce4418cbf33fe6d6b74948f303d | https://github.com/quantaphp/container-factories/blob/5e753d66a18d0ce4418cbf33fe6d6b74948f303d/src/Configuration/PhpFileConfiguration.php#L275-L288 |
196,894 | freialib/hlin.security | src/Auth.php | Auth.instance | static function instance(array $whitelist, array $blacklist, array $aliaslist, $main_entity_id = \hlin\Auth::Unidentified, $main_entity_role = \hlin\Auth::Guest, \hlin\archetype\Logger $logger = null) {
$i = new static;
$i->whitelist = $whitelist;
$i->blacklist = $blacklist;
$i->aliaslist = $aliaslist;
$i-... | php | static function instance(array $whitelist, array $blacklist, array $aliaslist, $main_entity_id = \hlin\Auth::Unidentified, $main_entity_role = \hlin\Auth::Guest, \hlin\archetype\Logger $logger = null) {
$i = new static;
$i->whitelist = $whitelist;
$i->blacklist = $blacklist;
$i->aliaslist = $aliaslist;
$i-... | [
"static",
"function",
"instance",
"(",
"array",
"$",
"whitelist",
",",
"array",
"$",
"blacklist",
",",
"array",
"$",
"aliaslist",
",",
"$",
"main_entity_id",
"=",
"\\",
"hlin",
"\\",
"Auth",
"::",
"Unidentified",
",",
"$",
"main_entity_role",
"=",
"\\",
"h... | Most operations are on the current entity, so we require the current
entity is set to facilitate the process; some operations also require
the current entity to resolve.
@return static | [
"Most",
"operations",
"are",
"on",
"the",
"current",
"entity",
"so",
"we",
"require",
"the",
"current",
"entity",
"is",
"set",
"to",
"facilitate",
"the",
"process",
";",
"some",
"operations",
"also",
"require",
"the",
"current",
"entity",
"to",
"resolve",
".... | 7f6aea6a7eb64f1095e176ddfad64008eed68b2e | https://github.com/freialib/hlin.security/blob/7f6aea6a7eb64f1095e176ddfad64008eed68b2e/src/Auth.php#L48-L62 |
196,895 | Vectrex/vxPHP | src/Http/Request.php | Request.overrideGlobals | public function overrideGlobals() {
$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), NULL, '&')));
$_GET = $this->query->all();
$_POST = $this->request->all();
$_SERVER = $this->server->all();
$_COOKIE = $this->cookies->all();
foreach ($this->headers... | php | public function overrideGlobals() {
$this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), NULL, '&')));
$_GET = $this->query->all();
$_POST = $this->request->all();
$_SERVER = $this->server->all();
$_COOKIE = $this->cookies->all();
foreach ($this->headers... | [
"public",
"function",
"overrideGlobals",
"(",
")",
"{",
"$",
"this",
"->",
"server",
"->",
"set",
"(",
"'QUERY_STRING'",
",",
"static",
"::",
"normalizeQueryString",
"(",
"http_build_query",
"(",
"$",
"this",
"->",
"query",
"->",
"all",
"(",
")",
",",
"NUL... | Overrides the PHP global variables according to this request instance.
It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE.
$_FILES is never overridden, see rfc1867 | [
"Overrides",
"the",
"PHP",
"global",
"variables",
"according",
"to",
"this",
"request",
"instance",
"."
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Http/Request.php#L486-L519 |
196,896 | Vectrex/vxPHP | src/Http/Request.php | Request.setTrustedHosts | public static function setTrustedHosts(array $hostPatterns) {
self::$trustedHostPatterns = array_map(function ($hostPattern) {
return sprintf('#%s#i', $hostPattern);
}, $hostPatterns);
self::$trustedHosts = [];
} | php | public static function setTrustedHosts(array $hostPatterns) {
self::$trustedHostPatterns = array_map(function ($hostPattern) {
return sprintf('#%s#i', $hostPattern);
}, $hostPatterns);
self::$trustedHosts = [];
} | [
"public",
"static",
"function",
"setTrustedHosts",
"(",
"array",
"$",
"hostPatterns",
")",
"{",
"self",
"::",
"$",
"trustedHostPatterns",
"=",
"array_map",
"(",
"function",
"(",
"$",
"hostPattern",
")",
"{",
"return",
"sprintf",
"(",
"'#%s#i'",
",",
"$",
"ho... | Sets a list of trusted host patterns.
You should only list the hosts you manage using regexs.
@param array $hostPatterns A list of trusted host patterns | [
"Sets",
"a",
"list",
"of",
"trusted",
"host",
"patterns",
".",
"You",
"should",
"only",
"list",
"the",
"hosts",
"you",
"manage",
"using",
"regexs",
"."
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Http/Request.php#L550-L558 |
196,897 | phossa/phossa-config | src/Phossa/Config/Env/Environment.php | Environment.getContents | protected function getContents(/*# string */ $path)/*# string */
{
// read in file
$contents = @file_get_contents($path);
// failed
if (false === $contents) {
throw new NotFoundException(
Message::get(Message::CONFIG_FILE_NOTFOUND, $path),
... | php | protected function getContents(/*# string */ $path)/*# string */
{
// read in file
$contents = @file_get_contents($path);
// failed
if (false === $contents) {
throw new NotFoundException(
Message::get(Message::CONFIG_FILE_NOTFOUND, $path),
... | [
"protected",
"function",
"getContents",
"(",
"/*# string */",
"$",
"path",
")",
"/*# string */",
"{",
"// read in file",
"$",
"contents",
"=",
"@",
"file_get_contents",
"(",
"$",
"path",
")",
";",
"// failed",
"if",
"(",
"false",
"===",
"$",
"contents",
")",
... | Read contents from a local file system
@param string $path
@return string
@access protected
@throws NotFoundException if no file found | [
"Read",
"contents",
"from",
"a",
"local",
"file",
"system"
] | fdb90831da06408bb674ab777754e67025604bed | https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Env/Environment.php#L85-L98 |
196,898 | phossa/phossa-config | src/Phossa/Config/Env/Environment.php | Environment.matchEnv | protected function matchEnv(/*# string */ $name)
{
if ('_' === $name[0]) {
// PHP super globals like _SERVER, _COOKIE etc.
$pos = strpos($name, '.');
if (false !== $pos) {
$pref = substr($name, 0, $pos);
$suff = substr($name, $pos + 1);
... | php | protected function matchEnv(/*# string */ $name)
{
if ('_' === $name[0]) {
// PHP super globals like _SERVER, _COOKIE etc.
$pos = strpos($name, '.');
if (false !== $pos) {
$pref = substr($name, 0, $pos);
$suff = substr($name, $pos + 1);
... | [
"protected",
"function",
"matchEnv",
"(",
"/*# string */",
"$",
"name",
")",
"{",
"if",
"(",
"'_'",
"===",
"$",
"name",
"[",
"0",
"]",
")",
"{",
"// PHP super globals like _SERVER, _COOKIE etc.",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"name",
",",
"'.'",
")"... | Find the env value base one the name
- support super globals like '_SERVER.HTTP_HOST' etc.
- use getenv()
@param string $name
@return string|false
@access protected | [
"Find",
"the",
"env",
"value",
"base",
"one",
"the",
"name"
] | fdb90831da06408bb674ab777754e67025604bed | https://github.com/phossa/phossa-config/blob/fdb90831da06408bb674ab777754e67025604bed/src/Phossa/Config/Env/Environment.php#L166-L180 |
196,899 | theomessin/ts-framework | src/Helper/Convert.php | Convert.permissionType | public static function permissionType($type)
{
if ($type == Teamspeak::PERM_TYPE_SERVERGROUP) {
return "Server Group";
}
if ($type == Teamspeak::PERM_TYPE_CLIENT) {
return "Client";
}
if ($type == Teamspeak::PERM_TYPE_CHANNEL) {
return "Cha... | php | public static function permissionType($type)
{
if ($type == Teamspeak::PERM_TYPE_SERVERGROUP) {
return "Server Group";
}
if ($type == Teamspeak::PERM_TYPE_CLIENT) {
return "Client";
}
if ($type == Teamspeak::PERM_TYPE_CHANNEL) {
return "Cha... | [
"public",
"static",
"function",
"permissionType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"Teamspeak",
"::",
"PERM_TYPE_SERVERGROUP",
")",
"{",
"return",
"\"Server Group\"",
";",
"}",
"if",
"(",
"$",
"type",
"==",
"Teamspeak",
"::",
"PERM... | Converts a given permission type ID to a human readable name.
@param integer $type
@return string | [
"Converts",
"a",
"given",
"permission",
"type",
"ID",
"to",
"a",
"human",
"readable",
"name",
"."
] | d60e36553241db05cb05ef19e749866cc977437c | https://github.com/theomessin/ts-framework/blob/d60e36553241db05cb05ef19e749866cc977437c/src/Helper/Convert.php#L148-L167 |
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.