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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21,800 | PHPPowertools/HTML5 | src/PowerTools/HTML5/Parser/Tokenizer.php | HTML5_Parser_Tokenizer.parseError | protected function parseError($msg) {
$args = func_get_args();
if (count($args) > 1) {
array_shift($args);
$msg = vsprintf($msg, $args);
}
$line = $this->scanner->currentLine();
$col = $this->scanner->columnOffset();
$this->events->parseError($ms... | php | protected function parseError($msg) {
$args = func_get_args();
if (count($args) > 1) {
array_shift($args);
$msg = vsprintf($msg, $args);
}
$line = $this->scanner->currentLine();
$col = $this->scanner->columnOffset();
$this->events->parseError($ms... | [
"protected",
"function",
"parseError",
"(",
"$",
"msg",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
">",
"1",
")",
"{",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"msg",
"=",
"vsprin... | Emit a parse error.
A parse error always returns false because it never consumes any
characters. | [
"Emit",
"a",
"parse",
"error",
"."
] | 4ea8caf5b2618a82ca5061dcbb7421b31065c1c7 | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L1013-L1025 |
21,801 | PHPPowertools/HTML5 | src/PowerTools/HTML5/Parser/Tokenizer.php | HTML5_Parser_Tokenizer.decodeCharacterReference | protected function decodeCharacterReference($inAttribute = false) {
// If it fails this, it's definitely not an entity.
if ($this->scanner->current() != '&') {
return false;
}
// Next char after &.
$tok = $this->scanner->next();
$entity = '';
$start ... | php | protected function decodeCharacterReference($inAttribute = false) {
// If it fails this, it's definitely not an entity.
if ($this->scanner->current() != '&') {
return false;
}
// Next char after &.
$tok = $this->scanner->next();
$entity = '';
$start ... | [
"protected",
"function",
"decodeCharacterReference",
"(",
"$",
"inAttribute",
"=",
"false",
")",
"{",
"// If it fails this, it's definitely not an entity.",
"if",
"(",
"$",
"this",
"->",
"scanner",
"->",
"current",
"(",
")",
"!=",
"'&'",
")",
"{",
"return",
"false... | Decode a character reference and return the string.
Returns false if the entity could not be found. If $inAttribute is set
to true, a bare & will be returned as-is.
@param boolean $inAttribute
Set to true if the text is inside of an attribute value.
false otherwise. | [
"Decode",
"a",
"character",
"reference",
"and",
"return",
"the",
"string",
"."
] | 4ea8caf5b2618a82ca5061dcbb7421b31065c1c7 | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Parser/Tokenizer.php#L1037-L1122 |
21,802 | wenbinye/PhalconX | src/Helper/ClassHelper.php | ClassHelper.splitName | public static function splitName($class)
{
$pos = strrpos($class, '\\');
if ($pos === false) {
return [null, $class];
} else {
return [substr($class, 0, $pos), substr($class, $pos+1)];
}
} | php | public static function splitName($class)
{
$pos = strrpos($class, '\\');
if ($pos === false) {
return [null, $class];
} else {
return [substr($class, 0, $pos), substr($class, $pos+1)];
}
} | [
"public",
"static",
"function",
"splitName",
"(",
"$",
"class",
")",
"{",
"$",
"pos",
"=",
"strrpos",
"(",
"$",
"class",
",",
"'\\\\'",
")",
";",
"if",
"(",
"$",
"pos",
"===",
"false",
")",
"{",
"return",
"[",
"null",
",",
"$",
"class",
"]",
";",... | Splits class name to namespace and class name
@param string $class
@return array | [
"Splits",
"class",
"name",
"to",
"namespace",
"and",
"class",
"name"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ClassHelper.php#L47-L55 |
21,803 | weew/http | src/Weew/Http/HttpRequest.php | HttpRequest.getParameter | public function getParameter($key, $default = null) {
$value = $this->getUrl()->getQuery()->get($key);
if ($value === null) {
$value = $this->getData()->get($key, $default);
}
return $value;
} | php | public function getParameter($key, $default = null) {
$value = $this->getUrl()->getQuery()->get($key);
if ($value === null) {
$value = $this->getData()->get($key, $default);
}
return $value;
} | [
"public",
"function",
"getParameter",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getUrl",
"(",
")",
"->",
"getQuery",
"(",
")",
"->",
"get",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"va... | Retrieve a value from url query or message body.
@param string $key
@param null $default
@return mixed | [
"Retrieve",
"a",
"value",
"from",
"url",
"query",
"or",
"message",
"body",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpRequest.php#L314-L322 |
21,804 | weew/http | src/Weew/Http/HttpRequest.php | HttpRequest.setDefaults | protected function setDefaults() {
if ($this->getAccept() === null) {
$this->setDefaultAccept();
}
if ($this->getContentType() === null) {
$this->setDefaultContentType();
}
} | php | protected function setDefaults() {
if ($this->getAccept() === null) {
$this->setDefaultAccept();
}
if ($this->getContentType() === null) {
$this->setDefaultContentType();
}
} | [
"protected",
"function",
"setDefaults",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getAccept",
"(",
")",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setDefaultAccept",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"getContentType",
"(",
")",
... | Use this as hook to extend your custom request. | [
"Use",
"this",
"as",
"hook",
"to",
"extend",
"your",
"custom",
"request",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpRequest.php#L344-L352 |
21,805 | wenbinye/PhalconX | src/Helper/ClassParser.php | ClassParser.getImports | public function getImports()
{
$imports = [];
$tokens = token_get_all(file_get_contents($this->file));
reset($tokens);
$token = '';
while ($token !== false) {
$token = next($tokens);
if (!is_array($token)) {
continue;
}
... | php | public function getImports()
{
$imports = [];
$tokens = token_get_all(file_get_contents($this->file));
reset($tokens);
$token = '';
while ($token !== false) {
$token = next($tokens);
if (!is_array($token)) {
continue;
}
... | [
"public",
"function",
"getImports",
"(",
")",
"{",
"$",
"imports",
"=",
"[",
"]",
";",
"$",
"tokens",
"=",
"token_get_all",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
"file",
")",
")",
";",
"reset",
"(",
"$",
"tokens",
")",
";",
"$",
"token",
... | Gets all imported classes
@return array | [
"Gets",
"all",
"imported",
"classes"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ClassParser.php#L57-L76 |
21,806 | zicht/z | src/Zicht/Tool/Container/Task.php | Task.compile | public function compile(Buffer $buffer)
{
parent::compile($buffer);
if (substr($this->getName(), 0, 1) !== '_') {
$buffer
->writeln('try {')
->indent(1)
->writeln('$z->addCommand(')
->indent(1)
... | php | public function compile(Buffer $buffer)
{
parent::compile($buffer);
if (substr($this->getName(), 0, 1) !== '_') {
$buffer
->writeln('try {')
->indent(1)
->writeln('$z->addCommand(')
->indent(1)
... | [
"public",
"function",
"compile",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"parent",
"::",
"compile",
"(",
"$",
"buffer",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",
"0",
",",
"1",
")",
"!==",
"'_'",
")",
"{",
... | Compiles the task initialization code into the buffer.
@param \Zicht\Tool\Script\Buffer $buffer
@return void | [
"Compiles",
"the",
"task",
"initialization",
"code",
"into",
"the",
"buffer",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Task.php#L63-L93 |
21,807 | heidelpay/PhpDoc | src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php | PackageTreeBuilder.execute | public function execute(ProjectDescriptor $project)
{
$rootPackageDescriptor = new PackageDescriptor();
$rootPackageDescriptor->setName('\\');
$project->getIndexes()->set('packages', new Collection());
$project->getIndexes()->packages['\\'] = $rootPackageDescriptor;
foreach ... | php | public function execute(ProjectDescriptor $project)
{
$rootPackageDescriptor = new PackageDescriptor();
$rootPackageDescriptor->setName('\\');
$project->getIndexes()->set('packages', new Collection());
$project->getIndexes()->packages['\\'] = $rootPackageDescriptor;
foreach ... | [
"public",
"function",
"execute",
"(",
"ProjectDescriptor",
"$",
"project",
")",
"{",
"$",
"rootPackageDescriptor",
"=",
"new",
"PackageDescriptor",
"(",
")",
";",
"$",
"rootPackageDescriptor",
"->",
"setName",
"(",
"'\\\\'",
")",
";",
"$",
"project",
"->",
"ge... | Compiles a 'packages' index on the project and create all Package Descriptors necessary.
@param ProjectDescriptor $project
@return void | [
"Compiles",
"a",
"packages",
"index",
"on",
"the",
"project",
"and",
"create",
"all",
"Package",
"Descriptors",
"necessary",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php#L49-L64 |
21,808 | heidelpay/PhpDoc | src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php | PackageTreeBuilder.addElementsOfTypeToPackage | protected function addElementsOfTypeToPackage(ProjectDescriptor $project, array $elements, $type)
{
/** @var DescriptorAbstract $element */
foreach ($elements as $element) {
$packageName = '';
$packageTags = $element->getTags()->get('package');
if ($packageTags in... | php | protected function addElementsOfTypeToPackage(ProjectDescriptor $project, array $elements, $type)
{
/** @var DescriptorAbstract $element */
foreach ($elements as $element) {
$packageName = '';
$packageTags = $element->getTags()->get('package');
if ($packageTags in... | [
"protected",
"function",
"addElementsOfTypeToPackage",
"(",
"ProjectDescriptor",
"$",
"project",
",",
"array",
"$",
"elements",
",",
"$",
"type",
")",
"{",
"/** @var DescriptorAbstract $element */",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"element",
")",
"{",
... | Adds the given elements of a specific type to their respective Package Descriptors.
This method will assign the given elements to the package as registered in the package field of that
element. If a package does not exist yet it will automatically be created.
@param ProjectDescriptor $project
@param DescriptorAbst... | [
"Adds",
"the",
"given",
"elements",
"of",
"a",
"specific",
"type",
"to",
"their",
"respective",
"Package",
"Descriptors",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php#L80-L120 |
21,809 | platformsh/platformsh-oauth2-php | src/Provider/Platformsh.php | Platformsh.requiresTfa | private function requiresTfa(ResponseInterface $response)
{
return substr($response->getStatusCode(), 0, 1) === '4' && $response->hasHeader(self::TFA_HEADER);
} | php | private function requiresTfa(ResponseInterface $response)
{
return substr($response->getStatusCode(), 0, 1) === '4' && $response->hasHeader(self::TFA_HEADER);
} | [
"private",
"function",
"requiresTfa",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"return",
"substr",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
",",
"0",
",",
"1",
")",
"===",
"'4'",
"&&",
"$",
"response",
"->",
"hasHeader",
"(",
"s... | Check whether the response requires two-factor authentication.
@param \Psr\Http\Message\ResponseInterface $response
@return bool | [
"Check",
"whether",
"the",
"response",
"requires",
"two",
"-",
"factor",
"authentication",
"."
] | c5056b818f326e8ee358521224ac7f803d1e9d6b | https://github.com/platformsh/platformsh-oauth2-php/blob/c5056b818f326e8ee358521224ac7f803d1e9d6b/src/Provider/Platformsh.php#L128-L131 |
21,810 | surebert/surebert-framework | src/sb/Controller/HTTP.php | HTTP.unsetCookie | public function unsetCookie($name, $path = '/')
{
setcookie($name, '', time() - 86400, '/', '', 0);
if (isset($_COOKIE) && isset($_COOKIE[$name])) {
unset($_COOKIE[$name]);
}
if (isset($this->request->cookie[$name])) {
unset($this->request->cookie[$name]);
... | php | public function unsetCookie($name, $path = '/')
{
setcookie($name, '', time() - 86400, '/', '', 0);
if (isset($_COOKIE) && isset($_COOKIE[$name])) {
unset($_COOKIE[$name]);
}
if (isset($this->request->cookie[$name])) {
unset($this->request->cookie[$name]);
... | [
"public",
"function",
"unsetCookie",
"(",
"$",
"name",
",",
"$",
"path",
"=",
"'/'",
")",
"{",
"setcookie",
"(",
"$",
"name",
",",
"''",
",",
"time",
"(",
")",
"-",
"86400",
",",
"'/'",
",",
"''",
",",
"0",
")",
";",
"if",
"(",
"isset",
"(",
... | Unsets a cookie value by setting it to expire
@param string $name The cookie name
@param string path The path to clear, defaults to / | [
"Unsets",
"a",
"cookie",
"value",
"by",
"setting",
"it",
"to",
"expire"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP.php#L79-L88 |
21,811 | surebert/surebert-framework | src/sb/Controller/HTTP.php | HTTP.sendError | public function sendError($error_num, $err_str = '')
{
if (empty($err_str)) {
switch ($error_num) {
case 400:
$err_str = 'Bad Request';
break;
case 401:
$err_str = 'Unauthorized';
br... | php | public function sendError($error_num, $err_str = '')
{
if (empty($err_str)) {
switch ($error_num) {
case 400:
$err_str = 'Bad Request';
break;
case 401:
$err_str = 'Unauthorized';
br... | [
"public",
"function",
"sendError",
"(",
"$",
"error_num",
",",
"$",
"err_str",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"err_str",
")",
")",
"{",
"switch",
"(",
"$",
"error_num",
")",
"{",
"case",
"400",
":",
"$",
"err_str",
"=",
"'Bad Re... | Send an http error header
@param integer $error_num The number of the error as found http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@param string $err_str The error string to send, defaults sent for
400, 401, 403, 404, 405, 410, 415, 500, 501 unless specified | [
"Send",
"an",
"http",
"error",
"header"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP.php#L119-L162 |
21,812 | surebert/surebert-framework | src/sb/Controller/HTTP.php | HTTP.requireBasicAuth | public function requireBasicAuth($check_auth = '', $realm = 'Please enter your username and password')
{
$authorized = false;
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="' . $realm . '"');
header('HTTP/1.0 401 Unauthorized');
e... | php | public function requireBasicAuth($check_auth = '', $realm = 'Please enter your username and password')
{
$authorized = false;
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="' . $realm . '"');
header('HTTP/1.0 401 Unauthorized');
e... | [
"public",
"function",
"requireBasicAuth",
"(",
"$",
"check_auth",
"=",
"''",
",",
"$",
"realm",
"=",
"'Please enter your username and password'",
")",
"{",
"$",
"authorized",
"=",
"false",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"_SERVER",
"[",
"'PHP_AUTH_USER... | Added option for requesting basic auth. ONLY USE OVER SSL
@param callable $check_auth the callable that determines success or not
@param string $realm the realm beings used
@return boolean | [
"Added",
"option",
"for",
"requesting",
"basic",
"auth",
".",
"ONLY",
"USE",
"OVER",
"SSL"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP.php#L295-L317 |
21,813 | wenbinye/PhalconX | src/Di/FactoryDefault.php | FactoryDefault.autoload | public function autoload(array $autoloads, $provider, $options = [])
{
foreach ($autoloads as $name => $alias) {
if (is_int($name)) {
$name = $alias;
}
if (empty($name)) {
throw new \InvalidArgumentException("Cannot not autoload empty servi... | php | public function autoload(array $autoloads, $provider, $options = [])
{
foreach ($autoloads as $name => $alias) {
if (is_int($name)) {
$name = $alias;
}
if (empty($name)) {
throw new \InvalidArgumentException("Cannot not autoload empty servi... | [
"public",
"function",
"autoload",
"(",
"array",
"$",
"autoloads",
",",
"$",
"provider",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"autoloads",
"as",
"$",
"name",
"=>",
"$",
"alias",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
... | mark autoload service definition from service provider
@param array $autoloads name of service. service alias
@param string|ServiceProvider $provider service provider
@param array options: shared, instances, prefix | [
"mark",
"autoload",
"service",
"definition",
"from",
"service",
"provider"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Di/FactoryDefault.php#L78-L108 |
21,814 | wenbinye/PhalconX | src/Di/FactoryDefault.php | FactoryDefault.load | public function load($provider, $options = null)
{
if (!is_object($provider)) {
$provider = $this->getShared($provider);
}
$names = $provider->getNames();
if (isset($options['aliases'])) {
$services = $this->createServiceAliases($names, $options['aliases']);
... | php | public function load($provider, $options = null)
{
if (!is_object($provider)) {
$provider = $this->getShared($provider);
}
$names = $provider->getNames();
if (isset($options['aliases'])) {
$services = $this->createServiceAliases($names, $options['aliases']);
... | [
"public",
"function",
"load",
"(",
"$",
"provider",
",",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"provider",
")",
")",
"{",
"$",
"provider",
"=",
"$",
"this",
"->",
"getShared",
"(",
"$",
"provider",
")",
";",
... | load all service definition from service provider
@param string|ServiceProvider $provider service provider
@param array $options non-shared service names
- aliases
- shared
- instances
- prefix | [
"load",
"all",
"service",
"definition",
"from",
"service",
"provider"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Di/FactoryDefault.php#L120-L133 |
21,815 | nabab/bbn | src/bbn/appui/observer.php | observer.get_file | private static function get_file(): string
{
if ( null === self::$path ){
if ( \defined('BBN_DATA_PATH') ){
self::$path = BBN_DATA_PATH;
}
else{
self::$path = __DIR__.'/';
}
}
return self::$path.'plugins/appui-cron/appui-observer.txt';
} | php | private static function get_file(): string
{
if ( null === self::$path ){
if ( \defined('BBN_DATA_PATH') ){
self::$path = BBN_DATA_PATH;
}
else{
self::$path = __DIR__.'/';
}
}
return self::$path.'plugins/appui-cron/appui-observer.txt';
} | [
"private",
"static",
"function",
"get_file",
"(",
")",
":",
"string",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"path",
")",
"{",
"if",
"(",
"\\",
"defined",
"(",
"'BBN_DATA_PATH'",
")",
")",
"{",
"self",
"::",
"$",
"path",
"=",
"BBN_DATA_PAT... | Returns the observer txt file's full path.
@return string | [
"Returns",
"the",
"observer",
"txt",
"file",
"s",
"full",
"path",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L48-L59 |
21,816 | nabab/bbn | src/bbn/appui/observer.php | observer._get_id | private function _get_id(string $request, $params): ?string
{
if ( $this->check() ){
if ( $params ){
return $this->db->select_one('bbn_observers', 'id', [
'id_string' => $this->_get_id_string($request, $params)
]);
}
return $this->db->get_one("
SELECT id
... | php | private function _get_id(string $request, $params): ?string
{
if ( $this->check() ){
if ( $params ){
return $this->db->select_one('bbn_observers', 'id', [
'id_string' => $this->_get_id_string($request, $params)
]);
}
return $this->db->get_one("
SELECT id
... | [
"private",
"function",
"_get_id",
"(",
"string",
"$",
"request",
",",
"$",
"params",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"if",
"(",
"$",
"params",
")",
"{",
"return",
"$",
"this",
"->",
"db",
... | Returns the ID of an observer with public = 1 and with similar request and params.
@param string $request
@param string $params
@return null|string | [
"Returns",
"the",
"ID",
"of",
"an",
"observer",
"with",
"public",
"=",
"1",
"and",
"with",
"similar",
"request",
"and",
"params",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L121-L138 |
21,817 | nabab/bbn | src/bbn/appui/observer.php | observer._get_id_from_user | private function _get_id_from_user(string $request, $params): ?string
{
if ( $this->id_user && $this->check() ){
$sql = '
SELECT `o`.`id`
FROM bbn_observers AS `o`
LEFT JOIN bbn_observers AS `ro`
ON `o`.`id_alias` = `ro`.`id`
WHERE `o`.`id_user` = ?
AND ... | php | private function _get_id_from_user(string $request, $params): ?string
{
if ( $this->id_user && $this->check() ){
$sql = '
SELECT `o`.`id`
FROM bbn_observers AS `o`
LEFT JOIN bbn_observers AS `ro`
ON `o`.`id_alias` = `ro`.`id`
WHERE `o`.`id_user` = ?
AND ... | [
"private",
"function",
"_get_id_from_user",
"(",
"string",
"$",
"request",
",",
"$",
"params",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"id_user",
"&&",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"$",
"sql",
"=",
"'\n S... | Returns the ID of an observer for the current user and with similar request and params.
@param string $request
@param string $params
@return null|string | [
"Returns",
"the",
"ID",
"of",
"an",
"observer",
"for",
"the",
"current",
"user",
"and",
"with",
"similar",
"request",
"and",
"params",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L147-L174 |
21,818 | nabab/bbn | src/bbn/appui/observer.php | observer._update_next | private function _update_next($id): bool
{
$id_alias = $this->db->select_one('bbn_observers', 'id_alias', ['id' => $id]);
return $this->db->query(<<<MYSQL
UPDATE bbn_observers
SET next = NOW() + INTERVAL frequency SECOND
WHERE id = ?
MYSQL
,
hex2bin($id_alias ?: $id)) ? true : fa... | php | private function _update_next($id): bool
{
$id_alias = $this->db->select_one('bbn_observers', 'id_alias', ['id' => $id]);
return $this->db->query(<<<MYSQL
UPDATE bbn_observers
SET next = NOW() + INTERVAL frequency SECOND
WHERE id = ?
MYSQL
,
hex2bin($id_alias ?: $id)) ? true : fa... | [
"private",
"function",
"_update_next",
"(",
"$",
"id",
")",
":",
"bool",
"{",
"$",
"id_alias",
"=",
"$",
"this",
"->",
"db",
"->",
"select_one",
"(",
"'bbn_observers'",
",",
"'id_alias'",
",",
"[",
"'id'",
"=>",
"$",
"id",
"]",
")",
";",
"return",
"$... | Sets the time of next execution in the observer's main row.
@param $id
@return bbn\db\query|int | [
"Sets",
"the",
"time",
"of",
"next",
"execution",
"in",
"the",
"observer",
"s",
"main",
"row",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L194-L204 |
21,819 | nabab/bbn | src/bbn/appui/observer.php | observer.check_result | public function check_result($id)
{
if ( $d = $this->get($id) ){
$t = new bbn\util\timer();
$t->start();
$res = $this->_exec($d['request'], $d['params']);
$duration = (int)ceil($t->stop() * 1000);
if ( $res !== $d['result'] ){
$this->db->update('bbn_observers', [
'r... | php | public function check_result($id)
{
if ( $d = $this->get($id) ){
$t = new bbn\util\timer();
$t->start();
$res = $this->_exec($d['request'], $d['params']);
$duration = (int)ceil($t->stop() * 1000);
if ( $res !== $d['result'] ){
$this->db->update('bbn_observers', [
'r... | [
"public",
"function",
"check_result",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"d",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"id",
")",
")",
"{",
"$",
"t",
"=",
"new",
"bbn",
"\\",
"util",
"\\",
"timer",
"(",
")",
";",
"$",
"t",
"->",
"sta... | Confronts the current result with the one kept in database.
@param $id
@return bool | [
"Confronts",
"the",
"current",
"result",
"with",
"the",
"one",
"kept",
"in",
"database",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L223-L241 |
21,820 | nabab/bbn | src/bbn/appui/observer.php | observer.add | public function add(array $cfg): ?string
{
if (
$this->id_user &&
(null !== $cfg['request']) &&
$this->check()
){
$t = new bbn\util\timer();
$t->start();
if ( is_string($cfg['request']) ){
$params = self::sanitize_params($cfg['params'] ?? []);
$request = tri... | php | public function add(array $cfg): ?string
{
if (
$this->id_user &&
(null !== $cfg['request']) &&
$this->check()
){
$t = new bbn\util\timer();
$t->start();
if ( is_string($cfg['request']) ){
$params = self::sanitize_params($cfg['params'] ?? []);
$request = tri... | [
"public",
"function",
"add",
"(",
"array",
"$",
"cfg",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"id_user",
"&&",
"(",
"null",
"!==",
"$",
"cfg",
"[",
"'request'",
"]",
")",
"&&",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{"... | Adds a new observer and returns its id or the id of an existing one.
@param array $cfg
@return null|string | [
"Adds",
"a",
"new",
"observer",
"and",
"returns",
"its",
"id",
"or",
"the",
"id",
"of",
"an",
"existing",
"one",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L249-L324 |
21,821 | nabab/bbn | src/bbn/appui/observer.php | observer.user_delete | public function user_delete($id): int
{
if ( property_exists($this, 'user') && $this->check() ){
return $this->db->delete('bbn_observers', ['id' => $id, 'id_user' => $this->user]);
}
return 0;
} | php | public function user_delete($id): int
{
if ( property_exists($this, 'user') && $this->check() ){
return $this->db->delete('bbn_observers', ['id' => $id, 'id_user' => $this->user]);
}
return 0;
} | [
"public",
"function",
"user_delete",
"(",
"$",
"id",
")",
":",
"int",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"'user'",
")",
"&&",
"$",
"this",
"->",
"check",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"delete",
... | Deletes the given observer for the current user
@param string $id
@return int | [
"Deletes",
"the",
"given",
"observer",
"for",
"the",
"current",
"user"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/observer.php#L403-L409 |
21,822 | odiaseo/pagebuilder | src/PageBuilder/View/Helper/PageBuilder.php | PageBuilder.applyFormats | protected function applyFormats($data)
{
if ($this->getOptions()->getOutputFormatters()) {
foreach ($this->getOptions()->getOutputFormatters() as $formatter) {
if ($formatter instanceof FormatterInterface) {
/** @var $formatter \PageBuilder\FormatterInt... | php | protected function applyFormats($data)
{
if ($this->getOptions()->getOutputFormatters()) {
foreach ($this->getOptions()->getOutputFormatters() as $formatter) {
if ($formatter instanceof FormatterInterface) {
/** @var $formatter \PageBuilder\FormatterInt... | [
"protected",
"function",
"applyFormats",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getOptions",
"(",
")",
"->",
"getOutputFormatters",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getOptions",
"(",
")",
"->",
"getOutputFormatt... | Apply formatter using the formatters in the order they were defined
@param $data
@return string | [
"Apply",
"formatter",
"using",
"the",
"formatters",
"in",
"the",
"order",
"they",
"were",
"defined"
] | 88ef7cccf305368561307efe4ca07fac8e5774f3 | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/View/Helper/PageBuilder.php#L334-L349 |
21,823 | lokhman/silex-tools | src/Silex/Application/ToolsTrait.php | ToolsTrait.redirectToRoute | public function redirectToRoute($route, array $parameters = [], $status = 302)
{
return new RedirectResponse($this['url_generator']->generate($route, $parameters), $status);
} | php | public function redirectToRoute($route, array $parameters = [], $status = 302)
{
return new RedirectResponse($this['url_generator']->generate($route, $parameters), $status);
} | [
"public",
"function",
"redirectToRoute",
"(",
"$",
"route",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"status",
"=",
"302",
")",
"{",
"return",
"new",
"RedirectResponse",
"(",
"$",
"this",
"[",
"'url_generator'",
"]",
"->",
"generate",
"(... | Redirects the user to route with the given parameters.
@param string $route The name of the route
@param mixed $parameters An array of parameters
@param int $status The status code (302 by default)
@return RedirectResponse | [
"Redirects",
"the",
"user",
"to",
"route",
"with",
"the",
"given",
"parameters",
"."
] | 91e84099479beb4e866abc88a55ed1e457a8a9e9 | https://github.com/lokhman/silex-tools/blob/91e84099479beb4e866abc88a55ed1e457a8a9e9/src/Silex/Application/ToolsTrait.php#L54-L57 |
21,824 | lokhman/silex-tools | src/Silex/Application/ToolsTrait.php | ToolsTrait.forward | public function forward($uri, $method, array $parameters = [])
{
$request = Request::create($uri, $method, $parameters);
return $this->handle($request, HttpKernelInterface::SUB_REQUEST);
} | php | public function forward($uri, $method, array $parameters = [])
{
$request = Request::create($uri, $method, $parameters);
return $this->handle($request, HttpKernelInterface::SUB_REQUEST);
} | [
"public",
"function",
"forward",
"(",
"$",
"uri",
",",
"$",
"method",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"request",
"=",
"Request",
"::",
"create",
"(",
"$",
"uri",
",",
"$",
"method",
",",
"$",
"parameters",
")",
";",
... | Forward the request to another controller by the URI.
@param string $uri
@param string $method
@param array $parameters
@return Symfony\Component\HttpFoundation\Response | [
"Forward",
"the",
"request",
"to",
"another",
"controller",
"by",
"the",
"URI",
"."
] | 91e84099479beb4e866abc88a55ed1e457a8a9e9 | https://github.com/lokhman/silex-tools/blob/91e84099479beb4e866abc88a55ed1e457a8a9e9/src/Silex/Application/ToolsTrait.php#L68-L73 |
21,825 | lokhman/silex-tools | src/Silex/Application/ToolsTrait.php | ToolsTrait.forwardToRoute | public function forwardToRoute($route, $method, array $parameters = [])
{
return $this->forward($this['url_generator']->generate($route, $parameters), $method);
} | php | public function forwardToRoute($route, $method, array $parameters = [])
{
return $this->forward($this['url_generator']->generate($route, $parameters), $method);
} | [
"public",
"function",
"forwardToRoute",
"(",
"$",
"route",
",",
"$",
"method",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"forward",
"(",
"$",
"this",
"[",
"'url_generator'",
"]",
"->",
"generate",
"(",
"$",
... | Forward the request to another controller by the route name.
@param string $route
@param string $method
@param array $parameters
@return Symfony\Component\HttpFoundation\Response | [
"Forward",
"the",
"request",
"to",
"another",
"controller",
"by",
"the",
"route",
"name",
"."
] | 91e84099479beb4e866abc88a55ed1e457a8a9e9 | https://github.com/lokhman/silex-tools/blob/91e84099479beb4e866abc88a55ed1e457a8a9e9/src/Silex/Application/ToolsTrait.php#L84-L87 |
21,826 | sabre-io/cs | lib/ControlSpaces.php | ControlSpaces.fixControlStructure | private function fixControlStructure(Tokens $tokens, $index)
{
// Ensure a single whitespace
if (!$tokens[$index - 1]->isWhitespace() || $tokens[$index - 1]->isWhitespace($this->singleLineWhitespaceOptions)) {
$tokens->ensureWhitespaceAtIndex($index - 1, 1, ' ');
}
} | php | private function fixControlStructure(Tokens $tokens, $index)
{
// Ensure a single whitespace
if (!$tokens[$index - 1]->isWhitespace() || $tokens[$index - 1]->isWhitespace($this->singleLineWhitespaceOptions)) {
$tokens->ensureWhitespaceAtIndex($index - 1, 1, ' ');
}
} | [
"private",
"function",
"fixControlStructure",
"(",
"Tokens",
"$",
"tokens",
",",
"$",
"index",
")",
"{",
"// Ensure a single whitespace",
"if",
"(",
"!",
"$",
"tokens",
"[",
"$",
"index",
"-",
"1",
"]",
"->",
"isWhitespace",
"(",
")",
"||",
"$",
"tokens",
... | Fixes whitespaces around braces of a control structure.
@param Tokens $tokens tokens to handle
@param int $index index of token | [
"Fixes",
"whitespaces",
"around",
"braces",
"of",
"a",
"control",
"structure",
"."
] | a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86 | https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/ControlSpaces.php#L88-L95 |
21,827 | sabre-io/cs | lib/ControlSpaces.php | ControlSpaces.getControlStructureTokens | private function getControlStructureTokens()
{
static $tokens = null;
if (null === $tokens) {
$tokens = [
T_IF,
T_ELSEIF,
T_FOR,
T_FOREACH,
T_WHILE,
T_DO,
T_CATCH,
... | php | private function getControlStructureTokens()
{
static $tokens = null;
if (null === $tokens) {
$tokens = [
T_IF,
T_ELSEIF,
T_FOR,
T_FOREACH,
T_WHILE,
T_DO,
T_CATCH,
... | [
"private",
"function",
"getControlStructureTokens",
"(",
")",
"{",
"static",
"$",
"tokens",
"=",
"null",
";",
"if",
"(",
"null",
"===",
"$",
"tokens",
")",
"{",
"$",
"tokens",
"=",
"[",
"T_IF",
",",
"T_ELSEIF",
",",
"T_FOR",
",",
"T_FOREACH",
",",
"T_W... | Gets the name of control structure tokens.
@staticvar string[] $tokens Token names.
@return string[] Token names. | [
"Gets",
"the",
"name",
"of",
"control",
"structure",
"tokens",
"."
] | a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86 | https://github.com/sabre-io/cs/blob/a4c57e213bf3f5e7d6b29a2f70d1ca4b0dce6d86/lib/ControlSpaces.php#L104-L123 |
21,828 | AOEpeople/Aoe_Layout | app/code/local/Aoe/Layout/Block/Widget/Tabs.php | Aoe_Layout_Block_Widget_Tabs.addTab | public function addTab($tabId, $tab)
{
parent::addTab($tabId, $tab);
if ($this->_tabs[$tabId] instanceof Mage_Core_Block_Abstract && $this->_tabs[$tabId]->getParentBlock() === null) {
$this->append($this->_tabs[$tabId]);
}
return $this;
} | php | public function addTab($tabId, $tab)
{
parent::addTab($tabId, $tab);
if ($this->_tabs[$tabId] instanceof Mage_Core_Block_Abstract && $this->_tabs[$tabId]->getParentBlock() === null) {
$this->append($this->_tabs[$tabId]);
}
return $this;
} | [
"public",
"function",
"addTab",
"(",
"$",
"tabId",
",",
"$",
"tab",
")",
"{",
"parent",
"::",
"addTab",
"(",
"$",
"tabId",
",",
"$",
"tab",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_tabs",
"[",
"$",
"tabId",
"]",
"instanceof",
"Mage_Core_Block_Abstra... | Add new tab
@param string $tabId
@param array|Varien_Object $tab
@return Mage_Adminhtml_Block_Widget_Tabs | [
"Add",
"new",
"tab"
] | d88ba3406cf12dbaf09548477133c3cb27d155ed | https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Block/Widget/Tabs.php#L15-L24 |
21,829 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.buildSourceTableMigration | public function buildSourceTableMigration($name)
{
$path = $this->getMigrationPath($name);
$migration = $this->getTableMigrationName($name);
$contents = view('_hierarchy::migrations.table', [
'table' => source_table_name($name),
'migration' => $migration
... | php | public function buildSourceTableMigration($name)
{
$path = $this->getMigrationPath($name);
$migration = $this->getTableMigrationName($name);
$contents = view('_hierarchy::migrations.table', [
'table' => source_table_name($name),
'migration' => $migration
... | [
"public",
"function",
"buildSourceTableMigration",
"(",
"$",
"name",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getMigrationPath",
"(",
"$",
"name",
")",
";",
"$",
"migration",
"=",
"$",
"this",
"->",
"getTableMigrationName",
"(",
"$",
"name",
")",
... | Builds a source table migration
@param string $name
@return string | [
"Builds",
"a",
"source",
"table",
"migration"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L81-L94 |
21,830 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.destroySourceTableMigration | public function destroySourceTableMigration($name, array $fields)
{
$path = $this->getMigrationPath($name);
$this->delete($path);
foreach ($fields as $field)
{
$this->destroyFieldMigrationForTable($field, $name);
}
} | php | public function destroySourceTableMigration($name, array $fields)
{
$path = $this->getMigrationPath($name);
$this->delete($path);
foreach ($fields as $field)
{
$this->destroyFieldMigrationForTable($field, $name);
}
} | [
"public",
"function",
"destroySourceTableMigration",
"(",
"$",
"name",
",",
"array",
"$",
"fields",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getMigrationPath",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"delete",
"(",
"$",
"path",
")",
";",
... | Destroy a source table migration
@param string $name
@param array $fields | [
"Destroy",
"a",
"source",
"table",
"migration"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L102-L112 |
21,831 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.buildFieldMigrationForTable | public function buildFieldMigrationForTable($name, $type, $indexed, $tableName)
{
$path = $this->getMigrationPath($tableName, $name);
$migration = $this->getTableFieldMigrationName($name, $tableName);
$contents = view('_hierarchy::migrations.field', [
'field' => $name,
... | php | public function buildFieldMigrationForTable($name, $type, $indexed, $tableName)
{
$path = $this->getMigrationPath($tableName, $name);
$migration = $this->getTableFieldMigrationName($name, $tableName);
$contents = view('_hierarchy::migrations.field', [
'field' => $name,
... | [
"public",
"function",
"buildFieldMigrationForTable",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"indexed",
",",
"$",
"tableName",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getMigrationPath",
"(",
"$",
"tableName",
",",
"$",
"name",
")",
";",
"... | Builds a field migration for a table
@param string $name
@param string $type
@param bool $indexed
@param string $tableName
@return string | [
"Builds",
"a",
"field",
"migration",
"for",
"a",
"table"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L123-L139 |
21,832 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.destroyFieldMigrationForTable | public function destroyFieldMigrationForTable($name, $tableName)
{
$path = $this->getMigrationPath($tableName, $name);
$this->delete($path);
} | php | public function destroyFieldMigrationForTable($name, $tableName)
{
$path = $this->getMigrationPath($tableName, $name);
$this->delete($path);
} | [
"public",
"function",
"destroyFieldMigrationForTable",
"(",
"$",
"name",
",",
"$",
"tableName",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getMigrationPath",
"(",
"$",
"tableName",
",",
"$",
"name",
")",
";",
"$",
"this",
"->",
"delete",
"(",
"$",
... | Destroys a field migration for a table
@param string $name
@param string $tableName | [
"Destroys",
"a",
"field",
"migration",
"for",
"a",
"table"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L147-L152 |
21,833 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.getTableFieldMigrationName | public function getTableFieldMigrationName($name, $tableName)
{
return sprintf(
MigrationBuilder::PATTERN_FIELD,
ucfirst($name),
ucfirst($tableName)
);
} | php | public function getTableFieldMigrationName($name, $tableName)
{
return sprintf(
MigrationBuilder::PATTERN_FIELD,
ucfirst($name),
ucfirst($tableName)
);
} | [
"public",
"function",
"getTableFieldMigrationName",
"(",
"$",
"name",
",",
"$",
"tableName",
")",
"{",
"return",
"sprintf",
"(",
"MigrationBuilder",
"::",
"PATTERN_FIELD",
",",
"ucfirst",
"(",
"$",
"name",
")",
",",
"ucfirst",
"(",
"$",
"tableName",
")",
")"... | Returns the migration name for a field in table
@param string $name
@param string $tableName
@return string | [
"Returns",
"the",
"migration",
"name",
"for",
"a",
"field",
"in",
"table"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L175-L182 |
21,834 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.getMigrationPath | public function getMigrationPath($table, $field = null)
{
$name = is_null($field) ?
$this->getTableMigrationName($table) :
$this->getTableFieldMigrationName($field, $table);
return sprintf(
$this->getBasePath() . '/%s.php',
$name);
} | php | public function getMigrationPath($table, $field = null)
{
$name = is_null($field) ?
$this->getTableMigrationName($table) :
$this->getTableFieldMigrationName($field, $table);
return sprintf(
$this->getBasePath() . '/%s.php',
$name);
} | [
"public",
"function",
"getMigrationPath",
"(",
"$",
"table",
",",
"$",
"field",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"is_null",
"(",
"$",
"field",
")",
"?",
"$",
"this",
"->",
"getTableMigrationName",
"(",
"$",
"table",
")",
":",
"$",
"this",
"->... | Returns the path for the migration
@param string $table
@param string|null $field
@return string | [
"Returns",
"the",
"path",
"for",
"the",
"migration"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L201-L210 |
21,835 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.getMigrationClassPathByKey | public function getMigrationClassPathByKey($table, $field = null)
{
$name = is_null($field) ?
$this->getTableMigrationName($table) :
$this->getTableFieldMigrationName($field, $table);
return $this->getMigrationClassPath($name);
} | php | public function getMigrationClassPathByKey($table, $field = null)
{
$name = is_null($field) ?
$this->getTableMigrationName($table) :
$this->getTableFieldMigrationName($field, $table);
return $this->getMigrationClassPath($name);
} | [
"public",
"function",
"getMigrationClassPathByKey",
"(",
"$",
"table",
",",
"$",
"field",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"is_null",
"(",
"$",
"field",
")",
"?",
"$",
"this",
"->",
"getTableMigrationName",
"(",
"$",
"table",
")",
":",
"$",
"th... | Returns the migration class path by key
@param string $table
@param string|null $field
@return string | [
"Returns",
"the",
"migration",
"class",
"path",
"by",
"key"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L230-L237 |
21,836 | NuclearCMS/Hierarchy | src/Builders/MigrationBuilder.php | MigrationBuilder.getColumnType | public function getColumnType($type)
{
if (array_key_exists($type, $this->typeMap))
{
return $this->typeMap[$type];
}
return $this->defaultType;
} | php | public function getColumnType($type)
{
if (array_key_exists($type, $this->typeMap))
{
return $this->typeMap[$type];
}
return $this->defaultType;
} | [
"public",
"function",
"getColumnType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"type",
",",
"$",
"this",
"->",
"typeMap",
")",
")",
"{",
"return",
"$",
"this",
"->",
"typeMap",
"[",
"$",
"type",
"]",
";",
"}",
"return",
... | Returns the column type for key
@param string $type
@return string | [
"Returns",
"the",
"column",
"type",
"for",
"key"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Builders/MigrationBuilder.php#L245-L253 |
21,837 | xiewulong/yii2-fileupload | oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php | ClassLoader.addPrefix | public function addPrefix($prefix, $paths)
{
if (!$prefix) {
foreach ((array) $paths as $path) {
$this->fallbackDirs[] = $path;
}
return;
}
if (isset($this->prefixes[$prefix])) {
$this->prefixes[$prefix] = array_merge(
... | php | public function addPrefix($prefix, $paths)
{
if (!$prefix) {
foreach ((array) $paths as $path) {
$this->fallbackDirs[] = $path;
}
return;
}
if (isset($this->prefixes[$prefix])) {
$this->prefixes[$prefix] = array_merge(
... | [
"public",
"function",
"addPrefix",
"(",
"$",
"prefix",
",",
"$",
"paths",
")",
"{",
"if",
"(",
"!",
"$",
"prefix",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"paths",
"as",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"fallbackDirs",
"[",
"]"... | Registers a set of classes
@param string $prefix The classes prefix
@param array|string $paths The location(s) of the classes | [
"Registers",
"a",
"set",
"of",
"classes"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php#L84-L101 |
21,838 | mothership-ec/composer | src/Composer/Repository/RepositoryManager.php | RepositoryManager.findPackages | public function findPackages($name, $version)
{
$packages = array();
foreach ($this->repositories as $repository) {
$packages = array_merge($packages, $repository->findPackages($name, $version));
}
return $packages;
} | php | public function findPackages($name, $version)
{
$packages = array();
foreach ($this->repositories as $repository) {
$packages = array_merge($packages, $repository->findPackages($name, $version));
}
return $packages;
} | [
"public",
"function",
"findPackages",
"(",
"$",
"name",
",",
"$",
"version",
")",
"{",
"$",
"packages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"repositories",
"as",
"$",
"repository",
")",
"{",
"$",
"packages",
"=",
"array_merg... | Searches for all packages matching a name and optionally a version in managed repositories.
@param string $name package name
@param string $version package version
@return array | [
"Searches",
"for",
"all",
"packages",
"matching",
"a",
"name",
"and",
"optionally",
"a",
"version",
"in",
"managed",
"repositories",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/RepositoryManager.php#L67-L76 |
21,839 | mothership-ec/composer | src/Composer/Repository/RepositoryManager.php | RepositoryManager.createRepository | public function createRepository($type, $config)
{
if (!isset($this->repositoryClasses[$type])) {
throw new \InvalidArgumentException('Repository type is not registered: '.$type);
}
$class = $this->repositoryClasses[$type];
return new $class($config, $this->io, $this->c... | php | public function createRepository($type, $config)
{
if (!isset($this->repositoryClasses[$type])) {
throw new \InvalidArgumentException('Repository type is not registered: '.$type);
}
$class = $this->repositoryClasses[$type];
return new $class($config, $this->io, $this->c... | [
"public",
"function",
"createRepository",
"(",
"$",
"type",
",",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"repositoryClasses",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | Returns a new repository for a specific installation type.
@param string $type repository type
@param array $config repository configuration
@return RepositoryInterface
@throws \InvalidArgumentException if repository for provided type is not registered | [
"Returns",
"a",
"new",
"repository",
"for",
"a",
"specific",
"installation",
"type",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/RepositoryManager.php#L96-L105 |
21,840 | yuncms/yii2-authentication | backend/controllers/AuthenticationController.php | AuthenticationController.actionIndex | public function actionIndex()
{
$searchModel = Yii::createObject(AuthenticationSearch::className());
$dataProvider = $searchModel->search(Yii::$app->request->get());
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
... | php | public function actionIndex()
{
$searchModel = Yii::createObject(AuthenticationSearch::className());
$dataProvider = $searchModel->search(Yii::$app->request->get());
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"searchModel",
"=",
"Yii",
"::",
"createObject",
"(",
"AuthenticationSearch",
"::",
"className",
"(",
")",
")",
";",
"$",
"dataProvider",
"=",
"$",
"searchModel",
"->",
"search",
"(",
"Yii",
"::",
"$... | Lists all Authentication models.
@return mixed | [
"Lists",
"all",
"Authentication",
"models",
"."
] | 02b70f7d2587480edb6dcc18ce256db662f1ed0d | https://github.com/yuncms/yii2-authentication/blob/02b70f7d2587480edb6dcc18ce256db662f1ed0d/backend/controllers/AuthenticationController.php#L40-L49 |
21,841 | inhere/php-librarys | src/DI/CallableResolver.php | CallableResolver.resolve | public function resolve($toResolve)
{
if (\is_callable($toResolve)) {
return $toResolve;
}
if (!\is_string($toResolve)) {
$this->assertCallable($toResolve);
}
// check for slim callable as "class:method"
if (preg_match(self::CALLABLE_PATTERN,... | php | public function resolve($toResolve)
{
if (\is_callable($toResolve)) {
return $toResolve;
}
if (!\is_string($toResolve)) {
$this->assertCallable($toResolve);
}
// check for slim callable as "class:method"
if (preg_match(self::CALLABLE_PATTERN,... | [
"public",
"function",
"resolve",
"(",
"$",
"toResolve",
")",
"{",
"if",
"(",
"\\",
"is_callable",
"(",
"$",
"toResolve",
")",
")",
"{",
"return",
"$",
"toResolve",
";",
"}",
"if",
"(",
"!",
"\\",
"is_string",
"(",
"$",
"toResolve",
")",
")",
"{",
"... | Resolve toResolve into a closure that that the router can dispatch.
If toResolve is of the format 'class:method', then try to extract 'class'
from the container otherwise instantiate it and then dispatch 'method'.
@param mixed $toResolve
@return callable
@throws RuntimeException if the callable does not exist
@thro... | [
"Resolve",
"toResolve",
"into",
"a",
"closure",
"that",
"that",
"the",
"router",
"can",
"dispatch",
"."
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/DI/CallableResolver.php#L50-L72 |
21,842 | GrupaZero/api | src/Gzero/Api/Controller/ApiController.php | ApiController.respondTransformer | protected function respondTransformer($data, $code, TransformerAbstract $transformer, array $headers = [])
{
if ($data === null) { // If we have empty result
return $this->respond(
[
'data' => []
],
$code,
$heade... | php | protected function respondTransformer($data, $code, TransformerAbstract $transformer, array $headers = [])
{
if ($data === null) { // If we have empty result
return $this->respond(
[
'data' => []
],
$code,
$heade... | [
"protected",
"function",
"respondTransformer",
"(",
"$",
"data",
",",
"$",
"code",
",",
"TransformerAbstract",
"$",
"transformer",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"data",
"===",
"null",
")",
"{",
"// If we have empty ... | Return transformed response in json format
@param mixed $data Response data
@param int $code Response code
@param TransformerAbstract $transformer Transformer class
@param array $headers HTTP headers
@return \Illuminate\Http\JsonResponse | [
"Return",
"transformed",
"response",
"in",
"json",
"format"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L69-L115 |
21,843 | GrupaZero/api | src/Gzero/Api/Controller/ApiController.php | ApiController.respondWithSuccess | protected function respondWithSuccess($data, TransformerAbstract $transformer = null, array $headers = [])
{
if ($transformer) {
return $this->respondTransformer($data, SymfonyResponse::HTTP_OK, $transformer, $headers);
}
return $this->respondWithSimpleSuccess($data);
} | php | protected function respondWithSuccess($data, TransformerAbstract $transformer = null, array $headers = [])
{
if ($transformer) {
return $this->respondTransformer($data, SymfonyResponse::HTTP_OK, $transformer, $headers);
}
return $this->respondWithSimpleSuccess($data);
} | [
"protected",
"function",
"respondWithSuccess",
"(",
"$",
"data",
",",
"TransformerAbstract",
"$",
"transformer",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"transformer",
")",
"{",
"return",
"$",
"this",
"->",
"re... | Return success response in json format
@param mixed $data Response data
@param TransformerAbstract $transformer Transformer class
@param array $headers HTTP Header
@return mixed | [
"Return",
"success",
"response",
"in",
"json",
"format"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L126-L132 |
21,844 | GrupaZero/api | src/Gzero/Api/Controller/ApiController.php | ApiController.respondWithError | protected function respondWithError(
$message = 'Bad Request',
$code = SymfonyResponse::HTTP_BAD_REQUEST,
array $headers = []
) {
return abort($code, $message, $headers);
} | php | protected function respondWithError(
$message = 'Bad Request',
$code = SymfonyResponse::HTTP_BAD_REQUEST,
array $headers = []
) {
return abort($code, $message, $headers);
} | [
"protected",
"function",
"respondWithError",
"(",
"$",
"message",
"=",
"'Bad Request'",
",",
"$",
"code",
"=",
"SymfonyResponse",
"::",
"HTTP_BAD_REQUEST",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"return",
"abort",
"(",
"$",
"code",
",",
"$"... | Return server error response in json format
@param string $message Custom error message
@param int $code Error code
@param array $headers HTTP headers
@return mixed | [
"Return",
"server",
"error",
"response",
"in",
"json",
"format"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/ApiController.php#L156-L162 |
21,845 | kenphp/ken | src/Http/BaseMiddleware.php | BaseMiddleware.next | final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
if ($this->_next) {
return $this->_next->process($request, $handler);
}
return $handler->handle($request);
} | php | final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
if ($this->_next) {
return $this->_next->process($request, $handler);
}
return $handler->handle($request);
} | [
"final",
"protected",
"function",
"next",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"RequestHandlerInterface",
"$",
"handler",
")",
":",
"ResponseInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"_next",
")",
"{",
"return",
"$",
"this",
"->",
"_next",
... | Pass request to the next middleware. If there are no next middleware,
it will pass the request to the handler
@param ServerRequestInterface $request
@param RequestHandlerInterface $handler
@return ResponseInterface | [
"Pass",
"request",
"to",
"the",
"next",
"middleware",
".",
"If",
"there",
"are",
"no",
"next",
"middleware",
"it",
"will",
"pass",
"the",
"request",
"to",
"the",
"handler"
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Http/BaseMiddleware.php#L44-L49 |
21,846 | josegonzalez/cakephp-sanction | View/Helper/ClearanceHelper.php | ClearanceHelper.parse | public function parse($currentRoute, $permit) {
$route = $permit['route'];
$count = count($route);
if ($count == 0) {
return false;
}
foreach ($route as $key => $value) {
if (isset($currentRoute[$key])) {
$values = (is_array($value)) ? $value : array($value);
foreach ($values as $k => $v) {
... | php | public function parse($currentRoute, $permit) {
$route = $permit['route'];
$count = count($route);
if ($count == 0) {
return false;
}
foreach ($route as $key => $value) {
if (isset($currentRoute[$key])) {
$values = (is_array($value)) ? $value : array($value);
foreach ($values as $k => $v) {
... | [
"public",
"function",
"parse",
"(",
"$",
"currentRoute",
",",
"$",
"permit",
")",
"{",
"$",
"route",
"=",
"$",
"permit",
"[",
"'route'",
"]",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"route",
")",
";",
"if",
"(",
"$",
"count",
"==",
"0",
")",
... | Parses the passed route against a rule
@param string $currentRoute route being testing
@param string $permit Permit variable that contains a route being tested against
@return void
@author Jose Diaz-Gonzalez | [
"Parses",
"the",
"passed",
"route",
"against",
"a",
"rule"
] | df2a8f0c0602c0ace802773db2c2ca6c89555c47 | https://github.com/josegonzalez/cakephp-sanction/blob/df2a8f0c0602c0ace802773db2c2ca6c89555c47/View/Helper/ClearanceHelper.php#L128-L147 |
21,847 | josegonzalez/cakephp-sanction | View/Helper/ClearanceHelper.php | ClearanceHelper.execute | public function execute($route, $title, $url = null, $options = array(), $confirmMessage = false) {
if (empty($route['rules'])) {
return $this->Html->link($title, $url, $options, $confirmMessage);
}
if (isset($route['rules']['deny'])) {
return ($route['rules']['deny'] == true) ? null : $this->Html->link($t... | php | public function execute($route, $title, $url = null, $options = array(), $confirmMessage = false) {
if (empty($route['rules'])) {
return $this->Html->link($title, $url, $options, $confirmMessage);
}
if (isset($route['rules']['deny'])) {
return ($route['rules']['deny'] == true) ? null : $this->Html->link($t... | [
"public",
"function",
"execute",
"(",
"$",
"route",
",",
"$",
"title",
",",
"$",
"url",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"confirmMessage",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"route",
"[",
"'ru... | Executes the route based on it's rules
@param string $route route being executed
@param string $title The content to be wrapped by <a> tags.
@param mixed $url Cake-relative URL or array of URL parameters, or external URL (starts with http://)
@param array $options Array of HTML attributes.
@param string $confirmMessag... | [
"Executes",
"the",
"route",
"based",
"on",
"it",
"s",
"rules"
] | df2a8f0c0602c0ace802773db2c2ca6c89555c47 | https://github.com/josegonzalez/cakephp-sanction/blob/df2a8f0c0602c0ace802773db2c2ca6c89555c47/View/Helper/ClearanceHelper.php#L160-L214 |
21,848 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.store | public function store( $id, $data, $attributes = array() )
{
$metaStorage = $this->getMetaDataStorage();
$metaStorage->lock();
$metaData = $this->getMetaData( $metaStorage );
foreach( $this->storageStack as $storageConf )
{
call_user_func(
... | php | public function store( $id, $data, $attributes = array() )
{
$metaStorage = $this->getMetaDataStorage();
$metaStorage->lock();
$metaData = $this->getMetaData( $metaStorage );
foreach( $this->storageStack as $storageConf )
{
call_user_func(
... | [
"public",
"function",
"store",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"metaStorage",
"=",
"$",
"this",
"->",
"getMetaDataStorage",
"(",
")",
";",
"$",
"metaStorage",
"->",
"lock",
"(",
")",
... | Stores data in the cache stack.
This method will store the given data across the complete stack. It can
afterwards be restored using the {@link ezcCacheStack::restore()} method
and be deleted through the {@link ezcCacheStack::delete()} method.
The data that can be stored in the cache depends on the configured
storage... | [
"Stores",
"data",
"in",
"the",
"cache",
"stack",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L207-L231 |
21,849 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.getMetaData | private function getMetaData( ezcCacheStackMetaDataStorage $metaStorage )
{
$metaData = $metaStorage->restoreMetaData();
if ( $metaData === null )
{
$metaData = call_user_func(
array(
$this->properties['options']->replacementStrategy,
... | php | private function getMetaData( ezcCacheStackMetaDataStorage $metaStorage )
{
$metaData = $metaStorage->restoreMetaData();
if ( $metaData === null )
{
$metaData = call_user_func(
array(
$this->properties['options']->replacementStrategy,
... | [
"private",
"function",
"getMetaData",
"(",
"ezcCacheStackMetaDataStorage",
"$",
"metaStorage",
")",
"{",
"$",
"metaData",
"=",
"$",
"metaStorage",
"->",
"restoreMetaData",
"(",
")",
";",
"if",
"(",
"$",
"metaData",
"===",
"null",
")",
"{",
"$",
"metaData",
"... | Returns the meta data to use.
Returns the meta data to use with the configured {@link
ezcCacheStackStackReplacementStrategy}.
@param ezcCacheStackMetaDataStorage $metaStorage
@return ezcCacheMetaData | [
"Returns",
"the",
"meta",
"data",
"to",
"use",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L242-L257 |
21,850 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.restore | public function restore( $id, $attributes = array(), $search = false )
{
$metaStorage = $this->getMetaDataStorage();
$metaStorage->lock();
$metaData = $this->getMetaData( $metaStorage );
$item = false;
foreach ( $this->storageStack as $storageConf )
{
$i... | php | public function restore( $id, $attributes = array(), $search = false )
{
$metaStorage = $this->getMetaDataStorage();
$metaStorage->lock();
$metaData = $this->getMetaData( $metaStorage );
$item = false;
foreach ( $this->storageStack as $storageConf )
{
$i... | [
"public",
"function",
"restore",
"(",
"$",
"id",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"search",
"=",
"false",
")",
"{",
"$",
"metaStorage",
"=",
"$",
"this",
"->",
"getMetaDataStorage",
"(",
")",
";",
"$",
"metaStorage",
"->",
"l... | Restores an item from the stack.
This method tries to restore an item from the cache stack and returns
the found data, if any. If no data is found, boolean false is returned.
Given the ID of an object will restore exactly the desired object. If
additional $attributes are given, this may speed up the restore process
fo... | [
"Restores",
"an",
"item",
"from",
"the",
"stack",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L277-L313 |
21,851 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.delete | public function delete( $id = null, $attributes = array(), $search = false )
{
$metaStorage = $this->getMetaDataStorage();
$metaStorage->lock();
$metaData = $metaStorage->restoreMetaData();
$deletedIds = array();
foreach ( $this->storageStack as $storageConf )
{
... | php | public function delete( $id = null, $attributes = array(), $search = false )
{
$metaStorage = $this->getMetaDataStorage();
$metaStorage->lock();
$metaData = $metaStorage->restoreMetaData();
$deletedIds = array();
foreach ( $this->storageStack as $storageConf )
{
... | [
"public",
"function",
"delete",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
",",
"$",
"search",
"=",
"false",
")",
"{",
"$",
"metaStorage",
"=",
"$",
"this",
"->",
"getMetaDataStorage",
"(",
")",
";",
"$",
"metaStorag... | Deletes an item from the stack.
This method deletes an item from the cache stack. The item will
afterwards no more be stored in any of the inner cache storages. Giving
the ID of the cache item will delete exactly 1 desired item. Giving an
attribute array, describing the desired item in more detail, can speed
up the de... | [
"Deletes",
"an",
"item",
"from",
"the",
"stack",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L372-L402 |
21,852 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.getMetaDataStorage | private function getMetaDataStorage()
{
$metaStorage = $this->options->metaStorage;
if ( $metaStorage === null )
{
$metaStorage = reset( $this->storageStack )->storage;
if ( !( $metaStorage instanceof ezcCacheStackMetaDataStorage ) )
{
thro... | php | private function getMetaDataStorage()
{
$metaStorage = $this->options->metaStorage;
if ( $metaStorage === null )
{
$metaStorage = reset( $this->storageStack )->storage;
if ( !( $metaStorage instanceof ezcCacheStackMetaDataStorage ) )
{
thro... | [
"private",
"function",
"getMetaDataStorage",
"(",
")",
"{",
"$",
"metaStorage",
"=",
"$",
"this",
"->",
"options",
"->",
"metaStorage",
";",
"if",
"(",
"$",
"metaStorage",
"===",
"null",
")",
"{",
"$",
"metaStorage",
"=",
"reset",
"(",
"$",
"this",
"->",... | Returns the meta data storage to be used.
Determines the meta data storage to be used by the stack and returns it.
@return ezcCacheStackMetaData | [
"Returns",
"the",
"meta",
"data",
"storage",
"to",
"be",
"used",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L411-L428 |
21,853 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.countDataItems | public function countDataItems( $id = null, $attributes = array() )
{
$sum = 0;
foreach( $this->storageStack as $storageConf )
{
$sum += $storageConf->storage->countDataItems( $id, $attributes );
}
return $sum;
} | php | public function countDataItems( $id = null, $attributes = array() )
{
$sum = 0;
foreach( $this->storageStack as $storageConf )
{
$sum += $storageConf->storage->countDataItems( $id, $attributes );
}
return $sum;
} | [
"public",
"function",
"countDataItems",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"sum",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"storageStack",
"as",
"$",
"storageConf",
")",
"{",
"$",
"s... | Counts how many items are stored, fulfilling certain criteria.
This method counts how many data items fulfilling the given criteria are
stored overall. Note: The items of all contained storages are counted
independantly and summarized.
@param string $id
@param array $attributes
@return int | [
"Counts",
"how",
"many",
"items",
"are",
"stored",
"fulfilling",
"certain",
"criteria",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L441-L449 |
21,854 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.getRemainingLifetime | public function getRemainingLifetime( $id, $attributes = array() )
{
foreach ( $this->storageStack as $storageConf )
{
$lifetime = $storageConf->storage->getRemainingLifetime(
$id,
$attributes
);
if ( $lifetime > 0 )
{
... | php | public function getRemainingLifetime( $id, $attributes = array() )
{
foreach ( $this->storageStack as $storageConf )
{
$lifetime = $storageConf->storage->getRemainingLifetime(
$id,
$attributes
);
if ( $lifetime > 0 )
{
... | [
"public",
"function",
"getRemainingLifetime",
"(",
"$",
"id",
",",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"storageStack",
"as",
"$",
"storageConf",
")",
"{",
"$",
"lifetime",
"=",
"$",
"storageConf",
"->",... | Returns the remaining lifetime for the given item ID.
This method returns the lifetime in seconds for the item identified by $item
and optionally described by $attributes. Definining the $attributes
might lead to faster results with some caches.
The first internal storage that is found for the data item is chosen to
... | [
"Returns",
"the",
"remaining",
"lifetime",
"for",
"the",
"given",
"item",
"ID",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L466-L480 |
21,855 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.pushStorage | public function pushStorage( ezcCacheStackStorageConfiguration $storageConf )
{
if ( isset( $this->storageIdMap[$storageConf->id] ) )
{
throw new ezcCacheStackIdAlreadyUsedException(
$storageConf->id
);
}
if ( in_array( $storageConf->storage, $... | php | public function pushStorage( ezcCacheStackStorageConfiguration $storageConf )
{
if ( isset( $this->storageIdMap[$storageConf->id] ) )
{
throw new ezcCacheStackIdAlreadyUsedException(
$storageConf->id
);
}
if ( in_array( $storageConf->storage, $... | [
"public",
"function",
"pushStorage",
"(",
"ezcCacheStackStorageConfiguration",
"$",
"storageConf",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"storageIdMap",
"[",
"$",
"storageConf",
"->",
"id",
"]",
")",
")",
"{",
"throw",
"new",
"ezcCacheStackIdAl... | Add a storage to the top of the stack.
This method is used to add a new storage to the top of the cache. The
$storageConf of type {@link ezcCacheStackStorageConfiguration} consists
of the actual {@link ezcCacheStackableStorage} and other information.
Most importantly, the configuration object contains an ID, which mu... | [
"Add",
"a",
"storage",
"to",
"the",
"top",
"of",
"the",
"stack",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L498-L514 |
21,856 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php | ezcCacheStack.popStorage | public function popStorage()
{
if ( count( $this->storageStack ) === 0 )
{
throw new ezcCacheStackUnderflowException();
}
$storageConf = array_shift( $this->storageStack );
unset( $this->storageIdMap[$storageConf->id] );
return $storageConf;
} | php | public function popStorage()
{
if ( count( $this->storageStack ) === 0 )
{
throw new ezcCacheStackUnderflowException();
}
$storageConf = array_shift( $this->storageStack );
unset( $this->storageIdMap[$storageConf->id] );
return $storageConf;
} | [
"public",
"function",
"popStorage",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"storageStack",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"ezcCacheStackUnderflowException",
"(",
")",
";",
"}",
"$",
"storageConf",
"=",
"array_shift",
"(",
... | Removes a storage from the top of the stack.
This method can be used to remove the top most {@link
ezcCacheStackableStorage} from the stack. This is commonly done to
remove caches or to insert new ones into lower positions. In both cases,
it is recommended to {@link ezcCacheStack::reset()} the whole cache
afterwards t... | [
"Removes",
"a",
"storage",
"from",
"the",
"top",
"of",
"the",
"stack",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/stack.php#L530-L539 |
21,857 | fccn/oai-pmh-core | src/libs/xml_creater.php | ANDS_XML.create_request | public function create_request($par_array)
{
//debug_var_dump('par_array', $par_array);
$request = $this->addChild($this->doc->documentElement, "request", $this->request_url());
foreach ($par_array as $key => $value) {
$request->setAttribute($key, $value);
}
} | php | public function create_request($par_array)
{
//debug_var_dump('par_array', $par_array);
$request = $this->addChild($this->doc->documentElement, "request", $this->request_url());
foreach ($par_array as $key => $value) {
$request->setAttribute($key, $value);
}
} | [
"public",
"function",
"create_request",
"(",
"$",
"par_array",
")",
"{",
"//debug_var_dump('par_array', $par_array);",
"$",
"request",
"=",
"$",
"this",
"->",
"addChild",
"(",
"$",
"this",
"->",
"doc",
"->",
"documentElement",
",",
"\"request\"",
",",
"$",
"this... | Create an OAI request node.
@param $par_array Type: array
The attributes of a request node. They describe the verb of the request and other associated parameters used in the request.
Keys of the array define attributes, and values are their content. | [
"Create",
"an",
"OAI",
"request",
"node",
"."
] | a9c6852482c7bd7c48911a2165120325ecc27ea2 | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/libs/xml_creater.php#L253-L260 |
21,858 | fccn/oai-pmh-core | src/libs/xml_creater.php | ANDS_Response_XML.create_resumpToken | public function create_resumpToken($token, $expirationdatetime, $num_rows, $cursor=null)
{
$resump_node = $this->addChild($this->verbNode, "resumptionToken", $token);
if (isset($expirationdatetime)) {
$resump_node->setAttribute("expirationDate", $expirationdatetime);
}
$r... | php | public function create_resumpToken($token, $expirationdatetime, $num_rows, $cursor=null)
{
$resump_node = $this->addChild($this->verbNode, "resumptionToken", $token);
if (isset($expirationdatetime)) {
$resump_node->setAttribute("expirationDate", $expirationdatetime);
}
$r... | [
"public",
"function",
"create_resumpToken",
"(",
"$",
"token",
",",
"$",
"expirationdatetime",
",",
"$",
"num_rows",
",",
"$",
"cursor",
"=",
"null",
")",
"{",
"$",
"resump_node",
"=",
"$",
"this",
"->",
"addChild",
"(",
"$",
"this",
"->",
"verbNode",
",... | If there are too many records request could not finished a resumpToken is generated to let harvester know
\param $token Type: string. A random number created somewhere?
\param $expirationdatetime Type: string. A string representing time.
\param $num_rows Type: integer. Number of records retrieved.
\param $cursor Type:... | [
"If",
"there",
"are",
"too",
"many",
"records",
"request",
"could",
"not",
"finished",
"a",
"resumpToken",
"is",
"generated",
"to",
"let",
"harvester",
"know"
] | a9c6852482c7bd7c48911a2165120325ecc27ea2 | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/libs/xml_creater.php#L397-L405 |
21,859 | SporkCode/Spork | src/Mvc/Listener/AccessDeniedStrategy.php | AccessDeniedStrategy.detectAccessDenied | public function detectAccessDenied(MvcEvent $event)
{
$response = $event->getResponse();
if ($response->getStatusCode() == 403) {
$event->setError('Access Denied');
$event->stopPropagation(true);
}
} | php | public function detectAccessDenied(MvcEvent $event)
{
$response = $event->getResponse();
if ($response->getStatusCode() == 403) {
$event->setError('Access Denied');
$event->stopPropagation(true);
}
} | [
"public",
"function",
"detectAccessDenied",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"response",
"=",
"$",
"event",
"->",
"getResponse",
"(",
")",
";",
"if",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
"==",
"403",
")",
"{",
"$",
"event... | If response status code is 403 set error state and stop event propagation
@param MvcEvent $event | [
"If",
"response",
"status",
"code",
"is",
"403",
"set",
"error",
"state",
"and",
"stop",
"event",
"propagation"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Listener/AccessDeniedStrategy.php#L133-L140 |
21,860 | SporkCode/Spork | src/Mvc/Listener/AccessDeniedStrategy.php | AccessDeniedStrategy.injectAccessDeniedViewModel | public function injectAccessDeniedViewModel(MvcEvent $event)
{
$this->config($event);
$result = $event->getResult();
if ($result instanceof ResponseInterface) {
return;
}
$response = $event->getResponse();
if ($response-... | php | public function injectAccessDeniedViewModel(MvcEvent $event)
{
$this->config($event);
$result = $event->getResult();
if ($result instanceof ResponseInterface) {
return;
}
$response = $event->getResponse();
if ($response-... | [
"public",
"function",
"injectAccessDeniedViewModel",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"this",
"->",
"config",
"(",
"$",
"event",
")",
";",
"$",
"result",
"=",
"$",
"event",
"->",
"getResult",
"(",
")",
";",
"if",
"(",
"$",
"result",
"insta... | Inject access denied View Model is response status is 403
@param MvcEvent $event | [
"Inject",
"access",
"denied",
"View",
"Model",
"is",
"response",
"status",
"is",
"403"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Listener/AccessDeniedStrategy.php#L147-L173 |
21,861 | SporkCode/Spork | src/Mvc/Listener/AccessDeniedStrategy.php | AccessDeniedStrategy.config | protected function config(MvcEvent $event)
{
$appConfig = $event->getApplication()->getServiceManager()->get('config');
$config = array_key_exists(self::CONFIG_KEY, $appConfig) ? $appConfig[self::CONFIG_KEY] : array();
if (array_key_exists('template', $config)) {
$this->... | php | protected function config(MvcEvent $event)
{
$appConfig = $event->getApplication()->getServiceManager()->get('config');
$config = array_key_exists(self::CONFIG_KEY, $appConfig) ? $appConfig[self::CONFIG_KEY] : array();
if (array_key_exists('template', $config)) {
$this->... | [
"protected",
"function",
"config",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"appConfig",
"=",
"$",
"event",
"->",
"getApplication",
"(",
")",
"->",
"getServiceManager",
"(",
")",
"->",
"get",
"(",
"'config'",
")",
";",
"$",
"config",
"=",
"array_key... | Set configuration options from application configuration
@param MvcEvent $event | [
"Set",
"configuration",
"options",
"from",
"application",
"configuration"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Listener/AccessDeniedStrategy.php#L180-L192 |
21,862 | shabbyrobe/amiss | src/Functions.php | Functions.keyValue | public static function keyValue($list, $keyProperty=null, $valueProperty=null)
{
$index = array();
foreach ($list as $i) {
if ($keyProperty) {
if (!$valueProperty) {
throw new \InvalidArgumentException("Must set value property if setting key property"... | php | public static function keyValue($list, $keyProperty=null, $valueProperty=null)
{
$index = array();
foreach ($list as $i) {
if ($keyProperty) {
if (!$valueProperty) {
throw new \InvalidArgumentException("Must set value property if setting key property"... | [
"public",
"static",
"function",
"keyValue",
"(",
"$",
"list",
",",
"$",
"keyProperty",
"=",
"null",
",",
"$",
"valueProperty",
"=",
"null",
")",
"{",
"$",
"index",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"i",
")",
"{",
... | Create a one-dimensional associative array from a list of objects, or a list of 2-tuples.
@param object[]|array $list
@param string $keyProperty
@param string $valueProperty
@return array | [
"Create",
"a",
"one",
"-",
"dimensional",
"associative",
"array",
"from",
"a",
"list",
"of",
"objects",
"or",
"a",
"list",
"of",
"2",
"-",
"tuples",
"."
] | ba261f0d1f985ed36e9fd2903ac0df86c5b9498d | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Functions.php#L14-L32 |
21,863 | nabab/bbn | src/bbn/user/session.php | session._get_value | private function _get_value($args){
if ( $this->id ){
$var =& $this->data;
foreach ( $args as $a ){
if ( !isset($var[$a]) ){
return null;
}
$var =& $var[$a];
}
return $var;
}
} | php | private function _get_value($args){
if ( $this->id ){
$var =& $this->data;
foreach ( $args as $a ){
if ( !isset($var[$a]) ){
return null;
}
$var =& $var[$a];
}
return $var;
}
} | [
"private",
"function",
"_get_value",
"(",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"id",
")",
"{",
"$",
"var",
"=",
"&",
"$",
"this",
"->",
"data",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"!",
"isset... | Gets a reference to the part of the data corresponding to an array of indexes
```php
$this->_get_value(['index1', 'index2'])
// Will return the content of $this->data['index1']['index2']
```
@param $args
@return null | [
"Gets",
"a",
"reference",
"to",
"the",
"part",
"of",
"the",
"data",
"corresponding",
"to",
"an",
"array",
"of",
"indexes"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/session.php#L54-L65 |
21,864 | zicht/z | src/Zicht/Tool/Container/Declaration.php | Declaration.compileBody | protected function compileBody(Buffer $buffer)
{
$buffer->write('return ');
$this->expr->compile($buffer);
$buffer->raw(';');
} | php | protected function compileBody(Buffer $buffer)
{
$buffer->write('return ');
$this->expr->compile($buffer);
$buffer->raw(';');
} | [
"protected",
"function",
"compileBody",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"$",
"buffer",
"->",
"write",
"(",
"'return '",
")",
";",
"$",
"this",
"->",
"expr",
"->",
"compile",
"(",
"$",
"buffer",
")",
";",
"$",
"buffer",
"->",
"raw",
"(",
"';'"... | Compiles the definition body
@param \Zicht\Tool\Script\Buffer $buffer
@return void | [
"Compiles",
"the",
"definition",
"body"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Declaration.php#L53-L58 |
21,865 | surebert/surebert-framework | src/sb/Controller/JSON/RPC2/Server.php | Server.useEncryption | public function useEncryption($key)
{
$this->encryptor = new \sb\Encryption\ForTransmission($key);
$this->encryption_key = $key;
//decrypt cookies if sent
foreach (\sb\Gateway::$cookie as $k => $v) {
\sb\Gateway::$cookie[$k] = $this->encryptor->decrypt($v);
}
... | php | public function useEncryption($key)
{
$this->encryptor = new \sb\Encryption\ForTransmission($key);
$this->encryption_key = $key;
//decrypt cookies if sent
foreach (\sb\Gateway::$cookie as $k => $v) {
\sb\Gateway::$cookie[$k] = $this->encryptor->decrypt($v);
}
... | [
"public",
"function",
"useEncryption",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"encryptor",
"=",
"new",
"\\",
"sb",
"\\",
"Encryption",
"\\",
"ForTransmission",
"(",
"$",
"key",
")",
";",
"$",
"this",
"->",
"encryption_key",
"=",
"$",
"key",
";",... | Sets the key that data is encrypted with and turns on encryption,
the client must use the same key
@param $key String | [
"Sets",
"the",
"key",
"that",
"data",
"is",
"encrypted",
"with",
"and",
"turns",
"on",
"encryption",
"the",
"client",
"must",
"use",
"the",
"same",
"key"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/JSON/RPC2/Server.php#L86-L95 |
21,866 | surebert/surebert-framework | src/sb/Controller/JSON/RPC2/Server.php | Server.getMethods | public function getMethods($html = true)
{
$arr = Array();
foreach($this->served_classes as $class){
foreach (\get_class_methods($class) as $method) {
$reflect = new \ReflectionMethod($class, $method);
if ($reflect) {
... | php | public function getMethods($html = true)
{
$arr = Array();
foreach($this->served_classes as $class){
foreach (\get_class_methods($class) as $method) {
$reflect = new \ReflectionMethod($class, $method);
if ($reflect) {
... | [
"public",
"function",
"getMethods",
"(",
"$",
"html",
"=",
"true",
")",
"{",
"$",
"arr",
"=",
"Array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"served_classes",
"as",
"$",
"class",
")",
"{",
"foreach",
"(",
"\\",
"get_class_methods",
"(",
"... | Get the methods available for this \sb\JSON\RPC2_Server instance
@return Array - Object once json_encoded
@servable true | [
"Get",
"the",
"methods",
"available",
"for",
"this",
"\\",
"sb",
"\\",
"JSON",
"\\",
"RPC2_Server",
"instance"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/JSON/RPC2/Server.php#L102-L149 |
21,867 | surebert/surebert-framework | src/sb/Controller/JSON/RPC2/Server.php | Server.getPhpdoc | protected function getPhpdoc($method)
{
$reflect = false;
foreach($this->served_classes as $class){
if (\method_exists($class, $method)) {
$reflect = new \ReflectionMethod($class, $method);
break;
}
}
... | php | protected function getPhpdoc($method)
{
$reflect = false;
foreach($this->served_classes as $class){
if (\method_exists($class, $method)) {
$reflect = new \ReflectionMethod($class, $method);
break;
}
}
... | [
"protected",
"function",
"getPhpdoc",
"(",
"$",
"method",
")",
"{",
"$",
"reflect",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"served_classes",
"as",
"$",
"class",
")",
"{",
"if",
"(",
"\\",
"method_exists",
"(",
"$",
"class",
",",
"$",
"... | Get php doc and return_type for method by name
@param string $name The name of the method to grab the docs for
@return Object with return_type and phpdoc property | [
"Get",
"php",
"doc",
"and",
"return_type",
"for",
"method",
"by",
"name"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/JSON/RPC2/Server.php#L156-L187 |
21,868 | surebert/surebert-framework | src/sb/Controller/JSON/RPC2/Server.php | Server.methodsToHtml | protected function methodsToHtml($methods)
{
$html = '<style type="text/css">
li{background-color:#c8c8d4;}
h1{
font-size:1.0em;
padding:3px 0 3px 10px;
color:white;
background-color:#8181bd;
}
pre{
... | php | protected function methodsToHtml($methods)
{
$html = '<style type="text/css">
li{background-color:#c8c8d4;}
h1{
font-size:1.0em;
padding:3px 0 3px 10px;
color:white;
background-color:#8181bd;
}
pre{
... | [
"protected",
"function",
"methodsToHtml",
"(",
"$",
"methods",
")",
"{",
"$",
"html",
"=",
"'<style type=\"text/css\">\n li{background-color:#c8c8d4;}\n\n h1{\n font-size:1.0em;\n padding:3px 0 3px 10px;\n color:white;\n backgro... | Coverts the methods served into an HTML string
@param $arr
@return string HTML | [
"Coverts",
"the",
"methods",
"served",
"into",
"an",
"HTML",
"string"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/JSON/RPC2/Server.php#L194-L221 |
21,869 | mekras/atompub | src/Element/Collection.php | Collection.getAcceptedTypes | public function getAcceptedTypes()
{
return $this->getCachedProperty(
'accept',
function () {
$result = [];
/** @var \DOMNodeList $nodes */
// No REQUIRED — no exception.
$nodes = $this->query('app:accept');
... | php | public function getAcceptedTypes()
{
return $this->getCachedProperty(
'accept',
function () {
$result = [];
/** @var \DOMNodeList $nodes */
// No REQUIRED — no exception.
$nodes = $this->query('app:accept');
... | [
"public",
"function",
"getAcceptedTypes",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"getCachedProperty",
"(",
"'accept'",
",",
"function",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"/** @var \\DOMNodeList $nodes */",
"// No REQUIRED — no exception.",
"$"... | Return types of representations accepted by the Collection.
@return string[]
@since 1.0 | [
"Return",
"types",
"of",
"representations",
"accepted",
"by",
"the",
"Collection",
"."
] | cfc9aab97cff7a822b720e1dd84ef16733183dbb | https://github.com/mekras/atompub/blob/cfc9aab97cff7a822b720e1dd84ef16733183dbb/src/Element/Collection.php#L56-L72 |
21,870 | mekras/atompub | src/Element/Collection.php | Collection.setAcceptedTypes | public function setAcceptedTypes(array $types)
{
/** @var \DOMNodeList $nodes */
// No REQUIRED — no exception.
$nodes = $this->query('app:accept');
foreach ($nodes as $node) {
$this->getDomElement()->removeChild($node);
}
foreach ($types as $type) {
... | php | public function setAcceptedTypes(array $types)
{
/** @var \DOMNodeList $nodes */
// No REQUIRED — no exception.
$nodes = $this->query('app:accept');
foreach ($nodes as $node) {
$this->getDomElement()->removeChild($node);
}
foreach ($types as $type) {
... | [
"public",
"function",
"setAcceptedTypes",
"(",
"array",
"$",
"types",
")",
"{",
"/** @var \\DOMNodeList $nodes */",
"// No REQUIRED — no exception.",
"$",
"nodes",
"=",
"$",
"this",
"->",
"query",
"(",
"'app:accept'",
")",
";",
"foreach",
"(",
"$",
"nodes",
"as",
... | Set types of representations accepted by the Collection.
@param string[] $types
@since 1.0 | [
"Set",
"types",
"of",
"representations",
"accepted",
"by",
"the",
"Collection",
"."
] | cfc9aab97cff7a822b720e1dd84ef16733183dbb | https://github.com/mekras/atompub/blob/cfc9aab97cff7a822b720e1dd84ef16733183dbb/src/Element/Collection.php#L81-L95 |
21,871 | WellCommerce/AppBundle | Controller/RedirectingController.php | RedirectingController.removeTrailingSlashAction | public function removeTrailingSlashAction(Request $request)
{
$pathInfo = $request->getPathInfo();
$requestUri = $request->getRequestUri();
$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
return $this->redirect($url, 301);
} | php | public function removeTrailingSlashAction(Request $request)
{
$pathInfo = $request->getPathInfo();
$requestUri = $request->getRequestUri();
$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
return $this->redirect($url, 301);
} | [
"public",
"function",
"removeTrailingSlashAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"pathInfo",
"=",
"$",
"request",
"->",
"getPathInfo",
"(",
")",
";",
"$",
"requestUri",
"=",
"$",
"request",
"->",
"getRequestUri",
"(",
")",
";",
"$",
"url",... | Action used to remove trailing slash in url
@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Action",
"used",
"to",
"remove",
"trailing",
"slash",
"in",
"url"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Controller/RedirectingController.php#L32-L40 |
21,872 | antaresproject/notifications | src/Http/Presenters/IndexPresenter.php | IndexPresenter.edit | public function edit($eloquent, $locale)
{
$this->breadcrumb->onEdit($eloquent);
$form = $this->getForm($eloquent);
return $this->view('edit', compact('form'));
} | php | public function edit($eloquent, $locale)
{
$this->breadcrumb->onEdit($eloquent);
$form = $this->getForm($eloquent);
return $this->view('edit', compact('form'));
} | [
"public",
"function",
"edit",
"(",
"$",
"eloquent",
",",
"$",
"locale",
")",
"{",
"$",
"this",
"->",
"breadcrumb",
"->",
"onEdit",
"(",
"$",
"eloquent",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
"$",
"eloquent",
")",
";",
"retu... | shows form edit job
@param Model $eloquent
@param String $locale
@return View | [
"shows",
"form",
"edit",
"job"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Presenters/IndexPresenter.php#L82-L87 |
21,873 | antaresproject/notifications | src/Http/Presenters/IndexPresenter.php | IndexPresenter.getForm | public function getForm($eloquent, $type = null)
{
$classname = $eloquent->classname;
$model = $eloquent->contents->first();
$configuration = [
'content' => $model !== null ? $model->content : null,
'title' => $model !== null ? $model->title ... | php | public function getForm($eloquent, $type = null)
{
$classname = $eloquent->classname;
$model = $eloquent->contents->first();
$configuration = [
'content' => $model !== null ? $model->content : null,
'title' => $model !== null ? $model->title ... | [
"public",
"function",
"getForm",
"(",
"$",
"eloquent",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"classname",
"=",
"$",
"eloquent",
"->",
"classname",
";",
"$",
"model",
"=",
"$",
"eloquent",
"->",
"contents",
"->",
"first",
"(",
")",
";",
"$",
... | gets form instance
@param Model $eloquent
@return FormBuilder
@throws Exception | [
"gets",
"form",
"instance"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Presenters/IndexPresenter.php#L96-L114 |
21,874 | antaresproject/notifications | src/Http/Presenters/IndexPresenter.php | IndexPresenter.form | protected function form(Fluent $fluent, $notification = null)
{
publish('notifications', 'scripts.resources-default');
Event::fire('antares.forms', 'notification.' . $fluent->form_name);
$fluent->type = $fluent->type === '' ? 'email' : $fluent->type;
return new Form($notification, $... | php | protected function form(Fluent $fluent, $notification = null)
{
publish('notifications', 'scripts.resources-default');
Event::fire('antares.forms', 'notification.' . $fluent->form_name);
$fluent->type = $fluent->type === '' ? 'email' : $fluent->type;
return new Form($notification, $... | [
"protected",
"function",
"form",
"(",
"Fluent",
"$",
"fluent",
",",
"$",
"notification",
"=",
"null",
")",
"{",
"publish",
"(",
"'notifications'",
",",
"'scripts.resources-default'",
")",
";",
"Event",
"::",
"fire",
"(",
"'antares.forms'",
",",
"'notification.'"... | gets instance of command form
@param Fluent $fluent
@param mixed $notification
@return FormBuilder | [
"gets",
"instance",
"of",
"command",
"form"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Presenters/IndexPresenter.php#L123-L130 |
21,875 | antaresproject/notifications | src/Http/Presenters/IndexPresenter.php | IndexPresenter.create | public function create(Model $model, $type = null)
{
$this->breadcrumb->onCreate($type);
$form = $this->getForm($model, $type)->onCreate();
return $this->view('create', ['form' => $form]);
} | php | public function create(Model $model, $type = null)
{
$this->breadcrumb->onCreate($type);
$form = $this->getForm($model, $type)->onCreate();
return $this->view('create', ['form' => $form]);
} | [
"public",
"function",
"create",
"(",
"Model",
"$",
"model",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"breadcrumb",
"->",
"onCreate",
"(",
"$",
"type",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"getForm",
"(",
"$",
"model",
... | create new notification notification
@param Model $model
@param String $type
@return View | [
"create",
"new",
"notification",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Http/Presenters/IndexPresenter.php#L150-L156 |
21,876 | antaresproject/notifications | src/Processor/IndexProcessor.php | IndexProcessor.edit | public function edit($id, $locale, IndexListener $listener)
{
app('antares.asset')->container('antares/foundation::application')->add('ckeditor', '/packages/ckeditor/ckeditor.js', ['webpack_forms_basic']);
$model = $this->repository->findByLocale($id, $locale);
if (is_null($model)) {
... | php | public function edit($id, $locale, IndexListener $listener)
{
app('antares.asset')->container('antares/foundation::application')->add('ckeditor', '/packages/ckeditor/ckeditor.js', ['webpack_forms_basic']);
$model = $this->repository->findByLocale($id, $locale);
if (is_null($model)) {
... | [
"public",
"function",
"edit",
"(",
"$",
"id",
",",
"$",
"locale",
",",
"IndexListener",
"$",
"listener",
")",
"{",
"app",
"(",
"'antares.asset'",
")",
"->",
"container",
"(",
"'antares/foundation::application'",
")",
"->",
"add",
"(",
"'ckeditor'",
",",
"'/p... | shows edit form
@param mixed $id
@param String $locale
@param IndexListener $listener
@return View | [
"shows",
"edit",
"form"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/IndexProcessor.php#L89-L97 |
21,877 | antaresproject/notifications | src/Processor/IndexProcessor.php | IndexProcessor.update | public function update(IndexListener $listener)
{
$id = Input::get('id');
$model = $this->repository->find($id);
$form = $this->presenter->getForm($model);
if (!$form->isValid()) {
return $listener->updateValidationFailed($id, $form->getMessageBag());
}
... | php | public function update(IndexListener $listener)
{
$id = Input::get('id');
$model = $this->repository->find($id);
$form = $this->presenter->getForm($model);
if (!$form->isValid()) {
return $listener->updateValidationFailed($id, $form->getMessageBag());
}
... | [
"public",
"function",
"update",
"(",
"IndexListener",
"$",
"listener",
")",
"{",
"$",
"id",
"=",
"Input",
"::",
"get",
"(",
"'id'",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"repository",
"->",
"find",
"(",
"$",
"id",
")",
";",
"$",
"form",
... | updates notification notification
@param IndexListener $listener
@return RedirectResponse | [
"updates",
"notification",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/IndexProcessor.php#L105-L120 |
21,878 | antaresproject/notifications | src/Processor/IndexProcessor.php | IndexProcessor.preview | public function preview()
{
$inputs = Input::all();
$content = str_replace("'", '"', $inputs['content']);
$content = $this->variablesAdapter->get($content);
if( isset($inputs['subject']) ) {
$subject = str_replace("'", '"', $inputs['subject']);
$subj... | php | public function preview()
{
$inputs = Input::all();
$content = str_replace("'", '"', $inputs['content']);
$content = $this->variablesAdapter->get($content);
if( isset($inputs['subject']) ) {
$subject = str_replace("'", '"', $inputs['subject']);
$subj... | [
"public",
"function",
"preview",
"(",
")",
"{",
"$",
"inputs",
"=",
"Input",
"::",
"all",
"(",
")",
";",
"$",
"content",
"=",
"str_replace",
"(",
"\"'\"",
",",
"'\"'",
",",
"$",
"inputs",
"[",
"'content'",
"]",
")",
";",
"$",
"content",
"=",
"$... | preview notification notification
@return View | [
"preview",
"notification",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/IndexProcessor.php#L180-L207 |
21,879 | antaresproject/notifications | src/Processor/IndexProcessor.php | IndexProcessor.changeStatus | public function changeStatus(IndexListener $listener, $id)
{
$model = $this->repository->find($id);
if (is_null($model)) {
return $listener->changeStatusFailed();
}
$model->active = $model->active ? 0 : 1;
$model->save();
return $listener->changeStatusSucc... | php | public function changeStatus(IndexListener $listener, $id)
{
$model = $this->repository->find($id);
if (is_null($model)) {
return $listener->changeStatusFailed();
}
$model->active = $model->active ? 0 : 1;
$model->save();
return $listener->changeStatusSucc... | [
"public",
"function",
"changeStatus",
"(",
"IndexListener",
"$",
"listener",
",",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"repository",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"model",
")",
")",
"{... | change notification notification status
@param IndexListener $listener
@param mixed $id
@return RedirectResponse | [
"change",
"notification",
"notification",
"status"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/IndexProcessor.php#L216-L225 |
21,880 | antaresproject/notifications | src/Processor/IndexProcessor.php | IndexProcessor.create | public function create($type = null)
{
app('antares.asset')->container('antares/foundation::application')->add('ckeditor', '/packages/ckeditor/ckeditor.js', ['webpack_forms_basic']);
return $this->presenter->create($this->repository->makeModel()->getModel(), $type);
} | php | public function create($type = null)
{
app('antares.asset')->container('antares/foundation::application')->add('ckeditor', '/packages/ckeditor/ckeditor.js', ['webpack_forms_basic']);
return $this->presenter->create($this->repository->makeModel()->getModel(), $type);
} | [
"public",
"function",
"create",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"app",
"(",
"'antares.asset'",
")",
"->",
"container",
"(",
"'antares/foundation::application'",
")",
"->",
"add",
"(",
"'ckeditor'",
",",
"'/packages/ckeditor/ckeditor.js'",
",",
"[",
"'we... | Create notification notification form
@param String $type
@return View | [
"Create",
"notification",
"notification",
"form"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/IndexProcessor.php#L233-L237 |
21,881 | antaresproject/notifications | src/Processor/IndexProcessor.php | IndexProcessor.store | public function store(IndexListener $listener)
{
$model = $this->repository->makeModel()->getModel();
$form = $this->presenter->getForm($model)->onCreate();
if (!$form->isValid()) {
return $listener->storeValidationFailed($form->getMessageBag());
}
try {
... | php | public function store(IndexListener $listener)
{
$model = $this->repository->makeModel()->getModel();
$form = $this->presenter->getForm($model)->onCreate();
if (!$form->isValid()) {
return $listener->storeValidationFailed($form->getMessageBag());
}
try {
... | [
"public",
"function",
"store",
"(",
"IndexListener",
"$",
"listener",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"repository",
"->",
"makeModel",
"(",
")",
"->",
"getModel",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"presenter",
"->",
... | store new notification notification
@param IndexListener $listener
@return RedirectResponse | [
"store",
"new",
"notification",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/IndexProcessor.php#L245-L258 |
21,882 | antaresproject/notifications | src/Processor/IndexProcessor.php | IndexProcessor.delete | public function delete($id, IndexListener $listener)
{
try {
$model = $this->repository->makeModel()->findOrFail($id);
$model->delete();
return $listener->deleteSuccess();
} catch (Exception $ex) {
return $listener->deleteFailed();
}
} | php | public function delete($id, IndexListener $listener)
{
try {
$model = $this->repository->makeModel()->findOrFail($id);
$model->delete();
return $listener->deleteSuccess();
} catch (Exception $ex) {
return $listener->deleteFailed();
}
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
",",
"IndexListener",
"$",
"listener",
")",
"{",
"try",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"repository",
"->",
"makeModel",
"(",
")",
"->",
"findOrFail",
"(",
"$",
"id",
")",
";",
"$",
"model",
... | deletes custom notification
@param mixed $id
@param IndexListener $listener
@return RedirectResponse | [
"deletes",
"custom",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/IndexProcessor.php#L267-L276 |
21,883 | i-lateral/silverstripe-modeladminplus | src/ModelAdminPlus.php | ModelAdminPlus.getExportFields | public function getExportFields()
{
$export_fields = Config::inst()->get(
$this->modelClass,
self::EXPORT_FIELDS
);
if (isset($export_fields) && is_array($export_fields)) {
$fields = $export_fields;
} else {
$fields = parent::getExport... | php | public function getExportFields()
{
$export_fields = Config::inst()->get(
$this->modelClass,
self::EXPORT_FIELDS
);
if (isset($export_fields) && is_array($export_fields)) {
$fields = $export_fields;
} else {
$fields = parent::getExport... | [
"public",
"function",
"getExportFields",
"(",
")",
"{",
"$",
"export_fields",
"=",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"$",
"this",
"->",
"modelClass",
",",
"self",
"::",
"EXPORT_FIELDS",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"export_... | Get the default export fields for the current model.
First this checks if there is an `export_fields` config variable set on
the model class, if not, it reverts to the default behaviour.
@return array | [
"Get",
"the",
"default",
"export",
"fields",
"for",
"the",
"current",
"model",
"."
] | c5209d9610cdb36ddc7b9231fad342df7e75ffc0 | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/ModelAdminPlus.php#L118-L134 |
21,884 | i-lateral/silverstripe-modeladminplus | src/ModelAdminPlus.php | ModelAdminPlus.getSearchSessionName | public function getSearchSessionName()
{
$curr = $this->sanitiseClassName(self::class);
$model = $this->sanitiseClassName($this->modelClass);
return $curr . "." . $model;
} | php | public function getSearchSessionName()
{
$curr = $this->sanitiseClassName(self::class);
$model = $this->sanitiseClassName($this->modelClass);
return $curr . "." . $model;
} | [
"public",
"function",
"getSearchSessionName",
"(",
")",
"{",
"$",
"curr",
"=",
"$",
"this",
"->",
"sanitiseClassName",
"(",
"self",
"::",
"class",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"sanitiseClassName",
"(",
"$",
"this",
"->",
"modelClass",
... | Get the name of the session to be useed by this model admin's search
form.
@return string | [
"Get",
"the",
"name",
"of",
"the",
"session",
"to",
"be",
"useed",
"by",
"this",
"model",
"admin",
"s",
"search",
"form",
"."
] | c5209d9610cdb36ddc7b9231fad342df7e75ffc0 | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/ModelAdminPlus.php#L142-L147 |
21,885 | i-lateral/silverstripe-modeladminplus | src/ModelAdminPlus.php | ModelAdminPlus.getEditForm | public function getEditForm($id = null, $fields = null)
{
$form = parent::getEditForm($id, $fields);
$grid_field = $form
->Fields()
->fieldByName($this->sanitiseClassName($this->modelClass));
// Add bulk editing to gridfield
$manager = new BulkManager();
... | php | public function getEditForm($id = null, $fields = null)
{
$form = parent::getEditForm($id, $fields);
$grid_field = $form
->Fields()
->fieldByName($this->sanitiseClassName($this->modelClass));
// Add bulk editing to gridfield
$manager = new BulkManager();
... | [
"public",
"function",
"getEditForm",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"form",
"=",
"parent",
"::",
"getEditForm",
"(",
"$",
"id",
",",
"$",
"fields",
")",
";",
"$",
"grid_field",
"=",
"$",
"form",
"->",
... | Add bulk editor to Edit Form
@param int|null $id
@param FieldList $fields
@return Form A Form object | [
"Add",
"bulk",
"editor",
"to",
"Edit",
"Form"
] | c5209d9610cdb36ddc7b9231fad342df7e75ffc0 | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/ModelAdminPlus.php#L210-L252 |
21,886 | surebert/surebert-framework | src/sb/Cache/Hash.php | Hash.store | public function store($key, $data, $lifetime = 0)
{
if ($lifetime != 0) {
$lifetime = \time() + $lifetime;
}
$data = array($lifetime, $data);
$this->hash[$key] = $data;
if ($key != $this->catalog_key) {
$this->catalogKeyAdd($key, $lifetime);
... | php | public function store($key, $data, $lifetime = 0)
{
if ($lifetime != 0) {
$lifetime = \time() + $lifetime;
}
$data = array($lifetime, $data);
$this->hash[$key] = $data;
if ($key != $this->catalog_key) {
$this->catalogKeyAdd($key, $lifetime);
... | [
"public",
"function",
"store",
"(",
"$",
"key",
",",
"$",
"data",
",",
"$",
"lifetime",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"lifetime",
"!=",
"0",
")",
"{",
"$",
"lifetime",
"=",
"\\",
"time",
"(",
")",
"+",
"$",
"lifetime",
";",
"}",
"$",
"d... | Store the cache data in memcache | [
"Store",
"the",
"cache",
"data",
"in",
"memcache"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Hash.php#L48-L64 |
21,887 | surebert/surebert-framework | src/sb/Cache/Hash.php | Hash.fetch | public function fetch($key)
{
if (!\array_key_exists($key, $this->hash)) {
return false;
}
$data = $this->hash[$key];
//check to see if it expired
if ($data && ($data[0] == 0 || \time() <= $data[0])) {
return $data[1];
} else {
$... | php | public function fetch($key)
{
if (!\array_key_exists($key, $this->hash)) {
return false;
}
$data = $this->hash[$key];
//check to see if it expired
if ($data && ($data[0] == 0 || \time() <= $data[0])) {
return $data[1];
} else {
$... | [
"public",
"function",
"fetch",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"\\",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"hash",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"data",
"=",
"$",
"this",
"->",
"hash",
"[",
"... | Fetches the cache from memcache | [
"Fetches",
"the",
"cache",
"from",
"memcache"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Hash.php#L69-L85 |
21,888 | surebert/surebert-framework | src/sb/Cache/Hash.php | Hash.delete | public function delete($key)
{
$deleted = false;
$catalog = \array_keys($this->getKeys());
foreach ($catalog as $k) {
if ($k == $key) {
unset($this->hash[$key]);
if ($delete) {
$this->catalogKeyDelete($k);
... | php | public function delete($key)
{
$deleted = false;
$catalog = \array_keys($this->getKeys());
foreach ($catalog as $k) {
if ($k == $key) {
unset($this->hash[$key]);
if ($delete) {
$this->catalogKeyDelete($k);
... | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"deleted",
"=",
"false",
";",
"$",
"catalog",
"=",
"\\",
"array_keys",
"(",
"$",
"this",
"->",
"getKeys",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"catalog",
"as",
"$",
"k",
")",
"{"... | Deletes cache data | [
"Deletes",
"cache",
"data"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Hash.php#L90-L108 |
21,889 | VincentChalnot/SidusDataGridBundle | Model/Column.php | Column.renderValue | public function renderValue($object, array $options = []): string
{
$options = array_merge(
['column' => $this, 'object' => $object],
$this->getFormattingOptions(),
$options
);
$accessor = PropertyAccess::createPropertyAccessor();
try {
... | php | public function renderValue($object, array $options = []): string
{
$options = array_merge(
['column' => $this, 'object' => $object],
$this->getFormattingOptions(),
$options
);
$accessor = PropertyAccess::createPropertyAccessor();
try {
... | [
"public",
"function",
"renderValue",
"(",
"$",
"object",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'column'",
"=>",
"$",
"this",
",",
"'object'",
"=>",
"$",
"object",
"]",
","... | Render column for a given result
@param mixed $object
@param array $options
@return string | [
"Render",
"column",
"for",
"a",
"given",
"result"
] | aa929113e2208ed335f514d2891affaf7fddf3f6 | https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/Model/Column.php#L249-L264 |
21,890 | surebert/surebert-framework | src/sb/Logger/FileSystem.php | FileSystem.getLogPath | protected function getLogPath($log)
{
$dir = $this->log_root.'/'.$log.'/';
if(!is_dir($dir)){
mkdir($dir, 0777, true);
}
return $dir;
} | php | protected function getLogPath($log)
{
$dir = $this->log_root.'/'.$log.'/';
if(!is_dir($dir)){
mkdir($dir, 0777, true);
}
return $dir;
} | [
"protected",
"function",
"getLogPath",
"(",
"$",
"log",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"log_root",
".",
"'/'",
".",
"$",
"log",
".",
"'/'",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"mkdir",
"(",
"$",
"dir",
... | Grabs the log path based on the type of log
@param $log Sting the log type. Should be in the $enabled_logs array
@return string The path to the log directory to be used | [
"Grabs",
"the",
"log",
"path",
"based",
"on",
"the",
"type",
"of",
"log"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Logger/FileSystem.php#L40-L50 |
21,891 | surebert/surebert-framework | src/sb/Logger/FileSystem.php | FileSystem.write | protected function write($data, $log_type)
{
return file_put_contents($this->getLogPath($log_type)
.date('Y_m_d').'.log', "\n\n".\date('Y/m/d H:i:s')
."\t".$this->agent_str
."\n".$data, \FILE_APPEND);
} | php | protected function write($data, $log_type)
{
return file_put_contents($this->getLogPath($log_type)
.date('Y_m_d').'.log', "\n\n".\date('Y/m/d H:i:s')
."\t".$this->agent_str
."\n".$data, \FILE_APPEND);
} | [
"protected",
"function",
"write",
"(",
"$",
"data",
",",
"$",
"log_type",
")",
"{",
"return",
"file_put_contents",
"(",
"$",
"this",
"->",
"getLogPath",
"(",
"$",
"log_type",
")",
".",
"date",
"(",
"'Y_m_d'",
")",
".",
"'.log'",
",",
"\"\\n\\n\"",
".",
... | Writes the data to file
@param string $data The data to be written
@param string $log_type The log_type being written to
@return boolean If the data was written or not | [
"Writes",
"the",
"data",
"to",
"file"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Logger/FileSystem.php#L58-L64 |
21,892 | 99designs/ergo-http | src/HeaderCollection.php | HeaderCollection.remove | function remove($header)
{
$normalizer = new HeaderCaseNormalizer();
$name = $normalizer->normalize($header);
foreach ($this->_headers as $idx => $header) {
if ($header->getName() == $name)
unset($this->_headers[$idx]);
}
return $this;
} | php | function remove($header)
{
$normalizer = new HeaderCaseNormalizer();
$name = $normalizer->normalize($header);
foreach ($this->_headers as $idx => $header) {
if ($header->getName() == $name)
unset($this->_headers[$idx]);
}
return $this;
} | [
"function",
"remove",
"(",
"$",
"header",
")",
"{",
"$",
"normalizer",
"=",
"new",
"HeaderCaseNormalizer",
"(",
")",
";",
"$",
"name",
"=",
"$",
"normalizer",
"->",
"normalize",
"(",
"$",
"header",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_headers... | Remove a header by name
@chainable | [
"Remove",
"a",
"header",
"by",
"name"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L40-L51 |
21,893 | 99designs/ergo-http | src/HeaderCollection.php | HeaderCollection.value | function value($name, $default = false)
{
$values = $this->values($name);
return count($values) ? $values[0] : $default;
} | php | function value($name, $default = false)
{
$values = $this->values($name);
return count($values) ? $values[0] : $default;
} | [
"function",
"value",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"false",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"values",
"(",
"$",
"name",
")",
";",
"return",
"count",
"(",
"$",
"values",
")",
"?",
"$",
"values",
"[",
"0",
"]",
":",... | Gets a single header value
@return string | [
"Gets",
"a",
"single",
"header",
"value"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L72-L76 |
21,894 | 99designs/ergo-http | src/HeaderCollection.php | HeaderCollection.values | function values($name)
{
$normalizer = new HeaderCaseNormalizer();
$name = $normalizer->normalize($name);
$values = array();
foreach ($this->_headers as $header) {
if ($header->getName() == $name) {
$values[] = $header->getValue();
}
}... | php | function values($name)
{
$normalizer = new HeaderCaseNormalizer();
$name = $normalizer->normalize($name);
$values = array();
foreach ($this->_headers as $header) {
if ($header->getName() == $name) {
$values[] = $header->getValue();
}
}... | [
"function",
"values",
"(",
"$",
"name",
")",
"{",
"$",
"normalizer",
"=",
"new",
"HeaderCaseNormalizer",
"(",
")",
";",
"$",
"name",
"=",
"$",
"normalizer",
"->",
"normalize",
"(",
"$",
"name",
")",
";",
"$",
"values",
"=",
"array",
"(",
")",
";",
... | Gets an array of the values for a header
@return array | [
"Gets",
"an",
"array",
"of",
"the",
"values",
"for",
"a",
"header"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L82-L95 |
21,895 | 99designs/ergo-http | src/HeaderCollection.php | HeaderCollection.toArray | function toArray($crlf = true)
{
$headers = array();
foreach ($this->_headers as $header) {
$string = $header->__toString();
$headers[] = $crlf ? $string : rtrim($string);
}
return $headers;
} | php | function toArray($crlf = true)
{
$headers = array();
foreach ($this->_headers as $header) {
$string = $header->__toString();
$headers[] = $crlf ? $string : rtrim($string);
}
return $headers;
} | [
"function",
"toArray",
"(",
"$",
"crlf",
"=",
"true",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_headers",
"as",
"$",
"header",
")",
"{",
"$",
"string",
"=",
"$",
"header",
"->",
"__toString",
"(",
... | Returns an array of the string versions of headers
@return array | [
"Returns",
"an",
"array",
"of",
"the",
"string",
"versions",
"of",
"headers"
] | 979b789f2e011a1cb70a00161e6b7bcd0d2e9c71 | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L101-L111 |
21,896 | brick/di | src/Container.php | Container.has | public function has(string $key) : bool
{
if (isset($this->items[$key])) {
return true;
}
try {
$class = new \ReflectionClass($key);
} catch (\ReflectionException $e) {
return false;
}
$classes = $this->reflectionTools->getClassHi... | php | public function has(string $key) : bool
{
if (isset($this->items[$key])) {
return true;
}
try {
$class = new \ReflectionClass($key);
} catch (\ReflectionException $e) {
return false;
}
$classes = $this->reflectionTools->getClassHi... | [
"public",
"function",
"has",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"$",
"class",
"=",
"new",
"\\",
"... | Returns whether the container has the given key.
@param string $key The key, class or interface name.
@return bool | [
"Returns",
"whether",
"the",
"container",
"has",
"the",
"given",
"key",
"."
] | 6ced82ab3623b8f1470317d38cbd2de855e7aa3d | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L94-L117 |
21,897 | brick/di | src/Container.php | Container.set | public function set(string $key, $value) : Container
{
$this->items[$key] = $value;
return $this;
} | php | public function set(string $key, $value) : Container
{
$this->items[$key] = $value;
return $this;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"Container",
"{",
"$",
"this",
"->",
"items",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"return",
"$",
"this",
";",
"}"
] | Sets a single value.
The value will be returned as is when requested with get().
@param string $key The key, class or interface name.
@param mixed $value The value to set.
@return Container | [
"Sets",
"a",
"single",
"value",
"."
] | 6ced82ab3623b8f1470317d38cbd2de855e7aa3d | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L153-L158 |
21,898 | brick/di | src/Container.php | Container.bind | public function bind(string $key, $target = null) : BindingDefinition
{
return $this->items[$key] = new BindingDefinition($target ?? $key);
} | php | public function bind(string $key, $target = null) : BindingDefinition
{
return $this->items[$key] = new BindingDefinition($target ?? $key);
} | [
"public",
"function",
"bind",
"(",
"string",
"$",
"key",
",",
"$",
"target",
"=",
"null",
")",
":",
"BindingDefinition",
"{",
"return",
"$",
"this",
"->",
"items",
"[",
"$",
"key",
"]",
"=",
"new",
"BindingDefinition",
"(",
"$",
"target",
"??",
"$",
... | Binds a key to a class name to be instantiated, or to a closure to be invoked.
By default, the key is bound to itself, so these two lines of code are equivalent;
$container->bind('Class\Name');
$container->bind('Class\Name', 'Class\Name');
It can be used to bind an interface to a class to be instantiated:
$containe... | [
"Binds",
"a",
"key",
"to",
"a",
"class",
"name",
"to",
"be",
"instantiated",
"or",
"to",
"a",
"closure",
"to",
"be",
"invoked",
"."
] | 6ced82ab3623b8f1470317d38cbd2de855e7aa3d | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L219-L222 |
21,899 | brick/di | src/Container.php | Container.alias | public function alias(string $key, string $targetKey) : AliasDefinition
{
return $this->items[$key] = new AliasDefinition($targetKey);
} | php | public function alias(string $key, string $targetKey) : AliasDefinition
{
return $this->items[$key] = new AliasDefinition($targetKey);
} | [
"public",
"function",
"alias",
"(",
"string",
"$",
"key",
",",
"string",
"$",
"targetKey",
")",
":",
"AliasDefinition",
"{",
"return",
"$",
"this",
"->",
"items",
"[",
"$",
"key",
"]",
"=",
"new",
"AliasDefinition",
"(",
"$",
"targetKey",
")",
";",
"}"... | Creates an alias from one key to another.
This method can be used for use cases as simple as:
$container->alias('my.alias', 'my.service');
This is particularly useful when you have already registered a class by its name,
but now want to make it resolvable through an interface name it implements as well:
$container-... | [
"Creates",
"an",
"alias",
"from",
"one",
"key",
"to",
"another",
"."
] | 6ced82ab3623b8f1470317d38cbd2de855e7aa3d | https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L248-L251 |
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.