Passed
Push — main ( c808ff...4e47c4 )
by Jonathan
13:05
created
app/Contracts/GeoDispersion/ModulePlaceMapperProviderInterface.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@
 block discarded – undo
19 19
  */
20 20
 interface ModulePlaceMapperProviderInterface
21 21
 {
22
-    /**
23
-     * List place mappers provided by the module as an array.
24
-     *
25
-     * @return string[] List of place mappers
26
-     */
27
-    public function listPlaceMappers(): array;
22
+	/**
23
+	 * List place mappers provided by the module as an array.
24
+	 *
25
+	 * @return string[] List of place mappers
26
+	 */
27
+	public function listPlaceMappers(): array;
28 28
 }
Please login to merge, or discard this patch.
app/Contracts/GeoDispersion/GeoAnalysisInterface.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -22,26 +22,26 @@
 block discarded – undo
22 22
  */
23 23
 interface GeoAnalysisInterface
24 24
 {
25
-    /**
26
-     * Get the geographical dispersion analysis title
27
-     *
28
-     * @return string
29
-     */
30
-    public function title(): string;
25
+	/**
26
+	 * Get the geographical dispersion analysis title
27
+	 *
28
+	 * @return string
29
+	 */
30
+	public function title(): string;
31 31
 
32
-    /**
33
-     * Gets the function to translate
34
-     *
35
-     * @return callable(int $count): string
36
-     */
37
-    public function itemsDescription(): callable;
32
+	/**
33
+	 * Gets the function to translate
34
+	 *
35
+	 * @return callable(int $count): string
36
+	 */
37
+	public function itemsDescription(): callable;
38 38
 
39
-    /**
40
-     * Get the results of the geographical dispersion analysis
41
-     *
42
-     * @param Tree $tree
43
-     * @param int $depth
44
-     * @return GeoAnalysisResults
45
-     */
46
-    public function results(Tree $tree, int $depth): GeoAnalysisResults;
39
+	/**
40
+	 * Get the results of the geographical dispersion analysis
41
+	 *
42
+	 * @param Tree $tree
43
+	 * @param int $depth
44
+	 * @return GeoAnalysisResults
45
+	 */
46
+	public function results(Tree $tree, int $depth): GeoAnalysisResults;
47 47
 }
Please login to merge, or discard this patch.
app/Contracts/GeoDispersion/MapDefinitionInterface.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,24 +19,24 @@
 block discarded – undo
19 19
  */
20 20
 interface MapDefinitionInterface
21 21
 {
22
-    /**
23
-     * Get the map ID
24
-     *
25
-     * @return string
26
-     */
27
-    public function id(): string;
22
+	/**
23
+	 * Get the map ID
24
+	 *
25
+	 * @return string
26
+	 */
27
+	public function id(): string;
28 28
 
29
-    /**
30
-     * Get the map title
31
-     *
32
-     * @return string
33
-     */
34
-    public function title(): string;
29
+	/**
30
+	 * Get the map title
31
+	 *
32
+	 * @return string
33
+	 */
34
+	public function title(): string;
35 35
 
36
-    /**
37
-     * Get the features in the map
38
-     *
39
-     * @return \Brick\Geo\IO\GeoJSON\Feature[]
40
-     */
41
-    public function features(): array;
36
+	/**
37
+	 * Get the features in the map
38
+	 *
39
+	 * @return \Brick\Geo\IO\GeoJSON\Feature[]
40
+	 */
41
+	public function features(): array;
42 42
 }
Please login to merge, or discard this patch.
app/Contracts/GeoDispersion/MapViewConfigInterface.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -19,26 +19,26 @@
 block discarded – undo
19 19
  */
20 20
 interface MapViewConfigInterface
21 21
 {
22
-    /**
23
-     * Get the feature property to be used for mapping the map feature with the analysis results
24
-     *
25
-     * @return string
26
-     */
27
-    public function mapMappingProperty(): string;
22
+	/**
23
+	 * Get the feature property to be used for mapping the map feature with the analysis results
24
+	 *
25
+	 * @return string
26
+	 */
27
+	public function mapMappingProperty(): string;
28 28
 
29
-    /**
30
-     * Get the config of the mapper associated with the map view
31
-     *
32
-     * @return PlaceMapperConfigInterface
33
-     */
34
-    public function mapperConfig(): PlaceMapperConfigInterface;
29
+	/**
30
+	 * Get the config of the mapper associated with the map view
31
+	 *
32
+	 * @return PlaceMapperConfigInterface
33
+	 */
34
+	public function mapperConfig(): PlaceMapperConfigInterface;
35 35
 
36
-    /**
37
-     * Get a MapViewConfigInterface object with the new properties
38
-     *
39
-     * @param string $mapping_property
40
-     * @param PlaceMapperConfigInterface $mapper_config
41
-     * @return static
42
-     */
43
-    public function with(string $mapping_property, PlaceMapperConfigInterface $mapper_config): self;
36
+	/**
37
+	 * Get a MapViewConfigInterface object with the new properties
38
+	 *
39
+	 * @param string $mapping_property
40
+	 * @param PlaceMapperConfigInterface $mapper_config
41
+	 * @return static
42
+	 */
43
+	public function with(string $mapping_property, PlaceMapperConfigInterface $mapper_config): self;
44 44
 }
