@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function addResultSet(SearchResultType $type, array $matches, array $exactMatches = null) { |
| 39 | 39 | $type = $type->getLabel(); |
| 40 | - if(!isset($this->result[$type])) { |
|
| 40 | + if (!isset($this->result[$type])) { |
|
| 41 | 41 | $this->result[$type] = []; |
| 42 | 42 | $this->result['exact'][$type] = []; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $this->result[$type] = array_merge($this->result[$type], $matches); |
| 46 | - if(is_array($exactMatches)) { |
|
| 46 | + if (is_array($exactMatches)) { |
|
| 47 | 47 | $this->result['exact'][$type] = array_merge($this->result['exact'][$type], $exactMatches); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | public function hasResult(SearchResultType $type, $collaboratorId) { |
| 60 | 60 | $type = $type->getLabel(); |
| 61 | - if(!isset($this->result[$type])) { |
|
| 61 | + if (!isset($this->result[$type])) { |
|
| 62 | 62 | return false; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $resultArrays = [$this->result['exact'][$type], $this->result[$type]]; |
| 66 | - foreach($resultArrays as $resultArray) { |
|
| 66 | + foreach ($resultArrays as $resultArray) { |
|
| 67 | 67 | if ($resultArray['value']['shareWith'] === $collaboratorId) { |
| 68 | 68 | return true; |
| 69 | 69 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | public function unsetResult(SearchResultType $type) { |
| 80 | 80 | $type = $type->getLabel(); |
| 81 | 81 | $this->result[$type] = []; |
| 82 | - if(isset($this->$result['exact'][$type])) { |
|
| 82 | + if (isset($this->$result['exact'][$type])) { |
|
| 83 | 83 | $this->result['exact'][$type] = []; |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $searchResult = $this->c->resolve(SearchResult::class); |
| 53 | 53 | |
| 54 | 54 | foreach ($shareTypes as $type) { |
| 55 | - if(!isset($this->pluginList[$type])) { |
|
| 55 | + if (!isset($this->pluginList[$type])) { |
|
| 56 | 56 | continue; |
| 57 | 57 | } |
| 58 | 58 | foreach ($this->pluginList[$type] as $plugin) { |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | // that the exact same email address and federated cloud id exists |
| 76 | 76 | $emailType = new SearchResultType('emails'); |
| 77 | 77 | $remoteType = new SearchResultType('remotes'); |
| 78 | - if($searchResult->hasExactIdMatch($emailType) && !$searchResult->hasExactIdMatch($remoteType)) { |
|
| 78 | + if ($searchResult->hasExactIdMatch($emailType) && !$searchResult->hasExactIdMatch($remoteType)) { |
|
| 79 | 79 | $searchResult->unsetResult($remoteType); |
| 80 | 80 | } elseif (!$searchResult->hasExactIdMatch($emailType) && $searchResult->hasExactIdMatch($remoteType)) { |
| 81 | 81 | $searchResult->unsetResult($emailType); |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | public function registerPlugin(array $pluginInfo) { |
| 88 | - $shareType = constant(Share::class . '::' . $pluginInfo['shareType']); |
|
| 89 | - if($shareType === null) { |
|
| 88 | + $shareType = constant(Share::class.'::'.$pluginInfo['shareType']); |
|
| 89 | + if ($shareType === null) { |
|
| 90 | 90 | throw new \InvalidArgumentException('Provided ShareType is invalid'); |
| 91 | 91 | } |
| 92 | 92 | $this->pluginList[$shareType][] = $pluginInfo['class']; |