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,400 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/ConstantConverter.php | ConstantConverter.convert | public function convert(\DOMElement $parent, ConstantDescriptor $constant)
{
$fullyQualifiedNamespaceName = $constant->getNamespace() instanceof NamespaceDescriptor
? $constant->getNamespace()->getFullyQualifiedStructuralElementName()
: $parent->getAttribute('namespace');
$c... | php | public function convert(\DOMElement $parent, ConstantDescriptor $constant)
{
$fullyQualifiedNamespaceName = $constant->getNamespace() instanceof NamespaceDescriptor
? $constant->getNamespace()->getFullyQualifiedStructuralElementName()
: $parent->getAttribute('namespace');
$c... | [
"public",
"function",
"convert",
"(",
"\\",
"DOMElement",
"$",
"parent",
",",
"ConstantDescriptor",
"$",
"constant",
")",
"{",
"$",
"fullyQualifiedNamespaceName",
"=",
"$",
"constant",
"->",
"getNamespace",
"(",
")",
"instanceof",
"NamespaceDescriptor",
"?",
"$",
... | Export the given reflected constant definition to the provided parent element.
@param \DOMElement $parent Element to augment.
@param ConstantDescriptor $constant Element to export.
@return \DOMElement | [
"Export",
"the",
"given",
"reflected",
"constant",
"definition",
"to",
"the",
"provided",
"parent",
"element",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/ConstantConverter.php#L45-L64 |
21,401 | raideer/twitch-api | src/OAuth.php | OAuth.setScope | public function setScope($scope)
{
if (!is_array($scope)) {
$this->scopes = explode(' ', $scope);
} else {
$this->scopes = $scope;
}
return $this;
} | php | public function setScope($scope)
{
if (!is_array($scope)) {
$this->scopes = explode(' ', $scope);
} else {
$this->scopes = $scope;
}
return $this;
} | [
"public",
"function",
"setScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"scope",
")",
")",
"{",
"$",
"this",
"->",
"scopes",
"=",
"explode",
"(",
"' '",
",",
"$",
"scope",
")",
";",
"}",
"else",
"{",
"$",
"this",
"-... | Sets the scope.
@param string or array $scope Space seperated string or array | [
"Sets",
"the",
"scope",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/OAuth.php#L91-L100 |
21,402 | raideer/twitch-api | src/OAuth.php | OAuth.addScope | public function addScope($scope)
{
if (!is_array($scope)) {
$scope = explode(' ', $scope);
}
$this->scopes = array_unique(array_merge($this->scopes, $scope));
return $this;
} | php | public function addScope($scope)
{
if (!is_array($scope)) {
$scope = explode(' ', $scope);
}
$this->scopes = array_unique(array_merge($this->scopes, $scope));
return $this;
} | [
"public",
"function",
"addScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"scope",
")",
")",
"{",
"$",
"scope",
"=",
"explode",
"(",
"' '",
",",
"$",
"scope",
")",
";",
"}",
"$",
"this",
"->",
"scopes",
"=",
"array_uniq... | Adds a scope.
@param string $scope https://github.com/justintv/Twitch-API/blob/master/authentication.md#scopes | [
"Adds",
"a",
"scope",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/OAuth.php#L117-L126 |
21,403 | raideer/twitch-api | src/OAuth.php | OAuth.getResponse | public function getResponse($code, $forceNew = false)
{
if (!$this->oauthResponse || $forceNew) {
$form_params = [
'client_id' => $this->getClientId(),
'client_secret' => $this->clientSecret,
'grant_type' => 'authorization_code',
'redirect_uri' => $this-... | php | public function getResponse($code, $forceNew = false)
{
if (!$this->oauthResponse || $forceNew) {
$form_params = [
'client_id' => $this->getClientId(),
'client_secret' => $this->clientSecret,
'grant_type' => 'authorization_code',
'redirect_uri' => $this-... | [
"public",
"function",
"getResponse",
"(",
"$",
"code",
",",
"$",
"forceNew",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"oauthResponse",
"||",
"$",
"forceNew",
")",
"{",
"$",
"form_params",
"=",
"[",
"'client_id'",
"=>",
"$",
"this",
... | Returns the OAuthResponse object that contains the access_token, registered scopes
and the refresh_token.
@param string $code Code returned by OAuth
@param bool $forceNew Force new token
@return Raideer\TwitchApi\OAuthResponse | [
"Returns",
"the",
"OAuthResponse",
"object",
"that",
"contains",
"the",
"access_token",
"registered",
"scopes",
"and",
"the",
"refresh_token",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/OAuth.php#L159-L199 |
21,404 | raideer/twitch-api | src/OAuth.php | OAuth.checkScope | public function checkScope($scope)
{
if ($this->OAuthResponse) {
return $this->OAuthResponse->hasScope($scope);
}
return in_array($scope, $this->getScope());
} | php | public function checkScope($scope)
{
if ($this->OAuthResponse) {
return $this->OAuthResponse->hasScope($scope);
}
return in_array($scope, $this->getScope());
} | [
"public",
"function",
"checkScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"OAuthResponse",
")",
"{",
"return",
"$",
"this",
"->",
"OAuthResponse",
"->",
"hasScope",
"(",
"$",
"scope",
")",
";",
"}",
"return",
"in_array",
"(",
"$",
... | Checks if the scope is registered.
@param string $scope Scope name
@return bool | [
"Checks",
"if",
"the",
"scope",
"is",
"registered",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/OAuth.php#L208-L215 |
21,405 | raideer/twitch-api | src/OAuth.php | OAuth.getUrl | public function getUrl()
{
$url = $this->baseAuthUrl;
$url .= '?response_type=code';
$url .= '&client_id='.$this->clientId;
$url .= '&redirect_uri='.$this->redirectUri;
$url .= '&scope='.implode(' ', $this->scopes);
$url .= '&state='.$this->state;
return $url;
} | php | public function getUrl()
{
$url = $this->baseAuthUrl;
$url .= '?response_type=code';
$url .= '&client_id='.$this->clientId;
$url .= '&redirect_uri='.$this->redirectUri;
$url .= '&scope='.implode(' ', $this->scopes);
$url .= '&state='.$this->state;
return $url;
} | [
"public",
"function",
"getUrl",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"baseAuthUrl",
";",
"$",
"url",
".=",
"'?response_type=code'",
";",
"$",
"url",
".=",
"'&client_id='",
".",
"$",
"this",
"->",
"clientId",
";",
"$",
"url",
".=",
"'&redi... | Builds the OAuth URL.
@return string URL | [
"Builds",
"the",
"OAuth",
"URL",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/OAuth.php#L222-L232 |
21,406 | kenphp/ken | src/Helpers/Route.php | Route.group | public static function group($route, $callback, $options = [])
{
app()->router->group($route, $callback, $options);
} | php | public static function group($route, $callback, $options = [])
{
app()->router->group($route, $callback, $options);
} | [
"public",
"static",
"function",
"group",
"(",
"$",
"route",
",",
"$",
"callback",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"app",
"(",
")",
"->",
"router",
"->",
"group",
"(",
"$",
"route",
",",
"$",
"callback",
",",
"$",
"options",
")",
";"... | Adds group route.
@param string $route Group base route
@param callable $callback
@param array $options | [
"Adds",
"group",
"route",
"."
] | c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/Route.php#L93-L96 |
21,407 | cirrusidentity/simplesamlphp-test-utils | src/InMemoryStore.php | InMemoryStore.get | public function get($type, $key)
{
if (array_key_exists($key, self::$store)) {
//TODO: implement expiration check
// implement data type check?
return self::$store[$key]['value'];
}
return null;
} | php | public function get($type, $key)
{
if (array_key_exists($key, self::$store)) {
//TODO: implement expiration check
// implement data type check?
return self::$store[$key]['value'];
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"type",
",",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"self",
"::",
"$",
"store",
")",
")",
"{",
"//TODO: implement expiration check",
"// implement data type check?",
"return",
"self",
... | Retrieve a value from the data store.
@param string $type The data type.
@param string $key The key.
@return mixed|null The value. | [
"Retrieve",
"a",
"value",
"from",
"the",
"data",
"store",
"."
] | 79150efb8bca89c180b604dc1d6194f819ebe2b2 | https://github.com/cirrusidentity/simplesamlphp-test-utils/blob/79150efb8bca89c180b604dc1d6194f819ebe2b2/src/InMemoryStore.php#L32-L40 |
21,408 | cirrusidentity/simplesamlphp-test-utils | src/InMemoryStore.php | InMemoryStore.set | public function set($type, $key, $value, $expire = null)
{
self::$store[$key] = [
'type' => $type,
'value' => $value,
'expire' => $expire
];
} | php | public function set($type, $key, $value, $expire = null)
{
self::$store[$key] = [
'type' => $type,
'value' => $value,
'expire' => $expire
];
} | [
"public",
"function",
"set",
"(",
"$",
"type",
",",
"$",
"key",
",",
"$",
"value",
",",
"$",
"expire",
"=",
"null",
")",
"{",
"self",
"::",
"$",
"store",
"[",
"$",
"key",
"]",
"=",
"[",
"'type'",
"=>",
"$",
"type",
",",
"'value'",
"=>",
"$",
... | Save a value to the data store.
@param string $type The data type.
@param string $key The key.
@param mixed $value The value.
@param int|null $expire The expiration time (unix timestamp), or null if it never expires. | [
"Save",
"a",
"value",
"to",
"the",
"data",
"store",
"."
] | 79150efb8bca89c180b604dc1d6194f819ebe2b2 | https://github.com/cirrusidentity/simplesamlphp-test-utils/blob/79150efb8bca89c180b604dc1d6194f819ebe2b2/src/InMemoryStore.php#L50-L57 |
21,409 | willhoffmann/domuserp-php | src/Resources/CommercialSector/CommercialSector.php | CommercialSector.customers | public function customers($id)
{
$customers = $this->execute(
self::HTTP_GET,
self::DOMUSERP_API_OPERACIONAL . '/setorcomercial/' . $id . '/clientes'
);
return $customers;
} | php | public function customers($id)
{
$customers = $this->execute(
self::HTTP_GET,
self::DOMUSERP_API_OPERACIONAL . '/setorcomercial/' . $id . '/clientes'
);
return $customers;
} | [
"public",
"function",
"customers",
"(",
"$",
"id",
")",
"{",
"$",
"customers",
"=",
"$",
"this",
"->",
"execute",
"(",
"self",
"::",
"HTTP_GET",
",",
"self",
"::",
"DOMUSERP_API_OPERACIONAL",
".",
"'/setorcomercial/'",
".",
"$",
"id",
".",
"'/clientes'",
"... | Lists all customers linked to the commercial sector
@param $id
@return string
@throws \GuzzleHttp\Exception\GuzzleException | [
"Lists",
"all",
"customers",
"linked",
"to",
"the",
"commercial",
"sector"
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/CommercialSector/CommercialSector.php#L48-L56 |
21,410 | nikolaposa/ZfOpenGraph | src/ZfOpenGraph/View/Helper/OpenGraph.php | OpenGraph.setLocale | public function setLocale($locale, array $alternates = array())
{
$this->insertMeta('set', 'locale', $locale);
if (!empty($alternates)) {
foreach ($alternates as $alternate) {
$this->insertStructure('append', 'locale', array(
'alternate' => $alternate... | php | public function setLocale($locale, array $alternates = array())
{
$this->insertMeta('set', 'locale', $locale);
if (!empty($alternates)) {
foreach ($alternates as $alternate) {
$this->insertStructure('append', 'locale', array(
'alternate' => $alternate... | [
"public",
"function",
"setLocale",
"(",
"$",
"locale",
",",
"array",
"$",
"alternates",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"insertMeta",
"(",
"'set'",
",",
"'locale'",
",",
"$",
"locale",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$... | Set 'locale' property.
@param string $locale Default locale
@param array $alternates Alternate locales array
@return self | [
"Set",
"locale",
"property",
"."
] | 5e1a9b6ff8d2e149dc9d949635f39786f6acc347 | https://github.com/nikolaposa/ZfOpenGraph/blob/5e1a9b6ff8d2e149dc9d949635f39786f6acc347/src/ZfOpenGraph/View/Helper/OpenGraph.php#L200-L213 |
21,411 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.onRequestTerminate | public function onRequestTerminate()
{
// lets see if there were unhandled fatal errors
$lasterror=error_get_last();
if(!is_null($lasterror)){
if($lasterror['type'] & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)){
// fatal error occured
... | php | public function onRequestTerminate()
{
// lets see if there were unhandled fatal errors
$lasterror=error_get_last();
if(!is_null($lasterror)){
if($lasterror['type'] & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)){
// fatal error occured
... | [
"public",
"function",
"onRequestTerminate",
"(",
")",
"{",
"// lets see if there were unhandled fatal errors\r",
"$",
"lasterror",
"=",
"error_get_last",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"lasterror",
")",
")",
"{",
"if",
"(",
"$",
"lasterror",... | Gets executed when request terminates
WARNING: do not call exit() or errorhandling will break | [
"Gets",
"executed",
"when",
"request",
"terminates"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L508-L529 |
21,412 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.error_log_wrap | public static function error_log_wrap($message)
{
// msglen is the remain length of the message that needs to be written.
$msglen=strlen($message);
$i=0;
while($msglen>0){
if($msglen>8000){
// the remaining message that needs to be written is still longer than 8000 bytes
... | php | public static function error_log_wrap($message)
{
// msglen is the remain length of the message that needs to be written.
$msglen=strlen($message);
$i=0;
while($msglen>0){
if($msglen>8000){
// the remaining message that needs to be written is still longer than 8000 bytes
... | [
"public",
"static",
"function",
"error_log_wrap",
"(",
"$",
"message",
")",
"{",
"// msglen is the remain length of the message that needs to be written.\r",
"$",
"msglen",
"=",
"strlen",
"(",
"$",
"message",
")",
";",
"$",
"i",
"=",
"0",
";",
"while",
"(",
"$",
... | Log the message to the error_log, but wrap at 8000 bytes
to prevent automatic cutoff by the PHP error_log function
@param string $message | [
"Log",
"the",
"message",
"to",
"the",
"error_log",
"but",
"wrap",
"at",
"8000",
"bytes",
"to",
"prevent",
"automatic",
"cutoff",
"by",
"the",
"PHP",
"error_log",
"function"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L641-L659 |
21,413 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.debugLogCPU | public function debugLogCPU($message='')
{
// get resource usage
$dat = getrusage();
$message.='[u:'.substr(($dat["ru_utime.tv_sec"]*1e6+$dat["ru_utime.tv_usec"])-$this->startUserCPU,0,-3).'ms / s:'.substr(($dat["ru_stime.tv_sec"]*1e6+$dat["ru_stime.tv_usec"])-$this->startSystemCPU,0,-3).'ms]';
$... | php | public function debugLogCPU($message='')
{
// get resource usage
$dat = getrusage();
$message.='[u:'.substr(($dat["ru_utime.tv_sec"]*1e6+$dat["ru_utime.tv_usec"])-$this->startUserCPU,0,-3).'ms / s:'.substr(($dat["ru_stime.tv_sec"]*1e6+$dat["ru_stime.tv_usec"])-$this->startSystemCPU,0,-3).'ms]';
$... | [
"public",
"function",
"debugLogCPU",
"(",
"$",
"message",
"=",
"''",
")",
"{",
"// get resource usage\r",
"$",
"dat",
"=",
"getrusage",
"(",
")",
";",
"$",
"message",
".=",
"'[u:'",
".",
"substr",
"(",
"(",
"$",
"dat",
"[",
"\"ru_utime.tv_sec\"",
"]",
"*... | Debug log the CPU used by the script
Please note its only updated every 10ms.
output: <user message>[u: <user time>ms / s:<system time>ms]
@param string $message [optional message to prepend] | [
"Debug",
"log",
"the",
"CPU",
"used",
"by",
"the",
"script"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L684-L690 |
21,414 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.getGlobalStorage | public function getGlobalStorage($name) {
if (!$this->GlobalStorageExists($name)) {
return false;
}
return $this->global_data->get($name);
} | php | public function getGlobalStorage($name) {
if (!$this->GlobalStorageExists($name)) {
return false;
}
return $this->global_data->get($name);
} | [
"public",
"function",
"getGlobalStorage",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"GlobalStorageExists",
"(",
"$",
"name",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"global_data",
"->",
"get",
"(",
... | Retrieve from Global storage
@param string $name
@return mixed pointer to Plugin or false when not found | [
"Retrieve",
"from",
"Global",
"storage"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L721-L726 |
21,415 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.includeClass | public static function includeClass($classname, $loadscheme='Web2All', $package='', $set_includedir=false) {
// $path will be the relative path to the classfile by exploding the namespace
$path = '';
$filename = $classname;
// support namespaces
if(strpos($classname,'\\')){
// ok, contai... | php | public static function includeClass($classname, $loadscheme='Web2All', $package='', $set_includedir=false) {
// $path will be the relative path to the classfile by exploding the namespace
$path = '';
$filename = $classname;
// support namespaces
if(strpos($classname,'\\')){
// ok, contai... | [
"public",
"static",
"function",
"includeClass",
"(",
"$",
"classname",
",",
"$",
"loadscheme",
"=",
"'Web2All'",
",",
"$",
"package",
"=",
"''",
",",
"$",
"set_includedir",
"=",
"false",
")",
"{",
"// $path will be the relative path to the classfile by exploding the n... | Load the classfile for the given class
This method will blindly include the first php file which it finds
for the given classname. It will not throw exceptions and won't indicate if the
operation succeeded. It is used by both the autoloader and the loadClass() method,
which is historically the method used to load a cl... | [
"Load",
"the",
"classfile",
"for",
"the",
"given",
"class"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L764-L829 |
21,416 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.loadClass | public static function loadClass($classname, $loadscheme='Web2All', $package='', $set_includedir=false) {
$class_exists=class_exists($classname) || interface_exists($classname);
if ($class_exists && !$set_includedir) {
// if class already exists, we don't need to do a thing
// but one CAVEAT: if... | php | public static function loadClass($classname, $loadscheme='Web2All', $package='', $set_includedir=false) {
$class_exists=class_exists($classname) || interface_exists($classname);
if ($class_exists && !$set_includedir) {
// if class already exists, we don't need to do a thing
// but one CAVEAT: if... | [
"public",
"static",
"function",
"loadClass",
"(",
"$",
"classname",
",",
"$",
"loadscheme",
"=",
"'Web2All'",
",",
"$",
"package",
"=",
"''",
",",
"$",
"set_includedir",
"=",
"false",
")",
"{",
"$",
"class_exists",
"=",
"class_exists",
"(",
"$",
"classname... | Include php file for Web2All_Manager_Plugin
@param string $classname
@param string $loadscheme [optional (Web2All|PEAR|INC|PLAIN) defaults to Web2All]
@param string $package [optional packagename]
@param boolean $set_includedir [optional bool, set true to add the package dir to include path] | [
"Include",
"php",
"file",
"for",
"Web2All_Manager_Plugin"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L839-L849 |
21,417 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.initClass | public function initClass($classname,$arguments=array(),$isplugin=true)
{
// when we no longer have any PHP 5.2 we can replace below with static::loadClass($classname);
// we cannot use self::loadClass($classname); because it will break extending Main classes which
// redefine the loadClass method. (... | php | public function initClass($classname,$arguments=array(),$isplugin=true)
{
// when we no longer have any PHP 5.2 we can replace below with static::loadClass($classname);
// we cannot use self::loadClass($classname); because it will break extending Main classes which
// redefine the loadClass method. (... | [
"public",
"function",
"initClass",
"(",
"$",
"classname",
",",
"$",
"arguments",
"=",
"array",
"(",
")",
",",
"$",
"isplugin",
"=",
"true",
")",
"{",
"// when we no longer have any PHP 5.2 we can replace below with static::loadClass($classname);\r",
"// we cannot use self::... | Initialize Web2All_Manager_Plugin
returns Web2All_Manager_Plugin object
@param string $classname
@param array $arguments
@param boolean $isplugin Force the first constructor param to be the
Web2All_Manager_Main object. Set false for
automatically detection if this is required.
@return object | [
"Initialize",
"Web2All_Manager_Plugin",
"returns",
"Web2All_Manager_Plugin",
"object"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L862-L897 |
21,418 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.registerIncludeRoot | public static function registerIncludeRoot($root=null)
{
if(is_null($root)){
$root = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR;
}
if(!in_array($root, self::$frameworkRoots)){
self::$frameworkRoots[] = $root;
return true;
}
re... | php | public static function registerIncludeRoot($root=null)
{
if(is_null($root)){
$root = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR;
}
if(!in_array($root, self::$frameworkRoots)){
self::$frameworkRoots[] = $root;
return true;
}
re... | [
"public",
"static",
"function",
"registerIncludeRoot",
"(",
"$",
"root",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"root",
")",
")",
"{",
"$",
"root",
"=",
"dirname",
"(",
"__FILE__",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'..'",
".",
"DIR... | Registers an include root directory
Used by autoloader and loadClass()
@param string $root directory path
@return boolean was the directory added | [
"Registers",
"an",
"include",
"root",
"directory"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L1005-L1015 |
21,419 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.unregisterIncludeRoot | public static function unregisterIncludeRoot($root)
{
$found_key=array_search($root, self::$frameworkRoots, true);
if($found_key!==false){
unset(self::$frameworkRoots[$found_key]);
return true;
}
return false;
} | php | public static function unregisterIncludeRoot($root)
{
$found_key=array_search($root, self::$frameworkRoots, true);
if($found_key!==false){
unset(self::$frameworkRoots[$found_key]);
return true;
}
return false;
} | [
"public",
"static",
"function",
"unregisterIncludeRoot",
"(",
"$",
"root",
")",
"{",
"$",
"found_key",
"=",
"array_search",
"(",
"$",
"root",
",",
"self",
"::",
"$",
"frameworkRoots",
",",
"true",
")",
";",
"if",
"(",
"$",
"found_key",
"!==",
"false",
")... | Unregisters an include root directory
@param string $root directory path
@return boolean was the directory removed | [
"Unregisters",
"an",
"include",
"root",
"directory"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L1023-L1031 |
21,420 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_Main.registerAutoloader | public static function registerAutoloader($root=null)
{
self::registerIncludeRoot($root);
if(!self::$autoloaderAdded){
self::$autoloaderAdded = true;
return spl_autoload_register(array('Web2All_Manager_Main','loadClass'));
}
return true;
} | php | public static function registerAutoloader($root=null)
{
self::registerIncludeRoot($root);
if(!self::$autoloaderAdded){
self::$autoloaderAdded = true;
return spl_autoload_register(array('Web2All_Manager_Main','loadClass'));
}
return true;
} | [
"public",
"static",
"function",
"registerAutoloader",
"(",
"$",
"root",
"=",
"null",
")",
"{",
"self",
"::",
"registerIncludeRoot",
"(",
"$",
"root",
")",
";",
"if",
"(",
"!",
"self",
"::",
"$",
"autoloaderAdded",
")",
"{",
"self",
"::",
"$",
"autoloader... | Registers an autoloader for the Web2All framework
it will call the Web2All_Manager_Main::loadClass
@return boolean | [
"Registers",
"an",
"autoloader",
"for",
"the",
"Web2All",
"framework"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L1050-L1058 |
21,421 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_ErrorObserverable.notifyObservers | public function notifyObservers() {
/**
* restore original error handler, to avoid problems when errors occurres
* in handling other errors
*/
$this->Web2All->restoreErrorHandlers();
foreach($this->observers as $observer) {
$observer->update($this);
}
foreach($this->obs... | php | public function notifyObservers() {
/**
* restore original error handler, to avoid problems when errors occurres
* in handling other errors
*/
$this->Web2All->restoreErrorHandlers();
foreach($this->observers as $observer) {
$observer->update($this);
}
foreach($this->obs... | [
"public",
"function",
"notifyObservers",
"(",
")",
"{",
"/**\r\n * restore original error handler, to avoid problems when errors occurres\r\n * in handling other errors\r\n */",
"$",
"this",
"->",
"Web2All",
"->",
"restoreErrorHandlers",
"(",
")",
";",
"foreach",
"(",
... | If this object has changed, as indicated by the hasChanged method, then
start observers as needed and notify them, and then call the clearChanged
method to indicate that this object has no longer changed. | [
"If",
"this",
"object",
"has",
"changed",
"as",
"indicated",
"by",
"the",
"hasChanged",
"method",
"then",
"start",
"observers",
"as",
"needed",
"and",
"notify",
"them",
"and",
"then",
"call",
"the",
"clearChanged",
"method",
"to",
"indicate",
"that",
"this",
... | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L1173-L1187 |
21,422 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_ErrorObserverable.flushEmailErrors | public function flushEmailErrors() {
foreach($this->observers as $observer) {
if(get_class($observer)=='Web2All_ErrorObserver_Email'){
$observer->flushErrors();
}
}
foreach($this->observer_names as $classname) {
if($classname=='Web2All_ErrorObserver_Email'){
$this->... | php | public function flushEmailErrors() {
foreach($this->observers as $observer) {
if(get_class($observer)=='Web2All_ErrorObserver_Email'){
$observer->flushErrors();
}
}
foreach($this->observer_names as $classname) {
if($classname=='Web2All_ErrorObserver_Email'){
$this->... | [
"public",
"function",
"flushEmailErrors",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"observers",
"as",
"$",
"observer",
")",
"{",
"if",
"(",
"get_class",
"(",
"$",
"observer",
")",
"==",
"'Web2All_ErrorObserver_Email'",
")",
"{",
"$",
"observer",
"... | flush e-mail errors if any
If there are any errors queued for emailing they will be e-mailed and the
errorstate will be reset. This is useful for long running processes like daemons. | [
"flush",
"e",
"-",
"mail",
"errors",
"if",
"any"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L1195-L1206 |
21,423 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_Manager_ClassInclude.loadClassname | public static function loadClassname($classname,$loadscheme='Web2All', $package='', $set_includedir=false) {
Web2All_Manager_Main::loadClass($classname,$loadscheme,$package,$set_includedir);
} | php | public static function loadClassname($classname,$loadscheme='Web2All', $package='', $set_includedir=false) {
Web2All_Manager_Main::loadClass($classname,$loadscheme,$package,$set_includedir);
} | [
"public",
"static",
"function",
"loadClassname",
"(",
"$",
"classname",
",",
"$",
"loadscheme",
"=",
"'Web2All'",
",",
"$",
"package",
"=",
"''",
",",
"$",
"set_includedir",
"=",
"false",
")",
"{",
"Web2All_Manager_Main",
"::",
"loadClass",
"(",
"$",
"classn... | Include php file
@param string $classname
@param string $loadscheme [optional (Web2All|PEAR|INC|PLAIN) defaults to Web2All]
@param string $package [optional packagename]
@param boolean $set_includedir [optional bool, set true to add the package dir to include path] | [
"Include",
"php",
"file"
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L2035-L2037 |
21,424 | web2all/framework | src/Web2All/Manager/Main.class.php | Web2All_PHP_INI.getBytes | public static function getBytes($size_str)
{
switch (substr ($size_str, -1))
{
case 'M': case 'm': return (int)$size_str * 1048576;
case 'K': case 'k': return (int)$size_str * 1024;
case 'G': case 'g': return (int)$size_str * 1073741824;
default: return $size_str;
}
} | php | public static function getBytes($size_str)
{
switch (substr ($size_str, -1))
{
case 'M': case 'm': return (int)$size_str * 1048576;
case 'K': case 'k': return (int)$size_str * 1024;
case 'G': case 'g': return (int)$size_str * 1073741824;
default: return $size_str;
}
} | [
"public",
"static",
"function",
"getBytes",
"(",
"$",
"size_str",
")",
"{",
"switch",
"(",
"substr",
"(",
"$",
"size_str",
",",
"-",
"1",
")",
")",
"{",
"case",
"'M'",
":",
"case",
"'m'",
":",
"return",
"(",
"int",
")",
"$",
"size_str",
"*",
"10485... | converts possible shorthand notations from the php ini
to bytes.
see: http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes
original code from: http://nl2.php.net/manual/en/function.ini-get.php#96996
@return int | [
"converts",
"possible",
"shorthand",
"notations",
"from",
"the",
"php",
"ini",
"to",
"bytes",
"."
] | 6990dc3700efad3207ec6e710124f7ba18891b31 | https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/Main.class.php#L2106-L2115 |
21,425 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Service/UserNotificationService.php | UserNotificationService.notifyPasswordReset | public function notifyPasswordReset(User $user, $plainPassword)
{
$fromEmail = $this->container->getParameter("default_mail_from");
$fromName = $this->container->getParameter("default_mail_from_name");
$appName = $this->container->getParameter("default_app_name");
$subject = "[$appNa... | php | public function notifyPasswordReset(User $user, $plainPassword)
{
$fromEmail = $this->container->getParameter("default_mail_from");
$fromName = $this->container->getParameter("default_mail_from_name");
$appName = $this->container->getParameter("default_app_name");
$subject = "[$appNa... | [
"public",
"function",
"notifyPasswordReset",
"(",
"User",
"$",
"user",
",",
"$",
"plainPassword",
")",
"{",
"$",
"fromEmail",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"\"default_mail_from\"",
")",
";",
"$",
"fromName",
"=",
"$",
"this"... | Notify Password reset.
@param User $user [description]
@param [type] $plainPassword [description] | [
"Notify",
"Password",
"reset",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Service/UserNotificationService.php#L43-L54 |
21,426 | stk2k/net-driver | src/NetDriver/AbstractNetDriver.php | AbstractNetDriver.fireOnSendingRequest | public function fireOnSendingRequest(HttpRequest $request)
{
$event = EnumEvent::REQUEST;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$ret = $l($request);
if ($r... | php | public function fireOnSendingRequest(HttpRequest $request)
{
$event = EnumEvent::REQUEST;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$ret = $l($request);
if ($r... | [
"public",
"function",
"fireOnSendingRequest",
"(",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"event",
"=",
"EnumEvent",
"::",
"REQUEST",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
"&&",
"is_array",
"(",... | Fire event before sending HTTP request
@param HttpRequest $request
@return HttpRequest | [
"Fire",
"event",
"before",
"sending",
"HTTP",
"request"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/AbstractNetDriver.php#L120-L134 |
21,427 | stk2k/net-driver | src/NetDriver/AbstractNetDriver.php | AbstractNetDriver.fireOnReceivedVerbose | public function fireOnReceivedVerbose($strerr, $header, $output)
{
$event = EnumEvent::VERBOSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($strerr, $header, $output);
... | php | public function fireOnReceivedVerbose($strerr, $header, $output)
{
$event = EnumEvent::VERBOSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($strerr, $header, $output);
... | [
"public",
"function",
"fireOnReceivedVerbose",
"(",
"$",
"strerr",
",",
"$",
"header",
",",
"$",
"output",
")",
"{",
"$",
"event",
"=",
"EnumEvent",
"::",
"VERBOSE",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
... | Fire event after received verbose
@param string $strerr
@param string $header
@param string $output | [
"Fire",
"event",
"after",
"received",
"verbose"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/AbstractNetDriver.php#L143-L153 |
21,428 | stk2k/net-driver | src/NetDriver/AbstractNetDriver.php | AbstractNetDriver.fireOnReceivedResponse | public function fireOnReceivedResponse(HttpResponse $response)
{
$event = EnumEvent::RESPONSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($response);
}
}... | php | public function fireOnReceivedResponse(HttpResponse $response)
{
$event = EnumEvent::RESPONSE;
if (isset($this->listeners[$event]) && is_array($this->listeners[$event]))
{
foreach($this->listeners[$event] as $l)
{
$l($response);
}
}... | [
"public",
"function",
"fireOnReceivedResponse",
"(",
"HttpResponse",
"$",
"response",
")",
"{",
"$",
"event",
"=",
"EnumEvent",
"::",
"RESPONSE",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"listeners",
"[",
"$",
"event",
"]",
")",
"&&",
"is_array",
... | Fire event after received HTTP response
@param HttpResponse $response | [
"Fire",
"event",
"after",
"received",
"HTTP",
"response"
] | 75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/AbstractNetDriver.php#L160-L170 |
21,429 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.filterByCustomerCustomerGroup | public function filterByCustomerCustomerGroup($customerCustomerGroup, $comparison = null)
{
if ($customerCustomerGroup instanceof \CustomerGroup\Model\CustomerCustomerGroup) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerCustomerGroup->getCustomerGroupId(), $c... | php | public function filterByCustomerCustomerGroup($customerCustomerGroup, $comparison = null)
{
if ($customerCustomerGroup instanceof \CustomerGroup\Model\CustomerCustomerGroup) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerCustomerGroup->getCustomerGroupId(), $c... | [
"public",
"function",
"filterByCustomerCustomerGroup",
"(",
"$",
"customerCustomerGroup",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"customerCustomerGroup",
"instanceof",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerCustomerGroup",
")",
... | Filter the query by a related \CustomerGroup\Model\CustomerCustomerGroup object
@param \CustomerGroup\Model\CustomerCustomerGroup|ObjectCollection $customerCustomerGroup the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildC... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerCustomerGroup",
"object"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L476-L489 |
21,430 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.useCustomerCustomerGroupQuery | public function useCustomerCustomerGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCustomerCustomerGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerCustomerGroup', '\CustomerGroup\Model\CustomerCustomerGro... | php | public function useCustomerCustomerGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCustomerCustomerGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerCustomerGroup', '\CustomerGroup\Model\CustomerCustomerGro... | [
"public",
"function",
"useCustomerCustomerGroupQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinCustomerCustomerGroup",
"(",
"$",
"relationAlias",
",",
"$",
"jo... | Use the CustomerCustomerGroup relation CustomerCustomerGroup object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \CustomerGroup\... | [
"Use",
"the",
"CustomerCustomerGroup",
"relation",
"CustomerCustomerGroup",
"object"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L534-L539 |
21,431 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.filterByCustomerGroupI18n | public function filterByCustomerGroupI18n($customerGroupI18n, $comparison = null)
{
if ($customerGroupI18n instanceof \CustomerGroup\Model\CustomerGroupI18n) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerGroupI18n->getId(), $comparison);
} elseif ($cu... | php | public function filterByCustomerGroupI18n($customerGroupI18n, $comparison = null)
{
if ($customerGroupI18n instanceof \CustomerGroup\Model\CustomerGroupI18n) {
return $this
->addUsingAlias(CustomerGroupTableMap::ID, $customerGroupI18n->getId(), $comparison);
} elseif ($cu... | [
"public",
"function",
"filterByCustomerGroupI18n",
"(",
"$",
"customerGroupI18n",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"customerGroupI18n",
"instanceof",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerGroupI18n",
")",
"{",
"return",... | Filter the query by a related \CustomerGroup\Model\CustomerGroupI18n object
@param \CustomerGroup\Model\CustomerGroupI18n|ObjectCollection $customerGroupI18n the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildCustomerGroup... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"\\",
"CustomerGroup",
"\\",
"Model",
"\\",
"CustomerGroupI18n",
"object"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L549-L562 |
21,432 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.useCustomerGroupI18nQuery | public function useCustomerGroupI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCustomerGroupI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerGroupI18n', '\CustomerGroup\Model\CustomerGroupI18nQuery');
} | php | public function useCustomerGroupI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinCustomerGroupI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerGroupI18n', '\CustomerGroup\Model\CustomerGroupI18nQuery');
} | [
"public",
"function",
"useCustomerGroupI18nQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"'LEFT JOIN'",
")",
"{",
"return",
"$",
"this",
"->",
"joinCustomerGroupI18n",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"us... | Use the CustomerGroupI18n relation CustomerGroupI18n object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \CustomerGroup\Model\Cu... | [
"Use",
"the",
"CustomerGroupI18n",
"relation",
"CustomerGroupI18n",
"object"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L607-L612 |
21,433 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.filterByCustomer | public function filterByCustomer($customer, $comparison = Criteria::EQUAL)
{
return $this
->useCustomerCustomerGroupQuery()
->filterByCustomer($customer, $comparison)
->endUse();
} | php | public function filterByCustomer($customer, $comparison = Criteria::EQUAL)
{
return $this
->useCustomerCustomerGroupQuery()
->filterByCustomer($customer, $comparison)
->endUse();
} | [
"public",
"function",
"filterByCustomer",
"(",
"$",
"customer",
",",
"$",
"comparison",
"=",
"Criteria",
"::",
"EQUAL",
")",
"{",
"return",
"$",
"this",
"->",
"useCustomerCustomerGroupQuery",
"(",
")",
"->",
"filterByCustomer",
"(",
"$",
"customer",
",",
"$",
... | Filter the query by a related Customer object
using the customer_customer_group table as cross reference
@param Customer $customer the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return ChildCustomerGroupQuery The current query, for... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"Customer",
"object",
"using",
"the",
"customer_customer_group",
"table",
"as",
"cross",
"reference"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L623-L629 |
21,434 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.getMaxRank | public function getMaxRank(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MA... | php | public function getMaxRank(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MA... | [
"public",
"function",
"getMaxRank",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection",
"(",
"CustomerGr... | Get the highest rank
@param ConnectionInterface optional connection
@return integer highest position | [
"Get",
"the",
"highest",
"rank"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L922-L932 |
21,435 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.getMaxRankArray | public function getMaxRankArray(ConnectionInterface $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MAX(' . CustomerGroupTab... | php | public function getMaxRankArray(ConnectionInterface $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CustomerGroupTableMap::DATABASE_NAME);
}
// shift the objects with a position lower than the one of object
$this->addSelectColumn('MAX(' . CustomerGroupTab... | [
"public",
"function",
"getMaxRankArray",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"CustomerGroupTableMap",
"::",
"DATABASE_NAME",
")"... | Get the highest rank by a scope with a array format.
@param ConnectionInterface optional connection
@return integer highest position | [
"Get",
"the",
"highest",
"rank",
"by",
"a",
"scope",
"with",
"a",
"array",
"format",
"."
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L941-L951 |
21,436 | thelia-modules/CustomerGroup | Model/Base/CustomerGroupQuery.php | CustomerGroupQuery.doSelectOrderByRank | static public function doSelectOrderByRank(Criteria $criteria = null, $order = Criteria::ASC, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
if (null === $criteria) {
... | php | static public function doSelectOrderByRank(Criteria $criteria = null, $order = Criteria::ASC, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection(CustomerGroupTableMap::DATABASE_NAME);
}
if (null === $criteria) {
... | [
"static",
"public",
"function",
"doSelectOrderByRank",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"order",
"=",
"Criteria",
"::",
"ASC",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")... | Return an array of sortable objects ordered by position
@param Criteria $criteria optional criteria object
@param string $order sorting order, to be chosen between Criteria::ASC (default) and Criteria::DESC
@param ConnectionInterface $con optional connection
@return array list of sortabl... | [
"Return",
"an",
"array",
"of",
"sortable",
"objects",
"ordered",
"by",
"position"
] | 672cc64c686812f6a95cf0d702111f93d8c0e850 | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerGroupQuery.php#L1018-L1039 |
21,437 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.createEditForm | private function createEditForm(UserGroup $entity) {
$form = $this->createForm(new UserGroupType(), $entity, array(
'action' => $this->generateUrl('admin_usergroup_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('lab... | php | private function createEditForm(UserGroup $entity) {
$form = $this->createForm(new UserGroupType(), $entity, array(
'action' => $this->generateUrl('admin_usergroup_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('lab... | [
"private",
"function",
"createEditForm",
"(",
"UserGroup",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"UserGroupType",
"(",
")",
",",
"$",
"entity",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"g... | Creates a form to edit a UserGroup entity.
@param UserGroup $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"UserGroup",
"entity",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L141-L150 |
21,438 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.deleteAction | public function deleteAction(Request $request, $id) {
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$userGroup = $em->getRepository('AmulenUserBundle:UserGroup')->find($id);
... | php | public function deleteAction(Request $request, $id) {
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$userGroup = $em->getRepository('AmulenUserBundle:UserGroup')->find($id);
... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"id",
")",
";",
"$",
"form",
"->",
"handleRequest",
"(",
"$",
"request",
")",
";",
"if"... | Deletes a UserGroup entity.
@Route("/{id}", name="admin_usergroup_delete")
@Method("DELETE") | [
"Deletes",
"a",
"UserGroup",
"entity",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L191-L224 |
21,439 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.createCreateForm | private function createCreateForm(UserGroup $entity)
{
$options = array ('action' => $this->generateUrl('admin_usergroup_create'),
'method' => 'POST'
);
$form = $this->createForm(new UserGroupType(), $entity, $options);
return $form;
} | php | private function createCreateForm(UserGroup $entity)
{
$options = array ('action' => $this->generateUrl('admin_usergroup_create'),
'method' => 'POST'
);
$form = $this->createForm(new UserGroupType(), $entity, $options);
return $form;
} | [
"private",
"function",
"createCreateForm",
"(",
"UserGroup",
"$",
"entity",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'action'",
"=>",
"$",
"this",
"->",
"generateUrl",
"(",
"'admin_usergroup_create'",
")",
",",
"'method'",
"=>",
"'POST'",
")",
";",
"$",... | Creates a form to create a UserGroup entity.
@param UserGroup $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"create",
"a",
"UserGroup",
"entity",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L253-L262 |
21,440 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Controller/UserGroupController.php | UserGroupController.getUsersByUserGroup | private function getUsersByUserGroup(UserGroup $userGroup)
{
return 10;
$em = $this->getDoctrine()->getEntityManager();
$query = $em->createQuery('SELECT '
. ' u, g '
. ' FROM Flowcode\UserBundle\Entity\User u'
... | php | private function getUsersByUserGroup(UserGroup $userGroup)
{
return 10;
$em = $this->getDoctrine()->getEntityManager();
$query = $em->createQuery('SELECT '
. ' u, g '
. ' FROM Flowcode\UserBundle\Entity\User u'
... | [
"private",
"function",
"getUsersByUserGroup",
"(",
"UserGroup",
"$",
"userGroup",
")",
"{",
"return",
"10",
";",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"query",
"=",
"$",
"em",
"->",
"c... | Get Users by user group. Dado un grupo de roles de usuario, retorna todos
los usuarios que pertenecen al grupo.
@param UserGroup $userGroup El grupo.
@return array() Los usuarios. | [
"Get",
"Users",
"by",
"user",
"group",
".",
"Dado",
"un",
"grupo",
"de",
"roles",
"de",
"usuario",
"retorna",
"todos",
"los",
"usuarios",
"que",
"pertenecen",
"al",
"grupo",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Controller/UserGroupController.php#L273-L287 |
21,441 | mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/RewriteRoutingChecks.php | RewriteRoutingChecks.rewriteRoutingCheckRoute | protected function rewriteRoutingCheckRoute (\MvcCore\IRoute & $route, array $additionalInfo) {
list ($requestMethod) = $additionalInfo;
$routeMethod = $route->GetMethod();
if ($routeMethod !== NULL && $routeMethod !== $requestMethod) return TRUE;
$modules = $route->GetAdvancedConfigProperty(\MvcCore\Ext\Rout... | php | protected function rewriteRoutingCheckRoute (\MvcCore\IRoute & $route, array $additionalInfo) {
list ($requestMethod) = $additionalInfo;
$routeMethod = $route->GetMethod();
if ($routeMethod !== NULL && $routeMethod !== $requestMethod) return TRUE;
$modules = $route->GetAdvancedConfigProperty(\MvcCore\Ext\Rout... | [
"protected",
"function",
"rewriteRoutingCheckRoute",
"(",
"\\",
"MvcCore",
"\\",
"IRoute",
"&",
"$",
"route",
",",
"array",
"$",
"additionalInfo",
")",
"{",
"list",
"(",
"$",
"requestMethod",
")",
"=",
"$",
"additionalInfo",
";",
"$",
"routeMethod",
"=",
"$"... | Return `TRUE` if there is possible by additional info array records
to route request by given route as first argument. For example if route
object has defined http method and request has the same method or not
or if route is allowed in currently routed module.
@param \MvcCore\IRoute $route
@param array $additionalInfo
... | [
"Return",
"TRUE",
"if",
"there",
"is",
"possible",
"by",
"additional",
"info",
"array",
"records",
"to",
"route",
"request",
"by",
"given",
"route",
"as",
"first",
"argument",
".",
"For",
"example",
"if",
"route",
"object",
"has",
"defined",
"http",
"method"... | 7695784a451db86cca6a43c98d076803cd0a50a7 | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/RewriteRoutingChecks.php#L27-L37 |
21,442 | phPoirot/psr7 | UploadedFile.php | UploadedFile.getStream | function getStream()
{
if ($err = $this->getError() !== UPLOAD_ERR_OK)
// TODO Handle Upload With Exception Error
throw new \RuntimeException(sprintf(
'Cannot retrieve stream due to upload error. error: (%s).'
, getUploadErrorMessageFromCode($err)
... | php | function getStream()
{
if ($err = $this->getError() !== UPLOAD_ERR_OK)
// TODO Handle Upload With Exception Error
throw new \RuntimeException(sprintf(
'Cannot retrieve stream due to upload error. error: (%s).'
, getUploadErrorMessageFromCode($err)
... | [
"function",
"getStream",
"(",
")",
"{",
"if",
"(",
"$",
"err",
"=",
"$",
"this",
"->",
"getError",
"(",
")",
"!==",
"UPLOAD_ERR_OK",
")",
"// TODO Handle Upload With Exception Error",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Cannot retrie... | Get Streamed Object Of Uploaded File
@return StreamInterface | [
"Get",
"Streamed",
"Object",
"Of",
"Uploaded",
"File"
] | e90295e806dc2eb0cc422f315075f673c63a0780 | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L99-L119 |
21,443 | phPoirot/psr7 | UploadedFile.php | UploadedFile.setTmpName | protected function setTmpName($filepath)
{
$this->tmpName = (string) $filepath;
$this->stream = null;
$this->_c_givenResource = $filepath; # stream will made of this when requested
return $this;
} | php | protected function setTmpName($filepath)
{
$this->tmpName = (string) $filepath;
$this->stream = null;
$this->_c_givenResource = $filepath; # stream will made of this when requested
return $this;
} | [
"protected",
"function",
"setTmpName",
"(",
"$",
"filepath",
")",
"{",
"$",
"this",
"->",
"tmpName",
"=",
"(",
"string",
")",
"$",
"filepath",
";",
"$",
"this",
"->",
"stream",
"=",
"null",
";",
"$",
"this",
"->",
"_c_givenResource",
"=",
"$",
"filepat... | Set tmp_name of Uploaded File
@param string $filepath
@return $this | [
"Set",
"tmp_name",
"of",
"Uploaded",
"File"
] | e90295e806dc2eb0cc422f315075f673c63a0780 | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L194-L201 |
21,444 | phPoirot/psr7 | UploadedFile.php | UploadedFile.setType | protected function setType($type)
{
if ($type == '*/*' || $type == 'application/octet-stream')
{
$type = \Module\HttpFoundation\getMimeTypeOfFile($this->getTmpName(), false);
if ( empty($type) )
if ( null !== $solved = \Module\HttpFoundation\getMimeTypeOfFile(... | php | protected function setType($type)
{
if ($type == '*/*' || $type == 'application/octet-stream')
{
$type = \Module\HttpFoundation\getMimeTypeOfFile($this->getTmpName(), false);
if ( empty($type) )
if ( null !== $solved = \Module\HttpFoundation\getMimeTypeOfFile(... | [
"protected",
"function",
"setType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'*/*'",
"||",
"$",
"type",
"==",
"'application/octet-stream'",
")",
"{",
"$",
"type",
"=",
"\\",
"Module",
"\\",
"HttpFoundation",
"\\",
"getMimeTypeOfFile",
"("... | Set File Type
@param string $type
@return $this | [
"Set",
"File",
"Type"
] | e90295e806dc2eb0cc422f315075f673c63a0780 | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L243-L257 |
21,445 | phPoirot/psr7 | UploadedFile.php | UploadedFile.setError | protected function setError($errorStatus)
{
# error status
if (! is_int($errorStatus)
|| 0 > $errorStatus
|| 8 < $errorStatus
)
throw new \InvalidArgumentException(
'Invalid error status for UploadedFile; must be an UPLOAD_ERR_* constant'
... | php | protected function setError($errorStatus)
{
# error status
if (! is_int($errorStatus)
|| 0 > $errorStatus
|| 8 < $errorStatus
)
throw new \InvalidArgumentException(
'Invalid error status for UploadedFile; must be an UPLOAD_ERR_* constant'
... | [
"protected",
"function",
"setError",
"(",
"$",
"errorStatus",
")",
"{",
"# error status",
"if",
"(",
"!",
"is_int",
"(",
"$",
"errorStatus",
")",
"||",
"0",
">",
"$",
"errorStatus",
"||",
"8",
"<",
"$",
"errorStatus",
")",
"throw",
"new",
"\\",
"InvalidA... | Set Error Status Code
@param int $errorStatus
@return $this | [
"Set",
"Error",
"Status",
"Code"
] | e90295e806dc2eb0cc422f315075f673c63a0780 | https://github.com/phPoirot/psr7/blob/e90295e806dc2eb0cc422f315075f673c63a0780/UploadedFile.php#L293-L306 |
21,446 | unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.gatherCSSFiles | protected function gatherCSSFiles() {
$this->output->writeln('Scanning theme "'.$this->theme.'" for CSS files');
$this->finder
->files()
->in($this->themeDir)
->name('*.css')
->notName('*.blubber.css')
->notName('*.lean.css');
foreach($this->finder as $file) {
$filename = basename(... | php | protected function gatherCSSFiles() {
$this->output->writeln('Scanning theme "'.$this->theme.'" for CSS files');
$this->finder
->files()
->in($this->themeDir)
->name('*.css')
->notName('*.blubber.css')
->notName('*.lean.css');
foreach($this->finder as $file) {
$filename = basename(... | [
"protected",
"function",
"gatherCSSFiles",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"'Scanning theme \"'",
".",
"$",
"this",
"->",
"theme",
".",
"'\" for CSS files'",
")",
";",
"$",
"this",
"->",
"finder",
"->",
"files",
"(",
")",
... | Collects all the CSS files per the user's approval | [
"Collects",
"all",
"the",
"CSS",
"files",
"per",
"the",
"user",
"s",
"approval"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L159-L175 |
21,447 | unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.loadTemplates | protected function loadTemplates() {
$manifest = SS_TemplateLoader::instance()->getManifest();
$templates = $manifest->getTemplates();
$total = sizeof($templates);
$count = 0;
$this->output->clearProgress();
foreach($templates as $name => $data) {
foreach($manifest->getCandidateTemplate($name, $this... | php | protected function loadTemplates() {
$manifest = SS_TemplateLoader::instance()->getManifest();
$templates = $manifest->getTemplates();
$total = sizeof($templates);
$count = 0;
$this->output->clearProgress();
foreach($templates as $name => $data) {
foreach($manifest->getCandidateTemplate($name, $this... | [
"protected",
"function",
"loadTemplates",
"(",
")",
"{",
"$",
"manifest",
"=",
"SS_TemplateLoader",
"::",
"instance",
"(",
")",
"->",
"getManifest",
"(",
")",
";",
"$",
"templates",
"=",
"$",
"manifest",
"->",
"getTemplates",
"(",
")",
";",
"$",
"total",
... | Loads all the static .ss templates as HTML into memory | [
"Loads",
"all",
"the",
"static",
".",
"ss",
"templates",
"as",
"HTML",
"into",
"memory"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L180-L196 |
21,448 | unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.loadURLs | protected function loadURLs() {
$omissions = self::config()->omit;
$dataobjects = self::config()->extra_dataobjects;
$i = 0;
$classes = ClassInfo::subclassesFor('SiteTree');
array_shift($classes);
$sampler = Sampler::create($classes)
->setDefaultLimit(self::config()->default_limit)
->setOmissi... | php | protected function loadURLs() {
$omissions = self::config()->omit;
$dataobjects = self::config()->extra_dataobjects;
$i = 0;
$classes = ClassInfo::subclassesFor('SiteTree');
array_shift($classes);
$sampler = Sampler::create($classes)
->setDefaultLimit(self::config()->default_limit)
->setOmissi... | [
"protected",
"function",
"loadURLs",
"(",
")",
"{",
"$",
"omissions",
"=",
"self",
"::",
"config",
"(",
")",
"->",
"omit",
";",
"$",
"dataobjects",
"=",
"self",
"::",
"config",
"(",
")",
"->",
"extra_dataobjects",
";",
"$",
"i",
"=",
"0",
";",
"$",
... | Loads all URLs to sample rendered content, per confirguration | [
"Loads",
"all",
"URLs",
"to",
"sample",
"rendered",
"content",
"per",
"confirguration"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L201-L254 |
21,449 | unclecheese/silverstripe-blubber | code/CSSBlubberTask.php | CSSBlubberTask.getSampleForObject | protected function getSampleForObject(DataObject $record) {
$response = Director::test($record->Link());
if($response->getStatusCode() === 200) {
return $response->getBody();
}
return false;
} | php | protected function getSampleForObject(DataObject $record) {
$response = Director::test($record->Link());
if($response->getStatusCode() === 200) {
return $response->getBody();
}
return false;
} | [
"protected",
"function",
"getSampleForObject",
"(",
"DataObject",
"$",
"record",
")",
"{",
"$",
"response",
"=",
"Director",
"::",
"test",
"(",
"$",
"record",
"->",
"Link",
"(",
")",
")",
";",
"if",
"(",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
... | Given a DataObject, get an actual SS_HTTPResponse of rendered HTML
@param DataObject $record
@return string The rendered HTML | [
"Given",
"a",
"DataObject",
"get",
"an",
"actual",
"SS_HTTPResponse",
"of",
"rendered",
"HTML"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberTask.php#L261-L269 |
21,450 | nabab/bbn | src/bbn/models/tts/optional.php | optional.get_appui_option_id | public static function get_appui_option_id(){
return bbn\appui\options::get_instance()->from_code(...self::_treat_args(func_get_args(), true));
} | php | public static function get_appui_option_id(){
return bbn\appui\options::get_instance()->from_code(...self::_treat_args(func_get_args(), true));
} | [
"public",
"static",
"function",
"get_appui_option_id",
"(",
")",
"{",
"return",
"bbn",
"\\",
"appui",
"\\",
"options",
"::",
"get_instance",
"(",
")",
"->",
"from_code",
"(",
"...",
"self",
"::",
"_treat_args",
"(",
"func_get_args",
"(",
")",
",",
"true",
... | Returns The option's ID of a category, i.e. direct children of option's root
@param string $code
@return int|false | [
"Returns",
"The",
"option",
"s",
"ID",
"of",
"a",
"category",
"i",
".",
"e",
".",
"direct",
"children",
"of",
"option",
"s",
"root"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/models/tts/optional.php#L115-L117 |
21,451 | kusanagi/katana-sdk-php7 | src/Api/TypeCatalog.php | TypeCatalog.getDefault | public function getDefault(string $type)
{
switch ($type) {
case self::TYPE_NULL:
return null;
case self::TYPE_BOOLEAN:
return false;
case self::TYPE_INTEGER:
case self::TYPE_FLOAT:
return 0;
case sel... | php | public function getDefault(string $type)
{
switch ($type) {
case self::TYPE_NULL:
return null;
case self::TYPE_BOOLEAN:
return false;
case self::TYPE_INTEGER:
case self::TYPE_FLOAT:
return 0;
case sel... | [
"public",
"function",
"getDefault",
"(",
"string",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_NULL",
":",
"return",
"null",
";",
"case",
"self",
"::",
"TYPE_BOOLEAN",
":",
"return",
"false",
";",
"case",
"s... | Return the default value for a given type.
@param string $type
@return mixed
@throws InvalidValueException | [
"Return",
"the",
"default",
"value",
"for",
"a",
"given",
"type",
"."
] | 91e7860a1852c3ce79a7034f8c36f41840e69e1f | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/TypeCatalog.php#L63-L82 |
21,452 | kusanagi/katana-sdk-php7 | src/Api/TypeCatalog.php | TypeCatalog.validate | public function validate(string $type, $value): bool
{
switch ($type) {
case self::TYPE_NULL:
return is_null($value);
case self::TYPE_BOOLEAN:
return is_bool($value);
case self::TYPE_INTEGER:
return is_integer($value);
... | php | public function validate(string $type, $value): bool
{
switch ($type) {
case self::TYPE_NULL:
return is_null($value);
case self::TYPE_BOOLEAN:
return is_bool($value);
case self::TYPE_INTEGER:
return is_integer($value);
... | [
"public",
"function",
"validate",
"(",
"string",
"$",
"type",
",",
"$",
"value",
")",
":",
"bool",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_NULL",
":",
"return",
"is_null",
"(",
"$",
"value",
")",
";",
"case",
"self",
... | Validates a value against a type.
@param mixed $value
@param string $type
@return bool
@throws InvalidValueException | [
"Validates",
"a",
"value",
"against",
"a",
"type",
"."
] | 91e7860a1852c3ce79a7034f8c36f41840e69e1f | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/TypeCatalog.php#L92-L120 |
21,453 | crysalead/inflector | src/Inflector.php | Inflector.camelize | public static function camelize($word)
{
$upper = function($matches) {
return strtoupper($matches[0]);
};
$word = preg_replace('/([a-z])([A-Z])/', '$1_$2', $word);
$camelized = str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', strtolower($word))));
return ... | php | public static function camelize($word)
{
$upper = function($matches) {
return strtoupper($matches[0]);
};
$word = preg_replace('/([a-z])([A-Z])/', '$1_$2', $word);
$camelized = str_replace(' ', '', ucwords(str_replace(['_', '-'], ' ', strtolower($word))));
return ... | [
"public",
"static",
"function",
"camelize",
"(",
"$",
"word",
")",
"{",
"$",
"upper",
"=",
"function",
"(",
"$",
"matches",
")",
"{",
"return",
"strtoupper",
"(",
"$",
"matches",
"[",
"0",
"]",
")",
";",
"}",
";",
"$",
"word",
"=",
"preg_replace",
... | Takes a under_scored word and turns it into a camelcased word.
@param string $word An underscored or slugged word (i.e. `'red_bike'` or `'red-bike'`).
@param array $on List of characters to camelize on.
@return string Camel cased version of the word (i.e. `'RedBike'`). | [
"Takes",
"a",
"under_scored",
"word",
"and",
"turns",
"it",
"into",
"a",
"camelcased",
"word",
"."
] | 07a890c43debebcfaeffe1c30a504f954e9a463c | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L29-L37 |
21,454 | crysalead/inflector | src/Inflector.php | Inflector.slug | public static function slug($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
$spaced = preg_replace('/[^\w\s]/', ' ', $transliterated);
return preg_replace('/\\s+/', $replacement, trim($spaced));
} | php | public static function slug($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
$spaced = preg_replace('/[^\w\s]/', ' ', $transliterated);
return preg_replace('/\\s+/', $replacement, trim($spaced));
} | [
"public",
"static",
"function",
"slug",
"(",
"$",
"string",
",",
"$",
"replacement",
"=",
"'-'",
")",
"{",
"$",
"transliterated",
"=",
"static",
"::",
"transliterate",
"(",
"$",
"string",
")",
";",
"$",
"spaced",
"=",
"preg_replace",
"(",
"'/[^\\w\\s]/'",
... | Returns a string with all spaces converted to given replacement and non word characters removed.
Maps special characters to ASCII using `transliterator_transliterate`.
@param string $string An arbitrary string to convert.
@param string $replacement The replacement to use for spaces.
@return string ... | [
"Returns",
"a",
"string",
"with",
"all",
"spaces",
"converted",
"to",
"given",
"replacement",
"and",
"non",
"word",
"characters",
"removed",
".",
"Maps",
"special",
"characters",
"to",
"ASCII",
"using",
"transliterator_transliterate",
"."
] | 07a890c43debebcfaeffe1c30a504f954e9a463c | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L81-L86 |
21,455 | crysalead/inflector | src/Inflector.php | Inflector.parameterize | public static function parameterize($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
return strtolower(static::slug($string, $replacement));
} | php | public static function parameterize($string, $replacement = '-')
{
$transliterated = static::transliterate($string);
return strtolower(static::slug($string, $replacement));
} | [
"public",
"static",
"function",
"parameterize",
"(",
"$",
"string",
",",
"$",
"replacement",
"=",
"'-'",
")",
"{",
"$",
"transliterated",
"=",
"static",
"::",
"transliterate",
"(",
"$",
"string",
")",
";",
"return",
"strtolower",
"(",
"static",
"::",
"slug... | Returns a lowercased string with all spaces converted to given replacement and non word characters removed.
Maps special characters to ASCII using `transliterator_transliterate`.
@param string $string An arbitrary string to convert.
@param string $replacement The replacement to use for spaces.
@return string ... | [
"Returns",
"a",
"lowercased",
"string",
"with",
"all",
"spaces",
"converted",
"to",
"given",
"replacement",
"and",
"non",
"word",
"characters",
"removed",
".",
"Maps",
"special",
"characters",
"to",
"ASCII",
"using",
"transliterator_transliterate",
"."
] | 07a890c43debebcfaeffe1c30a504f954e9a463c | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L96-L100 |
21,456 | crysalead/inflector | src/Inflector.php | Inflector._inflect | protected static function _inflect($type, $rule, $replacement, $locale)
{
$rules = & static::${$type};
if (!isset($rules[$locale])) {
$rules[$locale] = [];
}
$rules[$locale] = [$rule => $replacement] + $rules[$locale];
} | php | protected static function _inflect($type, $rule, $replacement, $locale)
{
$rules = & static::${$type};
if (!isset($rules[$locale])) {
$rules[$locale] = [];
}
$rules[$locale] = [$rule => $replacement] + $rules[$locale];
} | [
"protected",
"static",
"function",
"_inflect",
"(",
"$",
"type",
",",
"$",
"rule",
",",
"$",
"replacement",
",",
"$",
"locale",
")",
"{",
"$",
"rules",
"=",
"&",
"static",
"::",
"$",
"{",
"$",
"type",
"}",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Set a new inflection rule and its replacement.
@param string $type The inflection type.
@param string $rule A regular expression.
@param string $replacement The replacement expression.
@param string $locale The locale where this rule will be applied. | [
"Set",
"a",
"new",
"inflection",
"rule",
"and",
"its",
"replacement",
"."
] | 07a890c43debebcfaeffe1c30a504f954e9a463c | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L159-L166 |
21,457 | crysalead/inflector | src/Inflector.php | Inflector._inflectize | protected static function _inflectize($rules, $word, $locale)
{
if (!$word || !isset($rules[$locale])) {
return $word;
}
$result = $word;
foreach ($rules[$locale] as $rule => $replacement) {
$result = preg_replace($rule, $replacement, $word, -1, $count);
... | php | protected static function _inflectize($rules, $word, $locale)
{
if (!$word || !isset($rules[$locale])) {
return $word;
}
$result = $word;
foreach ($rules[$locale] as $rule => $replacement) {
$result = preg_replace($rule, $replacement, $word, -1, $count);
... | [
"protected",
"static",
"function",
"_inflectize",
"(",
"$",
"rules",
",",
"$",
"word",
",",
"$",
"locale",
")",
"{",
"if",
"(",
"!",
"$",
"word",
"||",
"!",
"isset",
"(",
"$",
"rules",
"[",
"$",
"locale",
"]",
")",
")",
"{",
"return",
"$",
"word"... | Changes the form of a word.
@param string $rules The inflection rules array.
@param string $word A word.
@param string $locale The locale to use for rules.
@return string The inflectized word. | [
"Changes",
"the",
"form",
"of",
"a",
"word",
"."
] | 07a890c43debebcfaeffe1c30a504f954e9a463c | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L202-L215 |
21,458 | crysalead/inflector | src/Inflector.php | Inflector.irregular | public static function irregular($singular, $plural, $locale = 'default')
{
$rules = !is_array($singular) ? [$singular => $plural] : $singular;
$len = min(strlen($singular), strlen($plural));
$prefix = '';
$index = 0;
while ($index < $len && ($singular[$index] === $plural[$... | php | public static function irregular($singular, $plural, $locale = 'default')
{
$rules = !is_array($singular) ? [$singular => $plural] : $singular;
$len = min(strlen($singular), strlen($plural));
$prefix = '';
$index = 0;
while ($index < $len && ($singular[$index] === $plural[$... | [
"public",
"static",
"function",
"irregular",
"(",
"$",
"singular",
",",
"$",
"plural",
",",
"$",
"locale",
"=",
"'default'",
")",
"{",
"$",
"rules",
"=",
"!",
"is_array",
"(",
"$",
"singular",
")",
"?",
"[",
"$",
"singular",
"=>",
"$",
"plural",
"]",... | Set a new exception in inflection.
@param string $singular The singular form of the word.
@param string $plural The plural form of the word.
@param string $locale The locale where this irregularity will be applied. | [
"Set",
"a",
"new",
"exception",
"in",
"inflection",
"."
] | 07a890c43debebcfaeffe1c30a504f954e9a463c | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L224-L247 |
21,459 | crysalead/inflector | src/Inflector.php | Inflector.reset | public static function reset($lang = null)
{
if (is_string($lang)) {
unset(static::$_singular[$lang]);
unset(static::$_plural[$lang]);
return;
}
static::$_singular = [];
static::$_plural = [];
if ($lang === true) {
return;
... | php | public static function reset($lang = null)
{
if (is_string($lang)) {
unset(static::$_singular[$lang]);
unset(static::$_plural[$lang]);
return;
}
static::$_singular = [];
static::$_plural = [];
if ($lang === true) {
return;
... | [
"public",
"static",
"function",
"reset",
"(",
"$",
"lang",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"lang",
")",
")",
"{",
"unset",
"(",
"static",
"::",
"$",
"_singular",
"[",
"$",
"lang",
"]",
")",
";",
"unset",
"(",
"static",
":... | Clears all inflection rules.
@param string|boolean $lang The language name to reset or `true` to reset all even defaults. | [
"Clears",
"all",
"inflection",
"rules",
"."
] | 07a890c43debebcfaeffe1c30a504f954e9a463c | https://github.com/crysalead/inflector/blob/07a890c43debebcfaeffe1c30a504f954e9a463c/src/Inflector.php#L266-L464 |
21,460 | ShaoZeMing/laravel-merchant | src/Form/Field/HasMany.php | HasMany.setupScriptForDefaultView | protected function setupScriptForDefaultView($templateScript)
{
$removeClass = NestedForm::REMOVE_FLAG_CLASS;
$defaultKey = NestedForm::DEFAULT_KEY_NAME;
/**
* When add a new sub form, replace all element key in new sub form.
*
* @example comments[new___key__][tit... | php | protected function setupScriptForDefaultView($templateScript)
{
$removeClass = NestedForm::REMOVE_FLAG_CLASS;
$defaultKey = NestedForm::DEFAULT_KEY_NAME;
/**
* When add a new sub form, replace all element key in new sub form.
*
* @example comments[new___key__][tit... | [
"protected",
"function",
"setupScriptForDefaultView",
"(",
"$",
"templateScript",
")",
"{",
"$",
"removeClass",
"=",
"NestedForm",
"::",
"REMOVE_FLAG_CLASS",
";",
"$",
"defaultKey",
"=",
"NestedForm",
"::",
"DEFAULT_KEY_NAME",
";",
"/**\n * When add a new sub form... | Setup default template script.
@param string $templateScript
@return void | [
"Setup",
"default",
"template",
"script",
"."
] | 20801b1735e7832a6e58b37c2c391328f8d626fa | https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Field/HasMany.php#L391-L424 |
21,461 | dragonmantank/fillet | src/Fillet/Parser/WordpressExport.php | WordpressExport.parse | public function parse($inputFile)
{
$DCNamespace = 'http://purl.org/rss/1.0/modules/content/';
$WPNamespace = 'http://wordpress.org/export/1.2/';
$reader = new \XMLReader();
$dom = new \DOMDocument('1.0', 'UTF-8');
$reader->open($inputFile);
while ($reader->read() &&... | php | public function parse($inputFile)
{
$DCNamespace = 'http://purl.org/rss/1.0/modules/content/';
$WPNamespace = 'http://wordpress.org/export/1.2/';
$reader = new \XMLReader();
$dom = new \DOMDocument('1.0', 'UTF-8');
$reader->open($inputFile);
while ($reader->read() &&... | [
"public",
"function",
"parse",
"(",
"$",
"inputFile",
")",
"{",
"$",
"DCNamespace",
"=",
"'http://purl.org/rss/1.0/modules/content/'",
";",
"$",
"WPNamespace",
"=",
"'http://wordpress.org/export/1.2/'",
";",
"$",
"reader",
"=",
"new",
"\\",
"XMLReader",
"(",
")",
... | Parses a specific XML file
@param string $inputFile File to parse
@return \Generator | [
"Parses",
"a",
"specific",
"XML",
"file"
] | b197947608c05ac2318e8f6b296345494004d9c6 | https://github.com/dragonmantank/fillet/blob/b197947608c05ac2318e8f6b296345494004d9c6/src/Fillet/Parser/WordpressExport.php#L18-L61 |
21,462 | david-mk/mail-map | src/MailMap/MailMap.php | MailMap.query | public function query($inbox = 'INBOX', callable $queryCall = null)
{
$query = new Query;
if (!is_null($queryCall)) {
$query = $queryCall($query);
}
return $query->get($this->factory->create($inbox), $this->mailFactory);
} | php | public function query($inbox = 'INBOX', callable $queryCall = null)
{
$query = new Query;
if (!is_null($queryCall)) {
$query = $queryCall($query);
}
return $query->get($this->factory->create($inbox), $this->mailFactory);
} | [
"public",
"function",
"query",
"(",
"$",
"inbox",
"=",
"'INBOX'",
",",
"callable",
"$",
"queryCall",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"new",
"Query",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"queryCall",
")",
")",
"{",
"$",
"query",
"=",
... | Execute query on a new connection and wrap results in Mail wrappers.
Provide a callable to set conditions, sorting, and limits on query.
The query instance will be provided as the single arguement to the
callable.
@param string $inbox
@param callable $queryCall
@return array | [
"Execute",
"query",
"on",
"a",
"new",
"connection",
"and",
"wrap",
"results",
"in",
"Mail",
"wrappers",
"."
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailMap.php#L53-L62 |
21,463 | ekuiter/feature-php | FeaturePhp/Model/XmlConfiguration.php | XmlConfiguration.fromString | public static function fromString($str, $directory = null) {
return new self((new fphp\Helper\XmlParser())->parseString($str));
} | php | public static function fromString($str, $directory = null) {
return new self((new fphp\Helper\XmlParser())->parseString($str));
} | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"str",
",",
"$",
"directory",
"=",
"null",
")",
"{",
"return",
"new",
"self",
"(",
"(",
"new",
"fphp",
"\\",
"Helper",
"\\",
"XmlParser",
"(",
")",
")",
"->",
"parseString",
"(",
"$",
"str",
")"... | Creates an XML configuration from an XML string.
@param string $str
@param string $directory ignored
@return XmlConfiguration | [
"Creates",
"an",
"XML",
"configuration",
"from",
"an",
"XML",
"string",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/XmlConfiguration.php#L85-L87 |
21,464 | shabbyrobe/amiss | src/Sql/Type/Date.php | Date.prepareDateTime | protected function prepareDateTime($value)
{
if ($this->requireAppTimeZone && !static::timeZoneEqual($value->getTimeZone(), $this->appTimeZone)) {
// Actually performing this conversion may not be an issue. Wait
// until it is raised before making a decision.
throw new \U... | php | protected function prepareDateTime($value)
{
if ($this->requireAppTimeZone && !static::timeZoneEqual($value->getTimeZone(), $this->appTimeZone)) {
// Actually performing this conversion may not be an issue. Wait
// until it is raised before making a decision.
throw new \U... | [
"protected",
"function",
"prepareDateTime",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"requireAppTimeZone",
"&&",
"!",
"static",
"::",
"timeZoneEqual",
"(",
"$",
"value",
"->",
"getTimeZone",
"(",
")",
",",
"$",
"this",
"->",
"appTimeZone"... | Don't type hint here - there's no common interface between DateTime and DateTimeImmutable
at 5.6 that supports all the methods we are using, though both objects remain largely interchangeable. | [
"Don",
"t",
"type",
"hint",
"here",
"-",
"there",
"s",
"no",
"common",
"interface",
"between",
"DateTime",
"and",
"DateTimeImmutable",
"at",
"5",
".",
"6",
"that",
"supports",
"all",
"the",
"methods",
"we",
"are",
"using",
"though",
"both",
"objects",
"rem... | ba261f0d1f985ed36e9fd2903ac0df86c5b9498d | https://github.com/shabbyrobe/amiss/blob/ba261f0d1f985ed36e9fd2903ac0df86c5b9498d/src/Sql/Type/Date.php#L140-L155 |
21,465 | soloproyectos-php/text-parser | src/text/parser/TextParser.php | TextParser.is | protected function is($methodName /*, $arg1, $arg2, $arg3 ... */)
{
if (!method_exists($this, $methodName)) {
throw new TextParserException(
"The method `$methodName` does not exist"
);
}
if (!is_callable(array($this, $methodName))) {
thro... | php | protected function is($methodName /*, $arg1, $arg2, $arg3 ... */)
{
if (!method_exists($this, $methodName)) {
throw new TextParserException(
"The method `$methodName` does not exist"
);
}
if (!is_callable(array($this, $methodName))) {
thro... | [
"protected",
"function",
"is",
"(",
"$",
"methodName",
"/*, $arg1, $arg2, $arg3 ... */",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"$",
"methodName",
")",
")",
"{",
"throw",
"new",
"TextParserException",
"(",
"\"The method `$methodName` doe... | Does the next thing satisfies a given method?
Matches the string against a function and moves the offset forward if the
function returns true.
@param string $methodName Method name
@throws TextParserException
@return mixed | [
"Does",
"the",
"next",
"thing",
"satisfies",
"a",
"given",
"method?"
] | 3ef2e8a26f7c53b170383d74ccf4106b0f3dd8b1 | https://github.com/soloproyectos-php/text-parser/blob/3ef2e8a26f7c53b170383d74ccf4106b0f3dd8b1/src/text/parser/TextParser.php#L132-L161 |
21,466 | activecollab/controller | src/Controller.php | Controller.getControllerName | public function getControllerName()
{
if (empty($this->controller_name)) {
$controller_class = get_class($this);
if (($pos = strrpos($controller_class, '\\')) !== false) {
$this->controller_name = substr($controller_class, $pos + 1);
} else {
... | php | public function getControllerName()
{
if (empty($this->controller_name)) {
$controller_class = get_class($this);
if (($pos = strrpos($controller_class, '\\')) !== false) {
$this->controller_name = substr($controller_class, $pos + 1);
} else {
... | [
"public",
"function",
"getControllerName",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"controller_name",
")",
")",
"{",
"$",
"controller_class",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"if",
"(",
"(",
"$",
"pos",
"=",
"strrpos",
... | Return controller name, without namespace.
@return string | [
"Return",
"controller",
"name",
"without",
"namespace",
"."
] | 51d24f3f203f7f5ae56edde2e35b5ef2d9293caa | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/Controller.php#L165-L178 |
21,467 | activecollab/controller | src/Controller.php | Controller.getParsedBodyParam | protected function getParsedBodyParam(ServerRequestInterface $request, $param_name, $default = null)
{
$parsed_body = $request->getParsedBody();
if ($parsed_body) {
if (is_array($parsed_body) && array_key_exists($param_name, $parsed_body)) {
return $parsed_body[$param_na... | php | protected function getParsedBodyParam(ServerRequestInterface $request, $param_name, $default = null)
{
$parsed_body = $request->getParsedBody();
if ($parsed_body) {
if (is_array($parsed_body) && array_key_exists($param_name, $parsed_body)) {
return $parsed_body[$param_na... | [
"protected",
"function",
"getParsedBodyParam",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"$",
"param_name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"parsed_body",
"=",
"$",
"request",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",
"$",
... | Return a param from a parsed body.
This method is NULL or object safe - it will check for body type, and do it's best to return a value without
breaking or throwing a warning.
@param ServerRequestInterface $request
@param $param_name
@param null $default
@return mixed|null | [
"Return",
"a",
"param",
"from",
"a",
"parsed",
"body",
"."
] | 51d24f3f203f7f5ae56edde2e35b5ef2d9293caa | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/Controller.php#L230-L243 |
21,468 | eghojansu/moe | src/tools/web/Geo.php | Geo.tzinfo | function tzinfo($zone) {
$ref=new DateTimeZone($zone);
$loc=$ref->getLocation();
$trn=$ref->getTransitions($now=time(),$now);
$out=array(
'offset'=>$ref->
getOffset(new DateTime('now',new DateTimeZone('GMT')))/3600,
'country'=>$loc['country_code'],
'latitude'=>$loc['latitude'],
'longitude'=>$loc... | php | function tzinfo($zone) {
$ref=new DateTimeZone($zone);
$loc=$ref->getLocation();
$trn=$ref->getTransitions($now=time(),$now);
$out=array(
'offset'=>$ref->
getOffset(new DateTime('now',new DateTimeZone('GMT')))/3600,
'country'=>$loc['country_code'],
'latitude'=>$loc['latitude'],
'longitude'=>$loc... | [
"function",
"tzinfo",
"(",
"$",
"zone",
")",
"{",
"$",
"ref",
"=",
"new",
"DateTimeZone",
"(",
"$",
"zone",
")",
";",
"$",
"loc",
"=",
"$",
"ref",
"->",
"getLocation",
"(",
")",
";",
"$",
"trn",
"=",
"$",
"ref",
"->",
"getTransitions",
"(",
"$",
... | Return information about specified Unix time zone
@return array
@param $zone string | [
"Return",
"information",
"about",
"specified",
"Unix",
"time",
"zone"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/web/Geo.php#L19-L33 |
21,469 | surebert/surebert-framework | src/sb/Controller/Google/Auth.php | Auth.login | public function login(){
if ($this->getGet('code')) {
$this->client->authenticate($this->getGet('code'));
$this->setSession('token', $this->client->getAccessToken());
$redirect = $this->config->redirect_uris[0];
header('Location: ' . filter_var($redirect, FILTER_... | php | public function login(){
if ($this->getGet('code')) {
$this->client->authenticate($this->getGet('code'));
$this->setSession('token', $this->client->getAccessToken());
$redirect = $this->config->redirect_uris[0];
header('Location: ' . filter_var($redirect, FILTER_... | [
"public",
"function",
"login",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getGet",
"(",
"'code'",
")",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"authenticate",
"(",
"$",
"this",
"->",
"getGet",
"(",
"'code'",
")",
")",
";",
"$",
"this",
"-... | Logs in the user
@return \stdClass
@servable true | [
"Logs",
"in",
"the",
"user"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Google/Auth.php#L98-L119 |
21,470 | dlundgren/php-css-splitter | src/Splitter.php | Splitter.countSelectors | public function countSelectors($css = null)
{
$count = 0;
if ($css !== null && $this->css !== $css) {
$this->css = $css;
$this->parsedCss = $this->splitIntoBlocks($this->css);
}
foreach ($this->parsedCss as $rules) {
$count += $rules['count'];
}
return $count;
} | php | public function countSelectors($css = null)
{
$count = 0;
if ($css !== null && $this->css !== $css) {
$this->css = $css;
$this->parsedCss = $this->splitIntoBlocks($this->css);
}
foreach ($this->parsedCss as $rules) {
$count += $rules['count'];
}
return $count;
} | [
"public",
"function",
"countSelectors",
"(",
"$",
"css",
"=",
"null",
")",
"{",
"$",
"count",
"=",
"0",
";",
"if",
"(",
"$",
"css",
"!==",
"null",
"&&",
"$",
"this",
"->",
"css",
"!==",
"$",
"css",
")",
"{",
"$",
"this",
"->",
"css",
"=",
"$",
... | Counts the selectors in the given css
@param string $css
@return int The count of selectors in the CSS | [
"Counts",
"the",
"selectors",
"in",
"the",
"given",
"css"
] | 5a130eee3141b3e2631e1d9fcee388546b216790 | https://github.com/dlundgren/php-css-splitter/blob/5a130eee3141b3e2631e1d9fcee388546b216790/src/Splitter.php#L57-L69 |
21,471 | dlundgren/php-css-splitter | src/Splitter.php | Splitter.split | public function split($css = null, $part = 1, $maxSelectors = self::MAX_SELECTORS_DEFAULT)
{
if (empty($css) && empty($this->css)) {
return null;
}
if (!empty($css) && $this->css !== $css) {
$this->css = $css;
}
$charset = $this->extractCharset($this->css);
isset($charset) && $this->css = str_repla... | php | public function split($css = null, $part = 1, $maxSelectors = self::MAX_SELECTORS_DEFAULT)
{
if (empty($css) && empty($this->css)) {
return null;
}
if (!empty($css) && $this->css !== $css) {
$this->css = $css;
}
$charset = $this->extractCharset($this->css);
isset($charset) && $this->css = str_repla... | [
"public",
"function",
"split",
"(",
"$",
"css",
"=",
"null",
",",
"$",
"part",
"=",
"1",
",",
"$",
"maxSelectors",
"=",
"self",
"::",
"MAX_SELECTORS_DEFAULT",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"css",
")",
"&&",
"empty",
"(",
"$",
"this",
"->"... | Returns the requested part of the split css
@param string $css
@param int $part
@param int $maxSelectors
@return null|string | [
"Returns",
"the",
"requested",
"part",
"of",
"the",
"split",
"css"
] | 5a130eee3141b3e2631e1d9fcee388546b216790 | https://github.com/dlundgren/php-css-splitter/blob/5a130eee3141b3e2631e1d9fcee388546b216790/src/Splitter.php#L79-L132 |
21,472 | dlundgren/php-css-splitter | src/Splitter.php | Splitter.summarizeBlock | private function summarizeBlock($block)
{
$block = array(
'rules' => is_array($block) ? $block : $this->splitIntoRules(trim($block)),
'count' => 0
);
foreach ($block['rules'] as $key => $rule) {
$block['rules'][$key] = array(
'rule' => $rule,
'count' => $this->countSelectorsInRule($rule),
);... | php | private function summarizeBlock($block)
{
$block = array(
'rules' => is_array($block) ? $block : $this->splitIntoRules(trim($block)),
'count' => 0
);
foreach ($block['rules'] as $key => $rule) {
$block['rules'][$key] = array(
'rule' => $rule,
'count' => $this->countSelectorsInRule($rule),
);... | [
"private",
"function",
"summarizeBlock",
"(",
"$",
"block",
")",
"{",
"$",
"block",
"=",
"array",
"(",
"'rules'",
"=>",
"is_array",
"(",
"$",
"block",
")",
"?",
"$",
"block",
":",
"$",
"this",
"->",
"splitIntoRules",
"(",
"trim",
"(",
"$",
"block",
"... | Summarizes the block of CSS
This splits the block into it's css rules and then counts the selectors in the rule
@param $block
@return array Array(rules,count) | [
"Summarizes",
"the",
"block",
"of",
"CSS"
] | 5a130eee3141b3e2631e1d9fcee388546b216790 | https://github.com/dlundgren/php-css-splitter/blob/5a130eee3141b3e2631e1d9fcee388546b216790/src/Splitter.php#L142-L157 |
21,473 | dlundgren/php-css-splitter | src/Splitter.php | Splitter.splitIntoBlocks | private function splitIntoBlocks($css)
{
if (is_array($css)) {
return $css;
}
$blocks = array();
$css = $this->stripComments($css);
$offset = 0;
// catch all @feature {...} blocks
if (preg_match_all('/(@[^{]+){([^{}]*{[^}]*})*\s*}/ism', $css, $matches, PREG_OFFSET_CAPTURE) > 0) {
foreach ($mat... | php | private function splitIntoBlocks($css)
{
if (is_array($css)) {
return $css;
}
$blocks = array();
$css = $this->stripComments($css);
$offset = 0;
// catch all @feature {...} blocks
if (preg_match_all('/(@[^{]+){([^{}]*{[^}]*})*\s*}/ism', $css, $matches, PREG_OFFSET_CAPTURE) > 0) {
foreach ($mat... | [
"private",
"function",
"splitIntoBlocks",
"(",
"$",
"css",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"css",
")",
")",
"{",
"return",
"$",
"css",
";",
"}",
"$",
"blocks",
"=",
"array",
"(",
")",
";",
"$",
"css",
"=",
"$",
"this",
"->",
"stripComm... | Splits the css into blocks maintaining the order of the rules and media queries
This makes it easier to split the CSS into files when a media query might be split
@param $css
@return array | [
"Splits",
"the",
"css",
"into",
"blocks",
"maintaining",
"the",
"order",
"of",
"the",
"rules",
"and",
"media",
"queries"
] | 5a130eee3141b3e2631e1d9fcee388546b216790 | https://github.com/dlundgren/php-css-splitter/blob/5a130eee3141b3e2631e1d9fcee388546b216790/src/Splitter.php#L167-L224 |
21,474 | dlundgren/php-css-splitter | src/Splitter.php | Splitter.splitIntoRules | private function splitIntoRules($css)
{
$rules = preg_split('/}/', trim($this->stripComments($css)));
// complete any rules by append } to them
array_walk($rules,
function (&$s) {
!empty($s) && $s = trim("$s}");
});
// clears out any empty rules
return array_filter($rules);
} | php | private function splitIntoRules($css)
{
$rules = preg_split('/}/', trim($this->stripComments($css)));
// complete any rules by append } to them
array_walk($rules,
function (&$s) {
!empty($s) && $s = trim("$s}");
});
// clears out any empty rules
return array_filter($rules);
} | [
"private",
"function",
"splitIntoRules",
"(",
"$",
"css",
")",
"{",
"$",
"rules",
"=",
"preg_split",
"(",
"'/}/'",
",",
"trim",
"(",
"$",
"this",
"->",
"stripComments",
"(",
"$",
"css",
")",
")",
")",
";",
"// complete any rules by append } to them",
"array_... | Splits the css into it's rules
@param $css
@return array | [
"Splits",
"the",
"css",
"into",
"it",
"s",
"rules"
] | 5a130eee3141b3e2631e1d9fcee388546b216790 | https://github.com/dlundgren/php-css-splitter/blob/5a130eee3141b3e2631e1d9fcee388546b216790/src/Splitter.php#L232-L244 |
21,475 | wenbinye/PhalconX | src/Db/Schema/Table.php | Table.describeTable | public static function describeTable(AdapterInterface $db, $table, $schema = null)
{
$columns = $db->describeColumns($table, $schema);
$indexes = $db->describeIndexes($table, $schema);
$references = $db->describeReferences($table, $schema);
$options = $db->tableOptions($table, $schem... | php | public static function describeTable(AdapterInterface $db, $table, $schema = null)
{
$columns = $db->describeColumns($table, $schema);
$indexes = $db->describeIndexes($table, $schema);
$references = $db->describeReferences($table, $schema);
$options = $db->tableOptions($table, $schem... | [
"public",
"static",
"function",
"describeTable",
"(",
"AdapterInterface",
"$",
"db",
",",
"$",
"table",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"$",
"columns",
"=",
"$",
"db",
"->",
"describeColumns",
"(",
"$",
"table",
",",
"$",
"schema",
")",
";",... | Gets table description
@return Table | [
"Gets",
"table",
"description"
] | 0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1 | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/Schema/Table.php#L40-L55 |
21,476 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/validators/index_fields.php | ezcDbSchemaIndexFieldsValidator.validate | static public function validate( ezcDbSchema $schema )
{
$errors = array();
/* For each table we first retrieve all the field names, and then check
* per index whether the fields it references exist */
foreach ( $schema->getSchema() as $tableName => $table )
{
$... | php | static public function validate( ezcDbSchema $schema )
{
$errors = array();
/* For each table we first retrieve all the field names, and then check
* per index whether the fields it references exist */
foreach ( $schema->getSchema() as $tableName => $table )
{
$... | [
"static",
"public",
"function",
"validate",
"(",
"ezcDbSchema",
"$",
"schema",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"/* For each table we first retrieve all the field names, and then check\n * per index whether the fields it references exist */",
"foreach... | Validates if all the fields used in all indexes exist.
This method loops over all the fields in the indexes of each table and
checks whether the fields that is used in an index is also defined in
the table definition. It will return an array containing error strings
for each non-supported type that it finds.
@param e... | [
"Validates",
"if",
"all",
"the",
"fields",
"used",
"in",
"all",
"indexes",
"exist",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/validators/index_fields.php#L31-L54 |
21,477 | j-d/draggy | src/Draggy/Log.php | Log.prepend | public function prepend($message)
{
$this->log = [$message] + $this->log;
$this->extendedLog = [$message] + $this->extendedLog;
} | php | public function prepend($message)
{
$this->log = [$message] + $this->log;
$this->extendedLog = [$message] + $this->extendedLog;
} | [
"public",
"function",
"prepend",
"(",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"log",
"=",
"[",
"$",
"message",
"]",
"+",
"$",
"this",
"->",
"log",
";",
"$",
"this",
"->",
"extendedLog",
"=",
"[",
"$",
"message",
"]",
"+",
"$",
"this",
"->",
... | Prepend a message to the log
@param $message | [
"Prepend",
"a",
"message",
"to",
"the",
"log"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Log.php#L43-L47 |
21,478 | primipilus/fileinfo | src/MimeType.php | MimeType.getExtensions | public static function getExtensions(string $mime) : array
{
$extensions = [];
foreach (static::$_types as $extension => $mimeType) {
if ($mimeType === $mime) {
$extensions[] = $extension;
}
}
return $extensions;
} | php | public static function getExtensions(string $mime) : array
{
$extensions = [];
foreach (static::$_types as $extension => $mimeType) {
if ($mimeType === $mime) {
$extensions[] = $extension;
}
}
return $extensions;
} | [
"public",
"static",
"function",
"getExtensions",
"(",
"string",
"$",
"mime",
")",
":",
"array",
"{",
"$",
"extensions",
"=",
"[",
"]",
";",
"foreach",
"(",
"static",
"::",
"$",
"_types",
"as",
"$",
"extension",
"=>",
"$",
"mimeType",
")",
"{",
"if",
... | Get extensions for one mime
@param string $mime
@return array | [
"Get",
"extensions",
"for",
"one",
"mime"
] | 734fd25b3dfd3b0706f9ef07499663578c0fa56e | https://github.com/primipilus/fileinfo/blob/734fd25b3dfd3b0706f9ef07499663578c0fa56e/src/MimeType.php#L1023-L1034 |
21,479 | ronaldborla/chikka | src/Borla/Chikka/Models/Notification.php | Notification.onSetAttribute | protected function onSetAttribute($name, $value) {
// Listen to these attributes
$listen = [
'message_type'=> 'type',
'message_id' => 'id',
'credits_cost'=> 'credits',
'rb_cost' => 'cost',
];
// If set
if (isset($listen[$name])) {
// If not yet set
if ( ! iss... | php | protected function onSetAttribute($name, $value) {
// Listen to these attributes
$listen = [
'message_type'=> 'type',
'message_id' => 'id',
'credits_cost'=> 'credits',
'rb_cost' => 'cost',
];
// If set
if (isset($listen[$name])) {
// If not yet set
if ( ! iss... | [
"protected",
"function",
"onSetAttribute",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"// Listen to these attributes",
"$",
"listen",
"=",
"[",
"'message_type'",
"=>",
"'type'",
",",
"'message_id'",
"=>",
"'id'",
",",
"'credits_cost'",
"=>",
"'credits'",
","... | When an attribute is set | [
"When",
"an",
"attribute",
"is",
"set"
] | 446987706f81d5a0efbc8bd6b7d3b259d0527719 | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Models/Notification.php#L56-L72 |
21,480 | nabab/bbn | src/bbn/api/virtualmin.php | virtualmin.delete_cache | public function delete_cache($command_name = '', $arguments= false){
$uid = $this->hostname;
if ( !empty($arguments) ){
$uid .= md5(json_encode($arguments));
}
if ( !empty($this->cache_delete($uid, $command_name)) ){
\bbn\x::log([$uid, $command_name], 'cache_delete');
return true;
... | php | public function delete_cache($command_name = '', $arguments= false){
$uid = $this->hostname;
if ( !empty($arguments) ){
$uid .= md5(json_encode($arguments));
}
if ( !empty($this->cache_delete($uid, $command_name)) ){
\bbn\x::log([$uid, $command_name], 'cache_delete');
return true;
... | [
"public",
"function",
"delete_cache",
"(",
"$",
"command_name",
"=",
"''",
",",
"$",
"arguments",
"=",
"false",
")",
"{",
"$",
"uid",
"=",
"$",
"this",
"->",
"hostname",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"arguments",
")",
")",
"{",
"$",
"uid"... | This function allows the cancellation of the cache of the used commands
@param $uid file cache
@param $method name
@return bool | [
"This",
"function",
"allows",
"the",
"cancellation",
"of",
"the",
"cache",
"of",
"the",
"used",
"commands"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/virtualmin.php#L186-L196 |
21,481 | nabab/bbn | src/bbn/api/virtualmin.php | virtualmin.get_header_url | private function get_header_url(){
return "wget -O - --quiet --http-user=" . $this->user . " --http-passwd=" . escapeshellarg($this->pass) . " --no-check-certificate 'https://" . $this->hostname . ":10000/".(
$this->mode === 'cloudmin' ? 'server-manager' : 'virtual-server'
)."/remote.cgi?json=1&multiline=... | php | private function get_header_url(){
return "wget -O - --quiet --http-user=" . $this->user . " --http-passwd=" . escapeshellarg($this->pass) . " --no-check-certificate 'https://" . $this->hostname . ":10000/".(
$this->mode === 'cloudmin' ? 'server-manager' : 'virtual-server'
)."/remote.cgi?json=1&multiline=... | [
"private",
"function",
"get_header_url",
"(",
")",
"{",
"return",
"\"wget -O - --quiet --http-user=\"",
".",
"$",
"this",
"->",
"user",
".",
"\" --http-passwd=\"",
".",
"escapeshellarg",
"(",
"$",
"this",
"->",
"pass",
")",
".",
"\" --no-check-certificate 'https://\""... | This function is used to get the header url part to be executed
@return string The the header url part to be executed | [
"This",
"function",
"is",
"used",
"to",
"get",
"the",
"header",
"url",
"part",
"to",
"be",
"executed"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/api/virtualmin.php#L260-L264 |
21,482 | glynnforrest/blockade | src/Blockade/Resolver/RedirectResolver.php | RedirectResolver.createUrl | protected function createUrl(BlockadeException $exception, Request $request)
{
//decide where to redirect. login_url for unauthenticated or
//bad credentials, deny_url for unauthorized or anything else
if ($exception instanceof AuthenticationException || $exception instanceof CredentialsExce... | php | protected function createUrl(BlockadeException $exception, Request $request)
{
//decide where to redirect. login_url for unauthenticated or
//bad credentials, deny_url for unauthorized or anything else
if ($exception instanceof AuthenticationException || $exception instanceof CredentialsExce... | [
"protected",
"function",
"createUrl",
"(",
"BlockadeException",
"$",
"exception",
",",
"Request",
"$",
"request",
")",
"{",
"//decide where to redirect. login_url for unauthenticated or",
"//bad credentials, deny_url for unauthorized or anything else",
"if",
"(",
"$",
"exception"... | Create the url to redirect to.
@param BlockadeException $exception The exception
@param Request $request The request that caused the exception | [
"Create",
"the",
"url",
"to",
"redirect",
"to",
"."
] | 5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b | https://github.com/glynnforrest/blockade/blob/5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b/src/Blockade/Resolver/RedirectResolver.php#L41-L50 |
21,483 | glynnforrest/blockade | src/Blockade/Resolver/RedirectResolver.php | RedirectResolver.createXmlHttpResponse | protected function createXmlHttpResponse(BlockadeException $exception, Request $request)
{
if ($exception instanceof AuthenticationException || $exception instanceof CredentialsException) {
return new Response('Authentication required', Response::HTTP_UNAUTHORIZED);
}
return new... | php | protected function createXmlHttpResponse(BlockadeException $exception, Request $request)
{
if ($exception instanceof AuthenticationException || $exception instanceof CredentialsException) {
return new Response('Authentication required', Response::HTTP_UNAUTHORIZED);
}
return new... | [
"protected",
"function",
"createXmlHttpResponse",
"(",
"BlockadeException",
"$",
"exception",
",",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"exception",
"instanceof",
"AuthenticationException",
"||",
"$",
"exception",
"instanceof",
"CredentialsException",
... | Create a response for XmlHttpRequests.
@param BlockadeException $exception The exception
@param Request $request The request that caused the exception | [
"Create",
"a",
"response",
"for",
"XmlHttpRequests",
"."
] | 5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b | https://github.com/glynnforrest/blockade/blob/5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b/src/Blockade/Resolver/RedirectResolver.php#L58-L65 |
21,484 | codeburnerframework/container | src/Container.php | Container.call | public function call($function, array $parameters = [])
{
$inspector = new ReflectionFunction($function);
$dependencies = $inspector->getParameters();
$dependencies = $this->process('', $parameters, $dependencies);
return call_user_func_array($function, $dependencies);
} | php | public function call($function, array $parameters = [])
{
$inspector = new ReflectionFunction($function);
$dependencies = $inspector->getParameters();
$dependencies = $this->process('', $parameters, $dependencies);
return call_user_func_array($function, $dependencies);
} | [
"public",
"function",
"call",
"(",
"$",
"function",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"$",
"inspector",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"function",
")",
";",
"$",
"dependencies",
"=",
"$",
"inspector",
"->",
"getParame... | Call a user function injecting the dependencies.
@param string|Closure $function The function or the user function name.
@param array $parameters The predefined dependencies.
@return mixed | [
"Call",
"a",
"user",
"function",
"injecting",
"the",
"dependencies",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L75-L83 |
21,485 | codeburnerframework/container | src/Container.php | Container.make | public function make(string $abstract, array $parameters = [])
{
try {
if (! isset($this->resolving[$abstract])) {
$this->resolving[$abstract] = $this->construct($abstract);
}
return $this->resolving[$abstract]($abstract, $parameters);
} catch (Re... | php | public function make(string $abstract, array $parameters = [])
{
try {
if (! isset($this->resolving[$abstract])) {
$this->resolving[$abstract] = $this->construct($abstract);
}
return $this->resolving[$abstract]($abstract, $parameters);
} catch (Re... | [
"public",
"function",
"make",
"(",
"string",
"$",
"abstract",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"resolving",
"[",
"$",
"abstract",
"]",
")",
")",
"{",
"$",
"this... | Makes an element or class injecting automatically all the dependencies.
@param string $abstract The class name or container element name to make.
@param array $parameters Specific parameters definition.
@throws ContainerException
@return object|null | [
"Makes",
"an",
"element",
"or",
"class",
"injecting",
"automatically",
"all",
"the",
"dependencies",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L95-L106 |
21,486 | codeburnerframework/container | src/Container.php | Container.construct | protected function construct(string $abstract) : Closure
{
$inspector = new ReflectionClass($abstract);
if (($constructor = $inspector->getConstructor()) && ($dependencies = $constructor->getParameters())) {
// if, and only if, a class has a constructor with parameters, we try to solve... | php | protected function construct(string $abstract) : Closure
{
$inspector = new ReflectionClass($abstract);
if (($constructor = $inspector->getConstructor()) && ($dependencies = $constructor->getParameters())) {
// if, and only if, a class has a constructor with parameters, we try to solve... | [
"protected",
"function",
"construct",
"(",
"string",
"$",
"abstract",
")",
":",
"Closure",
"{",
"$",
"inspector",
"=",
"new",
"ReflectionClass",
"(",
"$",
"abstract",
")",
";",
"if",
"(",
"(",
"$",
"constructor",
"=",
"$",
"inspector",
"->",
"getConstructo... | Construct a class and all the dependencies using the reflection library of PHP.
@param string $abstract The class name or container element name to make.
@throws ReflectionException
@return Closure | [
"Construct",
"a",
"class",
"and",
"all",
"the",
"dependencies",
"using",
"the",
"reflection",
"library",
"of",
"PHP",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L117-L137 |
21,487 | codeburnerframework/container | src/Container.php | Container.process | protected function process(string $abstract, array $parameters, array $dependencies) : array
{
foreach ($dependencies as &$dependency) {
if (isset($parameters[$dependency->name])) {
$dependency = $parameters[$dependency->name];
} else $dependency = $this->resolve($... | php | protected function process(string $abstract, array $parameters, array $dependencies) : array
{
foreach ($dependencies as &$dependency) {
if (isset($parameters[$dependency->name])) {
$dependency = $parameters[$dependency->name];
} else $dependency = $this->resolve($... | [
"protected",
"function",
"process",
"(",
"string",
"$",
"abstract",
",",
"array",
"$",
"parameters",
",",
"array",
"$",
"dependencies",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"dependencies",
"as",
"&",
"$",
"dependency",
")",
"{",
"if",
"(",
"isset... | Process all dependencies
@param string $abstract The class name or container element name to make
@param array $parameters User defined parameters that must be used instead of resolved ones
@param array $dependencies Array of ReflectionParameter
@throws ContainerException When a dependency cannot be solved.
@... | [
"Process",
"all",
"dependencies"
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L150-L159 |
21,488 | codeburnerframework/container | src/Container.php | Container.resolve | protected function resolve(string $abstract, ReflectionParameter $dependency)
{
$key = $abstract.$dependency->name;
if (! isset($this->resolved[$key])) {
$this->resolved[$key] = $this->generate($abstract, $dependency);
}
return $this->resolved[$key]($this);
} | php | protected function resolve(string $abstract, ReflectionParameter $dependency)
{
$key = $abstract.$dependency->name;
if (! isset($this->resolved[$key])) {
$this->resolved[$key] = $this->generate($abstract, $dependency);
}
return $this->resolved[$key]($this);
} | [
"protected",
"function",
"resolve",
"(",
"string",
"$",
"abstract",
",",
"ReflectionParameter",
"$",
"dependency",
")",
"{",
"$",
"key",
"=",
"$",
"abstract",
".",
"$",
"dependency",
"->",
"name",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"... | Resolve all the given class reflected dependencies.
@param string $abstract The class name or container element name to resolve dependencies.
@param ReflectionParameter $dependency The class dependency to be resolved.
@throws ContainerException When a dependency cannot be solved.
@return Object | [
"Resolve",
"all",
"the",
"given",
"class",
"reflected",
"dependencies",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L171-L180 |
21,489 | codeburnerframework/container | src/Container.php | Container.generate | protected function generate(string $abstract, ReflectionParameter $dependency) : Closure
{
if ($class = $dependency->getClass()) {
return $this->build($class->name, "{$abstract}{$class->name}");
}
try {
$value = $dependency->getDefaultValue();
return fun... | php | protected function generate(string $abstract, ReflectionParameter $dependency) : Closure
{
if ($class = $dependency->getClass()) {
return $this->build($class->name, "{$abstract}{$class->name}");
}
try {
$value = $dependency->getDefaultValue();
return fun... | [
"protected",
"function",
"generate",
"(",
"string",
"$",
"abstract",
",",
"ReflectionParameter",
"$",
"dependency",
")",
":",
"Closure",
"{",
"if",
"(",
"$",
"class",
"=",
"$",
"dependency",
"->",
"getClass",
"(",
")",
")",
"{",
"return",
"$",
"this",
"-... | Generate the dependencies callbacks to jump some conditions in every dependency creation.
@param string $abstract The class name or container element name to resolve dependencies.
@param ReflectionParameter $dependency The class dependency to be resolved.
@throws ContainerException When a dependency ... | [
"Generate",
"the",
"dependencies",
"callbacks",
"to",
"jump",
"some",
"conditions",
"in",
"every",
"dependency",
"creation",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L192-L207 |
21,490 | codeburnerframework/container | src/Container.php | Container.build | protected function build(string $classname, string $entry) : Closure
{
if (isset($this->dependencies[$entry])) {
return $this->dependencies[$entry];
}
return function () use ($classname) {
return $this->make($classname);
};
} | php | protected function build(string $classname, string $entry) : Closure
{
if (isset($this->dependencies[$entry])) {
return $this->dependencies[$entry];
}
return function () use ($classname) {
return $this->make($classname);
};
} | [
"protected",
"function",
"build",
"(",
"string",
"$",
"classname",
",",
"string",
"$",
"entry",
")",
":",
"Closure",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"dependencies",
"[",
"$",
"entry",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Create a build closure for a given class
@param string $classname The class that need to be build
@param string $entry Cache entry to search
@return Closure | [
"Create",
"a",
"build",
"closure",
"for",
"a",
"given",
"class"
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L218-L227 |
21,491 | codeburnerframework/container | src/Container.php | Container.flush | public function flush() : ContainerInterface
{
$this->collection = [];
$this->dependencies = [];
$this->resolving = [];
$this->resolved = [];
return $this;
} | php | public function flush() : ContainerInterface
{
$this->collection = [];
$this->dependencies = [];
$this->resolving = [];
$this->resolved = [];
return $this;
} | [
"public",
"function",
"flush",
"(",
")",
":",
"ContainerInterface",
"{",
"$",
"this",
"->",
"collection",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"dependencies",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"resolving",
"=",
"[",
"]",
";",
"$",
"this",
"-... | Reset the container, removing all the elements, cache and options.
@return ContainerInterface | [
"Reset",
"the",
"container",
"removing",
"all",
"the",
"elements",
"cache",
"and",
"options",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L235-L243 |
21,492 | codeburnerframework/container | src/Container.php | Container.isSingleton | public function isSingleton(string $abstract) : bool
{
if (! $this->has($abstract)) {
throw new NotFoundException("Element '$abstract' not found");
}
return $this->collection[$abstract] instanceof Closure === false;
} | php | public function isSingleton(string $abstract) : bool
{
if (! $this->has($abstract)) {
throw new NotFoundException("Element '$abstract' not found");
}
return $this->collection[$abstract] instanceof Closure === false;
} | [
"public",
"function",
"isSingleton",
"(",
"string",
"$",
"abstract",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"abstract",
")",
")",
"{",
"throw",
"new",
"NotFoundException",
"(",
"\"Element '$abstract' not found\"",
")",
"... | Verify if an element has a singleton instance.
@param string The class name or container element name to resolve dependencies.
@throws NotFoundException When $abstract does not exists
@return bool | [
"Verify",
"if",
"an",
"element",
"has",
"a",
"singleton",
"instance",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L298-L305 |
21,493 | codeburnerframework/container | src/Container.php | Container.set | public function set(string $abstract, $concrete, bool $shared = false) : ContainerInterface
{
if (is_object($concrete)) {
return $this->instance($abstract, $concrete);
}
if ($concrete instanceof Closure === false) {
$concrete = function (Container $container) use ($c... | php | public function set(string $abstract, $concrete, bool $shared = false) : ContainerInterface
{
if (is_object($concrete)) {
return $this->instance($abstract, $concrete);
}
if ($concrete instanceof Closure === false) {
$concrete = function (Container $container) use ($c... | [
"public",
"function",
"set",
"(",
"string",
"$",
"abstract",
",",
"$",
"concrete",
",",
"bool",
"$",
"shared",
"=",
"false",
")",
":",
"ContainerInterface",
"{",
"if",
"(",
"is_object",
"(",
"$",
"concrete",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Bind a new element to the container.
@param string $abstract The alias name that will be used to call the element.
@param string|closure|object $concrete The element class name, or an closure that makes the element, or the object itself.
@param bool $shared Define if the element will ... | [
"Bind",
"a",
"new",
"element",
"to",
"the",
"container",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L335-L352 |
21,494 | codeburnerframework/container | src/Container.php | Container.setIf | public function setIf(string $abstract, $concrete, bool $shared = false) : ContainerInterface
{
if (! $this->has($abstract)) {
$this->set($abstract, $concrete, $shared);
}
return $this;
} | php | public function setIf(string $abstract, $concrete, bool $shared = false) : ContainerInterface
{
if (! $this->has($abstract)) {
$this->set($abstract, $concrete, $shared);
}
return $this;
} | [
"public",
"function",
"setIf",
"(",
"string",
"$",
"abstract",
",",
"$",
"concrete",
",",
"bool",
"$",
"shared",
"=",
"false",
")",
":",
"ContainerInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"abstract",
")",
")",
"{",
"$",
... | Bind a new element to the container IF the element name not exists in the container.
@param string $abstract The alias name that will be used to call the element.
@param string|closure $concrete The element class name, or an closure that makes the element.
@param bool $shared Define if the element ... | [
"Bind",
"a",
"new",
"element",
"to",
"the",
"container",
"IF",
"the",
"element",
"name",
"not",
"exists",
"in",
"the",
"container",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L364-L371 |
21,495 | codeburnerframework/container | src/Container.php | Container.setTo | public function setTo(string $class, string $dependencyName, $dependency) : ContainerInterface
{
$key = "$class$dependencyName";
if ($dependency instanceof Closure === false) {
// let's use temporarily the set method to resolve
// the $dependency if it is not a closure read... | php | public function setTo(string $class, string $dependencyName, $dependency) : ContainerInterface
{
$key = "$class$dependencyName";
if ($dependency instanceof Closure === false) {
// let's use temporarily the set method to resolve
// the $dependency if it is not a closure read... | [
"public",
"function",
"setTo",
"(",
"string",
"$",
"class",
",",
"string",
"$",
"dependencyName",
",",
"$",
"dependency",
")",
":",
"ContainerInterface",
"{",
"$",
"key",
"=",
"\"$class$dependencyName\"",
";",
"if",
"(",
"$",
"dependency",
"instanceof",
"Closu... | Bind an specific instance to a class dependency.
@param string $class The class full name.
@param string $dependencyName The dependency full name.
@param string|closure $dependency The specific object class name or a classure that makes the element.
@return ContainerInterface | [
"Bind",
"an",
"specific",
"instance",
"to",
"a",
"class",
"dependency",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L383-L411 |
21,496 | codeburnerframework/container | src/Container.php | Container.instance | public function instance(string $abstract, $instance) : ContainerInterface
{
if (! is_object($instance)) {
throw new ContainerException('Trying to store ' . gettype($instance) . ' as object.');
}
$this->collection[$abstract] = $instance;
return $this;
} | php | public function instance(string $abstract, $instance) : ContainerInterface
{
if (! is_object($instance)) {
throw new ContainerException('Trying to store ' . gettype($instance) . ' as object.');
}
$this->collection[$abstract] = $instance;
return $this;
} | [
"public",
"function",
"instance",
"(",
"string",
"$",
"abstract",
",",
"$",
"instance",
")",
":",
"ContainerInterface",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"instance",
")",
")",
"{",
"throw",
"new",
"ContainerException",
"(",
"'Trying to store '",
".... | Bind an object to the container.
@param string $abstract The alias name that will be used to call the object.
@param object $instance The object that will be inserted.
@throws ContainerException When $instance is not an object.
@return ContainerInterface | [
"Bind",
"an",
"object",
"to",
"the",
"container",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L440-L449 |
21,497 | codeburnerframework/container | src/Container.php | Container.extend | public function extend(string $abstract, closure $extension) : ContainerInterface
{
$object = $this->get($abstract);
$this->collection[$abstract] = $extension($object, $this);
return $this;
} | php | public function extend(string $abstract, closure $extension) : ContainerInterface
{
$object = $this->get($abstract);
$this->collection[$abstract] = $extension($object, $this);
return $this;
} | [
"public",
"function",
"extend",
"(",
"string",
"$",
"abstract",
",",
"closure",
"$",
"extension",
")",
":",
"ContainerInterface",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"abstract",
")",
";",
"$",
"this",
"->",
"collection",
"[",
"... | Modify an element with a given function that receive the old element as argument.
@param string $abstract The alias name that will be used to call the element.
@param closure $extension The function that receives the old element and return a new or modified one.
@throws NotFoundException When no element was found ... | [
"Modify",
"an",
"element",
"with",
"a",
"given",
"function",
"that",
"receive",
"the",
"old",
"element",
"as",
"argument",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L461-L468 |
21,498 | codeburnerframework/container | src/Container.php | Container.share | public function share(string $abstract) : ContainerInterface
{
$object = $this->get($abstract);
$this->collection[$abstract] = $object;
return $this;
} | php | public function share(string $abstract) : ContainerInterface
{
$object = $this->get($abstract);
$this->collection[$abstract] = $object;
return $this;
} | [
"public",
"function",
"share",
"(",
"string",
"$",
"abstract",
")",
":",
"ContainerInterface",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"abstract",
")",
";",
"$",
"this",
"->",
"collection",
"[",
"$",
"abstract",
"]",
"=",
"$",
"o... | Makes an resolvable element an singleton.
@param string $abstract The alias name that will be used to call the element.
@throws NotFoundException When no element was found with $abstract key.
@throws ContainerException When the element on $abstract key is not resolvable.
@return ContainerInterface | [
"Makes",
"an",
"resolvable",
"element",
"an",
"singleton",
"."
] | aab42fdf1fa5d2043696dcc9d886cef4532b31b5 | https://github.com/codeburnerframework/container/blob/aab42fdf1fa5d2043696dcc9d886cef4532b31b5/src/Container.php#L481-L488 |
21,499 | nabab/bbn | src/bbn/util/timer.php | timer.start | public function start($key='default')
{
if ( !isset($this->measures[$key]) ){
$this->measures[$key] = [
'num' => 0,
'sum' => 0,
'start' => microtime(1)
];
}
else{
$this->measures[$key]['start'] = microtime(1);
}
} | php | public function start($key='default')
{
if ( !isset($this->measures[$key]) ){
$this->measures[$key] = [
'num' => 0,
'sum' => 0,
'start' => microtime(1)
];
}
else{
$this->measures[$key]['start'] = microtime(1);
}
} | [
"public",
"function",
"start",
"(",
"$",
"key",
"=",
"'default'",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"measures",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"measures",
"[",
"$",
"key",
"]",
"=",
"[",
"'num'"... | Starts a timer for a given key
@return void | [
"Starts",
"a",
"timer",
"for",
"a",
"given",
"key"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/util/timer.php#L34-L46 |
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.