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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
203,300 | tonis-io-legacy/tonis | src/Router/RouteMap.php | RouteMap.buildNameCache | private function buildNameCache()
{
if (!empty($this->nameCache)) {
return;
}
foreach ($this as $route) {
if (!$route->name()) {
continue;
}
$this->nameCache[$route->name()] = $route;
}
} | php | private function buildNameCache()
{
if (!empty($this->nameCache)) {
return;
}
foreach ($this as $route) {
if (!$route->name()) {
continue;
}
$this->nameCache[$route->name()] = $route;
}
} | [
"private",
"function",
"buildNameCache",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"nameCache",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"!",
"$",
"route",
"->"... | Iterates through routes and builds a name cache. | [
"Iterates",
"through",
"routes",
"and",
"builds",
"a",
"name",
"cache",
"."
] | 8371a277a94232433d882aaf37a85cd469daf501 | https://github.com/tonis-io-legacy/tonis/blob/8371a277a94232433d882aaf37a85cd469daf501/src/Router/RouteMap.php#L110-L121 |
203,301 | PenoaksDev/Milky-Framework | src/Milky/Http/JsonResponse.php | JsonResponse.setJsonOptions | public function setJsonOptions($options)
{
$this->encodingOptions = (int) $options;
return $this->setData($this->getData());
} | php | public function setJsonOptions($options)
{
$this->encodingOptions = (int) $options;
return $this->setData($this->getData());
} | [
"public",
"function",
"setJsonOptions",
"(",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"encodingOptions",
"=",
"(",
"int",
")",
"$",
"options",
";",
"return",
"$",
"this",
"->",
"setData",
"(",
"$",
"this",
"->",
"getData",
"(",
")",
")",
";",
"}"... | Set the JSON encoding options.
@param int $options
@return mixed | [
"Set",
"the",
"JSON",
"encoding",
"options",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/JsonResponse.php#L86-L91 |
203,302 | RhubarbPHP/Scaffold.BackgroundTasks | src/Task.php | Task.initiate | public static function initiate($settings)
{
// Create an entry in our database.
$taskStatus = new BackgroundTaskStatus();
$taskStatus->TaskClass = get_called_class();
$taskStatus->TaskSettings = $settings;
$taskStatus->save();
$task = new static();
$additio... | php | public static function initiate($settings)
{
// Create an entry in our database.
$taskStatus = new BackgroundTaskStatus();
$taskStatus->TaskClass = get_called_class();
$taskStatus->TaskSettings = $settings;
$taskStatus->save();
$task = new static();
$additio... | [
"public",
"static",
"function",
"initiate",
"(",
"$",
"settings",
")",
"{",
"// Create an entry in our database.",
"$",
"taskStatus",
"=",
"new",
"BackgroundTaskStatus",
"(",
")",
";",
"$",
"taskStatus",
"->",
"TaskClass",
"=",
"get_called_class",
"(",
")",
";",
... | Initiates execution of the background task.
@param array $settings Settings which will be passed to the execute method of the BackgroundTask (must be JSON serialisable)
@return BackgroundTaskStatus The status object for this task. | [
"Initiates",
"execution",
"of",
"the",
"background",
"task",
"."
] | 92a5feab27599288e8bf39deb522588115838904 | https://github.com/RhubarbPHP/Scaffold.BackgroundTasks/blob/92a5feab27599288e8bf39deb522588115838904/src/Task.php#L71-L107 |
203,303 | heiglandreas/OrgHeiglFileFinder | src/ClassMapList.php | ClassMapList.add | public function add(\SplFileInfo $file)
{
$content = new \Org_Heigl\FileFinder\Service\Tokenlist(file_get_contents($file->getPathname()));
$classname = $content->getClassName();
if (! $classname) {
return;
}
$class = $content->getNamespace();
$class[] = $... | php | public function add(\SplFileInfo $file)
{
$content = new \Org_Heigl\FileFinder\Service\Tokenlist(file_get_contents($file->getPathname()));
$classname = $content->getClassName();
if (! $classname) {
return;
}
$class = $content->getNamespace();
$class[] = $... | [
"public",
"function",
"add",
"(",
"\\",
"SplFileInfo",
"$",
"file",
")",
"{",
"$",
"content",
"=",
"new",
"\\",
"Org_Heigl",
"\\",
"FileFinder",
"\\",
"Service",
"\\",
"Tokenlist",
"(",
"file_get_contents",
"(",
"$",
"file",
"->",
"getPathname",
"(",
")",
... | Add an SPL-File-Info to the filelist
@param \SplFileInfo $file
@return void | [
"Add",
"an",
"SPL",
"-",
"File",
"-",
"Info",
"to",
"the",
"filelist"
] | 189d15b95bec7dc186ef73681463c104831234d8 | https://github.com/heiglandreas/OrgHeiglFileFinder/blob/189d15b95bec7dc186ef73681463c104831234d8/src/ClassMapList.php#L48-L62 |
203,304 | ComPHPPuebla/restful-extensions | src/ComPHPPuebla/Slim/Middleware/CheckOptionsMiddleware.php | CheckOptionsMiddleware.call | public function call()
{
$params = $this->app->router()->getCurrentRoute()->getParams();
$options = $this->model->getOptionsList();
if (isset($params['id'])) {
$options = $this->model->getOptions();
}
if (in_array($this->app->request()->getMethod(), $options)) {... | php | public function call()
{
$params = $this->app->router()->getCurrentRoute()->getParams();
$options = $this->model->getOptionsList();
if (isset($params['id'])) {
$options = $this->model->getOptions();
}
if (in_array($this->app->request()->getMethod(), $options)) {... | [
"public",
"function",
"call",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"app",
"->",
"router",
"(",
")",
"->",
"getCurrentRoute",
"(",
")",
"->",
"getParams",
"(",
")",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"model",
"->",
"getOpt... | Check if the current HTTP method is allowed for the resource being accesed
@see \Slim\Middleware::call() | [
"Check",
"if",
"the",
"current",
"HTTP",
"method",
"is",
"allowed",
"for",
"the",
"resource",
"being",
"accesed"
] | 3dc5e554d7ebe1305eed4cd4ec71a6944316199c | https://github.com/ComPHPPuebla/restful-extensions/blob/3dc5e554d7ebe1305eed4cd4ec71a6944316199c/src/ComPHPPuebla/Slim/Middleware/CheckOptionsMiddleware.php#L27-L43 |
203,305 | Nicklas766/Comment | src/Comment/Modules/ActiveRecordModelExtender.php | ActiveRecordModelExtender.getMD | public function getMD($content)
{
$funcArr = ["yamlfrontmatter", "shortcode", "markdown", "titlefromheader"];
$textFilter = new textFilter();
return $textFilter->parse($content, $funcArr)->text;
} | php | public function getMD($content)
{
$funcArr = ["yamlfrontmatter", "shortcode", "markdown", "titlefromheader"];
$textFilter = new textFilter();
return $textFilter->parse($content, $funcArr)->text;
} | [
"public",
"function",
"getMD",
"(",
"$",
"content",
")",
"{",
"$",
"funcArr",
"=",
"[",
"\"yamlfrontmatter\"",
",",
"\"shortcode\"",
",",
"\"markdown\"",
",",
"\"titlefromheader\"",
"]",
";",
"$",
"textFilter",
"=",
"new",
"textFilter",
"(",
")",
";",
"retur... | Return markdown based on string
@param string $content unparsed markdown
@return string as parsed markdown | [
"Return",
"markdown",
"based",
"on",
"string"
] | 1483eaf1ebb120b8bd6c2a1552c084b3a288ff25 | https://github.com/Nicklas766/Comment/blob/1483eaf1ebb120b8bd6c2a1552c084b3a288ff25/src/Comment/Modules/ActiveRecordModelExtender.php#L42-L47 |
203,306 | the-eater/odango.php | src/NyaaCollector.php | NyaaCollector.getFeed | protected function getFeed($query, $options)
{
$options = array_merge(['query' => $query], $options);
$nyaa = $this->getNyaa();
$feed = $nyaa->getFeed($options);
$matcher = $this->getMatcher();
return array_filter($feed, function ($item) use ($matcher, $query) {
$title = $item->getMe... | php | protected function getFeed($query, $options)
{
$options = array_merge(['query' => $query], $options);
$nyaa = $this->getNyaa();
$feed = $nyaa->getFeed($options);
$matcher = $this->getMatcher();
return array_filter($feed, function ($item) use ($matcher, $query) {
$title = $item->getMe... | [
"protected",
"function",
"getFeed",
"(",
"$",
"query",
",",
"$",
"options",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'query'",
"=>",
"$",
"query",
"]",
",",
"$",
"options",
")",
";",
"$",
"nyaa",
"=",
"$",
"this",
"->",
"getNyaa",
"... | Gets the torrent feed for given query and options
@param string $query Query to search for in the nyaa feed
@param array $options Options for the nyaa feed
@return NyaaTorrent[] | [
"Gets",
"the",
"torrent",
"feed",
"for",
"given",
"query",
"and",
"options"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaCollector.php#L63-L75 |
203,307 | the-eater/odango.php | src/NyaaCollector.php | NyaaCollector.filterDuplicates | public function filterDuplicates($torrents)
{
$arr = [];
foreach ($torrents as $torrent) {
$arr[$torrent->getTorrentId()] = $torrent;
}
return array_values($arr);
} | php | public function filterDuplicates($torrents)
{
$arr = [];
foreach ($torrents as $torrent) {
$arr[$torrent->getTorrentId()] = $torrent;
}
return array_values($arr);
} | [
"public",
"function",
"filterDuplicates",
"(",
"$",
"torrents",
")",
"{",
"$",
"arr",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"torrents",
"as",
"$",
"torrent",
")",
"{",
"$",
"arr",
"[",
"$",
"torrent",
"->",
"getTorrentId",
"(",
")",
"]",
"=",
"$... | Return list with unique torrents from given array
@param NyaaTorrent[] The list to filter duplicates out
@param NyaaTorrent[] | [
"Return",
"list",
"with",
"unique",
"torrents",
"from",
"given",
"array"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaCollector.php#L83-L92 |
203,308 | the-eater/odango.php | src/NyaaCollector.php | NyaaCollector.mapByHash | public function mapByHash($feed)
{
$torrents = [];
foreach ($feed as $torrent) {
$hash = $torrent->getSeriesHash();
if(!isset($torrents[$hash])) {
$torrents[$hash] = new NyaaSet($hash);
}
$torrents[$hash]->add($torrent);
}
return $torrents;
} | php | public function mapByHash($feed)
{
$torrents = [];
foreach ($feed as $torrent) {
$hash = $torrent->getSeriesHash();
if(!isset($torrents[$hash])) {
$torrents[$hash] = new NyaaSet($hash);
}
$torrents[$hash]->add($torrent);
}
return $torrents;
} | [
"public",
"function",
"mapByHash",
"(",
"$",
"feed",
")",
"{",
"$",
"torrents",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"feed",
"as",
"$",
"torrent",
")",
"{",
"$",
"hash",
"=",
"$",
"torrent",
"->",
"getSeriesHash",
"(",
")",
";",
"if",
"(",
"!... | Maps the torrents by series hash and collects them in a NyaaSet
@param NyaaTorrent[] list of torrents to be mapped
@param NyaaSet[] | [
"Maps",
"the",
"torrents",
"by",
"series",
"hash",
"and",
"collects",
"them",
"in",
"a",
"NyaaSet"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaCollector.php#L100-L115 |
203,309 | the-eater/odango.php | src/NyaaCollector.php | NyaaCollector.collectForUser | public function collectForUser($query, $users, $options = [])
{
$bigFeed = [];
foreach ($users as $userId) {
$userOptions = array_merge($options, ['user' => $userId]);
$userFeed = $this->getFeed($query, $userOptions);
$bigFeed = array_merge($bigFeed, $userFeed);
}
$bigFeed = $this-... | php | public function collectForUser($query, $users, $options = [])
{
$bigFeed = [];
foreach ($users as $userId) {
$userOptions = array_merge($options, ['user' => $userId]);
$userFeed = $this->getFeed($query, $userOptions);
$bigFeed = array_merge($bigFeed, $userFeed);
}
$bigFeed = $this-... | [
"public",
"function",
"collectForUser",
"(",
"$",
"query",
",",
"$",
"users",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"bigFeed",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"users",
"as",
"$",
"userId",
")",
"{",
"$",
"userOptions",
"=",
... | Searches for torrents per user
@param string $query The query to search for
@param int[] $users The users to search in
@param array $options extra options for the nyaa feed
@return NyaaSet[] | [
"Searches",
"for",
"torrents",
"per",
"user"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaCollector.php#L125-L138 |
203,310 | the-eater/odango.php | src/NyaaCollector.php | NyaaCollector.collectRecursive | public function collectRecursive($query, $options = [])
{
$feed = $this->getFeed($query, $options);
$userIds = [];
foreach ($feed as $torrent) {
if (!isset($userIds[$torrent->getSeriesHash()])) {
$userIds[$torrent->getSeriesHash()] = $torrent->getUserId();
}
}
$userIds = arr... | php | public function collectRecursive($query, $options = [])
{
$feed = $this->getFeed($query, $options);
$userIds = [];
foreach ($feed as $torrent) {
if (!isset($userIds[$torrent->getSeriesHash()])) {
$userIds[$torrent->getSeriesHash()] = $torrent->getUserId();
}
}
$userIds = arr... | [
"public",
"function",
"collectRecursive",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"feed",
"=",
"$",
"this",
"->",
"getFeed",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"$",
"userIds",
"=",
"[",
"]",
";",
"fore... | Searches for torrent and searches for each found torrent in their user for more torrents, to create complete sets
@param string $query The query to search for
@param array $options Extra options for the nyaa feed
@return NyaaSet[] | [
"Searches",
"for",
"torrent",
"and",
"searches",
"for",
"each",
"found",
"torrent",
"in",
"their",
"user",
"for",
"more",
"torrents",
"to",
"create",
"complete",
"sets"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaCollector.php#L147-L162 |
203,311 | the-eater/odango.php | src/NyaaCollector.php | NyaaCollector.collect | public function collect($query, $options = [])
{
if (!$this->getNyaa()->canProvideAllData()) {
return $this->collectRecursive($query, $options);
}
return $this->collectSingleFeed($query, $options);
} | php | public function collect($query, $options = [])
{
if (!$this->getNyaa()->canProvideAllData()) {
return $this->collectRecursive($query, $options);
}
return $this->collectSingleFeed($query, $options);
} | [
"public",
"function",
"collect",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getNyaa",
"(",
")",
"->",
"canProvideAllData",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"collectRecursive",
... | Searches for torrents by query and returns sets created from it
Collects recursively if backend doesn't provide all data
@param string $query The query to search for
@param array $options Extra options for the nyaa feed | [
"Searches",
"for",
"torrents",
"by",
"query",
"and",
"returns",
"sets",
"created",
"from",
"it",
"Collects",
"recursively",
"if",
"backend",
"doesn",
"t",
"provide",
"all",
"data"
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaCollector.php#L171-L179 |
203,312 | the-eater/odango.php | src/NyaaCollector.php | NyaaCollector.collectSingleFeed | public function collectSingleFeed($query, $options = [])
{
$feed = $this->getFeed($query, $options);
return $this->mapByHash($feed);
} | php | public function collectSingleFeed($query, $options = [])
{
$feed = $this->getFeed($query, $options);
return $this->mapByHash($feed);
} | [
"public",
"function",
"collectSingleFeed",
"(",
"$",
"query",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"feed",
"=",
"$",
"this",
"->",
"getFeed",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"return",
"$",
"this",
"->",
"mapByHash",
... | Searches for torrents by query and returns sets created from it, only fetches one feed.
@param string $query
@param array $options | [
"Searches",
"for",
"torrents",
"by",
"query",
"and",
"returns",
"sets",
"created",
"from",
"it",
"only",
"fetches",
"one",
"feed",
"."
] | 6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f | https://github.com/the-eater/odango.php/blob/6c78f983e7b3c49ff2f8a10ce7299747d3c82e3f/src/NyaaCollector.php#L187-L192 |
203,313 | praxigento/mobi_mod_downline | Block/Customer/Account/Reflink.php | Reflink.getDwnlCustomer | private function getDwnlCustomer()
{
if (is_null($this->cacheDwnlCust)) {
$custId = $this->session->getCustomerId();
$this->cacheDwnlCust = $this->daoDwnlCust->getById($custId);
}
return $this->cacheDwnlCust;
} | php | private function getDwnlCustomer()
{
if (is_null($this->cacheDwnlCust)) {
$custId = $this->session->getCustomerId();
$this->cacheDwnlCust = $this->daoDwnlCust->getById($custId);
}
return $this->cacheDwnlCust;
} | [
"private",
"function",
"getDwnlCustomer",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"cacheDwnlCust",
")",
")",
"{",
"$",
"custId",
"=",
"$",
"this",
"->",
"session",
"->",
"getCustomerId",
"(",
")",
";",
"$",
"this",
"->",
"cacheDwnl... | Cached data for current downline customer.
@return \Praxigento\Downline\Repo\Data\Customer | [
"Cached",
"data",
"for",
"current",
"downline",
"customer",
"."
] | 0f3c276dfff1aa029f9fd205ccfc56f207a2e75b | https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Block/Customer/Account/Reflink.php#L44-L51 |
203,314 | LIN3S/CMSKernel | src/LIN3S/CMSKernel/Infrastructure/Lin3sAdminBundle/Twig/TwigActionTranslationFilter.php | TwigActionTranslationFilter.actionTranslation | public function actionTranslation($options)
{
if (!is_array($options)) {
return $this->translator->trans($options, [], 'CmsKernelAdminBridge');
}
$resultOptions = [];
foreach ($options as $optionKey => $option) {
$option = null === json_decode($option, true) ... | php | public function actionTranslation($options)
{
if (!is_array($options)) {
return $this->translator->trans($options, [], 'CmsKernelAdminBridge');
}
$resultOptions = [];
foreach ($options as $optionKey => $option) {
$option = null === json_decode($option, true) ... | [
"public",
"function",
"actionTranslation",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"options",
")",
")",
"{",
"return",
"$",
"this",
"->",
"translator",
"->",
"trans",
"(",
"$",
"options",
",",
"[",
"]",
",",
"'CmsKernelAdmi... | Callback of action translation Twig filter that returns resultant array.
@param string $options The action options
@return array|string | [
"Callback",
"of",
"action",
"translation",
"Twig",
"filter",
"that",
"returns",
"resultant",
"array",
"."
] | 71b5fc1930cd60d6eac1a9816df34af4654f9a7e | https://github.com/LIN3S/CMSKernel/blob/71b5fc1930cd60d6eac1a9816df34af4654f9a7e/src/LIN3S/CMSKernel/Infrastructure/Lin3sAdminBundle/Twig/TwigActionTranslationFilter.php#L57-L89 |
203,315 | K-Phoen/rulerz-bridge | Form/SpecificationToBooleanTransformer.php | SpecificationToBooleanTransformer.reverseTransform | public function reverseTransform($boolean)
{
if (!$boolean) {
return null;
}
$rClass = new \ReflectionClass($this->specificationClass);
if ($rClass->getConstructor() && $rClass->getConstructor()->getNumberOfParameters() > 0) {
return $rClass->newInstanceArgs... | php | public function reverseTransform($boolean)
{
if (!$boolean) {
return null;
}
$rClass = new \ReflectionClass($this->specificationClass);
if ($rClass->getConstructor() && $rClass->getConstructor()->getNumberOfParameters() > 0) {
return $rClass->newInstanceArgs... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"boolean",
")",
"{",
"if",
"(",
"!",
"$",
"boolean",
")",
"{",
"return",
"null",
";",
"}",
"$",
"rClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"specificationClass",
")",
";",
"... | Transforms a value into a specification.
@param bool $boolean
@return \RulerZ\Spec\Specification|null | [
"Transforms",
"a",
"value",
"into",
"a",
"specification",
"."
] | fdad5856b669d59b5e4bda47c4e927a0485bf7a0 | https://github.com/K-Phoen/rulerz-bridge/blob/fdad5856b669d59b5e4bda47c4e927a0485bf7a0/Form/SpecificationToBooleanTransformer.php#L48-L61 |
203,316 | schpill/thin | src/Request.php | Request.detectEnv | public static function detectEnv(array $environments, $uri)
{
foreach ($environments as $environment => $patterns) {
// Essentially we just want to loop through each environment pattern
// and determine if the current URI matches the pattern and if so
... | php | public static function detectEnv(array $environments, $uri)
{
foreach ($environments as $environment => $patterns) {
// Essentially we just want to loop through each environment pattern
// and determine if the current URI matches the pattern and if so
... | [
"public",
"static",
"function",
"detectEnv",
"(",
"array",
"$",
"environments",
",",
"$",
"uri",
")",
"{",
"foreach",
"(",
"$",
"environments",
"as",
"$",
"environment",
"=>",
"$",
"patterns",
")",
"{",
"// Essentially we just want to loop through each environment p... | Detect the current environment from an environment configuration.
@param array $environments
@param string $uri
@return string|null | [
"Detect",
"the",
"current",
"environment",
"from",
"an",
"environment",
"configuration",
"."
] | a9102d9d6f70e8b0f6be93153f70849f46489ee1 | https://github.com/schpill/thin/blob/a9102d9d6f70e8b0f6be93153f70849f46489ee1/src/Request.php#L231-L243 |
203,317 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.setEntry | public function setEntry($var = null, $val = null, $section = false)
{
if (!empty($var)) {
if ($section) {
if (!isset($this->registry[$section])) {
$this->registry[$section] = array();
}
$this->registry[$section][$var] = $val;
... | php | public function setEntry($var = null, $val = null, $section = false)
{
if (!empty($var)) {
if ($section) {
if (!isset($this->registry[$section])) {
$this->registry[$section] = array();
}
$this->registry[$section][$var] = $val;
... | [
"public",
"function",
"setEntry",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"val",
"=",
"null",
",",
"$",
"section",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"var",
")",
")",
"{",
"if",
"(",
"$",
"section",
")",
"{",
"if",
"("... | Set an entry in the instance registry
@param null|string $var The variable name to set
@param null|mixed $val The variable value to set
@param false|string $section A section name in the registry (default is FALSE)
@return self | [
"Set",
"an",
"entry",
"in",
"the",
"instance",
"registry"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L102-L115 |
203,318 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.getEntry | public function getEntry($var = null, $section = false, $default = null)
{
if (!empty($var)) {
if (!empty($section) && isset($this->registry[$section]) && isset($this->registry[$section][$var])) {
return $this->registry[$section][$var];
} elseif (isset($this->registry... | php | public function getEntry($var = null, $section = false, $default = null)
{
if (!empty($var)) {
if (!empty($section) && isset($this->registry[$section]) && isset($this->registry[$section][$var])) {
return $this->registry[$section][$var];
} elseif (isset($this->registry... | [
"public",
"function",
"getEntry",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"section",
"=",
"false",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"var",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"section"... | Get an entry from the instance registry
@param string $var The variable name to get
@param string $section A section name in the registry (default is FALSE)
@param mixed $default The default value to return if it is not in registry (default is NULL)
@return mixed The value found or $default | [
"Get",
"an",
"entry",
"from",
"the",
"instance",
"registry"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L143-L153 |
203,319 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.isEntry | public function isEntry($var = null, $section = false)
{
return (
!empty($var) and (
(!empty($section) && isset($this->registry[$section]) && isset($this->registry[$section][$var])) or
isset($this->registry[$var])
)
);
} | php | public function isEntry($var = null, $section = false)
{
return (
!empty($var) and (
(!empty($section) && isset($this->registry[$section]) && isset($this->registry[$section][$var])) or
isset($this->registry[$var])
)
);
} | [
"public",
"function",
"isEntry",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"section",
"=",
"false",
")",
"{",
"return",
"(",
"!",
"empty",
"(",
"$",
"var",
")",
"and",
"(",
"(",
"!",
"empty",
"(",
"$",
"section",
")",
"&&",
"isset",
"(",
"$",
"th... | Check if an entry exists in registry
@param string $var The variable name to check
@param string $section A section name in the registry (default is FALSE)
@return bool | [
"Check",
"if",
"an",
"entry",
"exists",
"in",
"registry"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L162-L170 |
203,320 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.getKey | public function getKey($val = null, $var = null, $section = false)
{
if (!empty($val)) {
if (!empty($var)) {
foreach ($this->registry as $_sct=>$_data) {
if ($ok=array_search($val, $_data) && $ok==$var) {
return $_sct;
... | php | public function getKey($val = null, $var = null, $section = false)
{
if (!empty($val)) {
if (!empty($var)) {
foreach ($this->registry as $_sct=>$_data) {
if ($ok=array_search($val, $_data) && $ok==$var) {
return $_sct;
... | [
"public",
"function",
"getKey",
"(",
"$",
"val",
"=",
"null",
",",
"$",
"var",
"=",
"null",
",",
"$",
"section",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"val",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"var",
")",
... | Search a key in registry
@param mixed $val The variable value to find
@param string $var The variable name to search in (in case of array)
@param string $section A section name in the registry (default is FALSE)
@return string|null The key found in the registry | [
"Search",
"a",
"key",
"in",
"registry"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L180-L195 |
203,321 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.dumpStack | public function dumpStack($index = null, $default = null)
{
if (array_key_exists($index, $this->registry_stacks)) {
return $this->registry_stacks[$index];
}
return $default;
} | php | public function dumpStack($index = null, $default = null)
{
if (array_key_exists($index, $this->registry_stacks)) {
return $this->registry_stacks[$index];
}
return $default;
} | [
"public",
"function",
"dumpStack",
"(",
"$",
"index",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"registry_stacks",
")",
")",
"{",
"return",
"$",
"this",
"->",
"r... | Get a full stack from registry stacks
@param string $index The stack index
@param mixed $default The default value to return if it is not in registry (default is NULL)
@return mixed The requested stack entry if so | [
"Get",
"a",
"full",
"stack",
"from",
"registry",
"stacks"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L208-L214 |
203,322 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.saveStack | public function saveStack($index = null, $and_clean = false)
{
$this->registry_stacks[$index] = $this->registry;
if ($and_clean===true) {
$this->registry=array();
}
return $this;
} | php | public function saveStack($index = null, $and_clean = false)
{
$this->registry_stacks[$index] = $this->registry;
if ($and_clean===true) {
$this->registry=array();
}
return $this;
} | [
"public",
"function",
"saveStack",
"(",
"$",
"index",
"=",
"null",
",",
"$",
"and_clean",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"registry_stacks",
"[",
"$",
"index",
"]",
"=",
"$",
"this",
"->",
"registry",
";",
"if",
"(",
"$",
"and_clean",
"===... | Save a stack of entries in registry
@param string $index The stack index
@param bool $and_clean Clean the actual registry after recorded the stack (default is FALSE)
@return self | [
"Save",
"a",
"stack",
"of",
"entries",
"in",
"registry"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L223-L230 |
203,323 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.getStackEntry | public function getStackEntry($var = null, $section = false, $stack = null, $default = null)
{
if (!empty($var)) {
if (!empty($stack) && $this->isStack($stack)) {
$tmp_stack = $this->registry;
$this->loadStack($stack);
$val = $this->getEntry($var, ... | php | public function getStackEntry($var = null, $section = false, $stack = null, $default = null)
{
if (!empty($var)) {
if (!empty($stack) && $this->isStack($stack)) {
$tmp_stack = $this->registry;
$this->loadStack($stack);
$val = $this->getEntry($var, ... | [
"public",
"function",
"getStackEntry",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"section",
"=",
"false",
",",
"$",
"stack",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"var",
")",
")",
"{",
"if",
"... | Get a stack entry of the registry stacks
@param string $var The variable name to search
@param string $section A section name in the registry (default is FALSE)
@param string $stack The stack name to search in
@param mixed $default The default value to return if it is not in registry (de... | [
"Get",
"a",
"stack",
"entry",
"of",
"the",
"registry",
"stacks"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L264-L276 |
203,324 | atelierspierrot/patterns | src/Patterns/Commons/Registry.php | Registry.getStackKey | public function getStackKey($val = null, $section = false, $stack = null, $default = null)
{
if (!empty($val)) {
if (!empty($stack) && $this->isStack($stack)) {
$tmp_stack = $this->registry;
$this->loadStack($stack);
$var = $this->getKey($val, $sec... | php | public function getStackKey($val = null, $section = false, $stack = null, $default = null)
{
if (!empty($val)) {
if (!empty($stack) && $this->isStack($stack)) {
$tmp_stack = $this->registry;
$this->loadStack($stack);
$var = $this->getKey($val, $sec... | [
"public",
"function",
"getStackKey",
"(",
"$",
"val",
"=",
"null",
",",
"$",
"section",
"=",
"false",
",",
"$",
"stack",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"val",
")",
")",
"{",
"if",
"("... | Get the key of a stack entry of the registry stacks
@param string $val The variable value to search
@param string $section A section name in the registry (default is FALSE)
@param string $stack The stack name to search in
@param mixed $default The default value to return if it is not in ... | [
"Get",
"the",
"key",
"of",
"a",
"stack",
"entry",
"of",
"the",
"registry",
"stacks"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Commons/Registry.php#L287-L299 |
203,325 | ben-gibson/foursquare-venue-client | src/Factory/Tip/TipFactory.php | TipFactory.create | public function create(Description $description)
{
return new Tip(
new Identifier($description->getMandatoryProperty('id')),
$description->getMandatoryProperty('text'),
$description->getMandatoryProperty('type'),
$description->getMandatoryProperty('agreeCount'... | php | public function create(Description $description)
{
return new Tip(
new Identifier($description->getMandatoryProperty('id')),
$description->getMandatoryProperty('text'),
$description->getMandatoryProperty('type'),
$description->getMandatoryProperty('agreeCount'... | [
"public",
"function",
"create",
"(",
"Description",
"$",
"description",
")",
"{",
"return",
"new",
"Tip",
"(",
"new",
"Identifier",
"(",
"$",
"description",
"->",
"getMandatoryProperty",
"(",
"'id'",
")",
")",
",",
"$",
"description",
"->",
"getMandatoryProper... | Create a tip from a description.
@param Description $description The tip description.
@return Tip | [
"Create",
"a",
"tip",
"from",
"a",
"description",
"."
] | ce5e7c308f87d5ccc28ab8d27a9cb51bd106d969 | https://github.com/ben-gibson/foursquare-venue-client/blob/ce5e7c308f87d5ccc28ab8d27a9cb51bd106d969/src/Factory/Tip/TipFactory.php#L21-L30 |
203,326 | PHPColibri/framework | Util/File.php | File.getMimeType | public static function getMimeType($filePath)
{
$fInfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($fInfo, $filePath);
finfo_close($fInfo);
return $mime;
} | php | public static function getMimeType($filePath)
{
$fInfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($fInfo, $filePath);
finfo_close($fInfo);
return $mime;
} | [
"public",
"static",
"function",
"getMimeType",
"(",
"$",
"filePath",
")",
"{",
"$",
"fInfo",
"=",
"finfo_open",
"(",
"FILEINFO_MIME_TYPE",
")",
";",
"$",
"mime",
"=",
"finfo_file",
"(",
"$",
"fInfo",
",",
"$",
"filePath",
")",
";",
"finfo_close",
"(",
"$... | Get mime-type og the file.
@param string $filePath
@throws \Exception
@return string string with mime-type like 'image/jpeg' & etc | [
"Get",
"mime",
"-",
"type",
"og",
"the",
"file",
"."
] | 7e5b77141da5e5e7c63afc83592671321ac52f36 | https://github.com/PHPColibri/framework/blob/7e5b77141da5e5e7c63afc83592671321ac52f36/Util/File.php#L18-L25 |
203,327 | atelierspierrot/patterns | src/Patterns/Abstracts/AbstractSingleton.php | AbstractSingleton.createInstance | private static function createInstance($classname, array $arguments = array())
{
$reflection_obj = new ReflectionClass($classname);
if ($reflection_obj->getMethod('__construct')->isPublic()) {
self::$_instances[ $classname ] = call_user_func_array(array($reflection_obj, 'newInstance'), $... | php | private static function createInstance($classname, array $arguments = array())
{
$reflection_obj = new ReflectionClass($classname);
if ($reflection_obj->getMethod('__construct')->isPublic()) {
self::$_instances[ $classname ] = call_user_func_array(array($reflection_obj, 'newInstance'), $... | [
"private",
"static",
"function",
"createInstance",
"(",
"$",
"classname",
",",
"array",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"$",
"reflection_obj",
"=",
"new",
"ReflectionClass",
"(",
"$",
"classname",
")",
";",
"if",
"(",
"$",
"reflection_o... | Real object instances creation
@param string $classname The classname to create object from
@param array $arguments The arguments to pass to the `__construct` or `init` method
@return void | [
"Real",
"object",
"instances",
"creation"
] | b7a8313e98bbfb6525e1672d0a726a1ead6f156e | https://github.com/atelierspierrot/patterns/blob/b7a8313e98bbfb6525e1672d0a726a1ead6f156e/src/Patterns/Abstracts/AbstractSingleton.php#L124-L144 |
203,328 | harp-orm/harp | src/Rel/AbstractRel.php | AbstractRel.linkModels | public function linkModels(Models $models, Models $foreign, Closure $yield)
{
foreach ($models as $model) {
$linked = [];
foreach ($foreign as $foreignModel) {
if ($this->areLinked($model, $foreignModel)) {
$linked []= $foreignModel;
... | php | public function linkModels(Models $models, Models $foreign, Closure $yield)
{
foreach ($models as $model) {
$linked = [];
foreach ($foreign as $foreignModel) {
if ($this->areLinked($model, $foreignModel)) {
$linked []= $foreignModel;
... | [
"public",
"function",
"linkModels",
"(",
"Models",
"$",
"models",
",",
"Models",
"$",
"foreign",
",",
"Closure",
"$",
"yield",
")",
"{",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"$",
"linked",
"=",
"[",
"]",
";",
"foreach",
"(",
... | Iterate models and foreign models one by one and and assign links based on the areLinked method
Yeild the resulted links one by one for further processing.
@param Models $models
@param Models $foreign
@param Closure $yield call for each link | [
"Iterate",
"models",
"and",
"foreign",
"models",
"one",
"by",
"one",
"and",
"and",
"assign",
"links",
"based",
"on",
"the",
"areLinked",
"method",
"Yeild",
"the",
"resulted",
"links",
"one",
"by",
"one",
"for",
"further",
"processing",
"."
] | e0751696521164c86ccd0a76d708df490efd8306 | https://github.com/harp-orm/harp/blob/e0751696521164c86ccd0a76d708df490efd8306/src/Rel/AbstractRel.php#L165-L181 |
203,329 | praxisnetau/silverware-navigation | src/Model/LinkHolder.php | LinkHolder.getEnabledLinks | public function getEnabledLinks()
{
switch ($this->LinkMode) {
case self::MODE_PAGES:
$links = ArrayList::create();
foreach ($this->LinkedPages() as $page) {
$link = $page->toLink();
... | php | public function getEnabledLinks()
{
switch ($this->LinkMode) {
case self::MODE_PAGES:
$links = ArrayList::create();
foreach ($this->LinkedPages() as $page) {
$link = $page->toLink();
... | [
"public",
"function",
"getEnabledLinks",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"LinkMode",
")",
"{",
"case",
"self",
"::",
"MODE_PAGES",
":",
"$",
"links",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
... | Answers a list of the enabled links within the receiver.
@return ArrayList | [
"Answers",
"a",
"list",
"of",
"the",
"enabled",
"links",
"within",
"the",
"receiver",
"."
] | 04e6f3003c2871348d5bba7869d4fc273641627e | https://github.com/praxisnetau/silverware-navigation/blob/04e6f3003c2871348d5bba7869d4fc273641627e/src/Model/LinkHolder.php#L316-L341 |
203,330 | atelierspierrot/templatengine | src/TemplateEngine/TemplateObject/CssFile.php | CssFile.addIfExists | public function addIfExists($file_path, $media = 'screen', $condition = null)
{
$_fp = $this->__template->findAsset($file_path);
if ($_fp || \AssetsManager\Loader::isUrl($file_path)) {
return $this->add($file_path, $media, $condition);
}
return $this;
} | php | public function addIfExists($file_path, $media = 'screen', $condition = null)
{
$_fp = $this->__template->findAsset($file_path);
if ($_fp || \AssetsManager\Loader::isUrl($file_path)) {
return $this->add($file_path, $media, $condition);
}
return $this;
} | [
"public",
"function",
"addIfExists",
"(",
"$",
"file_path",
",",
"$",
"media",
"=",
"'screen'",
",",
"$",
"condition",
"=",
"null",
")",
"{",
"$",
"_fp",
"=",
"$",
"this",
"->",
"__template",
"->",
"findAsset",
"(",
"$",
"file_path",
")",
";",
"if",
... | Add a CSS file in CSS stack if it exists
@param string $file_path The new CSS path
@param string $media The media type for the CSS file (default is "screen")
@param string|null $condition Define a condition (for IE) for this stylesheet
@return self | [
"Add",
"a",
"CSS",
"file",
"in",
"CSS",
"stack",
"if",
"it",
"exists"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/TemplateEngine/TemplateObject/CssFile.php#L70-L77 |
203,331 | atelierspierrot/templatengine | src/TemplateEngine/TemplateObject/CssFile.php | CssFile.add | public function add($file_path, $media = 'screen', $condition = null)
{
$_fp = $this->__template->findAsset($file_path);
if ($_fp || \AssetsManager\Loader::isUrl($file_path)) {
$this->registry->addEntry(array(
'file'=>$_fp, 'media'=>$media, 'condition'=>$condition
... | php | public function add($file_path, $media = 'screen', $condition = null)
{
$_fp = $this->__template->findAsset($file_path);
if ($_fp || \AssetsManager\Loader::isUrl($file_path)) {
$this->registry->addEntry(array(
'file'=>$_fp, 'media'=>$media, 'condition'=>$condition
... | [
"public",
"function",
"add",
"(",
"$",
"file_path",
",",
"$",
"media",
"=",
"'screen'",
",",
"$",
"condition",
"=",
"null",
")",
"{",
"$",
"_fp",
"=",
"$",
"this",
"->",
"__template",
"->",
"findAsset",
"(",
"$",
"file_path",
")",
";",
"if",
"(",
"... | Add a CSS file in CSS stack
@param string $file_path The new CSS path
@param string $media The media type for the CSS file (default is "screen")
@param string|null $condition Define a condition (for IE) for this stylesheet
@return self
@throws \InvalidArgumentException if the path doesn't exist | [
"Add",
"a",
"CSS",
"file",
"in",
"CSS",
"stack"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/TemplateEngine/TemplateObject/CssFile.php#L88-L101 |
203,332 | atelierspierrot/templatengine | src/TemplateEngine/TemplateObject/CssFile.php | CssFile.set | public function set(array $files)
{
if (!empty($files)) {
foreach ($files as $_file) {
if (is_array($_file) && isset($_file['file'])) {
$this->add(
$_file['file'],
isset($_file['media']) ? $_file['media'] : '',
... | php | public function set(array $files)
{
if (!empty($files)) {
foreach ($files as $_file) {
if (is_array($_file) && isset($_file['file'])) {
$this->add(
$_file['file'],
isset($_file['media']) ? $_file['media'] : '',
... | [
"public",
"function",
"set",
"(",
"array",
"$",
"files",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"files",
")",
")",
"{",
"foreach",
"(",
"$",
"files",
"as",
"$",
"_file",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"_file",
")",
"&&",
"isse... | Set a full CSS stack
@param array $files An array of CSS files paths
@return self
@see self::add() | [
"Set",
"a",
"full",
"CSS",
"stack"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/TemplateEngine/TemplateObject/CssFile.php#L110-L126 |
203,333 | atelierspierrot/templatengine | src/TemplateEngine/TemplateObject/CssFile.php | CssFile.addMerged | public function addMerged($file_path, $media = 'screen')
{
$_fp = $this->__template->findAsset($file_path);
if ($_fp || \AssetsManager\Loader::isUrl($file_path)) {
$this->registry->addEntry(array(
'file'=>$_fp, 'media'=>$media
), 'css_merged_files');
}... | php | public function addMerged($file_path, $media = 'screen')
{
$_fp = $this->__template->findAsset($file_path);
if ($_fp || \AssetsManager\Loader::isUrl($file_path)) {
$this->registry->addEntry(array(
'file'=>$_fp, 'media'=>$media
), 'css_merged_files');
}... | [
"public",
"function",
"addMerged",
"(",
"$",
"file_path",
",",
"$",
"media",
"=",
"'screen'",
")",
"{",
"$",
"_fp",
"=",
"$",
"this",
"->",
"__template",
"->",
"findAsset",
"(",
"$",
"file_path",
")",
";",
"if",
"(",
"$",
"_fp",
"||",
"\\",
"AssetsMa... | Add an merged file
@param string $file_path The new CSS path
@param string $media The media type for the CSS file (default is "screen")
@return self
@throws \InvalidArgumentException if the path doesn't exist | [
"Add",
"an",
"merged",
"file"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/TemplateEngine/TemplateObject/CssFile.php#L210-L223 |
203,334 | atelierspierrot/templatengine | src/TemplateEngine/TemplateObject/CssFile.php | CssFile.writeMinified | public function writeMinified($mask = '%s')
{
$str='';
foreach ($this->cleanStack($this->getMinified(), 'file') as $entry) {
$tag_attrs = array(
'rel'=>'stylesheet',
'type'=>'text/css',
'href'=>$entry['file']
);
if (... | php | public function writeMinified($mask = '%s')
{
$str='';
foreach ($this->cleanStack($this->getMinified(), 'file') as $entry) {
$tag_attrs = array(
'rel'=>'stylesheet',
'type'=>'text/css',
'href'=>$entry['file']
);
if (... | [
"public",
"function",
"writeMinified",
"(",
"$",
"mask",
"=",
"'%s'",
")",
"{",
"$",
"str",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"cleanStack",
"(",
"$",
"this",
"->",
"getMinified",
"(",
")",
",",
"'file'",
")",
"as",
"$",
"entry",
")... | Write minified versions of the files stack in the cache directory
@param string $mask A mask to write each line via "sprintf()"
@return string The string to display fot this template object | [
"Write",
"minified",
"versions",
"of",
"the",
"files",
"stack",
"in",
"the",
"cache",
"directory"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/TemplateEngine/TemplateObject/CssFile.php#L380-L395 |
203,335 | antaresproject/sample_module | src/Processor/ModuleProcessor.php | ModuleProcessor.form | protected function form(Model $model)
{
$this->breadcrumb->onItem($model);
return app('antares.form')->of('awesone-module-form', function(FormGrid $form) use($model) {
$form->name('My Awesome Module Form');
$form->resourced('antares::sample_module/index', $mo... | php | protected function form(Model $model)
{
$this->breadcrumb->onItem($model);
return app('antares.form')->of('awesone-module-form', function(FormGrid $form) use($model) {
$form->name('My Awesome Module Form');
$form->resourced('antares::sample_module/index', $mo... | [
"protected",
"function",
"form",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"breadcrumb",
"->",
"onItem",
"(",
"$",
"model",
")",
";",
"return",
"app",
"(",
"'antares.form'",
")",
"->",
"of",
"(",
"'awesone-module-form'",
",",
"function",
"... | Generowanie nowego obiektu formularza
@param Model $model
@return \Antares\Html\Form\FormBuilder | [
"Generowanie",
"nowego",
"obiektu",
"formularza"
] | aceab14f392c25e32729018518e9d6b4e6fe23db | https://github.com/antaresproject/sample_module/blob/aceab14f392c25e32729018518e9d6b4e6fe23db/src/Processor/ModuleProcessor.php#L101-L156 |
203,336 | antaresproject/sample_module | src/Processor/ModuleProcessor.php | ModuleProcessor.store | public function store()
{
$input = Input::all();
$user = auth()->user();
$attributes = [
'user_id' => $user->hasRoles('member') ? $user->id : array_get($input, 'user'),
'name' => array_get($input, 'name'),
'value' => array_only($input, ['fi... | php | public function store()
{
$input = Input::all();
$user = auth()->user();
$attributes = [
'user_id' => $user->hasRoles('member') ? $user->id : array_get($input, 'user'),
'name' => array_get($input, 'name'),
'value' => array_only($input, ['fi... | [
"public",
"function",
"store",
"(",
")",
"{",
"$",
"input",
"=",
"Input",
"::",
"all",
"(",
")",
";",
"$",
"user",
"=",
"auth",
"(",
")",
"->",
"user",
"(",
")",
";",
"$",
"attributes",
"=",
"[",
"'user_id'",
"=>",
"$",
"user",
"->",
"hasRoles",
... | When stores form fields in database
@return \Illuminate\Http\RedirectResponse | [
"When",
"stores",
"form",
"fields",
"in",
"database"
] | aceab14f392c25e32729018518e9d6b4e6fe23db | https://github.com/antaresproject/sample_module/blob/aceab14f392c25e32729018518e9d6b4e6fe23db/src/Processor/ModuleProcessor.php#L173-L194 |
203,337 | antaresproject/sample_module | src/Processor/ModuleProcessor.php | ModuleProcessor.update | public function update($id)
{
$model = ModuleRow::withoutGlobalScopes()->findOrFail($id);
if (!request()->isMethod('put')) {
$form = $this->form($model);
} else {
$input = Input::all();
$user = auth()->user();
if (!$user->hasRoles('member'))... | php | public function update($id)
{
$model = ModuleRow::withoutGlobalScopes()->findOrFail($id);
if (!request()->isMethod('put')) {
$form = $this->form($model);
} else {
$input = Input::all();
$user = auth()->user();
if (!$user->hasRoles('member'))... | [
"public",
"function",
"update",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"ModuleRow",
"::",
"withoutGlobalScopes",
"(",
")",
"->",
"findOrFail",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"request",
"(",
")",
"->",
"isMethod",
"(",
"'put'",
")",
... | When updates form fields in database
@param mixes $id
@return \Illuminate\Http\RedirectResponse | [
"When",
"updates",
"form",
"fields",
"in",
"database"
] | aceab14f392c25e32729018518e9d6b4e6fe23db | https://github.com/antaresproject/sample_module/blob/aceab14f392c25e32729018518e9d6b4e6fe23db/src/Processor/ModuleProcessor.php#L202-L233 |
203,338 | antaresproject/sample_module | src/Processor/ModuleProcessor.php | ModuleProcessor.delete | public function delete($id)
{
$builder = ModuleRow::withoutGlobalScopes();
if (auth()->user()->hasRoles('member')) {
$builder->where(['user_id' => auth()->user()->id]);
}
$model = $builder->findOrFail($id);
$name = $model->name;
if ($model->delete()) {
... | php | public function delete($id)
{
$builder = ModuleRow::withoutGlobalScopes();
if (auth()->user()->hasRoles('member')) {
$builder->where(['user_id' => auth()->user()->id]);
}
$model = $builder->findOrFail($id);
$name = $model->name;
if ($model->delete()) {
... | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"$",
"builder",
"=",
"ModuleRow",
"::",
"withoutGlobalScopes",
"(",
")",
";",
"if",
"(",
"auth",
"(",
")",
"->",
"user",
"(",
")",
"->",
"hasRoles",
"(",
"'member'",
")",
")",
"{",
"$",
"bui... | When deletes item
@param mixed $id
@return \Illuminate\Http\RedirectResponse | [
"When",
"deletes",
"item"
] | aceab14f392c25e32729018518e9d6b4e6fe23db | https://github.com/antaresproject/sample_module/blob/aceab14f392c25e32729018518e9d6b4e6fe23db/src/Processor/ModuleProcessor.php#L241-L255 |
203,339 | kouks/laravel-casters | src/Casters/Caster.php | Caster.cast | public function cast($model)
{
if ($model instanceof Collection) {
return $model->map([$this, 'cast'])->toArray();
}
if (empty($model)) {
return;
}
$transformed = [];
foreach ($this->castRules() as $old => $desired) {
$this->reso... | php | public function cast($model)
{
if ($model instanceof Collection) {
return $model->map([$this, 'cast'])->toArray();
}
if (empty($model)) {
return;
}
$transformed = [];
foreach ($this->castRules() as $old => $desired) {
$this->reso... | [
"public",
"function",
"cast",
"(",
"$",
"model",
")",
"{",
"if",
"(",
"$",
"model",
"instanceof",
"Collection",
")",
"{",
"return",
"$",
"model",
"->",
"map",
"(",
"[",
"$",
"this",
",",
"'cast'",
"]",
")",
"->",
"toArray",
"(",
")",
";",
"}",
"i... | Casts collection fields.
@param mixed $model
@return array | [
"Casts",
"collection",
"fields",
"."
] | 6b5ada1147b658cf2866a9e9573b66ff699edbbf | https://github.com/kouks/laravel-casters/blob/6b5ada1147b658cf2866a9e9573b66ff699edbbf/src/Casters/Caster.php#L35-L52 |
203,340 | kouks/laravel-casters | src/Casters/Caster.php | Caster.resolveCast | private function resolveCast($old, $desired, Model $model, &$transformed)
{
if ($desired instanceof Closure) {
return $transformed[$old] = call_user_func($desired, $model);
}
if (is_string($desired) && strpos($desired, $this->functionSign) !== false) {
return $transf... | php | private function resolveCast($old, $desired, Model $model, &$transformed)
{
if ($desired instanceof Closure) {
return $transformed[$old] = call_user_func($desired, $model);
}
if (is_string($desired) && strpos($desired, $this->functionSign) !== false) {
return $transf... | [
"private",
"function",
"resolveCast",
"(",
"$",
"old",
",",
"$",
"desired",
",",
"Model",
"$",
"model",
",",
"&",
"$",
"transformed",
")",
"{",
"if",
"(",
"$",
"desired",
"instanceof",
"Closure",
")",
"{",
"return",
"$",
"transformed",
"[",
"$",
"old",... | Resolves casts based on supplied array of arguments.
@param string $old
@param string|Closure $desired
@param \Illuminate\Database\Eloquent\Model $model
@param array &$transformed
@return array | [
"Resolves",
"casts",
"based",
"on",
"supplied",
"array",
"of",
"arguments",
"."
] | 6b5ada1147b658cf2866a9e9573b66ff699edbbf | https://github.com/kouks/laravel-casters/blob/6b5ada1147b658cf2866a9e9573b66ff699edbbf/src/Casters/Caster.php#L63-L82 |
203,341 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/Tabs.php | Tabs.render | protected function render()
{
if (null === $this->active) {
$this->setActive(key($this->tabs));
}
$tabs = new ViewModel;
$tabs->tabs = $this->tabs;
$tabs->setTemplate('sxbootstrap/tabs/tabs');
return $this->getView()->render($tabs);
} | php | protected function render()
{
if (null === $this->active) {
$this->setActive(key($this->tabs));
}
$tabs = new ViewModel;
$tabs->tabs = $this->tabs;
$tabs->setTemplate('sxbootstrap/tabs/tabs');
return $this->getView()->render($tabs);
} | [
"protected",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"active",
")",
"{",
"$",
"this",
"->",
"setActive",
"(",
"key",
"(",
"$",
"this",
"->",
"tabs",
")",
")",
";",
"}",
"$",
"tabs",
"=",
"new",
"ViewModel... | Renders the tabs and returns the markup.
@return string | [
"Renders",
"the",
"tabs",
"and",
"returns",
"the",
"markup",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/Tabs.php#L69-L81 |
203,342 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/Tabs.php | Tabs.add | public function add($label, $content = null, $tabId = null, $active = false)
{
$tabId = is_null($tabId) ? $this->getTabId() : $tabId;
$label = is_null($label) ? $tabId : $label;
$this->tabs[$tabId] = array (
'label' => $label,
'content' => $content,
... | php | public function add($label, $content = null, $tabId = null, $active = false)
{
$tabId = is_null($tabId) ? $this->getTabId() : $tabId;
$label = is_null($label) ? $tabId : $label;
$this->tabs[$tabId] = array (
'label' => $label,
'content' => $content,
... | [
"public",
"function",
"add",
"(",
"$",
"label",
",",
"$",
"content",
"=",
"null",
",",
"$",
"tabId",
"=",
"null",
",",
"$",
"active",
"=",
"false",
")",
"{",
"$",
"tabId",
"=",
"is_null",
"(",
"$",
"tabId",
")",
"?",
"$",
"this",
"->",
"getTabId"... | Add a new tab.
@param string $label The label for the tab.
@param string $content The tab's content. Can be added later.
@param string $tabId The tab's id. Autogenerated when left empty.
@param boolean $active If this tab should be active.
@return Tabs Fluent interface | [
"Add",
"a",
"new",
"tab",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/Tabs.php#L118-L130 |
203,343 | SpoonX/SxBootstrap | src/SxBootstrap/View/Helper/Bootstrap/Tabs.php | Tabs.getTabId | protected function getTabId($current = false)
{
if (true === $current) {
return key($this->tabs);
}
$c = $this->tabCount++;
return $this->defaultTabIdentifier . $c;
} | php | protected function getTabId($current = false)
{
if (true === $current) {
return key($this->tabs);
}
$c = $this->tabCount++;
return $this->defaultTabIdentifier . $c;
} | [
"protected",
"function",
"getTabId",
"(",
"$",
"current",
"=",
"false",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"current",
")",
"{",
"return",
"key",
"(",
"$",
"this",
"->",
"tabs",
")",
";",
"}",
"$",
"c",
"=",
"$",
"this",
"->",
"tabCount",
"+... | Generate an id for a tab, or get the last added one.
@param boolean $current Whether or not to get the last added id.
@return string | [
"Generate",
"an",
"id",
"for",
"a",
"tab",
"or",
"get",
"the",
"last",
"added",
"one",
"."
] | 768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6 | https://github.com/SpoonX/SxBootstrap/blob/768b02e3b65f7dfe560e821cb0ff41ad3f86b3b6/src/SxBootstrap/View/Helper/Bootstrap/Tabs.php#L177-L186 |
203,344 | smalldb/libSmalldb | class/FlupdoGenericListing.php | FlupdoGenericListing.query | public function query()
{
if ($this->result === null) {
$this->before_called = true;
foreach ($this->before_query as $callable) {
$callable();
}
try {
$this->result = $this->query->query();
$this->result->setFetchMode(\PDO::FETCH_ASSOC);
}
catch (\Smalldb\Flupdo\FlupdoSqlException $ex)... | php | public function query()
{
if ($this->result === null) {
$this->before_called = true;
foreach ($this->before_query as $callable) {
$callable();
}
try {
$this->result = $this->query->query();
$this->result->setFetchMode(\PDO::FETCH_ASSOC);
}
catch (\Smalldb\Flupdo\FlupdoSqlException $ex)... | [
"public",
"function",
"query",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"result",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"before_called",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"before_query",
"as",
"$",
"callable",
")",
"{",
... | Execute SQL query or do whatever is required to get this listing
populated. | [
"Execute",
"SQL",
"query",
"or",
"do",
"whatever",
"is",
"required",
"to",
"get",
"this",
"listing",
"populated",
"."
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/FlupdoGenericListing.php#L456-L477 |
203,345 | smalldb/libSmalldb | class/FlupdoGenericListing.php | FlupdoGenericListing.fetchAll | public function fetchAll()
{
if ($this->result === null) {
$this->query();
}
$machine = $this->machine;
$id_keys = $this->machine->describeId();
if (count($id_keys) == 1) {
$list = array();
while(($properties = $this->result->fetch(\PDO::FETCH_ASSOC))) {
$item = $machine->hotRef($machine->deco... | php | public function fetchAll()
{
if ($this->result === null) {
$this->query();
}
$machine = $this->machine;
$id_keys = $this->machine->describeId();
if (count($id_keys) == 1) {
$list = array();
while(($properties = $this->result->fetch(\PDO::FETCH_ASSOC))) {
$item = $machine->hotRef($machine->deco... | [
"public",
"function",
"fetchAll",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"result",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"query",
"(",
")",
";",
"}",
"$",
"machine",
"=",
"$",
"this",
"->",
"machine",
";",
"$",
"id_keys",
"=",
"$",
... | Returns an array of all items in the listing.
This decodes properties. | [
"Returns",
"an",
"array",
"of",
"all",
"items",
"in",
"the",
"listing",
"."
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/FlupdoGenericListing.php#L504-L525 |
203,346 | smalldb/libSmalldb | class/FlupdoGenericListing.php | FlupdoGenericListing.calculateAdditionalFiltersData | protected function calculateAdditionalFiltersData(& $filters)
{
if (!empty($this->additional_filters_data)) {
foreach ($this->additional_filters_data as $f => $src) {
if (isset($src['query'])) {
$filters[$f] = $this->query->pdo->query($src['query'])->fetchColumn();
}
}
}
} | php | protected function calculateAdditionalFiltersData(& $filters)
{
if (!empty($this->additional_filters_data)) {
foreach ($this->additional_filters_data as $f => $src) {
if (isset($src['query'])) {
$filters[$f] = $this->query->pdo->query($src['query'])->fetchColumn();
}
}
}
} | [
"protected",
"function",
"calculateAdditionalFiltersData",
"(",
"&",
"$",
"filters",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"additional_filters_data",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"additional_filters_data",
"as",
"$",
... | Calculate additional filter data.
@param $filters Filters to populate with additional data.
@return Nothing. | [
"Calculate",
"additional",
"filter",
"data",
"."
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/FlupdoGenericListing.php#L581-L590 |
203,347 | smalldb/libSmalldb | class/FlupdoGenericListing.php | FlupdoGenericListing.setupSphinxSearch | protected function setupSphinxSearch($filter_name, $value, $machine_filter)
{
$sphinx_key_column = $this->query->quoteIdent($machine_filter['sphinx_key_column']);
$temp_table = $this->query->quoteIdent('_sphinx_temp_'.$filter_name);
$index_name = $this->query->quoteIdent($machine_filter['index_name']);
$this-... | php | protected function setupSphinxSearch($filter_name, $value, $machine_filter)
{
$sphinx_key_column = $this->query->quoteIdent($machine_filter['sphinx_key_column']);
$temp_table = $this->query->quoteIdent('_sphinx_temp_'.$filter_name);
$index_name = $this->query->quoteIdent($machine_filter['index_name']);
$this-... | [
"protected",
"function",
"setupSphinxSearch",
"(",
"$",
"filter_name",
",",
"$",
"value",
",",
"$",
"machine_filter",
")",
"{",
"$",
"sphinx_key_column",
"=",
"$",
"this",
"->",
"query",
"->",
"quoteIdent",
"(",
"$",
"machine_filter",
"[",
"'sphinx_key_column'",... | Setup query for lookup in Sphinx search engine.
Since Sphinx is accessed using standalone MySQL connection, this
will create temporary table and populate it with the fulltext search
result. Then the temporary table will be used to access and filter
the original query. | [
"Setup",
"query",
"for",
"lookup",
"in",
"Sphinx",
"search",
"engine",
"."
] | b94d22af5014e8060d0530fc7043768cdc57b01a | https://github.com/smalldb/libSmalldb/blob/b94d22af5014e8060d0530fc7043768cdc57b01a/class/FlupdoGenericListing.php#L601-L627 |
203,348 | alxmsl/Cli | source/Option.php | Option.setValue | public function setValue($value) {
switch ($this->type) {
case self::TYPE_BOOLEAN:
$this->value = (bool) $value;
break;
case self::TYPE_STRING:
$this->value = (string) $value;
break;
}
return $this;
} | php | public function setValue($value) {
switch ($this->type) {
case self::TYPE_BOOLEAN:
$this->value = (bool) $value;
break;
case self::TYPE_STRING:
$this->value = (string) $value;
break;
}
return $this;
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_BOOLEAN",
":",
"$",
"this",
"->",
"value",
"=",
"(",
"bool",
")",
"$",
"value",
";",
"break",
";",
"case"... | Option value setter
@param string|bool $value option value
@return Option self | [
"Option",
"value",
"setter"
] | 806fc2baa23e5a3d32734a4b913c3730342a8bb1 | https://github.com/alxmsl/Cli/blob/806fc2baa23e5a3d32734a4b913c3730342a8bb1/source/Option.php#L123-L133 |
203,349 | wearesho-team/cpa-integration | src/SalesDoubler/PostbackService.php | PostbackService.send | public function send(ConversionInterface $conversion): ResponseInterface
{
if (!$conversion instanceof Conversion) {
throw new UnsupportedConversionTypeException($this, $conversion);
}
$previousSentConversion = $this->repository->pull(
$conversion->getId(),
... | php | public function send(ConversionInterface $conversion): ResponseInterface
{
if (!$conversion instanceof Conversion) {
throw new UnsupportedConversionTypeException($this, $conversion);
}
$previousSentConversion = $this->repository->pull(
$conversion->getId(),
... | [
"public",
"function",
"send",
"(",
"ConversionInterface",
"$",
"conversion",
")",
":",
"ResponseInterface",
"{",
"if",
"(",
"!",
"$",
"conversion",
"instanceof",
"Conversion",
")",
"{",
"throw",
"new",
"UnsupportedConversionTypeException",
"(",
"$",
"this",
",",
... | Sending POST query to CPA network after creating conversion
@param ConversionInterface $conversion
@throws UnsupportedConversionTypeException
@throws DuplicatedConversionException
@throws RequestException
@return ResponseInterface | [
"Sending",
"POST",
"query",
"to",
"CPA",
"network",
"after",
"creating",
"conversion"
] | 6b78d2315e893ecf09132ae3e9d8e8c1b5ae6291 | https://github.com/wearesho-team/cpa-integration/blob/6b78d2315e893ecf09132ae3e9d8e8c1b5ae6291/src/SalesDoubler/PostbackService.php#L88-L107 |
203,350 | as3io/modlr | src/StorageLayerManager.php | StorageLayerManager.getPersister | public function getPersister($key)
{
if (empty($key) || false === $this->hasPersister($key)) {
throw PersisterException::persisterNotFound($key);
}
return $this->persisters[$key];
} | php | public function getPersister($key)
{
if (empty($key) || false === $this->hasPersister($key)) {
throw PersisterException::persisterNotFound($key);
}
return $this->persisters[$key];
} | [
"public",
"function",
"getPersister",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
"||",
"false",
"===",
"$",
"this",
"->",
"hasPersister",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"PersisterException",
"::",
"persisterNotFound",
... | Gets a Persister service by key.
@param string $key
@return PersisterInterface
@throws PersisterException If the service was not found. | [
"Gets",
"a",
"Persister",
"service",
"by",
"key",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/StorageLayerManager.php#L62-L68 |
203,351 | as3io/modlr | src/StorageLayerManager.php | StorageLayerManager.getSearchClient | public function getSearchClient($key)
{
if (empty($key) || false === $this->hasSearchClient($key)) {
throw ClientException::clientNotFound($key);
}
return $this->searchClients[$key];
} | php | public function getSearchClient($key)
{
if (empty($key) || false === $this->hasSearchClient($key)) {
throw ClientException::clientNotFound($key);
}
return $this->searchClients[$key];
} | [
"public",
"function",
"getSearchClient",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
"||",
"false",
"===",
"$",
"this",
"->",
"hasSearchClient",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"ClientException",
"::",
"clientNotFound",
... | Gets a Search Client service by key.
@param string $key
@return ClientInterface
@throws ClientException If the service was not found. | [
"Gets",
"a",
"Search",
"Client",
"service",
"by",
"key",
"."
] | 7e684b88bb22a2e18397df9402075c6533084b16 | https://github.com/as3io/modlr/blob/7e684b88bb22a2e18397df9402075c6533084b16/src/StorageLayerManager.php#L88-L94 |
203,352 | webeith/dnsbl | src/Dnsbl/Dnsbl.php | Dnsbl.check | public function check($hostname)
{
$result = array();
foreach ($this->getBlServers() as $blServer) {
$result[] = $blServer->getResolver()->execute($hostname);
}
return $result;
} | php | public function check($hostname)
{
$result = array();
foreach ($this->getBlServers() as $blServer) {
$result[] = $blServer->getResolver()->execute($hostname);
}
return $result;
} | [
"public",
"function",
"check",
"(",
"$",
"hostname",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getBlServers",
"(",
")",
"as",
"$",
"blServer",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"$",
"blServer",
... | Check hostname in all bl servers
@param string $hostname
@return Dnsbl\Resolver\Response\InterfaceResponse | [
"Check",
"hostname",
"in",
"all",
"bl",
"servers"
] | 062e30f1ccaf6578bebe1bbe51a6a833337ba825 | https://github.com/webeith/dnsbl/blob/062e30f1ccaf6578bebe1bbe51a6a833337ba825/src/Dnsbl/Dnsbl.php#L35-L43 |
203,353 | webeith/dnsbl | src/Dnsbl/Dnsbl.php | Dnsbl.checkIP | public function checkIP($ip)
{
$result = array();
foreach ($this->getBlServers() as $blServer) {
if ($blServer->supportIPv4()) {
$result[] = $blServer->getResolver()->execute($ip);
}
}
return $result;
} | php | public function checkIP($ip)
{
$result = array();
foreach ($this->getBlServers() as $blServer) {
if ($blServer->supportIPv4()) {
$result[] = $blServer->getResolver()->execute($ip);
}
}
return $result;
} | [
"public",
"function",
"checkIP",
"(",
"$",
"ip",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getBlServers",
"(",
")",
"as",
"$",
"blServer",
")",
"{",
"if",
"(",
"$",
"blServer",
"->",
"supportIPv4",
"(... | Check IP in black list
@param string $ip
@return Dnsbl\Resolver\Response\InterfaceResponse | [
"Check",
"IP",
"in",
"black",
"list"
] | 062e30f1ccaf6578bebe1bbe51a6a833337ba825 | https://github.com/webeith/dnsbl/blob/062e30f1ccaf6578bebe1bbe51a6a833337ba825/src/Dnsbl/Dnsbl.php#L52-L62 |
203,354 | webeith/dnsbl | src/Dnsbl/Dnsbl.php | Dnsbl.checkDomain | public function checkDomain($hostname)
{
$result = array();
foreach ($this->getBlServers() as $blServer) {
if ($blServer->supportDomain()) {
$result[] = $blServer->getResolver()->execute($hostname);
}
}
return $result;
} | php | public function checkDomain($hostname)
{
$result = array();
foreach ($this->getBlServers() as $blServer) {
if ($blServer->supportDomain()) {
$result[] = $blServer->getResolver()->execute($hostname);
}
}
return $result;
} | [
"public",
"function",
"checkDomain",
"(",
"$",
"hostname",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getBlServers",
"(",
")",
"as",
"$",
"blServer",
")",
"{",
"if",
"(",
"$",
"blServer",
"->",
"supportD... | Check domain name in black list
@param string $domain
@return Dnsbl\Resolver\Response\InterfaceResponse | [
"Check",
"domain",
"name",
"in",
"black",
"list"
] | 062e30f1ccaf6578bebe1bbe51a6a833337ba825 | https://github.com/webeith/dnsbl/blob/062e30f1ccaf6578bebe1bbe51a6a833337ba825/src/Dnsbl/Dnsbl.php#L70-L80 |
203,355 | atelierspierrot/templatengine | src/TemplateEngine/TemplateObject/LinkTag.php | LinkTag.set | public function set(array $tags)
{
if (!empty($tags)) {
foreach ($tags as $_tag) {
$this->add($_tag);
}
}
return $this;
} | php | public function set(array $tags)
{
if (!empty($tags)) {
foreach ($tags as $_tag) {
$this->add($_tag);
}
}
return $this;
} | [
"public",
"function",
"set",
"(",
"array",
"$",
"tags",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"tags",
")",
")",
"{",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"_tag",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"_tag",
")",
";",
"}",
... | Set a full links header stack
@param array $tags An array of tags definitions
@return self
@see self::add() | [
"Set",
"a",
"full",
"links",
"header",
"stack"
] | de01b117f882670bed7b322e2d3b8b30fa9ae45f | https://github.com/atelierspierrot/templatengine/blob/de01b117f882670bed7b322e2d3b8b30fa9ae45f/src/TemplateEngine/TemplateObject/LinkTag.php#L81-L89 |
203,356 | GordonSchmidt/GSImage | src/GSImage/Driver/AbstractDriver.php | AbstractDriver.getImageStorage | public function getImageStorage($image)
{
if (@file_exists('file://' . $image)) {
return DriverInterface::IMAGE_STORAGE_FILE;
} elseif (false === strpos($image, '://')) {
return DriverInterface::IMAGE_STORAGE_STRING;
} else {
return DriverInterface::IMAGE_... | php | public function getImageStorage($image)
{
if (@file_exists('file://' . $image)) {
return DriverInterface::IMAGE_STORAGE_FILE;
} elseif (false === strpos($image, '://')) {
return DriverInterface::IMAGE_STORAGE_STRING;
} else {
return DriverInterface::IMAGE_... | [
"public",
"function",
"getImageStorage",
"(",
"$",
"image",
")",
"{",
"if",
"(",
"@",
"file_exists",
"(",
"'file://'",
".",
"$",
"image",
")",
")",
"{",
"return",
"DriverInterface",
"::",
"IMAGE_STORAGE_FILE",
";",
"}",
"elseif",
"(",
"false",
"===",
"strp... | Get storage type of image
@param string $image
@return string | [
"Get",
"storage",
"type",
"of",
"image"
] | c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d | https://github.com/GordonSchmidt/GSImage/blob/c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d/src/GSImage/Driver/AbstractDriver.php#L29-L38 |
203,357 | GordonSchmidt/GSImage | src/GSImage/Driver/AbstractDriver.php | AbstractDriver.getInfo | public function getInfo($image)
{
if (DriverInterface::IMAGE_STORAGE_STRING == $this->getImageStorage($image)) {
$image = 'data://application/octet-stream;base64,' . base64_encode($image);
}
return getimagesize($image);
} | php | public function getInfo($image)
{
if (DriverInterface::IMAGE_STORAGE_STRING == $this->getImageStorage($image)) {
$image = 'data://application/octet-stream;base64,' . base64_encode($image);
}
return getimagesize($image);
} | [
"public",
"function",
"getInfo",
"(",
"$",
"image",
")",
"{",
"if",
"(",
"DriverInterface",
"::",
"IMAGE_STORAGE_STRING",
"==",
"$",
"this",
"->",
"getImageStorage",
"(",
"$",
"image",
")",
")",
"{",
"$",
"image",
"=",
"'data://application/octet-stream;base64,'"... | Get info of image
@param string $image
@return array | [
"Get",
"info",
"of",
"image"
] | c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d | https://github.com/GordonSchmidt/GSImage/blob/c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d/src/GSImage/Driver/AbstractDriver.php#L58-L64 |
203,358 | GordonSchmidt/GSImage | src/GSImage/Driver/AbstractDriver.php | AbstractDriver.ensure | public function ensure($image, $formats, $storages)
{
$storage = $this->getImageStorage($image);
$format = $this->getImageFormat($image);
$storages = is_string($storages) ? array($storages) : $storages;
$formats = is_int($formats) ? array($formats) : $formats;
if (in_array($... | php | public function ensure($image, $formats, $storages)
{
$storage = $this->getImageStorage($image);
$format = $this->getImageFormat($image);
$storages = is_string($storages) ? array($storages) : $storages;
$formats = is_int($formats) ? array($formats) : $formats;
if (in_array($... | [
"public",
"function",
"ensure",
"(",
"$",
"image",
",",
"$",
"formats",
",",
"$",
"storages",
")",
"{",
"$",
"storage",
"=",
"$",
"this",
"->",
"getImageStorage",
"(",
"$",
"image",
")",
";",
"$",
"format",
"=",
"$",
"this",
"->",
"getImageFormat",
"... | Ensure certain image storages und formats
@param string $image
@param array|int $formats
@param array|string $storages
@return string | [
"Ensure",
"certain",
"image",
"storages",
"und",
"formats"
] | c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d | https://github.com/GordonSchmidt/GSImage/blob/c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d/src/GSImage/Driver/AbstractDriver.php#L74-L94 |
203,359 | GordonSchmidt/GSImage | src/GSImage/Driver/AbstractDriver.php | AbstractDriver.getFileOptionForSaving | protected function getFileOptionForSaving($storages)
{
if (in_array(DriverInterface::IMAGE_STORAGE_STRING, $storages)) {
return null;
} elseif (in_array(DriverInterface::IMAGE_STORAGE_FILE, $storages)) {
return sys_get_temp_dir() . '/tmp-image-' . rand();
} else {
... | php | protected function getFileOptionForSaving($storages)
{
if (in_array(DriverInterface::IMAGE_STORAGE_STRING, $storages)) {
return null;
} elseif (in_array(DriverInterface::IMAGE_STORAGE_FILE, $storages)) {
return sys_get_temp_dir() . '/tmp-image-' . rand();
} else {
... | [
"protected",
"function",
"getFileOptionForSaving",
"(",
"$",
"storages",
")",
"{",
"if",
"(",
"in_array",
"(",
"DriverInterface",
"::",
"IMAGE_STORAGE_STRING",
",",
"$",
"storages",
")",
")",
"{",
"return",
"null",
";",
"}",
"elseif",
"(",
"in_array",
"(",
"... | Get file option from storages for saving
@param array $storages
@return string|null | [
"Get",
"file",
"option",
"from",
"storages",
"for",
"saving"
] | c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d | https://github.com/GordonSchmidt/GSImage/blob/c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d/src/GSImage/Driver/AbstractDriver.php#L102-L111 |
203,360 | GordonSchmidt/GSImage | src/GSImage/Driver/AbstractDriver.php | AbstractDriver.loadToString | public function loadToString($image)
{
$srcStorage = $this->getImageStorage($image);
if ($srcStorage !== DriverInterface::IMAGE_STORAGE_STRING) {
$image = @file_get_contents($image);
if (false === $image) {
throw new Exception\RuntimeException('could not load ... | php | public function loadToString($image)
{
$srcStorage = $this->getImageStorage($image);
if ($srcStorage !== DriverInterface::IMAGE_STORAGE_STRING) {
$image = @file_get_contents($image);
if (false === $image) {
throw new Exception\RuntimeException('could not load ... | [
"public",
"function",
"loadToString",
"(",
"$",
"image",
")",
"{",
"$",
"srcStorage",
"=",
"$",
"this",
"->",
"getImageStorage",
"(",
"$",
"image",
")",
";",
"if",
"(",
"$",
"srcStorage",
"!==",
"DriverInterface",
"::",
"IMAGE_STORAGE_STRING",
")",
"{",
"$... | Load image to string
@param string $image
@return string | [
"Load",
"image",
"to",
"string"
] | c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d | https://github.com/GordonSchmidt/GSImage/blob/c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d/src/GSImage/Driver/AbstractDriver.php#L144-L154 |
203,361 | GordonSchmidt/GSImage | src/GSImage/Driver/AbstractDriver.php | AbstractDriver.saveFromString | public function saveFromString($image, $options = array())
{
if (isset($options['file'])) {
if (false === @file_put_contents($options['file'], $image)) {
throw new Exception\RuntimeException('could not save image');
}
return $options['file'];
}
... | php | public function saveFromString($image, $options = array())
{
if (isset($options['file'])) {
if (false === @file_put_contents($options['file'], $image)) {
throw new Exception\RuntimeException('could not save image');
}
return $options['file'];
}
... | [
"public",
"function",
"saveFromString",
"(",
"$",
"image",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'file'",
"]",
")",
")",
"{",
"if",
"(",
"false",
"===",
"@",
"file_put_contents",
"(",
... | Save image from string
@param string $image
@param array $options
@return string | [
"Save",
"image",
"from",
"string"
] | c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d | https://github.com/GordonSchmidt/GSImage/blob/c36c5ce2131ac535f5ca2d9ce7b3c66cf6f2b72d/src/GSImage/Driver/AbstractDriver.php#L163-L172 |
203,362 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.getAllowedDbValues | public function getAllowedDbValues(array $except = [])
{
$map = $this->getMap();
$dbValues = array_diff(array_keys($map), $except);
return $dbValues;
} | php | public function getAllowedDbValues(array $except = [])
{
$map = $this->getMap();
$dbValues = array_diff(array_keys($map), $except);
return $dbValues;
} | [
"public",
"function",
"getAllowedDbValues",
"(",
"array",
"$",
"except",
"=",
"[",
"]",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"getMap",
"(",
")",
";",
"$",
"dbValues",
"=",
"array_diff",
"(",
"array_keys",
"(",
"$",
"map",
")",
",",
"$",
"e... | Returns list of the all registered database values
@param array $except List of the database values which should be excluded
@return array | [
"Returns",
"list",
"of",
"the",
"all",
"registered",
"database",
"values"
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L81-L87 |
203,363 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.getAllowedHumanValues | public function getAllowedHumanValues(array $except = [])
{
$map = $this->getMap();
$humanValues = array_diff(array_values($map), $except);
return $humanValues;
} | php | public function getAllowedHumanValues(array $except = [])
{
$map = $this->getMap();
$humanValues = array_diff(array_values($map), $except);
return $humanValues;
} | [
"public",
"function",
"getAllowedHumanValues",
"(",
"array",
"$",
"except",
"=",
"[",
"]",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"getMap",
"(",
")",
";",
"$",
"humanValues",
"=",
"array_diff",
"(",
"array_values",
"(",
"$",
"map",
")",
",",
"... | Returns list of the all registered humanized values
@param array $except List of the humanized values which should be excluded
@return array | [
"Returns",
"list",
"of",
"the",
"all",
"registered",
"humanized",
"values"
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L96-L102 |
203,364 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.getMap | public function getMap()
{
$result = [];
foreach ($this->getConstants() as $dbName => $dbValue) {
if (0 === strpos($dbName, self::PREFIX_DB)) {
$result[$dbValue] = $this->getAppropriateConstValue(self::PREFIX_DB, $dbName);
}
}
return $result;... | php | public function getMap()
{
$result = [];
foreach ($this->getConstants() as $dbName => $dbValue) {
if (0 === strpos($dbName, self::PREFIX_DB)) {
$result[$dbValue] = $this->getAppropriateConstValue(self::PREFIX_DB, $dbName);
}
}
return $result;... | [
"public",
"function",
"getMap",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getConstants",
"(",
")",
"as",
"$",
"dbName",
"=>",
"$",
"dbValue",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"dbName... | Returns map of the all registered values in the 'key' => 'value' pairs.
The 'key' equal to database value and the 'value' equal to humanized value.
@return array | [
"Returns",
"map",
"of",
"the",
"all",
"registered",
"values",
"in",
"the",
"key",
"=",
">",
"value",
"pairs",
".",
"The",
"key",
"equal",
"to",
"database",
"value",
"and",
"the",
"value",
"equal",
"to",
"humanized",
"value",
"."
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L110-L121 |
203,365 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.getRandomDbValue | public function getRandomDbValue(array $except = [])
{
$values = $this->getAllowedDbValues($except);
shuffle($values);
return array_shift($values);
} | php | public function getRandomDbValue(array $except = [])
{
$values = $this->getAllowedDbValues($except);
shuffle($values);
return array_shift($values);
} | [
"public",
"function",
"getRandomDbValue",
"(",
"array",
"$",
"except",
"=",
"[",
"]",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"getAllowedDbValues",
"(",
"$",
"except",
")",
";",
"shuffle",
"(",
"$",
"values",
")",
";",
"return",
"array_shift",
... | Returns random database value
@param array $except List of the database values which should be excluded
@return string|int | [
"Returns",
"random",
"database",
"value"
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L130-L137 |
203,366 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.getRandomHumanValue | public function getRandomHumanValue(array $except = [])
{
$values = $this->getAllowedHumanValues($except);
shuffle($values);
return array_shift($values);
} | php | public function getRandomHumanValue(array $except = [])
{
$values = $this->getAllowedHumanValues($except);
shuffle($values);
return array_shift($values);
} | [
"public",
"function",
"getRandomHumanValue",
"(",
"array",
"$",
"except",
"=",
"[",
"]",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"getAllowedHumanValues",
"(",
"$",
"except",
")",
";",
"shuffle",
"(",
"$",
"values",
")",
";",
"return",
"array_shi... | Returns random humanized value
@param array $except List of the humanized values which should be excluded
@return string|int | [
"Returns",
"random",
"humanized",
"value"
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L146-L153 |
203,367 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.getAppropriateConstValue | protected function getAppropriateConstValue($prefixFrom, $constName)
{
$prefixTo = $prefixFrom === self::PREFIX_DB ? self::PREFIX_HUMAN : self::PREFIX_DB;
$count = 1;
$constName = str_replace($prefixFrom, $prefixTo, $constName, $count);
return constant('static::'.$constName);
... | php | protected function getAppropriateConstValue($prefixFrom, $constName)
{
$prefixTo = $prefixFrom === self::PREFIX_DB ? self::PREFIX_HUMAN : self::PREFIX_DB;
$count = 1;
$constName = str_replace($prefixFrom, $prefixTo, $constName, $count);
return constant('static::'.$constName);
... | [
"protected",
"function",
"getAppropriateConstValue",
"(",
"$",
"prefixFrom",
",",
"$",
"constName",
")",
"{",
"$",
"prefixTo",
"=",
"$",
"prefixFrom",
"===",
"self",
"::",
"PREFIX_DB",
"?",
"self",
"::",
"PREFIX_HUMAN",
":",
"self",
"::",
"PREFIX_DB",
";",
"... | Returns appropriated pair value
@param string $prefixFrom Constant prefix which determine what the value should be returns
put self::PREFIX_DB to get appropriated humanized value
or self::PREFIX_HUMAN to get appropriated database value
@param string $constName Constant name which should be processed
@return int|str... | [
"Returns",
"appropriated",
"pair",
"value"
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L165-L172 |
203,368 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.convert | private function convert($value, $prefixFrom)
{
foreach ($this->getConstants() as $constName => $constValue) {
// process constant if she's does start from reserved prefix and values was equals
if (0 === strpos($constName, $prefixFrom) && $value === $constValue) {
ret... | php | private function convert($value, $prefixFrom)
{
foreach ($this->getConstants() as $constName => $constValue) {
// process constant if she's does start from reserved prefix and values was equals
if (0 === strpos($constName, $prefixFrom) && $value === $constValue) {
ret... | [
"private",
"function",
"convert",
"(",
"$",
"value",
",",
"$",
"prefixFrom",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getConstants",
"(",
")",
"as",
"$",
"constName",
"=>",
"$",
"constValue",
")",
"{",
"// process constant if she's does start from reserved ... | Returns appropriated value by received origin value. Humanized value by received database value and vise versa.
@param string|int $value Value for convert
@param string $prefixFrom Constant prefix which determine what the value should be returns
put self::PREFIX_DB to get appropriated humanized value
or self... | [
"Returns",
"appropriated",
"value",
"by",
"received",
"origin",
"value",
".",
"Humanized",
"value",
"by",
"received",
"database",
"value",
"and",
"vise",
"versa",
"."
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L186-L196 |
203,369 | adrenalinkin/enum-mapper | Mapper/AbstractEnumMapper.php | AbstractEnumMapper.getConstants | private function getConstants()
{
if (empty($this->constants)) {
try {
$reflection = new \ReflectionClass($this->getClassName());
$this->constants = $reflection->getConstants();
} catch (\ReflectionException $e) {
$this->constants ... | php | private function getConstants()
{
if (empty($this->constants)) {
try {
$reflection = new \ReflectionClass($this->getClassName());
$this->constants = $reflection->getConstants();
} catch (\ReflectionException $e) {
$this->constants ... | [
"private",
"function",
"getConstants",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"constants",
")",
")",
"{",
"try",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"getClassName",
"(",
")",
")",
"... | Returns list of the all available constants of the current class
@return array | [
"Returns",
"list",
"of",
"the",
"all",
"available",
"constants",
"of",
"the",
"current",
"class"
] | 3385e6cdf75f7f9863cd3222ece76de1a3e5961d | https://github.com/adrenalinkin/enum-mapper/blob/3385e6cdf75f7f9863cd3222ece76de1a3e5961d/Mapper/AbstractEnumMapper.php#L217-L229 |
203,370 | ttools/ttools | src/TTools/TTools.php | TTools.getAuthorizeUrl | public function getAuthorizeUrl(array $params = [])
{
$result = $this->OAuthRequest(self::API_BASE . self::REQUEST_PATH, $params);
if ($result->getCode() == 200) {
$tokens = $this->parseResponse($result->getResponse());
return [
'auth_url' => self::API_BASE ... | php | public function getAuthorizeUrl(array $params = [])
{
$result = $this->OAuthRequest(self::API_BASE . self::REQUEST_PATH, $params);
if ($result->getCode() == 200) {
$tokens = $this->parseResponse($result->getResponse());
return [
'auth_url' => self::API_BASE ... | [
"public",
"function",
"getAuthorizeUrl",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"OAuthRequest",
"(",
"self",
"::",
"API_BASE",
".",
"self",
"::",
"REQUEST_PATH",
",",
"$",
"params",
")",
";",
"if",
... | Gets the authorization url.
@param array $params Custom parameters passed to the OAuth request
@return array If successful, returns an array with 'auth_url', 'secret' and 'token';
otherwise, returns an array with error code and message. | [
"Gets",
"the",
"authorization",
"url",
"."
] | 32e6b1d9ffa346db3bbfff46a258f12d0c322819 | https://github.com/ttools/ttools/blob/32e6b1d9ffa346db3bbfff46a258f12d0c322819/src/TTools/TTools.php#L77-L93 |
203,371 | beyoio/beyod | protocol/http/Request.php | Request.loadRequest | public function loadRequest($buffer)
{
$this->requestAt = microtime(true);
list($this->_rawHeader, $this->_rawBody) = explode("\r\n\r\n", $buffer, 2);
$headers = explode("\r\n", $this->_rawHeader, 2);
list($this->method, $this->uri, $this->version)... | php | public function loadRequest($buffer)
{
$this->requestAt = microtime(true);
list($this->_rawHeader, $this->_rawBody) = explode("\r\n\r\n", $buffer, 2);
$headers = explode("\r\n", $this->_rawHeader, 2);
list($this->method, $this->uri, $this->version)... | [
"public",
"function",
"loadRequest",
"(",
"$",
"buffer",
")",
"{",
"$",
"this",
"->",
"requestAt",
"=",
"microtime",
"(",
"true",
")",
";",
"list",
"(",
"$",
"this",
"->",
"_rawHeader",
",",
"$",
"this",
"->",
"_rawBody",
")",
"=",
"explode",
"(",
"\... | load reqeust buffer to this object
@param string $buffer | [
"load",
"reqeust",
"buffer",
"to",
"this",
"object"
] | 11941db9c4ae4abbca6c8e634d21873c690efc79 | https://github.com/beyoio/beyod/blob/11941db9c4ae4abbca6c8e634d21873c690efc79/protocol/http/Request.php#L92-L112 |
203,372 | brick/validation | src/Internal/Luhn.php | Luhn.getCheckDigit | public static function getCheckDigit(string $number) : int
{
if (! ctype_digit($number)) {
throw new \InvalidArgumentException('The number must be a string of digits');
}
$checksum = self::checksum($number . '0');
return ($checksum === 0) ? 0 : 10 - $checksum;
} | php | public static function getCheckDigit(string $number) : int
{
if (! ctype_digit($number)) {
throw new \InvalidArgumentException('The number must be a string of digits');
}
$checksum = self::checksum($number . '0');
return ($checksum === 0) ? 0 : 10 - $checksum;
} | [
"public",
"static",
"function",
"getCheckDigit",
"(",
"string",
"$",
"number",
")",
":",
"int",
"{",
"if",
"(",
"!",
"ctype_digit",
"(",
"$",
"number",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The number must be a string of digits'... | Computes and returns the check digit of a number.
@param string $number
@return int
@throws \InvalidArgumentException | [
"Computes",
"and",
"returns",
"the",
"check",
"digit",
"of",
"a",
"number",
"."
] | b33593f75df80530417007bde97c4772807563ab | https://github.com/brick/validation/blob/b33593f75df80530417007bde97c4772807563ab/src/Internal/Luhn.php#L23-L32 |
203,373 | brick/validation | src/Internal/Luhn.php | Luhn.isValid | public static function isValid(string $number) : bool
{
if (ctype_digit($number)) {
return self::checksum($number) === 0;
}
return false;
} | php | public static function isValid(string $number) : bool
{
if (ctype_digit($number)) {
return self::checksum($number) === 0;
}
return false;
} | [
"public",
"static",
"function",
"isValid",
"(",
"string",
"$",
"number",
")",
":",
"bool",
"{",
"if",
"(",
"ctype_digit",
"(",
"$",
"number",
")",
")",
"{",
"return",
"self",
"::",
"checksum",
"(",
"$",
"number",
")",
"===",
"0",
";",
"}",
"return",
... | Checks that a number is valid.
@param string $number
@return bool | [
"Checks",
"that",
"a",
"number",
"is",
"valid",
"."
] | b33593f75df80530417007bde97c4772807563ab | https://github.com/brick/validation/blob/b33593f75df80530417007bde97c4772807563ab/src/Internal/Luhn.php#L41-L48 |
203,374 | brick/validation | src/Internal/Luhn.php | Luhn.checksum | private static function checksum(string $number) : int
{
$number = strrev($number);
$length = strlen($number);
$sum = 0;
for ($i = 0; $i < $length; $i++) {
$value = $number[$i] * ($i % 2 + 1);
$sum += ($value >= 10 ? $value - 9 : $value);
}
... | php | private static function checksum(string $number) : int
{
$number = strrev($number);
$length = strlen($number);
$sum = 0;
for ($i = 0; $i < $length; $i++) {
$value = $number[$i] * ($i % 2 + 1);
$sum += ($value >= 10 ? $value - 9 : $value);
}
... | [
"private",
"static",
"function",
"checksum",
"(",
"string",
"$",
"number",
")",
":",
"int",
"{",
"$",
"number",
"=",
"strrev",
"(",
"$",
"number",
")",
";",
"$",
"length",
"=",
"strlen",
"(",
"$",
"number",
")",
";",
"$",
"sum",
"=",
"0",
";",
"f... | Computes the checksum of a number.
@param string $number The number, validated as a string of digits.
@return int | [
"Computes",
"the",
"checksum",
"of",
"a",
"number",
"."
] | b33593f75df80530417007bde97c4772807563ab | https://github.com/brick/validation/blob/b33593f75df80530417007bde97c4772807563ab/src/Internal/Luhn.php#L57-L70 |
203,375 | Etenil/assegai | src/assegai/modules/mail/services/ses/utilities/info.class.php | CFInfo.api_support | public static function api_support()
{
$existing_classes = get_declared_classes();
foreach (glob(dirname(dirname(__FILE__)) . '/services/*.class.php') as $file)
{
include $file;
}
$with_sdk_classes = get_declared_classes();
$new_classes = array_diff($with_sdk_classes, $existing_classes);
$filtered_c... | php | public static function api_support()
{
$existing_classes = get_declared_classes();
foreach (glob(dirname(dirname(__FILE__)) . '/services/*.class.php') as $file)
{
include $file;
}
$with_sdk_classes = get_declared_classes();
$new_classes = array_diff($with_sdk_classes, $existing_classes);
$filtered_c... | [
"public",
"static",
"function",
"api_support",
"(",
")",
"{",
"$",
"existing_classes",
"=",
"get_declared_classes",
"(",
")",
";",
"foreach",
"(",
"glob",
"(",
"dirname",
"(",
"dirname",
"(",
"__FILE__",
")",
")",
".",
"'/services/*.class.php'",
")",
"as",
"... | Gets information about the web service APIs that the SDK supports.
@return array An associative array containing service classes and API versions. | [
"Gets",
"information",
"about",
"the",
"web",
"service",
"APIs",
"that",
"the",
"SDK",
"supports",
"."
] | d43cce1a88f1c332f60dd0a4374b17764852af9e | https://github.com/Etenil/assegai/blob/d43cce1a88f1c332f60dd0a4374b17764852af9e/src/assegai/modules/mail/services/ses/utilities/info.class.php#L36-L68 |
203,376 | oliwierptak/Everon1 | src/Everon/Helper/Asserts/IsInstance.php | IsInstance.assertIsInstance | public function assertIsInstance($class, $instance, $message='%s and %s are not the same instance', $exception='Asserts')
{
$is_instance = (get_class($class) === $instance);
if ($is_instance === false) {
$this->throwException($exception, $message, array(get_class($class), $instance));
... | php | public function assertIsInstance($class, $instance, $message='%s and %s are not the same instance', $exception='Asserts')
{
$is_instance = (get_class($class) === $instance);
if ($is_instance === false) {
$this->throwException($exception, $message, array(get_class($class), $instance));
... | [
"public",
"function",
"assertIsInstance",
"(",
"$",
"class",
",",
"$",
"instance",
",",
"$",
"message",
"=",
"'%s and %s are not the same instance'",
",",
"$",
"exception",
"=",
"'Asserts'",
")",
"{",
"$",
"is_instance",
"=",
"(",
"get_class",
"(",
"$",
"class... | Verifies that the specified conditions are of the same instance.
The assertion fails if they are not.
@param mixed $class Concreet class to check
@param string $instance Instance name
@param string $message
@param string $exception
@throws \Everon\Exception\Asserts | [
"Verifies",
"that",
"the",
"specified",
"conditions",
"are",
"of",
"the",
"same",
"instance",
".",
"The",
"assertion",
"fails",
"if",
"they",
"are",
"not",
"."
] | ac93793d1fa517a8394db5f00062f1925dc218a3 | https://github.com/oliwierptak/Everon1/blob/ac93793d1fa517a8394db5f00062f1925dc218a3/src/Everon/Helper/Asserts/IsInstance.php#L24-L30 |
203,377 | RowlandOti/ooglee-blogmodule | src/OoGlee/Application/Entities/Post/Listeners/IncrementPostViewsListener.php | IncrementPostViewsListener.listenerHandle | public function listenerHandle(IEvent $event)
{
$event->post->count_views++;
$event->post->save();
var_dump($event->post->count_views);
} | php | public function listenerHandle(IEvent $event)
{
$event->post->count_views++;
$event->post->save();
var_dump($event->post->count_views);
} | [
"public",
"function",
"listenerHandle",
"(",
"IEvent",
"$",
"event",
")",
"{",
"$",
"event",
"->",
"post",
"->",
"count_views",
"++",
";",
"$",
"event",
"->",
"post",
"->",
"save",
"(",
")",
";",
"var_dump",
"(",
"$",
"event",
"->",
"post",
"->",
"co... | Update the post view count
@param IEvent $event
@return void | [
"Update",
"the",
"post",
"view",
"count"
] | d9c0fe4745bb09f8b94047b0cda4fd7438cde16a | https://github.com/RowlandOti/ooglee-blogmodule/blob/d9c0fe4745bb09f8b94047b0cda4fd7438cde16a/src/OoGlee/Application/Entities/Post/Listeners/IncrementPostViewsListener.php#L34-L39 |
203,378 | bennybi/yii2-cza-base | widgets/ActiveField.php | ActiveField.hiddenInput | public function hiddenInput($options = []) {
$options = array_replace_recursive($this->inputOptions, $options);
$this->adjustLabelFor($options);
$this->parts['{label}'] = false;
$this->parts['{input}'] = Html::activeHiddenInput($this->model, $this->attribute, $options);
return $... | php | public function hiddenInput($options = []) {
$options = array_replace_recursive($this->inputOptions, $options);
$this->adjustLabelFor($options);
$this->parts['{label}'] = false;
$this->parts['{input}'] = Html::activeHiddenInput($this->model, $this->attribute, $options);
return $... | [
"public",
"function",
"hiddenInput",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_replace_recursive",
"(",
"$",
"this",
"->",
"inputOptions",
",",
"$",
"options",
")",
";",
"$",
"this",
"->",
"adjustLabelFor",
"(",
"$",
"opti... | override original method
@param type $options
@return \cza\base\widgets\ActiveField | [
"override",
"original",
"method"
] | 8257db8034bd948712fa469062921f210f0ba8da | https://github.com/bennybi/yii2-cza-base/blob/8257db8034bd948712fa469062921f210f0ba8da/widgets/ActiveField.php#L76-L83 |
203,379 | valu-digital/valuso | src/ValuSo/Annotation/Trigger.php | Trigger.getEventDescription | public function getEventDescription()
{
$event = array(
'type' => null,
'name' => null,
'args' => null,
'params' => null
);
if (is_string($this->value)) {
$event['type'] = $this->value;
} else {
$event['... | php | public function getEventDescription()
{
$event = array(
'type' => null,
'name' => null,
'args' => null,
'params' => null
);
if (is_string($this->value)) {
$event['type'] = $this->value;
} else {
$event['... | [
"public",
"function",
"getEventDescription",
"(",
")",
"{",
"$",
"event",
"=",
"array",
"(",
"'type'",
"=>",
"null",
",",
"'name'",
"=>",
"null",
",",
"'args'",
"=>",
"null",
",",
"'params'",
"=>",
"null",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
... | Retrieve event description
Event description is an array that contains following keys:
- type (event type, which is either 'pre' or 'post')
- name (name of the event)
- args (event arguments)
@return array | [
"Retrieve",
"event",
"description"
] | c96bed0f6bd21551822334fe6cfe913a7436dd17 | https://github.com/valu-digital/valuso/blob/c96bed0f6bd21551822334fe6cfe913a7436dd17/src/ValuSo/Annotation/Trigger.php#L34-L53 |
203,380 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.getImporters | public function getImporters($all = false)
{
$importers = [];
foreach ($this->importers as $importer) {
if ($importer->isEnabled() || true === $all) {
$importers[$importer->getKey()] = $importer;
}
}
return $importers;
} | php | public function getImporters($all = false)
{
$importers = [];
foreach ($this->importers as $importer) {
if ($importer->isEnabled() || true === $all) {
$importers[$importer->getKey()] = $importer;
}
}
return $importers;
} | [
"public",
"function",
"getImporters",
"(",
"$",
"all",
"=",
"false",
")",
"{",
"$",
"importers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"importers",
"as",
"$",
"importer",
")",
"{",
"if",
"(",
"$",
"importer",
"->",
"isEnabled",
"(",
... | Returns importers keyed by their internal key.
@param bool $all If all importers should be returned, regardless of status.
@return array | [
"Returns",
"importers",
"keyed",
"by",
"their",
"internal",
"key",
"."
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L296-L305 |
203,381 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.getImporter | public function getImporter($key)
{
foreach ($this->getImporters(true) as $k => $importer) {
if ($key === $k) {
return $importer;
}
}
throw new \InvalidArgumentException(sprintf('Importer could not be found by key `%s`.', $key));
} | php | public function getImporter($key)
{
foreach ($this->getImporters(true) as $k => $importer) {
if ($key === $k) {
return $importer;
}
}
throw new \InvalidArgumentException(sprintf('Importer could not be found by key `%s`.', $key));
} | [
"public",
"function",
"getImporter",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getImporters",
"(",
"true",
")",
"as",
"$",
"k",
"=>",
"$",
"importer",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"$",
"k",
")",
"{",
"return",
"$",... | Retrieves an importer by key
@param string $key
@return ImporterInterface
@throws InvalidArgumentInterface | [
"Retrieves",
"an",
"importer",
"by",
"key"
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L314-L322 |
203,382 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.getImporterKeys | public function getImporterKeys($all = false)
{
$keys = [];
if ($all) {
$keys = $this->importerKeys;
} else {
foreach ($this->importerKeys as $key => $bit) {
if ($bit) {
$keys[] = $key;
}
}
}
... | php | public function getImporterKeys($all = false)
{
$keys = [];
if ($all) {
$keys = $this->importerKeys;
} else {
foreach ($this->importerKeys as $key => $bit) {
if ($bit) {
$keys[] = $key;
}
}
}
... | [
"public",
"function",
"getImporterKeys",
"(",
"$",
"all",
"=",
"false",
")",
"{",
"$",
"keys",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"all",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"importerKeys",
";",
"}",
"else",
"{",
"foreach",
"(",
"$",
... | Returns the stored enabled importers for this model.
@param bool $all If all importers should be returned, regardless of status.
@return array | [
"Returns",
"the",
"stored",
"enabled",
"importers",
"for",
"this",
"model",
"."
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L330-L343 |
203,383 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.getSegmentKeys | public function getSegmentKeys($all = false)
{
$keys = [];
if ($all) {
$keys = $this->segmentKeys;
} else {
foreach ($this->segmentKeys as $key => $bit) {
if ($bit) {
$keys[] = $key;
}
}
}
... | php | public function getSegmentKeys($all = false)
{
$keys = [];
if ($all) {
$keys = $this->segmentKeys;
} else {
foreach ($this->segmentKeys as $key => $bit) {
if ($bit) {
$keys[] = $key;
}
}
}
... | [
"public",
"function",
"getSegmentKeys",
"(",
"$",
"all",
"=",
"false",
")",
"{",
"$",
"keys",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"all",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"segmentKeys",
";",
"}",
"else",
"{",
"foreach",
"(",
"$",
"... | Returns the stored enabled segments for this model.
@param bool $all If all segments should be returned, regardless of status.
@return array | [
"Returns",
"the",
"stored",
"enabled",
"segments",
"for",
"this",
"model",
"."
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L351-L364 |
203,384 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.getSegment | public function getSegment($key)
{
foreach ($this->getImporters() as $importer) {
if ($importer->hasSegment($key)) {
return $importer->getSegment($key);
}
}
throw new \InvalidArgumentException(sprintf('Segment could not be found by key `%s`.', $key));
... | php | public function getSegment($key)
{
foreach ($this->getImporters() as $importer) {
if ($importer->hasSegment($key)) {
return $importer->getSegment($key);
}
}
throw new \InvalidArgumentException(sprintf('Segment could not be found by key `%s`.', $key));
... | [
"public",
"function",
"getSegment",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getImporters",
"(",
")",
"as",
"$",
"importer",
")",
"{",
"if",
"(",
"$",
"importer",
"->",
"hasSegment",
"(",
"$",
"key",
")",
")",
"{",
"return",
"... | Retrieves a segment by key
@param string $key
@return SegmentInterface
@throws InvalidArgumentInterface | [
"Retrieves",
"a",
"segment",
"by",
"key"
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L373-L381 |
203,385 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.toggleImporter | public function toggleImporter($key)
{
$importer = $this->getImporter($key);
$importer->toggle();
foreach ($importer->getSegments() as $segment) {
if ($importer->isEnabled()) {
$this->addSegment($segment);
} else {
$this->removeSegment(... | php | public function toggleImporter($key)
{
$importer = $this->getImporter($key);
$importer->toggle();
foreach ($importer->getSegments() as $segment) {
if ($importer->isEnabled()) {
$this->addSegment($segment);
} else {
$this->removeSegment(... | [
"public",
"function",
"toggleImporter",
"(",
"$",
"key",
")",
"{",
"$",
"importer",
"=",
"$",
"this",
"->",
"getImporter",
"(",
"$",
"key",
")",
";",
"$",
"importer",
"->",
"toggle",
"(",
")",
";",
"foreach",
"(",
"$",
"importer",
"->",
"getSegments",
... | Toggles an importer and its segments
@param string $key | [
"Toggles",
"an",
"importer",
"and",
"its",
"segments"
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L388-L399 |
203,386 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.toggleSegment | public function toggleSegment($key)
{
$segment = $this->getSegment($key);
if (false === $segment->isEnabled()) {
return $segment->enable();
}
return $segment->disable();
} | php | public function toggleSegment($key)
{
$segment = $this->getSegment($key);
if (false === $segment->isEnabled()) {
return $segment->enable();
}
return $segment->disable();
} | [
"public",
"function",
"toggleSegment",
"(",
"$",
"key",
")",
"{",
"$",
"segment",
"=",
"$",
"this",
"->",
"getSegment",
"(",
"$",
"key",
")",
";",
"if",
"(",
"false",
"===",
"$",
"segment",
"->",
"isEnabled",
"(",
")",
")",
"{",
"return",
"$",
"seg... | Toggles a segment
@param string $key | [
"Toggles",
"a",
"segment"
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L406-L413 |
203,387 | as3io/symfony-data-importer | src/Import/Configuration.php | Configuration.getSegments | public function getSegments($all = false)
{
if ($all) {
return $this->segments;
}
$segments = [];
foreach ($this->segments as $segment) {
if ($segment->isEnabled()) {
$segments[] = $segment;
}
}
return $segments;
... | php | public function getSegments($all = false)
{
if ($all) {
return $this->segments;
}
$segments = [];
foreach ($this->segments as $segment) {
if ($segment->isEnabled()) {
$segments[] = $segment;
}
}
return $segments;
... | [
"public",
"function",
"getSegments",
"(",
"$",
"all",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"all",
")",
"{",
"return",
"$",
"this",
"->",
"segments",
";",
"}",
"$",
"segments",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"segments",
... | Returns segments keyed by their internal key.
@param bool $all If all segments should be returned, regardless of status.
@return array | [
"Returns",
"segments",
"keyed",
"by",
"their",
"internal",
"key",
"."
] | 33383e38f20f6b7a4b83da619bd028ac84ced579 | https://github.com/as3io/symfony-data-importer/blob/33383e38f20f6b7a4b83da619bd028ac84ced579/src/Import/Configuration.php#L422-L434 |
203,388 | makinacorpus/drupal-calista | src/Datasource/DefaultAccountDatasource.php | DefaultAccountDatasource.process | final protected function process(\SelectQueryInterface $select, Query $query)
{
if ($query->hasSortField()) {
$select->orderBy(
$query->getSortField(),
Query::SORT_DESC === $query->getSortOrder() ? 'desc' : 'asc'
);
}
$select->orderBy(
... | php | final protected function process(\SelectQueryInterface $select, Query $query)
{
if ($query->hasSortField()) {
$select->orderBy(
$query->getSortField(),
Query::SORT_DESC === $query->getSortOrder() ? 'desc' : 'asc'
);
}
$select->orderBy(
... | [
"final",
"protected",
"function",
"process",
"(",
"\\",
"SelectQueryInterface",
"$",
"select",
",",
"Query",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"hasSortField",
"(",
")",
")",
"{",
"$",
"select",
"->",
"orderBy",
"(",
"$",
"query",
"... | Implementors must set the users table with 'u' as alias, and call this
method for the datasource to work correctly.
@param \SelectQueryInterface $select
@param Query $query
@return \SelectQuery
It can be an extended query, so use this object. | [
"Implementors",
"must",
"set",
"the",
"users",
"table",
"with",
"u",
"as",
"alias",
"and",
"call",
"this",
"method",
"for",
"the",
"datasource",
"to",
"work",
"correctly",
"."
] | cceb6b975fc3e80f0f83c803fc6f6a9ac5852b53 | https://github.com/makinacorpus/drupal-calista/blob/cceb6b975fc3e80f0f83c803fc6f6a9ac5852b53/src/Datasource/DefaultAccountDatasource.php#L150-L174 |
203,389 | issei-m/spike-php | src/Spike.php | Spike.requestToken | public function requestToken(TokenRequest $request)
{
$result = $this->request('POST', '/tokens', [
'card[number]' => $request->getCardNumber(),
'card[exp_month]' => $request->getExpirationMonth(),
'card[exp_year]' => $request->getExpirationYear(),
'card[cvc]'... | php | public function requestToken(TokenRequest $request)
{
$result = $this->request('POST', '/tokens', [
'card[number]' => $request->getCardNumber(),
'card[exp_month]' => $request->getExpirationMonth(),
'card[exp_year]' => $request->getExpirationYear(),
'card[cvc]'... | [
"public",
"function",
"requestToken",
"(",
"TokenRequest",
"$",
"request",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'POST'",
",",
"'/tokens'",
",",
"[",
"'card[number]'",
"=>",
"$",
"request",
"->",
"getCardNumber",
"(",
")",
",",
... | Returns a new token.
@param TokenRequest $request
@return Token
@throws RequestException | [
"Returns",
"a",
"new",
"token",
"."
] | 9205b5047a1132bcdca6731feac02fe3d5dc1023 | https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Spike.php#L52-L65 |
203,390 | issei-m/spike-php | src/Spike.php | Spike.getToken | public function getToken($id)
{
$result = $this->request('GET', '/tokens/' . $id);
return $this->objectConverter->convert($result);
} | php | public function getToken($id)
{
$result = $this->request('GET', '/tokens/' . $id);
return $this->objectConverter->convert($result);
} | [
"public",
"function",
"getToken",
"(",
"$",
"id",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'GET'",
",",
"'/tokens/'",
".",
"$",
"id",
")",
";",
"return",
"$",
"this",
"->",
"objectConverter",
"->",
"convert",
"(",
"$",
"resul... | Returns the token by id.
@param string $id
@return Token
@throws RequestException | [
"Returns",
"the",
"token",
"by",
"id",
"."
] | 9205b5047a1132bcdca6731feac02fe3d5dc1023 | https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Spike.php#L75-L80 |
203,391 | issei-m/spike-php | src/Spike.php | Spike.getCharges | public function getCharges($limit = 10, $startingAfter = null, $endingBefore = null)
{
$endpointUrl = '/charges?limit=' . $limit;
if ($startingAfter) {
$endpointUrl .= '&starting_after=' . $startingAfter;
}
if ($endingBefore) {
$endpointUrl .= '&ending_before... | php | public function getCharges($limit = 10, $startingAfter = null, $endingBefore = null)
{
$endpointUrl = '/charges?limit=' . $limit;
if ($startingAfter) {
$endpointUrl .= '&starting_after=' . $startingAfter;
}
if ($endingBefore) {
$endpointUrl .= '&ending_before... | [
"public",
"function",
"getCharges",
"(",
"$",
"limit",
"=",
"10",
",",
"$",
"startingAfter",
"=",
"null",
",",
"$",
"endingBefore",
"=",
"null",
")",
"{",
"$",
"endpointUrl",
"=",
"'/charges?limit='",
".",
"$",
"limit",
";",
"if",
"(",
"$",
"startingAfte... | Returns the charges.
@param integer $limit
@param Charge|string $startingAfter
@param Charge|string $endingBefore
@return Charge[]
@throws RequestException | [
"Returns",
"the",
"charges",
"."
] | 9205b5047a1132bcdca6731feac02fe3d5dc1023 | https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Spike.php#L92-L106 |
203,392 | issei-m/spike-php | src/Spike.php | Spike.getCharge | public function getCharge($id)
{
$result = $this->request('GET', '/charges/' . $id);
return $this->objectConverter->convert($result);
} | php | public function getCharge($id)
{
$result = $this->request('GET', '/charges/' . $id);
return $this->objectConverter->convert($result);
} | [
"public",
"function",
"getCharge",
"(",
"$",
"id",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'GET'",
",",
"'/charges/'",
".",
"$",
"id",
")",
";",
"return",
"$",
"this",
"->",
"objectConverter",
"->",
"convert",
"(",
"$",
"res... | Returns the charge by id.
@param string $id
@return Charge
@throws RequestException | [
"Returns",
"the",
"charge",
"by",
"id",
"."
] | 9205b5047a1132bcdca6731feac02fe3d5dc1023 | https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Spike.php#L116-L121 |
203,393 | issei-m/spike-php | src/Spike.php | Spike.charge | public function charge(ChargeRequest $request)
{
$result = $this->request('POST', '/charges', [
'card' => (string) $request->getToken(),
'amount' => $request->getAmount() ? $request->getAmount()->getAmount() : null,
'currency' => $request->getAmount() ? $request->ge... | php | public function charge(ChargeRequest $request)
{
$result = $this->request('POST', '/charges', [
'card' => (string) $request->getToken(),
'amount' => $request->getAmount() ? $request->getAmount()->getAmount() : null,
'currency' => $request->getAmount() ? $request->ge... | [
"public",
"function",
"charge",
"(",
"ChargeRequest",
"$",
"request",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'POST'",
",",
"'/charges'",
",",
"[",
"'card'",
"=>",
"(",
"string",
")",
"$",
"request",
"->",
"getToken",
"(",
")"... | Creates a new charge.
@param ChargeRequest $request
@return Charge
@throws RequestException | [
"Creates",
"a",
"new",
"charge",
"."
] | 9205b5047a1132bcdca6731feac02fe3d5dc1023 | https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Spike.php#L131-L142 |
203,394 | issei-m/spike-php | src/Spike.php | Spike.capture | public function capture($charge)
{
$result = $this->request('POST', '/charges/' . $charge . '/capture');
return $this->objectConverter->convert($result);
} | php | public function capture($charge)
{
$result = $this->request('POST', '/charges/' . $charge . '/capture');
return $this->objectConverter->convert($result);
} | [
"public",
"function",
"capture",
"(",
"$",
"charge",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'POST'",
",",
"'/charges/'",
".",
"$",
"charge",
".",
"'/capture'",
")",
";",
"return",
"$",
"this",
"->",
"objectConverter",
"->",
"... | Captures the charge.
@param Charge|string $charge
@return Charge
@throws RequestException | [
"Captures",
"the",
"charge",
"."
] | 9205b5047a1132bcdca6731feac02fe3d5dc1023 | https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Spike.php#L152-L157 |
203,395 | issei-m/spike-php | src/Spike.php | Spike.refund | public function refund($charge)
{
$result = $this->request('POST', '/charges/' . $charge . '/refund');
return $this->objectConverter->convert($result);
} | php | public function refund($charge)
{
$result = $this->request('POST', '/charges/' . $charge . '/refund');
return $this->objectConverter->convert($result);
} | [
"public",
"function",
"refund",
"(",
"$",
"charge",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'POST'",
",",
"'/charges/'",
".",
"$",
"charge",
".",
"'/refund'",
")",
";",
"return",
"$",
"this",
"->",
"objectConverter",
"->",
"co... | Refunds the charge.
@param Charge|string $charge
@return Charge
@throws RequestException | [
"Refunds",
"the",
"charge",
"."
] | 9205b5047a1132bcdca6731feac02fe3d5dc1023 | https://github.com/issei-m/spike-php/blob/9205b5047a1132bcdca6731feac02fe3d5dc1023/src/Spike.php#L167-L172 |
203,396 | phramework/testphase | src/Expression.php | Expression.getPrefixSuffix | public static function getPrefixSuffix($expressionType = Expression::EXPRESSION_TYPE_PLAIN)
{
$prefix = '';
$suffix = '';
$patternPrefix = '';
$patternSuffix = '';
switch ($expressionType) {
case Expression::EXPRESSION_TYPE_PLAIN:
$patternPrefix =... | php | public static function getPrefixSuffix($expressionType = Expression::EXPRESSION_TYPE_PLAIN)
{
$prefix = '';
$suffix = '';
$patternPrefix = '';
$patternSuffix = '';
switch ($expressionType) {
case Expression::EXPRESSION_TYPE_PLAIN:
$patternPrefix =... | [
"public",
"static",
"function",
"getPrefixSuffix",
"(",
"$",
"expressionType",
"=",
"Expression",
"::",
"EXPRESSION_TYPE_PLAIN",
")",
"{",
"$",
"prefix",
"=",
"''",
";",
"$",
"suffix",
"=",
"''",
";",
"$",
"patternPrefix",
"=",
"''",
";",
"$",
"patternSuffix... | Get prefix and suffix
@param string $expressionType
@return string[4] Returns the expression type prefix, suffix, pattern prefix and suffix.
@example
```php
list(
$prefix,
$suffix,
$patternPrefix,
$patternSuffix
) = Expression::getPrefixSuffix(Expression::EXPRESSION_TYPE_INLINE_REPLACE);
``` | [
"Get",
"prefix",
"and",
"suffix"
] | b00107b7a37cf1a1b9b8860b3eb031aacfa2634c | https://github.com/phramework/testphase/blob/b00107b7a37cf1a1b9b8860b3eb031aacfa2634c/src/Expression.php#L74-L99 |
203,397 | znframework/package-hypertext | JQueryBuilder.php | JQueryBuilder.selector | public function selector($selector)
{
if( is_scalar($selector) )
{
$this->selector = json_encode($selector);
}
else
{
$this->selector = Buffering\Callback::do($selector);
}
return $this;
} | php | public function selector($selector)
{
if( is_scalar($selector) )
{
$this->selector = json_encode($selector);
}
else
{
$this->selector = Buffering\Callback::do($selector);
}
return $this;
} | [
"public",
"function",
"selector",
"(",
"$",
"selector",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"selector",
")",
")",
"{",
"$",
"this",
"->",
"selector",
"=",
"json_encode",
"(",
"$",
"selector",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"... | Keeps jquery selector
@param string $selector
@return object | [
"Keeps",
"jquery",
"selector"
] | 12bbc3bd47a2fae735f638a3e01cc82c1b9c9005 | https://github.com/znframework/package-hypertext/blob/12bbc3bd47a2fae735f638a3e01cc82c1b9c9005/JQueryBuilder.php#L63-L76 |
203,398 | m6w6/pq-gateway | lib/pq/Gateway/Table.php | Table.getQueryExecutor | function getQueryExecutor() {
if (!$this->exec) {
$this->exec = new QueryExecutor($this->conn);
}
return $this->exec;
} | php | function getQueryExecutor() {
if (!$this->exec) {
$this->exec = new QueryExecutor($this->conn);
}
return $this->exec;
} | [
"function",
"getQueryExecutor",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exec",
")",
"{",
"$",
"this",
"->",
"exec",
"=",
"new",
"QueryExecutor",
"(",
"$",
"this",
"->",
"conn",
")",
";",
"}",
"return",
"$",
"this",
"->",
"exec",
";",
"... | Get the query executor
@return \pq\Query\ExecutorInterface | [
"Get",
"the",
"query",
"executor"
] | 58233722a06fd742f531f8f012ea540b309303da | https://github.com/m6w6/pq-gateway/blob/58233722a06fd742f531f8f012ea540b309303da/lib/pq/Gateway/Table.php#L175-L180 |
203,399 | m6w6/pq-gateway | lib/pq/Gateway/Table.php | Table.getMetadataCache | function getMetadataCache() {
if (!isset($this->metadatCache)) {
$this->metadataCache = static::$defaultMetadataCache ?: new Table\StaticCache;
}
return $this->metadataCache;
} | php | function getMetadataCache() {
if (!isset($this->metadatCache)) {
$this->metadataCache = static::$defaultMetadataCache ?: new Table\StaticCache;
}
return $this->metadataCache;
} | [
"function",
"getMetadataCache",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"metadatCache",
")",
")",
"{",
"$",
"this",
"->",
"metadataCache",
"=",
"static",
"::",
"$",
"defaultMetadataCache",
"?",
":",
"new",
"Table",
"\\",
"StaticCa... | Get the metadata cache
@return \pq\Gateway\Table\CacheInterface | [
"Get",
"the",
"metadata",
"cache"
] | 58233722a06fd742f531f8f012ea540b309303da | https://github.com/m6w6/pq-gateway/blob/58233722a06fd742f531f8f012ea540b309303da/lib/pq/Gateway/Table.php#L186-L191 |
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.