Completed
Branch master (317f11)
by Julius
02:49
created
lib/Db/Entity.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@
 block discarded – undo
50 50
 	 * @param string $attribute the name of the attribute
51 51
 	 * @since 7.0.0
52 52
 	 */
53
-	protected function markFieldUpdated($attribute){
54
-		if(!in_array($attribute, $this->_relations)) {
53
+	protected function markFieldUpdated($attribute) {
54
+		if (!in_array($attribute, $this->_relations)) {
55 55
 			parent::markFieldUpdated($attribute);
56 56
 		}
57 57
 	}
Please login to merge, or discard this patch.
lib/Db/StackMapper.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -29,46 +29,46 @@
 block discarded – undo
29 29
 
30 30
 class StackMapper extends DeckMapper implements IPermissionMapper {
31 31
 
32
-    private $cardMapper;
32
+	private $cardMapper;
33 33
 
34
-    public function __construct(IDBConnection $db, CardMapper $cardMapper) {
35
-        parent::__construct($db, 'deck_stacks', '\OCA\Deck\Db\Stack');
36
-        $this->cardMapper = $cardMapper;
37
-    }
34
+	public function __construct(IDBConnection $db, CardMapper $cardMapper) {
35
+		parent::__construct($db, 'deck_stacks', '\OCA\Deck\Db\Stack');
36
+		$this->cardMapper = $cardMapper;
37
+	}
38 38
 
39 39
 
40 40
 	/**
41 41
 	 * @param $id
42 42
 	 * @return Entity if not found
43 43
 	 */
44
-    public function find($id) {
45
-        $sql = 'SELECT * FROM `*PREFIX*deck_stacks` ' .
46
-            'WHERE `id` = ?';
47
-        return $this->findEntity($sql, [$id]);
48
-    }
44
+	public function find($id) {
45
+		$sql = 'SELECT * FROM `*PREFIX*deck_stacks` ' .
46
+			'WHERE `id` = ?';
47
+		return $this->findEntity($sql, [$id]);
48
+	}
49 49
 
50 50
 
51
-    public function findAll($boardId, $limit=null, $offset=null) {
52
-        $sql = 'SELECT * FROM `*PREFIX*deck_stacks` WHERE `board_id` = ?  ORDER BY `order`';
53
-        return $this->findEntities($sql, [$boardId], $limit, $offset);
54
-    }
51
+	public function findAll($boardId, $limit=null, $offset=null) {
52
+		$sql = 'SELECT * FROM `*PREFIX*deck_stacks` WHERE `board_id` = ?  ORDER BY `order`';
53
+		return $this->findEntities($sql, [$boardId], $limit, $offset);
54
+	}
55 55
     
56 56
 
57
-    public function delete(Entity $entity) {
58
-        // delete cards on stack
57
+	public function delete(Entity $entity) {
58
+		// delete cards on stack
59 59
 		$this->cardMapper->deleteByStack($entity->getId());
60
-        return parent::delete($entity);
61
-    }
60
+		return parent::delete($entity);
61
+	}
62 62
 
63
-    public function isOwner($userId, $stackId) {
64
-        $sql = 'SELECT owner FROM `*PREFIX*deck_boards` WHERE `id` IN (SELECT board_id FROM `*PREFIX*deck_stacks` WHERE id = ?)';
65
-        $stmt = $this->execute($sql, [$stackId]);
66
-        $row = $stmt->fetch();
67
-        return ($row['owner'] === $userId);
68
-    }
63
+	public function isOwner($userId, $stackId) {
64
+		$sql = 'SELECT owner FROM `*PREFIX*deck_boards` WHERE `id` IN (SELECT board_id FROM `*PREFIX*deck_stacks` WHERE id = ?)';
65
+		$stmt = $this->execute($sql, [$stackId]);
66
+		$row = $stmt->fetch();
67
+		return ($row['owner'] === $userId);
68
+	}
69 69
 
70
-    public function findBoardId($stackId) {
71
-        $entity = $this->find($stackId);
72
-        return $entity->getBoardId();
73
-    }
70
+	public function findBoardId($stackId) {
71
+		$entity = $this->find($stackId);
72
+		return $entity->getBoardId();
73
+	}
74 74
 }
75 75
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     }
49 49
 
50 50
 
51
-    public function findAll($boardId, $limit=null, $offset=null) {
51
+    public function findAll($boardId, $limit = null, $offset = null) {
52 52
         $sql = 'SELECT * FROM `*PREFIX*deck_stacks` WHERE `board_id` = ?  ORDER BY `order`';
53 53
         return $this->findEntities($sql, [$boardId], $limit, $offset);
54 54
     }
Please login to merge, or discard this patch.
lib/Db/Card.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -28,41 +28,41 @@
 block discarded – undo
28 28
 
29 29
 class Card extends Entity implements JsonSerializable {
30 30
 
31
-    public $id;
32
-    protected $title;
33
-    protected $description;
34
-    protected $stackId;
35
-    protected $type;
36
-    protected $lastModified;
37
-    protected $createdAt;
38
-    protected $labels;
39
-    protected $owner;
40
-    protected $order;
41
-    protected $archived = false;
31
+	public $id;
32
+	protected $title;
33
+	protected $description;
34
+	protected $stackId;
35
+	protected $type;
36
+	protected $lastModified;
37
+	protected $createdAt;
38
+	protected $labels;
39
+	protected $owner;
40
+	protected $order;
41
+	protected $archived = false;
42 42
 
43
-    public function __construct() {
44
-        $this->addType('id','integer');
45
-        $this->addType('stackId','integer');
46
-        $this->addType('order','integer');
47
-        $this->addType('lastModified', 'integer');
48
-        $this->addType('createdAt', 'integer');
49
-        $this->addType('archived','boolean');
50
-        $this->addRelation('labels');
51
-    }
43
+	public function __construct() {
44
+		$this->addType('id','integer');
45
+		$this->addType('stackId','integer');
46
+		$this->addType('order','integer');
47
+		$this->addType('lastModified', 'integer');
48
+		$this->addType('createdAt', 'integer');
49
+		$this->addType('archived','boolean');
50
+		$this->addRelation('labels');
51
+	}
52 52
 
53
-    public function jsonSerialize() {
54
-        return [
55
-            'id' => $this->id,
56
-            'title' => $this->title,
57
-            'description' => $this->description,
58
-            'type' => $this->type,
59
-            'lastModified' => $this->lastModified,
60
-            'createdAt' => $this->createdAt,
61
-            'owner' => $this->owner,
62
-            'order' => $this->order,
63
-            'stackId' => $this->stackId,
64
-            'labels' => $this->labels,
65
-            'archived' => $this->archived,
66
-        ];
67
-    }
53
+	public function jsonSerialize() {
54
+		return [
55
+			'id' => $this->id,
56
+			'title' => $this->title,
57
+			'description' => $this->description,
58
+			'type' => $this->type,
59
+			'lastModified' => $this->lastModified,
60
+			'createdAt' => $this->createdAt,
61
+			'owner' => $this->owner,
62
+			'order' => $this->order,
63
+			'stackId' => $this->stackId,
64
+			'labels' => $this->labels,
65
+			'archived' => $this->archived,
66
+		];
67
+	}
68 68
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@
 block discarded – undo
41 41
     protected $archived = false;
42 42
 
43 43
     public function __construct() {
44
-        $this->addType('id','integer');
45
-        $this->addType('stackId','integer');
46
-        $this->addType('order','integer');
44
+        $this->addType('id', 'integer');
45
+        $this->addType('stackId', 'integer');
46
+        $this->addType('order', 'integer');
47 47
         $this->addType('lastModified', 'integer');
48 48
         $this->addType('createdAt', 'integer');
49
-        $this->addType('archived','boolean');
49
+        $this->addType('archived', 'boolean');
50 50
         $this->addRelation('labels');
51 51
     }
52 52
 
Please login to merge, or discard this patch.
lib/Db/Board.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -27,49 +27,49 @@
 block discarded – undo
27 27
 
28 28
 class Board extends Entity implements JsonSerializable {
29 29
 
30
-    public $id;
31
-    protected $title;
32
-    protected $owner;
33
-    protected $color;
34
-    protected $archived = false;
35
-    protected $labels;
36
-    protected $acl;
37
-    protected $shared;
30
+	public $id;
31
+	protected $title;
32
+	protected $owner;
33
+	protected $color;
34
+	protected $archived = false;
35
+	protected $labels;
36
+	protected $acl;
37
+	protected $shared;
38 38
 
39
-    public function __construct() {
40
-        $this->addType('id','integer');
41
-        $this->addType('shared','integer');
42
-        $this->addType('archived','boolean');
43
-        $this->addRelation('labels');
44
-        $this->addRelation('acl');
45
-        $this->addRelation('shared');
46
-        $this->shared = -1;
47
-    }
39
+	public function __construct() {
40
+		$this->addType('id','integer');
41
+		$this->addType('shared','integer');
42
+		$this->addType('archived','boolean');
43
+		$this->addRelation('labels');
44
+		$this->addRelation('acl');
45
+		$this->addRelation('shared');
46
+		$this->shared = -1;
47
+	}
48 48
 
49
-    public function jsonSerialize() {
50
-        $result = [
51
-            'id' => $this->id,
52
-            'title' => $this->title,
53
-            'owner' => $this->owner,
54
-            'color' => $this->color,
55
-            'labels' => $this->labels,
56
-            'acl' => $this->acl,
57
-        ];
58
-        if($this->shared!==-1) {
59
-            $result['shared'] = $this->shared;
60
-        }
61
-        return $result;
62
-    }
49
+	public function jsonSerialize() {
50
+		$result = [
51
+			'id' => $this->id,
52
+			'title' => $this->title,
53
+			'owner' => $this->owner,
54
+			'color' => $this->color,
55
+			'labels' => $this->labels,
56
+			'acl' => $this->acl,
57
+		];
58
+		if($this->shared!==-1) {
59
+			$result['shared'] = $this->shared;
60
+		}
61
+		return $result;
62
+	}
63 63
 
64
-    public function setLabels($labels) {
65
-        foreach ($labels as $l) {
66
-            $this->labels[] = $l;
67
-        }
68
-    }
64
+	public function setLabels($labels) {
65
+		foreach ($labels as $l) {
66
+			$this->labels[] = $l;
67
+		}
68
+	}
69 69
 
70
-    public function setAcl($acl) {
71
-        foreach ($acl as $a) {
72
-            $this->acl[$a->id] = $a;
73
-        }
74
-    }
70
+	public function setAcl($acl) {
71
+		foreach ($acl as $a) {
72
+			$this->acl[$a->id] = $a;
73
+		}
74
+	}
75 75
 }
76 76
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
     protected $shared;
38 38
 
39 39
     public function __construct() {
40
-        $this->addType('id','integer');
41
-        $this->addType('shared','integer');
42
-        $this->addType('archived','boolean');
40
+        $this->addType('id', 'integer');
41
+        $this->addType('shared', 'integer');
42
+        $this->addType('archived', 'boolean');
43 43
         $this->addRelation('labels');
44 44
         $this->addRelation('acl');
45 45
         $this->addRelation('shared');
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             'labels' => $this->labels,
56 56
             'acl' => $this->acl,
57 57
         ];
58
-        if($this->shared!==-1) {
58
+        if ($this->shared !== -1) {
59 59
             $result['shared'] = $this->shared;
60 60
         }
61 61
         return $result;
Please login to merge, or discard this patch.
lib/CardArchivedException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	 * Constructor
29 29
 	 * @param string $msg the error message
30 30
 	 */
31
-	public function __construct($msg=""){
31
+	public function __construct($msg = "") {
32 32
 		parent::__construct($msg);
33 33
 	}
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Controller/ShareController.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@
 block discarded – undo
67 67
 		}
68 68
 		$limit = 10;
69 69
 		foreach ($this->userManager->searchDisplayName($search, $limit, $offset) as $idx => $user) {
70
-			if ($user->getUID() === $this->userId)
71
-				continue;
70
+			if ($user->getUID() === $this->userId) {
71
+							continue;
72
+			}
72 73
 			$acl = new Acl();
73 74
 			$acl->setType('user');
74 75
 			$acl->setParticipant($user->getUID());
Please login to merge, or discard this patch.
lib/Controller/LabelController.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 
31 31
 class LabelController extends Controller {
32 32
 
33
-    private $labelService;
33
+	private $labelService;
34 34
 
35
-    public function __construct($appName, IRequest $request, LabelService $labelService){
36
-        parent::__construct($appName, $request);
37
-        $this->labelService = $labelService;
38
-    }
35
+	public function __construct($appName, IRequest $request, LabelService $labelService){
36
+		parent::__construct($appName, $request);
37
+		$this->labelService = $labelService;
38
+	}
39 39
 
40 40
 	/**
41 41
 	 * @NoAdminRequired
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 	 * @param $boardId
45 45
 	 * @return \OCP\AppFramework\Db\Entity
46 46
 	 */
47
-    public function create($title, $color, $boardId) {
48
-        return $this->labelService->create($title, $color, $boardId);
49
-    }
47
+	public function create($title, $color, $boardId) {
48
+		return $this->labelService->create($title, $color, $boardId);
49
+	}
50 50
 
51 51
 	/**
52 52
 	 * @NoAdminRequired
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 	 * @param $color
56 56
 	 * @return \OCP\AppFramework\Db\Entity
57 57
 	 */
58
-    public function update($id, $title, $color) {
59
-        return $this->labelService->update($id, $title, $color);
60
-    }
58
+	public function update($id, $title, $color) {
59
+		return $this->labelService->update($id, $title, $color);
60
+	}
61 61
 
62 62
 	/**
63 63
 	 * @NoAdminRequired
64 64
 	 * @param $labelId
65 65
 	 * @return \OCP\AppFramework\Db\Entity
66 66
 	 */
67
-    public function delete($labelId) {
68
-        return $this->labelService->delete($labelId);
69
-    }
67
+	public function delete($labelId) {
68
+		return $this->labelService->delete($labelId);
69
+	}
70 70
 
71 71
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
     private $labelService;
34 34
 
35
-    public function __construct($appName, IRequest $request, LabelService $labelService){
35
+    public function __construct($appName, IRequest $request, LabelService $labelService) {
36 36
         parent::__construct($appName, $request);
37 37
         $this->labelService = $labelService;
38 38
     }
Please login to merge, or discard this patch.
lib/Controller/BoardController.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,10 +49,10 @@
 block discarded – undo
49 49
 		$this->userInfo = $this->getBoardPrerequisites();
50 50
 	}
51 51
 
52
-    /**
53
-     * TODO: move to boardservice
54
-     * @return array
55
-     */
52
+	/**
53
+	 * TODO: move to boardservice
54
+	 * @return array
55
+	 */
56 56
 	private function getBoardPrerequisites() {
57 57
 		$groups = $this->groupManager->getUserGroupIds(
58 58
 			$this->userManager->get($this->userId)
Please login to merge, or discard this patch.
lib/Controller/StackController.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -31,31 +31,31 @@  discard block
 block discarded – undo
31 31
 
32 32
 
33 33
 class StackController extends Controller {
34
-    private $userId;
35
-    private $stackService;
36
-    public function __construct($appName, IRequest $request, StackService $cardService, $userId){
37
-        parent::__construct($appName, $request);
38
-        $this->userId = $userId;
39
-        $this->stackService = $cardService;
40
-    }
34
+	private $userId;
35
+	private $stackService;
36
+	public function __construct($appName, IRequest $request, StackService $cardService, $userId){
37
+		parent::__construct($appName, $request);
38
+		$this->userId = $userId;
39
+		$this->stackService = $cardService;
40
+	}
41 41
 
42 42
 	/**
43 43
 	 * @NoAdminRequired
44 44
 	 * @param $boardId
45 45
 	 * @return array
46 46
 	 */
47
-    public function index($boardId) {
48
-            return $this->stackService->findAll($boardId);
49
-    }
47
+	public function index($boardId) {
48
+			return $this->stackService->findAll($boardId);
49
+	}
50 50
 
51 51
 	/**
52 52
 	 * @NoAdminRequired
53 53
 	 * @param $boardId
54 54
 	 * @return array
55 55
 	 */
56
-    public function archived($boardId) {
57
-            return $this->stackService->findAllArchived($boardId);
58
-    }
56
+	public function archived($boardId) {
57
+			return $this->stackService->findAllArchived($boardId);
58
+	}
59 59
 
60 60
 	/**
61 61
 	 * @NoAdminRequired
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 	 * @param int $order
65 65
 	 * @return \OCP\AppFramework\Db\Entity
66 66
 	 */
67
-    public function create($title, $boardId, $order=999) {
68
-        return $this->stackService->create($title, $boardId, $order);
69
-    }
67
+	public function create($title, $boardId, $order=999) {
68
+		return $this->stackService->create($title, $boardId, $order);
69
+	}
70 70
 
71 71
 	/**
72 72
 	 * @NoAdminRequired
@@ -76,16 +76,16 @@  discard block
 block discarded – undo
76 76
 	 * @param $order
77 77
 	 * @return \OCP\AppFramework\Db\Entity
78 78
 	 */
79
-    public function update($id, $title, $boardId, $order) {
80
-        return $this->stackService->update($id, $title, $boardId, $order);
81
-    }
79
+	public function update($id, $title, $boardId, $order) {
80
+		return $this->stackService->update($id, $title, $boardId, $order);
81
+	}
82 82
 
83 83
 	/**
84 84
 	 * @NoAdminRequired
85 85
 	 * @param $stackId
86 86
 	 * @return \OCP\AppFramework\Db\Entity
87 87
 	 */
88
-    public function delete($stackId) {
89
-        return $this->stackService->delete($stackId);
90
-    }
88
+	public function delete($stackId) {
89
+		return $this->stackService->delete($stackId);
90
+	}
91 91
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 class StackController extends Controller {
34 34
     private $userId;
35 35
     private $stackService;
36
-    public function __construct($appName, IRequest $request, StackService $cardService, $userId){
36
+    public function __construct($appName, IRequest $request, StackService $cardService, $userId) {
37 37
         parent::__construct($appName, $request);
38 38
         $this->userId = $userId;
39 39
         $this->stackService = $cardService;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 * @param int $order
65 65
 	 * @return \OCP\AppFramework\Db\Entity
66 66
 	 */
67
-    public function create($title, $boardId, $order=999) {
67
+    public function create($title, $boardId, $order = 999) {
68 68
         return $this->stackService->create($title, $boardId, $order);
69 69
     }
70 70
 
Please login to merge, or discard this patch.