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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
187,000 | snapwp/snap-core | src/Http/Request/File/File.php | File.check_if_allowed | private function check_if_allowed()
{
$check = \wp_check_filetype_and_ext($this->data['tmp_name'], $this->client_name);
if ($check['type'] !== false) {
$this->guessed_type = $check['type'];
$this->guessed_extension = $check['ext'];
}
if (($check['type'] === ... | php | private function check_if_allowed()
{
$check = \wp_check_filetype_and_ext($this->data['tmp_name'], $this->client_name);
if ($check['type'] !== false) {
$this->guessed_type = $check['type'];
$this->guessed_extension = $check['ext'];
}
if (($check['type'] === ... | [
"private",
"function",
"check_if_allowed",
"(",
")",
"{",
"$",
"check",
"=",
"\\",
"wp_check_filetype_and_ext",
"(",
"$",
"this",
"->",
"data",
"[",
"'tmp_name'",
"]",
",",
"$",
"this",
"->",
"client_name",
")",
";",
"if",
"(",
"$",
"check",
"[",
"'type'... | Checks if the file passes WordPress upload checks.
@since 1.0.0
@return bool | [
"Checks",
"if",
"the",
"file",
"passes",
"WordPress",
"upload",
"checks",
"."
] | 43ff5da68e7f28017a21c7e33c770baf6f13d5cb | https://github.com/snapwp/snap-core/blob/43ff5da68e7f28017a21c7e33c770baf6f13d5cb/src/Http/Request/File/File.php#L563-L581 |
187,001 | netzmacht-archive/contao-bootstrap | src/Netzmacht/Bootstrap/Installer.php | Installer.setupSections | protected function setupSections()
{
if(version_compare(VERSION, '3.3', '<')) {
if(!isset($GLOBALS['TL_CONFIG']['customSections']) || $GLOBALS['TL_CONFIG']['customSections'] == '') {
$GLOBALS['TL_CONFIG']['customSections'] = 'bootstrap';
}
elseif(strpos($GLOBALS['TL_CONFIG']['customSections'], 'bootstra... | php | protected function setupSections()
{
if(version_compare(VERSION, '3.3', '<')) {
if(!isset($GLOBALS['TL_CONFIG']['customSections']) || $GLOBALS['TL_CONFIG']['customSections'] == '') {
$GLOBALS['TL_CONFIG']['customSections'] = 'bootstrap';
}
elseif(strpos($GLOBALS['TL_CONFIG']['customSections'], 'bootstra... | [
"protected",
"function",
"setupSections",
"(",
")",
"{",
"if",
"(",
"version_compare",
"(",
"VERSION",
",",
"'3.3'",
",",
"'<'",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'TL_CONFIG'",
"]",
"[",
"'customSections'",
"]",
")",
"|... | setup required sections | [
"setup",
"required",
"sections"
] | 6468ab614e67a6c31c4ea5ace0837737c855f85c | https://github.com/netzmacht-archive/contao-bootstrap/blob/6468ab614e67a6c31c4ea5ace0837737c855f85c/src/Netzmacht/Bootstrap/Installer.php#L60-L75 |
187,002 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.url | public function url($url)
{
if (filter_var($url, FILTER_VALIDATE_URL) !== false) {
return $url;
}
if (is_string($url)) {
return $this->parseStringUrl($url);
}
if (is_array($url)) {
return $this->make(new UrlSettings($url));
}
... | php | public function url($url)
{
if (filter_var($url, FILTER_VALIDATE_URL) !== false) {
return $url;
}
if (is_string($url)) {
return $this->parseStringUrl($url);
}
if (is_array($url)) {
return $this->make(new UrlSettings($url));
}
... | [
"public",
"function",
"url",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_VALIDATE_URL",
")",
"!==",
"false",
")",
"{",
"return",
"$",
"url",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"url",
")",
")",
"{",
"... | Create a url from variable type
@param $url
@return null|string|array | [
"Create",
"a",
"url",
"from",
"variable",
"type"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L17-L36 |
187,003 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.create | public function create(
?string $scheme = null,
?string $domain = null,
$path = null,
?array $query = [],
?string $fragment = null,
bool $trailingSlash = false
): string {
return $this->make(new UrlSettings([
'scheme' => $scheme,
... | php | public function create(
?string $scheme = null,
?string $domain = null,
$path = null,
?array $query = [],
?string $fragment = null,
bool $trailingSlash = false
): string {
return $this->make(new UrlSettings([
'scheme' => $scheme,
... | [
"public",
"function",
"create",
"(",
"?",
"string",
"$",
"scheme",
"=",
"null",
",",
"?",
"string",
"$",
"domain",
"=",
"null",
",",
"$",
"path",
"=",
"null",
",",
"?",
"array",
"$",
"query",
"=",
"[",
"]",
",",
"?",
"string",
"$",
"fragment",
"=... | Create a url
@param string|null $scheme
@param string|null $domain
@param string|array $path
@param array $query
@param string|null $fragment
@param bool $trailingSlash
@return string|null | [
"Create",
"a",
"url"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L50-L66 |
187,004 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.to | public function to(
$path = null,
?array $query = [],
?string $fragment = null,
bool $trailingSlash = false
): string {
return $this->create(null, $this->appUrl, $path, $query, $fragment, $trailingSlash);
} | php | public function to(
$path = null,
?array $query = [],
?string $fragment = null,
bool $trailingSlash = false
): string {
return $this->create(null, $this->appUrl, $path, $query, $fragment, $trailingSlash);
} | [
"public",
"function",
"to",
"(",
"$",
"path",
"=",
"null",
",",
"?",
"array",
"$",
"query",
"=",
"[",
"]",
",",
"?",
"string",
"$",
"fragment",
"=",
"null",
",",
"bool",
"$",
"trailingSlash",
"=",
"false",
")",
":",
"string",
"{",
"return",
"$",
... | Create a local url appended to the app url.
@param string|array|null $path
@param array|null $query
@param null|string $fragment
@param bool $trailingSlash
@return string | [
"Create",
"a",
"local",
"url",
"appended",
"to",
"the",
"app",
"url",
"."
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L77-L84 |
187,005 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.parseStringUrl | protected function parseStringUrl(?string $url) : string
{
$parts = parse_url($url);
if (isset($parts['query'])) {
parse_str($parts['query'], $query);
}
return $this->create(
$parts['scheme'] ?? null,
$parts['host'] ?? null,
$parts['p... | php | protected function parseStringUrl(?string $url) : string
{
$parts = parse_url($url);
if (isset($parts['query'])) {
parse_str($parts['query'], $query);
}
return $this->create(
$parts['scheme'] ?? null,
$parts['host'] ?? null,
$parts['p... | [
"protected",
"function",
"parseStringUrl",
"(",
"?",
"string",
"$",
"url",
")",
":",
"string",
"{",
"$",
"parts",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"parts",
"[",
"'query'",
"]",
")",
")",
"{",
"parse_str",
"... | Parse url when given as string
@param string $url
@return string | [
"Parse",
"url",
"when",
"given",
"as",
"string"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L102-L120 |
187,006 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.createOutput | protected function createOutput(Settings $settings) : string
{
return StrFormat::format(
'{{scheme}}{{domain}}{{path}}{{query}}{{fragment}}',
$this->parseUrlComponents($settings),
new StrSettings([ 'removeUnparsed' => true ])
);
} | php | protected function createOutput(Settings $settings) : string
{
return StrFormat::format(
'{{scheme}}{{domain}}{{path}}{{query}}{{fragment}}',
$this->parseUrlComponents($settings),
new StrSettings([ 'removeUnparsed' => true ])
);
} | [
"protected",
"function",
"createOutput",
"(",
"Settings",
"$",
"settings",
")",
":",
"string",
"{",
"return",
"StrFormat",
"::",
"format",
"(",
"'{{scheme}}{{domain}}{{path}}{{query}}{{fragment}}'",
",",
"$",
"this",
"->",
"parseUrlComponents",
"(",
"$",
"settings",
... | Create the URL string
@param \Laranix\Support\Settings|\Laranix\Support\IO\Url\UrlSettings $settings
@return string | [
"Create",
"the",
"URL",
"string"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L128-L135 |
187,007 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.parseUrlComponents | protected function parseUrlComponents(UrlSettings $settings) : array
{
return [
'scheme' => $this->getScheme($settings->scheme, $settings->domain),
'domain' => $this->getDomain($settings->domain),
'path' => $this->getPath($settings->path, $settings->trailingSla... | php | protected function parseUrlComponents(UrlSettings $settings) : array
{
return [
'scheme' => $this->getScheme($settings->scheme, $settings->domain),
'domain' => $this->getDomain($settings->domain),
'path' => $this->getPath($settings->path, $settings->trailingSla... | [
"protected",
"function",
"parseUrlComponents",
"(",
"UrlSettings",
"$",
"settings",
")",
":",
"array",
"{",
"return",
"[",
"'scheme'",
"=>",
"$",
"this",
"->",
"getScheme",
"(",
"$",
"settings",
"->",
"scheme",
",",
"$",
"settings",
"->",
"domain",
")",
",... | Parse the parts of the Url
@param \Laranix\Support\IO\Url\UrlSettings $settings
@return array | [
"Parse",
"the",
"parts",
"of",
"the",
"Url"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L143-L152 |
187,008 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.getScheme | protected function getScheme(?string $scheme, ?string $domain = null) : string
{
if ($scheme === null || $scheme === '//') {
return $this->tryGuessScheme($domain);
}
return $this->trim($scheme, ':/') . '://';
} | php | protected function getScheme(?string $scheme, ?string $domain = null) : string
{
if ($scheme === null || $scheme === '//') {
return $this->tryGuessScheme($domain);
}
return $this->trim($scheme, ':/') . '://';
} | [
"protected",
"function",
"getScheme",
"(",
"?",
"string",
"$",
"scheme",
",",
"?",
"string",
"$",
"domain",
"=",
"null",
")",
":",
"string",
"{",
"if",
"(",
"$",
"scheme",
"===",
"null",
"||",
"$",
"scheme",
"===",
"'//'",
")",
"{",
"return",
"$",
... | Get url scheme
@param string|null $scheme
@param null|string $domain
@return string | [
"Get",
"url",
"scheme"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L161-L168 |
187,009 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.tryGuessScheme | protected function tryGuessScheme(?string $domain) : ?string
{
if ($domain !== null) {
if (Str::startsWith($domain, 'https')) {
return 'https://';
}
if (Str::startsWith($domain, 'http')) {
return 'http://';
}
}
... | php | protected function tryGuessScheme(?string $domain) : ?string
{
if ($domain !== null) {
if (Str::startsWith($domain, 'https')) {
return 'https://';
}
if (Str::startsWith($domain, 'http')) {
return 'http://';
}
}
... | [
"protected",
"function",
"tryGuessScheme",
"(",
"?",
"string",
"$",
"domain",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"domain",
"!==",
"null",
")",
"{",
"if",
"(",
"Str",
"::",
"startsWith",
"(",
"$",
"domain",
",",
"'https'",
")",
")",
"{",
... | Get the scheme from the domain
@param null|string $domain
@return null|string | [
"Get",
"the",
"scheme",
"from",
"the",
"domain"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L176-L192 |
187,010 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.getQueryString | protected function getQueryString(?array $query) : ?string
{
if (empty($query)) {
return null;
}
return '?' . http_build_query($query, null, '&', PHP_QUERY_RFC3986);
} | php | protected function getQueryString(?array $query) : ?string
{
if (empty($query)) {
return null;
}
return '?' . http_build_query($query, null, '&', PHP_QUERY_RFC3986);
} | [
"protected",
"function",
"getQueryString",
"(",
"?",
"array",
"$",
"query",
")",
":",
"?",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"query",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"'?'",
".",
"http_build_query",
"(",
"$",
"query",
"... | Build query string
@param array|null $query
@return null|string | [
"Build",
"query",
"string"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L249-L256 |
187,011 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.getFragment | protected function getFragment(?string $fragment) : ?string
{
if ($fragment === null) {
return null;
}
return '#' . $this->trim($fragment, '#');
} | php | protected function getFragment(?string $fragment) : ?string
{
if ($fragment === null) {
return null;
}
return '#' . $this->trim($fragment, '#');
} | [
"protected",
"function",
"getFragment",
"(",
"?",
"string",
"$",
"fragment",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"fragment",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"'#'",
".",
"$",
"this",
"->",
"trim",
"(",
"$",
"... | Get url fragment
@param null|string $fragment
@return null|string | [
"Get",
"url",
"fragment"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L264-L271 |
187,012 | samanix/laranix | src/Laranix/Support/IO/Url/Url.php | Url.getTrailingSlash | protected function getTrailingSlash(string $item, bool $trailing) : string
{
if (Str::contains($item, '.') || !$trailing) {
return '';
}
return '/';
} | php | protected function getTrailingSlash(string $item, bool $trailing) : string
{
if (Str::contains($item, '.') || !$trailing) {
return '';
}
return '/';
} | [
"protected",
"function",
"getTrailingSlash",
"(",
"string",
"$",
"item",
",",
"bool",
"$",
"trailing",
")",
":",
"string",
"{",
"if",
"(",
"Str",
"::",
"contains",
"(",
"$",
"item",
",",
"'.'",
")",
"||",
"!",
"$",
"trailing",
")",
"{",
"return",
"''... | Check if we should include a trailing slash
@param string $item
@param bool $trailing
@return string | [
"Check",
"if",
"we",
"should",
"include",
"a",
"trailing",
"slash"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Url/Url.php#L280-L287 |
187,013 | AmericanCouncils/Transcoding | Preset.php | Preset.get | public function get($key, $default = null)
{
return isset($this->options[$key]) ? $this->options[$key] : $default;
} | php | public function get($key, $default = null)
{
return isset($this->options[$key]) ? $this->options[$key] : $default;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"options",
"[",
"$",
"key",
"]",
":",
"$",
"defau... | Retrieve one option by key, returning a default value if not set
@param string $key
@param mixed $default
@return mixed | [
"Retrieve",
"one",
"option",
"by",
"key",
"returning",
"a",
"default",
"value",
"if",
"not",
"set"
] | 8008fc06d0737b4cb7cad238b835911f588ed220 | https://github.com/AmericanCouncils/Transcoding/blob/8008fc06d0737b4cb7cad238b835911f588ed220/Preset.php#L482-L485 |
187,014 | netzmacht-archive/contao-bootstrap | src/Netzmacht/Bootstrap/Model/ContentWrapper/Model.php | Model.getTypeName | public function getTypeName($type = null)
{
$group = $this->getGroup();
$type = $type === null ? $this->getType() : $type;
return $GLOBALS['BOOTSTRAP']['wrappers'][$group][$type]['name'];
} | php | public function getTypeName($type = null)
{
$group = $this->getGroup();
$type = $type === null ? $this->getType() : $type;
return $GLOBALS['BOOTSTRAP']['wrappers'][$group][$type]['name'];
} | [
"public",
"function",
"getTypeName",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"getGroup",
"(",
")",
";",
"$",
"type",
"=",
"$",
"type",
"===",
"null",
"?",
"$",
"this",
"->",
"getType",
"(",
")",
":",
"$",
... | get type name
@param null $type
@return mixed | [
"get",
"type",
"name"
] | 6468ab614e67a6c31c4ea5ace0837737c855f85c | https://github.com/netzmacht-archive/contao-bootstrap/blob/6468ab614e67a6c31c4ea5ace0837737c855f85c/src/Netzmacht/Bootstrap/Model/ContentWrapper/Model.php#L177-L183 |
187,015 | CHH/meta-template | lib/MetaTemplate/Util/EngineRegistry.php | EngineRegistry.register | function register($engine, $extension)
{
if (!class_exists($engine)) {
throw new \InvalidArgumentException("Class $engine is not defined");
}
if (!class_implements($engine, "\\MetaTemplate\\Template\\TemplateInterface")) {
throw new \InvalidArgumentException(
... | php | function register($engine, $extension)
{
if (!class_exists($engine)) {
throw new \InvalidArgumentException("Class $engine is not defined");
}
if (!class_implements($engine, "\\MetaTemplate\\Template\\TemplateInterface")) {
throw new \InvalidArgumentException(
... | [
"function",
"register",
"(",
"$",
"engine",
",",
"$",
"extension",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"engine",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Class $engine is not defined\"",
")",
";",
"}",
"if",
... | Registers an engine with one or more extensions
@param string $engine Engine Class
@param string|array $extension One or more extensions
@return EngineRegistry | [
"Registers",
"an",
"engine",
"with",
"one",
"or",
"more",
"extensions"
] | de0d635b5543870eaa9904a2e4df8d38740e6069 | https://github.com/CHH/meta-template/blob/de0d635b5543870eaa9904a2e4df8d38740e6069/lib/MetaTemplate/Util/EngineRegistry.php#L29-L49 |
187,016 | devp-eu/tmcms-core | src/App/Frontend.php | Frontend.readTemplateContent | private function readTemplateContent()
{
// Get page content if static file used
if ($this->router_instance->getPageData()['html_file'] && file_exists(DIR_BASE . $this->router_instance->getPageData()['html_file'])) {
if (Settings::isFrontendLogEnabled()) {
FrontendLogger:... | php | private function readTemplateContent()
{
// Get page content if static file used
if ($this->router_instance->getPageData()['html_file'] && file_exists(DIR_BASE . $this->router_instance->getPageData()['html_file'])) {
if (Settings::isFrontendLogEnabled()) {
FrontendLogger:... | [
"private",
"function",
"readTemplateContent",
"(",
")",
"{",
"// Get page content if static file used",
"if",
"(",
"$",
"this",
"->",
"router_instance",
"->",
"getPageData",
"(",
")",
"[",
"'html_file'",
"]",
"&&",
"file_exists",
"(",
"DIR_BASE",
".",
"$",
"this",... | Read template content - file that is set for current requested page | [
"Read",
"template",
"content",
"-",
"file",
"that",
"is",
"set",
"for",
"current",
"requested",
"page"
] | b031af5643b6dc641539847784875137c8979cdd | https://github.com/devp-eu/tmcms-core/blob/b031af5643b6dc641539847784875137c8979cdd/src/App/Frontend.php#L178-L204 |
187,017 | devp-eu/tmcms-core | src/App/Frontend.php | Frontend.replaceElements | private function replaceElements($elements, $res)
{
$replaces = [];
// Some components may be disabled for current page
$disabled_components = Structure::getDisabledComponents();
$cached_components = Structure::getCachedComponents();
$cacher = Cacher::getInstance()->getDefa... | php | private function replaceElements($elements, $res)
{
$replaces = [];
// Some components may be disabled for current page
$disabled_components = Structure::getDisabledComponents();
$cached_components = Structure::getCachedComponents();
$cacher = Cacher::getInstance()->getDefa... | [
"private",
"function",
"replaceElements",
"(",
"$",
"elements",
",",
"$",
"res",
")",
"{",
"$",
"replaces",
"=",
"[",
"]",
";",
"// Some components may be disabled for current page",
"$",
"disabled_components",
"=",
"Structure",
"::",
"getDisabledComponents",
"(",
"... | Replaces component parts with it's real data set in admin panel
@param array $elements
@param array $res | [
"Replaces",
"component",
"parts",
"with",
"it",
"s",
"real",
"data",
"set",
"in",
"admin",
"panel"
] | b031af5643b6dc641539847784875137c8979cdd | https://github.com/devp-eu/tmcms-core/blob/b031af5643b6dc641539847784875137c8979cdd/src/App/Frontend.php#L241-L285 |
187,018 | devp-eu/tmcms-core | src/App/Frontend.php | Frontend.callReplace | private function callReplace($component)
{
ob_start();
// Get component from Controller
if ($component['file'] == 'plugin') {
// Reusable plugin found in placeholder
$selected_plugin_file = Plugin::getSelectedPluginValue($component['class']);
if ($selec... | php | private function callReplace($component)
{
ob_start();
// Get component from Controller
if ($component['file'] == 'plugin') {
// Reusable plugin found in placeholder
$selected_plugin_file = Plugin::getSelectedPluginValue($component['class']);
if ($selec... | [
"private",
"function",
"callReplace",
"(",
"$",
"component",
")",
"{",
"ob_start",
"(",
")",
";",
"// Get component from Controller",
"if",
"(",
"$",
"component",
"[",
"'file'",
"]",
"==",
"'plugin'",
")",
"{",
"// Reusable plugin found in placeholder",
"$",
"sele... | Replace one component value with real data set in admin panel for requested page
No check for file existance in it method - for speeding up processing.
Anyway, you will receive standard php error if requested file is not found.
@param array $component
@return string | [
"Replace",
"one",
"component",
"value",
"with",
"real",
"data",
"set",
"in",
"admin",
"panel",
"for",
"requested",
"page",
"No",
"check",
"for",
"file",
"existance",
"in",
"it",
"method",
"-",
"for",
"speeding",
"up",
"processing",
".",
"Anyway",
"you",
"w... | b031af5643b6dc641539847784875137c8979cdd | https://github.com/devp-eu/tmcms-core/blob/b031af5643b6dc641539847784875137c8979cdd/src/App/Frontend.php#L294-L347 |
187,019 | samanix/laranix | src/Laranix/Support/IO/Str/Str.php | Str.format | public static function format(string $string, array $values, $options = null) : string
{
if ($options instanceof Settings) {
$settings = $options;
} elseif (is_array($options)) {
$settings = new Settings($options);
} else {
$settings = new Settings();
... | php | public static function format(string $string, array $values, $options = null) : string
{
if ($options instanceof Settings) {
$settings = $options;
} elseif (is_array($options)) {
$settings = new Settings($options);
} else {
$settings = new Settings();
... | [
"public",
"static",
"function",
"format",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"values",
",",
"$",
"options",
"=",
"null",
")",
":",
"string",
"{",
"if",
"(",
"$",
"options",
"instanceof",
"Settings",
")",
"{",
"$",
"settings",
"=",
"$",
... | Parse string to formatted output.
@param string $string
@param array $values
@param \Laranix\Support\IO\Str\Settings|array $options
@return string | [
"Parse",
"string",
"to",
"formatted",
"output",
"."
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Str/Str.php#L15-L28 |
187,020 | samanix/laranix | src/Laranix/Support/IO/Str/Str.php | Str.parseString | protected static function parseString(string $string, array $values, Settings $options) : string
{
$output = str_replace(array_map(function ($value) use ($options) {
return $options->leftSeparator . $value . $options->rightSeparator;
}, array_keys($values)), array_values($values), $strin... | php | protected static function parseString(string $string, array $values, Settings $options) : string
{
$output = str_replace(array_map(function ($value) use ($options) {
return $options->leftSeparator . $value . $options->rightSeparator;
}, array_keys($values)), array_values($values), $strin... | [
"protected",
"static",
"function",
"parseString",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"values",
",",
"Settings",
"$",
"options",
")",
":",
"string",
"{",
"$",
"output",
"=",
"str_replace",
"(",
"array_map",
"(",
"function",
"(",
"$",
"value",
... | Format the string.
@param string $string
@param array $values
@param \Laranix\Support\IO\Str\Settings $options
@return string | [
"Format",
"the",
"string",
"."
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Support/IO/Str/Str.php#L39-L60 |
187,021 | Rosengate/exedra | Exedra/Application.php | Application.setUp | protected function setUp()
{
$this->services['service']->register(array(
'config' => Config::class,
'routingFactory' => function(){ return new Factory();},
'map' => function() { return $this['routingFactory']->createGroup();},
'request' => function(){ return i... | php | protected function setUp()
{
$this->services['service']->register(array(
'config' => Config::class,
'routingFactory' => function(){ return new Factory();},
'map' => function() { return $this['routingFactory']->createGroup();},
'request' => function(){ return i... | [
"protected",
"function",
"setUp",
"(",
")",
"{",
"$",
"this",
"->",
"services",
"[",
"'service'",
"]",
"->",
"register",
"(",
"array",
"(",
"'config'",
"=>",
"Config",
"::",
"class",
",",
"'routingFactory'",
"=>",
"function",
"(",
")",
"{",
"return",
"ne... | Setup dependency registry. | [
"Setup",
"dependency",
"registry",
"."
] | 61bb6155b3aeeb7edf10e06c2cafceeca8f679d0 | https://github.com/Rosengate/exedra/blob/61bb6155b3aeeb7edf10e06c2cafceeca8f679d0/Exedra/Application.php#L62-L79 |
187,022 | Rosengate/exedra | Exedra/Application.php | Application.request | public function request(ServerRequest $request = null)
{
$finding = $this->map->findByRequest($request = ($request ? : $this->request));
return $this->run($finding);
} | php | public function request(ServerRequest $request = null)
{
$finding = $this->map->findByRequest($request = ($request ? : $this->request));
return $this->run($finding);
} | [
"public",
"function",
"request",
"(",
"ServerRequest",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"finding",
"=",
"$",
"this",
"->",
"map",
"->",
"findByRequest",
"(",
"$",
"request",
"=",
"(",
"$",
"request",
"?",
":",
"$",
"this",
"->",
"request",
... | Execute the http request
And return the context
@param ServerRequest|null $request
@return Runtime\Context
@throws RouteNotFoundException | [
"Execute",
"the",
"http",
"request",
"And",
"return",
"the",
"context"
] | 61bb6155b3aeeb7edf10e06c2cafceeca8f679d0 | https://github.com/Rosengate/exedra/blob/61bb6155b3aeeb7edf10e06c2cafceeca8f679d0/Exedra/Application.php#L128-L133 |
187,023 | Rosengate/exedra | Exedra/Application.php | Application.run | public function run(Finding $finding)
{
/** @var Context $context */
$context = $this->create('runtime.context', array($this, $finding, $this->create('runtime.response')));
// The first call
$response = $context->next($context);
// mutate the context and update the response... | php | public function run(Finding $finding)
{
/** @var Context $context */
$context = $this->create('runtime.context', array($this, $finding, $this->create('runtime.response')));
// The first call
$response = $context->next($context);
// mutate the context and update the response... | [
"public",
"function",
"run",
"(",
"Finding",
"$",
"finding",
")",
"{",
"/** @var Context $context */",
"$",
"context",
"=",
"$",
"this",
"->",
"create",
"(",
"'runtime.context'",
",",
"array",
"(",
"$",
"this",
",",
"$",
"finding",
",",
"$",
"this",
"->",
... | Execute the call stack
@param Finding $finding
@return Context | [
"Execute",
"the",
"call",
"stack"
] | 61bb6155b3aeeb7edf10e06c2cafceeca8f679d0 | https://github.com/Rosengate/exedra/blob/61bb6155b3aeeb7edf10e06c2cafceeca8f679d0/Exedra/Application.php#L140-L159 |
187,024 | Rosengate/exedra | Exedra/Application.php | Application.respond | public function respond(ServerRequest $request)
{
try
{
$response = $this->request($request)
->finalize()
->getResponse();
}
catch(\Exception $e)
{
if($failRoute = $this->failRoute)
{
$respons... | php | public function respond(ServerRequest $request)
{
try
{
$response = $this->request($request)
->finalize()
->getResponse();
}
catch(\Exception $e)
{
if($failRoute = $this->failRoute)
{
$respons... | [
"public",
"function",
"respond",
"(",
"ServerRequest",
"$",
"request",
")",
"{",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"(",
"$",
"request",
")",
"->",
"finalize",
"(",
")",
"->",
"getResponse",
"(",
")",
";",
"}",
"catch",
"... | Dispatch and return the response
Handle uncaught \Exedra\Exception\Exception
@param ServerRequest|null $request
@return Response | [
"Dispatch",
"and",
"return",
"the",
"response",
"Handle",
"uncaught",
"\\",
"Exedra",
"\\",
"Exception",
"\\",
"Exception"
] | 61bb6155b3aeeb7edf10e06c2cafceeca8f679d0 | https://github.com/Rosengate/exedra/blob/61bb6155b3aeeb7edf10e06c2cafceeca8f679d0/Exedra/Application.php#L167-L203 |
187,025 | Rosengate/exedra | Exedra/Application.php | Application.dispatch | public function dispatch(ServerRequest $request = null)
{
$response = $this->respond($request ? : $this->request);
$response->send();
} | php | public function dispatch(ServerRequest $request = null)
{
$response = $this->respond($request ? : $this->request);
$response->send();
} | [
"public",
"function",
"dispatch",
"(",
"ServerRequest",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"respond",
"(",
"$",
"request",
"?",
":",
"$",
"this",
"->",
"request",
")",
";",
"$",
"response",
"->",
"send",
"... | Dispatch and send header
And print the response
@param ServerRequest|null $request | [
"Dispatch",
"and",
"send",
"header",
"And",
"print",
"the",
"response"
] | 61bb6155b3aeeb7edf10e06c2cafceeca8f679d0 | https://github.com/Rosengate/exedra/blob/61bb6155b3aeeb7edf10e06c2cafceeca8f679d0/Exedra/Application.php#L210-L215 |
187,026 | itstructure/yii2-field-widgets | src/TableMultilanguageField.php | TableMultilanguageField.run | public function run(): string
{
if (null === $this->language) {
throw new InvalidConfigException('Language model is not defined.');
}
if (strpos($this->name, '.') !== false) {
$out = $this->getDataByPath($this->name);
} else {
$out = $this->mode... | php | public function run(): string
{
if (null === $this->language) {
throw new InvalidConfigException('Language model is not defined.');
}
if (strpos($this->name, '.') !== false) {
$out = $this->getDataByPath($this->name);
} else {
$out = $this->mode... | [
"public",
"function",
"run",
"(",
")",
":",
"string",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"language",
")",
"{",
"throw",
"new",
"InvalidConfigException",
"(",
"'Language model is not defined.'",
")",
";",
"}",
"if",
"(",
"strpos",
"(",
"$",
... | Returns the translation of the field.
@throws InvalidConfigException
@return string | [
"Returns",
"the",
"translation",
"of",
"the",
"field",
"."
] | 2c21d81ead825a37b986f96d0411785908f3c96e | https://github.com/itstructure/yii2-field-widgets/blob/2c21d81ead825a37b986f96d0411785908f3c96e/src/TableMultilanguageField.php#L76-L91 |
187,027 | itstructure/yii2-field-widgets | src/TableMultilanguageField.php | TableMultilanguageField.getDataByPath | private function getDataByPath($name): string
{
$namePath = explode('.', $name);
$out = $this->model;
for ($i=0; $i < count($namePath); $i++) {
$out = $i+1 < count($namePath) ?
$out->{$namePath[$i]} : $out->{$namePath[$i].'_'.$this->language->getShortName()};
... | php | private function getDataByPath($name): string
{
$namePath = explode('.', $name);
$out = $this->model;
for ($i=0; $i < count($namePath); $i++) {
$out = $i+1 < count($namePath) ?
$out->{$namePath[$i]} : $out->{$namePath[$i].'_'.$this->language->getShortName()};
... | [
"private",
"function",
"getDataByPath",
"(",
"$",
"name",
")",
":",
"string",
"{",
"$",
"namePath",
"=",
"explode",
"(",
"'.'",
",",
"$",
"name",
")",
";",
"$",
"out",
"=",
"$",
"this",
"->",
"model",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"... | Obtaining a field translation of another model along a given path through a series
of entities, separated by a point.
@param $name string, separated by dot.
@return string | [
"Obtaining",
"a",
"field",
"translation",
"of",
"another",
"model",
"along",
"a",
"given",
"path",
"through",
"a",
"series",
"of",
"entities",
"separated",
"by",
"a",
"point",
"."
] | 2c21d81ead825a37b986f96d0411785908f3c96e | https://github.com/itstructure/yii2-field-widgets/blob/2c21d81ead825a37b986f96d0411785908f3c96e/src/TableMultilanguageField.php#L101-L121 |
187,028 | devp-eu/tmcms-core | src/assets/tinymce/plugins/moxiecut/phpzip.inc.php | PHPZip.addFile | function addFile($data, $name, $time = 0)
{
$name = str_replace('\\', '/', $name);
$dtime = dechex($this->unix2DosTime($time));
$hexdtime = '\x' . $dtime[6] . $dtime[7]
. '\x' . $dtime[4] . $dtime[5]
. '\x' . $dtime[2] . $dtime[3]
... | php | function addFile($data, $name, $time = 0)
{
$name = str_replace('\\', '/', $name);
$dtime = dechex($this->unix2DosTime($time));
$hexdtime = '\x' . $dtime[6] . $dtime[7]
. '\x' . $dtime[4] . $dtime[5]
. '\x' . $dtime[2] . $dtime[3]
... | [
"function",
"addFile",
"(",
"$",
"data",
",",
"$",
"name",
",",
"$",
"time",
"=",
"0",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"name",
")",
";",
"$",
"dtime",
"=",
"dechex",
"(",
"$",
"this",
"->",
"unix2... | Adds "file" to archive
@param string file contents
@param string name of the file in the archive (may contains the path)
@param integer the current timestamp
@access public | [
"Adds",
"file",
"to",
"archive"
] | b031af5643b6dc641539847784875137c8979cdd | https://github.com/devp-eu/tmcms-core/blob/b031af5643b6dc641539847784875137c8979cdd/src/assets/tinymce/plugins/moxiecut/phpzip.inc.php#L126-L194 |
187,029 | devp-eu/tmcms-core | src/assets/tinymce/plugins/moxiecut/phpzip.inc.php | PHPZip.file | function file()
{
$data = implode('', $this -> datasec);
$ctrldir = implode('', $this -> ctrl_dir);
return
$data .
$ctrldir .
$this -> eof_ctrl_dir .
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk"
p... | php | function file()
{
$data = implode('', $this -> datasec);
$ctrldir = implode('', $this -> ctrl_dir);
return
$data .
$ctrldir .
$this -> eof_ctrl_dir .
pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk"
p... | [
"function",
"file",
"(",
")",
"{",
"$",
"data",
"=",
"implode",
"(",
"''",
",",
"$",
"this",
"->",
"datasec",
")",
";",
"$",
"ctrldir",
"=",
"implode",
"(",
"''",
",",
"$",
"this",
"->",
"ctrl_dir",
")",
";",
"return",
"$",
"data",
".",
"$",
"c... | Dumps out file
@return string the zipped file
@access public | [
"Dumps",
"out",
"file"
] | b031af5643b6dc641539847784875137c8979cdd | https://github.com/devp-eu/tmcms-core/blob/b031af5643b6dc641539847784875137c8979cdd/src/assets/tinymce/plugins/moxiecut/phpzip.inc.php#L204-L218 |
187,030 | localheinz/classy | src/Exception/DirectoryDoesNotExist.php | DirectoryDoesNotExist.fromDirectory | public static function fromDirectory(string $directory): self
{
$exception = new self(\sprintf(
'Directory "%s" does not exist.',
$directory
));
$exception->directory = $directory;
return $exception;
} | php | public static function fromDirectory(string $directory): self
{
$exception = new self(\sprintf(
'Directory "%s" does not exist.',
$directory
));
$exception->directory = $directory;
return $exception;
} | [
"public",
"static",
"function",
"fromDirectory",
"(",
"string",
"$",
"directory",
")",
":",
"self",
"{",
"$",
"exception",
"=",
"new",
"self",
"(",
"\\",
"sprintf",
"(",
"'Directory \"%s\" does not exist.'",
",",
"$",
"directory",
")",
")",
";",
"$",
"except... | Returns a new exception from a directory.
@param string $directory
@return self | [
"Returns",
"a",
"new",
"exception",
"from",
"a",
"directory",
"."
] | 71c03b6bd9411be6e85d571dfe9558cd464052bc | https://github.com/localheinz/classy/blob/71c03b6bd9411be6e85d571dfe9558cd464052bc/src/Exception/DirectoryDoesNotExist.php#L30-L40 |
187,031 | praxigento/mobi_mod_warehouse | Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Collection.aroundAddAttributeToSelect | public function aroundAddAttributeToSelect(
\Magento\Catalog\Model\ResourceModel\Product\Collection $subject,
\Closure $proceed,
$attribute,
$joinType = false
) {
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $result */
$result = $proceed($attribute... | php | public function aroundAddAttributeToSelect(
\Magento\Catalog\Model\ResourceModel\Product\Collection $subject,
\Closure $proceed,
$attribute,
$joinType = false
) {
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $result */
$result = $proceed($attribute... | [
"public",
"function",
"aroundAddAttributeToSelect",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Product",
"\\",
"Collection",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"$",
"attribute",
",",
"$",
"joinTy... | Add warehouse price to product collection if 'price' attribute is added to select.
Add warehouse group price to product collection if 'special_price' attribute is added to select.
@param \Magento\Catalog\Model\ResourceModel\Product\Collection $subject
@param \Closure $proceed
@param array $attribute
@param bool|string... | [
"Add",
"warehouse",
"price",
"to",
"product",
"collection",
"if",
"price",
"attribute",
"is",
"added",
"to",
"select",
".",
"Add",
"warehouse",
"group",
"price",
"to",
"product",
"collection",
"if",
"special_price",
"attribute",
"is",
"added",
"to",
"select",
... | 9529bd1c8c41a383c2ea1c326594ef2137999063 | https://github.com/praxigento/mobi_mod_warehouse/blob/9529bd1c8c41a383c2ea1c326594ef2137999063/Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php#L51-L67 |
187,032 | praxigento/mobi_mod_warehouse | Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Collection.aroundGetSelectCountSql | public function aroundGetSelectCountSql(
\Magento\Catalog\Model\ResourceModel\Product\Collection $subject,
\Closure $proceed
) {
/** @var \Magento\Framework\DB\Select $result */
$result = $proceed();
$result->reset(\Zend_Db_Select::GROUP);
return $result;
} | php | public function aroundGetSelectCountSql(
\Magento\Catalog\Model\ResourceModel\Product\Collection $subject,
\Closure $proceed
) {
/** @var \Magento\Framework\DB\Select $result */
$result = $proceed();
$result->reset(\Zend_Db_Select::GROUP);
return $result;
} | [
"public",
"function",
"aroundGetSelectCountSql",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Product",
"\\",
"Collection",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
")",
"{",
"/** @var \\Magento\\Framework\\DB\\Sel... | Remove group clause to get total count in adminhtml grid.
@param \Magento\Catalog\Model\ResourceModel\Product\Collection $subject
@param \Closure $proceed
@return \Magento\Framework\DB\Select | [
"Remove",
"group",
"clause",
"to",
"get",
"total",
"count",
"in",
"adminhtml",
"grid",
"."
] | 9529bd1c8c41a383c2ea1c326594ef2137999063 | https://github.com/praxigento/mobi_mod_warehouse/blob/9529bd1c8c41a383c2ea1c326594ef2137999063/Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php#L128-L136 |
187,033 | praxigento/mobi_mod_warehouse | Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Collection.queryAddWrhsGroupPrice | private function queryAddWrhsGroupPrice($query)
{
$asCatInv = $this->getAliasForCataloginventoryTbl($query);
if ($asCatInv) {
$scope = $this->scope->getCurrentScope();
/* there is 'cataloginventory_stock_item' table - we can JOIN our tables to get warehouse group price */
... | php | private function queryAddWrhsGroupPrice($query)
{
$asCatInv = $this->getAliasForCataloginventoryTbl($query);
if ($asCatInv) {
$scope = $this->scope->getCurrentScope();
/* there is 'cataloginventory_stock_item' table - we can JOIN our tables to get warehouse group price */
... | [
"private",
"function",
"queryAddWrhsGroupPrice",
"(",
"$",
"query",
")",
"{",
"$",
"asCatInv",
"=",
"$",
"this",
"->",
"getAliasForCataloginventoryTbl",
"(",
"$",
"query",
")",
";",
"if",
"(",
"$",
"asCatInv",
")",
"{",
"$",
"scope",
"=",
"$",
"this",
"-... | Add warehouse group price to query if original query contains attribute 'special_price'.
@param $query | [
"Add",
"warehouse",
"group",
"price",
"to",
"query",
"if",
"original",
"query",
"contains",
"attribute",
"special_price",
"."
] | 9529bd1c8c41a383c2ea1c326594ef2137999063 | https://github.com/praxigento/mobi_mod_warehouse/blob/9529bd1c8c41a383c2ea1c326594ef2137999063/Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php#L176-L196 |
187,034 | praxigento/mobi_mod_warehouse | Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Collection.queryAddWrhsPrice | private function queryAddWrhsPrice($query)
{
$asCatInv = $this->getAliasForCataloginventoryTbl($query);
if ($asCatInv) {
/* there is 'cataloginventory_stock_item' table - we can JOIN our tables to get warehouse price */
/* LEFT JOIN prxgt_wrhs_stock_item */
$tbl ... | php | private function queryAddWrhsPrice($query)
{
$asCatInv = $this->getAliasForCataloginventoryTbl($query);
if ($asCatInv) {
/* there is 'cataloginventory_stock_item' table - we can JOIN our tables to get warehouse price */
/* LEFT JOIN prxgt_wrhs_stock_item */
$tbl ... | [
"private",
"function",
"queryAddWrhsPrice",
"(",
"$",
"query",
")",
"{",
"$",
"asCatInv",
"=",
"$",
"this",
"->",
"getAliasForCataloginventoryTbl",
"(",
"$",
"query",
")",
";",
"if",
"(",
"$",
"asCatInv",
")",
"{",
"/* there is 'cataloginventory_stock_item' table ... | Add warehouse price to query if original query contains attribute 'price'.
@param $query | [
"Add",
"warehouse",
"price",
"to",
"query",
"if",
"original",
"query",
"contains",
"attribute",
"price",
"."
] | 9529bd1c8c41a383c2ea1c326594ef2137999063 | https://github.com/praxigento/mobi_mod_warehouse/blob/9529bd1c8c41a383c2ea1c326594ef2137999063/Plugin/Magento/Catalog/Model/ResourceModel/Product/Collection.php#L203-L215 |
187,035 | RockPhp/PhpWsdl | src/Rock/PhpWsdl/class.soapdemo.php | SoapDemo.ComplexTypeArrayDemo | public function ComplexTypeArrayDemo($arr){
$res=Array();
$i=-1;
$len=sizeof($arr);
while(++$i<$len)
$res[]=$this->PrintVariable($arr[$i]);
return $res;
} | php | public function ComplexTypeArrayDemo($arr){
$res=Array();
$i=-1;
$len=sizeof($arr);
while(++$i<$len)
$res[]=$this->PrintVariable($arr[$i]);
return $res;
} | [
"public",
"function",
"ComplexTypeArrayDemo",
"(",
"$",
"arr",
")",
"{",
"$",
"res",
"=",
"Array",
"(",
")",
";",
"$",
"i",
"=",
"-",
"1",
";",
"$",
"len",
"=",
"sizeof",
"(",
"$",
"arr",
")",
";",
"while",
"(",
"++",
"$",
"i",
"<",
"$",
"len... | Print an array of objects
@param ComplexTypeDemoArray $arr A ComplexTypeDemo array
@return stringArray The results of print_r | [
"Print",
"an",
"array",
"of",
"objects"
] | b2f9da7a8c3ce50b26032ff2fd9cfe081dee9f73 | https://github.com/RockPhp/PhpWsdl/blob/b2f9da7a8c3ce50b26032ff2fd9cfe081dee9f73/src/Rock/PhpWsdl/class.soapdemo.php#L37-L44 |
187,036 | RockPhp/PhpWsdl | src/Rock/PhpWsdl/class.soapdemo.php | SoapDemo.SayHello | public function SayHello($name=null){
$name=utf8_decode($name);// Because a string parameter may be UTF-8 encoded...
if($name=='')
$name='unknown';
return utf8_encode('Hello '.$name.'!');// Because a string return value should by UTF-8 encoded...
} | php | public function SayHello($name=null){
$name=utf8_decode($name);// Because a string parameter may be UTF-8 encoded...
if($name=='')
$name='unknown';
return utf8_encode('Hello '.$name.'!');// Because a string return value should by UTF-8 encoded...
} | [
"public",
"function",
"SayHello",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"utf8_decode",
"(",
"$",
"name",
")",
";",
"// Because a string parameter may be UTF-8 encoded...\r",
"if",
"(",
"$",
"name",
"==",
"''",
")",
"$",
"name",
"=",
"'... | Say hello demo
@param string $name Some name (or an empty string)
@return string Response string | [
"Say",
"hello",
"demo"
] | b2f9da7a8c3ce50b26032ff2fd9cfe081dee9f73 | https://github.com/RockPhp/PhpWsdl/blob/b2f9da7a8c3ce50b26032ff2fd9cfe081dee9f73/src/Rock/PhpWsdl/class.soapdemo.php#L52-L57 |
187,037 | wbgym/school-bundle | src/Resources/contao/classes/WBGymEmail.php | WBGymEmail.contentReplaceTags | public function contentReplaceTags(array $arrSearchAndReplace)
{
foreach ($arrSearchAndReplace as $key => $value) {
$arrSearchAndReplace['{{'.$key.'}}'] = $value;
unset($arrSearchAndReplace[$key]);
}
$this->contentReplace($arrSearchAndReplace);
} | php | public function contentReplaceTags(array $arrSearchAndReplace)
{
foreach ($arrSearchAndReplace as $key => $value) {
$arrSearchAndReplace['{{'.$key.'}}'] = $value;
unset($arrSearchAndReplace[$key]);
}
$this->contentReplace($arrSearchAndReplace);
} | [
"public",
"function",
"contentReplaceTags",
"(",
"array",
"$",
"arrSearchAndReplace",
")",
"{",
"foreach",
"(",
"$",
"arrSearchAndReplace",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"arrSearchAndReplace",
"[",
"'{{'",
".",
"$",
"key",
".",
"'}}'",... | replace the named-tags of @param $arrSearchAndReplace with their associative values.
@param array $arrSearchAndReplace array of tag => value
@return void | [
"replace",
"the",
"named",
"-",
"tags",
"of"
] | a1ee3d1702e554adc0b80a5a714bc4f938816a1e | https://github.com/wbgym/school-bundle/blob/a1ee3d1702e554adc0b80a5a714bc4f938816a1e/src/Resources/contao/classes/WBGymEmail.php#L114-L121 |
187,038 | JanHuang/framework | src/Framework/Bundle/Commands/RouteDumpCommand.php | RouteDumpCommand.formatOutput | public function formatOutput(Route $route, Output $output, $type = self::STYLE_DETAIL)
{
switch ($type) {
case self::STYLE_DETAIL:
$output->write('Route [');
$output->write('<success>"' . $route->getName() . '"</success>');
$output->writeln(']');
... | php | public function formatOutput(Route $route, Output $output, $type = self::STYLE_DETAIL)
{
switch ($type) {
case self::STYLE_DETAIL:
$output->write('Route [');
$output->write('<success>"' . $route->getName() . '"</success>');
$output->writeln(']');
... | [
"public",
"function",
"formatOutput",
"(",
"Route",
"$",
"route",
",",
"Output",
"$",
"output",
",",
"$",
"type",
"=",
"self",
"::",
"STYLE_DETAIL",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"STYLE_DETAIL",
":",
"$",
"output... | Format route output to command line.
@param Route $route
@param Output $output
@param $type | [
"Format",
"route",
"output",
"to",
"command",
"line",
"."
] | 60532068958405dbc82e1dd117c499d16dbf57c3 | https://github.com/JanHuang/framework/blob/60532068958405dbc82e1dd117c499d16dbf57c3/src/Framework/Bundle/Commands/RouteDumpCommand.php#L152-L181 |
187,039 | PayUMEA/payu-mea-sdk-php | lib/PayU/Api/Request.php | Request.parseForEnterpriseAPI | public function parseForEnterpriseAPI(ResourceModel $resource)
{
$this->initDefaultParams($resource);
$this->parseRedirectUrls($resource);
$this->parseCustomerInformation($resource);
$this->parseCreditCardInformation($resource);
$this->parseRealTimeRecurringEnterprise($re... | php | public function parseForEnterpriseAPI(ResourceModel $resource)
{
$this->initDefaultParams($resource);
$this->parseRedirectUrls($resource);
$this->parseCustomerInformation($resource);
$this->parseCreditCardInformation($resource);
$this->parseRealTimeRecurringEnterprise($re... | [
"public",
"function",
"parseForEnterpriseAPI",
"(",
"ResourceModel",
"$",
"resource",
")",
"{",
"$",
"this",
"->",
"initDefaultParams",
"(",
"$",
"resource",
")",
";",
"$",
"this",
"->",
"parseRedirectUrls",
"(",
"$",
"resource",
")",
";",
"$",
"this",
"->",... | Parse a Payment resource into a request payload
@param ResourceModel $resource the payment resource
@return array $payload transaction payload for Enterprise API request | [
"Parse",
"a",
"Payment",
"resource",
"into",
"a",
"request",
"payload"
] | ebfcd99303cc424458732da8e1771edff843e437 | https://github.com/PayUMEA/payu-mea-sdk-php/blob/ebfcd99303cc424458732da8e1771edff843e437/lib/PayU/Api/Request.php#L39-L65 |
187,040 | PayUMEA/payu-mea-sdk-php | lib/PayU/Api/Request.php | Request.parseForRedirectAPI | public function parseForRedirectAPI(ResourceModel $resource)
{
$this->initDefaultParams($resource);
$this->parseRedirectUrls($resource);
$this->parseCustomerInformation($resource);
$this->parseFraudManagementParams($resource);
$this->parseTransactionRecord($resource);
... | php | public function parseForRedirectAPI(ResourceModel $resource)
{
$this->initDefaultParams($resource);
$this->parseRedirectUrls($resource);
$this->parseCustomerInformation($resource);
$this->parseFraudManagementParams($resource);
$this->parseTransactionRecord($resource);
... | [
"public",
"function",
"parseForRedirectAPI",
"(",
"ResourceModel",
"$",
"resource",
")",
"{",
"$",
"this",
"->",
"initDefaultParams",
"(",
"$",
"resource",
")",
";",
"$",
"this",
"->",
"parseRedirectUrls",
"(",
"$",
"resource",
")",
";",
"$",
"this",
"->",
... | Parse a Redirect resource into a request payload
@param ResourceModel $resource the payment resource
@return array $payload transaction payload for Redirect API request | [
"Parse",
"a",
"Redirect",
"resource",
"into",
"a",
"request",
"payload"
] | ebfcd99303cc424458732da8e1771edff843e437 | https://github.com/PayUMEA/payu-mea-sdk-php/blob/ebfcd99303cc424458732da8e1771edff843e437/lib/PayU/Api/Request.php#L503-L521 |
187,041 | PayUMEA/payu-mea-sdk-php | lib/PayU/Api/Request.php | Request.parseReserveResource | public function parseReserveResource(ResourceModel $resource)
{
$intent = $resource->getIntent();
$customer = $resource->getCustomer();
$transaction = $resource->getTransaction();
$amount = $transaction->getAmount();
$total = Formatter::formatToInteger($amount->getTotal());
... | php | public function parseReserveResource(ResourceModel $resource)
{
$intent = $resource->getIntent();
$customer = $resource->getCustomer();
$transaction = $resource->getTransaction();
$amount = $transaction->getAmount();
$total = Formatter::formatToInteger($amount->getTotal());
... | [
"public",
"function",
"parseReserveResource",
"(",
"ResourceModel",
"$",
"resource",
")",
"{",
"$",
"intent",
"=",
"$",
"resource",
"->",
"getIntent",
"(",
")",
";",
"$",
"customer",
"=",
"$",
"resource",
"->",
"getCustomer",
"(",
")",
";",
"$",
"transacti... | Parse a resource for void, credit, and capture transactions
@param ResourceModel $resource the payment resource
@return array $payload transaction payload for SOAP API request | [
"Parse",
"a",
"resource",
"for",
"void",
"credit",
"and",
"capture",
"transactions"
] | ebfcd99303cc424458732da8e1771edff843e437 | https://github.com/PayUMEA/payu-mea-sdk-php/blob/ebfcd99303cc424458732da8e1771edff843e437/lib/PayU/Api/Request.php#L552-L587 |
187,042 | samanix/laranix | src/Laranix/Tracker/Tracker.php | Tracker.getRenderedDataAttribute | public function getRenderedDataAttribute() : ?string
{
if ($this->renderedData !== null) {
return $this->renderedData;
}
if ($this->config->get('tracker.save_rendered', true) &&
($rendered = $this->getAttributeFromArray('data_rendered')) !== null) {
retur... | php | public function getRenderedDataAttribute() : ?string
{
if ($this->renderedData !== null) {
return $this->renderedData;
}
if ($this->config->get('tracker.save_rendered', true) &&
($rendered = $this->getAttributeFromArray('data_rendered')) !== null) {
retur... | [
"public",
"function",
"getRenderedDataAttribute",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"renderedData",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"renderedData",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"config",
"... | Get rendered data
@return null|string | [
"Get",
"rendered",
"data"
] | 6dfc0b341657e0429f2629e91a469bc6203af3a1 | https://github.com/samanix/laranix/blob/6dfc0b341657e0429f2629e91a469bc6203af3a1/src/Laranix/Tracker/Tracker.php#L134-L150 |
187,043 | GetOlympus/Zeus-Core | src/Zeus/Render/Controller/Render.php | Render.assets | public static function assets($currentPage, $fields)
{
global $pagenow;
// Check current page
if (empty($fields) || !in_array($pagenow, $currentPage)) {
return;
}
$assets = [
'scripts' => [],
'styles' => [],
];
/**
... | php | public static function assets($currentPage, $fields)
{
global $pagenow;
// Check current page
if (empty($fields) || !in_array($pagenow, $currentPage)) {
return;
}
$assets = [
'scripts' => [],
'styles' => [],
];
/**
... | [
"public",
"static",
"function",
"assets",
"(",
"$",
"currentPage",
",",
"$",
"fields",
")",
"{",
"global",
"$",
"pagenow",
";",
"// Check current page",
"if",
"(",
"empty",
"(",
"$",
"fields",
")",
"||",
"!",
"in_array",
"(",
"$",
"pagenow",
",",
"$",
... | Render assets on asked page.
@param array $currentPage
@param array $fields | [
"Render",
"assets",
"on",
"asked",
"page",
"."
] | 2bdee751e8fcf8ed082080ddcd198855631720ff | https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Render/Controller/Render.php#L171-L238 |
187,044 | GetOlympus/Zeus-Core | src/Zeus/Render/Controller/Render.php | Render.assetsInCache | public static function assetsInCache($source, $filename)
{
$dest = OL_ZEUS_DISTPATH.$filename;
// Create file
if (!file_exists($dest)) {
$ctns = file_exists($source) ? file_get_contents($source) : '';
Helpers::filePutContents($dest, $ctns, 'This file has been auto-ge... | php | public static function assetsInCache($source, $filename)
{
$dest = OL_ZEUS_DISTPATH.$filename;
// Create file
if (!file_exists($dest)) {
$ctns = file_exists($source) ? file_get_contents($source) : '';
Helpers::filePutContents($dest, $ctns, 'This file has been auto-ge... | [
"public",
"static",
"function",
"assetsInCache",
"(",
"$",
"source",
",",
"$",
"filename",
")",
"{",
"$",
"dest",
"=",
"OL_ZEUS_DISTPATH",
".",
"$",
"filename",
";",
"// Create file",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"dest",
")",
")",
"{",
"$",
... | Create temporary asset accessible file.
@param string $source
@param string $filename | [
"Create",
"temporary",
"asset",
"accessible",
"file",
"."
] | 2bdee751e8fcf8ed082080ddcd198855631720ff | https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Render/Controller/Render.php#L246-L255 |
187,045 | GetOlympus/Zeus-Core | src/Zeus/Render/Controller/Render.php | Render.view | public static function view($template, $vars, $context = 'core')
{
// Display template
echo self::getInstance()->twig->render('@'.$context.'/'.$template, $vars);
} | php | public static function view($template, $vars, $context = 'core')
{
// Display template
echo self::getInstance()->twig->render('@'.$context.'/'.$template, $vars);
} | [
"public",
"static",
"function",
"view",
"(",
"$",
"template",
",",
"$",
"vars",
",",
"$",
"context",
"=",
"'core'",
")",
"{",
"// Display template",
"echo",
"self",
"::",
"getInstance",
"(",
")",
"->",
"twig",
"->",
"render",
"(",
"'@'",
".",
"$",
"con... | Render TWIG component.
@param string $template
@param array $vars
@param string $context | [
"Render",
"TWIG",
"component",
"."
] | 2bdee751e8fcf8ed082080ddcd198855631720ff | https://github.com/GetOlympus/Zeus-Core/blob/2bdee751e8fcf8ed082080ddcd198855631720ff/src/Zeus/Render/Controller/Render.php#L264-L268 |
187,046 | shcloudservices/guzzle-openstack | src/Guzzle/Openstack/Common/AuthenticationObserver.php | AuthenticationObserver.onRequestCreate | public function onRequestCreate(Event $event)
{
$client = $event['client'];
$token = $client->getToken();
$event['request']->setHeader('X-Auth-Token', $token);
} | php | public function onRequestCreate(Event $event)
{
$client = $event['client'];
$token = $client->getToken();
$event['request']->setHeader('X-Auth-Token', $token);
} | [
"public",
"function",
"onRequestCreate",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"client",
"=",
"$",
"event",
"[",
"'client'",
"]",
";",
"$",
"token",
"=",
"$",
"client",
"->",
"getToken",
"(",
")",
";",
"$",
"event",
"[",
"'request'",
"]",
"->",
... | Add authentication token as a header for requests
@param Event $event | [
"Add",
"authentication",
"token",
"as",
"a",
"header",
"for",
"requests"
] | 02c3183e822765b258f5d5815752e53d90f9865d | https://github.com/shcloudservices/guzzle-openstack/blob/02c3183e822765b258f5d5815752e53d90f9865d/src/Guzzle/Openstack/Common/AuthenticationObserver.php#L29-L35 |
187,047 | shcloudservices/guzzle-openstack | src/Guzzle/Openstack/Common/AuthenticationObserver.php | AuthenticationObserver.onClientCommandCreate | public function onClientCommandCreate(\Guzzle\Common\Event $event)
{
$command = $event['command'];
if(get_class($command) != 'Guzzle\Openstack\Identity\Command\Authenticate'){
if($event['client']->getToken() == null){
throw new OpenstackException('Unauthenticated');
... | php | public function onClientCommandCreate(\Guzzle\Common\Event $event)
{
$command = $event['command'];
if(get_class($command) != 'Guzzle\Openstack\Identity\Command\Authenticate'){
if($event['client']->getToken() == null){
throw new OpenstackException('Unauthenticated');
... | [
"public",
"function",
"onClientCommandCreate",
"(",
"\\",
"Guzzle",
"\\",
"Common",
"\\",
"Event",
"$",
"event",
")",
"{",
"$",
"command",
"=",
"$",
"event",
"[",
"'command'",
"]",
";",
"if",
"(",
"get_class",
"(",
"$",
"command",
")",
"!=",
"'Guzzle\\Op... | Check the client authentication token for all commands except authentication
@param Event $event | [
"Check",
"the",
"client",
"authentication",
"token",
"for",
"all",
"commands",
"except",
"authentication"
] | 02c3183e822765b258f5d5815752e53d90f9865d | https://github.com/shcloudservices/guzzle-openstack/blob/02c3183e822765b258f5d5815752e53d90f9865d/src/Guzzle/Openstack/Common/AuthenticationObserver.php#L42-L50 |
187,048 | GoIntegro/raml | DocExpander.php | DocExpander.expand | public function expand(RamlDoc $ramlDoc)
{
$ramlDoc->rawRaml = self::applyAllToTree($ramlDoc, $ramlDoc->rawRaml);
return $this;
} | php | public function expand(RamlDoc $ramlDoc)
{
$ramlDoc->rawRaml = self::applyAllToTree($ramlDoc, $ramlDoc->rawRaml);
return $this;
} | [
"public",
"function",
"expand",
"(",
"RamlDoc",
"$",
"ramlDoc",
")",
"{",
"$",
"ramlDoc",
"->",
"rawRaml",
"=",
"self",
"::",
"applyAllToTree",
"(",
"$",
"ramlDoc",
",",
"$",
"ramlDoc",
"->",
"rawRaml",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Applies resource types and traits.
@param RamlDoc $ramlDoc
@throws \ErrorException
@see http://raml.org/spec.html#resource-types-and-traits | [
"Applies",
"resource",
"types",
"and",
"traits",
"."
] | 97d72f70911b1986e62faf43fe63435497f61af9 | https://github.com/GoIntegro/raml/blob/97d72f70911b1986e62faf43fe63435497f61af9/DocExpander.php#L21-L26 |
187,049 | GoIntegro/raml | DocExpander.php | DocExpander.applyAllToTree | private static function applyAllToTree(
RamlDoc $ramlDoc, array &$item, $itemKey = NULL
)
{
if (
RamlDoc::isValidMethod($itemKey)
&& !empty($item[RamlSpec::PROPERTY_APPLY_TRAITS])
) {
$item = self::applyTraitsToNode(
$ramlDoc, $item, $i... | php | private static function applyAllToTree(
RamlDoc $ramlDoc, array &$item, $itemKey = NULL
)
{
if (
RamlDoc::isValidMethod($itemKey)
&& !empty($item[RamlSpec::PROPERTY_APPLY_TRAITS])
) {
$item = self::applyTraitsToNode(
$ramlDoc, $item, $i... | [
"private",
"static",
"function",
"applyAllToTree",
"(",
"RamlDoc",
"$",
"ramlDoc",
",",
"array",
"&",
"$",
"item",
",",
"$",
"itemKey",
"=",
"NULL",
")",
"{",
"if",
"(",
"RamlDoc",
"::",
"isValidMethod",
"(",
"$",
"itemKey",
")",
"&&",
"!",
"empty",
"(... | Actually applies resource types and traits.
@param RamlDoc $ramlDoc
@param array &$item
@throws \ErrorException
@see http://raml.org/spec.html#resource-types-and-traits | [
"Actually",
"applies",
"resource",
"types",
"and",
"traits",
"."
] | 97d72f70911b1986e62faf43fe63435497f61af9 | https://github.com/GoIntegro/raml/blob/97d72f70911b1986e62faf43fe63435497f61af9/DocExpander.php#L35-L74 |
187,050 | nyroDev/UtilityBundle | Form/Extension/FileTypeExtension.php | FileTypeExtension.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$data = $form->getParent()->getData();
if ($options['currentFile'] || $data instanceof AbstractUploadable) {
try {
$currentFile = isset($options['currentFile']) && $options['currentFile'] ? $... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$data = $form->getParent()->getData();
if ($options['currentFile'] || $data instanceof AbstractUploadable) {
try {
$currentFile = isset($options['currentFile']) && $options['currentFile'] ? $... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"data",
"=",
"$",
"form",
"->",
"getParent",
"(",
")",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"$",
... | Pass the image URL to the view.
@param FormView $view
@param FormInterface $form
@param array $options | [
"Pass",
"the",
"image",
"URL",
"to",
"the",
"view",
"."
] | 666ed5da2d2c906a55425ce38d31e9c5a27ab33a | https://github.com/nyroDev/UtilityBundle/blob/666ed5da2d2c906a55425ce38d31e9c5a27ab33a/Form/Extension/FileTypeExtension.php#L38-L55 |
187,051 | kuria/cache | src/Psr/CacheItem.php | CacheItem.getTtl | function getTtl(): ?int
{
if (is_int($this->expiration)) {
return $this->expiration;
}
if ($this->expiration instanceof \DateTimeInterface) {
return $this->expiration->getTimestamp() - Clock::time();
}
if ($this->expiration instanceof \DateInterval) ... | php | function getTtl(): ?int
{
if (is_int($this->expiration)) {
return $this->expiration;
}
if ($this->expiration instanceof \DateTimeInterface) {
return $this->expiration->getTimestamp() - Clock::time();
}
if ($this->expiration instanceof \DateInterval) ... | [
"function",
"getTtl",
"(",
")",
":",
"?",
"int",
"{",
"if",
"(",
"is_int",
"(",
"$",
"this",
"->",
"expiration",
")",
")",
"{",
"return",
"$",
"this",
"->",
"expiration",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"expiration",
"instanceof",
"\\",
"Da... | Internal. Do not use.
@internal | [
"Internal",
".",
"Do",
"not",
"use",
"."
] | dab235bf7da798304a2c4133dd871f9cae6d952b | https://github.com/kuria/cache/blob/dab235bf7da798304a2c4133dd871f9cae6d952b/src/Psr/CacheItem.php#L76-L91 |
187,052 | sndsgd/util | src/Sometimes.php | Sometimes.isEnabled | public function isEnabled(
float $percentage,
string $value = "",
string $salt = ""
): bool
{
if ($percentage <= 0) {
return false;
}
if ($percentage >= 100) {
return true;
}
if ($value === "" && $salt === "") {
... | php | public function isEnabled(
float $percentage,
string $value = "",
string $salt = ""
): bool
{
if ($percentage <= 0) {
return false;
}
if ($percentage >= 100) {
return true;
}
if ($value === "" && $salt === "") {
... | [
"public",
"function",
"isEnabled",
"(",
"float",
"$",
"percentage",
",",
"string",
"$",
"value",
"=",
"\"\"",
",",
"string",
"$",
"salt",
"=",
"\"\"",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"percentage",
"<=",
"0",
")",
"{",
"return",
"false",
";",
... | Determine whether something is 'on' for a desired percentage of calls
@param float $percentage The percentage value ranging from 0 to 100
@param string $value An optional value to produce consistent results
@param string $salt An optional salt for even distribution across values
@return bool | [
"Determine",
"whether",
"something",
"is",
"on",
"for",
"a",
"desired",
"percentage",
"of",
"calls"
] | 17156301515d0747d34ccb802729f8a2cdf0e4ea | https://github.com/sndsgd/util/blob/17156301515d0747d34ccb802729f8a2cdf0e4ea/src/Sometimes.php#L15-L38 |
187,053 | koolkode/k1 | src/K1.php | K1.run | public static function run(App $app, ?Config $config = null): void
{
\ini_set('display_errors', '0');
\ini_set('html_errors', '0');
$k1 = new static($config);
$k1->runApp($app);
} | php | public static function run(App $app, ?Config $config = null): void
{
\ini_set('display_errors', '0');
\ini_set('html_errors', '0');
$k1 = new static($config);
$k1->runApp($app);
} | [
"public",
"static",
"function",
"run",
"(",
"App",
"$",
"app",
",",
"?",
"Config",
"$",
"config",
"=",
"null",
")",
":",
"void",
"{",
"\\",
"ini_set",
"(",
"'display_errors'",
",",
"'0'",
")",
";",
"\\",
"ini_set",
"(",
"'html_errors'",
",",
"'0'",
"... | Run K1 eighter serving the given resource or in console mode if launched from command line.
@param App $app An object implementing Resource or the fully-qualified name of a routed class.
@param Config $config K1 system configuration object. | [
"Run",
"K1",
"eighter",
"serving",
"the",
"given",
"resource",
"or",
"in",
"console",
"mode",
"if",
"launched",
"from",
"command",
"line",
"."
] | 5b21df0ef7b0b53ded72157855ab2bc2fb398538 | https://github.com/koolkode/k1/blob/5b21df0ef7b0b53ded72157855ab2bc2fb398538/src/K1.php#L51-L58 |
187,054 | poliander/janeiro | src/Janeiro/Loader.php | Loader.add | public function add($prefix, $dir, $prepend = false)
{
$prefix = trim($prefix, '\\') . '\\';
$dir = rtrim($dir, DIRECTORY_SEPARATOR) . '/';
if (isset($this->prefixes[$prefix]) === false) {
$this->prefixes[$prefix] = [];
}
if ($prepend) {
array_unshif... | php | public function add($prefix, $dir, $prepend = false)
{
$prefix = trim($prefix, '\\') . '\\';
$dir = rtrim($dir, DIRECTORY_SEPARATOR) . '/';
if (isset($this->prefixes[$prefix]) === false) {
$this->prefixes[$prefix] = [];
}
if ($prepend) {
array_unshif... | [
"public",
"function",
"add",
"(",
"$",
"prefix",
",",
"$",
"dir",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"$",
"prefix",
"=",
"trim",
"(",
"$",
"prefix",
",",
"'\\\\'",
")",
".",
"'\\\\'",
";",
"$",
"dir",
"=",
"rtrim",
"(",
"$",
"dir",
",... | Add a base directory for a given namespace prefix
@param string $prefix
@param string $dir
@param bool $prepend
@return self | [
"Add",
"a",
"base",
"directory",
"for",
"a",
"given",
"namespace",
"prefix"
] | 94cffda06eff58fb09a9d3bf907ab3163ce3a090 | https://github.com/poliander/janeiro/blob/94cffda06eff58fb09a9d3bf907ab3163ce3a090/src/Janeiro/Loader.php#L33-L49 |
187,055 | poliander/janeiro | src/Janeiro/Loader.php | Loader.resolve | public function resolve($class)
{
$result = false;
$prefix = $class;
while (false !== ($pos = strrpos($prefix, '\\'))) {
$prefix = substr($class, 0, $pos + 1);
if (isset($this->prefixes[$prefix])) {
$result = $this->resolveFilename($prefix, str_repla... | php | public function resolve($class)
{
$result = false;
$prefix = $class;
while (false !== ($pos = strrpos($prefix, '\\'))) {
$prefix = substr($class, 0, $pos + 1);
if (isset($this->prefixes[$prefix])) {
$result = $this->resolveFilename($prefix, str_repla... | [
"public",
"function",
"resolve",
"(",
"$",
"class",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"prefix",
"=",
"$",
"class",
";",
"while",
"(",
"false",
"!==",
"(",
"$",
"pos",
"=",
"strrpos",
"(",
"$",
"prefix",
",",
"'\\\\'",
")",
")",
")"... | Resolve a class name to path and filename
@param string $class
@return string|bool | [
"Resolve",
"a",
"class",
"name",
"to",
"path",
"and",
"filename"
] | 94cffda06eff58fb09a9d3bf907ab3163ce3a090 | https://github.com/poliander/janeiro/blob/94cffda06eff58fb09a9d3bf907ab3163ce3a090/src/Janeiro/Loader.php#L57-L77 |
187,056 | poliander/janeiro | src/Janeiro/Loader.php | Loader.load | protected function load($filename)
{
$success = false;
if (file_exists($filename)) {
/** @noinspection PhpIncludeInspection */
require $filename;
$success = true;
}
return $success;
} | php | protected function load($filename)
{
$success = false;
if (file_exists($filename)) {
/** @noinspection PhpIncludeInspection */
require $filename;
$success = true;
}
return $success;
} | [
"protected",
"function",
"load",
"(",
"$",
"filename",
")",
"{",
"$",
"success",
"=",
"false",
";",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
")",
"{",
"/** @noinspection PhpIncludeInspection */",
"require",
"$",
"filename",
";",
"$",
"success",
"... | Include class file, if given file exists
@param string $filename
@return bool | [
"Include",
"class",
"file",
"if",
"given",
"file",
"exists"
] | 94cffda06eff58fb09a9d3bf907ab3163ce3a090 | https://github.com/poliander/janeiro/blob/94cffda06eff58fb09a9d3bf907ab3163ce3a090/src/Janeiro/Loader.php#L106-L117 |
187,057 | JumpGateio/Users | src/JumpGate/Users/Models/User/Token.php | Token.generate | public function generate($type, User $user, $hours = null)
{
$hours = is_null($hours) ? 24 : $hours;
$user_id = $user->id;
$email = $user->getAuthIdentifier();
$value = str_shuffle(sha1($email . $type . spl_object_hash($this) . microtime(true)));
$token ... | php | public function generate($type, User $user, $hours = null)
{
$hours = is_null($hours) ? 24 : $hours;
$user_id = $user->id;
$email = $user->getAuthIdentifier();
$value = str_shuffle(sha1($email . $type . spl_object_hash($this) . microtime(true)));
$token ... | [
"public",
"function",
"generate",
"(",
"$",
"type",
",",
"User",
"$",
"user",
",",
"$",
"hours",
"=",
"null",
")",
"{",
"$",
"hours",
"=",
"is_null",
"(",
"$",
"hours",
")",
"?",
"24",
":",
"$",
"hours",
";",
"$",
"user_id",
"=",
"$",
"user",
"... | Generate a new token for the type.
@param string $type
@param \App\Models\User $user
@param null|int $hours
@return $this | [
"Generate",
"a",
"new",
"token",
"for",
"the",
"type",
"."
] | 2a63b9088b4fb385a1888918ede98be53e733f56 | https://github.com/JumpGateio/Users/blob/2a63b9088b4fb385a1888918ede98be53e733f56/src/JumpGate/Users/Models/User/Token.php#L85-L96 |
187,058 | JumpGateio/Users | src/JumpGate/Users/Models/User/Token.php | Token.notifyUser | public function notifyUser()
{
switch ($this->type) {
case self::TYPE_PASSWORD_RESET:
$event = new PasswordReset;
break;
case self::TYPE_ACTIVATION:
$event = new UserActivation;
break;
case self::TYP... | php | public function notifyUser()
{
switch ($this->type) {
case self::TYPE_PASSWORD_RESET:
$event = new PasswordReset;
break;
case self::TYPE_ACTIVATION:
$event = new UserActivation;
break;
case self::TYP... | [
"public",
"function",
"notifyUser",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_PASSWORD_RESET",
":",
"$",
"event",
"=",
"new",
"PasswordReset",
";",
"break",
";",
"case",
"self",
"::",
"TYPE_ACTIVATION",
... | Notify the user of this token. | [
"Notify",
"the",
"user",
"of",
"this",
"token",
"."
] | 2a63b9088b4fb385a1888918ede98be53e733f56 | https://github.com/JumpGateio/Users/blob/2a63b9088b4fb385a1888918ede98be53e733f56/src/JumpGate/Users/Models/User/Token.php#L121-L136 |
187,059 | JumpGateio/Users | src/JumpGate/Users/Models/User/Token.php | Token.extend | public function extend($hours = null)
{
$hours = is_null($hours) ? 24 : $hours;
$this->update([
'expires_at' => Carbon::now()->addHours($hours),
]);
} | php | public function extend($hours = null)
{
$hours = is_null($hours) ? 24 : $hours;
$this->update([
'expires_at' => Carbon::now()->addHours($hours),
]);
} | [
"public",
"function",
"extend",
"(",
"$",
"hours",
"=",
"null",
")",
"{",
"$",
"hours",
"=",
"is_null",
"(",
"$",
"hours",
")",
"?",
"24",
":",
"$",
"hours",
";",
"$",
"this",
"->",
"update",
"(",
"[",
"'expires_at'",
"=>",
"Carbon",
"::",
"now",
... | Extend the expiration of the token.
@param null|int $hours | [
"Extend",
"the",
"expiration",
"of",
"the",
"token",
"."
] | 2a63b9088b4fb385a1888918ede98be53e733f56 | https://github.com/JumpGateio/Users/blob/2a63b9088b4fb385a1888918ede98be53e733f56/src/JumpGate/Users/Models/User/Token.php#L143-L150 |
187,060 | JumpGateio/Users | src/JumpGate/Users/Models/User/Token.php | Token.extendByToken | public function extendByToken($token, $hours = null)
{
$token = $this->findByToken($token);
if (! is_null($token)) {
return $token->extend($hours);
}
} | php | public function extendByToken($token, $hours = null)
{
$token = $this->findByToken($token);
if (! is_null($token)) {
return $token->extend($hours);
}
} | [
"public",
"function",
"extendByToken",
"(",
"$",
"token",
",",
"$",
"hours",
"=",
"null",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"findByToken",
"(",
"$",
"token",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"token",
")",
")",
"{",
"re... | Extend the expiration of a token.
@param string $token
@param null $hours | [
"Extend",
"the",
"expiration",
"of",
"a",
"token",
"."
] | 2a63b9088b4fb385a1888918ede98be53e733f56 | https://github.com/JumpGateio/Users/blob/2a63b9088b4fb385a1888918ede98be53e733f56/src/JumpGate/Users/Models/User/Token.php#L193-L200 |
187,061 | JumpGateio/Users | src/JumpGate/Users/Models/User/Token.php | Token.expireByToken | public function expireByToken($token)
{
$token = $this->findByToken($token);
if (! is_null($token)) {
return $token->expire();
}
} | php | public function expireByToken($token)
{
$token = $this->findByToken($token);
if (! is_null($token)) {
return $token->expire();
}
} | [
"public",
"function",
"expireByToken",
"(",
"$",
"token",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"findByToken",
"(",
"$",
"token",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"token",
")",
")",
"{",
"return",
"$",
"token",
"->",
"expire... | Find an object by its token and immediately expire it.
@param string $token | [
"Find",
"an",
"object",
"by",
"its",
"token",
"and",
"immediately",
"expire",
"it",
"."
] | 2a63b9088b4fb385a1888918ede98be53e733f56 | https://github.com/JumpGateio/Users/blob/2a63b9088b4fb385a1888918ede98be53e733f56/src/JumpGate/Users/Models/User/Token.php#L207-L214 |
187,062 | poliander/janeiro | src/Janeiro/Mvc/View.php | View.set | public function set(string $name, $value = null): self
{
$this->variables[$name] = $value;
return $this;
} | php | public function set(string $name, $value = null): self
{
$this->variables[$name] = $value;
return $this;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
":",
"self",
"{",
"$",
"this",
"->",
"variables",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"return",
"$",
"this",
";",
"}"
] | Assign a variable to template
@param string $name
@param mixed $value
@return self | [
"Assign",
"a",
"variable",
"to",
"template"
] | 94cffda06eff58fb09a9d3bf907ab3163ce3a090 | https://github.com/poliander/janeiro/blob/94cffda06eff58fb09a9d3bf907ab3163ce3a090/src/Janeiro/Mvc/View.php#L46-L50 |
187,063 | poliander/janeiro | src/Janeiro/Mvc/View.php | View.get | public function get($variable)
{
if (false === array_key_exists($variable, $this->variables)) {
throw new View\Exception(sprintf('Unassigned variable "%s"', $variable));
}
return $this->variables[$variable];
} | php | public function get($variable)
{
if (false === array_key_exists($variable, $this->variables)) {
throw new View\Exception(sprintf('Unassigned variable "%s"', $variable));
}
return $this->variables[$variable];
} | [
"public",
"function",
"get",
"(",
"$",
"variable",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"variable",
",",
"$",
"this",
"->",
"variables",
")",
")",
"{",
"throw",
"new",
"View",
"\\",
"Exception",
"(",
"sprintf",
"(",
"'Unas... | Get value from template assignments
@throws \Janeiro\Mvc\Exception
@param string $variable
@return mixed | [
"Get",
"value",
"from",
"template",
"assignments"
] | 94cffda06eff58fb09a9d3bf907ab3163ce3a090 | https://github.com/poliander/janeiro/blob/94cffda06eff58fb09a9d3bf907ab3163ce3a090/src/Janeiro/Mvc/View.php#L59-L66 |
187,064 | comindware/tracker-php-api | src/Service/AccountService.php | AccountService.getAvatars | public function getAvatars(array $accounts)
{
$ids = [];
foreach ($accounts as $account) {
if ($account instanceof Account) {
$ids[] = $account->getId();
} else {
$ids[] = $account;
}
}
$response = $this->client->se... | php | public function getAvatars(array $accounts)
{
$ids = [];
foreach ($accounts as $account) {
if ($account instanceof Account) {
$ids[] = $account->getId();
} else {
$ids[] = $account;
}
}
$response = $this->client->se... | [
"public",
"function",
"getAvatars",
"(",
"array",
"$",
"accounts",
")",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"accounts",
"as",
"$",
"account",
")",
"{",
"if",
"(",
"$",
"account",
"instanceof",
"Account",
")",
"{",
"$",
"ids",
... | Get avatars.
@param array $accounts Array of {@see \Comindware\Tracker\API\Model\Account} or IDs.
@return FileStruct[]
@throws \Comindware\Tracker\API\Exception\RuntimeException In case of non-API errors.
@throws \Comindware\Tracker\API\Exception\UnexpectedValueException On invalid response.
@throws \Comindware\Trac... | [
"Get",
"avatars",
"."
] | 6be0a0df000b9a8838dc0d615b0b140863c2fd02 | https://github.com/comindware/tracker-php-api/blob/6be0a0df000b9a8838dc0d615b0b140863c2fd02/src/Service/AccountService.php#L37-L68 |
187,065 | comindware/tracker-php-api | src/Service/AccountService.php | AccountService.getAll | public function getAll()
{
$response = $this->client->sendRequest($this->getBase());
try {
$dataSet = new DataSetStruct($response);
} catch (\InvalidArgumentException $e) {
throw new UnexpectedValueException($e->getMessage(), $e->getCode(), $e);
}
$re... | php | public function getAll()
{
$response = $this->client->sendRequest($this->getBase());
try {
$dataSet = new DataSetStruct($response);
} catch (\InvalidArgumentException $e) {
throw new UnexpectedValueException($e->getMessage(), $e->getCode(), $e);
}
$re... | [
"public",
"function",
"getAll",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"sendRequest",
"(",
"$",
"this",
"->",
"getBase",
"(",
")",
")",
";",
"try",
"{",
"$",
"dataSet",
"=",
"new",
"DataSetStruct",
"(",
"$",
"response... | Get all accounts.
@return Account[]
@throws \Comindware\Tracker\API\Exception\RuntimeException In case of non-API errors.
@throws \Comindware\Tracker\API\Exception\UnexpectedValueException On invalid response.
@throws \Comindware\Tracker\API\Exception\WebApiClientException Ore one of descendants.
@throws \LogicExcept... | [
"Get",
"all",
"accounts",
"."
] | 6be0a0df000b9a8838dc0d615b0b140863c2fd02 | https://github.com/comindware/tracker-php-api/blob/6be0a0df000b9a8838dc0d615b0b140863c2fd02/src/Service/AccountService.php#L82-L102 |
187,066 | comindware/tracker-php-api | src/Service/AccountService.php | AccountService.get | public function get($id)
{
$response = $this->client->sendRequest($this->getBase() . '/' . $id);
if (!is_array($response)) {
throw new UnexpectedValueException('Array expected, but got ' . gettype($response));
}
try {
return new Account($response);
} ... | php | public function get($id)
{
$response = $this->client->sendRequest($this->getBase() . '/' . $id);
if (!is_array($response)) {
throw new UnexpectedValueException('Array expected, but got ' . gettype($response));
}
try {
return new Account($response);
} ... | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"sendRequest",
"(",
"$",
"this",
"->",
"getBase",
"(",
")",
".",
"'/'",
".",
"$",
"id",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"... | Get account by ID.
@param string $id Account ID.
@return Account
@throws \Comindware\Tracker\API\Exception\RuntimeException In case of non-API errors.
@throws \Comindware\Tracker\API\Exception\UnexpectedValueException On invalid response.
@throws \Comindware\Tracker\API\Exception\WebApiClientException Ore one of des... | [
"Get",
"account",
"by",
"ID",
"."
] | 6be0a0df000b9a8838dc0d615b0b140863c2fd02 | https://github.com/comindware/tracker-php-api/blob/6be0a0df000b9a8838dc0d615b0b140863c2fd02/src/Service/AccountService.php#L118-L130 |
187,067 | advanced-learning/silverstripe-oauth2-server | src/Entities/AccessTokenEntity.php | AccessTokenEntity.convertToJWT | public function convertToJWT(CryptKey $privateKey)
{
$tokenBuilder = (new Builder())
->setAudience($this->getClient()->getIdentifier())
->setId($this->getIdentifier(), true)
->setIssuedAt(time())
->setNotBefore(time())
->setExpiration($this->getExp... | php | public function convertToJWT(CryptKey $privateKey)
{
$tokenBuilder = (new Builder())
->setAudience($this->getClient()->getIdentifier())
->setId($this->getIdentifier(), true)
->setIssuedAt(time())
->setNotBefore(time())
->setExpiration($this->getExp... | [
"public",
"function",
"convertToJWT",
"(",
"CryptKey",
"$",
"privateKey",
")",
"{",
"$",
"tokenBuilder",
"=",
"(",
"new",
"Builder",
"(",
")",
")",
"->",
"setAudience",
"(",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"getIdentifier",
"(",
")",
")",
... | Generate a JWT from the access token
@param CryptKey $privateKey
@return string | [
"Generate",
"a",
"JWT",
"from",
"the",
"access",
"token"
] | e30ecd921ba1b8c7fd460bec88019ad1b61f5034 | https://github.com/advanced-learning/silverstripe-oauth2-server/blob/e30ecd921ba1b8c7fd460bec88019ad1b61f5034/src/Entities/AccessTokenEntity.php#L41-L63 |
187,068 | volodymyr-volynets/framework | I18n.php | I18n.rtl | public static function rtl($flag = true) {
if ($flag) {
return !empty(self::$options['rtl']);
} else {
return !empty(self::$options['rtl']) ? ' dir="rtl" ' : ' dir="ltr" ';
}
} | php | public static function rtl($flag = true) {
if ($flag) {
return !empty(self::$options['rtl']);
} else {
return !empty(self::$options['rtl']) ? ' dir="rtl" ' : ' dir="ltr" ';
}
} | [
"public",
"static",
"function",
"rtl",
"(",
"$",
"flag",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"flag",
")",
"{",
"return",
"!",
"empty",
"(",
"self",
"::",
"$",
"options",
"[",
"'rtl'",
"]",
")",
";",
"}",
"else",
"{",
"return",
"!",
"empty",
... | Check if language is RTL or return direction
@param boolean $flag
@return mixed | [
"Check",
"if",
"language",
"is",
"RTL",
"or",
"return",
"direction"
] | 975a49d7ac1697ed13e82e445908e7886ee62fb8 | https://github.com/volodymyr-volynets/framework/blob/975a49d7ac1697ed13e82e445908e7886ee62fb8/I18n.php#L110-L116 |
187,069 | volodymyr-volynets/framework | I18n.php | I18n.translateArray | public static function translateArray(array & $data, bool $sort = false) {
foreach ($data as $k => $v) {
$data[$k]['name'] = i18n(null, $v['name']);
}
if ($sort) {
array_key_sort($data, ['name' => SORT_ASC], ['name' => SORT_NATURAL]);
}
} | php | public static function translateArray(array & $data, bool $sort = false) {
foreach ($data as $k => $v) {
$data[$k]['name'] = i18n(null, $v['name']);
}
if ($sort) {
array_key_sort($data, ['name' => SORT_ASC], ['name' => SORT_NATURAL]);
}
} | [
"public",
"static",
"function",
"translateArray",
"(",
"array",
"&",
"$",
"data",
",",
"bool",
"$",
"sort",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"data",
"[",
"$",
"k",
"]",
"[",
"'n... | Translate and sort an array
@param array $data
@param bool $sort | [
"Translate",
"and",
"sort",
"an",
"array"
] | 975a49d7ac1697ed13e82e445908e7886ee62fb8 | https://github.com/volodymyr-volynets/framework/blob/975a49d7ac1697ed13e82e445908e7886ee62fb8/I18n.php#L161-L168 |
187,070 | hiqdev/omnipay-ecoin | src/Message/CompletePurchaseResponse.php | CompletePurchaseResponse.calculateHash | public function calculateHash()
{
$str = $this->data['ECM_TRANS_ID'] .
$this->data['ECM_TRANS_DATE'] .
$this->request->getPurse() .
$this->data['ECM_PAYER_ID'] .
$this->data['ECM_ITEM_COST'] .
$this->data['ECM_QTY'] .
... | php | public function calculateHash()
{
$str = $this->data['ECM_TRANS_ID'] .
$this->data['ECM_TRANS_DATE'] .
$this->request->getPurse() .
$this->data['ECM_PAYER_ID'] .
$this->data['ECM_ITEM_COST'] .
$this->data['ECM_QTY'] .
... | [
"public",
"function",
"calculateHash",
"(",
")",
"{",
"$",
"str",
"=",
"$",
"this",
"->",
"data",
"[",
"'ECM_TRANS_ID'",
"]",
".",
"$",
"this",
"->",
"data",
"[",
"'ECM_TRANS_DATE'",
"]",
".",
"$",
"this",
"->",
"request",
"->",
"getPurse",
"(",
")",
... | Calculate hash to validate incoming confirmation.
@return string | [
"Calculate",
"hash",
"to",
"validate",
"incoming",
"confirmation",
"."
] | 0c1efd7dd4ab37f09a926f8764a7b4495bc23b9e | https://github.com/hiqdev/omnipay-ecoin/blob/0c1efd7dd4ab37f09a926f8764a7b4495bc23b9e/src/Message/CompletePurchaseResponse.php#L120-L131 |
187,071 | dionsnoeijen/sexy-field-doctrine | src/SectionField/Service/FetchFieldsDoctrineSectionReader.php | FetchFieldsDoctrineSectionReader.makeNested | public static function makeNested(array $data): array
{
$result = [];
foreach ($data as $key => $value) {
$keyParts = explode(':', $key);
$current =& $result;
foreach (static::tail($keyParts) as $keyPart) {
if (!array_key_exists($keyPart, $current)... | php | public static function makeNested(array $data): array
{
$result = [];
foreach ($data as $key => $value) {
$keyParts = explode(':', $key);
$current =& $result;
foreach (static::tail($keyParts) as $keyPart) {
if (!array_key_exists($keyPart, $current)... | [
"public",
"static",
"function",
"makeNested",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"keyParts",
"=",
"explode",
"(",
... | Make a flat array nested.
@param array $data
@return array | [
"Make",
"a",
"flat",
"array",
"nested",
"."
] | ead3d9a776cbd237c847273acb4e9f4b929cf015 | https://github.com/dionsnoeijen/sexy-field-doctrine/blob/ead3d9a776cbd237c847273acb4e9f4b929cf015/src/SectionField/Service/FetchFieldsDoctrineSectionReader.php#L220-L235 |
187,072 | dionsnoeijen/sexy-field-doctrine | src/SectionField/Service/FetchFieldsDoctrineSectionReader.php | FetchFieldsDoctrineSectionReader.hasDuplicates | private static function hasDuplicates(array $entityPath): bool
{
$found = [];
foreach ($entityPath as $field) {
$key = $field['field'] . "\0" . $field['class'];
if (array_key_exists($key, $found)) {
return true;
}
$found[$key] = true;
... | php | private static function hasDuplicates(array $entityPath): bool
{
$found = [];
foreach ($entityPath as $field) {
$key = $field['field'] . "\0" . $field['class'];
if (array_key_exists($key, $found)) {
return true;
}
$found[$key] = true;
... | [
"private",
"static",
"function",
"hasDuplicates",
"(",
"array",
"$",
"entityPath",
")",
":",
"bool",
"{",
"$",
"found",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"entityPath",
"as",
"$",
"field",
")",
"{",
"$",
"key",
"=",
"$",
"field",
"[",
"'field'"... | Check if any fields appear in an entity path multiple times, to avoid weird loops.
@param array $entityPath
@return bool | [
"Check",
"if",
"any",
"fields",
"appear",
"in",
"an",
"entity",
"path",
"multiple",
"times",
"to",
"avoid",
"weird",
"loops",
"."
] | ead3d9a776cbd237c847273acb4e9f4b929cf015 | https://github.com/dionsnoeijen/sexy-field-doctrine/blob/ead3d9a776cbd237c847273acb4e9f4b929cf015/src/SectionField/Service/FetchFieldsDoctrineSectionReader.php#L242-L253 |
187,073 | dionsnoeijen/sexy-field-doctrine | src/SectionField/Service/FetchFieldsDoctrineSectionReader.php | FetchFieldsDoctrineSectionReader.implodeEntityPath | private static function implodeEntityPath(array $entityPath): string
{
$fields = [];
foreach ($entityPath as $item) {
$fields[] = $item['field'];
}
return implode(':', $fields);
} | php | private static function implodeEntityPath(array $entityPath): string
{
$fields = [];
foreach ($entityPath as $item) {
$fields[] = $item['field'];
}
return implode(':', $fields);
} | [
"private",
"static",
"function",
"implodeEntityPath",
"(",
"array",
"$",
"entityPath",
")",
":",
"string",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"entityPath",
"as",
"$",
"item",
")",
"{",
"$",
"fields",
"[",
"]",
"=",
"$",
"ite... | Reduce an entity path to the name that entity gets in the DQL, by linking field names with underscores
@param array[] $entityPath
@return string | [
"Reduce",
"an",
"entity",
"path",
"to",
"the",
"name",
"that",
"entity",
"gets",
"in",
"the",
"DQL",
"by",
"linking",
"field",
"names",
"with",
"underscores"
] | ead3d9a776cbd237c847273acb4e9f4b929cf015 | https://github.com/dionsnoeijen/sexy-field-doctrine/blob/ead3d9a776cbd237c847273acb4e9f4b929cf015/src/SectionField/Service/FetchFieldsDoctrineSectionReader.php#L270-L277 |
187,074 | dionsnoeijen/sexy-field-doctrine | src/SectionField/Service/FetchFieldsDoctrineSectionReader.php | FetchFieldsDoctrineSectionReader.findSlug | private static function findSlug(array $classMetadata): string
{
foreach ($classMetadata as $name => $info) {
if ($info['type'] === 'Slug') {
return $name;
}
}
throw new InvalidFetchFieldsQueryException("Class doesn't have a slug field");
} | php | private static function findSlug(array $classMetadata): string
{
foreach ($classMetadata as $name => $info) {
if ($info['type'] === 'Slug') {
return $name;
}
}
throw new InvalidFetchFieldsQueryException("Class doesn't have a slug field");
} | [
"private",
"static",
"function",
"findSlug",
"(",
"array",
"$",
"classMetadata",
")",
":",
"string",
"{",
"foreach",
"(",
"$",
"classMetadata",
"as",
"$",
"name",
"=>",
"$",
"info",
")",
"{",
"if",
"(",
"$",
"info",
"[",
"'type'",
"]",
"===",
"'Slug'",... | Find the name of a section's slug field.
@param array $classMetadata
@return string | [
"Find",
"the",
"name",
"of",
"a",
"section",
"s",
"slug",
"field",
"."
] | ead3d9a776cbd237c847273acb4e9f4b929cf015 | https://github.com/dionsnoeijen/sexy-field-doctrine/blob/ead3d9a776cbd237c847273acb4e9f4b929cf015/src/SectionField/Service/FetchFieldsDoctrineSectionReader.php#L284-L292 |
187,075 | linkeddatacenter/BOTK-core | src/Model/LocalBusiness.php | LocalBusiness.getParsedQuantitativeVars | private function getParsedQuantitativeVars()
{
static $quantitativeValuesVar = array(
'numberOfEmployees' => 'schema:numberOfEmployees',
'annualTurnover' => 'botk:annualTurnover',
'ebitda' => 'botk:ebitda' ,
'netProfit' => 'botk:netProfit',
'hasTotDevelopers' => 'botk:hasTotDevelopers',
'itBudget' ... | php | private function getParsedQuantitativeVars()
{
static $quantitativeValuesVar = array(
'numberOfEmployees' => 'schema:numberOfEmployees',
'annualTurnover' => 'botk:annualTurnover',
'ebitda' => 'botk:ebitda' ,
'netProfit' => 'botk:netProfit',
'hasTotDevelopers' => 'botk:hasTotDevelopers',
'itBudget' ... | [
"private",
"function",
"getParsedQuantitativeVars",
"(",
")",
"{",
"static",
"$",
"quantitativeValuesVar",
"=",
"array",
"(",
"'numberOfEmployees'",
"=>",
"'schema:numberOfEmployees'",
",",
"'annualTurnover'",
"=>",
"'botk:annualTurnover'",
",",
"'ebitda'",
"=>",
"'botk:e... | return a structured info to generate rdf code for quantitative values | [
"return",
"a",
"structured",
"info",
"to",
"generate",
"rdf",
"code",
"for",
"quantitative",
"values"
] | 51a98efc2f58698e82e9f46dfae904e216ec360d | https://github.com/linkeddatacenter/BOTK-core/blob/51a98efc2f58698e82e9f46dfae904e216ec360d/src/Model/LocalBusiness.php#L655-L723 |
187,076 | sergmoro1/yii2-blog-tools | src/controllers/PostController.php | PostController.findModel | public function findModel($id, $slug = '')
{
if($this->_model === null)
{
if(($this->_model = $id ? Post::findOne($id) : Post::findOne(['slug' => $slug])) !== null)
{
return $this->_model;
} else {
throw new NotFoundHttpException(... | php | public function findModel($id, $slug = '')
{
if($this->_model === null)
{
if(($this->_model = $id ? Post::findOne($id) : Post::findOne(['slug' => $slug])) !== null)
{
return $this->_model;
} else {
throw new NotFoundHttpException(... | [
"public",
"function",
"findModel",
"(",
"$",
"id",
",",
"$",
"slug",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_model",
"===",
"null",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"_model",
"=",
"$",
"id",
"?",
"Post",
"::",
"findOne"... | Finds the Post model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@param string $slug
@return Post the loaded model
@throws NotFoundHttpException if the model cannot be found | [
"Finds",
"the",
"Post",
"model",
"based",
"on",
"its",
"primary",
"key",
"value",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"404",
"HTTP",
"exception",
"will",
"be",
"thrown",
"."
] | 1c84caf13bd3ee67bf02307d4c3d3db079bb28e4 | https://github.com/sergmoro1/yii2-blog-tools/blob/1c84caf13bd3ee67bf02307d4c3d3db079bb28e4/src/controllers/PostController.php#L158-L169 |
187,077 | mikemirten/ZExt | library/ZExt/Di/Container.php | Container.set | public function set($id, $definition, $args = null, $factory = false) {
if (isset($this->_definitions[$id])) {
throw new Exceptions\ServiceOverride('Service "' . $id . '" already exists');
}
$definition = $this->normalizeDefinition($definition);
if ($args !== null) {
$args = $this->processArguments(... | php | public function set($id, $definition, $args = null, $factory = false) {
if (isset($this->_definitions[$id])) {
throw new Exceptions\ServiceOverride('Service "' . $id . '" already exists');
}
$definition = $this->normalizeDefinition($definition);
if ($args !== null) {
$args = $this->processArguments(... | [
"public",
"function",
"set",
"(",
"$",
"id",
",",
"$",
"definition",
",",
"$",
"args",
"=",
"null",
",",
"$",
"factory",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_definitions",
"[",
"$",
"id",
"]",
")",
")",
"{",
"th... | Set service definition
@param string $id ID of service
@param mixed $definition Definition of service
@param mixed $args Arguments for constructor of service
@param bool $factory Factory mode: new instance for each request of service
@return DefinitionInterface
@throws Exceptions\ServiceOverri... | [
"Set",
"service",
"definition"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Di/Container.php#L107-L126 |
187,078 | mikemirten/ZExt | library/ZExt/Di/Container.php | Container.setAlias | public function setAlias($existsId, $newId) {
if (isset($this->_definitions[$newId])) {
throw new Exceptions\ServiceOverride('Service "' . $newId . '" already exists');
}
$this->_definitions[$newId] = $this->getDefinition($existsId);
} | php | public function setAlias($existsId, $newId) {
if (isset($this->_definitions[$newId])) {
throw new Exceptions\ServiceOverride('Service "' . $newId . '" already exists');
}
$this->_definitions[$newId] = $this->getDefinition($existsId);
} | [
"public",
"function",
"setAlias",
"(",
"$",
"existsId",
",",
"$",
"newId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_definitions",
"[",
"$",
"newId",
"]",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"ServiceOverride",
"(",
"'Servic... | Set alias for service
@param string $existsId ID of exists service
@param string $newId Alias ID
@throws Exceptions\ServiceOverride | [
"Set",
"alias",
"for",
"service"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Di/Container.php#L135-L141 |
187,079 | mikemirten/ZExt | library/ZExt/Di/Container.php | Container.setParemetersConfig | public function setParemetersConfig(ConfigInterface $config, $lockExchange = true) {
if ($this->_parametersConfigLock) {
throw new Exceptions\ForbiddenAction('Config is locked and cannot be exchanged');
}
$this->_parametersConfig = $config;
$this->_parametersConfigLock = $lockExchange;
return $th... | php | public function setParemetersConfig(ConfigInterface $config, $lockExchange = true) {
if ($this->_parametersConfigLock) {
throw new Exceptions\ForbiddenAction('Config is locked and cannot be exchanged');
}
$this->_parametersConfig = $config;
$this->_parametersConfigLock = $lockExchange;
return $th... | [
"public",
"function",
"setParemetersConfig",
"(",
"ConfigInterface",
"$",
"config",
",",
"$",
"lockExchange",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_parametersConfigLock",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"ForbiddenAction",
"(",
"'... | Set config with parameters
@param ConfigInterface $config
@param bool $lockExchange Forbid set config in future
@throws Exceptions\ForbiddenAction
@return Container | [
"Set",
"config",
"with",
"parameters"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Di/Container.php#L174-L183 |
187,080 | mikemirten/ZExt | library/ZExt/Di/Container.php | Container.getParametersConfig | public function getParametersConfig() {
if ($this->_parametersConfig === null) {
$this->_parametersConfig = new Config();
$this->_parametersConfigLock = true;
}
return $this->_parametersConfig;
} | php | public function getParametersConfig() {
if ($this->_parametersConfig === null) {
$this->_parametersConfig = new Config();
$this->_parametersConfigLock = true;
}
return $this->_parametersConfig;
} | [
"public",
"function",
"getParametersConfig",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_parametersConfig",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_parametersConfig",
"=",
"new",
"Config",
"(",
")",
";",
"$",
"this",
"->",
"_parametersConfigLock",
... | Get config with parameters
@return ConfigInterface | [
"Get",
"config",
"with",
"parameters"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Di/Container.php#L190-L197 |
187,081 | mikemirten/ZExt | library/ZExt/Di/Container.php | Container.getLocatorByServiceId | protected function getLocatorByServiceId($id) {
if (isset($this->_locatorsResolved[$id])) {
return $this->_locatorsResolved[$id];
}
foreach ($this->_locators as $locator) {
if ($locator->has($id)) {
$this->_locatorsResolved[$id] = $locator;
return $locator;
}
}
} | php | protected function getLocatorByServiceId($id) {
if (isset($this->_locatorsResolved[$id])) {
return $this->_locatorsResolved[$id];
}
foreach ($this->_locators as $locator) {
if ($locator->has($id)) {
$this->_locatorsResolved[$id] = $locator;
return $locator;
}
}
} | [
"protected",
"function",
"getLocatorByServiceId",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_locatorsResolved",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_locatorsResolved",
"[",
"$",
"id",
"]",
";",... | Get resolve locator by service ID
@param string $id Service ID
@return LocatorInterface | [
"Get",
"resolve",
"locator",
"by",
"service",
"ID"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Di/Container.php#L268-L279 |
187,082 | mikemirten/ZExt | library/ZExt/Di/Container.php | Container.addLocator | public function addLocator(LocatorInterface $locator, $id = null) {
if ($id === null) {
$this->_locators[] = $locator;
} else {
$this->_locators[$id] = $locator;
}
return $this;
} | php | public function addLocator(LocatorInterface $locator, $id = null) {
if ($id === null) {
$this->_locators[] = $locator;
} else {
$this->_locators[$id] = $locator;
}
return $this;
} | [
"public",
"function",
"addLocator",
"(",
"LocatorInterface",
"$",
"locator",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_locators",
"[",
"]",
"=",
"$",
"locator",
";",
"}",
"else",
"{",... | Add fallback locator
@param LocatorInterface $locator Locator instance
@param string $id Locator unique ID
@return Container | [
"Add",
"fallback",
"locator"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Di/Container.php#L342-L350 |
187,083 | faraweilyas/whitegold-framework | src/TemplateEngine/Template.php | Template.setFileLocation | final protected function setFileLocation (string $file)
{
$file = $this->getLocation().$file;
$pathParts = pathinfo($file);
$this->file = !isset($pathParts['extension']) ? $file.".inc" : $file;
} | php | final protected function setFileLocation (string $file)
{
$file = $this->getLocation().$file;
$pathParts = pathinfo($file);
$this->file = !isset($pathParts['extension']) ? $file.".inc" : $file;
} | [
"final",
"protected",
"function",
"setFileLocation",
"(",
"string",
"$",
"file",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getLocation",
"(",
")",
".",
"$",
"file",
";",
"$",
"pathParts",
"=",
"pathinfo",
"(",
"$",
"file",
")",
";",
"$",
"this"... | Sets the template file location
@param string $file | [
"Sets",
"the",
"template",
"file",
"location"
] | f0e5fecea1a30abad595fdfc4c3821abc2831594 | https://github.com/faraweilyas/whitegold-framework/blob/f0e5fecea1a30abad595fdfc4c3821abc2831594/src/TemplateEngine/Template.php#L70-L75 |
187,084 | faraweilyas/whitegold-framework | src/TemplateEngine/Template.php | Template.display | final protected function display (bool $return=FALSE)
{
if (file_exists($this->file)):
$output = file_get_contents($this->file);
foreach ($this->assignedVariables as $key => $value)
$output = preg_replace('/{'.$key.'}/', $value, $output);
else:
$output = "*** Missing template error: {$this->file} ***... | php | final protected function display (bool $return=FALSE)
{
if (file_exists($this->file)):
$output = file_get_contents($this->file);
foreach ($this->assignedVariables as $key => $value)
$output = preg_replace('/{'.$key.'}/', $value, $output);
else:
$output = "*** Missing template error: {$this->file} ***... | [
"final",
"protected",
"function",
"display",
"(",
"bool",
"$",
"return",
"=",
"FALSE",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"file",
")",
")",
":",
"$",
"output",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"file",
")",
";... | Displays the template being generated
@param bool $return
@return mixed | [
"Displays",
"the",
"template",
"being",
"generated"
] | f0e5fecea1a30abad595fdfc4c3821abc2831594 | https://github.com/faraweilyas/whitegold-framework/blob/f0e5fecea1a30abad595fdfc4c3821abc2831594/src/TemplateEngine/Template.php#L82-L96 |
187,085 | mikemirten/ZExt | library/ZExt/Cache/Factory.php | Factory.createBackend | static function createBackend($options = [], $backend = null) {
$options = self::normalizeOptions($options);
// Backend type
if (isset($options[self::PARAM_TYPE])) {
$backendType = (string) $options[self::PARAM_TYPE];
unset($options[self::PARAM_TYPE]);
} else {
$backendType = self::DEFAULT_BACKEND;
... | php | static function createBackend($options = [], $backend = null) {
$options = self::normalizeOptions($options);
// Backend type
if (isset($options[self::PARAM_TYPE])) {
$backendType = (string) $options[self::PARAM_TYPE];
unset($options[self::PARAM_TYPE]);
} else {
$backendType = self::DEFAULT_BACKEND;
... | [
"static",
"function",
"createBackend",
"(",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"backend",
"=",
"null",
")",
"{",
"$",
"options",
"=",
"self",
"::",
"normalizeOptions",
"(",
"$",
"options",
")",
";",
"// Backend type",
"if",
"(",
"isset",
"(",
"$"... | Create the backend
Parameters:
param name | datatype | default | description
===============================================
type | string | memcache | Type of the backend (memcache, files...)
profiler | bool | false | Queries must be profileable (implements the "ZExt\Profiler\ProfileableInterf... | [
"Create",
"the",
"backend"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Cache/Factory.php#L86-L165 |
187,086 | mikemirten/ZExt | library/ZExt/Cache/Factory.php | Factory.createFrontend | static public function createFrontend($options = []) {
$options = self::normalizeOptions($options);
if (isset($options[self::PARAM_LIFETIME])) {
$lifetime = (int) $options[self::PARAM_LIFETIME];
unset($options[self::PARAM_LIFETIME]);
}
$frontend = new Wrapper(self::createBackend($options));
if ... | php | static public function createFrontend($options = []) {
$options = self::normalizeOptions($options);
if (isset($options[self::PARAM_LIFETIME])) {
$lifetime = (int) $options[self::PARAM_LIFETIME];
unset($options[self::PARAM_LIFETIME]);
}
$frontend = new Wrapper(self::createBackend($options));
if ... | [
"static",
"public",
"function",
"createFrontend",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"self",
"::",
"normalizeOptions",
"(",
"$",
"options",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"self",
"::",
"PARAM_LIF... | Create the frontend
The "lifetime" option is only supported, others will be passed further
@param array | Traversable $options
@return Wrapper | [
"Create",
"the",
"frontend",
"The",
"lifetime",
"option",
"is",
"only",
"supported",
"others",
"will",
"be",
"passed",
"further"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Cache/Factory.php#L174-L189 |
187,087 | mikemirten/ZExt | library/ZExt/Cache/Factory.php | Factory.createFrontendFactory | static public function createFrontendFactory($options = []) {
$options = self::normalizeOptions($options);
if (isset($options[self::PARAM_LIFETIME])) {
$lifetime = (int) $options[self::PARAM_LIFETIME];
unset($options[self::PARAM_LIFETIME]);
}
$frontend = new FrontendFactory(self::createBackend($opti... | php | static public function createFrontendFactory($options = []) {
$options = self::normalizeOptions($options);
if (isset($options[self::PARAM_LIFETIME])) {
$lifetime = (int) $options[self::PARAM_LIFETIME];
unset($options[self::PARAM_LIFETIME]);
}
$frontend = new FrontendFactory(self::createBackend($opti... | [
"static",
"public",
"function",
"createFrontendFactory",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"self",
"::",
"normalizeOptions",
"(",
"$",
"options",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"self",
"::",
"PA... | Create the frontend factory
The "lifetime" option is only supported, others will be passed further
@param array | Traversable $options
@return FrontendFactory | [
"Create",
"the",
"frontend",
"factory",
"The",
"lifetime",
"option",
"is",
"only",
"supported",
"others",
"will",
"be",
"passed",
"further"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Cache/Factory.php#L198-L213 |
187,088 | mikemirten/ZExt | library/ZExt/Cache/Factory.php | Factory.normalizeOptions | static protected function normalizeOptions($options) {
if ($options instanceof Traversable) {
$options = iterator_to_array($options);
}
if (! is_array($options)) {
throw new InvalidOptions('Options must be an array or a Traversable implementation');
}
return $options;
} | php | static protected function normalizeOptions($options) {
if ($options instanceof Traversable) {
$options = iterator_to_array($options);
}
if (! is_array($options)) {
throw new InvalidOptions('Options must be an array or a Traversable implementation');
}
return $options;
} | [
"static",
"protected",
"function",
"normalizeOptions",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"options",
"instanceof",
"Traversable",
")",
"{",
"$",
"options",
"=",
"iterator_to_array",
"(",
"$",
"options",
")",
";",
"}",
"if",
"(",
"!",
"is_array"... | Normalize the options
@param array | Traversable $options
@return array
@throws InvalidOptions | [
"Normalize",
"the",
"options"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Cache/Factory.php#L222-L232 |
187,089 | mikemirten/ZExt | library/ZExt/Di/InitializerAbstract.php | InitializerAbstract.getService | public function getService($id) {
if ($this->factoryMode) {
return $this->initService($id);
}
$fullId = $id . ':' . $this->getIdByArgs([]);
if (! isset($this->services[$fullId])) {
$this->services[$fullId] = $this->initService($id);
}
return $this->services[$fullId];
} | php | public function getService($id) {
if ($this->factoryMode) {
return $this->initService($id);
}
$fullId = $id . ':' . $this->getIdByArgs([]);
if (! isset($this->services[$fullId])) {
$this->services[$fullId] = $this->initService($id);
}
return $this->services[$fullId];
} | [
"public",
"function",
"getService",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"factoryMode",
")",
"{",
"return",
"$",
"this",
"->",
"initService",
"(",
"$",
"id",
")",
";",
"}",
"$",
"fullId",
"=",
"$",
"id",
".",
"':'",
".",
"$",
... | Get service without arguments
@param string $id
@return mixed | [
"Get",
"service",
"without",
"arguments"
] | 284956f5b85ba10571f64aaa651169e00f05ae56 | https://github.com/mikemirten/ZExt/blob/284956f5b85ba10571f64aaa651169e00f05ae56/library/ZExt/Di/InitializerAbstract.php#L156-L168 |
187,090 | snapwp/snap-core | src/Media/Admin.php | Admin.boot | public function boot()
{
if (Config::get('images.dynamic_image_sizes') !== false) {
$this->add_filter('media_meta', 'add_image_sizes_meta_to_media');
$this->add_filter('attachment_fields_to_edit', 'add_intermediate_mgmt_fields');
$this->add_filter('attachment_fields_to_sa... | php | public function boot()
{
if (Config::get('images.dynamic_image_sizes') !== false) {
$this->add_filter('media_meta', 'add_image_sizes_meta_to_media');
$this->add_filter('attachment_fields_to_edit', 'add_intermediate_mgmt_fields');
$this->add_filter('attachment_fields_to_sa... | [
"public",
"function",
"boot",
"(",
")",
"{",
"if",
"(",
"Config",
"::",
"get",
"(",
"'images.dynamic_image_sizes'",
")",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
"add_filter",
"(",
"'media_meta'",
",",
"'add_image_sizes_meta_to_media'",
")",
";",
"$",
"t... | Only enable dynamic image sizes if sizes have been defined.
@since 1.0.0 | [
"Only",
"enable",
"dynamic",
"image",
"sizes",
"if",
"sizes",
"have",
"been",
"defined",
"."
] | 43ff5da68e7f28017a21c7e33c770baf6f13d5cb | https://github.com/snapwp/snap-core/blob/43ff5da68e7f28017a21c7e33c770baf6f13d5cb/src/Media/Admin.php#L39-L48 |
187,091 | snapwp/snap-core | src/Media/Admin.php | Admin.add_additional_mime_type_support | public function add_additional_mime_type_support($post_mime_types)
{
$additional_mime_types = [
'application/msword' => [
\__('Word Docs', 'snap'),
\__('Manage Word Docs', 'snap'),
\_n_noop('Word Doc <span class="count">(%s)</span>', 'Word Docs <sp... | php | public function add_additional_mime_type_support($post_mime_types)
{
$additional_mime_types = [
'application/msword' => [
\__('Word Docs', 'snap'),
\__('Manage Word Docs', 'snap'),
\_n_noop('Word Doc <span class="count">(%s)</span>', 'Word Docs <sp... | [
"public",
"function",
"add_additional_mime_type_support",
"(",
"$",
"post_mime_types",
")",
"{",
"$",
"additional_mime_types",
"=",
"[",
"'application/msword'",
"=>",
"[",
"\\",
"__",
"(",
"'Word Docs'",
",",
"'snap'",
")",
",",
"\\",
"__",
"(",
"'Manage Word Docs... | Add some additional mime type filters to media pages.
@since 1.0.0
@param array $post_mime_types The current list of mime types.
@return array The original list with our additional types. | [
"Add",
"some",
"additional",
"mime",
"type",
"filters",
"to",
"media",
"pages",
"."
] | 43ff5da68e7f28017a21c7e33c770baf6f13d5cb | https://github.com/snapwp/snap-core/blob/43ff5da68e7f28017a21c7e33c770baf6f13d5cb/src/Media/Admin.php#L76-L107 |
187,092 | snapwp/snap-core | src/Media/Admin.php | Admin.add_image_sizes_meta_to_media | public function add_image_sizes_meta_to_media($form_meta, $post = null)
{
if (wp_attachment_is_image($post->ID) && current_user_can('manage_options')) {
$meta = wp_get_attachment_metadata($post->ID);
$form_meta .= '<strong>Available sizes: </strong>' . \count($meta['sizes']);
... | php | public function add_image_sizes_meta_to_media($form_meta, $post = null)
{
if (wp_attachment_is_image($post->ID) && current_user_can('manage_options')) {
$meta = wp_get_attachment_metadata($post->ID);
$form_meta .= '<strong>Available sizes: </strong>' . \count($meta['sizes']);
... | [
"public",
"function",
"add_image_sizes_meta_to_media",
"(",
"$",
"form_meta",
",",
"$",
"post",
"=",
"null",
")",
"{",
"if",
"(",
"wp_attachment_is_image",
"(",
"$",
"post",
"->",
"ID",
")",
"&&",
"current_user_can",
"(",
"'manage_options'",
")",
")",
"{",
"... | Adds the additional meta to all images within the admin media view.
Only visible to roles with 'manage_options' cap.
@since 1.0.0
@param string $form_meta The form meta html.
@param \WP_Post $post The current attachment post object.
@return string | [
"Adds",
"the",
"additional",
"meta",
"to",
"all",
"images",
"within",
"the",
"admin",
"media",
"view",
"."
] | 43ff5da68e7f28017a21c7e33c770baf6f13d5cb | https://github.com/snapwp/snap-core/blob/43ff5da68e7f28017a21c7e33c770baf6f13d5cb/src/Media/Admin.php#L120-L129 |
187,093 | snapwp/snap-core | src/Media/Admin.php | Admin.add_intermediate_mgmt_fields | public function add_intermediate_mgmt_fields($form_fields, $post = null)
{
$current_screen = \get_current_screen();
if (isset($current_screen->base) && $current_screen->base === 'post') {
return $form_fields;
}
// Only display for admin level users, and only if an image... | php | public function add_intermediate_mgmt_fields($form_fields, $post = null)
{
$current_screen = \get_current_screen();
if (isset($current_screen->base) && $current_screen->base === 'post') {
return $form_fields;
}
// Only display for admin level users, and only if an image... | [
"public",
"function",
"add_intermediate_mgmt_fields",
"(",
"$",
"form_fields",
",",
"$",
"post",
"=",
"null",
")",
"{",
"$",
"current_screen",
"=",
"\\",
"get_current_screen",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"current_screen",
"->",
"base",
")",
... | Output the HTML for the dynamic image management.
@since 1.0.0
@param array $form_fields The current output.
@param \WP_Post $post The current attachment.
@return mixed | [
"Output",
"the",
"HTML",
"for",
"the",
"dynamic",
"image",
"management",
"."
] | 43ff5da68e7f28017a21c7e33c770baf6f13d5cb | https://github.com/snapwp/snap-core/blob/43ff5da68e7f28017a21c7e33c770baf6f13d5cb/src/Media/Admin.php#L140-L193 |
187,094 | snapwp/snap-core | src/Media/Admin.php | Admin.handle_delete_intermediate_ajax | public function handle_delete_intermediate_ajax($post, $attachment_data)
{
if (isset($attachment_data['delete-intermediate']) && !empty($attachment_data['delete-intermediate'])) {
$sizes = $attachment_data['delete-intermediate'];
$meta = \wp_get_attachment_metadata($post['ID']);
... | php | public function handle_delete_intermediate_ajax($post, $attachment_data)
{
if (isset($attachment_data['delete-intermediate']) && !empty($attachment_data['delete-intermediate'])) {
$sizes = $attachment_data['delete-intermediate'];
$meta = \wp_get_attachment_metadata($post['ID']);
... | [
"public",
"function",
"handle_delete_intermediate_ajax",
"(",
"$",
"post",
",",
"$",
"attachment_data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"attachment_data",
"[",
"'delete-intermediate'",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"attachment_data",
"[",
"'d... | DThe AJAX handler for deleting a dynamic image size.
@since 1.0.0
@param \WP_Post $post The current attachment.
@param array $attachment_data The POST data passed from the quest.
@return \WP_Post | [
"DThe",
"AJAX",
"handler",
"for",
"deleting",
"a",
"dynamic",
"image",
"size",
"."
] | 43ff5da68e7f28017a21c7e33c770baf6f13d5cb | https://github.com/snapwp/snap-core/blob/43ff5da68e7f28017a21c7e33c770baf6f13d5cb/src/Media/Admin.php#L204-L247 |
187,095 | snapwp/snap-core | src/Media/Admin.php | Admin.is_media_screen | private function is_media_screen()
{
$current_screen = \get_current_screen();
if (isset($current_screen->base) && $current_screen->base === 'upload') {
return true;
}
return false;
} | php | private function is_media_screen()
{
$current_screen = \get_current_screen();
if (isset($current_screen->base) && $current_screen->base === 'upload') {
return true;
}
return false;
} | [
"private",
"function",
"is_media_screen",
"(",
")",
"{",
"$",
"current_screen",
"=",
"\\",
"get_current_screen",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"current_screen",
"->",
"base",
")",
"&&",
"$",
"current_screen",
"->",
"base",
"===",
"'upload'",
... | A simple utility for checking whether to render the media JS or not.
@since 1.0.0
@return bool | [
"A",
"simple",
"utility",
"for",
"checking",
"whether",
"to",
"render",
"the",
"media",
"JS",
"or",
"not",
"."
] | 43ff5da68e7f28017a21c7e33c770baf6f13d5cb | https://github.com/snapwp/snap-core/blob/43ff5da68e7f28017a21c7e33c770baf6f13d5cb/src/Media/Admin.php#L256-L265 |
187,096 | PayUMEA/payu-mea-sdk-php | lib/PayU/Api/Amount.php | Amount.setTotal | public function setTotal($total)
{
NumericValidator::validate($total, "Total");
$total = Formatter::formatToPrice($total, $this->getCurrency());
$this->total = $total;
return $this;
} | php | public function setTotal($total)
{
NumericValidator::validate($total, "Total");
$total = Formatter::formatToPrice($total, $this->getCurrency());
$this->total = $total;
return $this;
} | [
"public",
"function",
"setTotal",
"(",
"$",
"total",
")",
"{",
"NumericValidator",
"::",
"validate",
"(",
"$",
"total",
",",
"\"Total\"",
")",
";",
"$",
"total",
"=",
"Formatter",
"::",
"formatToPrice",
"(",
"$",
"total",
",",
"$",
"this",
"->",
"getCurr... | Total amount charged from the payer to the payee. In case of a refund,
this is the refunded amount to the original payer from the payee.
10 characters max with support for integers.
@param string|double $total
@return $this | [
"Total",
"amount",
"charged",
"from",
"the",
"payer",
"to",
"the",
"payee",
".",
"In",
"case",
"of",
"a",
"refund",
"this",
"is",
"the",
"refunded",
"amount",
"to",
"the",
"original",
"payer",
"from",
"the",
"payee",
".",
"10",
"characters",
"max",
"with... | ebfcd99303cc424458732da8e1771edff843e437 | https://github.com/PayUMEA/payu-mea-sdk-php/blob/ebfcd99303cc424458732da8e1771edff843e437/lib/PayU/Api/Amount.php#L53-L59 |
187,097 | black-lamp/blcms-shop | backend/components/form/CategoryImageForm.php | CategoryImageForm.generateImages | private function generateImages($type) {
$imagable = \Yii::$app->shop_imagable;
$nameFile = (new Security())->generateRandomString();
$this->$type->saveAs($imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);
$image_name = $imagable->create('shop-category/' . $type,
... | php | private function generateImages($type) {
$imagable = \Yii::$app->shop_imagable;
$nameFile = (new Security())->generateRandomString();
$this->$type->saveAs($imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);
$image_name = $imagable->create('shop-category/' . $type,
... | [
"private",
"function",
"generateImages",
"(",
"$",
"type",
")",
"{",
"$",
"imagable",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"shop_imagable",
";",
"$",
"nameFile",
"=",
"(",
"new",
"Security",
"(",
")",
")",
"->",
"generateRandomString",
"(",
")",
"... | Generates images from uploaded image using Imagable component
@param $type
@return mixed | [
"Generates",
"images",
"from",
"uploaded",
"image",
"using",
"Imagable",
"component"
] | fdded152c4bac5f155ddc3249554f7cddeed61dc | https://github.com/black-lamp/blcms-shop/blob/fdded152c4bac5f155ddc3249554f7cddeed61dc/backend/components/form/CategoryImageForm.php#L66-L76 |
187,098 | stk2k/eventstream | src/EventStream.php | EventStream.setAutoFlush | public function setAutoFlush($auto_flush)
{
foreach($this->channel_list as $channel)
{
$channel->setAutoFlush($auto_flush);
}
return $this;
} | php | public function setAutoFlush($auto_flush)
{
foreach($this->channel_list as $channel)
{
$channel->setAutoFlush($auto_flush);
}
return $this;
} | [
"public",
"function",
"setAutoFlush",
"(",
"$",
"auto_flush",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"channel_list",
"as",
"$",
"channel",
")",
"{",
"$",
"channel",
"->",
"setAutoFlush",
"(",
"$",
"auto_flush",
")",
";",
"}",
"return",
"$",
"this",... | Update auto flush flags in all channels
@param bool $auto_flush
@return EventStream | [
"Update",
"auto",
"flush",
"flags",
"in",
"all",
"channels"
] | 0b674409341ea9c14166139e169ce46b6b19fdfd | https://github.com/stk2k/eventstream/blob/0b674409341ea9c14166139e169ce46b6b19fdfd/src/EventStream.php#L60-L67 |
187,099 | AStateOfCode/AsseticAngularJsBundle | Angular/SymfonyTemplateNameFormatter.php | SymfonyTemplateNameFormatter.getModuleForAsset | public function getModuleForAsset(AssetInterface $asset)
{
$sourceRoot = $asset->getSourceRoot();
$bundleName = $this->bundleMap[$sourceRoot];
if (!isset($bundleName)) {
throw new \Exception('Could not map the asset to a bundle');
}
return $bundleName . '.templat... | php | public function getModuleForAsset(AssetInterface $asset)
{
$sourceRoot = $asset->getSourceRoot();
$bundleName = $this->bundleMap[$sourceRoot];
if (!isset($bundleName)) {
throw new \Exception('Could not map the asset to a bundle');
}
return $bundleName . '.templat... | [
"public",
"function",
"getModuleForAsset",
"(",
"AssetInterface",
"$",
"asset",
")",
"{",
"$",
"sourceRoot",
"=",
"$",
"asset",
"->",
"getSourceRoot",
"(",
")",
";",
"$",
"bundleName",
"=",
"$",
"this",
"->",
"bundleMap",
"[",
"$",
"sourceRoot",
"]",
";",
... | Create module name for asset.
This is bundle name.
@param AssetInterface $asset
@return string | [
"Create",
"module",
"name",
"for",
"asset",
".",
"This",
"is",
"bundle",
"name",
"."
] | e1158f4bd2c70d0f15b5cb51afad7024ccabde86 | https://github.com/AStateOfCode/AsseticAngularJsBundle/blob/e1158f4bd2c70d0f15b5cb51afad7024ccabde86/Angular/SymfonyTemplateNameFormatter.php#L46-L55 |
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.