Please login to merge, or discard this patch.
app/Contracts/GeoDispersion/PlaceMapperInterface.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -22,54 +22,54 @@
 block discarded – undo
22 22
  */
23 23
 interface PlaceMapperInterface
24 24
 {
25
-    /**
26
-     * Get the Place mapper title
27
-     *
28
-     * @return string
29
-     */
30
-    public function title(): string;
25
+	/**
26
+	 * Get the Place mapper title
27
+	 *
28
+	 * @return string
29
+	 */
30
+	public function title(): string;
31 31
 
32
-    /**
33
-     * Boot the Place mapper
34
-     */
35
-    public function boot(): void;
32
+	/**
33
+	 * Boot the Place mapper
34
+	 */
35
+	public function boot(): void;
36 36
 
37
-    /**
38
-     * Get the configuration associated to the mapper
39
-     *
40
-     * @return PlaceMapperConfigInterface
41
-     */
42
-    public function config(): PlaceMapperConfigInterface;
37
+	/**
38
+	 * Get the configuration associated to the mapper
39
+	 *
40
+	 * @return PlaceMapperConfigInterface
41
+	 */
42
+	public function config(): PlaceMapperConfigInterface;
43 43
 
44
-    /**
45
-     * Set the configured associated to the mapper
46
-     *
47
-     * @param PlaceMapperConfigInterface $config
48
-     */
49
-    public function setConfig(PlaceMapperConfigInterface $config): void;
44
+	/**
45
+	 * Set the configured associated to the mapper
46
+	 *
47
+	 * @param PlaceMapperConfigInterface $config
48
+	 */
49
+	public function setConfig(PlaceMapperConfigInterface $config): void;
50 50
 
51
-    /**
52
-     * Get the data associated to the mapper, for a specific key
53
-     *
54
-     * @param string $key
55
-     * @return null|mixed
56
-     */
57
-    public function data(string $key);
51
+	/**
52
+	 * Get the data associated to the mapper, for a specific key
53
+	 *
54
+	 * @param string $key
55
+	 * @return null|mixed
56
+	 */
57
+	public function data(string $key);
58 58
 
59
-    /**
60
-     * Set the data associated to the mapper, for a specific key
61
-     *
62
-     * @param string $key
63
-     * @param mixed $data
64
-     */
65
-    public function setData(string $key, $data): void;
59
+	/**
60
+	 * Set the data associated to the mapper, for a specific key
61
+	 *
62
+	 * @param string $key
63
+	 * @param mixed $data
64
+	 */
65
+	public function setData(string $key, $data): void;
66 66
 
67
-    /**
68
-     * Return the property value of the feature identifying a place in a GeoJson map.
69
-     *
70
-     * @param Place $place
71
-     * @param string $feature_property
72
-     * @return string|NULL
73
-     */
74
-    public function map(Place $place, string $feature_property): ?string;
67
+	/**
68
+	 * Return the property value of the feature identifying a place in a GeoJson map.
69
+	 *
70
+	 * @param Place $place
71
+	 * @param string $feature_property
72
+	 * @return string|NULL
73
+	 */
74
+	public function map(Place $place, string $feature_property): ?string;
75 75
 }
Please login to merge, or discard this patch.
app/Contracts/GeoDispersion/PlaceMapperConfigInterface.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -24,45 +24,45 @@
 block discarded – undo
24 24
  */
25 25
 interface PlaceMapperConfigInterface extends JsonSerializable
