PHPdoc cleanup

This commit is contained in:
Frederic Guillot
2016-03-04 21:11:12 -05:00
parent 3808209690
commit a7f3e3bec5
42 changed files with 97 additions and 51 deletions

View File

@@ -132,6 +132,7 @@ abstract class Base extends \Kanboard\Core\Base
* Set project id * Set project id
* *
* @access public * @access public
* @param integer $project_id
* @return Base * @return Base
*/ */
public function setProjectId($project_id) public function setProjectId($project_id)
@@ -154,10 +155,10 @@ abstract class Base extends \Kanboard\Core\Base
/** /**
* Set an user defined parameter * Set an user defined parameter
* *
* @access public * @access public
* @param string $name Parameter name * @param string $name Parameter name
* @param mixed $value Value * @param mixed $value Value
* @param Base * @return Base
*/ */
public function setParam($name, $value) public function setParam($name, $value)
{ {
@@ -271,6 +272,7 @@ abstract class Base extends \Kanboard\Core\Base
* @access public * @access public
* @param string $event * @param string $event
* @param string $description * @param string $description
* @return Base
*/ */
public function addEvent($event, $description = '') public function addEvent($event, $description = '')
{ {

View File

@@ -99,6 +99,7 @@ class AverageLeadCycleTimeAnalytic extends Base
* Get the 1000 last created tasks * Get the 1000 last created tasks
* *
* @access private * @access private
* @param integer $project_id
* @return array * @return array
*/ */
private function getTasks($project_id) private function getTasks($project_id)

View File

@@ -126,6 +126,7 @@ class AverageTimeSpentColumnAnalytic extends Base
* *
* @access private * @access private
* @param array $task * @param array $task
* @return integer
*/ */
private function getTaskTimeSpentInCurrentColumn(array &$task) private function getTaskTimeSpentInCurrentColumn(array &$task)
{ {

View File

@@ -19,6 +19,7 @@ class App extends Base
* @param integer $user_id * @param integer $user_id
* @param string $action * @param string $action
* @param integer $max * @param integer $max
* @return \Kanboard\Core\Paginator
*/ */
private function getProjectPaginator($user_id, $action, $max) private function getProjectPaginator($user_id, $action, $max)
{ {
@@ -37,6 +38,7 @@ class App extends Base
* @param integer $user_id * @param integer $user_id
* @param string $action * @param string $action
* @param integer $max * @param integer $max
* @return \Kanboard\Core\Paginator
*/ */
private function getTaskPaginator($user_id, $action, $max) private function getTaskPaginator($user_id, $action, $max)
{ {
@@ -55,6 +57,7 @@ class App extends Base
* @param integer $user_id * @param integer $user_id
* @param string $action * @param string $action
* @param integer $max * @param integer $max
* @return \Kanboard\Core\Paginator
*/ */
private function getSubtaskPaginator($user_id, $action, $max) private function getSubtaskPaginator($user_id, $action, $max)
{ {

View File

@@ -14,6 +14,8 @@ class Auth extends Base
* Display the form login * Display the form login
* *
* @access public * @access public
* @param array $values
* @param array $errors
*/ */
public function login(array $values = array(), array $errors = array()) public function login(array $values = array(), array $errors = array())
{ {

View File

@@ -76,6 +76,8 @@ class Column extends Base
* Display a form to edit a column * Display a form to edit a column
* *
* @access public * @access public
* @param array $values
* @param array $errors
*/ */
public function edit(array $values = array(), array $errors = array()) public function edit(array $values = array(), array $errors = array())
{ {

View File

@@ -31,7 +31,6 @@ use Pimple\Container;
* @property \Kanboard\Core\ObjectStorage\ObjectStorageInterface $objectStorage * @property \Kanboard\Core\ObjectStorage\ObjectStorageInterface $objectStorage
* @property \Kanboard\Core\Plugin\Hook $hook * @property \Kanboard\Core\Plugin\Hook $hook
* @property \Kanboard\Core\Plugin\Loader $pluginLoader * @property \Kanboard\Core\Plugin\Loader $pluginLoader
* @property \Kanboard\Core\Security\AccessMap $projectAccessMap
* @property \Kanboard\Core\Security\AuthenticationManager $authenticationManager * @property \Kanboard\Core\Security\AuthenticationManager $authenticationManager
* @property \Kanboard\Core\Security\AccessMap $applicationAccessMap * @property \Kanboard\Core\Security\AccessMap $applicationAccessMap
* @property \Kanboard\Core\Security\AccessMap $projectAccessMap * @property \Kanboard\Core\Security\AccessMap $projectAccessMap

View File

@@ -10,6 +10,26 @@ namespace Kanboard\Core\Cache;
*/ */
abstract class Base abstract class Base
{ {
/**
* Fetch value from cache
*
* @abstract
* @access public
* @param string $key
* @return mixed Null when not found, cached value otherwise
*/
abstract public function get($key);
/**
* Save a new value in the cache
*
* @abstract
* @access public
* @param string $key
* @param mixed $value
*/
abstract public function set($key, $value);
/** /**
* Proxy cache * Proxy cache
* *

View File

@@ -87,7 +87,8 @@ class Csv
* *
* @static * @static
* @access public * @access public
* @return integer * @param mixed $value
* @return int
*/ */
public static function getBooleanValue($value) public static function getBooleanValue($value)
{ {

View File

@@ -60,6 +60,7 @@ class Client
* Establish server connection * Establish server connection
* *
* @access public * @access public
* @throws ClientException
* @param string $server LDAP server hostname or IP * @param string $server LDAP server hostname or IP
* @param integer $port LDAP port * @param integer $port LDAP port
* @param boolean $tls Start TLS * @param boolean $tls Start TLS
@@ -98,6 +99,7 @@ class Client
* Anonymous authentication * Anonymous authentication
* *
* @access public * @access public
* @throws ClientException
* @return boolean * @return boolean
*/ */
public function useAnonymousAuthentication() public function useAnonymousAuthentication()
@@ -113,6 +115,7 @@ class Client
* Authentication with username/password * Authentication with username/password
* *
* @access public * @access public
* @throws ClientException
* @param string $bind_rdn * @param string $bind_rdn
* @param string $bind_password * @param string $bind_password
* @return boolean * @return boolean

View File

@@ -78,7 +78,7 @@ class Query
* Get LDAP Entries * Get LDAP Entries
* *
* @access public * @access public
* @return Entities * @return Entries
*/ */
public function getEntries() public function getEntries()
{ {

View File

@@ -41,7 +41,7 @@ class Client extends Base
* @param string $name * @param string $name
* @param string $subject * @param string $subject
* @param string $html * @param string $html
* @return EmailClient * @return Client
*/ */
public function send($email, $name, $subject, $html) public function send($email, $name, $subject, $html)
{ {
@@ -70,7 +70,7 @@ class Client extends Base
* *
* @access public * @access public
* @param string $transport * @param string $transport
* @return EmailClientInterface * @return ClientInterface
*/ */
public function getTransport($transport) public function getTransport($transport)
{ {
@@ -83,7 +83,7 @@ class Client extends Base
* @access public * @access public
* @param string $transport * @param string $transport
* @param string $class * @param string $class
* @return EmailClient * @return Client
*/ */
public function setTransport($transport, $class) public function setTransport($transport, $class)
{ {

View File

@@ -33,6 +33,7 @@ class FileStorage implements ObjectStorageInterface
* Fetch object contents * Fetch object contents
* *
* @access public * @access public
* @throws ObjectStorageException
* @param string $key * @param string $key
* @return string * @return string
*/ */
@@ -51,6 +52,7 @@ class FileStorage implements ObjectStorageInterface
* Save object * Save object
* *
* @access public * @access public
* @throws ObjectStorageException
* @param string $key * @param string $key
* @param string $blob * @param string $blob
*/ */
@@ -67,6 +69,7 @@ class FileStorage implements ObjectStorageInterface
* Output directly object content * Output directly object content
* *
* @access public * @access public
* @throws ObjectStorageException
* @param string $key * @param string $key
*/ */
public function output($key) public function output($key)
@@ -84,6 +87,7 @@ class FileStorage implements ObjectStorageInterface
* Move local file to object storage * Move local file to object storage
* *
* @access public * @access public
* @throws ObjectStorageException
* @param string $src_filename * @param string $src_filename
* @param string $key * @param string $key
* @return boolean * @return boolean
@@ -136,6 +140,7 @@ class FileStorage implements ObjectStorageInterface
* Create object folder * Create object folder
* *
* @access private * @access private
* @throws ObjectStorageException
* @param string $key * @param string $key
*/ */
private function createFolder($key) private function createFolder($key)

View File

@@ -55,6 +55,7 @@ class Loader extends \Kanboard\Core\Base
* Load plugin * Load plugin
* *
* @access public * @access public
* @throws LogicException
* @param string $plugin * @param string $plugin
*/ */
public function load($plugin) public function load($plugin)

View File

@@ -39,7 +39,7 @@ class AccessMap
* *
* @access public * @access public
* @param string $role * @param string $role
* @return Acl * @return AccessMap
*/ */
public function setDefaultRole($role) public function setDefaultRole($role)
{ {
@@ -53,7 +53,7 @@ class AccessMap
* @access public * @access public
* @param string $role * @param string $role
* @param array $subroles * @param array $subroles
* @return Acl * @return AccessMap
*/ */
public function setRoleHierarchy($role, array $subroles) public function setRoleHierarchy($role, array $subroles)
{ {
@@ -113,7 +113,7 @@ class AccessMap
* @param string $controller Controller class name * @param string $controller Controller class name
* @param mixed $methods List of method name or just one method * @param mixed $methods List of method name or just one method
* @param string $role Lowest role required * @param string $role Lowest role required
* @return Acl * @return AccessMap
*/ */
public function add($controller, $methods, $role) public function add($controller, $methods, $role)
{ {
@@ -135,7 +135,7 @@ class AccessMap
* @param string $controller * @param string $controller
* @param string $method * @param string $method
* @param string $role * @param string $role
* @return Acl * @return AccessMap
*/ */
private function addRule($controller, $method, $role) private function addRule($controller, $method, $role)
{ {
@@ -157,7 +157,7 @@ class AccessMap
* @access public * @access public
* @param string $controller * @param string $controller
* @param string $method * @param string $method
* @return boolean * @return array
*/ */
public function getRoles($controller, $method) public function getRoles($controller, $method)
{ {

View File

@@ -14,7 +14,7 @@ interface OAuthAuthenticationProviderInterface extends AuthenticationProviderInt
* Get user object * Get user object
* *
* @access public * @access public
* @return UserProviderInterface * @return \Kanboard\Core\User\UserProviderInterface
*/ */
public function getUser(); public function getUser();
@@ -31,7 +31,7 @@ interface OAuthAuthenticationProviderInterface extends AuthenticationProviderInt
* Get configured OAuth2 service * Get configured OAuth2 service
* *
* @access public * @access public
* @return Kanboard\Core\Http\OAuth2 * @return \Kanboard\Core\Http\OAuth2
*/ */
public function getService(); public function getService();

View File

@@ -14,7 +14,7 @@ interface PasswordAuthenticationProviderInterface extends AuthenticationProvider
* Get user object * Get user object
* *
* @access public * @access public
* @return UserProviderInterface * @return \Kanboard\Core\User\UserProviderInterface
*/ */
public function getUser(); public function getUser();

View File

@@ -14,7 +14,7 @@ interface PreAuthenticationProviderInterface extends AuthenticationProviderInter
* Get user object * Get user object
* *
* @access public * @access public
* @return UserProviderInterface * @return \Kanboard\Core\User\UserProviderInterface
*/ */
public function getUser(); public function getUser();
} }

View File

@@ -85,7 +85,7 @@ class AttachmentLinkProvider extends BaseLinkProvider implements ExternalLinkPro
* Get the link found with the properties * Get the link found with the properties
* *
* @access public * @access public
* @return ExternalLinkInterface * @return \Kanboard\Core\ExternalLink\ExternalLinkInterface
*/ */
public function getLink() public function getLink()
{ {

View File

@@ -65,7 +65,7 @@ class WebLinkProvider extends BaseLinkProvider implements ExternalLinkProviderIn
* Get the link found with the properties * Get the link found with the properties
* *
* @access public * @access public
* @return ExternalLinkInterface * @return \Kanboard\Core\ExternalLink\ExternalLinkInterface
*/ */
public function getLink() public function getLink()
{ {

View File

@@ -15,7 +15,8 @@ class AssetHelper extends Base
/** /**
* Add a Javascript asset * Add a Javascript asset
* *
* @param string $filename Filename * @param string $filename Filename
* @param bool $async
* @return string * @return string
*/ */
public function js($filename, $async = false) public function js($filename, $async = false)

View File

@@ -40,11 +40,12 @@ class FormHelper extends Base
* Display a select field * Display a select field
* *
* @access public * @access public
* @param string $name Field name * @param string $name Field name
* @param array $options Options * @param array $options Options
* @param array $values Form values * @param array $values Form values
* @param array $errors Form errors * @param array $errors Form errors
* @param string $class CSS class * @param array $attributes
* @param string $class CSS class
* @return string * @return string
*/ */
public function select($name, array $options, array $values = array(), array $errors = array(), array $attributes = array(), $class = '') public function select($name, array $options, array $values = array(), array $errors = array(), array $attributes = array(), $class = '')

View File

@@ -56,7 +56,7 @@ class HookHelper extends Base
* @access public * @access public
* @param string $hook * @param string $hook
* @param string $template * @param string $template
* @return \Helper\Hook * @return \Kanboard\Helper\Hook
*/ */
public function attach($hook, $template) public function attach($hook, $template)
{ {

View File

@@ -32,14 +32,15 @@ class UrlHelper extends Base
* HTML Link tag * HTML Link tag
* *
* @access public * @access public
* @param string $label Link label * @param string $label Link label
* @param string $controller Controller name * @param string $controller Controller name
* @param string $action Action name * @param string $action Action name
* @param array $params Url parameters * @param array $params Url parameters
* @param boolean $csrf Add a CSRF token * @param boolean $csrf Add a CSRF token
* @param string $class CSS class attribute * @param string $class CSS class attribute
* @param boolean $new_tab Open the link in a new tab * @param string $title
* @param string $anchor Link Anchor * @param boolean $new_tab Open the link in a new tab
* @param string $anchor Link Anchor
* @return string * @return string
*/ */
public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '') public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '')

View File

@@ -151,7 +151,7 @@ class Action extends Base
* *
* @author Antonio Rabelo * @author Antonio Rabelo
* @param integer $src_project_id Source project id * @param integer $src_project_id Source project id
* @return integer $dst_project_id Destination project id * @param integer $dst_project_id Destination project id
* @return boolean * @return boolean
*/ */
public function duplicate($src_project_id, $dst_project_id) public function duplicate($src_project_id, $dst_project_id)

View File

@@ -77,7 +77,7 @@ class Board extends Base
* *
* @author Antonio Rabelo * @author Antonio Rabelo
* @param integer $project_from Project Template * @param integer $project_from Project Template
* @return integer $project_to Project that receives the copy * @param integer $project_to Project that receives the copy
* @return boolean * @return boolean
*/ */
public function duplicate($project_from, $project_to) public function duplicate($project_from, $project_to)

View File

@@ -191,7 +191,7 @@ class Category extends Base
* *
* @author Antonio Rabelo * @author Antonio Rabelo
* @param integer $src_project_id Source project id * @param integer $src_project_id Source project id
* @return integer $dst_project_id Destination project id * @param integer $dst_project_id Destination project id
* @return boolean * @return boolean
*/ */
public function duplicate($src_project_id, $dst_project_id) public function duplicate($src_project_id, $dst_project_id)

View File

@@ -141,6 +141,7 @@ class Color extends Base
* Get available colors * Get available colors
* *
* @access public * @access public
* @param bool $prepend
* @return array * @return array
*/ */
public function getList($prepend = false) public function getList($prepend = false)

View File

@@ -239,6 +239,7 @@ class Config extends Setting
* Prepare data before save * Prepare data before save
* *
* @access public * @access public
* @param array $values
* @return array * @return array
*/ */
public function prepare(array $values) public function prepare(array $values)

View File

@@ -90,7 +90,7 @@ class Link extends Base
* *
* @access public * @access public
* @param integer $exclude_id Exclude this link * @param integer $exclude_id Exclude this link
* @param booelan $prepend Prepend default value * @param boolean $prepend Prepend default value
* @return array * @return array
*/ */
public function getList($exclude_id = 0, $prepend = true) public function getList($exclude_id = 0, $prepend = true)

View File

@@ -76,6 +76,7 @@ abstract class Metadata extends Base
* @access public * @access public
* @param integer $entity_id * @param integer $entity_id
* @param array $values * @param array $values
* @return boolean
*/ */
public function save($entity_id, array $values) public function save($entity_id, array $values)
{ {

View File

@@ -80,7 +80,7 @@ abstract class NotificationType extends Base
* *
* @access public * @access public
* @param string $type * @param string $type
* @return NotificationInterface * @return \Kanboard\Notification\NotificationInterface
*/ */
public function getType($type) public function getType($type)
{ {

View File

@@ -20,7 +20,7 @@ class PasswordReset extends Base
/** /**
* Token duration (30 minutes) * Token duration (30 minutes)
* *
* @var string * @var integer
*/ */
const DURATION = 1800; const DURATION = 1800;

View File

@@ -166,7 +166,7 @@ class ProjectGroupRole extends Base
* Copy group access from a project to another one * Copy group access from a project to another one
* *
* @param integer $project_src_id Project Template * @param integer $project_src_id Project Template
* @return integer $project_dst_id Project that receives the copy * @param integer $project_dst_id Project that receives the copy
* @return boolean * @return boolean
*/ */
public function duplicate($project_src_id, $project_dst_id) public function duplicate($project_src_id, $project_dst_id)

View File

@@ -75,6 +75,7 @@ abstract class Setting extends Base
* *
* @access public * @access public
* @param array $values * @param array $values
* @return boolean
*/ */
public function save(array $values) public function save(array $values)
{ {

View File

@@ -155,6 +155,7 @@ class TaskDuplication extends Base
* *
* @access public * @access public
* @param array $values * @param array $values
* @return array
*/ */
public function checkDestinationProjectValues(array &$values) public function checkDestinationProjectValues(array &$values)
{ {

View File

@@ -18,7 +18,8 @@ class TaskPermission extends Base
* Regular users can't remove tasks from other people * Regular users can't remove tasks from other people
* *
* @public * @public
* @return boolean * @param array $task
* @return bool
*/ */
public function canRemoveTask(array $task) public function canRemoveTask(array $task)
{ {

View File

@@ -89,6 +89,7 @@ class AuthSubscriber extends BaseSubscriber implements EventSubscriberInterface
* Increment failed login counter * Increment failed login counter
* *
* @access public * @access public
* @param AuthFailureEvent $event
*/ */
public function onLoginFailure(AuthFailureEvent $event) public function onLoginFailure(AuthFailureEvent $event)
{ {

View File

@@ -69,7 +69,7 @@ class LdapUserProvider implements UserProviderInterface
* @param string $name * @param string $name
* @param string $email * @param string $email
* @param string $role * @param string $role
* @param string[] * @param string[] $groupIds
*/ */
public function __construct($dn, $username, $name, $email, $role, array $groupIds) public function __construct($dn, $username, $name, $email, $role, array $groupIds)
{ {

View File

@@ -114,6 +114,6 @@ class AuthValidator extends Base
} }
} }
return array($result, $errors);; return array($result, $errors);
} }
} }

View File

@@ -12,11 +12,6 @@ if (version_compare(PHP_VERSION, '5.4.0', '<')) {
if (! ini_get('short_open_tag')) { if (! ini_get('short_open_tag')) {
throw new Exception('This software require to have short tags enabled if you have PHP < 5.4 ("short_open_tag = On")'); throw new Exception('This software require to have short tags enabled if you have PHP < 5.4 ("short_open_tag = On")');
} }
// Magic quotes are deprecated since PHP 5.4
if (get_magic_quotes_gpc()) {
throw new Exception('This software require to have "Magic quotes" disabled, it\'s deprecated since PHP 5.4 ("magic_quotes_gpc = Off")');
}
} }
// Check data folder if sqlite // Check data folder if sqlite

View File

@@ -25,6 +25,7 @@ function e()
/** /**
* Translate a number * Translate a number
* *
* @param mixed $value
* @return string * @return string
*/ */
function n($value) function n($value)