@@ -19,10 +19,10 @@ |
||
| 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 | } |
@@ -22,26 +22,26 @@ |
||
| 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 | } |
@@ -19,24 +19,24 @@ |
||
| 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 | } |
@@ -19,26 +19,26 @@ |
||
| 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 | } |
@@ -22,54 +22,54 @@ |
||
| 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 | } |
@@ -24,45 +24,45 @@ |
||
| 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 | } |
@@ -19,25 +19,25 @@ |
||
| 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 | } |
@@ -25,63 +25,63 @@ |
||
| 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 |
|
| 69 | - view($this->module()->name() . '::icons/source-status', [ |
|
| 70 | - 'module_name' => $this->module()->name(), |
|
| 71 | - 'source_status' => $this->source_status_service->sourceStatusForRecord($record), |
|
| 72 | - 'context' => 'INDI', |
|
| 73 | - 'size_style' => $size ]) . |
|
| 74 | - view($this->module()->name() . '::icons/source-status', [ |
|
| 75 | - 'module_name' => $this->module()->name(), |
|
| 76 | - 'source_status' => $this->source_status_service->sourceStatusForBirth($record), |
|
| 77 | - 'context' => 'INDI:BIRT', |
|
| 78 | - 'size_style' => $size ]) . |
|
| 79 | - ($record->isDead() ? view($this->module()->name() . '::icons/source-status', [ |
|
| 80 | - 'module_name' => $this->module()->name(), |
|
| 81 | - 'source_status' => $this->source_status_service->sourceStatusForDeath($record), |
|
| 82 | - 'context' => 'INDI:DEAT', |
|
| 83 | - 'size_style' => $size ]) : '') ; |
|
| 84 | - } |
|
| 85 | - return ''; |
|
| 86 | - } |
|
| 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 |
|
| 69 | + view($this->module()->name() . '::icons/source-status', [ |
|
| 70 | + 'module_name' => $this->module()->name(), |
|
| 71 | + 'source_status' => $this->source_status_service->sourceStatusForRecord($record), |
|
| 72 | + 'context' => 'INDI', |
|
| 73 | + 'size_style' => $size ]) . |
|
| 74 | + view($this->module()->name() . '::icons/source-status', [ |
|
| 75 | + 'module_name' => $this->module()->name(), |
|
| 76 | + 'source_status' => $this->source_status_service->sourceStatusForBirth($record), |
|
| 77 | + 'context' => 'INDI:BIRT', |
|
| 78 | + 'size_style' => $size ]) . |
|
| 79 | + ($record->isDead() ? view($this->module()->name() . '::icons/source-status', [ |
|
| 80 | + 'module_name' => $this->module()->name(), |
|
| 81 | + 'source_status' => $this->source_status_service->sourceStatusForDeath($record), |
|
| 82 | + 'context' => 'INDI:DEAT', |
|
| 83 | + 'size_style' => $size ]) : '') ; |
|
| 84 | + } |
|
| 85 | + return ''; |
|
| 86 | + } |
|
| 87 | 87 | } |
@@ -30,183 +30,183 @@ |
||
| 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 | } |