Skip to content

Commit

Permalink
Code compliance change and rename refs to User
Browse files Browse the repository at this point in the history
refs #4066
  • Loading branch information
mxhash authored and lippserd committed Jul 30, 2013
1 parent 8510d57 commit a1a8d4c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 18 deletions.
5 changes: 4 additions & 1 deletion library/Icinga/Application/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@

// @codingStandardsIgnoreStart
require_once dirname(__FILE__). '/ApplicationBootstrap.php';
require_once dirname(__FILE__). '/../Exception/ProgrammingError.php';
// @codingStandardsIgnoreStop

use Icinga\Exception\ProgrammingError;

/**
* Bootstrapping on cli environment
*/
Expand Down Expand Up @@ -59,6 +62,6 @@ private function assertRunningOnCli()
return;
}

throw new \Exception('Icinga is not running on CLI');
throw new ProgrammingError('Icinga is not running on CLI');
}
}
2 changes: 1 addition & 1 deletion library/Icinga/Application/Modules/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Module
private $app;

/**
* Creates a new module object
* Create a new module object
*
* @param ApplicationBootstrap $app
* @param string $name
Expand Down
3 changes: 1 addition & 2 deletions library/Icinga/Application/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
namespace Icinga\Application;

use Icinga\Authentication\Manager as AuthenticationManager;
use Icinga\Exception\ProgrammingError;
use Icinga\User\Preferences;
use Icinga\Web\Request;
use Zend_Controller_Front;
Expand Down Expand Up @@ -200,7 +199,7 @@ private function setupZendMvc()
}

/**
* Injects dependencies into request
* Inject dependencies into request
*
* @return self
*/
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Authentication/Backend/DbUserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace Icinga\Authentication\Backend;

use Icinga\Authentication\User as User;
use Icinga\User;
use Icinga\Authentication\UserBackend;
use Icinga\Authentication\Credentials;
use Icinga\Authentication;
Expand Down
10 changes: 5 additions & 5 deletions library/Icinga/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getPreferences()
}

/**
* Returns all groups this user belongs to
* Return all groups this user belongs to
*
* @return array
*/
Expand All @@ -159,15 +159,15 @@ public function getGroups()
}

/**
* Sets the groups this user belongs to
* Set the groups this user belongs to
*/
public function setGroups(array $groups)
{
$this->groups = $groups;
}

/**
* Returns true if the user is a member of this group
* Return true if the user is a member of this group
*
* @param string $group
* @return boolean
Expand All @@ -178,7 +178,7 @@ public function isMemberOf($group)
}

/**
* Returns permission information for this user
* Return permission information for this user
*
* @return Array
*/
Expand Down Expand Up @@ -293,7 +293,7 @@ public function getDomain()
}

/**
* Sets additional information about user
* Set additional information about user
*
* @param string $key
* @param string $value
Expand Down
5 changes: 0 additions & 5 deletions library/Icinga/Web/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,10 @@ public function setUser(User $user)
/**
* Getter for user
*
* @throws ProgrammingError
* @return User
*/
public function getUser()
{
if (!$this->user instanceof User) {
throw new ProgrammingError('User not previously initialized');
}

return $this->user;
}
}
2 changes: 1 addition & 1 deletion modules/monitoring/library/Monitoring/Command/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

namespace Monitoring\Command;

use Icinga\Authentication\User;
use Icinga\User;
use Icinga\Exception\ProgrammingError;

/**
Expand Down
4 changes: 2 additions & 2 deletions test/php/library/Icinga/Authentication/DbUserBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
require_once('../../library/Icinga/Application/Config.php');
require_once('../../library/Icinga/Authentication/Credentials.php');
require_once('../../library/Icinga/Authentication/Backend/DbUserBackend.php');
require_once('../../library/Icinga/Authentication/User.php');
require_once('../../library/Icinga/User.php');

use Icinga\Authentication\Backend\DbUserBackend;
use Icinga\Util\Crypto;
use Icinga\Authentication\Credentials;
use Icinga\Authentication\User;
use Icinga\User;
use Icinga\Application\Config;

/**
Expand Down

0 comments on commit a1a8d4c

Please sign in to comment.