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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
238,600 | drdplusinfo/drdplus-armourer | DrdPlus/Armourer/Armourer.php | Armourer.getBaseOfWoundsUsingWeaponlike | public function getBaseOfWoundsUsingWeaponlike(WeaponlikeCode $weaponlikeCode, Strength $currentStrength): int
{
// weapon base of wounds has to be summed with strength via bonus summing, see PPH page 92 right column
$baseOfWounds = $this->tables->getBaseOfWoundsTable()->getBaseOfWounds(
... | php | public function getBaseOfWoundsUsingWeaponlike(WeaponlikeCode $weaponlikeCode, Strength $currentStrength): int
{
// weapon base of wounds has to be summed with strength via bonus summing, see PPH page 92 right column
$baseOfWounds = $this->tables->getBaseOfWoundsTable()->getBaseOfWounds(
... | [
"public",
"function",
"getBaseOfWoundsUsingWeaponlike",
"(",
"WeaponlikeCode",
"$",
"weaponlikeCode",
",",
"Strength",
"$",
"currentStrength",
")",
":",
"int",
"{",
"// weapon base of wounds has to be summed with strength via bonus summing, see PPH page 92 right column",
"$",
"base... | Gives base of wound with a weapon and user strength.
@param WeaponlikeCode $weaponlikeCode
@param Strength $currentStrength
@return int
@throws \DrdPlus\Tables\Armaments\Weapons\Exceptions\CanNotUseWeaponBecauseOfMissingStrength
@throws \DrdPlus\Tables\Armaments\Exceptions\UnknownArmament
@throws \DrdPlus\Tables\Armam... | [
"Gives",
"base",
"of",
"wound",
"with",
"a",
"weapon",
"and",
"user",
"strength",
"."
] | c2b8e2349881d4edb433689c5edba0810a32c6d8 | https://github.com/drdplusinfo/drdplus-armourer/blob/c2b8e2349881d4edb433689c5edba0810a32c6d8/DrdPlus/Armourer/Armourer.php#L872-L882 |
238,601 | zugoripls/laravel-framework | src/Illuminate/Events/Dispatcher.php | Dispatcher.callQueueMethodOnHandler | protected function callQueueMethodOnHandler($class, $method, $arguments)
{
$handler = (new ReflectionClass($class))->newInstanceWithoutConstructor();
$handler->queue($this->resolveQueue(), 'Illuminate\Events\CallQueuedHandler@call', [
'class' => $class, 'method' => $method, 'data' => serialize($arguments),
]... | php | protected function callQueueMethodOnHandler($class, $method, $arguments)
{
$handler = (new ReflectionClass($class))->newInstanceWithoutConstructor();
$handler->queue($this->resolveQueue(), 'Illuminate\Events\CallQueuedHandler@call', [
'class' => $class, 'method' => $method, 'data' => serialize($arguments),
]... | [
"protected",
"function",
"callQueueMethodOnHandler",
"(",
"$",
"class",
",",
"$",
"method",
",",
"$",
"arguments",
")",
"{",
"$",
"handler",
"=",
"(",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
")",
"->",
"newInstanceWithoutConstructor",
"(",
")",
";"... | Call the queue method on the handler class.
@param string $class
@param string $method
@param array $arguments
@return void | [
"Call",
"the",
"queue",
"method",
"on",
"the",
"handler",
"class",
"."
] | 90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655 | https://github.com/zugoripls/laravel-framework/blob/90fa2b0e7a9b7786a6f02a9f10aba6a21ac03655/src/Illuminate/Events/Dispatcher.php#L430-L437 |
238,602 | SocietyCMS/Core | Console/Installers/Scripts/AdminUserInstaller.php | AdminUserInstaller.createFirstUser | protected function createFirstUser()
{
$info = [
'first_name' => $this->askForFirstName(),
'last_name' => $this->askForLastName(),
'email' => $this->askForEmail(),
'password' => $this->askForPassword(),
'created_at' => Carbon::now(),
... | php | protected function createFirstUser()
{
$info = [
'first_name' => $this->askForFirstName(),
'last_name' => $this->askForLastName(),
'email' => $this->askForEmail(),
'password' => $this->askForPassword(),
'created_at' => Carbon::now(),
... | [
"protected",
"function",
"createFirstUser",
"(",
")",
"{",
"$",
"info",
"=",
"[",
"'first_name'",
"=>",
"$",
"this",
"->",
"askForFirstName",
"(",
")",
",",
"'last_name'",
"=>",
"$",
"this",
"->",
"askForLastName",
"(",
")",
",",
"'email'",
"=>",
"$",
"t... | Create a first admin user.
@param $adminRoleId | [
"Create",
"a",
"first",
"admin",
"user",
"."
] | fb6be1b1dd46c89a976c02feb998e9af01ddca54 | https://github.com/SocietyCMS/Core/blob/fb6be1b1dd46c89a976c02feb998e9af01ddca54/Console/Installers/Scripts/AdminUserInstaller.php#L78-L95 |
238,603 | synapsestudios/synapse-base | src/Synapse/Install/RunInstallCommand.php | RunInstallCommand.getInstallScript | public function getInstallScript()
{
if (! $this->installScript) {
$installClass = $this->installNamespace.'Install';
if (! class_exists($installClass)) {
$message = sprintf('No install class found at %s. Nothing to do.', $installClass);
throw new Ru... | php | public function getInstallScript()
{
if (! $this->installScript) {
$installClass = $this->installNamespace.'Install';
if (! class_exists($installClass)) {
$message = sprintf('No install class found at %s. Nothing to do.', $installClass);
throw new Ru... | [
"public",
"function",
"getInstallScript",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"installScript",
")",
"{",
"$",
"installClass",
"=",
"$",
"this",
"->",
"installNamespace",
".",
"'Install'",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"inst... | Get install script
Use injected script if it exist, otherwise instantiate the default.
@return AbstractInstall
@throws RuntimeException If the install class cannot be found | [
"Get",
"install",
"script"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Install/RunInstallCommand.php#L113-L130 |
238,604 | synapsestudios/synapse-base | src/Synapse/Install/RunInstallCommand.php | RunInstallCommand.hasTablesOrViews | protected function hasTablesOrViews()
{
$tables = $this->db->query('SHOW TABLES', DbAdapter::QUERY_MODE_EXECUTE);
return (bool) count($tables);
} | php | protected function hasTablesOrViews()
{
$tables = $this->db->query('SHOW TABLES', DbAdapter::QUERY_MODE_EXECUTE);
return (bool) count($tables);
} | [
"protected",
"function",
"hasTablesOrViews",
"(",
")",
"{",
"$",
"tables",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SHOW TABLES'",
",",
"DbAdapter",
"::",
"QUERY_MODE_EXECUTE",
")",
";",
"return",
"(",
"bool",
")",
"count",
"(",
"$",
"tables",
... | Checks for existing tables in the database
@return boolean Whether or not there are existing tables | [
"Checks",
"for",
"existing",
"tables",
"in",
"the",
"database"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Install/RunInstallCommand.php#L180-L185 |
238,605 | synapsestudios/synapse-base | src/Synapse/Install/RunInstallCommand.php | RunInstallCommand.dropTables | protected function dropTables()
{
$tables = $this->db->query(
'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "BASE_TABLE"',
DbAdapter::QUERY_MODE_EXECUTE
);
// Disable foreign key checks -- we are wiping the database on purpose
$this->db->query(
'SET FOR... | php | protected function dropTables()
{
$tables = $this->db->query(
'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "BASE_TABLE"',
DbAdapter::QUERY_MODE_EXECUTE
);
// Disable foreign key checks -- we are wiping the database on purpose
$this->db->query(
'SET FOR... | [
"protected",
"function",
"dropTables",
"(",
")",
"{",
"$",
"tables",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SHOW FULL TABLES WHERE TABLE_TYPE LIKE \"BASE_TABLE\"'",
",",
"DbAdapter",
"::",
"QUERY_MODE_EXECUTE",
")",
";",
"// Disable foreign key checks -- we... | Drop all tables from the database | [
"Drop",
"all",
"tables",
"from",
"the",
"database"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Install/RunInstallCommand.php#L190-L215 |
238,606 | synapsestudios/synapse-base | src/Synapse/Install/RunInstallCommand.php | RunInstallCommand.dropViews | protected function dropViews()
{
$views = $this->db->query(
'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "VIEW"',
DbAdapter::QUERY_MODE_EXECUTE
);
foreach ($views as $view) {
$this->db->query(
'DROP VIEW '.reset($view),
DbAdapte... | php | protected function dropViews()
{
$views = $this->db->query(
'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "VIEW"',
DbAdapter::QUERY_MODE_EXECUTE
);
foreach ($views as $view) {
$this->db->query(
'DROP VIEW '.reset($view),
DbAdapte... | [
"protected",
"function",
"dropViews",
"(",
")",
"{",
"$",
"views",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SHOW FULL TABLES WHERE TABLE_TYPE LIKE \"VIEW\"'",
",",
"DbAdapter",
"::",
"QUERY_MODE_EXECUTE",
")",
";",
"foreach",
"(",
"$",
"views",
"as",
... | Drop all views from the database | [
"Drop",
"all",
"views",
"from",
"the",
"database"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Install/RunInstallCommand.php#L220-L233 |
238,607 | synapsestudios/synapse-base | src/Synapse/Install/RunInstallCommand.php | RunInstallCommand.install | protected function install(AbstractInstall $installScript, OutputInterface $output)
{
$dataPath = DATADIR;
$output->writeln(' Installing App...');
// Install the database structure
$this->runSql(
$dataPath.DIRECTORY_SEPARATOR.GenerateInstallCommand::STRUCTURE_FILE,
... | php | protected function install(AbstractInstall $installScript, OutputInterface $output)
{
$dataPath = DATADIR;
$output->writeln(' Installing App...');
// Install the database structure
$this->runSql(
$dataPath.DIRECTORY_SEPARATOR.GenerateInstallCommand::STRUCTURE_FILE,
... | [
"protected",
"function",
"install",
"(",
"AbstractInstall",
"$",
"installScript",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"dataPath",
"=",
"DATADIR",
";",
"$",
"output",
"->",
"writeln",
"(",
"' Installing App...'",
")",
";",
"// Install the databas... | Install fresh version of the database from db_structure and db_data files
@param AbstractInstall $installScript
@param OutputInterface $output Command line output interface | [
"Install",
"fresh",
"version",
"of",
"the",
"database",
"from",
"db_structure",
"and",
"db_data",
"files"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Install/RunInstallCommand.php#L241-L268 |
238,608 | synapsestudios/synapse-base | src/Synapse/Install/RunInstallCommand.php | RunInstallCommand.runSql | protected function runSql($file, $message, $notFoundMessage, $output)
{
if (! is_file($file)) {
$output->writeln($notFoundMessage);
return;
}
$output->writeln($message);
$dataSql = file_get_contents($file);
// Split the sql file on new lines and in... | php | protected function runSql($file, $message, $notFoundMessage, $output)
{
if (! is_file($file)) {
$output->writeln($notFoundMessage);
return;
}
$output->writeln($message);
$dataSql = file_get_contents($file);
// Split the sql file on new lines and in... | [
"protected",
"function",
"runSql",
"(",
"$",
"file",
",",
"$",
"message",
",",
"$",
"notFoundMessage",
",",
"$",
"output",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"file",
")",
")",
"{",
"$",
"output",
"->",
"writeln",
"(",
"$",
"notFoundMessag... | Given a filepath to a SQL file, load it and run the SQL statements inside
@param string $file Path to SQL file
@param string $message Message to output to the console if the file exists
@param string $notFoundMessage Message to output to the console if the file does not exist | [
"Given",
"a",
"filepath",
"to",
"a",
"SQL",
"file",
"load",
"it",
"and",
"run",
"the",
"SQL",
"statements",
"inside"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Install/RunInstallCommand.php#L277-L299 |
238,609 | cityware/city-snmp | src/MIBS/Extreme/SwMonitor/Memory.php | Memory.percentUsage | public function percentUsage()
{
$total = $this->systemTotal();
$free = $this->systemFree();
$usage = [];
foreach( $total as $slotId => $amount ) {
$usage[ $slotId ] = intval( ceil( ( ( $amount - $free[ $slotId ] ) * 100 ) / $amount ) );
}
return $usag... | php | public function percentUsage()
{
$total = $this->systemTotal();
$free = $this->systemFree();
$usage = [];
foreach( $total as $slotId => $amount ) {
$usage[ $slotId ] = intval( ceil( ( ( $amount - $free[ $slotId ] ) * 100 ) / $amount ) );
}
return $usag... | [
"public",
"function",
"percentUsage",
"(",
")",
"{",
"$",
"total",
"=",
"$",
"this",
"->",
"systemTotal",
"(",
")",
";",
"$",
"free",
"=",
"$",
"this",
"->",
"systemFree",
"(",
")",
";",
"$",
"usage",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"tot... | Percentage of memory used per slot
@return array Integer percentage of memory used | [
"Percentage",
"of",
"memory",
"used",
"per",
"slot"
] | 831b7485b6c932a84f081d5ceeb9c5f4e7a8641d | https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Extreme/SwMonitor/Memory.php#L76-L88 |
238,610 | OWeb/OWeb-Framework | OWeb/defaults/controllers/OWeb/Helpers/Form/Elements/Select.php | Select.add | public function add($text, $value){
$this->select[] = array($text, $value);
$this->validator->addPossibility($value);
} | php | public function add($text, $value){
$this->select[] = array($text, $value);
$this->validator->addPossibility($value);
} | [
"public",
"function",
"add",
"(",
"$",
"text",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"select",
"[",
"]",
"=",
"array",
"(",
"$",
"text",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"validator",
"->",
"addPossibility",
"(",
"$",
"val... | Adds a value to the list of possiblities
@param type $text The text to be shown for this value
@param type $value The actual value. | [
"Adds",
"a",
"value",
"to",
"the",
"list",
"of",
"possiblities"
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/defaults/controllers/OWeb/Helpers/Form/Elements/Select.php#L48-L51 |
238,611 | crisu83/yii-composer | InstallHandler.php | InstallHandler.setPermissions | public static function setPermissions(Event $event)
{
$options = array_merge(
array(
self::PARAM_WRITABLE => array(),
self::PARAM_EXECUTABLE => array(),
),
$event->getComposer()->getPackage()->getExtra()
);
foreach ((array)... | php | public static function setPermissions(Event $event)
{
$options = array_merge(
array(
self::PARAM_WRITABLE => array(),
self::PARAM_EXECUTABLE => array(),
),
$event->getComposer()->getPackage()->getExtra()
);
foreach ((array)... | [
"public",
"static",
"function",
"setPermissions",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"array",
"(",
"self",
"::",
"PARAM_WRITABLE",
"=>",
"array",
"(",
")",
",",
"self",
"::",
"PARAM_EXECUTABLE",
"=>",
"array",
"(... | Sets the correct permissions of files and directories.
@param Event $event | [
"Sets",
"the",
"correct",
"permissions",
"of",
"files",
"and",
"directories",
"."
] | 848a5b5fd3419ebd504d40d25d9c659411383ae1 | https://github.com/crisu83/yii-composer/blob/848a5b5fd3419ebd504d40d25d9c659411383ae1/InstallHandler.php#L32-L63 |
238,612 | AyeAyeApi/Formatters | src/Writer/Xml.php | Xml.partialFormat | public function partialFormat($data, $nodeName = null)
{
if (!$nodeName) {
$nodeName = $this->getNodeName($data);
}
$data = $this->parseData($data);
if (is_scalar($data)) {
return "<$nodeName>" . $this->parseScalarData($data) . "</$nodeName>";
}
... | php | public function partialFormat($data, $nodeName = null)
{
if (!$nodeName) {
$nodeName = $this->getNodeName($data);
}
$data = $this->parseData($data);
if (is_scalar($data)) {
return "<$nodeName>" . $this->parseScalarData($data) . "</$nodeName>";
}
... | [
"public",
"function",
"partialFormat",
"(",
"$",
"data",
",",
"$",
"nodeName",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"nodeName",
")",
"{",
"$",
"nodeName",
"=",
"$",
"this",
"->",
"getNodeName",
"(",
"$",
"data",
")",
";",
"}",
"$",
"data",
... | Format part of the data
@param mixed $data The data to be serialised into xml
@param string|null $nodeName The node currently being worked on
@return string | [
"Format",
"part",
"of",
"the",
"data"
] | 0141d0186e0555f7583be419f22280ac7ed24a6f | https://github.com/AyeAyeApi/Formatters/blob/0141d0186e0555f7583be419f22280ac7ed24a6f/src/Writer/Xml.php#L50-L61 |
238,613 | AyeAyeApi/Formatters | src/Writer/Xml.php | Xml.getNodeName | protected function getNodeName($data)
{
if (is_object($data)) {
$nodeName = preg_replace('/.*\\\/', '', get_class($data));
return preg_replace('/\W/', '', $nodeName);
} elseif (is_array($data)) {
return 'array';
}
return $this->defaultNodeName;
... | php | protected function getNodeName($data)
{
if (is_object($data)) {
$nodeName = preg_replace('/.*\\\/', '', get_class($data));
return preg_replace('/\W/', '', $nodeName);
} elseif (is_array($data)) {
return 'array';
}
return $this->defaultNodeName;
... | [
"protected",
"function",
"getNodeName",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"$",
"nodeName",
"=",
"preg_replace",
"(",
"'/.*\\\\\\/'",
",",
"''",
",",
"get_class",
"(",
"$",
"data",
")",
")",
";",
"ret... | Try to guess the node name
@param mixed $data Data to try to find the name of
@return mixed|string | [
"Try",
"to",
"guess",
"the",
"node",
"name"
] | 0141d0186e0555f7583be419f22280ac7ed24a6f | https://github.com/AyeAyeApi/Formatters/blob/0141d0186e0555f7583be419f22280ac7ed24a6f/src/Writer/Xml.php#L68-L77 |
238,614 | AyeAyeApi/Formatters | src/Writer/Xml.php | Xml.parseNonScalarData | protected function parseNonScalarData($data, $fallbackName = null)
{
$xml = '';
if (!$fallbackName) {
$fallbackName = $this->defaultNodeName;
}
foreach ($data as $property => $value) {
// Clear non-alphanumeric characters
$property = preg_replace('... | php | protected function parseNonScalarData($data, $fallbackName = null)
{
$xml = '';
if (!$fallbackName) {
$fallbackName = $this->defaultNodeName;
}
foreach ($data as $property => $value) {
// Clear non-alphanumeric characters
$property = preg_replace('... | [
"protected",
"function",
"parseNonScalarData",
"(",
"$",
"data",
",",
"$",
"fallbackName",
"=",
"null",
")",
"{",
"$",
"xml",
"=",
"''",
";",
"if",
"(",
"!",
"$",
"fallbackName",
")",
"{",
"$",
"fallbackName",
"=",
"$",
"this",
"->",
"defaultNodeName",
... | Recurse through non scalar data, serializing it
@param array|object $data
@param string|null $fallbackName The name to use for an element in the event it doesn't have one
@return string | [
"Recurse",
"through",
"non",
"scalar",
"data",
"serializing",
"it"
] | 0141d0186e0555f7583be419f22280ac7ed24a6f | https://github.com/AyeAyeApi/Formatters/blob/0141d0186e0555f7583be419f22280ac7ed24a6f/src/Writer/Xml.php#L98-L116 |
238,615 | JoshuaEstes/Daedalus | src/Daedalus/Application.php | Application.registerCommands | protected function registerCommands()
{
$this->add(new \Daedalus\Command\DumpContainerCommand($this->kernel->getContainer()));
$this->add(new \Daedalus\Command\HelpCommand($this->kernel->getContainer()));
} | php | protected function registerCommands()
{
$this->add(new \Daedalus\Command\DumpContainerCommand($this->kernel->getContainer()));
$this->add(new \Daedalus\Command\HelpCommand($this->kernel->getContainer()));
} | [
"protected",
"function",
"registerCommands",
"(",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"new",
"\\",
"Daedalus",
"\\",
"Command",
"\\",
"DumpContainerCommand",
"(",
"$",
"this",
"->",
"kernel",
"->",
"getContainer",
"(",
")",
")",
")",
";",
"$",
"this... | Registers the commands that are displayed to the developer | [
"Registers",
"the",
"commands",
"that",
"are",
"displayed",
"to",
"the",
"developer"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Application.php#L105-L109 |
238,616 | JoshuaEstes/Daedalus | src/Daedalus/Application.php | Application.addOutputFormatterStyles | protected function addOutputFormatterStyles(OutputInterface $output)
{
foreach ($this->getOutputFormatterStyles() as $name => $style) {
$output->getFormatter()->setStyle($name, $style);
}
} | php | protected function addOutputFormatterStyles(OutputInterface $output)
{
foreach ($this->getOutputFormatterStyles() as $name => $style) {
$output->getFormatter()->setStyle($name, $style);
}
} | [
"protected",
"function",
"addOutputFormatterStyles",
"(",
"OutputInterface",
"$",
"output",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getOutputFormatterStyles",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"style",
")",
"{",
"$",
"output",
"->",
"getFormatter",... | Adds extra styles to the output
@param OutputInterface $output | [
"Adds",
"extra",
"styles",
"to",
"the",
"output"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Application.php#L116-L121 |
238,617 | bravesheep/dogmatist | src/Builder.php | Builder.fake | public function fake($field, $type, array $options = [])
{
$field = $this->get($field);
$field->setFake($type, $options);
return $this;
} | php | public function fake($field, $type, array $options = [])
{
$field = $this->get($field);
$field->setFake($type, $options);
return $this;
} | [
"public",
"function",
"fake",
"(",
"$",
"field",
",",
"$",
"type",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"field",
")",
";",
"$",
"field",
"->",
"setFake",
"(",
"$",
"type",... | Fake the contents of a field.
@param string|int $field
@param string|callback $type
@param array $options
@return $this | [
"Fake",
"the",
"contents",
"of",
"a",
"field",
"."
] | 38c332e5ccff4e715b70e5f5ce153d96c745d695 | https://github.com/bravesheep/dogmatist/blob/38c332e5ccff4e715b70e5f5ce153d96c745d695/src/Builder.php#L197-L202 |
238,618 | bravesheep/dogmatist | src/Builder.php | Builder.copy | public function copy($type = null)
{
$builder = new Builder($this->type, $this->dogmatist, $this->parent, $this->strict);
$this->copyData($builder);
if ($type !== null) {
$builder->setType($type);
}
return $builder;
} | php | public function copy($type = null)
{
$builder = new Builder($this->type, $this->dogmatist, $this->parent, $this->strict);
$this->copyData($builder);
if ($type !== null) {
$builder->setType($type);
}
return $builder;
} | [
"public",
"function",
"copy",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"builder",
"=",
"new",
"Builder",
"(",
"$",
"this",
"->",
"type",
",",
"$",
"this",
"->",
"dogmatist",
",",
"$",
"this",
"->",
"parent",
",",
"$",
"this",
"->",
"strict",
... | Returns a clone for the current builder
@param string $type The new type of the cloned builder.
@return $this | [
"Returns",
"a",
"clone",
"for",
"the",
"current",
"builder"
] | 38c332e5ccff4e715b70e5f5ce153d96c745d695 | https://github.com/bravesheep/dogmatist/blob/38c332e5ccff4e715b70e5f5ce153d96c745d695/src/Builder.php#L512-L522 |
238,619 | simplecomplex/php-cache | src/CacheKey.php | CacheKey.validate | public static function validate(string $key) : bool
{
$le = strlen($key);
if ($le < static::VALID_LENGTH_MIN || $le > static::VALID_LENGTH_MAX) {
return false;
}
if ($key{0} === '-') {
return false;
}
// Faster than a regular expression.
... | php | public static function validate(string $key) : bool
{
$le = strlen($key);
if ($le < static::VALID_LENGTH_MIN || $le > static::VALID_LENGTH_MAX) {
return false;
}
if ($key{0} === '-') {
return false;
}
// Faster than a regular expression.
... | [
"public",
"static",
"function",
"validate",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"$",
"le",
"=",
"strlen",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"le",
"<",
"static",
"::",
"VALID_LENGTH_MIN",
"||",
"$",
"le",
">",
"static",
"::",
... | Checks that length and content is legal.
First char cannot be hyphen, because that could break CLI interaction.
@param string $key
@return bool | [
"Checks",
"that",
"length",
"and",
"content",
"is",
"legal",
"."
] | 4eb088bc65041948df0dbefcf9da11261c50fca4 | https://github.com/simplecomplex/php-cache/blob/4eb088bc65041948df0dbefcf9da11261c50fca4/src/CacheKey.php#L78-L90 |
238,620 | QuanticTelecom/invoices | src/QuanticTelecom/Invoices/AbstractInvoice.php | AbstractInvoice.setDueDate | private function setDueDate(Carbon $dueDate = null)
{
if (is_null($dueDate)) {
$dueDate = Carbon::now();
}
$this->dueDate = $dueDate;
} | php | private function setDueDate(Carbon $dueDate = null)
{
if (is_null($dueDate)) {
$dueDate = Carbon::now();
}
$this->dueDate = $dueDate;
} | [
"private",
"function",
"setDueDate",
"(",
"Carbon",
"$",
"dueDate",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dueDate",
")",
")",
"{",
"$",
"dueDate",
"=",
"Carbon",
"::",
"now",
"(",
")",
";",
"}",
"$",
"this",
"->",
"dueDate",
"=",
... | Set the due date of the invoice, if null, set the current date.
@param Carbon $dueDate | null
@return void | [
"Set",
"the",
"due",
"date",
"of",
"the",
"invoice",
"if",
"null",
"set",
"the",
"current",
"date",
"."
] | 70b946c776a1014ebb8735bd58c2c6a8b37f87ae | https://github.com/QuanticTelecom/invoices/blob/70b946c776a1014ebb8735bd58c2c6a8b37f87ae/src/QuanticTelecom/Invoices/AbstractInvoice.php#L139-L146 |
238,621 | QuanticTelecom/invoices | src/QuanticTelecom/Invoices/AbstractInvoice.php | AbstractInvoice.setCreatedAt | private function setCreatedAt(Carbon $createdAt = null)
{
if (is_null($createdAt)) {
$createdAt = Carbon::now();
}
$this->createdAt = $createdAt;
} | php | private function setCreatedAt(Carbon $createdAt = null)
{
if (is_null($createdAt)) {
$createdAt = Carbon::now();
}
$this->createdAt = $createdAt;
} | [
"private",
"function",
"setCreatedAt",
"(",
"Carbon",
"$",
"createdAt",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"createdAt",
")",
")",
"{",
"$",
"createdAt",
"=",
"Carbon",
"::",
"now",
"(",
")",
";",
"}",
"$",
"this",
"->",
"createdAt... | Set the creation date of the invoice, if null, set the current date.
@param Carbon $createdAt | null
@return void | [
"Set",
"the",
"creation",
"date",
"of",
"the",
"invoice",
"if",
"null",
"set",
"the",
"current",
"date",
"."
] | 70b946c776a1014ebb8735bd58c2c6a8b37f87ae | https://github.com/QuanticTelecom/invoices/blob/70b946c776a1014ebb8735bd58c2c6a8b37f87ae/src/QuanticTelecom/Invoices/AbstractInvoice.php#L165-L172 |
238,622 | wasabi-cms/core | src/Model/Table/GroupsTable.php | GroupsTable.moveUsersToAlternativeGroups | public function moveUsersToAlternativeGroups($userIdGroupIdMapping)
{
$affectedUsers = 0;
$affectedGroups = [];
foreach ($userIdGroupIdMapping as $userId => $groupId) {
$affectedUsers += $this->UsersGroups->updateAll([
'group_id' => $groupId
], [
... | php | public function moveUsersToAlternativeGroups($userIdGroupIdMapping)
{
$affectedUsers = 0;
$affectedGroups = [];
foreach ($userIdGroupIdMapping as $userId => $groupId) {
$affectedUsers += $this->UsersGroups->updateAll([
'group_id' => $groupId
], [
... | [
"public",
"function",
"moveUsersToAlternativeGroups",
"(",
"$",
"userIdGroupIdMapping",
")",
"{",
"$",
"affectedUsers",
"=",
"0",
";",
"$",
"affectedGroups",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"userIdGroupIdMapping",
"as",
"$",
"userId",
"=>",
"$",
"grou... | Assign users to new groups.
@param array $userIdGroupIdMapping A mapping of user ids to their new group ids.
@return int number of affected user rows | [
"Assign",
"users",
"to",
"new",
"groups",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Model/Table/GroupsTable.php#L88-L106 |
238,623 | borobudur-php/borobudur-broadcasting | src/Broadcaster/BroadcasterManager.php | BroadcasterManager.addBroadcaster | public static function addBroadcaster(BroadcasterInterface $broadcaster)
{
self::instantiateDefaultBroadcasters();
self::$broadcasters[$broadcaster->getName()] = $broadcaster;
} | php | public static function addBroadcaster(BroadcasterInterface $broadcaster)
{
self::instantiateDefaultBroadcasters();
self::$broadcasters[$broadcaster->getName()] = $broadcaster;
} | [
"public",
"static",
"function",
"addBroadcaster",
"(",
"BroadcasterInterface",
"$",
"broadcaster",
")",
"{",
"self",
"::",
"instantiateDefaultBroadcasters",
"(",
")",
";",
"self",
"::",
"$",
"broadcasters",
"[",
"$",
"broadcaster",
"->",
"getName",
"(",
")",
"]"... | Add a broadcaster.
@param BroadcasterInterface $broadcaster | [
"Add",
"a",
"broadcaster",
"."
] | d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a | https://github.com/borobudur-php/borobudur-broadcasting/blob/d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a/src/Broadcaster/BroadcasterManager.php#L46-L50 |
238,624 | borobudur-php/borobudur-broadcasting | src/Broadcaster/BroadcasterManager.php | BroadcasterManager.get | public static function get($name)
{
$name = strtolower($name);
if (!isset(self::$instantiated[$name])) {
throw new InvalidArgumentException(sprintf('Broadcaster "%s" is not instantiated.', $name));
}
return self::$instantiated[$name];
} | php | public static function get($name)
{
$name = strtolower($name);
if (!isset(self::$instantiated[$name])) {
throw new InvalidArgumentException(sprintf('Broadcaster "%s" is not instantiated.', $name));
}
return self::$instantiated[$name];
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instantiated",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
... | Get instantiated broadcaster.
@param string $name
@return BroadcasterInterface | [
"Get",
"instantiated",
"broadcaster",
"."
] | d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a | https://github.com/borobudur-php/borobudur-broadcasting/blob/d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a/src/Broadcaster/BroadcasterManager.php#L59-L68 |
238,625 | borobudur-php/borobudur-broadcasting | src/Broadcaster/BroadcasterManager.php | BroadcasterManager.build | public static function build($name, array $configs = array())
{
if (isset(self::$instantiated[$name])) {
return self::$instantiated[$name];
}
self::instantiateDefaultBroadcasters();
if (!isset(self::$broadcasters[$name])) {
throw new InvalidArgumentException(... | php | public static function build($name, array $configs = array())
{
if (isset(self::$instantiated[$name])) {
return self::$instantiated[$name];
}
self::instantiateDefaultBroadcasters();
if (!isset(self::$broadcasters[$name])) {
throw new InvalidArgumentException(... | [
"public",
"static",
"function",
"build",
"(",
"$",
"name",
",",
"array",
"$",
"configs",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"instantiated",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"self",
"::",
"... | Build a broadcaster.
@param string $name
@param array $configs
@return BroadcasterInterface | [
"Build",
"a",
"broadcaster",
"."
] | d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a | https://github.com/borobudur-php/borobudur-broadcasting/blob/d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a/src/Broadcaster/BroadcasterManager.php#L78-L92 |
238,626 | borobudur-php/borobudur-broadcasting | src/Broadcaster/BroadcasterManager.php | BroadcasterManager.instantiate | private static function instantiate($class, array $configs)
{
$reflection = new ReflectionClass($class);
$constructor = $reflection->getConstructor();
$arguments = array();
foreach ($constructor->getParameters() as $param) {
$name = $param->getName();
if (iss... | php | private static function instantiate($class, array $configs)
{
$reflection = new ReflectionClass($class);
$constructor = $reflection->getConstructor();
$arguments = array();
foreach ($constructor->getParameters() as $param) {
$name = $param->getName();
if (iss... | [
"private",
"static",
"function",
"instantiate",
"(",
"$",
"class",
",",
"array",
"$",
"configs",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"constructor",
"=",
"$",
"reflection",
"->",
"getConstructor",
"(... | Instantiate broadcaster.
@param string $class
@param array $configs
@return BroadcasterInterface | [
"Instantiate",
"broadcaster",
"."
] | d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a | https://github.com/borobudur-php/borobudur-broadcasting/blob/d2f58ab5a4eb96252f55b4093a9ae027cc35fb0a/src/Broadcaster/BroadcasterManager.php#L102-L128 |
238,627 | eix/core | src/php/main/Eix/Core/Responses/Data.php | Data.addData | public function addData($key, $value)
{
if (isset($this->data[$key])) {
$this->data[$key] = array_merge_recursive(
$this->data[$key],
$value
);
} else {
$this->setData($key, $value);
}
} | php | public function addData($key, $value)
{
if (isset($this->data[$key])) {
$this->data[$key] = array_merge_recursive(
$this->data[$key],
$value
);
} else {
$this->setData($key, $value);
}
} | [
"public",
"function",
"addData",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
"=",
"array_merge_recursive",... | Stores the response data in a key-value fashion, adding the data to the
existing set.
@param string $key the key under which the data is stored.
@param mixed $value the data. | [
"Stores",
"the",
"response",
"data",
"in",
"a",
"key",
"-",
"value",
"fashion",
"adding",
"the",
"data",
"to",
"the",
"existing",
"set",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/Responses/Data.php#L33-L43 |
238,628 | PowerOnSystem/HelperService | src/HtmlHelper.php | HtmlHelper.link | public function link($content, $url = [], array $options = []) {
/* @var $url_helper UrlHelper */
$url_helper = $this->url;
$cfg = [
'href' => is_array($url) ? (
key_exists('push', $url) ? $url_helper->push($url['push']) : (
key_exists(... | php | public function link($content, $url = [], array $options = []) {
/* @var $url_helper UrlHelper */
$url_helper = $this->url;
$cfg = [
'href' => is_array($url) ? (
key_exists('push', $url) ? $url_helper->push($url['push']) : (
key_exists(... | [
"public",
"function",
"link",
"(",
"$",
"content",
",",
"$",
"url",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"/* @var $url_helper UrlHelper */",
"$",
"url_helper",
"=",
"$",
"this",
"->",
"url",
";",
"$",
"cfg",
"=",
"[",... | Crea un enlace
@param string $content el contenido del enlace
@param array $url la URL
@param array $options [Opcional] las opciones
@return string una etiqueta a | [
"Crea",
"un",
"enlace"
] | 6d300764d7b3a090dd674b25415ce5088156ce8b | https://github.com/PowerOnSystem/HelperService/blob/6d300764d7b3a090dd674b25415ce5088156ce8b/src/HtmlHelper.php#L59-L77 |
238,629 | PowerOnSystem/HelperService | src/HtmlHelper.php | HtmlHelper.js | public function js($name = NULL, $external = FALSE, array $options = []) {
if ($name) {
$this->_js[$name] = $options + [
'src' => $external ? $name : PO_PATH_JS . '/' . $name
];
} else {
return implode(PHP_EOL, array_map(function($value) {
... | php | public function js($name = NULL, $external = FALSE, array $options = []) {
if ($name) {
$this->_js[$name] = $options + [
'src' => $external ? $name : PO_PATH_JS . '/' . $name
];
} else {
return implode(PHP_EOL, array_map(function($value) {
... | [
"public",
"function",
"js",
"(",
"$",
"name",
"=",
"NULL",
",",
"$",
"external",
"=",
"FALSE",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"_js",
"[",
"$",
"name",
"]",
"=",
"$",... | Agrega un archivo javascript o enlista los agregados
@param string $name [Opcional] el nombre del archivo si no se especifica name devuelve todos los archivos js incluidos
@param boolean $external [Opcional] Especifica si se trata de un archivo JS externo.
@return string una etiqueta script | [
"Agrega",
"un",
"archivo",
"javascript",
"o",
"enlista",
"los",
"agregados"
] | 6d300764d7b3a090dd674b25415ce5088156ce8b | https://github.com/PowerOnSystem/HelperService/blob/6d300764d7b3a090dd674b25415ce5088156ce8b/src/HtmlHelper.php#L112-L122 |
238,630 | PowerOnSystem/HelperService | src/HtmlHelper.php | HtmlHelper.meta | public function meta($name = NULL, $content = NULL) {
if ( $name ) {
$this->_meta[$name] = ['name' => $name, 'content' => $content];
} else {
return implode(PHP_EOL, array_map(function($meta) {
return '<meta name="' . $meta['name'] . '" content="' . $meta['co... | php | public function meta($name = NULL, $content = NULL) {
if ( $name ) {
$this->_meta[$name] = ['name' => $name, 'content' => $content];
} else {
return implode(PHP_EOL, array_map(function($meta) {
return '<meta name="' . $meta['name'] . '" content="' . $meta['co... | [
"public",
"function",
"meta",
"(",
"$",
"name",
"=",
"NULL",
",",
"$",
"content",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"_meta",
"[",
"$",
"name",
"]",
"=",
"[",
"'name'",
"=>",
"$",
"name",
",",
"'content'... | Agrega una etiqueta META
@param string $name Nombre/Tipo de etiqueta meta
@param string $content Contenido
@return string La etiqueta formateada | [
"Agrega",
"una",
"etiqueta",
"META"
] | 6d300764d7b3a090dd674b25415ce5088156ce8b | https://github.com/PowerOnSystem/HelperService/blob/6d300764d7b3a090dd674b25415ce5088156ce8b/src/HtmlHelper.php#L166-L174 |
238,631 | PowerOnSystem/HelperService | src/HtmlHelper.php | HtmlHelper.img | public function img($name, array $options = [], $external = FALSE) {
$cfg = $options + [
'class' => ''
];
return '<img src = "' . ($external ? $name : PO_PATH_IMG . '/' . $name) . '" ' . Str::htmlserialize($cfg) . ' />';
} | php | public function img($name, array $options = [], $external = FALSE) {
$cfg = $options + [
'class' => ''
];
return '<img src = "' . ($external ? $name : PO_PATH_IMG . '/' . $name) . '" ' . Str::htmlserialize($cfg) . ' />';
} | [
"public",
"function",
"img",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"external",
"=",
"FALSE",
")",
"{",
"$",
"cfg",
"=",
"$",
"options",
"+",
"[",
"'class'",
"=>",
"''",
"]",
";",
"return",
"'<img src = \"'",
".",
... | Crea una imagen
@param string $name el nombre del archivo
@param array $options [Opcional] las opciones
@param boolean $external [Opcional] Especifica si se trata de una imagen externa
@return string una etiqueta img | [
"Crea",
"una",
"imagen"
] | 6d300764d7b3a090dd674b25415ce5088156ce8b | https://github.com/PowerOnSystem/HelperService/blob/6d300764d7b3a090dd674b25415ce5088156ce8b/src/HtmlHelper.php#L183-L189 |
238,632 | PowerOnSystem/HelperService | src/HtmlHelper.php | HtmlHelper.nestedList | public function nestedList(array $list, array $options = [], array $item_options = [], $type_list = 'list') {
$type = $type_list == 'list' ? 'ul' : 'ol';
$r = '<' . $type . ' ' . Str::htmlserialize($options) . '>';
foreach ($list as $key => $l) {
$r .= is_array($l) ? $this->neste... | php | public function nestedList(array $list, array $options = [], array $item_options = [], $type_list = 'list') {
$type = $type_list == 'list' ? 'ul' : 'ol';
$r = '<' . $type . ' ' . Str::htmlserialize($options) . '>';
foreach ($list as $key => $l) {
$r .= is_array($l) ? $this->neste... | [
"public",
"function",
"nestedList",
"(",
"array",
"$",
"list",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"array",
"$",
"item_options",
"=",
"[",
"]",
",",
"$",
"type_list",
"=",
"'list'",
")",
"{",
"$",
"type",
"=",
"$",
"type_list",
"==",
... | Crea una lista simple u ordenada
@param array $list Array con la lista completa, puede ser un array multidimencional
@param array $options [Opcional] Opciones de la lista Ej: <code>$options = ['class' => 'my_list', 'id' => 'mylist1']</code>
@param array $item_options [Opcional] Opciones de un item específico Ej: <code>... | [
"Crea",
"una",
"lista",
"simple",
"u",
"ordenada"
] | 6d300764d7b3a090dd674b25415ce5088156ce8b | https://github.com/PowerOnSystem/HelperService/blob/6d300764d7b3a090dd674b25415ce5088156ce8b/src/HtmlHelper.php#L199-L211 |
238,633 | Aureja/JobQueue | src/JobFactoryRegistry.php | JobFactoryRegistry.get | public function get($name)
{
if (isset($this->factories[$name])) {
return $this->factories[$name];
}
throw JobFactoryException::create(sprintf('Not found %s job factory', $name));
} | php | public function get($name)
{
if (isset($this->factories[$name])) {
return $this->factories[$name];
}
throw JobFactoryException::create(sprintf('Not found %s job factory', $name));
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"factories",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"factories",
"[",
"$",
"name",
"]",
";",
"}",
"throw",
"JobFactor... | Get factory.
@param string $name
@return JobFactoryInterface
@throws JobFactoryException | [
"Get",
"factory",
"."
] | 0e488ca123d3105cf791173e3147ede1bcf39018 | https://github.com/Aureja/JobQueue/blob/0e488ca123d3105cf791173e3147ede1bcf39018/src/JobFactoryRegistry.php#L56-L63 |
238,634 | easy-system/es-error | src/ErrorListenerFactory.php | ErrorListenerFactory.make | public static function make()
{
$services = Provider::getServices();
$config = $services->get('Config');
$strategies = [];
if (isset($config['error']['strategies'])) {
$strategies = (array) $config['error']['strategies'];
}
$listener = new ErrorListener;
... | php | public static function make()
{
$services = Provider::getServices();
$config = $services->get('Config');
$strategies = [];
if (isset($config['error']['strategies'])) {
$strategies = (array) $config['error']['strategies'];
}
$listener = new ErrorListener;
... | [
"public",
"static",
"function",
"make",
"(",
")",
"{",
"$",
"services",
"=",
"Provider",
"::",
"getServices",
"(",
")",
";",
"$",
"config",
"=",
"$",
"services",
"->",
"get",
"(",
"'Config'",
")",
";",
"$",
"strategies",
"=",
"[",
"]",
";",
"if",
"... | Makes the error listener.
@return \Es\Error\ErrorListener The error listener | [
"Makes",
"the",
"error",
"listener",
"."
] | 5248c52f2992acc9ddf3542092ad7bbbb440e621 | https://github.com/easy-system/es-error/blob/5248c52f2992acc9ddf3542092ad7bbbb440e621/src/ErrorListenerFactory.php#L24-L39 |
238,635 | yii2module/yii2-encrypt | src/console/controllers/CoderController.php | CoderController.actionEncode | public function actionEncode()
{
$text = Enter::display('Enter text');
$encrypted = \App::$domain->encrypt->coder->encode($text);
Output::block($encrypted, 'Encrypted');
} | php | public function actionEncode()
{
$text = Enter::display('Enter text');
$encrypted = \App::$domain->encrypt->coder->encode($text);
Output::block($encrypted, 'Encrypted');
} | [
"public",
"function",
"actionEncode",
"(",
")",
"{",
"$",
"text",
"=",
"Enter",
"::",
"display",
"(",
"'Enter text'",
")",
";",
"$",
"encrypted",
"=",
"\\",
"App",
"::",
"$",
"domain",
"->",
"encrypt",
"->",
"coder",
"->",
"encode",
"(",
"$",
"text",
... | encryption of data | [
"encryption",
"of",
"data"
] | 47ec61161ab24ddf84bb456f27c9ee9704285801 | https://github.com/yii2module/yii2-encrypt/blob/47ec61161ab24ddf84bb456f27c9ee9704285801/src/console/controllers/CoderController.php#L19-L24 |
238,636 | yii2module/yii2-encrypt | src/console/controllers/CoderController.php | CoderController.actionDecode | public function actionDecode()
{
$encrypted = Enter::display('Enter encrypted');
$text = \App::$domain->encrypt->coder->decode($encrypted);
Output::block($text, 'Text');
} | php | public function actionDecode()
{
$encrypted = Enter::display('Enter encrypted');
$text = \App::$domain->encrypt->coder->decode($encrypted);
Output::block($text, 'Text');
} | [
"public",
"function",
"actionDecode",
"(",
")",
"{",
"$",
"encrypted",
"=",
"Enter",
"::",
"display",
"(",
"'Enter encrypted'",
")",
";",
"$",
"text",
"=",
"\\",
"App",
"::",
"$",
"domain",
"->",
"encrypt",
"->",
"coder",
"->",
"decode",
"(",
"$",
"enc... | decryption of data | [
"decryption",
"of",
"data"
] | 47ec61161ab24ddf84bb456f27c9ee9704285801 | https://github.com/yii2module/yii2-encrypt/blob/47ec61161ab24ddf84bb456f27c9ee9704285801/src/console/controllers/CoderController.php#L29-L34 |
238,637 | hmlb/date | src/Translation/DateLocalizationCapabilities.php | DateLocalizationCapabilities.translator | protected static function translator()
{
if (static::$translator === null) {
$translator = new Translator('en');
$translator->addLoader('array', new ArrayLoader());
static::$translator = $translator;
static::setLocale('en');
}
return static::$... | php | protected static function translator()
{
if (static::$translator === null) {
$translator = new Translator('en');
$translator->addLoader('array', new ArrayLoader());
static::$translator = $translator;
static::setLocale('en');
}
return static::$... | [
"protected",
"static",
"function",
"translator",
"(",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"translator",
"===",
"null",
")",
"{",
"$",
"translator",
"=",
"new",
"Translator",
"(",
"'en'",
")",
";",
"$",
"translator",
"->",
"addLoader",
"(",
"'array'... | Intialize the translator instance if necessary.
@return TranslatorInterface | [
"Intialize",
"the",
"translator",
"instance",
"if",
"necessary",
"."
] | 54ddca80fa4ef7d4a617812e10c291f142a164c0 | https://github.com/hmlb/date/blob/54ddca80fa4ef7d4a617812e10c291f142a164c0/src/Translation/DateLocalizationCapabilities.php#L32-L42 |
238,638 | osflab/view | Helper/Bootstrap/Accordion.php | Accordion.render | protected function render()
{
if (!isset($this->items[0])) {
return '';
}
foreach ($this->items as $itemId => $item) {
$item->setCollapsable(
self::$id,
self::$id . $itemId,
in_array($itemId, $this->openedItems));
... | php | protected function render()
{
if (!isset($this->items[0])) {
return '';
}
foreach ($this->items as $itemId => $item) {
$item->setCollapsable(
self::$id,
self::$id . $itemId,
in_array($itemId, $this->openedItems));
... | [
"protected",
"function",
"render",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"0",
"]",
")",
")",
"{",
"return",
"''",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"itemId",
"=>",
"$",
"ite... | Display the box at the end of configuration
@return string | [
"Display",
"the",
"box",
"at",
"the",
"end",
"of",
"configuration"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Accordion.php#L60-L78 |
238,639 | marando/phpSOFA | src/Marando/IAU/iauRy.php | iauRy.Ry | public static function Ry($theta, array &$r) {
$s;
$c;
$a00;
$a01;
$a02;
$a20;
$a21;
$a22;
$s = sin($theta);
$c = cos($theta);
$a00 = $c * $r[0][0] - $s * $r[2][0];
$a01 = $c * $r[0][1] - $s * $r[2][1];
$a02 = $c * $r[0][2] - $s * $r[2][2];
$a20 = $s * $r[0][0] ... | php | public static function Ry($theta, array &$r) {
$s;
$c;
$a00;
$a01;
$a02;
$a20;
$a21;
$a22;
$s = sin($theta);
$c = cos($theta);
$a00 = $c * $r[0][0] - $s * $r[2][0];
$a01 = $c * $r[0][1] - $s * $r[2][1];
$a02 = $c * $r[0][2] - $s * $r[2][2];
$a20 = $s * $r[0][0] ... | [
"public",
"static",
"function",
"Ry",
"(",
"$",
"theta",
",",
"array",
"&",
"$",
"r",
")",
"{",
"$",
"s",
";",
"$",
"c",
";",
"$",
"a00",
";",
"$",
"a01",
";",
"$",
"a02",
";",
"$",
"a20",
";",
"$",
"a21",
";",
"$",
"a22",
";",
"$",
"s",
... | - - - - - -
i a u R y
- - - - - -
Rotate an r-matrix about the y-axis.
This function is part of the International Astronomical Union's
SOFA (Standards Of Fundamental Astronomy) software collection.
Status: vector/matrix support function.
Given:
theta double angle (radians)
Given and returned:
r dou... | [
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"R",
"y",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauRy.php#L45-L73 |
238,640 | tekkla/core-html | Core/Html/Bootstrap/Navbar/AbstractNavbarElement.php | AbstractNavbarElement.isActive | final public function isActive($active = null)
{
if (isset($active)) {
$this->active = (bool) $active;
return $this;
}
else {
return $this->active;
}
} | php | final public function isActive($active = null)
{
if (isset($active)) {
$this->active = (bool) $active;
return $this;
}
else {
return $this->active;
}
} | [
"final",
"public",
"function",
"isActive",
"(",
"$",
"active",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"active",
")",
")",
"{",
"$",
"this",
"->",
"active",
"=",
"(",
"bool",
")",
"$",
"active",
";",
"return",
"$",
"this",
";",
"}",
... | Sets or gets active state of element
@param bool $active
@return \Core\Html\Bootstrap\Navbar\NavbarElementAbstract|boolean | [
"Sets",
"or",
"gets",
"active",
"state",
"of",
"element"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/Bootstrap/Navbar/AbstractNavbarElement.php#L41-L50 |
238,641 | n0m4dz/laracasa | Zend/Gdata/Calendar.php | Zend_Gdata_Calendar.getCalendarEventFeed | public function getCalendarEventFeed($location = null)
{
if ($location == null) {
$uri = self::CALENDAR_EVENT_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
return... | php | public function getCalendarEventFeed($location = null)
{
if ($location == null) {
$uri = self::CALENDAR_EVENT_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
return... | [
"public",
"function",
"getCalendarEventFeed",
"(",
"$",
"location",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"location",
"==",
"null",
")",
"{",
"$",
"uri",
"=",
"self",
"::",
"CALENDAR_EVENT_FEED_URI",
";",
"}",
"else",
"if",
"(",
"$",
"location",
"instan... | Retreive feed object
@param mixed $location The location for the feed, as a URL or Query
@return Zend_Gdata_Calendar_EventFeed | [
"Retreive",
"feed",
"object"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Calendar.php#L98-L108 |
238,642 | brisum/php-lib-object-manager | src/ObjectManager.php | ObjectManager.get | public function get($class)
{
$class = ltrim($class, '\\');
if (!isset($this->sharedInstances[$class])) {
$this->sharedInstances[$class] = $this->create($class);
}
return $this->sharedInstances[$class];
} | php | public function get($class)
{
$class = ltrim($class, '\\');
if (!isset($this->sharedInstances[$class])) {
$this->sharedInstances[$class] = $this->create($class);
}
return $this->sharedInstances[$class];
} | [
"public",
"function",
"get",
"(",
"$",
"class",
")",
"{",
"$",
"class",
"=",
"ltrim",
"(",
"$",
"class",
",",
"'\\\\'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"sharedInstances",
"[",
"$",
"class",
"]",
")",
")",
"{",
"$",
"t... | Get object from shared instances by class name.
@param string $class
@return mixed | [
"Get",
"object",
"from",
"shared",
"instances",
"by",
"class",
"name",
"."
] | 9d2326a4c4665ec9b8003ef1389f1f55cb4344ec | https://github.com/brisum/php-lib-object-manager/blob/9d2326a4c4665ec9b8003ef1389f1f55cb4344ec/src/ObjectManager.php#L89-L97 |
238,643 | brisum/php-lib-object-manager | src/ObjectManager.php | ObjectManager.invoke | public function invoke($object, $method, array $arguments = [])
{
$reflection = new \ReflectionClass($object);
$method = $reflection->getMethod($method);
$args = $this->resolveArguments($method, $arguments);
return $method->invokeArgs($object, $args);
} | php | public function invoke($object, $method, array $arguments = [])
{
$reflection = new \ReflectionClass($object);
$method = $reflection->getMethod($method);
$args = $this->resolveArguments($method, $arguments);
return $method->invokeArgs($object, $args);
} | [
"public",
"function",
"invoke",
"(",
"$",
"object",
",",
"$",
"method",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"object",
")",
";",
"$",
"method",
"=",
"$",
"reflectio... | Invoke method of object.
@param mixed $object
@param string $method
@param array $arguments
@return mixed | [
"Invoke",
"method",
"of",
"object",
"."
] | 9d2326a4c4665ec9b8003ef1389f1f55cb4344ec | https://github.com/brisum/php-lib-object-manager/blob/9d2326a4c4665ec9b8003ef1389f1f55cb4344ec/src/ObjectManager.php#L179-L186 |
238,644 | brisum/php-lib-object-manager | src/ObjectManager.php | ObjectManager.resolveArguments | protected function resolveArguments(
ReflectionMethod $method,
array $arguments
) {
$params = $method->getParameters();
$result = [];
foreach ($params as $param) {
/** @var ReflectionParameter $param */
if (isset($arguments[$param->name])) {
... | php | protected function resolveArguments(
ReflectionMethod $method,
array $arguments
) {
$params = $method->getParameters();
$result = [];
foreach ($params as $param) {
/** @var ReflectionParameter $param */
if (isset($arguments[$param->name])) {
... | [
"protected",
"function",
"resolveArguments",
"(",
"ReflectionMethod",
"$",
"method",
",",
"array",
"$",
"arguments",
")",
"{",
"$",
"params",
"=",
"$",
"method",
"->",
"getParameters",
"(",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$"... | Resolve argument of method.
@param ReflectionMethod $method
@param array $arguments
@return array | [
"Resolve",
"argument",
"of",
"method",
"."
] | 9d2326a4c4665ec9b8003ef1389f1f55cb4344ec | https://github.com/brisum/php-lib-object-manager/blob/9d2326a4c4665ec9b8003ef1389f1f55cb4344ec/src/ObjectManager.php#L195-L223 |
238,645 | tenside/core-bundle | src/Controller/VersionConstraintController.php | VersionConstraintController.checkVersionConstraintAction | public function checkVersionConstraintAction(Request $request)
{
try {
$inputData = new JsonArray($request->getContent());
} catch (\Exception $exception) {
return new JsonResponse(
[
'status' => 'ERROR',
'error' => 'in... | php | public function checkVersionConstraintAction(Request $request)
{
try {
$inputData = new JsonArray($request->getContent());
} catch (\Exception $exception) {
return new JsonResponse(
[
'status' => 'ERROR',
'error' => 'in... | [
"public",
"function",
"checkVersionConstraintAction",
"(",
"Request",
"$",
"request",
")",
"{",
"try",
"{",
"$",
"inputData",
"=",
"new",
"JsonArray",
"(",
"$",
"request",
"->",
"getContent",
"(",
")",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
... | Try to validate the version constraint.
@param Request $request The request.
@return JsonResponse
@throws \RuntimeException For invalid user classes.
@ApiDoc(
section="misc",
statusCodes = {
200 = "When everything worked out ok",
400 = "When the request payload was invalid."
},
authentication = true,
authentication... | [
"Try",
"to",
"validate",
"the",
"version",
"constraint",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/Controller/VersionConstraintController.php#L77-L121 |
238,646 | indigophp-archive/fuel-core | classes/theme.php | Theme.set_config | public function set_config($key, $value = null)
{
if (is_array($key))
{
$this->config = \Arr::merge($this->config, $key);
}
else
{
\Arr::set($this->config, $key, $value);
}
return $this;
} | php | public function set_config($key, $value = null)
{
if (is_array($key))
{
$this->config = \Arr::merge($this->config, $key);
}
else
{
\Arr::set($this->config, $key, $value);
}
return $this;
} | [
"public",
"function",
"set_config",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"\\",
"Arr",
"::",
"merge",
"(",
"$",
"this",
"->",
"config",
... | Sets a config item
@param mixed $key Config key or array to merge
@param mixed $value Config value
@return this | [
"Sets",
"a",
"config",
"item"
] | 275462154fb7937f8e1c2c541b31d8e7c5760e39 | https://github.com/indigophp-archive/fuel-core/blob/275462154fb7937f8e1c2c541b31d8e7c5760e39/classes/theme.php#L42-L54 |
238,647 | indigophp-archive/fuel-core | classes/theme.php | Theme.get_parent_themes | public function get_parent_themes($theme_name)
{
$return = array($this->create_theme_array($theme_name));
$theme_info = $this->load_info($theme_name);
if ( ! empty($theme_info['parent']))
{
$return = array_merge($return, $this->get_parent_themes($theme_info['parent']));
}
elseif($theme_name !== $this->... | php | public function get_parent_themes($theme_name)
{
$return = array($this->create_theme_array($theme_name));
$theme_info = $this->load_info($theme_name);
if ( ! empty($theme_info['parent']))
{
$return = array_merge($return, $this->get_parent_themes($theme_info['parent']));
}
elseif($theme_name !== $this->... | [
"public",
"function",
"get_parent_themes",
"(",
"$",
"theme_name",
")",
"{",
"$",
"return",
"=",
"array",
"(",
"$",
"this",
"->",
"create_theme_array",
"(",
"$",
"theme_name",
")",
")",
";",
"$",
"theme_info",
"=",
"$",
"this",
"->",
"load_info",
"(",
"$... | Returns parent theme info
@param string $theme_name
@return array | [
"Returns",
"parent",
"theme",
"info"
] | 275462154fb7937f8e1c2c541b31d8e7c5760e39 | https://github.com/indigophp-archive/fuel-core/blob/275462154fb7937f8e1c2c541b31d8e7c5760e39/classes/theme.php#L129-L144 |
238,648 | indigophp-archive/fuel-core | classes/theme.php | Theme.asset_url | public function asset_url($path)
{
$url = $this->asset_path($path);
if (filter_var($url, FILTER_VALIDATE_URL) === false)
{
$url = \Uri::create($url);
}
return $url;
} | php | public function asset_url($path)
{
$url = $this->asset_path($path);
if (filter_var($url, FILTER_VALIDATE_URL) === false)
{
$url = \Uri::create($url);
}
return $url;
} | [
"public",
"function",
"asset_url",
"(",
"$",
"path",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"asset_path",
"(",
"$",
"path",
")",
";",
"if",
"(",
"filter_var",
"(",
"$",
"url",
",",
"FILTER_VALIDATE_URL",
")",
"===",
"false",
")",
"{",
"$",
"... | Returns an absolute URL to asset
@param string $path
@return string | [
"Returns",
"an",
"absolute",
"URL",
"to",
"asset"
] | 275462154fb7937f8e1c2c541b31d8e7c5760e39 | https://github.com/indigophp-archive/fuel-core/blob/275462154fb7937f8e1c2c541b31d8e7c5760e39/classes/theme.php#L153-L163 |
238,649 | wp-pluginner/framework | src/Container.php | Container.loadRoutes | public function loadRoutes()
{
if ($this->bound('router')) {
/**
* Use Cached Routes if Available
*/
if ($this['config']->get('routes.cache') && $this['files']->exists($this['config']->get('routes.compiled'))) {
$contents = $this['files']->get($this['config']->get('routes.compiled'));
if (!emp... | php | public function loadRoutes()
{
if ($this->bound('router')) {
/**
* Use Cached Routes if Available
*/
if ($this['config']->get('routes.cache') && $this['files']->exists($this['config']->get('routes.compiled'))) {
$contents = $this['files']->get($this['config']->get('routes.compiled'));
if (!emp... | [
"public",
"function",
"loadRoutes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"bound",
"(",
"'router'",
")",
")",
"{",
"/**\n\t\t\t * Use Cached Routes if Available\n\t\t\t */",
"if",
"(",
"$",
"this",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'routes.cache'... | Load Routes into Router | [
"Load",
"Routes",
"into",
"Router"
] | 557d62674acf6ca43b2523f8d4a0aa0dbf8e674d | https://github.com/wp-pluginner/framework/blob/557d62674acf6ca43b2523f8d4a0aa0dbf8e674d/src/Container.php#L101-L155 |
238,650 | wp-pluginner/framework | src/Container.php | Container.routeRequest | public function routeRequest()
{
if($this->bound('router')){
try {
$pluginRequest = $this['request'];
$this['router']->matched(function ($event) {
global $wp_query;
$wp_query->is_404 = false;
$this->route_dispatched = true;
});
$response = $this['router']->dispatch($pluginRequest);
... | php | public function routeRequest()
{
if($this->bound('router')){
try {
$pluginRequest = $this['request'];
$this['router']->matched(function ($event) {
global $wp_query;
$wp_query->is_404 = false;
$this->route_dispatched = true;
});
$response = $this['router']->dispatch($pluginRequest);
... | [
"public",
"function",
"routeRequest",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"bound",
"(",
"'router'",
")",
")",
"{",
"try",
"{",
"$",
"pluginRequest",
"=",
"$",
"this",
"[",
"'request'",
"]",
";",
"$",
"this",
"[",
"'router'",
"]",
"->",
"ma... | Try Routing Requests | [
"Try",
"Routing",
"Requests"
] | 557d62674acf6ca43b2523f8d4a0aa0dbf8e674d | https://github.com/wp-pluginner/framework/blob/557d62674acf6ca43b2523f8d4a0aa0dbf8e674d/src/Container.php#L159-L191 |
238,651 | benkle-libs/feed-parser | src/Parser.php | Parser.parse | public function parse(\DOMDocument $dom)
{
$feed = $this->getStandard()->newFeed();
$rootNode = $this->getStandard()->getRootNode($dom);
$this->parseNodeChildren($rootNode, $feed);
return $feed;
} | php | public function parse(\DOMDocument $dom)
{
$feed = $this->getStandard()->newFeed();
$rootNode = $this->getStandard()->getRootNode($dom);
$this->parseNodeChildren($rootNode, $feed);
return $feed;
} | [
"public",
"function",
"parse",
"(",
"\\",
"DOMDocument",
"$",
"dom",
")",
"{",
"$",
"feed",
"=",
"$",
"this",
"->",
"getStandard",
"(",
")",
"->",
"newFeed",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"this",
"->",
"getStandard",
"(",
")",
"->",
"ge... | Turn a dom document into a feed object.
@param \DOMDocument $dom
@return FeedInterface
@throws InvalidNumberOfRootTagsException | [
"Turn",
"a",
"dom",
"document",
"into",
"a",
"feed",
"object",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Parser.php#L63-L69 |
238,652 | benkle-libs/feed-parser | src/Parser.php | Parser.parseNodeChildren | public function parseNodeChildren(\DOMNode $node, NodeInterface $target)
{
$rules = $this->getStandard()->getRules();
foreach ($node->childNodes as $childNode) {
/** @var RuleInterface $rule */
foreach ($rules as $rule) {
if ($rule->canHandle($childNode, $targ... | php | public function parseNodeChildren(\DOMNode $node, NodeInterface $target)
{
$rules = $this->getStandard()->getRules();
foreach ($node->childNodes as $childNode) {
/** @var RuleInterface $rule */
foreach ($rules as $rule) {
if ($rule->canHandle($childNode, $targ... | [
"public",
"function",
"parseNodeChildren",
"(",
"\\",
"DOMNode",
"$",
"node",
",",
"NodeInterface",
"$",
"target",
")",
"{",
"$",
"rules",
"=",
"$",
"this",
"->",
"getStandard",
"(",
")",
"->",
"getRules",
"(",
")",
";",
"foreach",
"(",
"$",
"node",
"-... | Parse the children of a given node.
@param \DOMNode $node
@param NodeInterface $target | [
"Parse",
"the",
"children",
"of",
"a",
"given",
"node",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Parser.php#L76-L88 |
238,653 | infusephp/rest-api | src/Libs/ApiRoute.php | ApiRoute.getQuery | public function getQuery($index = false)
{
return ($index) ? array_value($this->query, $index) : $this->query;
} | php | public function getQuery($index = false)
{
return ($index) ? array_value($this->query, $index) : $this->query;
} | [
"public",
"function",
"getQuery",
"(",
"$",
"index",
"=",
"false",
")",
"{",
"return",
"(",
"$",
"index",
")",
"?",
"array_value",
"(",
"$",
"this",
"->",
"query",
",",
"$",
"index",
")",
":",
"$",
"this",
"->",
"query",
";",
"}"
] | Gets one or all query parameters.
@param string $index
@return mixed | [
"Gets",
"one",
"or",
"all",
"query",
"parameters",
"."
] | 3a02152048ea38ec5f0adaed3f10a17730086ec7 | https://github.com/infusephp/rest-api/blob/3a02152048ea38ec5f0adaed3f10a17730086ec7/src/Libs/ApiRoute.php#L177-L180 |
238,654 | ARCANESOFT/Tracker | src/ViewComposers/Dashboard/ReferersListComposer.php | ReferersListComposer.calculateLanguagesPercentage | private function calculateLanguagesPercentage($referers)
{
$total = $referers->sum('count');
return $referers->transform(function ($item) use ($total) {
return $item + [
'percentage' => round(($item['count'] / $total) * 100, 2)
];
});
} | php | private function calculateLanguagesPercentage($referers)
{
$total = $referers->sum('count');
return $referers->transform(function ($item) use ($total) {
return $item + [
'percentage' => round(($item['count'] / $total) * 100, 2)
];
});
} | [
"private",
"function",
"calculateLanguagesPercentage",
"(",
"$",
"referers",
")",
"{",
"$",
"total",
"=",
"$",
"referers",
"->",
"sum",
"(",
"'count'",
")",
";",
"return",
"$",
"referers",
"->",
"transform",
"(",
"function",
"(",
"$",
"item",
")",
"use",
... | Calculate the referers percentage.
@param \Illuminate\Support\Collection $referers
@return \Illuminate\Support\Collection | [
"Calculate",
"the",
"referers",
"percentage",
"."
] | d106209b32ddbb192066715f0ef99afccfc22dcb | https://github.com/ARCANESOFT/Tracker/blob/d106209b32ddbb192066715f0ef99afccfc22dcb/src/ViewComposers/Dashboard/ReferersListComposer.php#L88-L97 |
238,655 | cmdweb/kernel | Kernel/Database.php | Database.select | public function select($sql, $class = "", $all = FALSE, $array = array())
{
// Prepara a Query
$sth = $this->prepare($sql);
// Define os dados do Where, se existirem.
foreach ($array as $key => $value) {
// Se o tipo do dado for inteiro, usa PDO::PARAM_INT, caso contr�ri... | php | public function select($sql, $class = "", $all = FALSE, $array = array())
{
// Prepara a Query
$sth = $this->prepare($sql);
// Define os dados do Where, se existirem.
foreach ($array as $key => $value) {
// Se o tipo do dado for inteiro, usa PDO::PARAM_INT, caso contr�ri... | [
"public",
"function",
"select",
"(",
"$",
"sql",
",",
"$",
"class",
"=",
"\"\"",
",",
"$",
"all",
"=",
"FALSE",
",",
"$",
"array",
"=",
"array",
"(",
")",
")",
"{",
"// Prepara a Query",
"$",
"sth",
"=",
"$",
"this",
"->",
"prepare",
"(",
"$",
"s... | Executa um select no banco
@param $sql - query
@param string $class - Classe de retorno
@param bool $all - Se quando retornar apenas um resultado vai voltar em um array ou um objeto unico (true = objeto)
@param array $array - Paramentos do PDO
@return array|mixed|null | [
"Executa",
"um",
"select",
"no",
"banco"
] | 01dfc802c582adac1a739bcb34e4c31d86cde268 | https://github.com/cmdweb/kernel/blob/01dfc802c582adac1a739bcb34e4c31d86cde268/Kernel/Database.php#L44-L86 |
238,656 | cmdweb/kernel | Kernel/Database.php | Database.ExecuteInsert | public function ExecuteInsert($table, $data)
{
if (is_object($data))
ModelState::ModelTreatment($data);
$data = (array)$data;
// Ordena
ksort($data);
// Campos e valores
$camposNomes = implode('`, `', array_keys($data));
... | php | public function ExecuteInsert($table, $data)
{
if (is_object($data))
ModelState::ModelTreatment($data);
$data = (array)$data;
// Ordena
ksort($data);
// Campos e valores
$camposNomes = implode('`, `', array_keys($data));
... | [
"public",
"function",
"ExecuteInsert",
"(",
"$",
"table",
",",
"$",
"data",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"ModelState",
"::",
"ModelTreatment",
"(",
"$",
"data",
")",
";",
"$",
"data",
"=",
"(",
"array",
")",
"$",
"d... | Executa um INSERT no banco
@param $table - Noma da Tabela
@param $data - Array com os dados do insert
@return string - id inserido no banco | [
"Executa",
"um",
"INSERT",
"no",
"banco"
] | 01dfc802c582adac1a739bcb34e4c31d86cde268 | https://github.com/cmdweb/kernel/blob/01dfc802c582adac1a739bcb34e4c31d86cde268/Kernel/Database.php#L105-L136 |
238,657 | cmdweb/kernel | Kernel/Database.php | Database.ExecuteUpdate | public function ExecuteUpdate($table, $data, $where)
{
if (is_object($data))
ModelState::ModelTreatment($data);
$data = (array)$data;
// Ordena
ksort($data);
// Define os dados que ser�o atualizados
$novosDados = NULL;
foreach ($data as $key => ... | php | public function ExecuteUpdate($table, $data, $where)
{
if (is_object($data))
ModelState::ModelTreatment($data);
$data = (array)$data;
// Ordena
ksort($data);
// Define os dados que ser�o atualizados
$novosDados = NULL;
foreach ($data as $key => ... | [
"public",
"function",
"ExecuteUpdate",
"(",
"$",
"table",
",",
"$",
"data",
",",
"$",
"where",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"data",
")",
")",
"ModelState",
"::",
"ModelTreatment",
"(",
"$",
"data",
")",
";",
"$",
"data",
"=",
"(",
"a... | Executa com UPDATE no banco
@param $table - Nome da Tabela
@param $data - Dados que vão ser atualizados
@param $where - WHERE da query do update
@return bool - Sucesso ou falha | [
"Executa",
"com",
"UPDATE",
"no",
"banco"
] | 01dfc802c582adac1a739bcb34e4c31d86cde268 | https://github.com/cmdweb/kernel/blob/01dfc802c582adac1a739bcb34e4c31d86cde268/Kernel/Database.php#L145-L177 |
238,658 | kengoldfarb/underscore_libs | src/_Libs/_ServiceResponse.php | _ServiceResponse._success | public static function _success($objects, $echoResponse = TRUE, $format = 'json') {
return self::_doResponse('success', $objects, $echoResponse, $format);
} | php | public static function _success($objects, $echoResponse = TRUE, $format = 'json') {
return self::_doResponse('success', $objects, $echoResponse, $format);
} | [
"public",
"static",
"function",
"_success",
"(",
"$",
"objects",
",",
"$",
"echoResponse",
"=",
"TRUE",
",",
"$",
"format",
"=",
"'json'",
")",
"{",
"return",
"self",
"::",
"_doResponse",
"(",
"'success'",
",",
"$",
"objects",
",",
"$",
"echoResponse",
"... | Create a service response of success
@param array $objects An object or array of objects
@param bool $echoResponse Whether to echo out of response
@param string $format 'json' or 'xml'
@return string The response | [
"Create",
"a",
"service",
"response",
"of",
"success"
] | e0d584f25093b594e67b8a3068ebd41c7f6483c5 | https://github.com/kengoldfarb/underscore_libs/blob/e0d584f25093b594e67b8a3068ebd41c7f6483c5/src/_Libs/_ServiceResponse.php#L37-L39 |
238,659 | kengoldfarb/underscore_libs | src/_Libs/_ServiceResponse.php | _ServiceResponse._failure | public static function _failure($objects, $echoResponse = TRUE, $format = 'json') {
return self::_doResponse('failure', $objects, $echoResponse, $format);
} | php | public static function _failure($objects, $echoResponse = TRUE, $format = 'json') {
return self::_doResponse('failure', $objects, $echoResponse, $format);
} | [
"public",
"static",
"function",
"_failure",
"(",
"$",
"objects",
",",
"$",
"echoResponse",
"=",
"TRUE",
",",
"$",
"format",
"=",
"'json'",
")",
"{",
"return",
"self",
"::",
"_doResponse",
"(",
"'failure'",
",",
"$",
"objects",
",",
"$",
"echoResponse",
"... | Create a service response of failure
@param array $objects An object or array of objects
@param bool $echoResponse Whether to echo out of response
@param const $format _ServiceResponse_JSON or _ServiceResponse_XML
@return string The response | [
"Create",
"a",
"service",
"response",
"of",
"failure"
] | e0d584f25093b594e67b8a3068ebd41c7f6483c5 | https://github.com/kengoldfarb/underscore_libs/blob/e0d584f25093b594e67b8a3068ebd41c7f6483c5/src/_Libs/_ServiceResponse.php#L49-L51 |
238,660 | kengoldfarb/underscore_libs | src/_Libs/_ServiceResponse.php | _ServiceResponse._doResponse | private static function _doResponse($type, $objects, $echoResponse, $format) {
$ret = array();
$ret['status'] = $type;
if (is_array($objects)) {
foreach ($objects as $k => $v) {
$ret[$k] = $v;
}
} else {
$ret[] = $objects;
}
... | php | private static function _doResponse($type, $objects, $echoResponse, $format) {
$ret = array();
$ret['status'] = $type;
if (is_array($objects)) {
foreach ($objects as $k => $v) {
$ret[$k] = $v;
}
} else {
$ret[] = $objects;
}
... | [
"private",
"static",
"function",
"_doResponse",
"(",
"$",
"type",
",",
"$",
"objects",
",",
"$",
"echoResponse",
",",
"$",
"format",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"$",
"ret",
"[",
"'status'",
"]",
"=",
"$",
"type",
";",
"if",
... | Builds the response
@param type $type
@param type $objects
@param type $echoResponse
@param type $format
@return type | [
"Builds",
"the",
"response"
] | e0d584f25093b594e67b8a3068ebd41c7f6483c5 | https://github.com/kengoldfarb/underscore_libs/blob/e0d584f25093b594e67b8a3068ebd41c7f6483c5/src/_Libs/_ServiceResponse.php#L62-L107 |
238,661 | CatLabInteractive/Neuron | src/Neuron/Config.php | Config.loadFile | private function loadFile ($file)
{
if (!isset ($this->files[$file]))
{
$filename = $this->folder . $file . '.php';
// First load these
if (file_exists ($filename))
{
$this->files[$file] = include ($filename);
}
// Now overload with environment values
if (isset ($this->environment))
{... | php | private function loadFile ($file)
{
if (!isset ($this->files[$file]))
{
$filename = $this->folder . $file . '.php';
// First load these
if (file_exists ($filename))
{
$this->files[$file] = include ($filename);
}
// Now overload with environment values
if (isset ($this->environment))
{... | [
"private",
"function",
"loadFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"files",
"[",
"$",
"file",
"]",
")",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"folder",
".",
"$",
"file",
".",
"'.php'",
"... | Load a file in case it's not loaded yet.
@param $file | [
"Load",
"a",
"file",
"in",
"case",
"it",
"s",
"not",
"loaded",
"yet",
"."
] | 67dca5349891e23b31a96dcdead893b9491a1b8b | https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Config.php#L87-L110 |
238,662 | CatLabInteractive/Neuron | src/Neuron/Config.php | Config.getValue | private function getValue ($name, $default)
{
$parts = explode ('.', $name);
$file = array_shift ($parts);
$this->loadFile ($file);
if (! isset ($this->files[$file])) {
return $default;
}
else {
$out = $this->files[$file];
foreach ($parts as $part)
{
if (!isset ($out[$part]))
{
r... | php | private function getValue ($name, $default)
{
$parts = explode ('.', $name);
$file = array_shift ($parts);
$this->loadFile ($file);
if (! isset ($this->files[$file])) {
return $default;
}
else {
$out = $this->files[$file];
foreach ($parts as $part)
{
if (!isset ($out[$part]))
{
r... | [
"private",
"function",
"getValue",
"(",
"$",
"name",
",",
"$",
"default",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"name",
")",
";",
"$",
"file",
"=",
"array_shift",
"(",
"$",
"parts",
")",
";",
"$",
"this",
"->",
"loadFile",
... | Find a config variable and return it.
@param string $name
@param string $default
@return mixed | [
"Find",
"a",
"config",
"variable",
"and",
"return",
"it",
"."
] | 67dca5349891e23b31a96dcdead893b9491a1b8b | https://github.com/CatLabInteractive/Neuron/blob/67dca5349891e23b31a96dcdead893b9491a1b8b/src/Neuron/Config.php#L127-L152 |
238,663 | jepihumet/libs | src/FileManager.php | FileManager.expandDirectories | public function expandDirectories($baseDir) {
$directories = array();
foreach (scandir($baseDir) as $file) {
if ($file == '.' || $file == '..')
continue;
$dir = $baseDir . DS . $file;
if (is_dir($dir)) {
$directories [] = $dir;
... | php | public function expandDirectories($baseDir) {
$directories = array();
foreach (scandir($baseDir) as $file) {
if ($file == '.' || $file == '..')
continue;
$dir = $baseDir . DS . $file;
if (is_dir($dir)) {
$directories [] = $dir;
... | [
"public",
"function",
"expandDirectories",
"(",
"$",
"baseDir",
")",
"{",
"$",
"directories",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"scandir",
"(",
"$",
"baseDir",
")",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"$",
"file",
"==",
"'.'",
"||",
... | Recursive function that returns all directories inside a base directory.
@param string $baseDir
@return array | [
"Recursive",
"function",
"that",
"returns",
"all",
"directories",
"inside",
"a",
"base",
"directory",
"."
] | a9c7a25e6b7bfa46ea9d61004273f7e29c40885e | https://github.com/jepihumet/libs/blob/a9c7a25e6b7bfa46ea9d61004273f7e29c40885e/src/FileManager.php#L19-L31 |
238,664 | synapsestudios/synapse-base | src/Synapse/Log/LogServiceProvider.php | LogServiceProvider.register | public function register(Application $app)
{
$this->config = $app['config']->load('log');
$handlers = $this->getHandlers($app);
$app['log'] = $app->share(function ($app) use ($handlers) {
return new Logger('main', $handlers);
});
$app->initializer('Synapse\\Log\... | php | public function register(Application $app)
{
$this->config = $app['config']->load('log');
$handlers = $this->getHandlers($app);
$app['log'] = $app->share(function ($app) use ($handlers) {
return new Logger('main', $handlers);
});
$app->initializer('Synapse\\Log\... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"$",
"app",
"[",
"'config'",
"]",
"->",
"load",
"(",
"'log'",
")",
";",
"$",
"handlers",
"=",
"$",
"this",
"->",
"getHandlers",
"(",
"$",
... | Register logging related services
@param Application $app Silex application | [
"Register",
"logging",
"related",
"services"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Log/LogServiceProvider.php#L39-L52 |
238,665 | synapsestudios/synapse-base | src/Synapse/Log/LogServiceProvider.php | LogServiceProvider.boot | public function boot(Application $app)
{
// Register Monolog error handler for fatal errors here because Symfony's handler overrides it
$monologErrorHandler = new MonologErrorHandler($app['log']);
$monologErrorHandler->registerErrorHandler();
$monologErrorHandler->registerFatalHandl... | php | public function boot(Application $app)
{
// Register Monolog error handler for fatal errors here because Symfony's handler overrides it
$monologErrorHandler = new MonologErrorHandler($app['log']);
$monologErrorHandler->registerErrorHandler();
$monologErrorHandler->registerFatalHandl... | [
"public",
"function",
"boot",
"(",
"Application",
"$",
"app",
")",
"{",
"// Register Monolog error handler for fatal errors here because Symfony's handler overrides it",
"$",
"monologErrorHandler",
"=",
"new",
"MonologErrorHandler",
"(",
"$",
"app",
"[",
"'log'",
"]",
")",
... | Perform extra chores on boot
@param Application $app | [
"Perform",
"extra",
"chores",
"on",
"boot"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Log/LogServiceProvider.php#L59-L66 |
238,666 | synapsestudios/synapse-base | src/Synapse/Log/LogServiceProvider.php | LogServiceProvider.getHandlers | protected function getHandlers(Application $app)
{
$handlers = [];
// File Handler
$file = Arr::path($this->config, 'file.path');
if ($file) {
$handlers[] = $this->getFileHandler($file);
$handlers[] = $this->getFileExceptionHandler($file);
}
... | php | protected function getHandlers(Application $app)
{
$handlers = [];
// File Handler
$file = Arr::path($this->config, 'file.path');
if ($file) {
$handlers[] = $this->getFileHandler($file);
$handlers[] = $this->getFileExceptionHandler($file);
}
... | [
"protected",
"function",
"getHandlers",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"handlers",
"=",
"[",
"]",
";",
"// File Handler",
"$",
"file",
"=",
"Arr",
"::",
"path",
"(",
"$",
"this",
"->",
"config",
",",
"'file.path'",
")",
";",
"if",
"(",
... | Get an array of logging handlers to use
@param Application $app
@return array | [
"Get",
"an",
"array",
"of",
"logging",
"handlers",
"to",
"use"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Log/LogServiceProvider.php#L74-L108 |
238,667 | synapsestudios/synapse-base | src/Synapse/Log/LogServiceProvider.php | LogServiceProvider.getFileHandler | protected function getFileHandler($file)
{
$format = '[%datetime%] %channel%.%level_name%: %message% %context% %extra%'.PHP_EOL;
$handler = new StreamHandler($file, Logger::INFO);
$handler->setFormatter(new LineFormatter($format));
return new DummyExceptionHandler($handler);
} | php | protected function getFileHandler($file)
{
$format = '[%datetime%] %channel%.%level_name%: %message% %context% %extra%'.PHP_EOL;
$handler = new StreamHandler($file, Logger::INFO);
$handler->setFormatter(new LineFormatter($format));
return new DummyExceptionHandler($handler);
} | [
"protected",
"function",
"getFileHandler",
"(",
"$",
"file",
")",
"{",
"$",
"format",
"=",
"'[%datetime%] %channel%.%level_name%: %message% %context% %extra%'",
".",
"PHP_EOL",
";",
"$",
"handler",
"=",
"new",
"StreamHandler",
"(",
"$",
"file",
",",
"Logger",
"::",
... | Log handler for files
@param string $file Path of log file
@return DummyExceptionHandler | [
"Log",
"handler",
"for",
"files"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Log/LogServiceProvider.php#L128-L136 |
238,668 | synapsestudios/synapse-base | src/Synapse/Log/LogServiceProvider.php | LogServiceProvider.getFileExceptionHandler | protected function getFileExceptionHandler($file)
{
$format = '%context.stacktrace%'.PHP_EOL;
$handler = new StreamHandler($file, Logger::ERROR);
$handler->setFormatter(new ExceptionLineFormatter($format));
return $handler;
} | php | protected function getFileExceptionHandler($file)
{
$format = '%context.stacktrace%'.PHP_EOL;
$handler = new StreamHandler($file, Logger::ERROR);
$handler->setFormatter(new ExceptionLineFormatter($format));
return $handler;
} | [
"protected",
"function",
"getFileExceptionHandler",
"(",
"$",
"file",
")",
"{",
"$",
"format",
"=",
"'%context.stacktrace%'",
".",
"PHP_EOL",
";",
"$",
"handler",
"=",
"new",
"StreamHandler",
"(",
"$",
"file",
",",
"Logger",
"::",
"ERROR",
")",
";",
"$",
"... | Exception log handler for files
@param string $file Path of log file
@return StreamHandler | [
"Exception",
"log",
"handler",
"for",
"files"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Log/LogServiceProvider.php#L144-L152 |
238,669 | synapsestudios/synapse-base | src/Synapse/Log/LogServiceProvider.php | LogServiceProvider.getLogglyHandler | protected function getLogglyHandler()
{
$token = Arr::path($this->config, 'loggly.token');
if (! $token) {
throw new ConfigException('Loggly is enabled but the token is not set.');
}
return new LogglyHandler($token, Logger::INFO);
} | php | protected function getLogglyHandler()
{
$token = Arr::path($this->config, 'loggly.token');
if (! $token) {
throw new ConfigException('Loggly is enabled but the token is not set.');
}
return new LogglyHandler($token, Logger::INFO);
} | [
"protected",
"function",
"getLogglyHandler",
"(",
")",
"{",
"$",
"token",
"=",
"Arr",
"::",
"path",
"(",
"$",
"this",
"->",
"config",
",",
"'loggly.token'",
")",
";",
"if",
"(",
"!",
"$",
"token",
")",
"{",
"throw",
"new",
"ConfigException",
"(",
"'Log... | Log handler for Loggly
@return LogglyHandler | [
"Log",
"handler",
"for",
"Loggly"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Log/LogServiceProvider.php#L159-L168 |
238,670 | synapsestudios/synapse-base | src/Synapse/Log/LogServiceProvider.php | LogServiceProvider.getRollbarHandler | protected function getRollbarHandler($environment)
{
$rollbarConfig = Arr::get($this->config, 'rollbar', []);
return new RollbarHandler($rollbarConfig, $environment);
} | php | protected function getRollbarHandler($environment)
{
$rollbarConfig = Arr::get($this->config, 'rollbar', []);
return new RollbarHandler($rollbarConfig, $environment);
} | [
"protected",
"function",
"getRollbarHandler",
"(",
"$",
"environment",
")",
"{",
"$",
"rollbarConfig",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"config",
",",
"'rollbar'",
",",
"[",
"]",
")",
";",
"return",
"new",
"RollbarHandler",
"(",
"$",
"rol... | Register log handler for Rollbar
@return RollbarHandler | [
"Register",
"log",
"handler",
"for",
"Rollbar"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Log/LogServiceProvider.php#L175-L179 |
238,671 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php | Mapper.findRootOf | public function findRootOf( $id )
{
return $this->findOne( array(
'id' => $this->sql()
->select()
->columns( array( 'rootId' ) )
->where( array(
'id' => $id,
) ),
... | php | public function findRootOf( $id )
{
return $this->findOne( array(
'id' => $this->sql()
->select()
->columns( array( 'rootId' ) )
->where( array(
'id' => $id,
) ),
... | [
"public",
"function",
"findRootOf",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"findOne",
"(",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"sql",
"(",
")",
"->",
"select",
"(",
")",
"->",
"columns",
"(",
"array",
"(",
"'rootId'",
")"... | Find root paragraph of paragraph by id
@param int $id
@return \Paragraph\Model\Paragraph\StructureInterface | [
"Find",
"root",
"paragraph",
"of",
"paragraph",
"by",
"id"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php#L706-L716 |
238,672 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php | Mapper.getTagIdByName | private function getTagIdByName( $tag )
{
$tagSql = $this->sql( $this->getTableInSchema( static::$tagTableName ) );
$select = $tagSql->select()
->columns( array( 'id' ) )
->where( array(
new TypedParameters(
... | php | private function getTagIdByName( $tag )
{
$tagSql = $this->sql( $this->getTableInSchema( static::$tagTableName ) );
$select = $tagSql->select()
->columns( array( 'id' ) )
->where( array(
new TypedParameters(
... | [
"private",
"function",
"getTagIdByName",
"(",
"$",
"tag",
")",
"{",
"$",
"tagSql",
"=",
"$",
"this",
"->",
"sql",
"(",
"$",
"this",
"->",
"getTableInSchema",
"(",
"static",
"::",
"$",
"tagTableName",
")",
")",
";",
"$",
"select",
"=",
"$",
"tagSql",
... | Get tag id by its name
@param string $tag
@return int|null | [
"Get",
"tag",
"id",
"by",
"its",
"name"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php#L1133-L1162 |
238,673 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php | Mapper.setTagFor | protected function setTagFor( $paragraphId, $tag )
{
$rows = 0;
$tagSql = $this->sql( $this->getTableInSchema( static::$tagTableName ) );
$tagJoinSql = $this->sql( $this->getTableInSchema( static::$tagJoinTableName ) );
$tagId = $this->getTagIdByName( $tag );
... | php | protected function setTagFor( $paragraphId, $tag )
{
$rows = 0;
$tagSql = $this->sql( $this->getTableInSchema( static::$tagTableName ) );
$tagJoinSql = $this->sql( $this->getTableInSchema( static::$tagJoinTableName ) );
$tagId = $this->getTagIdByName( $tag );
... | [
"protected",
"function",
"setTagFor",
"(",
"$",
"paragraphId",
",",
"$",
"tag",
")",
"{",
"$",
"rows",
"=",
"0",
";",
"$",
"tagSql",
"=",
"$",
"this",
"->",
"sql",
"(",
"$",
"this",
"->",
"getTableInSchema",
"(",
"static",
"::",
"$",
"tagTableName",
... | Set a tag for a paragraph
@param int $paragraphId
@param string $tag
@return int | [
"Set",
"a",
"tag",
"for",
"a",
"paragraph"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php#L1171-L1214 |
238,674 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php | Mapper.saveRawProperties | public function saveRawProperties( $id, $properties )
{
$result = 0;
if ( ! empty( $properties ) )
{
foreach ( $properties as $property )
{
$result += $this->saveProperty(
$id,
empty( $property['locale'] ) ? nul... | php | public function saveRawProperties( $id, $properties )
{
$result = 0;
if ( ! empty( $properties ) )
{
foreach ( $properties as $property )
{
$result += $this->saveProperty(
$id,
empty( $property['locale'] ) ? nul... | [
"public",
"function",
"saveRawProperties",
"(",
"$",
"id",
",",
"$",
"properties",
")",
"{",
"$",
"result",
"=",
"0",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"properties",
")",
")",
"{",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"property",
")",
... | Save raw paragraph properties
@param int $id
@param array|\Traversable $properties
@return int | [
"Save",
"raw",
"paragraph",
"properties"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php#L1223-L1241 |
238,675 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php | Mapper.saveRawData | public function saveRawData( array $data )
{
if ( ! parent::save( $data ) )
{
return null;
}
return isset( $data['id'] ) ? $data['id'] : null;
} | php | public function saveRawData( array $data )
{
if ( ! parent::save( $data ) )
{
return null;
}
return isset( $data['id'] ) ? $data['id'] : null;
} | [
"public",
"function",
"saveRawData",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"parent",
"::",
"save",
"(",
"$",
"data",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"isset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
"?",
"$",
... | Save paragraph form raw data
@param array $data
@return int|null | [
"Save",
"paragraph",
"form",
"raw",
"data"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Mapper.php#L1315-L1323 |
238,676 | lbmzorx/yii2-components | src/action/ErrorAction.php | ErrorAction.chooseView | protected function chooseView(){
if($this->guestView){
if(Yii::$app->user->isGuest){
$this->controller->layout=$this->guestLayout;
$this->view=$this->guestView;
}
}
if($this->userView){
if(!Yii::$app->user->isGuest){
... | php | protected function chooseView(){
if($this->guestView){
if(Yii::$app->user->isGuest){
$this->controller->layout=$this->guestLayout;
$this->view=$this->guestView;
}
}
if($this->userView){
if(!Yii::$app->user->isGuest){
... | [
"protected",
"function",
"chooseView",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"guestView",
")",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"isGuest",
")",
"{",
"$",
"this",
"->",
"controller",
"->",
"layout",
"=",
"$",
"this... | select view template of error view by different group | [
"select",
"view",
"template",
"of",
"error",
"view",
"by",
"different",
"group"
] | 0d5344fbaf07ee979942414d2874696273ce7bdd | https://github.com/lbmzorx/yii2-components/blob/0d5344fbaf07ee979942414d2874696273ce7bdd/src/action/ErrorAction.php#L83-L96 |
238,677 | consigliere/components | src/Process/Installer.php | Installer.installViaSubtree | public function installViaSubtree()
{
return new Process(sprintf(
'cd %s && git remote add %s %s && git subtree add --prefix=%s --squash %s %s',
base_path(),
$this->getComponentName(),
$this->getRepoUrl(),
$this->getDestinationPath(),
$... | php | public function installViaSubtree()
{
return new Process(sprintf(
'cd %s && git remote add %s %s && git subtree add --prefix=%s --squash %s %s',
base_path(),
$this->getComponentName(),
$this->getRepoUrl(),
$this->getDestinationPath(),
$... | [
"public",
"function",
"installViaSubtree",
"(",
")",
"{",
"return",
"new",
"Process",
"(",
"sprintf",
"(",
"'cd %s && git remote add %s %s && git subtree add --prefix=%s --squash %s %s'",
",",
"base_path",
"(",
")",
",",
"$",
"this",
"->",
"getComponentName",
"(",
")",
... | Install the component via git subtree.
@return \Symfony\Component\Process\Process | [
"Install",
"the",
"component",
"via",
"git",
"subtree",
"."
] | 9b08bb111f0b55b0a860ed9c3407eda0d9cc1252 | https://github.com/consigliere/components/blob/9b08bb111f0b55b0a860ed9c3407eda0d9cc1252/src/Process/Installer.php#L270-L281 |
238,678 | remote-office/libx | src/Cache/Storage/Redis.php | Redis.retrieve | public function retrieve($key)
{
// Get value by key
$value = $this->redis->get($key);
if($value === false)
return null;
return $value;
} | php | public function retrieve($key)
{
// Get value by key
$value = $this->redis->get($key);
if($value === false)
return null;
return $value;
} | [
"public",
"function",
"retrieve",
"(",
"$",
"key",
")",
"{",
"// Get value by key",
"$",
"value",
"=",
"$",
"this",
"->",
"redis",
"->",
"get",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"value",
"===",
"false",
")",
"return",
"null",
";",
"return",
... | Retrieve value from redis server
@param string $key
@return string | [
"Retrieve",
"value",
"from",
"redis",
"server"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Cache/Storage/Redis.php#L29-L38 |
238,679 | AlcyZ/Alcys-ORM | src/Core/Db/Statement/Insert.php | Insert.values | public function values(array $valuesArray)
{
$this->_checkColumnsArrayIsset()->_checkArraysForSameLength($valuesArray)->_checkValuesArrayType($valuesArray);
$this->values[] = $valuesArray;
return $this;
} | php | public function values(array $valuesArray)
{
$this->_checkColumnsArrayIsset()->_checkArraysForSameLength($valuesArray)->_checkValuesArrayType($valuesArray);
$this->values[] = $valuesArray;
return $this;
} | [
"public",
"function",
"values",
"(",
"array",
"$",
"valuesArray",
")",
"{",
"$",
"this",
"->",
"_checkColumnsArrayIsset",
"(",
")",
"->",
"_checkArraysForSameLength",
"(",
"$",
"valuesArray",
")",
"->",
"_checkValuesArrayType",
"(",
"$",
"valuesArray",
")",
";",... | Validate the passed array and add their values to the insert statement.
The columns method must called before, otherwise an exception will thrown.
@param ReferencesInterface[] $valuesArray
@return $this The same instance to concatenate methods.
@throws \Exception When array does not have the same length like the pass... | [
"Validate",
"the",
"passed",
"array",
"and",
"add",
"their",
"values",
"to",
"the",
"insert",
"statement",
".",
"The",
"columns",
"method",
"must",
"called",
"before",
"otherwise",
"an",
"exception",
"will",
"thrown",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/Statement/Insert.php#L104-L110 |
238,680 | ehough/shortstop | src/main/php/ehough/shortstop/api/HttpRequest.php | ehough_shortstop_api_HttpRequest.setUrl | public final function setUrl($url)
{
if (is_string($url)) {
$this->_url = new ehough_curly_Url($url);
return;
}
if (! $url instanceof ehough_curly_Url) {
throw new ehough_shortstop_api_exception_InvalidArgumentException(
'setUrl() only ... | php | public final function setUrl($url)
{
if (is_string($url)) {
$this->_url = new ehough_curly_Url($url);
return;
}
if (! $url instanceof ehough_curly_Url) {
throw new ehough_shortstop_api_exception_InvalidArgumentException(
'setUrl() only ... | [
"public",
"final",
"function",
"setUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"url",
")",
")",
"{",
"$",
"this",
"->",
"_url",
"=",
"new",
"ehough_curly_Url",
"(",
"$",
"url",
")",
";",
"return",
";",
"}",
"if",
"(",
"!",
... | Sets the URL of this request.
@param mixed $url The URL of this request.
@throws ehough_shortstop_api_exception_InvalidArgumentException If the given URL is not a valid string URL
or instance of ehough_curly_Url
@return void | [
"Sets",
"the",
"URL",
"of",
"this",
"request",
"."
] | 4cef21457741347546c70e8e5c0cef6d3162b257 | https://github.com/ehough/shortstop/blob/4cef21457741347546c70e8e5c0cef6d3162b257/src/main/php/ehough/shortstop/api/HttpRequest.php#L92-L109 |
238,681 | iwyg/template | Engine.php | Engine.getErrFunc | protected function getErrFunc()
{
if (null === $this->errFunc) {
$this->errFunc = function ($errno, $errstr, $errfile, $errline) {
$this->stopErrorHandling();
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
};
}
retu... | php | protected function getErrFunc()
{
if (null === $this->errFunc) {
$this->errFunc = function ($errno, $errstr, $errfile, $errline) {
$this->stopErrorHandling();
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
};
}
retu... | [
"protected",
"function",
"getErrFunc",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"errFunc",
")",
"{",
"$",
"this",
"->",
"errFunc",
"=",
"function",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
... | Get the error handler
@return \Closure | [
"Get",
"the",
"error",
"handler"
] | ad7c8e79ce3b8fc7fcf82bc3e53737a4d7ecc16e | https://github.com/iwyg/template/blob/ad7c8e79ce3b8fc7fcf82bc3e53737a4d7ecc16e/Engine.php#L548-L558 |
238,682 | ronanchilvers/silex-spot2-provider | src/Application/Spot2Trait.php | Spot2Trait.mapper | public function mapper($entityName)
{
if (!class_exists($entityName)) {
throw new \Exception('Unable to get mapper for unknown entity class '.$entityName);
}
$locator = $this['spot2.locator'];
return $locator->mapper($entityName);
} | php | public function mapper($entityName)
{
if (!class_exists($entityName)) {
throw new \Exception('Unable to get mapper for unknown entity class '.$entityName);
}
$locator = $this['spot2.locator'];
return $locator->mapper($entityName);
} | [
"public",
"function",
"mapper",
"(",
"$",
"entityName",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"entityName",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Unable to get mapper for unknown entity class '",
".",
"$",
"entityName",
")",
";... | Get a mapper for a given entity.
@param string $entityName
@return Spot\Mapper
@author Ronan Chilvers <ronan@d3r.com> | [
"Get",
"a",
"mapper",
"for",
"a",
"given",
"entity",
"."
] | 9b13856d9560f13604ad885ee4c94e374d5e3635 | https://github.com/ronanchilvers/silex-spot2-provider/blob/9b13856d9560f13604ad885ee4c94e374d5e3635/src/Application/Spot2Trait.php#L36-L44 |
238,683 | a2c/BaconAclBundle | Controller/ModuleController.php | ModuleController.indexAction | public function indexAction($page, $sort, $direction)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'INDEX')) {
throw $this->createAccessDeniedException();
}
$breadcumbs = $this->container->get('bacon_breadcrumbs');
$bre... | php | public function indexAction($page, $sort, $direction)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'INDEX')) {
throw $this->createAccessDeniedException();
}
$breadcumbs = $this->container->get('bacon_breadcrumbs');
$bre... | [
"public",
"function",
"indexAction",
"(",
"$",
"page",
",",
"$",
"sort",
",",
"$",
"direction",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",... | Lists all Module entities.
@Route("/",defaults={"page"=1, "sort"="id", "direction"="asc"}, name="module")
@Route("/page/{page}/sort/{sort}/direction/{direction}/", defaults={"page"=1, "sort"="id", "direction"="asc"}, name="module_pagination")
@Method("GET")
@Security("has_role('ROLE_ADMIN')")
@Template() | [
"Lists",
"all",
"Module",
"entities",
"."
] | ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c | https://github.com/a2c/BaconAclBundle/blob/ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c/Controller/ModuleController.php#L32-L73 |
238,684 | a2c/BaconAclBundle | Controller/ModuleController.php | ModuleController.newAction | public function newAction(Request $request)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'NEW')) {
throw $this->createAccessDeniedException();
}
$breadcumbs = $this->container->get('bacon_breadcrumbs');
$breadcumbs->add... | php | public function newAction(Request $request)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'NEW')) {
throw $this->createAccessDeniedException();
}
$breadcumbs = $this->container->get('bacon_breadcrumbs');
$breadcumbs->add... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",
"'module'",
",",
"'NEW'",
")",... | Displays a form to create a new Module entity.
@Route("/new", name="module_new")
@Method({"GET", "POST"})
@Security("has_role('ROLE_ADMIN')")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Module",
"entity",
"."
] | ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c | https://github.com/a2c/BaconAclBundle/blob/ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c/Controller/ModuleController.php#L115-L154 |
238,685 | a2c/BaconAclBundle | Controller/ModuleController.php | ModuleController.showAction | public function showAction(Request $request, Module $entity)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'SHOW')) {
throw $this->createAccessDeniedException();
}
$breadcumbs = $this->container->get('bacon_breadcrumbs');
... | php | public function showAction(Request $request, Module $entity)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'SHOW')) {
throw $this->createAccessDeniedException();
}
$breadcumbs = $this->container->get('bacon_breadcrumbs');
... | [
"public",
"function",
"showAction",
"(",
"Request",
"$",
"request",
",",
"Module",
"$",
"entity",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",... | Finds and displays a Module entity.
@Route("/{id}", name="module_show")
@Method("GET")
@Security("has_role('ROLE_ADMIN')")
@Template() | [
"Finds",
"and",
"displays",
"a",
"Module",
"entity",
"."
] | ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c | https://github.com/a2c/BaconAclBundle/blob/ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c/Controller/ModuleController.php#L216-L242 |
238,686 | a2c/BaconAclBundle | Controller/ModuleController.php | ModuleController.deleteAction | public function deleteAction(Module $entity)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'DELETE')) {
throw $this->createAccessDeniedException();
}
$handler = new ModuleFormHandler(
$this->createDeleteForm('module_d... | php | public function deleteAction(Module $entity)
{
$acl = $this->get('bacon_acl.service.authorization');
if (!$acl->authorize('module', 'DELETE')) {
throw $this->createAccessDeniedException();
}
$handler = new ModuleFormHandler(
$this->createDeleteForm('module_d... | [
"public",
"function",
"deleteAction",
"(",
"Module",
"$",
"entity",
")",
"{",
"$",
"acl",
"=",
"$",
"this",
"->",
"get",
"(",
"'bacon_acl.service.authorization'",
")",
";",
"if",
"(",
"!",
"$",
"acl",
"->",
"authorize",
"(",
"'module'",
",",
"'DELETE'",
... | Deletes a Module entity.
@Route("/{id}", name="module_delete")
@Security("has_role('ROLE_ADMIN')")
@Method("DELETE") | [
"Deletes",
"a",
"Module",
"entity",
"."
] | ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c | https://github.com/a2c/BaconAclBundle/blob/ed4d2fe25e8f08bfb70a0d50a504ec2878dd2e6c/Controller/ModuleController.php#L250-L267 |
238,687 | alxmsl/Connection | source/Redis/RedisFactory.php | RedisFactory.createRedisByConfig | public static function createRedisByConfig(array $config) {
$Redis = new Connection();
$Redis->setHost(@$config['host'])
->setPort(@$config['port']);
(isset($config['persistent'])) && $Redis->setPersistent($config['persistent']);
(isset($config['connect_timeout'])) && $R... | php | public static function createRedisByConfig(array $config) {
$Redis = new Connection();
$Redis->setHost(@$config['host'])
->setPort(@$config['port']);
(isset($config['persistent'])) && $Redis->setPersistent($config['persistent']);
(isset($config['connect_timeout'])) && $R... | [
"public",
"static",
"function",
"createRedisByConfig",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"Redis",
"=",
"new",
"Connection",
"(",
")",
";",
"$",
"Redis",
"->",
"setHost",
"(",
"@",
"$",
"config",
"[",
"'host'",
"]",
")",
"->",
"setPort",
"(",
... | Create PhpRedis instance by array config
@param array $config array configuration
@throws InvalidArgumentException | [
"Create",
"PhpRedis",
"instance",
"by",
"array",
"config"
] | f686efeb795a5450112a04792876b2198829fd32 | https://github.com/alxmsl/Connection/blob/f686efeb795a5450112a04792876b2198829fd32/source/Redis/RedisFactory.php#L32-L40 |
238,688 | zepi/turbo-base | Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php | ExecuteInstallation.execute | public function execute(Framework $framework, CliRequest $request, Response $response)
{
// Configure turbo
$this->configure();
// Save the settings
$this->configurationManager->saveConfigurationFile();
// Execute the DataSource setups
$dataSourceMan... | php | public function execute(Framework $framework, CliRequest $request, Response $response)
{
// Configure turbo
$this->configure();
// Save the settings
$this->configurationManager->saveConfigurationFile();
// Execute the DataSource setups
$dataSourceMan... | [
"public",
"function",
"execute",
"(",
"Framework",
"$",
"framework",
",",
"CliRequest",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"// Configure turbo",
"$",
"this",
"->",
"configure",
"(",
")",
";",
"// Save the settings",
"$",
"this",
"->",
... | Execute the installation of Turbo
@access public
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\CliRequest $request
@param \Zepi\Turbo\Response\Response $response | [
"Execute",
"the",
"installation",
"of",
"Turbo"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php#L88-L102 |
238,689 | zepi/turbo-base | Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php | ExecuteInstallation.configure | protected function configure()
{
$configureSettingGroup = $this->cliHelper->confirmAction('Would you like to change the settings?');
if (!$configureSettingGroup) {
return;
}
$this->configureSettings($this->configurationManager->getSettings());
} | php | protected function configure()
{
$configureSettingGroup = $this->cliHelper->confirmAction('Would you like to change the settings?');
if (!$configureSettingGroup) {
return;
}
$this->configureSettings($this->configurationManager->getSettings());
} | [
"protected",
"function",
"configure",
"(",
")",
"{",
"$",
"configureSettingGroup",
"=",
"$",
"this",
"->",
"cliHelper",
"->",
"confirmAction",
"(",
"'Would you like to change the settings?'",
")",
";",
"if",
"(",
"!",
"$",
"configureSettingGroup",
")",
"{",
"retur... | Iterates trough all configuration settings and asks the user for a
value. | [
"Iterates",
"trough",
"all",
"configuration",
"settings",
"and",
"asks",
"the",
"user",
"for",
"a",
"value",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php#L108-L116 |
238,690 | zepi/turbo-base | Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php | ExecuteInstallation.configureSettings | protected function configureSettings($settings, $path = '')
{
foreach ($settings as $key => $node) {
if (is_array($node)) {
$this->configureSettings($node, $path . $key . '.');
} else {
$this->configureSetting($path . $key, $node);
}
... | php | protected function configureSettings($settings, $path = '')
{
foreach ($settings as $key => $node) {
if (is_array($node)) {
$this->configureSettings($node, $path . $key . '.');
} else {
$this->configureSetting($path . $key, $node);
}
... | [
"protected",
"function",
"configureSettings",
"(",
"$",
"settings",
",",
"$",
"path",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"settings",
"as",
"$",
"key",
"=>",
"$",
"node",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"node",
")",
")",
"{",
"$",
... | Configures one settings group
@access protected
@param array $settings | [
"Configures",
"one",
"settings",
"group"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php#L124-L133 |
238,691 | zepi/turbo-base | Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php | ExecuteInstallation.configureSetting | protected function configureSetting($path, $value)
{
$newValue = $this->cliHelper->inputText('Please enter the value for "' . $path . '":', $value);
if ($newValue === $value) {
return;
}
$this->configurationManager->setSetting($path, $newValue);
} | php | protected function configureSetting($path, $value)
{
$newValue = $this->cliHelper->inputText('Please enter the value for "' . $path . '":', $value);
if ($newValue === $value) {
return;
}
$this->configurationManager->setSetting($path, $newValue);
} | [
"protected",
"function",
"configureSetting",
"(",
"$",
"path",
",",
"$",
"value",
")",
"{",
"$",
"newValue",
"=",
"$",
"this",
"->",
"cliHelper",
"->",
"inputText",
"(",
"'Please enter the value for \"'",
".",
"$",
"path",
".",
"'\":'",
",",
"$",
"value",
... | Configures one setting
@access protected
@param string $path
@param string $value | [
"Configures",
"one",
"setting"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Installation/Turbo/src/EventHandler/ExecuteInstallation.php#L142-L151 |
238,692 | vip9008/yii2-googleapisclient | service/MapsEngine.php | MapsEngine_RasterCollectionsRasters_Resource.batchDelete | public function batchDelete($id, MapsEngine_RasterCollectionsRasterBatchDeleteRequest $postBody, $optParams = array())
{
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('batchDelete', array($params), "MapsEngine_RasterCollectionsRasters... | php | public function batchDelete($id, MapsEngine_RasterCollectionsRasterBatchDeleteRequest $postBody, $optParams = array())
{
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('batchDelete', array($params), "MapsEngine_RasterCollectionsRasters... | [
"public",
"function",
"batchDelete",
"(",
"$",
"id",
",",
"MapsEngine_RasterCollectionsRasterBatchDeleteRequest",
"$",
"postBody",
",",
"$",
"optParams",
"=",
"array",
"(",
")",
")",
"{",
"$",
"params",
"=",
"array",
"(",
"'id'",
"=>",
"$",
"id",
",",
"'post... | Remove rasters from an existing raster collection.
Up to 50 rasters can be included in a single batchDelete request. Each
batchDelete request is atomic. (rasters.batchDelete)
@param string $id The ID of the raster collection to which these rasters
belong.
@param Google_RasterCollectionsRasterBatchDeleteRequest $postB... | [
"Remove",
"rasters",
"from",
"an",
"existing",
"raster",
"collection",
"."
] | b6aae1c490d84a6004ed7dccb5d4176184032b57 | https://github.com/vip9008/yii2-googleapisclient/blob/b6aae1c490d84a6004ed7dccb5d4176184032b57/service/MapsEngine.php#L2567-L2572 |
238,693 | webriq/core | module/Core/src/Grid/Core/Model/Module/Model.php | Model.onModules | public function onModules( ModulesEvent $event )
{
$saved = 0;
$model = $event->getTarget();
$mapper = $model->getMapper();
$modules = $event->getParams();
foreach ( $modules as $name => $enabled )
{
if ( empty( $name ) )
{
... | php | public function onModules( ModulesEvent $event )
{
$saved = 0;
$model = $event->getTarget();
$mapper = $model->getMapper();
$modules = $event->getParams();
foreach ( $modules as $name => $enabled )
{
if ( empty( $name ) )
{
... | [
"public",
"function",
"onModules",
"(",
"ModulesEvent",
"$",
"event",
")",
"{",
"$",
"saved",
"=",
"0",
";",
"$",
"model",
"=",
"$",
"event",
"->",
"getTarget",
"(",
")",
";",
"$",
"mapper",
"=",
"$",
"model",
"->",
"getMapper",
"(",
")",
";",
"$",... | Default action on modules-set event
@param ModulesEvent $event
@return int | [
"Default",
"action",
"on",
"modules",
"-",
"set",
"event"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Core/src/Grid/Core/Model/Module/Model.php#L107-L140 |
238,694 | bugotech/foundation | src/Env.php | Env.load | public function load($path, $file = '.env')
{
try {
$env = new \Dotenv\Dotenv($path, $file);
$env->load();
return true;
} catch (\Dotenv\Exception\InvalidPathException $e) {
return false;
}
} | php | public function load($path, $file = '.env')
{
try {
$env = new \Dotenv\Dotenv($path, $file);
$env->load();
return true;
} catch (\Dotenv\Exception\InvalidPathException $e) {
return false;
}
} | [
"public",
"function",
"load",
"(",
"$",
"path",
",",
"$",
"file",
"=",
"'.env'",
")",
"{",
"try",
"{",
"$",
"env",
"=",
"new",
"\\",
"Dotenv",
"\\",
"Dotenv",
"(",
"$",
"path",
",",
"$",
"file",
")",
";",
"$",
"env",
"->",
"load",
"(",
")",
"... | Load file .env.
@param $path
@param string $file
@return bool | [
"Load",
"file",
".",
"env",
"."
] | e4b96cd1cef117e9c5f2c6f5671d260853317658 | https://github.com/bugotech/foundation/blob/e4b96cd1cef117e9c5f2c6f5671d260853317658/src/Env.php#L14-L24 |
238,695 | tenside/core-bundle | src/DependencyInjection/Factory/LoggerFactory.php | LoggerFactory.create | public static function create(
$kernel,
$filename,
$maxFiles = 0,
$level = Logger::DEBUG,
$bubble = true,
$filePermission = null,
$useLocking = false
) {
return new RotatingFileHandler(
$kernel->getLogDir() . DIRECTORY_SEPARATOR . $filename... | php | public static function create(
$kernel,
$filename,
$maxFiles = 0,
$level = Logger::DEBUG,
$bubble = true,
$filePermission = null,
$useLocking = false
) {
return new RotatingFileHandler(
$kernel->getLogDir() . DIRECTORY_SEPARATOR . $filename... | [
"public",
"static",
"function",
"create",
"(",
"$",
"kernel",
",",
"$",
"filename",
",",
"$",
"maxFiles",
"=",
"0",
",",
"$",
"level",
"=",
"Logger",
"::",
"DEBUG",
",",
"$",
"bubble",
"=",
"true",
",",
"$",
"filePermission",
"=",
"null",
",",
"$",
... | Create the logger service.
@param Kernel $kernel The kernel to retrieve the log dir from.
@param string $filename The filename.
@param int $maxFiles The maximal amount of files to keep (0 means unlimited).
@param int $level The minimum logging level at which this handler w... | [
"Create",
"the",
"logger",
"service",
"."
] | a7ffad3649cddac1e5594b4f8b65a5504363fccd | https://github.com/tenside/core-bundle/blob/a7ffad3649cddac1e5594b4f8b65a5504363fccd/src/DependencyInjection/Factory/LoggerFactory.php#L53-L70 |
238,696 | franckysolo/octopush-sdk | src/Octopush/Client.php | Client.send | public function send($message, array $options = [])
{
$sms = new Message($options);
$this->request('sms', $sms->getParams());
$response = $this->getResponse();
if ($response['error_code'] !== '000') {
$this->errors[] = $response['error_code'];
return false;
... | php | public function send($message, array $options = [])
{
$sms = new Message($options);
$this->request('sms', $sms->getParams());
$response = $this->getResponse();
if ($response['error_code'] !== '000') {
$this->errors[] = $response['error_code'];
return false;
... | [
"public",
"function",
"send",
"(",
"$",
"message",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"sms",
"=",
"new",
"Message",
"(",
"$",
"options",
")",
";",
"$",
"this",
"->",
"request",
"(",
"'sms'",
",",
"$",
"sms",
"->",
"getPar... | Send a sms message
@param string $message The string message
@param array $options The array options
@return bool true if message is send otherwise false | [
"Send",
"a",
"sms",
"message"
] | 3797e53d51474a64b65fbf437e5dd46e288f2ef8 | https://github.com/franckysolo/octopush-sdk/blob/3797e53d51474a64b65fbf437e5dd46e288f2ef8/src/Octopush/Client.php#L88-L100 |
238,697 | franckysolo/octopush-sdk | src/Octopush/Client.php | Client.request | public function request($url, array $params = [])
{
$curl = new Curl();
$query = $this->buildQuery($params);
$curl->setOptions($this->url . $url, $query, $this->port);
$response = $curl->exec();
$this->setResponse($response);
$this->setErrors($response);
retur... | php | public function request($url, array $params = [])
{
$curl = new Curl();
$query = $this->buildQuery($params);
$curl->setOptions($this->url . $url, $query, $this->port);
$response = $curl->exec();
$this->setResponse($response);
$this->setErrors($response);
retur... | [
"public",
"function",
"request",
"(",
"$",
"url",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"curl",
"=",
"new",
"Curl",
"(",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"buildQuery",
"(",
"$",
"params",
")",
";",
"$",
"curl... | Send a curl request
@param string $url The url API
@param array $params The query params
@return \Octopush\Client | [
"Send",
"a",
"curl",
"request"
] | 3797e53d51474a64b65fbf437e5dd46e288f2ef8 | https://github.com/franckysolo/octopush-sdk/blob/3797e53d51474a64b65fbf437e5dd46e288f2ef8/src/Octopush/Client.php#L109-L118 |
238,698 | franckysolo/octopush-sdk | src/Octopush/Client.php | Client.buildQuery | public function buildQuery(array $params = [])
{
$params = array_merge($params, [
'user_login' => $this->login,
'api_key' => $this->apiKey
]);
return http_build_query($params);
} | php | public function buildQuery(array $params = [])
{
$params = array_merge($params, [
'user_login' => $this->login,
'api_key' => $this->apiKey
]);
return http_build_query($params);
} | [
"public",
"function",
"buildQuery",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"=",
"array_merge",
"(",
"$",
"params",
",",
"[",
"'user_login'",
"=>",
"$",
"this",
"->",
"login",
",",
"'api_key'",
"=>",
"$",
"this",
"->",
"a... | Merge the credentials and params then returns the string query
@param array $params The params array
@return string The query string | [
"Merge",
"the",
"credentials",
"and",
"params",
"then",
"returns",
"the",
"string",
"query"
] | 3797e53d51474a64b65fbf437e5dd46e288f2ef8 | https://github.com/franckysolo/octopush-sdk/blob/3797e53d51474a64b65fbf437e5dd46e288f2ef8/src/Octopush/Client.php#L126-L133 |
238,699 | franckysolo/octopush-sdk | src/Octopush/Client.php | Client.setErrors | protected function setErrors($response)
{
libxml_use_internal_errors(true);
$doc = new \DOMDocument('1.0', 'utf-8');
$doc->loadXML($response);
$errors = libxml_get_errors();
if (!empty($errors)) {
$this->errors[] = 'Xml response is invalid';
}
r... | php | protected function setErrors($response)
{
libxml_use_internal_errors(true);
$doc = new \DOMDocument('1.0', 'utf-8');
$doc->loadXML($response);
$errors = libxml_get_errors();
if (!empty($errors)) {
$this->errors[] = 'Xml response is invalid';
}
r... | [
"protected",
"function",
"setErrors",
"(",
"$",
"response",
")",
"{",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"$",
"doc",
"=",
"new",
"\\",
"DOMDocument",
"(",
"'1.0'",
",",
"'utf-8'",
")",
";",
"$",
"doc",
"->",
"loadXML",
"(",
"$",
"respon... | Set the xml errors
@param string $response
@return \Octopush\Client | [
"Set",
"the",
"xml",
"errors"
] | 3797e53d51474a64b65fbf437e5dd46e288f2ef8 | https://github.com/franckysolo/octopush-sdk/blob/3797e53d51474a64b65fbf437e5dd46e288f2ef8/src/Octopush/Client.php#L195-L208 |
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.