26 26
 {
27
-    /**
28
-     * Deserialise the mapper configuration from a string or an array
29
-     *
30
-     * @param mixed $config
31
-     * @return $this
32
-     */
33
-    public function jsonDeserialize($config): self;
27
+	/**
28
+	 * Deserialise the mapper configuration from a string or an array
29
+	 *
30
+	 * @param mixed $config
31
+	 * @return $this
32
+	 */
33
+	public function jsonDeserialize($config): self;
34 34
 
35
-    /**
36
-     * Check if the configuration contains a specific key
37
-     *
38
-     * @param string $key
39
-     * @return bool
40
-     */
41
-    public function has(string $key): bool;
35
+	/**
36
+	 * Check if the configuration contains a specific key
37
+	 *
38
+	 * @param string $key
39
+	 * @return bool
40
+	 */
41
+	public function has(string $key): bool;
42 42
 
43
-    /**
44
-     * Return the configuration associated with a key, or a default value if none found.
45
-     *
46
-     * @param string $key
47
-     * @param mixed|null $default
48
-     * @return mixed|null
49
-     */
50
-    public function get(string $key, $default = null);
43
+	/**
44
+	 * Return the configuration associated with a key, or a default value if none found.
45
+	 *
46
+	 * @param string $key
47
+	 * @param mixed|null $default
48
+	 * @return mixed|null
49
+	 */
50
+	public function get(string $key, $default = null);
51 51
 
52
-    /**
53
-     * Return the content of the mapper configuration section of the config page
54
-     *
55
-     * @param ModuleInterface $module
56
-     * @param Tree $tree
57
-     * @return string
58
-     */
59
-    public function configContent(ModuleInterface $module, Tree $tree): string;
52
+	/**
53
+	 * Return the content of the mapper configuration section of the config page
54
+	 *
55
+	 * @param ModuleInterface $module
56
+	 * @param Tree $tree
57
+	 * @return string
58
+	 */
59
+	public function configContent(ModuleInterface $module, Tree $tree): string;
60 60
 
61
-    /**
62
-     * Return a PlaceMapperConfigInterface object updated according to its mapper configuration rules
63
-     *
64
-     * @param ServerRequestInterface $request
65
-     * @return static
66
-     */
67
-    public function withConfigUpdate(ServerRequestInterface $request): self;
61
+	/**
62
+	 * Return a PlaceMapperConfigInterface object updated according to its mapper configuration rules
63
+	 *
64
+	 * @param ServerRequestInterface $request
65
+	 * @return static
66
+	 */
67
+	public function withConfigUpdate(ServerRequestInterface $request): self;
68 68
 }
Please login to merge, or discard this patch.
app/Contracts/Tasks/TaskInterface.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -19,25 +19,25 @@
 block discarded – undo
19 19
  */
20 20
 interface TaskInterface
21 21
 {
22
-    /**
23
-     * Display name of the task
24
-     *
25
-     * @return string
26
-     */
27
-    public function name(): string;
22
+	/**
23
+	 * Display name of the task
24
+	 *
25
+	 * @return string
26
+	 */
27
+	public function name(): string;
28 28
     
29
-    /**
30
-     * Return the default frequency for the execution of the task, in minutes.
31
-     *
32
-     * @return int Frequency for the execution of the task
33
-     */
34
-    public function defaultFrequency(): int;
29
+	/**
30
+	 * Return the default frequency for the execution of the task, in minutes.
31
+	 *
32
+	 * @return int Frequency for the execution of the task
33
+	 */
34
+	public function defaultFrequency(): int;
35 35
     
36
-    /**
37
-     * Run the task's actions, and return whether the execution has been successful.
38
-     *
39
-     * @param TaskSchedule $task_schedule
40
-     * @return bool Has the execution been a success
41
-     */
42
-    public function run(TaskSchedule $task_schedule): bool;
36
+	/**
37
+	 * Run the task's actions, and return whether the execution has been successful.
38
+	 *
39
+	 * @param TaskSchedule $task_schedule
40
+	 * @return bool Has the execution been a success
41
+	 */
42
+	public function run(TaskSchedule $task_schedule): bool;
43 43
 }
Please login to merge, or discard this patch.
app/Module/IsSourced/Hooks/IsSourcedStatusColumnsHook.php 1 patch
Indentation   +171 added lines, -171 removed lines patch added patch discarded remove patch
@@ -30,183 +30,183 @@
 block discarded – undo
30 30
  * Hook for adding columns with source statuses in datatables.
31 31
  */
32 32
 class IsSourcedStatusColumnsHook implements
