Completed
Pull Request — master (#58)
by Julius
02:52
created
lib/Service/BoardService.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -27,12 +27,9 @@
 block discarded – undo
27 27
 use OCA\Deck\Db\AclMapper;
28 28
 use OCA\Deck\Db\Group;
29 29
 use OCA\Deck\Db\Label;
30
-
31
-
32 30
 use OCA\Deck\Db\User;
33 31
 use OCP\IGroupManager;
34 32
 use OCP\IL10N;
35
-
36 33
 use OCA\Deck\Db\Board;
37 34
 use OCA\Deck\Db\BoardMapper;
38 35
 use OCA\Deck\Db\LabelMapper;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
 		$groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups']);
63 63
 		$complete = array_merge($userBoards, $groupBoards);
64 64
 		$result = [];
65
-		foreach($complete as &$item) {
66
-			if(!array_key_exists($item->getId(), $result)) {
65
+		foreach ($complete as &$item) {
66
+			if (!array_key_exists($item->getId(), $result)) {
67 67
 				$item = $this->mapOwner($item);
68
-				if($item->getAcl() !== null) {
68
+				if ($item->getAcl() !== null) {
69 69
 					foreach ($item->getAcl() as &$acl) {
70 70
 						$acl = $this->mapAcl($acl);
71 71
 					}
@@ -81,21 +81,21 @@  discard block
 block discarded – undo
81 81
 		$board = $this->boardMapper->find($boardId, true, true);
82 82
 		$board = $this->mapOwner($board);
83 83
 		foreach ($board->getAcl() as &$acl) {
84
-			if($acl !== null) {
84
+			if ($acl !== null) {
85 85
 				$this->mapAcl($acl);
86 86
 			}
87 87
 		}
88 88
 		return $board;
89 89
 	}
90 90
 
91
-	private function mapAcl(Acl &$acl) {
91
+	private function mapAcl(Acl & $acl) {
92 92
 		$userManager = $this->userManager;
93 93
 		$groupManager = $this->groupManager;
94 94
 		$acl->resolveRelation('participant', function($participant) use (&$acl, &$userManager, &$groupManager) {
95
-			if($acl->getType() === Acl::PERMISSION_TYPE_USER) {
95
+			if ($acl->getType() === Acl::PERMISSION_TYPE_USER) {
96 96
 				return new User($userManager->get($acl->getParticipant($participant)));
97 97
 			}
98
-			if($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
98
+			if ($acl->getType() === Acl::PERMISSION_TYPE_GROUP) {
99 99
 				return new Group($groupManager->get($acl->getParticipant($participant)));
100 100
 			}
101 101
 		});
Please login to merge, or discard this patch.
lib/Controller/ShareController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 	 * @return array
56 56
 	 */
57 57
 	public function searchUser($search) {
58
-		if($search==='%') {
58
+		if ($search === '%') {
59 59
 			$search = '';
60 60
 		}
61 61
 		$limit = 5;
Please login to merge, or discard this patch.
lib/Db/RelationalEntity.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 	/**
32 32
 	 * Mark a property as relation so it will not get updated using Mapper::update
33
-	 * @param $property string Name of the property
33
+	 * @param string $property string Name of the property
34 34
 	 */
35 35
 	public function addRelation($property) {
36 36
 		if (!in_array($property, $this->_relations)) {
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 	/**
42 42
 	 * Mark a property as resolvable via resolveRelation()
43
-	 * @param $property string Name of the property
43
+	 * @param string $property string Name of the property
44 44
 	 */
45 45
 	public function addResolvable($property) {
46 46
 		$this->_resolvedProperties[$property] = null;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -83,30 +83,30 @@
 block discarded – undo
83 83
 	 */
84 84
 	public function resolveRelation($property, $resolver) {
85 85
 		$result = null;
86
-		if($property !== null && $this->$property !== null) {
86
+		if ($property !== null && $this->$property !== null) {
87 87
 			$result = $resolver($this->$property);
88 88
 		}
89 89
 
90
-		if($result instanceof RelationalObject || $result === null) {
90
+		if ($result instanceof RelationalObject || $result === null) {
91 91
 			$this->_resolvedProperties[$property] = $result;
92 92
 		} else {
93 93
 			throw new \Exception('resolver must return an instance of RelationalObject');
94 94
 		}
95 95
 	}
96 96
 
97
-	public function __call($methodName, $args){
98
-		$attr = lcfirst( substr($methodName, 7) );
99
-		if(strpos($methodName, 'resolve') === 0 && array_key_exists($attr, $this->_resolvedProperties)) {
100
-			if($this->_resolvedProperties[$attr] !== null) {
97
+	public function __call($methodName, $args) {
98
+		$attr = lcfirst(substr($methodName, 7));
99
+		if (strpos($methodName, 'resolve') === 0 && array_key_exists($attr, $this->_resolvedProperties)) {
100
+			if ($this->_resolvedProperties[$attr] !== null) {
101 101
 				return $this->_resolvedProperties[$attr];
102 102
 			} else {
103 103
 				return $this->getter($attr);
104 104
 			}
105 105
 		}
106 106
 
107
-		$attr = lcfirst( substr($methodName, 3) );
108
-		if(strpos($methodName, 'set') === 0 && array_key_exists($attr, $this->_resolvedProperties)) {
109
-			if(!is_scalar($args[0])) {
107
+		$attr = lcfirst(substr($methodName, 3));
108
+		if (strpos($methodName, 'set') === 0 && array_key_exists($attr, $this->_resolvedProperties)) {
109
+			if (!is_scalar($args[0])) {
110 110
 				$args[0] = $args[0]['primaryKey'];
111 111
 			}
112 112
 			return parent::setter($attr, $args);
Please login to merge, or discard this patch.
lib/Db/RelationalObject.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 	 * This method should be overwritten if object doesn't implement \JsonSerializable
50 50
 	 */
51 51
 	public function getObjectSerialization() {
52
-		if($this->object instanceof \JsonSerializable) {
52
+		if ($this->object instanceof \JsonSerializable) {
53 53
 			$this->object->jsonSerialize();
54 54
 		} else {
55 55
 			throw new \Exception('jsonSerialize is not implemented on ' . get_class($this));
Please login to merge, or discard this patch.