Passed
Push — main ( c808ff...4e47c4 )
by Jonathan
13:05
created
app/Module/Hooks/HooksModule.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -42,106 +42,106 @@
 block discarded – undo
42 42
  * Provide entry points to extend core webtrees code.
43 43
  */
44 44
 class HooksModule extends AbstractModule implements
45
-    ModuleMyArtJaubInterface,
46
-    ModuleConfigInterface,
47
-    ModuleHookSubscriberInterface
45
+	ModuleMyArtJaubInterface,
46
+	ModuleConfigInterface,
47
+	ModuleHookSubscriberInterface
48 48
 {
49
-    use ModuleMyArtJaubTrait {
50
-        boot as traitBoot;
51
-    }
52
-    use ModuleConfigTrait;
53
-
54
-    // How to update the database schema for this module
55
-    private const SCHEMA_TARGET_VERSION   = 2;
56
-    private const SCHEMA_SETTING_NAME     = 'MAJ_HOOKS_SCHEMA_VERSION';
57
-    private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema';
58
-
59
-    /**
60
-     * {@inheritDoc}
61
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::title()
62
-     */
63
-    public function title(): string
64
-    {
65
-        return /* I18N: Name of the “Hooks” module */ I18N::translate('Hooks');
66
-    }
67
-
68
-    /**
69
-     * {@inheritDoc}
70
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::description()
71
-     */
72
-    public function description(): string
73
-    {
74
-        return /* I18N: Description of the “Hooks” module */ I18N::translate('Implements hooks management.');
75
-    }
76
-
77
-    /**
78
-     * {@inheritDoc}
79
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::boot()
80
-     */
81
-    public function boot(): void
82
-    {
83
-        $this->traitBoot();
84
-        app()->bind(HookServiceInterface::class, HookService::class);
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/hooks', static function (Map $router): void {
101
-
102
-                $router->attach('', '/config/admin', static function (Map $router): void {
103
-
104
-                    $router->get(AdminConfigPage::class, '', AdminConfigPage::class);
105
-                    $router->get(ModulesHooksPage::class, '/{hook_name}', ModulesHooksPage::class);
106
-                    $router->post(ModulesHooksAction::class, '/{hook_name}', ModulesHooksAction::class);
107
-                });
108
-            });
109
-        });
110
-    }
111
-
112
-    /**
113
-     * {@inheritDoc}
114
-     * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion()
115
-     */
116
-    public function customModuleVersion(): string
117
-    {
118
-        return '2.1.6-v.1';
119
-    }
120
-
121
-    /**
122
-     * {@inheritDoc}
123
-     * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink()
124
-     */
125
-    public function getConfigLink(): string
126
-    {
127
-        return route(AdminConfigPage::class);
128
-    }
129
-
130
-    /**
131
-     * {@inheritDoc}
132
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks()
133
-     */
134
-    public function listSubscribedHooks(): array
135
-    {
136
-        return [
137
-            app()->makeWith(FactSourceTextExtenderCollector::class, ['module' => $this]),
138
-            app()->makeWith(FamilyDatatablesExtenderCollector::class, ['module' => $this]),
139
-            app()->makeWith(IndividualDatatablesExtenderCollector::class, ['module' => $this]),
140
-            app()->makeWith(NameAccordionExtenderCollector::class, ['module' => $this]),
141
-            app()->makeWith(RecordNameTextExtenderCollector::class, ['module' => $this]),
142
-            app()->makeWith(SosaFamilyDatatablesExtenderCollector::class, ['module' => $this]),
143
-            app()->makeWith(SosaIndividualDatatablesExtenderCollector::class, ['module' => $this]),
144
-            app()->makeWith(SosaMissingDatatablesExtenderCollector::class, ['module' => $this])
145
-        ];
146
-    }
49
+	use ModuleMyArtJaubTrait {
50
+		boot as traitBoot;
51
+	}
52
+	use ModuleConfigTrait;
53
+
54
+	// How to update the database schema for this module
55
+	private const SCHEMA_TARGET_VERSION   = 2;
56
+	private const SCHEMA_SETTING_NAME     = 'MAJ_HOOKS_SCHEMA_VERSION';
57
+	private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema';
58
+
59
+	/**
60
+	 * {@inheritDoc}
61
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::title()
62
+	 */
63
+	public function title(): string
64
+	{
65
+		return /* I18N: Name of the “Hooks” module */ I18N::translate('Hooks');
66
+	}
67
+
68
+	/**
69
+	 * {@inheritDoc}
70
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::description()
71
+	 */
72
+	public function description(): string
73
+	{
74
+		return /* I18N: Description of the “Hooks” module */ I18N::translate('Implements hooks management.');
75
+	}
76
+
77
+	/**
78
+	 * {@inheritDoc}
79
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::boot()
80
+	 */
81
+	public function boot(): void
82
+	{
83
+		$this->traitBoot();
84
+		app()->bind(HookServiceInterface::class, HookService::class);
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/hooks', static function (Map $router): void {
101
+
102
+				$router->attach('', '/config/admin', static function (Map $router): void {
103
+
104
+					$router->get(AdminConfigPage::class, '', AdminConfigPage::class);
105
+					$router->get(ModulesHooksPage::class, '/{hook_name}', ModulesHooksPage::class);
106
+					$router->post(ModulesHooksAction::class, '/{hook_name}', ModulesHooksAction::class);
107
+				});
108
+			});
109
+		});
110
+	}
111
+
112
+	/**
113
+	 * {@inheritDoc}
114
+	 * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion()
115
+	 */
116
+	public function customModuleVersion(): string
117
+	{
118
+		return '2.1.6-v.1';
119
+	}
120
+
121
+	/**
122
+	 * {@inheritDoc}
123
+	 * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink()
124
+	 */
125
+	public function getConfigLink(): string
126
+	{
127
+		return route(AdminConfigPage::class);
128
+	}
129
+
130
+	/**
131
+	 * {@inheritDoc}
132
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks()
133
+	 */
134
+	public function listSubscribedHooks(): array
135
+	{
136
+		return [
137
+			app()->makeWith(FactSourceTextExtenderCollector::class, ['module' => $this]),
138
+			app()->makeWith(FamilyDatatablesExtenderCollector::class, ['module' => $this]),
139
+			app()->makeWith(IndividualDatatablesExtenderCollector::class, ['module' => $this]),
140
+			app()->makeWith(NameAccordionExtenderCollector::class, ['module' => $this]),
141
+			app()->makeWith(RecordNameTextExtenderCollector::class, ['module' => $this]),
142
+			app()->makeWith(SosaFamilyDatatablesExtenderCollector::class, ['module' => $this]),
143
+			app()->makeWith(SosaIndividualDatatablesExtenderCollector::class, ['module' => $this]),
144
+			app()->makeWith(SosaMissingDatatablesExtenderCollector::class, ['module' => $this])
145
+		];
146
+	}
147 147
 }
