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,600 | simbiosis-group/yii2-helper | models/ExcelImportForm.php | ExcelImportForm.getCellValue | public function getCellValue($value, $model, $record, $key, $isParent = true)
{
if ($isParent) {
if(isset($model->importSafeAttributes()[$value]) && is_array($model->importSafeAttributes()[$value])) {
$array = $model->importSafeAttributes()[$value];
return $array['model']::find()
->andWhere([$... | php | public function getCellValue($value, $model, $record, $key, $isParent = true)
{
if ($isParent) {
if(isset($model->importSafeAttributes()[$value]) && is_array($model->importSafeAttributes()[$value])) {
$array = $model->importSafeAttributes()[$value];
return $array['model']::find()
->andWhere([$... | [
"public",
"function",
"getCellValue",
"(",
"$",
"value",
",",
"$",
"model",
",",
"$",
"record",
",",
"$",
"key",
",",
"$",
"isParent",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"isParent",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"model",
"->",
"impo... | Get excel cell value. If the import safe attributes has the model declared, it will grab the id from that model instead of the cell value
@param string $model The model name to save the excel rows into
@param array $value The values to be assigned
@param string $record The model name to save the excel rows into
@param ... | [
"Get",
"excel",
"cell",
"value",
".",
"If",
"the",
"import",
"safe",
"attributes",
"has",
"the",
"model",
"declared",
"it",
"will",
"grab",
"the",
"id",
"from",
"that",
"model",
"instead",
"of",
"the",
"cell",
"value"
] | c85c4204dd06b16e54210e75fe6deb51869d1dd9 | https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/models/ExcelImportForm.php#L149-L172 |
23,601 | TangoMan75/CallbackBundle | TwigExtension/Callback.php | Callback.callbackFunction | public function callbackFunction($route = null, $parameters = [])
{
if ($route === null || ! is_string($route)) {
// Gets URI from current request
$uri = $this->request->getUri();
} else {
// Generates URI from '_route'
$uri = $this->router->generate(
... | php | public function callbackFunction($route = null, $parameters = [])
{
if ($route === null || ! is_string($route)) {
// Gets URI from current request
$uri = $this->request->getUri();
} else {
// Generates URI from '_route'
$uri = $this->router->generate(
... | [
"public",
"function",
"callbackFunction",
"(",
"$",
"route",
"=",
"null",
",",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"route",
"===",
"null",
"||",
"!",
"is_string",
"(",
"$",
"route",
")",
")",
"{",
"// Gets URI from current request... | Removes callbacks from query
@param string $route
@param array $parameters
@return string | [
"Removes",
"callbacks",
"from",
"query"
] | a56f599c7786ee7a8134e4f7752da427036f8002 | https://github.com/TangoMan75/CallbackBundle/blob/a56f599c7786ee7a8134e4f7752da427036f8002/TwigExtension/Callback.php#L72-L108 |
23,602 | zhouyl/mellivora | Mellivora/Database/Schema/Grammars/Grammar.php | Grammar.getCommandsByName | protected function getCommandsByName(Blueprint $blueprint, $name)
{
return array_filter($blueprint->getCommands(), function ($value) use ($name) {
return $value->name === $name;
});
} | php | protected function getCommandsByName(Blueprint $blueprint, $name)
{
return array_filter($blueprint->getCommands(), function ($value) use ($name) {
return $value->name === $name;
});
} | [
"protected",
"function",
"getCommandsByName",
"(",
"Blueprint",
"$",
"blueprint",
",",
"$",
"name",
")",
"{",
"return",
"array_filter",
"(",
"$",
"blueprint",
"->",
"getCommands",
"(",
")",
",",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"name",
... | Get all of the commands with a given name.
@param \Mellivora\Database\Schema\Blueprint $blueprint
@param string $name
@return array | [
"Get",
"all",
"of",
"the",
"commands",
"with",
"a",
"given",
"name",
"."
] | 79f844c5c9c25ffbe18d142062e9bc3df00b36a1 | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Schema/Grammars/Grammar.php#L175-L180 |
23,603 | CupOfTea696/WordPress-Composer | src/PluginInteractor.php | PluginInteractor.activate | public function activate(Composer $composer, IOInterface $io, $pluginName)
{
$plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
if ($plugin) {
$result = $this->wp(function () use ($plugin) {
wp_cache_set('plugins', [], 'plugins');
... | php | public function activate(Composer $composer, IOInterface $io, $pluginName)
{
$plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
if ($plugin) {
$result = $this->wp(function () use ($plugin) {
wp_cache_set('plugins', [], 'plugins');
... | [
"public",
"function",
"activate",
"(",
"Composer",
"$",
"composer",
",",
"IOInterface",
"$",
"io",
",",
"$",
"pluginName",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"prepare",
"(",
"__FUNCTION__",
",",
"$",
"composer",
",",
"$",
"io",
",",
"$",
... | Activate a plugin.
@param \Composer\Composer $composer
@param \Composer\IO\IOInterface $io
@param string $plugin
@return void | [
"Activate",
"a",
"plugin",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/PluginInteractor.php#L67-L80 |
23,604 | CupOfTea696/WordPress-Composer | src/PluginInteractor.php | PluginInteractor.deactivate | public function deactivate(Composer $composer, IOInterface $io, $pluginName)
{
$plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
if ($plugin) {
$result = $this->wp(function () use ($plugin) {
return deactivate_plugins($plugin);
});
... | php | public function deactivate(Composer $composer, IOInterface $io, $pluginName)
{
$plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
if ($plugin) {
$result = $this->wp(function () use ($plugin) {
return deactivate_plugins($plugin);
});
... | [
"public",
"function",
"deactivate",
"(",
"Composer",
"$",
"composer",
",",
"IOInterface",
"$",
"io",
",",
"$",
"pluginName",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"prepare",
"(",
"__FUNCTION__",
",",
"$",
"composer",
",",
"$",
"io",
",",
"$"... | Deactivate a plugin.
@param \Composer\Composer $composer
@param \Composer\IO\IOInterface $io
@param string $plugin
@return void | [
"Deactivate",
"a",
"plugin",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/PluginInteractor.php#L90-L101 |
23,605 | CupOfTea696/WordPress-Composer | src/PluginInteractor.php | PluginInteractor.uninstall | public function uninstall(Composer $composer, IOInterface $io, $pluginName)
{
$plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
if ($plugin) {
$result = $this->wp(function () use ($plugin) {
return uninstall_plugin($plugin);
});
... | php | public function uninstall(Composer $composer, IOInterface $io, $pluginName)
{
$plugin = $this->prepare(__FUNCTION__, $composer, $io, $pluginName);
if ($plugin) {
$result = $this->wp(function () use ($plugin) {
return uninstall_plugin($plugin);
});
... | [
"public",
"function",
"uninstall",
"(",
"Composer",
"$",
"composer",
",",
"IOInterface",
"$",
"io",
",",
"$",
"pluginName",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"prepare",
"(",
"__FUNCTION__",
",",
"$",
"composer",
",",
"$",
"io",
",",
"$",... | Uninstall a plugin.
@param \Composer\Composer $composer
@param \Composer\IO\IOInterface $io
@param string $plugin
@return void | [
"Uninstall",
"a",
"plugin",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/PluginInteractor.php#L111-L122 |
23,606 | CupOfTea696/WordPress-Composer | src/PluginInteractor.php | PluginInteractor.prepare | protected function prepare($action, Composer $composer, IOInterface $io, $pluginName)
{
$this->composer = $composer;
$this->io = $io;
if ($this->isPluginExcluded($action, $pluginName)) {
return $this->excluded($action, $pluginName) && false;
}
$p... | php | protected function prepare($action, Composer $composer, IOInterface $io, $pluginName)
{
$this->composer = $composer;
$this->io = $io;
if ($this->isPluginExcluded($action, $pluginName)) {
return $this->excluded($action, $pluginName) && false;
}
$p... | [
"protected",
"function",
"prepare",
"(",
"$",
"action",
",",
"Composer",
"$",
"composer",
",",
"IOInterface",
"$",
"io",
",",
"$",
"pluginName",
")",
"{",
"$",
"this",
"->",
"composer",
"=",
"$",
"composer",
";",
"$",
"this",
"->",
"io",
"=",
"$",
"i... | Prepare plugin interaction.
@param string $action
@param \Composer\Composer $composer
@param \Composer\IO\IOInterface $io
@param string $pluginName
@return string|false | [
"Prepare",
"plugin",
"interaction",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/PluginInteractor.php#L133-L151 |
23,607 | CupOfTea696/WordPress-Composer | src/PluginInteractor.php | PluginInteractor.getPlugin | protected function getPlugin($plugin)
{
$path = $this->plugin->getPublicDirectory() . '/plugins/' . $plugin;
if (file_exists($path) && is_dir($path)) {
$files = scandir($path);
foreach ($files as $file) {
$pattern = defined('HHVM_VERSION'... | php | protected function getPlugin($plugin)
{
$path = $this->plugin->getPublicDirectory() . '/plugins/' . $plugin;
if (file_exists($path) && is_dir($path)) {
$files = scandir($path);
foreach ($files as $file) {
$pattern = defined('HHVM_VERSION'... | [
"protected",
"function",
"getPlugin",
"(",
"$",
"plugin",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"plugin",
"->",
"getPublicDirectory",
"(",
")",
".",
"'/plugins/'",
".",
"$",
"plugin",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
"&&",... | Get the main plugin file for a plugin.
@param string $plugin
@return string|false | [
"Get",
"the",
"main",
"plugin",
"file",
"for",
"a",
"plugin",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/PluginInteractor.php#L174-L203 |
23,608 | CupOfTea696/WordPress-Composer | src/PluginInteractor.php | PluginInteractor.executing | protected function executing($action, $plugin)
{
$this->io->write(' - ' . ucfirst($this->getActionExecuting($action)) . ' plugin <info>' . $plugin . '</info>');
$this->io->write('');
} | php | protected function executing($action, $plugin)
{
$this->io->write(' - ' . ucfirst($this->getActionExecuting($action)) . ' plugin <info>' . $plugin . '</info>');
$this->io->write('');
} | [
"protected",
"function",
"executing",
"(",
"$",
"action",
",",
"$",
"plugin",
")",
"{",
"$",
"this",
"->",
"io",
"->",
"write",
"(",
"' - '",
".",
"ucfirst",
"(",
"$",
"this",
"->",
"getActionExecuting",
"(",
"$",
"action",
")",
")",
".",
"' plugin <i... | Write action executing.
@param string $action
@param string $plugin
@return void | [
"Write",
"action",
"executing",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/PluginInteractor.php#L224-L228 |
23,609 | CupOfTea696/WordPress-Composer | src/PluginInteractor.php | PluginInteractor.wp | protected function wp(Closure $cmd)
{
$cmd = new ReflectionFunction($cmd);
$code = implode(array_slice(file($cmd->getFileName()), ($startLine = $cmd->getStartLine() - 1), $cmd->getEndLine() - $startLine));
preg_match('/\\{(.*)\\}/s', $code, $body);
$vars = $cmd->get... | php | protected function wp(Closure $cmd)
{
$cmd = new ReflectionFunction($cmd);
$code = implode(array_slice(file($cmd->getFileName()), ($startLine = $cmd->getStartLine() - 1), $cmd->getEndLine() - $startLine));
preg_match('/\\{(.*)\\}/s', $code, $body);
$vars = $cmd->get... | [
"protected",
"function",
"wp",
"(",
"Closure",
"$",
"cmd",
")",
"{",
"$",
"cmd",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"cmd",
")",
";",
"$",
"code",
"=",
"implode",
"(",
"array_slice",
"(",
"file",
"(",
"$",
"cmd",
"->",
"getFileName",
"(",
")"... | Run a closure in the WordPress environment.
@param closure $cmd
@return mixed | [
"Run",
"a",
"closure",
"in",
"the",
"WordPress",
"environment",
"."
] | 8c0abc10f82b8ce1db5354f6a041c7587ad3fb90 | https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/PluginInteractor.php#L305-L373 |
23,610 | GrupaZero/api | src/Gzero/Api/Controller/Admin/RouteController.php | RouteController.store | public function store($contentId)
{
$content = $this->repository->getById($contentId);
if (!empty($content)) {
$this->authorize('create', $content);
$this->authorize('update', $content);
if ($content->type != 'category') {
$input = $this->validator... | php | public function store($contentId)
{
$content = $this->repository->getById($contentId);
if (!empty($content)) {
$this->authorize('create', $content);
$this->authorize('update', $content);
if ($content->type != 'category') {
$input = $this->validator... | [
"public",
"function",
"store",
"(",
"$",
"contentId",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"repository",
"->",
"getById",
"(",
"$",
"contentId",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"content",
")",
")",
"{",
"$",
"this",
"->",
... | Stores newly created route for specified content entity in database.
@param int $contentId Id of the content
@return \Illuminate\Http\JsonResponse
@throws RepositoryValidationException | [
"Stores",
"newly",
"created",
"route",
"for",
"specified",
"content",
"entity",
"in",
"database",
"."
] | fc544bb6057274e9d5e7b617346c3f854ea5effd | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/RouteController.php#L62-L78 |
23,611 | Eresus/EresusCMS | src/core/DB.php | Eresus_DB.lazyConnection | public static function lazyConnection($dsn, $name = false)
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '("%s", %s)', $dsn, $name);
self::$lazyConnectionDSNs[$name] = $dsn;
} | php | public static function lazyConnection($dsn, $name = false)
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '("%s", %s)', $dsn, $name);
self::$lazyConnectionDSNs[$name] = $dsn;
} | [
"public",
"static",
"function",
"lazyConnection",
"(",
"$",
"dsn",
",",
"$",
"name",
"=",
"false",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'(\"%s\", %s)'",
",",
"$",
"dsn",
",",
"$",
"name",
")",
";",
"self",
... | Configures lazy connection to DB
@param string $dsn Connection DSN string
@param string|bool $name Optional connection name
@return void | [
"Configures",
"lazy",
"connection",
"to",
"DB"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/DB.php#L85-L89 |
23,612 | Eresus/EresusCMS | src/core/DB.php | Eresus_DB.configureObject | public static function configureObject($name)
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '(%s)', $name);
if (!isset(self::$lazyConnectionDSNs[$name]))
{
throw new Eresus_DB_Exception('DSN for lazy connection "' . $name . '" not found');
}
$dsn = self::$lazyConn... | php | public static function configureObject($name)
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '(%s)', $name);
if (!isset(self::$lazyConnectionDSNs[$name]))
{
throw new Eresus_DB_Exception('DSN for lazy connection "' . $name . '" not found');
}
$dsn = self::$lazyConn... | [
"public",
"static",
"function",
"configureObject",
"(",
"$",
"name",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'(%s)'",
",",
"$",
"name",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"lazyConnectionD... | eZ Components lazy init
@param bool|string $name Connection name
@throws Eresus_DB_Exception
@return ezcDbHandler | [
"eZ",
"Components",
"lazy",
"init"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/DB.php#L123-L136 |
23,613 | Eresus/EresusCMS | src/core/DB.php | DBQueryInsider.subst | public function subst($query)
{
foreach ($this->values as $key => $value)
{
$query = preg_replace("/$key(\s|,|$)/", "$value$1", $query);
}
return $query;
} | php | public function subst($query)
{
foreach ($this->values as $key => $value)
{
$query = preg_replace("/$key(\s|,|$)/", "$value$1", $query);
}
return $query;
} | [
"public",
"function",
"subst",
"(",
"$",
"query",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"query",
"=",
"preg_replace",
"(",
"\"/$key(\\s|,|$)/\"",
",",
"\"$value$1\"",
",",
"$",
"quer... | Substitute values in query
@param string $query
@return string | [
"Substitute",
"values",
"in",
"query"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/DB.php#L242-L250 |
23,614 | surebert/surebert-framework | src/sb/Cameras/Axis/Q6035.php | Q6035.takeSnapShot | public function takeSnapShot($user_agent='Surebert Kamera', $options=Array()){
$ch = curl_init($this->url.'/jpg/1/image.jpg?timestamp='.time());
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, $this->uname.':'.$this->pass);
curl_setopt($ch, ... | php | public function takeSnapShot($user_agent='Surebert Kamera', $options=Array()){
$ch = curl_init($this->url.'/jpg/1/image.jpg?timestamp='.time());
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_setopt($ch, CURLOPT_USERPWD, $this->uname.':'.$this->pass);
curl_setopt($ch, ... | [
"public",
"function",
"takeSnapShot",
"(",
"$",
"user_agent",
"=",
"'Surebert Kamera'",
",",
"$",
"options",
"=",
"Array",
"(",
")",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
"$",
"this",
"->",
"url",
".",
"'/jpg/1/image.jpg?timestamp='",
".",
"time",
"(... | Retrives a current snapshot
@return string jpeg data | [
"Retrives",
"a",
"current",
"snapshot"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cameras/Axis/Q6035.php#L49-L65 |
23,615 | surebert/surebert-framework | src/sb/Cameras/Axis/Q6035.php | Q6035.saveSnapshot | public function saveSnapshot($dir){
if(!is_dir($dir)){
mkdir($dir, 0775, true);
}
$jpeg = $this->takeSnapShot();
$file = $dir.'/'.date('Y_m_d_H_i_s').'.jpg';
if(file_put_contents($file, $jpeg)){
return $file;
}
re... | php | public function saveSnapshot($dir){
if(!is_dir($dir)){
mkdir($dir, 0775, true);
}
$jpeg = $this->takeSnapShot();
$file = $dir.'/'.date('Y_m_d_H_i_s').'.jpg';
if(file_put_contents($file, $jpeg)){
return $file;
}
re... | [
"public",
"function",
"saveSnapshot",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"mkdir",
"(",
"$",
"dir",
",",
"0775",
",",
"true",
")",
";",
"}",
"$",
"jpeg",
"=",
"$",
"this",
"->",
"takeSnapShot",
"... | Retrieves and stores a snapshot by date
@param type $dir
@return string Path if saved, empty string if not | [
"Retrieves",
"and",
"stores",
"a",
"snapshot",
"by",
"date"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cameras/Axis/Q6035.php#L72-L85 |
23,616 | Visithor/visithor | src/Visithor/Command/GoCommand.php | GoCommand.checkEnvironment | protected function checkEnvironment(
InputInterface $input,
OutputInterface $output
) {
$env = $input
->getParameterOption(
['--env', '-e'],
getenv('SYMFONY_ENV') ?: 'dev'
);
if ('test' != $env) {
$output->writeln('... | php | protected function checkEnvironment(
InputInterface $input,
OutputInterface $output
) {
$env = $input
->getParameterOption(
['--env', '-e'],
getenv('SYMFONY_ENV') ?: 'dev'
);
if ('test' != $env) {
$output->writeln('... | [
"protected",
"function",
"checkEnvironment",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"env",
"=",
"$",
"input",
"->",
"getParameterOption",
"(",
"[",
"'--env'",
",",
"'-e'",
"]",
",",
"getenv",
"(",
"'SYMFONY... | Check environment. If not test, add a notice
@param InputInterface $input Input
@param OutputInterface $output Output
@return $this Self object | [
"Check",
"environment",
".",
"If",
"not",
"test",
"add",
"a",
"notice"
] | 201ba2cfc536a0875983c79226947aa20b9f4dca | https://github.com/Visithor/visithor/blob/201ba2cfc536a0875983c79226947aa20b9f4dca/src/Visithor/Command/GoCommand.php#L171-L186 |
23,617 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.sanitize | private function sanitize($filename)
{
$filename = preg_replace('/[^A-Za-z0-9\-\._]/', '.', (string) $filename);
return trim(substr(preg_replace('/[_\.\-]{2,}/', '.', $filename), 0, 40), '._-');
} | php | private function sanitize($filename)
{
$filename = preg_replace('/[^A-Za-z0-9\-\._]/', '.', (string) $filename);
return trim(substr(preg_replace('/[_\.\-]{2,}/', '.', $filename), 0, 40), '._-');
} | [
"private",
"function",
"sanitize",
"(",
"$",
"filename",
")",
"{",
"$",
"filename",
"=",
"preg_replace",
"(",
"'/[^A-Za-z0-9\\-\\._]/'",
",",
"'.'",
",",
"(",
"string",
")",
"$",
"filename",
")",
";",
"return",
"trim",
"(",
"substr",
"(",
"preg_replace",
"... | Sanitizes filename.
@param string $filename The filename
@return string A safe filename | [
"Sanitizes",
"filename",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L263-L267 |
23,618 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.pane | public function pane()
{
global $step;
require_privs('rah_backup');
$steps = array(
'browser' => false,
'create' => true,
'download' => true,
'multi_edit' => true,
);
if (!$step || !bouncer($step, $steps) || !has_privs('rah_b... | php | public function pane()
{
global $step;
require_privs('rah_backup');
$steps = array(
'browser' => false,
'create' => true,
'download' => true,
'multi_edit' => true,
);
if (!$step || !bouncer($step, $steps) || !has_privs('rah_b... | [
"public",
"function",
"pane",
"(",
")",
"{",
"global",
"$",
"step",
";",
"require_privs",
"(",
"'rah_backup'",
")",
";",
"$",
"steps",
"=",
"array",
"(",
"'browser'",
"=>",
"false",
",",
"'create'",
"=>",
"true",
",",
"'download'",
"=>",
"true",
",",
"... | Delivers panels. | [
"Delivers",
"panels",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L273-L291 |
23,619 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.head | public function head()
{
global $event, $theme;
if ($event != 'rah_backup') {
return;
}
gTxtScript(array(
'rah_backup_confirm_backup',
));
$msg = array(
'backup' => escape_js($theme->announce_async(gTxt('rah_backup_taking'))),
... | php | public function head()
{
global $event, $theme;
if ($event != 'rah_backup') {
return;
}
gTxtScript(array(
'rah_backup_confirm_backup',
));
$msg = array(
'backup' => escape_js($theme->announce_async(gTxt('rah_backup_taking'))),
... | [
"public",
"function",
"head",
"(",
")",
"{",
"global",
"$",
"event",
",",
"$",
"theme",
";",
"if",
"(",
"$",
"event",
"!=",
"'rah_backup'",
")",
"{",
"return",
";",
"}",
"gTxtScript",
"(",
"array",
"(",
"'rah_backup_confirm_backup'",
",",
")",
")",
";"... | Adds the panel's CSS and JavaScript to the <head>. | [
"Adds",
"the",
"panel",
"s",
"CSS",
"and",
"JavaScript",
"to",
"the",
"<",
";",
"head>",
";",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L297-L349 |
23,620 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.create | private function create()
{
try {
callback_event('rah_backup.backup');
} catch (Rah_Backup_Exception $e) {
$this->browser(array($e->getMessage(), E_ERROR));
return;
} catch (Exception $e) {
$this->browser(array(txpspecialchars($e->getMessage())... | php | private function create()
{
try {
callback_event('rah_backup.backup');
} catch (Rah_Backup_Exception $e) {
$this->browser(array($e->getMessage(), E_ERROR));
return;
} catch (Exception $e) {
$this->browser(array(txpspecialchars($e->getMessage())... | [
"private",
"function",
"create",
"(",
")",
"{",
"try",
"{",
"callback_event",
"(",
"'rah_backup.backup'",
")",
";",
"}",
"catch",
"(",
"Rah_Backup_Exception",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"browser",
"(",
"array",
"(",
"$",
"e",
"->",
"getMessag... | The panel that creates new backups. | [
"The",
"panel",
"that",
"creates",
"new",
"backups",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L494-L507 |
23,621 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.download | private function download()
{
$file = (string) gps('file');
try {
$backups = $this->getBackups();
} catch (Exception $e) {
}
if (empty($backups) || !isset($backups[$file])) {
$this->browser(array(gTxt('rah_backup_can_not_download'), E_ERROR));
... | php | private function download()
{
$file = (string) gps('file');
try {
$backups = $this->getBackups();
} catch (Exception $e) {
}
if (empty($backups) || !isset($backups[$file])) {
$this->browser(array(gTxt('rah_backup_can_not_download'), E_ERROR));
... | [
"private",
"function",
"download",
"(",
")",
"{",
"$",
"file",
"=",
"(",
"string",
")",
"gps",
"(",
"'file'",
")",
";",
"try",
"{",
"$",
"backups",
"=",
"$",
"this",
"->",
"getBackups",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")"... | Streams backups for downloading. | [
"Streams",
"backups",
"for",
"downloading",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L513-L555 |
23,622 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.multi_edit | private function multi_edit()
{
extract(psa(array(
'selected',
'edit_method',
)));
require_privs('rah_backup_'.((string) $edit_method));
if (!is_string($edit_method) || empty($selected) || !is_array($selected)) {
$this->browser(array(gTxt('rah_ba... | php | private function multi_edit()
{
extract(psa(array(
'selected',
'edit_method',
)));
require_privs('rah_backup_'.((string) $edit_method));
if (!is_string($edit_method) || empty($selected) || !is_array($selected)) {
$this->browser(array(gTxt('rah_ba... | [
"private",
"function",
"multi_edit",
"(",
")",
"{",
"extract",
"(",
"psa",
"(",
"array",
"(",
"'selected'",
",",
"'edit_method'",
",",
")",
")",
")",
";",
"require_privs",
"(",
"'rah_backup_'",
".",
"(",
"(",
"string",
")",
"$",
"edit_method",
")",
")",
... | Multi-edit handler. | [
"Multi",
"-",
"edit",
"handler",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L561-L582 |
23,623 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.multi_option_delete | private function multi_option_delete()
{
$selected = ps('selected');
$deleted = array();
try {
foreach ($this->getBackups() as $name => $file) {
if (in_array($name, $selected, true)) {
$deleted[$name] = $file['path'];
@unli... | php | private function multi_option_delete()
{
$selected = ps('selected');
$deleted = array();
try {
foreach ($this->getBackups() as $name => $file) {
if (in_array($name, $selected, true)) {
$deleted[$name] = $file['path'];
@unli... | [
"private",
"function",
"multi_option_delete",
"(",
")",
"{",
"$",
"selected",
"=",
"ps",
"(",
"'selected'",
")",
";",
"$",
"deleted",
"=",
"array",
"(",
")",
";",
"try",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getBackups",
"(",
")",
"as",
"$",
"name... | Deletes selected backups. | [
"Deletes",
"selected",
"backups",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L588-L608 |
23,624 | gocom/rah_backup | src/Rah/Backup.php | Rah_Backup.getBackups | private function getBackups($sort = 'name', $direction = 'asc', $offset = 0, $limit = null)
{
$directory = txpath . '/' . get_pref('rah_backup_path');
if (!get_pref('rah_backup_path') || !file_exists($directory) || !is_dir($directory) || !is_readable($directory)) {
throw new Rah_Backup_... | php | private function getBackups($sort = 'name', $direction = 'asc', $offset = 0, $limit = null)
{
$directory = txpath . '/' . get_pref('rah_backup_path');
if (!get_pref('rah_backup_path') || !file_exists($directory) || !is_dir($directory) || !is_readable($directory)) {
throw new Rah_Backup_... | [
"private",
"function",
"getBackups",
"(",
"$",
"sort",
"=",
"'name'",
",",
"$",
"direction",
"=",
"'asc'",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"directory",
"=",
"txpath",
".",
"'/'",
".",
"get_pref",
"(",
"'... | Gets a list of backups.
@param string $sort Sorting criteria, either 'name', 'ext', 'date', 'size', 'type'
@param string $direction Sorting direction, either 'asc' or 'desc'
@param int $offset Offset
@param int $limit Limit results
@return array | [
"Gets",
"a",
"list",
"of",
"backups",
"."
] | 1a757c0fd569f4baf59471da8b1b487472a71390 | https://github.com/gocom/rah_backup/blob/1a757c0fd569f4baf59471da8b1b487472a71390/src/Rah/Backup.php#L620-L680 |
23,625 | arndtteunissen/column-layout | Classes/Hook/LayoutPreviewHook.php | LayoutPreviewHook.injectStylesAndScripts | public function injectStylesAndScripts(array $params, PageLayoutController $ref): string
{
$jsCallbackFunction = null;
// The translation view is shown. Disable floating elements for that view.
if ($ref->MOD_SETTINGS['function'] === '2') {
$jsCallbackFunction = 'function(ColumnL... | php | public function injectStylesAndScripts(array $params, PageLayoutController $ref): string
{
$jsCallbackFunction = null;
// The translation view is shown. Disable floating elements for that view.
if ($ref->MOD_SETTINGS['function'] === '2') {
$jsCallbackFunction = 'function(ColumnL... | [
"public",
"function",
"injectStylesAndScripts",
"(",
"array",
"$",
"params",
",",
"PageLayoutController",
"$",
"ref",
")",
":",
"string",
"{",
"$",
"jsCallbackFunction",
"=",
"null",
";",
"// The translation view is shown. Disable floating elements for that view.",
"if",
... | Hook for header rendering of the PageLayoutController to inject stylesheet required for custom column layout
display.
@see PageLayoutController::renderContent()
@param array $params
@param PageLayoutController $ref
@return string html to be added to the page layout | [
"Hook",
"for",
"header",
"rendering",
"of",
"the",
"PageLayoutController",
"to",
"inject",
"stylesheet",
"required",
"for",
"custom",
"column",
"layout",
"display",
"."
] | ad737068eef3b084d4d0e3a48e6a3d8277af9560 | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Hook/LayoutPreviewHook.php#L38-L54 |
23,626 | arndtteunissen/column-layout | Classes/Hook/LayoutPreviewHook.php | LayoutPreviewHook.skipRendering | protected function skipRendering(PageLayoutView &$parentObject, array $row): bool
{
$tsConf = $parentObject->modTSconfig['column_layout'] ?? [];
return (
$tsConf['hidePreview'] ?? false // Hidden via page TSConfig
|| empty($row['tx_column_layout_column_co... | php | protected function skipRendering(PageLayoutView &$parentObject, array $row): bool
{
$tsConf = $parentObject->modTSconfig['column_layout'] ?? [];
return (
$tsConf['hidePreview'] ?? false // Hidden via page TSConfig
|| empty($row['tx_column_layout_column_co... | [
"protected",
"function",
"skipRendering",
"(",
"PageLayoutView",
"&",
"$",
"parentObject",
",",
"array",
"$",
"row",
")",
":",
"bool",
"{",
"$",
"tsConf",
"=",
"$",
"parentObject",
"->",
"modTSconfig",
"[",
"'column_layout'",
"]",
"??",
"[",
"]",
";",
"ret... | Checks if the rendering of the column markup should be skipped.
@param PageLayoutView $parentObject
@return bool | [
"Checks",
"if",
"the",
"rendering",
"of",
"the",
"column",
"markup",
"should",
"be",
"skipped",
"."
] | ad737068eef3b084d4d0e3a48e6a3d8277af9560 | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/Hook/LayoutPreviewHook.php#L84-L93 |
23,627 | surebert/surebert-framework | src/sb/Controller/HTTP/Proxy.php | Proxy.get | public function get() {
if (!isset($this->request->args[0])) {
exit;
}
$url = $this->request->args[0];
//add the $_GET vars to the request
$query_string = http_build_query($this->request->get);
$destination_url = $url . ($query_string ? '?'.$query_s... | php | public function get() {
if (!isset($this->request->args[0])) {
exit;
}
$url = $this->request->args[0];
//add the $_GET vars to the request
$query_string = http_build_query($this->request->get);
$destination_url = $url . ($query_string ? '?'.$query_s... | [
"public",
"function",
"get",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"request",
"->",
"args",
"[",
"0",
"]",
")",
")",
"{",
"exit",
";",
"}",
"$",
"url",
"=",
"$",
"this",
"->",
"request",
"->",
"args",
"[",
"0",
"]",
... | proxies request and responds
It will proxy both GET and POST data and return respose
@servable true
e.g. SITE_URL/proxy/get/http://someothersite?test=rest&ff=gg | [
"proxies",
"request",
"and",
"responds"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP/Proxy.php#L77-L142 |
23,628 | surebert/surebert-framework | src/sb/Controller/HTTP/Proxy.php | Proxy.headerCallBack | protected function headerCallBack($ch, $data){
if (!is_null($data)) {
if (preg_match("~^HTTP/.*? 404~", $data)) {
header(trim($data));
while (ob_get_level() > 0) {
ob_end_flush();
}
... | php | protected function headerCallBack($ch, $data){
if (!is_null($data)) {
if (preg_match("~^HTTP/.*? 404~", $data)) {
header(trim($data));
while (ob_get_level() > 0) {
ob_end_flush();
}
... | [
"protected",
"function",
"headerCallBack",
"(",
"$",
"ch",
",",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"data",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"~^HTTP/.*? 404~\"",
",",
"$",
"data",
")",
")",
"{",
"header",
"(",
... | Called to process headers from URL being proxied
@param resource $ch The curl connection
@param string $data The header data
@return int length of the data from header | [
"Called",
"to",
"process",
"headers",
"from",
"URL",
"being",
"proxied"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/HTTP/Proxy.php#L150-L176 |
23,629 | eghojansu/moe | src/tools/web/OpenID.php | OpenID.auth | function auth($proxy=NULL,$attr=array(),array $reqd=NULL) {
$fw=Base::instance();
$root=$fw->get('SCHEME').'://'.$fw->get('HOST');
if (empty($this->args['trust_root']))
$this->args['trust_root']=$root.$fw->get('BASE').'/';
if (empty($this->args['return_to']))
$this->args['return_to']=$root.$_SERVER['REQUE... | php | function auth($proxy=NULL,$attr=array(),array $reqd=NULL) {
$fw=Base::instance();
$root=$fw->get('SCHEME').'://'.$fw->get('HOST');
if (empty($this->args['trust_root']))
$this->args['trust_root']=$root.$fw->get('BASE').'/';
if (empty($this->args['return_to']))
$this->args['return_to']=$root.$_SERVER['REQUE... | [
"function",
"auth",
"(",
"$",
"proxy",
"=",
"NULL",
",",
"$",
"attr",
"=",
"array",
"(",
")",
",",
"array",
"$",
"reqd",
"=",
"NULL",
")",
"{",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"$",
"root",
"=",
"$",
"fw",
"->",
"get",... | Initiate OpenID authentication sequence; Return FALSE on failure
or redirect to OpenID provider URL
@return bool
@param $proxy string
@param $attr array
@param $reqd string|array | [
"Initiate",
"OpenID",
"authentication",
"sequence",
";",
"Return",
"FALSE",
"on",
"failure",
"or",
"redirect",
"to",
"OpenID",
"provider",
"URL"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/web/OpenID.php#L127-L150 |
23,630 | Isset/pushnotification | src/PushNotification/Type/Apple/AppleConnection.php | AppleConnection.send | public function send(Message $message)
{
/* @var AppleMessage $message */
$buildMessage = $this->buildMessage($message);
$this->streamSocket->connect();
$bytesSend = $this->streamSocket->write($buildMessage);
if (strlen($buildMessage) !== $bytesSend) {
$this->stre... | php | public function send(Message $message)
{
/* @var AppleMessage $message */
$buildMessage = $this->buildMessage($message);
$this->streamSocket->connect();
$bytesSend = $this->streamSocket->write($buildMessage);
if (strlen($buildMessage) !== $bytesSend) {
$this->stre... | [
"public",
"function",
"send",
"(",
"Message",
"$",
"message",
")",
"{",
"/* @var AppleMessage $message */",
"$",
"buildMessage",
"=",
"$",
"this",
"->",
"buildMessage",
"(",
"$",
"message",
")",
";",
"$",
"this",
"->",
"streamSocket",
"->",
"connect",
"(",
"... | Send a message without waiting on response.
@param Message $message
@throws ConnectionException
@throws ConnectionHandlerException | [
"Send",
"a",
"message",
"without",
"waiting",
"on",
"response",
"."
] | 5e7634dc6b1cf4f7c371d1890243a25252db0d85 | https://github.com/Isset/pushnotification/blob/5e7634dc6b1cf4f7c371d1890243a25252db0d85/src/PushNotification/Type/Apple/AppleConnection.php#L112-L123 |
23,631 | nabab/bbn | src/bbn/appui/dbsync.php | dbsync.check | public static function check(){
return ( \is_object(self::$db) && \is_object(self::$dbs) && self::$db->check() && self::$dbs->check() );
} | php | public static function check(){
return ( \is_object(self::$db) && \is_object(self::$dbs) && self::$db->check() && self::$dbs->check() );
} | [
"public",
"static",
"function",
"check",
"(",
")",
"{",
"return",
"(",
"\\",
"is_object",
"(",
"self",
"::",
"$",
"db",
")",
"&&",
"\\",
"is_object",
"(",
"self",
"::",
"$",
"dbs",
")",
"&&",
"self",
"::",
"$",
"db",
"->",
"check",
"(",
")",
"&&"... | Checks if the initialization has been all right
@return bool | [
"Checks",
"if",
"the",
"initialization",
"has",
"been",
"all",
"right"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/dbsync.php#L154-L156 |
23,632 | cultuurnet/deserializer | src/JSONDeserializer.php | JSONDeserializer.deserialize | public function deserialize(StringLiteral $data)
{
$data = json_decode($data->toNative(), $this->assoc);
if (null === $data) {
throw new NotWellFormedException('Invalid JSON');
}
return $data;
} | php | public function deserialize(StringLiteral $data)
{
$data = json_decode($data->toNative(), $this->assoc);
if (null === $data) {
throw new NotWellFormedException('Invalid JSON');
}
return $data;
} | [
"public",
"function",
"deserialize",
"(",
"StringLiteral",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"data",
"->",
"toNative",
"(",
")",
",",
"$",
"this",
"->",
"assoc",
")",
";",
"if",
"(",
"null",
"===",
"$",
"data",
")",
... | Decodes a JSON string into a generic PHP object.
@param StringLiteral $data
@return \stdClass | [
"Decodes",
"a",
"JSON",
"string",
"into",
"a",
"generic",
"PHP",
"object",
"."
] | ec7830eb860ea83f7c28c38649b0057177ade784 | https://github.com/cultuurnet/deserializer/blob/ec7830eb860ea83f7c28c38649b0057177ade784/src/JSONDeserializer.php#L30-L39 |
23,633 | GrupaZero/social | src/Gzero/Social/SocialLoginService.php | SocialLoginService.login | public function login($serviceName, AbstractUser $response)
{
$userId = $this->repo->getUserIdBySocialId($response->id, $serviceName);
if (auth()->check()) { // user already logged and service has not been connected
$user = auth()->user();
if ($userId) { // This service has a... | php | public function login($serviceName, AbstractUser $response)
{
$userId = $this->repo->getUserIdBySocialId($response->id, $serviceName);
if (auth()->check()) { // user already logged and service has not been connected
$user = auth()->user();
if ($userId) { // This service has a... | [
"public",
"function",
"login",
"(",
"$",
"serviceName",
",",
"AbstractUser",
"$",
"response",
")",
"{",
"$",
"userId",
"=",
"$",
"this",
"->",
"repo",
"->",
"getUserIdBySocialId",
"(",
"$",
"response",
"->",
"id",
",",
"$",
"serviceName",
")",
";",
"if",... | Login using social service.
@param $serviceName string social service name
@param $response AbstractUser response data
@throws SocialException | [
"Login",
"using",
"social",
"service",
"."
] | f7cbf50765bd228010a2c61d950f915828306cf7 | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Social/SocialLoginService.php#L50-L76 |
23,634 | rattfieldnz/url-validation | src/RattfieldNz/UrlValidation/UrlValidation.php | UrlValidation.getUrlStatusCode | public static function getUrlStatusCode($url)
{
//Instantiate the EpiCurl class to be used
//with checking URL HTTP status code.
$epi_curl_checker = EpiCurl::getInstance();
// Add the given URL to the url checker.
$url_check = $epi_curl_checker->addURL($url);
... | php | public static function getUrlStatusCode($url)
{
//Instantiate the EpiCurl class to be used
//with checking URL HTTP status code.
$epi_curl_checker = EpiCurl::getInstance();
// Add the given URL to the url checker.
$url_check = $epi_curl_checker->addURL($url);
... | [
"public",
"static",
"function",
"getUrlStatusCode",
"(",
"$",
"url",
")",
"{",
"//Instantiate the EpiCurl class to be used\r",
"//with checking URL HTTP status code.\r",
"$",
"epi_curl_checker",
"=",
"EpiCurl",
"::",
"getInstance",
"(",
")",
";",
"// Add the given URL to the ... | This function obtains an HTTP status
code from a given URL.
@param $url
@uses EpiCurl::getInstance
@return int | [
"This",
"function",
"obtains",
"an",
"HTTP",
"status",
"code",
"from",
"a",
"given",
"URL",
"."
] | ff44a463a9119fa3bea9bd7fef3d44b7e6f9a44c | https://github.com/rattfieldnz/url-validation/blob/ff44a463a9119fa3bea9bd7fef3d44b7e6f9a44c/src/RattfieldNz/UrlValidation/UrlValidation.php#L53-L64 |
23,635 | webcreate/util | src/Webcreate/Util/Cli.php | Cli.prepare | public function prepare($command, array $arguments = array())
{
$commandline = $command;
foreach ($arguments as $option => $value) {
if (is_bool($value)) {
if ($value === true) {
$commandline .= ' ' . $option;
}
} else {
... | php | public function prepare($command, array $arguments = array())
{
$commandline = $command;
foreach ($arguments as $option => $value) {
if (is_bool($value)) {
if ($value === true) {
$commandline .= ' ' . $option;
}
} else {
... | [
"public",
"function",
"prepare",
"(",
"$",
"command",
",",
"array",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"$",
"commandline",
"=",
"$",
"command",
";",
"foreach",
"(",
"$",
"arguments",
"as",
"$",
"option",
"=>",
"$",
"value",
")",
"{",... | Prepares a commandline
@param string $command
@param array $arguments
@return string | [
"Prepares",
"a",
"commandline"
] | 16c53697a3d96431d0afd57f8ab9f1df6c21e976 | https://github.com/webcreate/util/blob/16c53697a3d96431d0afd57f8ab9f1df6c21e976/src/Webcreate/Util/Cli.php#L53-L75 |
23,636 | fccn/oai-pmh-core | src/schemas/ands_oai.php | ANDS_OAI.addChild | protected function addChild($mom_node, $name, $value='')
{
return $this->oai_pmh->addChild($mom_node, $name, $value);
} | php | protected function addChild($mom_node, $name, $value='')
{
return $this->oai_pmh->addChild($mom_node, $name, $value);
} | [
"protected",
"function",
"addChild",
"(",
"$",
"mom_node",
",",
"$",
"name",
",",
"$",
"value",
"=",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"oai_pmh",
"->",
"addChild",
"(",
"$",
"mom_node",
",",
"$",
"name",
",",
"$",
"value",
")",
";",
"}"
... | A worker function for easily adding a newly created node to current XML Doc.
@param $mom_node Type: DOMElement. Node the new child will be attached to.
@param $name Type: sting. The name of the child node is being added.
@param $value Type: sting. The text content of the child node is being added. The default is ''.
@r... | [
"A",
"worker",
"function",
"for",
"easily",
"adding",
"a",
"newly",
"created",
"node",
"to",
"current",
"XML",
"Doc",
"."
] | a9c6852482c7bd7c48911a2165120325ecc27ea2 | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_oai.php#L83-L86 |
23,637 | fccn/oai-pmh-core | src/schemas/ands_oai.php | ANDS_OAI.create_regObject | protected function create_regObject($group, $key, $originatingSource)
{
$regObj_node = $this->addChild($this->working_node, 'registryObject');
$regObj_node->setAttribute('group', $group);
$this->addChild($regObj_node, 'key', $key);
$this->addChild($regObj_node, 'originatingSource', $... | php | protected function create_regObject($group, $key, $originatingSource)
{
$regObj_node = $this->addChild($this->working_node, 'registryObject');
$regObj_node->setAttribute('group', $group);
$this->addChild($regObj_node, 'key', $key);
$this->addChild($regObj_node, 'originatingSource', $... | [
"protected",
"function",
"create_regObject",
"(",
"$",
"group",
",",
"$",
"key",
",",
"$",
"originatingSource",
")",
"{",
"$",
"regObj_node",
"=",
"$",
"this",
"->",
"addChild",
"(",
"$",
"this",
"->",
"working_node",
",",
"'registryObject'",
")",
";",
"$"... | Create a single registryObject node. Each set has its own structure but they all have an attribute of group, a key node and an originatingSource node. The newly created node will be used as the working node.
\param $group string, group attribute of the new registryObject node .
\param $key string, key node, used as an... | [
"Create",
"a",
"single",
"registryObject",
"node",
".",
"Each",
"set",
"has",
"its",
"own",
"structure",
"but",
"they",
"all",
"have",
"an",
"attribute",
"of",
"group",
"a",
"key",
"node",
"and",
"an",
"originatingSource",
"node",
".",
"The",
"newly",
"cre... | a9c6852482c7bd7c48911a2165120325ecc27ea2 | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_oai.php#L106-L113 |
23,638 | fccn/oai-pmh-core | src/schemas/ands_oai.php | ANDS_OAI.create_dcs_node | protected function create_dcs_node($set_name, $set_type)
{
$this->working_node = $this->addChild($this->working_node, $set_name);
$this->working_node->setAttribute('type', $set_type);
} | php | protected function create_dcs_node($set_name, $set_type)
{
$this->working_node = $this->addChild($this->working_node, $set_name);
$this->working_node->setAttribute('type', $set_type);
} | [
"protected",
"function",
"create_dcs_node",
"(",
"$",
"set_name",
",",
"$",
"set_type",
")",
"{",
"$",
"this",
"->",
"working_node",
"=",
"$",
"this",
"->",
"addChild",
"(",
"$",
"this",
"->",
"working_node",
",",
"$",
"set_name",
")",
";",
"$",
"this",
... | RIF-CS node is the content node of RIF-CS metadata node which starts from regObjects.
Each set supportted in RIF-CS has its own content model. The created node will be used as the
root node of this record for following nodes will be created.
\param $set_name string, the name of set. For ANDS, they are Activity, Party ... | [
"RIF",
"-",
"CS",
"node",
"is",
"the",
"content",
"node",
"of",
"RIF",
"-",
"CS",
"metadata",
"node",
"which",
"starts",
"from",
"regObjects",
".",
"Each",
"set",
"supportted",
"in",
"RIF",
"-",
"CS",
"has",
"its",
"own",
"content",
"model",
".",
"The"... | a9c6852482c7bd7c48911a2165120325ecc27ea2 | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_oai.php#L122-L126 |
23,639 | infinity-next/sleuth | src/Detectives/ImageGDDetective.php | ImageGDDetective.leadGIF | protected function leadGIF()
{
$exif = exif_imagetype($this->file) === IMAGETYPE_GIF;
if ($exif)
{
return $this->closeCase("gif", "image/gif");
}
return null;
} | php | protected function leadGIF()
{
$exif = exif_imagetype($this->file) === IMAGETYPE_GIF;
if ($exif)
{
return $this->closeCase("gif", "image/gif");
}
return null;
} | [
"protected",
"function",
"leadGIF",
"(",
")",
"{",
"$",
"exif",
"=",
"exif_imagetype",
"(",
"$",
"this",
"->",
"file",
")",
"===",
"IMAGETYPE_GIF",
";",
"if",
"(",
"$",
"exif",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"gif\"",
",",
... | Checks if thise file is a GIF.
@return boolean|null | [
"Checks",
"if",
"thise",
"file",
"is",
"a",
"GIF",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ImageGDDetective.php#L15-L25 |
23,640 | infinity-next/sleuth | src/Detectives/ImageGDDetective.php | ImageGDDetective.leadJPG | protected function leadJPG()
{
$exif = exif_imagetype($this->file) === IMAGETYPE_JPEG;
if ($exif)
{
return $this->closeCase("jpg", "image/jpg");
}
return null;
} | php | protected function leadJPG()
{
$exif = exif_imagetype($this->file) === IMAGETYPE_JPEG;
if ($exif)
{
return $this->closeCase("jpg", "image/jpg");
}
return null;
} | [
"protected",
"function",
"leadJPG",
"(",
")",
"{",
"$",
"exif",
"=",
"exif_imagetype",
"(",
"$",
"this",
"->",
"file",
")",
"===",
"IMAGETYPE_JPEG",
";",
"if",
"(",
"$",
"exif",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"jpg\"",
",",
... | Checks if thise file is a JPG.
@return boolean|null | [
"Checks",
"if",
"thise",
"file",
"is",
"a",
"JPG",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ImageGDDetective.php#L32-L42 |
23,641 | infinity-next/sleuth | src/Detectives/ImageGDDetective.php | ImageGDDetective.leadPNG | protected function leadPNG()
{
$exif = exif_imagetype($this->file) === IMAGETYPE_PNG;
if ($exif)
{
return $this->closeCase("png", "image/png");
}
return null;
} | php | protected function leadPNG()
{
$exif = exif_imagetype($this->file) === IMAGETYPE_PNG;
if ($exif)
{
return $this->closeCase("png", "image/png");
}
return null;
} | [
"protected",
"function",
"leadPNG",
"(",
")",
"{",
"$",
"exif",
"=",
"exif_imagetype",
"(",
"$",
"this",
"->",
"file",
")",
"===",
"IMAGETYPE_PNG",
";",
"if",
"(",
"$",
"exif",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"png\"",
",",
... | Checks if thise file is a PNG.
@return boolean|null | [
"Checks",
"if",
"thise",
"file",
"is",
"a",
"PNG",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ImageGDDetective.php#L49-L59 |
23,642 | infinity-next/sleuth | src/Detectives/ImageGDDetective.php | ImageGDDetective.leadSWF | protected function leadSWF()
{
$exif = exif_imagetype($this->file);
$flash = ($exif === IMAGETYPE_SWF || $exif === IMAGETYPE_SWC);
if ($exif)
{
return $this->closeCase("swf", "application/x-shockwave-flash");
}
return null;
} | php | protected function leadSWF()
{
$exif = exif_imagetype($this->file);
$flash = ($exif === IMAGETYPE_SWF || $exif === IMAGETYPE_SWC);
if ($exif)
{
return $this->closeCase("swf", "application/x-shockwave-flash");
}
return null;
} | [
"protected",
"function",
"leadSWF",
"(",
")",
"{",
"$",
"exif",
"=",
"exif_imagetype",
"(",
"$",
"this",
"->",
"file",
")",
";",
"$",
"flash",
"=",
"(",
"$",
"exif",
"===",
"IMAGETYPE_SWF",
"||",
"$",
"exif",
"===",
"IMAGETYPE_SWC",
")",
";",
"if",
"... | Checks if the file is a SWF.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"SWF",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ImageGDDetective.php#L66-L77 |
23,643 | accompli/chrono | src/Repository.php | Repository.getAdapter | public function getAdapter()
{
if ($this->repositoryAdapter instanceof AdapterInterface) {
return $this->repositoryAdapter;
}
foreach ($this->adapters as $adapterClass) {
if (class_exists($adapterClass) === false || in_array('Accompli\Chrono\Adapter\AdapterInterface'... | php | public function getAdapter()
{
if ($this->repositoryAdapter instanceof AdapterInterface) {
return $this->repositoryAdapter;
}
foreach ($this->adapters as $adapterClass) {
if (class_exists($adapterClass) === false || in_array('Accompli\Chrono\Adapter\AdapterInterface'... | [
"public",
"function",
"getAdapter",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"repositoryAdapter",
"instanceof",
"AdapterInterface",
")",
"{",
"return",
"$",
"this",
"->",
"repositoryAdapter",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"adapters",
"as",... | Returns the supported adapter for the repository.
@return AdapterInterface|null | [
"Returns",
"the",
"supported",
"adapter",
"for",
"the",
"repository",
"."
] | 5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc | https://github.com/accompli/chrono/blob/5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc/src/Repository.php#L95-L111 |
23,644 | ajgarlag/AjglSessionConcurrency | src/Http/EventListener/RefreshSessionRegistryLastUsedListener.php | RefreshSessionRegistryLastUsedListener.onKernelTerminate | public function onKernelTerminate(PostResponseEvent $event)
{
if (!$event->getRequest()->hasSession()) {
return;
}
$session = $event->getRequest()->getSession();
$this->registry->refreshLastUsed($session->getId(), $session->getMetadataBag()->getLastUsed());
} | php | public function onKernelTerminate(PostResponseEvent $event)
{
if (!$event->getRequest()->hasSession()) {
return;
}
$session = $event->getRequest()->getSession();
$this->registry->refreshLastUsed($session->getId(), $session->getMetadataBag()->getLastUsed());
} | [
"public",
"function",
"onKernelTerminate",
"(",
"PostResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"->",
"getRequest",
"(",
")",
"->",
"hasSession",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"session",
"=",
"$",
"event",
"->"... | Refresh the last used timestamp for the given session if registered.
@param PostResponseEvent $event | [
"Refresh",
"the",
"last",
"used",
"timestamp",
"for",
"the",
"given",
"session",
"if",
"registered",
"."
] | daa3b1ff3ad4951947f7192e12b2496555e135fb | https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/EventListener/RefreshSessionRegistryLastUsedListener.php#L41-L50 |
23,645 | surebert/surebert-framework | src/sb/SSH2/Shell.php | Shell.exec | public function exec($command, $timeout=30, $with_login_env=true)
{
stream_set_timeout($this->shell, $timeout);
if($with_login_env){
$command = 'bash -l '.$command;
}
return fwrite($this->shell, $command.PHP_EOL);
} | php | public function exec($command, $timeout=30, $with_login_env=true)
{
stream_set_timeout($this->shell, $timeout);
if($with_login_env){
$command = 'bash -l '.$command;
}
return fwrite($this->shell, $command.PHP_EOL);
} | [
"public",
"function",
"exec",
"(",
"$",
"command",
",",
"$",
"timeout",
"=",
"30",
",",
"$",
"with_login_env",
"=",
"true",
")",
"{",
"stream_set_timeout",
"(",
"$",
"this",
"->",
"shell",
",",
"$",
"timeout",
")",
";",
"if",
"(",
"$",
"with_login_env"... | Execute a command on the interactive shell
@param string $command The command to exec
@param boolean $with_login_env o run a shell script with all the variables that you would have when logged in interactively
@return boolean | [
"Execute",
"a",
"command",
"on",
"the",
"interactive",
"shell"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/SSH2/Shell.php#L56-L64 |
23,646 | oroinc/OroLayoutComponent | ExpressionLanguage/Encoder/ExpressionEncoderRegistry.php | ExpressionEncoderRegistry.get | public function get($format)
{
if (!array_key_exists($format, $this->encoders)) {
throw new \RuntimeException(
sprintf('The expression encoder for "%s" formatting was not found.', $format)
);
}
return $this->encoders[$format];
} | php | public function get($format)
{
if (!array_key_exists($format, $this->encoders)) {
throw new \RuntimeException(
sprintf('The expression encoder for "%s" formatting was not found.', $format)
);
}
return $this->encoders[$format];
} | [
"public",
"function",
"get",
"(",
"$",
"format",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"format",
",",
"$",
"this",
"->",
"encoders",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'The expression encoder fo... | Returns the encoder for the given format
@param string $format
@return ExpressionEncoderInterface
@throws \RuntimeException if the appropriate encoder does not exist | [
"Returns",
"the",
"encoder",
"for",
"the",
"given",
"format"
] | 682a96672393d81c63728e47c4a4c3618c515be0 | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ExpressionLanguage/Encoder/ExpressionEncoderRegistry.php#L27-L36 |
23,647 | dstuecken/notify | src/Handler/SmartyHandler.php | SmartyHandler.handle | public function handle(NotificationInterface $notification, $level)
{
if ($notification instanceof AttributeAwareInterface)
{
$options = $notification->attributes();
}
else
{
$options = [];
}
if ($notification instanceof TitleAwareInte... | php | public function handle(NotificationInterface $notification, $level)
{
if ($notification instanceof AttributeAwareInterface)
{
$options = $notification->attributes();
}
else
{
$options = [];
}
if ($notification instanceof TitleAwareInte... | [
"public",
"function",
"handle",
"(",
"NotificationInterface",
"$",
"notification",
",",
"$",
"level",
")",
"{",
"if",
"(",
"$",
"notification",
"instanceof",
"AttributeAwareInterface",
")",
"{",
"$",
"options",
"=",
"$",
"notification",
"->",
"attributes",
"(",
... | Handle a notification.
@return boolean | [
"Handle",
"a",
"notification",
"."
] | abccf0a6a272caf66baea74323f18e2212c6e11e | https://github.com/dstuecken/notify/blob/abccf0a6a272caf66baea74323f18e2212c6e11e/src/Handler/SmartyHandler.php#L34-L68 |
23,648 | SporkCode/Spork | src/Filter/AbstractFilter.php | AbstractFilter.inline | public static function inline($value, $options = array())
{
$filter = new static();
$filter->setOptions($options);
return $filter->filter($value);
} | php | public static function inline($value, $options = array())
{
$filter = new static();
$filter->setOptions($options);
return $filter->filter($value);
} | [
"public",
"static",
"function",
"inline",
"(",
"$",
"value",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"filter",
"=",
"new",
"static",
"(",
")",
";",
"$",
"filter",
"->",
"setOptions",
"(",
"$",
"options",
")",
";",
"return",
"$",... | Static function to execute filter
@param int $value
@param array $options
@return mixed | [
"Static",
"function",
"to",
"execute",
"filter"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Filter/AbstractFilter.php#L24-L29 |
23,649 | surebert/surebert-framework | src/sb/Strings.php | Strings.cleanFileName | public static function cleanFileName($str)
{
preg_match('~\.\w{1,4}$~', $str, $ext);
$str = preg_replace('~\.\w{1,4}$~', '', $str);
return str_replace(Array(' ', '.', '-'), "_", $str).$ext[0];
} | php | public static function cleanFileName($str)
{
preg_match('~\.\w{1,4}$~', $str, $ext);
$str = preg_replace('~\.\w{1,4}$~', '', $str);
return str_replace(Array(' ', '.', '-'), "_", $str).$ext[0];
} | [
"public",
"static",
"function",
"cleanFileName",
"(",
"$",
"str",
")",
"{",
"preg_match",
"(",
"'~\\.\\w{1,4}$~'",
",",
"$",
"str",
",",
"$",
"ext",
")",
";",
"$",
"str",
"=",
"preg_replace",
"(",
"'~\\.\\w{1,4}$~'",
",",
"''",
",",
"$",
"str",
")",
";... | Cleans up file names and removes extraneous spaces, symbols, etc
@author paul.visco@roswellpark.org
@param string $str
@return string | [
"Cleans",
"up",
"file",
"names",
"and",
"removes",
"extraneous",
"spaces",
"symbols",
"etc"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Strings.php#L46-L53 |
23,650 | surebert/surebert-framework | src/sb/Strings.php | Strings.stripMicrosoftChars | public static function stripMicrosoftChars($str)
{
$chars=array(
chr(133) => '...', //dot dot dot elipsis
chr(145) => "'", //curly left single quotes
chr(146) => "'", //curly right single quotes
chr(147) => '"', //curly left double quotes
chr(148... | php | public static function stripMicrosoftChars($str)
{
$chars=array(
chr(133) => '...', //dot dot dot elipsis
chr(145) => "'", //curly left single quotes
chr(146) => "'", //curly right single quotes
chr(147) => '"', //curly left double quotes
chr(148... | [
"public",
"static",
"function",
"stripMicrosoftChars",
"(",
"$",
"str",
")",
"{",
"$",
"chars",
"=",
"array",
"(",
"chr",
"(",
"133",
")",
"=>",
"'...'",
",",
"//dot dot dot elipsis",
"chr",
"(",
"145",
")",
"=>",
"\"'\"",
",",
"//curly left single quotes",
... | Removes microsoft characters and replace them with their ascii counterparts
@author paul.visco@roswellpark.org
@param string $str
@return string | [
"Removes",
"microsoft",
"characters",
"and",
"replace",
"them",
"with",
"their",
"ascii",
"counterparts"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Strings.php#L74-L101 |
23,651 | surebert/surebert-framework | src/sb/Strings.php | Strings.truncate | public static function truncate($str, $maxlength=20)
{
if(strlen($str) > $maxlength){
$str = substr($str, 0, $maxlength-3).'...';
}
return $str;
} | php | public static function truncate($str, $maxlength=20)
{
if(strlen($str) > $maxlength){
$str = substr($str, 0, $maxlength-3).'...';
}
return $str;
} | [
"public",
"static",
"function",
"truncate",
"(",
"$",
"str",
",",
"$",
"maxlength",
"=",
"20",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"str",
")",
">",
"$",
"maxlength",
")",
"{",
"$",
"str",
"=",
"substr",
"(",
"$",
"str",
",",
"0",
",",
"$",... | Truncates a string to a certain length and right padswith ...
@param string $str
@param integer $maxlength The maximum length, keep in mind that the ... counts as three chars
@return string | [
"Truncates",
"a",
"string",
"to",
"a",
"certain",
"length",
"and",
"right",
"padswith",
"..."
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Strings.php#L142-L150 |
23,652 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Command/Manual/ToLatexCommand.php | ToLatexCommand.getConverter | protected function getConverter(InputInterface $input)
{
/** @var ToLatexInterface $converter */
$converter = parent::getConverter($input);
$this->configureConverterFromInputOptions($converter, $input);
return $converter;
} | php | protected function getConverter(InputInterface $input)
{
/** @var ToLatexInterface $converter */
$converter = parent::getConverter($input);
$this->configureConverterFromInputOptions($converter, $input);
return $converter;
} | [
"protected",
"function",
"getConverter",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"/** @var ToLatexInterface $converter */",
"$",
"converter",
"=",
"parent",
"::",
"getConverter",
"(",
"$",
"input",
")",
";",
"$",
"this",
"->",
"configureConverterFromInputOptio... | Returns and configures the converter for this operation.
This method overrides the parent getConverter method and invokes the
configureConverterFromInputOptions() method to set the options coming
from the Input object.
@param InputInterface $input
@see BaseConvertCommand::getConverter() for the basic functionality.
... | [
"Returns",
"and",
"configures",
"the",
"converter",
"for",
"this",
"operation",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Command/Manual/ToLatexCommand.php#L78-L85 |
23,653 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/interfaces/part.php | ezcMailPart.generateHeaders | public function generateHeaders()
{
// set content disposition header
if ( $this->contentDisposition !== null &&
( $this->contentDisposition instanceof ezcMailContentDispositionHeader ) )
{
$cdHeader = $this->contentDisposition;
$cd = "{$cdHeader->disposit... | php | public function generateHeaders()
{
// set content disposition header
if ( $this->contentDisposition !== null &&
( $this->contentDisposition instanceof ezcMailContentDispositionHeader ) )
{
$cdHeader = $this->contentDisposition;
$cd = "{$cdHeader->disposit... | [
"public",
"function",
"generateHeaders",
"(",
")",
"{",
"// set content disposition header",
"if",
"(",
"$",
"this",
"->",
"contentDisposition",
"!==",
"null",
"&&",
"(",
"$",
"this",
"->",
"contentDisposition",
"instanceof",
"ezcMailContentDispositionHeader",
")",
")... | Returns the headers set for this part as a RFC 822 string.
Each header is separated by a line break.
This method does not add the required two lines of space
to separate the headers from the body of the part.
It also encodes the headers (with the 'Q' encoding) if the charset
associated with the header is different th... | [
"Returns",
"the",
"headers",
"set",
"for",
"this",
"part",
"as",
"a",
"RFC",
"822",
"string",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/interfaces/part.php#L278-L397 |
23,654 | interactivesolutions/honeycomb-core | src/commands/HCCommand.php | HCCommand.deleteDirectory | public function deleteDirectory(string $path, bool $withFiles = false)
{
if( $path == '*' )
$this->abort('Can not delete "*", please specify folder or file.');
$files = glob($path . '/*');
foreach ( $files as $file ) {
if( is_file($file) && ! $withFiles ) return;
... | php | public function deleteDirectory(string $path, bool $withFiles = false)
{
if( $path == '*' )
$this->abort('Can not delete "*", please specify folder or file.');
$files = glob($path . '/*');
foreach ( $files as $file ) {
if( is_file($file) && ! $withFiles ) return;
... | [
"public",
"function",
"deleteDirectory",
"(",
"string",
"$",
"path",
",",
"bool",
"$",
"withFiles",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"path",
"==",
"'*'",
")",
"$",
"this",
"->",
"abort",
"(",
"'Can not delete \"*\", please specify folder or file.'",
")"... | Deleting existing folder
@param string $path
@param bool $withFiles | [
"Deleting",
"existing",
"folder"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/commands/HCCommand.php#L47-L65 |
23,655 | interactivesolutions/honeycomb-core | src/commands/HCCommand.php | HCCommand.getToReplace | public function getToReplace(array $ignoreSymbols): array
{
if( empty($ignoreSymbols) )
return $this->toReplace;
return array_diff($this->toReplace, $ignoreSymbols);
} | php | public function getToReplace(array $ignoreSymbols): array
{
if( empty($ignoreSymbols) )
return $this->toReplace;
return array_diff($this->toReplace, $ignoreSymbols);
} | [
"public",
"function",
"getToReplace",
"(",
"array",
"$",
"ignoreSymbols",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"ignoreSymbols",
")",
")",
"return",
"$",
"this",
"->",
"toReplace",
";",
"return",
"array_diff",
"(",
"$",
"this",
"->",
"toR... | Get replaceable symbols
@param array $ignoreSymbols
@return array | [
"Get",
"replaceable",
"symbols"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/commands/HCCommand.php#L113-L119 |
23,656 | interactivesolutions/honeycomb-core | src/commands/HCCommand.php | HCCommand.stringWithUnderscore | protected function stringWithUnderscore(string $string, array $ignoreToReplace = [])
{
return str_replace($this->getToReplace($ignoreToReplace), '_', trim($string, '/'));
} | php | protected function stringWithUnderscore(string $string, array $ignoreToReplace = [])
{
return str_replace($this->getToReplace($ignoreToReplace), '_', trim($string, '/'));
} | [
"protected",
"function",
"stringWithUnderscore",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"ignoreToReplace",
"=",
"[",
"]",
")",
"{",
"return",
"str_replace",
"(",
"$",
"this",
"->",
"getToReplace",
"(",
"$",
"ignoreToReplace",
")",
",",
"'_'",
",",
... | Get string in underscore
@param string $string
@param array $ignoreToReplace
@return mixed | [
"Get",
"string",
"in",
"underscore"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/commands/HCCommand.php#L151-L154 |
23,657 | interactivesolutions/honeycomb-core | src/commands/HCCommand.php | HCCommand.stringWithDash | protected function stringWithDash(string $string, array $ignoreToReplace = [])
{
return str_replace($this->getToReplace($ignoreToReplace), '-', trim($string, '/'));
} | php | protected function stringWithDash(string $string, array $ignoreToReplace = [])
{
return str_replace($this->getToReplace($ignoreToReplace), '-', trim($string, '/'));
} | [
"protected",
"function",
"stringWithDash",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"ignoreToReplace",
"=",
"[",
"]",
")",
"{",
"return",
"str_replace",
"(",
"$",
"this",
"->",
"getToReplace",
"(",
"$",
"ignoreToReplace",
")",
",",
"'-'",
",",
"tri... | Get string in dash
@param string $string
@param array $ignoreToReplace
@return mixed | [
"Get",
"string",
"in",
"dash"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/commands/HCCommand.php#L163-L166 |
23,658 | interactivesolutions/honeycomb-core | src/commands/HCCommand.php | HCCommand.stringOnly | protected function stringOnly(string $string, array $ignoreToReplace = [])
{
return str_replace($this->getToReplace($ignoreToReplace), '', trim($string, '/'));
} | php | protected function stringOnly(string $string, array $ignoreToReplace = [])
{
return str_replace($this->getToReplace($ignoreToReplace), '', trim($string, '/'));
} | [
"protected",
"function",
"stringOnly",
"(",
"string",
"$",
"string",
",",
"array",
"$",
"ignoreToReplace",
"=",
"[",
"]",
")",
"{",
"return",
"str_replace",
"(",
"$",
"this",
"->",
"getToReplace",
"(",
"$",
"ignoreToReplace",
")",
",",
"''",
",",
"trim",
... | Remove all items from string
@param string $string
@param array $ignoreToReplace
@return mixed | [
"Remove",
"all",
"items",
"from",
"string"
] | 06b8d88bb285e73a1a286e60411ca5f41863f39f | https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/commands/HCCommand.php#L175-L178 |
23,659 | heidelpay/PhpDoc | features/bootstrap/FeatureContext.php | FeatureContext.iShouldGetALogEntry | public function iShouldGetALogEntry($string)
{
$found = false;
foreach (explode("\n", $this->getOutput()) as $line) {
if (trim($line) == $string) {
$found = true;
}
}
if (!$found) {
throw new \Exception(
"Actual out... | php | public function iShouldGetALogEntry($string)
{
$found = false;
foreach (explode("\n", $this->getOutput()) as $line) {
if (trim($line) == $string) {
$found = true;
}
}
if (!$found) {
throw new \Exception(
"Actual out... | [
"public",
"function",
"iShouldGetALogEntry",
"(",
"$",
"string",
")",
"{",
"$",
"found",
"=",
"false",
";",
"foreach",
"(",
"explode",
"(",
"\"\\n\"",
",",
"$",
"this",
"->",
"getOutput",
"(",
")",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"trim",... | Verifies whether one of the log entries is the same as the given.
Please note that this method exactly checks the given except for leading
and trailing spaces and control characters; those are stripped first.
@param string $string
@Then /^I should get a log entry "([^"]*)"$/
@throws \Exception if the condition is n... | [
"Verifies",
"whether",
"one",
"of",
"the",
"log",
"entries",
"is",
"the",
"same",
"as",
"the",
"given",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/features/bootstrap/FeatureContext.php#L84-L98 |
23,660 | heidelpay/PhpDoc | features/bootstrap/FeatureContext.php | FeatureContext.iShouldGetALogEntryContaining | public function iShouldGetALogEntryContaining($string)
{
$found = false;
foreach (explode("\n", $this->getOutput()) as $line) {
if (strpos(trim($line), $string) !== false) {
$found = true;
}
}
if (!$found) {
throw new \Exception(
... | php | public function iShouldGetALogEntryContaining($string)
{
$found = false;
foreach (explode("\n", $this->getOutput()) as $line) {
if (strpos(trim($line), $string) !== false) {
$found = true;
}
}
if (!$found) {
throw new \Exception(
... | [
"public",
"function",
"iShouldGetALogEntryContaining",
"(",
"$",
"string",
")",
"{",
"$",
"found",
"=",
"false",
";",
"foreach",
"(",
"explode",
"(",
"\"\\n\"",
",",
"$",
"this",
"->",
"getOutput",
"(",
")",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",... | Verifies whether a log entry contains the given substring.
@param string $string
@Then /^I should get a log entry containing "([^"]*)"$/
@throws \Exception if the condition is not fulfilled
@return void | [
"Verifies",
"whether",
"a",
"log",
"entry",
"contains",
"the",
"given",
"substring",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/features/bootstrap/FeatureContext.php#L138-L152 |
23,661 | heidelpay/PhpDoc | features/bootstrap/FeatureContext.php | FeatureContext.iRunPhpDocumentorAgainstTheFile | public function iRunPhpDocumentorAgainstTheFile($file_path)
{
$tmp = self::getTmpFolder();
$fullPath = __DIR__ . '/../../' . $file_path;
$this->iRunPhpdoc("-f $fullPath -t $tmp --config='{$this->getTempXmlConfigurationPath()}' --force");
} | php | public function iRunPhpDocumentorAgainstTheFile($file_path)
{
$tmp = self::getTmpFolder();
$fullPath = __DIR__ . '/../../' . $file_path;
$this->iRunPhpdoc("-f $fullPath -t $tmp --config='{$this->getTempXmlConfigurationPath()}' --force");
} | [
"public",
"function",
"iRunPhpDocumentorAgainstTheFile",
"(",
"$",
"file_path",
")",
"{",
"$",
"tmp",
"=",
"self",
"::",
"getTmpFolder",
"(",
")",
";",
"$",
"fullPath",
"=",
"__DIR__",
".",
"'/../../'",
".",
"$",
"file_path",
";",
"$",
"this",
"->",
"iRunP... | Runs phpDocumentor with only the file that is provided in this command.
The configuration is explicitly disabled to prevent tainting via
the configuration.
@param string $file_path
@When /^I run phpDocumentor against the file "([^"]*)"$/
@return void | [
"Runs",
"phpDocumentor",
"with",
"only",
"the",
"file",
"that",
"is",
"provided",
"in",
"this",
"command",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/features/bootstrap/FeatureContext.php#L276-L281 |
23,662 | heidelpay/PhpDoc | features/bootstrap/FeatureContext.php | FeatureContext.iRunPhpDocumentorWith | public function iRunPhpDocumentorWith(PyStringNode $code, $extraParameters = '')
{
$tmp = self::getTmpFolder();
$file = tempnam($tmp, 'pdb');
file_put_contents($file, $code);
$this->iRunPhpdoc("-f $file -t $tmp --config='{$this->getTempXmlConfigurationPath()}' --force $extraParameter... | php | public function iRunPhpDocumentorWith(PyStringNode $code, $extraParameters = '')
{
$tmp = self::getTmpFolder();
$file = tempnam($tmp, 'pdb');
file_put_contents($file, $code);
$this->iRunPhpdoc("-f $file -t $tmp --config='{$this->getTempXmlConfigurationPath()}' --force $extraParameter... | [
"public",
"function",
"iRunPhpDocumentorWith",
"(",
"PyStringNode",
"$",
"code",
",",
"$",
"extraParameters",
"=",
"''",
")",
"{",
"$",
"tmp",
"=",
"self",
"::",
"getTmpFolder",
"(",
")",
";",
"$",
"file",
"=",
"tempnam",
"(",
"$",
"tmp",
",",
"'pdb'",
... | Parses the given PHP code with phpDocumentor.
@param PyStringNode $code
@When /^I run phpDocumentor with:$/
@return void | [
"Parses",
"the",
"given",
"PHP",
"code",
"with",
"phpDocumentor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/features/bootstrap/FeatureContext.php#L292-L299 |
23,663 | heidelpay/PhpDoc | features/bootstrap/FeatureContext.php | FeatureContext.iShouldGet | public function iShouldGet(PyStringNode $string)
{
if ($this->getOutput() != trim($string->getRaw())) {
throw new \Exception(
"Actual output is:\n" . $this->getOutput()
);
}
} | php | public function iShouldGet(PyStringNode $string)
{
if ($this->getOutput() != trim($string->getRaw())) {
throw new \Exception(
"Actual output is:\n" . $this->getOutput()
);
}
} | [
"public",
"function",
"iShouldGet",
"(",
"PyStringNode",
"$",
"string",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getOutput",
"(",
")",
"!=",
"trim",
"(",
"$",
"string",
"->",
"getRaw",
"(",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
... | Verifies whether the output of an iRun When is equal to the given.
@param PyStringNode $string
@Then /^I should get:$/
@throws \Exception if the condition is not fulfilled
@return void | [
"Verifies",
"whether",
"the",
"output",
"of",
"an",
"iRun",
"When",
"is",
"equal",
"to",
"the",
"given",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/features/bootstrap/FeatureContext.php#L355-L362 |
23,664 | heidelpay/PhpDoc | features/bootstrap/FeatureContext.php | FeatureContext.theExitCodeShouldBeZero | public function theExitCodeShouldBeZero()
{
if ($this->getReturnCode() != 0) {
throw new \Exception(
'Return code was ' . $this->getReturnCode() . ' with output '
.$this->getOutput() . $this->process->getOutput()
);
}
} | php | public function theExitCodeShouldBeZero()
{
if ($this->getReturnCode() != 0) {
throw new \Exception(
'Return code was ' . $this->getReturnCode() . ' with output '
.$this->getOutput() . $this->process->getOutput()
);
}
} | [
"public",
"function",
"theExitCodeShouldBeZero",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getReturnCode",
"(",
")",
"!=",
"0",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Return code was '",
".",
"$",
"this",
"->",
"getReturnCode",
"(",
")",
... | Verifies whether the return code was 0 and thus execution was a success.
@Then /^the exit code should be zero$/
@throws \Exception if the condition is not fulfilled
@return void | [
"Verifies",
"whether",
"the",
"return",
"code",
"was",
"0",
"and",
"thus",
"execution",
"was",
"a",
"success",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/features/bootstrap/FeatureContext.php#L373-L381 |
23,665 | hametuha/wpametu | src/WPametu/UI/Field/TokenInputPost.php | TokenInputPost.get_required | protected function get_required( \WP_Post $post = null){
if( current_user_can('edit_posts') ){
$url = admin_url('post-new.php?post_type='.$this->post_type);
$post_type_obj = get_post_type_object($this->post_type);
$tip = esc_html(sprintf($this->__('Add new %s'), $post_type_ob... | php | protected function get_required( \WP_Post $post = null){
if( current_user_can('edit_posts') ){
$url = admin_url('post-new.php?post_type='.$this->post_type);
$post_type_obj = get_post_type_object($this->post_type);
$tip = esc_html(sprintf($this->__('Add new %s'), $post_type_ob... | [
"protected",
"function",
"get_required",
"(",
"\\",
"WP_Post",
"$",
"post",
"=",
"null",
")",
"{",
"if",
"(",
"current_user_can",
"(",
"'edit_posts'",
")",
")",
"{",
"$",
"url",
"=",
"admin_url",
"(",
"'post-new.php?post_type='",
".",
"$",
"this",
"->",
"p... | Add button before requried
@param \WP_Post $post
@return string | [
"Add",
"button",
"before",
"requried"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/TokenInputPost.php#L89-L102 |
23,666 | hametuha/wpametu | src/WPametu/UI/Field/TokenInputPost.php | TokenInputPost.get_prepopulates | protected function get_prepopulates($data){
$json = [];
foreach( $data as $post ){
$json[] = [
'id' => $post->ID,
'name' => $post->post_title,
];
}
return $json;
} | php | protected function get_prepopulates($data){
$json = [];
foreach( $data as $post ){
$json[] = [
'id' => $post->ID,
'name' => $post->post_title,
];
}
return $json;
} | [
"protected",
"function",
"get_prepopulates",
"(",
"$",
"data",
")",
"{",
"$",
"json",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"post",
")",
"{",
"$",
"json",
"[",
"]",
"=",
"[",
"'id'",
"=>",
"$",
"post",
"->",
"ID",
",",
"'n... | Get prepopulated data
@param array $data
@return array | [
"Get",
"prepopulated",
"data"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/TokenInputPost.php#L110-L119 |
23,667 | eghojansu/moe | src/tools/Web.php | Web.mime | function mime($file) {
if (preg_match('/\w+$/',$file,$ext)) {
$map=array(
'au'=>'audio/basic',
'avi'=>'video/avi',
'bmp'=>'image/bmp',
'bz2'=>'application/x-bzip2',
'css'=>'text/css',
'dtd'=>'application/xml-dtd',
'doc'=>'application/msword',
'gif'=>'image/gif',
'gz'=>'applicati... | php | function mime($file) {
if (preg_match('/\w+$/',$file,$ext)) {
$map=array(
'au'=>'audio/basic',
'avi'=>'video/avi',
'bmp'=>'image/bmp',
'bz2'=>'application/x-bzip2',
'css'=>'text/css',
'dtd'=>'application/xml-dtd',
'doc'=>'application/msword',
'gif'=>'image/gif',
'gz'=>'applicati... | [
"function",
"mime",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/\\w+$/'",
",",
"$",
"file",
",",
"$",
"ext",
")",
")",
"{",
"$",
"map",
"=",
"array",
"(",
"'au'",
"=>",
"'audio/basic'",
",",
"'avi'",
"=>",
"'video/avi'",
",",
"'bmp... | Detect MIME type using file extension
@return string
@param $file string | [
"Detect",
"MIME",
"type",
"using",
"file",
"extension"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/tools/Web.php#L26-L72 |
23,668 | bariew/yii2-i18n-cms-module | controllers/MessageController.php | MessageController.actionIndex | public function actionIndex()
{
$searchModel = new MessageSearch;
$dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
return $this->render('index', compact('dataProvider', 'searchModel'));
} | php | public function actionIndex()
{
$searchModel = new MessageSearch;
$dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
return $this->render('index', compact('dataProvider', 'searchModel'));
} | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"searchModel",
"=",
"new",
"MessageSearch",
";",
"$",
"dataProvider",
"=",
"$",
"searchModel",
"->",
"search",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"getQueryParams",
"(",
")",
")",
... | Lists all Message models.
@return mixed | [
"Lists",
"all",
"Message",
"models",
"."
] | 18d2394565cdd8b5070a287a739c9007705ef18a | https://github.com/bariew/yii2-i18n-cms-module/blob/18d2394565cdd8b5070a287a739c9007705ef18a/controllers/MessageController.php#L29-L34 |
23,669 | bariew/yii2-i18n-cms-module | controllers/MessageController.php | MessageController.actionFastUpdate | public function actionFastUpdate($id)
{
Message::updateAll(
['translation' => Yii::$app->request->post('translation')],
['id' => $id, 'language' => Yii::$app->request->post('language')]
);
} | php | public function actionFastUpdate($id)
{
Message::updateAll(
['translation' => Yii::$app->request->post('translation')],
['id' => $id, 'language' => Yii::$app->request->post('language')]
);
} | [
"public",
"function",
"actionFastUpdate",
"(",
"$",
"id",
")",
"{",
"Message",
"::",
"updateAll",
"(",
"[",
"'translation'",
"=>",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
"'translation'",
")",
"]",
",",
"[",
"'id'",
"=>",
"$",
"id"... | Fast translation update.
@param int $id
@return string | [
"Fast",
"translation",
"update",
"."
] | 18d2394565cdd8b5070a287a739c9007705ef18a | https://github.com/bariew/yii2-i18n-cms-module/blob/18d2394565cdd8b5070a287a739c9007705ef18a/controllers/MessageController.php#L42-L48 |
23,670 | thienhungho/yii2-product-management | src/modules/ProductManageForCustomer/controllers/ProductController.php | ProductController.findModel | protected function findModel($id)
{
if (($model = Product::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
} | php | protected function findModel($id)
{
if (($model = Product::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
}
} | [
"protected",
"function",
"findModel",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"(",
"$",
"model",
"=",
"Product",
"::",
"findOne",
"(",
"$",
"id",
")",
")",
"!==",
"null",
")",
"{",
"return",
"$",
"model",
";",
"}",
"else",
"{",
"throw",
"new",
"NotF... | Finds the Product model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@return Product the loaded model
@throws NotFoundHttpException if the model cannot be found | [
"Finds",
"the",
"Product",
"model",
"based",
"on",
"its",
"primary",
"key",
"value",
".",
"If",
"the",
"model",
"is",
"not",
"found",
"a",
"404",
"HTTP",
"exception",
"will",
"be",
"thrown",
"."
] | 72e1237bba123faf671e44491bd93077b50adde9 | https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManageForCustomer/controllers/ProductController.php#L155-L162 |
23,671 | mothership-ec/composer | src/Composer/Repository/Pear/BaseChannelReader.php | BaseChannelReader.requestXml | protected function requestXml($origin, $path)
{
// http://components.ez.no/p/packages.xml is malformed. to read it we must ignore parsing errors.
$xml = simplexml_load_string($this->requestContent($origin, $path), "SimpleXMLElement", LIBXML_NOERROR);
if (false == $xml) {
$url = ... | php | protected function requestXml($origin, $path)
{
// http://components.ez.no/p/packages.xml is malformed. to read it we must ignore parsing errors.
$xml = simplexml_load_string($this->requestContent($origin, $path), "SimpleXMLElement", LIBXML_NOERROR);
if (false == $xml) {
$url = ... | [
"protected",
"function",
"requestXml",
"(",
"$",
"origin",
",",
"$",
"path",
")",
"{",
"// http://components.ez.no/p/packages.xml is malformed. to read it we must ignore parsing errors.",
"$",
"xml",
"=",
"simplexml_load_string",
"(",
"$",
"this",
"->",
"requestContent",
"(... | Read xml content from remote filesystem
@param $origin string server
@param $path string relative path to content
@throws \UnexpectedValueException
@return \SimpleXMLElement | [
"Read",
"xml",
"content",
"from",
"remote",
"filesystem"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/Pear/BaseChannelReader.php#L71-L82 |
23,672 | ezsystems/ezcomments-ls-extension | classes/ezcomformtool.php | ezcomFormTool.checkVars | public function checkVars()
{
$http = eZHTTPTool::instance();
$user = eZUser::currentUser();
$isAnon = $user->isAnonymous();
$status = true;
foreach ( $this->fields as $field => $fieldSetup )
{
$fieldPostName = $fieldSetup[self::VARNAME];
$t... | php | public function checkVars()
{
$http = eZHTTPTool::instance();
$user = eZUser::currentUser();
$isAnon = $user->isAnonymous();
$status = true;
foreach ( $this->fields as $field => $fieldSetup )
{
$fieldPostName = $fieldSetup[self::VARNAME];
$t... | [
"public",
"function",
"checkVars",
"(",
")",
"{",
"$",
"http",
"=",
"eZHTTPTool",
"::",
"instance",
"(",
")",
";",
"$",
"user",
"=",
"eZUser",
"::",
"currentUser",
"(",
")",
";",
"$",
"isAnon",
"=",
"$",
"user",
"->",
"isAnonymous",
"(",
")",
";",
... | check variable from client | [
"check",
"variable",
"from",
"client"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomformtool.php#L73-L130 |
23,673 | ezsystems/ezcomments-ls-extension | classes/ezcomformtool.php | ezcomFormTool.fillObject | public function fillObject( $comment, $fieldNames = null )
{
$filledFields = $this->fields;
if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
{
$filledFields = array();
foreach ( $fieldNames as $fieldName )
{
$filledFields[$fieldNam... | php | public function fillObject( $comment, $fieldNames = null )
{
$filledFields = $this->fields;
if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
{
$filledFields = array();
foreach ( $fieldNames as $fieldName )
{
$filledFields[$fieldNam... | [
"public",
"function",
"fillObject",
"(",
"$",
"comment",
",",
"$",
"fieldNames",
"=",
"null",
")",
"{",
"$",
"filledFields",
"=",
"$",
"this",
"->",
"fields",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"fieldNames",
")",
"&&",
"is_array",
"(",
"$",
"f... | Fill field to comment object
@param $comment ezcomcomment persistent object
@param $fieldNames field name array selected to be filled into comment
@return | [
"Fill",
"field",
"to",
"comment",
"object"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomformtool.php#L138-L158 |
23,674 | martin-helmich/flow-eventbroker | Classes/Helmich/EventBroker/Broker/EventMapping.php | EventMapping.addListenerForEvent | public function addListenerForEvent($eventClassName, $listener)
{
if (FALSE === array_key_exists($eventClassName, $this->eventMap))
{
$this->eventMap[$eventClassName] = [];
}
$this->eventMap[$eventClassName][] = $listener;
} | php | public function addListenerForEvent($eventClassName, $listener)
{
if (FALSE === array_key_exists($eventClassName, $this->eventMap))
{
$this->eventMap[$eventClassName] = [];
}
$this->eventMap[$eventClassName][] = $listener;
} | [
"public",
"function",
"addListenerForEvent",
"(",
"$",
"eventClassName",
",",
"$",
"listener",
")",
"{",
"if",
"(",
"FALSE",
"===",
"array_key_exists",
"(",
"$",
"eventClassName",
",",
"$",
"this",
"->",
"eventMap",
")",
")",
"{",
"$",
"this",
"->",
"event... | Adds a new listener for an event.
@param string $eventClassName The event class name.
@param callable $listener Any kind of callable.
@return void | [
"Adds",
"a",
"new",
"listener",
"for",
"an",
"event",
"."
] | a08dc966cfddbee4f8ea75d1c682320ac196352d | https://github.com/martin-helmich/flow-eventbroker/blob/a08dc966cfddbee4f8ea75d1c682320ac196352d/Classes/Helmich/EventBroker/Broker/EventMapping.php#L46-L53 |
23,675 | martin-helmich/flow-eventbroker | Classes/Helmich/EventBroker/Broker/EventMapping.php | EventMapping.getListenersForEvent | public function getListenersForEvent($eventClassName)
{
if (FALSE === array_key_exists($eventClassName, $this->eventMap))
{
return [];
}
return $this->eventMap[$eventClassName];
} | php | public function getListenersForEvent($eventClassName)
{
if (FALSE === array_key_exists($eventClassName, $this->eventMap))
{
return [];
}
return $this->eventMap[$eventClassName];
} | [
"public",
"function",
"getListenersForEvent",
"(",
"$",
"eventClassName",
")",
"{",
"if",
"(",
"FALSE",
"===",
"array_key_exists",
"(",
"$",
"eventClassName",
",",
"$",
"this",
"->",
"eventMap",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"$",
... | Gets all listeners for an event.
@param string $eventClassName The event class name.
@return array An array of callables. | [
"Gets",
"all",
"listeners",
"for",
"an",
"event",
"."
] | a08dc966cfddbee4f8ea75d1c682320ac196352d | https://github.com/martin-helmich/flow-eventbroker/blob/a08dc966cfddbee4f8ea75d1c682320ac196352d/Classes/Helmich/EventBroker/Broker/EventMapping.php#L63-L70 |
23,676 | jasny/controller | src/Controller/View.php | View.view | public function view($name, array $context = [])
{
$context += ['current_url' => $this->getRequest()->getUri()];
if (method_exists($this, 'flash')) {
$context += ['flash' => $this->flash()];
}
$response = $this->getViewer()->render($this->getResponse(), ... | php | public function view($name, array $context = [])
{
$context += ['current_url' => $this->getRequest()->getUri()];
if (method_exists($this, 'flash')) {
$context += ['flash' => $this->flash()];
}
$response = $this->getViewer()->render($this->getResponse(), ... | [
"public",
"function",
"view",
"(",
"$",
"name",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"context",
"+=",
"[",
"'current_url'",
"=>",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getUri",
"(",
")",
"]",
";",
"if",
"(",
"me... | View rendered template
@param string $name Template name
@param array $context Template context | [
"View",
"rendered",
"template"
] | 28edf64343f1d8218c166c0c570128e1ee6153d8 | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/View.php#L83-L94 |
23,677 | romainbessugesmeusy/php-datagrid | library/RBM/Datagrid/Data/Processor/ResultRow.php | ResultRow.getCellDataForColumnName | public function getCellDataForColumnName($columnName)
{
return Extractor::extract(
$this->_data,
$this->_dataGrid->getColumn($columnName)->getCellAccessor()
);
} | php | public function getCellDataForColumnName($columnName)
{
return Extractor::extract(
$this->_data,
$this->_dataGrid->getColumn($columnName)->getCellAccessor()
);
} | [
"public",
"function",
"getCellDataForColumnName",
"(",
"$",
"columnName",
")",
"{",
"return",
"Extractor",
"::",
"extract",
"(",
"$",
"this",
"->",
"_data",
",",
"$",
"this",
"->",
"_dataGrid",
"->",
"getColumn",
"(",
"$",
"columnName",
")",
"->",
"getCellAc... | Get the cell accessor from the DataGridColumn and extract the data from the row
@param $columnName
@return mixed | [
"Get",
"the",
"cell",
"accessor",
"from",
"the",
"DataGridColumn",
"and",
"extract",
"the",
"data",
"from",
"the",
"row"
] | 18f7ae15845fcf61520bbfc946771242bf1091c9 | https://github.com/romainbessugesmeusy/php-datagrid/blob/18f7ae15845fcf61520bbfc946771242bf1091c9/library/RBM/Datagrid/Data/Processor/ResultRow.php#L71-L77 |
23,678 | dotkernel/dot-rbac | src/Role/RoleService.php | RoleService.matchIdentityRoles | public function matchIdentityRoles(array $roles): bool
{
$identityRoles = $this->getIdentityRoles();
// Too easy...
if (empty($identityRoles)) {
return false;
}
$roleNames = [];
foreach ($roles as $role) {
$roleNames[] = $role instanceof RoleIn... | php | public function matchIdentityRoles(array $roles): bool
{
$identityRoles = $this->getIdentityRoles();
// Too easy...
if (empty($identityRoles)) {
return false;
}
$roleNames = [];
foreach ($roles as $role) {
$roleNames[] = $role instanceof RoleIn... | [
"public",
"function",
"matchIdentityRoles",
"(",
"array",
"$",
"roles",
")",
":",
"bool",
"{",
"$",
"identityRoles",
"=",
"$",
"this",
"->",
"getIdentityRoles",
"(",
")",
";",
"// Too easy...",
"if",
"(",
"empty",
"(",
"$",
"identityRoles",
")",
")",
"{",
... | Check if the given roles match one of the identity roles
This method is smart enough to automatically recursively extracts roles for hierarchical roles
@param string[]|RoleInterface[] $roles
@return bool | [
"Check",
"if",
"the",
"given",
"roles",
"match",
"one",
"of",
"the",
"identity",
"roles"
] | 747ffadf3cf28750bb7cf81be60eb4c93b830446 | https://github.com/dotkernel/dot-rbac/blob/747ffadf3cf28750bb7cf81be60eb4c93b830446/src/Role/RoleService.php#L92-L110 |
23,679 | nabab/bbn | src/bbn/appui/project.php | project.get_root_path | public function get_root_path($repository){
if ( \is_string($repository) ){
$repository = $this->repository($repository);
}
if ( !empty($repository) && !empty($repository['bbn_path']) ){
$repository_path = !empty($repository['path']) ? '/' . $repository['path'] : '';
$path = self::decipher... | php | public function get_root_path($repository){
if ( \is_string($repository) ){
$repository = $this->repository($repository);
}
if ( !empty($repository) && !empty($repository['bbn_path']) ){
$repository_path = !empty($repository['path']) ? '/' . $repository['path'] : '';
$path = self::decipher... | [
"public",
"function",
"get_root_path",
"(",
"$",
"repository",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"repository",
")",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"repository",
"(",
"$",
"repository",
")",
";",
"}",
"if",
"(",
"... | Gets the real root path from a repository's id as recorded in the options.
@param string|array $repository The repository's name (code) or the repository's configuration
@return bool|string | [
"Gets",
"the",
"real",
"root",
"path",
"from",
"a",
"repository",
"s",
"id",
"as",
"recorded",
"in",
"the",
"options",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L226-L236 |
23,680 | nabab/bbn | src/bbn/appui/project.php | project.repositories | public function repositories(string $code=''){
$all = $this->options->full_soptions($this->options->from_code('PATHS', 'ide', 'appui'));
$cats = [];
$r = [];
foreach ( $all as $a ){
if ( \defined($a['bbn_path']) ){
$k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']);
... | php | public function repositories(string $code=''){
$all = $this->options->full_soptions($this->options->from_code('PATHS', 'ide', 'appui'));
$cats = [];
$r = [];
foreach ( $all as $a ){
if ( \defined($a['bbn_path']) ){
$k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']);
... | [
"public",
"function",
"repositories",
"(",
"string",
"$",
"code",
"=",
"''",
")",
"{",
"$",
"all",
"=",
"$",
"this",
"->",
"options",
"->",
"full_soptions",
"(",
"$",
"this",
"->",
"options",
"->",
"from_code",
"(",
"'PATHS'",
",",
"'ide'",
",",
"'appu... | Makes the repositories' configurations.
@param string $code The repository's name (code)
@return array|bool | [
"Makes",
"the",
"repositories",
"configurations",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L254-L283 |
23,681 | nabab/bbn | src/bbn/appui/project.php | project.repository_from_url | public function repository_from_url(string $url, bool $obj = false){
$repository = '';
$repositories = $this->repositories();
foreach ( $repositories as $i => $d ){
if ( (strpos($url, $i) === 0) &&
(\strlen($i) > \strlen($repository) )
){
$repository = $i;
}
}
if (... | php | public function repository_from_url(string $url, bool $obj = false){
$repository = '';
$repositories = $this->repositories();
foreach ( $repositories as $i => $d ){
if ( (strpos($url, $i) === 0) &&
(\strlen($i) > \strlen($repository) )
){
$repository = $i;
}
}
if (... | [
"public",
"function",
"repository_from_url",
"(",
"string",
"$",
"url",
",",
"bool",
"$",
"obj",
"=",
"false",
")",
"{",
"$",
"repository",
"=",
"''",
";",
"$",
"repositories",
"=",
"$",
"this",
"->",
"repositories",
"(",
")",
";",
"foreach",
"(",
"$",... | Returns the repository's name or object from an URL.
@param string $url
@param bool $obj
@return bool|int|string | [
"Returns",
"the",
"repository",
"s",
"name",
"or",
"object",
"from",
"an",
"URL",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L292-L307 |
23,682 | nabab/bbn | src/bbn/appui/project.php | project.real_to_url | public function real_to_url(string $file){
foreach ( $this->repositories() as $i => $d ){
if (
// Repository's root path
($root = $this->get_root_path($d)) &&
(strpos($file, $root) === 0)
){
$res = $i;
$bits = explode('/', substr($file, \strlen($root)));
// ... | php | public function real_to_url(string $file){
foreach ( $this->repositories() as $i => $d ){
if (
// Repository's root path
($root = $this->get_root_path($d)) &&
(strpos($file, $root) === 0)
){
$res = $i;
$bits = explode('/', substr($file, \strlen($root)));
// ... | [
"public",
"function",
"real_to_url",
"(",
"string",
"$",
"file",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"repositories",
"(",
")",
"as",
"$",
"i",
"=>",
"$",
"d",
")",
"{",
"if",
"(",
"// Repository's root path",
"(",
"$",
"root",
"=",
"$",
"thi... | Returns the file's URL from the real file's path.
@param string $file The real file's path
@return bool|string | [
"Returns",
"the",
"file",
"s",
"URL",
"from",
"the",
"real",
"file",
"s",
"path",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/project.php#L315-L352 |
23,683 | bfitech/zapstore | src/RedisConn.php | RedisConn.connection__predis | private function connection__predis() {
$args = [];
foreach (array_keys($this->verified_params) as $key) {
if ($key == 'redistype' || !$this->$key)
continue;
$args[substr($key, 5)] = $this->$key;
}
try {
$this->connection = new \Predis\Client($args);
$this->connection->ping();
return $this->c... | php | private function connection__predis() {
$args = [];
foreach (array_keys($this->verified_params) as $key) {
if ($key == 'redistype' || !$this->$key)
continue;
$args[substr($key, 5)] = $this->$key;
}
try {
$this->connection = new \Predis\Client($args);
$this->connection->ping();
return $this->c... | [
"private",
"function",
"connection__predis",
"(",
")",
"{",
"$",
"args",
"=",
"[",
"]",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"verified_params",
")",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"'redistype'",
"||",
"... | Open connection with predis. | [
"Open",
"connection",
"with",
"predis",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L111-L125 |
23,684 | bfitech/zapstore | src/RedisConn.php | RedisConn.connection__redis | private function connection__redis() {
$this->connection = new \Redis();
# @note: This emits warning on failure instead of throwing
# exception, hence the @ sign.
if (!@$this->connection->connect(
$this->redishost, $this->redisport,
$this->redistimeout
))
// @codeCoverageIgnoreStart
return $this->... | php | private function connection__redis() {
$this->connection = new \Redis();
# @note: This emits warning on failure instead of throwing
# exception, hence the @ sign.
if (!@$this->connection->connect(
$this->redishost, $this->redisport,
$this->redistimeout
))
// @codeCoverageIgnoreStart
return $this->... | [
"private",
"function",
"connection__redis",
"(",
")",
"{",
"$",
"this",
"->",
"connection",
"=",
"new",
"\\",
"Redis",
"(",
")",
";",
"# @note: This emits warning on failure instead of throwing",
"# exception, hence the @ sign.",
"if",
"(",
"!",
"@",
"$",
"this",
"-... | Open connection with ext-redis. | [
"Open",
"connection",
"with",
"ext",
"-",
"redis",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L130-L157 |
23,685 | bfitech/zapstore | src/RedisConn.php | RedisConn.connection_open_fail | private function connection_open_fail($msg='') {
$logline = sprintf('Redis: %s connection failed',
$this->redistype);
if ($msg)
$logline .= ': ' . $msg;
$logline .= ' <- ' . json_encode($this->verified_params);
self::$logger->error($logline);
throw new RedisError(RedisError::CONNECTION_ERROR,
$loglin... | php | private function connection_open_fail($msg='') {
$logline = sprintf('Redis: %s connection failed',
$this->redistype);
if ($msg)
$logline .= ': ' . $msg;
$logline .= ' <- ' . json_encode($this->verified_params);
self::$logger->error($logline);
throw new RedisError(RedisError::CONNECTION_ERROR,
$loglin... | [
"private",
"function",
"connection_open_fail",
"(",
"$",
"msg",
"=",
"''",
")",
"{",
"$",
"logline",
"=",
"sprintf",
"(",
"'Redis: %s connection failed'",
",",
"$",
"this",
"->",
"redistype",
")",
";",
"if",
"(",
"$",
"msg",
")",
"$",
"logline",
".=",
"'... | Throw exception on failing connection. | [
"Throw",
"exception",
"on",
"failing",
"connection",
"."
] | 0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0 | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/RedisConn.php#L162-L171 |
23,686 | ekuiter/feature-php | FeaturePhp/Helper/PhpParser.php | PhpParser.parseString | public function parseString($str) {
$parser = (new \PhpParser\ParserFactory())->create(\PhpParser\ParserFactory::PREFER_PHP7);
$this->ast = $parser->parse($str);
return $this;
} | php | public function parseString($str) {
$parser = (new \PhpParser\ParserFactory())->create(\PhpParser\ParserFactory::PREFER_PHP7);
$this->ast = $parser->parse($str);
return $this;
} | [
"public",
"function",
"parseString",
"(",
"$",
"str",
")",
"{",
"$",
"parser",
"=",
"(",
"new",
"\\",
"PhpParser",
"\\",
"ParserFactory",
"(",
")",
")",
"->",
"create",
"(",
"\\",
"PhpParser",
"\\",
"ParserFactory",
"::",
"PREFER_PHP7",
")",
";",
"$",
... | Parses a PHP string.
@param string $str
@return PhpParser | [
"Parses",
"a",
"PHP",
"string",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/PhpParser.php#L29-L33 |
23,687 | ekuiter/feature-php | FeaturePhp/Helper/PhpParser.php | PhpParser.getExactlyOneClass | public function getExactlyOneClass($fileSource) {
if (count($this->ast) !== 1 || $this->ast[0]->getType() !== "Stmt_Class")
throw new PhpParserException("\"$fileSource\" does not define exactly one class");
return $this->ast[0];
} | php | public function getExactlyOneClass($fileSource) {
if (count($this->ast) !== 1 || $this->ast[0]->getType() !== "Stmt_Class")
throw new PhpParserException("\"$fileSource\" does not define exactly one class");
return $this->ast[0];
} | [
"public",
"function",
"getExactlyOneClass",
"(",
"$",
"fileSource",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"ast",
")",
"!==",
"1",
"||",
"$",
"this",
"->",
"ast",
"[",
"0",
"]",
"->",
"getType",
"(",
")",
"!==",
"\"Stmt_Class\"",
")",
... | Asserts that the code defines one class and returns it.
@param string $fileSource
@return \PhpParser\Node\Stmt\Class_ | [
"Asserts",
"that",
"the",
"code",
"defines",
"one",
"class",
"and",
"returns",
"it",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/PhpParser.php#L60-L64 |
23,688 | clickalicious/caching-middleware | src/Cache.php | Cache.buildResponse | protected function buildResponse($html, ResponseInterface $response)
{
// @codeCoverageIgnoreStart
$body = new Stream('php://memory', 'w');
$body->write($html);
$response = $response->withBody($body);
return $response;
// @codeCoverageIgnoreEnd
} | php | protected function buildResponse($html, ResponseInterface $response)
{
// @codeCoverageIgnoreStart
$body = new Stream('php://memory', 'w');
$body->write($html);
$response = $response->withBody($body);
return $response;
// @codeCoverageIgnoreEnd
} | [
"protected",
"function",
"buildResponse",
"(",
"$",
"html",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"// @codeCoverageIgnoreStart",
"$",
"body",
"=",
"new",
"Stream",
"(",
"'php://memory'",
",",
"'w'",
")",
";",
"$",
"body",
"->",
"write",
"(",
"... | Builds response instance with HTML body from HTML passed in.
@param string $html HTML used for response body
@param \Psr\Http\Message\ResponseInterface $response Response used as base for response
@author Benjamin Carl <opensource@clickalicious.de>
@return \Psr\Http\Message\ResponseI... | [
"Builds",
"response",
"instance",
"with",
"HTML",
"body",
"from",
"HTML",
"passed",
"in",
"."
] | 86ce045ec19bf3bcb48c656ca27f7cdfa03746ed | https://github.com/clickalicious/caching-middleware/blob/86ce045ec19bf3bcb48c656ca27f7cdfa03746ed/src/Cache.php#L279-L288 |
23,689 | clickalicious/caching-middleware | src/Cache.php | Cache.cacheResponse | protected function cacheResponse(RequestInterface $request, ResponseInterface $response)
{
$cacheItem = $this->createCacheItem($this->createKeyFromRequest($request));
$value = $response->getBody()->__toString();
$cacheItem->set($value);
$this
->getCacheItemPool()
... | php | protected function cacheResponse(RequestInterface $request, ResponseInterface $response)
{
$cacheItem = $this->createCacheItem($this->createKeyFromRequest($request));
$value = $response->getBody()->__toString();
$cacheItem->set($value);
$this
->getCacheItemPool()
... | [
"protected",
"function",
"cacheResponse",
"(",
"RequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"cacheItem",
"=",
"$",
"this",
"->",
"createCacheItem",
"(",
"$",
"this",
"->",
"createKeyFromRequest",
"(",
"$",
"reques... | Caches a response by Request & Response.
@param RequestInterface $request Request as identifier
@param ResponseInterface $response Response to cache
@author Benjamin Carl <opensource@clickalicious.de> | [
"Caches",
"a",
"response",
"by",
"Request",
"&",
"Response",
"."
] | 86ce045ec19bf3bcb48c656ca27f7cdfa03746ed | https://github.com/clickalicious/caching-middleware/blob/86ce045ec19bf3bcb48c656ca27f7cdfa03746ed/src/Cache.php#L330-L339 |
23,690 | Eresus/EresusCMS | src/core/Feed/Writer/Item.php | Eresus_Feed_Writer_Item.addElementArray | public function addElementArray($elementArray)
{
if (!is_array($elementArray))
{
return;
}
foreach ($elementArray as $elementName => $content)
{
$this->addElement($elementName, $content);
}
} | php | public function addElementArray($elementArray)
{
if (!is_array($elementArray))
{
return;
}
foreach ($elementArray as $elementName => $content)
{
$this->addElement($elementName, $content);
}
} | [
"public",
"function",
"addElementArray",
"(",
"$",
"elementArray",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"elementArray",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"elementArray",
"as",
"$",
"elementName",
"=>",
"$",
"content",
")"... | Set multiple feed elements from an array.
Elements which have attributes cannot be added by this method
@param array array of elements in 'tagName' => 'tagContent' format.
@return void | [
"Set",
"multiple",
"feed",
"elements",
"from",
"an",
"array",
".",
"Elements",
"which",
"have",
"attributes",
"cannot",
"be",
"added",
"by",
"this",
"method"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L79-L89 |
23,691 | Eresus/EresusCMS | src/core/Feed/Writer/Item.php | Eresus_Feed_Writer_Item.setDate | public function setDate($date)
{
if (!is_numeric($date))
{
$date = strtotime($date);
}
if ($this->version == Eresus_Feed_Writer::ATOM)
{
$tag = 'updated';
$value = date(DATE_ATOM, $date);
}
elseif ($this->version == Eresus_... | php | public function setDate($date)
{
if (!is_numeric($date))
{
$date = strtotime($date);
}
if ($this->version == Eresus_Feed_Writer::ATOM)
{
$tag = 'updated';
$value = date(DATE_ATOM, $date);
}
elseif ($this->version == Eresus_... | [
"public",
"function",
"setDate",
"(",
"$",
"date",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"date",
")",
")",
"{",
"$",
"date",
"=",
"strtotime",
"(",
"$",
"date",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"version",
"==",
"Eresus_Fee... | Set the 'date' element of feed item
@param string $date The content of 'date' element
@return void | [
"Set",
"the",
"date",
"element",
"of",
"feed",
"item"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L130-L154 |
23,692 | Eresus/EresusCMS | src/core/Feed/Writer/Item.php | Eresus_Feed_Writer_Item.setEncloser | public function setEncloser($url, $length, $type)
{
$attributes = array('url' => $url, 'length' => $length, 'type' => $type);
$this->addElement('enclosure', '', $attributes);
} | php | public function setEncloser($url, $length, $type)
{
$attributes = array('url' => $url, 'length' => $length, 'type' => $type);
$this->addElement('enclosure', '', $attributes);
} | [
"public",
"function",
"setEncloser",
"(",
"$",
"url",
",",
"$",
"length",
",",
"$",
"type",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
"'url'",
"=>",
"$",
"url",
",",
"'length'",
"=>",
"$",
"length",
",",
"'type'",
"=>",
"$",
"type",
")",
";",... | Set the 'encloser' element of feed item
For RSS 2.0 only
@param string $url The url attribute of encloser tag
@param string $length The length attribute of encloser tag
@param string $type The type attribute of encloser tag
@return void | [
"Set",
"the",
"encloser",
"element",
"of",
"feed",
"item",
"For",
"RSS",
"2",
".",
"0",
"only"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Feed/Writer/Item.php#L185-L189 |
23,693 | ezsystems/ezcomments-ls-extension | classes/ezcomnotification.php | ezcomNotification.fetchNotificationList | static function fetchNotificationList( $status = 1, $length = null, $offset = 0, $sorts = null )
{
$cond = array();
if ( is_null( $status ) )
{
$cond = null;
}
else
{
$cond['status'] = $status;
}
$limit = array();
if ( is_nu... | php | static function fetchNotificationList( $status = 1, $length = null, $offset = 0, $sorts = null )
{
$cond = array();
if ( is_null( $status ) )
{
$cond = null;
}
else
{
$cond['status'] = $status;
}
$limit = array();
if ( is_nu... | [
"static",
"function",
"fetchNotificationList",
"(",
"$",
"status",
"=",
"1",
",",
"$",
"length",
"=",
"null",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"sorts",
"=",
"null",
")",
"{",
"$",
"cond",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_null",
... | Fetch the list of notification
@param $length: count of the notification to be fetched
@param $status: the status of the notification
@param $offset: offset
@return notification list | [
"Fetch",
"the",
"list",
"of",
"notification"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomnotification.php#L98-L120 |
23,694 | neilime/zf2-tree-layout-stack | src/TreeLayoutStack/TemplatingService.php | TemplatingService.factory | public static function factory($aOptions){
if($aOptions instanceof \Traversable)$aOptions = \Zend\Stdlib\ArrayUtils::iteratorToArray($aOptions);
elseif(!is_array($aOptions))throw new \InvalidArgumentException(__METHOD__.' expects an array or Traversable object; received "'.(is_object($aOptions)?get_class($aOptions)... | php | public static function factory($aOptions){
if($aOptions instanceof \Traversable)$aOptions = \Zend\Stdlib\ArrayUtils::iteratorToArray($aOptions);
elseif(!is_array($aOptions))throw new \InvalidArgumentException(__METHOD__.' expects an array or Traversable object; received "'.(is_object($aOptions)?get_class($aOptions)... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"aOptions",
")",
"{",
"if",
"(",
"$",
"aOptions",
"instanceof",
"\\",
"Traversable",
")",
"$",
"aOptions",
"=",
"\\",
"Zend",
"\\",
"Stdlib",
"\\",
"ArrayUtils",
"::",
"iteratorToArray",
"(",
"$",
"aOpti... | Instantiate a Templating service
@param array|Traversable $aOptions
@throws \InvalidArgumentException
@return \TreeLayoutStack\TemplatingService | [
"Instantiate",
"a",
"Templating",
"service"
] | 0a1431816ca1f4d4053b6f7f9ba83d8e72ad564a | https://github.com/neilime/zf2-tree-layout-stack/blob/0a1431816ca1f4d4053b6f7f9ba83d8e72ad564a/src/TreeLayoutStack/TemplatingService.php#L28-L32 |
23,695 | neilime/zf2-tree-layout-stack | src/TreeLayoutStack/TemplatingService.php | TemplatingService.buildLayoutTemplate | public function buildLayoutTemplate(\Zend\Mvc\MvcEvent $oEvent){
$oRequest = $oEvent->getRequest();
if(!($oRequest instanceof \Zend\Http\Request) || $oRequest->isXmlHttpRequest() || (
($oView = $oEvent->getResult()) instanceof \Zend\View\Model\ModelInterface
&& $oView->terminate()
))return $this;
... | php | public function buildLayoutTemplate(\Zend\Mvc\MvcEvent $oEvent){
$oRequest = $oEvent->getRequest();
if(!($oRequest instanceof \Zend\Http\Request) || $oRequest->isXmlHttpRequest() || (
($oView = $oEvent->getResult()) instanceof \Zend\View\Model\ModelInterface
&& $oView->terminate()
))return $this;
... | [
"public",
"function",
"buildLayoutTemplate",
"(",
"\\",
"Zend",
"\\",
"Mvc",
"\\",
"MvcEvent",
"$",
"oEvent",
")",
"{",
"$",
"oRequest",
"=",
"$",
"oEvent",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"!",
"(",
"$",
"oRequest",
"instanceof",
"\\",
"Z... | Define layout template
@param \Zend\Mvc\MvcEvent $oEvent
@throws \RuntimeException
@return \TreeLayoutStack\TemplatingService | [
"Define",
"layout",
"template"
] | 0a1431816ca1f4d4053b6f7f9ba83d8e72ad564a | https://github.com/neilime/zf2-tree-layout-stack/blob/0a1431816ca1f4d4053b6f7f9ba83d8e72ad564a/src/TreeLayoutStack/TemplatingService.php#L84-L118 |
23,696 | expectation-php/expect | src/MatcherPackage.php | MatcherPackage.fromPackageFile | public static function fromPackageFile($composerJson)
{
if (file_exists($composerJson) === false) {
throw new ComposerJsonNotFoundException("File {$composerJson} not found.");
}
$config = Config::load($composerJson);
$autoload = $config->get('autoload.psr-4');
$... | php | public static function fromPackageFile($composerJson)
{
if (file_exists($composerJson) === false) {
throw new ComposerJsonNotFoundException("File {$composerJson} not found.");
}
$config = Config::load($composerJson);
$autoload = $config->get('autoload.psr-4');
$... | [
"public",
"static",
"function",
"fromPackageFile",
"(",
"$",
"composerJson",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"composerJson",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"ComposerJsonNotFoundException",
"(",
"\"File {$composerJson} not found.\"",
")"... | Create a new matcher package from composer.json
@param string $composerJson composer.json path
@throws \expect\package\ComposerJsonNotFoundException | [
"Create",
"a",
"new",
"matcher",
"package",
"from",
"composer",
".",
"json"
] | 1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139 | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/MatcherPackage.php#L107-L126 |
23,697 | gpupo/common-schema | src/ORM/Entity/Application/API/OAuth/Client/AccessToken.php | AccessToken.setClient | public function setClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client = null)
{
$this->client = $client;
return $this;
} | php | public function setClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client = null)
{
$this->client = $client;
return $this;
} | [
"public",
"function",
"setClient",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Application",
"\\",
"API",
"\\",
"OAuth",
"\\",
"Client",
"\\",
"Client",
"$",
"client",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"client",
... | Set client.
@param null|\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client
@return AccessToken | [
"Set",
"client",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Application/API/OAuth/Client/AccessToken.php#L274-L279 |
23,698 | alevilar/ristorantino-vendor | Acl/Controller/Component/AclManagerComponent.php | AclManagerComponent.check_controller_hash_tmp_file | private function check_controller_hash_tmp_file()
{
if(is_writable(dirname($this->controllers_hash_file)))
{
App :: uses('File', 'Utility');
$file = new File($this->controllers_hash_file, true);
return $file->exists();
}
else
{
$this->Session->setFlash(sprin... | php | private function check_controller_hash_tmp_file()
{
if(is_writable(dirname($this->controllers_hash_file)))
{
App :: uses('File', 'Utility');
$file = new File($this->controllers_hash_file, true);
return $file->exists();
}
else
{
$this->Session->setFlash(sprin... | [
"private",
"function",
"check_controller_hash_tmp_file",
"(",
")",
"{",
"if",
"(",
"is_writable",
"(",
"dirname",
"(",
"$",
"this",
"->",
"controllers_hash_file",
")",
")",
")",
"{",
"App",
"::",
"uses",
"(",
"'File'",
",",
"'Utility'",
")",
";",
"$",
"fil... | Check if the file containing the stored controllers hashes can be created,
and create it if it does not exist
@return boolean true if the file exists or could be created | [
"Check",
"if",
"the",
"file",
"containing",
"the",
"stored",
"controllers",
"hashes",
"can",
"be",
"created",
"and",
"create",
"it",
"if",
"it",
"does",
"not",
"exist"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L31-L44 |
23,699 | alevilar/ristorantino-vendor | Acl/Controller/Component/AclManagerComponent.php | AclManagerComponent.set_display_name | public function set_display_name($model_classname, $field_expression)
{
$model_instance = $this->get_model_instance($model_classname);
$schema = $model_instance->schema();
if(array_key_exists($field_expression, $schema)
||
array_key_exists(str_replace($model_classname . '.',... | php | public function set_display_name($model_classname, $field_expression)
{
$model_instance = $this->get_model_instance($model_classname);
$schema = $model_instance->schema();
if(array_key_exists($field_expression, $schema)
||
array_key_exists(str_replace($model_classname . '.',... | [
"public",
"function",
"set_display_name",
"(",
"$",
"model_classname",
",",
"$",
"field_expression",
")",
"{",
"$",
"model_instance",
"=",
"$",
"this",
"->",
"get_model_instance",
"(",
"$",
"model_classname",
")",
";",
"$",
"schema",
"=",
"$",
"model_instance",
... | Check if a given field_expression is an existing fieldname for the given model
If it doesn't exist, a virtual field called 'alaxos_acl_display_name' is created with the given expression
@param string $model_classname
@param string $field_expression
@return string The name of the field to use as display name | [
"Check",
"if",
"a",
"given",
"field_expression",
"is",
"an",
"existing",
"fieldname",
"for",
"the",
"given",
"model"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Acl/Controller/Component/AclManagerComponent.php#L90-L128 |
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.