Skip to content

Commit

Permalink
PHPDoc: Use @var instead of @type
Browse files Browse the repository at this point in the history
Becasue of too many kittens PSR-5 backed off of deprecating @var.
So that's the way we go too.
  • Loading branch information
lippserd committed Mar 12, 2015
1 parent 6dc48fe commit 8563d5e
Show file tree
Hide file tree
Showing 38 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion application/controllers/ConfigController.php
Expand Up @@ -23,7 +23,7 @@ class ConfigController extends ActionController
/**
* The first allowed config action according to the user's permissions
*
* @type string
* @var string
*/
protected $firstAllowedAction;

Expand Down
8 changes: 4 additions & 4 deletions application/forms/Security/RoleForm.php
Expand Up @@ -18,7 +18,7 @@ class RoleForm extends ConfigForm
/**
* Provided permissions by currently loaded modules
*
* @type array
* @var array
*/
protected $providedPermissions = array(
'*' => '*',
Expand All @@ -33,7 +33,7 @@ class RoleForm extends ConfigForm
/**
* Provided restrictions by currently loaded modules
*
* @type array
* @var array
*/
protected $providedRestrictions = array();

Expand All @@ -46,11 +46,11 @@ public function init()
$helper = new Zend_Form_Element('bogus');
foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $module) {
foreach ($module->getProvidedPermissions() as $permission) {
/** @type object $permission */
/** @var object $permission */
$this->providedPermissions[$permission->name] = $permission->name . ': ' . $permission->description;
}
foreach ($module->getProvidedRestrictions() as $restriction) {
/** @type object $restriction */
/** @var object $restriction */
$name = $helper->filterName($restriction->name); // Zend only permits alphanumerics, the underscore,
// the circumflex and any ASCII character in range
// \x7f to \xff (127 to 255)
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Application/ApplicationBootstrap.php
Expand Up @@ -115,7 +115,7 @@ abstract class ApplicationBootstrap
/**
* Whether Icinga Web 2 requires setup
*
* @type bool
* @var bool
*/
protected $requiresSetup = false;

Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Cli/Command.php
Expand Up @@ -17,7 +17,7 @@ abstract class Command
protected $docs;

/**
* @type Params
* @var Params
*/
protected $params;
protected $screen;
Expand Down
4 changes: 2 additions & 2 deletions library/Icinga/Data/Tree/SimpleTree.php
Expand Up @@ -14,14 +14,14 @@ class SimpleTree implements IteratorAggregate
/**
* Root node
*
* @type TreeNode
* @var TreeNode
*/
protected $sentinel;

/**
* Nodes
*
* @type array
* @var array
*/
protected $nodes = array();

Expand Down
4 changes: 2 additions & 2 deletions library/Icinga/Data/Tree/TreeNode.php
Expand Up @@ -10,7 +10,7 @@ class TreeNode implements Identifiable
/**
* The node's ID
*
* @type mixed
* @var mixed
*/
protected $id;

Expand All @@ -24,7 +24,7 @@ class TreeNode implements Identifiable
/**
* The node's children
*
* @type array
* @var array
*/
protected $children = array();

Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Data/Tree/TreeNodeIterator.php
Expand Up @@ -14,7 +14,7 @@ class TreeNodeIterator implements RecursiveIterator
/**
* The node's children
*
* @type array
* @var array
*/
protected $children;

Expand Down
4 changes: 2 additions & 2 deletions library/Icinga/File/FileExtensionFilterIterator.php
Expand Up @@ -33,7 +33,7 @@ class FileExtensionFilterIterator extends FilterIterator
/**
* The extension to filter for
*
* @type string
* @var string
*/
protected $extension;

Expand All @@ -58,7 +58,7 @@ public function __construct(Iterator $iterator, $extension)
public function accept()
{
$current = $this->current();
/** @type $current \SplFileInfo */
/** @var $current \SplFileInfo */
if (! $current->isFile()) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/File/NonEmptyFileIterator.php
Expand Up @@ -37,7 +37,7 @@ class NonEmptyFileIterator extends FilterIterator
public function accept()
{
$current = $this->current();
/** @type $current \SplFileInfo */
/** @var $current \SplFileInfo */
if (! $current->isFile()
|| $current->getSize() === 0
) {
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Web/Controller/ActionController.php
Expand Up @@ -51,7 +51,7 @@ class ActionController extends Zend_Controller_Action
/**
* Authentication manager
*
* @type Manager|null
* @var Manager|null
*/
private $auth;

Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Web/Dom/DomNodeIterator.php
Expand Up @@ -33,7 +33,7 @@ class DomNodeIterator implements RecursiveIterator
/**
* The node's children
*
* @type IteratorIterator
* @var IteratorIterator
*/
protected $children;

Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Web/Form.php
Expand Up @@ -145,7 +145,7 @@ class Form extends Zend_Form
/**
* Authentication manager
*
* @type Manager|null
* @var Manager|null
*/
private $auth;

Expand Down
16 changes: 8 additions & 8 deletions library/Icinga/Web/Menu.php
Expand Up @@ -18,7 +18,7 @@ class Menu implements RecursiveIterator
/**
* The id of this menu
*
* @type string
* @var string
*/
protected $id;

Expand All @@ -27,7 +27,7 @@ class Menu implements RecursiveIterator
*
* Used for sorting when priority is unset or equal to other items
*
* @type string
* @var string
*/
protected $title;

Expand All @@ -36,42 +36,42 @@ class Menu implements RecursiveIterator
*
* Used for sorting
*
* @type int
* @var int
*/
protected $priority = 100;

/**
* The url of this menu
*
* @type string
* @var string
*/
protected $url;

/**
* The path to the icon of this menu
*
* @type string
* @var string
*/
protected $icon;

/**
* The sub menus of this menu
*
* @type array
* @var array
*/
protected $subMenus = array();

/**
* A custom item renderer used instead of the default rendering logic
*
* @type MenuItemRenderer
* @var MenuItemRenderer
*/
protected $itemRenderer = null;

/*
* Parent menu
*
* @type Menu
* @var Menu
*/
protected $parent;

Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Web/View.php
Expand Up @@ -39,7 +39,7 @@ class View extends Zend_View_Abstract
/**
* Authentication manager
*
* @type \Icinga\Authentication\Manager|null
* @var \Icinga\Authentication\Manager|null
*/
private $auth;

Expand Down
4 changes: 2 additions & 2 deletions modules/doc/application/views/scripts/chapter.phtml
@@ -1,6 +1,6 @@
<div class="controls">
<?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton() ?>
<?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton() ?>
</div>
<div class="content">
<?= /** @type \Icinga\Module\Doc\Renderer\DocSectionRenderer $section */ $section ?>
<?= /** @var \Icinga\Module\Doc\Renderer\DocSectionRenderer $section */ $section ?>
</div>
4 changes: 2 additions & 2 deletions modules/doc/application/views/scripts/index/index.phtml
@@ -1,5 +1,5 @@
<div class="controls"></div>
<?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<h1><?= $this->translate('Available documentations'); ?></h1>
<div class="content">
<ul>
Expand All @@ -16,4 +16,4 @@
array('title' => $this->translate('List all modifications for which documentation is available'))
); ?></li>
</ul>
</div>
</div>
4 changes: 2 additions & 2 deletions modules/doc/application/views/scripts/module/index.phtml
@@ -1,5 +1,5 @@
<div class="controls">
<?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<h1><?= $this->translate('Module documentations'); ?></h1>
</div>
<div class="content">
Expand All @@ -16,4 +16,4 @@
); ?></li>
<?php endforeach ?>
</ul>
</div>
</div>
6 changes: 3 additions & 3 deletions modules/doc/application/views/scripts/pdf.phtml
@@ -1,5 +1,5 @@
<div class="content">
<h1><?= /** @type string $title */ $title ?></h1>
<?= /** @type \Icinga\Module\Doc\Renderer\DocTocRenderer $toc */ $toc ?>
<?= /** @type \Icinga\Module\Doc\Renderer\DocSectionRenderer $section */ $section ?>
<h1><?= /** @var string $title */ $title ?></h1>
<?= /** @var \Icinga\Module\Doc\Renderer\DocTocRenderer $toc */ $toc ?>
<?= /** @var \Icinga\Module\Doc\Renderer\DocSectionRenderer $section */ $section ?>
</div>
2 changes: 1 addition & 1 deletion modules/doc/application/views/scripts/search/index.phtml
@@ -1,5 +1,5 @@
<div class="content">
<?php foreach (/** @type \Icinga\Module\Doc\Renderer\DocSearchRenderer[] $searches */ $searches as $title => $search): ?>
<?php foreach (/** @var \Icinga\Module\Doc\Renderer\DocSearchRenderer[] $searches */ $searches as $title => $search): ?>
<?php if (! $search->isEmpty()): ?>
<h1><?= $this->escape($title) ?></h1>
<?= $search ?>
Expand Down
6 changes: 3 additions & 3 deletions modules/doc/application/views/scripts/toc.phtml
@@ -1,7 +1,7 @@
<div class="controls">
<?= /** @type \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton() ?>
<h1><?= /** @type string $title */ $title ?></h1>
<?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton() ?>
<h1><?= /** @var string $title */ $title ?></h1>
</div>
<div class="content">
<?= /** @type \Icinga\Module\Doc\Renderer\DocTocRenderer $toc */ $toc ?>
<?= /** @var \Icinga\Module\Doc\Renderer\DocTocRenderer $toc */ $toc ?>
</div>
2 changes: 1 addition & 1 deletion modules/doc/configuration.php
@@ -1,7 +1,7 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */

/** @type $this \Icinga\Application\Modules\Module */
/** @var $this \Icinga\Application\Modules\Module */

$section = $this->menuSection($this->translate('Documentation'), array(
'title' => 'Documentation',
Expand Down
2 changes: 1 addition & 1 deletion modules/doc/library/Doc/DocIterator.php
Expand Up @@ -19,7 +19,7 @@ class DocIterator implements Countable, IteratorAggregate
/**
* Ordered files
*
* @type array
* @var array
*/
protected $fileInfo;

Expand Down
8 changes: 4 additions & 4 deletions modules/doc/library/Doc/DocParser.php
Expand Up @@ -18,14 +18,14 @@ class DocParser
/**
* Path to the documentation
*
* @type string
* @var string
*/
protected $path;

/**
* Iterator over documentation files
*
* @type DocIterator
* @var DocIterator
*/
protected $docIterator;

Expand Down Expand Up @@ -130,7 +130,7 @@ public function getDocTree()
$tree = new SimpleTree();
$stack = new SplStack();
foreach ($this->docIterator as $fileInfo) {
/** @type $fileInfo \SplFileInfo */
/** @var $fileInfo \SplFileInfo */
$file = $fileInfo->openFile();
$lastLine = null;
foreach ($file as $line) {
Expand All @@ -143,7 +143,7 @@ public function getDocTree()
if ($id === null) {
$path = array();
foreach ($stack as $section) {
/** @type $section DocSection */
/** @var $section DocSection */
$path[] = $section->getTitle();
}
$path[] = $title;
Expand Down
10 changes: 5 additions & 5 deletions modules/doc/library/Doc/DocSection.php
Expand Up @@ -13,35 +13,35 @@ class DocSection extends TreeNode
/**
* Chapter the section belongs to
*
* @type DocSection
* @var DocSection
*/
protected $chapter;

/**
* Content of the section
*
* @type array
* @var array
*/
protected $content = array();

/**
* Header level
*
* @type int
* @var int
*/
protected $level;

/**
* Whether to instruct search engines to not index the link to the section
*
* @type bool
* @var bool
*/
protected $noFollow;

/**
* Title of the section
*
* @type string
* @var string
*/
protected $title;

Expand Down

0 comments on commit 8563d5e

Please sign in to comment.