Please login to merge, or discard this patch.
app/Module/IsSourced/Hooks/IsSourcedStatusHook.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -25,53 +25,53 @@
 block discarded – undo
25 25
  */
26 26
 class IsSourcedStatusHook implements RecordNameTextExtenderInterface
27 27
 {
28
-    private ModuleInterface $module;
29
-    private SourceStatusService $source_status_service;
28
+	private ModuleInterface $module;
29
+	private SourceStatusService $source_status_service;
30 30
 
31
-    /**
32
-     * Constructor for IsSourcedStatusHook
33
-     *
34
-     * @param ModuleInterface $module
35
-     * @param SourceStatusService $source_status_service
36
-     */
37
-    public function __construct(ModuleInterface $module, SourceStatusService $source_status_service)
38
-    {
39
-        $this->module = $module;
40
-        $this->source_status_service = $source_status_service;
41
-    }
31
+	/**
32
+	 * Constructor for IsSourcedStatusHook
33
+	 *
34
+	 * @param ModuleInterface $module
35
+	 * @param SourceStatusService $source_status_service
36
+	 */
37
+	public function __construct(ModuleInterface $module, SourceStatusService $source_status_service)
38
+	{
39
+		$this->module = $module;
40
+		$this->source_status_service = $source_status_service;
41
+	}
42 42
 
43
-    /**
44
-     * {@inheritDoc}
45
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface::module()
46
-     */
47
-    public function module(): ModuleInterface
48
-    {
49
-        return $this->module;
50
-    }
43
+	/**
44
+	 * {@inheritDoc}
45
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface::module()
46
+	 */
47
+	public function module(): ModuleInterface
48
+	{
49
+		return $this->module;
50
+	}
51 51
 
52
-    /**
53
-     * {@inheritDoc}
54
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNamePrepend()
55
-     */
56
-    public function recordNamePrepend(GedcomRecord $record, bool $use_long = false, string $size = ''): string
57
-    {
58
-        return '';
59
-    }
52
+	/**
53
+	 * {@inheritDoc}
54
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNamePrepend()
55
+	 */
56
+	public function recordNamePrepend(GedcomRecord $record, bool $use_long = false, string $size = ''): string
57
+	{
58
+		return '';
59
+	}
60 60
 
61
-    /**
62
-     * {@inheritDoc}
63
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNameAppend()
64
-     */
65
-    public function recordNameAppend(GedcomRecord $record, bool $use_long = false, string $size = ''): string
66
-    {
67
-        if ($use_long && $record instanceof Individual) {
68
-            return view($this->module()->name() . '::hooks/name-append', [
69
-                'module_name'           =>  $this->module()->name(),
70
-                'source_status_service' =>  $this->source_status_service,
71
-                'individual'            =>  $record,
72
-                'size_style'            =>  $size
73
-            ]);
74
-        }
75
-        return '';
76
-    }
61
+	/**
62
+	 * {@inheritDoc}
63
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNameAppend()
64
+	 */
65
+	public function recordNameAppend(GedcomRecord $record, bool $use_long = false, string $size = ''): string
66
+	{
67
+		if ($use_long && $record instanceof Individual) {
68
+			return view($this->module()->name() . '::hooks/name-append', [
69
+				'module_name'           =>  $this->module()->name(),
70
+				'source_status_service' =>  $this->source_status_service,
71
+				'individual'            =>  $record,
72
+				'size_style'            =>  $size
73
+			]);
74
+		}
75
+		return '';
76
+	}
77 77
 }
Please login to merge, or discard this patch.
app/Module/IsSourced/IsSourcedModule.php 1 patch
Indentation   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -33,105 +33,105 @@
 block discarded – undo
33 33
  * IsSourced Module
34 34
  */
35 35
 class IsSourcedModule extends AbstractModule implements
36
-    ModuleMyArtJaubInterface,
37
-    ModuleGlobalInterface,
38
-    ModuleSidebarInterface,
39
-    ModuleHookSubscriberInterface
36
+	ModuleMyArtJaubInterface,
37
+	ModuleGlobalInterface,
38
+	ModuleSidebarInterface,
39
+	ModuleHookSubscriberInterface
40 40
 {
41
-    use ModuleMyArtJaubTrait;
42
-    use ModuleGlobalTrait;
43
-    use ModuleSidebarTrait;
41
+	use ModuleMyArtJaubTrait;
42
+	use ModuleGlobalTrait;
43
+	use ModuleSidebarTrait;
44 44
 
45
-    /**
46
-     * {@inheritDoc}
47
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::title()
48
-     */
49
-    public function title(): string
50
-    {
51
-        return I18N::translate('Sourced events');
52
-    }
45
+	/**
46
+	 * {@inheritDoc}
47
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::title()
48
+	 */
49
+	public function title(): string
50
+	{
51
+		return I18N::translate('Sourced events');
52
+	}
53 53
 
54
-    /**
55
-     * {@inheritDoc}
56
-     * @see \Fisharebest\Webtrees\Module\AbstractModule::description()
57
-     */
58
-    public function description(): string
59
-    {
60
-        return I18N::translate('Indicate if events related to an record are sourced.');
61
-    }
54
+	/**
55
+	 * {@inheritDoc}
56
+	 * @see \Fisharebest\Webtrees\Module\AbstractModule::description()
57
+	 */
58
+	public function description(): string
59
+	{
60
+		return I18N::translate('Indicate if events related to an record are sourced.');
61
+	}
62 62
 
63
-    /**
64
-     * {@inheritDoc}
65
-     * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion()
66
-     */
67
-    public function customModuleVersion(): string
68
-    {
69
-        return '2.1.6-v.1';
70
-    }
63
+	/**
64
+	 * {@inheritDoc}
65
+	 * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion()
66
+	 */
67
+	public function customModuleVersion(): string
68
+	{
69
+		return '2.1.6-v.1';
70
+	}
71 71
 
72
-    /**
73
-     * {@inheritDoc}
74
-     * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::headContent()
75
-     */
76
-    public function headContent(): string
77
-    {
78
-        return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">';
79
-    }
72
+	/**
73
+	 * {@inheritDoc}
74
+	 * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::headContent()
75
+	 */
76
+	public function headContent(): string
77
+	{
78
+		return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">';
79
+	}
80 80
 
81
-    /**
82
-     * {@inheritDoc}
83
-     * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::bodyContent()
84
-     */
85
-    public function bodyContent(): string
86
-    {
87
-        return '<script src="' . $this->assetUrl('js/issourced.min.js') . '"></script>';
88
-    }
81
+	/**
82
+	 * {@inheritDoc}
83
+	 * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::bodyContent()
84
+	 */
85
+	public function bodyContent(): string
86
+	{
87
+		return '<script src="' . $this->assetUrl('js/issourced.min.js') . '"></script>';
88
+	}
89 89
 
90
-    /**
91
-     * {@inheritDoc}
92
-     * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::hasSidebarContent()
93
-     */
94
-    public function hasSidebarContent(Individual $individual): bool
95
-    {
96
-        return true;
97
-    }
90
+	/**
91
+	 * {@inheritDoc}
92
+	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::hasSidebarContent()
93
+	 */
94
+	public function hasSidebarContent(Individual $individual): bool
95
+	{
96
+		return true;
97
+	}
98 98
 
99
-    /**
100
-     * {@inheritDoc}
101
-     * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::getSidebarContent()
102
-     */
103
-    public function getSidebarContent(Individual $individual): string
104
-    {
105
-        /** @var SourceStatusService $source_status_service */
106
-        $source_status_service = app(SourceStatusService::class);
99
+	/**
100
+	 * {@inheritDoc}
101
+	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::getSidebarContent()
102
+	 */
103
+	public function getSidebarContent(Individual $individual): string
104
+	{
105
+		/** @var SourceStatusService $source_status_service */
106
+		$source_status_service = app(SourceStatusService::class);
107 107
 
108
-        $spouse_families_status = $individual->spouseFamilies()->map(
109
-            function (Family $sfamily) use ($source_status_service): array {
110
-                return [ $sfamily, $source_status_service->sourceStatusForMarriage($sfamily)];
111
-            }
112
-        )->filter(function (array $item): bool {
113
-            return $item[1]->isSet();
114
-        });
108
+		$spouse_families_status = $individual->spouseFamilies()->map(
109
+			function (Family $sfamily) use ($source_status_service): array {
110
+				return [ $sfamily, $source_status_service->sourceStatusForMarriage($sfamily)];
111
+			}
112
+		)->filter(function (array $item): bool {
113
+			return $item[1]->isSet();
114
+		});
115 115
 
116
-        return view($this->name() . '::sidebar/content', [
117
-            'module_name'               => $this->name(),
118
-            'individual'                =>  $individual,
119
-            'source_status_individual'  =>  $source_status_service->sourceStatusForRecord($individual),
120
-            'source_status_birth'       =>  $source_status_service->sourceStatusForBirth($individual),
121
-            'source_status_marriages'   =>  $spouse_families_status,
122
-            'source_status_death'       =>  $source_status_service->sourceStatusForDeath($individual)
123
-        ]);
124
-    }
116
+		return view($this->name() . '::sidebar/content', [
117
+			'module_name'               => $this->name(),
118
+			'individual'                =>  $individual,
119
+			'source_status_individual'  =>  $source_status_service->sourceStatusForRecord($individual),
120
+			'source_status_birth'       =>  $source_status_service->sourceStatusForBirth($individual),
121
+			'source_status_marriages'   =>  $spouse_families_status,
122
+			'source_status_death'       =>  $source_status_service->sourceStatusForDeath($individual)
123
+		]);
124
+	}
125 125
 
126
-    /**
127
-     * {@inheritDoc}
128
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks()
129
-     */
130
-    public function listSubscribedHooks(): array
131
-    {
132
-        return [
133
-            app()->makeWith(IsSourcedStatusHook::class, [ 'module' => $this ]),
134
-            app()->makeWith(IsSourcedStatusColumnsHook::class, [ 'module' => $this ])
135
-        ];
136
-    }
126
+	/**
127
+	 * {@inheritDoc}
128
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks()
129
+	 */
130
+	public function listSubscribedHooks(): array
131
+	{
132
+		return [
133
+			app()->makeWith(IsSourcedStatusHook::class, [ 'module' => $this ]),
134
+			app()->makeWith(IsSourcedStatusColumnsHook::class, [ 'module' => $this ])
135
+		];
136
+	}
137 137
 }
Please login to merge, or discard this patch.
app/Common/Hooks/AbstractHookCollector.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -27,77 +27,77 @@
 block discarded – undo
27 27
  */
28 28
 abstract class AbstractHookCollector implements HookCollectorInterface, HookInterface
29 29
 {
30
-    /** @var Collection<int, array<THook>> $hooks */
31
-    protected Collection $hooks;
30
+	/** @var Collection<int, array<THook>> $hooks */
31
+	protected Collection $hooks;
32 32
 
33
-    private ModuleInterface $module;
33
+	private ModuleInterface $module;
34 34
 
35
-    /**
36
-     * Constructor for AbstractHookCollector
37
-     *
38
-     * @param ModuleInterface $module
39
-     */
40
-    public function __construct(ModuleInterface $module)
41
-    {
42
-        $this->hooks = new Collection();
43
-        $this->module = $module;
44
-    }
35
+	/**
36
+	 * Constructor for AbstractHookCollector
37
+	 *
38
+	 * @param ModuleInterface $module
39
+	 */
40
+	public function __construct(ModuleInterface $module)
41
+	{
42
+		$this->hooks = new Collection();
43
+		$this->module = $module;
44
+	}
45 45
 
46
-    /**
47
-     * {@inheritDoc}
48
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface::module()
49
-     */
50
-    public function module(): ModuleInterface
51
-    {
52
-        return $this->module;
53
-    }
46
+	/**
47
+	 * {@inheritDoc}
48
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface::module()
49
+	 */
50
+	public function module(): ModuleInterface
51
+	{
52
+		return $this->module;
53
+	}
54 54
 
55
-    /**
56
-     * {@inheritDoc}
57
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::name()
58
-     */
59
-    public function name(): string
60
-    {
61
-        return $this->module->name() . '-' .
62
-            mb_substr(str_replace('collector', '', mb_strtolower((new ReflectionClass($this))->getShortName())), 0, 64);
63
-    }
55
+	/**
56
+	 * {@inheritDoc}
57
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::name()
58
+	 */
59
+	public function name(): string
60
+	{
61
+		return $this->module->name() . '-' .
62
+			mb_substr(str_replace('collector', '', mb_strtolower((new ReflectionClass($this))->getShortName())), 0, 64);
63
+	}
64 64
 
65
-    /**
66
-     * {@inheritDoc}
67
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::title()
68
-     */
69
-    abstract public function title(): string;
65
+	/**
66
+	 * {@inheritDoc}
67
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::title()
68
+	 */
69
+	abstract public function title(): string;
70 70
 
71
-    /**
72
-     * {@inheritDoc}
73
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::description()
74
-     */
75
-    abstract public function description(): string;
71
+	/**
72
+	 * {@inheritDoc}
73
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::description()
74
+	 */
75
+	abstract public function description(): string;
76 76
 
77
-    /**
78
-     * {@inheritDoc}
79
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::hookInterface()
80
-     */
81
-    abstract public function hookInterface(): string;
77
+	/**
78
+	 * {@inheritDoc}
79
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::hookInterface()
80
+	 */
81
+	abstract public function hookInterface(): string;
82 82
 
83
-    /**
84
-     * {@inheritDoc}
85
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::register()
86
-     */
87
-    public function register(HookInterface $hook_instance, int $order): void
88
-    {
89
-        $this->hooks->put($order, [...$this->hooks->get($order, []), $hook_instance]);
90
-    }
83
+	/**
84
+	 * {@inheritDoc}
85
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::register()
86
+	 */
87
+	public function register(HookInterface $hook_instance, int $order): void
88
+	{
89
+		$this->hooks->put($order, [...$this->hooks->get($order, []), $hook_instance]);
90
+	}
91 91
 
92
-    /**
93
-     * {@inheritDoc}
94
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::hooks()
95
-     *
96
-     * @return Collection<THook>
97
-     */
98
-    public function hooks(): Collection
99
-    {
100
-        /** @var Collection<THook> */
101
-        return $this->hooks->sortKeys()->flatten();
102
-    }
92
+	/**
93
+	 * {@inheritDoc}
94
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookCollectorInterface::hooks()
95
+	 *
96
+	 * @return Collection<THook>
97
+	 */
98
+	public function hooks(): Collection
99
+	{
100
+		/** @var Collection<THook> */
101
+		return $this->hooks->sortKeys()->flatten();
102
+	}
103 103
 }
Please login to merge, or discard this patch.
app/Common/GeoDispersion/Config/GenericPlaceMapperConfig.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -25,106 +25,106 @@
 block discarded – undo
25 25
  */
26 26
 class GenericPlaceMapperConfig implements PlaceMapperConfigInterface
27 27
 {
28
-    /** @var array<string, mixed> $config */
29
-    private array $config = [];
28
+	/** @var array<string, mixed> $config */
29
+	private array $config = [];
30 30
 
31
-    /**
32
-     * Get the generic mapper's config
33
-     *
34
-     * @return array<string, mixed>
35
-     */
36
-    public function config(): array
37
-    {
38
-        return $this->config;
39
-    }
31
+	/**
32
+	 * Get the generic mapper's config
33
+	 *
34
+	 * @return array<string, mixed>
35
+	 */
36
+	public function config(): array
37
+	{
38
+		return $this->config;
39
+	}
40 40
 
41
-    /**
42
-     * Set the generic mapper's config
43
-     *
44
-     * @param array<string, mixed> $config
45
-     * @return $this
46
-     */
47
-    public function setConfig(array $config): self
48
-    {
49
-        $this->config = $config;
50
-        return $this;
51
-    }
41
+	/**
42
+	 * Set the generic mapper's config
43
+	 *
44
+	 * @param array<string, mixed> $config
45
+	 * @return $this
46
+	 */
47
+	public function setConfig(array $config): self
48
+	{
49
+		$this->config = $config;
50
+		return $this;
51
+	}
52 52
 
53
-    /**
54
-     * {@inheritDoc}
55
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::get()
56
-     */
57
-    public function get(string $key, $default = null)
58
-    {
59
-        return $this->config[$key] ?? $default;
60
-    }
53
+	/**
54
+	 * {@inheritDoc}
55
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::get()
56
+	 */
57
+	public function get(string $key, $default = null)
58
+	{
59
+		return $this->config[$key] ?? $default;
60
+	}
61 61
 
62
-    /**
63
-     * {@inheritDoc}
64
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::has()
65
-     */
66
-    public function has(string $key): bool
67
-    {
68
-        return key_exists($key, $this->config);
69
-    }
62
+	/**
63
+	 * {@inheritDoc}
64
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::has()
65
+	 */
66
+	public function has(string $key): bool
67
+	{
68
+		return key_exists($key, $this->config);
69
+	}
70 70
 
71
-    /**
72
-     * {@inheritDoc}
73
-     * @see \JsonSerializable::jsonSerialize()
74
-     */
75
-    #[\ReturnTypeWillChange]
76
-    public function jsonSerialize()
77
-    {
78
-        return [
79
-            'class'     =>  get_class($this),
80
-            'config'    =>  $this->jsonSerializeConfig()
81
-        ];
82
-    }
71
+	/**
72
+	 * {@inheritDoc}
73
+	 * @see \JsonSerializable::jsonSerialize()
74
+	 */
75
+	#[\ReturnTypeWillChange]
76
+	public function jsonSerialize()
77
+	{
78
+		return [
79
+			'class'     =>  get_class($this),
80
+			'config'    =>  $this->jsonSerializeConfig()
81
+		];
82
+	}
83 83
 
84
-    /**
85
-     * Returns a representation of the mapper config compatible with Json serialisation
86
-     *
87
-     * @return mixed
88
-     */
89
-    public function jsonSerializeConfig()
90
-    {
91
-        return $this->config;
92
-    }
84
+	/**
85
+	 * Returns a representation of the mapper config compatible with Json serialisation
86
+	 *
87
+	 * @return mixed
88
+	 */
89
+	public function jsonSerializeConfig()
90
+	{
91
+		return $this->config;
92
+	}
93 93
 
94
-    /**
95
-     * {@inheritDoc}
96
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::jsonDeserialize()
97
-     *
98
-     * @param mixed $config
99
-     * @return $this
100
-     */
101
-    public function jsonDeserialize($config): self
102
-    {
103
-        if (is_string($config)) {
104
-            return $this->jsonDeserialize((array) json_decode($config));
105
-        }
106
-        if (is_array($config)) {
107
-            return $this->setConfig($config);
108
-        }
109
-        return $this;
110
-    }
94
+	/**
95
+	 * {@inheritDoc}
96
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::jsonDeserialize()
97
+	 *
98
+	 * @param mixed $config
99
+	 * @return $this
100
+	 */
101
+	public function jsonDeserialize($config): self
102
+	{
103
+		if (is_string($config)) {
104
+			return $this->jsonDeserialize((array) json_decode($config));
105
+		}
106
+		if (is_array($config)) {
107
+			return $this->setConfig($config);
108
+		}
109
+		return $this;
110
+	}
111 111
 
112
-    /**
113
-     * {@inheritDoc}
114
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::configContent()
115
-     */
116
-    public function configContent(ModuleInterface $module, Tree $tree): string
117
-    {
118
-        return '';
119
-    }
112
+	/**
113
+	 * {@inheritDoc}
114
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::configContent()
115
+	 */
116
+	public function configContent(ModuleInterface $module, Tree $tree): string
117
+	{
118
+		return '';
119
+	}
120 120
 
121
-    /**
122
-     * {@inheritDoc}
123
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::withConfigUpdate()
124
-     * @return $this
125
-     */
126
-    public function withConfigUpdate(ServerRequestInterface $request): self
127
-    {
128
-        return $this;
129
-    }
121
+	/**
122
+	 * {@inheritDoc}
123
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::withConfigUpdate()
124
+	 * @return $this
125
+	 */
126
+	public function withConfigUpdate(ServerRequestInterface $request): self
127
+	{
128
+		return $this;
129
+	}
130 130
 }
