Merge branch 'master' into bugfix/significant-whitespaces-8777

This commit is contained in:
Eric Lippmann 2015-04-08 10:19:53 +02:00
commit 45d1230b28
59 changed files with 218 additions and 172 deletions

View File

@ -34,7 +34,7 @@ class DbBackendForm extends Form
*
* @param array $resources The resources to choose from
*
* @return self
* @return $this
*/
public function setResources(array $resources)
{

View File

@ -35,7 +35,7 @@ class LdapBackendForm extends Form
*
* @param array $resources The resources to choose from
*
* @return self
* @return $this
*/
public function setResources(array $resources)
{

View File

@ -38,7 +38,7 @@ class AuthenticationBackendConfigForm extends ConfigForm
*
* @param Config $resources The resource configuration
*
* @return self
* @return $this
*/
public function setResourceConfig(Config $resourceConfig)
{
@ -82,7 +82,7 @@ class AuthenticationBackendConfigForm extends ConfigForm
*
* @param array $values The values to extend the configuration with
*
* @return self
* @return $this
*
* @throws InvalidArgumentException In case the backend does already exist
*/
@ -159,7 +159,7 @@ class AuthenticationBackendConfigForm extends ConfigForm
* @param string $name The name of the backend to be moved
* @param int $position The new (absolute) position of the backend
*
* @return self
* @return $this
*
* @throws InvalidArgumentException In case the backend does not exist
*/

View File

@ -49,6 +49,7 @@ class DbResourceForm extends Form
'db',
array(
'required' => true,
'autosubmit' => true,
'label' => $this->translate('Database Type'),
'description' => $this->translate('The type of SQL database'),
'multiOptions' => $dbChoices
@ -68,10 +69,11 @@ class DbResourceForm extends Form
'number',
'port',
array(
'required' => true,
'label' => $this->translate('Port'),
'description' => $this->translate('The port to use'),
'value' => 3306
'required' => true,
'preserveDefault' => true,
'label' => $this->translate('Port'),
'description' => $this->translate('The port to use'),
'value' => ! array_key_exists('db', $formData) || $formData['db'] === 'mysql' ? 3306 : 5432
)
);
$this->addElement(

View File

@ -27,6 +27,10 @@ class LdapResourceForm extends Form
*/
public function createElements(array $formData)
{
$defaultPort = ! array_key_exists('encryption', $formData) || $formData['encryption'] !== Connection::LDAPS
? 389
: 636;
$this->addElement(
'text',
'name',
@ -52,10 +56,11 @@ class LdapResourceForm extends Form
'number',
'port',
array(
'required' => true,
'label' => $this->translate('Port'),
'description' => $this->translate('The port of the LDAP server to use for authentication'),
'value' => 389
'required' => true,
'preserveDefault' => true,
'label' => $this->translate('Port'),
'description' => $this->translate('The port of the LDAP server to use for authentication'),
'value' => $defaultPort
)
);
$this->addElement(

View File

@ -53,7 +53,7 @@ class ResourceConfigForm extends ConfigForm
*
* @param array $values The values to extend the configuration with
*
* @return self
* @return $this
*
* @thrwos InvalidArgumentException In case the resource does already exist
*/

View File

@ -25,7 +25,7 @@ class ConfigForm extends Form
*
* @param Config $config The configuration to use
*
* @return self
* @return $this
*/
public function setIniConfig(Config $config)
{

View File

@ -48,7 +48,7 @@ class PreferenceForm extends Form
*
* @param Preferences $preferences The preferences to work with
*
* @return self
* @return $this
*/
public function setPreferences(Preferences $preferences)
{
@ -61,17 +61,18 @@ class PreferenceForm extends Form
*
* @param PreferencesStore $store The preference store to use
*
* @return self
* @return $this
*/
public function setStore(PreferencesStore $store)
{
$this->store = $store;
return $this;
}
/**
* Persist preferences
*
* @return self
* @return $this
*/
public function save()
{

View File

@ -37,7 +37,7 @@ class Zend_View_Helper_DateFormat extends Zend_View_Helper_Abstract
/**
* Helper entry point
*
* @return self
* @return $this
*/
public function dateFormat()
{

View File

@ -77,7 +77,7 @@ class Config implements Countable, Iterator
*
* @param string $filepath The path to the ini file
*
* @return self
* @return $this
*/
public function setConfigFile($filepath)
{
@ -223,7 +223,7 @@ class Config implements Countable, Iterator
* @param string $name
* @param array|ConfigObject $config
*
* @return self
* @return $this
*/
public function setSection($name, $config = null)
{
@ -242,7 +242,7 @@ class Config implements Countable, Iterator
*
* @param string $name
*
* @return self
* @return $this
*/
public function removeSection($name)
{

View File

@ -20,7 +20,7 @@ class EmbeddedWeb extends ApplicationBootstrap
* Embedded bootstrap parts
*
* @see ApplicationBootstrap::bootstrap
* @return self
* @return $this
*/
protected function bootstrap()
{

View File

@ -156,7 +156,7 @@ class Manager
/**
* Try to set all enabled modules in loaded sate
*
* @return self
* @return $this
* @see Manager::loadModule()
*/
public function loadEnabledModules()
@ -173,7 +173,7 @@ class Manager
* @param string $name The name of the module to load
* @param mixed $basedir Optional module base directory
*
* @return self
* @return $this
*/
public function loadModule($name, $basedir = null)
{
@ -197,7 +197,7 @@ class Manager
*
* @param string $name The module to enable
*
* @return self
* @return $this
* @throws ConfigurationError When trying to enable a module that is not installed
* @throws NotFoundError In case the "enabledModules" directory does not exist
* @throws SystemPermissionException When insufficient permissions for the application exist
@ -256,7 +256,7 @@ class Manager
*
* @param string $name The name of the module to disable
*
* @return self
* @return $this
*
* @throws ConfigurationError When the module is not installed or it's not a symlink
* @throws SystemPermissionException When the module can't be disabled
@ -491,7 +491,7 @@ class Manager
*
* @param array $availableDirs Installed modules location
*
* @return self
* @return $this
*/
public function detectInstalledModules(array $availableDirs = null)
{

View File

@ -752,7 +752,7 @@ class Module
* @param string $name Unique tab name
* @param string $config Tab config
*
* @return self
* @return $this
*/
protected function provideConfigTab($name, $config = array())
{
@ -769,7 +769,7 @@ class Module
*
* @param string $className The name of the class
*
* @return self
* @return $this
*/
protected function provideSetupWizard($className)
{
@ -780,7 +780,7 @@ class Module
/**
* Register new namespaces on the autoloader
*
* @return self
* @return $this
*/
protected function registerAutoloader()
{
@ -802,7 +802,7 @@ class Module
/**
* Bind text domain for i18n
*
* @return self
* @return $this
*/
protected function registerLocales()
{
@ -849,7 +849,7 @@ class Module
*
* Add controller directory to mvc
*
* @return self
* @return $this
*/
protected function registerWebIntegration()
{
@ -872,7 +872,7 @@ class Module
/**
* Add routes for static content and any route added via addRoute() to the route chain
*
* @return self
* @return $this
* @see addRoute()
*/
protected function registerRoutes()
@ -912,7 +912,7 @@ class Module
/**
* Run module bootstrap script
*
* @return self
* @return $this
*/
protected function launchRunScript()
{
@ -924,7 +924,7 @@ class Module
*
* @param string $file File to include
*
* @return self
* @return $this
*/
protected function includeScript($file)
{
@ -958,7 +958,7 @@ class Module
* @param string $class
* @param string $key
*
* @return self
* @return $this
*/
protected function registerHook($name, $class, $key = null)
{
@ -977,7 +977,7 @@ class Module
* @param string $name Name of the route
* @param Zend_Controller_Router_Route_Abstract $route Instance of the route
*
* @return self
* @return $this
* @see registerRoutes()
*/
protected function addRoute($name, Zend_Controller_Router_Route_Abstract $route)

View File

@ -26,7 +26,7 @@ abstract class UserBackend implements Countable
*
* @param string $name
*
* @return self
* @return $this
*/
public function setName($name)
{

View File

@ -115,7 +115,7 @@ class Axis implements Drawable
*
* @param AxisUnit $unit The AxisUnit implementation to use for the x axis
*
* @return self This Axis Object
* @return $this This Axis Object
* @see Axis::CalendarUnit
* @see Axis::LinearUnit
*/
@ -130,7 +130,7 @@ class Axis implements Drawable
*
* @param AxisUnit $unit The AxisUnit implementation to use for the y axis
*
* @return self This Axis Object
* @return $this This Axis Object
* @see Axis::CalendarUnit
* @see Axis::LinearUnit
*/
@ -331,7 +331,7 @@ class Axis implements Drawable
*
* @param string $label The label to use for the y axis
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setYLabel($label)
{
@ -346,7 +346,7 @@ class Axis implements Drawable
*
* @param int $xMin The minimum value to use for the x axis
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setXMin($xMin)
{
@ -361,7 +361,7 @@ class Axis implements Drawable
*
* @param int $yMin The minimum value to use for the x axis
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setYMin($yMin)
{
@ -376,7 +376,7 @@ class Axis implements Drawable
*
* @param int $xMax The minimum value to use for the x axis
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setXMax($xMax)
{
@ -391,7 +391,7 @@ class Axis implements Drawable
*
* @param int $yMax The minimum value to use for the y axis
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setYMax($yMax)
{

View File

@ -132,7 +132,7 @@ class GridChart extends Chart
*
* @param array $axis,... The line definitions to draw
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function drawLines(array $axis)
{
@ -146,7 +146,7 @@ class GridChart extends Chart
* Refer to the graphs.md for a detailed list of allowed attributes
*
* @param array $axis
* @return self
* @return $this
*/
public function drawBars(array $axis)
{
@ -215,7 +215,7 @@ class GridChart extends Chart
* @param string $yAxisLabel The label to use for the y axis
* @param string $axisName The name of the axis, for now 'default'
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setAxisLabel($xAxisLabel, $yAxisLabel, $axisName = 'default')
{
@ -229,7 +229,7 @@ class GridChart extends Chart
* @param AxisUnit $unit The unit for the x axis
* @param string $axisName The name of the axis to set the label for, currently only 'default'
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setXAxis(AxisUnit $unit, $axisName = 'default')
{
@ -243,7 +243,7 @@ class GridChart extends Chart
* @param AxisUnit $unit The unit for the y axis
* @param string $axisName The name of the axis to set the label for, currently only 'default'
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setYAxis(AxisUnit $unit, $axisName = 'default')
{
@ -276,7 +276,7 @@ class GridChart extends Chart
* @param Axis $axis The new axis to use
* @param string $name The name of the axis, currently only 'default'
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setAxis(Axis $axis, $name = 'default')
{
@ -290,7 +290,7 @@ class GridChart extends Chart
* @param Axis $axis The axis object to add
* @param string $name The name of the axis
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function addAxis(Axis $axis, $name)
{
@ -307,7 +307,7 @@ class GridChart extends Chart
* @param int $yMin The minimum value for the y axis or null to use a dynamic value
* @param string $axisName The name of the axis to set the minimum, currently only 'default'
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setAxisMin($xMin = null, $yMin = null, $axisName = 'default')
{
@ -324,7 +324,7 @@ class GridChart extends Chart
* @param int $yMax The maximum value for the y axis or null to use a dynamic value
* @param string $axisName The name of the axis to set the maximum, currently only 'default'
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setAxisMax($xMax = null, $yMax = null, $axisName = 'default')
{

View File

@ -107,7 +107,7 @@ class PieChart extends Chart
*
* @param array $dataSet,... The pie definition, see graphs.md for further details concerning the format
*
* @return self Fluent interface
* @return $this Fluent interface
*/
public function drawPie(array $dataSet)
{
@ -272,7 +272,7 @@ class PieChart extends Chart
*
* @param string $type Either self::STACKED or self::ROW
*
* @return self Fluent interface
* @return $this Fluent interface
*/
public function setType($type)
{
@ -283,7 +283,7 @@ class PieChart extends Chart
/**
* Hide the caption from this PieChart
*
* @return self Fluent interface
* @return $this Fluent interface
*/
public function disableLegend()
{

View File

@ -77,7 +77,7 @@ class Path extends Styleable implements Drawable
*
* @param array $points Either a single [x, y] point or an array of x, y points
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function append(array $points)
{
@ -96,7 +96,7 @@ class Path extends Styleable implements Drawable
*
* @param array $points Either a single [x, y] point or an array of x, y points
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function prepend(array $points)
{
@ -115,7 +115,7 @@ class Path extends Styleable implements Drawable
*
* @param boolean $bool True to draw discrete or false to draw straight lines between points
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setDiscrete($bool)
{
@ -126,7 +126,7 @@ class Path extends Styleable implements Drawable
/**
* Mark this path as containing absolute coordinates
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function toAbsolute()
{

View File

@ -189,7 +189,7 @@ class PieSlice extends Animatable implements Drawable
*
* @param int $x The new x position
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setX($x)
{
@ -202,7 +202,7 @@ class PieSlice extends Animatable implements Drawable
*
* @param int $y The new y position
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setY($y)
{
@ -215,7 +215,7 @@ class PieSlice extends Animatable implements Drawable
*
* @param DOMElement $group The label group
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setLabelGroup(DOMElement $group)
{
@ -228,7 +228,7 @@ class PieSlice extends Animatable implements Drawable
*
* @param string $caption The caption for this element
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setCaption($caption)
{
@ -241,7 +241,7 @@ class PieSlice extends Animatable implements Drawable
*
* @param int $offset The offset for the caption handle
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setCaptionOffset($offset)
{
@ -254,7 +254,7 @@ class PieSlice extends Animatable implements Drawable
*
* @param int $bound The offset for the caption text
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setOuterCaptionBound($bound)
{

View File

@ -59,7 +59,7 @@ class Styleable
*
* @param string $width The stroke with with unit
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setStrokeWidth($width)
{
@ -72,7 +72,7 @@ class Styleable
*
* @param string $color The color to set for the stroke
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setStrokeColor($color)
{
@ -85,7 +85,7 @@ class Styleable
*
* @param string $styles The styles to set additionally
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setAdditionalStyle($styles)
{
@ -98,7 +98,7 @@ class Styleable
*
* @param string $color The color to use for filling or null to use no fill
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setFill($color = null)
{
@ -111,7 +111,7 @@ class Styleable
*
* @param string $id The id to set for this element
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setId($id)
{

View File

@ -104,7 +104,7 @@ class Text extends Styleable implements Drawable
*
* @param string $size The font size including a unit
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setFontSize($size)
{
@ -117,7 +117,7 @@ class Text extends Styleable implements Drawable
*
* @param String $align Value how to align
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setAlignment($align)
{
@ -130,7 +130,7 @@ class Text extends Styleable implements Drawable
*
* @param string $weight The weight of the string
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function setFontWeight($weight)
{

View File

@ -110,7 +110,7 @@ class CalendarUnit extends LinearUnit
* @param array $dataset The dataset to update
* @param int $idx The index to use for determining the data
*
* @return self Fluid interface
* @return $this Fluid interface
*/
public function addValues(array $dataset, $idx = 0)
{

View File

@ -74,7 +74,7 @@ class LinearUnit implements AxisUnit
* @param array $dataset The dataset to add
* @param int $idx The idx (0 for x, 1 for y)
*
* @return self Fluent interface
* @return $this Fluent interface
*/
public function addValues(array $dataset, $idx = 0)
{

View File

@ -65,7 +65,7 @@ class LogarithmicUnit implements AxisUnit
* @param array $dataset The dataset to add
* @param int $idx The idx (0 for x, 1 for y)
*
* @return self Fluent interface
* @return $this Fluent interface
*/
public function addValues(array $dataset, $idx = 0)
{

View File

@ -15,7 +15,7 @@ class StaticAxis implements AxisUnit
* @param array $dataset The dataset that will be shown in the Axis
* @param int $idx The idx in the dataset (0 for x, 1 for y)
*
* @return self Fluent interface
* @return $this Fluent interface
*/
public function addValues(array $dataset, $idx = 0)
{

View File

@ -186,7 +186,7 @@ class Params
* @param string $key The option name
* @param mixed $value The value to set
*
* @return self
* @return $this
*/
public function set($key, $value)
{
@ -199,7 +199,7 @@ class Params
*
* @param string|array $keys The option or options to remove
*
* @return self
* @return $this
*/
public function remove($keys = array())
{
@ -263,7 +263,7 @@ class Params
*
* @param mixed $key The argument
*
* @return self
* @return $this
*/
public function unshift($key)
{

View File

@ -274,7 +274,7 @@ class ConfigObject implements Countable, Iterator, ArrayAccess
*
* @param array|Config $data An array or a config
*
* @return self
* @return $this
*/
public function merge($data)
{

View File

@ -183,7 +183,7 @@ class DbConnection implements Selectable
*
* @param string $prefix
*
* @return self
* @return $this
*/
public function setTablePrefix($prefix)
{

View File

@ -63,7 +63,7 @@ class PivotTable
/**
* Prepare the queries used for the pre processing
*
* @return self
* @return $this
*/
protected function prepareQueries()
{
@ -82,7 +82,7 @@ class PivotTable
/**
* Set a default sorting for the x- and y-axis without losing any existing rules
*
* @return self
* @return $this
*/
protected function adjustSorting()
{

View File

@ -106,7 +106,7 @@ class SimpleQuery implements QueryInterface, Queryable
*
* Query will return all available columns if none are given here
*
* @return self
* @return $this
*/
public function from($target, array $fields = null)
{
@ -125,7 +125,7 @@ class SimpleQuery implements QueryInterface, Queryable
* @param string $condition
* @param mixed $value
*
* @return self
* @return $this
*/
public function where($condition, $value = null)
{
@ -192,7 +192,7 @@ class SimpleQuery implements QueryInterface, Queryable
* @param string $field
* @param string $direction
*
* @return self
* @return $this
*/
public function order($field, $direction = null)
{
@ -270,7 +270,7 @@ class SimpleQuery implements QueryInterface, Queryable
* @param int $count Number of rows to return
* @param int $offset Start returning after this many rows
*
* @return self
* @return $this
*/
public function limit($count = null, $offset = null)
{
@ -417,7 +417,7 @@ class SimpleQuery implements QueryInterface, Queryable
*
* @param array $columns
*
* @return self
* @return $this
*/
public function columns(array $columns)
{

View File

@ -416,7 +416,7 @@ if ($col > $size - 1) return $res;
/**
* Disconnect in case we are connected to a Livestatus socket
*
* @return self
* @return $this
*/
public function disconnect()
{

View File

@ -33,6 +33,11 @@ use Icinga\Web\Form\Element\CsrfCounterMeasure;
*/
class Form extends Zend_Form
{
/**
* The suffix to append to a field's hidden default field name
*/
const DEFAULT_SUFFIX = '_default';
/**
* Whether this form has been created
*
@ -211,7 +216,7 @@ class Form extends Zend_Form
*
* @param string $label The label to use for the submit button
*
* @return self
* @return $this
*/
public function setSubmitLabel($label)
{
@ -234,7 +239,7 @@ class Form extends Zend_Form
*
* @param string|Url $url The url to redirect to
*
* @return self
* @return $this
*/
public function setRedirectUrl($url)
{
@ -263,7 +268,7 @@ class Form extends Zend_Form
*
* @param string $viewScript The view script to use
*
* @return self
* @return $this
*/
public function setViewScript($viewScript)
{
@ -286,7 +291,7 @@ class Form extends Zend_Form
*
* @param bool $disabled Set true in order to disable CSRF protection for this form, otherwise false
*
* @return self
* @return $this
*/
public function setTokenDisabled($disabled = true)
{
@ -314,7 +319,7 @@ class Form extends Zend_Form
*
* @param string $name The name to set
*
* @return self
* @return $this
*/
public function setTokenElementName($name)
{
@ -337,7 +342,7 @@ class Form extends Zend_Form
*
* @param bool $disabled Set true in order to disable identification for this form, otherwise false
*
* @return self
* @return $this
*/
public function setUidDisabled($disabled = true)
{
@ -365,7 +370,7 @@ class Form extends Zend_Form
*
* @param string $name The name to set
*
* @return self
* @return $this
*/
public function setUidElementName($name)
{
@ -388,7 +393,7 @@ class Form extends Zend_Form
*
* @param bool $state
*
* @return self
* @return $this
*/
public function setValidatePartial($state)
{
@ -525,7 +530,7 @@ class Form extends Zend_Form
*
* @param array $formData The data sent by the user
*
* @return self
* @return $this
*/
public function create(array $formData = array())
{
@ -593,7 +598,7 @@ class Form extends Zend_Form
* Uses the label previously set with Form::setSubmitLabel(). Overwrite this
* method in order to add multiple submit buttons or one with a custom name.
*
* @return self
* @return $this
*/
public function addSubmitButton()
{
@ -731,6 +736,20 @@ class Form extends Zend_Form
unset($el->autosubmit);
}
if ($el->getAttrib('preserveDefault')) {
$el->addDecorator(
array('preserveDefault' => 'HtmlTag'),
array(
'tag' => 'input',
'type' => 'hidden',
'name' => $name . static::DEFAULT_SUFFIX,
'value' => $el->getValue()
)
);
unset($el->preserveDefault);
}
return $this->ensureElementAccessibility($el);
}
@ -773,7 +792,7 @@ class Form extends Zend_Form
/**
* Add a field with a unique and form specific ID
*
* @return self
* @return $this
*/
public function addFormIdentification()
{
@ -795,7 +814,7 @@ class Form extends Zend_Form
/**
* Add CSRF counter measure field to this form
*
* @return self
* @return $this
*/
public function addCsrfCounterMeasure()
{
@ -814,6 +833,17 @@ class Form extends Zend_Form
public function populate(array $defaults)
{
$this->create($defaults);
foreach ($this->getElements() as $name => $_) {
if (
array_key_exists($name, $defaults)
&& array_key_exists($name . static::DEFAULT_SUFFIX, $defaults)
&& $defaults[$name] === $defaults[$name . static::DEFAULT_SUFFIX]
) {
unset($defaults[$name]);
}
}
return parent::populate($defaults);
}
@ -900,10 +930,18 @@ class Form extends Zend_Form
{
$this->create($formData);
// Ensure that disabled elements are not overwritten (http://www.zendframework.com/issues/browse/ZF-6909)
foreach ($this->getElements() as $name => $element) {
if ($element->getAttrib('disabled')) {
$formData[$name] = $element->getValue();
if (array_key_exists($name, $formData)) {
if ($element->getAttrib('disabled')) {
// Ensure that disabled elements are not overwritten
// (http://www.zendframework.com/issues/browse/ZF-6909)
$formData[$name] = $element->getValue();
} elseif (
array_key_exists($name . static::DEFAULT_SUFFIX, $formData)
&& $formData[$name] === $formData[$name . static::DEFAULT_SUFFIX]
) {
unset($formData[$name]);
}
}
}
@ -948,7 +986,7 @@ class Form extends Zend_Form
* Overwrites Zend_Form::loadDefaultDecorators to avoid having
* the HtmlTag-Decorator added and to provide viewscript usage
*
* @return self
* @return $this
*/
public function loadDefaultDecorators()
{

View File

@ -639,7 +639,7 @@ class Menu implements RecursiveIterator
*
* @param array $menus The menus to load, as key-value array
*
* @return static
* @return $this
*/
protected function loadSubMenus(array $menus)
{

View File

@ -95,7 +95,7 @@ class SessionNamespace implements IteratorAggregate
* @param string $key Name of value
* @param mixed $value Value to set
*
* @return self
* @return $this
*/
public function set($key, $value)
{

View File

@ -163,7 +163,7 @@ class Url
*
* @param string $baseUrl The url path to use as the Url Base
*
* @return self
* @return $this
*/
public function setBaseUrl($baseUrl)
{
@ -190,7 +190,7 @@ class Url
*
* @param string $path The path to set
*
* @return self
* @return $this
*/
public function setPath($path)
{
@ -250,7 +250,7 @@ class Url
*
* @param array $params The parameters to add
*
* @return self
* @return $this
*/
public function addParams(array $params)
{
@ -266,7 +266,7 @@ class Url
*
* @param array $params The parameters to set
*
* @return self
* @return $this
*/
public function overwriteParams(array $params)
{
@ -282,7 +282,7 @@ class Url
*
* @param UrlParams|array $params The new parameters to use for the query part
*
* @return self
* @return $this
*/
public function setParams($params)
{
@ -343,7 +343,7 @@ class Url
* @param string $param The query parameter name
* @param array|string $value An array or string to set as the parameter value
*
* @return self
* @return $this
*/
public function setParam($param, $value = true)
{
@ -356,7 +356,7 @@ class Url
*
* @param string $anchor The site's anchor string without the '#'
*
* @return self
* @return $this
*/
public function setAnchor($anchor)
{
@ -369,7 +369,7 @@ class Url
*
* @param string|array $keyOrArrayOfKeys An array of strings or a string representing the key(s)
* of the parameters to be removed
* @return self
* @return $this
*/
public function remove($keyOrArrayOfKeys)
{

View File

@ -159,7 +159,7 @@ class UrlParams
* @param string $param The parameter you're interested in
* @param string $value The value to be stored
*
* @return self
* @return $this
*/
public function add($param, $value = true)
{
@ -175,7 +175,7 @@ class UrlParams
* @param string $param Parameter name or param/value list
* @param string $value The value to be stored
*
* @return self
* @return $this
*/
public function addValues($param, $values = null)
{
@ -231,7 +231,7 @@ class UrlParams
* @param string $param The parameter you're interested in
* @param string $value The value to be stored
*
* @return self
* @return $this
*/
public function unshift($param, $value)
{
@ -248,7 +248,7 @@ class UrlParams
* @param string $param The parameter you want to set
* @param string $value The value to be stored
*
* @return self
* @return $this
*/
public function set($param, $value)
{

View File

@ -104,7 +104,7 @@ class View extends Zend_View_Abstract
*
* @param string $name The desired function name
* @param Closure $function An anonymous function
* @return self
* @return $this
*/
public function addHelperFunction($name, Closure $function)
{

View File

@ -64,7 +64,7 @@ class Dashboard extends AbstractWidget
/**
* Load Pane items provided by all enabled modules
*
* @return self
* @return $this
*/
public function load()
{
@ -241,7 +241,7 @@ class Dashboard extends AbstractWidget
*
* @param string $title
*
* @return self
* @return $this
*/
public function createPane($title)
{
@ -278,7 +278,7 @@ class Dashboard extends AbstractWidget
*
* @param Pane $pane The pane to add
*
* @return self
* @return $this
*/
public function addPane(Pane $pane)
{

View File

@ -119,7 +119,7 @@ EOD;
*
* @param string|Url $url The url to use, either as an Url object or as a path
*
* @return self
* @return $this
*/
public function setUrl($url)
{

View File

@ -78,7 +78,7 @@ class Pane extends UserWidget
*
* @param string $title The new title to use for this pane
*
* @return self
* @return $this
*/
public function setTitle($title)
{
@ -198,7 +198,7 @@ class Pane extends UserWidget
* (if a new dashlet will be created)
* @param string|null $url An Url to be used when dashlet is a string
*
* @return self
* @return $this
* @throws \Icinga\Exception\ConfigurationError
*/
public function addDashlet($dashlet, $url = null)

View File

@ -87,7 +87,7 @@ class SortBox extends AbstractWidget
*
* @param Request $request The request to use for populating the form
*
* @return static $this
* @return $this
*/
public function applyRequest($request)
{

View File

@ -235,7 +235,7 @@ class Tab extends AbstractWidget
*
* @param bool $active Whether the tab should be active
*
* @return self
* @return $this
*/
public function setActive($active = true)
{

View File

@ -116,7 +116,7 @@ EOT;
*
* @param string $name Name of the tab going to be activated
*
* @return self
* @return $this
*
* @throws ProgrammingError When the given tab name doesn't exist
*
@ -148,7 +148,7 @@ EOT;
*
* @param string $name CSS class name(s)
*
* @return self
* @return $this
*/
public function setClass($name)
{
@ -194,7 +194,7 @@ EOT;
* @param string $name The new tab name
* @param array|Tab $tab The tab itself of its properties
*
* @return self
* @return $this
*
* @throws ProgrammingError When the tab name already exists
*/
@ -219,7 +219,7 @@ EOT;
* @param string $name The new tab name
* @param array|Tab $tab The tab itself of its properties
*
* @return self
* @return $this
*/
public function set($name, $tab)
{
@ -236,7 +236,7 @@ EOT;
*
* @param string $name
*
* @return self
* @return $this
*/
public function remove($name)
{
@ -427,7 +427,7 @@ EOT;
*
* @param Tabextension $tabextension
*
* @return self
* @return $this
*/
public function extend(Tabextension $tabextension)
{

View File

@ -92,7 +92,7 @@ class Wizard
*
* @param Wizard $wizard The parent wizard
*
* @return self
* @return $this
*/
public function setParent(Wizard $wizard)
{
@ -144,7 +144,7 @@ class Wizard
*
* @param Form|Wizard $page The page or wizard to add to the wizard
*
* @return self
* @return $this
*/
public function addPage($page)
{
@ -166,7 +166,7 @@ class Wizard
*
* @param array $pages The pages or wizards to add to the wizard
*
* @return self
* @return $this
*/
public function addPages(array $pages)
{
@ -221,7 +221,7 @@ class Wizard
*
* @param Form $page The page to set as current page
*
* @return self
* @return $this
*/
public function setCurrentPage(Form $page)
{
@ -504,7 +504,7 @@ class Wizard
*
* @param bool $state Whether this wizard has been completed
*
* @return self
* @return $this
*/
public function setIsFinished($state = true)
{

View File

@ -60,7 +60,7 @@ class InstanceConfigForm extends ConfigForm
*
* @param array $values The values to extend the configuration with
*
* @return self
* @return $this
*
* @throws InvalidArgumentException In case the resource already exists
*/

View File

@ -9,7 +9,7 @@ class Zend_View_Helper_CheckPerformance extends Zend_View_Helper_Abstract
/**
* Create dispatch instance
*
* @return self
* @return $this
*/
public function checkPerformance()
{

View File

@ -6,7 +6,7 @@ class Zend_View_Helper_Customvar extends Zend_View_Helper_Abstract
/**
* Create dispatch instance
*
* @return self
* @return $this
*/
public function checkPerformance()
{

View File

@ -9,7 +9,7 @@ class Zend_View_Helper_RuntimeVariables extends Zend_View_Helper_Abstract
/**
* Create dispatch instance
*
* @return self
* @return $this
*/
public function runtimeVariables()
{

View File

@ -199,7 +199,7 @@ abstract class IdoQuery extends DbQuery
* @param string $columnOrAlias The column or column alias to order by
* @param int $dir The sort direction or null to use default direction
*
* @return self Fluent interface
* @return $this Fluent interface
*/
public function order($columnOrAlias, $dir = null)
{
@ -487,7 +487,7 @@ abstract class IdoQuery extends DbQuery
*
* @param $alias The alias of the column to require
*
* @return self Fluent interface
* @return $this Fluent interface
* @see IdoQuery::requireVirtualTable The method initializing required joins
* @throws \Icinga\Exception\ProgrammingError When an unknown column is requested
*/
@ -522,7 +522,7 @@ abstract class IdoQuery extends DbQuery
* Require a virtual table for the given table name if not already required
*
* @param String $name The table name to require
* @return self Fluent interface
* @return $this Fluent interface
*/
protected function requireVirtualTable($name)
{
@ -549,7 +549,7 @@ abstract class IdoQuery extends DbQuery
* This requires a join$Table() method to exist
*
* @param String $table The table to join by calling join$Table() in the concrete implementation
* @return self Fluent interface
* @return $this Fluent interface
*
* @throws \Icinga\Exception\ProgrammingError If the join method for this table does not exist
*/
@ -676,7 +676,7 @@ abstract class IdoQuery extends DbQuery
*
* @param array $columns
*
* @return self
* @return $this
*/
public function columns(array $columns)
{

View File

@ -239,7 +239,7 @@ class MonitoringBackend implements Selectable, Queryable, ConnectionInterface
/**
* Backend entry point
*
* @return self
* @return $this
*/
public function select()
{

View File

@ -55,7 +55,7 @@ class LocalCommandFile implements CommandTransportInterface
*
* @param string $path
*
* @return self
* @return $this
*/
public function setPath($path)
{
@ -78,7 +78,7 @@ class LocalCommandFile implements CommandTransportInterface
*
* @param string $openMode
*
* @return self
* @return $this
*/
public function setOpenMode($openMode)
{

View File

@ -71,7 +71,7 @@ class RemoteCommandFile implements CommandTransportInterface
*
* @param string $host
*
* @return self
* @return $this
*/
public function setHost($host)
{
@ -94,7 +94,7 @@ class RemoteCommandFile implements CommandTransportInterface
*
* @param int $port
*
* @return self
* @return $this
*/
public function setPort($port)
{
@ -117,7 +117,7 @@ class RemoteCommandFile implements CommandTransportInterface
*
* @param string $user
*
* @return self
* @return $this
*/
public function setUser($user)
{
@ -142,7 +142,7 @@ class RemoteCommandFile implements CommandTransportInterface
*
* @param string $path
*
* @return self
* @return $this
*/
public function setPath($path)
{

View File

@ -44,7 +44,7 @@ class AdminAccountPage extends Form
*
* @param array $config
*
* @return self
* @return $this
*/
public function setResourceConfig(array $config)
{
@ -57,7 +57,7 @@ class AdminAccountPage extends Form
*
* @param array $config
*
* @return self
* @return $this
*/
public function setBackendConfig(array $config)
{

View File

@ -35,7 +35,7 @@ class AuthBackendPage extends Form
*
* @param array $config
*
* @return self
* @return $this
*/
public function setResourceConfig(array $config)
{

View File

@ -53,7 +53,7 @@ class DatabaseCreationPage extends Form
*
* @param array $config
*
* @return self
* @return $this
*/
public function setResourceConfig(array $config)
{
@ -66,7 +66,7 @@ class DatabaseCreationPage extends Form
*
* @param array $privileges The privileges
*
* @return self
* @return $this
*/
public function setDatabaseSetupPrivileges(array $privileges)
{
@ -79,7 +79,7 @@ class DatabaseCreationPage extends Form
*
* @param array $privileges The privileges
*
* @return self
* @return $this
*/
public function setDatabaseUsagePrivileges(array $privileges)
{

View File

@ -45,7 +45,7 @@ EOT;
*
* @param array $config
*
* @return self
* @return $this
*/
public function setResourceConfig(array $config)
{

View File

@ -32,7 +32,7 @@ class RequirementsPage extends Form
*
* @param SetupWizard $wizard
*
* @return self
* @return $this
*/
public function setWizard(SetupWizard $wizard)
{

View File

@ -64,7 +64,7 @@ class SummaryPage extends Form
*
* @param array $summary
*
* @return self
* @return $this
*/
public function setSummary(array $summary)
{

View File

@ -127,7 +127,7 @@ class DbTool
/**
* Connect to the server
*
* @return self
* @return $this
*/
public function connectToHost()
{
@ -150,7 +150,7 @@ class DbTool
/**
* Connect to the database
*
* @return self
* @return $this
*/
public function connectToDb()
{
@ -691,7 +691,7 @@ EOD;
. ' AND ' . $privilegeCondition . ($requireGrants ? " AND is_grantable = 'YES'" : ''),
array(':grantee' => $grantee)
);
return (int) $query->fetchObject()->matches === count($mysqlPrivileges);
return $query->fetchObject()->matches === count($mysqlPrivileges);
}
/**
@ -786,6 +786,6 @@ EOD;
$privilegesGranted &= $query->fetchColumn() !== false;
}
return $privilegesGranted;
return (bool) $privilegesGranted;
}
}