Fixed namespaces (PHPCI -> PHPCensor)
This commit is contained in:
parent
60d74b0b44
commit
60a2b7282a
238 changed files with 1014 additions and 863 deletions
36
src/PHPCensor/Helper/User.php
Normal file
36
src/PHPCensor/Helper/User.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Helper;
|
||||
|
||||
/**
|
||||
* User Helper - Provides access to logged in user information in views.
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
* @package PHPCI
|
||||
* @subpackage Web
|
||||
*/
|
||||
class User
|
||||
{
|
||||
/**
|
||||
* Proxies method calls through to the current active user model.
|
||||
* @param $method
|
||||
* @param array $params
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function __call($method, $params = [])
|
||||
{
|
||||
$user = $_SESSION['phpci_user'];
|
||||
|
||||
if (!is_object($user)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return call_user_func_array([$user, $method], $params);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue