Passed
Push — main ( c808ff...64cea5 )
by Jonathan
03:30
created
app/Module/GeoDispersion/Services/GeoAnalysisService.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -25,41 +25,41 @@
 block discarded – undo
25 25
  */
26 26
 class GeoAnalysisService
27 27
 {
28
-    private ModuleService $module_service;
28
+	private ModuleService $module_service;
29 29
 
30
-    /**
31
-     * Constructor for MapDefinitionsService
32
-     *
33
-     * @param ModuleService $module_service
34
-     */
35
-    public function __construct(ModuleService $module_service)
36
-    {
37
-        $this->module_service = $module_service;
38
-    }
30
+	/**
31
+	 * Constructor for MapDefinitionsService
32
+	 *
33
+	 * @param ModuleService $module_service
34
+	 */
35
+	public function __construct(ModuleService $module_service)
36
+	{
37
+		$this->module_service = $module_service;
38
+	}
39 39
 
40
-    /**
41
-     * Get all available geographical dispersion analyses.
42
-     *
43
-     * {@internal The list is generated based on the modules exposing ModuleGeoAnalysisProviderInterface
44
-     *
45
-     * @param bool $include_disabled
46
-     * @return Collection<GeoAnalysisInterface>
47
-     */
48
-    public function all(bool $include_disabled = false): Collection
49
-    {
50
-        /** @var Collection<GeoAnalysisInterface> $geoanalyses */
51
-        $geoanalyses = $this->module_service
52
-            ->findByInterface(ModuleGeoAnalysisProviderInterface::class, $include_disabled)
53
-            ->flatMap(fn(ModuleGeoAnalysisProviderInterface $module) => $module->listGeoAnalyses())
54
-            ->map(static function (string $analysis_class): ?GeoAnalysisInterface {
55
-                try {
56
-                    $analysis = app($analysis_class);
57
-                    return $analysis instanceof GeoAnalysisInterface ? $analysis : null;
58
-                } catch (BindingResolutionException $ex) {
59
-                    return null;
60
-                }
61
-            })->filter();
40
+	/**
41
+	 * Get all available geographical dispersion analyses.
42
+	 *
43
+	 * {@internal The list is generated based on the modules exposing ModuleGeoAnalysisProviderInterface
44
+	 *
45
+	 * @param bool $include_disabled
46
+	 * @return Collection<GeoAnalysisInterface>
47
+	 */
48
+	public function all(bool $include_disabled = false): Collection
49
+	{
50
+		/** @var Collection<GeoAnalysisInterface> $geoanalyses */
51
+		$geoanalyses = $this->module_service
52
+			->findByInterface(ModuleGeoAnalysisProviderInterface::class, $include_disabled)
53
+			->flatMap(fn(ModuleGeoAnalysisProviderInterface $module) => $module->listGeoAnalyses())
54
+			->map(static function (string $analysis_class): ?GeoAnalysisInterface {
55
+				try {
56
+					$analysis = app($analysis_class);
57
+					return $analysis instanceof GeoAnalysisInterface ? $analysis : null;
58
+				} catch (BindingResolutionException $ex) {
59
+					return null;
60
+				}
61
+			})->filter();
62 62
 
63
-        return $geoanalyses;
64
-    }
63
+		return $geoanalyses;
64
+	}
65 65
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Services/PlaceMapperService.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -25,41 +25,41 @@
 block discarded – undo
25 25
  */
26 26
 class PlaceMapperService
27 27
 {
28
-    private ModuleService $module_service;
28
+	private ModuleService $module_service;
29 29
 
30
-    /**
31
-     * Constructor for PlaceMapperService
32
-     *
33
-     * @param ModuleService $module_service
34
-     */
35
-    public function __construct(ModuleService $module_service)
36
-    {
37
-        $this->module_service = $module_service;
38
-    }
30
+	/**
31
+	 * Constructor for PlaceMapperService
32
+	 *
33
+	 * @param ModuleService $module_service
34
+	 */
35
+	public function __construct(ModuleService $module_service)
36
+	{
37
+		$this->module_service = $module_service;
38
+	}
39 39
 
40
-    /**
41
-     * Get all place mappers available.
42
-     *
43
-     * {@internal The list is generated based on the modules exposing ModulePlaceMapperProviderInterface}
44
-     *
45
-     * @param bool $include_disabled
46
-     * @return Collection<PlaceMapperInterface>
47
-     */
48
-    public function all(bool $include_disabled = false): Collection
49
-    {
50
-        /** @var Collection<PlaceMapperInterface> $place_mappers */
51
-        $place_mappers =  $this->module_service
52
-            ->findByInterface(ModulePlaceMapperProviderInterface::class, $include_disabled)
53
-            ->flatMap(fn(ModulePlaceMapperProviderInterface $module) => $module->listPlaceMappers())
54
-            ->map(static function (string $mapper_class): ?PlaceMapperInterface {
55
-                try {
56
-                    $mapper = app($mapper_class);
57
-                    return $mapper instanceof PlaceMapperInterface ? $mapper : null;
58
-                } catch (BindingResolutionException $ex) {
59
-                    return null;
60
-                }
61
-            })->filter();
40
+	/**
41
+	 * Get all place mappers available.
42
+	 *
43
+	 * {@internal The list is generated based on the modules exposing ModulePlaceMapperProviderInterface}
44
+	 *
45
+	 * @param bool $include_disabled
46
+	 * @return Collection<PlaceMapperInterface>
47
+	 */
48
+	public function all(bool $include_disabled = false): Collection
49
+	{
50
+		/** @var Collection<PlaceMapperInterface> $place_mappers */
51
+		$place_mappers =  $this->module_service
52
+			->findByInterface(ModulePlaceMapperProviderInterface::class, $include_disabled)
53
+			->flatMap(fn(ModulePlaceMapperProviderInterface $module) => $module->listPlaceMappers())
54
+			->map(static function (string $mapper_class): ?PlaceMapperInterface {
55
+				try {
56
+					$mapper = app($mapper_class);
57
+					return $mapper instanceof PlaceMapperInterface ? $mapper : null;
58
+				} catch (BindingResolutionException $ex) {
59
+					return null;
60
+				}
61
+			})->filter();
62 62
 
63
-        return $place_mappers;
64
-    }
63
+		return $place_mappers;
64
+	}
65 65
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/PlaceMappers/PlaceMapperTrait.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -24,67 +24,67 @@
 block discarded – undo
24 24
  */
25 25
 trait PlaceMapperTrait
26 26
 {
27
-    private ?PlaceMapperConfigInterface $config = null;
27
+	private ?PlaceMapperConfigInterface $config = null;
28 28
 
29
-    /** @var array<string, mixed> $data */
30
-    private array $data = [];
29
+	/** @var array<string, mixed> $data */
30
+	private array $data = [];
31 31
 
32
-    /**
33
-     * Implementation of PlaceMapperInterface::boot
34
-     *
35
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::boot()
36
-     */
37
-    public function boot(): void
38
-    {
39
-    }
32
+	/**
33
+	 * Implementation of PlaceMapperInterface::boot
34
+	 *
35
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::boot()
36
+	 */
37
+	public function boot(): void
38
+	{
39
+	}
40 40
 
41
-    /**
42
-     * Implementation of PlaceMapperInterface::config
43
-     *
44
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::config()
45
-     *
46
-     * @return PlaceMapperConfigInterface
47
-     */
48
-    public function config(): PlaceMapperConfigInterface
49
-    {
50
-        return $this->config ?? new NullPlaceMapperConfig();
51
-    }
41
+	/**
42
+	 * Implementation of PlaceMapperInterface::config
43
+	 *
44
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::config()
45
+	 *
46
+	 * @return PlaceMapperConfigInterface
47
+	 */
48
+	public function config(): PlaceMapperConfigInterface
49
+	{
50
+		return $this->config ?? new NullPlaceMapperConfig();
51
+	}
52 52
 
53
-    /**
54
-     * Implementation of PlaceMapperInterface::setConfig
55
-     *
56
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::setConfig()
57
-     *
58
-     * @param PlaceMapperConfigInterface $config
59
-     */
60
-    public function setConfig(PlaceMapperConfigInterface $config): void
61
-    {
62
-        $this->config = $config;
63
-    }
53
+	/**
54
+	 * Implementation of PlaceMapperInterface::setConfig
55
+	 *
56
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::setConfig()
57
+	 *
58
+	 * @param PlaceMapperConfigInterface $config
59
+	 */
60
+	public function setConfig(PlaceMapperConfigInterface $config): void
61
+	{
62
+		$this->config = $config;
63
+	}
64 64
 
65
-    /**
66
-     * Implementation of PlaceMapperInterface::data
67
-     *
68
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::data()
69
-     *
70
-     * @param string $key
71
-     * @return NULL|mixed
72
-     */
73
-    public function data(string $key)
74
-    {
75
-        return $this->data[$key] ?? null;
76
-    }
65
+	/**
66
+	 * Implementation of PlaceMapperInterface::data
67
+	 *
68
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::data()
69
+	 *
70
+	 * @param string $key
71
+	 * @return NULL|mixed
72
+	 */
73
+	public function data(string $key)
74
+	{
75
+		return $this->data[$key] ?? null;
76
+	}
77 77
 
78
-    /**
79
-     * Implementation of PlaceMapperInterface::setData
80
-     *
81
-     * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::setData()
82
-     *
83
-     * @param string $key
84
-     * @param mixed|null $data
85
-     */
86
-    public function setData(string $key, $data): void
87
-    {
88
-        $this->data[$key] = $data;
89
-    }
78
+	/**
79
+	 * Implementation of PlaceMapperInterface::setData
80
+	 *
81
+	 * @see \MyArtJaub\Webtrees\Contracts\GeoDispersion\PlaceMapperInterface::setData()
82
+	 *
83
+	 * @param string $key
84
+	 * @param mixed|null $data
85
+	 */
86
+	public function setData(string $key, $data): void
87
+	{
88
+		$this->data[$key] = $data;
89
+	}
90 90
 }
Please login to merge, or discard this patch.
app/Common/GeoDispersion/GeoAnalysis/GeoAnalysisResults.php 1 patch
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -23,104 +23,104 @@
 block discarded – undo
23 23
  */
24 24
 class GeoAnalysisResults
25 25
 {
26
-    private GeoAnalysisResult $global;
26
+	private GeoAnalysisResult $global;
27 27
 
28
-    /**
29
-     * @var Collection<string, GeoAnalysisResult> $detailed
30
-     */
31
-    private Collection $detailed;
28
+	/**
29
+	 * @var Collection<string, GeoAnalysisResult> $detailed
30
+	 */
31
+	private Collection $detailed;
32 32
 
33
-    /**
34
-     * Constructor for GeoAnalysisResults
35
-     */
36
-    public function __construct()
37
-    {
38
-        $this->global = new GeoAnalysisResult('Global', 0);
39
-        $this->detailed = new Collection();
40
-    }
33
+	/**
34
+	 * Constructor for GeoAnalysisResults
35
+	 */
36
+	public function __construct()
37
+	{
38
+		$this->global = new GeoAnalysisResult('Global', 0);
39
+		$this->detailed = new Collection();
40
+	}
41 41
 
42
-    /**
43
-     * Global result of the geographical analysis
44
-     *
45
-     * @return GeoAnalysisResult
46
-     */
47
-    public function global(): GeoAnalysisResult
48
-    {
49
-        return $this->global;
50
-    }
42
+	/**
43
+	 * Global result of the geographical analysis
44
+	 *
45
+	 * @return GeoAnalysisResult
46
+	 */
47
+	public function global(): GeoAnalysisResult
48
+	{
49
+		return $this->global;
50
+	}
51 51
 
52
-    /**
53
-     * List of results by category of the geographical analysis
54
-     *
55
-     * @return Collection<string, GeoAnalysisResult>
56
-     */
57
-    public function detailed(): Collection
58
-    {
59
-        return $this->detailed;
60
-    }
52
+	/**
53
+	 * List of results by category of the geographical analysis
54
+	 *
55
+	 * @return Collection<string, GeoAnalysisResult>
56
+	 */
57
+	public function detailed(): Collection
58
+	{
59
+		return $this->detailed;
60
+	}
61 61
 
62
-    /**
63
-     * List of results by category of the geographical analysis.
64
-     * The list is sorted first by the category order, then by the category description
65
-     *
66
-     * @return Collection<string, GeoAnalysisResult>
67
-     */
68
-    public function sortedDetailed(): Collection
69
-    {
70
-        return $this->detailed->sortBy([
71
-            fn(GeoAnalysisResult $a, GeoAnalysisResult $b): int => $a->order() <=> $b->order(),
72
-            fn(GeoAnalysisResult $a, GeoAnalysisResult $b): int =>
73
-                I18N::comparator()($a->description(), $b->description())
74
-        ]);
75
-    }
62
+	/**
63
+	 * List of results by category of the geographical analysis.
64
+	 * The list is sorted first by the category order, then by the category description
65
+	 *
66
+	 * @return Collection<string, GeoAnalysisResult>
67
+	 */
68
+	public function sortedDetailed(): Collection
69
+	{
70
+		return $this->detailed->sortBy([
71
+			fn(GeoAnalysisResult $a, GeoAnalysisResult $b): int => $a->order() <=> $b->order(),
72
+			fn(GeoAnalysisResult $a, GeoAnalysisResult $b): int =>
73
+				I18N::comparator()($a->description(), $b->description())
74
+		]);
75
+	}
76 76
 
77
-    /**
78
-     * Add a GeoAnalysis Place to the global result
79
-     *
80
-     * @param GeoAnalysisPlace $place
81
-     */
82
-    public function addPlace(GeoAnalysisPlace $place): void
83
-    {
84
-        $this->global()->addPlace($place);
85
-    }
77
+	/**
78
+	 * Add a GeoAnalysis Place to the global result
79
+	 *
80
+	 * @param GeoAnalysisPlace $place
81
+	 */
82
+	public function addPlace(GeoAnalysisPlace $place): void
83
+	{
84
+		$this->global()->addPlace($place);
85
+	}
86 86
 
87
-    /**
88
-     * Add a new category to the list of results, if it does not exist yet
89
-     *
90
-     * @param string $description
91
-     * @param int $order
92
-     */
93
-    public function addCategory(string $description, int $order): void
94
-    {
95
-        if (!$this->detailed->has($description)) {
96
-            $this->detailed->put($description, new GeoAnalysisResult($description, $order));
97
-        }
98
-    }
87
+	/**
88
+	 * Add a new category to the list of results, if it does not exist yet
89
+	 *
90
+	 * @param string $description
91
+	 * @param int $order
92
+	 */
93
+	public function addCategory(string $description, int $order): void
94
+	{
95
+		if (!$this->detailed->has($description)) {
96
+			$this->detailed->put($description, new GeoAnalysisResult($description, $order));
97
+		}
98
+	}
99 99
 
100
-    /**
101
-     * Add a GeoAnalysis Place to a category result, if the category exist.
102
-     *
103
-     * @param string $category_name
104
-     * @param GeoAnalysisPlace $place
105
-     */
106
-    public function addPlaceInCreatedCategory(string $category_name, GeoAnalysisPlace $place): void
107
-    {
108
-        if ($this->detailed->has($category_name)) {
109
-            $this->detailed->get($category_name)->addPlace($place);
110
-        }
111
-    }
100
+	/**
101
+	 * Add a GeoAnalysis Place to a category result, if the category exist.
102
+	 *
103
+	 * @param string $category_name
104
+	 * @param GeoAnalysisPlace $place
105
+	 */
106
+	public function addPlaceInCreatedCategory(string $category_name, GeoAnalysisPlace $place): void
107
+	{
108
+		if ($this->detailed->has($category_name)) {
109
+			$this->detailed->get($category_name)->addPlace($place);
110
+		}
111
+	}
112 112
 
113
-    /**
114
-     * Add a GeoAnalysis Place to a category result, after creating the category if it does not exist.
115
-     *
116
-     * @param string $category_name
117
-     * @param GeoAnalysisPlace $place
118
-     */
119
-    public function addPlaceInCategory(string $category_name, int $category_order, GeoAnalysisPlace $place): void
120
-    {
121
-        if (!$this->detailed->has($category_name)) {
122
-            $this->addCategory($category_name, $category_order);
123
-        }
124
-        $this->addPlaceInCreatedCategory($category_name, $place);
125
-    }
113
+	/**
114
+	 * Add a GeoAnalysis Place to a category result, after creating the category if it does not exist.
115
+	 *
116
+	 * @param string $category_name
117
+	 * @param GeoAnalysisPlace $place
118
+	 */
119
+	public function addPlaceInCategory(string $category_name, int $category_order, GeoAnalysisPlace $place): void
120
+	{
121
+		if (!$this->detailed->has($category_name)) {
122
+			$this->addCategory($category_name, $category_order);
123
+		}
124
+		$this->addPlaceInCreatedCategory($category_name, $place);
125
+	}
126 126
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Views/GeoAnalysisTable.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -22,51 +22,51 @@
 block discarded – undo
22 22
 
23 23
 class GeoAnalysisTable extends AbstractGeoAnalysisView
24 24
 {
25
-    /**
26
-     * {@inheritDoc}
27
-     * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::type()
28
-     */
29
-    public function type(): string
30
-    {
31
-        return I18N::translateContext('GEODISPERSION', 'Table');
32
-    }
25
+	/**
26
+	 * {@inheritDoc}
27
+	 * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::type()
28
+	 */
29
+	public function type(): string
30
+	{
31
+		return I18N::translateContext('GEODISPERSION', 'Table');
32
+	}
33 33
 
34
-    /**
35
-     * {@inheritDoc}
36
-     * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::icon()
37
-     */
38
-    public function icon(ModuleInterface $module): string
39
-    {
40
-        return view($module->name() . '::icons/view-table', ['type' => $this->type()]);
41
-    }
34
+	/**
35
+	 * {@inheritDoc}
36
+	 * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::icon()
37
+	 */
38
+	public function icon(ModuleInterface $module): string
39
+	{
40
+		return view($module->name() . '::icons/view-table', ['type' => $this->type()]);
41
+	}
42 42
 
43
-    /**
44
-     * {@inheritDoc}
45
-     * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::globalSettingsContent()
46
-     */
47
-    public function globalSettingsContent(ModuleInterface $module): string
48
-    {
49
-        return '';
50
-    }
43
+	/**
44
+	 * {@inheritDoc}
45
+	 * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::globalSettingsContent()
46
+	 */
47
+	public function globalSettingsContent(ModuleInterface $module): string
48
+	{
49
+		return '';
50
+	}
51 51
 
52
-    /**
53
-     * {@inheritDoc}
54
-     * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::withGlobalSettingsUpdate()
55
-     * @return $this
56
-     */
57
-    public function withGlobalSettingsUpdate(ServerRequestInterface $request): self
58
-    {
59
-        return $this;
60
-    }
52
+	/**
53
+	 * {@inheritDoc}
54
+	 * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::withGlobalSettingsUpdate()
55
+	 * @return $this
56
+	 */
57
+	public function withGlobalSettingsUpdate(ServerRequestInterface $request): self
58
+	{
59
+		return $this;
60
+	}
61 61
 
62
-    /**
63
-     * {@inheritDoc}
64
-     * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::globalTabContent()
65
-     */
66
-    public function globalTabContent(GeoDispersionModule $module, GeoAnalysisResult $result, array $params): string
67
-    {
68
-        return view($module->name() . '::geoanalysisview-tab-glb-table', $params + [
69
-            'result'    =>  $result
70
-        ]);
71
-    }
62
+	/**
63
+	 * {@inheritDoc}
64
+	 * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisView::globalTabContent()
65
+	 */
66
+	public function globalTabContent(GeoDispersionModule $module, GeoAnalysisResult $result, array $params): string
67
+	{
68
+		return view($module->name() . '::geoanalysisview-tab-glb-table', $params + [
69
+			'result'    =>  $result
70
+		]);
71
+	}
72 72
 }
Please login to merge, or discard this patch.
app/Module/GeoDispersion/Views/AbstractGeoAnalysisView.php 1 patch
Indentation   +220 added lines, -220 removed lines patch added patch discarded remove patch
@@ -27,224 +27,224 @@
 block discarded – undo
27 27
  */
28 28
 abstract class AbstractGeoAnalysisView
29 29
 {
30
-    private int $id;
31
-    private Tree $tree;
32
-    private bool $enabled;
33
-    private string $description;
34
-    private GeoAnalysisInterface $geoanalysis;
35
-    private int $depth;
36
-    private int $detailed_top_places;
37
-    private bool $use_flags;
38
-
39
-    /**
40
-     * Constructor for AbstractGeoAnalysisView
41
-     *
42
-     * @param int $id
43
-     * @param Tree $tree
44
-     * @param bool $enabled
45
-     * @param string $description
46
-     * @param GeoAnalysisInterface $geoanalysis
47
-     * @param int $depth
48
-     * @param int $detailed_top_places
49
-     * @param bool $use_flags
50
-     */
51
-    final public function __construct(
52
-        int $id,
53
-        Tree $tree,
54
-        bool $enabled,
55
-        string $description,
56
-        GeoAnalysisInterface $geoanalysis,
57
-        int $depth,
58
-        int $detailed_top_places = 0,
59
-        bool $use_flags = false
60
-    ) {
61
-        $this->id = $id;
62
-        $this->tree = $tree;
63
-        $this->enabled = $enabled;
64
-        $this->description = $description;
65
-        $this->geoanalysis = $geoanalysis;
66
-        $this->depth = $depth;
67
-        $this->detailed_top_places = $detailed_top_places;
68
-        $this->use_flags = $use_flags;
69
-    }
70
-
71
-    /**
72
-     * Create a copy of the view with a new ID.
73
-     *
74
-     * @param int $id
75
-     * @return static
76
-     */
77
-    public function withId(int $id): self
78
-    {
79
-        $new = clone $this;
80
-        $new->id = $id;
81
-        return $new;
82
-    }
83
-
84
-    /**
85
-     * Create a copy of the view with new properties.
86
-     *
87
-     * @param bool $enabled
88
-     * @param string $description
89
-     * @param GeoAnalysisInterface $geoanalysis
90
-     * @param int $depth
91
-     * @param int $detailed_top_places
92
-     * @param bool $use_flags
93
-     * @return static
94
-     */
95
-    public function with(
96
-        bool $enabled,
97
-        string $description,
98
-        GeoAnalysisInterface $geoanalysis,
99
-        int $depth,
100
-        int $detailed_top_places = 0,
101
-        bool $use_flags = false
102
-    ): self {
103
-        $new = clone $this;
104
-        $new->enabled = $enabled;
105
-        $new->description = $description;
106
-        $new->geoanalysis = $geoanalysis;
107
-        $new->depth = $depth;
108
-        $new->detailed_top_places = $detailed_top_places;
109
-        $new->use_flags = $use_flags;
110
-        return $new;
111
-    }
112
-
113
-    /**
114
-     * Get the view ID
115
-     *
116
-     * @return int
117
-     */
118
-    public function id(): int
119
-    {
120
-        return $this->id;
121
-    }
122
-
123
-    /**
124
-     * Get the view type for display
125
-     *
126
-     * @return string
127
-     */
128
-    abstract public function type(): string;
129
-
130
-    /**
131
-     * Get the icon for the view type
132
-     *
133
-     * @param ModuleInterface $module
134
-     * @return string
135
-     */
136
-    abstract public function icon(ModuleInterface $module): string;
137
-
138
-    /**
139
-     * Return the content of the global settings section of the config page
140
-     *
141
-     * @param ModuleInterface $module
142
-     * @return string
143
-     */
144
-    abstract public function globalSettingsContent(ModuleInterface $module): string;
145
-
146
-    /**
147
-     * Return a view with global settings updated according to the view rules
148
-     *
149
-     * @param ServerRequestInterface $request
150
-     * @return static
151
-     */
152
-    abstract public function withGlobalSettingsUpdate(ServerRequestInterface $request): self;
153
-
154
-    /**
155
-     * Returns the content of the view global tab
156
-     *
157
-     * @param GeoDispersionModule $module
158
-     * @param GeoAnalysisResult $result
159
-     * @param array<string, mixed> $params
160
-     * @return string
161
-     */
162
-    abstract public function globalTabContent(
163
-        GeoDispersionModule $module,
164
-        GeoAnalysisResult $result,
165
-        array $params
166
-    ): string;
167
-
168
-    /**
169
-     * Returns the content of the view detailed tab
170
-     *
171
-     * @param ModuleInterface $module
172
-     * @param Collection<string, GeoAnalysisResult> $results
173
-     * @param array<string, mixed> $params
174
-     * @return string
175
-     */
176
-    public function detailedTabContent(ModuleInterface $module, Collection $results, array $params): string
177
-    {
178
-        return view($module->name() . '::geoanalysisview-tab-detailed', $params + [ 'results'   =>  $results ]);
179
-    }
180
-
181
-    /**
182
-     * Get the tree to which the view belongs
183
-     *
184
-     * @return Tree
185
-     */
186
-    public function tree(): Tree
187
-    {
188
-        return $this->tree;
189
-    }
190
-
191
-    /**
192
-     * Get the description of the view
193
-     *
194
-     * @return string
195
-     */
196
-    public function description(): string
197
-    {
198
-        return $this->description;
199
-    }
200
-
201
-    /**
202
-     * Get whether the view is enabled
203
-     *
204
-     * @return bool
205
-     */
206
-    public function isEnabled(): bool
207
-    {
208
-        return $this->enabled;
209
-    }
210
-
211
-    /**
212
-     * Get the geographical dispersion analysis for the view
213
-     *
214
-     * @return GeoAnalysisInterface
215
-     */
216
-    public function analysis(): GeoAnalysisInterface
217
-    {
218
-        return $this->geoanalysis;
219
-    }
220
-
221
-    /**
222
-     * Get the place hierarchy depth for the view
223
-     *
224
-     * @return int
225
-     */
226
-    public function placesDepth(): int
227
-    {
228
-        return $this->depth;
229
-    }
230
-
231
-    /**
232
-     * Get the number of places to display in the detailed tab
233
-     *
234
-     * @return int
235
-     */
236
-    public function numberTopPlaces(): int
237
-    {
238
-        return $this->detailed_top_places;
239
-    }
240
-
241
-    /**
242
-     * Get whether flags should be used in the detailed tab
243
-     *
244
-     * @return bool
245
-     */
246
-    public function useFlags(): bool
247
-    {
248
-        return $this->use_flags;
249
-    }
30
+	private int $id;
31
+	private Tree $tree;
32
+	private bool $enabled;
33
+	private string $description;
34
+	private GeoAnalysisInterface $geoanalysis;
35
+	private int $depth;
36
+	private int $detailed_top_places;
37
+	private bool $use_flags;
38
+
39
+	/**
40
+	 * Constructor for AbstractGeoAnalysisView
41
+	 *
42
+	 * @param int $id
43
+	 * @param Tree $tree
44
+	 * @param bool $enabled
45
+	 * @param string $description
46
+	 * @param GeoAnalysisInterface $geoanalysis
47
+	 * @param int $depth
48
+	 * @param int $detailed_top_places
49
+	 * @param bool $use_flags
50
+	 */
51
+	final public function __construct(
52
+		int $id,
53
+		Tree $tree,
54
+		bool $enabled,
55
+		string $description,
56
+		GeoAnalysisInterface $geoanalysis,
57
+		int $depth,
58
+		int $detailed_top_places = 0,
59
+		bool $use_flags = false
60
+	) {
61
+		$this->id = $id;
62
+		$this->tree = $tree;
63
+		$this->enabled = $enabled;
64
+		$this->description = $description;
65
+		$this->geoanalysis = $geoanalysis;
66
+		$this->depth = $depth;
67
+		$this->detailed_top_places = $detailed_top_places;
68
+		$this->use_flags = $use_flags;
69
+	}
70
+
71
+	/**
72
+	 * Create a copy of the view with a new ID.
73
+	 *
74
+	 * @param int $id
75
+	 * @return static
76
+	 */
77
+	public function withId(int $id): self
78
+	{
79
+		$new = clone $this;
80
+		$new->id = $id;
81
+		return $new;
82
+	}
83
+
84
+	/**
85
+	 * Create a copy of the view with new properties.
86
+	 *
87
+	 * @param bool $enabled
88
+	 * @param string $description
89
+	 * @param GeoAnalysisInterface $geoanalysis
90
+	 * @param int $depth
91
+	 * @param int $detailed_top_places
92
+	 * @param bool $use_flags
93
+	 * @return static
94
+	 */
95
+	public function with(
96
+		bool $enabled,
97
+		string $description,
98
+		GeoAnalysisInterface $geoanalysis,
99
+		int $depth,
100
+		int $detailed_top_places = 0,
101
+		bool $use_flags = false
102
+	): self {
103
+		$new = clone $this;
104
+		$new->enabled = $enabled;
105
+		$new->description = $description;
106
+		$new->geoanalysis = $geoanalysis;
107
+		$new->depth = $depth;
108
+		$new->detailed_top_places = $detailed_top_places;
109
+		$new->use_flags = $use_flags;
110
+		return $new;
111
+	}
112
+
113
+	/**
114
+	 * Get the view ID
115
+	 *
116
+	 * @return int
117
+	 */
118
+	public function id(): int
119
+	{
120
+		return $this->id;
121
+	}
122
+
123
+	/**
124
+	 * Get the view type for display
125
+	 *
126
+	 * @return string
127
+	 */
128
+	abstract public function type(): string;
129
+
130
+	/**
131
+	 * Get the icon for the view type
132
+	 *
133
+	 * @param ModuleInterface $module
134
+	 * @return string
135
+	 */
136
+	abstract public function icon(ModuleInterface $module): string;
137
+
138
+	/**
139
+	 * Return the content of the global settings section of the config page
140
+	 *
141
+	 * @param ModuleInterface $module
142
+	 * @return string
143
+	 */
144
+	abstract public function globalSettingsContent(ModuleInterface $module): string;
145
+
146
+	/**
147
+	 * Return a view with global settings updated according to the view rules
148
+	 *
149
+	 * @param ServerRequestInterface $request
150
+	 * @return static
151
+	 */
152
+	abstract public function withGlobalSettingsUpdate(ServerRequestInterface $request): self;
153
+
154
+	/**
155
+	 * Returns the content of the view global tab
156
+	 *
157
+	 * @param GeoDispersionModule $module
158
+	 * @param GeoAnalysisResult $result
159
+	 * @param array<string, mixed> $params
160
+	 * @return string
161
+	 */
162
+	abstract public function globalTabContent(
163
+		GeoDispersionModule $module,
164
+		GeoAnalysisResult $result,
165
+		array $params
166
+	): string;
167
+
168
+	/**
169
+	 * Returns the content of the view detailed tab
170
+	 *
171
+	 * @param ModuleInterface $module
172
+	 * @param Collection<string, GeoAnalysisResult> $results
173
+	 * @param array<string, mixed> $params
174
+	 * @return string
175
+	 */
176
+	public function detailedTabContent(ModuleInterface $module, Collection $results, array $params): string
177
+	{
178
+		return view($module->name() . '::geoanalysisview-tab-detailed', $params + [ 'results'   =>  $results ]);
179
+	}
180
+
181
+	/**
182
+	 * Get the tree to which the view belongs
183
+	 *
184
+	 * @return Tree
185
+	 */
186
+	public function tree(): Tree
187
+	{
188
+		return $this->tree;
189
+	}
190
+
191
+	/**
192
+	 * Get the description of the view
193
+	 *
194
+	 * @return string
195
+	 */
196
+	public function description(): string
197
+	{
198
+		return $this->description;
199
+	}
200
+
201
+	/**
202
+	 * Get whether the view is enabled
203
+	 *
204
+	 * @return bool
205
+	 */
206
+	public function isEnabled(): bool
207
+	{
208
+		return $this->enabled;
209
+	}
210
+
211
+	/**
212
+	 * Get the geographical dispersion analysis for the view
213
+	 *
214
+	 * @return GeoAnalysisInterface
215
+	 */
216
+	public function analysis(): GeoAnalysisInterface
217
+	{
218
+		return $this->geoanalysis;
219
+	}
220
+
221
+	/**
222
+	 * Get the place hierarchy depth for the view
223
+	 *
224
+	 * @return int
225
+	 */
226
+	public function placesDepth(): int
227
+	{
228
+		return $this->depth;
229
+	}
230
+
231
+	/**
232
+	 * Get the number of places to display in the detailed tab
233
+	 *
234
+	 * @return int
235
+	 */
236
+	public function numberTopPlaces(): int
237
+	{
238
+		return $this->detailed_top_places;
239
+	}
240
+
241
+	/**
242
+	 * Get whether flags should be used in the detailed tab
243
+	 *
244
+	 * @return bool
245
+	 */
246
+	public function useFlags(): bool
247
+	{
248
+		return $this->use_flags;
249
+	}
250 250
 }
Please login to merge, or discard this patch.
app/Contracts/Hooks/NameAccordionExtenderInterface.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
  /**
4
- * webtrees-lib: MyArtJaub library for webtrees
5
- *
6
- * @package MyArtJaub\Webtrees
7
- * @subpackage Hooks
8
- * @author Jonathan Jaubart <[email protected]>
9
- * @copyright Copyright (c) 2011-2022, Jonathan Jaubart
10
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
11
- */
4
+  * webtrees-lib: MyArtJaub library for webtrees
5
+  *
6
+  * @package MyArtJaub\Webtrees
7
+  * @subpackage Hooks
8
+  * @author Jonathan Jaubart <[email protected]>
9
+  * @copyright Copyright (c) 2011-2022, Jonathan Jaubart
10
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
11
+  */
12 12
 
13 13
 declare(strict_types=1);
14 14
 
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
  */
22 22
 interface NameAccordionExtenderInterface extends HookInterface
23 23
 {
24
-    /**
25
-     * Add a new card to the names accordion.
26
-     *
27
-     * @param Individual $individual
28
-     * @return string
29
-     */
30
-    public function accordionCard(Individual $individual): string;
24
+	/**
25
+	 * Add a new card to the names accordion.
26
+	 *
27
+	 * @param Individual $individual
28
+	 * @return string
29
+	 */
30
+	public function accordionCard(Individual $individual): string;
31 31
 }
Please login to merge, or discard this patch.
app/Contracts/Hooks/ModuleHookSubscriberInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
  /**
4
- * webtrees-lib: MyArtJaub library for webtrees
5
- *
6
- * @package MyArtJaub\Webtrees
7
- * @subpackage Hooks
8
- * @author Jonathan Jaubart <[email protected]>
9
- * @copyright Copyright (c) 2011-2022, Jonathan Jaubart
10
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
11
- */
4
+  * webtrees-lib: MyArtJaub library for webtrees
5
+  *
6
+  * @package MyArtJaub\Webtrees
7
+  * @subpackage Hooks
8
+  * @author Jonathan Jaubart <[email protected]>
9
+  * @copyright Copyright (c) 2011-2022, Jonathan Jaubart
10
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
11
+  */
12 12
 
13 13
 declare(strict_types=1);
14 14
 
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
  */
20 20
 interface ModuleHookSubscriberInterface
21 21
 {
22
-    /**
23
-     * List hooks to be subscribed by the module as an array.
24
-     *
25
-     * @return HookInterface[]
26
-     */
27
-    public function listSubscribedHooks(): array;
22
+	/**
23
+	 * List hooks to be subscribed by the module as an array.
24
+	 *
25
+	 * @return HookInterface[]
26
+	 */
27
+	public function listSubscribedHooks(): array;
28 28
 }
Please login to merge, or discard this patch.
app/Contracts/Hooks/FamilyDatatablesExtenderInterface.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
  /**
4
- * webtrees-lib: MyArtJaub library for webtrees
5
- *
6
- * @package MyArtJaub\Webtrees
7
- * @subpackage Hooks
8
- * @author Jonathan Jaubart <[email protected]>
9
- * @copyright Copyright (c) 2011-2022, Jonathan Jaubart
10
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
11
- */
4
+  * webtrees-lib: MyArtJaub library for webtrees
5
+  *
6
+  * @package MyArtJaub\Webtrees
7
+  * @subpackage Hooks
8
+  * @author Jonathan Jaubart <[email protected]>
9
+  * @copyright Copyright (c) 2011-2022, Jonathan Jaubart
10
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
11
+  */
12 12
 
13 13
 declare(strict_types=1);
14 14
 
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
  */
20 20
 interface FamilyDatatablesExtenderInterface extends HookInterface
21 21
 {
22
-    /**
23
-     * Get the columns to be added to families datatables
24
-     *
25
-     * @param iterable<\Fisharebest\Webtrees\Family> $records
26
-     * @return array<string, array<string, array<string, mixed>>>
27
-     */
28
-    public function familyColumns(iterable $records): array;
22
+	/**
23
+	 * Get the columns to be added to families datatables
24
+	 *
25
+	 * @param iterable<\Fisharebest\Webtrees\Family> $records
26
+	 * @return array<string, array<string, array<string, mixed>>>
27
+	 */
28
+	public function familyColumns(iterable $records): array;
29 29
 }
Please login to merge, or discard this patch.