@@ -61,8 +61,8 @@ |
||
| 61 | 61 | * Convert to bash color |
| 62 | 62 | * |
| 63 | 63 | * @param string $string |
| 64 | - * @param string $forderground_color |
|
| 65 | - * @param string $backgrond_coilor |
|
| 64 | + * @param string $foreground_color |
|
| 65 | + * @param string $background_color |
|
| 66 | 66 | * @return string |
| 67 | 67 | */ |
| 68 | 68 | public function getColoredString(string $string, string $foreground_color = null, string $background_color = null): string |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -71,15 +71,15 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | // Check if given foreground color found |
| 73 | 73 | if (isset($this->foreground_colors[$foreground_color])) { |
| 74 | - $colored_string .= "\033[" . $this->foreground_colors[$foreground_color] . "m"; |
|
| 74 | + $colored_string .= "\033[".$this->foreground_colors[$foreground_color]."m"; |
|
| 75 | 75 | } |
| 76 | 76 | // Check if given background color found |
| 77 | 77 | if (isset($this->background_colors[$background_color])) { |
| 78 | - $colored_string .= "\033[" . $this->background_colors[$background_color] . "m"; |
|
| 78 | + $colored_string .= "\033[".$this->background_colors[$background_color]."m"; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Add string and end coloring |
| 82 | - $colored_string .= $string . "\033[0m"; |
|
| 82 | + $colored_string .= $string."\033[0m"; |
|
| 83 | 83 | |
| 84 | 84 | return $colored_string; |
| 85 | 85 | } |
@@ -40,7 +40,6 @@ |
||
| 40 | 40 | /** |
| 41 | 41 | * Set options |
| 42 | 42 | * |
| 43 | - * @param Iterable $options |
|
| 44 | 43 | * @return AdapterInterface |
| 45 | 44 | */ |
| 46 | 45 | public function setOptions(?Iterable $config=null) |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @param Iterable $options |
| 44 | 44 | * @return AdapterInterface |
| 45 | 45 | */ |
| 46 | - public function setOptions(?Iterable $config=null) |
|
| 46 | + public function setOptions(? Iterable $config = null) |
|
| 47 | 47 | { |
| 48 | 48 | parent::setOptions($options); |
| 49 | 49 | |
@@ -198,7 +198,7 @@ |
||
| 198 | 198 | * @param string $date_format |
| 199 | 199 | * @param string $level |
| 200 | 200 | * @param array $context |
| 201 | - * @return void |
|
| 201 | + * @return string |
|
| 202 | 202 | */ |
| 203 | 203 | protected function _format(string $message, string $format, string $date_format, string $level, array $context=[]): string |
| 204 | 204 | { |
@@ -14,9 +14,7 @@ |
||
| 14 | 14 | use \Psr\Log\AbstractLogger; |
| 15 | 15 | use \Psr\Log\LogLevel; |
| 16 | 16 | use \Psr\Log\LoggerInterface; |
| 17 | -use Balloon\Log\Adapter\AbstractAdapter; |
|
| 18 | 17 | use Balloon\Log\Adapter\AdapterInterface; |
| 19 | -use Balloon\Config; |
|
| 20 | 18 | |
| 21 | 19 | class Logger extends AbstractLogger implements LoggerInterface |
| 22 | 20 | { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param Iterable $config |
| 58 | 58 | * @return void |
| 59 | 59 | */ |
| 60 | - public function __construct(?Iterable $config=null) |
|
| 60 | + public function __construct(? Iterable $config = null) |
|
| 61 | 61 | { |
| 62 | 62 | $this->setOptions($config); |
| 63 | 63 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @param Iterable $config |
| 70 | 70 | * @return Logger |
| 71 | 71 | */ |
| 72 | - public function setOptions(?Iterable $config=null) |
|
| 72 | + public function setOptions(? Iterable $config = null) |
|
| 73 | 73 | { |
| 74 | 74 | if ($config === null) { |
| 75 | 75 | return $this; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @param Iterable $config |
| 94 | 94 | * @return AdapterInterface |
| 95 | 95 | */ |
| 96 | - public function addAdapter(string $name, string $class, ?Iterable $config=null): AdapterInterface |
|
| 96 | + public function addAdapter(string $name, string $class, ? Iterable $config = null) : AdapterInterface |
|
| 97 | 97 | { |
| 98 | 98 | if (isset($this->adapter[$name])) { |
| 99 | 99 | throw new Exception\InvalidArgument('log adapter '.$name.' is already registered'); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * @param array $adapters |
| 131 | 131 | * @return array |
| 132 | 132 | */ |
| 133 | - public function getAdapters(array $adapters=[]): array |
|
| 133 | + public function getAdapters(array $adapters = []): array |
|
| 134 | 134 | { |
| 135 | 135 | if (empty($adapter)) { |
| 136 | 136 | return $this->adapter; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param array $context |
| 158 | 158 | * @return bool |
| 159 | 159 | */ |
| 160 | - public function log($level, $message, array $context=[]): bool |
|
| 160 | + public function log($level, $message, array $context = []): bool |
|
| 161 | 161 | { |
| 162 | 162 | if (!array_key_exists($level, self::PRIORITIES)) { |
| 163 | 163 | throw new Exception\InvalidArgument('log level '.$level.' is unkown'); |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | * @param array $context |
| 201 | 201 | * @return void |
| 202 | 202 | */ |
| 203 | - protected function _format(string $message, string $format, string $date_format, string $level, array $context=[]): string |
|
| 203 | + protected function _format(string $message, string $format, string $date_format, string $level, array $context = []): string |
|
| 204 | 204 | { |
| 205 | - $parsed = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) use ($message, $level, $date_format, $context) { |
|
| 205 | + $parsed = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) use ($message, $level, $date_format, $context) { |
|
| 206 | 206 | $key = ''; |
| 207 | 207 | $context = array_merge($this->context, $context); |
| 208 | 208 | |
@@ -225,9 +225,9 @@ discard block |
||
| 225 | 225 | $replace = []; |
| 226 | 226 | foreach ($context as $key => $val) { |
| 227 | 227 | if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { |
| 228 | - $replace['{' . $key . '}'] = $val; |
|
| 228 | + $replace['{'.$key.'}'] = $val; |
|
| 229 | 229 | } else { |
| 230 | - $replace['{' . $key . '}'] = json_encode($val); |
|
| 230 | + $replace['{'.$key.'}'] = json_encode($val); |
|
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | * Run plugin method |
| 110 | 110 | * |
| 111 | 111 | * @param string $method |
| 112 | - * @param array $context |
|
| 112 | + * @param User[] $context |
|
| 113 | 113 | * @return bool |
| 114 | 114 | */ |
| 115 | 115 | public function run(string $method, array $context=[]): bool |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | namespace Balloon; |
| 13 | 13 | |
| 14 | 14 | use Balloon\Plugin\PluginInterface; |
| 15 | -use Balloon\Filesystem; |
|
| 16 | 15 | use Balloon\Plugin\Exception; |
| 17 | 16 | use \Psr\Log\LoggerInterface as Logger; |
| 18 | 17 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @param object|array $config |
| 54 | 54 | * @return bool |
| 55 | 55 | */ |
| 56 | - public function registerPlugin($name, $config=null): bool |
|
| 56 | + public function registerPlugin($name, $config = null): bool |
|
| 57 | 57 | { |
| 58 | 58 | if ($name instanceof Config) { |
| 59 | 59 | foreach ($name as $id => $config) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @param array $context |
| 113 | 113 | * @return bool |
| 114 | 114 | */ |
| 115 | - public function run(string $method, array $context=[]): bool |
|
| 115 | + public function run(string $method, array $context = []): bool |
|
| 116 | 116 | { |
| 117 | 117 | $this->logger->debug('execute plugins hooks for ['.$method.']', [ |
| 118 | 118 | 'category' => get_class($this), |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | namespace Balloon\Plugin; |
| 13 | 13 | |
| 14 | 14 | use Balloon\Filesystem; |
| 15 | -use Balloon\Exception; |
|
| 16 | 15 | use \MongoDB\BSON\UTCDateTime; |
| 17 | 16 | |
| 18 | 17 | class CleanTrash extends AbstractPlugin |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @param Iterable $config |
| 32 | 32 | * @return PluginInterface |
| 33 | 33 | */ |
| 34 | - public function setOptions(?Iterable $config): PluginInterface |
|
| 34 | + public function setOptions(? Iterable $config) : PluginInterface |
|
| 35 | 35 | { |
| 36 | 36 | if ($config === null) { |
| 37 | 37 | return $this; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function cli(Filesystem $fs): void |
| 59 | 59 | { |
| 60 | - $lt = time() - $this->max_age; |
|
| 60 | + $lt = time() - $this->max_age; |
|
| 61 | 61 | |
| 62 | 62 | $result = $fs->findNodesWithCustomFilter(['deleted' => ['$lt' => new UTCDateTime($lt)]]); |
| 63 | 63 | $this->logger->info('found ['.count($result).'] nodes for cleanup, force remove them from trash', [ |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use Balloon\Filesystem\Node\Collection; |
| 16 | 16 | use Balloon\Filesystem\Node\File; |
| 17 | 17 | use Balloon\Filesystem\Node\INode; |
| 18 | -use Balloon\Filesystem; |
|
| 19 | 18 | use \MongoDB\BSON\ObjectID; |
| 20 | 19 | |
| 21 | 20 | class Delta extends AbstractPlugin |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | ]; |
| 34 | 34 | |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Init |
|
| 38 | - * |
|
| 39 | - * @return void |
|
| 40 | - */ |
|
| 36 | + /** |
|
| 37 | + * Init |
|
| 38 | + * |
|
| 39 | + * @return void |
|
| 40 | + */ |
|
| 41 | 41 | public function init(): void |
| 42 | 42 | { |
| 43 | 43 | if (php_sapi_name() === 'cli') { |
@@ -437,8 +437,8 @@ discard block |
||
| 437 | 437 | ]; |
| 438 | 438 | |
| 439 | 439 | $node->getFilesystem()->getDatabase()->delta->updateMany([ |
| 440 | - 'node' => [ |
|
| 441 | - '$in' => $toset, |
|
| 440 | + 'node' => [ |
|
| 441 | + '$in' => $toset, |
|
| 442 | 442 | ], |
| 443 | 443 | ], $action); |
| 444 | 444 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return void |
| 126 | 126 | */ |
| 127 | 127 | public function postCopyCollection(Collection $node, Collection $parent, |
| 128 | - Collection $new_node, int $conflict, ?string $recursion, bool $recursion_first): void |
|
| 128 | + Collection $new_node, int $conflict, ? string $recursion, bool $recursion_first) : void |
|
| 129 | 129 | { |
| 130 | 130 | if ($recursion_first === false) { |
| 131 | 131 | return; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @return void |
| 163 | 163 | */ |
| 164 | 164 | public function postCopyFile(File $node, Collection $parent, File $new_node, |
| 165 | - int $conflict, ?string $recursion, bool $recursion_first): void |
|
| 165 | + int $conflict, ? string $recursion, bool $recursion_first) : void |
|
| 166 | 166 | { |
| 167 | 167 | if ($recursion_first === false) { |
| 168 | 168 | return; |
@@ -229,14 +229,14 @@ discard block |
||
| 229 | 229 | * @param bool $recursion_first |
| 230 | 230 | * @return void |
| 231 | 231 | */ |
| 232 | - public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void |
|
| 232 | + public function postDeleteCollection(Collection $node, bool $force, ? string $recursion, bool $recursion_first) : void |
|
| 233 | 233 | { |
| 234 | 234 | if ($recursion_first === false) { |
| 235 | 235 | return; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | $attributes = $node->getAttribute(['parent', 'name']); |
| 239 | - $attributes['node'] = $node->getId(); |
|
| 239 | + $attributes['node'] = $node->getId(); |
|
| 240 | 240 | |
| 241 | 241 | |
| 242 | 242 | if ($node->isReference()) { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $attributes['share'] = $node->getShareId(); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - $attributes['client']= $this->client; |
|
| 260 | + $attributes['client'] = $this->client; |
|
| 261 | 261 | $attributes['owner'] = $this->getEventOwner($node); |
| 262 | 262 | $attributes['force'] = $force; |
| 263 | 263 | $node->getFilesystem()->getDelta()->add($attributes); |
@@ -292,14 +292,14 @@ discard block |
||
| 292 | 292 | * @param bool $recursion_first |
| 293 | 293 | * @return void |
| 294 | 294 | */ |
| 295 | - public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void |
|
| 295 | + public function postDeleteFile(File $node, bool $force, ? string $recursion, bool $recursion_first) : void |
|
| 296 | 296 | { |
| 297 | 297 | if ($recursion_first === false) { |
| 298 | 298 | return; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $attributes = $node->getAttribute(['parent', 'name']); |
| 302 | - $attributes['node'] = $node->getId(); |
|
| 302 | + $attributes['node'] = $node->getId(); |
|
| 303 | 303 | |
| 304 | 304 | if ($force === true) { |
| 305 | 305 | $attributes['operation'] = 'forceDeleteFile'; |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $attributes['share'] = $node->getShareId(); |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - $attributes['client']= $this->client; |
|
| 314 | + $attributes['client'] = $this->client; |
|
| 315 | 315 | $attributes['owner'] = $this->getEventOwner($node); |
| 316 | 316 | $attributes['force'] = $force; |
| 317 | 317 | $node->getFilesystem()->getDelta()->add($attributes); |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * @param bool $recursion_first |
| 331 | 331 | * @return void |
| 332 | 332 | */ |
| 333 | - public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ?string $recursion, bool $recursion_first): void |
|
| 333 | + public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ? string $recursion, bool $recursion_first) : void |
|
| 334 | 334 | { |
| 335 | 335 | if ($recursion_first === false) { |
| 336 | 336 | return; |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | - $log['client']= $this->client; |
|
| 416 | + $log['client'] = $this->client; |
|
| 417 | 417 | |
| 418 | 418 | if (isset($log['operation'])) { |
| 419 | 419 | $node->getFilesystem()->getDelta()->add($log); |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | namespace Balloon\Plugin; |
| 13 | 13 | |
| 14 | 14 | use Balloon\User; |
| 15 | -use Balloon\Queue\JobInterface; |
|
| 16 | 15 | use Balloon\Filesystem\Node\INode; |
| 17 | 16 | use Balloon\Resource; |
| 18 | 17 | use Balloon\Filesystem\Node\Collection; |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | $mail = new Message(); |
| 153 | 153 | $mail->setBody($body); |
| 154 | 154 | $mail->setFrom($this->notifications['new_share']['sender']['address'], |
| 155 | - $this->notifications['new_share']['sender']['name']); |
|
| 155 | + $this->notifications['new_share']['sender']['name']); |
|
| 156 | 156 | $mail->setSubject($subject); |
| 157 | 157 | |
| 158 | 158 | foreach ($receiver as $rec) { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @param Iterable $config |
| 53 | 53 | * @return PluginInterface |
| 54 | 54 | */ |
| 55 | - public function setOptions(?Iterable $config): PluginInterface |
|
| 55 | + public function setOptions(? Iterable $config) : PluginInterface |
|
| 56 | 56 | { |
| 57 | 57 | if ($config === null) { |
| 58 | 58 | return $this; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * @param bool $recursion_first |
| 108 | 108 | * @return void |
| 109 | 109 | */ |
| 110 | - public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ?string $recursion, bool $recursion_first): void |
|
| 110 | + public function postSaveNodeAttributes(INode $node, array $attributes, array $remove, ? string $recursion, bool $recursion_first) : void |
|
| 111 | 111 | { |
| 112 | 112 | if (!($node instanceof Collection)) { |
| 113 | 113 | return; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $acl = $node->getShare(); |
| 124 | 124 | $resource = new Resource($fs->getUser(), $this->logger, $fs); |
| 125 | 125 | if ($node->isShared() && is_array($acl) && (isset($raw['acl']) && $raw['acl'] !== $node->getAcl() || !isset($raw['acl']))) { |
| 126 | - $receiver=[]; |
|
| 126 | + $receiver = []; |
|
| 127 | 127 | foreach ($acl as $rule) { |
| 128 | 128 | if ($rule['type'] == 'user') { |
| 129 | 129 | $user = new User($rule['name'], $this->logger, $fs, true, false); |
@@ -142,14 +142,14 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | if (!empty($receiver)) { |
| 145 | - $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) use ($node) { |
|
| 145 | + $body = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) use ($node) { |
|
| 146 | 146 | return $node->getAttribute($match[2]); |
| 147 | 147 | }, $this->notifications['new_share']['body']); |
| 148 | - $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function ($match) use ($node) { |
|
| 148 | + $subject = preg_replace_callback('/(\{(([a-z]\.*)+)\})/', function($match) use ($node) { |
|
| 149 | 149 | return $node->getAttribute($match[2]); |
| 150 | 150 | }, $this->notifications['new_share']['subject']); |
| 151 | 151 | |
| 152 | - $mail = new Message(); |
|
| 152 | + $mail = new Message(); |
|
| 153 | 153 | $mail->setBody($body); |
| 154 | 154 | $mail->setFrom($this->notifications['new_share']['sender']['address'], |
| 155 | 155 | $this->notifications['new_share']['sender']['name']); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @param User $user |
| 172 | 172 | * @return string |
| 173 | 173 | */ |
| 174 | - protected function checkNotify(INode $node, User $user): ?string |
|
| 174 | + protected function checkNotify(INode $node, User $user): ? string |
|
| 175 | 175 | { |
| 176 | 176 | if ($user->hasShare($node)) { |
| 177 | 177 | $this->logger->debug('skip mail notifcation for share ['.$node->getId().'] user ['.$user->getId().'] already owns it', [ |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace Balloon\Plugin; |
| 13 | 13 | |
| 14 | -use Balloon\Exception; |
|
| 15 | 14 | use \Psr\Log\LoggerInterface as Logger; |
| 16 | 15 | use Balloon\Filesystem; |
| 17 | 16 | use Balloon\Filesystem\Node\Collection; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * @return void |
| 279 | 279 | */ |
| 280 | 280 | public function preCopyFile(File $node, Collection $parent, |
| 281 | - int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 281 | + int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 282 | 282 | |
| 283 | 283 | |
| 284 | 284 | /** |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @return void |
| 296 | 296 | */ |
| 297 | 297 | public function postCopyFile(File $node, Collection $parent, File $new_node, |
| 298 | - int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 298 | + int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 299 | 299 | |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @param Iterable $config |
| 37 | 37 | * @return PluginInterface |
| 38 | 38 | */ |
| 39 | - public function setOptions(?Iterable $config): PluginInterface; |
|
| 39 | + public function setOptions(? Iterable $config) : PluginInterface; |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @param array $params |
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | - public function __call(string $method, array $params=[]): void; |
|
| 57 | + public function __call(string $method, array $params = []): void; |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @param mixed $content |
| 111 | 111 | * @return void |
| 112 | 112 | */ |
| 113 | - public function preHttpResponse(\Balloon\Http\Response $response, int &$code, &$content): void; |
|
| 113 | + public function preHttpResponse(\Balloon\Http\Response $response, int&$code, &$content): void; |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * @param bool $clone |
| 190 | 190 | * @return void |
| 191 | 191 | */ |
| 192 | - public function preCreateCollection(Collection $parent, string &$name, array &$attributes, bool $clone): void; |
|
| 192 | + public function preCreateCollection(Collection $parent, string&$name, array &$attributes, bool $clone): void; |
|
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | * @param bool $clone |
| 217 | 217 | * @return void |
| 218 | 218 | */ |
| 219 | - public function preCreateFile(Collection $parent, string &$name, array &$attributes, bool $clone): void; |
|
| 219 | + public function preCreateFile(Collection $parent, string&$name, array &$attributes, bool $clone): void; |
|
| 220 | 220 | |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * @return void |
| 246 | 246 | */ |
| 247 | 247 | public function preCopyCollection(Collection $node, Collection $parent, |
| 248 | - int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 248 | + int $conflict, ? string $recursion, bool $recursion_first) : void; |
|
| 249 | 249 | |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @return void |
| 263 | 263 | */ |
| 264 | 264 | public function postCopyCollection(Collection $node, Collection $parent, |
| 265 | - Collection $new_node, int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 265 | + Collection $new_node, int $conflict, ? string $recursion, bool $recursion_first) : void; |
|
| 266 | 266 | |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * @return void |
| 279 | 279 | */ |
| 280 | 280 | public function preCopyFile(File $node, Collection $parent, |
| 281 | - int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 281 | + int $conflict, ? string $recursion, bool $recursion_first) : void; |
|
| 282 | 282 | |
| 283 | 283 | |
| 284 | 284 | /** |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @return void |
| 296 | 296 | */ |
| 297 | 297 | public function postCopyFile(File $node, Collection $parent, File $new_node, |
| 298 | - int $conflict, ?string $recursion, bool $recursion_first): void; |
|
| 298 | + int $conflict, ? string $recursion, bool $recursion_first) : void; |
|
| 299 | 299 | |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | * @param bool $recursion_first |
| 310 | 310 | * @return void |
| 311 | 311 | */ |
| 312 | - public function preDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void; |
|
| 312 | + public function preDeleteCollection(Collection $node, bool $force, ? string $recursion, bool $recursion_first) : void; |
|
| 313 | 313 | |
| 314 | 314 | |
| 315 | 315 | /** |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | * @param bool $recursion_first |
| 324 | 324 | * @return void |
| 325 | 325 | */ |
| 326 | - public function postDeleteCollection(Collection $node, bool $force, ?string $recursion, bool $recursion_first): void; |
|
| 326 | + public function postDeleteCollection(Collection $node, bool $force, ? string $recursion, bool $recursion_first) : void; |
|
| 327 | 327 | |
| 328 | 328 | |
| 329 | 329 | /** |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | * @param bool $recursion_first |
| 338 | 338 | * @return void |
| 339 | 339 | */ |
| 340 | - public function preDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void; |
|
| 340 | + public function preDeleteFile(File $node, bool $force, ? string $recursion, bool $recursion_first) : void; |
|
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | * @param bool $recursion_first |
| 352 | 352 | * @return void |
| 353 | 353 | */ |
| 354 | - public function postDeleteFile(File $node, bool $force, ?string $recursion, bool $recursion_first): void; |
|
| 354 | + public function postDeleteFile(File $node, bool $force, ? string $recursion, bool $recursion_first) : void; |
|
| 355 | 355 | |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | * @return void |
| 368 | 368 | */ |
| 369 | 369 | public function preSaveNodeAttributes(INode $node, array &$save_attributes, |
| 370 | - array &$remove_attributes, ?string $recursion, bool $recursion_first): void; |
|
| 370 | + array &$remove_attributes, ? string $recursion, bool $recursion_first) : void; |
|
| 371 | 371 | |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | * @return void |
| 384 | 384 | */ |
| 385 | 385 | public function postSaveNodeAttributes(INode $node, array $save_attributes, |
| 386 | - array $remove_attributes, ?string $recursion, bool $recursion_first): void; |
|
| 386 | + array $remove_attributes, ? string $recursion, bool $recursion_first) : void; |
|
| 387 | 387 | |
| 388 | 388 | |
| 389 | 389 | /** |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | * @param bool $autocreate |
| 398 | 398 | * @return void |
| 399 | 399 | */ |
| 400 | - public function preInstanceUser(\Balloon\User $user, string &$username, ?array &$attributes, bool $autocreate): void; |
|
| 400 | + public function preInstanceUser(\Balloon\User $user, string&$username, ? array &$attributes, bool $autocreate) : void; |
|
| 401 | 401 | |
| 402 | 402 | |
| 403 | 403 | /** |
@@ -11,8 +11,6 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace Balloon\Plugin; |
| 13 | 13 | |
| 14 | -use Balloon\Filesystem; |
|
| 15 | -use Balloon\Exception; |
|
| 16 | 14 | use Balloon\Filesystem\Node\File; |
| 17 | 15 | use Balloon\Queue\Preview as PreviewJob; |
| 18 | 16 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |