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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9,300 | kambo-1st/KamboRouter | src/Dispatcher/ClassAutoBind.php | ClassAutoBind.dispatchNotFound | public function dispatchNotFound()
{
if (isset($this->notFoundHandler)) {
$notFoundHandler = $this->notFoundHandler;
$controllerName = implode(
'\\',
[
$this->baseNamespace,
$this->controllerName,
... | php | public function dispatchNotFound()
{
if (isset($this->notFoundHandler)) {
$notFoundHandler = $this->notFoundHandler;
$controllerName = implode(
'\\',
[
$this->baseNamespace,
$this->controllerName,
... | [
"public",
"function",
"dispatchNotFound",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"notFoundHandler",
")",
")",
"{",
"$",
"notFoundHandler",
"=",
"$",
"this",
"->",
"notFoundHandler",
";",
"$",
"controllerName",
"=",
"implode",
"(",
"'\\\... | Called if any of route did not match the request.
@return mixed | [
"Called",
"if",
"any",
"of",
"route",
"did",
"not",
"match",
"the",
"request",
"."
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClassAutoBind.php#L113-L137 |
9,301 | kambo-1st/KamboRouter | src/Dispatcher/ClassAutoBind.php | ClassAutoBind.transformHandler | private function transformHandler($matches, $parameters, $handler)
{
$transformed = [];
foreach ($handler as $target => $placeholder) {
foreach ($parameters as $key => $parameterName) {
if ($parameterName[0][0] == $placeholder) {
if ($target == 'contro... | php | private function transformHandler($matches, $parameters, $handler)
{
$transformed = [];
foreach ($handler as $target => $placeholder) {
foreach ($parameters as $key => $parameterName) {
if ($parameterName[0][0] == $placeholder) {
if ($target == 'contro... | [
"private",
"function",
"transformHandler",
"(",
"$",
"matches",
",",
"$",
"parameters",
",",
"$",
"handler",
")",
"{",
"$",
"transformed",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"handler",
"as",
"$",
"target",
"=>",
"$",
"placeholder",
")",
"{",
"for... | Transform provided handler with variables and parameters
@param mixed $matches found matched variables
@param mixed $parameters route parameters
@param mixed $handler handler that should be executed
@return mixed | [
"Transform",
"provided",
"handler",
"with",
"variables",
"and",
"parameters"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClassAutoBind.php#L214-L230 |
9,302 | kambo-1st/KamboRouter | src/Dispatcher/ClassAutoBind.php | ClassAutoBind.resolveNamespace | private function resolveNamespace($parameters, $handler, $matches)
{
if (isset($handler['module'])) {
$moduleName = $handler['module'];
if ($this->isPlaceholder($moduleName)) {
foreach ($handler as $target => $placeholder) {
foreach ($parameters as... | php | private function resolveNamespace($parameters, $handler, $matches)
{
if (isset($handler['module'])) {
$moduleName = $handler['module'];
if ($this->isPlaceholder($moduleName)) {
foreach ($handler as $target => $placeholder) {
foreach ($parameters as... | [
"private",
"function",
"resolveNamespace",
"(",
"$",
"parameters",
",",
"$",
"handler",
",",
"$",
"matches",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"handler",
"[",
"'module'",
"]",
")",
")",
"{",
"$",
"moduleName",
"=",
"$",
"handler",
"[",
"'module'"... | Resolve proper namespace according parameters, handler and matches
@param mixed $parameters route parameters
@param mixed $handler handler that should be executed
@param mixed $matches found matched variables
@return mixed | [
"Resolve",
"proper",
"namespace",
"according",
"parameters",
"handler",
"and",
"matches"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClassAutoBind.php#L241-L269 |
9,303 | kambo-1st/KamboRouter | src/Dispatcher/ClassAutoBind.php | ClassAutoBind.isPlaceholder | private function isPlaceholder(string $value) : bool
{
if (strrchr($value, '}') && (0 === strpos($value, '{'))) {
return true;
}
return false;
} | php | private function isPlaceholder(string $value) : bool
{
if (strrchr($value, '}') && (0 === strpos($value, '{'))) {
return true;
}
return false;
} | [
"private",
"function",
"isPlaceholder",
"(",
"string",
"$",
"value",
")",
":",
"bool",
"{",
"if",
"(",
"strrchr",
"(",
"$",
"value",
",",
"'}'",
")",
"&&",
"(",
"0",
"===",
"strpos",
"(",
"$",
"value",
",",
"'{'",
")",
")",
")",
"{",
"return",
"t... | Check if the variable is placeholder
@param string $value found route
@return boolean true if value should be transfered | [
"Check",
"if",
"the",
"variable",
"is",
"placeholder"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClassAutoBind.php#L278-L285 |
9,304 | kambo-1st/KamboRouter | src/Dispatcher/ClassAutoBind.php | ClassAutoBind.getFunctionArgumentsControlers | private function getFunctionArgumentsControlers(
$paramMap,
$matches,
$parameters,
$handlers
) {
$output = [];
$matches = array_values($matches);
if (isset($parameters)) {
foreach ($handlers as $placeholder) {
if ($this->isPlaceho... | php | private function getFunctionArgumentsControlers(
$paramMap,
$matches,
$parameters,
$handlers
) {
$output = [];
$matches = array_values($matches);
if (isset($parameters)) {
foreach ($handlers as $placeholder) {
if ($this->isPlaceho... | [
"private",
"function",
"getFunctionArgumentsControlers",
"(",
"$",
"paramMap",
",",
"$",
"matches",
",",
"$",
"parameters",
",",
"$",
"handlers",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"matches",
"=",
"array_values",
"(",
"$",
"matches",
")",
... | Get function arguments for controler
@param mixed $paramMap parameter map
@param mixed $matches found matched variables
@param mixed $parameters route parameters
@param mixed $handlers handler that should be executed
@return mixed | [
"Get",
"function",
"arguments",
"for",
"controler"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClassAutoBind.php#L297-L331 |
9,305 | kambo-1st/KamboRouter | src/Dispatcher/ClassAutoBind.php | ClassAutoBind.getMethodParameters | private function getMethodParameters(string $class, string $methodName) : array
{
$methodReflection = new ReflectionMethod($class, $methodName);
$parametersName = [];
foreach ($methodReflection->getParameters() as $parameter) {
$parametersName[] = $parameter->name;
}
... | php | private function getMethodParameters(string $class, string $methodName) : array
{
$methodReflection = new ReflectionMethod($class, $methodName);
$parametersName = [];
foreach ($methodReflection->getParameters() as $parameter) {
$parametersName[] = $parameter->name;
}
... | [
"private",
"function",
"getMethodParameters",
"(",
"string",
"$",
"class",
",",
"string",
"$",
"methodName",
")",
":",
"array",
"{",
"$",
"methodReflection",
"=",
"new",
"ReflectionMethod",
"(",
"$",
"class",
",",
"$",
"methodName",
")",
";",
"$",
"parameter... | Get names of parameters for provided class and method
@param string $class name of class
@param string $methodName name of method
@return array | [
"Get",
"names",
"of",
"parameters",
"for",
"provided",
"class",
"and",
"method"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClassAutoBind.php#L341-L351 |
9,306 | gpupo/Coordinate | src/Gpupo/Coordinate/Conversion.php | Conversion.setDMS | public function setDMS($string)
{
$string = preg_replace(
"/[^a-zA-Z0-9,.\s]/",
' ',
trim($string)
);
$string = str_replace(
array('S', 'N', 'E', 'W'),
array(' S', ' N', ' E', ' W'),
strtoupper($string)
);
... | php | public function setDMS($string)
{
$string = preg_replace(
"/[^a-zA-Z0-9,.\s]/",
' ',
trim($string)
);
$string = str_replace(
array('S', 'N', 'E', 'W'),
array(' S', ' N', ' E', ' W'),
strtoupper($string)
);
... | [
"public",
"function",
"setDMS",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"preg_replace",
"(",
"\"/[^a-zA-Z0-9,.\\s]/\"",
",",
"' '",
",",
"trim",
"(",
"$",
"string",
")",
")",
";",
"$",
"string",
"=",
"str_replace",
"(",
"array",
"(",
"'S'",
"... | Clean input DMS and set as array. | [
"Clean",
"input",
"DMS",
"and",
"set",
"as",
"array",
"."
] | 7a1725d56dcbf0e6f881e51ba3f3d6a72c7d5946 | https://github.com/gpupo/Coordinate/blob/7a1725d56dcbf0e6f881e51ba3f3d6a72c7d5946/src/Gpupo/Coordinate/Conversion.php#L118-L140 |
9,307 | athena-oss/php-fluent-webdriver-client | src/Browser/BrowserDriverBuilder.php | BrowserDriverBuilder.withProxySettings | public function withProxySettings($proxySettings)
{
if (!empty($proxySettings)) {
$this->extraCapabilities[WebDriverCapabilityType::PROXY] = [
'proxyType' => $proxySettings['proxyType'],
'httpProxy' => $proxySettings['httpProxy'],
'sslProxy' => $pr... | php | public function withProxySettings($proxySettings)
{
if (!empty($proxySettings)) {
$this->extraCapabilities[WebDriverCapabilityType::PROXY] = [
'proxyType' => $proxySettings['proxyType'],
'httpProxy' => $proxySettings['httpProxy'],
'sslProxy' => $pr... | [
"public",
"function",
"withProxySettings",
"(",
"$",
"proxySettings",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"proxySettings",
")",
")",
"{",
"$",
"this",
"->",
"extraCapabilities",
"[",
"WebDriverCapabilityType",
"::",
"PROXY",
"]",
"=",
"[",
"'proxyTy... | Sets the given proxy settings and returns self.
@param array $proxySettings
@return $this | [
"Sets",
"the",
"given",
"proxy",
"settings",
"and",
"returns",
"self",
"."
] | 0b4cca15ab876bd9af40c115728fafce08ce3472 | https://github.com/athena-oss/php-fluent-webdriver-client/blob/0b4cca15ab876bd9af40c115728fafce08ce3472/src/Browser/BrowserDriverBuilder.php#L93-L103 |
9,308 | athena-oss/php-fluent-webdriver-client | src/Browser/BrowserDriverBuilder.php | BrowserDriverBuilder.build | public function build()
{
$capabilities = $this->makeCapabilities($this->type, $this->extraCapabilities);
$this->remoteWebDriver = RemoteWebDriver::create(
$this->url,
$capabilities,
$this->connectionTimeout,
$this->requestTimeout
);
... | php | public function build()
{
$capabilities = $this->makeCapabilities($this->type, $this->extraCapabilities);
$this->remoteWebDriver = RemoteWebDriver::create(
$this->url,
$capabilities,
$this->connectionTimeout,
$this->requestTimeout
);
... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"capabilities",
"=",
"$",
"this",
"->",
"makeCapabilities",
"(",
"$",
"this",
"->",
"type",
",",
"$",
"this",
"->",
"extraCapabilities",
")",
";",
"$",
"this",
"->",
"remoteWebDriver",
"=",
"RemoteWebDrive... | Builds a Facebook RemoteWebDriver.
@throws UnsupportedBrowserException
@return $this | [
"Builds",
"a",
"Facebook",
"RemoteWebDriver",
"."
] | 0b4cca15ab876bd9af40c115728fafce08ce3472 | https://github.com/athena-oss/php-fluent-webdriver-client/blob/0b4cca15ab876bd9af40c115728fafce08ce3472/src/Browser/BrowserDriverBuilder.php#L184-L206 |
9,309 | Flowpack/Flowpack.SingleSignOn.Server | Classes/Flowpack/SingleSignOn/Server/Service/AccountManager.php | AccountManager.impersonateAccount | public function impersonateAccount(\TYPO3\Flow\Security\Account $account = NULL) {
if ($this->impersonatedAccount !== $account) {
$this->impersonatedAccount = $account;
$this->destroyRegisteredClientSessions();
$this->emitAccountImpersonated($account);
}
} | php | public function impersonateAccount(\TYPO3\Flow\Security\Account $account = NULL) {
if ($this->impersonatedAccount !== $account) {
$this->impersonatedAccount = $account;
$this->destroyRegisteredClientSessions();
$this->emitAccountImpersonated($account);
}
} | [
"public",
"function",
"impersonateAccount",
"(",
"\\",
"TYPO3",
"\\",
"Flow",
"\\",
"Security",
"\\",
"Account",
"$",
"account",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"impersonatedAccount",
"!==",
"$",
"account",
")",
"{",
"$",
"this",
"->... | Impersonate another account
Destroys registered client sessions to force re-authentication.
@param \TYPO3\Flow\Security\Account $account
@return void | [
"Impersonate",
"another",
"account"
] | b1fa014f31d0d101a79cb95d5585b9973f35347d | https://github.com/Flowpack/Flowpack.SingleSignOn.Server/blob/b1fa014f31d0d101a79cb95d5585b9973f35347d/Classes/Flowpack/SingleSignOn/Server/Service/AccountManager.php#L77-L85 |
9,310 | pletfix/core | src/Handlers/ExceptionHandler.php | ExceptionHandler.handleForConsole | private function handleForConsole(Exception $e)
{
if ($e instanceof StopException) {
$output = $e->getMessage();
}
else {
$data = $this->convertException($e);
$class = get_class($e);
$file = $this->stripFile($data['file']);
$line ... | php | private function handleForConsole(Exception $e)
{
if ($e instanceof StopException) {
$output = $e->getMessage();
}
else {
$data = $this->convertException($e);
$class = get_class($e);
$file = $this->stripFile($data['file']);
$line ... | [
"private",
"function",
"handleForConsole",
"(",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"instanceof",
"StopException",
")",
"{",
"$",
"output",
"=",
"$",
"e",
"->",
"getMessage",
"(",
")",
";",
"}",
"else",
"{",
"$",
"data",
"=",
"$",
... | Write a error message to the console and exit the script.
@param Exception $e | [
"Write",
"a",
"error",
"message",
"to",
"the",
"console",
"and",
"exit",
"the",
"script",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Handlers/ExceptionHandler.php#L98-L135 |
9,311 | pletfix/core | src/Handlers/ExceptionHandler.php | ExceptionHandler.handleForBrowser | private function handleForBrowser(Exception $e)
{
// $request = request();
// if ($e instanceof ModelNotFoundException) {
// $e = new NotFoundHttpException($e->getMessage(), $e);
// }
// elseif ($e instanceof AuthorizationException) {
// $e = new HttpException(403, ... | php | private function handleForBrowser(Exception $e)
{
// $request = request();
// if ($e instanceof ModelNotFoundException) {
// $e = new NotFoundHttpException($e->getMessage(), $e);
// }
// elseif ($e instanceof AuthorizationException) {
// $e = new HttpException(403, ... | [
"private",
"function",
"handleForBrowser",
"(",
"Exception",
"$",
"e",
")",
"{",
"// $request = request();",
"// if ($e instanceof ModelNotFoundException) {",
"// $e = new NotFoundHttpException($e->getMessage(), $e);",
"// }",
"// elseif ($e instanceo... | Send a error message as a HTTP response.
@param Exception $e | [
"Send",
"a",
"error",
"message",
"as",
"a",
"HTTP",
"response",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Handlers/ExceptionHandler.php#L142-L237 |
9,312 | pletfix/core | src/Handlers/ExceptionHandler.php | ExceptionHandler.convertException | private function convertException(Exception $e)
{
$data = [];
$data['message'] = $e->getMessage();
$data['code'] = $e->getCode();
$data['trace'] = $this->filterTrace($e->getTrace());
$data['status'] = Response::HTTP_INTERNAL_SERVER_ERROR;
// determine the r... | php | private function convertException(Exception $e)
{
$data = [];
$data['message'] = $e->getMessage();
$data['code'] = $e->getCode();
$data['trace'] = $this->filterTrace($e->getTrace());
$data['status'] = Response::HTTP_INTERNAL_SERVER_ERROR;
// determine the r... | [
"private",
"function",
"convertException",
"(",
"Exception",
"$",
"e",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"data",
"[",
"'message'",
"]",
"=",
"$",
"e",
"->",
"getMessage",
"(",
")",
";",
"$",
"data",
"[",
"'code'",
"]",
"=",
"$",
"e"... | Convert a Exception to a simple array.
@param Exception $e
@return array | [
"Convert",
"a",
"Exception",
"to",
"a",
"simple",
"array",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Handlers/ExceptionHandler.php#L248-L280 |
9,313 | pletfix/core | src/Handlers/ExceptionHandler.php | ExceptionHandler.renderSQL | private function renderSQL($sql, $line)
{
try {
$sql = trim($sql);
$count = count(explode(PHP_EOL, $sql));
$code = '<code>' . SqlFormatter::highlight($sql) . '</code>';
return $this->wrapLineNumbers($count, $code, $line);
}
catch(Throwable $e)... | php | private function renderSQL($sql, $line)
{
try {
$sql = trim($sql);
$count = count(explode(PHP_EOL, $sql));
$code = '<code>' . SqlFormatter::highlight($sql) . '</code>';
return $this->wrapLineNumbers($count, $code, $line);
}
catch(Throwable $e)... | [
"private",
"function",
"renderSQL",
"(",
"$",
"sql",
",",
"$",
"line",
")",
"{",
"try",
"{",
"$",
"sql",
"=",
"trim",
"(",
"$",
"sql",
")",
";",
"$",
"count",
"=",
"count",
"(",
"explode",
"(",
"PHP_EOL",
",",
"$",
"sql",
")",
")",
";",
"$",
... | Render SQL.
@param string $sql
@param int $line
@return string | [
"Render",
"SQL",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Handlers/ExceptionHandler.php#L322-L336 |
9,314 | pletfix/core | src/Handlers/ExceptionHandler.php | ExceptionHandler.wrapLineNumbers | private function wrapLineNumbers($count, $code, $line)
{
$length = max(strlen($count), 2);
$numbers = [];
for ($number = 1; $number <= $count; $number++) {
$numbers[] = str_pad($number, $length, '0', STR_PAD_LEFT);
}
if ($line > 0) {
$numbers[$line - ... | php | private function wrapLineNumbers($count, $code, $line)
{
$length = max(strlen($count), 2);
$numbers = [];
for ($number = 1; $number <= $count; $number++) {
$numbers[] = str_pad($number, $length, '0', STR_PAD_LEFT);
}
if ($line > 0) {
$numbers[$line - ... | [
"private",
"function",
"wrapLineNumbers",
"(",
"$",
"count",
",",
"$",
"code",
",",
"$",
"line",
")",
"{",
"$",
"length",
"=",
"max",
"(",
"strlen",
"(",
"$",
"count",
")",
",",
"2",
")",
";",
"$",
"numbers",
"=",
"[",
"]",
";",
"for",
"(",
"$"... | Render code with line numbers
@param int $count
@param string $code
@param int $line
@return null|string | [
"Render",
"code",
"with",
"line",
"numbers"
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Handlers/ExceptionHandler.php#L346-L363 |
9,315 | pletfix/core | src/Handlers/ExceptionHandler.php | ExceptionHandler.filterTrace | private function filterTrace($trace)
{
$ignore = 'app/Services/Database.php';
$j = strlen($ignore);
foreach ($trace as $i => $entry) {
if (isset($entry['file'])) {
$s = $this->stripFile($entry['file']);
if (substr($s, 0, $j) == $ignore) {
... | php | private function filterTrace($trace)
{
$ignore = 'app/Services/Database.php';
$j = strlen($ignore);
foreach ($trace as $i => $entry) {
if (isset($entry['file'])) {
$s = $this->stripFile($entry['file']);
if (substr($s, 0, $j) == $ignore) {
... | [
"private",
"function",
"filterTrace",
"(",
"$",
"trace",
")",
"{",
"$",
"ignore",
"=",
"'app/Services/Database.php'",
";",
"$",
"j",
"=",
"strlen",
"(",
"$",
"ignore",
")",
";",
"foreach",
"(",
"$",
"trace",
"as",
"$",
"i",
"=>",
"$",
"entry",
")",
"... | Filter Trace to relevant entries
@param array $trace
@return array | [
"Filter",
"Trace",
"to",
"relevant",
"entries"
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Handlers/ExceptionHandler.php#L371-L385 |
9,316 | pletfix/core | src/Handlers/ExceptionHandler.php | ExceptionHandler.dumpArgs | private function dumpArgs($args)
{
foreach ($args as $key => $arg) {
if (is_object($arg)) {
$v = '{' . get_class($arg) . '}';
}
else if (is_array($arg)) {
$v = '[' . $this->dumpArgs($arg) . ']';
}
else if (is_string(... | php | private function dumpArgs($args)
{
foreach ($args as $key => $arg) {
if (is_object($arg)) {
$v = '{' . get_class($arg) . '}';
}
else if (is_array($arg)) {
$v = '[' . $this->dumpArgs($arg) . ']';
}
else if (is_string(... | [
"private",
"function",
"dumpArgs",
"(",
"$",
"args",
")",
"{",
"foreach",
"(",
"$",
"args",
"as",
"$",
"key",
"=>",
"$",
"arg",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"arg",
")",
")",
"{",
"$",
"v",
"=",
"'{'",
".",
"get_class",
"(",
"$",
... | Render the arguments of a function.
@param $args
@return string | [
"Render",
"the",
"arguments",
"of",
"a",
"function",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Handlers/ExceptionHandler.php#L420-L446 |
9,317 | novuso/system | src/Utility/VarPrinter.php | VarPrinter.toString | public static function toString($value): string
{
if ($value === null) {
return 'NULL';
}
if ($value === true) {
return 'TRUE';
}
if ($value === false) {
return 'FALSE';
}
if (is_object($value)) {
return stati... | php | public static function toString($value): string
{
if ($value === null) {
return 'NULL';
}
if ($value === true) {
return 'TRUE';
}
if ($value === false) {
return 'FALSE';
}
if (is_object($value)) {
return stati... | [
"public",
"static",
"function",
"toString",
"(",
"$",
"value",
")",
":",
"string",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"'NULL'",
";",
"}",
"if",
"(",
"$",
"value",
"===",
"true",
")",
"{",
"return",
"'TRUE'",
";",
"}",
... | Reads a string representation from a value
@param mixed $value The value
@return string | [
"Reads",
"a",
"string",
"representation",
"from",
"a",
"value"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/VarPrinter.php#L24-L51 |
9,318 | novuso/system | src/Utility/VarPrinter.php | VarPrinter.readObject | protected static function readObject($object): string
{
if ($object instanceof Closure) {
return 'Function';
}
if ($object instanceof DateTime) {
return sprintf('DateTime(%s)', $object->format('Y-m-d\TH:i:sP'));
}
if (method_exists($object, 'toString... | php | protected static function readObject($object): string
{
if ($object instanceof Closure) {
return 'Function';
}
if ($object instanceof DateTime) {
return sprintf('DateTime(%s)', $object->format('Y-m-d\TH:i:sP'));
}
if (method_exists($object, 'toString... | [
"protected",
"static",
"function",
"readObject",
"(",
"$",
"object",
")",
":",
"string",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"Closure",
")",
"{",
"return",
"'Function'",
";",
"}",
"if",
"(",
"$",
"object",
"instanceof",
"DateTime",
")",
"{",
"re... | Reads a string representation from an object
@param object $object The object
@return string | [
"Reads",
"a",
"string",
"representation",
"from",
"an",
"object"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/VarPrinter.php#L60-L79 |
9,319 | novuso/system | src/Utility/VarPrinter.php | VarPrinter.readArray | protected static function readArray(array $array): string
{
$data = [];
foreach ($array as $key => $value) {
$data[] = sprintf('%s => %s', $key, static::toString($value));
}
return sprintf('Array(%s)', implode(', ', $data));
} | php | protected static function readArray(array $array): string
{
$data = [];
foreach ($array as $key => $value) {
$data[] = sprintf('%s => %s', $key, static::toString($value));
}
return sprintf('Array(%s)', implode(', ', $data));
} | [
"protected",
"static",
"function",
"readArray",
"(",
"array",
"$",
"array",
")",
":",
"string",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"data",
"[",
"]",
"=",
"sprin... | Reads a string representation from an array
@param array $array The array
@return string | [
"Reads",
"a",
"string",
"representation",
"from",
"an",
"array"
] | e34038b391826edc68d0b5fccfba96642de9d6f0 | https://github.com/novuso/system/blob/e34038b391826edc68d0b5fccfba96642de9d6f0/src/Utility/VarPrinter.php#L88-L97 |
9,320 | konservs/brilliant.framework | libraries/Log/BLoggerHTML.php | BLoggerHTML.print_html | public static function print_html(){
echo('<div class="debuginfo">');
echo('<p><b>Debug information:</b></p>');
foreach(self::$strings as $msg){
$style='';
switch($msg->level){
case LL_GENERAL:
case LL_DEBUG:
case LL_INFO:
$style='';
break;
case LL_WARNING:
case LL_ERROR:
... | php | public static function print_html(){
echo('<div class="debuginfo">');
echo('<p><b>Debug information:</b></p>');
foreach(self::$strings as $msg){
$style='';
switch($msg->level){
case LL_GENERAL:
case LL_DEBUG:
case LL_INFO:
$style='';
break;
case LL_WARNING:
case LL_ERROR:
... | [
"public",
"static",
"function",
"print_html",
"(",
")",
"{",
"echo",
"(",
"'<div class=\"debuginfo\">'",
")",
";",
"echo",
"(",
"'<p><b>Debug information:</b></p>'",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"strings",
"as",
"$",
"msg",
")",
"{",
"$",
"st... | Print HTML log. | [
"Print",
"HTML",
"log",
"."
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/Log/BLoggerHTML.php#L41-L69 |
9,321 | helthe/Segmentio | Queue.php | Queue.dequeue | public function dequeue($platform = null)
{
if (null === $platform) {
return array_shift($this->queue);
}
// The array pointer does not reset between method calls. So we need to reset it manually.
reset($this->queue);
do {
$index = key($this->queue);... | php | public function dequeue($platform = null)
{
if (null === $platform) {
return array_shift($this->queue);
}
// The array pointer does not reset between method calls. So we need to reset it manually.
reset($this->queue);
do {
$index = key($this->queue);... | [
"public",
"function",
"dequeue",
"(",
"$",
"platform",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"platform",
")",
"{",
"return",
"array_shift",
"(",
"$",
"this",
"->",
"queue",
")",
";",
"}",
"// The array pointer does not reset between method call... | Removes the method at the beginning of the queue. You can optionally
filter to dequeue a specific platform method.
@param string $platform
@return MethodInterface|null | [
"Removes",
"the",
"method",
"at",
"the",
"beginning",
"of",
"the",
"queue",
".",
"You",
"can",
"optionally",
"filter",
"to",
"dequeue",
"a",
"specific",
"platform",
"method",
"."
] | 40a97cf9780404bf0a48ad4621cc994ca66e9128 | https://github.com/helthe/Segmentio/blob/40a97cf9780404bf0a48ad4621cc994ca66e9128/Queue.php#L60-L83 |
9,322 | roboapp/crud | src/Move.php | Move.moveDown | protected function moveDown($id)
{
$model = $this->getModel($id);
$orderAttrName = $this->positionAttribute;
$orderDir = SORT_ASC;
$swapModel = $model::find()
->where(['>', $orderAttrName, $model->$orderAttrName])
->orderBy([$orderAttrName => $orderDir])
... | php | protected function moveDown($id)
{
$model = $this->getModel($id);
$orderAttrName = $this->positionAttribute;
$orderDir = SORT_ASC;
$swapModel = $model::find()
->where(['>', $orderAttrName, $model->$orderAttrName])
->orderBy([$orderAttrName => $orderDir])
... | [
"protected",
"function",
"moveDown",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
"$",
"id",
")",
";",
"$",
"orderAttrName",
"=",
"$",
"this",
"->",
"positionAttribute",
";",
"$",
"orderDir",
"=",
"SORT_ASC",
";",
... | Move model to down
@param mixed $id ID of the model to be moved down
@return mixed
@throws \yii\web\NotFoundHttpException | [
"Move",
"model",
"to",
"down"
] | cda8ce1b8996157e08df949fcc83e314e25621f1 | https://github.com/roboapp/crud/blob/cda8ce1b8996157e08df949fcc83e314e25621f1/src/Move.php#L53-L72 |
9,323 | roboapp/crud | src/Move.php | Move.moveUp | protected function moveUp($id)
{
$model = $this->getModel($id);
$orderAttrName = $this->positionAttribute;
$orderDir = SORT_DESC;
$swapModel = $model::find()
->where(['<', $orderAttrName, $model->$orderAttrName])
->orderBy([$orderAttrName => $orderDir])
... | php | protected function moveUp($id)
{
$model = $this->getModel($id);
$orderAttrName = $this->positionAttribute;
$orderDir = SORT_DESC;
$swapModel = $model::find()
->where(['<', $orderAttrName, $model->$orderAttrName])
->orderBy([$orderAttrName => $orderDir])
... | [
"protected",
"function",
"moveUp",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
"$",
"id",
")",
";",
"$",
"orderAttrName",
"=",
"$",
"this",
"->",
"positionAttribute",
";",
"$",
"orderDir",
"=",
"SORT_DESC",
";",
"... | Move model to up
@param mixed $id ID of the model to be moved up
@return mixed
@throws \yii\web\NotFoundHttpException | [
"Move",
"model",
"to",
"up"
] | cda8ce1b8996157e08df949fcc83e314e25621f1 | https://github.com/roboapp/crud/blob/cda8ce1b8996157e08df949fcc83e314e25621f1/src/Move.php#L80-L99 |
9,324 | dlabas/DlcDoctrine | src/DlcDoctrine/Event/CommitTransactionListener.php | CommitTransactionListener.onFinish | public function onFinish(MvcEvent $event)
{
$connection = $this->getObjectManager()->getConnection();
if ($connection->isTransactionActive()) {
$connection->commit();
}
} | php | public function onFinish(MvcEvent $event)
{
$connection = $this->getObjectManager()->getConnection();
if ($connection->isTransactionActive()) {
$connection->commit();
}
} | [
"public",
"function",
"onFinish",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
"->",
"getConnection",
"(",
")",
";",
"if",
"(",
"$",
"connection",
"->",
"isTransactionActive",
"(",
")",
... | Listen to the "finish" event and attempt to commit a transaction
@param MvcEvent $e | [
"Listen",
"to",
"the",
"finish",
"event",
"and",
"attempt",
"to",
"commit",
"a",
"transaction"
] | 1e754c208197e9aa7a9d58efcc726e109aaa6edf | https://github.com/dlabas/DlcDoctrine/blob/1e754c208197e9aa7a9d58efcc726e109aaa6edf/src/DlcDoctrine/Event/CommitTransactionListener.php#L28-L35 |
9,325 | neontabs-drupal8/nt8property | src/Form/NT8PropertyFormBase.php | NT8PropertyFormBase.setupAreaLocTaxonomy | public function setupAreaLocTaxonomy(array &$form, FormStateInterface $formState) {
$limit_arealocs = $formState->getValue('attribute_code_limit') ?: NULL;
$new_arr = [];
if (isset($limit_arealocs)) {
$new_arr = array_map(
'trim',
explode(',', $limit_arealocs)
) ?: [];
}
... | php | public function setupAreaLocTaxonomy(array &$form, FormStateInterface $formState) {
$limit_arealocs = $formState->getValue('attribute_code_limit') ?: NULL;
$new_arr = [];
if (isset($limit_arealocs)) {
$new_arr = array_map(
'trim',
explode(',', $limit_arealocs)
) ?: [];
}
... | [
"public",
"function",
"setupAreaLocTaxonomy",
"(",
"array",
"&",
"$",
"form",
",",
"FormStateInterface",
"$",
"formState",
")",
"{",
"$",
"limit_arealocs",
"=",
"$",
"formState",
"->",
"getValue",
"(",
"'attribute_code_limit'",
")",
"?",
":",
"NULL",
";",
"$",... | Runs the necessary methods in the property service to setup the taxonomy.
@see ::createAreaLocTermsFromTabs | [
"Runs",
"the",
"necessary",
"methods",
"in",
"the",
"property",
"service",
"to",
"setup",
"the",
"taxonomy",
"."
] | 53b630a612c6dc7c90a8ca1ce4ceb41568473447 | https://github.com/neontabs-drupal8/nt8property/blob/53b630a612c6dc7c90a8ca1ce4ceb41568473447/src/Form/NT8PropertyFormBase.php#L233-L249 |
9,326 | neontabs-drupal8/nt8property | src/Form/NT8PropertyFormBase.php | NT8PropertyFormBase.loadPropertyBatchAll | public function loadPropertyBatchAll(array &$form, FormStateInterface $formState) {
$batch_size = $formState->getValue('batch_size') ?: 6;
$modify_replace = $formState->getValue('modify_replace_batch') ?: 0;
NT8PropertyBatch::propertyBatchLoad($batch_size, $modify_replace);
} | php | public function loadPropertyBatchAll(array &$form, FormStateInterface $formState) {
$batch_size = $formState->getValue('batch_size') ?: 6;
$modify_replace = $formState->getValue('modify_replace_batch') ?: 0;
NT8PropertyBatch::propertyBatchLoad($batch_size, $modify_replace);
} | [
"public",
"function",
"loadPropertyBatchAll",
"(",
"array",
"&",
"$",
"form",
",",
"FormStateInterface",
"$",
"formState",
")",
"{",
"$",
"batch_size",
"=",
"$",
"formState",
"->",
"getValue",
"(",
"'batch_size'",
")",
"?",
":",
"6",
";",
"$",
"modify_replac... | Initiates a batch method to load all properties. | [
"Initiates",
"a",
"batch",
"method",
"to",
"load",
"all",
"properties",
"."
] | 53b630a612c6dc7c90a8ca1ce4ceb41568473447 | https://github.com/neontabs-drupal8/nt8property/blob/53b630a612c6dc7c90a8ca1ce4ceb41568473447/src/Form/NT8PropertyFormBase.php#L304-L309 |
9,327 | acantepie/CoreBundle | Services/UmbrellaFileUploader.php | UmbrellaFileUploader.createUmbrellaFile | public function createUmbrellaFile(UploadedFile $file, $upload = false)
{
$umbrellaFile = new UmbrellaFile();
$umbrellaFile->name = $file->getClientOriginalName();
$umbrellaFile->md5 = md5_file($file->getRealPath());
$umbrellaFile->mimeType = $file->getMimeType();
$umbrellaFi... | php | public function createUmbrellaFile(UploadedFile $file, $upload = false)
{
$umbrellaFile = new UmbrellaFile();
$umbrellaFile->name = $file->getClientOriginalName();
$umbrellaFile->md5 = md5_file($file->getRealPath());
$umbrellaFile->mimeType = $file->getMimeType();
$umbrellaFi... | [
"public",
"function",
"createUmbrellaFile",
"(",
"UploadedFile",
"$",
"file",
",",
"$",
"upload",
"=",
"false",
")",
"{",
"$",
"umbrellaFile",
"=",
"new",
"UmbrellaFile",
"(",
")",
";",
"$",
"umbrellaFile",
"->",
"name",
"=",
"$",
"file",
"->",
"getClientO... | Create Umbrella file from UploadedFile
If upload set to true => process upload else upload will be processed on postPersist
@param UploadedFile $file
@param bool $upload
@return UmbrellaFile | [
"Create",
"Umbrella",
"file",
"from",
"UploadedFile",
"If",
"upload",
"set",
"to",
"true",
"=",
">",
"process",
"upload",
"else",
"upload",
"will",
"be",
"processed",
"on",
"postPersist"
] | e9f19194b105bfcc10c34ff0763e45436d719782 | https://github.com/acantepie/CoreBundle/blob/e9f19194b105bfcc10c34ff0763e45436d719782/Services/UmbrellaFileUploader.php#L89-L103 |
9,328 | niconoe-/asserts | src/Asserts/Categories/AssertObjectTrait.php | AssertObjectTrait.assertObjectIsA | public static function assertObjectIsA($object, string $type, Throwable $exception)
{
static::makeAssertion(\is_a($object, $type), $exception);
return $object;
} | php | public static function assertObjectIsA($object, string $type, Throwable $exception)
{
static::makeAssertion(\is_a($object, $type), $exception);
return $object;
} | [
"public",
"static",
"function",
"assertObjectIsA",
"(",
"$",
"object",
",",
"string",
"$",
"type",
",",
"Throwable",
"$",
"exception",
")",
"{",
"static",
"::",
"makeAssertion",
"(",
"\\",
"is_a",
"(",
"$",
"object",
",",
"$",
"type",
")",
",",
"$",
"e... | Asserts that the given object is an instance of the given type.
@param mixed $object The given object to test.
@param string $type The expected type of the given object.
@param Throwable $exception The exception to throw if the assertion fails.
@return mixed The given object tested. | [
"Asserts",
"that",
"the",
"given",
"object",
"is",
"an",
"instance",
"of",
"the",
"given",
"type",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertObjectTrait.php#L27-L31 |
9,329 | niconoe-/asserts | src/Asserts/Categories/AssertObjectTrait.php | AssertObjectTrait.assertPropertiesInCascade | public static function assertPropertiesInCascade($object, Throwable $exception, string ...$propertiesInCascade)
{
foreach ($propertiesInCascade as $property) {
static::makeAssertion(\property_exists($object, $property), $exception);
$object = $object->{$property};
}
r... | php | public static function assertPropertiesInCascade($object, Throwable $exception, string ...$propertiesInCascade)
{
foreach ($propertiesInCascade as $property) {
static::makeAssertion(\property_exists($object, $property), $exception);
$object = $object->{$property};
}
r... | [
"public",
"static",
"function",
"assertPropertiesInCascade",
"(",
"$",
"object",
",",
"Throwable",
"$",
"exception",
",",
"string",
"...",
"$",
"propertiesInCascade",
")",
"{",
"foreach",
"(",
"$",
"propertiesInCascade",
"as",
"$",
"property",
")",
"{",
"static"... | Asserts that a list of properties exist in cascade from an original object.
@param mixed $object The original object to check properties in cascade.
@param Throwable $exception The exception to throw if the assertion fails.
@param string ...$propertiesInCascade The list of properties to check in cascade.
@return mixed... | [
"Asserts",
"that",
"a",
"list",
"of",
"properties",
"exist",
"in",
"cascade",
"from",
"an",
"original",
"object",
"."
] | a33dd3fb8983ae6965533c8ff4ff8380367b561d | https://github.com/niconoe-/asserts/blob/a33dd3fb8983ae6965533c8ff4ff8380367b561d/src/Asserts/Categories/AssertObjectTrait.php#L41-L48 |
9,330 | jmpantoja/planb-utils | src/Type/Assurance/Exception/AssertException.php | AssertException.parseParams | private static function parseParams(array $arguments): string
{
if (0 === count($arguments)) {
return '';
}
$arguments = array_map(function ($argument) {
return beautify_parse('<argument:argument>', [
'argument' => sprintf('"%s"', $argument),
... | php | private static function parseParams(array $arguments): string
{
if (0 === count($arguments)) {
return '';
}
$arguments = array_map(function ($argument) {
return beautify_parse('<argument:argument>', [
'argument' => sprintf('"%s"', $argument),
... | [
"private",
"static",
"function",
"parseParams",
"(",
"array",
"$",
"arguments",
")",
":",
"string",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"arguments",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"arguments",
"=",
"array_map",
"(",
"function"... | Convierte los argumentos en una cadena de texto
@param mixed[] $arguments
@return string | [
"Convierte",
"los",
"argumentos",
"en",
"una",
"cadena",
"de",
"texto"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Type/Assurance/Exception/AssertException.php#L72-L87 |
9,331 | potfur/statemachine | src/StateMachine/PayloadEnvelope.php | PayloadEnvelope.changeState | public function changeState($name)
{
$this->state = $name;
$this->history[] = $name;
$this->hasChanged = true;
} | php | public function changeState($name)
{
$this->state = $name;
$this->history[] = $name;
$this->hasChanged = true;
} | [
"public",
"function",
"changeState",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"state",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"history",
"[",
"]",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"hasChanged",
"=",
"true",
";",
"}"
] | Set new state to subject
@param string $name state name | [
"Set",
"new",
"state",
"to",
"subject"
] | 6b68535e6c94b10bf618a7809a48f6a8f6d30deb | https://github.com/potfur/statemachine/blob/6b68535e6c94b10bf618a7809a48f6a8f6d30deb/src/StateMachine/PayloadEnvelope.php#L93-L98 |
9,332 | digit-soft/re-action-promise | src/PromiseWithSD.php | PromiseWithSD.always | public function always(callable $onFulfilledOrRejected)
{
return $this->then(function ($value) use ($onFulfilledOrRejected) {
return resolve($onFulfilledOrRejected($this->sharedData))->then(function () use ($value) {
return $value;
});
}, function ($reason) us... | php | public function always(callable $onFulfilledOrRejected)
{
return $this->then(function ($value) use ($onFulfilledOrRejected) {
return resolve($onFulfilledOrRejected($this->sharedData))->then(function () use ($value) {
return $value;
});
}, function ($reason) us... | [
"public",
"function",
"always",
"(",
"callable",
"$",
"onFulfilledOrRejected",
")",
"{",
"return",
"$",
"this",
"->",
"then",
"(",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"onFulfilledOrRejected",
")",
"{",
"return",
"resolve",
"(",
"$",
"onFul... | Always callable after resolving or rejecting
@param callable $onFulfilledOrRejected
@return ExtendedPromiseInterface | [
"Always",
"callable",
"after",
"resolving",
"or",
"rejecting"
] | 9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1 | https://github.com/digit-soft/re-action-promise/blob/9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1/src/PromiseWithSD.php#L84-L95 |
9,333 | digit-soft/re-action-promise | src/PromiseWithSD.php | PromiseWithSD.resolver | protected function resolver(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
{
return function ($resolve, $reject, $notify) use ($onFulfilled, $onRejected, $onProgress) {
if ($onProgress) {
$progressHandler = function ($update) use ($notify,... | php | protected function resolver(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
{
return function ($resolve, $reject, $notify) use ($onFulfilled, $onRejected, $onProgress) {
if ($onProgress) {
$progressHandler = function ($update) use ($notify,... | [
"protected",
"function",
"resolver",
"(",
"callable",
"$",
"onFulfilled",
"=",
"null",
",",
"callable",
"$",
"onRejected",
"=",
"null",
",",
"callable",
"$",
"onProgress",
"=",
"null",
")",
"{",
"return",
"function",
"(",
"$",
"resolve",
",",
"$",
"reject"... | Promise resolver callback generator
@param callable|null $onFulfilled
@param callable|null $onRejected
@param callable|null $onProgress
@return \Closure | [
"Promise",
"resolver",
"callback",
"generator"
] | 9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1 | https://github.com/digit-soft/re-action-promise/blob/9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1/src/PromiseWithSD.php#L104-L127 |
9,334 | digit-soft/re-action-promise | src/PromiseWithSD.php | PromiseWithSD.resolveFunction | protected static function resolveFunction(self &$target)
{
return function ($value = null) use (&$target) {
if ($target !== null) {
$target->settle(resolve($value, $target->sharedData));
$target = null;
}
};
} | php | protected static function resolveFunction(self &$target)
{
return function ($value = null) use (&$target) {
if ($target !== null) {
$target->settle(resolve($value, $target->sharedData));
$target = null;
}
};
} | [
"protected",
"static",
"function",
"resolveFunction",
"(",
"self",
"&",
"$",
"target",
")",
"{",
"return",
"function",
"(",
"$",
"value",
"=",
"null",
")",
"use",
"(",
"&",
"$",
"target",
")",
"{",
"if",
"(",
"$",
"target",
"!==",
"null",
")",
"{",
... | Creates a static resolver callback that is not bound to a promise instance.
Moving the closure creation to a static method allows us to create a
callback that is not bound to a promise instance. By passing the target
promise instance by reference, we can still execute its resolving logic
and still clear this reference... | [
"Creates",
"a",
"static",
"resolver",
"callback",
"that",
"is",
"not",
"bound",
"to",
"a",
"promise",
"instance",
"."
] | 9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1 | https://github.com/digit-soft/re-action-promise/blob/9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1/src/PromiseWithSD.php#L231-L239 |
9,335 | jmpantoja/planb-utils | src/DS/Resolver/Rule/AbstractRule.php | AbstractRule.execute | public function execute(Input $input): Input
{
if (!$input->isEvaluableForTypes(...$this->types)) {
return $input;
}
return $this->resolve($input);
} | php | public function execute(Input $input): Input
{
if (!$input->isEvaluableForTypes(...$this->types)) {
return $input;
}
return $this->resolve($input);
} | [
"public",
"function",
"execute",
"(",
"Input",
"$",
"input",
")",
":",
"Input",
"{",
"if",
"(",
"!",
"$",
"input",
"->",
"isEvaluableForTypes",
"(",
"...",
"$",
"this",
"->",
"types",
")",
")",
"{",
"return",
"$",
"input",
";",
"}",
"return",
"$",
... | Manipula un input
@param \PlanB\DS\Resolver\Input $input
@return \PlanB\DS\Resolver\Input
@throws \Throwable | [
"Manipula",
"un",
"input"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/DS/Resolver/Rule/AbstractRule.php#L69-L77 |
9,336 | blenderdeluxe/khipu | src/KhipuService/KhipuServiceCreateEmail.php | KhipuServiceCreateEmail.addRecipient | public function addRecipient($name, $email, $amount) {
$this->recipients->addRecipient($name, $email, $amount);
return $this;
} | php | public function addRecipient($name, $email, $amount) {
$this->recipients->addRecipient($name, $email, $amount);
return $this;
} | [
"public",
"function",
"addRecipient",
"(",
"$",
"name",
",",
"$",
"email",
",",
"$",
"amount",
")",
"{",
"$",
"this",
"->",
"recipients",
"->",
"addRecipient",
"(",
"$",
"name",
",",
"$",
"email",
",",
"$",
"amount",
")",
";",
"return",
"$",
"this",
... | Este metodo se encarga de adjuntar un destinatario al objeto.
@param string $name
Nombre del pagador.
@param string $email
Correo electrónico del pagador.
@param int $amount
Monto que pagará el pagador. | [
"Este",
"metodo",
"se",
"encarga",
"de",
"adjuntar",
"un",
"destinatario",
"al",
"objeto",
"."
] | ef78fa8ba372c7784936ce95a3d0bd46a35e0143 | https://github.com/blenderdeluxe/khipu/blob/ef78fa8ba372c7784936ce95a3d0bd46a35e0143/src/KhipuService/KhipuServiceCreateEmail.php#L70-L73 |
9,337 | synapsestudios/synapse-base | src/Synapse/CliCommand/AbstractCliCommand.php | AbstractCliCommand.run | public function run(CliCommandOptions $options = null)
{
$options = $this->getOptions($options);
$command = $this->buildCommand($options);
$startTime = microtime(true);
$response = $this->executor->execute(
$command,
$options->getCwd(),
$optio... | php | public function run(CliCommandOptions $options = null)
{
$options = $this->getOptions($options);
$command = $this->buildCommand($options);
$startTime = microtime(true);
$response = $this->executor->execute(
$command,
$options->getCwd(),
$optio... | [
"public",
"function",
"run",
"(",
"CliCommandOptions",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"getOptions",
"(",
"$",
"options",
")",
";",
"$",
"command",
"=",
"$",
"this",
"->",
"buildCommand",
"(",
"$",
"option... | Executes a cli command
@param CliCommandOptions $options object of `cwd`, `env`, and `redirect`
@return CliCommandResponse object with output and comand information | [
"Executes",
"a",
"cli",
"command"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/CliCommand/AbstractCliCommand.php#L46-L70 |
9,338 | osflab/container | ZendContainer.php | ZendContainer.getDbConfig | protected static function getDbConfig()
{
static $config = null;
if (!$config) {
$config = Container::getConfig()->getConfig('db');
if (!is_array($config)) {
throw new ArchException('Key db must be declared in application configuration');
... | php | protected static function getDbConfig()
{
static $config = null;
if (!$config) {
$config = Container::getConfig()->getConfig('db');
if (!is_array($config)) {
throw new ArchException('Key db must be declared in application configuration');
... | [
"protected",
"static",
"function",
"getDbConfig",
"(",
")",
"{",
"static",
"$",
"config",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"config",
")",
"{",
"$",
"config",
"=",
"Container",
"::",
"getConfig",
"(",
")",
"->",
"getConfig",
"(",
"'db'",
")",
";... | Configuration de la db dans la configuration de l'application
@return array
@throws ArchException | [
"Configuration",
"de",
"la",
"db",
"dans",
"la",
"configuration",
"de",
"l",
"application"
] | 415b374260ad377df00f8b3683b99f08bb4d25b6 | https://github.com/osflab/container/blob/415b374260ad377df00f8b3683b99f08bb4d25b6/ZendContainer.php#L51-L62 |
9,339 | phpservicebus/core | src/Transport/RabbitMq/RabbitMqQueueCreator.php | RabbitMqQueueCreator.createIfNecessary | public function createIfNecessary(QueueBindings $queueBindings)
{
$addresses = array_merge($queueBindings->getReceivingAddresses(), $queueBindings->getSendingAddresses());
foreach ($addresses as $address) {
$this->routingTopology->setupForEndpointUse($this->brokerModel, $address);
... | php | public function createIfNecessary(QueueBindings $queueBindings)
{
$addresses = array_merge($queueBindings->getReceivingAddresses(), $queueBindings->getSendingAddresses());
foreach ($addresses as $address) {
$this->routingTopology->setupForEndpointUse($this->brokerModel, $address);
... | [
"public",
"function",
"createIfNecessary",
"(",
"QueueBindings",
"$",
"queueBindings",
")",
"{",
"$",
"addresses",
"=",
"array_merge",
"(",
"$",
"queueBindings",
"->",
"getReceivingAddresses",
"(",
")",
",",
"$",
"queueBindings",
"->",
"getSendingAddresses",
"(",
... | Creates message queues for the defined queue bindings.
@param QueueBindings $queueBindings | [
"Creates",
"message",
"queues",
"for",
"the",
"defined",
"queue",
"bindings",
"."
] | adbcf94be1e022120ede0c5aafa8a4f7900b0a6c | https://github.com/phpservicebus/core/blob/adbcf94be1e022120ede0c5aafa8a4f7900b0a6c/src/Transport/RabbitMq/RabbitMqQueueCreator.php#L42-L48 |
9,340 | ddliu/requery | src/Context.php | Context.extract | public function extract($parts = null) {
if ($this->isEmpty()) {
return false;
}
if ($parts === null) {
return $this->content;
}
if (is_array($parts)) {
$result = array();
foreach ($parts as $key) {
if (isset($this... | php | public function extract($parts = null) {
if ($this->isEmpty()) {
return false;
}
if ($parts === null) {
return $this->content;
}
if (is_array($parts)) {
$result = array();
foreach ($parts as $key) {
if (isset($this... | [
"public",
"function",
"extract",
"(",
"$",
"parts",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"parts",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
... | Extract result parts of current query.
@param mixed $parts
@return mixed | [
"Extract",
"result",
"parts",
"of",
"current",
"query",
"."
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/Context.php#L47-L68 |
9,341 | ddliu/requery | src/Context.php | Context.find | public function find($re, $filter = null) {
if ($this->isEmpty()) {
return self::getEmptyContext();
}
$result = null;
if ($filter) {
$this->findAll($re)->each(function($context) use ($filter, &$result) {
if ($filter($context)) {
... | php | public function find($re, $filter = null) {
if ($this->isEmpty()) {
return self::getEmptyContext();
}
$result = null;
if ($filter) {
$this->findAll($re)->each(function($context) use ($filter, &$result) {
if ($filter($context)) {
... | [
"public",
"function",
"find",
"(",
"$",
"re",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"self",
"::",
"getEmptyContext",
"(",
")",
";",
"}",
"$",
"result",
"=",
"null",
";",
... | Find with regexp in current context
@param string $re
@param callable $filter
@return Context | [
"Find",
"with",
"regexp",
"in",
"current",
"context"
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/Context.php#L76-L99 |
9,342 | ddliu/requery | src/Context.php | Context.findAll | public function findAll($re, $filter = null) {
if ($this->isEmpty()) {
return self::getEmptyContext();
}
if (!preg_match_all($re, $this->toString(), $matches, PREG_SET_ORDER)) {
$matches = array();
}
$result = array();
foreach ($matches as $match... | php | public function findAll($re, $filter = null) {
if ($this->isEmpty()) {
return self::getEmptyContext();
}
if (!preg_match_all($re, $this->toString(), $matches, PREG_SET_ORDER)) {
$matches = array();
}
$result = array();
foreach ($matches as $match... | [
"public",
"function",
"findAll",
"(",
"$",
"re",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
")",
")",
"{",
"return",
"self",
"::",
"getEmptyContext",
"(",
")",
";",
"}",
"if",
"(",
"!",
"preg_match_all"... | Find all matching data in the context.
@param string $re
@param callbale $filter
@return ContextCollection | [
"Find",
"all",
"matching",
"data",
"in",
"the",
"context",
"."
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/Context.php#L123-L141 |
9,343 | Webiny/BackupService | src/Webiny/BackupService/Lib/Cleanup.php | Cleanup.addToQueue | public static function addToQueue($path, $type)
{
if ($type != self::TYPE_DIR && $type != self::TYPE_FILE) {
throw new \Exception(sprintf('Invalid $type parameter "%s"', $type));
}
self::$cleanupQueue[] = ['path' => $path, 'type' => $type];
} | php | public static function addToQueue($path, $type)
{
if ($type != self::TYPE_DIR && $type != self::TYPE_FILE) {
throw new \Exception(sprintf('Invalid $type parameter "%s"', $type));
}
self::$cleanupQueue[] = ['path' => $path, 'type' => $type];
} | [
"public",
"static",
"function",
"addToQueue",
"(",
"$",
"path",
",",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"!=",
"self",
"::",
"TYPE_DIR",
"&&",
"$",
"type",
"!=",
"self",
"::",
"TYPE_FILE",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
... | Add a file or a folder to the cleanup queue.
@param string $path Path that should be removed.
@param string $type Is it a file or a directory.
@throws \Exception | [
"Add",
"a",
"file",
"or",
"a",
"folder",
"to",
"the",
"cleanup",
"queue",
"."
] | 9728ddaa67e5703ac7898a6f69a0ad14ac37a256 | https://github.com/Webiny/BackupService/blob/9728ddaa67e5703ac7898a6f69a0ad14ac37a256/src/Webiny/BackupService/Lib/Cleanup.php#L53-L60 |
9,344 | Webiny/BackupService | src/Webiny/BackupService/Lib/Cleanup.php | Cleanup.doCleanup | public static function doCleanup()
{
Service::$log->msg('Cleanup started');
foreach (self::$cleanupQueue as $cq) {
Service::$log->msg(sprintf('Removing %s %s', $cq['type'], $cq['path']));
if (strpos($cq['path'], self::$tempFolder) !== 0) {
throw new \Exceptio... | php | public static function doCleanup()
{
Service::$log->msg('Cleanup started');
foreach (self::$cleanupQueue as $cq) {
Service::$log->msg(sprintf('Removing %s %s', $cq['type'], $cq['path']));
if (strpos($cq['path'], self::$tempFolder) !== 0) {
throw new \Exceptio... | [
"public",
"static",
"function",
"doCleanup",
"(",
")",
"{",
"Service",
"::",
"$",
"log",
"->",
"msg",
"(",
"'Cleanup started'",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"cleanupQueue",
"as",
"$",
"cq",
")",
"{",
"Service",
"::",
"$",
"log",
"->",
... | Method that does the actual cleanup.
@throws \Exception | [
"Method",
"that",
"does",
"the",
"actual",
"cleanup",
"."
] | 9728ddaa67e5703ac7898a6f69a0ad14ac37a256 | https://github.com/Webiny/BackupService/blob/9728ddaa67e5703ac7898a6f69a0ad14ac37a256/src/Webiny/BackupService/Lib/Cleanup.php#L67-L88 |
9,345 | monolyth-php/formulaic | src/Element/Group.php | Group.setIdPrefix | public function setIdPrefix(string $prefix = null)
{
foreach ((array)$this as $element) {
if (is_object($element)) {
$element->setIdPrefix($prefix);
}
}
} | php | public function setIdPrefix(string $prefix = null)
{
foreach ((array)$this as $element) {
if (is_object($element)) {
$element->setIdPrefix($prefix);
}
}
} | [
"public",
"function",
"setIdPrefix",
"(",
"string",
"$",
"prefix",
"=",
"null",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"element",
")",
")",
"{",
"$",
"element",
"-... | Sets the ID prefix for this group. The ID prefix is optionally prefixed
to all generated IDs to resolve ambiguity.
@param string $prefix The prefix. Set to `null` to remove. | [
"Sets",
"the",
"ID",
"prefix",
"for",
"this",
"group",
".",
"The",
"ID",
"prefix",
"is",
"optionally",
"prefixed",
"to",
"all",
"generated",
"IDs",
"to",
"resolve",
"ambiguity",
"."
] | 4bf7853a0c29cc17957f1b26c79f633867742c14 | https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Element/Group.php#L71-L78 |
9,346 | monolyth-php/formulaic | src/Element/Group.php | Group.valueSuppliedByUser | public function valueSuppliedByUser(bool $status = null) : bool
{
$is = false;
foreach ((array)$this as $field) {
if (is_string($field)) {
continue;
}
if (isset($status)) {
$field->getElement()->valueSuppliedByUser($status);
... | php | public function valueSuppliedByUser(bool $status = null) : bool
{
$is = false;
foreach ((array)$this as $field) {
if (is_string($field)) {
continue;
}
if (isset($status)) {
$field->getElement()->valueSuppliedByUser($status);
... | [
"public",
"function",
"valueSuppliedByUser",
"(",
"bool",
"$",
"status",
"=",
"null",
")",
":",
"bool",
"{",
"$",
"is",
"=",
"false",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"is_string",
"(",
"$... | Mark the entire group as set by the user.
@param bool $status Optional setter. Omit if you just want to query the
current status.
@return bool | [
"Mark",
"the",
"entire",
"group",
"as",
"set",
"by",
"the",
"user",
"."
] | 4bf7853a0c29cc17957f1b26c79f633867742c14 | https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Element/Group.php#L185-L200 |
9,347 | Dhii/data-state-abstract | src/TransitionerAwareTrait.php | TransitionerAwareTrait._setTransitioner | protected function _setTransitioner($transitioner)
{
if ($transitioner !== null && !($transitioner instanceof TransitionerInterface)) {
throw $this->_createInvalidArgumentException(
$this->__('Argument is not a valid booking transitioner'),
null,
n... | php | protected function _setTransitioner($transitioner)
{
if ($transitioner !== null && !($transitioner instanceof TransitionerInterface)) {
throw $this->_createInvalidArgumentException(
$this->__('Argument is not a valid booking transitioner'),
null,
n... | [
"protected",
"function",
"_setTransitioner",
"(",
"$",
"transitioner",
")",
"{",
"if",
"(",
"$",
"transitioner",
"!==",
"null",
"&&",
"!",
"(",
"$",
"transitioner",
"instanceof",
"TransitionerInterface",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInval... | Sets the booking transitioner for this instance.
@since [*next-version*]
@param TransitionerInterface|null $transitioner The transitioner or null.
@throws InvalidArgumentException If the argument is not valid. | [
"Sets",
"the",
"booking",
"transitioner",
"for",
"this",
"instance",
"."
] | c335c37a939861659e657b995cfc657bb3bb2733 | https://github.com/Dhii/data-state-abstract/blob/c335c37a939861659e657b995cfc657bb3bb2733/src/TransitionerAwareTrait.php#L46-L58 |
9,348 | phramework/util | src/File.php | File.directoryToArray | public static function directoryToArray(
string $directory,
bool $recursive = false,
bool $listDirs = false,
bool $listFiles = true,
string $exclude = '',
array $allowedFileTypes = [],
bool $relativePath = false
) : array {
$arrayItems = [];
$s... | php | public static function directoryToArray(
string $directory,
bool $recursive = false,
bool $listDirs = false,
bool $listFiles = true,
string $exclude = '',
array $allowedFileTypes = [],
bool $relativePath = false
) : array {
$arrayItems = [];
$s... | [
"public",
"static",
"function",
"directoryToArray",
"(",
"string",
"$",
"directory",
",",
"bool",
"$",
"recursive",
"=",
"false",
",",
"bool",
"$",
"listDirs",
"=",
"false",
",",
"bool",
"$",
"listFiles",
"=",
"true",
",",
"string",
"$",
"exclude",
"=",
... | Get an array that represents directory tree
@param string $directory Directory path
@param boolean $recursive *[Optional]* Include sub directories
@param boolean $listDirs *[Optional]* Include directories on listing
@param boolean $listFiles *[Optional]* Include files on listing
@param string $exclud... | [
"Get",
"an",
"array",
"that",
"represents",
"directory",
"tree"
] | 09202b9962a9a07e2a31b0c9eff90ece1d6bd3ca | https://github.com/phramework/util/blob/09202b9962a9a07e2a31b0c9eff90ece1d6bd3ca/src/File.php#L91-L156 |
9,349 | phPoirot/PathUri | UriSequence.php | UriSequence.isAbsolute | function isAbsolute()
{
$p = $this->getPath();
reset($p);
$fi = current($p);
return $this->_isRoot($fi);
} | php | function isAbsolute()
{
$p = $this->getPath();
reset($p);
$fi = current($p);
return $this->_isRoot($fi);
} | [
"function",
"isAbsolute",
"(",
")",
"{",
"$",
"p",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"reset",
"(",
"$",
"p",
")",
";",
"$",
"fi",
"=",
"current",
"(",
"$",
"p",
")",
";",
"return",
"$",
"this",
"->",
"_isRoot",
"(",
"$",
"fi",... | Is Absolute Path?
@return boolean | [
"Is",
"Absolute",
"Path?"
] | 1f765e77b5aca20f6440d3e27a8df60ed888c09e | https://github.com/phPoirot/PathUri/blob/1f765e77b5aca20f6440d3e27a8df60ed888c09e/UriSequence.php#L92-L99 |
9,350 | phPoirot/PathUri | UriSequence.php | UriSequence.joint | function joint(iUriSequence $pathUri)
{
$muchLength = $this->getPath();
$less = $pathUri->getPath();
if ( count($less) > count($muchLength) ) {
$muchLength = $less;
$less = $this->getPath();
}
$similar = array(); // empty path
foreach($... | php | function joint(iUriSequence $pathUri)
{
$muchLength = $this->getPath();
$less = $pathUri->getPath();
if ( count($less) > count($muchLength) ) {
$muchLength = $less;
$less = $this->getPath();
}
$similar = array(); // empty path
foreach($... | [
"function",
"joint",
"(",
"iUriSequence",
"$",
"pathUri",
")",
"{",
"$",
"muchLength",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"$",
"less",
"=",
"$",
"pathUri",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"less",
")",
... | Joint Given PathUri with Current Path
/var/www/html <=> /var/www/ ===> /var/www
@param iUriSequence $pathUri
@return iUriSequence | [
"Joint",
"Given",
"PathUri",
"with",
"Current",
"Path"
] | 1f765e77b5aca20f6440d3e27a8df60ed888c09e | https://github.com/phPoirot/PathUri/blob/1f765e77b5aca20f6440d3e27a8df60ed888c09e/UriSequence.php#L190-L211 |
9,351 | phPoirot/PathUri | UriSequence.php | UriSequence.mask | function mask(iUriSequence $pathUri, $toggle = true)
{
# the absolute path when another is not is always masked on
#- /foo <=> bar ---> /foo
if (
## one is absolute and another is not
($this->isAbsolute() || $pathUri->isAbsolute())
&& !($this->isAbsolute()... | php | function mask(iUriSequence $pathUri, $toggle = true)
{
# the absolute path when another is not is always masked on
#- /foo <=> bar ---> /foo
if (
## one is absolute and another is not
($this->isAbsolute() || $pathUri->isAbsolute())
&& !($this->isAbsolute()... | [
"function",
"mask",
"(",
"iUriSequence",
"$",
"pathUri",
",",
"$",
"toggle",
"=",
"true",
")",
"{",
"# the absolute path when another is not is always masked on",
"#- /foo <=> bar ---> /foo",
"if",
"(",
"## one is absolute and another is not",
"(",
"$",
"this",
"->",
"isA... | Mask Given PathUri with Current Path
toggle:
/var/www/html <=> /var/www/ ===> html
/uri <=> contact ===> /uri
/uri <=> /contact ===> uri
/uri/path <=> /contact ===> uri/path
/uri/ <=> /uri/contact ===> (empty)
/uri/ <=> /uri/contact/ ===> contact/
toggle fals... | [
"Mask",
"Given",
"PathUri",
"with",
"Current",
"Path"
] | 1f765e77b5aca20f6440d3e27a8df60ed888c09e | https://github.com/phPoirot/PathUri/blob/1f765e77b5aca20f6440d3e27a8df60ed888c09e/UriSequence.php#L233-L273 |
9,352 | phPoirot/PathUri | UriSequence.php | UriSequence.normalize | function normalize()
{
$normalized = array();
$paths = $this->getPath();
if (empty($paths))
return $normalized;
// Replace "~" with user's home directory.
if ('~' === $paths[0]) {
$home = explode($this->getSeparator(), str_replace('\\', '/', $t... | php | function normalize()
{
$normalized = array();
$paths = $this->getPath();
if (empty($paths))
return $normalized;
// Replace "~" with user's home directory.
if ('~' === $paths[0]) {
$home = explode($this->getSeparator(), str_replace('\\', '/', $t... | [
"function",
"normalize",
"(",
")",
"{",
"$",
"normalized",
"=",
"array",
"(",
")",
";",
"$",
"paths",
"=",
"$",
"this",
"->",
"getPath",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"paths",
")",
")",
"return",
"$",
"normalized",
";",
"// Replace \... | Normalize Array Path Stored On Class
@return $this | [
"Normalize",
"Array",
"Path",
"Stored",
"On",
"Class"
] | 1f765e77b5aca20f6440d3e27a8df60ed888c09e | https://github.com/phPoirot/PathUri/blob/1f765e77b5aca20f6440d3e27a8df60ed888c09e/UriSequence.php#L356-L403 |
9,353 | webriq/core | module/Customize/src/Grid/Customize/Model/Rule/Mapper.php | Mapper.findBySelector | public function findBySelector( $selector, $media = '', $rootId = null )
{
$where = array(
'selector' => (string) $selector,
'media' => (string) $media,
);
if ( empty( $rootId ) )
{
$where[] = new Predicate\IsNull( 'rootParagraphId' );
... | php | public function findBySelector( $selector, $media = '', $rootId = null )
{
$where = array(
'selector' => (string) $selector,
'media' => (string) $media,
);
if ( empty( $rootId ) )
{
$where[] = new Predicate\IsNull( 'rootParagraphId' );
... | [
"public",
"function",
"findBySelector",
"(",
"$",
"selector",
",",
"$",
"media",
"=",
"''",
",",
"$",
"rootId",
"=",
"null",
")",
"{",
"$",
"where",
"=",
"array",
"(",
"'selector'",
"=>",
"(",
"string",
")",
"$",
"selector",
",",
"'media'",
"=>",
"("... | Find structure by selector & media
@param string $selector
@param string $media [optional]
@param int $rootId [optional]
@return \Customize\Model\Rule\Structure | [
"Find",
"structure",
"by",
"selector",
"&",
"media"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/Rule/Mapper.php#L445-L462 |
9,354 | webriq/core | module/Customize/src/Grid/Customize/Model/Rule/Mapper.php | Mapper.findAllByRoot | public function findAllByRoot( $rootId = null,
$order = null,
$limit = null,
$offset = null )
{
$select = $this->select();
if ( empty( $rootId ) )
{
$where = array(
... | php | public function findAllByRoot( $rootId = null,
$order = null,
$limit = null,
$offset = null )
{
$select = $this->select();
if ( empty( $rootId ) )
{
$where = array(
... | [
"public",
"function",
"findAllByRoot",
"(",
"$",
"rootId",
"=",
"null",
",",
"$",
"order",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"select",
"(",
")",
";",
"if... | Find all structure by rootId
@param null|int $rootId
@param null|array $order
@param null|int $limit
@param null|int $offset
@return \Customize\Model\Rule\Structure[] | [
"Find",
"all",
"structure",
"by",
"rootId"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/Rule/Mapper.php#L473-L511 |
9,355 | webriq/core | module/Customize/src/Grid/Customize/Model/Rule/Mapper.php | Mapper.deleteByRoot | public function deleteByRoot( $rootId = null, array $except = array() )
{
if ( null === $rootId )
{
$where = array( new Predicate\IsNull(
'rootParagraphId'
) );
}
else
{
$where = array(
'rootParagraphId' => (... | php | public function deleteByRoot( $rootId = null, array $except = array() )
{
if ( null === $rootId )
{
$where = array( new Predicate\IsNull(
'rootParagraphId'
) );
}
else
{
$where = array(
'rootParagraphId' => (... | [
"public",
"function",
"deleteByRoot",
"(",
"$",
"rootId",
"=",
"null",
",",
"array",
"$",
"except",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"rootId",
")",
"{",
"$",
"where",
"=",
"array",
"(",
"new",
"Predicate",
"\\",
"IsN... | Delete rules by root-id
@param int|null $rootId
@param int[] $except
@return int | [
"Delete",
"rules",
"by",
"root",
"-",
"id"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/Rule/Mapper.php#L520-L549 |
9,356 | bseries/base_social | models/Instagram.php | Instagram._resolvePaginated | protected static function _resolvePaginated(array $pagination, array $data) {
$client = new Client();
// `pagination` key is an empty array if there are no more pages.
if (!$pagination) {
Logger::debug("Instagram-API finished resolving pagination.");
return $data;
}
Logger::debug("Instagram-API retriev... | php | protected static function _resolvePaginated(array $pagination, array $data) {
$client = new Client();
// `pagination` key is an empty array if there are no more pages.
if (!$pagination) {
Logger::debug("Instagram-API finished resolving pagination.");
return $data;
}
Logger::debug("Instagram-API retriev... | [
"protected",
"static",
"function",
"_resolvePaginated",
"(",
"array",
"$",
"pagination",
",",
"array",
"$",
"data",
")",
"{",
"$",
"client",
"=",
"new",
"Client",
"(",
")",
";",
"// `pagination` key is an empty array if there are no more pages.",
"if",
"(",
"!",
"... | Will never cache first page, but cache all subsequent pages. | [
"Will",
"never",
"cache",
"first",
"page",
"but",
"cache",
"all",
"subsequent",
"pages",
"."
] | a5c4859b0efc9285e7a1fb8a4ff8b59ce01660c0 | https://github.com/bseries/base_social/blob/a5c4859b0efc9285e7a1fb8a4ff8b59ce01660c0/models/Instagram.php#L72-L88 |
9,357 | zhengkai/tango | lib/Drive/DB.php | DB.genAI | public function genAI($sTable) {
$sTable = '`' . addslashes($sTable) . '`';
$sQuery = 'INSERT INTO ' . $sTable . ' () VALUES ()';
$iID = $this->getInsertID($sQuery);
if ($iID && ($iID % 1000 == 0)) {
$sQuery = 'DELETE FROM ' . $sTable;
$this->exec($sQuery);
}
return $iID;
} | php | public function genAI($sTable) {
$sTable = '`' . addslashes($sTable) . '`';
$sQuery = 'INSERT INTO ' . $sTable . ' () VALUES ()';
$iID = $this->getInsertID($sQuery);
if ($iID && ($iID % 1000 == 0)) {
$sQuery = 'DELETE FROM ' . $sTable;
$this->exec($sQuery);
}
return $iID;
} | [
"public",
"function",
"genAI",
"(",
"$",
"sTable",
")",
"{",
"$",
"sTable",
"=",
"'`'",
".",
"addslashes",
"(",
"$",
"sTable",
")",
".",
"'`'",
";",
"$",
"sQuery",
"=",
"'INSERT INTO '",
".",
"$",
"sTable",
".",
"' () VALUES ()'",
";",
"$",
"iID",
"=... | auto increment id generator
@param string $sTable
@access public
@return integer
CREATE TABLE IF NOT EXISTS `id_gen` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=binary AUTO_INCREMENT=1; | [
"auto",
"increment",
"id",
"generator"
] | 2d42c42acd9042f9a3cd902eb4427710fa46c35b | https://github.com/zhengkai/tango/blob/2d42c42acd9042f9a3cd902eb4427710fa46c35b/lib/Drive/DB.php#L428-L437 |
9,358 | ob-ivan/sd-dependency-injection | src/Container.php | Container.getRecursive | private function getRecursive(string $name) {
if ($name === self::SELF_NAME) {
return $this;
}
if (!isset($this->services[$name])) {
if (in_array($name, $this->usedNames)) {
throw new Exception("Cyclic dependency found while resolving $name");
... | php | private function getRecursive(string $name) {
if ($name === self::SELF_NAME) {
return $this;
}
if (!isset($this->services[$name])) {
if (in_array($name, $this->usedNames)) {
throw new Exception("Cyclic dependency found while resolving $name");
... | [
"private",
"function",
"getRecursive",
"(",
"string",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"self",
"::",
"SELF_NAME",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"services",
"[",
"$",... | Return an initialized service.
@param $name string
@return mixed | [
"Return",
"an",
"initialized",
"service",
"."
] | 279e652ec583a0a11dda359c6f11586b3297a4bd | https://github.com/ob-ivan/sd-dependency-injection/blob/279e652ec583a0a11dda359c6f11586b3297a4bd/src/Container.php#L148-L163 |
9,359 | rinvex/obsolete-attributable | src/Traits/Attributable.php | Attributable.bootAttributable | public static function bootAttributable()
{
$models = array_merge([static::class], array_values(class_parents(static::class)));
$attributes = DB::table(config('rinvex.attributable.tables.attribute_entity'))->whereIn('entity_type', $models)->get()->pluck('attribute_id');
static::$entityAttrib... | php | public static function bootAttributable()
{
$models = array_merge([static::class], array_values(class_parents(static::class)));
$attributes = DB::table(config('rinvex.attributable.tables.attribute_entity'))->whereIn('entity_type', $models)->get()->pluck('attribute_id');
static::$entityAttrib... | [
"public",
"static",
"function",
"bootAttributable",
"(",
")",
"{",
"$",
"models",
"=",
"array_merge",
"(",
"[",
"static",
"::",
"class",
"]",
",",
"array_values",
"(",
"class_parents",
"(",
"static",
"::",
"class",
")",
")",
")",
";",
"$",
"attributes",
... | Boot the attributable trait for a model.
@return void | [
"Boot",
"the",
"attributable",
"trait",
"for",
"a",
"model",
"."
] | 23fa78efda9c24e2e1579917967537a3b3b9e4ce | https://github.com/rinvex/obsolete-attributable/blob/23fa78efda9c24e2e1579917967537a3b3b9e4ce/src/Traits/Attributable.php#L57-L67 |
9,360 | rinvex/obsolete-attributable | src/Traits/Attributable.php | Attributable.setEntityAttribute | public function setEntityAttribute(string $key, $value)
{
$current = $this->getEntityAttributeRelation($key);
$attribute = $this->getEntityAttributes()->get($key);
// $current will always contain a collection when an attribute is multivalued
// as morphMany provides collections even... | php | public function setEntityAttribute(string $key, $value)
{
$current = $this->getEntityAttributeRelation($key);
$attribute = $this->getEntityAttributes()->get($key);
// $current will always contain a collection when an attribute is multivalued
// as morphMany provides collections even... | [
"public",
"function",
"setEntityAttribute",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"getEntityAttributeRelation",
"(",
"$",
"key",
")",
";",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getEntityAttribu... | Set the entity attribute.
@param string $key
@param mixed $value
@return mixed | [
"Set",
"the",
"entity",
"attribute",
"."
] | 23fa78efda9c24e2e1579917967537a3b3b9e4ce | https://github.com/rinvex/obsolete-attributable/blob/23fa78efda9c24e2e1579917967537a3b3b9e4ce/src/Traits/Attributable.php#L324-L356 |
9,361 | thecodingmachine/html.utils.weblibrarymanager | src/WebLibraryManager.php | WebLibraryManager.toHtml | public function toHtml()
{
/*if ($this->rendered) {
throw new WebLibraryException("The library has already been rendered.");
}*/
echo $this->getCssHtml();
echo $this->getJsHtml();
echo $this->getAdditionalHtml();
$this->rendered = true;
} | php | public function toHtml()
{
/*if ($this->rendered) {
throw new WebLibraryException("The library has already been rendered.");
}*/
echo $this->getCssHtml();
echo $this->getJsHtml();
echo $this->getAdditionalHtml();
$this->rendered = true;
} | [
"public",
"function",
"toHtml",
"(",
")",
"{",
"/*if ($this->rendered) {\n throw new WebLibraryException(\"The library has already been rendered.\");\n }*/",
"echo",
"$",
"this",
"->",
"getCssHtml",
"(",
")",
";",
"echo",
"$",
"this",
"->",
"getJsHtml",
"(",... | Renders the HTML in charge of loading CSS and JS files.
The Html is echoed directly into the output.
This function should be called within the head tag. | [
"Renders",
"the",
"HTML",
"in",
"charge",
"of",
"loading",
"CSS",
"and",
"JS",
"files",
".",
"The",
"Html",
"is",
"echoed",
"directly",
"into",
"the",
"output",
".",
"This",
"function",
"should",
"be",
"called",
"within",
"the",
"head",
"tag",
"."
] | e1e5e06d7221a4e77196798ca8bdc3908025eb51 | https://github.com/thecodingmachine/html.utils.weblibrarymanager/blob/e1e5e06d7221a4e77196798ca8bdc3908025eb51/src/WebLibraryManager.php#L99-L110 |
9,362 | thecodingmachine/html.utils.weblibrarymanager | src/WebLibraryManager.php | WebLibraryManager.addAdditionalScript | public function addAdditionalScript($additionalScript): void
{
if (!$additionalScript instanceof HtmlElementInterface) {
$additionalScript = new HtmlString($additionalScript);
}
$this->webLibraries[] = new InlineWebLibrary(null, null, $additionalScript);
} | php | public function addAdditionalScript($additionalScript): void
{
if (!$additionalScript instanceof HtmlElementInterface) {
$additionalScript = new HtmlString($additionalScript);
}
$this->webLibraries[] = new InlineWebLibrary(null, null, $additionalScript);
} | [
"public",
"function",
"addAdditionalScript",
"(",
"$",
"additionalScript",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"additionalScript",
"instanceof",
"HtmlElementInterface",
")",
"{",
"$",
"additionalScript",
"=",
"new",
"HtmlString",
"(",
"$",
"additionalScrip... | Adds an additional script at the end of the <head> tag.
The provided script can either be a string or an object implementing HtmlElementInterface.
@param string|HtmlElementInterface $additionalScript | [
"Adds",
"an",
"additional",
"script",
"at",
"the",
"end",
"of",
"the",
"<",
";",
"head>",
";",
"tag",
".",
"The",
"provided",
"script",
"can",
"either",
"be",
"a",
"string",
"or",
"an",
"object",
"implementing",
"HtmlElementInterface",
"."
] | e1e5e06d7221a4e77196798ca8bdc3908025eb51 | https://github.com/thecodingmachine/html.utils.weblibrarymanager/blob/e1e5e06d7221a4e77196798ca8bdc3908025eb51/src/WebLibraryManager.php#L142-L148 |
9,363 | PowerOnSystem/HelperService | src/BlockHelper.php | BlockHelper.humaniceTrace | public function humaniceTrace(array $trace) {
/* @var $html_helper HtmlHelper */
$html_helper = $this->html;
$list = [];
foreach ($trace as $id_trace => $e) {
$class = explode('\\', key_exists('class', $e) ? $e['class'] : '');
$type = key_exists('type', $e) ... | php | public function humaniceTrace(array $trace) {
/* @var $html_helper HtmlHelper */
$html_helper = $this->html;
$list = [];
foreach ($trace as $id_trace => $e) {
$class = explode('\\', key_exists('class', $e) ? $e['class'] : '');
$type = key_exists('type', $e) ... | [
"public",
"function",
"humaniceTrace",
"(",
"array",
"$",
"trace",
")",
"{",
"/* @var $html_helper HtmlHelper */",
"$",
"html_helper",
"=",
"$",
"this",
"->",
"html",
";",
"$",
"list",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"trace",
"as",
"$",
"id_trace"... | Obtiene el trace de legible de una excepcion
@param array $trace
@return string | [
"Obtiene",
"el",
"trace",
"de",
"legible",
"de",
"una",
"excepcion"
] | 6d300764d7b3a090dd674b25415ce5088156ce8b | https://github.com/PowerOnSystem/HelperService/blob/6d300764d7b3a090dd674b25415ce5088156ce8b/src/BlockHelper.php#L35-L69 |
9,364 | znframework/package-crontab | Job.php | Job.listArray | public function listArray() : Array
{
if( ! is_file($this->crontabCommands) )
{
return [];
}
return Arrays\RemoveElement::element(explode(EOL, file_get_contents($this->crontabCommands)), '');
} | php | public function listArray() : Array
{
if( ! is_file($this->crontabCommands) )
{
return [];
}
return Arrays\RemoveElement::element(explode(EOL, file_get_contents($this->crontabCommands)), '');
} | [
"public",
"function",
"listArray",
"(",
")",
":",
"Array",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"this",
"->",
"crontabCommands",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"Arrays",
"\\",
"RemoveElement",
"::",
"element",
"(",
"explode... | Gets crontab list array
@return array | [
"Gets",
"crontab",
"list",
"array"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L195-L203 |
9,365 | znframework/package-crontab | Job.php | Job.list | public function list() : String
{
$list = '';
if( is_file($this->crontabCommands) )
{
$jobs = $this->listArray();
$list = '<pre>';
$list .= '[ID] CRON JOB<br><br>';
foreach( $jobs as $key => $job )
{
$list .= '['... | php | public function list() : String
{
$list = '';
if( is_file($this->crontabCommands) )
{
$jobs = $this->listArray();
$list = '<pre>';
$list .= '[ID] CRON JOB<br><br>';
foreach( $jobs as $key => $job )
{
$list .= '['... | [
"public",
"function",
"list",
"(",
")",
":",
"String",
"{",
"$",
"list",
"=",
"''",
";",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"crontabCommands",
")",
")",
"{",
"$",
"jobs",
"=",
"$",
"this",
"->",
"listArray",
"(",
")",
";",
"$",
"list",... | Gets crontab list
@return string | [
"Gets",
"crontab",
"list"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L210-L229 |
9,366 | znframework/package-crontab | Job.php | Job.remove | public function remove($key = NULL)
{
$this->executeRemoveCommand();
if( $key === NULL )
{
unlink($this->crontabCommands);
}
else
{
$this->removeJobFromExecFile($key);
$this->executeCommand();
}
} | php | public function remove($key = NULL)
{
$this->executeRemoveCommand();
if( $key === NULL )
{
unlink($this->crontabCommands);
}
else
{
$this->removeJobFromExecFile($key);
$this->executeCommand();
}
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"executeRemoveCommand",
"(",
")",
";",
"if",
"(",
"$",
"key",
"===",
"NULL",
")",
"{",
"unlink",
"(",
"$",
"this",
"->",
"crontabCommands",
")",
";",
"}",
"e... | Remove cron job
@param string $key = NULL | [
"Remove",
"cron",
"job"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L246-L260 |
9,367 | znframework/package-crontab | Job.php | Job.createCrontabDirectoryIfNotExists | protected function createCrontabDirectoryIfNotExists()
{
if( ! is_dir($crontabDirectory = pathinfo($this->crontabCommands, PATHINFO_DIRNAME)) )
{
Filesystem::createFolder($crontabDirectory);
}
} | php | protected function createCrontabDirectoryIfNotExists()
{
if( ! is_dir($crontabDirectory = pathinfo($this->crontabCommands, PATHINFO_DIRNAME)) )
{
Filesystem::createFolder($crontabDirectory);
}
} | [
"protected",
"function",
"createCrontabDirectoryIfNotExists",
"(",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"crontabDirectory",
"=",
"pathinfo",
"(",
"$",
"this",
"->",
"crontabCommands",
",",
"PATHINFO_DIRNAME",
")",
")",
")",
"{",
"Filesystem",
"::",
"c... | Protected create crontab directory if not exists | [
"Protected",
"create",
"crontab",
"directory",
"if",
"not",
"exists"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L351-L357 |
9,368 | znframework/package-crontab | Job.php | Job.createExecFileIfNotExists | protected function createExecFileIfNotExists()
{
if( ! is_file($this->crontabCommands) )
{
Filesystem\Forge::create($this->crontabCommands);
$this->processor->exec('chmod 0777 ' . $this->crontabCommands);
}
} | php | protected function createExecFileIfNotExists()
{
if( ! is_file($this->crontabCommands) )
{
Filesystem\Forge::create($this->crontabCommands);
$this->processor->exec('chmod 0777 ' . $this->crontabCommands);
}
} | [
"protected",
"function",
"createExecFileIfNotExists",
"(",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"this",
"->",
"crontabCommands",
")",
")",
"{",
"Filesystem",
"\\",
"Forge",
"::",
"create",
"(",
"$",
"this",
"->",
"crontabCommands",
")",
";",
"$",... | Protected create exec file if not exists | [
"Protected",
"create",
"exec",
"file",
"if",
"not",
"exists"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L378-L386 |
9,369 | znframework/package-crontab | Job.php | Job.addJobToExecFile | protected function addJobToExecFile($cmd)
{
$content = file_get_contents($this->crontabCommands);
if( ! stristr($content, $cmd))
{
$content = $content . $this->getValidCommand() . $cmd . EOL;
file_put_contents($this->crontabCommands, $content);
}
} | php | protected function addJobToExecFile($cmd)
{
$content = file_get_contents($this->crontabCommands);
if( ! stristr($content, $cmd))
{
$content = $content . $this->getValidCommand() . $cmd . EOL;
file_put_contents($this->crontabCommands, $content);
}
} | [
"protected",
"function",
"addJobToExecFile",
"(",
"$",
"cmd",
")",
"{",
"$",
"content",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"crontabCommands",
")",
";",
"if",
"(",
"!",
"stristr",
"(",
"$",
"content",
",",
"$",
"cmd",
")",
")",
"{",
"$",
... | Protected add job to exec file | [
"Protected",
"add",
"job",
"to",
"exec",
"file"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L391-L401 |
9,370 | znframework/package-crontab | Job.php | Job.removeJobFromExecFile | protected function removeJobFromExecFile($cmd)
{
$jobs = $this->listArray();
unset($jobs[$cmd]);
file_put_contents($this->crontabCommands, implode(EOL, $jobs) . EOL);
} | php | protected function removeJobFromExecFile($cmd)
{
$jobs = $this->listArray();
unset($jobs[$cmd]);
file_put_contents($this->crontabCommands, implode(EOL, $jobs) . EOL);
} | [
"protected",
"function",
"removeJobFromExecFile",
"(",
"$",
"cmd",
")",
"{",
"$",
"jobs",
"=",
"$",
"this",
"->",
"listArray",
"(",
")",
";",
"unset",
"(",
"$",
"jobs",
"[",
"$",
"cmd",
"]",
")",
";",
"file_put_contents",
"(",
"$",
"this",
"->",
"cro... | Protected remove job from exec file | [
"Protected",
"remove",
"job",
"from",
"exec",
"file"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L406-L413 |
9,371 | znframework/package-crontab | Job.php | Job.getDatetimeFormat | protected function getDatetimeFormat()
{
if( $this->interval !== '* * * * *' )
{
$interval = $this->interval.' ';
}
else
{
$interval = ( $this->minute ?? '*' ) . ' '.
( $this->hour ?? '*' ) . ' '.
... | php | protected function getDatetimeFormat()
{
if( $this->interval !== '* * * * *' )
{
$interval = $this->interval.' ';
}
else
{
$interval = ( $this->minute ?? '*' ) . ' '.
( $this->hour ?? '*' ) . ' '.
... | [
"protected",
"function",
"getDatetimeFormat",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"interval",
"!==",
"'* * * * *'",
")",
"{",
"$",
"interval",
"=",
"$",
"this",
"->",
"interval",
".",
"' '",
";",
"}",
"else",
"{",
"$",
"interval",
"=",
"(",
... | Protected datet time format | [
"Protected",
"datet",
"time",
"format"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L442-L460 |
9,372 | znframework/package-crontab | Job.php | Job.defaultCommandVariables | protected function defaultCommandVariables()
{
$this->type = NULL;
$this->path = NULL;
$this->command = NULL;
$this->debug = false;
} | php | protected function defaultCommandVariables()
{
$this->type = NULL;
$this->path = NULL;
$this->command = NULL;
$this->debug = false;
} | [
"protected",
"function",
"defaultCommandVariables",
"(",
")",
"{",
"$",
"this",
"->",
"type",
"=",
"NULL",
";",
"$",
"this",
"->",
"path",
"=",
"NULL",
";",
"$",
"this",
"->",
"command",
"=",
"NULL",
";",
"$",
"this",
"->",
"debug",
"=",
"false",
";"... | Protected defaul command variables | [
"Protected",
"defaul",
"command",
"variables"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L492-L498 |
9,373 | znframework/package-crontab | Job.php | Job.defaultIntervalVariables | protected function defaultIntervalVariables()
{
$this->interval = '* * * * *';
$this->minute = '*';
$this->hour = '*';
$this->dayNumber = '*';
$this->month = '*';
$this->day = '*';
} | php | protected function defaultIntervalVariables()
{
$this->interval = '* * * * *';
$this->minute = '*';
$this->hour = '*';
$this->dayNumber = '*';
$this->month = '*';
$this->day = '*';
} | [
"protected",
"function",
"defaultIntervalVariables",
"(",
")",
"{",
"$",
"this",
"->",
"interval",
"=",
"'* * * * *'",
";",
"$",
"this",
"->",
"minute",
"=",
"'*'",
";",
"$",
"this",
"->",
"hour",
"=",
"'*'",
";",
"$",
"this",
"->",
"dayNumber",
"=",
"... | Protected default interval variables | [
"Protected",
"default",
"interval",
"variables"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/Job.php#L503-L511 |
9,374 | AnonymPHP/Anonym-Library | src/Anonym/Cron/Task/ConsoleTask.php | ConsoleTask.setCommand | public function setCommand($command, $base = null)
{
$base = ($base === null) ? BASE : $base;
parent::setCommand($this->resolveBase($base).'anonym '.$command);
return $this;
} | php | public function setCommand($command, $base = null)
{
$base = ($base === null) ? BASE : $base;
parent::setCommand($this->resolveBase($base).'anonym '.$command);
return $this;
} | [
"public",
"function",
"setCommand",
"(",
"$",
"command",
",",
"$",
"base",
"=",
"null",
")",
"{",
"$",
"base",
"=",
"(",
"$",
"base",
"===",
"null",
")",
"?",
"BASE",
":",
"$",
"base",
";",
"parent",
"::",
"setCommand",
"(",
"$",
"this",
"->",
"r... | register the command
@param string $command
@param string $base
@return $this | [
"register",
"the",
"command"
] | c967ad804f84e8fb204593a0959cda2fed5ae075 | https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Cron/Task/ConsoleTask.php#L27-L34 |
9,375 | NuclearCMS/Synthesizer | src/Processors/DocumentsProcessor.php | DocumentsProcessor.process | public function process($text, $args = null)
{
$text = $this->processDocuments($text, $args);
$text = $this->processGalleries($text, $args);
return $text;
} | php | public function process($text, $args = null)
{
$text = $this->processDocuments($text, $args);
$text = $this->processGalleries($text, $args);
return $text;
} | [
"public",
"function",
"process",
"(",
"$",
"text",
",",
"$",
"args",
"=",
"null",
")",
"{",
"$",
"text",
"=",
"$",
"this",
"->",
"processDocuments",
"(",
"$",
"text",
",",
"$",
"args",
")",
";",
"$",
"text",
"=",
"$",
"this",
"->",
"processGallerie... | Processes the given text
@param string $text
@param array|null $args
@return string | [
"Processes",
"the",
"given",
"text"
] | 750e24b7ab5d625af5471584108d2fad0443dbca | https://github.com/NuclearCMS/Synthesizer/blob/750e24b7ab5d625af5471584108d2fad0443dbca/src/Processors/DocumentsProcessor.php#L33-L39 |
9,376 | NuclearCMS/Synthesizer | src/Processors/DocumentsProcessor.php | DocumentsProcessor.makeDocuments | protected function makeDocuments(array $matches, array $ids, $documents, $text)
{
foreach ($ids as $key => $id)
{
$document = $documents->find($id);
$parsedDocument = '';
if ( ! is_null($document))
{
$parsedDocument = $document->prese... | php | protected function makeDocuments(array $matches, array $ids, $documents, $text)
{
foreach ($ids as $key => $id)
{
$document = $documents->find($id);
$parsedDocument = '';
if ( ! is_null($document))
{
$parsedDocument = $document->prese... | [
"protected",
"function",
"makeDocuments",
"(",
"array",
"$",
"matches",
",",
"array",
"$",
"ids",
",",
"$",
"documents",
",",
"$",
"text",
")",
"{",
"foreach",
"(",
"$",
"ids",
"as",
"$",
"key",
"=>",
"$",
"id",
")",
"{",
"$",
"document",
"=",
"$",... | Replaces the document tags with presenter renders
@param array $matches
@param array $ids
@param Collection|null $documents
@param string $text
@return string | [
"Replaces",
"the",
"document",
"tags",
"with",
"presenter",
"renders"
] | 750e24b7ab5d625af5471584108d2fad0443dbca | https://github.com/NuclearCMS/Synthesizer/blob/750e24b7ab5d625af5471584108d2fad0443dbca/src/Processors/DocumentsProcessor.php#L90-L107 |
9,377 | NuclearCMS/Synthesizer | src/Processors/DocumentsProcessor.php | DocumentsProcessor.getGalleryMatches | protected function getGalleryMatches($text)
{
preg_match_all('~\[gallery.+ids="(\d+(?:,\d+)*)"\]~', $text, $matches);
list($matches, $gallery) = $matches;
foreach ($gallery as $key => $ids)
{
$gallery[$key] = explode(',', $ids);
}
return [$matches, $gal... | php | protected function getGalleryMatches($text)
{
preg_match_all('~\[gallery.+ids="(\d+(?:,\d+)*)"\]~', $text, $matches);
list($matches, $gallery) = $matches;
foreach ($gallery as $key => $ids)
{
$gallery[$key] = explode(',', $ids);
}
return [$matches, $gal... | [
"protected",
"function",
"getGalleryMatches",
"(",
"$",
"text",
")",
"{",
"preg_match_all",
"(",
"'~\\[gallery.+ids=\"(\\d+(?:,\\d+)*)\"\\]~'",
",",
"$",
"text",
",",
"$",
"matches",
")",
";",
"list",
"(",
"$",
"matches",
",",
"$",
"gallery",
")",
"=",
"$",
... | Finds all media in given string
@param string $text
@return array | [
"Finds",
"all",
"media",
"in",
"given",
"string"
] | 750e24b7ab5d625af5471584108d2fad0443dbca | https://github.com/NuclearCMS/Synthesizer/blob/750e24b7ab5d625af5471584108d2fad0443dbca/src/Processors/DocumentsProcessor.php#L129-L141 |
9,378 | NuclearCMS/Synthesizer | src/Processors/DocumentsProcessor.php | DocumentsProcessor.makeGalleries | protected function makeGalleries(array $matches, array $idSets, $text)
{
foreach ($idSets as $key => $ids)
{
$slides = get_nuclear_gallery($ids);
$gallery = (count($slides)) ? $this->makeGalleryHTML($slides) : '';
$text = str_replace($matches[$key], $gallery, $t... | php | protected function makeGalleries(array $matches, array $idSets, $text)
{
foreach ($idSets as $key => $ids)
{
$slides = get_nuclear_gallery($ids);
$gallery = (count($slides)) ? $this->makeGalleryHTML($slides) : '';
$text = str_replace($matches[$key], $gallery, $t... | [
"protected",
"function",
"makeGalleries",
"(",
"array",
"$",
"matches",
",",
"array",
"$",
"idSets",
",",
"$",
"text",
")",
"{",
"foreach",
"(",
"$",
"idSets",
"as",
"$",
"key",
"=>",
"$",
"ids",
")",
"{",
"$",
"slides",
"=",
"get_nuclear_gallery",
"("... | Replaces the document tags with gallery render
@param array $matches
@param array $idSets
@param string $text
@return string | [
"Replaces",
"the",
"document",
"tags",
"with",
"gallery",
"render"
] | 750e24b7ab5d625af5471584108d2fad0443dbca | https://github.com/NuclearCMS/Synthesizer/blob/750e24b7ab5d625af5471584108d2fad0443dbca/src/Processors/DocumentsProcessor.php#L151-L163 |
9,379 | NuclearCMS/Synthesizer | src/Processors/DocumentsProcessor.php | DocumentsProcessor.makeGalleryHTML | protected function makeGalleryHTML(Collection $slides)
{
if ( ! count($slides))
{
return '';
}
$html = '';
foreach ($slides as $slide)
{
$html .= $this->makeSlideHTML($slide);
}
return $this->wrapSlidesHTML($html);
} | php | protected function makeGalleryHTML(Collection $slides)
{
if ( ! count($slides))
{
return '';
}
$html = '';
foreach ($slides as $slide)
{
$html .= $this->makeSlideHTML($slide);
}
return $this->wrapSlidesHTML($html);
} | [
"protected",
"function",
"makeGalleryHTML",
"(",
"Collection",
"$",
"slides",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"slides",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"html",
"=",
"''",
";",
"foreach",
"(",
"$",
"slides",
"as",
"$",
"sl... | Makes gallery HTML
@param Collection $slides
@return string | [
"Makes",
"gallery",
"HTML"
] | 750e24b7ab5d625af5471584108d2fad0443dbca | https://github.com/NuclearCMS/Synthesizer/blob/750e24b7ab5d625af5471584108d2fad0443dbca/src/Processors/DocumentsProcessor.php#L171-L186 |
9,380 | NuclearCMS/Synthesizer | src/Processors/DocumentsProcessor.php | DocumentsProcessor.makeSlideHTML | protected function makeSlideHTML(Image $image)
{
$translation = $image->translate();
$caption = ($translation) ? $translation->caption : '';
$description = ($translation) ? $translation->description : '';
return '<li class="gallery__item">
<figure data-original="' . $ima... | php | protected function makeSlideHTML(Image $image)
{
$translation = $image->translate();
$caption = ($translation) ? $translation->caption : '';
$description = ($translation) ? $translation->description : '';
return '<li class="gallery__item">
<figure data-original="' . $ima... | [
"protected",
"function",
"makeSlideHTML",
"(",
"Image",
"$",
"image",
")",
"{",
"$",
"translation",
"=",
"$",
"image",
"->",
"translate",
"(",
")",
";",
"$",
"caption",
"=",
"(",
"$",
"translation",
")",
"?",
"$",
"translation",
"->",
"caption",
":",
"... | Makes slide HTML
@param Image $image
@return string | [
"Makes",
"slide",
"HTML"
] | 750e24b7ab5d625af5471584108d2fad0443dbca | https://github.com/NuclearCMS/Synthesizer/blob/750e24b7ab5d625af5471584108d2fad0443dbca/src/Processors/DocumentsProcessor.php#L194-L207 |
9,381 | kore/CTXParser | src/php/CTXParser/Parser.php | Parser.parseString | public function parseString($string)
{
$tokens = new Stack($this->tokenizer->tokenize($string));
if ($tokens[0]->type === Tokenizer::T_EOF) {
return new CTX\AccountInfoList();
}
$ctx = new CTX();
$this->reduceStruct($tokens, $ctx);
return $ctx->accountI... | php | public function parseString($string)
{
$tokens = new Stack($this->tokenizer->tokenize($string));
if ($tokens[0]->type === Tokenizer::T_EOF) {
return new CTX\AccountInfoList();
}
$ctx = new CTX();
$this->reduceStruct($tokens, $ctx);
return $ctx->accountI... | [
"public",
"function",
"parseString",
"(",
"$",
"string",
")",
"{",
"$",
"tokens",
"=",
"new",
"Stack",
"(",
"$",
"this",
"->",
"tokenizer",
"->",
"tokenize",
"(",
"$",
"string",
")",
")",
";",
"if",
"(",
"$",
"tokens",
"[",
"0",
"]",
"->",
"type",
... | Parse the given string
@param string $string
@return AccountInfoList | [
"Parse",
"the",
"given",
"string"
] | 9b11c2311a9de61baee7edafe46d1671dd5833c4 | https://github.com/kore/CTXParser/blob/9b11c2311a9de61baee7edafe46d1671dd5833c4/src/php/CTXParser/Parser.php#L43-L55 |
9,382 | kore/CTXParser | src/php/CTXParser/Parser.php | Parser.read | private function read(array $types, Stack $tokens)
{
$token = $tokens->shift();
if (!in_array($token->type, $types, true)) {
$names = array();
foreach ($types as $type) {
$names[] = $this->tokenizer->getTokenName($type);
}
throw new \... | php | private function read(array $types, Stack $tokens)
{
$token = $tokens->shift();
if (!in_array($token->type, $types, true)) {
$names = array();
foreach ($types as $type) {
$names[] = $this->tokenizer->getTokenName($type);
}
throw new \... | [
"private",
"function",
"read",
"(",
"array",
"$",
"types",
",",
"Stack",
"$",
"tokens",
")",
"{",
"$",
"token",
"=",
"$",
"tokens",
"->",
"shift",
"(",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"token",
"->",
"type",
",",
"$",
"types",
",",... | Read expected from token array
Try to read the given token from the token array. If another token is
found, a parse error is issued. If the token is found, the token is
removed fromt he token array and returned.
@param array $types
@param Token[] $tokens
@return Token | [
"Read",
"expected",
"from",
"token",
"array"
] | 9b11c2311a9de61baee7edafe46d1671dd5833c4 | https://github.com/kore/CTXParser/blob/9b11c2311a9de61baee7edafe46d1671dd5833c4/src/php/CTXParser/Parser.php#L68-L86 |
9,383 | kore/CTXParser | src/php/CTXParser/Parser.php | Parser.reduceArrayValue | protected function reduceArrayValue(Stack $tokens, Struct $parent)
{
$token = $this->read(array(Tokenizer::T_ARRAY_VALUE), $tokens);
$name = $token->match['name'];
$parent->$name = array_map(
function ($value) use ($token) {
return $this->getValue($token, $value)... | php | protected function reduceArrayValue(Stack $tokens, Struct $parent)
{
$token = $this->read(array(Tokenizer::T_ARRAY_VALUE), $tokens);
$name = $token->match['name'];
$parent->$name = array_map(
function ($value) use ($token) {
return $this->getValue($token, $value)... | [
"protected",
"function",
"reduceArrayValue",
"(",
"Stack",
"$",
"tokens",
",",
"Struct",
"$",
"parent",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"read",
"(",
"array",
"(",
"Tokenizer",
"::",
"T_ARRAY_VALUE",
")",
",",
"$",
"tokens",
")",
";",
"$... | Reduce array value
@param Stack $tokens
@param Struct $parent
@return void | [
"Reduce",
"array",
"value"
] | 9b11c2311a9de61baee7edafe46d1671dd5833c4 | https://github.com/kore/CTXParser/blob/9b11c2311a9de61baee7edafe46d1671dd5833c4/src/php/CTXParser/Parser.php#L149-L160 |
9,384 | kore/CTXParser | src/php/CTXParser/Parser.php | Parser.getValue | protected function getValue(Token $token, $value = null)
{
$value = $value ?: $token->match['value'];
$type = $token->match['type'];
switch (true) {
case $type === 'int':
return (int) $value;
case $type === 'char' &&
preg_match('(^(?... | php | protected function getValue(Token $token, $value = null)
{
$value = $value ?: $token->match['value'];
$type = $token->match['type'];
switch (true) {
case $type === 'int':
return (int) $value;
case $type === 'char' &&
preg_match('(^(?... | [
"protected",
"function",
"getValue",
"(",
"Token",
"$",
"token",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"value",
"?",
":",
"$",
"token",
"->",
"match",
"[",
"'value'",
"]",
";",
"$",
"type",
"=",
"$",
"token",
"->",
"ma... | Convert token value type
@param Token $token
@param string $value
@return mixed | [
"Convert",
"token",
"value",
"type"
] | 9b11c2311a9de61baee7edafe46d1671dd5833c4 | https://github.com/kore/CTXParser/blob/9b11c2311a9de61baee7edafe46d1671dd5833c4/src/php/CTXParser/Parser.php#L169-L187 |
9,385 | mszewcz/php-light-framework | src/Validator/Specific/Password.php | Password.validateLetter | private function validateLetter(): bool
{
if ($this->options['require-letter'] === true) {
if (!\preg_match('/[a-z]/iu', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_LETTER);
return false;
}
}
ret... | php | private function validateLetter(): bool
{
if ($this->options['require-letter'] === true) {
if (!\preg_match('/[a-z]/iu', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_LETTER);
return false;
}
}
ret... | [
"private",
"function",
"validateLetter",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'require-letter'",
"]",
"===",
"true",
")",
"{",
"if",
"(",
"!",
"\\",
"preg_match",
"(",
"'/[a-z]/iu'",
",",
"(",
"string",
")",
"$",
... | Validates that password contains a letter
@return bool | [
"Validates",
"that",
"password",
"contains",
"a",
"letter"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Validator/Specific/Password.php#L76-L85 |
9,386 | mszewcz/php-light-framework | src/Validator/Specific/Password.php | Password.validateLowercaseLetter | private function validateLowercaseLetter(): bool
{
if ($this->options['require-lowercase-letter'] === true) {
if (!\preg_match('/[a-z]/u', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_LOWERCASE_LETTER);
return false;
... | php | private function validateLowercaseLetter(): bool
{
if ($this->options['require-lowercase-letter'] === true) {
if (!\preg_match('/[a-z]/u', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_LOWERCASE_LETTER);
return false;
... | [
"private",
"function",
"validateLowercaseLetter",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'require-lowercase-letter'",
"]",
"===",
"true",
")",
"{",
"if",
"(",
"!",
"\\",
"preg_match",
"(",
"'/[a-z]/u'",
",",
"(",
"string... | Validates that password contains a lowercase letter
@return bool | [
"Validates",
"that",
"password",
"contains",
"a",
"lowercase",
"letter"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Validator/Specific/Password.php#L92-L101 |
9,387 | mszewcz/php-light-framework | src/Validator/Specific/Password.php | Password.validateUppercaseLetter | private function validateUppercaseLetter(): bool
{
if ($this->options['require-uppercase-letter'] === true) {
if (!\preg_match('/[A-Z]/u', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_UPPERCASE_LETTER);
return false;
... | php | private function validateUppercaseLetter(): bool
{
if ($this->options['require-uppercase-letter'] === true) {
if (!\preg_match('/[A-Z]/u', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_UPPERCASE_LETTER);
return false;
... | [
"private",
"function",
"validateUppercaseLetter",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'require-uppercase-letter'",
"]",
"===",
"true",
")",
"{",
"if",
"(",
"!",
"\\",
"preg_match",
"(",
"'/[A-Z]/u'",
",",
"(",
"string... | Validates that password contains an uppercase letter
@return bool | [
"Validates",
"that",
"password",
"contains",
"an",
"uppercase",
"letter"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Validator/Specific/Password.php#L108-L117 |
9,388 | mszewcz/php-light-framework | src/Validator/Specific/Password.php | Password.validateNumber | private function validateNumber(): bool
{
if ($this->options['require-number'] === true) {
if (!\preg_match('/[0-9]/', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_NUMBER);
return false;
}
}
retur... | php | private function validateNumber(): bool
{
if ($this->options['require-number'] === true) {
if (!\preg_match('/[0-9]/', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_NUMBER);
return false;
}
}
retur... | [
"private",
"function",
"validateNumber",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'require-number'",
"]",
"===",
"true",
")",
"{",
"if",
"(",
"!",
"\\",
"preg_match",
"(",
"'/[0-9]/'",
",",
"(",
"string",
")",
"$",
"... | Validates that password contains a number
@return bool | [
"Validates",
"that",
"password",
"contains",
"a",
"number"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Validator/Specific/Password.php#L124-L133 |
9,389 | mszewcz/php-light-framework | src/Validator/Specific/Password.php | Password.validateSpecialCharacter | private function validateSpecialCharacter(): bool
{
if ($this->options['require-special-character'] === true) {
if (!\preg_match('/'.$this->options['special-character-pattern'].'/', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_SPECIAL_CHARA... | php | private function validateSpecialCharacter(): bool
{
if ($this->options['require-special-character'] === true) {
if (!\preg_match('/'.$this->options['special-character-pattern'].'/', (string)$this->value)) {
$this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_SPECIAL_CHARA... | [
"private",
"function",
"validateSpecialCharacter",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'require-special-character'",
"]",
"===",
"true",
")",
"{",
"if",
"(",
"!",
"\\",
"preg_match",
"(",
"'/'",
".",
"$",
"this",
"-... | Validates that password contains a special character
@return bool | [
"Validates",
"that",
"password",
"contains",
"a",
"special",
"character"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Validator/Specific/Password.php#L140-L149 |
9,390 | mszewcz/php-light-framework | src/Validator/Specific/Password.php | Password.validateDifferentPreviousOne | private function validateDifferentPreviousOne(): bool
{
if ($this->options['require-different-than-previous-one'] === true) {
if (isset($this->options['stored-passwords'][0])) {
$passwordHash = (string)$this->value;
if (PasswordEnctyption::compare($passwordHash, $... | php | private function validateDifferentPreviousOne(): bool
{
if ($this->options['require-different-than-previous-one'] === true) {
if (isset($this->options['stored-passwords'][0])) {
$passwordHash = (string)$this->value;
if (PasswordEnctyption::compare($passwordHash, $... | [
"private",
"function",
"validateDifferentPreviousOne",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'require-different-than-previous-one'",
"]",
"===",
"true",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"options",
"["... | Validates that password is different than previous one
@return bool | [
"Validates",
"that",
"password",
"is",
"different",
"than",
"previous",
"one"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Validator/Specific/Password.php#L156-L168 |
9,391 | mszewcz/php-light-framework | src/Validator/Specific/Password.php | Password.validateDifferentPreviousAll | private function validateDifferentPreviousAll(): bool
{
if ($this->options['require-different-than-previous-all'] === true) {
$passwordHash = (string)$this->value;
foreach ($this->options['stored-passwords'] as $storedPassword) {
if (PasswordEnctyption::compare($passw... | php | private function validateDifferentPreviousAll(): bool
{
if ($this->options['require-different-than-previous-all'] === true) {
$passwordHash = (string)$this->value;
foreach ($this->options['stored-passwords'] as $storedPassword) {
if (PasswordEnctyption::compare($passw... | [
"private",
"function",
"validateDifferentPreviousAll",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'require-different-than-previous-all'",
"]",
"===",
"true",
")",
"{",
"$",
"passwordHash",
"=",
"(",
"string",
")",
"$",
"this",
... | Validates that password is different than all previous passwords
@return bool | [
"Validates",
"that",
"password",
"is",
"different",
"than",
"all",
"previous",
"passwords"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Validator/Specific/Password.php#L175-L187 |
9,392 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.getLastElement | public static function getLastElement(array &$inputArray, $removeElement=false)
{
if (count($inputArray) > 0)
{
if (!$removeElement)
{
$element = end($inputArray);
}
else
{
$element = array_pop($inputArray);
... | php | public static function getLastElement(array &$inputArray, $removeElement=false)
{
if (count($inputArray) > 0)
{
if (!$removeElement)
{
$element = end($inputArray);
}
else
{
$element = array_pop($inputArray);
... | [
"public",
"static",
"function",
"getLastElement",
"(",
"array",
"&",
"$",
"inputArray",
",",
"$",
"removeElement",
"=",
"false",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"inputArray",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"removeElement",
")",
... | Fetches the last element of an array
@param array &$inputArray - the array we want the last element of.
@param bool removeElement - override to true if you also want to remove that element
@return $element - the last element of the array. | [
"Fetches",
"the",
"last",
"element",
"of",
"an",
"array"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L57-L76 |
9,393 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.getLastIndex | public static function getLastIndex(array &$inputArray, $removeElement=false)
{
$arrayIndexes = array_keys($inputArray);
return self::getLastElement($arrayIndexes, $removeElement);
} | php | public static function getLastIndex(array &$inputArray, $removeElement=false)
{
$arrayIndexes = array_keys($inputArray);
return self::getLastElement($arrayIndexes, $removeElement);
} | [
"public",
"static",
"function",
"getLastIndex",
"(",
"array",
"&",
"$",
"inputArray",
",",
"$",
"removeElement",
"=",
"false",
")",
"{",
"$",
"arrayIndexes",
"=",
"array_keys",
"(",
"$",
"inputArray",
")",
";",
"return",
"self",
"::",
"getLastElement",
"(",
... | Returns the last index in the provided array
@param array $inputArray - the array we want the last index of
@param bool $removeElement - override to true if you want to also remove the element
@return mixed | [
"Returns",
"the",
"last",
"index",
"in",
"the",
"provided",
"array"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L85-L89 |
9,394 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.removeIndexes | public static function removeIndexes(array $inputArray,
array $indexes,
$reIndex=false)
{
if ($reIndex)
{
# Was going to use array_filter here but realized user may want
# 'false' val... | php | public static function removeIndexes(array $inputArray,
array $indexes,
$reIndex=false)
{
if ($reIndex)
{
# Was going to use array_filter here but realized user may want
# 'false' val... | [
"public",
"static",
"function",
"removeIndexes",
"(",
"array",
"$",
"inputArray",
",",
"array",
"$",
"indexes",
",",
"$",
"reIndex",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"reIndex",
")",
"{",
"# Was going to use array_filter here but realized user may want ",
"#... | Removes the specified indexes from the input array before returning it.
@param array $inputArray - the array we are manipulating
@param array $indexes - array list of indexes whose elements we wish to
remove
@param bool $reIndex - override to true if your array needs re-indexing
(e.g. 0,1,2,3)
@return array $outputAr... | [
"Removes",
"the",
"specified",
"indexes",
"from",
"the",
"input",
"array",
"before",
"returning",
"it",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L103-L135 |
9,395 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.mysqliWrapValues | public static function mysqliWrapValues($inputArray)
{
foreach ($inputArray as &$value)
{
if ($value !== null)
{
$value = "'" . $value . "'";
}
else
{
$value = "NULL";
}
}
... | php | public static function mysqliWrapValues($inputArray)
{
foreach ($inputArray as &$value)
{
if ($value !== null)
{
$value = "'" . $value . "'";
}
else
{
$value = "NULL";
}
}
... | [
"public",
"static",
"function",
"mysqliWrapValues",
"(",
"$",
"inputArray",
")",
"{",
"foreach",
"(",
"$",
"inputArray",
"as",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"!==",
"null",
")",
"{",
"$",
"value",
"=",
"\"'\"",
".",
"$",
"value... | Wrap all of values in an array for insertion into a database. This is a
specific variation of the wrap_elements method that will correctly
convert null values into a NULL string without quotes so that nulls get
inserted into the database correctly.
@param $inputArray - array we are going to create our wrapped array fro... | [
"Wrap",
"all",
"of",
"values",
"in",
"an",
"array",
"for",
"insertion",
"into",
"a",
"database",
".",
"This",
"is",
"a",
"specific",
"variation",
"of",
"the",
"wrap_elements",
"method",
"that",
"will",
"correctly",
"convert",
"null",
"values",
"into",
"a",
... | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L164-L179 |
9,396 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.fastDiff | public static function fastDiff($array1, $array2)
{
$missingValues = array();
$flippedArray2 = array_flip($array2); # swaps indexes and values
foreach ($array1 as $value)
{
if (!isset($flippedArray2[$value]))
{
$missingValues[] = $valu... | php | public static function fastDiff($array1, $array2)
{
$missingValues = array();
$flippedArray2 = array_flip($array2); # swaps indexes and values
foreach ($array1 as $value)
{
if (!isset($flippedArray2[$value]))
{
$missingValues[] = $valu... | [
"public",
"static",
"function",
"fastDiff",
"(",
"$",
"array1",
",",
"$",
"array2",
")",
"{",
"$",
"missingValues",
"=",
"array",
"(",
")",
";",
"$",
"flippedArray2",
"=",
"array_flip",
"(",
"$",
"array2",
")",
";",
"# swaps indexes and values",
"foreach",
... | Faster version of array_diff that relies on not needing to keep indexes
of the missing values
Compares values, but returns the indexes
@param array $array1 - array to compare
@param array $array2 - array to compare
@return array - values in array1 but not array2 | [
"Faster",
"version",
"of",
"array_diff",
"that",
"relies",
"on",
"not",
"needing",
"to",
"keep",
"indexes",
"of",
"the",
"missing",
"values",
"Compares",
"values",
"but",
"returns",
"the",
"indexes"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L190-L204 |
9,397 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.fastIntersect | public static function fastIntersect($array1, $array2)
{
$sharedValues = array();
$flippedArray2 = array_flip($array2); # swaps indexes and values
foreach ($array1 as $value)
{
if (isset($flippedArray2[$value]))
{
$sharedValues[] = $va... | php | public static function fastIntersect($array1, $array2)
{
$sharedValues = array();
$flippedArray2 = array_flip($array2); # swaps indexes and values
foreach ($array1 as $value)
{
if (isset($flippedArray2[$value]))
{
$sharedValues[] = $va... | [
"public",
"static",
"function",
"fastIntersect",
"(",
"$",
"array1",
",",
"$",
"array2",
")",
"{",
"$",
"sharedValues",
"=",
"array",
"(",
")",
";",
"$",
"flippedArray2",
"=",
"array_flip",
"(",
"$",
"array2",
")",
";",
"# swaps indexes and values",
"foreach... | Returns all the values that are in array1 and array2.
Relies on the values being integers or strings
Will only return a value once, even if it appears multiple times in the
array.
Does not maintain indexes.
@param array $array1 - array of integers or strings to compare
@param array $array2 - array of integers or string... | [
"Returns",
"all",
"the",
"values",
"that",
"are",
"in",
"array1",
"and",
"array2",
".",
"Relies",
"on",
"the",
"values",
"being",
"integers",
"or",
"strings",
"Will",
"only",
"return",
"a",
"value",
"once",
"even",
"if",
"it",
"appears",
"multiple",
"times... | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L217-L231 |
9,398 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.indexDiff | public static function indexDiff(array $array1, array $array2)
{
$indexes = array();
$flippedArray2 = array_flip($array2); # swaps indexes and values
foreach ($array1 as $index => $value)
{
if (!isset($flippedArray2[$value]))
{
$indexe... | php | public static function indexDiff(array $array1, array $array2)
{
$indexes = array();
$flippedArray2 = array_flip($array2); # swaps indexes and values
foreach ($array1 as $index => $value)
{
if (!isset($flippedArray2[$value]))
{
$indexe... | [
"public",
"static",
"function",
"indexDiff",
"(",
"array",
"$",
"array1",
",",
"array",
"$",
"array2",
")",
"{",
"$",
"indexes",
"=",
"array",
"(",
")",
";",
"$",
"flippedArray2",
"=",
"array_flip",
"(",
"$",
"array2",
")",
";",
"# swaps indexes and values... | Same as array_diff except that this returns the indexes of the values
that are in array1 but not array2.
WARNING - this is NOT comparing the indexes themselves.
@param array $array1
@param array $array2
@return array - array of indexes in array1 where the values are not in
array2 | [
"Same",
"as",
"array_diff",
"except",
"that",
"this",
"returns",
"the",
"indexes",
"of",
"the",
"values",
"that",
"are",
"in",
"array1",
"but",
"not",
"array2",
".",
"WARNING",
"-",
"this",
"is",
"NOT",
"comparing",
"the",
"indexes",
"themselves",
"."
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L304-L318 |
9,399 | iRAP-software/package-core-libs | src/ArrayLib.php | ArrayLib.stripEmptyElements | public static function stripEmptyElements($inputArray)
{
$outputArray = array_filter($inputArray);
if (!self::isAssoc($inputArray))
{
$outputArray = array_values($outputArray);
}
return $outputArray;
} | php | public static function stripEmptyElements($inputArray)
{
$outputArray = array_filter($inputArray);
if (!self::isAssoc($inputArray))
{
$outputArray = array_values($outputArray);
}
return $outputArray;
} | [
"public",
"static",
"function",
"stripEmptyElements",
"(",
"$",
"inputArray",
")",
"{",
"$",
"outputArray",
"=",
"array_filter",
"(",
"$",
"inputArray",
")",
";",
"if",
"(",
"!",
"self",
"::",
"isAssoc",
"(",
"$",
"inputArray",
")",
")",
"{",
"$",
"outpu... | Remove empty elements from the provided array.
If the input array is not assosciative, then it will be re-indexed. 0,1,2,3 etc
@param array $inputArray - the array to perform actions upon. | [
"Remove",
"empty",
"elements",
"from",
"the",
"provided",
"array",
".",
"If",
"the",
"input",
"array",
"is",
"not",
"assosciative",
"then",
"it",
"will",
"be",
"re",
"-",
"indexed",
".",
"0",
"1",
"2",
"3",
"etc"
] | 244871d2fbc2f3fac26ff4b98715224953d9befb | https://github.com/iRAP-software/package-core-libs/blob/244871d2fbc2f3fac26ff4b98715224953d9befb/src/ArrayLib.php#L326-L336 |
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.