33
-    FamilyDatatablesExtenderInterface,
34
-    IndividualDatatablesExtenderInterface,
35
-    SosaFamilyDatatablesExtenderInterface,
36
-    SosaIndividualDatatablesExtenderInterface,
37
-    SosaMissingDatatablesExtenderInterface
33
+	FamilyDatatablesExtenderInterface,
34
+	IndividualDatatablesExtenderInterface,
35
+	SosaFamilyDatatablesExtenderInterface,
36
+	SosaIndividualDatatablesExtenderInterface,
37
+	SosaMissingDatatablesExtenderInterface
38 38
 {
39
-    private ModuleInterface $module;
40
-    private SourceStatusService $source_status_service;
39
+	private ModuleInterface $module;
40
+	private SourceStatusService $source_status_service;
41 41
 
42
-    /**
43
-     * Constructor for IsSourcedStatusColumnsHook
44
-     *
45
-     * @param ModuleInterface $module
46
-     * @param SourceStatusService $source_status_service
47
-     */
48
-    public function __construct(ModuleInterface $module, SourceStatusService $source_status_service)
49
-    {
50
-        $this->module = $module;
51
-        $this->source_status_service = $source_status_service;
52
-    }
42
+	/**
43
+	 * Constructor for IsSourcedStatusColumnsHook
44
+	 *
45
+	 * @param ModuleInterface $module
46
+	 * @param SourceStatusService $source_status_service
47
+	 */
48
+	public function __construct(ModuleInterface $module, SourceStatusService $source_status_service)
49
+	{
50
+		$this->module = $module;
51
+		$this->source_status_service = $source_status_service;
52
+	}
53 53
 
54
-    /**
55
-     * {@inheritDoc}
56
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface::module()
57
-     */
58
-    public function module(): ModuleInterface
59
-    {
60
-        return $this->module;
61
-    }
54
+	/**
55
+	 * {@inheritDoc}
56
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface::module()
57
+	 */
58
+	public function module(): ModuleInterface
59
+	{
60
+		return $this->module;
61
+	}
62 62
 
63
-    /**
64
-     * {@inheritDoc}
65
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\IndividualDatatablesExtenderInterface::individualColumns()
66
-     */
67
-    public function individualColumns(iterable $records): array
68
-    {
69
-        $records = collect($records);
70
-        return [
71
-            'issourced' => [
72
-                'birth' => [
73
-                    'position' => 7,
74
-                    'column_def' => [ 'class' => 'text-center' ],
75
-                    'th' => view($this->module()->name() . '::components/column-th-issourced', [
76
-                        'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:BIRT')->label())
77
-                    ]),
78
-                    'records' => $records->map(function (Individual $individual): array {
79
-                        $source_status = $this->source_status_service->sourceStatusForBirth($individual);
80
-                        return [
81
-                            'order' => $source_status->order(),
82
-                            'text' => view($this->module()->name() . '::icons/source-status', [
83
-                                'module_name' => $this->module()->name(),
84
-                                'source_status' => $source_status,
85
-                                'context'  => 'INDI:BIRT',
86
-                                'size_style' => '' ])
87
-                        ];
88
-                    })->toArray()
89
-                ],
90
-                'death' => [
91
-                    'position' => 12,
92
-                    'column_def' => [ 'class' => 'text-center' ],
93
-                    'th' => view($this->module()->name() . '::components/column-th-issourced', [
94
-                        'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:DEAT')->label())
95
-                    ]),
96
-                    'records' => $records->map(function (Individual $individual): array {
97
-                        $source_status = $this->source_status_service->sourceStatusForDeath($individual);
98
-                        return $individual->isDead() ? [
99
-                            'order' =>  $source_status->order(),
100
-                            'text' => view($this->module()->name() . '::icons/source-status', [
101
-                                'module_name' => $this->module()->name(),
102
-                                'source_status' => $source_status,
103
-                                'context'  => 'INDI:DEAT',
104
-                                'size_style' => '' ])
105
-                        ] : ['order' => 0, 'text' => ''];
106
-                    })->toArray()
107
-                ]
108
-            ]
109
-        ];
110
-    }
63
+	/**
64
+	 * {@inheritDoc}
65
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\IndividualDatatablesExtenderInterface::individualColumns()
66
+	 */
67
+	public function individualColumns(iterable $records): array
68
+	{
69
+		$records = collect($records);
70
+		return [
71
+			'issourced' => [
72
+				'birth' => [
73
+					'position' => 7,
74
+					'column_def' => [ 'class' => 'text-center' ],
75
+					'th' => view($this->module()->name() . '::components/column-th-issourced', [
76
+						'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:BIRT')->label())
77
+					]),
78
+					'records' => $records->map(function (Individual $individual): array {
79
+						$source_status = $this->source_status_service->sourceStatusForBirth($individual);
80
+						return [
81
+							'order' => $source_status->order(),
82
+							'text' => view($this->module()->name() . '::icons/source-status', [
83
+								'module_name' => $this->module()->name(),
84
+								'source_status' => $source_status,
85
+								'context'  => 'INDI:BIRT',
86
+								'size_style' => '' ])
87
+						];
88
+					})->toArray()
89
+				],
90
+				'death' => [
91
+					'position' => 12,
92
+					'column_def' => [ 'class' => 'text-center' ],
93
+					'th' => view($this->module()->name() . '::components/column-th-issourced', [
94
+						'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:DEAT')->label())
95
+					]),
96
+					'records' => $records->map(function (Individual $individual): array {
97
+						$source_status = $this->source_status_service->sourceStatusForDeath($individual);
98
+						return $individual->isDead() ? [
99
+							'order' =>  $source_status->order(),
100
+							'text' => view($this->module()->name() . '::icons/source-status', [
101
+								'module_name' => $this->module()->name(),
102
+								'source_status' => $source_status,
103
+								'context'  => 'INDI:DEAT',
104
+								'size_style' => '' ])
105
+						] : ['order' => 0, 'text' => ''];
106
+					})->toArray()
107
+				]
108
+			]
109
+		];
110
+	}
111 111
 
