Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/apporder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>2016-05-27 10:23:55 +0300
committerScrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>2016-05-27 10:23:55 +0300
commit42daf4c6b3e22dd38e7db76f9c02e622f1a67b91 (patch)
treeb4516b2ddfdf52627d914e9fd6bdcda9eae717b7
parent6e9cc9cfed3e5a520ff82d6f493e0aaa36a835d5 (diff)
Scrutinizer Auto-Fixesscrutinizer-patch-1
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
-rw-r--r--appinfo/application.php2
-rw-r--r--controller/settingscontroller.php24
-rw-r--r--service/configservice.php2
-rw-r--r--tests/bootstrap.php6
-rw-r--r--tests/unit/controller/SettingsControllerTest.php8
5 files changed, 21 insertions, 21 deletions
diff --git a/appinfo/application.php b/appinfo/application.php
index 14553bd..8176180 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -7,7 +7,7 @@ use \OCA\AppOrder\Service\ConfigService;
class Application extends App {
- public function __construct(array $urlParams=array()){
+ public function __construct(array $urlParams = array()) {
parent::__construct('apporder', $urlParams);
$container = $this->getContainer();
$container->registerService('ConfigService', function($c) {
diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php
index a5a6224..f94441a 100644
--- a/controller/settingscontroller.php
+++ b/controller/settingscontroller.php
@@ -8,21 +8,21 @@ use \OCP\IRequest;
use \OCP\INavigationManager;
use \OCA\AppOrder\Service\ConfigService;
-class SettingsController extends Controller{
+class SettingsController extends Controller {
private $userId;
private $l10n;
private $appConfig;
private $navigationManager;
- public function __construct($appName, IRequest $request, ConfigService $appConfig, INavigationManager $navigationManager, $userId){
+ public function __construct($appName, IRequest $request, ConfigService $appConfig, INavigationManager $navigationManager, $userId) {
parent::__construct($appName, $request);
$this->userId = $userId;
$this->appConfig = $appConfig;
$this->navigationManager = $navigationManager;
}
- public function adminIndex(){
+ public function adminIndex() {
$navigation = $this->navigationManager->getAll();
$order = json_decode($this->appConfig->getAppValue('order'));
$nav = $this->matchOrder($navigation, $order);
@@ -47,12 +47,12 @@ class SettingsController extends Controller{
public function matchOrder($nav, $order) {
$nav_tmp = array();
$result = array();
- foreach($nav as $app)
+ foreach ($nav as $app)
$nav_tmp[$app['href']] = $app;
- foreach($order as $app)
+ foreach ($order as $app)
$result[$app] = $nav_tmp[$app];
- foreach($nav as $app)
- if(!array_key_exists($app['href'], $result))
+ foreach ($nav as $app)
+ if (!array_key_exists($app['href'], $result))
$result[$app['href']] = $app;
return $result;
}
@@ -60,7 +60,7 @@ class SettingsController extends Controller{
/**
* @NoAdminRequired
*/
- public function getOrder(){
+ public function getOrder() {
$order = $this->getAppOrder();
return array('status' => 'success', 'order' => $order);
}
@@ -68,7 +68,7 @@ class SettingsController extends Controller{
/**
* @NoAdminRequired
*/
- public function savePersonal($order){
+ public function savePersonal($order) {
$this->appConfig->setUserValue('order', $this->userId, $order);
$response = array(
'status' => 'success',
@@ -78,9 +78,9 @@ class SettingsController extends Controller{
return $response;
}
- public function saveDefaultOrder($order){
- if (!is_null($order)){
- $this->appConfig->setAppValue('order',$order);
+ public function saveDefaultOrder($order) {
+ if (!is_null($order)) {
+ $this->appConfig->setAppValue('order', $order);
}
return array('status' => 'success', 'order' => $order);
}
diff --git a/service/configservice.php b/service/configservice.php
index b485b16..0f6f5e2 100644
--- a/service/configservice.php
+++ b/service/configservice.php
@@ -9,7 +9,7 @@ class ConfigService {
private $config;
private $appName;
- public function __construct(IConfig $config, $appName){
+ public function __construct(IConfig $config, $appName) {
$this->config = $config;
$this->appName = $appName;
}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 30a94f3..2249de2 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -9,8 +9,8 @@
* @copyright jus 2016
*/
-require_once __DIR__ . '/../../../tests/bootstrap.php';
-require_once __DIR__ . '/../appinfo/autoload.php';
+require_once __DIR__.'/../../../tests/bootstrap.php';
+require_once __DIR__.'/../appinfo/autoload.php';
-\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
+\OC::$loader->addValidRoot(OC::$SERVERROOT.'/tests');
\OC_App::loadApp('apporder');
diff --git a/tests/unit/controller/SettingsControllerTest.php b/tests/unit/controller/SettingsControllerTest.php
index c4b8847..951246b 100644
--- a/tests/unit/controller/SettingsControllerTest.php
+++ b/tests/unit/controller/SettingsControllerTest.php
@@ -19,7 +19,7 @@ class SettingsControllerTest extends \Test\TestCase {
private $appName;
private $controller;
private $config;
- public function setUp (){
+ public function setUp() {
parent::setUp();
@@ -34,7 +34,7 @@ class SettingsControllerTest extends \Test\TestCase {
$this->service = $this->getMockBuilder('\OCA\AppOrder\Service\ConfigService')
->disableOriginalConstructor()
->getMock();
- $this->navigationManager = $this->getMockBuilder('\OCP\INavigationManager')->setMethods(['getAll','add','setActiveEntry'])
+ $this->navigationManager = $this->getMockBuilder('\OCP\INavigationManager')->setMethods(['getAll', 'add', 'setActiveEntry'])
->disableOriginalConstructor()
->getMock();
$this->userId = 'admin';
@@ -91,7 +91,7 @@ class SettingsControllerTest extends \Test\TestCase {
}
public function testGetAppOrder() {
- $nav_system= ['/app/calendar/', '/app/tasks/'];
+ $nav_system = ['/app/calendar/', '/app/tasks/'];
$nav_user = ['/app/files/', '/app/calendar/', '/app/tasks/'];
$this->service->expects($this->once())
->method('getAppValue')
@@ -105,7 +105,7 @@ class SettingsControllerTest extends \Test\TestCase {
$this->assertEquals(json_encode($nav_user), $result);
}
public function testGetAppOrderNoUser() {
- $nav_system= ['/app/calendar/', '/app/tasks/'];
+ $nav_system = ['/app/calendar/', '/app/tasks/'];
$nav_user = '';
$this->service->expects($this->once())
->method('getAppValue')