Completed
Push — master ( c3f16a...5bade9 )
by Joas
28:33 queued 19s
created
lib/private/Hooks/PublicEmitter.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@
 block discarded – undo
29 29
  * @deprecated 18.0.0 use events and the \OCP\EventDispatcher\IEventDispatcher service
30 30
  */
31 31
 class PublicEmitter extends BasicEmitter {
32
-	/**
33
-	 * @param string $scope
34
-	 * @param string $method
35
-	 * @param array $arguments optional
36
-	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
37
-	 *
38
-	 * @suppress PhanAccessMethodProtected
39
-	 */
40
-	public function emit($scope, $method, array $arguments = []) {
41
-		parent::emit($scope, $method, $arguments);
42
-	}
32
+    /**
33
+     * @param string $scope
34
+     * @param string $method
35
+     * @param array $arguments optional
36
+     * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
37
+     *
38
+     * @suppress PhanAccessMethodProtected
39
+     */
40
+    public function emit($scope, $method, array $arguments = []) {
41
+        parent::emit($scope, $method, $arguments);
42
+    }
43 43
 }
Please login to merge, or discard this patch.
lib/private/Hooks/EmitterTrait.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener
42 42
 	 */
43 43
 	public function listen($scope, $method, callable $callback) {
44
-		$eventName = $scope . '::' . $method;
44
+		$eventName = $scope.'::'.$method;
45 45
 		if (!isset($this->listeners[$eventName])) {
46 46
 			$this->listeners[$eventName] = [];
47 47
 		}
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$names = [];
61 61
 		$allNames = array_keys($this->listeners);
62 62
 		if ($scope and $method) {
63
-			$name = $scope . '::' . $method;
63
+			$name = $scope.'::'.$method;
64 64
 			if (isset($this->listeners[$name])) {
65 65
 				$names[] = $name;
66 66
 			}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
102 102
 	 */
103 103
 	protected function emit($scope, $method, array $arguments = []) {
104
-		$eventName = $scope . '::' . $method;
104
+		$eventName = $scope.'::'.$method;
105 105
 		if (isset($this->listeners[$eventName])) {
106 106
 			foreach ($this->listeners[$eventName] as $callback) {
107 107
 				call_user_func_array($callback, $arguments);
Please login to merge, or discard this patch.
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -10,83 +10,83 @@
 block discarded – undo
10 10
  * @deprecated 18.0.0 use events and the \OCP\EventDispatcher\IEventDispatcher service
11 11
  */
12 12
 trait EmitterTrait {
13
-	/**
14
-	 * @var callable[][] $listeners
15
-	 */
16
-	protected $listeners = [];
13
+    /**
14
+     * @var callable[][] $listeners
15
+     */
16
+    protected $listeners = [];
17 17
 
18
-	/**
19
-	 * @param string $scope
20
-	 * @param string $method
21
-	 * @param callable $callback
22
-	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener
23
-	 */
24
-	public function listen($scope, $method, callable $callback) {
25
-		$eventName = $scope . '::' . $method;
26
-		if (!isset($this->listeners[$eventName])) {
27
-			$this->listeners[$eventName] = [];
28
-		}
29
-		if (!in_array($callback, $this->listeners[$eventName], true)) {
30
-			$this->listeners[$eventName][] = $callback;
31
-		}
32
-	}
18
+    /**
19
+     * @param string $scope
20
+     * @param string $method
21
+     * @param callable $callback
22
+     * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener
23
+     */
24
+    public function listen($scope, $method, callable $callback) {
25
+        $eventName = $scope . '::' . $method;
26
+        if (!isset($this->listeners[$eventName])) {
27
+            $this->listeners[$eventName] = [];
28
+        }
29
+        if (!in_array($callback, $this->listeners[$eventName], true)) {
30
+            $this->listeners[$eventName][] = $callback;
31
+        }
32
+    }
33 33
 
34
-	/**
35
-	 * @param string $scope optional
36
-	 * @param string $method optional
37
-	 * @param callable $callback optional
38
-	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::removeListener
39
-	 */
40
-	public function removeListener($scope = null, $method = null, ?callable $callback = null) {
41
-		$names = [];
42
-		$allNames = array_keys($this->listeners);
43
-		if ($scope and $method) {
44
-			$name = $scope . '::' . $method;
45
-			if (isset($this->listeners[$name])) {
46
-				$names[] = $name;
47
-			}
48
-		} elseif ($scope) {
49
-			foreach ($allNames as $name) {
50
-				$parts = explode('::', $name, 2);
51
-				if ($parts[0] == $scope) {
52
-					$names[] = $name;
53
-				}
54
-			}
55
-		} elseif ($method) {
56
-			foreach ($allNames as $name) {
57
-				$parts = explode('::', $name, 2);
58
-				if ($parts[1] == $method) {
59
-					$names[] = $name;
60
-				}
61
-			}
62
-		} else {
63
-			$names = $allNames;
64
-		}
34
+    /**
35
+     * @param string $scope optional
36
+     * @param string $method optional
37
+     * @param callable $callback optional
38
+     * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::removeListener
39
+     */
40
+    public function removeListener($scope = null, $method = null, ?callable $callback = null) {
41
+        $names = [];
42
+        $allNames = array_keys($this->listeners);
43
+        if ($scope and $method) {
44
+            $name = $scope . '::' . $method;
45
+            if (isset($this->listeners[$name])) {
46
+                $names[] = $name;
47
+            }
48
+        } elseif ($scope) {
49
+            foreach ($allNames as $name) {
50
+                $parts = explode('::', $name, 2);
51
+                if ($parts[0] == $scope) {
52
+                    $names[] = $name;
53
+                }
54
+            }
55
+        } elseif ($method) {
56
+            foreach ($allNames as $name) {
57
+                $parts = explode('::', $name, 2);
58
+                if ($parts[1] == $method) {
59
+                    $names[] = $name;
60
+                }
61
+            }
62
+        } else {
63
+            $names = $allNames;
64
+        }
65 65
 
66
-		foreach ($names as $name) {
67
-			if ($callback) {
68
-				$index = array_search($callback, $this->listeners[$name], true);
69
-				if ($index !== false) {
70
-					unset($this->listeners[$name][$index]);
71
-				}
72
-			} else {
73
-				$this->listeners[$name] = [];
74
-			}
75
-		}
76
-	}
66
+        foreach ($names as $name) {
67
+            if ($callback) {
68
+                $index = array_search($callback, $this->listeners[$name], true);
69
+                if ($index !== false) {
70
+                    unset($this->listeners[$name][$index]);
71
+                }
72
+            } else {
73
+                $this->listeners[$name] = [];
74
+            }
75
+        }
76
+    }
77 77
 
78
-	/**
79
-	 * @param string $scope
80
-	 * @param string $method
81
-	 * @param array $arguments optional
82
-	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
83
-	 */
84
-	protected function emit($scope, $method, array $arguments = []) {
85
-		$eventName = $scope . '::' . $method;
86
-		if (isset($this->listeners[$eventName])) {
87
-			foreach ($this->listeners[$eventName] as $callback) {
88
-				call_user_func_array($callback, $arguments);
89
-			}
90
-		}
91
-	}
78
+    /**
79
+     * @param string $scope
80
+     * @param string $method
81
+     * @param array $arguments optional
82
+     * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped
83
+     */
84
+    protected function emit($scope, $method, array $arguments = []) {
85
+        $eventName = $scope . '::' . $method;
86
+        if (isset($this->listeners[$eventName])) {
87
+            foreach ($this->listeners[$eventName] as $callback) {
88
+                call_user_func_array($callback, $arguments);
89
+            }
90
+        }
91
+    }
92 92
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/MountProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 		$managerProvider = $this->managerProvider;
64 64
 		$manager = $managerProvider();
65 65
 		$data['manager'] = $manager;
66
-		$mountPoint = '/' . $user->getUID() . '/files/' . ltrim($data['mountpoint'], '/');
66
+		$mountPoint = '/'.$user->getUID().'/files/'.ltrim($data['mountpoint'], '/');
67 67
 		$data['mountpoint'] = $mountPoint;
68 68
 		$data['cloudId'] = $this->cloudIdManager->getCloudId($data['owner'], $data['remote']);
69 69
 		$data['certificateManager'] = \OC::$server->getCertificateManager();
Please login to merge, or discard this patch.
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -16,52 +16,52 @@
 block discarded – undo
16 16
 use OCP\Server;
17 17
 
18 18
 class MountProvider implements IMountProvider {
19
-	public const STORAGE = '\OCA\Files_Sharing\External\Storage';
19
+    public const STORAGE = '\OCA\Files_Sharing\External\Storage';
20 20
 
21
-	/**
22
-	 * @var callable
23
-	 */
24
-	private $managerProvider;
21
+    /**
22
+     * @var callable
23
+     */
24
+    private $managerProvider;
25 25
 
26
-	/**
27
-	 * @param IDBConnection $connection
28
-	 * @param callable $managerProvider due to setup order we need a callable that return the manager instead of the manager itself
29
-	 * @param ICloudIdManager $cloudIdManager
30
-	 */
31
-	public function __construct(
32
-		private IDBConnection $connection,
33
-		callable $managerProvider,
34
-		private ICloudIdManager $cloudIdManager,
35
-	) {
36
-		$this->managerProvider = $managerProvider;
37
-	}
26
+    /**
27
+     * @param IDBConnection $connection
28
+     * @param callable $managerProvider due to setup order we need a callable that return the manager instead of the manager itself
29
+     * @param ICloudIdManager $cloudIdManager
30
+     */
31
+    public function __construct(
32
+        private IDBConnection $connection,
33
+        callable $managerProvider,
34
+        private ICloudIdManager $cloudIdManager,
35
+    ) {
36
+        $this->managerProvider = $managerProvider;
37
+    }
38 38
 
39
-	public function getMount(IUser $user, $data, IStorageFactory $storageFactory) {
40
-		$managerProvider = $this->managerProvider;
41
-		$manager = $managerProvider();
42
-		$data['manager'] = $manager;
43
-		$mountPoint = '/' . $user->getUID() . '/files/' . ltrim($data['mountpoint'], '/');
44
-		$data['mountpoint'] = $mountPoint;
45
-		$data['cloudId'] = $this->cloudIdManager->getCloudId($data['owner'], $data['remote']);
46
-		$data['certificateManager'] = \OC::$server->getCertificateManager();
47
-		$data['HttpClientService'] = Server::get(IClientService::class);
48
-		return new Mount(self::STORAGE, $mountPoint, $data, $manager, $storageFactory);
49
-	}
39
+    public function getMount(IUser $user, $data, IStorageFactory $storageFactory) {
40
+        $managerProvider = $this->managerProvider;
41
+        $manager = $managerProvider();
42
+        $data['manager'] = $manager;
43
+        $mountPoint = '/' . $user->getUID() . '/files/' . ltrim($data['mountpoint'], '/');
44
+        $data['mountpoint'] = $mountPoint;
45
+        $data['cloudId'] = $this->cloudIdManager->getCloudId($data['owner'], $data['remote']);
46
+        $data['certificateManager'] = \OC::$server->getCertificateManager();
47
+        $data['HttpClientService'] = Server::get(IClientService::class);
48
+        return new Mount(self::STORAGE, $mountPoint, $data, $manager, $storageFactory);
49
+    }
50 50
 
51
-	public function getMountsForUser(IUser $user, IStorageFactory $loader) {
52
-		$qb = $this->connection->getQueryBuilder();
53
-		$qb->select('remote', 'share_token', 'password', 'mountpoint', 'owner')
54
-			->from('share_external')
55
-			->where($qb->expr()->eq('user', $qb->createNamedParameter($user->getUID())))
56
-			->andWhere($qb->expr()->eq('accepted', $qb->createNamedParameter(1, IQueryBuilder::PARAM_INT)));
57
-		$result = $qb->executeQuery();
58
-		$mounts = [];
59
-		while ($row = $result->fetch()) {
60
-			$row['manager'] = $this;
61
-			$row['token'] = $row['share_token'];
62
-			$mounts[] = $this->getMount($user, $row, $loader);
63
-		}
64
-		$result->closeCursor();
65
-		return $mounts;
66
-	}
51
+    public function getMountsForUser(IUser $user, IStorageFactory $loader) {
52
+        $qb = $this->connection->getQueryBuilder();
53
+        $qb->select('remote', 'share_token', 'password', 'mountpoint', 'owner')
54
+            ->from('share_external')
55
+            ->where($qb->expr()->eq('user', $qb->createNamedParameter($user->getUID())))
56
+            ->andWhere($qb->expr()->eq('accepted', $qb->createNamedParameter(1, IQueryBuilder::PARAM_INT)));
57
+        $result = $qb->executeQuery();
58
+        $mounts = [];
59
+        while ($row = $result->fetch()) {
60
+            $row['manager'] = $this;
61
+            $row['token'] = $row['share_token'];
62
+            $mounts[] = $this->getMount($user, $row, $loader);
63
+        }
64
+        $result->closeCursor();
65
+        return $mounts;
66
+    }
67 67
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Http/Output.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -32,77 +32,77 @@
 block discarded – undo
32 32
  * Very thin wrapper class to make output testable
33 33
  */
34 34
 class Output implements IOutput {
35
-	/** @var string */
36
-	private $webRoot;
35
+    /** @var string */
36
+    private $webRoot;
37 37
 
38
-	/**
39
-	 * @param $webRoot
40
-	 */
41
-	public function __construct($webRoot) {
42
-		$this->webRoot = $webRoot;
43
-	}
38
+    /**
39
+     * @param $webRoot
40
+     */
41
+    public function __construct($webRoot) {
42
+        $this->webRoot = $webRoot;
43
+    }
44 44
 
45
-	/**
46
-	 * @param string $out
47
-	 */
48
-	public function setOutput($out) {
49
-		print($out);
50
-	}
45
+    /**
46
+     * @param string $out
47
+     */
48
+    public function setOutput($out) {
49
+        print($out);
50
+    }
51 51
 
52
-	/**
53
-	 * @param string|resource $path or file handle
54
-	 *
55
-	 * @return bool false if an error occurred
56
-	 */
57
-	public function setReadfile($path) {
58
-		if (is_resource($path)) {
59
-			$output = fopen('php://output', 'w');
60
-			return stream_copy_to_stream($path, $output) > 0;
61
-		} else {
62
-			return @readfile($path);
63
-		}
64
-	}
52
+    /**
53
+     * @param string|resource $path or file handle
54
+     *
55
+     * @return bool false if an error occurred
56
+     */
57
+    public function setReadfile($path) {
58
+        if (is_resource($path)) {
59
+            $output = fopen('php://output', 'w');
60
+            return stream_copy_to_stream($path, $output) > 0;
61
+        } else {
62
+            return @readfile($path);
63
+        }
64
+    }
65 65
 
66
-	/**
67
-	 * @param string $header
68
-	 */
69
-	public function setHeader($header) {
70
-		header($header);
71
-	}
66
+    /**
67
+     * @param string $header
68
+     */
69
+    public function setHeader($header) {
70
+        header($header);
71
+    }
72 72
 
73
-	/**
74
-	 * @param int $code sets the http status code
75
-	 */
76
-	public function setHttpResponseCode($code) {
77
-		http_response_code($code);
78
-	}
73
+    /**
74
+     * @param int $code sets the http status code
75
+     */
76
+    public function setHttpResponseCode($code) {
77
+        http_response_code($code);
78
+    }
79 79
 
80
-	/**
81
-	 * @return int returns the current http response code
82
-	 */
83
-	public function getHttpResponseCode() {
84
-		return http_response_code();
85
-	}
80
+    /**
81
+     * @return int returns the current http response code
82
+     */
83
+    public function getHttpResponseCode() {
84
+        return http_response_code();
85
+    }
86 86
 
87
-	/**
88
-	 * @param string $name
89
-	 * @param string $value
90
-	 * @param int $expire
91
-	 * @param string $path
92
-	 * @param string $domain
93
-	 * @param bool $secure
94
-	 * @param bool $httpOnly
95
-	 */
96
-	public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly, $sameSite = 'Lax') {
97
-		$path = $this->webRoot ? : '/';
87
+    /**
88
+     * @param string $name
89
+     * @param string $value
90
+     * @param int $expire
91
+     * @param string $path
92
+     * @param string $domain
93
+     * @param bool $secure
94
+     * @param bool $httpOnly
95
+     */
96
+    public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly, $sameSite = 'Lax') {
97
+        $path = $this->webRoot ? : '/';
98 98
 
99
-		setcookie($name, $value, [
100
-			'expires' => $expire,
101
-			'path' => $path,
102
-			'domain' => $domain,
103
-			'secure' => $secure,
104
-			'httponly' => $httpOnly,
105
-			'samesite' => $sameSite
106
-		]);
107
-	}
99
+        setcookie($name, $value, [
100
+            'expires' => $expire,
101
+            'path' => $path,
102
+            'domain' => $domain,
103
+            'secure' => $secure,
104
+            'httponly' => $httpOnly,
105
+            'samesite' => $sameSite
106
+        ]);
107
+    }
108 108
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
 	 * @param bool $httpOnly
95 95
 	 */
96 96
 	public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly, $sameSite = 'Lax') {
97
-		$path = $this->webRoot ? : '/';
97
+		$path = $this->webRoot ?: '/';
98 98
 
99 99
 		setcookie($name, $value, [
100 100
 			'expires' => $expire,
Please login to merge, or discard this patch.
core/Migrations/Version14000Date20180710092004.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,19 +34,19 @@
 block discarded – undo
34 34
 use OCP\Migration\SimpleMigrationStep;
35 35
 
36 36
 class Version14000Date20180710092004 extends SimpleMigrationStep {
37
-	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
38
-		/** @var ISchemaWrapper $schema */
39
-		$schema = $schemaClosure();
37
+    public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
38
+        /** @var ISchemaWrapper $schema */
39
+        $schema = $schemaClosure();
40 40
 
41
-		$table = $schema->getTable('share');
41
+        $table = $schema->getTable('share');
42 42
 
43
-		if (!$table->hasColumn('password_by_talk')) {
44
-			$table->addColumn('password_by_talk', Types::BOOLEAN, [
45
-				'default' => 0,
46
-				'notnull' => false,
47
-			]);
48
-		}
43
+        if (!$table->hasColumn('password_by_talk')) {
44
+            $table->addColumn('password_by_talk', Types::BOOLEAN, [
45
+                'default' => 0,
46
+                'notnull' => false,
47
+            ]);
48
+        }
49 49
 
50
-		return $schema;
51
-	}
50
+        return $schema;
51
+    }
52 52
 }
Please login to merge, or discard this patch.
apps/dav/lib/Migration/Version1016Date20201109085907.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -32,30 +32,30 @@
 block discarded – undo
32 32
 use OCP\Migration\SimpleMigrationStep;
33 33
 
34 34
 class Version1016Date20201109085907 extends SimpleMigrationStep {
35
-	/**
36
-	 * @param IOutput $output
37
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
38
-	 * @param array $options
39
-	 * @return null|ISchemaWrapper
40
-	 */
41
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
42
-		/** @var ISchemaWrapper $schema */
43
-		$schema = $schemaClosure();
44
-
45
-		$result = $this->ensureColumnIsNullable($schema, 'calendar_reminders', 'is_recurring');
46
-
47
-		return $result ? $schema : null;
48
-	}
49
-
50
-	protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool {
51
-		$table = $schema->getTable($tableName);
52
-		$column = $table->getColumn($columnName);
53
-
54
-		if ($column->getNotnull()) {
55
-			$column->setNotnull(false);
56
-			return true;
57
-		}
58
-
59
-		return false;
60
-	}
35
+    /**
36
+     * @param IOutput $output
37
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
38
+     * @param array $options
39
+     * @return null|ISchemaWrapper
40
+     */
41
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
42
+        /** @var ISchemaWrapper $schema */
43
+        $schema = $schemaClosure();
44
+
45
+        $result = $this->ensureColumnIsNullable($schema, 'calendar_reminders', 'is_recurring');
46
+
47
+        return $result ? $schema : null;
48
+    }
49
+
50
+    protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool {
51
+        $table = $schema->getTable($tableName);
52
+        $column = $table->getColumn($columnName);
53
+
54
+        if ($column->getNotnull()) {
55
+            $column->setNotnull(false);
56
+            return true;
57
+        }
58
+
59
+        return false;
60
+    }
61 61
 }
Please login to merge, or discard this patch.
core/Migrations/Version20000Date20201111081915.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -32,30 +32,30 @@
 block discarded – undo
32 32
 use OCP\Migration\SimpleMigrationStep;
33 33
 
34 34
 class Version20000Date20201111081915 extends SimpleMigrationStep {
35
-	/**
36
-	 * @param IOutput $output
37
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
38
-	 * @param array $options
39
-	 * @return null|ISchemaWrapper
40
-	 */
41
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
42
-		/** @var ISchemaWrapper $schema */
43
-		$schema = $schemaClosure();
44
-
45
-		$result = $this->ensureColumnIsNullable($schema, 'direct_edit', 'accessed');
46
-
47
-		return $result ? $schema : null;
48
-	}
49
-
50
-	protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool {
51
-		$table = $schema->getTable($tableName);
52
-		$column = $table->getColumn($columnName);
53
-
54
-		if ($column->getNotnull()) {
55
-			$column->setNotnull(false);
56
-			return true;
57
-		}
58
-
59
-		return false;
60
-	}
35
+    /**
36
+     * @param IOutput $output
37
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
38
+     * @param array $options
39
+     * @return null|ISchemaWrapper
40
+     */
41
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
42
+        /** @var ISchemaWrapper $schema */
43
+        $schema = $schemaClosure();
44
+
45
+        $result = $this->ensureColumnIsNullable($schema, 'direct_edit', 'accessed');
46
+
47
+        return $result ? $schema : null;
48
+    }
49
+
50
+    protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool {
51
+        $table = $schema->getTable($tableName);
52
+        $column = $table->getColumn($columnName);
53
+
54
+        if ($column->getNotnull()) {
55
+            $column->setNotnull(false);
56
+            return true;
57
+        }
58
+
59
+        return false;
60
+    }
61 61
 }
Please login to merge, or discard this patch.
apps/user_status/lib/Migration/Version0001Date20200602134824.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -37,61 +37,61 @@
 block discarded – undo
37 37
  */
38 38
 class Version0001Date20200602134824 extends SimpleMigrationStep {
39 39
 
40
-	/**
41
-	 * @param IOutput $output
42
-	 * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
43
-	 * @param array $options
44
-	 * @return null|ISchemaWrapper
45
-	 * @since 20.0.0
46
-	 */
47
-	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
48
-		/** @var ISchemaWrapper $schema */
49
-		$schema = $schemaClosure();
40
+    /**
41
+     * @param IOutput $output
42
+     * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
43
+     * @param array $options
44
+     * @return null|ISchemaWrapper
45
+     * @since 20.0.0
46
+     */
47
+    public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
48
+        /** @var ISchemaWrapper $schema */
49
+        $schema = $schemaClosure();
50 50
 
51
-		$statusTable = $schema->createTable('user_status');
52
-		$statusTable->addColumn('id', Types::BIGINT, [
53
-			'autoincrement' => true,
54
-			'notnull' => true,
55
-			'length' => 20,
56
-			'unsigned' => true,
57
-		]);
58
-		$statusTable->addColumn('user_id', Types::STRING, [
59
-			'notnull' => true,
60
-			'length' => 255,
61
-		]);
62
-		$statusTable->addColumn('status', Types::STRING, [
63
-			'notnull' => true,
64
-			'length' => 255,
65
-		]);
66
-		$statusTable->addColumn('status_timestamp', Types::INTEGER, [
67
-			'notnull' => true,
68
-			'length' => 11,
69
-			'unsigned' => true,
70
-		]);
71
-		$statusTable->addColumn('is_user_defined', Types::BOOLEAN, [
72
-			'notnull' => false,
73
-		]);
74
-		$statusTable->addColumn('message_id', Types::STRING, [
75
-			'notnull' => false,
76
-			'length' => 255,
77
-		]);
78
-		$statusTable->addColumn('custom_icon', Types::STRING, [
79
-			'notnull' => false,
80
-			'length' => 255,
81
-		]);
82
-		$statusTable->addColumn('custom_message', Types::TEXT, [
83
-			'notnull' => false,
84
-		]);
85
-		$statusTable->addColumn('clear_at', Types::INTEGER, [
86
-			'notnull' => false,
87
-			'length' => 11,
88
-			'unsigned' => true,
89
-		]);
51
+        $statusTable = $schema->createTable('user_status');
52
+        $statusTable->addColumn('id', Types::BIGINT, [
53
+            'autoincrement' => true,
54
+            'notnull' => true,
55
+            'length' => 20,
56
+            'unsigned' => true,
57
+        ]);
58
+        $statusTable->addColumn('user_id', Types::STRING, [
59
+            'notnull' => true,
60
+            'length' => 255,
61
+        ]);
62
+        $statusTable->addColumn('status', Types::STRING, [
63
+            'notnull' => true,
64
+            'length' => 255,
65
+        ]);
66
+        $statusTable->addColumn('status_timestamp', Types::INTEGER, [
67
+            'notnull' => true,
68
+            'length' => 11,
69
+            'unsigned' => true,
70
+        ]);
71
+        $statusTable->addColumn('is_user_defined', Types::BOOLEAN, [
72
+            'notnull' => false,
73
+        ]);
74
+        $statusTable->addColumn('message_id', Types::STRING, [
75
+            'notnull' => false,
76
+            'length' => 255,
77
+        ]);
78
+        $statusTable->addColumn('custom_icon', Types::STRING, [
79
+            'notnull' => false,
80
+            'length' => 255,
81
+        ]);
82
+        $statusTable->addColumn('custom_message', Types::TEXT, [
83
+            'notnull' => false,
84
+        ]);
85
+        $statusTable->addColumn('clear_at', Types::INTEGER, [
86
+            'notnull' => false,
87
+            'length' => 11,
88
+            'unsigned' => true,
89
+        ]);
90 90
 
91
-		$statusTable->setPrimaryKey(['id']);
92
-		$statusTable->addUniqueIndex(['user_id'], 'user_status_uid_ix');
93
-		$statusTable->addIndex(['clear_at'], 'user_status_clr_ix');
91
+        $statusTable->setPrimaryKey(['id']);
92
+        $statusTable->addUniqueIndex(['user_id'], 'user_status_uid_ix');
93
+        $statusTable->addIndex(['clear_at'], 'user_status_clr_ix');
94 94
 
95
-		return $schema;
96
-	}
95
+        return $schema;
96
+    }
97 97
 }