112
-    /**
113
-     * {@inheritDoc}
114
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\FamilyDatatablesExtenderInterface::familyColumns()
115
-     */
116
-    public function familyColumns(iterable $records): array
117
-    {
118
-        $records = collect($records);
119
-        return [
120
-            'issourced' => [
121
-                'marr' => [
122
-                    'position' => 10,
123
-                    'column_def' => [ 'class' => 'text-center' ],
124
-                    'th' => view($this->module()->name() . '::components/column-th-issourced', [
125
-                        'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('FAM:MARR')->label())
126
-                    ]),
127
-                    'records' => $records->map(function (Family $family): array {
128
-                        $source_status = $this->source_status_service->sourceStatusForMarriage($family);
129
-                        return $family->getMarriage() !== null ? [
130
-                            'order' =>  $source_status->order(),
131
-                            'text' => view($this->module()->name() . '::icons/source-status', [
132
-                                'module_name' => $this->module()->name(),
133
-                                'source_status' => $source_status,
134
-                                'context'  => 'FAM:MARR',
135
-                                'size_style' => '' ])
136
-                        ] : ['order' => 0, 'text' => ''];
137
-                    })->toArray()
138
-                ]
139
-            ]
140
-        ];
141
-    }
112
+	/**
113
+	 * {@inheritDoc}
114
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\FamilyDatatablesExtenderInterface::familyColumns()
115
+	 */
116
+	public function familyColumns(iterable $records): array
117
+	{
118
+		$records = collect($records);
119
+		return [
120
+			'issourced' => [
121
+				'marr' => [
122
+					'position' => 10,
123
+					'column_def' => [ 'class' => 'text-center' ],
124
+					'th' => view($this->module()->name() . '::components/column-th-issourced', [
125
+						'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('FAM:MARR')->label())
126
+					]),
127
+					'records' => $records->map(function (Family $family): array {
128
+						$source_status = $this->source_status_service->sourceStatusForMarriage($family);
129
+						return $family->getMarriage() !== null ? [
130
+							'order' =>  $source_status->order(),
131
+							'text' => view($this->module()->name() . '::icons/source-status', [
132
+								'module_name' => $this->module()->name(),
133
+								'source_status' => $source_status,
134
+								'context'  => 'FAM:MARR',
135
+								'size_style' => '' ])
136
+						] : ['order' => 0, 'text' => ''];
137
+					})->toArray()
138
+				]
139
+			]
140
+		];
141
+	}
142 142
 
143
-    /**
144
-     * {@inheritDoc}
145
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaIndividualDatatablesExtenderInterface::sosaIndividualColumns()
146
-     */
147
-    public function sosaIndividualColumns(iterable $records): array
148
-    {
149
-        $columns = $this->individualColumns($records);
150
-        $columns['issourced']['birth']['position'] = 5;
151
-        $columns['issourced']['death']['position'] = 8;
152
-        return $columns;
153
-    }
143
+	/**
144
+	 * {@inheritDoc}
145
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaIndividualDatatablesExtenderInterface::sosaIndividualColumns()
146
+	 */
147
+	public function sosaIndividualColumns(iterable $records): array
148
+	{
149
+		$columns = $this->individualColumns($records);
150
+		$columns['issourced']['birth']['position'] = 5;
151
+		$columns['issourced']['death']['position'] = 8;
152
+		return $columns;
153
+	}
154 154
 
