@@ -24,8 +24,7 @@ |
||
24 | 24 | |
25 | 25 | namespace OCA\CMSPico\Exceptions; |
26 | 26 | |
27 | -class PluginNotCompatibleException extends \Exception |
|
28 | -{ |
|
27 | +class PluginNotCompatibleException extends \Exception { |
|
29 | 28 | /** @var string */ |
30 | 29 | private $pluginName; |
31 | 30 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | $reasonData = $this->reasonData; |
72 | - $replaceCallback = function (array $matches) use ($reasonData) { |
|
72 | + $replaceCallback = function(array $matches) use ($reasonData) { |
|
73 | 73 | return $reasonData[$matches[1]] ?? ''; |
74 | 74 | }; |
75 | 75 |
@@ -24,7 +24,6 @@ |
||
24 | 24 | |
25 | 25 | namespace OCA\CMSPico\Exceptions; |
26 | 26 | |
27 | -class PluginNotFoundException extends \Exception |
|
28 | -{ |
|
27 | +class PluginNotFoundException extends \Exception { |
|
29 | 28 | |
30 | 29 | } |
@@ -27,8 +27,7 @@ |
||
27 | 27 | use OCA\CMSPico\Exceptions\PluginNotCompatibleException; |
28 | 28 | use OCA\CMSPico\Files\LocalFolder; |
29 | 29 | |
30 | -class Plugin implements \JsonSerializable |
|
31 | -{ |
|
30 | +class Plugin implements \JsonSerializable { |
|
32 | 31 | /** @var int */ |
33 | 32 | const PLUGIN_TYPE_SYSTEM = 1; |
34 | 33 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
114 | - $includeClosure = static function (string $pluginFile) { |
|
114 | + $includeClosure = static function(string $pluginFile) { |
|
115 | 115 | /** @noinspection PhpIncludeInspection */ |
116 | 116 | require($pluginFile); |
117 | 117 | }; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | throw new PluginNotCompatibleException( |
122 | 122 | $this->getName(), |
123 | 123 | 'Incompatible plugin: Plugin file "{file}" not found.', |
124 | - [ 'file' => $this->getName() . '/' . $this->getName() . '.php' ] |
|
124 | + ['file' => $this->getName() . '/' . $this->getName() . '.php'] |
|
125 | 125 | ); |
126 | 126 | } |
127 | 127 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | throw new PluginNotCompatibleException( |
133 | 133 | $this->getName(), |
134 | 134 | 'Incompatible plugin: Plugin class "{class}" not found.', |
135 | - [ 'class' => $className ] |
|
135 | + ['class' => $className] |
|
136 | 136 | ); |
137 | 137 | } |
138 | 138 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $this->getName(), |
148 | 148 | 'Incompatible plugin: Plugins for Pico CMS for Nextcloud must use API version {minApiVersion} ' |
149 | 149 | . 'or later, but this plugin uses API version {apiVersion}.', |
150 | - [ 'minApiVersion' => \Pico::API_VERSION, 'apiVersion' => $apiVersion ] |
|
150 | + ['minApiVersion' => \Pico::API_VERSION, 'apiVersion' => $apiVersion] |
|
151 | 151 | ); |
152 | 152 | } |
153 | 153 |
@@ -24,7 +24,6 @@ |
||
24 | 24 | |
25 | 25 | namespace OCA\CMSPico\Exceptions; |
26 | 26 | |
27 | -class FilesystemNotWritableException extends \Exception |
|
28 | -{ |
|
27 | +class FilesystemNotWritableException extends \Exception { |
|
29 | 28 | |
30 | 29 | } |
@@ -37,8 +37,7 @@ |
||
37 | 37 | use OCP\Files\NotFoundException; |
38 | 38 | use OCP\Files\NotPermittedException; |
39 | 39 | |
40 | -class FileService |
|
41 | -{ |
|
40 | +class FileService { |
|
42 | 41 | /** @var string */ |
43 | 42 | const APPDATA_PUBLIC = 'appdata_public'; |
44 | 43 |
@@ -297,6 +297,6 @@ |
||
297 | 297 | */ |
298 | 298 | public function getLinkMode(): int |
299 | 299 | { |
300 | - return (int) $this->configService->getAppValue(ConfigService::LINK_MODE); |
|
300 | + return (int)$this->configService->getAppValue(ConfigService::LINK_MODE); |
|
301 | 301 | } |
302 | 302 | } |
@@ -48,8 +48,7 @@ |
||
48 | 48 | use OCA\CMSPico\Model\Website; |
49 | 49 | use OCP\Files\InvalidPathException; |
50 | 50 | |
51 | -class WebsitesService |
|
52 | -{ |
|
51 | +class WebsitesService { |
|
53 | 52 | /** @var int */ |
54 | 53 | const LINK_MODE_LONG = 1; |
55 | 54 |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function isReadable(): bool |
117 | 117 | { |
118 | - return ($this->getPermissions() & Constants::PERMISSION_READ) === Constants::PERMISSION_READ; |
|
118 | + return ($this->getPermissions()&Constants::PERMISSION_READ) === Constants::PERMISSION_READ; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function isUpdateable(): bool |
125 | 125 | { |
126 | - return ($this->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE; |
|
126 | + return ($this->getPermissions()&Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function isDeletable(): bool |
133 | 133 | { |
134 | - return ($this->getPermissions() & Constants::PERMISSION_DELETE) === Constants::PERMISSION_DELETE; |
|
134 | + return ($this->getPermissions()&Constants::PERMISSION_DELETE) === Constants::PERMISSION_DELETE; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function assertValidFileName(string $name) |
143 | 143 | { |
144 | - if (in_array($name, [ '', '.', '..' ], true)) { |
|
144 | + if (in_array($name, ['', '.', '..'], true)) { |
|
145 | 145 | throw new InvalidPathException(); |
146 | 146 | } |
147 | 147 | if ((strpos($name, '/') !== false) || (strpos($name, '\\') !== false)) { |
@@ -28,8 +28,7 @@ |
||
28 | 28 | use OCP\Constants; |
29 | 29 | use OCP\Files\InvalidPathException; |
30 | 30 | |
31 | -abstract class AbstractNode implements NodeInterface |
|
32 | -{ |
|
31 | +abstract class AbstractNode implements NodeInterface { |
|
33 | 32 | /** @var MiscService */ |
34 | 33 | protected $miscService; |
35 | 34 |
@@ -28,8 +28,7 @@ |
||
28 | 28 | use OCA\CMSPico\Model\Website; |
29 | 29 | use OCP\DB\QueryBuilder\IQueryBuilder; |
30 | 30 | |
31 | -class WebsitesRequestBuilder extends CoreRequestBuilder |
|
32 | -{ |
|
31 | +class WebsitesRequestBuilder extends CoreRequestBuilder { |
|
33 | 32 | /** |
34 | 33 | * @return IQueryBuilder |
35 | 34 | */ |
@@ -45,8 +45,7 @@ |
||
45 | 45 | use OCP\Migration\IOutput; |
46 | 46 | use OCP\Migration\SimpleMigrationStep; |
47 | 47 | |
48 | -class Version010000 extends SimpleMigrationStep |
|
49 | -{ |
|
48 | +class Version010000 extends SimpleMigrationStep { |
|
50 | 49 | /** @var IDBConnection */ |
51 | 50 | private $databaseConnection; |
52 | 51 |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | if (!$table->hasIndex('user_id')) { |
147 | - $table->addIndex([ 'user_id' ], 'user_id'); |
|
147 | + $table->addIndex(['user_id'], 'user_id'); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | if (!$table->hasIndex('site')) { |
151 | - $table->addIndex([ 'site' ], 'site'); |
|
151 | + $table->addIndex(['site'], 'site'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return $schema; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $qbUpdate |
178 | 178 | ->update(CoreRequestBuilder::TABLE_WEBSITES, 'w') |
179 | 179 | ->set('w.type', $qbUpdate->createParameter('type')) |
180 | - ->set('w.options',$qbUpdate->createParameter('options')) |
|
180 | + ->set('w.options', $qbUpdate->createParameter('options')) |
|
181 | 181 | ->where($qbUpdate->expr()->eq('w.id', $qbUpdate->createParameter('id'))); |
182 | 182 | |
183 | 183 | $selectCursor = $this->databaseConnection->getQueryBuilder() |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | . 'folders below "%s". Make sure to give the webserver write access to this directory by ' |
252 | 252 | . 'changing its permissions and ownership to the same as of your "%s" directory. Then try ' |
253 | 253 | . 'again enabling Pico CMS for Nextcloud.', |
254 | - [ $appDataPublicPath, $dataPath ] |
|
254 | + [$appDataPublicPath, $dataPath] |
|
255 | 255 | )); |
256 | 256 | } |
257 | 257 | } |