summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-24 16:47:41 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-24 16:47:41 -0400
commit1a0465cb57818fd302da8bd7a27b9a78415d1804 (patch)
treebc56dd3ded941267fe034374283f893438ba74f7
parent03fc8a1bce033cc8334f588f3c95baffa1291b54 (diff)
Fix PhpAnalyzer issues
-rw-r--r--app/Controller/Link.php2
-rw-r--r--app/Controller/Project.php2
-rw-r--r--app/Integration/HipchatWebhook.php2
-rw-r--r--app/Integration/SlackWebhook.php2
-rw-r--r--app/Model/Currency.php4
-rw-r--r--app/Model/Project.php4
-rw-r--r--app/Model/User.php8
-rw-r--r--app/ServiceProvider/DatabaseProvider.php10
8 files changed, 20 insertions, 14 deletions
diff --git a/app/Controller/Link.php b/app/Controller/Link.php
index 8eac8494..482e415c 100644
--- a/app/Controller/Link.php
+++ b/app/Controller/Link.php
@@ -71,7 +71,7 @@ class Link extends Base
if ($valid) {
- if ($this->link->create($values['label'], $values['opposite_label'])) {
+ if ($this->link->create($values['label'], $values['opposite_label']) !== false) {
$this->session->flash(t('Link added successfully.'));
$this->response->redirect($this->helper->url->to('link', 'index'));
}
diff --git a/app/Controller/Project.php b/app/Controller/Project.php
index f0847ef2..52c2b870 100644
--- a/app/Controller/Project.php
+++ b/app/Controller/Project.php
@@ -323,7 +323,7 @@ class Project extends Base
if ($this->request->getStringParam('duplicate') === 'yes') {
$values = array_keys($this->request->getValues());
- if ($this->projectDuplication->duplicate($project['id'], $values)) {
+ if ($this->projectDuplication->duplicate($project['id'], $values) !== false) {
$this->session->flash(t('Project cloned successfully.'));
} else {
$this->session->flashError(t('Unable to clone this project.'));
diff --git a/app/Integration/HipchatWebhook.php b/app/Integration/HipchatWebhook.php
index 59190959..5cd01fb0 100644
--- a/app/Integration/HipchatWebhook.php
+++ b/app/Integration/HipchatWebhook.php
@@ -73,7 +73,7 @@ class HipchatWebhook extends \Core\Base
if ($this->config->get('application_url')) {
$html .= '<br/><a href="'.$this->config->get('application_url');
- $html .= $this->helper->u('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id)).'">';
+ $html .= $this->helper->url->href('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id)).'">';
$html .= t('view the task on Kanboard').'</a>';
}
diff --git a/app/Integration/SlackWebhook.php b/app/Integration/SlackWebhook.php
index 4d2ae3a3..8be33496 100644
--- a/app/Integration/SlackWebhook.php
+++ b/app/Integration/SlackWebhook.php
@@ -65,7 +65,7 @@ class SlackWebhook extends \Core\Base
if ($this->config->get('application_url')) {
$payload['text'] .= ' - <'.$this->config->get('application_url');
- $payload['text'] .= $this->helper->u('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id));
+ $payload['text'] .= $this->helper->url->href('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id));
$payload['text'] .= '|'.t('view the task on Kanboard').'>';
}
diff --git a/app/Model/Currency.php b/app/Model/Currency.php
index bc423337..6ae842e7 100644
--- a/app/Model/Currency.php
+++ b/app/Model/Currency.php
@@ -35,7 +35,9 @@ class Currency extends Base
* Calculate the price for the reference currency
*
* @access public
- * @return array
+ * @param string $currency
+ * @param double $price
+ * @return double
*/
public function getPrice($currency, $price)
{
diff --git a/app/Model/Project.php b/app/Model/Project.php
index 80e17437..71c660b9 100644
--- a/app/Model/Project.php
+++ b/app/Model/Project.php
@@ -64,7 +64,7 @@ class Project extends Base
*
* @access public
* @param string $identifier
- * @return array
+ * @return array|boolean
*/
public function getByIdentifier($identifier)
{
@@ -80,7 +80,7 @@ class Project extends Base
*
* @access public
* @param string $token Token
- * @return array
+ * @return array|boolean
*/
public function getByToken($token)
{
diff --git a/app/Model/User.php b/app/Model/User.php
index 845efac0..83cf065b 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -111,7 +111,7 @@ class User extends Base
*
* @access public
* @param string $google_id Google unique id
- * @return array
+ * @return array|boolean
*/
public function getByGoogleId($google_id)
{
@@ -127,7 +127,7 @@ class User extends Base
*
* @access public
* @param string $github_id GitHub user id
- * @return array
+ * @return array|boolean
*/
public function getByGitHubId($github_id)
{
@@ -155,7 +155,7 @@ class User extends Base
*
* @access public
* @param string $email Email
- * @return array
+ * @return array|boolean
*/
public function getByEmail($email)
{
@@ -171,7 +171,7 @@ class User extends Base
*
* @access public
* @param string $token Token
- * @return array
+ * @return array|boolean
*/
public function getByToken($token)
{
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php
index 7ee35d5f..e6a75a4e 100644
--- a/app/ServiceProvider/DatabaseProvider.php
+++ b/app/ServiceProvider/DatabaseProvider.php
@@ -18,6 +18,7 @@ class DatabaseProvider implements ServiceProviderInterface
/**
* Setup the database driver and execute schema migration
*
+ * @access public
* @return \PicoDb\Database
*/
public function getInstance()
@@ -51,9 +52,10 @@ class DatabaseProvider implements ServiceProviderInterface
/**
* Setup the Sqlite database driver
*
+ * @access private
* @return \PicoDb\Database
*/
- function getSqliteInstance()
+ private function getSqliteInstance()
{
require_once __DIR__.'/../Schema/Sqlite.php';
@@ -66,9 +68,10 @@ class DatabaseProvider implements ServiceProviderInterface
/**
* Setup the Mysql database driver
*
+ * @access private
* @return \PicoDb\Database
*/
- function getMysqlInstance()
+ private function getMysqlInstance()
{
require_once __DIR__.'/../Schema/Mysql.php';
@@ -86,9 +89,10 @@ class DatabaseProvider implements ServiceProviderInterface
/**
* Setup the Postgres database driver
*
+ * @access private
* @return \PicoDb\Database
*/
- public function getPostgresInstance()
+ private function getPostgresInstance()
{
require_once __DIR__.'/../Schema/Postgres.php';