Please login to merge, or discard this patch.
app/Common/GeoDispersion/Config/NullPlaceMapperConfig.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -26,62 +26,62 @@
 block discarded – undo
26 26
  */
27 27
 class NullPlaceMapperConfig implements PlaceMapperConfigInterface
28 28
 {
29
-    /**
30
-     * {@inheritDoc}
31
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::get()
32
-     */
33
-    public function get(string $key, $default = null)
34
-    {
35
-        return $default;
36
-    }
29
+	/**
30
+	 * {@inheritDoc}
31
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::get()
32
+	 */
33
+	public function get(string $key, $default = null)
34
+	{
35
+		return $default;
36
+	}
37 37
 
38
-    /**
39
-     * {@inheritDoc}
40
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::has()
41
-     */
42
-    public function has(string $key): bool
43
-    {
44
-        return false;
45
-    }
38
+	/**
39
+	 * {@inheritDoc}
40
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::has()
41
+	 */
42
+	public function has(string $key): bool
43
+	{
44
+		return false;
45
+	}
46 46
 
47
-    /**
48
-     * {@inheritDoc}
49
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::jsonDeserialize()
50
-     *
51
-     * @param mixed $config
52
-     * @return $this
53
-     */
54
-    public function jsonDeserialize($config): self
55
-    {
56
-        return $this;
57
-    }
47
+	/**
48
+	 * {@inheritDoc}
49
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::jsonDeserialize()
50
+	 *
51
+	 * @param mixed $config
52
+	 * @return $this
53
+	 */
54
+	public function jsonDeserialize($config): self
55
+	{
56
+		return $this;
57
+	}
58 58
 
59
-    /**
60
-     * {@inheritDoc}
61
-     * @see JsonSerializable::jsonSerialize()
62
-     */
63
-    #[\ReturnTypeWillChange]
64
-    public function jsonSerialize()
65
-    {
66
-        return [];
67
-    }
59
+	/**
60
+	 * {@inheritDoc}
61
+	 * @see JsonSerializable::jsonSerialize()
62
+	 */
63
+	#[\ReturnTypeWillChange]
64
+	public function jsonSerialize()
65
+	{
66
+		return [];
67
+	}
68 68
 
69
-    /**
70
-     * {@inheritDoc}
71
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::configContent()
72
-     */
73
-    public function configContent(ModuleInterface $module, Tree $tree): string
74
-    {
75
-        return '';
76
-    }
69
+	/**
70
+	 * {@inheritDoc}
71
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::configContent()
72
+	 */
73
+	public function configContent(ModuleInterface $module, Tree $tree): string
74
+	{
75
+		return '';
76
+	}
77 77
 
78
-    /**
79
-     * {@inheritDoc}
80
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::withConfigUpdate()
81
-     * @return $this
82
-     */
83
-    public function withConfigUpdate(ServerRequestInterface $request): self
84
-    {
85
-        return $this;
86
-    }
78
+	/**
79
+	 * {@inheritDoc}
80
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperConfigInterface::withConfigUpdate()
81
+	 * @return $this
82
+	 */
83
+	public function withConfigUpdate(ServerRequestInterface $request): self
84
+	{
85
+		return $this;
86
+	}
87 87
 }
