Run php-cs-fixer on the code base
This commit is contained in:
@@ -35,10 +35,9 @@ class Action extends \Kanboard\Core\Base
|
||||
$actions = $this->action->getAllByProject($project_id);
|
||||
|
||||
foreach ($actions as $index => $action) {
|
||||
|
||||
$params = array();
|
||||
|
||||
foreach($action['params'] as $param) {
|
||||
foreach ($action['params'] as $param) {
|
||||
$params[$param['name']] = $param['value'];
|
||||
}
|
||||
|
||||
@@ -57,7 +56,7 @@ class Action extends \Kanboard\Core\Base
|
||||
'params' => $params,
|
||||
);
|
||||
|
||||
list($valid,) = $this->action->validateCreation($values);
|
||||
list($valid, ) = $this->action->validateCreation($values);
|
||||
|
||||
if (! $valid) {
|
||||
return false;
|
||||
@@ -80,14 +79,14 @@ class Action extends \Kanboard\Core\Base
|
||||
$required_params = $action->getActionRequiredParameters();
|
||||
|
||||
// Check missing parameters
|
||||
foreach($required_params as $param => $value) {
|
||||
foreach ($required_params as $param => $value) {
|
||||
if (! isset($params[$param])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check extra parameters
|
||||
foreach($params as $param => $value) {
|
||||
foreach ($params as $param => $value) {
|
||||
if (! isset($required_params[$param])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,11 +29,9 @@ class Auth extends Base
|
||||
if ($username !== 'jsonrpc' && ! $this->authentication->hasCaptcha($username) && $this->authentication->authenticate($username, $password)) {
|
||||
$this->checkProcedurePermission(true, $method);
|
||||
$this->userSession->refresh($this->user->getByUsername($username));
|
||||
}
|
||||
else if ($username === 'jsonrpc' && $password === $this->config->get('api_token')) {
|
||||
} elseif ($username === 'jsonrpc' && $password === $this->config->get('api_token')) {
|
||||
$this->checkProcedurePermission(false, $method);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new AuthenticationFailure('Wrong credentials');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,7 @@ abstract class Base extends \Kanboard\Core\Base
|
||||
|
||||
if ($is_user && ! $is_both_procedure && ! $is_user_procedure) {
|
||||
throw new AccessDeniedException('Permission denied');
|
||||
}
|
||||
else if (! $is_user && ! $is_both_procedure && $is_user_procedure) {
|
||||
} elseif (! $is_user && ! $is_both_procedure && $is_user_procedure) {
|
||||
throw new AccessDeniedException('Permission denied');
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class Category extends \Kanboard\Core\Base
|
||||
'name' => $name,
|
||||
);
|
||||
|
||||
list($valid,) = $this->category->validateCreation($values);
|
||||
list($valid, ) = $this->category->validateCreation($values);
|
||||
return $valid ? $this->category->create($values) : false;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class Category extends \Kanboard\Core\Base
|
||||
'name' => $name,
|
||||
);
|
||||
|
||||
list($valid,) = $this->category->validateModification($values);
|
||||
list($valid, ) = $this->category->validateModification($values);
|
||||
return $valid && $this->category->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class Comment extends \Kanboard\Core\Base
|
||||
'comment' => $content,
|
||||
);
|
||||
|
||||
list($valid,) = $this->comment->validateCreation($values);
|
||||
list($valid, ) = $this->comment->validateCreation($values);
|
||||
|
||||
return $valid ? $this->comment->create($values) : false;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class Comment extends \Kanboard\Core\Base
|
||||
'comment' => $content,
|
||||
);
|
||||
|
||||
list($valid,) = $this->comment->validateModification($values);
|
||||
list($valid, ) = $this->comment->validateModification($values);
|
||||
return $valid && $this->comment->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,14 +25,12 @@ class File extends \Kanboard\Core\Base
|
||||
public function downloadFile($file_id)
|
||||
{
|
||||
try {
|
||||
|
||||
$file = $this->file->getById($file_id);
|
||||
|
||||
if (! empty($file)) {
|
||||
return base64_encode($this->objectStorage->get($file['path']));
|
||||
}
|
||||
}
|
||||
catch (ObjectStorageException $e) {
|
||||
} catch (ObjectStorageException $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class Link extends \Kanboard\Core\Base
|
||||
'opposite_label' => $opposite_label,
|
||||
);
|
||||
|
||||
list($valid,) = $this->link->validateCreation($values);
|
||||
list($valid, ) = $this->link->validateCreation($values);
|
||||
return $valid ? $this->link->create($label, $opposite_label) : false;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ class Link extends \Kanboard\Core\Base
|
||||
'label' => $label,
|
||||
);
|
||||
|
||||
list($valid,) = $this->link->validateModification($values);
|
||||
list($valid, ) = $this->link->validateModification($values);
|
||||
return $valid && $this->link->update($values);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class Me extends Base
|
||||
'is_private' => 1,
|
||||
);
|
||||
|
||||
list($valid,) = $this->project->validateCreation($values);
|
||||
list($valid, ) = $this->project->validateCreation($values);
|
||||
return $valid ? $this->project->create($values, $this->userSession->getId(), true) : false;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class Project extends Base
|
||||
'description' => $description
|
||||
);
|
||||
|
||||
list($valid,) = $this->project->validateCreation($values);
|
||||
list($valid, ) = $this->project->validateCreation($values);
|
||||
return $valid ? $this->project->create($values) : false;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class Project extends Base
|
||||
'description' => $description
|
||||
);
|
||||
|
||||
list($valid,) = $this->project->validateModification($values);
|
||||
list($valid, ) = $this->project->validateModification($values);
|
||||
return $valid && $this->project->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class Subtask extends \Kanboard\Core\Base
|
||||
'status' => $status,
|
||||
);
|
||||
|
||||
list($valid,) = $this->subtask->validateCreation($values);
|
||||
list($valid, ) = $this->subtask->validateCreation($values);
|
||||
return $valid ? $this->subtask->create($values) : false;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class Subtask extends \Kanboard\Core\Base
|
||||
}
|
||||
}
|
||||
|
||||
list($valid,) = $this->subtask->validateApiModification($values);
|
||||
list($valid, ) = $this->subtask->validateApiModification($values);
|
||||
return $valid && $this->subtask->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class Task extends Base
|
||||
'reference' => $reference,
|
||||
);
|
||||
|
||||
list($valid,) = $this->taskValidator->validateCreation($values);
|
||||
list($valid, ) = $this->taskValidator->validateCreation($values);
|
||||
|
||||
return $valid ? $this->taskCreation->create($values) : false;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class User extends \Kanboard\Core\Base
|
||||
'is_project_admin' => $is_project_admin,
|
||||
);
|
||||
|
||||
list($valid,) = $this->user->validateCreation($values);
|
||||
list($valid, ) = $this->user->validateCreation($values);
|
||||
return $valid ? $this->user->create($values) : false;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class User extends \Kanboard\Core\Base
|
||||
}
|
||||
}
|
||||
|
||||
list($valid,) = $this->user->validateApiModification($values);
|
||||
list($valid, ) = $this->user->validateApiModification($values);
|
||||
return $valid && $this->user->update($values);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user