155
-    /**
156
-     * {@inheritDoc}
157
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaFamilyDatatablesExtenderInterface::sosaFamilyColumns()
158
-     */
159
-    public function sosaFamilyColumns(iterable $records): array
160
-    {
161
-        return $this->familyColumns($records);
162
-    }
155
+	/**
156
+	 * {@inheritDoc}
157
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaFamilyDatatablesExtenderInterface::sosaFamilyColumns()
158
+	 */
159
+	public function sosaFamilyColumns(iterable $records): array
160
+	{
161
+		return $this->familyColumns($records);
162
+	}
163 163
 
164
-    /**
165
-     * {@inheritDoc}
166
-     * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaMissingDatatablesExtenderInterface::sosaMissingColumns()
167
-     */
168
-    public function sosaMissingColumns(iterable $records): array
169
-    {
170
-        $records = collect($records);
171
-        return [
172
-            'issourced' => [
173
-                'indi' => [
174
-                    'position' => 3,
175
-                    'column_def' => [ 'class' => 'text-center' ],
176
-                    'th' => view($this->module()->name() . '::components/column-th-issourced', [
177
-                        'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI')->label())
178
-                    ]),
179
-                    'records' => $records->map(function (Individual $individual): array {
180
-                        $source_status = $this->source_status_service->sourceStatusForRecord($individual);
181
-                        return [
182
-                            'order' => $source_status->order(),
183
-                            'text' => view($this->module()->name() . '::icons/source-status', [
184
-                                'module_name' => $this->module()->name(),
185
-                                'source_status' => $source_status,
186
-                                'context'  => 'INDI',
187
-                                'size_style' => '' ])
188
-                        ];
189
-                    })->toArray()
190
-                ],
191
-                'birth' => [
192
-                    'position' => 7,
193
-                    'column_def' => [ 'class' => 'text-center' ],
194
-                    'th' => view($this->module()->name() . '::components/column-th-issourced', [
195
-                        'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:BIRT')->label())
196
-                    ]),
197
-                    'records' => $records->map(function (Individual $individual): array {
198
-                        $source_status = $this->source_status_service->sourceStatusForBirth($individual);
199
-                        return [
200
-                            'order' => $source_status->order(),
201
-                            'text' => view($this->module()->name() . '::icons/source-status', [
202
-                                'module_name' => $this->module()->name(),
203
-                                'source_status' => $source_status,
204
-                                'context'  => 'INDI:BIRT',
205
-                                'size_style' => '' ])
206
-                        ];
207
-                    })->toArray()
208
-                ]
209
-            ]
210
-        ];
211
-    }
164
+	/**
165
+	 * {@inheritDoc}
166
+	 * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaMissingDatatablesExtenderInterface::sosaMissingColumns()
167
+	 */
168
+	public function sosaMissingColumns(iterable $records): array
169
+	{
170
+		$records = collect($records);
171
+		return [
172
+			'issourced' => [
173
+				'indi' => [
174
+					'position' => 3,
175
+					'column_def' => [ 'class' => 'text-center' ],
176
+					'th' => view($this->module()->name() . '::components/column-th-issourced', [
177
+						'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI')->label())
178
+					]),
179
+					'records' => $records->map(function (Individual $individual): array {
180
+						$source_status = $this->source_status_service->sourceStatusForRecord($individual);
181
+						return [
182
+							'order' => $source_status->order(),
183
+							'text' => view($this->module()->name() . '::icons/source-status', [
184
+								'module_name' => $this->module()->name(),
185
+								'source_status' => $source_status,
186
+								'context'  => 'INDI',
187
+								'size_style' => '' ])
188
+						];
189
+					})->toArray()
190
+				],
191
+				'birth' => [
192
+					'position' => 7,
193
+					'column_def' => [ 'class' => 'text-center' ],
194
+					'th' => view($this->module()->name() . '::components/column-th-issourced', [
195
+						'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:BIRT')->label())
196
+					]),
197
+					'records' => $records->map(function (Individual $individual): array {
198
+						$source_status = $this->source_status_service->sourceStatusForBirth($individual);
199
+						return [
200
+							'order' => $source_status->order(),
201
+							'text' => view($this->module()->name() . '::icons/source-status', [
202
+								'module_name' => $this->module()->name(),
203
+								'source_status' => $source_status,
204
+								'context'  => 'INDI:BIRT',
205
+								'size_style' => '' ])
206
+						];
207
+					})->toArray()
208
+				]
209
+			]
210
+		];
211
+	}
212 212
 }
