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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
23,200 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.exec | public function exec($cmd)
{
if (trim($cmd)) {
$this->setOutputPrefix('');
if ($this->resolve('DEBUG')) {
$this->output->writeln('<comment># ' . join('::', Debug::$scope) . "</comment>");
}
if ($this->resolve('EXPLAIN')) {
if ... | php | public function exec($cmd)
{
if (trim($cmd)) {
$this->setOutputPrefix('');
if ($this->resolve('DEBUG')) {
$this->output->writeln('<comment># ' . join('::', Debug::$scope) . "</comment>");
}
if ($this->resolve('EXPLAIN')) {
if ... | [
"public",
"function",
"exec",
"(",
"$",
"cmd",
")",
"{",
"if",
"(",
"trim",
"(",
"$",
"cmd",
")",
")",
"{",
"$",
"this",
"->",
"setOutputPrefix",
"(",
"''",
")",
";",
"if",
"(",
"$",
"this",
"->",
"resolve",
"(",
"'DEBUG'",
")",
")",
"{",
"$",
... | Executes a script snippet using the 'executor' service.
@param string $cmd
@return void | [
"Executes",
"a",
"script",
"snippet",
"using",
"the",
"executor",
"service",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L496-L517 |
23,201 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.str | public function str($value)
{
if (is_array($value)) {
$allScalar = function ($a, $b) {
return $a && is_scalar($b);
};
if (!array_reduce($value, $allScalar, true)) {
throw new UnexpectedValueException("Unexpected complex type " . Util::toPhp... | php | public function str($value)
{
if (is_array($value)) {
$allScalar = function ($a, $b) {
return $a && is_scalar($b);
};
if (!array_reduce($value, $allScalar, true)) {
throw new UnexpectedValueException("Unexpected complex type " . Util::toPhp... | [
"public",
"function",
"str",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"allScalar",
"=",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"$",
"a",
"&&",
"is_scalar",
"(",
"$",
"b",
... | Convert the value to a string.
@param mixed $value
@return string
@throws \UnexpectedValueException | [
"Convert",
"the",
"value",
"to",
"a",
"string",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L561-L573 |
23,202 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.push | public function push($varName, $tail)
{
if (false === $this->has($varName)) {
$this->set($varName, null);
}
if (!isset($this->varStack[json_encode($varName)])) {
$this->varStack[json_encode($varName)] = array();
}
array_push($this->varStack[json_encode... | php | public function push($varName, $tail)
{
if (false === $this->has($varName)) {
$this->set($varName, null);
}
if (!isset($this->varStack[json_encode($varName)])) {
$this->varStack[json_encode($varName)] = array();
}
array_push($this->varStack[json_encode... | [
"public",
"function",
"push",
"(",
"$",
"varName",
",",
"$",
"tail",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"has",
"(",
"$",
"varName",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"varName",
",",
"null",
")",
";",
"}",
... | Push a var on a local stack by it's name.
@param string $varName
@param string $tail
@return void | [
"Push",
"a",
"var",
"on",
"a",
"local",
"stack",
"by",
"it",
"s",
"name",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L650-L660 |
23,203 | zicht/z | src/Zicht/Tool/Container/Container.php | Container.pop | public function pop($varName)
{
$this->set($varName, array_pop($this->varStack[json_encode($varName)]));
} | php | public function pop($varName)
{
$this->set($varName, array_pop($this->varStack[json_encode($varName)]));
} | [
"public",
"function",
"pop",
"(",
"$",
"varName",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"varName",
",",
"array_pop",
"(",
"$",
"this",
"->",
"varStack",
"[",
"json_encode",
"(",
"$",
"varName",
")",
"]",
")",
")",
";",
"}"
] | Pop a var from a local var stack.
@param string $varName
@return void | [
"Pop",
"a",
"var",
"from",
"a",
"local",
"var",
"stack",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Container.php#L669-L672 |
23,204 | eloquent/phony-kahlan | src/ArgumentFactory.php | ArgumentFactory.argumentsForCallback | public function argumentsForCallback(callable $callback): array
{
$definition = new ReflectionFunction($callback);
$arguments = [];
foreach ($definition->getParameters() as $parameter) {
if ($type = $parameter->getType()) {
$arguments[] = Phony::emptyValue($type)... | php | public function argumentsForCallback(callable $callback): array
{
$definition = new ReflectionFunction($callback);
$arguments = [];
foreach ($definition->getParameters() as $parameter) {
if ($type = $parameter->getType()) {
$arguments[] = Phony::emptyValue($type)... | [
"public",
"function",
"argumentsForCallback",
"(",
"callable",
"$",
"callback",
")",
":",
"array",
"{",
"$",
"definition",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"callback",
")",
";",
"$",
"arguments",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"definit... | Returns an argument list of test doubles for the supplied callback.
@param callable $callback The callback.
@return array The arguments. | [
"Returns",
"an",
"argument",
"list",
"of",
"test",
"doubles",
"for",
"the",
"supplied",
"callback",
"."
] | a4654a7edf58268b492acc751ecbeddded9b176f | https://github.com/eloquent/phony-kahlan/blob/a4654a7edf58268b492acc751ecbeddded9b176f/src/ArgumentFactory.php#L21-L35 |
23,205 | zhouyl/mellivora | Mellivora/Console/GeneratorCommand.php | GeneratorCommand.qualifyClass | protected function qualifyClass($name)
{
$rootNamespace = $this->rootNamespace();
if (Str::startsWith($name, $rootNamespace . '\\')) {
return $name;
}
$name = str_replace('/', '\\', $name);
return $this->qualifyClass(
$this->getDefaultNamespace(trim... | php | protected function qualifyClass($name)
{
$rootNamespace = $this->rootNamespace();
if (Str::startsWith($name, $rootNamespace . '\\')) {
return $name;
}
$name = str_replace('/', '\\', $name);
return $this->qualifyClass(
$this->getDefaultNamespace(trim... | [
"protected",
"function",
"qualifyClass",
"(",
"$",
"name",
")",
"{",
"$",
"rootNamespace",
"=",
"$",
"this",
"->",
"rootNamespace",
"(",
")",
";",
"if",
"(",
"Str",
"::",
"startsWith",
"(",
"$",
"name",
",",
"$",
"rootNamespace",
".",
"'\\\\'",
")",
")... | Parse the class name and format according to the root namespace.
@param string $name
@return string | [
"Parse",
"the",
"class",
"name",
"and",
"format",
"according",
"to",
"the",
"root",
"namespace",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Console/GeneratorCommand.php#L61-L74 |
23,206 | amenophis/WHMCS-Connector | src/Amenophis/WHMCS/Adapter/Manager.php | Manager.get | public function get($name = null)
{
if(count($this->connectors) > 0)
{
if(!is_null($name))
{
if(!isset($this->connectors[$name]))
throw new \Exception("unknown Connector: $name");
return $this->connectors[$name];
}
return current($this->con... | php | public function get($name = null)
{
if(count($this->connectors) > 0)
{
if(!is_null($name))
{
if(!isset($this->connectors[$name]))
throw new \Exception("unknown Connector: $name");
return $this->connectors[$name];
}
return current($this->con... | [
"public",
"function",
"get",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"connectors",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",... | get an Connector by its name or it will return the default Connector
@param string $name Index of the chosen Connector
@return FP\WHMCS\Connector | [
"get",
"an",
"Connector",
"by",
"its",
"name",
"or",
"it",
"will",
"return",
"the",
"default",
"Connector"
] | eb608e6652aca8a46dd80dd04159142a7e2d2f9b | https://github.com/amenophis/WHMCS-Connector/blob/eb608e6652aca8a46dd80dd04159142a7e2d2f9b/src/Amenophis/WHMCS/Adapter/Manager.php#L50-L65 |
23,207 | tttptd/laravel-responder | src/ResponderServiceProvider.php | ResponderServiceProvider.registerFractal | protected function registerFractal()
{
$this->app->bind(SerializerAbstract::class, function ($app) {
$serializer = $app->config->get('responder.serializer');
return new $serializer;
});
$this->app->bind(Manager::class, function ($app) {
return (new Manag... | php | protected function registerFractal()
{
$this->app->bind(SerializerAbstract::class, function ($app) {
$serializer = $app->config->get('responder.serializer');
return new $serializer;
});
$this->app->bind(Manager::class, function ($app) {
return (new Manag... | [
"protected",
"function",
"registerFractal",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"SerializerAbstract",
"::",
"class",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"serializer",
"=",
"$",
"app",
"->",
"config",
"->",
"get",
"(... | Register Fractal serializer, manager and a factory to generate Fractal
resource instances.
@return void | [
"Register",
"Fractal",
"serializer",
"manager",
"and",
"a",
"factory",
"to",
"generate",
"Fractal",
"resource",
"instances",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/ResponderServiceProvider.php#L95-L110 |
23,208 | tttptd/laravel-responder | src/ResponderServiceProvider.php | ResponderServiceProvider.registerResponseBuilders | protected function registerResponseBuilders()
{
$this->app->bind(SuccessResponseBuilder::class, function ($app) {
$builder = new SuccessResponseBuilder(response(), $app[ResourceFactory::class], $app[Manager::class]);
if ($parameter = $app->config->get('responder.load_relations_from_... | php | protected function registerResponseBuilders()
{
$this->app->bind(SuccessResponseBuilder::class, function ($app) {
$builder = new SuccessResponseBuilder(response(), $app[ResourceFactory::class], $app[Manager::class]);
if ($parameter = $app->config->get('responder.load_relations_from_... | [
"protected",
"function",
"registerResponseBuilders",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bind",
"(",
"SuccessResponseBuilder",
"::",
"class",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"builder",
"=",
"new",
"SuccessResponseBuilder",
"(",
"... | Register success and error response builders.
@return void | [
"Register",
"success",
"and",
"error",
"response",
"builders",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/ResponderServiceProvider.php#L117-L136 |
23,209 | tttptd/laravel-responder | src/ResponderServiceProvider.php | ResponderServiceProvider.registerAliases | protected function registerAliases()
{
$this->app->alias(Responder::class, 'responder');
$this->app->alias(SuccessResponseBuilder::class, 'responder.success');
$this->app->alias(ErrorResponseBuilder::class, 'responder.error');
$this->app->alias(Manager::class, 'responder.manager');
... | php | protected function registerAliases()
{
$this->app->alias(Responder::class, 'responder');
$this->app->alias(SuccessResponseBuilder::class, 'responder.success');
$this->app->alias(ErrorResponseBuilder::class, 'responder.error');
$this->app->alias(Manager::class, 'responder.manager');
... | [
"protected",
"function",
"registerAliases",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"alias",
"(",
"Responder",
"::",
"class",
",",
"'responder'",
")",
";",
"$",
"this",
"->",
"app",
"->",
"alias",
"(",
"SuccessResponseBuilder",
"::",
"class",
",",
... | Set aliases for the provided services.
@return void | [
"Set",
"aliases",
"for",
"the",
"provided",
"services",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/ResponderServiceProvider.php#L143-L150 |
23,210 | antaresproject/notifications | src/Event/EventDispatcher.php | EventDispatcher.run | public function run(array $notification, array $variables = null, array $recipients = null)
{
$typeName = Arr::get($notification, 'type.name');
switch ($typeName) {
case 'email':
$instance = app(EmailNotification::class);
break;
case 'sms':
... | php | public function run(array $notification, array $variables = null, array $recipients = null)
{
$typeName = Arr::get($notification, 'type.name');
switch ($typeName) {
case 'email':
$instance = app(EmailNotification::class);
break;
case 'sms':
... | [
"public",
"function",
"run",
"(",
"array",
"$",
"notification",
",",
"array",
"$",
"variables",
"=",
"null",
",",
"array",
"$",
"recipients",
"=",
"null",
")",
"{",
"$",
"typeName",
"=",
"Arr",
"::",
"get",
"(",
"$",
"notification",
",",
"'type.name'",
... | Sends notification.
@param array $notification
@param array|null $variables
@param array|null $recipients
@return bool|\Symfony\Component\HttpFoundation\Response | [
"Sends",
"notification",
"."
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Event/EventDispatcher.php#L45-L75 |
23,211 | mothership-ec/composer | src/Composer/Downloader/DownloadManager.php | DownloadManager.getDownloaderForInstalledPackage | public function getDownloaderForInstalledPackage(PackageInterface $package)
{
$installationSource = $package->getInstallationSource();
if ('metapackage' === $package->getType()) {
return;
}
if ('dist' === $installationSource) {
$downloader = $this->getDownlo... | php | public function getDownloaderForInstalledPackage(PackageInterface $package)
{
$installationSource = $package->getInstallationSource();
if ('metapackage' === $package->getType()) {
return;
}
if ('dist' === $installationSource) {
$downloader = $this->getDownlo... | [
"public",
"function",
"getDownloaderForInstalledPackage",
"(",
"PackageInterface",
"$",
"package",
")",
"{",
"$",
"installationSource",
"=",
"$",
"package",
"->",
"getInstallationSource",
"(",
")",
";",
"if",
"(",
"'metapackage'",
"===",
"$",
"package",
"->",
"get... | Returns downloader for already installed package.
@param PackageInterface $package package instance
@return DownloaderInterface|null
@throws \InvalidArgumentException if package has no installation source specified
@throws \LogicException if specific downloader used to load package with
wrong type | [
"Returns",
"downloader",
"for",
"already",
"installed",
"package",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Downloader/DownloadManager.php#L131-L157 |
23,212 | mothership-ec/composer | src/Composer/Downloader/DownloadManager.php | DownloadManager.update | public function update(PackageInterface $initial, PackageInterface $target, $targetDir)
{
$downloader = $this->getDownloaderForInstalledPackage($initial);
if (!$downloader) {
return;
}
$installationSource = $initial->getInstallationSource();
if ('dist' === $inst... | php | public function update(PackageInterface $initial, PackageInterface $target, $targetDir)
{
$downloader = $this->getDownloaderForInstalledPackage($initial);
if (!$downloader) {
return;
}
$installationSource = $initial->getInstallationSource();
if ('dist' === $inst... | [
"public",
"function",
"update",
"(",
"PackageInterface",
"$",
"initial",
",",
"PackageInterface",
"$",
"target",
",",
"$",
"targetDir",
")",
"{",
"$",
"downloader",
"=",
"$",
"this",
"->",
"getDownloaderForInstalledPackage",
"(",
"$",
"initial",
")",
";",
"if"... | Updates package from initial to target version.
@param PackageInterface $initial initial package version
@param PackageInterface $target target package version
@param string $targetDir target dir
@throws \InvalidArgumentException if initial package is not installed | [
"Updates",
"package",
"from",
"initial",
"to",
"target",
"version",
"."
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Downloader/DownloadManager.php#L228-L260 |
23,213 | Smile-SA/CronBundle | Repository/SmileCronRepository.php | SmileCronRepository.isQueued | public function isQueued($alias)
{
$query = $this->createQueryBuilder('c')
->where('c.alias = :alias')
->andWhere('c.ended is NULL')
->setParameter('alias', $alias)
->getQuery();
$result = $query->setMaxResults(1)->getOneOrNullResult();
if ($... | php | public function isQueued($alias)
{
$query = $this->createQueryBuilder('c')
->where('c.alias = :alias')
->andWhere('c.ended is NULL')
->setParameter('alias', $alias)
->getQuery();
$result = $query->setMaxResults(1)->getOneOrNullResult();
if ($... | [
"public",
"function",
"isQueued",
"(",
"$",
"alias",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'c'",
")",
"->",
"where",
"(",
"'c.alias = :alias'",
")",
"->",
"andWhere",
"(",
"'c.ended is NULL'",
")",
"->",
"setParameter",
... | Identify of cron command is queued
@param string $alias cron alias
@return bool true if cron is already queued | [
"Identify",
"of",
"cron",
"command",
"is",
"queued"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Repository/SmileCronRepository.php#L20-L34 |
23,214 | Smile-SA/CronBundle | Repository/SmileCronRepository.php | SmileCronRepository.addQueued | public function addQueued($alias)
{
$query = $this->createQueryBuilder('c')
->where('c.alias = :alias')
->setParameter('alias', $alias)
->getQuery();
/** @var SmileCron $smileCron */
$smileCron = $query->setMaxResults(1)->getOneOrNullResult();
if... | php | public function addQueued($alias)
{
$query = $this->createQueryBuilder('c')
->where('c.alias = :alias')
->setParameter('alias', $alias)
->getQuery();
/** @var SmileCron $smileCron */
$smileCron = $query->setMaxResults(1)->getOneOrNullResult();
if... | [
"public",
"function",
"addQueued",
"(",
"$",
"alias",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'c'",
")",
"->",
"where",
"(",
"'c.alias = :alias'",
")",
"->",
"setParameter",
"(",
"'alias'",
",",
"$",
"alias",
")",
"->"... | Add cron to queued
@param string $alias cron alias | [
"Add",
"cron",
"to",
"queued"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Repository/SmileCronRepository.php#L41-L64 |
23,215 | Smile-SA/CronBundle | Repository/SmileCronRepository.php | SmileCronRepository.run | public function run(SmileCron $smileCron)
{
$now = new \DateTime('now');
$smileCron->setStarted($now);
$this->getEntityManager()->persist($smileCron);
$this->getEntityManager()->flush();
} | php | public function run(SmileCron $smileCron)
{
$now = new \DateTime('now');
$smileCron->setStarted($now);
$this->getEntityManager()->persist($smileCron);
$this->getEntityManager()->flush();
} | [
"public",
"function",
"run",
"(",
"SmileCron",
"$",
"smileCron",
")",
"{",
"$",
"now",
"=",
"new",
"\\",
"DateTime",
"(",
"'now'",
")",
";",
"$",
"smileCron",
"->",
"setStarted",
"(",
"$",
"now",
")",
";",
"$",
"this",
"->",
"getEntityManager",
"(",
... | Run cron command
@param SmileCron $smileCron cron command | [
"Run",
"cron",
"command"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Repository/SmileCronRepository.php#L86-L92 |
23,216 | Smile-SA/CronBundle | Repository/SmileCronRepository.php | SmileCronRepository.end | public function end(SmileCron $smileCron, $status = 0)
{
$now = new \DateTime('now');
$smileCron->setEnded($now);
$smileCron->setStatus($status);
$this->getEntityManager()->persist($smileCron);
$this->getEntityManager()->flush();
} | php | public function end(SmileCron $smileCron, $status = 0)
{
$now = new \DateTime('now');
$smileCron->setEnded($now);
$smileCron->setStatus($status);
$this->getEntityManager()->persist($smileCron);
$this->getEntityManager()->flush();
} | [
"public",
"function",
"end",
"(",
"SmileCron",
"$",
"smileCron",
",",
"$",
"status",
"=",
"0",
")",
"{",
"$",
"now",
"=",
"new",
"\\",
"DateTime",
"(",
"'now'",
")",
";",
"$",
"smileCron",
"->",
"setEnded",
"(",
"$",
"now",
")",
";",
"$",
"smileCro... | End cron command
@param SmileCron $smileCron cron command
@param int $status cron command status | [
"End",
"cron",
"command"
] | 3e6d29112915fa957cc04386ba9c6d1fc134d31f | https://github.com/Smile-SA/CronBundle/blob/3e6d29112915fa957cc04386ba9c6d1fc134d31f/Repository/SmileCronRepository.php#L100-L107 |
23,217 | Innmind/neo4j-dbal | src/Transport/Http.php | Http.isSuccessful | private function isSuccessful(Response $response): bool
{
if ($response->statusCode()->value() !== 200) {
return false;
}
$json = Json::decode((string) $response->body());
return count($json['errors']) === 0;
} | php | private function isSuccessful(Response $response): bool
{
if ($response->statusCode()->value() !== 200) {
return false;
}
$json = Json::decode((string) $response->body());
return count($json['errors']) === 0;
} | [
"private",
"function",
"isSuccessful",
"(",
"Response",
"$",
"response",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"response",
"->",
"statusCode",
"(",
")",
"->",
"value",
"(",
")",
"!==",
"200",
")",
"{",
"return",
"false",
";",
"}",
"$",
"json",
"=",
... | Check if the response is successful
@param Response $response
@return bool | [
"Check",
"if",
"the",
"response",
"is",
"successful"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Transport/Http.php#L94-L103 |
23,218 | FriendsOfApi/phraseapp | src/Api/Locale.php | Locale.download | public function download(string $projectKey, string $localeId, string $ext, array $params = [])
{
$params['file_format'] = $ext;
$response = $this->httpGet(sprintf('/api/v2/projects/%s/locales/%s/download', $projectKey, $localeId), $params);
if (!$this->hydrator) {
return $resp... | php | public function download(string $projectKey, string $localeId, string $ext, array $params = [])
{
$params['file_format'] = $ext;
$response = $this->httpGet(sprintf('/api/v2/projects/%s/locales/%s/download', $projectKey, $localeId), $params);
if (!$this->hydrator) {
return $resp... | [
"public",
"function",
"download",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"localeId",
",",
"string",
"$",
"ext",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"[",
"'file_format'",
"]",
"=",
"$",
"ext",
";",
"$",
... | Download a locale.
@param string $projectKey
@param string $localeId
@param string $ext
@param array $params
@throws Exception
@return string|ResponseInterface | [
"Download",
"a",
"locale",
"."
] | 1553bf857eb0858f9a7eb905b085864d24f80886 | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Locale.php#L32-L47 |
23,219 | ekuiter/feature-php | FeaturePhp/Generator/CopyGenerator.php | CopyGenerator.processFileSpecification | protected function processFileSpecification($artifact, $fileSpecification) {
$this->files[] = fphp\File\StoredFile::fromSpecification($fileSpecification);
$this->tracingLinks[] = new fphp\Artifact\TracingLink(
"file", $artifact, $fileSpecification->getSourcePlace(), $fileSpecification->getTa... | php | protected function processFileSpecification($artifact, $fileSpecification) {
$this->files[] = fphp\File\StoredFile::fromSpecification($fileSpecification);
$this->tracingLinks[] = new fphp\Artifact\TracingLink(
"file", $artifact, $fileSpecification->getSourcePlace(), $fileSpecification->getTa... | [
"protected",
"function",
"processFileSpecification",
"(",
"$",
"artifact",
",",
"$",
"fileSpecification",
")",
"{",
"$",
"this",
"->",
"files",
"[",
"]",
"=",
"fphp",
"\\",
"File",
"\\",
"StoredFile",
"::",
"fromSpecification",
"(",
"$",
"fileSpecification",
"... | Adds a stored file from a specification.
Considers globally excluded files. Only exact file names are supported.
@param \FeaturePhp\Artifact\Artifact $artifact
@param \FeaturePhp\Specification\FileSpecification $fileSpecification | [
"Adds",
"a",
"stored",
"file",
"from",
"a",
"specification",
".",
"Considers",
"globally",
"excluded",
"files",
".",
"Only",
"exact",
"file",
"names",
"are",
"supported",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/CopyGenerator.php#L34-L39 |
23,220 | oroinc/OroLayoutComponent | LayoutRegistry.php | LayoutRegistry.addExtension | public function addExtension(ExtensionInterface $extension, $priority = 0)
{
$this->extensions[$priority][] = $extension;
$this->sorted = null;
$this->typeExtensions = [];
} | php | public function addExtension(ExtensionInterface $extension, $priority = 0)
{
$this->extensions[$priority][] = $extension;
$this->sorted = null;
$this->typeExtensions = [];
} | [
"public",
"function",
"addExtension",
"(",
"ExtensionInterface",
"$",
"extension",
",",
"$",
"priority",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"extensions",
"[",
"$",
"priority",
"]",
"[",
"]",
"=",
"$",
"extension",
";",
"$",
"this",
"->",
"sorted",
... | Registers an layout extension.
@param ExtensionInterface $extension
@param int $priority | [
"Registers",
"an",
"layout",
"extension",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutRegistry.php#L204-L209 |
23,221 | oroinc/OroLayoutComponent | LayoutRegistry.php | LayoutRegistry.getExtensions | protected function getExtensions()
{
if (null === $this->sorted) {
ksort($this->extensions);
$this->sorted = !empty($this->extensions)
? call_user_func_array('array_merge', $this->extensions)
: [];
}
return $this->sorted;
} | php | protected function getExtensions()
{
if (null === $this->sorted) {
ksort($this->extensions);
$this->sorted = !empty($this->extensions)
? call_user_func_array('array_merge', $this->extensions)
: [];
}
return $this->sorted;
} | [
"protected",
"function",
"getExtensions",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"sorted",
")",
"{",
"ksort",
"(",
"$",
"this",
"->",
"extensions",
")",
";",
"$",
"this",
"->",
"sorted",
"=",
"!",
"empty",
"(",
"$",
"this",
"->... | Returns all registered extensions sorted by priority.
@return ExtensionInterface[] | [
"Returns",
"all",
"registered",
"extensions",
"sorted",
"by",
"priority",
"."
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/LayoutRegistry.php#L216-L226 |
23,222 | ekuiter/feature-php | FeaturePhp/Helper/_String.php | _String.getMaxLength | public static function getMaxLength($array, $key) {
$maxLen = 0;
foreach ($array as $element) {
$str = call_user_func(array($element, $key));
$maxLen = strlen($str) > $maxLen ? strlen($str) : $maxLen;
}
return $maxLen;
} | php | public static function getMaxLength($array, $key) {
$maxLen = 0;
foreach ($array as $element) {
$str = call_user_func(array($element, $key));
$maxLen = strlen($str) > $maxLen ? strlen($str) : $maxLen;
}
return $maxLen;
} | [
"public",
"static",
"function",
"getMaxLength",
"(",
"$",
"array",
",",
"$",
"key",
")",
"{",
"$",
"maxLen",
"=",
"0",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"element",
")",
"{",
"$",
"str",
"=",
"call_user_func",
"(",
"array",
"(",
"$",
"el... | Returns the maximum member length of an array of objects.
@param array $array
@param callable $key
@return int | [
"Returns",
"the",
"maximum",
"member",
"length",
"of",
"an",
"array",
"of",
"objects",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/_String.php#L45-L52 |
23,223 | qlake/framework | src/Qlake/Config/Config.php | Config.aliases | public function aliases(array $aliases = null)
{
if (is_null($aliases))
{
return $this->aliases;
}
else
{
$this->aliases = array_merge($this->aliases, $aliases);
}
} | php | public function aliases(array $aliases = null)
{
if (is_null($aliases))
{
return $this->aliases;
}
else
{
$this->aliases = array_merge($this->aliases, $aliases);
}
} | [
"public",
"function",
"aliases",
"(",
"array",
"$",
"aliases",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"aliases",
")",
")",
"{",
"return",
"$",
"this",
"->",
"aliases",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"aliases",
"=",
"array... | Set or get config aliases
@param array $aliases
@return array|null | [
"Set",
"or",
"get",
"config",
"aliases"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Config/Config.php#L48-L58 |
23,224 | qlake/framework | src/Qlake/Config/Config.php | Config.alias | public function alias($alias, $path = null)
{
if (is_null($path))
{
return $this->aliases[$alias] ?: null;
}
else
{
$this->aliases[$alias] = $path;
}
} | php | public function alias($alias, $path = null)
{
if (is_null($path))
{
return $this->aliases[$alias] ?: null;
}
else
{
$this->aliases[$alias] = $path;
}
} | [
"public",
"function",
"alias",
"(",
"$",
"alias",
",",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"this",
"->",
"aliases",
"[",
"$",
"alias",
"]",
"?",
":",
"null",
";",
"}",
"else"... | Set or get a config alias
@param string $alias
@param string $path
@return string|null | [
"Set",
"or",
"get",
"a",
"config",
"alias"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Config/Config.php#L68-L78 |
23,225 | qlake/framework | src/Qlake/Config/Config.php | Config.loadConfig | protected function loadConfig($alias, $configName)
{
if (isset($this->aliases[$alias]))
{
$aliasPath = $this->aliases[$alias];
}
else
{
throw new ClearException("Config Alias [$alias] Not Found.", 4);
}
$file = $aliasPath . $configName . '.php';
if (is_file($file))
{
return $this->configs[... | php | protected function loadConfig($alias, $configName)
{
if (isset($this->aliases[$alias]))
{
$aliasPath = $this->aliases[$alias];
}
else
{
throw new ClearException("Config Alias [$alias] Not Found.", 4);
}
$file = $aliasPath . $configName . '.php';
if (is_file($file))
{
return $this->configs[... | [
"protected",
"function",
"loadConfig",
"(",
"$",
"alias",
",",
"$",
"configName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"alias",
"]",
")",
")",
"{",
"$",
"aliasPath",
"=",
"$",
"this",
"->",
"aliases",
"[",
"$",... | Open and load configs from a file
@param string $alias
@param string $configName
@return array | [
"Open",
"and",
"load",
"configs",
"from",
"a",
"file"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Config/Config.php#L111-L130 |
23,226 | qlake/framework | src/Qlake/Config/Config.php | Config.set | public function set($mixedKey, $value)
{
list($alias, $configName, $key) = $this->parseKey($mixedKey);
if (is_null($key))
{
$this->configs[$alias][$configName] = $value;
}
$this->configs[$alias][$configName][$key] = $value;
} | php | public function set($mixedKey, $value)
{
list($alias, $configName, $key) = $this->parseKey($mixedKey);
if (is_null($key))
{
$this->configs[$alias][$configName] = $value;
}
$this->configs[$alias][$configName][$key] = $value;
} | [
"public",
"function",
"set",
"(",
"$",
"mixedKey",
",",
"$",
"value",
")",
"{",
"list",
"(",
"$",
"alias",
",",
"$",
"configName",
",",
"$",
"key",
")",
"=",
"$",
"this",
"->",
"parseKey",
"(",
"$",
"mixedKey",
")",
";",
"if",
"(",
"is_null",
"("... | Set a config
@param string $mixedKey May be a key or a config file name
@param mixed $value
@return array|mixed | [
"Set",
"a",
"config"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Config/Config.php#L160-L170 |
23,227 | qlake/framework | src/Qlake/Config/Config.php | Config.parseKey | protected function parseKey($mixedKey)
{
if (preg_match('/^((?P<alias>[\w]+)::)?(?P<name>\w+)(\.(?P<key>\w+))?$/', $mixedKey, $matches) !==1)
{
throw new ClearException("Invalid Config Variable Name. Name Must Be Like [alias::name.key] Or [name.key].", 4);
}
$alias = $matches['alias'];
$name = $matches[... | php | protected function parseKey($mixedKey)
{
if (preg_match('/^((?P<alias>[\w]+)::)?(?P<name>\w+)(\.(?P<key>\w+))?$/', $mixedKey, $matches) !==1)
{
throw new ClearException("Invalid Config Variable Name. Name Must Be Like [alias::name.key] Or [name.key].", 4);
}
$alias = $matches['alias'];
$name = $matches[... | [
"protected",
"function",
"parseKey",
"(",
"$",
"mixedKey",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^((?P<alias>[\\w]+)::)?(?P<name>\\w+)(\\.(?P<key>\\w+))?$/'",
",",
"$",
"mixedKey",
",",
"$",
"matches",
")",
"!==",
"1",
")",
"{",
"throw",
"new",
"ClearExceptio... | Parse requested mixed-key and split alias, name and key
@param string $mixedKey
@return array An array like [alias, name, key] | [
"Parse",
"requested",
"mixed",
"-",
"key",
"and",
"split",
"alias",
"name",
"and",
"key"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Config/Config.php#L179-L191 |
23,228 | 42mate/towel | src/Towel/BaseApp.php | BaseApp.db | public function db($database = null)
{
if (empty($database)) {
$database = $this->database;
}
return $this->silex['dbs'][$database];
} | php | public function db($database = null)
{
if (empty($database)) {
$database = $this->database;
}
return $this->silex['dbs'][$database];
} | [
"public",
"function",
"db",
"(",
"$",
"database",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"database",
")",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"database",
";",
"}",
"return",
"$",
"this",
"->",
"silex",
"[",
"'dbs'",
"... | Gets dbal engine.
@param string $database : Database to use, check config to see available sources.
default is the default source.
@return \Doctrine\DBAL\Connection | [
"Gets",
"dbal",
"engine",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/BaseApp.php#L55-L61 |
23,229 | 42mate/towel | src/Towel/BaseApp.php | BaseApp.getCurrentUser | public function getCurrentUser()
{
if (Towel::isCli()) {
return false; //Cli is not logged.
}
$userRecord = $this->session()->get('user', false);
if (!$userRecord) {
return false;
}
$userModel = $this->getInstance('user_model');
$userMo... | php | public function getCurrentUser()
{
if (Towel::isCli()) {
return false; //Cli is not logged.
}
$userRecord = $this->session()->get('user', false);
if (!$userRecord) {
return false;
}
$userModel = $this->getInstance('user_model');
$userMo... | [
"public",
"function",
"getCurrentUser",
"(",
")",
"{",
"if",
"(",
"Towel",
"::",
"isCli",
"(",
")",
")",
"{",
"return",
"false",
";",
"//Cli is not logged.",
"}",
"$",
"userRecord",
"=",
"$",
"this",
"->",
"session",
"(",
")",
"->",
"get",
"(",
"'user'... | Gets the current user or false if is not authenticated.
@returns \Towel\Model\BaseModel | [
"Gets",
"the",
"current",
"user",
"or",
"false",
"if",
"is",
"not",
"authenticated",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/BaseApp.php#L97-L112 |
23,230 | 42mate/towel | src/Towel/BaseApp.php | BaseApp.sendMail | public function sendMail($to, $subject = '', $message = '', $headers = '')
{
if (empty($headers)) {
$headers = 'From: ' . APP_SYS_EMAIL;
}
mail($to, $subject, $message, $headers);
} | php | public function sendMail($to, $subject = '', $message = '', $headers = '')
{
if (empty($headers)) {
$headers = 'From: ' . APP_SYS_EMAIL;
}
mail($to, $subject, $message, $headers);
} | [
"public",
"function",
"sendMail",
"(",
"$",
"to",
",",
"$",
"subject",
"=",
"''",
",",
"$",
"message",
"=",
"''",
",",
"$",
"headers",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"headers",
")",
")",
"{",
"$",
"headers",
"=",
"'From: '",
... | Sends an Email.
@param $to
@param string $subject
@param string $message
@param string $headers | [
"Sends",
"an",
"Email",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/BaseApp.php#L154-L160 |
23,231 | 42mate/towel | src/Towel/BaseApp.php | BaseApp.url | public function url($route, $parameters = array())
{
return $this->silex['url_generator']->generate($route, $parameters, \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL);
} | php | public function url($route, $parameters = array())
{
return $this->silex['url_generator']->generate($route, $parameters, \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL);
} | [
"public",
"function",
"url",
"(",
"$",
"route",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"silex",
"[",
"'url_generator'",
"]",
"->",
"generate",
"(",
"$",
"route",
",",
"$",
"parameters",
",",
"\\",
"Symf... | Generates an absolute URL from the given parameters.
@param string $route The name of the route
@param mixed $parameters An array of parameters
@return string The generated URL | [
"Generates",
"an",
"absolute",
"URL",
"from",
"the",
"given",
"parameters",
"."
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/BaseApp.php#L183-L186 |
23,232 | 42mate/towel | src/Towel/BaseApp.php | BaseApp.getCache | public function getCache()
{
if (null === self::$cache) {
if (!empty($this->appConfig['cache']['driver'])) {
// Options definition.
if (empty($this->appConfig['cache']['options'])) {
$options = array();
} else {
... | php | public function getCache()
{
if (null === self::$cache) {
if (!empty($this->appConfig['cache']['driver'])) {
// Options definition.
if (empty($this->appConfig['cache']['options'])) {
$options = array();
} else {
... | [
"public",
"function",
"getCache",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"self",
"::",
"$",
"cache",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"appConfig",
"[",
"'cache'",
"]",
"[",
"'driver'",
"]",
")",
")",
"{",
"// Options def... | Instantiate Cache driver
@return \Towel\Cache\CacheInterface | [
"Instantiate",
"Cache",
"driver"
] | 5316c3075fc844e8a5cbae113712b26556227dff | https://github.com/42mate/towel/blob/5316c3075fc844e8a5cbae113712b26556227dff/src/Towel/BaseApp.php#L192-L219 |
23,233 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php | Xml.createErrorEntry | protected function createErrorEntry($error, $parse_errors)
{
$marker_obj = new \DOMElement(strtolower($error->getSeverity()));
$parse_errors->appendChild($marker_obj);
$message = ($this->getTranslator())
? vsprintf($this->getTranslator()->translate($error->getCode()), $error->ge... | php | protected function createErrorEntry($error, $parse_errors)
{
$marker_obj = new \DOMElement(strtolower($error->getSeverity()));
$parse_errors->appendChild($marker_obj);
$message = ($this->getTranslator())
? vsprintf($this->getTranslator()->translate($error->getCode()), $error->ge... | [
"protected",
"function",
"createErrorEntry",
"(",
"$",
"error",
",",
"$",
"parse_errors",
")",
"{",
"$",
"marker_obj",
"=",
"new",
"\\",
"DOMElement",
"(",
"strtolower",
"(",
"$",
"error",
"->",
"getSeverity",
"(",
")",
")",
")",
";",
"$",
"parse_errors",
... | Creates an entry in the ParseErrors collection of a file for a given error.
@param Error $error
@param \DOMElement $parse_errors
@return void | [
"Creates",
"an",
"entry",
"in",
"the",
"ParseErrors",
"collection",
"of",
"a",
"file",
"for",
"a",
"given",
"error",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php#L253-L265 |
23,234 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php | Xml.buildFunction | public function buildFunction(\DOMElement $parent, FunctionDescriptor $function, \DOMElement $child = null)
{
if (!$child) {
$child = new \DOMElement('function');
$parent->appendChild($child);
}
$namespace = $function->getNamespace()
? $function->getNames... | php | public function buildFunction(\DOMElement $parent, FunctionDescriptor $function, \DOMElement $child = null)
{
if (!$child) {
$child = new \DOMElement('function');
$parent->appendChild($child);
}
$namespace = $function->getNamespace()
? $function->getNames... | [
"public",
"function",
"buildFunction",
"(",
"\\",
"DOMElement",
"$",
"parent",
",",
"FunctionDescriptor",
"$",
"function",
",",
"\\",
"DOMElement",
"$",
"child",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"child",
")",
"{",
"$",
"child",
"=",
"new",
"... | Export this function definition to the given parent DOMElement.
@param \DOMElement $parent Element to augment.
@param FunctionDescriptor $function Element to export.
@param \DOMElement $child if supplied this element will be augmented instead of freshly added.
@return void | [
"Export",
"this",
"function",
"definition",
"to",
"the",
"given",
"parent",
"DOMElement",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php#L289-L310 |
23,235 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php | Xml.buildPackageTree | protected function buildPackageTree(\DOMDocument $dom)
{
$xpath = new \DOMXPath($dom);
$packages = array('global' => true);
$qry = $xpath->query('//@package');
for ($i = 0; $i < $qry->length; $i++) {
if (isset($packages[$qry->item($i)->nodeValue])) {
conti... | php | protected function buildPackageTree(\DOMDocument $dom)
{
$xpath = new \DOMXPath($dom);
$packages = array('global' => true);
$qry = $xpath->query('//@package');
for ($i = 0; $i < $qry->length; $i++) {
if (isset($packages[$qry->item($i)->nodeValue])) {
conti... | [
"protected",
"function",
"buildPackageTree",
"(",
"\\",
"DOMDocument",
"$",
"dom",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"dom",
")",
";",
"$",
"packages",
"=",
"array",
"(",
"'global'",
"=>",
"true",
")",
";",
"$",
"qry",
"=... | Collects all packages and subpackages, and adds a new section in the
DOM to provide an overview.
@param \DOMDocument $dom Packages are extracted and a summary inserted
in this object.
@return void | [
"Collects",
"all",
"packages",
"and",
"subpackages",
"and",
"adds",
"a",
"new",
"section",
"in",
"the",
"DOM",
"to",
"provide",
"an",
"overview",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php#L474-L489 |
23,236 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php | Xml.buildNamespaceTree | protected function buildNamespaceTree(\DOMDocument $dom)
{
$xpath = new \DOMXPath($dom);
$namespaces = array();
$qry = $xpath->query('//@namespace');
for ($i = 0; $i < $qry->length; $i++) {
if (isset($namespaces[$qry->item($i)->nodeValue])) {
continue;
... | php | protected function buildNamespaceTree(\DOMDocument $dom)
{
$xpath = new \DOMXPath($dom);
$namespaces = array();
$qry = $xpath->query('//@namespace');
for ($i = 0; $i < $qry->length; $i++) {
if (isset($namespaces[$qry->item($i)->nodeValue])) {
continue;
... | [
"protected",
"function",
"buildNamespaceTree",
"(",
"\\",
"DOMDocument",
"$",
"dom",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"dom",
")",
";",
"$",
"namespaces",
"=",
"array",
"(",
")",
";",
"$",
"qry",
"=",
"$",
"xpath",
"->",... | Collects all namespaces and sub-namespaces, and adds a new section in
the DOM to provide an overview.
@param \DOMDocument $dom Namespaces are extracted and a summary inserted
in this object.
@return void | [
"Collects",
"all",
"namespaces",
"and",
"sub",
"-",
"namespaces",
"and",
"adds",
"a",
"new",
"section",
"in",
"the",
"DOM",
"to",
"provide",
"an",
"overview",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php#L500-L515 |
23,237 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php | Xml.generateNamespaceTree | protected function generateNamespaceTree($namespaces)
{
sort($namespaces);
$result = array();
foreach ($namespaces as $namespace) {
if (!$namespace) {
$namespace = 'global';
}
$namespace_list = explode('\\', $namespace);
$nod... | php | protected function generateNamespaceTree($namespaces)
{
sort($namespaces);
$result = array();
foreach ($namespaces as $namespace) {
if (!$namespace) {
$namespace = 'global';
}
$namespace_list = explode('\\', $namespace);
$nod... | [
"protected",
"function",
"generateNamespaceTree",
"(",
"$",
"namespaces",
")",
"{",
"sort",
"(",
"$",
"namespaces",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"namespaces",
"as",
"$",
"namespace",
")",
"{",
"if",
"(",
"!... | Generates a hierarchical array of namespaces with their singular name
from a single level list of namespaces with their full name.
@param array $namespaces the list of namespaces as retrieved from the xml.
@return array | [
"Generates",
"a",
"hierarchical",
"array",
"of",
"namespaces",
"with",
"their",
"singular",
"name",
"from",
"a",
"single",
"level",
"list",
"of",
"namespaces",
"with",
"their",
"full",
"name",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php#L568-L591 |
23,238 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php | Xml.generateNamespaceElements | protected function generateNamespaceElements($namespaces, $parent_element, $node_name = 'namespace')
{
foreach ($namespaces as $name => $sub_namespaces) {
$node = new \DOMElement($node_name);
$parent_element->appendChild($node);
$node->setAttribute('name', $name);
... | php | protected function generateNamespaceElements($namespaces, $parent_element, $node_name = 'namespace')
{
foreach ($namespaces as $name => $sub_namespaces) {
$node = new \DOMElement($node_name);
$parent_element->appendChild($node);
$node->setAttribute('name', $name);
... | [
"protected",
"function",
"generateNamespaceElements",
"(",
"$",
"namespaces",
",",
"$",
"parent_element",
",",
"$",
"node_name",
"=",
"'namespace'",
")",
"{",
"foreach",
"(",
"$",
"namespaces",
"as",
"$",
"name",
"=>",
"$",
"sub_namespaces",
")",
"{",
"$",
"... | Recursive method to create a hierarchical set of nodes in the dom.
@param array[] $namespaces the list of namespaces to process.
@param \DOMElement $parent_element the node to receive the children of
the above list.
@param string $node_name the name of the summary element.
@return void | [
"Recursive",
"method",
"to",
"create",
"a",
"hierarchical",
"set",
"of",
"nodes",
"in",
"the",
"dom",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php#L603-L615 |
23,239 | hametuha/wpametu | src/WPametu/Service/Recaptcha.php | Recaptcha.get_html | public function get_html($theme = 'light', $lang = 'en', $type = 'image'){
if( $this->enabled ){
// Option value
$option = [];
// Select theme
switch($theme){
case 'dark':
$option['theme'] = $theme;
break;
... | php | public function get_html($theme = 'light', $lang = 'en', $type = 'image'){
if( $this->enabled ){
// Option value
$option = [];
// Select theme
switch($theme){
case 'dark':
$option['theme'] = $theme;
break;
... | [
"public",
"function",
"get_html",
"(",
"$",
"theme",
"=",
"'light'",
",",
"$",
"lang",
"=",
"'en'",
",",
"$",
"type",
"=",
"'image'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enabled",
")",
"{",
"// Option value",
"$",
"option",
"=",
"[",
"]",
";",... | Return reCaptcha's HTML
@link https://developers.google.com/recaptcha/docs/language
@param string $theme light(default), dark
@param string $lang en(default), fr, nl, de, pt, ru, es, tr, ja and more.
@param string $type image(default) audio
@return string|false | [
"Return",
"reCaptcha",
"s",
"HTML"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Service/Recaptcha.php#L70-L167 |
23,240 | Speicher210/monsum-api | src/Model/Subscription.php | Subscription.isRunning | public function isRunning()
{
$runningStatuses = [
self::SUBSCRIPTION_STATUS_ACTIVE,
self::SUBSCRIPTION_STATUS_TRIAL,
];
return in_array($this->getStatus(), $runningStatuses, true);
} | php | public function isRunning()
{
$runningStatuses = [
self::SUBSCRIPTION_STATUS_ACTIVE,
self::SUBSCRIPTION_STATUS_TRIAL,
];
return in_array($this->getStatus(), $runningStatuses, true);
} | [
"public",
"function",
"isRunning",
"(",
")",
"{",
"$",
"runningStatuses",
"=",
"[",
"self",
"::",
"SUBSCRIPTION_STATUS_ACTIVE",
",",
"self",
"::",
"SUBSCRIPTION_STATUS_TRIAL",
",",
"]",
";",
"return",
"in_array",
"(",
"$",
"this",
"->",
"getStatus",
"(",
")",
... | Check if the current subscription is running.
@return boolean | [
"Check",
"if",
"the",
"current",
"subscription",
"is",
"running",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Model/Subscription.php#L71-L79 |
23,241 | CalderaWP/metaplate-core | src/helper_loader.php | helper_loader.add_helpers | private function add_helpers( $helpers ) {
foreach( $helpers as $helper ) {
$helper = $this->validate_helper_input( $helper );
if ( is_array( $helper ) ) {
$this->add_helper( $helper );
}
}
} | php | private function add_helpers( $helpers ) {
foreach( $helpers as $helper ) {
$helper = $this->validate_helper_input( $helper );
if ( is_array( $helper ) ) {
$this->add_helper( $helper );
}
}
} | [
"private",
"function",
"add_helpers",
"(",
"$",
"helpers",
")",
"{",
"foreach",
"(",
"$",
"helpers",
"as",
"$",
"helper",
")",
"{",
"$",
"helper",
"=",
"$",
"this",
"->",
"validate_helper_input",
"(",
"$",
"helper",
")",
";",
"if",
"(",
"is_array",
"("... | Add the helpers to the Handlebars instance, if validation passes.
@param array $helpers Array of helpers to add | [
"Add",
"the",
"helpers",
"to",
"the",
"Handlebars",
"instance",
"if",
"validation",
"passes",
"."
] | 15ede9c4250ab23112a32f8e45d5393f8278bbb8 | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/helper_loader.php#L58-L67 |
23,242 | CalderaWP/metaplate-core | src/helper_loader.php | helper_loader.validate_helper_input | private function validate_helper_input( $helper ) {
if ( ! is_array( $helper ) || empty( $helper ) ) {
return false;
}
if ( ! isset( $helper[ 'name' ] ) || ! isset( $helper[ 'class' ] ) ) {
return false;
}
//if not set, set callback name to "helper"
if ( ! isset( $helper[ 'callback' ] ) ) {
$he... | php | private function validate_helper_input( $helper ) {
if ( ! is_array( $helper ) || empty( $helper ) ) {
return false;
}
if ( ! isset( $helper[ 'name' ] ) || ! isset( $helper[ 'class' ] ) ) {
return false;
}
//if not set, set callback name to "helper"
if ( ! isset( $helper[ 'callback' ] ) ) {
$he... | [
"private",
"function",
"validate_helper_input",
"(",
"$",
"helper",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"helper",
")",
"||",
"empty",
"(",
"$",
"helper",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"he... | Make sure each helper passed in is valid.
@todo ensure helper class/callback are callable. Preferably, without creating object of the class.
@param array $helper Array to add helper with.
@return bool|array Returns the array if valid, false if not. | [
"Make",
"sure",
"each",
"helper",
"passed",
"in",
"is",
"valid",
"."
] | 15ede9c4250ab23112a32f8e45d5393f8278bbb8 | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/helper_loader.php#L93-L109 |
23,243 | CalderaWP/metaplate-core | src/pods/access.php | access.offsetGet | public function offsetGet($offset) {
if ( $this->offsetExists( $offset ) ) {
return parent::offsetGet( $offset );
} else {
if( 'id' == $offset || 'ID' == $offset ) {
$_value = $this->pod->id();
}else{
$_value = $this->pod->field( $offset );
}
if( $_value ) {
parent::offsetSet( $offset, $... | php | public function offsetGet($offset) {
if ( $this->offsetExists( $offset ) ) {
return parent::offsetGet( $offset );
} else {
if( 'id' == $offset || 'ID' == $offset ) {
$_value = $this->pod->id();
}else{
$_value = $this->pod->field( $offset );
}
if( $_value ) {
parent::offsetSet( $offset, $... | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"offset",
")",
")",
"{",
"return",
"parent",
"::",
"offsetGet",
"(",
"$",
"offset",
")",
";",
"}",
"else",
"{",
"if",
"(",
"'id... | Get an offset if already set or traverse Pod and then set plus reutrn.
@since 0.1.0
@param mixed $offset Offset to get
@return mixed | [
"Get",
"an",
"offset",
"if",
"already",
"set",
"or",
"traverse",
"Pod",
"and",
"then",
"set",
"plus",
"reutrn",
"."
] | 15ede9c4250ab23112a32f8e45d5393f8278bbb8 | https://github.com/CalderaWP/metaplate-core/blob/15ede9c4250ab23112a32f8e45d5393f8278bbb8/src/pods/access.php#L66-L81 |
23,244 | ekuiter/feature-php | FeaturePhp/Generator/CollaborationGenerator.php | CollaborationGenerator.processFileSpecification | protected function processFileSpecification($artifact, $fileSpecification) {
$collaboration = fphp\Collaboration\Collaboration::findByArtifact($this->collaborations, $artifact);
if (!$collaboration)
$this->collaborations[] = $collaboration = new fphp\Collaboration\Collaboration($artifact);
... | php | protected function processFileSpecification($artifact, $fileSpecification) {
$collaboration = fphp\Collaboration\Collaboration::findByArtifact($this->collaborations, $artifact);
if (!$collaboration)
$this->collaborations[] = $collaboration = new fphp\Collaboration\Collaboration($artifact);
... | [
"protected",
"function",
"processFileSpecification",
"(",
"$",
"artifact",
",",
"$",
"fileSpecification",
")",
"{",
"$",
"collaboration",
"=",
"fphp",
"\\",
"Collaboration",
"\\",
"Collaboration",
"::",
"findByArtifact",
"(",
"$",
"this",
"->",
"collaborations",
"... | Adds a role from a file to a collaboration.
@param \FeaturePhp\Artifact\Artifact $artifact
@param \FeaturePhp\Specification\FileSpecification $fileSpecification | [
"Adds",
"a",
"role",
"from",
"a",
"file",
"to",
"a",
"collaboration",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/CollaborationGenerator.php#L62-L70 |
23,245 | ekuiter/feature-php | FeaturePhp/Generator/CollaborationGenerator.php | CollaborationGenerator._generateFiles | protected function _generateFiles() {
foreach ($this->getRegisteredArtifacts() as $artifact) {
$featureName = $artifact->getFeature()->getName();
if (array_search($featureName, $this->featureOrder) === false)
throw new CollaborationGeneratorException("no feature order sup... | php | protected function _generateFiles() {
foreach ($this->getRegisteredArtifacts() as $artifact) {
$featureName = $artifact->getFeature()->getName();
if (array_search($featureName, $this->featureOrder) === false)
throw new CollaborationGeneratorException("no feature order sup... | [
"protected",
"function",
"_generateFiles",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRegisteredArtifacts",
"(",
")",
"as",
"$",
"artifact",
")",
"{",
"$",
"featureName",
"=",
"$",
"artifact",
"->",
"getFeature",
"(",
")",
"->",
"getName",
"(",
... | Generates the refined files. | [
"Generates",
"the",
"refined",
"files",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Generator/CollaborationGenerator.php#L75-L96 |
23,246 | crysalead/storage-stream | src/MultiStream.php | MultiStream.append | public function append($string, $length = null)
{
$this->end();
return $this->write($string, $length);
} | php | public function append($string, $length = null)
{
$this->end();
return $this->write($string, $length);
} | [
"public",
"function",
"append",
"(",
"$",
"string",
",",
"$",
"length",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"end",
"(",
")",
";",
"return",
"$",
"this",
"->",
"write",
"(",
"$",
"string",
",",
"$",
"length",
")",
";",
"}"
] | Append data to the stream.
@param string $string The string that is to be written.
@param integer $length If the length argument is given, writing will stop after length bytes have
been written or the end of string if reached, whichever comes first.
@return integer Number of bytes written | [
"Append",
"data",
"to",
"the",
"stream",
"."
] | 8ec613b42a2dd5d7e951a118f61d6094fe97dd9b | https://github.com/crysalead/storage-stream/blob/8ec613b42a2dd5d7e951a118f61d6094fe97dd9b/src/MultiStream.php#L291-L295 |
23,247 | crysalead/storage-stream | src/MultiStream.php | MultiStream.get | public function get($index)
{
if (!isset($this->_streams[$index])) {
throw new InvalidArgumentException("Unexisting stream index `{$index}`.");
}
return $this->_streams[$index];
} | php | public function get($index)
{
if (!isset($this->_streams[$index])) {
throw new InvalidArgumentException("Unexisting stream index `{$index}`.");
}
return $this->_streams[$index];
} | [
"public",
"function",
"get",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_streams",
"[",
"$",
"index",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Unexisting stream index `{$index}`.\"",
")",
"... | Return a contained stream.
@param integer $index An index.
@return object | [
"Return",
"a",
"contained",
"stream",
"."
] | 8ec613b42a2dd5d7e951a118f61d6094fe97dd9b | https://github.com/crysalead/storage-stream/blob/8ec613b42a2dd5d7e951a118f61d6094fe97dd9b/src/MultiStream.php#L335-L341 |
23,248 | crysalead/storage-stream | src/MultiStream.php | MultiStream.remove | public function remove($index)
{
if (!isset($this->_streams[$index])) {
throw new InvalidArgumentException("Unexisting stream index `{$index}`.");
}
$stream = $this->_streams[$index];
unset($this->_streams[$index]);
$this->_streams = array_values($this->_streams);... | php | public function remove($index)
{
if (!isset($this->_streams[$index])) {
throw new InvalidArgumentException("Unexisting stream index `{$index}`.");
}
$stream = $this->_streams[$index];
unset($this->_streams[$index]);
$this->_streams = array_values($this->_streams);... | [
"public",
"function",
"remove",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_streams",
"[",
"$",
"index",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Unexisting stream index `{$index}`.\"",
")",
... | Remove a stream.
@param integer $index An index.
@return object The removed stream. | [
"Remove",
"a",
"stream",
"."
] | 8ec613b42a2dd5d7e951a118f61d6094fe97dd9b | https://github.com/crysalead/storage-stream/blob/8ec613b42a2dd5d7e951a118f61d6094fe97dd9b/src/MultiStream.php#L349-L358 |
23,249 | crysalead/storage-stream | src/MultiStream.php | MultiStream.detach | public function detach()
{
$this->_offset = $this->_current = 0;
$this->_seekable = true;
foreach ($this->_streams as $stream) {
$stream->detach();
}
$this->_streams = [];
} | php | public function detach()
{
$this->_offset = $this->_current = 0;
$this->_seekable = true;
foreach ($this->_streams as $stream) {
$stream->detach();
}
$this->_streams = [];
} | [
"public",
"function",
"detach",
"(",
")",
"{",
"$",
"this",
"->",
"_offset",
"=",
"$",
"this",
"->",
"_current",
"=",
"0",
";",
"$",
"this",
"->",
"_seekable",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"_streams",
"as",
"$",
"stream",
")... | Detaches each attached stream.
Returns null as it's not clear which underlying stream resource to return. | [
"Detaches",
"each",
"attached",
"stream",
"."
] | 8ec613b42a2dd5d7e951a118f61d6094fe97dd9b | https://github.com/crysalead/storage-stream/blob/8ec613b42a2dd5d7e951a118f61d6094fe97dd9b/src/MultiStream.php#L423-L433 |
23,250 | Innmind/neo4j-dbal | src/Translator/HttpTranslator.php | HttpTranslator.computeEndpoint | private function computeEndpoint(): UrlInterface
{
if (!$this->transactions->isOpened()) {
return Url::fromString('/db/data/transaction/commit');
}
return $this->transactions->current()->endpoint();
} | php | private function computeEndpoint(): UrlInterface
{
if (!$this->transactions->isOpened()) {
return Url::fromString('/db/data/transaction/commit');
}
return $this->transactions->current()->endpoint();
} | [
"private",
"function",
"computeEndpoint",
"(",
")",
":",
"UrlInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"transactions",
"->",
"isOpened",
"(",
")",
")",
"{",
"return",
"Url",
"::",
"fromString",
"(",
"'/db/data/transaction/commit'",
")",
";",
"}",
... | Determine the appropriate endpoint based on the transactions | [
"Determine",
"the",
"appropriate",
"endpoint",
"based",
"on",
"the",
"transactions"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Translator/HttpTranslator.php#L77-L84 |
23,251 | Innmind/neo4j-dbal | src/Translator/HttpTranslator.php | HttpTranslator.computeBody | private function computeBody(Query $query): StringStream
{
$statement = [
'statement' => $query->cypher(),
'resultDataContents' => ['graph', 'row'],
];
if ($query->hasParameters()) {
$parameters = [];
foreach ($query->parameters() as $paramet... | php | private function computeBody(Query $query): StringStream
{
$statement = [
'statement' => $query->cypher(),
'resultDataContents' => ['graph', 'row'],
];
if ($query->hasParameters()) {
$parameters = [];
foreach ($query->parameters() as $paramet... | [
"private",
"function",
"computeBody",
"(",
"Query",
"$",
"query",
")",
":",
"StringStream",
"{",
"$",
"statement",
"=",
"[",
"'statement'",
"=>",
"$",
"query",
"->",
"cypher",
"(",
")",
",",
"'resultDataContents'",
"=>",
"[",
"'graph'",
",",
"'row'",
"]",
... | Build the json payload to be sent to the server | [
"Build",
"the",
"json",
"payload",
"to",
"be",
"sent",
"to",
"the",
"server"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Translator/HttpTranslator.php#L89-L109 |
23,252 | zicht/z | src/Zicht/Tool/Container/ContainerBuilder.php | ContainerBuilder.isExpressionPath | public function isExpressionPath($path, $node)
{
if (is_scalar($node)) {
foreach ($this->expressionPaths as $callable) {
if (call_user_func($callable, $path)) {
return true;
}
}
}
return false;
} | php | public function isExpressionPath($path, $node)
{
if (is_scalar($node)) {
foreach ($this->expressionPaths as $callable) {
if (call_user_func($callable, $path)) {
return true;
}
}
}
return false;
} | [
"public",
"function",
"isExpressionPath",
"(",
"$",
"path",
",",
"$",
"node",
")",
"{",
"if",
"(",
"is_scalar",
"(",
"$",
"node",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"expressionPaths",
"as",
"$",
"callable",
")",
"{",
"if",
"(",
"call_u... | Decides if a node should be an expression.
@param array $path
@param mixed $node
@return bool | [
"Decides",
"if",
"a",
"node",
"should",
"be",
"an",
"expression",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/ContainerBuilder.php#L58-L68 |
23,253 | zicht/z | src/Zicht/Tool/Container/ContainerBuilder.php | ContainerBuilder.build | public function build()
{
Debug::enterScope('build');
$traverser = $this->createNodeCreatorTraverser($this->config);
$result = $traverser->traverse();
$node = new ContainerNode();
$gatherer = $this->createNodeGathererTraverser($result, $node);
$gatherer->traverse();
... | php | public function build()
{
Debug::enterScope('build');
$traverser = $this->createNodeCreatorTraverser($this->config);
$result = $traverser->traverse();
$node = new ContainerNode();
$gatherer = $this->createNodeGathererTraverser($result, $node);
$gatherer->traverse();
... | [
"public",
"function",
"build",
"(",
")",
"{",
"Debug",
"::",
"enterScope",
"(",
"'build'",
")",
";",
"$",
"traverser",
"=",
"$",
"this",
"->",
"createNodeCreatorTraverser",
"(",
"$",
"this",
"->",
"config",
")",
";",
"$",
"result",
"=",
"$",
"traverser",... | Build the container node
@return ContainerNode | [
"Build",
"the",
"container",
"node"
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/ContainerBuilder.php#L76-L88 |
23,254 | zicht/z | src/Zicht/Tool/Container/ContainerBuilder.php | ContainerBuilder.createArgNode | public function createArgNode($path, $node)
{
$v = trim($node);
if (substr($v, 0, 1) == '?') {
$conditional = true;
$v = ltrim(substr($v, 1));
} else {
$conditional = false;
}
return new ArgNode(end($path), $this->exprcompiler->parse($v), $... | php | public function createArgNode($path, $node)
{
$v = trim($node);
if (substr($v, 0, 1) == '?') {
$conditional = true;
$v = ltrim(substr($v, 1));
} else {
$conditional = false;
}
return new ArgNode(end($path), $this->exprcompiler->parse($v), $... | [
"public",
"function",
"createArgNode",
"(",
"$",
"path",
",",
"$",
"node",
")",
"{",
"$",
"v",
"=",
"trim",
"(",
"$",
"node",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"v",
",",
"0",
",",
"1",
")",
"==",
"'?'",
")",
"{",
"$",
"conditional",
"=... | Creates a node for the 'args' definition of the task.
@param array $path
@param string $node
@return \Zicht\Tool\Script\Node\Task\ArgNode | [
"Creates",
"a",
"node",
"for",
"the",
"args",
"definition",
"of",
"the",
"task",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/ContainerBuilder.php#L160-L170 |
23,255 | zicht/z | src/Zicht/Tool/Container/ContainerBuilder.php | ContainerBuilder.createOptNode | public function createOptNode($path, $node)
{
return new OptNode(end($path), $this->exprcompiler->parse($node));
} | php | public function createOptNode($path, $node)
{
return new OptNode(end($path), $this->exprcompiler->parse($node));
} | [
"public",
"function",
"createOptNode",
"(",
"$",
"path",
",",
"$",
"node",
")",
"{",
"return",
"new",
"OptNode",
"(",
"end",
"(",
"$",
"path",
")",
",",
"$",
"this",
"->",
"exprcompiler",
"->",
"parse",
"(",
"$",
"node",
")",
")",
";",
"}"
] | Creates a node for the 'opts' definition of the task.
@param array $path
@param string $node
@return \Zicht\Tool\Script\Node\Task\OptNode | [
"Creates",
"a",
"node",
"for",
"the",
"opts",
"definition",
"of",
"the",
"task",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/ContainerBuilder.php#L179-L182 |
23,256 | zicht/z | src/Zicht/Tool/Container/ContainerBuilder.php | ContainerBuilder.createSetNode | public function createSetNode($path, $node)
{
return new SetNode(end($path), $this->exprcompiler->parse($node));
} | php | public function createSetNode($path, $node)
{
return new SetNode(end($path), $this->exprcompiler->parse($node));
} | [
"public",
"function",
"createSetNode",
"(",
"$",
"path",
",",
"$",
"node",
")",
"{",
"return",
"new",
"SetNode",
"(",
"end",
"(",
"$",
"path",
")",
",",
"$",
"this",
"->",
"exprcompiler",
"->",
"parse",
"(",
"$",
"node",
")",
")",
";",
"}"
] | Creates a node for the 'set' definition of the task.
@param array $path
@param string $node
@return SetNode | [
"Creates",
"a",
"node",
"for",
"the",
"set",
"definition",
"of",
"the",
"task",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/ContainerBuilder.php#L192-L195 |
23,257 | zicht/z | src/Zicht/Tool/Container/ContainerBuilder.php | ContainerBuilder.createNodeCreatorTraverser | public function createNodeCreatorTraverser($config)
{
$traverser = new Traverser($config);
$traverser->addVisitor(
array($this, 'createArgNode'),
function ($path) {
return (count($path) == 4 && $path[0] == 'tasks' && $path[2] == 'args');
},
... | php | public function createNodeCreatorTraverser($config)
{
$traverser = new Traverser($config);
$traverser->addVisitor(
array($this, 'createArgNode'),
function ($path) {
return (count($path) == 4 && $path[0] == 'tasks' && $path[2] == 'args');
},
... | [
"public",
"function",
"createNodeCreatorTraverser",
"(",
"$",
"config",
")",
"{",
"$",
"traverser",
"=",
"new",
"Traverser",
"(",
"$",
"config",
")",
";",
"$",
"traverser",
"->",
"addVisitor",
"(",
"array",
"(",
"$",
"this",
",",
"'createArgNode'",
")",
",... | Creates the traverser that creates relevant nodes at all known paths.
@param array $config
@return Traverser | [
"Creates",
"the",
"traverser",
"that",
"creates",
"relevant",
"nodes",
"at",
"all",
"known",
"paths",
"."
] | 6a1731dad20b018555a96b726a61d4bf8ec8c886 | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/ContainerBuilder.php#L230-L299 |
23,258 | qlake/framework | src/Qlake/Routing/Route.php | Route.hasParam | public function hasParam($param)
{
$param = (string)$this->params[$param];
return strlen($param) > 0 ? true : false;
} | php | public function hasParam($param)
{
$param = (string)$this->params[$param];
return strlen($param) > 0 ? true : false;
} | [
"public",
"function",
"hasParam",
"(",
"$",
"param",
")",
"{",
"$",
"param",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"params",
"[",
"$",
"param",
"]",
";",
"return",
"strlen",
"(",
"$",
"param",
")",
">",
"0",
"?",
"true",
":",
"false",
";",
... | Determine that route param exists.
@param string $param
@return bool | [
"Determine",
"that",
"route",
"param",
"exists",
"."
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Routing/Route.php#L160-L165 |
23,259 | qlake/framework | src/Qlake/Routing/Route.php | Route.isMatch | public function isMatch($pathInfo)
{
$this->compile();
$pathInfo = trim($pathInfo, '/');
if (!preg_match($this->pattern, $pathInfo, $paramValues))
{
return false;
}
foreach ($this->paramNames as $name)
{
$this->params[$name] = isset($paramValues[$name]) ? urldecode($paramValues[$name]) : null;
... | php | public function isMatch($pathInfo)
{
$this->compile();
$pathInfo = trim($pathInfo, '/');
if (!preg_match($this->pattern, $pathInfo, $paramValues))
{
return false;
}
foreach ($this->paramNames as $name)
{
$this->params[$name] = isset($paramValues[$name]) ? urldecode($paramValues[$name]) : null;
... | [
"public",
"function",
"isMatch",
"(",
"$",
"pathInfo",
")",
"{",
"$",
"this",
"->",
"compile",
"(",
")",
";",
"$",
"pathInfo",
"=",
"trim",
"(",
"$",
"pathInfo",
",",
"'/'",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"$",
"this",
"->",
"pattern",... | Determine matching route by given uri.
@param string $pathInfo
@return bool | [
"Determine",
"matching",
"route",
"by",
"given",
"uri",
"."
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Routing/Route.php#L261-L278 |
23,260 | qlake/framework | src/Qlake/Routing/Route.php | Route.compile | public function compile()
{
//reset arrays
$this->params = [];
$this->paramNames = [];
$this->conditions = [];
$this->compiled = true;
$uri = $this->normalizeUri($this->getUri());
// match patterns like /{param?:regex}
// tested in https://regex101.com/r/gP6yH7
$regex = preg_replace_callback(
... | php | public function compile()
{
//reset arrays
$this->params = [];
$this->paramNames = [];
$this->conditions = [];
$this->compiled = true;
$uri = $this->normalizeUri($this->getUri());
// match patterns like /{param?:regex}
// tested in https://regex101.com/r/gP6yH7
$regex = preg_replace_callback(
... | [
"public",
"function",
"compile",
"(",
")",
"{",
"//reset arrays",
"$",
"this",
"->",
"params",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"paramNames",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"conditions",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"compile... | Compile route uri pattern regex
@return Qlake\Routing\Route | [
"Compile",
"route",
"uri",
"pattern",
"regex"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Routing/Route.php#L391-L422 |
23,261 | qlake/framework | src/Qlake/Routing/Route.php | Route.createRegex | protected function createRegex($matched)
{
$startSlash = $matched[1] ? true : false;
$param = $matched[2];
$optional = $matched[3] ? true : false;
$pattern = $matched[4] ?: null;
$pattern = $this->conditions[$param] ?: $pattern ?: '[^/]+';
$this->paramNames[] = $param;
if ($startSlash)
{
... | php | protected function createRegex($matched)
{
$startSlash = $matched[1] ? true : false;
$param = $matched[2];
$optional = $matched[3] ? true : false;
$pattern = $matched[4] ?: null;
$pattern = $this->conditions[$param] ?: $pattern ?: '[^/]+';
$this->paramNames[] = $param;
if ($startSlash)
{
... | [
"protected",
"function",
"createRegex",
"(",
"$",
"matched",
")",
"{",
"$",
"startSlash",
"=",
"$",
"matched",
"[",
"1",
"]",
"?",
"true",
":",
"false",
";",
"$",
"param",
"=",
"$",
"matched",
"[",
"2",
"]",
";",
"$",
"optional",
"=",
"$",
"matched... | Callback for creating route param names regex
@param array $matched
@return string | [
"Callback",
"for",
"creating",
"route",
"param",
"names",
"regex"
] | 0b7bad459ae0721bc5cdd141344f9dfc1acee28a | https://github.com/qlake/framework/blob/0b7bad459ae0721bc5cdd141344f9dfc1acee28a/src/Qlake/Routing/Route.php#L432-L453 |
23,262 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/composer.php | ezcMailComposer.generateHtmlPart | private function generateHtmlPart()
{
$result = false;
if ( $this->htmlText != '' )
{
$matches = array();
if ( $this->options->automaticImageInclude === true )
{
// recognize file:// and file:///, pick out the image, add it as a part and th... | php | private function generateHtmlPart()
{
$result = false;
if ( $this->htmlText != '' )
{
$matches = array();
if ( $this->options->automaticImageInclude === true )
{
// recognize file:// and file:///, pick out the image, add it as a part and th... | [
"private",
"function",
"generateHtmlPart",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"htmlText",
"!=",
"''",
")",
"{",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"options",
"->",
... | Returns an ezcMailPart based on the HTML provided.
This method adds local files/images to the mail itself using a
{@link ezcMailMultipartRelated} object.
@throws ezcBaseFileNotFoundException
if $fileName does not exists.
@throws ezcBaseFilePermissionProblem
if $fileName could not be read.
@return ezcMailPart | [
"Returns",
"an",
"ezcMailPart",
"based",
"on",
"the",
"HTML",
"provided",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/composer.php#L463-L545 |
23,263 | WellCommerce/AppBundle | Manager/DictionaryManager.php | DictionaryManager.syncDictionary | public function syncDictionary()
{
$this->kernel = $this->get('kernel');
$this->locales = $this->getLocales();
$this->propertyAccessor = PropertyAccess::createPropertyAccessor();
$this->filesystem = new Filesystem();
foreach ($this->locales a... | php | public function syncDictionary()
{
$this->kernel = $this->get('kernel');
$this->locales = $this->getLocales();
$this->propertyAccessor = PropertyAccess::createPropertyAccessor();
$this->filesystem = new Filesystem();
foreach ($this->locales a... | [
"public",
"function",
"syncDictionary",
"(",
")",
"{",
"$",
"this",
"->",
"kernel",
"=",
"$",
"this",
"->",
"get",
"(",
"'kernel'",
")",
";",
"$",
"this",
"->",
"locales",
"=",
"$",
"this",
"->",
"getLocales",
"(",
")",
";",
"$",
"this",
"->",
"pro... | Synchronizes database and filesystem translations | [
"Synchronizes",
"database",
"and",
"filesystem",
"translations"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Manager/DictionaryManager.php#L58-L70 |
23,264 | hametuha/wpametu | src/WPametu/UI/Field/GeoChecker.php | GeoChecker.get_field | protected function get_field( \WP_Post $post ){
$html = parent::get_field($post);
return $html.sprintf('<p class="inline-error"><i class="dashicons dashicons-location-alt"></i> %s</p>', $this->__('Can\'t find map point. Try another string'));
} | php | protected function get_field( \WP_Post $post ){
$html = parent::get_field($post);
return $html.sprintf('<p class="inline-error"><i class="dashicons dashicons-location-alt"></i> %s</p>', $this->__('Can\'t find map point. Try another string'));
} | [
"protected",
"function",
"get_field",
"(",
"\\",
"WP_Post",
"$",
"post",
")",
"{",
"$",
"html",
"=",
"parent",
"::",
"get_field",
"(",
"$",
"post",
")",
";",
"return",
"$",
"html",
".",
"sprintf",
"(",
"'<p class=\"inline-error\"><i class=\"dashicons dashicons-l... | Add error message.
@param \WP_Post $post
@return string | [
"Add",
"error",
"message",
"."
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/GeoChecker.php#L37-L40 |
23,265 | surebert/surebert-framework | src/sb/JS.php | JS.setHTML | public static function setHTML($id, $html)
{
$js = '$("'.$id.'").html('.json_encode($html).');';
return self::execHeader($js);
} | php | public static function setHTML($id, $html)
{
$js = '$("'.$id.'").html('.json_encode($html).');';
return self::execHeader($js);
} | [
"public",
"static",
"function",
"setHTML",
"(",
"$",
"id",
",",
"$",
"html",
")",
"{",
"$",
"js",
"=",
"'$(\"'",
".",
"$",
"id",
".",
"'\").html('",
".",
"json_encode",
"(",
"$",
"html",
")",
".",
"');'",
";",
"return",
"self",
"::",
"execHeader",
... | Uses jsexec_header to set the innerHTML of an element by id
@param integer $id the HTML element id
@param string $html The innerHTML to set
@return string | [
"Uses",
"jsexec_header",
"to",
"set",
"the",
"innerHTML",
"of",
"an",
"element",
"by",
"id"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JS.php#L23-L27 |
23,266 | surebert/surebert-framework | src/sb/JS.php | JS.execScript | public static function execScript($script_path, $context=null)
{
header('Content-type: text/javascript');
if(!is_null($context)){
if(is_object($context)){
$context = get_object_vars($context);
}
if(is_array($context)){
extract($cont... | php | public static function execScript($script_path, $context=null)
{
header('Content-type: text/javascript');
if(!is_null($context)){
if(is_object($context)){
$context = get_object_vars($context);
}
if(is_array($context)){
extract($cont... | [
"public",
"static",
"function",
"execScript",
"(",
"$",
"script_path",
",",
"$",
"context",
"=",
"null",
")",
"{",
"header",
"(",
"'Content-type: text/javascript'",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"context",
")",
")",
"{",
"if",
"(",
"is_o... | Executes a script at a certain path
@param string $script_path full path | [
"Executes",
"a",
"script",
"at",
"a",
"certain",
"path"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/JS.php#L33-L46 |
23,267 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.processMetadataDrivers | private function processMetadataDrivers()
{
$builder = $this->getContainerBuilder();
// At the moment, only Docblock annotations are supported, XML and YAML are not.
$annotationReader = $builder->addDefinition($this->prefix('metadata.annotationReader'))
->setClass(AnnotationReader::class);
$cachedReader... | php | private function processMetadataDrivers()
{
$builder = $this->getContainerBuilder();
// At the moment, only Docblock annotations are supported, XML and YAML are not.
$annotationReader = $builder->addDefinition($this->prefix('metadata.annotationReader'))
->setClass(AnnotationReader::class);
$cachedReader... | [
"private",
"function",
"processMetadataDrivers",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"// At the moment, only Docblock annotations are supported, XML and YAML are not.\t\t",
"$",
"annotationReader",
"=",
"$",
"builder"... | Registers metadata drivers. | [
"Registers",
"metadata",
"drivers",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L106-L136 |
23,268 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.createServiceName | private function createServiceName(string $namespace)
{
$parts = explode('\\', $namespace);
foreach ($parts as $k => $part) {
$parts[$k] = lcfirst($part);
}
return trim(implode('.', $parts), '.');
} | php | private function createServiceName(string $namespace)
{
$parts = explode('\\', $namespace);
foreach ($parts as $k => $part) {
$parts[$k] = lcfirst($part);
}
return trim(implode('.', $parts), '.');
} | [
"private",
"function",
"createServiceName",
"(",
"string",
"$",
"namespace",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"namespace",
")",
";",
"foreach",
"(",
"$",
"parts",
"as",
"$",
"k",
"=>",
"$",
"part",
")",
"{",
"$",
"part... | Converts PHP namespace to service name. | [
"Converts",
"PHP",
"namespace",
"to",
"service",
"name",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L142-L149 |
23,269 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.processConnection | private function processConnection()
{
$builder = $this->getContainerBuilder();
$connection = $builder->addDefinition($this->prefix('connection'))
->setClass(Connection::class)
->setFactory(DriverManager::class . '::getConnection', [$this->config['connection']]);
} | php | private function processConnection()
{
$builder = $this->getContainerBuilder();
$connection = $builder->addDefinition($this->prefix('connection'))
->setClass(Connection::class)
->setFactory(DriverManager::class . '::getConnection', [$this->config['connection']]);
} | [
"private",
"function",
"processConnection",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"$",
"connection",
"=",
"$",
"builder",
"->",
"addDefinition",
"(",
"$",
"this",
"->",
"prefix",
"(",
"'connection'",
"... | Registers DBAL connection. | [
"Registers",
"DBAL",
"connection",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L155-L162 |
23,270 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.processEvents | private function processEvents()
{
$builder = $this->getContainerBuilder();
$eventManager = $builder->addDefinition($this->prefix('eventManager'))
->setClass(EventManager::class);
$entityListenerResolver = $builder->addDefinition($this->prefix('entityListenerResolver'))
->setClass(ContainerEntityListener... | php | private function processEvents()
{
$builder = $this->getContainerBuilder();
$eventManager = $builder->addDefinition($this->prefix('eventManager'))
->setClass(EventManager::class);
$entityListenerResolver = $builder->addDefinition($this->prefix('entityListenerResolver'))
->setClass(ContainerEntityListener... | [
"private",
"function",
"processEvents",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"$",
"eventManager",
"=",
"$",
"builder",
"->",
"addDefinition",
"(",
"$",
"this",
"->",
"prefix",
"(",
"'eventManager'",
"... | Registers Event Manager. | [
"Registers",
"Event",
"Manager",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L168-L191 |
23,271 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.processEntityManager | private function processEntityManager()
{
$builder = $this->getContainerBuilder();
$configuration = $builder->addDefinition($this->prefix('configuration'))
->setClass(Configuration::class)
->addSetup('$service->setMetadataDriverImpl($this->getService(?))', [$this->prefix('metadata.driver')])
->addSetup('... | php | private function processEntityManager()
{
$builder = $this->getContainerBuilder();
$configuration = $builder->addDefinition($this->prefix('configuration'))
->setClass(Configuration::class)
->addSetup('$service->setMetadataDriverImpl($this->getService(?))', [$this->prefix('metadata.driver')])
->addSetup('... | [
"private",
"function",
"processEntityManager",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"$",
"configuration",
"=",
"$",
"builder",
"->",
"addDefinition",
"(",
"$",
"this",
"->",
"prefix",
"(",
"'configurati... | Registers Entity Manager. | [
"Registers",
"Entity",
"Manager",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L197-L222 |
23,272 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.processCachingServices | private function processCachingServices()
{
$this->createCache('annotations');
$this->createCache('metadata');
$this->createCache('query');
$this->createCache('result');
$this->createCache('hydration');
} | php | private function processCachingServices()
{
$this->createCache('annotations');
$this->createCache('metadata');
$this->createCache('query');
$this->createCache('result');
$this->createCache('hydration');
} | [
"private",
"function",
"processCachingServices",
"(",
")",
"{",
"$",
"this",
"->",
"createCache",
"(",
"'annotations'",
")",
";",
"$",
"this",
"->",
"createCache",
"(",
"'metadata'",
")",
";",
"$",
"this",
"->",
"createCache",
"(",
"'query'",
")",
";",
"$"... | Registers caching services. | [
"Registers",
"caching",
"services",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L228-L235 |
23,273 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.createCache | private function createCache(string $name)
{
$builder = $this->getContainerBuilder();
$cache = $builder->addDefinition($this->prefix('cache.' . $name))
->setClass(Cache::class)
->setArguments(['@Nette\Caching\IStorage', $this->debugMode])
->addSetup('$service->setNamespace(?)', [$this->prefix('cache.' . ... | php | private function createCache(string $name)
{
$builder = $this->getContainerBuilder();
$cache = $builder->addDefinition($this->prefix('cache.' . $name))
->setClass(Cache::class)
->setArguments(['@Nette\Caching\IStorage', $this->debugMode])
->addSetup('$service->setNamespace(?)', [$this->prefix('cache.' . ... | [
"private",
"function",
"createCache",
"(",
"string",
"$",
"name",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"$",
"cache",
"=",
"$",
"builder",
"->",
"addDefinition",
"(",
"$",
"this",
"->",
"prefix",
"(",
"... | Creates a caching service. | [
"Creates",
"a",
"caching",
"service",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L241-L251 |
23,274 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.processConsole | private function processConsole()
{
$builder = $this->getContainerBuilder();
$console = $builder->addDefinition($this->prefix('console'))
->setClass(Application::class)
->setArguments(['Doctrine Command Line Interface', \Doctrine\ORM\Version::VERSION])
->addSetup('?->setCatchExceptions(TRUE)', ['@self'])... | php | private function processConsole()
{
$builder = $this->getContainerBuilder();
$console = $builder->addDefinition($this->prefix('console'))
->setClass(Application::class)
->setArguments(['Doctrine Command Line Interface', \Doctrine\ORM\Version::VERSION])
->addSetup('?->setCatchExceptions(TRUE)', ['@self'])... | [
"private",
"function",
"processConsole",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"$",
"console",
"=",
"$",
"builder",
"->",
"addDefinition",
"(",
"$",
"this",
"->",
"prefix",
"(",
"'console'",
")",
")"... | Registers Doctrine Console. | [
"Registers",
"Doctrine",
"Console",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L257-L279 |
23,275 | andromeda-framework/doctrine | src/Doctrine/DI/DoctrineExtension.php | DoctrineExtension.processTracy | private function processTracy()
{
$builder = $this->getContainerBuilder();
$tracyPanel = $builder->addDefinition($this->prefix('tracyPanel'))
->setClass(Panel::class);
$builder->getDefinition($this->prefix('entityManager'))
->addSetup('?->setEntityManager(?)', ['@' . $this->prefix('tracyPanel'), '@self']... | php | private function processTracy()
{
$builder = $this->getContainerBuilder();
$tracyPanel = $builder->addDefinition($this->prefix('tracyPanel'))
->setClass(Panel::class);
$builder->getDefinition($this->prefix('entityManager'))
->addSetup('?->setEntityManager(?)', ['@' . $this->prefix('tracyPanel'), '@self']... | [
"private",
"function",
"processTracy",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"getContainerBuilder",
"(",
")",
";",
"$",
"tracyPanel",
"=",
"$",
"builder",
"->",
"addDefinition",
"(",
"$",
"this",
"->",
"prefix",
"(",
"'tracyPanel'",
")",
... | Registers debug panel. | [
"Registers",
"debug",
"panel",
"."
] | 46924d91c09e0b9fbe5764518cbad70e467ffad4 | https://github.com/andromeda-framework/doctrine/blob/46924d91c09e0b9fbe5764518cbad70e467ffad4/src/Doctrine/DI/DoctrineExtension.php#L285-L294 |
23,276 | antaresproject/notifications | src/Processor/LogsProcessor.php | LogsProcessor.preview | public function preview($id)
{
$item = app(StackRepository::class)->fetchOne((int) $id)->firstOrFail();
if (in_array($item->notification->type->name, ['email', 'sms'])) {
$classname = $item->notification->type->name === 'email' ? EmailNotification::class : SmsNotification::class;
... | php | public function preview($id)
{
$item = app(StackRepository::class)->fetchOne((int) $id)->firstOrFail();
if (in_array($item->notification->type->name, ['email', 'sms'])) {
$classname = $item->notification->type->name === 'email' ? EmailNotification::class : SmsNotification::class;
... | [
"public",
"function",
"preview",
"(",
"$",
"id",
")",
"{",
"$",
"item",
"=",
"app",
"(",
"StackRepository",
"::",
"class",
")",
"->",
"fetchOne",
"(",
"(",
"int",
")",
"$",
"id",
")",
"->",
"firstOrFail",
"(",
")",
";",
"if",
"(",
"in_array",
"(",
... | Preview notification log
@param mixed $id
@return View | [
"Preview",
"notification",
"log"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/LogsProcessor.php#L92-L106 |
23,277 | antaresproject/notifications | src/Processor/LogsProcessor.php | LogsProcessor.delete | public function delete(LogsListener $listener, $id = null): RedirectResponse
{
$stack = !empty($ids = input('attr')) ? $this->stack->newQuery()->whereIn('id', $ids) : $this->stack->newQuery()->findOrFail($id);
if ($stack->delete()) {
return $listener->deleteSuccess();
}
... | php | public function delete(LogsListener $listener, $id = null): RedirectResponse
{
$stack = !empty($ids = input('attr')) ? $this->stack->newQuery()->whereIn('id', $ids) : $this->stack->newQuery()->findOrFail($id);
if ($stack->delete()) {
return $listener->deleteSuccess();
}
... | [
"public",
"function",
"delete",
"(",
"LogsListener",
"$",
"listener",
",",
"$",
"id",
"=",
"null",
")",
":",
"RedirectResponse",
"{",
"$",
"stack",
"=",
"!",
"empty",
"(",
"$",
"ids",
"=",
"input",
"(",
"'attr'",
")",
")",
"?",
"$",
"this",
"->",
"... | Deletes notification log
@param LogsListener $listener
@param mixed $id
@return RedirectResponse | [
"Deletes",
"notification",
"log"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Processor/LogsProcessor.php#L115-L122 |
23,278 | surebert/surebert-framework | src/sb/PDO/Mysql/Backup.php | Backup.checkDumpDir | protected function checkDumpDir()
{
if (!is_dir($this->dump_dir)) {
mkdir($this->dump_dir, 0700, true);
}
foreach (\range($this->max_version, 1) as $version) {
$dir = $this->dump_dir . $version;
if (is_dir($dir)) {
if ($version == $this... | php | protected function checkDumpDir()
{
if (!is_dir($this->dump_dir)) {
mkdir($this->dump_dir, 0700, true);
}
foreach (\range($this->max_version, 1) as $version) {
$dir = $this->dump_dir . $version;
if (is_dir($dir)) {
if ($version == $this... | [
"protected",
"function",
"checkDumpDir",
"(",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"this",
"->",
"dump_dir",
")",
")",
"{",
"mkdir",
"(",
"$",
"this",
"->",
"dump_dir",
",",
"0700",
",",
"true",
")",
";",
"}",
"foreach",
"(",
"\\",
"range"... | check to make sure dump directory exists and if not create it | [
"check",
"to",
"make",
"sure",
"dump",
"directory",
"exists",
"and",
"if",
"not",
"create",
"it"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Mysql/Backup.php#L129-L155 |
23,279 | surebert/surebert-framework | src/sb/PDO/Mysql/Backup.php | Backup.dumpDatabases | protected function dumpDatabases()
{
foreach ($this->db->query("SHOW DATABASES") as $list) {
$database = $list->Database;
if (!in_array($database, $this->ignore) || preg_match("~_no_backup$~", $database)) {
$start = microtime(true);
$dir = $this->du... | php | protected function dumpDatabases()
{
foreach ($this->db->query("SHOW DATABASES") as $list) {
$database = $list->Database;
if (!in_array($database, $this->ignore) || preg_match("~_no_backup$~", $database)) {
$start = microtime(true);
$dir = $this->du... | [
"protected",
"function",
"dumpDatabases",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"\"SHOW DATABASES\"",
")",
"as",
"$",
"list",
")",
"{",
"$",
"database",
"=",
"$",
"list",
"->",
"Database",
";",
"if",
"(",
"!",
"i... | Dump the database files and gzip, add version number | [
"Dump",
"the",
"database",
"files",
"and",
"gzip",
"add",
"version",
"number"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Mysql/Backup.php#L160-L191 |
23,280 | surebert/surebert-framework | src/sb/PDO/Mysql/Backup.php | Backup.log | protected function log($message)
{
if ($this->debug == true) {
file_put_contents("php://stdout", $message . "\n");
}
file_put_contents($this->dump_dir . 'dump.log', $message . "\n", \FILE_APPEND);
} | php | protected function log($message)
{
if ($this->debug == true) {
file_put_contents("php://stdout", $message . "\n");
}
file_put_contents($this->dump_dir . 'dump.log', $message . "\n", \FILE_APPEND);
} | [
"protected",
"function",
"log",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
"==",
"true",
")",
"{",
"file_put_contents",
"(",
"\"php://stdout\"",
",",
"$",
"message",
".",
"\"\\n\"",
")",
";",
"}",
"file_put_contents",
"(",
"$",... | Send messages to stdout
@param string $message | [
"Send",
"messages",
"to",
"stdout"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Mysql/Backup.php#L197-L205 |
23,281 | surebert/surebert-framework | src/sb/PDO/Mysql/Backup.php | Backup.recursiveDelete | protected function recursiveDelete($dir, $del = 0)
{
if (substr($dir, 0, 1) == '/') {
throw new \Exception("You cannot delete root directories");
}
$iterator = new \RecursiveDirectoryIterator($dir);
foreach (new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIt... | php | protected function recursiveDelete($dir, $del = 0)
{
if (substr($dir, 0, 1) == '/') {
throw new \Exception("You cannot delete root directories");
}
$iterator = new \RecursiveDirectoryIterator($dir);
foreach (new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIt... | [
"protected",
"function",
"recursiveDelete",
"(",
"$",
"dir",
",",
"$",
"del",
"=",
"0",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"dir",
",",
"0",
",",
"1",
")",
"==",
"'/'",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"You cannot delete root ... | Recursively deletes the files in a diretory
@param string $dir The directory path
@param boolean $del Should directory itself be deleted upon completion
@return boolean | [
"Recursively",
"deletes",
"the",
"files",
"in",
"a",
"diretory"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Mysql/Backup.php#L214-L234 |
23,282 | Isset/pushnotification | src/PushNotification/NotificationCenter.php | NotificationCenter.addNotifier | public function addNotifier(Notifier $notifier, bool $setLogger = true)
{
if ($notifier instanceof self) {
throw new LogicException('Cannot add self');
}
if ($setLogger) {
$notifier->setLogger($this->getLogger());
}
$this->notifiers[] = $notifier;
... | php | public function addNotifier(Notifier $notifier, bool $setLogger = true)
{
if ($notifier instanceof self) {
throw new LogicException('Cannot add self');
}
if ($setLogger) {
$notifier->setLogger($this->getLogger());
}
$this->notifiers[] = $notifier;
... | [
"public",
"function",
"addNotifier",
"(",
"Notifier",
"$",
"notifier",
",",
"bool",
"$",
"setLogger",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"notifier",
"instanceof",
"self",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Cannot add self'",
")",
";",
"... | Add a notifier to the Notification center.
@param Notifier $notifier
@param bool $setLogger if false the default logger will not be set to the notifier
@throws LogicException | [
"Add",
"a",
"notifier",
"to",
"the",
"Notification",
"center",
"."
] | 5e7634dc6b1cf4f7c371d1890243a25252db0d85 | https://github.com/Isset/pushnotification/blob/5e7634dc6b1cf4f7c371d1890243a25252db0d85/src/PushNotification/NotificationCenter.php#L89-L99 |
23,283 | eghojansu/moe | src/Base.php | Base.devoid | function devoid($key) {
$val=$this->ref($key,FALSE);
return empty($val) &&
(!Cache::instance()->exists($this->hash($key).'.var',$val) ||
!$val);
} | php | function devoid($key) {
$val=$this->ref($key,FALSE);
return empty($val) &&
(!Cache::instance()->exists($this->hash($key).'.var',$val) ||
!$val);
} | [
"function",
"devoid",
"(",
"$",
"key",
")",
"{",
"$",
"val",
"=",
"$",
"this",
"->",
"ref",
"(",
"$",
"key",
",",
"FALSE",
")",
";",
"return",
"empty",
"(",
"$",
"val",
")",
"&&",
"(",
"!",
"Cache",
"::",
"instance",
"(",
")",
"->",
"exists",
... | Return TRUE if hive key is empty and not cached
@return bool
@param $key string | [
"Return",
"TRUE",
"if",
"hive",
"key",
"is",
"empty",
"and",
"not",
"cached"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Base.php#L284-L289 |
23,284 | eghojansu/moe | src/Base.php | Base.get | function get($key,$args=NULL) {
if (is_string($val=$this->ref($key,FALSE)) && !is_null($args))
return call_user_func_array(
array($this,'format'),
array_merge(array($val),is_array($args)?$args:array($args))
);
if (is_null($val)) {
// Attempt to retrieve from cache
if (Cache::instance()->exists($... | php | function get($key,$args=NULL) {
if (is_string($val=$this->ref($key,FALSE)) && !is_null($args))
return call_user_func_array(
array($this,'format'),
array_merge(array($val),is_array($args)?$args:array($args))
);
if (is_null($val)) {
// Attempt to retrieve from cache
if (Cache::instance()->exists($... | [
"function",
"get",
"(",
"$",
"key",
",",
"$",
"args",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"val",
"=",
"$",
"this",
"->",
"ref",
"(",
"$",
"key",
",",
"FALSE",
")",
")",
"&&",
"!",
"is_null",
"(",
"$",
"args",
")",
")",
... | Retrieve contents of hive key
@return mixed
@param $key string
@param $args string|array | [
"Retrieve",
"contents",
"of",
"hive",
"key"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Base.php#L358-L370 |
23,285 | eghojansu/moe | src/Base.php | Base.pre | function pre($data, $exit = false)
{
echo '<pre>';
print_r($data);
echo '</pre>';
!$exit || exit(str_repeat('<br>', 2).' '.$exit);
echo '<hr>';
} | php | function pre($data, $exit = false)
{
echo '<pre>';
print_r($data);
echo '</pre>';
!$exit || exit(str_repeat('<br>', 2).' '.$exit);
echo '<hr>';
} | [
"function",
"pre",
"(",
"$",
"data",
",",
"$",
"exit",
"=",
"false",
")",
"{",
"echo",
"'<pre>'",
";",
"print_r",
"(",
"$",
"data",
")",
";",
"echo",
"'</pre>'",
";",
"!",
"$",
"exit",
"||",
"exit",
"(",
"str_repeat",
"(",
"'<br>'",
",",
"2",
")"... | Output the data
@param mixed $data
@param bool $exit wether to exit after dumping or not | [
"Output",
"the",
"data"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Base.php#L654-L661 |
23,286 | eghojansu/moe | src/Base.php | Base.constants | function constants($class,$prefix='') {
$ref=new ReflectionClass($class);
$out=array();
foreach (preg_grep('/^'.$prefix.'/',array_keys($ref->getconstants()))
as $val) {
$out[$key=substr($val,strlen($prefix))]=
constant((is_object($class)?get_class($class):$class).'::'.$prefix.$key);
}
unset($ref);
... | php | function constants($class,$prefix='') {
$ref=new ReflectionClass($class);
$out=array();
foreach (preg_grep('/^'.$prefix.'/',array_keys($ref->getconstants()))
as $val) {
$out[$key=substr($val,strlen($prefix))]=
constant((is_object($class)?get_class($class):$class).'::'.$prefix.$key);
}
unset($ref);
... | [
"function",
"constants",
"(",
"$",
"class",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"ref",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"out",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"preg_grep",
"(",
"'/^'",
".",
"... | Convert class constants to array
@return array
@param $class object|string
@param $prefix string | [
"Convert",
"class",
"constants",
"to",
"array"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Base.php#L827-L837 |
23,287 | eghojansu/moe | src/Base.php | Base.recursive | function recursive($arg,$func,$stack=NULL) {
if ($stack) {
foreach ($stack as $node)
if ($arg===$node)
return $arg;
}
else
$stack=array();
switch (gettype($arg)) {
case 'object':
if (method_exists('ReflectionClass','iscloneable')) {
$ref=new ReflectionClass($arg);
if ($ref->isclo... | php | function recursive($arg,$func,$stack=NULL) {
if ($stack) {
foreach ($stack as $node)
if ($arg===$node)
return $arg;
}
else
$stack=array();
switch (gettype($arg)) {
case 'object':
if (method_exists('ReflectionClass','iscloneable')) {
$ref=new ReflectionClass($arg);
if ($ref->isclo... | [
"function",
"recursive",
"(",
"$",
"arg",
",",
"$",
"func",
",",
"$",
"stack",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"stack",
")",
"{",
"foreach",
"(",
"$",
"stack",
"as",
"$",
"node",
")",
"if",
"(",
"$",
"arg",
"===",
"$",
"node",
")",
"re... | Invoke callback recursively for all data types
@return mixed
@param $arg mixed
@param $func callback
@param $stack array | [
"Invoke",
"callback",
"recursively",
"for",
"all",
"data",
"types"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Base.php#L885-L915 |
23,288 | eghojansu/moe | src/Base.php | Base.map | function map($url,$class,$ttl=0,$kbps=0) {
if (is_array($url)) {
foreach ($url as $item)
$this->map($item,$class,$ttl,$kbps);
return;
}
foreach (explode('|',self::VERBS) as $method)
$this->route($method.' '.$url,is_string($class)?
$class.'->'.$this->hive['PREMAP'].strtolower($method):
array($... | php | function map($url,$class,$ttl=0,$kbps=0) {
if (is_array($url)) {
foreach ($url as $item)
$this->map($item,$class,$ttl,$kbps);
return;
}
foreach (explode('|',self::VERBS) as $method)
$this->route($method.' '.$url,is_string($class)?
$class.'->'.$this->hive['PREMAP'].strtolower($method):
array($... | [
"function",
"map",
"(",
"$",
"url",
",",
"$",
"class",
",",
"$",
"ttl",
"=",
"0",
",",
"$",
"kbps",
"=",
"0",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"url",
")",
")",
"{",
"foreach",
"(",
"$",
"url",
"as",
"$",
"item",
")",
"$",
"this",
... | Provide ReST interface by mapping HTTP verb to class method
@return NULL
@param $url string
@param $class string|object
@param $ttl int
@param $kbps int | [
"Provide",
"ReST",
"interface",
"by",
"mapping",
"HTTP",
"verb",
"to",
"class",
"method"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Base.php#L1452-L1463 |
23,289 | eghojansu/moe | src/Base.php | Base.highlight | function highlight($text) {
$out='';
$pre=FALSE;
$text=trim($text);
if (!preg_match('/^<\?php/',$text)) {
$text='<?php '.$text;
$pre=TRUE;
}
foreach (token_get_all($text) as $token)
if ($pre)
$pre=FALSE;
else
$out.='<span'.
(is_array($token)?
(' class="'.
substr(strtolo... | php | function highlight($text) {
$out='';
$pre=FALSE;
$text=trim($text);
if (!preg_match('/^<\?php/',$text)) {
$text='<?php '.$text;
$pre=TRUE;
}
foreach (token_get_all($text) as $token)
if ($pre)
$pre=FALSE;
else
$out.='<span'.
(is_array($token)?
(' class="'.
substr(strtolo... | [
"function",
"highlight",
"(",
"$",
"text",
")",
"{",
"$",
"out",
"=",
"''",
";",
"$",
"pre",
"=",
"FALSE",
";",
"$",
"text",
"=",
"trim",
"(",
"$",
"text",
")",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/^<\\?php/'",
",",
"$",
"text",
")",
")",... | Apply syntax highlighting
@return string
@param $text string | [
"Apply",
"syntax",
"highlighting"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Base.php#L2062-L2082 |
23,290 | chrismou/phergie-irc-plugin-react-google | src/Provider/GoogleSearch.php | GoogleSearch.getApiRequestUrl | public function getApiRequestUrl(Event $event)
{
$params = $event->getCustomParams();
$query = trim(implode(" ", $params));
$querystringParams = [
'v' => '1.0',
'q' => $query
];
return sprintf("%s?%s", $this->apiUrl, http_build_query($querystringPara... | php | public function getApiRequestUrl(Event $event)
{
$params = $event->getCustomParams();
$query = trim(implode(" ", $params));
$querystringParams = [
'v' => '1.0',
'q' => $query
];
return sprintf("%s?%s", $this->apiUrl, http_build_query($querystringPara... | [
"public",
"function",
"getApiRequestUrl",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"params",
"=",
"$",
"event",
"->",
"getCustomParams",
"(",
")",
";",
"$",
"query",
"=",
"trim",
"(",
"implode",
"(",
"\" \"",
",",
"$",
"params",
")",
")",
";",
"$",... | Get the url for the API request
@param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
@return string | [
"Get",
"the",
"url",
"for",
"the",
"API",
"request"
] | 4492bf1e25826a9cf7187afee0ec35deddefaf6f | https://github.com/chrismou/phergie-irc-plugin-react-google/blob/4492bf1e25826a9cf7187afee0ec35deddefaf6f/src/Provider/GoogleSearch.php#L45-L56 |
23,291 | mikebarlow/html-helper | src/Integrations/PlatesPHP.php | PlatesPHP.getHtmlHelper | public function getHtmlHelper()
{
$this->HtmlHelper->Form->getDataService()->template = $this->template;
$this->HtmlHelper->getRouterService()->template = $this->template;
$this->HtmlHelper->getAssetsService()->template = $this->template;
return $this->HtmlHelper;
} | php | public function getHtmlHelper()
{
$this->HtmlHelper->Form->getDataService()->template = $this->template;
$this->HtmlHelper->getRouterService()->template = $this->template;
$this->HtmlHelper->getAssetsService()->template = $this->template;
return $this->HtmlHelper;
} | [
"public",
"function",
"getHtmlHelper",
"(",
")",
"{",
"$",
"this",
"->",
"HtmlHelper",
"->",
"Form",
"->",
"getDataService",
"(",
")",
"->",
"template",
"=",
"$",
"this",
"->",
"template",
";",
"$",
"this",
"->",
"HtmlHelper",
"->",
"getRouterService",
"("... | return the instance of the html helper
@return object $htmlHelper Instance of the html helper | [
"return",
"the",
"instance",
"of",
"the",
"html",
"helper"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Integrations/PlatesPHP.php#L36-L42 |
23,292 | alevilar/ristorantino-vendor | Risto/Controller/PagesController.php | PagesController.display | public function display() {
$path = func_get_args();
$count = count($path);
if (!$count) {
return $this->redirect('/');
}
$page = $subpage = $title_for_layout = null;
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - ... | php | public function display() {
$path = func_get_args();
$count = count($path);
if (!$count) {
return $this->redirect('/');
}
$page = $subpage = $title_for_layout = null;
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - ... | [
"public",
"function",
"display",
"(",
")",
"{",
"$",
"path",
"=",
"func_get_args",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"$",
"count",
")",
"{",
"return",
"$",
"this",
"->",
"redirect",
"(",
"'/'",... | Displays a view
@param mixed What page to display
@return void
@throws NotFoundException When the view file could not be found
or MissingViewException in debug mode. | [
"Displays",
"a",
"view"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Controller/PagesController.php#L49-L76 |
23,293 | eXistenZNL/PermCheck | src/PermCheck.php | PermCheck.run | public function run()
{
$this->loader->parse();
$files = $this->filesystem->getFiles();
// Now we check all the files against the config
while ($files->valid()) {
/* @var SplFileInfo $file */
$file = $files->current();
// Skip symlinks as they ar... | php | public function run()
{
$this->loader->parse();
$files = $this->filesystem->getFiles();
// Now we check all the files against the config
while ($files->valid()) {
/* @var SplFileInfo $file */
$file = $files->current();
// Skip symlinks as they ar... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"loader",
"->",
"parse",
"(",
")",
";",
"$",
"files",
"=",
"$",
"this",
"->",
"filesystem",
"->",
"getFiles",
"(",
")",
";",
"// Now we check all the files against the config",
"while",
"(",
"$... | Run the permission check and return any errors
@return void | [
"Run",
"the",
"permission",
"check",
"and",
"return",
"any",
"errors"
] | f22f2936350f6b440222fb6ea37dfc382fc4550e | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/PermCheck.php#L95-L134 |
23,294 | eXistenZNL/PermCheck | src/PermCheck.php | PermCheck.isExcluded | protected function isExcluded($filename)
{
foreach ($this->config->getExcludedFiles() as $excludedFile) {
if ($filename === $excludedFile) {
return true;
}
}
foreach ($this->config->getExcludedDirs() as $excludedDir) {
if (strpos($filename,... | php | protected function isExcluded($filename)
{
foreach ($this->config->getExcludedFiles() as $excludedFile) {
if ($filename === $excludedFile) {
return true;
}
}
foreach ($this->config->getExcludedDirs() as $excludedDir) {
if (strpos($filename,... | [
"protected",
"function",
"isExcluded",
"(",
"$",
"filename",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"getExcludedFiles",
"(",
")",
"as",
"$",
"excludedFile",
")",
"{",
"if",
"(",
"$",
"filename",
"===",
"$",
"excludedFile",
")",
"{",... | Check whether the given file should be excluded.
@param string $filename The filename to check.
@return boolean | [
"Check",
"whether",
"the",
"given",
"file",
"should",
"be",
"excluded",
"."
] | f22f2936350f6b440222fb6ea37dfc382fc4550e | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/PermCheck.php#L143-L156 |
23,295 | eXistenZNL/PermCheck | src/PermCheck.php | PermCheck.shouldBeExecutable | protected function shouldBeExecutable($filename)
{
foreach ($this->config->getExecutableFiles() as $exFile) {
if ($filename === $exFile) {
return true;
}
}
return false;
} | php | protected function shouldBeExecutable($filename)
{
foreach ($this->config->getExecutableFiles() as $exFile) {
if ($filename === $exFile) {
return true;
}
}
return false;
} | [
"protected",
"function",
"shouldBeExecutable",
"(",
"$",
"filename",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"getExecutableFiles",
"(",
")",
"as",
"$",
"exFile",
")",
"{",
"if",
"(",
"$",
"filename",
"===",
"$",
"exFile",
")",
"{",
... | Check whether the given file should be executable.
@param string $filename The filename to check.
@return boolean | [
"Check",
"whether",
"the",
"given",
"file",
"should",
"be",
"executable",
"."
] | f22f2936350f6b440222fb6ea37dfc382fc4550e | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/PermCheck.php#L165-L173 |
23,296 | eXistenZNL/PermCheck | src/PermCheck.php | PermCheck.getRelativeFilename | protected function getRelativeFilename(SplFileInfo $file)
{
$filename = $file->getPathname();
$regex = sprintf('#^(%s)/(.+)#', $this->directory);
$matches = array();
preg_match(
$regex,
$filename,
$matches
);
return $matches[2];
... | php | protected function getRelativeFilename(SplFileInfo $file)
{
$filename = $file->getPathname();
$regex = sprintf('#^(%s)/(.+)#', $this->directory);
$matches = array();
preg_match(
$regex,
$filename,
$matches
);
return $matches[2];
... | [
"protected",
"function",
"getRelativeFilename",
"(",
"SplFileInfo",
"$",
"file",
")",
"{",
"$",
"filename",
"=",
"$",
"file",
"->",
"getPathname",
"(",
")",
";",
"$",
"regex",
"=",
"sprintf",
"(",
"'#^(%s)/(.+)#'",
",",
"$",
"this",
"->",
"directory",
")",... | Get the relative name of the given file.
@param SplFileInfo $file The file to get the relative name for.
@return string | [
"Get",
"the",
"relative",
"name",
"of",
"the",
"given",
"file",
"."
] | f22f2936350f6b440222fb6ea37dfc382fc4550e | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/PermCheck.php#L182-L195 |
23,297 | PHPPowertools/HTML5 | src/PowerTools/HTML5/Serializer/Traverser.php | HTML5_Serializer_Traverser.walk | public function walk() {
if ($this->dom instanceof \DOMDocument) {
$this->rules->document($this->dom);
} elseif ($this->dom instanceof \DOMDocumentFragment) {
// Document fragments are a special case. Only the children need to
// be serialized.
if ($this->... | php | public function walk() {
if ($this->dom instanceof \DOMDocument) {
$this->rules->document($this->dom);
} elseif ($this->dom instanceof \DOMDocumentFragment) {
// Document fragments are a special case. Only the children need to
// be serialized.
if ($this->... | [
"public",
"function",
"walk",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dom",
"instanceof",
"\\",
"DOMDocument",
")",
"{",
"$",
"this",
"->",
"rules",
"->",
"document",
"(",
"$",
"this",
"->",
"dom",
")",
";",
"}",
"elseif",
"(",
"$",
"this",
... | Tell the traverser to walk the DOM.
@return resource $out
Returns the output stream. | [
"Tell",
"the",
"traverser",
"to",
"walk",
"the",
"DOM",
"."
] | 4ea8caf5b2618a82ca5061dcbb7421b31065c1c7 | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Serializer/Traverser.php#L142-L161 |
23,298 | PHPPowertools/HTML5 | src/PowerTools/HTML5/Serializer/Traverser.php | HTML5_Serializer_Traverser.node | public function node(\DOMNode $node) {
// A listing of types is at http://php.net/manual/en/dom.constants.php
switch ($node->nodeType) {
case XML_ELEMENT_NODE:
$this->rules->element($node);
break;
case XML_TEXT_NODE:
$this->rules->t... | php | public function node(\DOMNode $node) {
// A listing of types is at http://php.net/manual/en/dom.constants.php
switch ($node->nodeType) {
case XML_ELEMENT_NODE:
$this->rules->element($node);
break;
case XML_TEXT_NODE:
$this->rules->t... | [
"public",
"function",
"node",
"(",
"\\",
"DOMNode",
"$",
"node",
")",
"{",
"// A listing of types is at http://php.net/manual/en/dom.constants.php",
"switch",
"(",
"$",
"node",
"->",
"nodeType",
")",
"{",
"case",
"XML_ELEMENT_NODE",
":",
"$",
"this",
"->",
"rules",
... | Process a node in the DOM.
@param mixed $node
A node implementing \DOMNode. | [
"Process",
"a",
"node",
"in",
"the",
"DOM",
"."
] | 4ea8caf5b2618a82ca5061dcbb7421b31065c1c7 | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Serializer/Traverser.php#L169-L193 |
23,299 | PHPPowertools/HTML5 | src/PowerTools/HTML5/Serializer/Traverser.php | HTML5_Serializer_Traverser.isLocalElement | public function isLocalElement($element) {
$uri = $element->namespaceURI;
if (empty($uri)) {
return false;
}
return isset(static::$local_ns[$uri]);
} | php | public function isLocalElement($element) {
$uri = $element->namespaceURI;
if (empty($uri)) {
return false;
}
return isset(static::$local_ns[$uri]);
} | [
"public",
"function",
"isLocalElement",
"(",
"$",
"element",
")",
"{",
"$",
"uri",
"=",
"$",
"element",
"->",
"namespaceURI",
";",
"if",
"(",
"empty",
"(",
"$",
"uri",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"isset",
"(",
"static",
"::"... | Is an element local?
@param mixed $element
An element that implement \DOMNode.
@return bool True if local and false otherwise. | [
"Is",
"an",
"element",
"local?"
] | 4ea8caf5b2618a82ca5061dcbb7421b31065c1c7 | https://github.com/PHPPowertools/HTML5/blob/4ea8caf5b2618a82ca5061dcbb7421b31065c1c7/src/PowerTools/HTML5/Serializer/Traverser.php#L215-L222 |
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.