@@ -33,105 +33,105 @@ |
||
| 33 | 33 | * IsSourced Module |
| 34 | 34 | */ |
| 35 | 35 | class IsSourcedModule extends AbstractModule implements |
| 36 | - ModuleMyArtJaubInterface, |
|
| 37 | - ModuleGlobalInterface, |
|
| 38 | - ModuleSidebarInterface, |
|
| 39 | - ModuleHookSubscriberInterface |
|
| 36 | + ModuleMyArtJaubInterface, |
|
| 37 | + ModuleGlobalInterface, |
|
| 38 | + ModuleSidebarInterface, |
|
| 39 | + ModuleHookSubscriberInterface |
|
| 40 | 40 | { |
| 41 | - use ModuleMyArtJaubTrait; |
|
| 42 | - use ModuleGlobalTrait; |
|
| 43 | - use ModuleSidebarTrait; |
|
| 41 | + use ModuleMyArtJaubTrait; |
|
| 42 | + use ModuleGlobalTrait; |
|
| 43 | + use ModuleSidebarTrait; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * {@inheritDoc} |
|
| 47 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::title() |
|
| 48 | - */ |
|
| 49 | - public function title(): string |
|
| 50 | - { |
|
| 51 | - return I18N::translate('Sourced events'); |
|
| 52 | - } |
|
| 45 | + /** |
|
| 46 | + * {@inheritDoc} |
|
| 47 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::title() |
|
| 48 | + */ |
|
| 49 | + public function title(): string |
|
| 50 | + { |
|
| 51 | + return I18N::translate('Sourced events'); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * {@inheritDoc} |
|
| 56 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::description() |
|
| 57 | - */ |
|
| 58 | - public function description(): string |
|
| 59 | - { |
|
| 60 | - return I18N::translate('Indicate if events related to an record are sourced.'); |
|
| 61 | - } |
|
| 54 | + /** |
|
| 55 | + * {@inheritDoc} |
|
| 56 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::description() |
|
| 57 | + */ |
|
| 58 | + public function description(): string |
|
| 59 | + { |
|
| 60 | + return I18N::translate('Indicate if events related to an record are sourced.'); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * {@inheritDoc} |
|
| 65 | - * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion() |
|
| 66 | - */ |
|
| 67 | - public function customModuleVersion(): string |
|
| 68 | - { |
|
| 69 | - return '2.1.0-v.1'; |
|
| 70 | - } |
|
| 63 | + /** |
|
| 64 | + * {@inheritDoc} |
|
| 65 | + * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion() |
|
| 66 | + */ |
|
| 67 | + public function customModuleVersion(): string |
|
| 68 | + { |
|
| 69 | + return '2.1.0-v.1'; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * {@inheritDoc} |
|
| 74 | - * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::headContent() |
|
| 75 | - */ |
|
| 76 | - public function headContent(): string |
|
| 77 | - { |
|
| 78 | - return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
| 79 | - } |
|
| 72 | + /** |
|
| 73 | + * {@inheritDoc} |
|
| 74 | + * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::headContent() |
|
| 75 | + */ |
|
| 76 | + public function headContent(): string |
|
| 77 | + { |
|
| 78 | + return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * {@inheritDoc} |
|
| 83 | - * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::bodyContent() |
|
| 84 | - */ |
|
| 85 | - public function bodyContent(): string |
|
| 86 | - { |
|
| 87 | - return '<script src="' . $this->assetUrl('js/issourced.min.js') . '"></script>'; |
|
| 88 | - } |
|
| 81 | + /** |
|
| 82 | + * {@inheritDoc} |
|
| 83 | + * @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::bodyContent() |
|
| 84 | + */ |
|
| 85 | + public function bodyContent(): string |
|
| 86 | + { |
|
| 87 | + return '<script src="' . $this->assetUrl('js/issourced.min.js') . '"></script>'; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * {@inheritDoc} |
|
| 92 | - * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::hasSidebarContent() |
|
| 93 | - */ |
|
| 94 | - public function hasSidebarContent(Individual $individual): bool |
|
| 95 | - { |
|
| 96 | - return true; |
|
| 97 | - } |
|
| 90 | + /** |
|
| 91 | + * {@inheritDoc} |
|
| 92 | + * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::hasSidebarContent() |
|
| 93 | + */ |
|
| 94 | + public function hasSidebarContent(Individual $individual): bool |
|
| 95 | + { |
|
| 96 | + return true; |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - /** |
|
| 100 | - * {@inheritDoc} |
|
| 101 | - * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::getSidebarContent() |
|
| 102 | - */ |
|
| 103 | - public function getSidebarContent(Individual $individual): string |
|
| 104 | - { |
|
| 105 | - /** @var SourceStatusService $source_status_service */ |
|
| 106 | - $source_status_service = app(SourceStatusService::class); |
|
| 99 | + /** |
|
| 100 | + * {@inheritDoc} |
|
| 101 | + * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::getSidebarContent() |
|
| 102 | + */ |
|
| 103 | + public function getSidebarContent(Individual $individual): string |
|
| 104 | + { |
|
| 105 | + /** @var SourceStatusService $source_status_service */ |
|
| 106 | + $source_status_service = app(SourceStatusService::class); |
|
| 107 | 107 | |
| 108 | - $spouse_families_status = $individual->spouseFamilies()->map( |
|
| 109 | - function (Family $sfamily) use ($source_status_service): array { |
|
| 110 | - return [ $sfamily, $source_status_service->sourceStatusForMarriage($sfamily)]; |
|
| 111 | - } |
|
| 112 | - )->filter(function (array $item): bool { |
|
| 113 | - return $item[1]->isSet(); |
|
| 114 | - }); |
|
| 108 | + $spouse_families_status = $individual->spouseFamilies()->map( |
|
| 109 | + function (Family $sfamily) use ($source_status_service): array { |
|
| 110 | + return [ $sfamily, $source_status_service->sourceStatusForMarriage($sfamily)]; |
|
| 111 | + } |
|
| 112 | + )->filter(function (array $item): bool { |
|
| 113 | + return $item[1]->isSet(); |
|
| 114 | + }); |
|
| 115 | 115 | |
| 116 | - return view($this->name() . '::sidebar/content', [ |
|
| 117 | - 'module_name' => $this->name(), |
|
| 118 | - 'individual' => $individual, |
|
| 119 | - 'source_status_individual' => $source_status_service->sourceStatusForRecord($individual), |
|
| 120 | - 'source_status_birth' => $source_status_service->sourceStatusForBirth($individual), |
|
| 121 | - 'source_status_marriages' => $spouse_families_status, |
|
| 122 | - 'source_status_death' => $source_status_service->sourceStatusForDeath($individual) |
|
| 123 | - ]); |
|
| 124 | - } |
|
| 116 | + return view($this->name() . '::sidebar/content', [ |
|
| 117 | + 'module_name' => $this->name(), |
|
| 118 | + 'individual' => $individual, |
|
| 119 | + 'source_status_individual' => $source_status_service->sourceStatusForRecord($individual), |
|
| 120 | + 'source_status_birth' => $source_status_service->sourceStatusForBirth($individual), |
|
| 121 | + 'source_status_marriages' => $spouse_families_status, |
|
| 122 | + 'source_status_death' => $source_status_service->sourceStatusForDeath($individual) |
|
| 123 | + ]); |
|
| 124 | + } |
|
| 125 | 125 | |
| 126 | - /** |
|
| 127 | - * {@inheritDoc} |
|
| 128 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks() |
|
| 129 | - */ |
|
| 130 | - public function listSubscribedHooks(): array |
|
| 131 | - { |
|
| 132 | - return [ |
|
| 133 | - app()->makeWith(IsSourcedStatusHook::class, [ 'module' => $this ]), |
|
| 134 | - app()->makeWith(IsSourcedStatusColumnsHook::class, [ 'module' => $this ]) |
|
| 135 | - ]; |
|
| 136 | - } |
|
| 126 | + /** |
|
| 127 | + * {@inheritDoc} |
|
| 128 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks() |
|
| 129 | + */ |
|
| 130 | + public function listSubscribedHooks(): array |
|
| 131 | + { |
|
| 132 | + return [ |
|
| 133 | + app()->makeWith(IsSourcedStatusHook::class, [ 'module' => $this ]), |
|
| 134 | + app()->makeWith(IsSourcedStatusColumnsHook::class, [ 'module' => $this ]) |
|
| 135 | + ]; |
|
| 136 | + } |
|
| 137 | 137 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function headContent(): string |
| 77 | 77 | { |
| 78 | - return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
| 78 | + return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">'; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function bodyContent(): string |
| 86 | 86 | { |
| 87 | - return '<script src="' . $this->assetUrl('js/issourced.min.js') . '"></script>'; |
|
| 87 | + return '<script src="'.$this->assetUrl('js/issourced.min.js').'"></script>'; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | $source_status_service = app(SourceStatusService::class); |
| 107 | 107 | |
| 108 | 108 | $spouse_families_status = $individual->spouseFamilies()->map( |
| 109 | - function (Family $sfamily) use ($source_status_service): array { |
|
| 110 | - return [ $sfamily, $source_status_service->sourceStatusForMarriage($sfamily)]; |
|
| 109 | + function(Family $sfamily) use ($source_status_service): array { |
|
| 110 | + return [$sfamily, $source_status_service->sourceStatusForMarriage($sfamily)]; |
|
| 111 | 111 | } |
| 112 | - )->filter(function (array $item): bool { |
|
| 112 | + )->filter(function(array $item): bool { |
|
| 113 | 113 | return $item[1]->isSet(); |
| 114 | 114 | }); |
| 115 | 115 | |
| 116 | - return view($this->name() . '::sidebar/content', [ |
|
| 116 | + return view($this->name().'::sidebar/content', [ |
|
| 117 | 117 | 'module_name' => $this->name(), |
| 118 | 118 | 'individual' => $individual, |
| 119 | 119 | 'source_status_individual' => $source_status_service->sourceStatusForRecord($individual), |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | public function listSubscribedHooks(): array |
| 131 | 131 | { |
| 132 | 132 | return [ |
| 133 | - app()->makeWith(IsSourcedStatusHook::class, [ 'module' => $this ]), |
|
| 134 | - app()->makeWith(IsSourcedStatusColumnsHook::class, [ 'module' => $this ]) |
|
| 133 | + app()->makeWith(IsSourcedStatusHook::class, ['module' => $this]), |
|
| 134 | + app()->makeWith(IsSourcedStatusColumnsHook::class, ['module' => $this]) |
|
| 135 | 135 | ]; |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -43,107 +43,107 @@ |
||
| 43 | 43 | * Provide entry points to extend core webtrees code. |
| 44 | 44 | */ |
| 45 | 45 | class HooksModule extends AbstractModule implements |
| 46 | - ModuleMyArtJaubInterface, |
|
| 47 | - ModuleConfigInterface, |
|
| 48 | - ModuleHookSubscriberInterface |
|
| 46 | + ModuleMyArtJaubInterface, |
|
| 47 | + ModuleConfigInterface, |
|
| 48 | + ModuleHookSubscriberInterface |
|
| 49 | 49 | { |
| 50 | - use ModuleMyArtJaubTrait { |
|
| 51 | - boot as traitBoot; |
|
| 52 | - } |
|
| 53 | - use ModuleConfigTrait; |
|
| 54 | - |
|
| 55 | - // How to update the database schema for this module |
|
| 56 | - private const SCHEMA_TARGET_VERSION = 2; |
|
| 57 | - private const SCHEMA_SETTING_NAME = 'MAJ_HOOKS_SCHEMA_VERSION'; |
|
| 58 | - private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema'; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * {@inheritDoc} |
|
| 62 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::title() |
|
| 63 | - */ |
|
| 64 | - public function title(): string |
|
| 65 | - { |
|
| 66 | - return /* I18N: Name of the “Hooks” module */ I18N::translate('Hooks'); |
|
| 67 | - } |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * {@inheritDoc} |
|
| 71 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::description() |
|
| 72 | - */ |
|
| 73 | - public function description(): string |
|
| 74 | - { |
|
| 75 | - return /* I18N: Description of the “Hooks” module */ I18N::translate('Implements hooks management.'); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * {@inheritDoc} |
|
| 80 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::boot() |
|
| 81 | - */ |
|
| 82 | - public function boot(): void |
|
| 83 | - { |
|
| 84 | - $this->traitBoot(); |
|
| 85 | - app()->bind(HookServiceInterface::class, HookService::class); |
|
| 86 | - app(MigrationService::class)->updateSchema( |
|
| 87 | - self::SCHEMA_MIGRATION_PREFIX, |
|
| 88 | - self::SCHEMA_SETTING_NAME, |
|
| 89 | - self::SCHEMA_TARGET_VERSION |
|
| 90 | - ); |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * {@inheritDoc} |
|
| 95 | - * @see \MyArtJaub\Webtrees\Module\ModuleMyArtJaubInterface::loadRoutes() |
|
| 96 | - */ |
|
| 97 | - public function loadRoutes(Map $router): void |
|
| 98 | - { |
|
| 99 | - $router->attach('', '', static function (Map $router): void { |
|
| 100 | - |
|
| 101 | - $router->attach('', '/module-maj/hooks', static function (Map $router): void { |
|
| 102 | - |
|
| 103 | - $router->attach('', '/config/admin', static function (Map $router): void { |
|
| 104 | - |
|
| 105 | - $router->get(AdminConfigPage::class, '', AdminConfigPage::class); |
|
| 106 | - $router->get(ModulesHooksPage::class, '/{hook_name}', ModulesHooksPage::class); |
|
| 107 | - $router->post(ModulesHooksAction::class, '/{hook_name}', ModulesHooksAction::class); |
|
| 108 | - }); |
|
| 109 | - }); |
|
| 110 | - }); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * {@inheritDoc} |
|
| 115 | - * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion() |
|
| 116 | - */ |
|
| 117 | - public function customModuleVersion(): string |
|
| 118 | - { |
|
| 119 | - return '2.1.0-v.1'; |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - /** |
|
| 123 | - * {@inheritDoc} |
|
| 124 | - * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
| 125 | - */ |
|
| 126 | - public function getConfigLink(): string |
|
| 127 | - { |
|
| 128 | - return route(AdminConfigPage::class); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * {@inheritDoc} |
|
| 133 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks() |
|
| 134 | - */ |
|
| 135 | - public function listSubscribedHooks(): array |
|
| 136 | - { |
|
| 137 | - return [ |
|
| 138 | - app()->makeWith(CustomSimpleTagEditorCollector::class, ['module' => $this]), |
|
| 139 | - app()->makeWith(FactSourceTextExtenderCollector::class, ['module' => $this]), |
|
| 140 | - app()->makeWith(FamilyDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 141 | - app()->makeWith(IndividualDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 142 | - app()->makeWith(NameAccordionExtenderCollector::class, ['module' => $this]), |
|
| 143 | - app()->makeWith(RecordNameTextExtenderCollector::class, ['module' => $this]), |
|
| 144 | - app()->makeWith(SosaFamilyDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 145 | - app()->makeWith(SosaIndividualDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 146 | - app()->makeWith(SosaMissingDatatablesExtenderCollector::class, ['module' => $this]) |
|
| 147 | - ]; |
|
| 148 | - } |
|
| 50 | + use ModuleMyArtJaubTrait { |
|
| 51 | + boot as traitBoot; |
|
| 52 | + } |
|
| 53 | + use ModuleConfigTrait; |
|
| 54 | + |
|
| 55 | + // How to update the database schema for this module |
|
| 56 | + private const SCHEMA_TARGET_VERSION = 2; |
|
| 57 | + private const SCHEMA_SETTING_NAME = 'MAJ_HOOKS_SCHEMA_VERSION'; |
|
| 58 | + private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema'; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * {@inheritDoc} |
|
| 62 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::title() |
|
| 63 | + */ |
|
| 64 | + public function title(): string |
|
| 65 | + { |
|
| 66 | + return /* I18N: Name of the “Hooks” module */ I18N::translate('Hooks'); |
|
| 67 | + } |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * {@inheritDoc} |
|
| 71 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::description() |
|
| 72 | + */ |
|
| 73 | + public function description(): string |
|
| 74 | + { |
|
| 75 | + return /* I18N: Description of the “Hooks” module */ I18N::translate('Implements hooks management.'); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * {@inheritDoc} |
|
| 80 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::boot() |
|
| 81 | + */ |
|
| 82 | + public function boot(): void |
|
| 83 | + { |
|
| 84 | + $this->traitBoot(); |
|
| 85 | + app()->bind(HookServiceInterface::class, HookService::class); |
|
| 86 | + app(MigrationService::class)->updateSchema( |
|
| 87 | + self::SCHEMA_MIGRATION_PREFIX, |
|
| 88 | + self::SCHEMA_SETTING_NAME, |
|
| 89 | + self::SCHEMA_TARGET_VERSION |
|
| 90 | + ); |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * {@inheritDoc} |
|
| 95 | + * @see \MyArtJaub\Webtrees\Module\ModuleMyArtJaubInterface::loadRoutes() |
|
| 96 | + */ |
|
| 97 | + public function loadRoutes(Map $router): void |
|
| 98 | + { |
|
| 99 | + $router->attach('', '', static function (Map $router): void { |
|
| 100 | + |
|
| 101 | + $router->attach('', '/module-maj/hooks', static function (Map $router): void { |
|
| 102 | + |
|
| 103 | + $router->attach('', '/config/admin', static function (Map $router): void { |
|
| 104 | + |
|
| 105 | + $router->get(AdminConfigPage::class, '', AdminConfigPage::class); |
|
| 106 | + $router->get(ModulesHooksPage::class, '/{hook_name}', ModulesHooksPage::class); |
|
| 107 | + $router->post(ModulesHooksAction::class, '/{hook_name}', ModulesHooksAction::class); |
|
| 108 | + }); |
|
| 109 | + }); |
|
| 110 | + }); |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * {@inheritDoc} |
|
| 115 | + * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion() |
|
| 116 | + */ |
|
| 117 | + public function customModuleVersion(): string |
|
| 118 | + { |
|
| 119 | + return '2.1.0-v.1'; |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + /** |
|
| 123 | + * {@inheritDoc} |
|
| 124 | + * @see \Fisharebest\Webtrees\Module\ModuleConfigInterface::getConfigLink() |
|
| 125 | + */ |
|
| 126 | + public function getConfigLink(): string |
|
| 127 | + { |
|
| 128 | + return route(AdminConfigPage::class); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * {@inheritDoc} |
|
| 133 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\ModuleHookSubscriberInterface::listSubscribedHooks() |
|
| 134 | + */ |
|
| 135 | + public function listSubscribedHooks(): array |
|
| 136 | + { |
|
| 137 | + return [ |
|
| 138 | + app()->makeWith(CustomSimpleTagEditorCollector::class, ['module' => $this]), |
|
| 139 | + app()->makeWith(FactSourceTextExtenderCollector::class, ['module' => $this]), |
|
| 140 | + app()->makeWith(FamilyDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 141 | + app()->makeWith(IndividualDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 142 | + app()->makeWith(NameAccordionExtenderCollector::class, ['module' => $this]), |
|
| 143 | + app()->makeWith(RecordNameTextExtenderCollector::class, ['module' => $this]), |
|
| 144 | + app()->makeWith(SosaFamilyDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 145 | + app()->makeWith(SosaIndividualDatatablesExtenderCollector::class, ['module' => $this]), |
|
| 146 | + app()->makeWith(SosaMissingDatatablesExtenderCollector::class, ['module' => $this]) |
|
| 147 | + ]; |
|
| 148 | + } |
|
| 149 | 149 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | // How to update the database schema for this module |
| 56 | 56 | private const SCHEMA_TARGET_VERSION = 2; |
| 57 | 57 | private const SCHEMA_SETTING_NAME = 'MAJ_HOOKS_SCHEMA_VERSION'; |
| 58 | - private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema'; |
|
| 58 | + private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__.'\Schema'; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * {@inheritDoc} |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function loadRoutes(Map $router): void |
| 98 | 98 | { |
| 99 | - $router->attach('', '', static function (Map $router): void { |
|
| 99 | + $router->attach('', '', static function(Map $router): void { |
|
| 100 | 100 | |
| 101 | - $router->attach('', '/module-maj/hooks', static function (Map $router): void { |
|
| 101 | + $router->attach('', '/module-maj/hooks', static function(Map $router): void { |
|
| 102 | 102 | |
| 103 | - $router->attach('', '/config/admin', static function (Map $router): void { |
|
| 103 | + $router->attach('', '/config/admin', static function(Map $router): void { |
|
| 104 | 104 | |
| 105 | 105 | $router->get(AdminConfigPage::class, '', AdminConfigPage::class); |
| 106 | 106 | $router->get(ModulesHooksPage::class, '/{hook_name}', ModulesHooksPage::class); |
@@ -27,52 +27,52 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class RecordNameTextExtenderCollector extends AbstractHookCollector implements RecordNameTextExtenderInterface |
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Text extender for records’ name'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Text extender for records’ name'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | - */ |
|
| 43 | - public function description(): string |
|
| 44 | - { |
|
| 45 | - return I18N::translate('Extends the full name of GEDCOM records with additional text or icons.'); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | + */ |
|
| 43 | + public function description(): string |
|
| 44 | + { |
|
| 45 | + return I18N::translate('Extends the full name of GEDCOM records with additional text or icons.'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return RecordNameTextExtenderInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return RecordNameTextExtenderInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNamePrepend() |
|
| 60 | - */ |
|
| 61 | - public function recordNamePrepend(GedcomRecord $record, bool $use_long = false, string $size = ''): string |
|
| 62 | - { |
|
| 63 | - return $this->hooks() |
|
| 64 | - ->map(fn(RecordNameTextExtenderInterface $hook) => $hook->recordNamePrepend($record, $use_long, $size)) |
|
| 65 | - ->implode(''); |
|
| 66 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNamePrepend() |
|
| 60 | + */ |
|
| 61 | + public function recordNamePrepend(GedcomRecord $record, bool $use_long = false, string $size = ''): string |
|
| 62 | + { |
|
| 63 | + return $this->hooks() |
|
| 64 | + ->map(fn(RecordNameTextExtenderInterface $hook) => $hook->recordNamePrepend($record, $use_long, $size)) |
|
| 65 | + ->implode(''); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * {@inheritDoc} |
|
| 70 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNameAppend() |
|
| 71 | - */ |
|
| 72 | - public function recordNameAppend(GedcomRecord $record, bool $use_long = false, string $size = ''): string |
|
| 73 | - { |
|
| 74 | - return $this->hooks() |
|
| 75 | - ->map(fn(RecordNameTextExtenderInterface $hook) => $hook->recordNameAppend($record, $use_long, $size)) |
|
| 76 | - ->implode(''); |
|
| 77 | - } |
|
| 68 | + /** |
|
| 69 | + * {@inheritDoc} |
|
| 70 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\RecordNameTextExtenderInterface::recordNameAppend() |
|
| 71 | + */ |
|
| 72 | + public function recordNameAppend(GedcomRecord $record, bool $use_long = false, string $size = ''): string |
|
| 73 | + { |
|
| 74 | + return $this->hooks() |
|
| 75 | + ->map(fn(RecordNameTextExtenderInterface $hook) => $hook->recordNameAppend($record, $use_long, $size)) |
|
| 76 | + ->implode(''); |
|
| 77 | + } |
|
| 78 | 78 | } |
@@ -27,64 +27,64 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class CustomSimpleTagEditorCollector extends AbstractHookCollector implements CustomSimpleTagEditorInterface |
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Custom simple tag editor'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Custom simple tag editor'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | - */ |
|
| 43 | - public function description(): string |
|
| 44 | - { |
|
| 45 | - return I18N::translate('Allows for the edition of simple custom tags.'); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | + */ |
|
| 43 | + public function description(): string |
|
| 44 | + { |
|
| 45 | + return I18N::translate('Allows for the edition of simple custom tags.'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return CustomSimpleTagEditorInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return CustomSimpleTagEditorInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\CustomSimpleTagEditorInterface::addExpectedTags() |
|
| 60 | - */ |
|
| 61 | - public function addExpectedTags(array $expected_tags): array |
|
| 62 | - { |
|
| 63 | - return $this->hooks()->reduce( |
|
| 64 | - fn(array $tags, CustomSimpleTagEditorInterface $hook): array => $hook->addExpectedTags($tags), |
|
| 65 | - $expected_tags |
|
| 66 | - ); |
|
| 67 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\CustomSimpleTagEditorInterface::addExpectedTags() |
|
| 60 | + */ |
|
| 61 | + public function addExpectedTags(array $expected_tags): array |
|
| 62 | + { |
|
| 63 | + return $this->hooks()->reduce( |
|
| 64 | + fn(array $tags, CustomSimpleTagEditorInterface $hook): array => $hook->addExpectedTags($tags), |
|
| 65 | + $expected_tags |
|
| 66 | + ); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * {@inheritDoc} |
|
| 71 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\CustomSimpleTagEditorInterface::getLabel() |
|
| 72 | - */ |
|
| 73 | - public function getLabel(string $tag): string |
|
| 74 | - { |
|
| 75 | - return $this->hooks() |
|
| 76 | - ->map(fn(CustomSimpleTagEditorInterface $hook) => $hook->getLabel($tag)) |
|
| 77 | - ->first(fn(string $label) => $label !== '') ?? ''; |
|
| 78 | - } |
|
| 69 | + /** |
|
| 70 | + * {@inheritDoc} |
|
| 71 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\CustomSimpleTagEditorInterface::getLabel() |
|
| 72 | + */ |
|
| 73 | + public function getLabel(string $tag): string |
|
| 74 | + { |
|
| 75 | + return $this->hooks() |
|
| 76 | + ->map(fn(CustomSimpleTagEditorInterface $hook) => $hook->getLabel($tag)) |
|
| 77 | + ->first(fn(string $label) => $label !== '') ?? ''; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - /** |
|
| 81 | - * {@inheritDoc} |
|
| 82 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\CustomSimpleTagEditorInterface::editForm() |
|
| 83 | - */ |
|
| 84 | - public function editForm(string $tag, string $id, string $name, string $value, Tree $tree): string |
|
| 85 | - { |
|
| 86 | - return $this->hooks() |
|
| 87 | - ->map(fn(CustomSimpleTagEditorInterface $hook): string => $hook->editForm($tag, $id, $name, $value, $tree)) |
|
| 88 | - ->implode(''); |
|
| 89 | - } |
|
| 80 | + /** |
|
| 81 | + * {@inheritDoc} |
|
| 82 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\CustomSimpleTagEditorInterface::editForm() |
|
| 83 | + */ |
|
| 84 | + public function editForm(string $tag, string $id, string $name, string $value, Tree $tree): string |
|
| 85 | + { |
|
| 86 | + return $this->hooks() |
|
| 87 | + ->map(fn(CustomSimpleTagEditorInterface $hook): string => $hook->editForm($tag, $id, $name, $value, $tree)) |
|
| 88 | + ->implode(''); |
|
| 89 | + } |
|
| 90 | 90 | } |
@@ -27,41 +27,41 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class NameAccordionExtenderCollector extends AbstractHookCollector implements NameAccordionExtenderInterface |
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Individual names accordion extender'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Individual names accordion extender'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | - */ |
|
| 43 | - public function description(): string |
|
| 44 | - { |
|
| 45 | - return I18N::translate('Extends the names accordion of on an individual’s page.'); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | + */ |
|
| 43 | + public function description(): string |
|
| 44 | + { |
|
| 45 | + return I18N::translate('Extends the names accordion of on an individual’s page.'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return NameAccordionExtenderInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return NameAccordionExtenderInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\NameAccordionExtenderInterface::accordionCard() |
|
| 60 | - */ |
|
| 61 | - public function accordionCard(Individual $individual): string |
|
| 62 | - { |
|
| 63 | - return $this->hooks() |
|
| 64 | - ->map(fn(NameAccordionExtenderInterface $hook) => $hook->accordionCard($individual)) |
|
| 65 | - ->implode(''); |
|
| 66 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\NameAccordionExtenderInterface::accordionCard() |
|
| 60 | + */ |
|
| 61 | + public function accordionCard(Individual $individual): string |
|
| 62 | + { |
|
| 63 | + return $this->hooks() |
|
| 64 | + ->map(fn(NameAccordionExtenderInterface $hook) => $hook->accordionCard($individual)) |
|
| 65 | + ->implode(''); |
|
| 66 | + } |
|
| 67 | 67 | } |
@@ -25,45 +25,45 @@ |
||
| 25 | 25 | * @extends AbstractHookCollector<SosaFamilyDatatablesExtenderInterface> |
| 26 | 26 | */ |
| 27 | 27 | class SosaFamilyDatatablesExtenderCollector extends AbstractHookCollector implements |
| 28 | - SosaFamilyDatatablesExtenderInterface |
|
| 28 | + SosaFamilyDatatablesExtenderInterface |
|
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Columns extender for tables of ancestors’ families'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Columns extender for tables of ancestors’ families'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | - */ |
|
| 43 | - public function description(): string |
|
| 44 | - { |
|
| 45 | - return I18N::translate('Add additional columns to tables of ancestors’ families'); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | + */ |
|
| 43 | + public function description(): string |
|
| 44 | + { |
|
| 45 | + return I18N::translate('Add additional columns to tables of ancestors’ families'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return SosaFamilyDatatablesExtenderInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return SosaFamilyDatatablesExtenderInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaFamilyDatatablesExtenderInterface::sosaFamilyColumns() |
|
| 60 | - */ |
|
| 61 | - public function sosaFamilyColumns(iterable $records): array |
|
| 62 | - { |
|
| 63 | - $result = []; |
|
| 64 | - foreach ($this->hooks() as $hook) { |
|
| 65 | - $result = array_merge($result, $hook->sosaFamilyColumns($records)); |
|
| 66 | - } |
|
| 67 | - return $result; |
|
| 68 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaFamilyDatatablesExtenderInterface::sosaFamilyColumns() |
|
| 60 | + */ |
|
| 61 | + public function sosaFamilyColumns(iterable $records): array |
|
| 62 | + { |
|
| 63 | + $result = []; |
|
| 64 | + foreach ($this->hooks() as $hook) { |
|
| 65 | + $result = array_merge($result, $hook->sosaFamilyColumns($records)); |
|
| 66 | + } |
|
| 67 | + return $result; |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -27,52 +27,52 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class FactSourceTextExtenderCollector extends AbstractHookCollector implements FactSourceTextExtenderInterface |
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Text extender for source citations’ title'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Text extender for source citations’ title'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | - */ |
|
| 43 | - public function description(): string |
|
| 44 | - { |
|
| 45 | - return I18N::translate('Extends the title of source citations with additional text or icons.'); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | + */ |
|
| 43 | + public function description(): string |
|
| 44 | + { |
|
| 45 | + return I18N::translate('Extends the title of source citations with additional text or icons.'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return FactSourceTextExtenderInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return FactSourceTextExtenderInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourcePrepend() |
|
| 60 | - */ |
|
| 61 | - public function factSourcePrepend(Tree $tree, string $source_record, int $level): string |
|
| 62 | - { |
|
| 63 | - return $this->hooks() |
|
| 64 | - ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 65 | - ->implode(''); |
|
| 66 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourcePrepend() |
|
| 60 | + */ |
|
| 61 | + public function factSourcePrepend(Tree $tree, string $source_record, int $level): string |
|
| 62 | + { |
|
| 63 | + return $this->hooks() |
|
| 64 | + ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 65 | + ->implode(''); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * {@inheritDoc} |
|
| 70 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourceAppend() |
|
| 71 | - */ |
|
| 72 | - public function factSourceAppend(Tree $tree, string $source_record, int $level): string |
|
| 73 | - { |
|
| 74 | - return $this->hooks() |
|
| 75 | - ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 76 | - ->implode(''); |
|
| 77 | - } |
|
| 68 | + /** |
|
| 69 | + * {@inheritDoc} |
|
| 70 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourceAppend() |
|
| 71 | + */ |
|
| 72 | + public function factSourceAppend(Tree $tree, string $source_record, int $level): string |
|
| 73 | + { |
|
| 74 | + return $this->hooks() |
|
| 75 | + ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 76 | + ->implode(''); |
|
| 77 | + } |
|
| 78 | 78 | } |
@@ -25,45 +25,45 @@ |
||
| 25 | 25 | * @extends AbstractHookCollector<IndividualDatatablesExtenderInterface> |
| 26 | 26 | */ |
| 27 | 27 | class IndividualDatatablesExtenderCollector extends AbstractHookCollector implements |
| 28 | - IndividualDatatablesExtenderInterface |
|
| 28 | + IndividualDatatablesExtenderInterface |
|
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Columns extender for tables of individuals'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Columns extender for tables of individuals'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | - */ |
|
| 43 | - public function description(): string |
|
| 44 | - { |
|
| 45 | - return I18N::translate('Add additional columns to tables of individuals'); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | + */ |
|
| 43 | + public function description(): string |
|
| 44 | + { |
|
| 45 | + return I18N::translate('Add additional columns to tables of individuals'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return IndividualDatatablesExtenderInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return IndividualDatatablesExtenderInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\IndividualDatatablesExtenderInterface::individualColumns() |
|
| 60 | - */ |
|
| 61 | - public function individualColumns(iterable $records): array |
|
| 62 | - { |
|
| 63 | - $result = []; |
|
| 64 | - foreach ($this->hooks() as $hook) { |
|
| 65 | - $result = array_merge($result, $hook->individualColumns($records)); |
|
| 66 | - } |
|
| 67 | - return $result; |
|
| 68 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\IndividualDatatablesExtenderInterface::individualColumns() |
|
| 60 | + */ |
|
| 61 | + public function individualColumns(iterable $records): array |
|
| 62 | + { |
|
| 63 | + $result = []; |
|
| 64 | + foreach ($this->hooks() as $hook) { |
|
| 65 | + $result = array_merge($result, $hook->individualColumns($records)); |
|
| 66 | + } |
|
| 67 | + return $result; |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -25,45 +25,45 @@ |
||
| 25 | 25 | * @extends AbstractHookCollector<SosaMissingDatatablesExtenderInterface> |
| 26 | 26 | */ |
| 27 | 27 | class SosaMissingDatatablesExtenderCollector extends AbstractHookCollector implements |
| 28 | - SosaMissingDatatablesExtenderInterface |
|
| 28 | + SosaMissingDatatablesExtenderInterface |
|
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Columns extender for tables of missing ancestors'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Columns extender for tables of missing ancestors'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * {@inheritDoc} |
|
| 41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | - */ |
|
| 43 | - public function description(): string |
|
| 44 | - { |
|
| 45 | - return I18N::translate('Add additional columns to tables of missing ancestors'); |
|
| 46 | - } |
|
| 39 | + /** |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
| 42 | + */ |
|
| 43 | + public function description(): string |
|
| 44 | + { |
|
| 45 | + return I18N::translate('Add additional columns to tables of missing ancestors'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return SosaMissingDatatablesExtenderInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return SosaMissingDatatablesExtenderInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaMissingDatatablesExtenderInterface::sosaMissingColumns() |
|
| 60 | - */ |
|
| 61 | - public function sosaMissingColumns(iterable $records): array |
|
| 62 | - { |
|
| 63 | - $result = []; |
|
| 64 | - foreach ($this->hooks() as $hook) { |
|
| 65 | - $result = array_merge($result, $hook->sosaMissingColumns($records)); |
|
| 66 | - } |
|
| 67 | - return $result; |
|
| 68 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaMissingDatatablesExtenderInterface::sosaMissingColumns() |
|
| 60 | + */ |
|
| 61 | + public function sosaMissingColumns(iterable $records): array |
|
| 62 | + { |
|
| 63 | + $result = []; |
|
| 64 | + foreach ($this->hooks() as $hook) { |
|
| 65 | + $result = array_merge($result, $hook->sosaMissingColumns($records)); |
|
| 66 | + } |
|
| 67 | + return $result; |
|
| 68 | + } |
|
| 69 | 69 | } |