Please login to merge, or discard this patch.
app/Module/IsSourced/Data/SourceStatus.php 1 patch
Indentation   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -22,148 +22,148 @@
 block discarded – undo
22 22
  */
23 23
 class SourceStatus
24 24
 {
25
-    /**
26
-     * @var boolean $source_exist
27
-     */
28
-    private $source_exist = false;
29
-
30
-    /**
31
-     * @var boolean $has_document
32
-     */
33
-    private $has_document = false;
34
-
35
-    /**
36
-     * Return whether the SourceStatus object contains relevant data.
37
-     *
38
-     * @return bool
39
-     */
40
-    public function isSet(): bool
41
-    {
42
-        return true;
43
-    }
44
-
45
-    /**
46
-     * Returns whether the record contains a source.
47
-     *
48
-     * @return bool
49
-     */
50
-    public function hasSource(): bool
51
-    {
52
-        return $this->source_exist;
53
-    }
54
-
55
-    /**
56
-     *  Set whether the record contains a source.
57
-     *
58
-     * @param bool $source_exist
59
-     * @return $this
60
-     */
61
-    public function setHasSource(bool $source_exist): self
62
-    {
63
-        $this->source_exist = $source_exist;
64
-        return $this;
65
-    }
66
-
67
-    /**
68
-     * Combine whether the record contains a source with the previous status.
69
-     *
70
-     * @param bool $source_exist
71
-     * @return $this
72
-     */
73
-    public function addHasSource(bool $source_exist): self
74
-    {
75
-        $this->source_exist = $this->source_exist || $source_exist;
76
-        return $this;
77
-    }
78
-
79
-    /**
80
-     * Return whether the source citation is supported by a document.
81
-     * Uses the _ACT tag from the MyArtJaub Certificates module.
82
-     *
83
-     * @return bool
84
-     */
85
-    public function hasSupportingDocument(): bool
86
-    {
87
-        return $this->hasSource() && $this->has_document;
88
-    }
89
-
90
-    /**
91
-     * Set whether the source citation is supported by a document.
92
-     *
93
-     * @param bool $has_document
94
-     * @return $this
95
-     */
96
-    public function setHasSupportingDocument(bool $has_document): self
97
-    {
98
-        $this->has_document = $has_document;
99
-        return $this;
100
-    }
101
-
102
-    /**
103
-     * Combine whether the source citation is supported by a document with the previous status.
104
-     *
105
-     * @param bool $has_document
106
-     * @return $this
107
-     */
108
-    public function addHasSupportingDocument(bool $has_document): self
109
-    {
110
-        $this->has_document = $this->has_document || $has_document;
111
-        return $this;
112
-    }
113
-
114
-    /**
115
-     * Check whether all possible criteria for defining a sourced element have been met.
116
-     *
117
-     * @return bool
118
-     */
119
-    public function isFullySourced(): bool
120
-    {
121
-        return $this->hasSupportingDocument();
122
-    }
123
-
124
-    /**
125
-     * Get the label to display to describe the source status.
126
-     *
127
-     * @param string $context
128
-     * @return string
129
-     */
130
-    public function label(string $context): string
131
-    {
132
-        $context_label = Registry::elementFactory()->make($context)->label();
133
-
134
-        if (!$this->hasSource()) {
135
-            return I18N::translate('%s not sourced', $context_label);
136
-        }
137
-
138
-        if ($this->hasSupportingDocument()) {
139
-            return I18N::translate('%s sourced with a certificate', $context_label);
140
-        }
141
-
142
-        return I18N::translate('%s sourced', $context_label);
143
-    }
144
-
145
-    /**
146
-     * Get an indicative value to order source statuses
147
-     *
148
-     * @return int
149
-     */
150
-    public function order(): int
151
-    {
152
-        return ($this->hasSource() ? 1 : 0)  * (1 + ($this->hasSupportingDocument() ? 1 : 0));
153
-    }
154
-
155
-    /**
156
-     * Return an element combining properties of the current object with another SourceStatus.
157
-     * Do not use the initial object anymore, it may not appropriately describe the status anymore.
158
-     *
159
-     * @template T of SourceStatus
160
-     * @param T $other
161
-     * @return $this|T
162
-     */
163
-    public function combineWith(SourceStatus $other)
164
-    {
165
-        $this->addHasSource($other->hasSource());
166
-        $this->addHasSupportingDocument($other->hasSource());
167
-        return $this;
168
-    }
25
+	/**
26
+	 * @var boolean $source_exist
27
+	 */
28
+	private $source_exist = false;
29
+
30
+	/**
31
+	 * @var boolean $has_document
32
+	 */
33
+	private $has_document = false;
34
+
35
+	/**
36
+	 * Return whether the SourceStatus object contains relevant data.
37
+	 *
38
+	 * @return bool
39
+	 */
40
+	public function isSet(): bool
41
+	{
42
+		return true;
43
+	}
44
+
45
+	/**
46
+	 * Returns whether the record contains a source.
47
+	 *
48
+	 * @return bool
49
+	 */
50
+	public function hasSource(): bool
51
+	{
52
+		return $this->source_exist;
53
+	}
54
+
55
+	/**
56
+	 *  Set whether the record contains a source.
57
+	 *
58
+	 * @param bool $source_exist
59
+	 * @return $this
60
+	 */
61
+	public function setHasSource(bool $source_exist): self
62
+	{
63
+		$this->source_exist = $source_exist;
64
+		return $this;
65
+	}
66
+
67
+	/**
68
+	 * Combine whether the record contains a source with the previous status.
69
+	 *
70
+	 * @param bool $source_exist
71
+	 * @return $this
72
+	 */
73
+	public function addHasSource(bool $source_exist): self
74
+	{
75
+		$this->source_exist = $this->source_exist || $source_exist;
76
+		return $this;
77
+	}
78
+
79
+	/**
80
+	 * Return whether the source citation is supported by a document.
81
+	 * Uses the _ACT tag from the MyArtJaub Certificates module.
82
+	 *
83
+	 * @return bool
84
+	 */
85
+	public function hasSupportingDocument(): bool
86
+	{
87
+		return $this->hasSource() && $this->has_document;
88
+	}
89
+
90
+	/**
91
+	 * Set whether the source citation is supported by a document.
92
+	 *
93
+	 * @param bool $has_document
94
+	 * @return $this
95
+	 */
96
+	public function setHasSupportingDocument(bool $has_document): self
97
+	{
98
+		$this->has_document = $has_document;
99
+		return $this;
100
+	}
101
+
102
+	/**
103
+	 * Combine whether the source citation is supported by a document with the previous status.
104
+	 *
105
+	 * @param bool $has_document
106
+	 * @return $this
107
+	 */
108
+	public function addHasSupportingDocument(bool $has_document): self
109
+	{
110
+		$this->has_document = $this->has_document || $has_document;
111
+		return $this;
112
+	}
113
+
114
+	/**
115
+	 * Check whether all possible criteria for defining a sourced element have been met.
116
+	 *
117
+	 * @return bool
118
+	 */
119
+	public function isFullySourced(): bool
120
+	{
121
+		return $this->hasSupportingDocument();
122
+	}
123
+
124
+	/**
125
+	 * Get the label to display to describe the source status.
126
+	 *
127
+	 * @param string $context
128
+	 * @return string
129
+	 */
130
+	public function label(string $context): string
131
+	{
132
+		$context_label = Registry::elementFactory()->make($context)->label();
133
+
134
+		if (!$this->hasSource()) {
135
+			return I18N::translate('%s not sourced', $context_label);
136
+		}
137
+
138
+		if ($this->hasSupportingDocument()) {
139
+			return I18N::translate('%s sourced with a certificate', $context_label);
140
+		}
141
+
142
+		return I18N::translate('%s sourced', $context_label);
143
+	}
144
+
145
+	/**
146
+	 * Get an indicative value to order source statuses
147
+	 *
148
+	 * @return int
149
+	 */
150
+	public function order(): int
151
+	{
152
+		return ($this->hasSource() ? 1 : 0)  * (1 + ($this->hasSupportingDocument() ? 1 : 0));
153
+	}
154
+
155
+	/**
156
+	 * Return an element combining properties of the current object with another SourceStatus.
157
+	 * Do not use the initial object anymore, it may not appropriately describe the status anymore.
158
+	 *
159
+	 * @template T of SourceStatus
160
+	 * @param T $other
161
+	 * @return $this|T
162
+	 */
163
+	public function combineWith(SourceStatus $other)
164
+	{
165
+		$this->addHasSource($other->hasSource());
166
+		$this->addHasSupportingDocument($other->hasSource());
167
+		return $this;
168
+	}
169 169
 }
Please login to merge, or discard this patch.