diff --git a/application/clicommands/AutocompleteCommand.php b/application/clicommands/AutocompleteCommand.php index ecc72f77a..0328138d2 100644 --- a/application/clicommands/AutocompleteCommand.php +++ b/application/clicommands/AutocompleteCommand.php @@ -4,7 +4,6 @@ namespace Icinga\Clicommands; use Icinga\Cli\Command; use Icinga\Cli\Loader; -use Icinga\Cli\Documentation; /** * Autocomplete for modules, commands and actions @@ -22,11 +21,11 @@ class AutocompleteCommand extends Command { if ($suggestions) { $key = array_search('autocomplete', $suggestions); - if ($key !== false){ + if ($key !== false) { unset($suggestions[$key]); } echo implode("\n", $suggestions) - // . serialize($GLOBALS['argv']) + //. serialize($GLOBALS['argv']) . "\n"; } } @@ -41,7 +40,6 @@ class AutocompleteCommand extends Command */ public function completeAction() { - // TODO: $module = null; $command = null; $action = null; @@ -54,16 +52,11 @@ class AutocompleteCommand extends Command $search_word = $bare_params[$cword]; if ($search_word === '--') { // TODO: Unfinished, completion missing - return $this->suggest(array( - '--verbose', - '--help', - '--debug' - )); + return $this->suggest(array('--verbose', '--help', '--debug')); } $search = $params->shift(); - // TODO: - if (! $search) { + if (!$search) { return $this->suggest( array_merge($loader->listCommands(), $loader->listModules()) ); diff --git a/application/clicommands/ModuleCommand.php b/application/clicommands/ModuleCommand.php index 07ac892fb..5396317b1 100644 --- a/application/clicommands/ModuleCommand.php +++ b/application/clicommands/ModuleCommand.php @@ -72,9 +72,7 @@ class ModuleCommand extends Command "%-14s %-9s %-9s %s\n", $module, $mod->getVersion(), - ($type === 'enabled' || $this->modules->hasEnabled($module)) - ? 'enabled' - : 'disabled', + ($type === 'enabled' || $this->modules->hasEnabled($module)) ? 'enabled' : 'disabled', $dir ); } diff --git a/application/forms/Config/GeneralForm.php b/application/forms/Config/GeneralForm.php index d6eb5db91..8558ca698 100644 --- a/application/forms/Config/GeneralForm.php +++ b/application/forms/Config/GeneralForm.php @@ -184,8 +184,9 @@ class GeneralForm extends Form 'label' => t('Default Language'), 'required' => true, 'multiOptions' => $languages, - 'helptext' => t('Select the language to use by default. Can be' - . ' overwritten by a user in his preferences.'), + 'helptext' => t( + 'Select the language to use by default. Can be overwritten by a user in his preferences.' + ), 'value' => $cfg->get('language', Translator::DEFAULT_LOCALE) ) ); diff --git a/application/forms/Config/Resource/CreateResourceForm.php b/application/forms/Config/Resource/CreateResourceForm.php index 43e5b2e63..a688ae62f 100644 --- a/application/forms/Config/Resource/CreateResourceForm.php +++ b/application/forms/Config/Resource/CreateResourceForm.php @@ -4,9 +4,10 @@ namespace Icinga\Module\Monitoring\Form\Config\Backend; use Icinga\Module\Monitoring\Form\Config\Backend\EditResourceForm; -class CreateResourceForm extends EditResourceForm { +class CreateResourceForm extends EditResourceForm +{ public function __construct() { } -} \ No newline at end of file +} diff --git a/application/forms/Config/Resource/EditResourceForm.php b/application/forms/Config/Resource/EditResourceForm.php index a70263efe..3ef89b5dd 100644 --- a/application/forms/Config/Resource/EditResourceForm.php +++ b/application/forms/Config/Resource/EditResourceForm.php @@ -29,13 +29,10 @@ namespace Icinga\Form\Config\Resource; -use Icinga\Exception\ProgrammingError; -use Icinga\Protocol\Ldap\Exception; use \Zend_Config; use \Icinga\Web\Form; use \Icinga\Web\Form\Decorator\HelpText; use \Icinga\Application\Logger; -use \Icinga\Application\Icinga; use Icinga\Data\ResourceFactory; /** @@ -168,7 +165,7 @@ class EditResourceForm extends Form private function addStatusdatForm() { - $this->addElement( + $this->addElement( 'text', 'resource_statusdat_status_file', array( @@ -192,7 +189,7 @@ class EditResourceForm extends Form private function addLivestatusForm() { - $this->addElement( + $this->addElement( 'text', 'resource_livestatus_socket', array( @@ -386,10 +383,7 @@ class EditResourceForm extends Form $resource->getConnection()->getConnection(); break; case 'statusdat': - if ( - !file_exists($config->object_file) || - !file_exists($config->status_file) - ) { + if (!file_exists($config->object_file) || !file_exists($config->status_file)) { $this->addErrorMessage( 'Connectivity validation failed, the provided file or socket does not exist.' ); @@ -443,11 +437,7 @@ class EditResourceForm extends Form $type = $values['resource_type']; $result = array('type' => $type); foreach ($values as $key => $value) { - if ( - $key !== 'resource_type' && - $key !== 'resource_all_name' && - $key !== 'resource_all_name_old' - ) { + if ($key !== 'resource_type' && $key !== 'resource_all_name' && $key !== 'resource_all_name_old') { $configKey = explode('_', $key, 3); if (sizeof($configKey) < 3) { Logger::warn('EditResourceForm: invalid form key "' . $key . '" was ignored.'); diff --git a/application/views/helpers/RequestId.php b/application/views/helpers/RequestId.php index 6eb4fb0c8..0b9358081 100644 --- a/application/views/helpers/RequestId.php +++ b/application/views/helpers/RequestId.php @@ -1,4 +1,6 @@ getRequest()->getId(); } } + +// @codingStandardsIgnoreStop diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index d0bd77ab4..8744e2255 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -105,7 +105,7 @@ class Manager if (empty($availableDirs)) { $availableDirs = array(realpath(ICINGA_APPDIR . '/../modules')); } else { - foreach($availableDirs as $key => $dir) { + foreach ($availableDirs as $key => $dir) { $dir[$key] = realpath($dir); } } diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index a47dfaeb4..fcb378fcd 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -324,7 +324,6 @@ class Module $key = lcfirst($key); switch ($key) { - case 'depends': if (strpos($val, ' ') === false) { $metadata->depends[$val] = true; @@ -341,11 +340,9 @@ class Module } } break; - case 'description': $metadata->shortDescription = $val; // YES, no break here - default: $metadata->{$key} = $val; @@ -524,12 +521,7 @@ class Module { $moduleName = ucfirst($this->getName()); $moduleLibraryDir = $this->getLibDir(). '/'. $moduleName; - if ( - is_dir($this->getBaseDir()) && - is_dir($this->getLibDir()) && - is_dir($moduleLibraryDir) - ) { - + if (is_dir($this->getBaseDir()) && is_dir($this->getLibDir()) && is_dir($moduleLibraryDir)) { $this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName, $moduleLibraryDir); if (is_dir($this->getFormDir())) { $this->app->getLoader()->registerNamespace( diff --git a/library/Icinga/Authentication/Backend/DbUserBackend.php b/library/Icinga/Authentication/Backend/DbUserBackend.php index 7f1eba270..3ad5a9351 100644 --- a/library/Icinga/Authentication/Backend/DbUserBackend.php +++ b/library/Icinga/Authentication/Backend/DbUserBackend.php @@ -289,7 +289,8 @@ class DbUserBackend implements UserBackend * * @return string */ - protected function createPasswordHash($password, $salt) { + protected function createPasswordHash($password, $salt) + { return hash_hmac('sha256', $password, $salt); } diff --git a/library/Icinga/Chart/PieChart.php b/library/Icinga/Chart/PieChart.php index 7b2c3b309..9a6e89375 100644 --- a/library/Icinga/Chart/PieChart.php +++ b/library/Icinga/Chart/PieChart.php @@ -136,7 +136,10 @@ class PieChart extends Chart */ protected function build() { - $this->renderer = new SVGRenderer(($this->type === self::STACKED) ? $this->width : count($this->pies)*$this->width, $this->width); + $this->renderer = new SVGRenderer( + $this->type === self::STACKED ? $this->width : count($this->pies) * $this->width, + $this->width + ); foreach ($this->pies as &$pie) { $this->normalizeDataSet($pie); } @@ -292,7 +295,7 @@ class PieChart extends Chart $offset = isset($this->pies[$i+1]) ? $radius - $shrinkStep : 0; $labelPos = 0; $lastRadius = 0; - foreach ($pie['data'] as $idx => $dataset) { + foreach ($pie['data'] as $idx => $dataset) { $color = $this->getColorForPieSlice($pie, $idx); if ($dataset === 100) { $dataset = 99.9; diff --git a/library/Icinga/Chart/Primitive/PieSlice.php b/library/Icinga/Chart/Primitive/PieSlice.php index 3bf1abd67..6cd03ed17 100644 --- a/library/Icinga/Chart/Primitive/PieSlice.php +++ b/library/Icinga/Chart/Primitive/PieSlice.php @@ -180,7 +180,7 @@ class PieSlice extends Animatable implements Drawable $path->append(array($midX, $midY))->toAbsolute(); $midX += intval($r/2 * sin(M_PI/9)) * ($midRadius > M_PI ? -1 : 1); - $midY -= intval($r/2 * cos(M_PI/3) ) * ($midRadius < M_PI*1.4 && $midRadius > M_PI/3 ? -1 : 1); + $midY -= intval($r/2 * cos(M_PI/3)) * ($midRadius < M_PI*1.4 && $midRadius > M_PI/3 ? -1 : 1); if ($ctx->ytoRelative($midY) > 100) { $midY = $ctx->yToAbsolute(100); diff --git a/library/Icinga/Chart/Unit/StaticAxis.php b/library/Icinga/Chart/Unit/StaticAxis.php index eff5620e3..07bbf4a2a 100644 --- a/library/Icinga/Chart/Unit/StaticAxis.php +++ b/library/Icinga/Chart/Unit/StaticAxis.php @@ -140,5 +140,4 @@ class StaticAxis implements AxisUnit { return reset($this->items); } - -} \ No newline at end of file +} diff --git a/library/Icinga/Cli/Command.php b/library/Icinga/Cli/Command.php index 46564fe28..30f6af79e 100644 --- a/library/Icinga/Cli/Command.php +++ b/library/Icinga/Cli/Command.php @@ -126,4 +126,3 @@ abstract class Command { } } - diff --git a/library/Icinga/Cli/Documentation.php b/library/Icinga/Cli/Documentation.php index b9944ee06..7159f1c2a 100644 --- a/library/Icinga/Cli/Documentation.php +++ b/library/Icinga/Cli/Documentation.php @@ -35,13 +35,14 @@ class Documentation $d = "USAGE: icingaweb [module] [action] [options]\n\n" . "Available commands:\n\n"; foreach ($this->loader->listCommands() as $command) { - if ($command === 'autocomplete') continue; - $obj = $this->loader->getCommandInstance($command); - $d .= sprintf( - " %-14s %s\n", - $command, - $this->getClassTitle($obj) - ); + if ($command !== 'autocomplete') { + $obj = $this->loader->getCommandInstance($command); + $d .= sprintf( + " %-14s %s\n", + $command, + $this->getClassTitle($obj) + ); + } } $d .= "\nAvailable modules:\n\n"; foreach ($this->loader->listModules() as $module) { diff --git a/library/Icinga/Cli/Loader.php b/library/Icinga/Cli/Loader.php index ceef6b851..843dd6a5f 100644 --- a/library/Icinga/Cli/Loader.php +++ b/library/Icinga/Cli/Loader.php @@ -131,7 +131,7 @@ class Loader $command, null, false - ); + ); } return $this->commandInstances[$command]; } @@ -346,29 +346,31 @@ class Loader protected function formatTrace($trace) { $output = array(); - foreach($trace as $i => $step) - { + foreach ($trace as $i => $step) { $object = ''; if (isset($step['object']) && is_object($step['object'])) { $object = sprintf('[%s]', get_class($step['object'])) . $step['type']; } elseif (! empty($step['object'])) { $object = (string) $step['object'] . $step['type']; } - if (is_array($step['args'])) - { - foreach ($step['args'] as & $arg) - { - if (is_object($arg)) - { + if (is_array($step['args'])) { + foreach ($step['args'] as & $arg) { + if (is_object($arg)) { $arg = sprintf('[%s]', get_class($arg)); } if (is_string($arg)) { $arg = preg_replace('~\n~', '\n', $arg); - if (strlen($arg) > 50) $arg = substr($arg, 0, 47) . '...'; + if (strlen($arg) > 50) { + $arg = substr($arg, 0, 47) . '...'; + } $arg = "'" . $arg . "'"; } - if ($arg === null) $arg = 'NULL'; - if (is_bool($arg)) $arg = $arg ? 'TRUE' : 'FALSE'; + if ($arg === null) { + $arg = 'NULL'; + } + if (is_bool($arg)) { + $arg = $arg ? 'TRUE' : 'FALSE'; + } } } else { $step['args'] = array(); diff --git a/library/Icinga/Cli/Screen/AnsiScreen.php b/library/Icinga/Cli/Screen/AnsiScreen.php index e8d22d486..fa9cc9cc2 100644 --- a/library/Icinga/Cli/Screen/AnsiScreen.php +++ b/library/Icinga/Cli/Screen/AnsiScreen.php @@ -101,11 +101,11 @@ class AnsiScreen extends Screen $parts = preg_split('/;/', $current); $lc_parts = array(); foreach ($parts as $part) { - if (strpos($part, '=') === false) { - continue; - } - list($key, $val) = preg_split('/=/', $part, 2); - $lc_parts[$key] = $val; + if (strpos($part, '=') === false) { + continue; + } + list($key, $val) = preg_split('/=/', $part, 2); + $lc_parts[$key] = $val; } $this->isUtf8 = array_key_exists('LC_CTYPE', $lc_parts) diff --git a/library/Icinga/Data/Db/Connection.php b/library/Icinga/Data/Db/Connection.php index 666143dbb..e3483dffb 100644 --- a/library/Icinga/Data/Db/Connection.php +++ b/library/Icinga/Data/Db/Connection.php @@ -131,10 +131,10 @@ class Connection implements DatasourceInterface $adapter = 'Pdo_Mysql'; /* * Set MySQL server SQL modes to behave as closely as possible to Oracle and PostgreSQL. Note that the - * ONLY_FULL_GROUP_BY mode is left on purpose because MySQL requires you to specify all non-aggregate columns - * in the group by list even if the query is grouped by the master table's primary key which is valid - * ANSI SQL though. Further in that case the query plan would suffer if you add more columns to the group by - * list. + * ONLY_FULL_GROUP_BY mode is left on purpose because MySQL requires you to specify all non-aggregate + * columns in the group by list even if the query is grouped by the master table's primary key which is + * valid ANSI SQL though. Further in that case the query plan would suffer if you add more columns to + * the group by list. */ $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET SESSION SQL_MODE=\'STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,' @@ -145,21 +145,17 @@ class Connection implements DatasourceInterface $adapter = 'Pdo_Pgsql'; $adapterParamaters['port'] = $this->config->get('port', 5432); break; -// case 'oracle': -// if ($this->dbtype === 'oracle') { -// $attributes['persistent'] = true; -// } -// $this->db = ZfDb::factory($adapter, $attributes); -// if ($adapter === 'Oracle') { -// $this->db->setLobAsString(false); -// } -// break; + /*case 'oracle': + if ($this->dbtype === 'oracle') { + $attributes['persistent'] = true; + } + $this->db = ZfDb::factory($adapter, $attributes); + if ($adapter === 'Oracle') { + $this->db->setLobAsString(false); + } + break;*/ default: - throw new ConfigurationError( - sprintf( - 'Backend "%s" is not supported', $this->dbType - ) - ); + throw new ConfigurationError(sprintf('Backend "%s" is not supported', $this->dbType)); } $this->conn = Zend_Db::factory($adapter, $adapterParamaters); $this->conn->setFetchMode(Zend_Db::FETCH_OBJ); diff --git a/library/Icinga/File/Pdf.php b/library/Icinga/File/Pdf.php index 6239459fd..55510201c 100644 --- a/library/Icinga/File/Pdf.php +++ b/library/Icinga/File/Pdf.php @@ -5,7 +5,6 @@ namespace Icinga\File; use \DOMPDF; use \DOMDocument; use \DOMXPath; -use \DOMNode; require_once 'vendor/dompdf/dompdf_config.inc.php'; @@ -34,7 +33,8 @@ class Pdf extends DOMPDF */ public $paginateTable = true; - public function __construct() { + public function __construct() + { $this->set_paper(DOMPDF_DEFAULT_PAPER_SIZE, "portrait"); parent::__construct(); } diff --git a/library/Icinga/Filter/Query/Node.php b/library/Icinga/Filter/Query/Node.php index 0632e9309..d1abc74a9 100644 --- a/library/Icinga/Filter/Query/Node.php +++ b/library/Icinga/Filter/Query/Node.php @@ -119,7 +119,7 @@ class Node } elseif (!is_array($right)) { $right = array($right); } - foreach($right as &$value) { + foreach ($right as &$value) { $value = trim($value); } $node->right = $right; diff --git a/library/Icinga/Filter/Query/Tree.php b/library/Icinga/Filter/Query/Tree.php index 10577f9ca..ced419679 100644 --- a/library/Icinga/Filter/Query/Tree.php +++ b/library/Icinga/Filter/Query/Tree.php @@ -372,7 +372,7 @@ class Tree if ($ctx->type == Node::TYPE_OPERATOR) { if ($ctx->left == $node->left && $ctx->operator == $node->operator) { - if(empty($node->right) || $ctx->right == $node->right) { + if (empty($node->right) || $ctx->right == $node->right) { return $ctx; } } diff --git a/library/Icinga/Protocol/Commandpipe/CommandPipe.php b/library/Icinga/Protocol/Commandpipe/CommandPipe.php index 3466a888e..4e14ba6d9 100644 --- a/library/Icinga/Protocol/Commandpipe/CommandPipe.php +++ b/library/Icinga/Protocol/Commandpipe/CommandPipe.php @@ -151,7 +151,9 @@ class CommandPipe foreach ($objects as $object) { $objectType = $this->getObjectType($object); if ($objectType === self::TYPE_SERVICE) { - $this->transport->send($command->getServiceCommand($object->host_name, $object->service_description)); + $this->transport->send( + $command->getServiceCommand($object->host_name, $object->service_description) + ); } else { $this->transport->send($command->getHostCommand($object->host_name)); } diff --git a/library/Icinga/Protocol/Statusdat/Parser.php b/library/Icinga/Protocol/Statusdat/Parser.php index 08c936061..3e920def9 100755 --- a/library/Icinga/Protocol/Statusdat/Parser.php +++ b/library/Icinga/Protocol/Statusdat/Parser.php @@ -29,7 +29,6 @@ namespace Icinga\Protocol\Statusdat; -use Icinga\Application\Logger; use Icinga\Exception\ConfigurationError; use Icinga\Exception\ProgrammingError; use Icinga\Protocol\Statusdat\Exception\ParsingException as ParsingException; @@ -320,7 +319,8 @@ class Parser $isContact = strpos($this->currentObjectType, "contact") !== false; $name = $this->getObjectIdentifier($object); - if ($isService === false && $isHost === false && $isContact === false) { // this would be error in the parser implementation + if ($isService === false && $isHost === false && $isContact === false) { + // this would be error in the parser implementation return null; } $property = $this->currentObjectType; diff --git a/library/Icinga/Protocol/Statusdat/PrintableObject.php b/library/Icinga/Protocol/Statusdat/PrintableObject.php index f968e0bf9..5382fc88d 100644 --- a/library/Icinga/Protocol/Statusdat/PrintableObject.php +++ b/library/Icinga/Protocol/Statusdat/PrintableObject.php @@ -35,11 +35,11 @@ class PrintableObject { if (isset($this->contact_name)) { return $this->contact_name; - } else if (isset($this->service_description)) { + } elseif (isset($this->service_description)) { return $this->service_description; - } else if (isset($this->host_name)) { + } elseif (isset($this->host_name)) { return $this->host_name; } return ''; } -} \ No newline at end of file +} diff --git a/library/Icinga/Protocol/Statusdat/Query.php b/library/Icinga/Protocol/Statusdat/Query.php index 543ca5604..14bf766d5 100755 --- a/library/Icinga/Protocol/Statusdat/Query.php +++ b/library/Icinga/Protocol/Statusdat/Query.php @@ -31,8 +31,6 @@ namespace Icinga\Protocol\Statusdat; use Exception; use Icinga\Exception\ProgrammingError; -use Icinga\Filter\Query\Node; -use Icinga\Protocol; use Icinga\Data\BaseQuery; use Icinga\Protocol\Statusdat\View\MonitoringObjectList; use Icinga\Protocol\Statusdat\Query\IQueryPart; @@ -227,7 +225,7 @@ class Query extends BaseQuery if ($baseGroup) { $baseGroup->setQuery($this); $idx = array_keys($state[$target]); - $indexes = $baseGroup->filter($state[$target], $idx ); + $indexes = $baseGroup->filter($state[$target], $idx); } if (!isset($result[$target])) { $result[$target] = $indexes; diff --git a/library/Icinga/Protocol/Statusdat/Query/Expression.php b/library/Icinga/Protocol/Statusdat/Query/Expression.php index 0d1aafe67..b3cb1c655 100755 --- a/library/Icinga/Protocol/Statusdat/Query/Expression.php +++ b/library/Icinga/Protocol/Statusdat/Query/Expression.php @@ -29,8 +29,6 @@ namespace Icinga\Protocol\Statusdat\Query; -use Icinga\Protocol\Ldap\Exception; - class Expression implements IQueryPart { /** @@ -285,7 +283,7 @@ class Expression implements IQueryPart if (!is_string($val) && !is_numeric($val) && is_object($val)) { if (isset($val->service_description)) { $val = $val->service_description; - } elseif(isset($val->host_name)) { + } elseif (isset($val->host_name)) { $val = $val->host_name; } else { return false; @@ -433,6 +431,4 @@ class Expression implements IQueryPart { $this->query = $query; } - - } diff --git a/library/Icinga/Protocol/Statusdat/Query/Group.php b/library/Icinga/Protocol/Statusdat/Query/Group.php index 6a5e12dd3..cf091599a 100755 --- a/library/Icinga/Protocol/Statusdat/Query/Group.php +++ b/library/Icinga/Protocol/Statusdat/Query/Group.php @@ -414,6 +414,4 @@ class Group implements IQueryPart { $this->query = $query; } - - } diff --git a/library/Icinga/Protocol/Statusdat/Query/IQueryPart.php b/library/Icinga/Protocol/Statusdat/Query/IQueryPart.php index 864e84ca5..70c91f168 100755 --- a/library/Icinga/Protocol/Statusdat/Query/IQueryPart.php +++ b/library/Icinga/Protocol/Statusdat/Query/IQueryPart.php @@ -58,5 +58,4 @@ interface IQueryPart * @return mixed */ public function setQuery($query); - } diff --git a/library/Icinga/Protocol/Statusdat/Reader.php b/library/Icinga/Protocol/Statusdat/Reader.php index 6da54e082..4700ac12c 100755 --- a/library/Icinga/Protocol/Statusdat/Reader.php +++ b/library/Icinga/Protocol/Statusdat/Reader.php @@ -32,9 +32,6 @@ namespace Icinga\Protocol\Statusdat; use Icinga\Application\Logger; use Icinga\Data\DatasourceInterface; use Icinga\Exception\ConfigurationError; -use Icinga\Exception; -use Icinga\Benchmark; -use Icinga\Protocol\Statusdat\View\MonitoringObjectList; /** * Class Reader @@ -163,9 +160,11 @@ class Reader implements IReader, DatasourceInterface // the object cache might exist for months and is still valid $this->objectCache = $this->initCache($this->config->object_file, $backendOptions, null, $cachingEnabled); $this->statusCache = $this->initCache( - $this->config->status_file, $backendOptions, $maxCacheLifetime, $cachingEnabled + $this->config->status_file, + $backendOptions, + $maxCacheLifetime, + $cachingEnabled ); - } /** diff --git a/library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php b/library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php index 5ce2c2a10..bba702c79 100755 --- a/library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php +++ b/library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php @@ -94,5 +94,4 @@ class RuntimeStateContainer extends \stdClass return $this->$attr; } - } diff --git a/library/Icinga/Session/PhpSession.php b/library/Icinga/Session/PhpSession.php index 52bbc0efe..354bf198c 100644 --- a/library/Icinga/Session/PhpSession.php +++ b/library/Icinga/Session/PhpSession.php @@ -32,7 +32,6 @@ namespace Icinga\Session; use Icinga\Application\Logger; use \Icinga\Exception\ConfigurationError; - /** * Session implementation in PHP */ diff --git a/library/Icinga/Session/SessionNamespace.php b/library/Icinga/Session/SessionNamespace.php index 97938834a..5770889af 100644 --- a/library/Icinga/Session/SessionNamespace.php +++ b/library/Icinga/Session/SessionNamespace.php @@ -31,7 +31,6 @@ namespace Icinga\Session; use \Exception; - /** * Container for session values */ @@ -50,7 +49,8 @@ class SessionNamespace * @param string $key The value's name * @param mixed $value The value */ - public function __set($key, $value) { + public function __set($key, $value) + { $this->set($key, $value); } @@ -62,7 +62,8 @@ class SessionNamespace * @return mixed The value * @throws Exception When the given value-name is not found */ - public function __get($key) { + public function __get($key) + { if (!array_key_exists($key, $this->values)) { throw new Exception('Cannot access non-existent session value "' + $key + '"'); } @@ -76,7 +77,8 @@ class SessionNamespace * @param string $key The value's name * @return bool */ - public function __isset($key) { + public function __isset($key) + { return isset($this->values[$key]); } @@ -85,7 +87,8 @@ class SessionNamespace * * @param string $key The value's name */ - public function __unset($key) { + public function __unset($key) + { unset($this->values[$key]); } diff --git a/library/Icinga/User/Message.php b/library/Icinga/User/Message.php index d10bb09f5..2fb76f9ee 100644 --- a/library/Icinga/User/Message.php +++ b/library/Icinga/User/Message.php @@ -3,7 +3,6 @@ namespace Icinga\User; use \Zend_Log; -use \DateTime; /** * Class Message @@ -12,8 +11,8 @@ use \DateTime; * * @package Icinga\User */ -class Message { - +class Message +{ /** * The content of this message * @@ -34,7 +33,8 @@ class Message { * * Zend_Log::INFO * * Zend_Log::ERR */ - public function __construct($message, $level = Zend_Log::INFO) { + public function __construct($message, $level = Zend_Log::INFO) + { $this->message = $message; $this->level = $level; } @@ -54,4 +54,4 @@ class Message { { return $this->level; } -} \ No newline at end of file +} diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 7fdbed55f..778f75c0b 100755 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -180,10 +180,12 @@ class ActionController extends Zend_Controller_Action { if ($this->getRequest()->isXmlHttpRequest()) { $this->_response->setHttpResponseCode(401); - $this->_helper->json(array( - 'exception' => 'You are not logged in', - 'redirectTo' => Url::fromPath('/authentication/login')->getAbsoluteUrl() - )); + $this->_helper->json( + array( + 'exception' => 'You are not logged in', + 'redirectTo' => Url::fromPath('/authentication/login')->getAbsoluteUrl() + ) + ); } $url = Url::fromPath('/authentication/login'); $url->setParam('redirect', $afterLogin); diff --git a/library/Icinga/Web/Form/Validator/TriStateValidator.php b/library/Icinga/Web/Form/Validator/TriStateValidator.php index 7f21881c4..c20b87f3c 100644 --- a/library/Icinga/Web/Form/Validator/TriStateValidator.php +++ b/library/Icinga/Web/Form/Validator/TriStateValidator.php @@ -31,8 +31,8 @@ namespace Icinga\Web\Form\Validator; use \Zend_Validate_Abstract; -class TriStateValidator extends Zend_Validate_Abstract { - +class TriStateValidator extends Zend_Validate_Abstract +{ /** * @var null */ @@ -77,4 +77,4 @@ class TriStateValidator extends Zend_Validate_Abstract { { return $this->validPattern; } -} \ No newline at end of file +} diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index 34e5d40d0..5304c6c47 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -40,7 +40,8 @@ class Menu extends MenuItem * * @return Menu */ - public static function fromConfig() { + public static function fromConfig() + { $menu = new static('menu'); $manager = Icinga::app()->getModuleManager(); $menuConfigs = array(Config::app('menu')); @@ -81,5 +82,4 @@ class Menu extends MenuItem } return $this; } - } diff --git a/library/Icinga/Web/Session.php b/library/Icinga/Web/Session.php index 1101e90d2..5fd4dc115 100644 --- a/library/Icinga/Web/Session.php +++ b/library/Icinga/Web/Session.php @@ -34,7 +34,6 @@ use Icinga\Session\SessionNamespace; use Icinga\Session\Session as BaseSession; use Icinga\Exception\ProgrammingError; - /** * Session container */ diff --git a/library/Icinga/Web/Widget/AlertMessageBox.php b/library/Icinga/Web/Widget/AlertMessageBox.php index 111e0cbec..d019d5245 100644 --- a/library/Icinga/Web/Widget/AlertMessageBox.php +++ b/library/Icinga/Web/Widget/AlertMessageBox.php @@ -17,8 +17,8 @@ use Icinga\Authentication\Manager as AuthenticationManager; * but this is done lazily when render() is called, to ensure that messages will * always be displayed before they are cleared. */ -class AlertMessageBox implements \Icinga\Web\Widget\Widget { - +class AlertMessageBox implements \Icinga\Web\Widget\Widget +{ /** * Remove all messages from the current user, return them and commit * changes to the underlying session. @@ -74,10 +74,11 @@ class AlertMessageBox implements \Icinga\Web\Widget\Widget { /** * Create a new AlertBox * - * @param boolean showUserMessages If the current user messages should be displayed - * in this AlertMessageBox. Defaults to false + * @param boolean showUserMessages If the current user messages should be displayed + * in this AlertMessageBox. Defaults to false */ - public function __construct($showUserMessages = false) { + public function __construct($showUserMessages = false) + { if ($showUserMessages) { $this->user = AuthenticationManager::getInstance()->getUser(); } @@ -108,10 +109,11 @@ class AlertMessageBox implements \Icinga\Web\Widget\Widget { * * @return string */ - public function render(Zend_View_Abstract $view = null) { + public function render(Zend_View_Abstract $view = null) + { $html = ''; if (isset($this->user)) { - $this->messages = array_merge($this->messages, $this->getAndClearMessages()); + $this->messages = array_merge($this->messages, $this->getAndClearMessages()); } foreach ($this->messages as $message) { $level = $message->getLevel(); diff --git a/library/Icinga/Web/Widget/Chart/PieChart.php b/library/Icinga/Web/Widget/Chart/PieChart.php index 8832cc123..0e4547135 100644 --- a/library/Icinga/Web/Widget/Chart/PieChart.php +++ b/library/Icinga/Web/Widget/Chart/PieChart.php @@ -34,8 +34,8 @@ use Icinga\Web\Url; use \Zend_View_Abstract; -class PieChart implements Widget { - +class PieChart implements Widget +{ /** * The template string used for rendering this widget * @@ -123,4 +123,4 @@ EOD; $template = preg_replace('{{height}}', $this->height, $template); return $template; } -} \ No newline at end of file +} diff --git a/library/Icinga/Web/Widget/Dashboard/Component.php b/library/Icinga/Web/Widget/Dashboard/Component.php index 10db222c3..b78b0ce3a 100644 --- a/library/Icinga/Web/Widget/Dashboard/Component.php +++ b/library/Icinga/Web/Widget/Dashboard/Component.php @@ -213,7 +213,7 @@ EOD; $html = str_replace('{FULL_URL}', $url->getUrlWithout('view')->getAbsoluteUrl(), $html); $html = str_replace('{REMOVE_BTN}', $this->getRemoveForm($view), $html); $html = str_replace('{DIMENSION}', $this->getBoxSizeAsCSS(), $html); - $html = str_replace('{{IS_FULL}}', $this->fullsize ? 'row' : '' , $html); + $html = str_replace('{{IS_FULL}}', $this->fullsize ? 'row' : '', $html); $html = str_replace('{TITLE}', htmlentities($this->getTitle()), $html); return $html; } @@ -236,14 +236,16 @@ EOD; $form = new Form(); $form->setMethod('POST'); $form->setAction($removeUrl); - $form->addElement(new Zend_Form_Element_Button( - 'remove_pane_btn', - array( - 'class'=> 'btn btn-danger pull-right', - 'type' => 'submit', - 'label' => 'Remove' + $form->addElement( + new Zend_Form_Element_Button( + 'remove_pane_btn', + array( + 'class'=> 'btn btn-danger pull-right', + 'type' => 'submit', + 'label' => 'Remove' + ) ) - )); + ); return $form->render($view); } diff --git a/library/Icinga/Web/Widget/FilterBadgeRenderer.php b/library/Icinga/Web/Widget/FilterBadgeRenderer.php index 818083e9a..2a59fa689 100644 --- a/library/Icinga/Web/Widget/FilterBadgeRenderer.php +++ b/library/Icinga/Web/Widget/FilterBadgeRenderer.php @@ -51,7 +51,7 @@ class FilterBadgeRenderer implements Widget private $tpl =<<<'EOT'
- + {{FILTER_SUM}} {{SUBLIST}} @@ -89,7 +89,7 @@ EOT; $value = $node->right[0]; } else { $value = join(',', $node->right); - if(strlen($value) > 15) { + if (strlen($value) > 15) { $value = substr($value, 0, 13) . '..'; } } @@ -110,7 +110,7 @@ EOT; $url = $basePath . (empty($allParams) ? '?' : '&') . $url; $liItem = str_replace('{{REMOVE_FILTER}}', $url, $this->subItemTpl); - $liItem = str_replace('{{FILTER_TEXT}}', ucfirst($node->left) . $node->operator . $value , $liItem); + $liItem = str_replace('{{FILTER_TEXT}}', ucfirst($node->left) . $node->operator . $value, $liItem); $liItems .= $liItem; }