Please login to merge, or discard this patch.
app/Common/GeoDispersion/Config/MapColorsConfig.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -23,93 +23,93 @@
 block discarded – undo
23 23
  */
24 24
 class MapColorsConfig implements JsonSerializable
25 25
 {
26
-    private Color $default;
27
-    private Color $stroke;
28
-    private Color $max_value;
29
-    private Color $hover;
26
+	private Color $default;
27
+	private Color $stroke;
28
+	private Color $max_value;
29
+	private Color $hover;
30 30
 
31
-    /**
32
-     * Constructor for MapColorsConfig
33
-     *
34
-     * @param Color $default
35
-     * @param Color $stroke
36
-     * @param Color $max_value
37
-     * @param Color $hover
38
-     */
39
-    public function __construct(
40
-        Color $default,
41
-        Color $stroke,
42
-        Color $max_value,
43
-        Color $hover
44
-    ) {
45
-        $this->default = $default;
46
-        $this->stroke = $stroke;
47
-        $this->max_value = $max_value;
48
-        $this->hover = $hover;
49
-    }
31
+	/**
32
+	 * Constructor for MapColorsConfig
33
+	 *
34
+	 * @param Color $default
35
+	 * @param Color $stroke
36
+	 * @param Color $max_value
37
+	 * @param Color $hover
38
+	 */
39
+	public function __construct(
40
+		Color $default,
41
+		Color $stroke,
42
+		Color $max_value,
43
+		Color $hover
44
+	) {
45
+		$this->default = $default;
46
+		$this->stroke = $stroke;
47
+		$this->max_value = $max_value;
48
+		$this->hover = $hover;
49
+	}
50 50
 
51
-    /**
52
-     * Get the default color for the features
53
-     *
54
-     * @return Color
55
-     */
56
-    public function defaultColor(): Color
57
-    {
58
-        return $this->default;
59
-    }
51
+	/**
52
+	 * Get the default color for the features
53
+	 *
54
+	 * @return Color
55
+	 */
56
+	public function defaultColor(): Color
57
+	{
58
+		return $this->default;
59
+	}
60 60
 
61
-    /**
62
-     * Get the color for the features' strokes
63
-     *
64
-     * @return Color
65
-     */
66
-    public function strokeColor(): Color
67
-    {
68
-        return $this->stroke;
69
-    }
61
+	/**
62
+	 * Get the color for the features' strokes
63
+	 *
64
+	 * @return Color
65
+	 */
66
+	public function strokeColor(): Color
67
+	{
68
+		return $this->stroke;
69
+	}
70 70
 
71
-    /**
72
-     * Get the color for the features with the lowest count
73
-     *
74
-     * @return Color
75
-     */
76
-    public function minValueColor(): Color
77
-    {
78
-        return new Rgb(255, 255, 255);
79
-    }
71
+	/**
72
+	 * Get the color for the features with the lowest count
73
+	 *
74
+	 * @return Color
75
+	 */
76
+	public function minValueColor(): Color
77
+	{
78
+		return new Rgb(255, 255, 255);
79
+	}
80 80
 
81
-    /**
82
-     * Get the color for the features with the highest count
83
-     *
84
-     * @return Color
85
-     */
86
-    public function maxValueColor(): Color
87
-    {
88
-        return $this->max_value;
89
-    }
81
+	/**
82
+	 * Get the color for the features with the highest count
83
+	 *
84
+	 * @return Color
85
+	 */
86
+	public function maxValueColor(): Color
87
+	{
88
+		return $this->max_value;
89
+	}
90 90
 
91
-    /**
92
-     * Get the color for feature hovering
93
-     *
94
-     * @return Color
95
-     */
96
-    public function hoverColor(): Color
97
-    {
98
-        return $this->hover;
99
-    }
91
+	/**
92
+	 * Get the color for feature hovering
93
+	 *
94
+	 * @return Color
95
+	 */
96
+	public function hoverColor(): Color
97
+	{
98
+		return $this->hover;
99
+	}
100 100
 
101
-    /**
102
-     * {@inheritDoc}
103
-     * @see JsonSerializable::jsonSerialize()
104
-     */
105
-    #[\ReturnTypeWillChange]
106
-    public function jsonSerialize()
107
-    {
108
-        return [
109
-            'default'   => (string) $this->defaultColor()->toHex(),
110
-            'stroke'    => (string) $this->strokeColor()->toHex(),
111
-            'maxvalue'  => (string) $this->maxValueColor()->toHex(),
112
-            'hover'     => (string) $this->hoverColor()->toHex(),
113
-        ];
114
-    }
101
+	/**
102
+	 * {@inheritDoc}
103
+	 * @see JsonSerializable::jsonSerialize()
104
+	 */
105
+	#[\ReturnTypeWillChange]
106
+	public function jsonSerialize()
107
+	{
108
+		return [
109
+			'default'   => (string) $this->defaultColor()->toHex(),
110
+			'stroke'    => (string) $this->strokeColor()->toHex(),
111
+			'maxvalue'  => (string) $this->maxValueColor()->toHex(),
112
+			'hover'     => (string) $this->hoverColor()->toHex(),
113
+		];
114
+	}
115 115
 }
Please login to merge, or discard this patch.