Please login to merge, or discard this patch.
apps/user_status/lib/Migration/Version1000Date20201111130204.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -33,30 +33,30 @@
 block discarded – undo
33 33
 
34 34
 class Version1000Date20201111130204 extends SimpleMigrationStep {
35 35
 
36
-	/**
37
-	 * @param IOutput $output
38
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
-	 * @param array $options
40
-	 * @return null|ISchemaWrapper
41
-	 */
42
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
43
-		/** @var ISchemaWrapper $schema */
44
-		$schema = $schemaClosure();
45
-
46
-		$result = $this->ensureColumnIsNullable($schema, 'user_status', 'is_user_defined');
47
-
48
-		return $result ? $schema : null;
49
-	}
50
-
51
-	protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool {
52
-		$table = $schema->getTable($tableName);
53
-		$column = $table->getColumn($columnName);
54
-
55
-		if ($column->getNotnull()) {
56
-			$column->setNotnull(false);
57
-			return true;
58
-		}
59
-
60
-		return false;
61
-	}
36
+    /**
37
+     * @param IOutput $output
38
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
+     * @param array $options
40
+     * @return null|ISchemaWrapper
41
+     */
42
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
43
+        /** @var ISchemaWrapper $schema */
44
+        $schema = $schemaClosure();
45
+
46
+        $result = $this->ensureColumnIsNullable($schema, 'user_status', 'is_user_defined');
47
+
48
+        return $result ? $schema : null;
49
+    }
50
+
51
+    protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool {
52
+        $table = $schema->getTable($tableName);
53
+        $column = $table->getColumn($columnName);
54
+
55
+        if ($column->getNotnull()) {
56
+            $column->setNotnull(false);
57
+            return true;
58
+        }
59
+
60
+        return false;
61
+    }
62 62
 }
Please login to merge, or discard this patch.