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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,700 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/rfc822_digest_parser.php | ezcMailRfc822DigestParser.parseBody | public function parseBody( $line )
{
$this->mailParser->parseBody( $line );
$this->size += strlen( $line );
} | php | public function parseBody( $line )
{
$this->mailParser->parseBody( $line );
$this->size += strlen( $line );
} | [
"public",
"function",
"parseBody",
"(",
"$",
"line",
")",
"{",
"$",
"this",
"->",
"mailParser",
"->",
"parseBody",
"(",
"$",
"line",
")",
";",
"$",
"this",
"->",
"size",
"+=",
"strlen",
"(",
"$",
"line",
")",
";",
"}"
] | Parses each line of the digest body.
Every line is part of the digested mail. It is sent directly to the mail parser.
@param string $line | [
"Parses",
"each",
"line",
"of",
"the",
"digest",
"body",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/rfc822_digest_parser.php#L63-L67 |
20,701 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/rfc822_digest_parser.php | ezcMailRfc822DigestParser.finish | public function finish()
{
$digest = new ezcMailRfc822Digest( $this->mailParser->finish() );
ezcMailPartParser::parsePartHeaders( $this->headers, $digest );
$digest->size = $this->size;
return $digest;
} | php | public function finish()
{
$digest = new ezcMailRfc822Digest( $this->mailParser->finish() );
ezcMailPartParser::parsePartHeaders( $this->headers, $digest );
$digest->size = $this->size;
return $digest;
} | [
"public",
"function",
"finish",
"(",
")",
"{",
"$",
"digest",
"=",
"new",
"ezcMailRfc822Digest",
"(",
"$",
"this",
"->",
"mailParser",
"->",
"finish",
"(",
")",
")",
";",
"ezcMailPartParser",
"::",
"parsePartHeaders",
"(",
"$",
"this",
"->",
"headers",
","... | Returns a ezcMailRfc822Digest with the digested mail in it.
@return ezcMailRfc822Digest | [
"Returns",
"a",
"ezcMailRfc822Digest",
"with",
"the",
"digested",
"mail",
"in",
"it",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/rfc822_digest_parser.php#L74-L80 |
20,702 | zhouyl/mellivora | Mellivora/Database/Schema/Grammars/PostgresGrammar.php | PostgresGrammar.typeEnum | protected function typeEnum(Fluent $column)
{
$allowed = array_map(function ($a) {
return "'{$a}'";
}, $column->allowed);
return "varchar(255) check (\"{$column->name}\" in (" . implode(', ', $allowed) . '))';
} | php | protected function typeEnum(Fluent $column)
{
$allowed = array_map(function ($a) {
return "'{$a}'";
}, $column->allowed);
return "varchar(255) check (\"{$column->name}\" in (" . implode(', ', $allowed) . '))';
} | [
"protected",
"function",
"typeEnum",
"(",
"Fluent",
"$",
"column",
")",
"{",
"$",
"allowed",
"=",
"array_map",
"(",
"function",
"(",
"$",
"a",
")",
"{",
"return",
"\"'{$a}'\"",
";",
"}",
",",
"$",
"column",
"->",
"allowed",
")",
";",
"return",
"\"varch... | Create the column definition for an enum type.
@param \Mellivora\Support\Fluent $column
@return string | [
"Create",
"the",
"column",
"definition",
"for",
"an",
"enum",
"type",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Schema/Grammars/PostgresGrammar.php#L449-L456 |
20,703 | surebert/surebert-framework | src/sb/SSH2/Client.php | Client.tunnel | public function tunnel($host, $port)
{
$stream = @ssh2_tunnel($this->connection, $command);
if(!$stream){
throw new \Exception('Cannot create tunnel to: '.$host.' on port'.$port);
}
return $stream;
} | php | public function tunnel($host, $port)
{
$stream = @ssh2_tunnel($this->connection, $command);
if(!$stream){
throw new \Exception('Cannot create tunnel to: '.$host.' on port'.$port);
}
return $stream;
} | [
"public",
"function",
"tunnel",
"(",
"$",
"host",
",",
"$",
"port",
")",
"{",
"$",
"stream",
"=",
"@",
"ssh2_tunnel",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"command",
")",
";",
"if",
"(",
"!",
"$",
"stream",
")",
"{",
"throw",
"new",
"\... | Tunnels a connection
@param string $host The host to tunnel to via the ssh2 client
@param integer $port The port to tunnel to via the ssh2 client
@return stream The tunnel stream | [
"Tunnels",
"a",
"connection"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SSH2/Client.php#L109-L117 |
20,704 | colorium/web | src/Colorium/Web/Rest.php | Rest.merge | public function merge(array $logics)
{
foreach($logics as $name => $specs) {
$this->set($name, $specs);
}
return $this;
} | php | public function merge(array $logics)
{
foreach($logics as $name => $specs) {
$this->set($name, $specs);
}
return $this;
} | [
"public",
"function",
"merge",
"(",
"array",
"$",
"logics",
")",
"{",
"foreach",
"(",
"$",
"logics",
"as",
"$",
"name",
"=>",
"$",
"specs",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"name",
",",
"$",
"specs",
")",
";",
"}",
"return",
"$",
"... | Merge multiple logics
@param array $logics
@return $this | [
"Merge",
"multiple",
"logics"
] | 2a767658b8737022939b0cc4505b5f652c1683d2 | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Rest.php#L67-L74 |
20,705 | colorium/web | src/Colorium/Web/Rest.php | Rest.before | protected function before(Context $context)
{
// set context forwarder
$context->forwarder = $context->forwarder ?: [$this, 'forward'];
return parent::before($context);
} | php | protected function before(Context $context)
{
// set context forwarder
$context->forwarder = $context->forwarder ?: [$this, 'forward'];
return parent::before($context);
} | [
"protected",
"function",
"before",
"(",
"Context",
"$",
"context",
")",
"{",
"// set context forwarder",
"$",
"context",
"->",
"forwarder",
"=",
"$",
"context",
"->",
"forwarder",
"?",
":",
"[",
"$",
"this",
",",
"'forward'",
"]",
";",
"return",
"parent",
... | Setup context before process
@param Context $context
@return Context | [
"Setup",
"context",
"before",
"process"
] | 2a767658b8737022939b0cc4505b5f652c1683d2 | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Rest.php#L98-L104 |
20,706 | colorium/web | src/Colorium/Web/Rest.php | Rest.route | protected function route(Context $context)
{
$this->logger->debug('kernel.route: find route from http query');
// logic already specified
if($context->logic) {
$this->logger->debug('kernel.route: forward to #' . $context->logic->name . ', skip routing');
return $cont... | php | protected function route(Context $context)
{
$this->logger->debug('kernel.route: find route from http query');
// logic already specified
if($context->logic) {
$this->logger->debug('kernel.route: forward to #' . $context->logic->name . ', skip routing');
return $cont... | [
"protected",
"function",
"route",
"(",
"Context",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"'kernel.route: find route from http query'",
")",
";",
"// logic already specified",
"if",
"(",
"$",
"context",
"->",
"logic",
")",
"{",... | Find route from context
@param Context $context
@return Context
@throws NotFoundException | [
"Find",
"route",
"from",
"context"
] | 2a767658b8737022939b0cc4505b5f652c1683d2 | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Rest.php#L165-L192 |
20,707 | dstuecken/notify | src/Handler/HeaderHandler.php | HeaderHandler.formatAttributes | public static function formatAttributes($destroy_callback = null, $create_callback = null, $sticky = null, $life = null, $classname = null, $width = null)
{
$options = [];
if ($destroy_callback !== null)
{
$options['destroyed'] = $destroy_callback;
} // if
if ($... | php | public static function formatAttributes($destroy_callback = null, $create_callback = null, $sticky = null, $life = null, $classname = null, $width = null)
{
$options = [];
if ($destroy_callback !== null)
{
$options['destroyed'] = $destroy_callback;
} // if
if ($... | [
"public",
"static",
"function",
"formatAttributes",
"(",
"$",
"destroy_callback",
"=",
"null",
",",
"$",
"create_callback",
"=",
"null",
",",
"$",
"sticky",
"=",
"null",
",",
"$",
"life",
"=",
"null",
",",
"$",
"classname",
"=",
"null",
",",
"$",
"width"... | Static method for retrieving the options-array.
@param string $destroy_callback
@param string $create_callback
@param boolean $sticky
@param integer $life
@param string $classname
@param integer $width
@return array | [
"Static",
"method",
"for",
"retrieving",
"the",
"options",
"-",
"array",
"."
] | abccf0a6a272caf66baea74323f18e2212c6e11e | https://github.com/dstuecken/notify/blob/abccf0a6a272caf66baea74323f18e2212c6e11e/src/Handler/HeaderHandler.php#L149-L184 |
20,708 | welderlourenco/laravel-facebook | src/WelderLourenco/Facebook/Facebook.php | Facebook.getFacebookSession | private function getFacebookSession($accessToken)
{
$facebookSession = new FacebookSession($accessToken);
try
{
$facebookSession->validate();
return $facebookSession;
}
catch (FacebookRequestException $ex)
{
throw new FacebookException($ex->getMessage());
}
catch (\Exception $ex)
{
... | php | private function getFacebookSession($accessToken)
{
$facebookSession = new FacebookSession($accessToken);
try
{
$facebookSession->validate();
return $facebookSession;
}
catch (FacebookRequestException $ex)
{
throw new FacebookException($ex->getMessage());
}
catch (\Exception $ex)
{
... | [
"private",
"function",
"getFacebookSession",
"(",
"$",
"accessToken",
")",
"{",
"$",
"facebookSession",
"=",
"new",
"FacebookSession",
"(",
"$",
"accessToken",
")",
";",
"try",
"{",
"$",
"facebookSession",
"->",
"validate",
"(",
")",
";",
"return",
"$",
"fac... | Get the FacebookSession through an access_token.
@param string $accessToken
@return FacebookSession | [
"Get",
"the",
"FacebookSession",
"through",
"an",
"access_token",
"."
] | e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd | https://github.com/welderlourenco/laravel-facebook/blob/e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd/src/WelderLourenco/Facebook/Facebook.php#L74-L92 |
20,709 | welderlourenco/laravel-facebook | src/WelderLourenco/Facebook/Facebook.php | Facebook.connect | public function connect($accessToken = null)
{
if (is_null($accessToken))
{
return $this->getRedirectLoginHelper();
}
else
{
return $this->getFacebookSession($accessToken);
}
} | php | public function connect($accessToken = null)
{
if (is_null($accessToken))
{
return $this->getRedirectLoginHelper();
}
else
{
return $this->getFacebookSession($accessToken);
}
} | [
"public",
"function",
"connect",
"(",
"$",
"accessToken",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"accessToken",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getRedirectLoginHelper",
"(",
")",
";",
"}",
"else",
"{",
"return",
"$",
"this"... | Trigger method that can get either a facebook session with access token or a redirect login helper.
@param string $accessToken The facebook access token.
@return mixed | [
"Trigger",
"method",
"that",
"can",
"get",
"either",
"a",
"facebook",
"session",
"with",
"access",
"token",
"or",
"a",
"redirect",
"login",
"helper",
"."
] | e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd | https://github.com/welderlourenco/laravel-facebook/blob/e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd/src/WelderLourenco/Facebook/Facebook.php#L100-L110 |
20,710 | welderlourenco/laravel-facebook | src/WelderLourenco/Facebook/Facebook.php | Facebook.process | public function process()
{
try
{
$redirectLoginHelper = $this->getRedirectLoginHelper();
return $this->connect($redirectLoginHelper->getSessionFromRedirect()->getToken());
}
catch(FacebookRequestException $ex)
{
throw new FacebookException($ex->getMessage());
}
catch(\Exception $ex)
{
... | php | public function process()
{
try
{
$redirectLoginHelper = $this->getRedirectLoginHelper();
return $this->connect($redirectLoginHelper->getSessionFromRedirect()->getToken());
}
catch(FacebookRequestException $ex)
{
throw new FacebookException($ex->getMessage());
}
catch(\Exception $ex)
{
... | [
"public",
"function",
"process",
"(",
")",
"{",
"try",
"{",
"$",
"redirectLoginHelper",
"=",
"$",
"this",
"->",
"getRedirectLoginHelper",
"(",
")",
";",
"return",
"$",
"this",
"->",
"connect",
"(",
"$",
"redirectLoginHelper",
"->",
"getSessionFromRedirect",
"(... | Get the redirect postback sent from facebook processed, ready to a facebook session.
@return connect($accessToken) | [
"Get",
"the",
"redirect",
"postback",
"sent",
"from",
"facebook",
"processed",
"ready",
"to",
"a",
"facebook",
"session",
"."
] | e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd | https://github.com/welderlourenco/laravel-facebook/blob/e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd/src/WelderLourenco/Facebook/Facebook.php#L117-L133 |
20,711 | welderlourenco/laravel-facebook | src/WelderLourenco/Facebook/Facebook.php | Facebook.api | public function api(FacebookSession $fbsession, $method, $call)
{
try
{
$facebookResponse = (new FacebookRequest($fbsession, $method, $call))->execute();
return $graphObject = $facebookResponse->getGraphObject();
}
catch (FacebookRequestException $ex)
{
throw new FacebookException($ex->getMess... | php | public function api(FacebookSession $fbsession, $method, $call)
{
try
{
$facebookResponse = (new FacebookRequest($fbsession, $method, $call))->execute();
return $graphObject = $facebookResponse->getGraphObject();
}
catch (FacebookRequestException $ex)
{
throw new FacebookException($ex->getMess... | [
"public",
"function",
"api",
"(",
"FacebookSession",
"$",
"fbsession",
",",
"$",
"method",
",",
"$",
"call",
")",
"{",
"try",
"{",
"$",
"facebookResponse",
"=",
"(",
"new",
"FacebookRequest",
"(",
"$",
"fbsession",
",",
"$",
"method",
",",
"$",
"call",
... | Make a request into facebook api.
@param FacebookSession $fbsession
@param string $method
@param string $call
@return FacebookRequest | [
"Make",
"a",
"request",
"into",
"facebook",
"api",
"."
] | e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd | https://github.com/welderlourenco/laravel-facebook/blob/e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd/src/WelderLourenco/Facebook/Facebook.php#L143-L159 |
20,712 | welderlourenco/laravel-facebook | src/WelderLourenco/Facebook/Facebook.php | Facebook.change | public function change($appId, $appSecret, $redirectUrl = null)
{
\Config::set('facebook::app.appId', $appId);
\Config::set('facebook::app.appSecret', $appSecret);
if (!is_null($redirectUrl))
\Config::set('facebook::app.redirectUrl', $redirectUrl);
return $this;
} | php | public function change($appId, $appSecret, $redirectUrl = null)
{
\Config::set('facebook::app.appId', $appId);
\Config::set('facebook::app.appSecret', $appSecret);
if (!is_null($redirectUrl))
\Config::set('facebook::app.redirectUrl', $redirectUrl);
return $this;
} | [
"public",
"function",
"change",
"(",
"$",
"appId",
",",
"$",
"appSecret",
",",
"$",
"redirectUrl",
"=",
"null",
")",
"{",
"\\",
"Config",
"::",
"set",
"(",
"'facebook::app.appId'",
",",
"$",
"appId",
")",
";",
"\\",
"Config",
"::",
"set",
"(",
"'facebo... | Change the appId, appSecret and redirectUrl before connecting.
@param string $appId
@param string $appSecret
@param string $redireectUrl
@return this | [
"Change",
"the",
"appId",
"appSecret",
"and",
"redirectUrl",
"before",
"connecting",
"."
] | e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd | https://github.com/welderlourenco/laravel-facebook/blob/e0c80ab5ff1c95b634da8c15a5fd3c00ded232dd/src/WelderLourenco/Facebook/Facebook.php#L169-L176 |
20,713 | gyselroth/micro-container | src/Container.php | Container.has | public function has($name): bool
{
try {
$this->container->get($name);
return true;
} catch (\Exception $e) {
return false;
}
} | php | public function has($name): bool
{
try {
$this->container->get($name);
return true;
} catch (\Exception $e) {
return false;
}
} | [
"public",
"function",
"has",
"(",
"$",
"name",
")",
":",
"bool",
"{",
"try",
"{",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"$",
"name",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"return",
... | Check if service is registered. | [
"Check",
"if",
"service",
"is",
"registered",
"."
] | 728cf35af9645648392c50752b4b555d491bac4e | https://github.com/gyselroth/micro-container/blob/728cf35af9645648392c50752b4b555d491bac4e/src/Container.php#L52-L61 |
20,714 | GrupaZero/api | src/Gzero/Api/Transformer/BlockTranslationTransformer.php | BlockTranslationTransformer.transform | public function transform($translation)
{
$translation = $this->entityToArray(BlockTranslation::class, $translation);
return [
'id' => (int) $translation['id'],
'langCode' => $translation['lang_code'],
'title' => $translation['title'],
... | php | public function transform($translation)
{
$translation = $this->entityToArray(BlockTranslation::class, $translation);
return [
'id' => (int) $translation['id'],
'langCode' => $translation['lang_code'],
'title' => $translation['title'],
... | [
"public",
"function",
"transform",
"(",
"$",
"translation",
")",
"{",
"$",
"translation",
"=",
"$",
"this",
"->",
"entityToArray",
"(",
"BlockTranslation",
"::",
"class",
",",
"$",
"translation",
")",
";",
"return",
"[",
"'id'",
"=>",
"(",
"int",
")",
"$... | Transforms block translation entity
@param BlockTranslation|array $translation BlockTranslation entity
@return array | [
"Transforms",
"block",
"translation",
"entity"
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/BlockTranslationTransformer.php#L26-L39 |
20,715 | SporkCode/Spork | src/DateTime/DateInterval.php | DateInterval.toSeconds | public function toSeconds()
{
$seconds = $this->s;
$seconds += $this->i * 60;
$seconds += $this->h * 3600;
if ($this->days) {
$seconds += $this->days * 86400;
} else {
if ($this->d) {
$seconds += $this->d * 86400;
}... | php | public function toSeconds()
{
$seconds = $this->s;
$seconds += $this->i * 60;
$seconds += $this->h * 3600;
if ($this->days) {
$seconds += $this->days * 86400;
} else {
if ($this->d) {
$seconds += $this->d * 86400;
}... | [
"public",
"function",
"toSeconds",
"(",
")",
"{",
"$",
"seconds",
"=",
"$",
"this",
"->",
"s",
";",
"$",
"seconds",
"+=",
"$",
"this",
"->",
"i",
"*",
"60",
";",
"$",
"seconds",
"+=",
"$",
"this",
"->",
"h",
"*",
"3600",
";",
"if",
"(",
"$",
... | Convert interval to number of seconds
@return integer | [
"Convert",
"interval",
"to",
"number",
"of",
"seconds"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/DateTime/DateInterval.php#L47-L69 |
20,716 | SporkCode/Spork | src/DateTime/DateInterval.php | DateInterval.isQuirkMode | protected static function isQuirkMode()
{
if (null === self::$quirkMode) {
self::$quirkMode = version_compare(PHP_VERSION, '5.5.4', '<')
&& version_compare(PHP_VERSION, '5.5.0', '>')
|| version_compare(PHP_VERSION, '5.4.20', '<');
}
retur... | php | protected static function isQuirkMode()
{
if (null === self::$quirkMode) {
self::$quirkMode = version_compare(PHP_VERSION, '5.5.4', '<')
&& version_compare(PHP_VERSION, '5.5.0', '>')
|| version_compare(PHP_VERSION, '5.4.20', '<');
}
retur... | [
"protected",
"static",
"function",
"isQuirkMode",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"quirkMode",
")",
"{",
"self",
"::",
"$",
"quirkMode",
"=",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.5.4'",
",",
"'<'",
")",
"&&",
"versi... | Test if PHP version has quirks
@return boolean | [
"Test",
"if",
"PHP",
"version",
"has",
"quirks"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/DateTime/DateInterval.php#L75-L83 |
20,717 | zicht/z | src/Zicht/Tool/Packager/Node/DynamicStub.php | DynamicStub.compileInitialization | protected function compileInitialization(Buffer $buffer)
{
$buffer->write('$app = new Zicht\Tool\Application(')
->asPhp($this->appName)
->raw(', Zicht\Version\Version::fromString(')
->asPhp($this->appVersion)
->raw(') ?: new Zicht\Version\Version(), Zicht\Tool... | php | protected function compileInitialization(Buffer $buffer)
{
$buffer->write('$app = new Zicht\Tool\Application(')
->asPhp($this->appName)
->raw(', Zicht\Version\Version::fromString(')
->asPhp($this->appVersion)
->raw(') ?: new Zicht\Version\Version(), Zicht\Tool... | [
"protected",
"function",
"compileInitialization",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"$",
"buffer",
"->",
"write",
"(",
"'$app = new Zicht\\Tool\\Application('",
")",
"->",
"asPhp",
"(",
"$",
"this",
"->",
"appName",
")",
"->",
"raw",
"(",
"', Zicht\\Versio... | Writes the initialization code for a dynamic build
@param \Zicht\Tool\Script\Buffer $buffer
@return void | [
"Writes",
"the",
"initialization",
"code",
"for",
"a",
"dynamic",
"build"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Packager/Node/DynamicStub.php#L38-L47 |
20,718 | nabab/bbn | src/bbn/html/builder.php | builder.reset | public function reset()
{
$this->_current_cfg = [];
$this->_cfg = [];
$this->_root_element = false;
$this->_current_element = false;
foreach ( $this->_defaults as $k => $v ){
$this->_current_cfg[$k] = $v;
}
return $this;
} | php | public function reset()
{
$this->_current_cfg = [];
$this->_cfg = [];
$this->_root_element = false;
$this->_current_element = false;
foreach ( $this->_defaults as $k => $v ){
$this->_current_cfg[$k] = $v;
}
return $this;
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"_current_cfg",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"_cfg",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"_root_element",
"=",
"false",
";",
"$",
"this",
"->",
"_current_element",
"=",
"... | Sets the configuration back to its default value | [
"Sets",
"the",
"configuration",
"back",
"to",
"its",
"default",
"value"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/builder.php#L133-L143 |
20,719 | nabab/bbn | src/bbn/html/builder.php | builder.export_config | public function export_config()
{
if ( isset($this->_root_element) ){
return bbn\str::make_readable($this->_root_element->get_config());
}
return bbn\str::make_readable($this->_cfg);
} | php | public function export_config()
{
if ( isset($this->_root_element) ){
return bbn\str::make_readable($this->_root_element->get_config());
}
return bbn\str::make_readable($this->_cfg);
} | [
"public",
"function",
"export_config",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_root_element",
")",
")",
"{",
"return",
"bbn",
"\\",
"str",
"::",
"make_readable",
"(",
"$",
"this",
"->",
"_root_element",
"->",
"get_config",
"(",
")",
... | Returns the current configuration
@return array | [
"Returns",
"the",
"current",
"configuration"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/builder.php#L162-L168 |
20,720 | nabab/bbn | src/bbn/html/builder.php | builder.option | public function option($opt)
{
$args = \func_get_args();
if ( \is_array($opt) && isset($opt[0], $this->_defaults[$opt[0]]) ){
$this->_current_cfg[$opt[0]] = $opt[1];
}
else if ( isset($args[0], $args[1], $this->_defaults[$args[0]]) ){
$this->_current_cfg[$args[0]] = $args[1];
}
else{
throw new Inv... | php | public function option($opt)
{
$args = \func_get_args();
if ( \is_array($opt) && isset($opt[0], $this->_defaults[$opt[0]]) ){
$this->_current_cfg[$opt[0]] = $opt[1];
}
else if ( isset($args[0], $args[1], $this->_defaults[$args[0]]) ){
$this->_current_cfg[$args[0]] = $args[1];
}
else{
throw new Inv... | [
"public",
"function",
"option",
"(",
"$",
"opt",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"opt",
")",
"&&",
"isset",
"(",
"$",
"opt",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"_defau... | Change an option in the current configuration - Chainable
@param array|string $opt Either an array with the param name and value, or 2 strings in the same order
@return bbn\html\builder | [
"Change",
"an",
"option",
"in",
"the",
"current",
"configuration",
"-",
"Chainable"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/html/builder.php#L207-L220 |
20,721 | mayconpaivac/l5-validation | src/Prettus/Validator/AbstractValidator.php | AbstractValidator.passesOrFail | public function passesOrFail($action = null)
{
if( !$this->passes($action) ){
throw new ValidatorException( $this->errorsBag() );
}
return true;
} | php | public function passesOrFail($action = null)
{
if( !$this->passes($action) ){
throw new ValidatorException( $this->errorsBag() );
}
return true;
} | [
"public",
"function",
"passesOrFail",
"(",
"$",
"action",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"passes",
"(",
"$",
"action",
")",
")",
"{",
"throw",
"new",
"ValidatorException",
"(",
"$",
"this",
"->",
"errorsBag",
"(",
")",
")",... | Pass the data and the rules to the validator or throws ValidatorException
@throws ValidatorException
@param string $action
@return boolean | [
"Pass",
"the",
"data",
"and",
"the",
"rules",
"to",
"the",
"validator",
"or",
"throws",
"ValidatorException"
] | 0921391d7d9cf2853dd5667fb47c1450a251a0d8 | https://github.com/mayconpaivac/l5-validation/blob/0921391d7d9cf2853dd5667fb47c1450a251a0d8/src/Prettus/Validator/AbstractValidator.php#L110-L117 |
20,722 | mayconpaivac/l5-validation | src/Prettus/Validator/AbstractValidator.php | AbstractValidator.parserValidationRules | protected function parserValidationRules($rules, $id = null)
{
if($id === null)
{
return $rules;
}
array_walk($rules, function(&$rules, $field) use ($id)
{
if(!is_array($rules))
{
$rules = explode("|", $rules);
... | php | protected function parserValidationRules($rules, $id = null)
{
if($id === null)
{
return $rules;
}
array_walk($rules, function(&$rules, $field) use ($id)
{
if(!is_array($rules))
{
$rules = explode("|", $rules);
... | [
"protected",
"function",
"parserValidationRules",
"(",
"$",
"rules",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"return",
"$",
"rules",
";",
"}",
"array_walk",
"(",
"$",
"rules",
",",
"function",
"(",
"&",
... | Parser Validation Rules
@param $rules
@param null $id
@return array | [
"Parser",
"Validation",
"Rules"
] | 0921391d7d9cf2853dd5667fb47c1450a251a0d8 | https://github.com/mayconpaivac/l5-validation/blob/0921391d7d9cf2853dd5667fb47c1450a251a0d8/src/Prettus/Validator/AbstractValidator.php#L174-L215 |
20,723 | jasny/codeception-module | src/ResponseConvertor.php | ResponseConvertor.convert | public function convert(ResponseInterface $psrResponse)
{
return new BrowserKitResponse(
(string)$psrResponse->getBody(),
$psrResponse->getStatusCode() ?: 200,
$this->flattenHeaders($psrResponse->getHeaders())
);
} | php | public function convert(ResponseInterface $psrResponse)
{
return new BrowserKitResponse(
(string)$psrResponse->getBody(),
$psrResponse->getStatusCode() ?: 200,
$this->flattenHeaders($psrResponse->getHeaders())
);
} | [
"public",
"function",
"convert",
"(",
"ResponseInterface",
"$",
"psrResponse",
")",
"{",
"return",
"new",
"BrowserKitResponse",
"(",
"(",
"string",
")",
"$",
"psrResponse",
"->",
"getBody",
"(",
")",
",",
"$",
"psrResponse",
"->",
"getStatusCode",
"(",
")",
... | Convert a PSR-7 response to a codeception response
@param ResponseInterface $psrResponse
@return BrowserKitResponse | [
"Convert",
"a",
"PSR",
"-",
"7",
"response",
"to",
"a",
"codeception",
"response"
] | 5c2b12e4ab291f26424fda9fbf1618c818bc8d6e | https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/ResponseConvertor.php#L19-L26 |
20,724 | ekuiter/feature-php | FeaturePhp/Helper/Partition.php | Partition.fromObjects | public static function fromObjects($array, $key) {
$elements = array();
foreach ($array as $element) {
$result = call_user_func(array($element, $key));
$elements = array_merge($elements, is_array($result) ? $result : array($result));
}
return new self($elements);
... | php | public static function fromObjects($array, $key) {
$elements = array();
foreach ($array as $element) {
$result = call_user_func(array($element, $key));
$elements = array_merge($elements, is_array($result) ? $result : array($result));
}
return new self($elements);
... | [
"public",
"static",
"function",
"fromObjects",
"(",
"$",
"array",
",",
"$",
"key",
")",
"{",
"$",
"elements",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"element",
")",
"{",
"$",
"result",
"=",
"call_user_func",
"(",
"array... | Creates a partition from a set of objects.
@param array $array
@param callable $key
@return Partition | [
"Creates",
"a",
"partition",
"from",
"a",
"set",
"of",
"objects",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Partition.php#L33-L40 |
20,725 | ekuiter/feature-php | FeaturePhp/Helper/Partition.php | Partition.partitionBy | public function partitionBy($key) {
$partition = array();
foreach ($this->elements as $element) {
$newEquivalenceClass = true;
for ($i = 0; $i < count($partition); $i++) // partition[$i] is an equivalence class
// an equivalence class is guaranteed to be non-empty... | php | public function partitionBy($key) {
$partition = array();
foreach ($this->elements as $element) {
$newEquivalenceClass = true;
for ($i = 0; $i < count($partition); $i++) // partition[$i] is an equivalence class
// an equivalence class is guaranteed to be non-empty... | [
"public",
"function",
"partitionBy",
"(",
"$",
"key",
")",
"{",
"$",
"partition",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"elements",
"as",
"$",
"element",
")",
"{",
"$",
"newEquivalenceClass",
"=",
"true",
";",
"for",
"(",
"$... | Partitions the elements using an equivalence relation.
@param callable $key a binary relation on the elements
@return array[] | [
"Partitions",
"the",
"elements",
"using",
"an",
"equivalence",
"relation",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/Partition.php#L47-L61 |
20,726 | surebert/surebert-framework | src/sb/String/HTML.php | HTML.escape | public static function escape($mixed, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_string($mixed)) {
$mixed = htmlspecialchars($mixed, $quote_style, $charset);
} elseif (is_object($mixed) || is_array($mixed)) {
foreach ($mixed as $k => &$v) {
if ($... | php | public static function escape($mixed, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_string($mixed)) {
$mixed = htmlspecialchars($mixed, $quote_style, $charset);
} elseif (is_object($mixed) || is_array($mixed)) {
foreach ($mixed as $k => &$v) {
if ($... | [
"public",
"static",
"function",
"escape",
"(",
"$",
"mixed",
",",
"$",
"quote_style",
"=",
"ENT_QUOTES",
",",
"$",
"charset",
"=",
"'UTF-8'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"mixed",
")",
")",
"{",
"$",
"mixed",
"=",
"htmlspecialchars",
"("... | Recursively htmlspecialchars string properties of objects and arrays
@param mixed $mixed The object or array to convert
@param int $quote_style ent quote style from htmlspecialchars
@param string $charset The charset from htmlspecialchars
@return type | [
"Recursively",
"htmlspecialchars",
"string",
"properties",
"of",
"objects",
"and",
"arrays"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/String/HTML.php#L18-L36 |
20,727 | surebert/surebert-framework | src/sb/String/HTML.php | HTML.unescape | public static function unescape($mixed, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_string($mixed)) {
$mixed = str_replace('&', '&', $mixed);
$mixed = str_replace(''', '\'', $mixed);
$mixed = str_replace('"', '"', $mixed);
$mixed = s... | php | public static function unescape($mixed, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_string($mixed)) {
$mixed = str_replace('&', '&', $mixed);
$mixed = str_replace(''', '\'', $mixed);
$mixed = str_replace('"', '"', $mixed);
$mixed = s... | [
"public",
"static",
"function",
"unescape",
"(",
"$",
"mixed",
",",
"$",
"quote_style",
"=",
"ENT_QUOTES",
",",
"$",
"charset",
"=",
"'UTF-8'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"mixed",
")",
")",
"{",
"$",
"mixed",
"=",
"str_replace",
"(",
... | Recursively unhtmlspecialchars string properties of objects and arrays
@param mixed $mixed The object or array to convert
@param int $quote_style ent quote style from htmlspecialchars
@param string $charset The charset from htmlspecialchars
@return type | [
"Recursively",
"unhtmlspecialchars",
"string",
"properties",
"of",
"objects",
"and",
"arrays"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/String/HTML.php#L45-L67 |
20,728 | InactiveProjects/limoncello-illuminate | app/Http/Controllers/Web/HomeController.php | HomeController.authenticate | public function authenticate(Request $request)
{
$email = $request->input(self::AUTH_PARAM_EMAIL, null);
$password = $request->input(self::AUTH_PARAM_PASSWORD, null);
if ($email !== null &&
$password !== null &&
($user = User::query()->where(User::FIELD_EMAIL, '='... | php | public function authenticate(Request $request)
{
$email = $request->input(self::AUTH_PARAM_EMAIL, null);
$password = $request->input(self::AUTH_PARAM_PASSWORD, null);
if ($email !== null &&
$password !== null &&
($user = User::query()->where(User::FIELD_EMAIL, '='... | [
"public",
"function",
"authenticate",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"email",
"=",
"$",
"request",
"->",
"input",
"(",
"self",
"::",
"AUTH_PARAM_EMAIL",
",",
"null",
")",
";",
"$",
"password",
"=",
"$",
"request",
"->",
"input",
"(",
"s... | Issue auth token.
@param Request $request
@return Response | [
"Issue",
"auth",
"token",
"."
] | cae6fc26190efcf090495a5c3582c10fa2430897 | https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Http/Controllers/Web/HomeController.php#L39-L67 |
20,729 | Danack/GithubArtaxService | lib/GithubService/Operation/listForks.php | listForks.getFilteredParameter | public function getFilteredParameter($name) {
if (array_key_exists($name, $this->parameters) == false) {
throw new \Exception('Parameter '.$name.' does not exist.');
}
$value = $this->parameters[$name];
return $value;
} | php | public function getFilteredParameter($name) {
if (array_key_exists($name, $this->parameters) == false) {
throw new \Exception('Parameter '.$name.' does not exist.');
}
$value = $this->parameters[$name];
return $value;
} | [
"public",
"function",
"getFilteredParameter",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"parameters",
")",
"==",
"false",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Parameter '",
".",
"$... | Apply any filters necessary to the parameter
@return mixed
@param string $name The name of the parameter to get. | [
"Apply",
"any",
"filters",
"necessary",
"to",
"the",
"parameter"
] | 9f62b5be4f413207d4012e7fa084d0ae505680eb | https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/Operation/listForks.php#L71-L80 |
20,730 | nabab/bbn | src/bbn/file/image.php | image.get_extension | public function get_extension(){
parent::get_extension();
if ( !$this->ext2 && $this->file ){
if ( function_exists('exif_imagetype') ){
if ( $r = exif_imagetype($this->file) ){
if ( !array_key_exists($r, bbn\file\image::$allowed_extensions) ){
$this->ext = false;
}
}
... | php | public function get_extension(){
parent::get_extension();
if ( !$this->ext2 && $this->file ){
if ( function_exists('exif_imagetype') ){
if ( $r = exif_imagetype($this->file) ){
if ( !array_key_exists($r, bbn\file\image::$allowed_extensions) ){
$this->ext = false;
}
}
... | [
"public",
"function",
"get_extension",
"(",
")",
"{",
"parent",
"::",
"get_extension",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"ext2",
"&&",
"$",
"this",
"->",
"file",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'exif_imagetype'",
")",
")",... | Returns the extension of the image. If the file has jpg extension will return 'jpeg'.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
bbn\x::dump($img->get_extension());
// (string) "jpeg"
```
@return string | [
"Returns",
"the",
"extension",
"of",
"the",
"image",
".",
"If",
"the",
"file",
"has",
"jpg",
"extension",
"will",
"return",
"jpeg",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L205-L226 |
20,731 | nabab/bbn | src/bbn/file/image.php | image.display | public function display()
{
if ( $this->test() ){
if ( !headers_sent() ){
header('Content-Type: image/'.$this->ext2);
}
if ( class_exists('\\Imagick') ){
echo $this->img;
$this->img->clear();
$this->img->destroy();
}
else{
\call_user_func('image'.$this->ext2, $this->img);
image... | php | public function display()
{
if ( $this->test() ){
if ( !headers_sent() ){
header('Content-Type: image/'.$this->ext2);
}
if ( class_exists('\\Imagick') ){
echo $this->img;
$this->img->clear();
$this->img->destroy();
}
else{
\call_user_func('image'.$this->ext2, $this->img);
image... | [
"public",
"function",
"display",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"if",
"(",
"!",
"headers_sent",
"(",
")",
")",
"{",
"header",
"(",
"'Content-Type: image/'",
".",
"$",
"this",
"->",
"ext2",
")",
";",
"}",
... | Sends the image with Content-Type.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->display();
```
@return image | [
"Sends",
"the",
"image",
"with",
"Content",
"-",
"Type",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L338-L355 |
20,732 | nabab/bbn | src/bbn/file/image.php | image.crop | public function crop($w, $h, $x, $y)
{
if ( $this->test() ){
$args = \func_get_args();
foreach ( $args as $arg ){
if ( !is_numeric($arg) ){
$this->error = \defined('BBN_ARGUMENTS_MUST_BE_NUMERIC') ?
BBN_ARGUMENTS_MUST_BE_NUMERIC : 'Arguments must be numeric';
}
}
if ( $w + $x > $this->... | php | public function crop($w, $h, $x, $y)
{
if ( $this->test() ){
$args = \func_get_args();
foreach ( $args as $arg ){
if ( !is_numeric($arg) ){
$this->error = \defined('BBN_ARGUMENTS_MUST_BE_NUMERIC') ?
BBN_ARGUMENTS_MUST_BE_NUMERIC : 'Arguments must be numeric';
}
}
if ( $w + $x > $this->... | [
"public",
"function",
"crop",
"(",
"$",
"w",
",",
"$",
"h",
",",
"$",
"x",
",",
"$",
"y",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"args... | Returns a crop of the image.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
bbn\x::dump($img->get_width(),$img->get_height());
// (int) 345 146
$img->crop(10, 10, 30, 30)->save("/home/data/test/img2.jpeg");
$img2 = new \bbn\file\image("/home/data/test/img2.jpeg");
bbn\x::hdump($img2->get_width(),$img2... | [
"Returns",
"a",
"crop",
"of",
"the",
"image",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L639-L679 |
20,733 | nabab/bbn | src/bbn/file/image.php | image.brightness | public function brightness($val='+')
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
$p = ( $val == '-' ) ? 90 : 110;
if ( !$this->img->modulateImage($p,100,100) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a proble... | php | public function brightness($val='+')
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
$p = ( $val == '-' ) ? 90 : 110;
if ( !$this->img->modulateImage($p,100,100) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a proble... | [
"public",
"function",
"brightness",
"(",
"$",
"val",
"=",
"'+'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\Imagick'",
")",
")",
"{",
"$",
"p",
"=",
"(",
"$",
"val",
"==",
"'-'",
")... | Adjusts the image's brightness.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->brightness();
$img->brightness("-");
```
@param string $val The value "+" (default) increases the brightness, the value ("-") reduces it.
@return image | [
"Adjusts",
"the",
"image",
"s",
"brightness",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L809-L831 |
20,734 | nabab/bbn | src/bbn/file/image.php | image.contrast | public function contrast($val='+')
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
$p = ( $val == '-' ) ? 0 : 1;
if ( !$this->img->contrastImage($p) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
... | php | public function contrast($val='+')
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
$p = ( $val == '-' ) ? 0 : 1;
if ( !$this->img->contrastImage($p) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
... | [
"public",
"function",
"contrast",
"(",
"$",
"val",
"=",
"'+'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\Imagick'",
")",
")",
"{",
"$",
"p",
"=",
"(",
"$",
"val",
"==",
"'-'",
")",... | Adjusts the image contrast.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->contrast("-");
$img->contrast();
```
@param string $val The value "+" (default), increases the contrast, the value ("-") reduces it.
@return image | [
"Adjusts",
"the",
"image",
"contrast",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L845-L867 |
20,735 | nabab/bbn | src/bbn/file/image.php | image.grayscale | public function grayscale()
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
if ( !$this->img->modulateImage(100,0,100) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
}
else if ( function_exists('im... | php | public function grayscale()
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
if ( !$this->img->modulateImage(100,0,100) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
}
else if ( function_exists('im... | [
"public",
"function",
"grayscale",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\Imagick'",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"img",
"->",
"modulateImage",
"(",
"100",... | Converts the image's color to grayscale.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->grayscale()->save();
```
@return image | [
"Converts",
"the",
"image",
"s",
"color",
"to",
"grayscale",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L879-L899 |
20,736 | nabab/bbn | src/bbn/file/image.php | image.negate | public function negate()
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
if ( !$this->img->negateImage(false) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
}
else if ( function_exists('imagefilter... | php | public function negate()
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
{
if ( !$this->img->negateImage(false) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
}
else if ( function_exists('imagefilter... | [
"public",
"function",
"negate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\Imagick'",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"img",
"->",
"negateImage",
"(",
"false",
... | Converts the image's color to negative.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->negate();
```
@return image | [
"Converts",
"the",
"image",
"s",
"color",
"to",
"negative",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L911-L931 |
20,737 | nabab/bbn | src/bbn/file/image.php | image.polaroid | public function polaroid()
{
if ( $this->test() ){
if ( class_exists('\\Imagick') ){
if ( !$this->img->polaroidImage(new \ImagickDraw(), 0) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
}
}
return $this;
} | php | public function polaroid()
{
if ( $this->test() ){
if ( class_exists('\\Imagick') ){
if ( !$this->img->polaroidImage(new \ImagickDraw(), 0) ){
$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
}
}
}
return $this;
} | [
"public",
"function",
"polaroid",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\Imagick'",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"img",
"->",
"polaroidImage",
"(",
"new",
... | Converts the image's color with polaroid filter.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->polaroid()->save();
```
@return image
@todo Transparency of png files. | [
"Converts",
"the",
"image",
"s",
"color",
"with",
"polaroid",
"filter",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L944-L955 |
20,738 | nabab/bbn | src/bbn/file/image.php | image.thumbs | public function thumbs($dest = '.', $sizes = [[false, 960], [false, 480], [false, 192], [false, 96], [false, 48]], $mask = '_%s', $crop = false, $bigger = false){
if ( $this->test() && is_dir($dest) ){
$this->get_extension();
$w = $this->get_width();
$h = $this->get_height();
$d = $w >= $h ? 'w' : 'h';... | php | public function thumbs($dest = '.', $sizes = [[false, 960], [false, 480], [false, 192], [false, 96], [false, 48]], $mask = '_%s', $crop = false, $bigger = false){
if ( $this->test() && is_dir($dest) ){
$this->get_extension();
$w = $this->get_width();
$h = $this->get_height();
$d = $w >= $h ? 'w' : 'h';... | [
"public",
"function",
"thumbs",
"(",
"$",
"dest",
"=",
"'.'",
",",
"$",
"sizes",
"=",
"[",
"[",
"false",
",",
"960",
"]",
",",
"[",
"false",
",",
"480",
"]",
",",
"[",
"false",
",",
"192",
"]",
",",
"[",
"false",
",",
"96",
"]",
",",
"[",
"... | Creates miniature of the image
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
$img->thumbs()->save(/home/data/test/image_test.jpg");
```
@return image|false | [
"Creates",
"miniature",
"of",
"the",
"image"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L967-L1010 |
20,739 | nabab/bbn | src/bbn/file/image.php | image.toString | public function toString()
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
$m = $this->img;
else
{
ob_start();
\call_user_func('image'.$this->ext2,$this->img);
$m = ob_get_contents();
ob_end_clean();
}
return 'data:image/'.$this->ext.';base64,'.base64_encode($m);
}
} | php | public function toString()
{
if ( $this->test() )
{
if ( class_exists('\\Imagick') )
$m = $this->img;
else
{
ob_start();
\call_user_func('image'.$this->ext2,$this->img);
$m = ob_get_contents();
ob_end_clean();
}
return 'data:image/'.$this->ext.';base64,'.base64_encode($m);
}
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"test",
"(",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'\\\\Imagick'",
")",
")",
"$",
"m",
"=",
"$",
"this",
"->",
"img",
";",
"else",
"{",
"ob_start",
"(",
")",... | Return the image as string.
```php
$img = new bbn\file\image("/home/data/test/image.jpg");
bbn\x::hdump($img->toString());
// (string)
```
@return string | [
"Return",
"the",
"image",
"as",
"string",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/image.php#L1023-L1038 |
20,740 | oroinc/OroLayoutComponent | Extension/Theme/PathProvider/ChainPathProvider.php | ChainPathProvider.addProvider | public function addProvider(PathProviderInterface $provider, $priority = 0)
{
$this->providers[$priority][] = $provider;
$this->sorted = null;
} | php | public function addProvider(PathProviderInterface $provider, $priority = 0)
{
$this->providers[$priority][] = $provider;
$this->sorted = null;
} | [
"public",
"function",
"addProvider",
"(",
"PathProviderInterface",
"$",
"provider",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"providers",
"[",
"$",
"priority",
"]",
"[",
"]",
"=",
"$",
"provider",
";",
"$",
"this",
"->",
"sorted",
"... | For automatically injecting provider should be registered as DI service
with tag layout.resource.path_provider
@param PathProviderInterface $provider
@param int $priority | [
"For",
"automatically",
"injecting",
"provider",
"should",
"be",
"registered",
"as",
"DI",
"service",
"with",
"tag",
"layout",
".",
"resource",
".",
"path_provider"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/Theme/PathProvider/ChainPathProvider.php#L23-L27 |
20,741 | artscorestudio/document-bundle | Repository/PageRepository.php | PageRepository.getLastVersion | public function getLastVersion($page_id)
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original=:page_id')
->orderBy('p.createdAt', 'DESC')
->setParameter(':page_id', $page_id);
$result = $qb->getQuery()->setMaxResults(1)->getResult();
if ( is_null($result) ) {
$qb2 = $this->createQuery... | php | public function getLastVersion($page_id)
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original=:page_id')
->orderBy('p.createdAt', 'DESC')
->setParameter(':page_id', $page_id);
$result = $qb->getQuery()->setMaxResults(1)->getResult();
if ( is_null($result) ) {
$qb2 = $this->createQuery... | [
"public",
"function",
"getLastVersion",
"(",
"$",
"page_id",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'p'",
")",
";",
"$",
"qb",
"->",
"where",
"(",
"'p.original=:page_id'",
")",
"->",
"orderBy",
"(",
"'p.createdAt'",
",",
... | Get last version for a page
@param integer $id ASFDocumentBundle:Page ID | [
"Get",
"last",
"version",
"for",
"a",
"page"
] | 3aceab0f75de8f7dd0fad0d0db83d7940bf565c8 | https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Repository/PageRepository.php#L30-L48 |
20,742 | artscorestudio/document-bundle | Repository/PageRepository.php | PageRepository.findBySlug | public function findBySlug($path)
{
$qb = $this->createQueryBuilder('p');
$qb instanceof QueryBuilder;
$qb->add('where', $qb->expr()->like('p.slug', $qb->expr()->lower(':searched_term')))
->setParameter('searched_term', $path);
return $qb->getQuery()->getResult();
} | php | public function findBySlug($path)
{
$qb = $this->createQueryBuilder('p');
$qb instanceof QueryBuilder;
$qb->add('where', $qb->expr()->like('p.slug', $qb->expr()->lower(':searched_term')))
->setParameter('searched_term', $path);
return $qb->getQuery()->getResult();
} | [
"public",
"function",
"findBySlug",
"(",
"$",
"path",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'p'",
")",
";",
"$",
"qb",
"instanceof",
"QueryBuilder",
";",
"$",
"qb",
"->",
"add",
"(",
"'where'",
",",
"$",
"qb",
"->",... | Find page by slug
@param string $path | [
"Find",
"page",
"by",
"slug"
] | 3aceab0f75de8f7dd0fad0d0db83d7940bf565c8 | https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Repository/PageRepository.php#L72-L81 |
20,743 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.initializeState | protected function initializeState(RawLayout $rawLayout, ContextInterface $context)
{
$this->rawLayout = $rawLayout;
$this->context = $context;
$this->dataAccessor = new DataAccessor($this->registry, $this->context);
$this->optionsResolver = new BlockOptionsResolver($this->regi... | php | protected function initializeState(RawLayout $rawLayout, ContextInterface $context)
{
$this->rawLayout = $rawLayout;
$this->context = $context;
$this->dataAccessor = new DataAccessor($this->registry, $this->context);
$this->optionsResolver = new BlockOptionsResolver($this->regi... | [
"protected",
"function",
"initializeState",
"(",
"RawLayout",
"$",
"rawLayout",
",",
"ContextInterface",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"rawLayout",
"=",
"$",
"rawLayout",
";",
"$",
"this",
"->",
"context",
"=",
"$",
"context",
";",
"$",
"thi... | Initializes the state of this factory
@param RawLayout $rawLayout
@param ContextInterface $context | [
"Initializes",
"the",
"state",
"of",
"this",
"factory"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L85-L105 |
20,744 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.clearState | protected function clearState()
{
$this->rawLayout = null;
$this->context = null;
$this->dataAccessor = null;
$this->optionsResolver = null;
$this->typeHelper = null;
$this->blockBuilder = null;
$this->block = null;
} | php | protected function clearState()
{
$this->rawLayout = null;
$this->context = null;
$this->dataAccessor = null;
$this->optionsResolver = null;
$this->typeHelper = null;
$this->blockBuilder = null;
$this->block = null;
} | [
"protected",
"function",
"clearState",
"(",
")",
"{",
"$",
"this",
"->",
"rawLayout",
"=",
"null",
";",
"$",
"this",
"->",
"context",
"=",
"null",
";",
"$",
"this",
"->",
"dataAccessor",
"=",
"null",
";",
"$",
"this",
"->",
"optionsResolver",
"=",
"nul... | Clears the state of this factory | [
"Clears",
"the",
"state",
"of",
"this",
"factory"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L110-L119 |
20,745 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlocks | protected function buildBlocks($rootId)
{
// build the root block
if (!$this->rawLayout->hasProperty($rootId, RawLayout::RESOLVED_OPTIONS, true)) {
$this->buildBlock($rootId);
}
// build child blocks
$iterator = $this->rawLayout->getHierarchyIterator($rootId);
... | php | protected function buildBlocks($rootId)
{
// build the root block
if (!$this->rawLayout->hasProperty($rootId, RawLayout::RESOLVED_OPTIONS, true)) {
$this->buildBlock($rootId);
}
// build child blocks
$iterator = $this->rawLayout->getHierarchyIterator($rootId);
... | [
"protected",
"function",
"buildBlocks",
"(",
"$",
"rootId",
")",
"{",
"// build the root block",
"if",
"(",
"!",
"$",
"this",
"->",
"rawLayout",
"->",
"hasProperty",
"(",
"$",
"rootId",
",",
"RawLayout",
"::",
"RESOLVED_OPTIONS",
",",
"true",
")",
")",
"{",
... | Builds all blocks starting with and including the given root block
@param string $rootId
@throws Exception\LogicException if a child block is added to not container | [
"Builds",
"all",
"blocks",
"starting",
"with",
"and",
"including",
"the",
"given",
"root",
"block"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L128-L163 |
20,746 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlockViews | protected function buildBlockViews($rootId)
{
/** @var BlockView[] $views */
$views = [];
// build the root view
$rootView = $this->buildBlockView($rootId);
$views[$rootId] = $rootView;
// build child views
$iterator = $this->rawLayout->getHierarchyIter... | php | protected function buildBlockViews($rootId)
{
/** @var BlockView[] $views */
$views = [];
// build the root view
$rootView = $this->buildBlockView($rootId);
$views[$rootId] = $rootView;
// build child views
$iterator = $this->rawLayout->getHierarchyIter... | [
"protected",
"function",
"buildBlockViews",
"(",
"$",
"rootId",
")",
"{",
"/** @var BlockView[] $views */",
"$",
"views",
"=",
"[",
"]",
";",
"// build the root view",
"$",
"rootView",
"=",
"$",
"this",
"->",
"buildBlockView",
"(",
"$",
"rootId",
")",
";",
"$"... | Builds views for all blocks starting with and including the given root block
@param string $rootId
@return BlockView The root block view | [
"Builds",
"views",
"for",
"all",
"blocks",
"starting",
"with",
"and",
"including",
"the",
"given",
"root",
"block"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L172-L204 |
20,747 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlock | protected function buildBlock($id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$options = $this->rawLayout->getProperty($id, RawLayout::OPTIONS, true);
$types = $this->typeHelper->getTypes($blockType);
$this->setBlockResolvedOptions($id, $bl... | php | protected function buildBlock($id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$options = $this->rawLayout->getProperty($id, RawLayout::OPTIONS, true);
$types = $this->typeHelper->getTypes($blockType);
$this->setBlockResolvedOptions($id, $bl... | [
"protected",
"function",
"buildBlock",
"(",
"$",
"id",
")",
"{",
"$",
"blockType",
"=",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
"true",
")",
";",
"$",
"options",
"=",
"$",
"this",
... | Builds the block
@param string $id | [
"Builds",
"the",
"block"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L211-L218 |
20,748 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlockView | protected function buildBlockView($id, BlockView $parentView = null)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$resolvedOptions = $this->rawLayout->getProperty($id, RawLayout::RESOLVED_OPTIONS, true);
$types = $this->typeHelper->getTypes(... | php | protected function buildBlockView($id, BlockView $parentView = null)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$resolvedOptions = $this->rawLayout->getProperty($id, RawLayout::RESOLVED_OPTIONS, true);
$types = $this->typeHelper->getTypes(... | [
"protected",
"function",
"buildBlockView",
"(",
"$",
"id",
",",
"BlockView",
"$",
"parentView",
"=",
"null",
")",
"{",
"$",
"blockType",
"=",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
... | Created and builds the block view
@param string $id
@param BlockView|null $parentView
@return BlockView | [
"Created",
"and",
"builds",
"the",
"block",
"view"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L228-L258 |
20,749 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.finishBlockView | protected function finishBlockView(BlockView $view, $id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$types = $this->typeHelper->getTypes($blockType);
// point the block view state to the current block
$this->block->initialize($id);
//... | php | protected function finishBlockView(BlockView $view, $id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$types = $this->typeHelper->getTypes($blockType);
// point the block view state to the current block
$this->block->initialize($id);
//... | [
"protected",
"function",
"finishBlockView",
"(",
"BlockView",
"$",
"view",
",",
"$",
"id",
")",
"{",
"$",
"blockType",
"=",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
"true",
")",
";",
... | Finishes the building of the block view
@param BlockView $view
@param string $id | [
"Finishes",
"the",
"building",
"of",
"the",
"block",
"view"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L266-L278 |
20,750 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.isContainerBlock | protected function isContainerBlock($id)
{
return $this->typeHelper->isInstanceOf(
$this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true),
ContainerType::NAME
);
} | php | protected function isContainerBlock($id)
{
return $this->typeHelper->isInstanceOf(
$this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true),
ContainerType::NAME
);
} | [
"protected",
"function",
"isContainerBlock",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"typeHelper",
"->",
"isInstanceOf",
"(",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
"tr... | Checks whether the given block is a container for other blocks
@param string $id
@return bool | [
"Checks",
"whether",
"the",
"given",
"block",
"is",
"a",
"container",
"for",
"other",
"blocks"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L287-L293 |
20,751 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.processExpressions | protected function processExpressions(Options $options)
{
if (!$this->context->getOr('expressions_evaluate')) {
return;
}
$values = $options->toArray();
if ($this->context->getOr('expressions_evaluate_deferred')) {
$this->expressionProcessor->processExpressi... | php | protected function processExpressions(Options $options)
{
if (!$this->context->getOr('expressions_evaluate')) {
return;
}
$values = $options->toArray();
if ($this->context->getOr('expressions_evaluate_deferred')) {
$this->expressionProcessor->processExpressi... | [
"protected",
"function",
"processExpressions",
"(",
"Options",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"context",
"->",
"getOr",
"(",
"'expressions_evaluate'",
")",
")",
"{",
"return",
";",
"}",
"$",
"values",
"=",
"$",
"options",
"-... | Processes expressions that don't work with data
@param Options $options | [
"Processes",
"expressions",
"that",
"don",
"t",
"work",
"with",
"data"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L300-L321 |
20,752 | oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.setBlockResolvedOptions | protected function setBlockResolvedOptions($id, $blockType, $options, $types)
{
// resolve options
$resolvedOptions = new Options($this->optionsResolver->resolveOptions($blockType, $options));
$this->processExpressions($resolvedOptions);
$resolvedOptions = $this->resolveValueBags($r... | php | protected function setBlockResolvedOptions($id, $blockType, $options, $types)
{
// resolve options
$resolvedOptions = new Options($this->optionsResolver->resolveOptions($blockType, $options));
$this->processExpressions($resolvedOptions);
$resolvedOptions = $this->resolveValueBags($r... | [
"protected",
"function",
"setBlockResolvedOptions",
"(",
"$",
"id",
",",
"$",
"blockType",
",",
"$",
"options",
",",
"$",
"types",
")",
"{",
"// resolve options",
"$",
"resolvedOptions",
"=",
"new",
"Options",
"(",
"$",
"this",
"->",
"optionsResolver",
"->",
... | Setting resolved options for block
@param string $id
@param string $blockType
@param array $options
@param array $types
@return Options | [
"Setting",
"resolved",
"options",
"for",
"block"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L354-L376 |
20,753 | flipboxfactory/craft-psr3 | src/Logger.php | Logger.log | public function log($level, $message, array $context = [])
{
// Resolve category from 'context'
$category = ArrayHelper::remove($context, 'category', $this->category);
// Resolve level
$level = ArrayHelper::getValue($this->map, $level, $this->level);
$this->logger->log(
... | php | public function log($level, $message, array $context = [])
{
// Resolve category from 'context'
$category = ArrayHelper::remove($context, 'category', $this->category);
// Resolve level
$level = ArrayHelper::getValue($this->map, $level, $this->level);
$this->logger->log(
... | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"// Resolve category from 'context'",
"$",
"category",
"=",
"ArrayHelper",
"::",
"remove",
"(",
"$",
"context",
",",
"'category'",
"... | Log a message, transforming from PSR3 to the closest Yii2.
@inheritdoc | [
"Log",
"a",
"message",
"transforming",
"from",
"PSR3",
"to",
"the",
"closest",
"Yii2",
"."
] | cac258edc823fddd42f18904a94d603d51d80177 | https://github.com/flipboxfactory/craft-psr3/blob/cac258edc823fddd42f18904a94d603d51d80177/src/Logger.php#L76-L89 |
20,754 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.generateSchemaAsSql | protected function generateSchemaAsSql()
{
$prefix = ezcDbSchema::$options->tableNamePrefix;
foreach ( $this->schema as $tableName => $tableDefinition )
{
$this->generateDropTableSql( $prefix . $tableName );
$this->generateCreateTableSql( $prefix . $tableName, $tableD... | php | protected function generateSchemaAsSql()
{
$prefix = ezcDbSchema::$options->tableNamePrefix;
foreach ( $this->schema as $tableName => $tableDefinition )
{
$this->generateDropTableSql( $prefix . $tableName );
$this->generateCreateTableSql( $prefix . $tableName, $tableD... | [
"protected",
"function",
"generateSchemaAsSql",
"(",
")",
"{",
"$",
"prefix",
"=",
"ezcDbSchema",
"::",
"$",
"options",
"->",
"tableNamePrefix",
";",
"foreach",
"(",
"$",
"this",
"->",
"schema",
"as",
"$",
"tableName",
"=>",
"$",
"tableDefinition",
")",
"{",... | Creates SQL DDL statements from a schema definitin.
Loops over the tables in the schema definition in $this->schema and
creates SQL SSL statements for this which it stores internally into the
$this->queries array. | [
"Creates",
"SQL",
"DDL",
"statements",
"from",
"a",
"schema",
"definitin",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L116-L124 |
20,755 | jim-moser/zf2-validators-empty-or | src/OrChain.php | OrChain.getValidators | public function getValidators()
{
$allValidatorData = $this->validators->
toArray(PriorityQueue::EXTR_DATA);
foreach ($allValidatorData as $key => $validatorData) {
$allValidatorData[$key] = $validatorData['instance'];
}
return ... | php | public function getValidators()
{
$allValidatorData = $this->validators->
toArray(PriorityQueue::EXTR_DATA);
foreach ($allValidatorData as $key => $validatorData) {
$allValidatorData[$key] = $validatorData['instance'];
}
return ... | [
"public",
"function",
"getValidators",
"(",
")",
"{",
"$",
"allValidatorData",
"=",
"$",
"this",
"->",
"validators",
"->",
"toArray",
"(",
"PriorityQueue",
"::",
"EXTR_DATA",
")",
";",
"foreach",
"(",
"$",
"allValidatorData",
"as",
"$",
"key",
"=>",
"$",
"... | Returns array of all validators.
@return PriorityQueue | [
"Returns",
"array",
"of",
"all",
"validators",
"."
] | 12f799e18ff59986c23ff3f934702834046438f2 | https://github.com/jim-moser/zf2-validators-empty-or/blob/12f799e18ff59986c23ff3f934702834046438f2/src/OrChain.php#L376-L384 |
20,756 | activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeArray | protected function encodeArray(array $action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | php | protected function encodeArray(array $action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | [
"protected",
"function",
"encodeArray",
"(",
"array",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"status",
"=",
"200",
")",
"{",
"return",
"$",
"response",
"->",
"write",
"(",
"json_encode",
"(",
"$",
"action_result",
")",
")"... | Encode regular array response, with status 200.
@param array $action_result
@param ResponseInterface $response
@param int $status
@return ResponseInterface | [
"Encode",
"regular",
"array",
"response",
"with",
"status",
"200",
"."
] | 51d24f3f203f7f5ae56edde2e35b5ef2d9293caa | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L107-L110 |
20,757 | activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeScalar | protected function encodeScalar($action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | php | protected function encodeScalar($action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | [
"protected",
"function",
"encodeScalar",
"(",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"status",
"=",
"200",
")",
"{",
"return",
"$",
"response",
"->",
"write",
"(",
"json_encode",
"(",
"$",
"action_result",
")",
")",
"->",
... | Encode scalar value, with status 200.
@param mixed $action_result
@param ResponseInterface $response
@param int $status
@return ResponseInterface | [
"Encode",
"scalar",
"value",
"with",
"status",
"200",
"."
] | 51d24f3f203f7f5ae56edde2e35b5ef2d9293caa | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L120-L123 |
20,758 | activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeStatus | protected function encodeStatus(StatusResponse $action_result, ResponseInterface $response)
{
$response = $response->withStatus($action_result->getHttpCode(), $action_result->getMessage());
if ($action_result->getHttpCode() >= 400) {
$response = $response->write(json_encode(['message' =... | php | protected function encodeStatus(StatusResponse $action_result, ResponseInterface $response)
{
$response = $response->withStatus($action_result->getHttpCode(), $action_result->getMessage());
if ($action_result->getHttpCode() >= 400) {
$response = $response->write(json_encode(['message' =... | [
"protected",
"function",
"encodeStatus",
"(",
"StatusResponse",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"response",
"=",
"$",
"response",
"->",
"withStatus",
"(",
"$",
"action_result",
"->",
"getHttpCode",
"(",
")",
",",
... | Encode and return status response.
@param StatusResponse $action_result
@param ResponseInterface $response
@return ResponseInterface | [
"Encode",
"and",
"return",
"status",
"response",
"."
] | 51d24f3f203f7f5ae56edde2e35b5ef2d9293caa | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L132-L141 |
20,759 | activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeException | protected function encodeException($exception, ResponseInterface $response, $status = 500)
{
$error = ['message' => $exception->getMessage(), 'type' => get_class($exception)];
if ($this->getDisplayErrorDetails()) {
$error['exception'] = [];
do {
$error['exce... | php | protected function encodeException($exception, ResponseInterface $response, $status = 500)
{
$error = ['message' => $exception->getMessage(), 'type' => get_class($exception)];
if ($this->getDisplayErrorDetails()) {
$error['exception'] = [];
do {
$error['exce... | [
"protected",
"function",
"encodeException",
"(",
"$",
"exception",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"status",
"=",
"500",
")",
"{",
"$",
"error",
"=",
"[",
"'message'",
"=>",
"$",
"exception",
"->",
"getMessage",
"(",
")",
",",
"'type'"... | Encode and return exception.
@param Throwable|Exception $exception
@param ResponseInterface $response
@param int $status
@return ResponseInterface | [
"Encode",
"and",
"return",
"exception",
"."
] | 51d24f3f203f7f5ae56edde2e35b5ef2d9293caa | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L151-L171 |
20,760 | zicht/z | src/Zicht/Tool/Application.php | Application.renderException | public function renderException($e, $output)
{
if ($output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) {
parent::renderException($e, $output);
} else {
/** @var $ancestry \Exception[] */
$ancestry = array();
$maxLength = 0;
do {
... | php | public function renderException($e, $output)
{
if ($output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) {
parent::renderException($e, $output);
} else {
/** @var $ancestry \Exception[] */
$ancestry = array();
$maxLength = 0;
do {
... | [
"public",
"function",
"renderException",
"(",
"$",
"e",
",",
"$",
"output",
")",
"{",
"if",
"(",
"$",
"output",
"->",
"getVerbosity",
"(",
")",
">",
"OutputInterface",
"::",
"VERBOSITY_VERBOSE",
")",
"{",
"parent",
"::",
"renderException",
"(",
"$",
"e",
... | Custom exception rendering, renders only the exception types and messages, hierarchically, but with regular
formatting if verbosity is higher.
@param \Exception $e
@param \Symfony\Component\Console\Output\OutputInterface $output
@return void | [
"Custom",
"exception",
"rendering",
"renders",
"only",
"the",
"exception",
"types",
"and",
"messages",
"hierarchically",
"but",
"with",
"regular",
"formatting",
"if",
"verbosity",
"is",
"higher",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Application.php#L66-L98 |
20,761 | zicht/z | src/Zicht/Tool/Application.php | Application.getContainer | public function getContainer($forceRecompile = false)
{
if (null === $this->container) {
$config = $this->loader->processConfiguration();
$config['z']['sources'] = $this->loader->getSourceFiles();
$config['z']['cache_file'] = sys_get_temp_dir() . '/z_' . $this->getCacheKe... | php | public function getContainer($forceRecompile = false)
{
if (null === $this->container) {
$config = $this->loader->processConfiguration();
$config['z']['sources'] = $this->loader->getSourceFiles();
$config['z']['cache_file'] = sys_get_temp_dir() . '/z_' . $this->getCacheKe... | [
"public",
"function",
"getContainer",
"(",
"$",
"forceRecompile",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"container",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"loader",
"->",
"processConfiguration",
"(",
")",
";",
... | Returns the container instance, and initializes it if not yet available.
@param bool $forceRecompile
@return Container | [
"Returns",
"the",
"container",
"instance",
"and",
"initializes",
"it",
"if",
"not",
"yet",
"available",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Application.php#L134-L152 |
20,762 | OKTOTV/OktolabMediaBundle | Controller/SeriesController.php | SeriesController.newAction | public function newAction(Request $request)
{
$series = $this->get('oktolab_media')->createSeries();
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.new_series_button', 'attr' => ['class' => 'btn btn-primary']]);
... | php | public function newAction(Request $request)
{
$series = $this->get('oktolab_media')->createSeries();
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.new_series_button', 'attr' => ['class' => 'btn btn-primary']]);
... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"series",
"=",
"$",
"this",
"->",
"get",
"(",
"'oktolab_media'",
")",
"->",
"createSeries",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"Series... | Displays a form to create a new Series entity.
@Route("/new", name="oktolab_series_new")
@Method({"GET", "POST"})
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Series",
"entity",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/SeriesController.php#L60-L84 |
20,763 | OKTOTV/OktolabMediaBundle | Controller/SeriesController.php | SeriesController.editAction | public function editAction(Request $request, $series)
{
$series = $this->get('oktolab_media')->getSeries($series);
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.edit_series_button', 'attr' => ['class' => 'btn btn-pri... | php | public function editAction(Request $request, $series)
{
$series = $this->get('oktolab_media')->getSeries($series);
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.edit_series_button', 'attr' => ['class' => 'btn btn-pri... | [
"public",
"function",
"editAction",
"(",
"Request",
"$",
"request",
",",
"$",
"series",
")",
"{",
"$",
"series",
"=",
"$",
"this",
"->",
"get",
"(",
"'oktolab_media'",
")",
"->",
"getSeries",
"(",
"$",
"series",
")",
";",
"$",
"form",
"=",
"$",
"this... | Displays a form to edit an existing Series entity.
@ ParamConverter("series", class="OktolabMediaBundle:Series")
@Method({"GET", "POST"})
@Template() | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"Series",
"entity",
"."
] | f9c1eac4f6b19d2ab25288b301dd0d9350478bb3 | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/SeriesController.php#L114-L143 |
20,764 | richardhj/contao-widget-upload-preview | src/FormUploadPreview.php | FormUploadPreview.validate | public function validate()
{
// Delete the file when requested
if (true === $this->enableReset && $this->getPost($this->strName.'_reset')) {
if (null !== ($fileModel = FilesModel::findByPk($this->varValue))) {
$file = new File($fileModel->path);
$file->del... | php | public function validate()
{
// Delete the file when requested
if (true === $this->enableReset && $this->getPost($this->strName.'_reset')) {
if (null !== ($fileModel = FilesModel::findByPk($this->varValue))) {
$file = new File($fileModel->path);
$file->del... | [
"public",
"function",
"validate",
"(",
")",
"{",
"// Delete the file when requested",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"enableReset",
"&&",
"$",
"this",
"->",
"getPost",
"(",
"$",
"this",
"->",
"strName",
".",
"'_reset'",
")",
")",
"{",
"if",
... | Validate the user input and set the value.
@throws \Exception | [
"Validate",
"the",
"user",
"input",
"and",
"set",
"the",
"value",
"."
] | 5de3488ad55c69cd311ff26e749a74097b7a9db1 | https://github.com/richardhj/contao-widget-upload-preview/blob/5de3488ad55c69cd311ff26e749a74097b7a9db1/src/FormUploadPreview.php#L133-L157 |
20,765 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.create | public function create($uid, $stream)
{
return new $this->mailClass(
$uid,
$stream,
$this->parseMailHeader($stream, $uid),
$this->parseHeaders($stream, $uid),
$this->parseBody($stream, $uid)
);
} | php | public function create($uid, $stream)
{
return new $this->mailClass(
$uid,
$stream,
$this->parseMailHeader($stream, $uid),
$this->parseHeaders($stream, $uid),
$this->parseBody($stream, $uid)
);
} | [
"public",
"function",
"create",
"(",
"$",
"uid",
",",
"$",
"stream",
")",
"{",
"return",
"new",
"$",
"this",
"->",
"mailClass",
"(",
"$",
"uid",
",",
"$",
"stream",
",",
"$",
"this",
"->",
"parseMailHeader",
"(",
"$",
"stream",
",",
"$",
"uid",
")"... | Create new mail from uid
@param int $uid
@param resource $stream
@return \MailMap\Contracts\Mail | [
"Create",
"new",
"mail",
"from",
"uid"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L65-L74 |
20,766 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseMailHeader | protected function parseMailHeader($stream, $uid)
{
$header = imap_headerinfo($stream, imap_msgno($stream, $uid));
return [
'msgNo' => (int) $header->Msgno,
'subject' => $this->parseSubject($header->subject),
'date' => $header->udate,
'to' => isset($h... | php | protected function parseMailHeader($stream, $uid)
{
$header = imap_headerinfo($stream, imap_msgno($stream, $uid));
return [
'msgNo' => (int) $header->Msgno,
'subject' => $this->parseSubject($header->subject),
'date' => $header->udate,
'to' => isset($h... | [
"protected",
"function",
"parseMailHeader",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
"{",
"$",
"header",
"=",
"imap_headerinfo",
"(",
"$",
"stream",
",",
"imap_msgno",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
")",
";",
"return",
"[",
"'msgNo'",
"=>",... | Parse the mail header
@param resource $stream
@param int $uid
@return array | [
"Parse",
"the",
"mail",
"header"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L83-L110 |
20,767 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseAddress | protected function parseAddress(array $addresses)
{
return array_map(function ($address) {
return (object) [
'address' => $address->mailbox.'@'.$address->host,
'domain' => $address->host,
'name' => isset($address->personal)
? st... | php | protected function parseAddress(array $addresses)
{
return array_map(function ($address) {
return (object) [
'address' => $address->mailbox.'@'.$address->host,
'domain' => $address->host,
'name' => isset($address->personal)
? st... | [
"protected",
"function",
"parseAddress",
"(",
"array",
"$",
"addresses",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"address",
")",
"{",
"return",
"(",
"object",
")",
"[",
"'address'",
"=>",
"$",
"address",
"->",
"mailbox",
".",
"'@'",
"... | Parse email addresses from header
@param array $addresses
@return array | [
"Parse",
"email",
"addresses",
"from",
"header"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L118-L131 |
20,768 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseSubject | protected function parseSubject($subject)
{
$subject = imap_mime_header_decode($subject);
$subjectParts = array_map(function ($subj) {
if (strtolower($subj->charset) === 'default') {
return $subj->text;
}
return iconv($subj->charset, static::$char... | php | protected function parseSubject($subject)
{
$subject = imap_mime_header_decode($subject);
$subjectParts = array_map(function ($subj) {
if (strtolower($subj->charset) === 'default') {
return $subj->text;
}
return iconv($subj->charset, static::$char... | [
"protected",
"function",
"parseSubject",
"(",
"$",
"subject",
")",
"{",
"$",
"subject",
"=",
"imap_mime_header_decode",
"(",
"$",
"subject",
")",
";",
"$",
"subjectParts",
"=",
"array_map",
"(",
"function",
"(",
"$",
"subj",
")",
"{",
"if",
"(",
"strtolowe... | Parse the subject of the email
@param string $subject
@return string | [
"Parse",
"the",
"subject",
"of",
"the",
"email"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L151-L163 |
20,769 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseHeaders | protected function parseHeaders($stream, $uid)
{
$rawHeaders = imap_fetchheader($stream, $uid, static::$fetchFlags);
$headers = [];
$key = null;
foreach (explode("\n", $rawHeaders) as $line) {
// Test if continutation
if ($line !== '' && !preg_match('/^\s/',... | php | protected function parseHeaders($stream, $uid)
{
$rawHeaders = imap_fetchheader($stream, $uid, static::$fetchFlags);
$headers = [];
$key = null;
foreach (explode("\n", $rawHeaders) as $line) {
// Test if continutation
if ($line !== '' && !preg_match('/^\s/',... | [
"protected",
"function",
"parseHeaders",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
"{",
"$",
"rawHeaders",
"=",
"imap_fetchheader",
"(",
"$",
"stream",
",",
"$",
"uid",
",",
"static",
"::",
"$",
"fetchFlags",
")",
";",
"$",
"headers",
"=",
"[",
"]",
... | Parse the email headers into array structure
@param resource $stream
@param int $uid
@return array | [
"Parse",
"the",
"email",
"headers",
"into",
"array",
"structure"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L172-L196 |
20,770 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseNestedKeyPairHeader | protected function parseNestedKeyPairHeader($nestedPairs)
{
return array_reduce(explode(';', $nestedPairs), function($result, $pair) {
$keyVal = explode('=', $pair, 2);
$key = trim(array_shift($keyVal));
$val = trim(implode('=', $keyVal));
if ($key !== '' && $... | php | protected function parseNestedKeyPairHeader($nestedPairs)
{
return array_reduce(explode(';', $nestedPairs), function($result, $pair) {
$keyVal = explode('=', $pair, 2);
$key = trim(array_shift($keyVal));
$val = trim(implode('=', $keyVal));
if ($key !== '' && $... | [
"protected",
"function",
"parseNestedKeyPairHeader",
"(",
"$",
"nestedPairs",
")",
"{",
"return",
"array_reduce",
"(",
"explode",
"(",
"';'",
",",
"$",
"nestedPairs",
")",
",",
"function",
"(",
"$",
"result",
",",
"$",
"pair",
")",
"{",
"$",
"keyVal",
"=",... | Parse the any nested key-pair values in the header value
@param string $nestedPairs
@return array | [
"Parse",
"the",
"any",
"nested",
"key",
"-",
"pair",
"values",
"in",
"the",
"header",
"value"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L204-L215 |
20,771 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseBody | protected function parseBody($stream, $uid)
{
$struct = imap_fetchstructure($stream, $uid, static::$fetchFlags);
if (!isset($struct->parts)) {
return array_filter([$this->parsePart($stream, $uid, $struct)]);
}
$parsedParts = [];
foreach ($this->flattenParts($str... | php | protected function parseBody($stream, $uid)
{
$struct = imap_fetchstructure($stream, $uid, static::$fetchFlags);
if (!isset($struct->parts)) {
return array_filter([$this->parsePart($stream, $uid, $struct)]);
}
$parsedParts = [];
foreach ($this->flattenParts($str... | [
"protected",
"function",
"parseBody",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
"{",
"$",
"struct",
"=",
"imap_fetchstructure",
"(",
"$",
"stream",
",",
"$",
"uid",
",",
"static",
"::",
"$",
"fetchFlags",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Parse the email body and its parts
@param resource $stream
@param int $uid
@return array | [
"Parse",
"the",
"email",
"body",
"and",
"its",
"parts"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L224-L237 |
20,772 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.flattenParts | protected function flattenParts(array $parts, array $flattened = [], $pre = '', $idx = 1, $full = true)
{
foreach ($parts as $part) {
$key = $pre.$idx;
$flattened[$key] = $part;
if (isset($part->parts)) {
if ($part->type == TYPEMULTIPART) {
$flattened = $th... | php | protected function flattenParts(array $parts, array $flattened = [], $pre = '', $idx = 1, $full = true)
{
foreach ($parts as $part) {
$key = $pre.$idx;
$flattened[$key] = $part;
if (isset($part->parts)) {
if ($part->type == TYPEMULTIPART) {
$flattened = $th... | [
"protected",
"function",
"flattenParts",
"(",
"array",
"$",
"parts",
",",
"array",
"$",
"flattened",
"=",
"[",
"]",
",",
"$",
"pre",
"=",
"''",
",",
"$",
"idx",
"=",
"1",
",",
"$",
"full",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"parts",
"as"... | Flatten email structure recursively.
Parts re-keyed as 1, 1.1, 2, 2.1, 2.1.1 etc
@param array $parts
@param array $flattened
@param string $pre
@param int $idx
@param bool $full
@return array | [
"Flatten",
"email",
"structure",
"recursively",
"."
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L251-L270 |
20,773 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parsePart | protected function parsePart($stream, $uid, $part, $partNo = 1)
{
if (!in_array($part->type, [TYPETEXT, TYPEMULTIPART])) {
return null;
}
$body = imap_fetchbody($stream, $uid, $partNo, static::$bodyFlags);
$body = static::decode($body, $part->encoding);
if ('' !... | php | protected function parsePart($stream, $uid, $part, $partNo = 1)
{
if (!in_array($part->type, [TYPETEXT, TYPEMULTIPART])) {
return null;
}
$body = imap_fetchbody($stream, $uid, $partNo, static::$bodyFlags);
$body = static::decode($body, $part->encoding);
if ('' !... | [
"protected",
"function",
"parsePart",
"(",
"$",
"stream",
",",
"$",
"uid",
",",
"$",
"part",
",",
"$",
"partNo",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"part",
"->",
"type",
",",
"[",
"TYPETEXT",
",",
"TYPEMULTIPART",
"]",
")",
... | Parse individual part of the structure
@param resource $stream
@param int $uid
@param stdClass $part
@param int $partNo
@return stdClass | null | [
"Parse",
"individual",
"part",
"of",
"the",
"structure"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L281-L298 |
20,774 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.decode | protected static function decode($body, $encoding)
{
if (ENCQUOTEDPRINTABLE === $encoding) {
return quoted_printable_decode($body);
}
if (ENCBASE64 === $encoding) {
return base64_decode($body);
}
return $body;
} | php | protected static function decode($body, $encoding)
{
if (ENCQUOTEDPRINTABLE === $encoding) {
return quoted_printable_decode($body);
}
if (ENCBASE64 === $encoding) {
return base64_decode($body);
}
return $body;
} | [
"protected",
"static",
"function",
"decode",
"(",
"$",
"body",
",",
"$",
"encoding",
")",
"{",
"if",
"(",
"ENCQUOTEDPRINTABLE",
"===",
"$",
"encoding",
")",
"{",
"return",
"quoted_printable_decode",
"(",
"$",
"body",
")",
";",
"}",
"if",
"(",
"ENCBASE64",
... | Decode the body text
@param string $body
@param int $encoding
@return string | [
"Decode",
"the",
"body",
"text"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L307-L318 |
20,775 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.convertBodyEncoding | protected static function convertBodyEncoding($body, $charset = '', $encoding = -1)
{
if ('' === $charset) {
$charset = static::$charset;
}
if (!mb_check_encoding($body, $charset)) {
$charset = mb_detect_encoding($body);
}
if ($charset === static::$c... | php | protected static function convertBodyEncoding($body, $charset = '', $encoding = -1)
{
if ('' === $charset) {
$charset = static::$charset;
}
if (!mb_check_encoding($body, $charset)) {
$charset = mb_detect_encoding($body);
}
if ($charset === static::$c... | [
"protected",
"static",
"function",
"convertBodyEncoding",
"(",
"$",
"body",
",",
"$",
"charset",
"=",
"''",
",",
"$",
"encoding",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"''",
"===",
"$",
"charset",
")",
"{",
"$",
"charset",
"=",
"static",
"::",
"$",
"... | Convert body encoding from given coding to default
@param string $body
@param string $charset
@param int $encoding
@return string | [
"Convert",
"body",
"encoding",
"from",
"given",
"coding",
"to",
"default"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L328-L347 |
20,776 | david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.findCharset | protected function findCharset($struct)
{
if (isset($struct->parameters)) {
foreach ($struct->parameters as $param) {
if (strtolower($param->attribute) === 'charset') {
return strtoupper($param->value);
}
}
}
if (iss... | php | protected function findCharset($struct)
{
if (isset($struct->parameters)) {
foreach ($struct->parameters as $param) {
if (strtolower($param->attribute) === 'charset') {
return strtoupper($param->value);
}
}
}
if (iss... | [
"protected",
"function",
"findCharset",
"(",
"$",
"struct",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"struct",
"->",
"parameters",
")",
")",
"{",
"foreach",
"(",
"$",
"struct",
"->",
"parameters",
"as",
"$",
"param",
")",
"{",
"if",
"(",
"strtolower",
... | Locate the charset within the struct
@param stdClass $struct
@return string | [
"Locate",
"the",
"charset",
"within",
"the",
"struct"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L355-L373 |
20,777 | inhere/php-librarys | src/Collections/FixedArray.php | FixedArray.offsetUnset | public function offsetUnset($offset)
{
$index = $this->getKeyIndex($offset);
if ($index >= 0) {
// change size.
$this->values->setSize($index - 1);
unset($this->keys[$offset], $this->values[$index]);
}
} | php | public function offsetUnset($offset)
{
$index = $this->getKeyIndex($offset);
if ($index >= 0) {
// change size.
$this->values->setSize($index - 1);
unset($this->keys[$offset], $this->values[$index]);
}
} | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"getKeyIndex",
"(",
"$",
"offset",
")",
";",
"if",
"(",
"$",
"index",
">=",
"0",
")",
"{",
"// change size.",
"$",
"this",
"->",
"values",
"->",
... | Unset an offset in the iterator.
@param mixed $offset The array offset.
@return void | [
"Unset",
"an",
"offset",
"in",
"the",
"iterator",
"."
] | e6ca598685469794f310e3ab0e2bc19519cd0ae6 | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Collections/FixedArray.php#L186-L196 |
20,778 | mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php | FileToIntegerTransformer.transform | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof File)) {
throw new TransformationFailedException('Expected an instance of a concrete5 file object.');
}
return intval($value->getFileID())... | php | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof File)) {
throw new TransformationFailedException('Expected an instance of a concrete5 file object.');
}
return intval($value->getFileID())... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"==",
"''",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"(",
"$",
"value",
"instanceof",
"File",
")",
")",
"{",
... | Converts a concrete5 file object to an integer.
@param \Concrete\Core\File\File $value The file object value
@return int The integer value
@throws TransformationFailedException If the given value is not an
instance of Concrete\Core\File\File. | [
"Converts",
"a",
"concrete5",
"file",
"object",
"to",
"an",
"integer",
"."
] | 41a93c293d986574ec5cade8a7c8700e083dbaaa | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php#L34-L43 |
20,779 | mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php | FileToIntegerTransformer.reverseTransform | public function reverseTransform($fID)
{
if (!is_numeric($fID) || $fID == 0) {
return null;
}
$rep = $this->entityManager->getRepository('Concrete\Core\File\File');
$f = $rep->find($fID);
if (!is_object($f) || $f->isError()) {
throw new Transformatio... | php | public function reverseTransform($fID)
{
if (!is_numeric($fID) || $fID == 0) {
return null;
}
$rep = $this->entityManager->getRepository('Concrete\Core\File\File');
$f = $rep->find($fID);
if (!is_object($f) || $f->isError()) {
throw new Transformatio... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"fID",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"fID",
")",
"||",
"$",
"fID",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"$",
"rep",
"=",
"$",
"this",
"->",
"entityManager",
"->",
... | Converts an integer to a concrete5 file object.
@param int $fID
@return mixed The value
@throws TransformationFailedException If the given value is not a proper
concrete5 file ID. | [
"Converts",
"an",
"integer",
"to",
"a",
"concrete5",
"file",
"object",
"."
] | 41a93c293d986574ec5cade8a7c8700e083dbaaa | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php#L53-L67 |
20,780 | webdevvie/pheanstalk-task-queue-bundle | Command/RegenerateFailedTaskCommand.php | RegenerateFailedTaskCommand.regenerateTaskById | private function regenerateTaskById($id)
{
try {
$response = $this->taskQueueService->regenerateTask($id);
if ($response) {
$this->output->writeln("<info>Regeneration succes</info>");
} else {
$this->output->writeln("<error>Regeneration suc... | php | private function regenerateTaskById($id)
{
try {
$response = $this->taskQueueService->regenerateTask($id);
if ($response) {
$this->output->writeln("<info>Regeneration succes</info>");
} else {
$this->output->writeln("<error>Regeneration suc... | [
"private",
"function",
"regenerateTaskById",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"taskQueueService",
"->",
"regenerateTask",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"response",
")",
"{",
"$",
"this",
"->",
... | Regenerates a task that has failed
@param integer $id
@return void | [
"Regenerates",
"a",
"task",
"that",
"has",
"failed"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/RegenerateFailedTaskCommand.php#L72-L84 |
20,781 | eghojansu/moe | src/Instance.php | Instance.__callstatic | static function __callstatic($func,array $args) {
if (!self::$fw)
self::$fw=Base::instance();
return call_user_func_array(array(self::$fw,$func),$args);
} | php | static function __callstatic($func,array $args) {
if (!self::$fw)
self::$fw=Base::instance();
return call_user_func_array(array(self::$fw,$func),$args);
} | [
"static",
"function",
"__callstatic",
"(",
"$",
"func",
",",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"fw",
")",
"self",
"::",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
... | Forward function calls to framework
@return mixed
@param $func callback
@param $args array | [
"Forward",
"function",
"calls",
"to",
"framework"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Instance.php#L19-L23 |
20,782 | odiaseo/pagebuilder | src/PageBuilder/Service/LayoutService.php | LayoutService.getPageThemeLayout | public function getPageThemeLayout($pageThemeId)
{
/** @var $themeModel \PageBuilder\Model\PageTemplateModel */
$themeModel = $this->getServiceLocator()->get('pagebuilder\model\pageTheme');
$pageTheme = $themeModel->findObject($pageThemeId);
return $this->getPageLayout($page... | php | public function getPageThemeLayout($pageThemeId)
{
/** @var $themeModel \PageBuilder\Model\PageTemplateModel */
$themeModel = $this->getServiceLocator()->get('pagebuilder\model\pageTheme');
$pageTheme = $themeModel->findObject($pageThemeId);
return $this->getPageLayout($page... | [
"public",
"function",
"getPageThemeLayout",
"(",
"$",
"pageThemeId",
")",
"{",
"/** @var $themeModel \\PageBuilder\\Model\\PageTemplateModel */",
"$",
"themeModel",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'pagebuilder\\model\\pageTheme'",
... | Get Page theme layout
@param $pageThemeId
@return array | [
"Get",
"Page",
"theme",
"layout"
] | 88ef7cccf305368561307efe4ca07fac8e5774f3 | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Service/LayoutService.php#L101-L109 |
20,783 | sciactive/nymph-server | src/Drivers/MySQLDriver.php | MySQLDriver.connect | public function connect() {
// Check that the MySQLi extension is installed.
if (!is_callable('mysqli_connect')) {
throw new Exceptions\UnableToConnectException(
'MySQLi PHP extension is not available. It probably has not been '.
'installed. Please install and configure it in order to ... | php | public function connect() {
// Check that the MySQLi extension is installed.
if (!is_callable('mysqli_connect')) {
throw new Exceptions\UnableToConnectException(
'MySQLi PHP extension is not available. It probably has not been '.
'installed. Please install and configure it in order to ... | [
"public",
"function",
"connect",
"(",
")",
"{",
"// Check that the MySQLi extension is installed.",
"if",
"(",
"!",
"is_callable",
"(",
"'mysqli_connect'",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"UnableToConnectException",
"(",
"'MySQLi PHP extension is not av... | Connect to the MySQL database.
@return bool Whether this instance is connected to a MySQL database after
the method has run. | [
"Connect",
"to",
"the",
"MySQL",
"database",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/MySQLDriver.php#L46-L97 |
20,784 | sciactive/nymph-server | src/Drivers/MySQLDriver.php | MySQLDriver.disconnect | public function disconnect() {
if ($this->connected) {
if (is_a($this->link, 'mysqli')) {
unset($this->link);
}
$this->link = null;
$this->connected = false;
}
return $this->connected;
} | php | public function disconnect() {
if ($this->connected) {
if (is_a($this->link, 'mysqli')) {
unset($this->link);
}
$this->link = null;
$this->connected = false;
}
return $this->connected;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connected",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"this",
"->",
"link",
",",
"'mysqli'",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"link",
")",
";",
"}",
"... | Disconnect from the MySQL database.
@return bool Whether this instance is connected to a MySQL database after
the method has run. | [
"Disconnect",
"from",
"the",
"MySQL",
"database",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/MySQLDriver.php#L105-L114 |
20,785 | hametuha/wpametu | src/WPametu/API/Rewrite.php | Rewrite.rewrite_rules_array | public function rewrite_rules_array( array $rules ){
if( !empty($this->classes) ){
// Normal rewrite rules
$new_rewrite = [];
$error_message = [];
foreach( $this->classes as $class_name ){
$prefix = $this->get_prefix($class_name);
/** ... | php | public function rewrite_rules_array( array $rules ){
if( !empty($this->classes) ){
// Normal rewrite rules
$new_rewrite = [];
$error_message = [];
foreach( $this->classes as $class_name ){
$prefix = $this->get_prefix($class_name);
/** ... | [
"public",
"function",
"rewrite_rules_array",
"(",
"array",
"$",
"rules",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"classes",
")",
")",
"{",
"// Normal rewrite rules",
"$",
"new_rewrite",
"=",
"[",
"]",
";",
"$",
"error_message",
"=",
"[... | Add rewrite rules.
@param array $rules
@return array | [
"Add",
"rewrite",
"rules",
"."
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Rewrite.php#L95-L120 |
20,786 | hametuha/wpametu | src/WPametu/API/Rewrite.php | Rewrite.pre_get_posts | public function pre_get_posts( \WP_Query &$wp_query ){
if( !is_admin() && $wp_query->is_main_query() && ($api_class = $wp_query->get($this->api_class)) ){
// Detect class is valid
try{
// Fix escaped namespace delimiter
$api_class = str_replace('\\\\', '\\... | php | public function pre_get_posts( \WP_Query &$wp_query ){
if( !is_admin() && $wp_query->is_main_query() && ($api_class = $wp_query->get($this->api_class)) ){
// Detect class is valid
try{
// Fix escaped namespace delimiter
$api_class = str_replace('\\\\', '\\... | [
"public",
"function",
"pre_get_posts",
"(",
"\\",
"WP_Query",
"&",
"$",
"wp_query",
")",
"{",
"if",
"(",
"!",
"is_admin",
"(",
")",
"&&",
"$",
"wp_query",
"->",
"is_main_query",
"(",
")",
"&&",
"(",
"$",
"api_class",
"=",
"$",
"wp_query",
"->",
"get",
... | Parse request and invoke REST class if possible
@param \WP_Query $wp_query | [
"Parse",
"request",
"and",
"invoke",
"REST",
"class",
"if",
"possible"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Rewrite.php#L127-L159 |
20,787 | hametuha/wpametu | src/WPametu/API/Rewrite.php | Rewrite.admin_init | public function admin_init(){
if( !AjaxBase::is_ajax() && current_user_can('manage_options') ){
if( !empty($this->classes) ){
$rewrites = '';
foreach( $this->classes as $class_name ){
$rewrites .= $this->get_prefix($class_name);
}
... | php | public function admin_init(){
if( !AjaxBase::is_ajax() && current_user_can('manage_options') ){
if( !empty($this->classes) ){
$rewrites = '';
foreach( $this->classes as $class_name ){
$rewrites .= $this->get_prefix($class_name);
}
... | [
"public",
"function",
"admin_init",
"(",
")",
"{",
"if",
"(",
"!",
"AjaxBase",
"::",
"is_ajax",
"(",
")",
"&&",
"current_user_can",
"(",
"'manage_options'",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"classes",
")",
")",
"{",
"$"... | Update rewrite rules if possible | [
"Update",
"rewrite",
"rules",
"if",
"possible"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Rewrite.php#L187-L207 |
20,788 | hametuha/wpametu | src/WPametu/API/Rewrite.php | Rewrite.get_prefix | public function get_prefix($class_name){
/** @var RestBase $class_name */
if( !empty($class_name::$prefix) ){
return $class_name::$prefix;
}else{
$seg = explode('\\', $class_name);
$base = $seg[count($seg) - 1];
return $this->str->camel_to_hyphen($... | php | public function get_prefix($class_name){
/** @var RestBase $class_name */
if( !empty($class_name::$prefix) ){
return $class_name::$prefix;
}else{
$seg = explode('\\', $class_name);
$base = $seg[count($seg) - 1];
return $this->str->camel_to_hyphen($... | [
"public",
"function",
"get_prefix",
"(",
"$",
"class_name",
")",
"{",
"/** @var RestBase $class_name */",
"if",
"(",
"!",
"empty",
"(",
"$",
"class_name",
"::",
"$",
"prefix",
")",
")",
"{",
"return",
"$",
"class_name",
"::",
"$",
"prefix",
";",
"}",
"else... | Get class prefix
@param string $class_name
@return string | [
"Get",
"class",
"prefix"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Rewrite.php#L215-L224 |
20,789 | DotZecker/Larafeed | src/Entry.php | Entry.prepare | public function prepare()
{
// The date format method to use with Carbon to convert the dates
$dateFormatMethod = 'to' . strtolower($this->format) . 'String';
if (null !== $this->pubDate) {
$this->pubDate = Carbon::parse($this->pubDate)->{$dateFormatMethod}();
}
... | php | public function prepare()
{
// The date format method to use with Carbon to convert the dates
$dateFormatMethod = 'to' . strtolower($this->format) . 'String';
if (null !== $this->pubDate) {
$this->pubDate = Carbon::parse($this->pubDate)->{$dateFormatMethod}();
}
... | [
"public",
"function",
"prepare",
"(",
")",
"{",
"// The date format method to use with Carbon to convert the dates",
"$",
"dateFormatMethod",
"=",
"'to'",
".",
"strtolower",
"(",
"$",
"this",
"->",
"format",
")",
".",
"'String'",
";",
"if",
"(",
"null",
"!==",
"$"... | Validate, auto-fill and sanitize the entry
@return void | [
"Validate",
"auto",
"-",
"fill",
"and",
"sanitize",
"the",
"entry"
] | d696e2f97b584ed690fe7ba4ac5d739e266c75dd | https://github.com/DotZecker/Larafeed/blob/d696e2f97b584ed690fe7ba4ac5d739e266c75dd/src/Entry.php#L33-L49 |
20,790 | DotZecker/Larafeed | src/Entry.php | Entry.autoFill | public function autoFill()
{
// The date format method to use with Carbon to convert the dates
$dateFormatMethod = 'to' . strtolower($this->format) . 'String';
if (null === $this->pubDate) {
$this->pubDate = Carbon::parse('now')->{$dateFormatMethod}();
}
if (nul... | php | public function autoFill()
{
// The date format method to use with Carbon to convert the dates
$dateFormatMethod = 'to' . strtolower($this->format) . 'String';
if (null === $this->pubDate) {
$this->pubDate = Carbon::parse('now')->{$dateFormatMethod}();
}
if (nul... | [
"public",
"function",
"autoFill",
"(",
")",
"{",
"// The date format method to use with Carbon to convert the dates",
"$",
"dateFormatMethod",
"=",
"'to'",
".",
"strtolower",
"(",
"$",
"this",
"->",
"format",
")",
".",
"'String'",
";",
"if",
"(",
"null",
"===",
"$... | Fill the attributes that can be auto-generated
@return void | [
"Fill",
"the",
"attributes",
"that",
"can",
"be",
"auto",
"-",
"generated"
] | d696e2f97b584ed690fe7ba4ac5d739e266c75dd | https://github.com/DotZecker/Larafeed/blob/d696e2f97b584ed690fe7ba4ac5d739e266c75dd/src/Entry.php#L56-L70 |
20,791 | DevGroup-ru/yii2-users-module | src/UsersModule.php | UsersModule.buildAliases | protected function buildAliases()
{
$this->routes = ArrayHelper::merge($this->defaultRoutes, $this->routes);
foreach ($this->routes as $alias => $route) {
Yii::setAlias($alias, $route);
}
} | php | protected function buildAliases()
{
$this->routes = ArrayHelper::merge($this->defaultRoutes, $this->routes);
foreach ($this->routes as $alias => $route) {
Yii::setAlias($alias, $route);
}
} | [
"protected",
"function",
"buildAliases",
"(",
")",
"{",
"$",
"this",
"->",
"routes",
"=",
"ArrayHelper",
"::",
"merge",
"(",
"$",
"this",
"->",
"defaultRoutes",
",",
"$",
"this",
"->",
"routes",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"routes",
"a... | Sets needed routes aliases | [
"Sets",
"needed",
"routes",
"aliases"
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/UsersModule.php#L165-L171 |
20,792 | phpnfe/tools | src/Validar.php | Validar.validar | public static function validar($xml, $schemaFile)
{
//Para poder pegar os erros caso houver
libxml_use_internal_errors(true);
libxml_clear_errors();
if (is_file($xml)) {
$xml = file_get_contents($xml);
}
$dom = new DOMDocument('1.0', 'utf-8');
$... | php | public static function validar($xml, $schemaFile)
{
//Para poder pegar os erros caso houver
libxml_use_internal_errors(true);
libxml_clear_errors();
if (is_file($xml)) {
$xml = file_get_contents($xml);
}
$dom = new DOMDocument('1.0', 'utf-8');
$... | [
"public",
"static",
"function",
"validar",
"(",
"$",
"xml",
",",
"$",
"schemaFile",
")",
"{",
"//Para poder pegar os erros caso houver",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"libxml_clear_errors",
"(",
")",
";",
"if",
"(",
"is_file",
"(",
"$",
"x... | Valida um xml assinado.
@param $xml
@param $schemaFile
@return bool
@throws \Exception | [
"Valida",
"um",
"xml",
"assinado",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Validar.php#L15-L42 |
20,793 | hametuha/wpametu | src/WPametu/UI/MetaBox.php | MetaBox.override | public function override($post_type, $post){
if( $this->is_valid_post_type($post_type) ){
foreach( $this->fields as $name => $vars ){
switch( $name ){
case 'excerpt':
remove_meta_box('postexcerpt', $post_type, 'normal');
... | php | public function override($post_type, $post){
if( $this->is_valid_post_type($post_type) ){
foreach( $this->fields as $name => $vars ){
switch( $name ){
case 'excerpt':
remove_meta_box('postexcerpt', $post_type, 'normal');
... | [
"public",
"function",
"override",
"(",
"$",
"post_type",
",",
"$",
"post",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_valid_post_type",
"(",
"$",
"post_type",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"name",
"=>",
"$",
... | Override default meta box
@param string $post_type
@param \WP_Post $post | [
"Override",
"default",
"meta",
"box"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/MetaBox.php#L117-L144 |
20,794 | hametuha/wpametu | src/WPametu/UI/MetaBox.php | MetaBox.render | public function render( \WP_Post $post ){
$this->nonce_field();
$this->desc();
echo '<table class="table form-table wpametu-meta-table">';
foreach( $this->loop_fields() as $field ){
if( !is_wp_error($field) ){
/** @var \WPametu\UI\Field\Base $field */
... | php | public function render( \WP_Post $post ){
$this->nonce_field();
$this->desc();
echo '<table class="table form-table wpametu-meta-table">';
foreach( $this->loop_fields() as $field ){
if( !is_wp_error($field) ){
/** @var \WPametu\UI\Field\Base $field */
... | [
"public",
"function",
"render",
"(",
"\\",
"WP_Post",
"$",
"post",
")",
"{",
"$",
"this",
"->",
"nonce_field",
"(",
")",
";",
"$",
"this",
"->",
"desc",
"(",
")",
";",
"echo",
"'<table class=\"table form-table wpametu-meta-table\">'",
";",
"foreach",
"(",
"$... | Render meta box content
@param \WP_Post $post | [
"Render",
"meta",
"box",
"content"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/MetaBox.php#L198-L212 |
20,795 | willhoffmann/domuserp-php | src/Resources/Brands/Secondary/Models.php | Models.getList | public function getList(array $query = [])
{
$list = $this->pagination(
self::DOMUSERP_API_OPERACIONAL . '/marcas/' . $this->brandId . '/modelos',
$query
);
return $list;
} | php | public function getList(array $query = [])
{
$list = $this->pagination(
self::DOMUSERP_API_OPERACIONAL . '/marcas/' . $this->brandId . '/modelos',
$query
);
return $list;
} | [
"public",
"function",
"getList",
"(",
"array",
"$",
"query",
"=",
"[",
"]",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"pagination",
"(",
"self",
"::",
"DOMUSERP_API_OPERACIONAL",
".",
"'/marcas/'",
".",
"$",
"this",
"->",
"brandId",
".",
"'/modelos'... | List of product models
@param array $query
@return array|string
@throws \GuzzleHttp\Exception\GuzzleException | [
"List",
"of",
"product",
"models"
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/Brands/Secondary/Models.php#L35-L43 |
20,796 | willhoffmann/domuserp-php | src/Resources/Brands/Secondary/Models.php | Models.get | public function get($id)
{
$data = $this->execute(
self::HTTP_GET,
self::DOMUSERP_API_OPERACIONAL . '/marcas/' . $this->brandId . '/modelos/' . $id
);
return $data;
} | php | public function get($id)
{
$data = $this->execute(
self::HTTP_GET,
self::DOMUSERP_API_OPERACIONAL . '/marcas/' . $this->brandId . '/modelos/' . $id
);
return $data;
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"execute",
"(",
"self",
"::",
"HTTP_GET",
",",
"self",
"::",
"DOMUSERP_API_OPERACIONAL",
".",
"'/marcas/'",
".",
"$",
"this",
"->",
"brandId",
".",
"'/modelos/'",... | Gets the product models data according to the id parameter
@param int $id
@return array|string
@throws \GuzzleHttp\Exception\GuzzleException | [
"Gets",
"the",
"product",
"models",
"data",
"according",
"to",
"the",
"id",
"parameter"
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/Brands/Secondary/Models.php#L52-L60 |
20,797 | WellCommerce/AppBundle | Form/DataTransformer/UserGroupPermissionToArrayTransformer.php | UserGroupPermissionToArrayTransformer.clearPreviousCollection | protected function clearPreviousCollection(Collection $collection)
{
if ($collection->count()) {
foreach ($collection as $item) {
$collection->removeElement($item);
}
}
} | php | protected function clearPreviousCollection(Collection $collection)
{
if ($collection->count()) {
foreach ($collection as $item) {
$collection->removeElement($item);
}
}
} | [
"protected",
"function",
"clearPreviousCollection",
"(",
"Collection",
"$",
"collection",
")",
"{",
"if",
"(",
"$",
"collection",
"->",
"count",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"item",
")",
"{",
"$",
"collection",
"->",
... | Resets previous photo collection
@param Collection $collection | [
"Resets",
"previous",
"photo",
"collection"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/DataTransformer/UserGroupPermissionToArrayTransformer.php#L78-L85 |
20,798 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/Command/Template/ListCommand.php | ListCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Available templates:');
foreach ($this->factory->getAllNames() as $template_name) {
$output->writeln('* '.$template_name);
}
$output->writeln('');
} | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Available templates:');
foreach ($this->factory->getAllNames() as $template_name) {
$output->writeln('* '.$template_name);
}
$output->writeln('');
} | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"writeln",
"(",
"'Available templates:'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"factory",
"->",
"getAllNames"... | Retrieves all template names from the Template Factory and sends those to stdout.
@param InputInterface $input
@param OutputInterface $output
@return void | [
"Retrieves",
"all",
"template",
"names",
"from",
"the",
"Template",
"Factory",
"and",
"sends",
"those",
"to",
"stdout",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Command/Template/ListCommand.php#L67-L74 |
20,799 | surebert/surebert-framework | src/sb/Request.php | Request.setInput | public function setInput(&$post, &$cookie, &$files, &$put, &$delete, &$data)
{
$this->post = $post;
$this->cookie = $cookie;
$this->files = $files;
$this->put = $put;
$this->delete = $delete;
$this->data = $data;
} | php | public function setInput(&$post, &$cookie, &$files, &$put, &$delete, &$data)
{
$this->post = $post;
$this->cookie = $cookie;
$this->files = $files;
$this->put = $put;
$this->delete = $delete;
$this->data = $data;
} | [
"public",
"function",
"setInput",
"(",
"&",
"$",
"post",
",",
"&",
"$",
"cookie",
",",
"&",
"$",
"files",
",",
"&",
"$",
"put",
",",
"&",
"$",
"delete",
",",
"&",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"post",
"=",
"$",
"post",
";",
"$",
... | Sets the input for the request
@param $post
@param $cookie
@param $files | [
"Sets",
"the",
"input",
"for",
"the",
"request"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Request.php#L123-L132 |
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.