Passed
Branch feature/2.1-geodispersion-dev (38d49e)
by Jonathan
04:17
created
src/Webtrees/Module/AdminTasks/AdminTasksModule.php 2 patches
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -41,127 +41,127 @@
 block discarded – undo
41 41
  * Allow for tasks to be run on a (nearly-)regular schedule
42 42
  */
43 43
 class AdminTasksModule extends AbstractModule implements
44
-    ModuleMyArtJaubInterface,
45
-    ModuleConfigInterface,
46
-    ModuleGlobalInterface,
47
-    ModuleTasksProviderInterface
44
+	ModuleMyArtJaubInterface,
45
+	ModuleConfigInterface,
46
+	ModuleGlobalInterface,
47
+	ModuleTasksProviderInterface
48 48
 {
49
-    use ModuleMyArtJaubTrait {
50
-        boot as traitBoot;
51
-    }
52
-    use ModuleConfigTrait;
53
-    use ModuleGlobalTrait;
54
-
55
-    //How to update the database schema for this module
56
-    private const SCHEMA_TARGET_VERSION   = 2;
57
-    private const SCHEMA_SETTING_NAME     = 'MAJ_ADMTASKS_SCHEMA_VERSION';
58
-    private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema';
59
-
60
-    /**
61
-     * {@inheritDoc}
62
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::title()
63
-     */
64
-    public function title(): string
65
-    {
66
-        return I18N::translate('Administration Tasks');
67
-    }
68
-
69
-    /**
70
-     * {@inheritDoc}
71
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::description()
72
-     */
73
-    public function description(): string
74
-    {
75
-        return I18N::translate('Manage and run nearly-scheduled administration tasks.');
76
-    }
77
-
78
-    /**
79
-     * {@inheritDoc}
80
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::boot()
81
-     */
82
-    public function boot(): void
83
-    {
84
-        $this->traitBoot();
85
-        app(MigrationService::class)->updateSchema(
86
-            self::SCHEMA_MIGRATION_PREFIX,
87
-            self::SCHEMA_SETTING_NAME,
88
-            self::SCHEMA_TARGET_VERSION
89
-        );
90
-    }
91
-
92
-    /**
93
-     * {@inheritDoc}
94
-     * @see \MyArtJaub\Webtrees\Module\ModuleMyArtJaubInterface::loadRoutes()
95
-     */
96
-    public function loadRoutes(Map $router): void
97
-    {
98
-        $router->attach('', '', static function (Map $router): void {
99
-
100
-            $router->attach('', '/module-maj/admintasks', static function (Map $router): void {
101
-                $router->tokens(['task' => '\d+', 'enable' => '[01]']);
102
-
103
-                $router->attach('', '/admin', static function (Map $router): void {
104
-
105
-                    $router->extras([
106
-                        'middleware' => [
107
-                            AuthAdministrator::class,
108
-                        ],
109
-                    ]);
110
-                    $router->get(AdminConfigPage::class, '/config', AdminConfigPage::class);
111
-
112
-                    $router->attach('', '/tasks', static function (Map $router): void {
113
-
114
-                        $router->get(TasksList::class, '', TasksList::class);
115
-                        $router->get(TaskEditPage::class, '/{task}', TaskEditPage::class);
116
-                        $router->post(TaskEditAction::class, '/{task}', TaskEditAction::class);
117
-                        $router->get(TaskStatusAction::class, '/{task}/status/{enable}', TaskStatusAction::class);
118
-                    });
119
-                });
120
-
121
-                $router->get(TaskTrigger::class, '/trigger{/task}', TaskTrigger::class)
122
-                    ->allows(RequestMethodInterface::METHOD_POST);
123
-
124
-                $router->post(TokenGenerate::class, '/token', TokenGenerate::class)
125
-                    ->extras(['middleware' => [AuthAdministrator::class]]);
126
-            });
127
-        });
128
-    }
129
-
130
-    /**
131
-     * {@inheritDoc}
132
-     * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleLatestVersion()
133
-     */
134
-    public function customModuleVersion(): string
135
-    {
136
-        return '2.0.11-v.2';
137
-    }
138
-
139
-    /**
140
-     * {@inheritDoc}
141
-     * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink()
142
-     */
143
-    public function getConfigLink(): string
144
-    {
145
-        return route(AdminConfigPage::class);
146
-    }
147
-
148
-    /**
149
-     * {@inheritDoc}
150
-     * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::bodyContent()
151
-     */
152
-    public function bodyContent(): string
153
-    {
154
-        return view($this->name() . '::snippet', [ 'url' => route(TaskTrigger::class) ]);
155
-    }
156
-
157
-    /**
158
-     * {@inheritDoc}
159
-     * @see \MyArtJaub\Webtrees\Module\AdminTasks\Contracts\ModuleTasksProviderInterface::listTasks()
160
-     */
161
-    public function listTasks(): array
162
-    {
163
-        return [
164
-            'maj-healthcheck' => HealthCheckEmailTask::class
165
-        ];
166
-    }
49
+	use ModuleMyArtJaubTrait {
50
+		boot as traitBoot;
51
+	}
52
+	use ModuleConfigTrait;
53
+	use ModuleGlobalTrait;
54
+
55
+	//How to update the database schema for this module
56
+	private const SCHEMA_TARGET_VERSION   = 2;
57
+	private const SCHEMA_SETTING_NAME     = 'MAJ_ADMTASKS_SCHEMA_VERSION';
58
+	private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema';
59
+
60
+	/**
61
+	 * {@inheritDoc}
62
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::title()
63
+	 */
64
+	public function title(): string
65
+	{
66
+		return I18N::translate('Administration Tasks');
67
+	}
68
+
69
+	/**
70
+	 * {@inheritDoc}
71
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::description()
72
+	 */
73
+	public function description(): string
74
+	{
75
+		return I18N::translate('Manage and run nearly-scheduled administration tasks.');
76
+	}
77
+
78
+	/**
79
+	 * {@inheritDoc}
80
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::boot()
81
+	 */
82
+	public function boot(): void
83
+	{
84
+		$this->traitBoot();
85
+		app(MigrationService::class)->updateSchema(
86
+			self::SCHEMA_MIGRATION_PREFIX,
87
+			self::SCHEMA_SETTING_NAME,
88
+			self::SCHEMA_TARGET_VERSION
89
+		);
90
+	}
91
+
92
+	/**
93
+	 * {@inheritDoc}
94
+	 * @see \MyArtJaub\Webtrees\Module\ModuleMyArtJaubInterface::loadRoutes()
95
+	 */
96
+	public function loadRoutes(Map $router): void
97
+	{
98
+		$router->attach('', '', static function (Map $router): void {
99
+
100
+			$router->attach('', '/module-maj/admintasks', static function (Map $router): void {
101
+				$router->tokens(['task' => '\d+', 'enable' => '[01]']);
102
+
103
+				$router->attach('', '/admin', static function (Map $router): void {
104
+
105
+					$router->extras([
106
+						'middleware' => [
107
+							AuthAdministrator::class,
108
+						],
109
+					]);
110
+					$router->get(AdminConfigPage::class, '/config', AdminConfigPage::class);
111
+
112
+					$router->attach('', '/tasks', static function (Map $router): void {
113
+
114
+						$router->get(TasksList::class, '', TasksList::class);
115
+						$router->get(TaskEditPage::class, '/{task}', TaskEditPage::class);
116
+						$router->post(TaskEditAction::class, '/{task}', TaskEditAction::class);
117
+						$router->get(TaskStatusAction::class, '/{task}/status/{enable}', TaskStatusAction::class);
118
+					});
119
+				});
120
+
121
+				$router->get(TaskTrigger::class, '/trigger{/task}', TaskTrigger::class)
122
+					->allows(RequestMethodInterface::METHOD_POST);
123
+
124
+				$router->post(TokenGenerate::class, '/token', TokenGenerate::class)
125
+					->extras(['middleware' => [AuthAdministrator::class]]);
126
+			});
127
+		});
128
+	}
129
+
130
+	/**
131
+	 * {@inheritDoc}
132
+	 * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleLatestVersion()
133
+	 */
134
+	public function customModuleVersion(): string
135
+	{
136
+		return '2.0.11-v.2';
137
+	}
138
+
139
+	/**
140
+	 * {@inheritDoc}
141
+	 * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink()
142
+	 */
143
+	public function getConfigLink(): string
144
+	{
145
+		return route(AdminConfigPage::class);
146
+	}
147
+
148
+	/**
149
+	 * {@inheritDoc}
150
+	 * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::bodyContent()
151
+	 */
152
+	public function bodyContent(): string
153
+	{
154
+		return view($this->name() . '::snippet', [ 'url' => route(TaskTrigger::class) ]);
155
+	}
156
+
157
+	/**
158
+	 * {@inheritDoc}
159
+	 * @see \MyArtJaub\Webtrees\Module\AdminTasks\Contracts\ModuleTasksProviderInterface::listTasks()
160
+	 */
161
+	public function listTasks(): array
162
+	{
163
+		return [
164
+			'maj-healthcheck' => HealthCheckEmailTask::class
165
+		];
166
+	}
167 167
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     //How to update the database schema for this module
56 56
     private const SCHEMA_TARGET_VERSION   = 2;
57 57
     private const SCHEMA_SETTING_NAME     = 'MAJ_ADMTASKS_SCHEMA_VERSION';
58
-    private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema';
58
+    private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__.'\Schema';
59 59
 
60 60
     /**
61 61
      * {@inheritDoc}
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function loadRoutes(Map $router): void
97 97
     {
98
-        $router->attach('', '', static function (Map $router): void {
98
+        $router->attach('', '', static function(Map $router): void {
99 99
 
100
-            $router->attach('', '/module-maj/admintasks', static function (Map $router): void {
100
+            $router->attach('', '/module-maj/admintasks', static function(Map $router): void {
101 101
                 $router->tokens(['task' => '\d+', 'enable' => '[01]']);
102 102
 
103
-                $router->attach('', '/admin', static function (Map $router): void {
103
+                $router->attach('', '/admin', static function(Map $router): void {
104 104
 
105 105
                     $router->extras([
106 106
                         'middleware' => [
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                     ]);
110 110
                     $router->get(AdminConfigPage::class, '/config', AdminConfigPage::class);
111 111
 
112
-                    $router->attach('', '/tasks', static function (Map $router): void {
112
+                    $router->attach('', '/tasks', static function(Map $router): void {
113 113
 
114 114
                         $router->get(TasksList::class, '', TasksList::class);
115 115
                         $router->get(TaskEditPage::class, '/{task}', TaskEditPage::class);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function bodyContent(): string
153 153
     {
154
-        return view($this->name() . '::snippet', [ 'url' => route(TaskTrigger::class) ]);
154
+        return view($this->name().'::snippet', ['url' => route(TaskTrigger::class)]);
155 155
     }
156 156
 
157 157
     /**
Please login to merge, or discard this patch.
src/Webtrees/Common/GeoDispersion/Config/NullPlaceMapperConfig.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -25,59 +25,59 @@
 block discarded – undo
25 25
  */
26 26
 class NullPlaceMapperConfig implements PlaceMapperConfigInterface
27 27
 {
28
-    /**
29
-     * {@inheritDoc}
30
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::get()
31
-     */
32
-    public function get(string $key, $default = null)
33
-    {
34
-        return $default;
35
-    }
28
+	/**
29
+	 * {@inheritDoc}
30
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::get()
31
+	 */
32
+	public function get(string $key, $default = null)
33
+	{
34
+		return $default;
35
+	}
36 36
 
37
-    /**
38
-     * {@inheritDoc}
39
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::has()
40
-     */
41
-    public function has(string $key): bool
42
-    {
43
-        return false;
44
-    }
37
+	/**
38
+	 * {@inheritDoc}
39
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::has()
40
+	 */
41
+	public function has(string $key): bool
42
+	{
43
+		return false;
44
+	}
45 45
     
46
-    /**
47
-     * {@inheritDoc}
48
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::jsonDeserialize()
49
-     */
50
-    public function jsonDeserialize($config): self
51
-    {
52
-        return $this;
53
-    }
46
+	/**
47
+	 * {@inheritDoc}
48
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::jsonDeserialize()
49
+	 */
50
+	public function jsonDeserialize($config): self
51
+	{
52
+		return $this;
53
+	}
54 54
     
55
-    /**
56
-     * {@inheritDoc}
57
-     * @see JsonSerializable::jsonSerialize()
58
-     */
59
-    public function jsonSerialize()
60
-    {
61
-        return [];
62
-    }
55
+	/**
56
+	 * {@inheritDoc}
57
+	 * @see JsonSerializable::jsonSerialize()
58
+	 */
59
+	public function jsonSerialize()
60
+	{
61
+		return [];
62
+	}
63 63
 
64
-    /**
65
-     * {@inheritDoc}
66
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::configContent()
67
-     */
68
-    public function configContent(ModuleInterface $module, Tree $tree): string
69
-    {
70
-        return '';
71
-    }
64
+	/**
65
+	 * {@inheritDoc}
66
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::configContent()
67
+	 */
68
+	public function configContent(ModuleInterface $module, Tree $tree): string
69
+	{
70
+		return '';
71
+	}
72 72
     
73
-    /**
74
-     * {@inheritDoc}
75
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::withConfigUpdate()
76
-     */
77
-    public function withConfigUpdate(ServerRequestInterface $request): self
78
-    {
79
-        return $this;
80
-    }
73
+	/**
74
+	 * {@inheritDoc}
75
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::withConfigUpdate()
76
+	 */
77
+	public function withConfigUpdate(ServerRequestInterface $request): self
78
+	{
79
+		return $this;
80
+	}
81 81
 
82 82
 
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Common/GeoDispersion/Config/MapViewConfig.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -22,51 +22,51 @@
 block discarded – undo
22 22
  */
23 23
 class MapViewConfig implements MapViewConfigInterface
24 24
 {
25
-    private string $map_mapping_property;
26
-    private PlaceMapperConfigInterface $mapper_config;
25
+	private string $map_mapping_property;
26
+	private PlaceMapperConfigInterface $mapper_config;
27 27
     
28
-    /**
29
-     * Constructor for MapViewConfig
30
-     * 
31
-     * @param string $map_mapping_property
32
-     * @param PlaceMapperConfigInterface $mapper_config
33
-     */
34
-    public function __construct(
35
-        string $map_mapping_property,
36
-        PlaceMapperConfigInterface $mapper_config = null
37
-    ) {
38
-        $this->map_mapping_property = $map_mapping_property;
39
-        $this->mapper_config = $mapper_config ?? new NullPlaceMapperConfig();
40
-    }
28
+	/**
29
+	 * Constructor for MapViewConfig
30
+	 * 
31
+	 * @param string $map_mapping_property
32
+	 * @param PlaceMapperConfigInterface $mapper_config
33
+	 */
34
+	public function __construct(
35
+		string $map_mapping_property,
36
+		PlaceMapperConfigInterface $mapper_config = null
37
+	) {
38
+		$this->map_mapping_property = $map_mapping_property;
39
+		$this->mapper_config = $mapper_config ?? new NullPlaceMapperConfig();
40
+	}
41 41
     
42
-    /**
43
-     * {@inheritDoc}
44
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\MapViewConfigInterface::mapMappingProperty()
45
-     */
46
-    public function mapMappingProperty(): string
47
-    {
48
-        return $this->map_mapping_property;
49
-    }
42
+	/**
43
+	 * {@inheritDoc}
44
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\MapViewConfigInterface::mapMappingProperty()
45
+	 */
46
+	public function mapMappingProperty(): string
47
+	{
48
+		return $this->map_mapping_property;
49
+	}
50 50
     
51
-    /**
52
-     * {@inheritDoc}
53
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\MapViewConfigInterface::mapperConfig()
54
-     */
55
-    public function mapperConfig(): PlaceMapperConfigInterface
56
-    {
57
-        return $this->mapper_config;
58
-    }
51
+	/**
52
+	 * {@inheritDoc}
53
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\MapViewConfigInterface::mapperConfig()
54
+	 */
55
+	public function mapperConfig(): PlaceMapperConfigInterface
56
+	{
57
+		return $this->mapper_config;
58
+	}
59 59
     
60
-    /**
61
-     * {@inheritDoc}
62
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\MapViewConfigInterface::with()
63
-     */
64
-    public function with(string $mapping_property, PlaceMapperConfigInterface $mapper_config): self
65
-    {
66
-        $new = clone $this;
67
-        $new->map_mapping_property = $mapping_property;
68
-        $new->mapper_config = $mapper_config;
69
-        return $new;
70
-    }
60
+	/**
61
+	 * {@inheritDoc}
62
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\MapViewConfigInterface::with()
63
+	 */
64
+	public function with(string $mapping_property, PlaceMapperConfigInterface $mapper_config): self
65
+	{
66
+		$new = clone $this;
67
+		$new->map_mapping_property = $mapping_property;
68
+		$new->mapper_config = $mapper_config;
69
+		return $new;
70
+	}
71 71
 
72 72
 }
73 73
\ No newline at end of file
Please login to merge, or discard this patch.