Completed
Branch dev (bc6e47)
by Raffael
02:23
created
src/app/Balloon.App.Notification/Hook/NewShareAdded.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 
15 15
 use Balloon\App\Notification\Exception;
16 16
 use Balloon\App\Notification\Notifier;
17
-use Balloon\Async\Mail;
18 17
 use Balloon\Filesystem\Node\Collection;
19 18
 use Balloon\Filesystem\Node\NodeInterface;
20 19
 use Balloon\Hook\AbstractHook;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * Balloon
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return AbstractHook
83 83
      */
84
-    public function setOptions(?Iterable $config = null): AbstractHook
84
+    public function setOptions(?Iterable $config = null) : AbstractHook
85 85
     {
86 86
         if (null === $config) {
87 87
             return $this;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             switch ($option) {
92 92
                 case 'body':
93 93
                 case 'subject':
94
-                    $this->{$option} = (string) $value;
94
+                    $this->{$option} = (string)$value;
95 95
 
96 96
                 break;
97 97
                 default:
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @param string        $recursion
114 114
      * @param bool          $recursion_first
115 115
      */
116
-    public function postSaveNodeAttributes(NodeInterface $node, array $attributes, array $remove, ?string $recursion, bool $recursion_first): void
116
+    public function postSaveNodeAttributes(NodeInterface $node, array $attributes, array $remove, ?string $recursion, bool $recursion_first) : void
117 117
     {
118 118
         if (!($node instanceof Collection)) {
119 119
             return;
@@ -130,24 +130,24 @@  discard block
 block discarded – undo
130 130
         foreach ($node->getAcl() as $rule) {
131 131
             if ('user' === $rule['type']) {
132 132
                 $user = $this->server->getUserById(new ObjectId($rule['id']));
133
-                if (!isset($receiver[(string) $user->getId()]) && $this->checkNotify($node, $user)) {
134
-                    $receiver[(string) $user->getId()] = $user;
133
+                if (!isset($receiver[(string)$user->getId()]) && $this->checkNotify($node, $user)) {
134
+                    $receiver[(string)$user->getId()] = $user;
135 135
                 }
136 136
             } elseif ('group' === $rule['type']) {
137 137
                 foreach ($this->server->getGroupById($rule['id'])->getResolvedMember() as $user) {
138
-                    if (!isset($receiver[(string) $user->getId()]) && $this->checkNotify($node, $user)) {
139
-                        $receiver[(string) $user->getId()] = $user;
138
+                    if (!isset($receiver[(string)$user->getId()]) && $this->checkNotify($node, $user)) {
139
+                        $receiver[(string)$user->getId()] = $user;
140 140
                     }
141 141
                 }
142 142
             }
143 143
         }
144 144
 
145 145
         if (!empty($receiver)) {
146
-            $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) {
146
+            $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) {
147 147
                 return '';
148 148
                 //return $node->getAttributes()[$match[2]];
149 149
             }, $this->body);
150
-            $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) {
150
+            $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) {
151 151
                 return '';
152 152
                 //return $node->getAttributes()[$match[2]];
153 153
             }, $this->subject);
Please login to merge, or discard this patch.
src/app/Balloon.App.Office/Api/v1/Document.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 use Balloon\Filesystem\Node\Collection;
21 21
 use Balloon\Filesystem\Node\File;
22 22
 use Balloon\Server;
23
-use Balloon\Server\User;
24 23
 use Micro\Http\Response;
25 24
 
26 25
 class Document extends Controller
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * Balloon
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      *
87 87
      * @return Response
88 88
      */
89
-    public function get(?string $id = null, ?string $p = null): Response
89
+    public function get(?string $id = null, ?string $p = null) : Response
90 90
     {
91 91
         $node = $this->fs->getNode($id, $p, File::class);
92 92
         $document = new OfficeDoc($this->fs->getDatabase(), $node);
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 
95 95
         foreach ($document->getSessions() as $session) {
96 96
             $sessions[] = [
97
-                'id' => (string) $session['_id'],
97
+                'id' => (string)$session['_id'],
98 98
                 'created' => $session['_id']->getTimestamp(),
99 99
                 'user' => [
100
-                    'id' => (string) $session['user'],
100
+                    'id' => (string)$session['user'],
101 101
                     'name' => $this->server->getUserById($session['user'])->getUsername(),
102 102
                 ],
103 103
             ];
@@ -158,12 +158,12 @@  discard block
 block discarded – undo
158 158
      *
159 159
      * @return Response
160 160
      */
161
-    public function put(string $name, string $type, ?string $collection = null, array $attributes = [], int $conflict = 0): Response
161
+    public function put(string $name, string $type, ?string $collection = null, array $attributes = [], int $conflict = 0) : Response
162 162
     {
163 163
         $parent = $this->fs->getNode($collection, null, Collection::class, false, true);
164 164
         $tpl = new Template($type);
165 165
         $result = $parent->addFile($name, $tpl->get(), $attributes);
166 166
 
167
-        return (new Response())->setCode(201)->setBody((string) $result->getId());
167
+        return (new Response())->setCode(201)->setBody((string)$result->getId());
168 168
     }
169 169
 }
Please login to merge, or discard this patch.
src/lib/Database.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * Balloon
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      *
246 246
      * @return AdapterAwareInterface
247 247
      */
248
-    public function injectAdapter($adapter, ?string $name = null): AdapterAwareInterface
248
+    public function injectAdapter($adapter, ?string $name = null) : AdapterAwareInterface
249 249
     {
250 250
         if (!($adapter instanceof DeltaInterface)) {
251 251
             throw new Exception('delta needs to implement DeltaInterface');
Please login to merge, or discard this patch.
src/lib/Mime/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/lib/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/lib/Async/AutoDestroy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/lib/Async/Mail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/lib/Async/CleanTrash.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.
src/lib/Api/Exception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 /**
5 5
  * Balloon
Please login to merge, or discard this patch.