diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-22 17:59:26 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-25 16:15:48 +0200 |
commit | a2a7150d6d87a499e6745651edb27c9795939d0c (patch) | |
tree | 43c24a93b22268ec324ec30b2ef026ea09df1b4b /lib/private/Repair | |
parent | a83a8f0dde07bff67e0ceb7008cc26b3fad32516 (diff) | |
download | nextcloud-server-a2a7150d6d87a499e6745651edb27c9795939d0c.tar.gz nextcloud-server-a2a7150d6d87a499e6745651edb27c9795939d0c.zip |
Migrate Repair events to OCP\EventDispatcher\Event
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Repair')
-rw-r--r-- | lib/private/Repair/Events/RepairAdvanceEvent.php | 46 | ||||
-rw-r--r-- | lib/private/Repair/Events/RepairErrorEvent.php | 38 | ||||
-rw-r--r-- | lib/private/Repair/Events/RepairFinishEvent.php | 27 | ||||
-rw-r--r-- | lib/private/Repair/Events/RepairInfoEvent.php | 38 | ||||
-rw-r--r-- | lib/private/Repair/Events/RepairStartEvent.php | 45 | ||||
-rw-r--r-- | lib/private/Repair/Events/RepairStepEvent.php | 38 | ||||
-rw-r--r-- | lib/private/Repair/Events/RepairWarningEvent.php | 38 |
7 files changed, 270 insertions, 0 deletions
diff --git a/lib/private/Repair/Events/RepairAdvanceEvent.php b/lib/private/Repair/Events/RepairAdvanceEvent.php new file mode 100644 index 00000000000..c82c61c186c --- /dev/null +++ b/lib/private/Repair/Events/RepairAdvanceEvent.php @@ -0,0 +1,46 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +namespace OC\Repair\Events; + +use OCP\EventDispatcher\Event; + +class RepairAdvanceEvent extends Event { + // TODO Is that current step or step increment? + private int $current; + private string $description; + + public function __construct( + int $current, + string $description + ) { + $this->current = $current; + $this->description = $description; + } + + public function getCurrentStep(): int { + return $this->current; + } + + public function getDescription(): string { + return $this->description; + } +} diff --git a/lib/private/Repair/Events/RepairErrorEvent.php b/lib/private/Repair/Events/RepairErrorEvent.php new file mode 100644 index 00000000000..c1380143216 --- /dev/null +++ b/lib/private/Repair/Events/RepairErrorEvent.php @@ -0,0 +1,38 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +namespace OC\Repair\Events; + +use OCP\EventDispatcher\Event; + +class RepairErrorEvent extends Event { + private string $message; + + public function __construct( + string $message + ) { + $this->message = $message; + } + + public function getMessage(): string { + return $this->message; + } +} diff --git a/lib/private/Repair/Events/RepairFinishEvent.php b/lib/private/Repair/Events/RepairFinishEvent.php new file mode 100644 index 00000000000..2d3027c23bc --- /dev/null +++ b/lib/private/Repair/Events/RepairFinishEvent.php @@ -0,0 +1,27 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +namespace OC\Repair\Events; + +use OCP\EventDispatcher\Event; + +class RepairFinishEvent extends Event { +} diff --git a/lib/private/Repair/Events/RepairInfoEvent.php b/lib/private/Repair/Events/RepairInfoEvent.php new file mode 100644 index 00000000000..7acf71b2d90 --- /dev/null +++ b/lib/private/Repair/Events/RepairInfoEvent.php @@ -0,0 +1,38 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +namespace OC\Repair\Events; + +use OCP\EventDispatcher\Event; + +class RepairInfoEvent extends Event { + private string $message; + + public function __construct( + string $message + ) { + $this->message = $message; + } + + public function getMessage(): string { + return $this->message; + } +} diff --git a/lib/private/Repair/Events/RepairStartEvent.php b/lib/private/Repair/Events/RepairStartEvent.php new file mode 100644 index 00000000000..115e145f69f --- /dev/null +++ b/lib/private/Repair/Events/RepairStartEvent.php @@ -0,0 +1,45 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +namespace OC\Repair\Events; + +use OCP\EventDispatcher\Event; + +class RepairStartEvent extends Event { + private int $max; + private string $current; + + public function __construct( + int $max, + string $current + ) { + $this->max = $max; + $this->current = $current; + } + + public function getMaxStep(): int { + return $this->max; + } + + public function getCurrentStepName(): string { + return $this->current; + } +} diff --git a/lib/private/Repair/Events/RepairStepEvent.php b/lib/private/Repair/Events/RepairStepEvent.php new file mode 100644 index 00000000000..03f0c492920 --- /dev/null +++ b/lib/private/Repair/Events/RepairStepEvent.php @@ -0,0 +1,38 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +namespace OC\Repair\Events; + +use OCP\EventDispatcher\Event; + +class RepairStepEvent extends Event { + private string $stepName; + + public function __construct( + string $stepName + ) { + $this->stepName = $stepName; + } + + public function getStepName(): string { + return $this->stepName; + } +} diff --git a/lib/private/Repair/Events/RepairWarningEvent.php b/lib/private/Repair/Events/RepairWarningEvent.php new file mode 100644 index 00000000000..f42478873d2 --- /dev/null +++ b/lib/private/Repair/Events/RepairWarningEvent.php @@ -0,0 +1,38 @@ +<?php +/** + * @copyright Copyright (c) 2022 Côme Chilliet <come.chilliet@nextcloud.com> + * + * @author Côme Chilliet <come.chilliet@nextcloud.com> + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +namespace OC\Repair\Events; + +use OCP\EventDispatcher\Event; + +class RepairWarningEvent extends Event { + private string $message; + + public function __construct( + string $message + ) { + $this->message = $message; + } + + public function getMessage(): string { + return $this->message; + } +} |