From 76692c8b291f16d9251d67f27078779f6737fe7e Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Mon, 8 Jun 2015 15:09:08 +0100 Subject: PHPDoc --- action.php | 3 +- addmedia.php | 3 +- admin.php | 3 +- admin_media.php | 3 +- admin_media_upload.php | 3 +- admin_module_blocks.php | 3 +- admin_module_menus.php | 3 +- admin_module_reports.php | 3 +- admin_module_sidebar.php | 3 +- admin_module_tabs.php | 3 +- admin_modules.php | 3 +- admin_pgv_to_wt.php | 3 +- admin_site_access.php | 3 +- admin_site_change.php | 3 +- admin_site_clean.php | 3 +- admin_site_config.php | 3 +- admin_site_info.php | 3 +- admin_site_logs.php | 3 +- admin_site_merge.php | 3 +- admin_site_readme.php | 3 +- admin_site_upgrade.php | 3 +- admin_trees_check.php | 13 +- admin_trees_config.php | 3 +- admin_trees_download.php | 3 +- admin_trees_duplicates.php | 3 +- admin_trees_export.php | 3 +- admin_trees_manage.php | 3 +- admin_trees_merge.php | 3 +- admin_trees_places.php | 3 +- admin_trees_renumber.php | 3 +- admin_users.php | 3 +- admin_users_bulk.php | 3 +- ancestry.php | 3 +- app/Auth.php | 5 +- app/ColorGenerator.php | 21 +- app/Config.php | 8 +- app/Controller/AdvancedSearchController.php | 24 +- app/Controller/AjaxController.php | 8 +- app/Controller/AncestryController.php | 6 +- app/Controller/BaseController.php | 16 +- app/Controller/BranchesController.php | 6 +- app/Controller/ChartController.php | 6 +- app/Controller/CompactController.php | 14 +- app/Controller/DescendancyController.php | 9 +- app/Controller/FamilyBookController.php | 5 +- app/Controller/FamilyController.php | 20 +- app/Controller/FanchartController.php | 5 +- app/Controller/GedcomRecordController.php | 6 +- app/Controller/HourglassController.php | 21 +- app/Controller/IndividualController.php | 18 +- app/Controller/LifespanController.php | 35 +- app/Controller/MediaController.php | 5 +- app/Controller/NoteController.php | 5 +- app/Controller/PageController.php | 5 +- app/Controller/PedigreeController.php | 5 +- app/Controller/RelationshipController.php | 5 +- app/Controller/RepositoryController.php | 5 +- app/Controller/SearchController.php | 5 +- app/Controller/SimpleController.php | 5 +- app/Controller/SourceController.php | 6 +- app/Controller/TimelineController.php | 10 +- app/Database.php | 6 +- app/Date.php | 30 +- app/Date/CalendarDate.php | 5 +- app/Date/FrenchDate.php | 83 ++- app/Date/GregorianDate.php | 14 +- app/Date/HijriDate.php | 61 +- app/Date/JalaliDate.php | 61 +- app/Date/JewishDate.php | 88 ++- app/Date/JulianDate.php | 38 +- app/Date/RomanDate.php | 5 +- app/Fact.php | 6 +- app/Family.php | 61 +- app/File.php | 5 +- app/Filter.php | 5 +- app/FlashMessages.php | 6 +- app/Functions/Functions.php | 8 +- app/Functions/FunctionsCharts.php | 4 +- app/Functions/FunctionsDate.php | 6 +- app/Functions/FunctionsDb.php | 6 +- app/Functions/FunctionsEdit.php | 17 +- app/Functions/FunctionsExport.php | 4 +- app/Functions/FunctionsImport.php | 3 +- app/Functions/FunctionsMedia.php | 4 +- app/Functions/FunctionsPrint.php | 23 +- app/Functions/FunctionsPrintFacts.php | 11 +- app/Functions/FunctionsPrintLists.php | 3 +- app/Functions/FunctionsRtl.php | 22 +- app/GedcomCode/GedcomCodeAdop.php | 6 +- app/GedcomCode/GedcomCodeName.php | 4 +- app/GedcomCode/GedcomCodePedi.php | 4 +- app/GedcomCode/GedcomCodeQuay.php | 5 +- app/GedcomCode/GedcomCodeRela.php | 4 +- app/GedcomCode/GedcomCodeStat.php | 4 +- app/GedcomCode/GedcomCodeTemp.php | 4 +- app/GedcomRecord.php | 10 +- app/GedcomTag.php | 5 +- app/HitCounter.php | 5 +- app/Html.php | 3 +- app/I18N.php | 17 +- app/Individual.php | 37 +- app/Log.php | 3 +- app/Mail.php | 5 +- app/Media.php | 50 +- app/Menu.php | 26 +- app/Module.php | 6 +- app/Module/AbstractModule.php | 8 +- app/Module/AhnentafelReportModule.php | 30 +- app/Module/AlbumModule.php | 57 +- app/Module/BatchUpdate/BatchUpdateBasePlugin.php | 7 +- .../BatchUpdateDuplicateLinksPlugin.php | 4 +- .../BatchUpdate/BatchUpdateMarriedNamesPlugin.php | 8 +- .../BatchUpdate/BatchUpdateMissingDeathPlugin.php | 4 +- .../BatchUpdate/BatchUpdateNameFormatPlugin.php | 4 +- .../BatchUpdate/BatchUpdateSearchReplacePlugin.php | 27 +- app/Module/BatchUpdateModule.php | 30 +- app/Module/BirthDeathMarriageReportModule.php | 30 +- app/Module/BirthReportModule.php | 4 +- app/Module/CemeteryReportModule.php | 4 +- app/Module/CensusAssistantModule.php | 20 +- app/Module/ChangeReportModule.php | 4 +- app/Module/ChartsBlockModule.php | 30 +- app/Module/CkeditorModule.php | 4 +- .../ClippingsCart/ClippingsCartController.php | 5 +- app/Module/ClippingsCartModule.php | 19 +- app/Module/DeathReportModule.php | 4 +- app/Module/DescendancyModule.php | 31 +- app/Module/DescendancyReportModule.php | 4 +- app/Module/ExtraInformationModule.php | 10 +- app/Module/FactSourcesReportModule.php | 4 +- app/Module/FamiliesSidebarModule.php | 27 +- app/Module/FamilyGroupReportModule.php | 4 +- app/Module/FamilyNavigatorModule.php | 18 +- .../FamilyTreeFavorites/Schema/Migration0.php | 6 +- .../FamilyTreeFavorites/Schema/Migration1.php | 6 +- .../FamilyTreeFavorites/Schema/Migration2.php | 6 +- .../FamilyTreeFavorites/Schema/Migration3.php | 6 +- app/Module/FamilyTreeFavoritesModule.php | 68 ++- app/Module/FamilyTreeNews/Schema/Migration0.php | 6 +- app/Module/FamilyTreeNews/Schema/Migration1.php | 6 +- app/Module/FamilyTreeNews/Schema/Migration2.php | 6 +- app/Module/FamilyTreeNewsModule.php | 48 +- app/Module/FamilyTreeStatisticsModule.php | 30 +- app/Module/FrequentlyAskedQuestionsModule.php | 11 +- app/Module/GoogleMaps/Schema/Migration0.php | 6 +- app/Module/GoogleMaps/Schema/Migration1.php | 6 +- app/Module/GoogleMaps/Schema/Migration2.php | 6 +- app/Module/GoogleMaps/Schema/Migration3.php | 6 +- app/Module/GoogleMaps/Schema/Migration4.php | 6 +- app/Module/GoogleMaps/Schema/Migration5.php | 6 +- app/Module/GoogleMapsModule.php | 63 +- app/Module/HtmlBlockModule.php | 22 +- app/Module/IndividualFactsTabModule.php | 4 +- app/Module/IndividualFamiliesReportModule.php | 4 +- app/Module/IndividualReportModule.php | 4 +- app/Module/IndividualSidebarModule.php | 27 +- app/Module/InteractiveTree/TreeView.php | 7 +- app/Module/InteractiveTreeModule.php | 14 +- app/Module/LoggedInUsersModule.php | 22 +- app/Module/LoginBlockModule.php | 22 +- app/Module/MarriageReportModule.php | 4 +- app/Module/MediaTabModule.php | 5 +- app/Module/MissingFactsReportModule.php | 4 +- app/Module/ModuleBlockInterface.php | 10 +- app/Module/ModuleChartInterface.php | 3 +- app/Module/ModuleConfigInterface.php | 3 +- app/Module/ModuleMenuInterface.php | 4 +- app/Module/ModuleReportInterface.php | 4 +- app/Module/ModuleSidebarInterface.php | 3 +- app/Module/ModuleTabInterface.php | 3 +- app/Module/ModuleThemeInterface.php | 3 +- app/Module/NotesTabModule.php | 5 +- app/Module/OccupationReportModule.php | 4 +- app/Module/OnThisDayModule.php | 30 +- app/Module/PageMenuModule.php | 4 +- app/Module/PedigreeReportModule.php | 4 +- app/Module/RecentChangesModule.php | 30 +- app/Module/RelatedIndividualsReportModule.php | 4 +- app/Module/RelativesTabModule.php | 27 +- app/Module/ResearchTaskModule.php | 29 +- app/Module/ReviewChangesModule.php | 30 +- app/Module/SiteMapModule.php | 13 +- app/Module/SlideShowModule.php | 22 +- app/Module/SourcesTabModule.php | 5 +- app/Module/StoriesModule.php | 11 +- app/Module/ThemeSelectModule.php | 23 +- app/Module/TopGivenNamesModule.php | 30 +- app/Module/TopPageViewsModule.php | 63 +- app/Module/TopSurnamesModule.php | 40 +- app/Module/UpcomingAnniversariesModule.php | 40 +- app/Module/UserFavoritesModule.php | 26 +- app/Module/UserJournalModule.php | 48 +- app/Module/UserMessagesModule.php | 30 +- app/Module/UserWelcomeModule.php | 22 +- app/Module/WelcomeBlockModule.php | 22 +- app/Module/YahrzeitModule.php | 29 +- app/Note.php | 32 +- app/Place.php | 35 +- app/Query/QueryMedia.php | 6 +- app/Query/QueryName.php | 6 +- app/Report/ReportBase.php | 4 +- app/Report/ReportBaseCell.php | 4 +- app/Report/ReportBaseElement.php | 26 +- app/Report/ReportBaseFootnote.php | 16 +- app/Report/ReportBaseHtml.php | 18 +- app/Report/ReportBaseImage.php | 7 +- app/Report/ReportBaseLine.php | 7 +- app/Report/ReportBasePageheader.php | 10 +- app/Report/ReportBaseText.php | 7 +- app/Report/ReportBaseTextbox.php | 14 +- app/Report/ReportHtml.php | 45 +- app/Report/ReportHtmlCell.php | 3 +- app/Report/ReportHtmlFootnote.php | 3 +- app/Report/ReportHtmlHtml.php | 5 +- app/Report/ReportHtmlImage.php | 3 +- app/Report/ReportHtmlLine.php | 3 +- app/Report/ReportHtmlPageheader.php | 5 +- app/Report/ReportHtmlText.php | 5 +- app/Report/ReportHtmlTextbox.php | 5 +- app/Report/ReportParserBase.php | 6 +- app/Report/ReportParserGenerate.php | 95 +-- app/Report/ReportParserSetup.php | 4 +- app/Report/ReportPdf.php | 8 +- app/Report/ReportPdfCell.php | 4 +- app/Report/ReportPdfFootnote.php | 3 +- app/Report/ReportPdfHtml.php | 5 +- app/Report/ReportPdfImage.php | 5 +- app/Report/ReportPdfLine.php | 3 +- app/Report/ReportPdfPageheader.php | 3 +- app/Report/ReportPdfText.php | 4 +- app/Report/ReportPdfTextbox.php | 3 +- app/Report/ReportTcpdf.php | 20 +- app/Repository.php | 26 +- app/Schema/Migration0.php | 10 +- app/Schema/Migration1.php | 10 +- app/Schema/Migration10.php | 10 +- app/Schema/Migration11.php | 10 +- app/Schema/Migration12.php | 10 +- app/Schema/Migration13.php | 10 +- app/Schema/Migration14.php | 10 +- app/Schema/Migration15.php | 10 +- app/Schema/Migration16.php | 10 +- app/Schema/Migration17.php | 10 +- app/Schema/Migration18.php | 10 +- app/Schema/Migration19.php | 10 +- app/Schema/Migration2.php | 10 +- app/Schema/Migration20.php | 10 +- app/Schema/Migration21.php | 10 +- app/Schema/Migration22.php | 10 +- app/Schema/Migration23.php | 10 +- app/Schema/Migration24.php | 10 +- app/Schema/Migration25.php | 10 +- app/Schema/Migration26.php | 10 +- app/Schema/Migration27.php | 10 +- app/Schema/Migration28.php | 10 +- app/Schema/Migration29.php | 10 +- app/Schema/Migration3.php | 10 +- app/Schema/Migration4.php | 10 +- app/Schema/Migration5.php | 8 +- app/Schema/Migration6.php | 10 +- app/Schema/Migration7.php | 10 +- app/Schema/Migration8.php | 10 +- app/Schema/Migration9.php | 10 +- app/Schema/MigrationInterface.php | 5 +- app/Session.php | 6 +- app/Site.php | 5 +- app/Soundex.php | 9 +- app/Source.php | 34 +- app/SpecialChars.php | 5 +- app/SpecialChars/AbstractSpecialChars.php | 5 +- app/SpecialChars/SpecialCharsAf.php | 5 +- app/SpecialChars/SpecialCharsAr.php | 5 +- app/SpecialChars/SpecialCharsCs.php | 5 +- app/SpecialChars/SpecialCharsDa.php | 5 +- app/SpecialChars/SpecialCharsDe.php | 5 +- app/SpecialChars/SpecialCharsEl.php | 5 +- app/SpecialChars/SpecialCharsEn.php | 5 +- app/SpecialChars/SpecialCharsEs.php | 5 +- app/SpecialChars/SpecialCharsEu.php | 9 +- app/SpecialChars/SpecialCharsFi.php | 5 +- app/SpecialChars/SpecialCharsFr.php | 5 +- app/SpecialChars/SpecialCharsGd.php | 5 +- app/SpecialChars/SpecialCharsHaw.php | 5 +- app/SpecialChars/SpecialCharsHe.php | 5 +- app/SpecialChars/SpecialCharsHu.php | 5 +- app/SpecialChars/SpecialCharsInterface.php | 5 +- app/SpecialChars/SpecialCharsIs.php | 5 +- app/SpecialChars/SpecialCharsIt.php | 5 +- app/SpecialChars/SpecialCharsLt.php | 5 +- app/SpecialChars/SpecialCharsNl.php | 5 +- app/SpecialChars/SpecialCharsNn.php | 5 +- app/SpecialChars/SpecialCharsPl.php | 5 +- app/SpecialChars/SpecialCharsPt.php | 5 +- app/SpecialChars/SpecialCharsRu.php | 5 +- app/SpecialChars/SpecialCharsSk.php | 5 +- app/SpecialChars/SpecialCharsSl.php | 5 +- app/SpecialChars/SpecialCharsSv.php | 5 +- app/SpecialChars/SpecialCharsTr.php | 5 +- app/SpecialChars/SpecialCharsVi.php | 5 +- app/Statement.php | 13 +- app/Stats.php | 654 ++++++++++++++++++++- app/Theme.php | 6 +- app/Theme/AbstractTheme.php | 14 +- app/Theme/AdministrationTheme.php | 6 +- app/Theme/CloudsTheme.php | 6 +- app/Theme/ColorsTheme.php | 6 +- app/Theme/FabTheme.php | 6 +- app/Theme/MinimalTheme.php | 6 +- app/Theme/ThemeInterface.php | 17 +- app/Theme/WebtreesTheme.php | 6 +- app/Theme/XeneaTheme.php | 6 +- app/Tree.php | 5 +- app/User.php | 5 +- autocomplete.php | 15 +- block_edit.php | 3 +- branches.php | 3 +- calendar.php | 3 +- compact.php | 3 +- descendancy.php | 3 +- edit_changes.php | 3 +- edit_interface.php | 3 +- editnews.php | 3 +- edituser.php | 3 +- expand_view.php | 3 +- family.php | 3 +- familybook.php | 3 +- famlist.php | 3 +- fanchart.php | 3 +- find.php | 5 +- gedrecord.php | 3 +- help_text.php | 3 +- hourglass.php | 3 +- hourglass_ajax.php | 3 +- import.php | 3 +- includes/php_53_compatibility.php | 9 +- includes/session.php | 3 +- index.php | 3 +- index_edit.php | 3 +- indilist.php | 3 +- individual.php | 3 +- inverselink.php | 3 +- lifespan.php | 4 +- login.php | 3 +- logout.php | 3 +- mediafirewall.php | 7 +- medialist.php | 3 +- mediaviewer.php | 3 +- message.php | 3 +- module.php | 3 +- modules_v3/GEDFact_assistant/MEDIA_ctrl.php | 4 +- .../_MEDIA/media_0_inverselink.php | 3 +- .../GEDFact_assistant/census/census-edit.php | 4 +- .../GEDFact_assistant/census/census-save.php | 4 +- modules_v3/GEDFact_assistant/module.php | 3 +- modules_v3/ahnentafel_report/module.php | 3 +- modules_v3/batch_update/module.php | 3 +- modules_v3/bdm_report/module.php | 3 +- modules_v3/birth_report/module.php | 3 +- modules_v3/cemetery_report/module.php | 3 +- modules_v3/change_report/module.php | 3 +- modules_v3/charts/module.php | 3 +- modules_v3/ckeditor/module.php | 3 +- modules_v3/clippings/module.php | 3 +- modules_v3/death_report/module.php | 3 +- modules_v3/descendancy/module.php | 3 +- modules_v3/descendancy_report/module.php | 3 +- modules_v3/extra_info/module.php | 3 +- modules_v3/fact_sources/module.php | 3 +- modules_v3/families/module.php | 3 +- modules_v3/family_group_report/module.php | 3 +- modules_v3/family_nav/module.php | 3 +- modules_v3/faq/module.php | 3 +- modules_v3/gedcom_block/module.php | 3 +- modules_v3/gedcom_favorites/module.php | 3 +- modules_v3/gedcom_news/module.php | 4 +- modules_v3/gedcom_stats/module.php | 3 +- modules_v3/googlemap/module.php | 4 +- modules_v3/html/module.php | 3 +- modules_v3/individual_ext_report/module.php | 3 +- modules_v3/individual_report/module.php | 3 +- modules_v3/individuals/module.php | 3 +- modules_v3/lightbox/module.php | 3 +- modules_v3/logged_in/module.php | 3 +- modules_v3/login_block/module.php | 3 +- modules_v3/marriage_report/module.php | 3 +- modules_v3/media/module.php | 3 +- modules_v3/missing_facts_report/module.php | 3 +- modules_v3/notes/module.php | 3 +- modules_v3/occupation_report/module.php | 3 +- modules_v3/page_menu/module.php | 3 +- modules_v3/pedigree_report/module.php | 3 +- modules_v3/personal_facts/module.php | 3 +- modules_v3/random_media/module.php | 3 +- modules_v3/recent_changes/module.php | 3 +- modules_v3/relative_ext_report/module.php | 3 +- modules_v3/relatives/module.php | 3 +- modules_v3/review_changes/module.php | 3 +- modules_v3/sitemap/module.php | 3 +- modules_v3/sources_tab/module.php | 3 +- modules_v3/stories/module.php | 3 +- modules_v3/theme_select/module.php | 3 +- modules_v3/todays_events/module.php | 3 +- modules_v3/todo/module.php | 3 +- modules_v3/top10_givnnames/module.php | 3 +- modules_v3/top10_pageviews/module.php | 3 +- modules_v3/top10_surnames/module.php | 3 +- modules_v3/tree/module.php | 3 +- modules_v3/upcoming_events/module.php | 3 +- modules_v3/user_blog/module.php | 3 +- modules_v3/user_favorites/module.php | 3 +- modules_v3/user_messages/module.php | 3 +- modules_v3/user_welcome/module.php | 3 +- modules_v3/yahrzeit/module.php | 3 +- note.php | 3 +- notelist.php | 3 +- pedigree.php | 3 +- phpdoc.xml | 1 + placelist.php | 3 +- relationship.php | 3 +- repo.php | 3 +- repolist.php | 3 +- reportengine.php | 4 +- search.php | 3 +- search_advanced.php | 3 +- setup.php | 3 +- site-offline.php | 3 +- site-unavailable.php | 3 +- source.php | 3 +- sourcelist.php | 3 +- statistics.php | 3 +- statisticsplot.php | 11 +- themes/_administration/theme.php | 3 +- themes/clouds/theme.php | 3 +- themes/colors/theme.php | 3 +- themes/fab/theme.php | 3 +- themes/minimal/theme.php | 3 +- themes/webtrees/theme.php | 3 +- themes/xenea/theme.php | 3 +- timeline.php | 3 +- 439 files changed, 3215 insertions(+), 1573 deletions(-) diff --git a/action.php b/action.php index b385ac9b24..cdb3572682 100644 --- a/action.php +++ b/action.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/addmedia.php b/addmedia.php index 7dcad4ce45..dda40c03e2 100644 --- a/addmedia.php +++ b/addmedia.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin.php b/admin.php index 4daa73d8ed..3cacee26f4 100644 --- a/admin.php +++ b/admin.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_media.php b/admin_media.php index f7dc6da0a4..b383903f3a 100644 --- a/admin_media.php +++ b/admin_media.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\AjaxController; use Fisharebest\Webtrees\Controller\PageController; diff --git a/admin_media_upload.php b/admin_media_upload.php index a972ba5ba1..3722221ee0 100644 --- a/admin_media_upload.php +++ b/admin_media_upload.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_module_blocks.php b/admin_module_blocks.php index 89d4bdc5fd..d11aea612a 100644 --- a/admin_module_blocks.php +++ b/admin_module_blocks.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_module_menus.php b/admin_module_menus.php index a7f454f5ee..efd963b236 100644 --- a/admin_module_menus.php +++ b/admin_module_menus.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_module_reports.php b/admin_module_reports.php index b83ab56751..af711e3301 100644 --- a/admin_module_reports.php +++ b/admin_module_reports.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_module_sidebar.php b/admin_module_sidebar.php index ce8eb5e8eb..1e2dc6bebc 100644 --- a/admin_module_sidebar.php +++ b/admin_module_sidebar.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_module_tabs.php b/admin_module_tabs.php index 9e081f351d..ccc75ddd86 100644 --- a/admin_module_tabs.php +++ b/admin_module_tabs.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_modules.php b/admin_modules.php index f49ccae743..b51b2c8ad6 100644 --- a/admin_modules.php +++ b/admin_modules.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_pgv_to_wt.php b/admin_pgv_to_wt.php index 6f7dfaa005..e61413a90d 100644 --- a/admin_pgv_to_wt.php +++ b/admin_pgv_to_wt.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use PDO; diff --git a/admin_site_access.php b/admin_site_access.php index fe40dd42a5..cbc5b807c0 100644 --- a/admin_site_access.php +++ b/admin_site_access.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_site_change.php b/admin_site_change.php index 07dd3eaa5d..daee36acf5 100644 --- a/admin_site_change.php +++ b/admin_site_change.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_site_clean.php b/admin_site_clean.php index 0c1be70716..a6df361dac 100644 --- a/admin_site_clean.php +++ b/admin_site_clean.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Rhumsaa\Uuid\Uuid; diff --git a/admin_site_config.php b/admin_site_config.php index 801bca16cb..04b529803c 100644 --- a/admin_site_config.php +++ b/admin_site_config.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_site_info.php b/admin_site_info.php index 2e37659da8..7af3bee264 100644 --- a/admin_site_info.php +++ b/admin_site_info.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; diff --git a/admin_site_logs.php b/admin_site_logs.php index d06cdf60c9..03e841af65 100644 --- a/admin_site_logs.php +++ b/admin_site_logs.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsEdit; diff --git a/admin_site_merge.php b/admin_site_merge.php index e7be4fb258..a5c8dcddce 100644 --- a/admin_site_merge.php +++ b/admin_site_merge.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_site_readme.php b/admin_site_readme.php index ff70f22551..a63149b851 100644 --- a/admin_site_readme.php +++ b/admin_site_readme.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Michelf\MarkdownExtra; diff --git a/admin_site_upgrade.php b/admin_site_upgrade.php index 50646c122b..4f8190ee65 100644 --- a/admin_site_upgrade.php +++ b/admin_site_upgrade.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\Functions; diff --git a/admin_trees_check.php b/admin_trees_check.php index 9ae5601ae4..2cdabd3ae9 100644 --- a/admin_trees_check.php +++ b/admin_trees_check.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php @@ -195,6 +194,8 @@ foreach ($all_links as $xref1 => $links) { } /** + * Create a message linking one record to another. + * * @param string $type1 * @param string $xref1 * @param string $type2 @@ -213,6 +214,8 @@ function link_message($type1, $xref1, $type2, $xref2) { } /** + * Format a link to a record. + * * @param string $xref * * @return string @@ -222,6 +225,8 @@ function format_link($xref) { } /** + * Format a record type. + * * @param string $type * * @return string @@ -231,6 +236,8 @@ function format_type($type) { } /** + * Format an error message. + * * @param string $message * * @return string @@ -243,6 +250,8 @@ function error($message) { } /** + * Format a warning message. + * * @param string $message * * @return string diff --git a/admin_trees_config.php b/admin_trees_config.php index 451371fd2a..fb7505666a 100644 --- a/admin_trees_config.php +++ b/admin_trees_config.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_trees_download.php b/admin_trees_download.php index 88927a0f26..def6f483b0 100644 --- a/admin_trees_download.php +++ b/admin_trees_download.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_trees_duplicates.php b/admin_trees_duplicates.php index 174da03f0b..8d6d880c6c 100644 --- a/admin_trees_duplicates.php +++ b/admin_trees_duplicates.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_trees_export.php b/admin_trees_export.php index 3efb8e711a..bfff7521ef 100644 --- a/admin_trees_export.php +++ b/admin_trees_export.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_trees_manage.php b/admin_trees_manage.php index 26f7587174..6c0ca25111 100644 --- a/admin_trees_manage.php +++ b/admin_trees_manage.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_trees_merge.php b/admin_trees_merge.php index a92f1f6e36..d1954e8e24 100644 --- a/admin_trees_merge.php +++ b/admin_trees_merge.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_trees_places.php b/admin_trees_places.php index eefd33b683..5e1e46f966 100644 --- a/admin_trees_places.php +++ b/admin_trees_places.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_trees_renumber.php b/admin_trees_renumber.php index 9875860671..1edcd32523 100644 --- a/admin_trees_renumber.php +++ b/admin_trees_renumber.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/admin_users.php b/admin_users.php index 31e4ddfd0c..39373b2b2f 100644 --- a/admin_users.php +++ b/admin_users.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsDate; diff --git a/admin_users_bulk.php b/admin_users_bulk.php index bb1b9b2a9e..ec8729bd6f 100644 --- a/admin_users_bulk.php +++ b/admin_users_bulk.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Controller\PageController; diff --git a/ancestry.php b/ancestry.php index a208f89c6c..166b05bfb7 100644 --- a/ancestry.php +++ b/ancestry.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Defined in session.php diff --git a/app/Auth.php b/app/Auth.php index d6aaeecdc7..bcad5ccfd1 100644 --- a/app/Auth.php +++ b/app/Auth.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class Auth - authentication functions + * Authentication. */ class Auth { // Privacy constants diff --git a/app/ColorGenerator.php b/app/ColorGenerator.php index 199f844928..6fdea9c523 100644 --- a/app/ColorGenerator.php +++ b/app/ColorGenerator.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class colorGenerator + * Generate a range of colurs for the lifespan chart. */ class ColorGenerator { - /** @var int */ + /** @var int Current hue */ private $hue; - /** @var int */ + /** @var int Initial hue*/ private $basehue; - /** @var int */ + /** @var int Saturation */ private $saturation; - /** @var int */ + /** @var int Lightness */ private $lightness; - /** @var int */ + /** @var int Initial lightness*/ private $baselightness; - /** @var int */ + /** @var int Alpha transparancy */ private $alpha; - /** @var int */ + /** @var int Clockwise or anticlockwise color wheel */ private $range; /** + * Create a color generator. + * * @param int $hue (0Deg = Red, 120Deg = green, 240Deg = blue) * @param int $saturation * @param int $lightness diff --git a/app/Config.php b/app/Config.php index c232b16637..a91d6b733b 100644 --- a/app/Config.php +++ b/app/Config.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class Config - Application configuration data. Data here has no - * GUI to edit it, although most of it can be altered to customise local - * installations. + * Application configuration data. Data here has no GUI to edit it, + * although most of it can be altered to customise local installations. */ class Config { /** diff --git a/app/Controller/AdvancedSearchController.php b/app/Controller/AdvancedSearchController.php index 51911f08d1..a3fbd6db3b 100644 --- a/app/Controller/AdvancedSearchController.php +++ b/app/Controller/AdvancedSearchController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Functions\FunctionsPrintLists; @@ -24,13 +24,17 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Soundex; /** - * Class AdvancedSearchController - Controller for the advanced search page + * Controller for the advanced search page */ class AdvancedSearchController extends SearchController { + /** @var string[] Fields to search */ public $fields = array(); + + /** @var string[] Field values to search */ public $values = array(); + + /** @var int[] Range of days either side of target date */ public $plusminus = array(); - public $errors = array(); /** * Startup activity @@ -167,6 +171,8 @@ class AdvancedSearchController extends SearchController { } /** + * Get the value. + * * @param int $i * * @return string @@ -181,6 +187,8 @@ class AdvancedSearchController extends SearchController { } /** + * Get the field. + * * @param int $i * * @return string @@ -195,6 +203,8 @@ class AdvancedSearchController extends SearchController { } /** + * Get the index. + * * @param string $field * * @return int @@ -204,6 +214,8 @@ class AdvancedSearchController extends SearchController { } /** + * Get the label. + * * @param string $tag * * @return string @@ -635,7 +647,9 @@ class AdvancedSearchController extends SearchController { } } - /** {@inheritdoc} */ + /** + * Display the search results + */ public function printResults() { if ($this->myindilist) { uasort($this->myindilist, '\Fisharebest\Webtrees\GedcomRecord::compare'); diff --git a/app/Controller/AjaxController.php b/app/Controller/AjaxController.php index e67f292935..4bbdce6a0f 100644 --- a/app/Controller/AjaxController.php +++ b/app/Controller/AjaxController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; /** - * Class AjaxController - Base controller for all popup pages + * Base controller for all popup pages */ class AjaxController extends BaseController { /** + * Print the page header, using the theme + * * @return $this */ public function pageHeader() { @@ -33,6 +34,7 @@ class AjaxController extends BaseController { } /** + * Print the page footer, using the theme */ public function pageFooter() { // Ajax responses may have Javascript diff --git a/app/Controller/AncestryController.php b/app/Controller/AncestryController.php index 51f31f0491..461534d0c6 100644 --- a/app/Controller/AncestryController.php +++ b/app/Controller/AncestryController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsCharts; use Fisharebest\Webtrees\Functions\FunctionsPrint; @@ -23,7 +23,7 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Theme; /** - * Class AncestryController - Controller for the ancestry chart + * Controller for the ancestry chart */ class AncestryController extends ChartController { /** @var int Show boxes for cousins */ diff --git a/app/Controller/BaseController.php b/app/Controller/BaseController.php index e18f6d73e5..d4edd94939 100644 --- a/app/Controller/BaseController.php +++ b/app/Controller/BaseController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Database; /** - * Class BaseController - Base controller for all other controllers + * Base controller for all other controllers */ class BaseController { // The controller accumulates Javascript (inline and external), and renders it in the footer - const JS_PRIORITY_HIGH = 0; - const JS_PRIORITY_NORMAL = 1; - const JS_PRIORITY_LOW = 2; + const JS_PRIORITY_HIGH = 0; + const JS_PRIORITY_NORMAL = 1; + const JS_PRIORITY_LOW = 2; + + /** @var string[][] Inline JavaScript to add to the page. */ private $inline_javascript = array( self::JS_PRIORITY_HIGH => array(), self::JS_PRIORITY_NORMAL => array(), self::JS_PRIORITY_LOW => array(), ); + + /** @var string[] Exteral JavaScript files to load. */ private $external_javascript = array(); /** diff --git a/app/Controller/BranchesController.php b/app/Controller/BranchesController.php index 012e91f87b..ccd6215c5f 100644 --- a/app/Controller/BranchesController.php +++ b/app/Controller/BranchesController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Family; @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Soundex; /** - * Class BranchesController - Controller for the branches list + * Controller for the branches list */ class BranchesController extends PageController { /** @var string Generate the branches for this surname */ diff --git a/app/Controller/ChartController.php b/app/Controller/ChartController.php index 19f0f02f52..59fae077dd 100644 --- a/app/Controller/ChartController.php +++ b/app/Controller/ChartController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Theme; /** - * Class ChartController - Base controller for all chart pages + * Base controller for all chart pages */ class ChartController extends PageController { /** @var Individual Who is chart about? */ diff --git a/app/Controller/CompactController.php b/app/Controller/CompactController.php index 3b914bc151..a73b4c491f 100644 --- a/app/Controller/CompactController.php +++ b/app/Controller/CompactController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; /** - * Class CompactController - Controller for the compact chart + * Controller for the compact chart */ class CompactController extends ChartController { - // Data for the view + /** @var bool Data for the view .*/ public $show_thumbs = false; - // Date for the controller + /** int[] Data for the controller. */ private $treeid = array(); /** @@ -49,6 +49,8 @@ class CompactController extends ChartController { } /** + * Get an individual by their SOSA number. + * * @param int $n * * @return string @@ -100,6 +102,8 @@ class CompactController extends ChartController { } /** + * Get an arrow, pointing to other generations. + * * @param int $n * @param string $arrow_dir * diff --git a/app/Controller/DescendancyController.php b/app/Controller/DescendancyController.php index d2bfe2424a..7071be6158 100644 --- a/app/Controller/DescendancyController.php +++ b/app/Controller/DescendancyController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\Filter; @@ -27,7 +26,7 @@ use Fisharebest\Webtrees\Theme; use Rhumsaa\Uuid\Uuid; /** - * Class DescendancyController - Controller for the descendancy chart + * Controller for the descendancy chart */ class DescendancyController extends ChartController { /** @var int Show boxes for cousins */ @@ -39,8 +38,10 @@ class DescendancyController extends ChartController { /** @var int Number of generations to display */ public $generations; - // d'Aboville numbering system [ http://www.saintclair.org/numbers/numdob.html ] + /** @var array d'Aboville numbering system */ public $dabo_num = array(); + + /** @var array d'Aboville numbering system */ public $dabo_sex = array(); /** diff --git a/app/Controller/FamilyBookController.php b/app/Controller/FamilyBookController.php index 2aac9d6ef9..454f8f9a7a 100644 --- a/app/Controller/FamilyBookController.php +++ b/app/Controller/FamilyBookController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsPrint; @@ -23,7 +22,7 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Theme; /** - * Class FamilyBookController - Controller for the familybook chart + * Controller for the familybook chart */ class FamilyBookController extends ChartController { /** @var int Whether to show spouse details */ diff --git a/app/Controller/FamilyController.php b/app/Controller/FamilyController.php index d0d31f3403..0fcbaeb33a 100644 --- a/app/Controller/FamilyController.php +++ b/app/Controller/FamilyController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\Filter; @@ -27,7 +27,7 @@ use Fisharebest\Webtrees\Menu; use Fisharebest\Webtrees\Module; /** - * Class FamilyController - Controller for the family page + * Controller for the family page */ class FamilyController extends GedcomRecordController { /** @@ -75,20 +75,6 @@ class FamilyController extends GedcomRecordController { return parent::getSignificantFamily(); } - /** - * @param string[] $tags an array of HUSB/WIFE/CHIL - * - * @return string - */ - public function getTimelineIndis($tags) { - preg_match_all('/\n1 (?:' . implode('|', $tags) . ') @(' . WT_REGEX_XREF . ')@/', $this->record->getGedcom(), $matches); - foreach ($matches[1] as &$match) { - $match = 'pids%5B%5D=' . $match; - } - - return implode('&', $matches[1]); - } - /** * get edit menu */ diff --git a/app/Controller/FanchartController.php b/app/Controller/FanchartController.php index b6c9b2855f..60c0aca949 100644 --- a/app/Controller/FanchartController.php +++ b/app/Controller/FanchartController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; @@ -23,7 +22,7 @@ use Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Theme; /** - * Class FanchartController Controller for the fan chart + * Controller for the fan chart */ class FanchartController extends ChartController { /** @var int Style of fanchart */ diff --git a/app/Controller/GedcomRecordController.php b/app/Controller/GedcomRecordController.php index ebaf14eb9b..9be223977c 100644 --- a/app/Controller/GedcomRecordController.php +++ b/app/Controller/GedcomRecordController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\FlashMessages; use Fisharebest\Webtrees\GedcomRecord; @@ -27,7 +27,7 @@ use Fisharebest\Webtrees\Repository; use Fisharebest\Webtrees\Source; /** - * Class GedcomRecordController - Base controller for all GedcomRecord controllers + * Base controller for all GedcomRecord controllers */ class GedcomRecordController extends PageController { /** diff --git a/app/Controller/HourglassController.php b/app/Controller/HourglassController.php index abcf723008..b843e27f04 100644 --- a/app/Controller/HourglassController.php +++ b/app/Controller/HourglassController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsPrint; @@ -23,32 +22,36 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Theme; /** - * Class HourglassController - Controller for the hourglass chart + * Controller for the hourglass chart */ class HourglassController extends ChartController { - /** @var int Whether to show spouse details */ + /** @var int Whether to show spouse details. */ public $show_spouse; - /** @var int Number of ascendancy generations to show */ + /** @var int Number of ascendancy generations to show. */ public $generations; - /** @var int Number of descendancy generations that exist */ + /** @var int Number of descendancy generations that exist. */ private $dgenerations; - /** @var int Half height of personbox */ + /** @var int Half height of personbox. */ public $bhalfheight; - // Left and right get reversed on RTL pages + /** @var string An arrow that points to the start of the line */ private $left_arrow; + + /** @var string An arrow that points to the end of the line. */ private $right_arrow; - /** @var bool Can the Javascript be loaded by the controller */ + /** @var bool Can the Javascript be loaded by the controller. */ private $canLoadJS; const LINK = ""; const SWITCH_LINK = "%s"; /** + * Create the hourglass controller. + * * @param string $rootid * @param int $show_full * @param bool $loadJS diff --git a/app/Controller/IndividualController.php b/app/Controller/IndividualController.php index 8777a44a3f..b5a0629ae4 100644 --- a/app/Controller/IndividualController.php +++ b/app/Controller/IndividualController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; @@ -33,12 +32,16 @@ use Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\User; /** - * Class IndividualController - Controller for the individual page + * Controller for the individual page */ class IndividualController extends GedcomRecordController { + /** @var int Count of names */ public $name_count = 0; + + /** @var int Count of names. */ public $total_names = 0; + /** ModuleTabInterface[] List of tabs to show */ public $tabs; /** @@ -427,11 +430,16 @@ class IndividualController extends GedcomRecordController { } /** - * @param Family $family + * Get the description for the family. + * + * For example, "XXX's family with new wife". + * + * @param Family $family + * @param Individual $individual * * @return string */ - public function getSpouseFamilyLabel(Family $family, $individual) { + public function getSpouseFamilyLabel(Family $family, Individual $individual) { $spouse = $family->getSpouse($individual); if ($spouse) { return diff --git a/app/Controller/LifespanController.php b/app/Controller/LifespanController.php index c7f8eac2aa..c6017206ca 100644 --- a/app/Controller/LifespanController.php +++ b/app/Controller/LifespanController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\ColorGenerator; use Fisharebest\Webtrees\Database; @@ -36,7 +35,7 @@ use Fisharebest\Webtrees\Place; use Fisharebest\Webtrees\Session; /** - * Class LifespanController - Controller for the timeline chart + * Controller for the timeline chart */ class LifespanController extends PageController { // Base color parameters @@ -53,7 +52,7 @@ class LifespanController extends PageController { /** @var string|null Chart parameter */ public $place = null; -/** @var int|null Chart parameter */ + /** @var int|null Chart parameter */ public $beginYear = null; /** @var int|null Chart parameter */ @@ -65,46 +64,46 @@ class LifespanController extends PageController { /** @var string Chart parameter */ public $showDetails; - /** @var Individual[] */ + /** @var Individual[] A list of individuals to display. */ private $people = array(); - /** @var string */ + /** @var string The default calendar to use. */ private $defaultCalendar; - /** @var string */ + /** @var string Which calendar to use. */ private $calendar; - /** @var string */ + /** @var string Which calendar escape to use. */ private $calendarEscape; - /** @var int */ + /** @var int The earliest year to show. */ private $timelineMinYear; - /** @var int */ + /** @var int That latest year to show. */ private $timelineMaxYear; - /** @var int */ + /** @var int The current year. */ private $currentYear; - /** @var string[] */ + /** @var string[] A list of colors to use. */ private $colors = array(); - /** @var Place|null */ + /** @var Place|null A place to serarh. */ private $place_obj = null; - /** @var Date|null */ + /** @var Date|null Start of the date range. */ private $startDate = null; - /** @var Date|null */ + /** @var Date|null End of the date range. */ private $endDate = null; - /** @var bool */ + /** @var bool Only match dates in the chosen calendar. */ private $strictDate; - /** @var string[] */ + /** @var string[] List of facts/events to include. */ private $facts; - /** @var string[] */ + /** @var string[] Facts and events to exclude from the chart */ private $nonfacts = array( 'FAMS', 'FAMC', 'MAY', 'BLOB', 'OBJE', 'SEX', 'NAME', 'SOUR', 'NOTE', 'BAPL', 'ENDL', 'SLGC', 'SLGS', '_TODO', '_WT_OBJE_SORT', 'CHAN', 'HUSB', 'WIFE', 'CHIL', 'OCCU', 'ASSO', diff --git a/app/Controller/MediaController.php b/app/Controller/MediaController.php index b7b968a473..9fa31934bf 100644 --- a/app/Controller/MediaController.php +++ b/app/Controller/MediaController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Fact; @@ -26,7 +25,7 @@ use Fisharebest\Webtrees\Menu; use Fisharebest\Webtrees\Module; /** - * Class MediaController - Controller for the media page + * Controller for the media page */ class MediaController extends GedcomRecordController { /** diff --git a/app/Controller/NoteController.php b/app/Controller/NoteController.php index 129168dee4..f314a7bcaf 100644 --- a/app/Controller/NoteController.php +++ b/app/Controller/NoteController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; @@ -24,7 +23,7 @@ use Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Note; /** - * Class NoteController - Controller for the shared note page + * Controller for the shared note page */ class NoteController extends GedcomRecordController { /** diff --git a/app/Controller/PageController.php b/app/Controller/PageController.php index 848774552a..e24aa6a2f9 100644 --- a/app/Controller/PageController.php +++ b/app/Controller/PageController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; @@ -26,7 +25,7 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Theme; /** - * Class PageController Controller for full-page, themed HTML responses + * Controller for full-page, themed HTML responses */ class PageController extends BaseController { /** @var string Some pages have multiple URLs (TODO really?) */ diff --git a/app/Controller/PedigreeController.php b/app/Controller/PedigreeController.php index 09b7559683..bd8b43c516 100644 --- a/app/Controller/PedigreeController.php +++ b/app/Controller/PedigreeController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; @@ -22,7 +21,7 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Theme; /** - * Class PedigreeController - Controller for the pedigree chart + * Controller for the pedigree chart */ class PedigreeController extends ChartController { /** diff --git a/app/Controller/RelationshipController.php b/app/Controller/RelationshipController.php index 4478b7d7c1..fe064923c3 100644 --- a/app/Controller/RelationshipController.php +++ b/app/Controller/RelationshipController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Algorithm\Dijkstra; use Fisharebest\Webtrees\Database; @@ -23,7 +22,7 @@ use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\Individual; /** - * Class RelationshipController - Controller for the relationships calculations + * Controller for the relationships calculations */ class RelationshipController extends PageController { /** diff --git a/app/Controller/RepositoryController.php b/app/Controller/RepositoryController.php index 1a4478125e..820e6a8e9d 100644 --- a/app/Controller/RepositoryController.php +++ b/app/Controller/RepositoryController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; @@ -24,7 +23,7 @@ use Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Repository; /** - * Class RepositoryController - Controller for the repository page + * Controller for the repository page */ class RepositoryController extends GedcomRecordController { /** diff --git a/app/Controller/SearchController.php b/app/Controller/SearchController.php index 97171ff3a4..d1e6857fca 100644 --- a/app/Controller/SearchController.php +++ b/app/Controller/SearchController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Config; @@ -33,7 +32,7 @@ use Fisharebest\Webtrees\Source; use Fisharebest\Webtrees\Tree; /** - * Class SearchController - Controller for the search page + * Controller for the search page */ class SearchController extends PageController { /** @var string The type of search to perform */ diff --git a/app/Controller/SimpleController.php b/app/Controller/SimpleController.php index fbbfd4d095..6385766d50 100644 --- a/app/Controller/SimpleController.php +++ b/app/Controller/SimpleController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; /** - * Class SimpleController - Controller for all popup pages + * Controller for all popup pages */ class SimpleController extends PageController { /** diff --git a/app/Controller/SourceController.php b/app/Controller/SourceController.php index 6877a79c5b..5f7c794f4d 100644 --- a/app/Controller/SourceController.php +++ b/app/Controller/SourceController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; @@ -23,7 +23,7 @@ use Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Source; /** - * Class SourceController - Controller for the source page + * Controller for the source page */ class SourceController extends GedcomRecordController { /** diff --git a/app/Controller/TimelineController.php b/app/Controller/TimelineController.php index 85a8095065..555d79d226 100644 --- a/app/Controller/TimelineController.php +++ b/app/Controller/TimelineController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Controller; + use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Date\GregorianDate; use Fisharebest\Webtrees\Fact; @@ -27,7 +27,7 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Theme; /** - * Class TimelineController - Controller for the timeline chart + * Controller for the timeline chart */ class TimelineController extends PageController { /** @var int Height of the age box */ @@ -63,7 +63,7 @@ class TimelineController extends PageController { /** @var int Vertical scale */ public $scale = 2; - // GEDCOM elements that may have DATE data, but should not be displayed + /** @var string[] GEDCOM elements that may have DATE data, but should not be displayed */ private $nonfacts = array('BAPL', 'ENDL', 'SLGC', 'SLGS', '_TODO', 'CHAN'); /** @@ -164,6 +164,8 @@ class TimelineController extends PageController { } /** + * Print a fact for an individual. + * * @param Fact $event */ public function printTimeFact(Fact $event) { diff --git a/app/Database.php b/app/Database.php index 9877f3416a..5b7c35ad7c 100644 --- a/app/Database.php +++ b/app/Database.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Schema\MigrationInterface; use PDO; use PDOException; /** - * Class Database Class - Extend PHP's native PDO class - * to provide database access with logging, etc. + * Extend PHP's native PDO class. */ class Database { /** @var Database Implement the singleton pattern */ diff --git a/app/Date.php b/app/Date.php index 4b471de2e6..f5915f7b27 100644 --- a/app/Date.php +++ b/app/Date.php @@ -1,6 +1,4 @@ . */ - -// Classes for Gedcom Date/Calendar functionality. -// -// -// webtrees: online genealogy -// Copyright (C) 2014 Greg Roach -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +namespace Fisharebest\Webtrees; use Fisharebest\ExtCalendar\GregorianCalendar; use Fisharebest\Webtrees\Date\CalendarDate; @@ -47,12 +26,13 @@ use Fisharebest\Webtrees\Date\JulianDate; use Fisharebest\Webtrees\Date\RomanDate; /** - * Class Date - a representation of GEDCOM dates and date ranges - * NOTE: Since different calendars start their days at different times, (civil + * A representation of GEDCOM dates and date ranges. + * + * Since different calendars start their days at different times, (civil * midnight, solar midnight, sunset, sunrise, etc.), we convert on the basis of * midday. * - * NOTE: We assume that years start on the first day of the first month. Where + * We assume that years start on the first day of the first month. Where * this is not the case (e.g. England prior to 1752), we need to use modified * years or the OS/NS notation "4 FEB 1750/51". */ diff --git a/app/Date/CalendarDate.php b/app/Date/CalendarDate.php index 9bb0962d44..dc6125a969 100644 --- a/app/Date/CalendarDate.php +++ b/app/Date/CalendarDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; use FishareBest\ExtCalendar\CalendarInterface; use FishareBest\ExtCalendar\JewishCalendar; use Fisharebest\Webtrees\I18N; /** - * Class CalendarDate - Classes for Gedcom Date/Calendar functionality. + * Classes for Gedcom Date/Calendar functionality. * * CalendarDate is a base class for classes such as GregorianDate, etc. * + All supported calendars have non-zero days/months/years. diff --git a/app/Date/FrenchDate.php b/app/Date/FrenchDate.php index 3dec17d735..707d21b7e3 100644 --- a/app/Date/FrenchDate.php +++ b/app/Date/FrenchDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; use Fisharebest\ExtCalendar\FrenchCalendar; use Fisharebest\Webtrees\I18N; /** - * Class FrenchDate - Definitions for the French Republican calendar + * Definitions for the French Republican calendar */ class FrenchDate extends CalendarDate { - /** {@inheritdoc} */ + /** @var integer[] Convert GEDCOM month names to month numbers */ public static $MONTH_ABBREV = array('' => 0, 'VEND' => 1, 'BRUM' => 2, 'FRIM' => 3, 'NIVO' => 4, 'PLUV' => 5, 'VENT' => 6, 'GERM' => 7, 'FLOR' => 8, 'PRAI' => 9, 'MESS' => 10, 'THER' => 11, 'FRUC' => 12, 'COMP' => 13); - /** {@inheritdoc} */ + /** + * Create a date from either: + * a Julian day number + * day/month/year strings from a GEDCOM date + * another CalendarDate object + * + * @param array|int|CalendarDate $date + */ public function __construct($date) { $this->calendar = new FrenchCalendar; parent::__construct($date); } - /** {@inheritdoc} */ + /** + * Full month name in nominative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ public static function monthNameNominativeCase($month_number, $leap_year) { static $translated_month_names; @@ -58,7 +71,14 @@ class FrenchDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in genitive case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameGenitiveCase($month_number, $leap_year) { static $translated_month_names; @@ -84,7 +104,14 @@ class FrenchDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in locative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameLocativeCase($month_number, $leap_year) { static $translated_month_names; @@ -110,7 +137,14 @@ class FrenchDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in instrumental case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameInstrumentalCase($month_number, $leap_year) { static $translated_month_names; @@ -136,12 +170,25 @@ class FrenchDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Abbreviated month name + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameAbbreviated($month_number, $leap_year) { return self::monthNameNominativeCase($month_number, $leap_year); } - /** {@inheritdoc} */ + /** + * Full day of th eweek + * + * @param int $day_number + * + * @return string + */ public function dayNames($day_number) { static $translated_day_names; @@ -163,12 +210,22 @@ class FrenchDate extends CalendarDate { return $translated_day_names[$day_number]; } - /** {@inheritdoc} */ + /** + * Abbreviated day of the week + * + * @param int $day_number + * + * @return string + */ protected function dayNamesAbbreviated($day_number) { return $this->dayNames($day_number); } - /** {@inheritdoc} */ + /** + * Generate the %Y format for a date. + * + * @return string + */ protected function formatLongYear() { return $this->numberToRomanNumerals($this->y); } diff --git a/app/Date/GregorianDate.php b/app/Date/GregorianDate.php index 47902f3582..01d34de736 100644 --- a/app/Date/GregorianDate.php +++ b/app/Date/GregorianDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; use Fisharebest\ExtCalendar\GregorianCalendar; /** - * Class GregorianDate - Definitions for the Gregorian calendar + * Definitions for the Gregorian calendar */ class GregorianDate extends CalendarDate { - /** {@inheritdoc} */ + /** + * Create a date from either: + * a Julian day number + * day/month/year strings from a GEDCOM date + * another CalendarDate object + * + * @param array|int|CalendarDate $date + */ public function __construct($date) { $this->calendar = new GregorianCalendar; parent::__construct($date); diff --git a/app/Date/HijriDate.php b/app/Date/HijriDate.php index f15750c71c..4a04f89691 100644 --- a/app/Date/HijriDate.php +++ b/app/Date/HijriDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; use Fisharebest\ExtCalendar\ArabicCalendar; use Fisharebest\Webtrees\I18N; /** - * Class HijriDate - Definitions for the Hijri calendar. + * Definitions for the Hijri calendar. * * Note that these are "theoretical" dates. * "True" dates are based on local lunar observations, and can be a +/- one day. */ class HijriDate extends CalendarDate { - /** {@inheritdoc} */ + /** @var integer[] Convert GEDCOM month names to month numbers */ public static $MONTH_ABBREV = array('' => 0, 'MUHAR' => 1, 'SAFAR' => 2, 'RABIA' => 3, 'RABIT' => 4, 'JUMAA' => 5, 'JUMAT' => 6, 'RAJAB' => 7, 'SHAAB' => 8, 'RAMAD' => 9, 'SHAWW' => 10, 'DHUAQ' => 11, 'DHUAH' => 12); - /** {@inheritdoc} */ + /** + * Create a date from either: + * a Julian day number + * day/month/year strings from a GEDCOM date + * another CalendarDate object + * + * @param array|int|CalendarDate $date + */ public function __construct($date) { $this->calendar = new ArabicCalendar; parent::__construct($date); } - /** {@inheritdoc} */ + /** + * Full month name in nominative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ public static function monthNameNominativeCase($month_number, $leap_year) { static $translated_month_names; @@ -60,7 +73,14 @@ class HijriDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in genitive case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameGenitiveCase($month_number, $leap_year) { static $translated_month_names; @@ -85,7 +105,14 @@ class HijriDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in locative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameLocativeCase($month_number, $leap_year) { static $translated_month_names; @@ -110,7 +137,14 @@ class HijriDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in instrumental case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameInstrumentalCase($month_number, $leap_year) { static $translated_month_names; @@ -135,7 +169,14 @@ class HijriDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Abbreviated month name + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameAbbreviated($month_number, $leap_year) { return self::monthNameNominativeCase($month_number, $leap_year); } diff --git a/app/Date/JalaliDate.php b/app/Date/JalaliDate.php index 355e743f6c..f5274c6d24 100644 --- a/app/Date/JalaliDate.php +++ b/app/Date/JalaliDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; use Fisharebest\ExtCalendar\PersianCalendar; use Fisharebest\Webtrees\I18N; /** - * Class JalaliDate - Definitions for the Jalali calendar + * Definitions for the Jalali calendar */ class JalaliDate extends CalendarDate { - /** {@inheritdoc} */ + /** @var integer[] Convert GEDCOM month names to month numbers */ public static $MONTH_ABBREV = array('' => 0, 'FARVA' => 1, 'ORDIB' => 2, 'KHORD' => 3, 'TIR' => 4, 'MORDA' => 5, 'SHAHR' => 6, 'MEHR' => 7, 'ABAN' => 8, 'AZAR' => 9, 'DEY' => 10, 'BAHMA' => 11, 'ESFAN' => 12); - /** {@inheritdoc} */ + /** + * Create a date from either: + * a Julian day number + * day/month/year strings from a GEDCOM date + * another CalendarDate object + * + * @param array|int|CalendarDate $date + */ public function __construct($date) { $this->calendar = new PersianCalendar; parent::__construct($date); } - /** {@inheritdoc} */ + /** + * Full month name in nominative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ public static function monthNameNominativeCase($month_number, $leap_year) { static $translated_month_names; @@ -57,7 +70,14 @@ class JalaliDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in genitive case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameGenitiveCase($month_number, $leap_year) { static $translated_month_names; @@ -82,7 +102,14 @@ class JalaliDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in locative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameLocativeCase($month_number, $leap_year) { static $translated_month_names; @@ -107,7 +134,14 @@ class JalaliDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Full month name in instrumental case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameInstrumentalCase($month_number, $leap_year) { static $translated_month_names; @@ -132,7 +166,14 @@ class JalaliDate extends CalendarDate { return $translated_month_names[$month_number]; } - /** {@inheritdoc} */ + /** + * Abbreviated month name + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameAbbreviated($month_number, $leap_year) { static $translated_month_names; diff --git a/app/Date/JewishDate.php b/app/Date/JewishDate.php index 65cb102ee1..9ec3605619 100644 --- a/app/Date/JewishDate.php +++ b/app/Date/JewishDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; use Fisharebest\ExtCalendar\JewishCalendar; use Fisharebest\Webtrees\I18N; /** - * Class JewishDate - Definitions for the Jewish calendar + * Definitions for the Jewish calendar */ class JewishDate extends CalendarDate { - /** {@inheritdoc} */ + /** @var integer[] Convert GEDCOM month names to month numbers */ public static $MONTH_ABBREV = array('' => 0, 'TSH' => 1, 'CSH' => 2, 'KSL' => 3, 'TVT' => 4, 'SHV' => 5, 'ADR' => 6, 'ADS' => 7, 'NSN' => 8, 'IYR' => 9, 'SVN' => 10, 'TMZ' => 11, 'AAV' => 12, 'ELL' => 13); - /** {@inheritdoc} */ + /** + * Create a date from either: + * a Julian day number + * day/month/year strings from a GEDCOM date + * another CalendarDate object + * + * @param array|int|CalendarDate $date + */ public function __construct($date) { $this->calendar = new JewishCalendar; parent::__construct($date); } - /** {@inheritdoc} */ + /** + * Generate the %j format for a date. + * + * @return string + */ protected function formatDay() { if (WT_LOCALE === 'he' || WT_LOCALE === 'yi') { return $this->calendar->numberToHebrewNumerals($this->d, true); @@ -41,7 +51,14 @@ class JewishDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Generate the %y format for a date. + * + * NOTE Short year is NOT a 2-digit year. It is for calendars such as hebrew + * which have a 3-digit form of 4-digit years. + * + * @return string + */ protected function formatShortYear() { if (WT_LOCALE === 'he' || WT_LOCALE === 'yi') { return $this->calendar->numberToHebrewNumerals($this->y, false); @@ -50,7 +67,11 @@ class JewishDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Generate the %Y format for a date. + * + * @return string + */ protected function formatLongYear() { if (WT_LOCALE === 'he' || WT_LOCALE === 'yi') { return $this->calendar->numberToHebrewNumerals($this->y, true); @@ -59,7 +80,14 @@ class JewishDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Full month name in nominative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ public static function monthNameNominativeCase($month_number, $leap_year) { static $translated_month_names; @@ -90,7 +118,14 @@ class JewishDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Full month name in genitive case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameGenitiveCase($month_number, $leap_year) { static $translated_month_names; @@ -121,7 +156,14 @@ class JewishDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Full month name in locative case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameLocativeCase($month_number, $leap_year) { static $translated_month_names; @@ -152,7 +194,14 @@ class JewishDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Full month name in instrumental case. + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameInstrumentalCase($month_number, $leap_year) { static $translated_month_names; @@ -183,12 +232,23 @@ class JewishDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Abbreviated month name + * + * @param int $month_number + * @param bool $leap_year Some calendars use leap months + * + * @return string + */ protected function monthNameAbbreviated($month_number, $leap_year) { return self::monthNameNominativeCase($month_number, $leap_year); } - /** {@inheritdoc} */ + /** + * Which months follows this one? Calendars with leap-months should provide their own implementation. + * + * @return integer[] + */ protected function nextMonth() { if ($this->m == 6 && !$this->isLeapYear()) { return array($this->y, 8); diff --git a/app/Date/JulianDate.php b/app/Date/JulianDate.php index 47cce69731..023a1c0969 100644 --- a/app/Date/JulianDate.php +++ b/app/Date/JulianDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; use Fisharebest\ExtCalendar\JulianCalendar; use Fisharebest\Webtrees\I18N; /** - * Class JulianDate - Definitions for the Julian Proleptic calendar + * Definitions for the Julian Proleptic calendar * (Proleptic means we extend it backwards, prior to its introduction in 46BC) */ class JulianDate extends CalendarDate { /** @var bool True for dates recorded in new-style/old-style format, e.g. 2 FEB 1743/44 */ private $new_old_style = false; - /** {@inheritdoc} */ + /** + * Create a date from either: + * a Julian day number + * day/month/year strings from a GEDCOM date + * another CalendarDate object + * + * @param array|int|CalendarDate $date + */ public function __construct($date) { $this->calendar = new JulianCalendar; parent::__construct($date); } - /** {@inheritdoc} */ + /** + * Most years are 1 more than the previous, but not always (e.g. 1BC->1AD) + * + * @param int $year + * + * @return int + */ protected function nextYear($year) { if ($year == -1) { return 1; @@ -45,7 +57,9 @@ class JulianDate extends CalendarDate { /** * Process new-style/old-style years and years BC * - * {@inheritdoc} + * @param string $year + * + * @return int */ protected function extractYear($year) { if (preg_match('/^(\d\d\d\d)\/\d{1,4}$/', $year, $match)) { @@ -60,7 +74,11 @@ class JulianDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Generate the %Y format for a date. + * + * @return string + */ protected function formatLongYear() { if ($this->y < 0) { return /* I18N: BCE=Before the Common Era, for Julian years < 0. See http://en.wikipedia.org/wiki/Common_Era */ @@ -75,7 +93,11 @@ class JulianDate extends CalendarDate { } } - /** {@inheritdoc} */ + /** + * Generate the %E format for a date. + * + * @return string + */ protected function formatGedcomYear() { if ($this->y < 0) { return sprintf('%04d B.C.', -$this->y); diff --git a/app/Date/RomanDate.php b/app/Date/RomanDate.php index 07bbe56524..7506f9eacd 100644 --- a/app/Date/RomanDate.php +++ b/app/Date/RomanDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Date; /** - * Class RomanDate - Definitions for the Roman calendar + * Definitions for the Roman calendar * * The 5.5.1 gedcom spec mentions this calendar, but gives no details of * how it is to be represented.... This class is just a place holder so that diff --git a/app/Fact.php b/app/Fact.php index 95470d5432..b468f6b085 100644 --- a/app/Fact.php +++ b/app/Fact.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; + use Fisharebest\Webtrees\Functions\FunctionsPrint; /** - * Class Fact - Class that defines an event details object + * A GEDCOM fact or event object. */ class Fact { /** @var string Unique identifier for this fact (currently implemented as a hash of the raw data). */ diff --git a/app/Family.php b/app/Family.php index b602de24be..d7dedd75de 100644 --- a/app/Family.php +++ b/app/Family.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class Family - Class file for a Family + * A GEDCOM family (FAM) object. */ class Family extends GedcomRecord { const RECORD_TYPE = 'FAM'; @@ -29,7 +28,15 @@ class Family extends GedcomRecord { /** @var Individual|null The wife (or second spouse for same-sex couples) */ private $wife; - /** {@inheritdoc} */ + /** + * Create a GedcomRecord object from raw GEDCOM data. + * + * @param string $xref + * @param string $gedcom an empty string for new/pending records + * @param string|null $pending null for a record with no pending edits, + * empty string for records with pending deletions + * @param Tree $tree + */ public function __construct($xref, $gedcom, $pending, $tree) { parent::__construct($xref, $gedcom, $pending, $tree); @@ -51,7 +58,13 @@ class Family extends GedcomRecord { } } - /** {@inheritdoc} */ + /** + * Generate a private version of this record + * + * @param int $access_level + * + * @return string + */ protected function createPrivateGedcomRecord($access_level) { $SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS'); @@ -68,7 +81,14 @@ class Family extends GedcomRecord { return $rec; } - /** {@inheritdoc} */ + /** + * Fetch data from the database + * + * @param string $xref + * @param int $tree_id + * + * @return null|string + */ protected static function fetchGedcomRecord($xref, $tree_id) { return Database::prepare( "SELECT f_gedcom FROM `##families` WHERE f_id = :xref AND f_file = :tree_id" @@ -104,7 +124,13 @@ class Family extends GedcomRecord { } } - /** {@inheritdoc} */ + /** + * Each object type may have its own special rules, and re-implement this function. + * + * @param int $access_level + * + * @return bool + */ protected function canShowByType($access_level) { // Hide a family if any member is private preg_match_all('/\n1 (?:CHIL|HUSB|WIFE) @(' . WT_REGEX_XREF . ')@/', $this->gedcom, $matches); @@ -118,7 +144,13 @@ class Family extends GedcomRecord { return true; } - /** {@inheritdoc} */ + /** + * Can the name of this record be shown? + * + * @param int|null $access_level + * + * @return bool + */ public function canShowName($access_level = null) { // We can always see the name (Husband-name + Wife-name), however, // the name will often be "private + private" @@ -301,7 +333,11 @@ class Family extends GedcomRecord { return array(); } - /** {@inheritdoc} */ + /** + * Derived classes should redefine this function, otherwise the object will have no name + * + * @return string[][] + */ public function getAllNames() { if (is_null($this->_getAllNames)) { // Check the script used by each name, so we can match cyrillic with cyrillic, greek with greek, etc. @@ -364,7 +400,12 @@ class Family extends GedcomRecord { return $this->_getAllNames; } - /** {@inheritdoc} */ + /** + * This function should be redefined in derived classes to show any major + * identifying characteristics of this record. + * + * @return string + */ public function formatListDetails() { return $this->formatFirstMajorFact(WT_EVENTS_MARR, 1) . diff --git a/app/File.php b/app/File.php index a1e324b9d3..61fd93a874 100644 --- a/app/File.php +++ b/app/File.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class File - File manipulation utilities + * File manipulation utilities. */ class File { /** diff --git a/app/Filter.php b/app/Filter.php index 92e50f65c3..57666ea8f7 100644 --- a/app/Filter.php +++ b/app/Filter.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use HTMLPurifier; use HTMLPurifier_Config; use Michelf\MarkdownExtra; /** - * Class Filter - Filter/escape/validate input and output + * Filter input and escape output. */ class Filter { // REGEX to match a URL diff --git a/app/FlashMessages.php b/app/FlashMessages.php index 09c8f1aefe..de68f96ed7 100644 --- a/app/FlashMessages.php +++ b/app/FlashMessages.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class FlashMessages - Flash messages allow us to generate messages - * in one context, and display them in another. + * Generate messages in one request and display them in the next. */ class FlashMessages { // Session storage key diff --git a/app/Functions/Functions.php b/app/Functions/Functions.php index 102ffda709..741e2daa29 100644 --- a/app/Functions/Functions.php +++ b/app/Functions/Functions.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Fact; @@ -473,6 +473,8 @@ class Functions { } /** + * Calculate the name of a cousin. + * * @param int $n * @param string $sex * @@ -665,6 +667,8 @@ class Functions { } /** + * Convert a relationship path into a relationship name. + * * @param string $path * @param Individual $person1 * @param Individual $person2 diff --git a/app/Functions/FunctionsCharts.php b/app/Functions/FunctionsCharts.php index 174af25c9a..96dfcbb772 100644 --- a/app/Functions/FunctionsCharts.php +++ b/app/Functions/FunctionsCharts.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\I18N; diff --git a/app/Functions/FunctionsDate.php b/app/Functions/FunctionsDate.php index 1a6cf66ded..ca5d258ddd 100644 --- a/app/Functions/FunctionsDate.php +++ b/app/Functions/FunctionsDate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; + use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\I18N; @@ -23,6 +23,8 @@ use Fisharebest\Webtrees\I18N; */ class FunctionsDate { /** + * Convert a GEDCOM age string to localized text. + * * @param string $age_string * @param bool $show_years * diff --git a/app/Functions/FunctionsDb.php b/app/Functions/FunctionsDb.php index f0bdabe01a..5f03b23da9 100644 --- a/app/Functions/FunctionsDb.php +++ b/app/Functions/FunctionsDb.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Date; @@ -1002,6 +1002,8 @@ class FunctionsDb { } /** + * Get the blocks for a specified user. + * * @param int $user_id * * @return string[][] diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php index 695a76bc5e..4794c921ae 100644 --- a/app/Functions/FunctionsEdit.php +++ b/app/Functions/FunctionsEdit.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Config; @@ -398,6 +397,8 @@ class FunctionsEdit { } /** + * An HTML link to create a new media object. + * * @param string $element_id * * @return string @@ -407,6 +408,8 @@ class FunctionsEdit { } /** + * An HTML link to create a new repository. + * * @param string $element_id * * @return string @@ -416,6 +419,8 @@ class FunctionsEdit { } /** + * An HTML link to create a new note. + * * @param string $element_id * * @return string @@ -425,6 +430,8 @@ class FunctionsEdit { } /** + * An HTML link to edit a note. + * * @param string $note_id * * @return string @@ -434,6 +441,8 @@ class FunctionsEdit { } /** + * An HTML link to create a new source. + * * @param string $element_id * * @return string @@ -1108,6 +1117,8 @@ class FunctionsEdit { } /** + * Create a form to add a sex record. + * * @return string */ public static function addNewSex() { @@ -1122,6 +1133,8 @@ class FunctionsEdit { } /** + * Create a form to add a new fact. + * * @param string $fact * * @return string diff --git a/app/Functions/FunctionsExport.php b/app/Functions/FunctionsExport.php index 03b0c63ad2..3514c0eb00 100644 --- a/app/Functions/FunctionsExport.php +++ b/app/Functions/FunctionsExport.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Family; diff --git a/app/Functions/FunctionsImport.php b/app/Functions/FunctionsImport.php index c9959635fd..23468e5764 100644 --- a/app/Functions/FunctionsImport.php +++ b/app/Functions/FunctionsImport.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Date; diff --git a/app/Functions/FunctionsMedia.php b/app/Functions/FunctionsMedia.php index 0b06852a61..40f3ffdb6d 100644 --- a/app/Functions/FunctionsMedia.php +++ b/app/Functions/FunctionsMedia.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; + use Fisharebest\Webtrees\Log; /** diff --git a/app/Functions/FunctionsPrint.php b/app/Functions/FunctionsPrint.php index b926ddabdc..ee622d5f30 100644 --- a/app/Functions/FunctionsPrint.php +++ b/app/Functions/FunctionsPrint.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\SearchController; @@ -744,6 +743,8 @@ class FunctionsPrint { } /** + * HTML link to find an individual. + * * @param string $element_id * @param string $indiname * @param Tree $tree @@ -761,6 +762,8 @@ class FunctionsPrint { } /** + * HTML link to find a place. + * * @param string $element_id * * @return string @@ -770,6 +773,8 @@ class FunctionsPrint { } /** + * HTML link to find a family. + * * @param string $element_id * * @return string @@ -779,6 +784,8 @@ class FunctionsPrint { } /** + * HTML link to open the special character window. + * * @param string $element_id * * @return string @@ -788,6 +795,8 @@ class FunctionsPrint { } /** + * HTML element to insert a value from a list. + * * @param string $element_id * @param string[] $choices */ @@ -802,6 +811,8 @@ class FunctionsPrint { } /** + * HTML link to find a source. + * * @param string $element_id * @param string $sourcename * @@ -812,6 +823,8 @@ class FunctionsPrint { } /** + * HTML link to find a note. + * * @param string $element_id * @param string $notename * @@ -822,6 +835,8 @@ class FunctionsPrint { } /** + * HTML link to find a repository. + * * @param string $element_id * * @return string @@ -831,6 +846,8 @@ class FunctionsPrint { } /** + * HTML link to find a media object. + * * @param string $element_id * @param string $choose * @@ -841,6 +858,8 @@ class FunctionsPrint { } /** + * HTML link to find a fact. + * * @param string $element_id * * @return string diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index f8634859c2..ae92ab894a 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Date; @@ -474,7 +473,7 @@ class FunctionsPrintFacts { break; } } - echo FunctionsPrintFacts::printFactSources($fact->getGedcom(), 2); + echo self::printFactSources($fact->getGedcom(), 2); echo FunctionsPrint::printFactNotes($fact->getGedcom(), 2); self::printMediaLinks($fact->getGedcom(), 2); echo ''; @@ -642,7 +641,7 @@ class FunctionsPrintFacts { } } echo FunctionsPrint::printFactNotes($media->getGedcom(), $nlevel); - echo FunctionsPrintFacts::printFactSources($media->getGedcom(), $nlevel); + echo self::printFactSources($media->getGedcom(), $nlevel); echo ''; //close div "media-display-title" echo ''; //close div "media-display" } @@ -1006,7 +1005,7 @@ class FunctionsPrintFacts { echo $text; if (!empty($noterec)) { - echo FunctionsPrintFacts::printFactSources($noterec, 1); + echo self::printFactSources($noterec, 1); } // 2 RESN tags. Note, there can be more than one, such as "privacy" and "locked" @@ -1139,7 +1138,7 @@ class FunctionsPrintFacts { break; } echo FunctionsPrint::printFactNotes($media->getGedcom(), 1); - echo FunctionsPrintFacts::printFactSources($media->getGedcom(), 1); + echo self::printFactSources($media->getGedcom(), 1); } else { echo $xref; } diff --git a/app/Functions/FunctionsPrintLists.php b/app/Functions/FunctionsPrintLists.php index 912c2b88e9..2752c28f90 100644 --- a/app/Functions/FunctionsPrintLists.php +++ b/app/Functions/FunctionsPrintLists.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Functions; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; diff --git a/app/Functions/FunctionsRtl.php b/app/Functions/FunctionsRtl.php index b9cced5edf..7b3497cc66 100644 --- a/app/Functions/FunctionsRtl.php +++ b/app/Functions/FunctionsRtl.php @@ -1,6 +1,4 @@ . */ - -// RTL Functions for use in the PDF/HTML reports +namespace Fisharebest\Webtrees\Functions; use Fisharebest\Webtrees\I18N; /** - * Class FunctionsRtl - common functions + * RTL Functions for use in the PDF/HTML reports */ class FunctionsRtl { const OPEN_PARENTHESES = '([{'; @@ -36,26 +33,34 @@ class FunctionsRtl { const PUNCTUATION = ',.:;?!'; + /** @var string Were we previously processing LTR or RTL. */ private static $previousState; + /** @var string Are we currently processing LTR or RTL. */ private static $currentState; + /** @var string Text waiting to be processed. */ private static $waitingText; + /** @var string LTR text. */ private static $startLTR; + /** @var string LTR text. */ private static $endLTR; + /** @var string RTL text. */ private static $startRTL; + /** @var string RTL text. */ private static $endRTL; + /** @var int Offset into the text. */ private static $lenStart; + /** @var int Offset into the text. */ private static $lenEnd; - private static $spanNumber = 0; - + /** @var int Offset into the text. */ private static $posSpanStart; /** @@ -86,7 +91,6 @@ class FunctionsRtl { // Nothing to do return ''; } - self::$spanNumber++; $workingText = str_replace("\n", '
', $inputText); $workingText = str_replace(array('
', 'class="starredname">'), '
', $workingText); // Reposition some incorrectly placed line breaks @@ -1103,6 +1107,8 @@ class FunctionsRtl { } /** + * Wrap text, similar to the PHP wordwrap() function. + * * @param string $string * @param int $width * @param string $sep diff --git a/app/GedcomCode/GedcomCodeAdop.php b/app/GedcomCode/GedcomCodeAdop.php index cf4a72d41a..af4fe5fa74 100644 --- a/app/GedcomCode/GedcomCodeAdop.php +++ b/app/GedcomCode/GedcomCodeAdop.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\GedcomCode; + use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; @@ -77,7 +77,7 @@ class GedcomCodeAdop { /** * A list of all possible values for PEDI * - * @param null GedcomRecord|null $record + * @param GedcomRecord|null $record * * @return string[] */ diff --git a/app/GedcomCode/GedcomCodeName.php b/app/GedcomCode/GedcomCodeName.php index 3ae6c8b760..62dcc1859b 100644 --- a/app/GedcomCode/GedcomCodeName.php +++ b/app/GedcomCode/GedcomCodeName.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\GedcomCode; + use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; diff --git a/app/GedcomCode/GedcomCodePedi.php b/app/GedcomCode/GedcomCodePedi.php index 71614fb354..3f20c708f0 100644 --- a/app/GedcomCode/GedcomCodePedi.php +++ b/app/GedcomCode/GedcomCodePedi.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\GedcomCode; + use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; diff --git a/app/GedcomCode/GedcomCodeQuay.php b/app/GedcomCode/GedcomCodeQuay.php index 3b71b7b6e5..b6841caf0a 100644 --- a/app/GedcomCode/GedcomCodeQuay.php +++ b/app/GedcomCode/GedcomCodeQuay.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\GedcomCode; + use Fisharebest\Webtrees\I18N; /** * Class GedcomCodeQuay - Functions and logic for GEDCOM "QUAY" codes */ class GedcomCodeQuay { + /** @var string[] Valid values for a QUAY tag. */ private static $TYPES = array('3', '2', '1', '0'); /** diff --git a/app/GedcomCode/GedcomCodeRela.php b/app/GedcomCode/GedcomCodeRela.php index 0b2ffa76f9..3e9abe30ca 100644 --- a/app/GedcomCode/GedcomCodeRela.php +++ b/app/GedcomCode/GedcomCodeRela.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\GedcomCode; + use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; diff --git a/app/GedcomCode/GedcomCodeStat.php b/app/GedcomCode/GedcomCodeStat.php index 888ea34943..2be312830f 100644 --- a/app/GedcomCode/GedcomCodeStat.php +++ b/app/GedcomCode/GedcomCodeStat.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\GedcomCode; + use Fisharebest\Webtrees\I18N; /** diff --git a/app/GedcomCode/GedcomCodeTemp.php b/app/GedcomCode/GedcomCodeTemp.php index 9588d0125f..753392f10f 100644 --- a/app/GedcomCode/GedcomCodeTemp.php +++ b/app/GedcomCode/GedcomCodeTemp.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\GedcomCode; + use Fisharebest\Webtrees\I18N; /** diff --git a/app/GedcomRecord.php b/app/GedcomRecord.php index 51241f0cd8..549ba102f3 100644 --- a/app/GedcomRecord.php +++ b/app/GedcomRecord.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; + use Fisharebest\Webtrees\Functions\Functions; use Fisharebest\Webtrees\Functions\FunctionsDate; use Fisharebest\Webtrees\Functions\FunctionsImport; use Fisharebest\Webtrees\Functions\FunctionsPrint; /** - * Class GedcomRecord - Base class for all gedcom records + * A GEDCOM object. */ class GedcomRecord { const RECORD_TYPE = 'UNKNOWN'; @@ -60,10 +60,10 @@ class GedcomRecord { /** @var int Cached result */ protected $_getSecondaryName; - // Allow getInstance() to return references to existing objects + /** @var GedcomRecord[][] Allow getInstance() to return references to existing objects */ protected static $gedcom_record_cache; - // Fetch all pending edits in one database query + /** @var \stdClass[][] Fetch all pending edits in one database query */ private static $pending_record_cache; /** diff --git a/app/GedcomTag.php b/app/GedcomTag.php index 369ae87926..ec12e135a2 100644 --- a/app/GedcomTag.php +++ b/app/GedcomTag.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Rhumsaa\Uuid\Uuid; /** - * Class GedcomTag - Static GEDCOM data for Tags + * Static GEDCOM data for tags */ class GedcomTag { /** @var string[] All tags that webtrees knows how to translate - including special/internal tags */ diff --git a/app/HitCounter.php b/app/HitCounter.php index c7e542b6ab..1dbec917e8 100644 --- a/app/HitCounter.php +++ b/app/HitCounter.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class HitCounter - measure page popularity + * Measure page popularity. */ class HitCounter { /** diff --git a/app/Html.php b/app/Html.php index d53e70a06a..f98da8f41e 100644 --- a/app/Html.php +++ b/app/Html.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** * Class Html - Add HTML markup to elements consistently. diff --git a/app/I18N.php b/app/I18N.php index 6b94a84904..34e5308542 100644 --- a/app/I18N.php +++ b/app/I18N.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\ExtCalendar\ArabicCalendar; use Fisharebest\ExtCalendar\CalendarInterface; @@ -29,13 +28,13 @@ use Fisharebest\Localization\Translator; use Patchwork\TurkishUtf8; /** - * Class I18N - Functions to support internationalization (i18n) functionality. + * Internationalization (i18n) and localization (l10n). */ class I18N { /** @var LocaleInterface The current locale (e.g. LocaleEnGb) */ private static $locale; - /** @var Translator */ + /** @var Translator An object that performs translation*/ private static $translator; // Digits are always rendered LTR, even in RTL text. @@ -47,13 +46,13 @@ class I18N { const ALPHABET_LOWER = 'aàáâãäåāăąǎǟǡǻȁȃȧḁạảấầẩẫậắằẳẵặⓐaæǣǽbḃḅḇⓑbƀɓƃcçćĉċčḉⅽⓒcƈdďḋḍḏḑḓⅾⓓddždzđɖɗƌðeèéêëēĕėęěȅȇȩḕḗḙḛḝẹẻẽếềểễệⓔeǝəɛfḟⓕfƒgĝğġģǧǵḡⓖgǥɠɣƣhĥȟḣḥḧḩḫⓗhƕħiìíîïĩīĭįǐȉȋḭḯỉịⅰⓘiⅱⅲijⅳⅸɨɩjĵⓙjkķǩḱḳḵⓚkƙlĺļľḷḹḻḽⅼⓛlŀljłƚmḿṁṃⅿⓜmnñńņňǹṅṇṉṋⓝnnjɲƞŋoòóôõöōŏőơǒǫǭȍȏȫȭȯȱṍṏṑṓọỏốồổỗộớờởỡợⓞoœøǿɔɵȣpṕṗⓟpƥqⓠqrŕŗřȑȓṙṛṝṟⓡrʀsśŝşšșṡṣṥṧṩⓢsʃtţťțṫṭṯṱⓣtŧƭʈuùúûüũūŭůűųưǔǖǘǚǜȕȗṳṵṷṹṻụủứừửữựⓤuʉɯʊvṽṿⅴⓥvⅵⅶⅷʋʌwŵẁẃẅẇẉⓦwxẋẍⅹⓧxⅺⅻyýÿŷȳẏỳỵỷỹⓨyƴzźżžẑẓẕⓩzƶȥǯʒƹȝþƿƨƽƅάαἀἁἂἃἄἅἆἇὰάᾀᾁᾂᾃᾄᾅᾆᾇᾰᾱᾳβγδέεἐἑἒἓἔἕὲέϝϛζήηἠἡἢἣἤἥἦἧὴήᾐᾑᾒᾓᾔᾕᾖᾗῃθϊἰἱἲἳἴἵἶἷὶίῐῑκϗλμνξοόὀὁὂὃὄὅὸόπϟϙρῥσϲτυϋύὑὓὕὗὺύῠῡφχψωώὠὡὢὣὤὥὦὧὼώᾠᾡᾢᾣᾤᾥᾦᾧῳϡϸϻϣϥϧϩϫϭϯаӑӓәӛӕбвгґғҕдԁђԃѓҙеѐёӗєжӂӝҗзԅӟѕӡԇиѝӣҋӥіїйјкқӄҡҟҝлӆљԉмӎнӊңӈҥњԋоӧөӫпҧҁрҏсԍҫтԏҭћќуӯўӱӳүұѹфхҳһѡѿѽѻцҵчӵҷӌҹҽҿџшщъыӹьҍѣэӭюяѥѧѫѩѭѯѱѳѵѷҩաբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆȼɂɇɉɋɍɏͱͳͷͻͼͽӏӷӻӽӿԑԓԕԗԙԛԝԟԡԣԥᵹᵽỻỽỿⅎↄⰰⰱⰲⰳⰴⰵⰶⰷⰸⰹⰺⰻⰼⰽⰾⰿⱀⱁⱂⱃⱄⱅⱆⱇⱈⱉⱊⱋⱌⱍⱎⱏⱐⱑⱒⱓⱔⱕⱖⱗⱘⱙⱚⱛⱜⱝⱞⱡⱨⱪⱬⱳⱶⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳬⳮⴀⴁⴂⴃⴄⴅⴆⴇⴈⴉⴊⴋⴌⴍⴎⴏⴐⴑⴒⴓⴔⴕⴖⴗⴘⴙⴚⴛⴜⴝⴞⴟⴠⴡⴢⴣⴤⴥꙁꙃꙅꙇꙉꙋꙍꙏꙑꙓꙕꙗꙙꙛꙝꙟꙣꙥꙧꙩꙫꙭꚁꚃꚅꚇꚉꚋꚍꚏꚑꚓꚕꚗꜣꜥꜧꜩꜫꜭꜯꜳꜵꜷꜹꜻꜽꜿꝁꝃꝅꝇꝉꝋꝍꝏꝑꝓꝕꝗꝙꝛꝝꝟꝡꝣꝥꝧꝩꝫꝭꝯꝺꝼꝿꞁꞃꞅꞇꞌ'; const ALPHABET_UPPER = 'AÀÁÂÃÄÅĀĂĄǍǞǠǺȀȂȦḀẠẢẤẦẨẪẬẮẰẲẴẶⒶAÆǢǼBḂḄḆⒷBɃƁƂCÇĆĈĊČḈⅭⒸCƇDĎḊḌḎḐḒⅮⒹDDŽDZĐƉƊƋÐEÈÉÊËĒĔĖĘĚȄȆȨḔḖḘḚḜẸẺẼẾỀỂỄỆⒺEƎƏƐFḞⒻFƑGĜĞĠĢǦǴḠⒼGǤƓƔƢHĤȞḢḤḦḨḪⒽHǶĦIÌÍÎÏĨĪĬĮǏȈȊḬḮỈỊⅠⒾIⅡⅢIJⅣⅨƗƖJĴⒿJKĶǨḰḲḴⓀKƘLĹĻĽḶḸḺḼⅬⓁLĿLJŁȽMḾṀṂⅯⓂMNÑŃŅŇǸṄṆṈṊⓃNNJƝȠŊOÒÓÔÕÖŌŎŐƠǑǪǬȌȎȪȬȮȰṌṎṐṒỌỎỐỒỔỖỘỚỜỞỠỢⓄOŒØǾƆƟȢPṔṖⓅPƤQⓆQRŔŖŘȐȒṘṚṜṞⓇRƦSŚŜŞŠȘṠṢṤṦṨⓈSƩTŢŤȚṪṬṮṰⓉTŦƬƮUÙÚÛÜŨŪŬŮŰŲƯǓǕǗǙǛȔȖṲṴṶṸṺỤỦỨỪỬỮỰⓊUɄƜƱVṼṾⅤⓋVⅥⅦⅧƲɅWŴẀẂẄẆẈⓌWXẊẌⅩⓍXⅪⅫYÝŸŶȲẎỲỴỶỸⓎYƳZŹŻŽẐẒẔⓏZƵȤǮƷƸȜÞǷƧƼƄΆΑἈἉἊἋἌἍἎἏᾺΆᾈᾉᾊᾋᾌᾍᾎᾏᾸᾹᾼΒΓΔΈΕἘἙἚἛἜἝῈΈϜϚΖΉΗἨἩἪἫἬἭἮἯῊΉᾘᾙᾚᾛᾜᾝᾞᾟῌΘΪἸἹἺἻἼἽἾἿῚΊῘῙΚϏΛΜΝΞΟΌὈὉὊὋὌὍῸΌΠϞϘΡῬΣϹΤΥΫΎὙὛὝὟῪΎῨῩΦΧΨΩΏὨὩὪὫὬὭὮὯῺΏᾨᾩᾪᾫᾬᾭᾮᾯῼϠϷϺϢϤϦϨϪϬϮАӐӒӘӚӔБВГҐҒҔДԀЂԂЃҘЕЀЁӖЄЖӁӜҖЗԄӞЅӠԆИЍӢҊӤІЇЙЈКҚӃҠҞҜЛӅЉԈМӍНӉҢӇҤЊԊОӦӨӪПҦҀРҎСԌҪТԎҬЋЌУӮЎӰӲҮҰѸФХҲҺѠѾѼѺЦҴЧӴҶӋҸҼҾЏШЩЪЫӸЬҌѢЭӬЮЯѤѦѪѨѬѮѰѲѴѶҨԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖȻɁɆɈɊɌɎͰͲͶϽϾϿӀӶӺӼӾԐԒԔԖԘԚԜԞԠԢԤꝽⱣỺỼỾℲↃⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰢⰣⰤⰥⰦⰧⰨⰩⰪⰫⰬⰭⰮⱠⱧⱩⱫⱲⱵⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭႠႡႢႣႤႥႦႧႨႩႪႫႬႭႮႯႰႱႲႳႴႵႶႷႸႹႺႻႼႽႾႿჀჁჂჃჄჅꙀꙂꙄꙆꙈꙊꙌꙎꙐꙒꙔꙖꙘꙚꙜꙞꙢꙤꙦꙨꙪꙬꚀꚂꚄꚆꚈꚊꚌꚎꚐꚒꚔꚖꜢꜤꜦꜨꜪꜬꜮꜲꜴꜶꜸꜺꜼꜾꝀꝂꝄꝆꝈꝊꝌꝎꝐꝒꝔꝖꝘꝚꝜꝞꝠꝢꝤꝦꝨꝪꝬꝮꝹꝻꝾꞀꞂꞄꞆꞋ'; - // Alphabet for the currently selected locale + /** @var string Alphabet, in lower case, for the current locale. */ private static $alphabet_lower = 'abcdefghijklmnopqrstuvwxyz'; + + /** @var string Alphabet, in upper case, for the current locale. */ private static $alphabet_upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - // Lookup table to convert unicode code-points into scripts. - // See https://en.wikipedia.org/wiki/Unicode_block - // Note: we only need details for scripts of languages into which webtrees is translated. + /** @var int[][] Character ranges used by each script. */ private static $scripts = array( array('Latn', 0x0041, 0x005A), // a-z array('Latn', 0x0061, 0x007A), // A-Z @@ -76,7 +75,7 @@ class I18N { array('Hans', 0x20000, 0x2FA1F), // Mixed CJK, not just Hans ); - // Characters that are displayed in mirror form in RTL text. + /** @var string[] Characters that are displayed in mirror form in RTL text. */ private static $mirror_characters = array( '(' => ')', ')' => '(', diff --git a/app/Individual.php b/app/Individual.php index abeb89bda7..458dd651d7 100644 --- a/app/Individual.php +++ b/app/Individual.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Fisharebest\ExtCalendar\GregorianCalendar; use Fisharebest\Webtrees\GedcomCode\GedcomCodePedi; /** - * Class Individual - Class file for an individual + * A GEDCOM individual (INDI) object. */ class Individual extends GedcomRecord { const RECORD_TYPE = 'INDI'; const URL_PREFIX = 'individual.php?pid='; - public $generation; // used in some lists to keep track of this individual’s generation in that list + /** @var int used in some lists to keep track of this individual’s generation in that list */ + public $generation; /** @var Date The estimated date of birth */ private $_getEstimatedBirthDate; @@ -72,7 +72,9 @@ class Individual extends GedcomRecord { /** * Can the name of this record be shown? * - * {@inheritdoc} + * @param int|null $access_level + * + * @return bool */ public function canShowName($access_level = null) { if ($access_level === null) { @@ -83,9 +85,11 @@ class Individual extends GedcomRecord { } /** - * Implement individual-specific privacy logic + * Can this individual be shown? + * + * @param int $access_level * - * {@inheritdoc} + * @return bool */ protected function canShowByType($access_level) { global $WT_TREE; @@ -205,7 +209,13 @@ class Individual extends GedcomRecord { return false; } - /** {@inheritdoc} */ + /** + * Generate a private version of this record + * + * @param int $access_level + * + * @return string + */ protected function createPrivateGedcomRecord($access_level) { $SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS'); @@ -232,7 +242,14 @@ class Individual extends GedcomRecord { return $rec; } - /** {@inheritdoc} */ + /** + * Fetch data from the database + * + * @param string $xref + * @param int $tree_id + * + * @return null|string + */ protected static function fetchGedcomRecord($xref, $tree_id) { return Database::prepare( "SELECT i_gedcom FROM `##individuals` WHERE i_id = :xref AND i_file = :tree_id" @@ -1238,7 +1255,7 @@ class Individual extends GedcomRecord { } /** - * Get an array of structures containing all the names in the record + * Extract names from the GEDCOM record. */ public function extractNames() { $this->extractNamesFromFacts(1, 'NAME', $this->getFacts('NAME', false, Auth::accessLevel($this->tree), $this->canShowName())); diff --git a/app/Log.php b/app/Log.php index 8cc7bae34f..52d0df28ef 100644 --- a/app/Log.php +++ b/app/Log.php @@ -1,5 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Zend_Mail; use Zend_Mail_Transport_File; @@ -22,7 +21,7 @@ use Zend_Mail_Transport_Sendmail; use Zend_Mail_Transport_Smtp; /** - * Class Mail - Send mail messages + * Send mail messages. */ class Mail { const EOL = "
\r\n"; // End-of-line that works for both TEXT and HTML messages diff --git a/app/Media.php b/app/Media.php index 33a26485f6..e4b21024ba 100644 --- a/app/Media.php +++ b/app/Media.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; + use Fisharebest\Webtrees\Functions\FunctionsMedia; use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; /** - * Class Media - Class that defines a media object + * A GEDCOM media (OBJE) object. */ class Media extends GedcomRecord { const RECORD_TYPE = 'OBJE'; @@ -31,7 +31,15 @@ class Media extends GedcomRecord { /** @var string The "FILE" value from the GEDCOM */ private $file = ''; - /** {@inheritdoc} */ + /** + * Create a GedcomRecord object from raw GEDCOM data. + * + * @param string $xref + * @param string $gedcom an empty string for new/pending records + * @param string|null $pending null for a record with no pending edits, + * empty string for records with pending deletions + * @param Tree $tree + */ public function __construct($xref, $gedcom, $pending, $tree) { parent::__construct($xref, $gedcom, $pending, $tree); @@ -43,7 +51,13 @@ class Media extends GedcomRecord { } } - /** {@inheritdoc} */ + /** + * Each object type may have its own special rules, and re-implement this function. + * + * @param int $access_level + * + * @return bool + */ protected function canShowByType($access_level) { // Hide media objects if they are attached to private records $linked_ids = Database::prepare( @@ -62,7 +76,14 @@ class Media extends GedcomRecord { return parent::canShowByType($access_level); } - /** {@inheritdoc} */ + /** + * Fetch data from the database + * + * @param string $xref + * @param int $tree_id + * + * @return null|string + */ protected static function fetchGedcomRecord($xref, $tree_id) { return Database::prepare( "SELECT m_gedcom FROM `##media` WHERE m_id = :xref AND m_file = :tree_id" @@ -558,7 +579,11 @@ class Media extends GedcomRecord { '>' . $image . ''; } - /** {@inheritdoc} */ + /** + * If this object has no name, what do we call it? + * + * @return string + */ public function getFallBackName() { if ($this->canShow()) { return basename($this->file); @@ -567,7 +592,9 @@ class Media extends GedcomRecord { } } - /** {@inheritdoc} */ + /** + * Extract names from the GEDCOM record. + */ public function extractNames() { // Earlier gedcom versions had level 1 titles // Later gedcom versions had level 2 titles @@ -575,7 +602,12 @@ class Media extends GedcomRecord { $this->extractNamesFromFacts(1, 'TITL', $this->getFacts('TITL')); } - /** {@inheritdoc} */ + /** + * This function should be redefined in derived classes to show any major + * identifying characteristics of this record. + * + * @return string + */ public function formatListDetails() { ob_start(); FunctionsPrintFacts::printMediaLinks('1 OBJE @' . $this->getXref() . '@', 1); diff --git a/app/Menu.php b/app/Menu.php index 105f5a9705..bd64c31be1 100644 --- a/app/Menu.php +++ b/app/Menu.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; use Rhumsaa\Uuid\Uuid; /** - * Class Menu - System for generating menus. + * System for generating menus. */ class Menu { /** @var string The text to be displayed in the mneu */ @@ -34,7 +33,7 @@ class Menu { /** @var string An onclick action, typically used with a link of "#" */ private $onclick; - /** @var Menu[] */ + /** @var Menu[] An optional list of sub-menus. */ private $submenus; /** @var string Used internally to create javascript menus */ @@ -118,6 +117,8 @@ class Menu { } /** + * Get the class. + * * @return string */ public function getClass() { @@ -125,6 +126,8 @@ class Menu { } /** + * Set the class. + * * @param string $class * * @return $this @@ -136,6 +139,8 @@ class Menu { } /** + * Get the label. + * * @return string */ public function getLabel() { @@ -143,6 +148,8 @@ class Menu { } /** + * Set the label. + * * @param string $label * * @return $this @@ -154,6 +161,7 @@ class Menu { } /** + * Get the link. * @return string */ public function getLink() { @@ -161,6 +169,8 @@ class Menu { } /** + * Set the link. + * * @param string $link * * @return $this @@ -172,6 +182,8 @@ class Menu { } /** + * Get the click handler. + * * @return string */ public function getOnclick() { @@ -179,6 +191,8 @@ class Menu { } /** + * Set the click handler. + * * @param string $onclick * * @return $this @@ -265,6 +279,8 @@ class Menu { } /** + * Get the sub-menus. + * * @return Menu[] */ public function getSubmenus() { @@ -272,6 +288,8 @@ class Menu { } /** + * Set the sub-menus. + * * @param Menu[] $submenus * * @return $this diff --git a/app/Module.php b/app/Module.php index a09f8b8db6..b5874f6678 100644 --- a/app/Module.php +++ b/app/Module.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; + use Fisharebest\Webtrees\Module\AbstractModule; use Fisharebest\Webtrees\Module\ModuleBlockInterface; use Fisharebest\Webtrees\Module\ModuleChartInterface; @@ -25,7 +25,7 @@ use Fisharebest\Webtrees\Module\ModuleTabInterface; use Fisharebest\Webtrees\Module\ModuleThemeInterface; /** - * Class Module - Static functions for managing and maintaining modules. + * Functions for managing and maintaining modules. */ class Module { /** diff --git a/app/Module/AbstractModule.php b/app/Module/AbstractModule.php index b8b1091d27..4d05479b5f 100644 --- a/app/Module/AbstractModule.php +++ b/app/Module/AbstractModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Tree; @@ -43,6 +43,8 @@ abstract class AbstractModule { } /** + * Get a block setting. + * * @param int $block_id * @param string $setting_name * @param string|null $default_value @@ -61,6 +63,8 @@ abstract class AbstractModule { } /** + * Set a block setting. + * * @param int $block_id * @param string $setting_name * @param string|null $setting_value diff --git a/app/Module/AhnentafelReportModule.php b/app/Module/AhnentafelReportModule.php index b185fd8961..37fbfa1480 100644 --- a/app/Module/AhnentafelReportModule.php +++ b/app/Module/AhnentafelReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; @@ -23,24 +23,42 @@ use Fisharebest\Webtrees\Menu; * Class AhnentafelReportModule */ class AhnentafelReportModule extends AbstractModule implements ModuleReportInterface { - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { // This text also appears in the .XML file - update both together return /* I18N: Name of a module/report */ I18N::translate('Ancestors'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { // This text also appears in the .XML file - update both together return /* I18N: Description of the “Ancestors” module */ I18N::translate('A report of an individual’s ancestors, in a narrative style.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ + /** + * Return a list of (usually just one) menu items. + * + * @return Menu[] + */ public function getReportMenus() { global $controller, $WT_TREE; diff --git a/app/Module/AlbumModule.php b/app/Module/AlbumModule.php index 7090e37b3e..4beb7e3f95 100644 --- a/app/Module/AlbumModule.php +++ b/app/Module/AlbumModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsPrint; @@ -28,36 +28,63 @@ use Fisharebest\Webtrees\Theme; * Class AlbumModule */ class AlbumModule extends AbstractModule implements ModuleTabInterface { + /** @var Media[] List of media objects. */ private $media_list; - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Album'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Album” module */ I18N::translate('An alternative to the “media” tab, and an enhanced image viewer.'); } - /** {@inheritdoc} */ + /** + * The user can re-arrange the tab order, but until they do, this + * is the order in which tabs are shown. + * + * @return int + */ public function defaultTabOrder() { return 60; } - /** {@inheritdoc} */ + /** + * Is this tab empty? If so, we don't always need to display it. + * + * @return bool + */ public function hasTabContent() { global $WT_TREE; return Auth::isEditor($WT_TREE) || $this->getMedia(); } - /** {@inheritdoc} */ + /** + * A greyed out tab has no actual content, but may perhaps have + * options to create content. + * + * @return bool + */ public function isGrayedOut() { return !$this->getMedia(); } - /** {@inheritdoc} */ + /** + * Generate the HTML content of this tab. + * + * @return string + */ public function getTabContent() { global $WT_TREE, $controller; @@ -209,12 +236,22 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface { return $this->media_list; } - /** {@inheritdoc} */ + /** + * Can this tab load asynchronously? + * + * @return bool + */ public function canLoadAjax() { return !Auth::isSearchEngine(); // Search engines cannot use AJAX } - /** {@inheritdoc} */ + /** + * Any content (e.g. Javascript) that needs to be rendered before the tabs. + * + * This function is probably not needed, as there are better ways to achieve this. + * + * @return string + */ public function getPreLoadContent() { return ''; } diff --git a/app/Module/BatchUpdate/BatchUpdateBasePlugin.php b/app/Module/BatchUpdate/BatchUpdateBasePlugin.php index e4d2bb8b7e..d41a1f5384 100644 --- a/app/Module/BatchUpdate/BatchUpdateBasePlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateBasePlugin.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\BatchUpdate; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\GedcomRecord; @@ -30,7 +30,8 @@ use Fisharebest\Webtrees\Module\BatchUpdateModule; * string updateRecord($xref, $gedrec) */ class BatchUpdateBasePlugin { - public $chan = false; // User option; update change record + /** @var bool User option; update change record */ + public $chan = false; /** * Default is to operate on INDI records diff --git a/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php b/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php index f6a47e43b6..ffc53aa5a0 100644 --- a/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateDuplicateLinksPlugin.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\BatchUpdate; + use Fisharebest\Webtrees\I18N; /** diff --git a/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php b/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php index 513275e9a4..6ab814f8af 100644 --- a/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateMarriedNamesPlugin.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\BatchUpdate; + use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Module\BatchUpdateModule; @@ -90,6 +90,8 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin { } /** + * Generate a list of married surnames that are not already present. + * * @param string $xref * @param string $gedrec * @@ -117,6 +119,8 @@ class BatchUpdateMarriedNamesPlugin extends BatchUpdateBasePlugin { } /** + * Extract a list of surnames from a GEDCOM record. + * * @param string $xref * @param string $gedrec * diff --git a/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php b/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php index 21e913a6ed..631562e996 100644 --- a/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateMissingDeathPlugin.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\BatchUpdate; + use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; diff --git a/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php b/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php index 3637b6597a..18b9390b26 100644 --- a/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateNameFormatPlugin.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\BatchUpdate; + use Fisharebest\Webtrees\I18N; /** diff --git a/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php b/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php index 941bab9c16..b1390961b4 100644 --- a/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php +++ b/app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\BatchUpdate; + use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; @@ -22,12 +22,23 @@ use Fisharebest\Webtrees\I18N; * Class BatchUpdateSearchReplacePlugin Batch Update plugin: search/replace */ class BatchUpdateSearchReplacePlugin extends BatchUpdateBasePlugin { - private $search = null; // Search string - private $replace = null; // Replace string - private $method = null; // simple/wildcards/regex - private $regex = null; // Search string, converted to a regex - private $case = null; // "i" for case insensitive, "" for case sensitive - private $error = null; // Message for bad user parameters + /** @var string Search string */ + private $search; + + /** @var string Replace string */ + private $replace; + + /** @var string simple/wildcards/regex */ + private $method; + + /** @var string Search string, converted to a regex */ + private $regex; + + /** @var string "i" for case insensitive, "" for case sensitive */ + private $case; + + /** @var string Message for bad user parameters */ + private $error; /** * User-friendly name for this plugin. diff --git a/app/Module/BatchUpdateModule.php b/app/Module/BatchUpdateModule.php index 81dc4913d9..e53468cf62 100644 --- a/app/Module/BatchUpdateModule.php +++ b/app/Module/BatchUpdateModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Database; @@ -68,17 +68,30 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface /** @var GedcomRecord The record corresponding to $curr_xref */ private $record; - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Batch update'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Batch update” module */ I18N::translate('Apply automatic corrections to your genealogy data.'); } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { switch ($mod_action) { case 'admin_batch_update': @@ -399,7 +412,12 @@ class BatchUpdateModule extends AbstractModule implements ModuleConfigInterface } } - /** {@inheritdoc} */ + /** + * The URL to a page where the user can modify the configuration of this module. + * These links are displayed in the admin page menu. + * + * @return string + */ public function getConfigLink() { return 'module.php?mod=' . $this->getName() . '&mod_action=admin_batch_update'; } diff --git a/app/Module/BirthDeathMarriageReportModule.php b/app/Module/BirthDeathMarriageReportModule.php index 970b030697..8633cf3605 100644 --- a/app/Module/BirthDeathMarriageReportModule.php +++ b/app/Module/BirthDeathMarriageReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; @@ -23,24 +23,42 @@ use Fisharebest\Webtrees\Menu; * Class BirthDeathMarriageReportModule */ class BirthDeathMarriageReportModule extends AbstractModule implements ModuleReportInterface { - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { // This text also appears in the .XML file - update both together return /* I18N: Name of a module/report. “Vital records” are life events - birth/marriage/death */ I18N::translate('Vital records'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { // This text also appears in the .XML file - update both together return /* I18N: Description of the “Vital records” module. “Vital records” are life events - birth/marriage/death */ I18N::translate('A report of vital records for a given date or place.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ + /** + * Return a list of (usually just one) menu items. + * + * @return Menu[] + */ public function getReportMenus() { global $WT_TREE; diff --git a/app/Module/BirthReportModule.php b/app/Module/BirthReportModule.php index 4248ff0550..a895ecf985 100644 --- a/app/Module/BirthReportModule.php +++ b/app/Module/BirthReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/CemeteryReportModule.php b/app/Module/CemeteryReportModule.php index 8432eadaef..3216b8a323 100644 --- a/app/Module/CemeteryReportModule.php +++ b/app/Module/CemeteryReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/CensusAssistantModule.php b/app/Module/CensusAssistantModule.php index 33c70f62a5..6cf3f77468 100644 --- a/app/Module/CensusAssistantModule.php +++ b/app/Module/CensusAssistantModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Controller\SimpleController; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\Filter; @@ -39,7 +39,12 @@ class CensusAssistantModule extends AbstractModule { return /* I18N: Description of the “Census assistant” module */ I18N::translate('An alternative way to enter census transcripts and link them to individuals.'); } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { switch ($mod_action) { case 'census_find': @@ -57,7 +62,7 @@ class CensusAssistantModule extends AbstractModule { } /** - * ... + * Find an individual. */ private static function censusFind() { global $WT_TREE; @@ -182,9 +187,6 @@ class CensusAssistantModule extends AbstractModule { } echo "
  • "; - // ============================================================================================================================== - // NOTES = is equivalent to= function pasterow(id, nam, mnam, label, gend, cond, dom, dob, age, dod, occu, birthpl, fbirthpl, mbirthpl, chilBLD) { - // ============================================================================================================================== echo "getXref() . "', "; // id - Indi Id echo "'" . addslashes(strip_tags($fulln)) . "', "; // nam - Name @@ -222,7 +224,7 @@ class CensusAssistantModule extends AbstractModule { } /** - * ... + * Find a media object. */ private static function mediaFind() { global $WT_TREE; @@ -321,7 +323,7 @@ class CensusAssistantModule extends AbstractModule { } /** - * ... + * Search for a media object. */ private static function mediaQuery() { global $WT_TREE; diff --git a/app/Module/ChangeReportModule.php b/app/Module/ChangeReportModule.php index 187083dfab..5d608ee1a5 100644 --- a/app/Module/ChangeReportModule.php +++ b/app/Module/ChangeReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/ChartsBlockModule.php b/app/Module/ChartsBlockModule.php index e2b5d1b2ad..e264476d40 100644 --- a/app/Module/ChartsBlockModule.php +++ b/app/Module/ChartsBlockModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\HourglassController; use Fisharebest\Webtrees\Filter; @@ -39,8 +39,16 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “Charts” module */ I18N::translate('An alternative way to display charts.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $WT_TREE, $ctype, $controller; $PEDIGREE_ROOT_ID = $WT_TREE->getPreference('PEDIGREE_ROOT_ID'); @@ -50,11 +58,9 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface { $type = $this->getBlockSetting($block_id, 'type', 'pedigree'); $pid = $this->getBlockSetting($block_id, 'pid', Auth::check() ? ($gedcomid ? $gedcomid : $PEDIGREE_ROOT_ID) : $PEDIGREE_ROOT_ID); - if ($cfg) { - foreach (array('details', 'type', 'pid', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('details', 'type', 'pid', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -155,7 +161,11 @@ class ChartsBlockModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { global $WT_TREE, $controller; diff --git a/app/Module/CkeditorModule.php b/app/Module/CkeditorModule.php index b496902f2b..e00635e312 100644 --- a/app/Module/CkeditorModule.php +++ b/app/Module/CkeditorModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Controller\BaseController; use Fisharebest\Webtrees\I18N; diff --git a/app/Module/ClippingsCart/ClippingsCartController.php b/app/Module/ClippingsCart/ClippingsCartController.php index 014430236d..5d6b3d485e 100644 --- a/app/Module/ClippingsCart/ClippingsCartController.php +++ b/app/Module/ClippingsCart/ClippingsCartController.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\ClippingsCart; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; @@ -32,7 +31,7 @@ use PclZip; * The clippings cart. */ class ClippingsCartController { - /** @var string */ + /** @var string Data to be downloaded. */ private $download_data; /** @var string[] List of files to include */ diff --git a/app/Module/ClippingsCartModule.php b/app/Module/ClippingsCartModule.php index d9d91784aa..f561a85b83 100644 --- a/app/Module/ClippingsCartModule.php +++ b/app/Module/ClippingsCartModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Family; @@ -46,7 +46,12 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, return Auth::PRIV_USER; } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { switch ($mod_action) { case 'ajax': @@ -503,7 +508,11 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, } } - /** {@inheritdoc} */ + /** + * Load this sidebar synchronously. + * + * @return string + */ public function getSidebarContent() { global $controller; @@ -645,6 +654,8 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, } /** + * A form to choose the download options. + * * @param ClippingsCartController $clip_ctrl * * @return string diff --git a/app/Module/DeathReportModule.php b/app/Module/DeathReportModule.php index ed84f9159f..b8862fb10b 100644 --- a/app/Module/DeathReportModule.php +++ b/app/Module/DeathReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/DescendancyModule.php b/app/Module/DescendancyModule.php index ec52b7f20a..f26b65b899 100644 --- a/app/Module/DescendancyModule.php +++ b/app/Module/DescendancyModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Family; @@ -39,13 +39,18 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface I18N::translate('A sidebar showing the descendants of an individual.'); } - /** {@inheritdoc} */ - public function modAction($modAction) { + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ + public function modAction($mod_action) { global $WT_TREE; header('Content-Type: text/html; charset=UTF-8'); - switch ($modAction) { + switch ($mod_action) { case 'search': $search = Filter::get('search'); echo $this->search($search, $WT_TREE); @@ -77,7 +82,11 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface return ''; } - /** {@inheritdoc} */ + /** + * Load this sidebar synchronously. + * + * @return string + */ public function getSidebarContent() { global $controller; @@ -131,6 +140,8 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface } /** + * Format an individual in a list. + * * @param Individual $person * @param int $generations * @@ -153,6 +164,8 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface } /** + * Format a family in a list. + * * @param Family $family * @param Individual $person * @param int $generations @@ -182,6 +195,8 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface } /** + * Respond to an autocomplete search request. + * * @param string $query Search for this term * @param Tree $tree Search in this tree * @@ -218,6 +233,8 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface } /** + * Display spouses. + * * @param Individual $person * @param int $generations * @@ -238,6 +255,8 @@ class DescendancyModule extends AbstractModule implements ModuleSidebarInterface } /** + * Display descendants. + * * @param Family $family * @param int $generations * diff --git a/app/Module/DescendancyReportModule.php b/app/Module/DescendancyReportModule.php index 81c5bc21e1..ced9b944b6 100644 --- a/app/Module/DescendancyReportModule.php +++ b/app/Module/DescendancyReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/ExtraInformationModule.php b/app/Module/ExtraInformationModule.php index 364597140f..ecfac4119d 100644 --- a/app/Module/ExtraInformationModule.php +++ b/app/Module/ExtraInformationModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Fact; use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; use Fisharebest\Webtrees\I18N; @@ -44,7 +44,11 @@ class ExtraInformationModule extends AbstractModule implements ModuleSidebarInte return true; } - /** {@inheritdoc} */ + /** + * Load this sidebar synchronously. + * + * @return string + */ public function getSidebarContent() { global $controller; diff --git a/app/Module/FactSourcesReportModule.php b/app/Module/FactSourcesReportModule.php index b519f1fb82..b1097a0279 100644 --- a/app/Module/FactSourcesReportModule.php +++ b/app/Module/FactSourcesReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/FamiliesSidebarModule.php b/app/Module/FamiliesSidebarModule.php index 02a5d44279..e06a237383 100644 --- a/app/Module/FamiliesSidebarModule.php +++ b/app/Module/FamiliesSidebarModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Family; @@ -38,9 +38,14 @@ class FamiliesSidebarModule extends AbstractModule implements ModuleSidebarInter return /* I18N: Description of the “Families” module */ I18N::translate('A sidebar showing an alphabetic list of all the families in the family tree.'); } - /** {@inheritdoc} */ - public function modAction($modAction) { - switch ($modAction) { + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ + public function modAction($mod_action) { + switch ($mod_action) { case 'ajax': header('Content-Type: text/html; charset=UTF-8'); echo $this->getSidebarAjaxContent(); @@ -80,7 +85,11 @@ class FamiliesSidebarModule extends AbstractModule implements ModuleSidebarInter } } - /** {@inheritdoc} */ + /** + * Load this sidebar synchronously. + * + * @return string + */ public function getSidebarContent() { global $controller, $WT_TREE; @@ -164,6 +173,8 @@ class FamiliesSidebarModule extends AbstractModule implements ModuleSidebarInter } /** + * Get a list of surname initials. + * * @param Tree $tree * @param string $alpha * @@ -183,6 +194,8 @@ class FamiliesSidebarModule extends AbstractModule implements ModuleSidebarInter } /** + * Get a list of surnames. + * * @param Tree $tree * @param string $alpha * @param string $surname @@ -210,6 +223,8 @@ class FamiliesSidebarModule extends AbstractModule implements ModuleSidebarInter } /** + * Autocomplete search for families. + * * @param Tree $tree Search this tree * @param string $query Search for this text * diff --git a/app/Module/FamilyGroupReportModule.php b/app/Module/FamilyGroupReportModule.php index d99c18f3ae..42a9c7fcd9 100644 --- a/app/Module/FamilyGroupReportModule.php +++ b/app/Module/FamilyGroupReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/FamilyNavigatorModule.php b/app/Module/FamilyNavigatorModule.php index dc7483a3bd..ff5f330908 100644 --- a/app/Module/FamilyNavigatorModule.php +++ b/app/Module/FamilyNavigatorModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\Functions\Functions; @@ -55,7 +55,11 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter return ''; } - /** {@inheritdoc} */ + /** + * Load this sidebar synchronously. + * + * @return string + */ public function getSidebarContent() { global $controller; @@ -102,6 +106,8 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter } /** + * Format a family. + * * @param Family $family * @param string $title */ @@ -161,6 +167,8 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter } /** + * Format an individual. + * * @param $person * @param bool $showUnknown * @@ -177,6 +185,8 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter } /** + * Forat the parents of an individual. + * * @param Individual $person * * @return string @@ -217,6 +227,8 @@ class FamilyNavigatorModule extends AbstractModule implements ModuleSidebarInter } /** + * Format a family. + * * @param Individual $person * * @return string diff --git a/app/Module/FamilyTreeFavorites/Schema/Migration0.php b/app/Module/FamilyTreeFavorites/Schema/Migration0.php index a9d77ee8ed..96f99c7f27 100644 --- a/app/Module/FamilyTreeFavorites/Schema/Migration0.php +++ b/app/Module/FamilyTreeFavorites/Schema/Migration0.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\FamilyTreeFavorites\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; /** - * Class Migration0 - upgrade the database schema from version 0 (empty database) to version 1. + * Upgrade the database schema from version 0 (empty database) to version 1. */ class Migration0 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/FamilyTreeFavorites/Schema/Migration1.php b/app/Module/FamilyTreeFavorites/Schema/Migration1.php index eb204c2c35..996bd88e61 100644 --- a/app/Module/FamilyTreeFavorites/Schema/Migration1.php +++ b/app/Module/FamilyTreeFavorites/Schema/Migration1.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\FamilyTreeFavorites\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; use PDOException; /** - * Class Migration1 - upgrade the database schema from version 1 to version 2. + * Upgrade the database schema from version 1 to version 2. */ class Migration1 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/FamilyTreeFavorites/Schema/Migration2.php b/app/Module/FamilyTreeFavorites/Schema/Migration2.php index 6d677d3c80..e95d2eeab5 100644 --- a/app/Module/FamilyTreeFavorites/Schema/Migration2.php +++ b/app/Module/FamilyTreeFavorites/Schema/Migration2.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\FamilyTreeFavorites\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; use PDOException; /** - * Class Migration2 - upgrade the database schema from version 2 to version 3. + * Upgrade the database schema from version 2 to version 3. */ class Migration2 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/FamilyTreeFavorites/Schema/Migration3.php b/app/Module/FamilyTreeFavorites/Schema/Migration3.php index 419beb3154..2109eadd35 100644 --- a/app/Module/FamilyTreeFavorites/Schema/Migration3.php +++ b/app/Module/FamilyTreeFavorites/Schema/Migration3.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\FamilyTreeFavorites\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; use PDOException; /** - * Class Migration3 - upgrade the database schema from version 3 to version 4. + * Upgrade the database schema from version 3 to version 4. */ class Migration3 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/FamilyTreeFavoritesModule.php b/app/Module/FamilyTreeFavoritesModule.php index 9cf2f685a7..0b04dcd4ad 100644 --- a/app/Module/FamilyTreeFavoritesModule.php +++ b/app/Module/FamilyTreeFavoritesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; @@ -38,7 +37,11 @@ use Rhumsaa\Uuid\Uuid; * logic works for both. */ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInterface { - /** {@inheritdoc} */ + /** + * Create a new module. + * + * @param string $directory Where is this module installed + */ public function __construct($directory) { parent::__construct($directory); @@ -46,18 +49,34 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt Database::updateSchema('\Fisharebest\Webtrees\Module\FamilyTreeFavorites\Schema', 'FV_SCHEMA_VERSION', 4); } - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Favorites'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Favorites” module */ I18N::translate('Display and manage a family tree’s favorite pages.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $controller, $WT_TREE; $action = Filter::get('action'); @@ -103,11 +122,9 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt $block = $this->getBlockSetting($block_id, 'block', '0'); - if ($cfg) { - foreach (array('block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -219,22 +236,41 @@ class FamilyTreeFavoritesModule extends AbstractModule implements ModuleBlockInt } } - /** {@inheritdoc} */ + /** + * Should this block load asynchronously using AJAX? + * + * Simple blocks are faster in-line, more comples ones + * can be loaded later. + * + * @return bool + */ public function loadAjax() { return false; } - /** {@inheritdoc} */ + /** + * Can this block be shown on the user’s home page? + * + * @return bool + */ public function isUserBlock() { return false; } - /** {@inheritdoc} */ + /** + * Can this block be shown on the tree’s home page? + * + * @return bool + */ public function isGedcomBlock() { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'block', Filter::postBool('block')); diff --git a/app/Module/FamilyTreeNews/Schema/Migration0.php b/app/Module/FamilyTreeNews/Schema/Migration0.php index 8a3b460c49..81c1daedf7 100644 --- a/app/Module/FamilyTreeNews/Schema/Migration0.php +++ b/app/Module/FamilyTreeNews/Schema/Migration0.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\FamilyTreeNews\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; /** - * Class Migration0 - upgrade the database schema from version 0 (empty database) to version 1. + * Upgrade the database schema from version 0 (empty database) to version 1. */ class Migration0 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/FamilyTreeNews/Schema/Migration1.php b/app/Module/FamilyTreeNews/Schema/Migration1.php index 0fbc10cab8..31338ed5bd 100644 --- a/app/Module/FamilyTreeNews/Schema/Migration1.php +++ b/app/Module/FamilyTreeNews/Schema/Migration1.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\FamilyTreeNews\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; use PDOException; /** - * Class Migration1 - upgrade the database schema from version 1 to version 2. + * Upgrade the database schema from version 1 to version 2. */ class Migration1 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/FamilyTreeNews/Schema/Migration2.php b/app/Module/FamilyTreeNews/Schema/Migration2.php index 721576dfb3..c2ac05af5c 100644 --- a/app/Module/FamilyTreeNews/Schema/Migration2.php +++ b/app/Module/FamilyTreeNews/Schema/Migration2.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\FamilyTreeNews\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; use PDOException; /** - * Class Migration2 - upgrade the database schema from version 2 to version 3. + * Upgrade the database schema from version 2 to version 3. */ class Migration2 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/FamilyTreeNewsModule.php b/app/Module/FamilyTreeNewsModule.php index 142b2f8028..8ec2f7e943 100644 --- a/app/Module/FamilyTreeNewsModule.php +++ b/app/Module/FamilyTreeNewsModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; @@ -27,7 +27,11 @@ use Fisharebest\Webtrees\Theme; * Class FamilyTreeNewsModule */ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterface { - /** {@inheritdoc} */ + /** + * Create a new module. + * + * @param string $directory Where is this module installed + */ public function __construct($directory) { parent::__construct($directory); @@ -35,18 +39,34 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac Database::updateSchema('\Fisharebest\Webtrees\Module\FamilyTreeNews\Schema', 'NB_SCHEMA_VERSION', 3); } - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('News'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “GEDCOM News” module */ I18N::translate('Family news and site announcements.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; switch (Filter::get('action')) { @@ -69,11 +89,9 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac $limit = $this->getBlockSetting($block_id, 'limit', 'nolimit'); } } - if ($cfg) { - foreach (array('limit', 'flag') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('limit', 'flag') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } $usernews = Database::prepare( @@ -154,7 +172,11 @@ class FamilyTreeNewsModule extends AbstractModule implements ModuleBlockInterfac return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'limit', Filter::post('limit')); diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php index 1825afd6cb..3137ccbf47 100644 --- a/app/Module/FamilyTreeStatisticsModule.php +++ b/app/Module/FamilyTreeStatisticsModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsDb; @@ -37,8 +37,16 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn return /* I18N: Description of “Statistics” module */ I18N::translate('The size of the family tree, earliest and latest events, common names, etc.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $WT_TREE, $ctype; $show_last_update = $this->getBlockSetting($block_id, 'show_last_update', '1'); @@ -64,11 +72,9 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn $block = '0'; $stat_link = '1'; - if ($cfg) { - foreach (array('show_common_surnames', 'stat_indi', 'stat_fam', 'stat_sour', 'stat_media', 'stat_surname', 'stat_events', 'stat_users', 'stat_first_birth', 'stat_last_birth', 'stat_first_death', 'stat_last_death', 'stat_long_life', 'stat_avg_life', 'stat_most_chil', 'stat_avg_chil', 'stat_link', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('show_common_surnames', 'stat_indi', 'stat_fam', 'stat_sour', 'stat_media', 'stat_surname', 'stat_events', 'stat_users', 'stat_first_birth', 'stat_last_birth', 'stat_first_death', 'stat_last_death', 'stat_long_life', 'stat_avg_life', 'stat_most_chil', 'stat_avg_chil', 'stat_link', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -228,7 +234,11 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'show_last_update', Filter::postBool('show_last_update')); diff --git a/app/Module/FrequentlyAskedQuestionsModule.php b/app/Module/FrequentlyAskedQuestionsModule.php index f65c829fec..f2f2e9f871 100644 --- a/app/Module/FrequentlyAskedQuestionsModule.php +++ b/app/Module/FrequentlyAskedQuestionsModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Database; @@ -39,7 +39,12 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen return /* I18N: Description of the “FAQ” module */ I18N::translate('A list of frequently asked questions and answers.'); } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { switch ($mod_action) { case 'admin_config': diff --git a/app/Module/GoogleMaps/Schema/Migration0.php b/app/Module/GoogleMaps/Schema/Migration0.php index ccaf8355d2..a1f53a72db 100644 --- a/app/Module/GoogleMaps/Schema/Migration0.php +++ b/app/Module/GoogleMaps/Schema/Migration0.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\GoogleMaps\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; /** - * Class Migration0 - upgrade the database schema from version 0 (empty database) to version 1. + * Upgrade the database schema from version 0 (empty database) to version 1. */ class Migration0 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/GoogleMaps/Schema/Migration1.php b/app/Module/GoogleMaps/Schema/Migration1.php index d5843e5c65..a884afe7ff 100644 --- a/app/Module/GoogleMaps/Schema/Migration1.php +++ b/app/Module/GoogleMaps/Schema/Migration1.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\GoogleMaps\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; use PDOException; /** - * Class Migration1 - upgrade the database schema from version 1 to version 2. + * Upgrade the database schema from version 1 to version 2. */ class Migration1 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/GoogleMaps/Schema/Migration2.php b/app/Module/GoogleMaps/Schema/Migration2.php index ac17dce363..802198c8c0 100644 --- a/app/Module/GoogleMaps/Schema/Migration2.php +++ b/app/Module/GoogleMaps/Schema/Migration2.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\GoogleMaps\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; /** - * Class Migration2 - upgrade the database schema from version 2 to version 3. + * Upgrade the database schema from version 2 to version 3. */ class Migration2 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/GoogleMaps/Schema/Migration3.php b/app/Module/GoogleMaps/Schema/Migration3.php index a10ef44920..8b50bd9e5d 100644 --- a/app/Module/GoogleMaps/Schema/Migration3.php +++ b/app/Module/GoogleMaps/Schema/Migration3.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\GoogleMaps\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; /** - * Class Migration3 - upgrade the database schema from version 3 to version 4. + * Upgrade the database schema from version 3 to version 4. */ class Migration3 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/GoogleMaps/Schema/Migration4.php b/app/Module/GoogleMaps/Schema/Migration4.php index a07a4c448d..61eec9a487 100644 --- a/app/Module/GoogleMaps/Schema/Migration4.php +++ b/app/Module/GoogleMaps/Schema/Migration4.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\GoogleMaps\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; /** - * Class Migration4 - upgrade the database schema from version 4 to version 5. + * Upgrade the database schema from version 4 to version 5. */ class Migration4 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/GoogleMaps/Schema/Migration5.php b/app/Module/GoogleMaps/Schema/Migration5.php index e9820defd1..12a23a0a79 100644 --- a/app/Module/GoogleMaps/Schema/Migration5.php +++ b/app/Module/GoogleMaps/Schema/Migration5.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\GoogleMaps\Schema; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Schema\MigrationInterface; /** - * Class Migration5 - upgrade the database schema from version 5 to version 6. + * Upgrade the database schema from version 5 to version 6. */ class Migration5 implements MigrationInterface { /** {@inheritDoc} */ diff --git a/app/Module/GoogleMapsModule.php b/app/Module/GoogleMapsModule.php index 830468a396..c044851f06 100644 --- a/app/Module/GoogleMapsModule.php +++ b/app/Module/GoogleMapsModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\ChartController; @@ -64,7 +63,11 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, /** @var int Number of nodes in the chart */ private $treesize; - /** {@inheritdoc} */ + /** + * Create a new module. + * + * @param string $directory Where is this module installed + */ public function __construct($directory) { parent::__construct($directory); @@ -82,7 +85,12 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, return /* I18N: Description of the “Google Maps™” module */ I18N::translate('Show the location of places and events using the Google Maps™ mapping service.'); } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { switch ($mod_action) { case 'admin_config': @@ -506,7 +514,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** - * ... + * Select a flag. + * */ private function flags() { global $WT_TREE; @@ -721,7 +730,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** - * ... + * Display a map showing the originas of ones ancestors. */ private function pedigreeMap() { global $controller, $WT_TREE; @@ -914,6 +923,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Create the Javascript to activate the map. + * * @return string */ private function pedigreeMapJavascript() { @@ -1475,7 +1486,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** - * ... + * Check places for missing data, etc. */ private function adminPlaceCheck() { global $WT_TREE; @@ -1797,6 +1808,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Remove prefixes from a place name to allow it to be matched. + * * @param string $prefix_list * @param string $place * @param string[] $placelist @@ -1816,6 +1829,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Remove suffixes from a place name to allow it to be matched. + * * @param string $suffix_list * @param string $place * @param string[] $placelist @@ -1835,6 +1850,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Remove prefixes and sufixes to allow place names to be matched. + * * @param string $prefix_list * @param string $suffix_list * @param string $place @@ -1857,6 +1874,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Match placenames with different prefixes and suffixes. + * * @param string $placename * @param int $level * @@ -1875,6 +1894,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Get the map co-ordinates of a place. + * * @param string $place * * @return null|\stdClass @@ -1912,6 +1933,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Build a map for an individual. + * * @param Individual $indi */ private function buildIndividualMap(Individual $indi) { @@ -2465,6 +2488,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Get the Location ID. + * * @param string $place * * @return int @@ -2503,6 +2528,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Get the place ID. + * * @param string $place * * @return int @@ -2540,6 +2567,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Set the place IDs. + * * @param int $level * @param string[] $parent * @@ -2560,6 +2589,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Set the map level. + * * @param int $level * @param string[] $parent * @@ -2712,6 +2743,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Find the current location. + * * @param int $numls * @param int $levelm * @@ -2730,6 +2763,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Print the numbers of individuals. + * * @param int $level * @param string[] $parent */ @@ -2756,6 +2791,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Print the flags and markers. + * * @param string[] $place2 * @param int $level * @param string[] $parent @@ -3132,6 +3169,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Get the highest index. + * * @return int */ private function getHighestIndex() { @@ -3139,6 +3178,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Get the highest level. + * * @return int */ private function getHighestLevel() { @@ -3193,6 +3234,8 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Set the output level. + * * @param int $parent_id */ private function outputLevel($parent_id) { @@ -3248,7 +3291,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** - * ... + * Edit places. */ private function placesEdit() { $GM_MAX_ZOOM = $this->getSetting('GM_MAX_ZOOM'); @@ -4063,7 +4106,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** - * ... + * Places administration. */ private function adminPlaces() { global $WT_TREE; @@ -4638,7 +4681,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** - * ... + * Generate the streetview window. */ private function wtStreetView() { header('Content-type: text/html; charset=UTF-8'); diff --git a/app/Module/HtmlBlockModule.php b/app/Module/HtmlBlockModule.php index d4002fc419..87f4451e38 100644 --- a/app/Module/HtmlBlockModule.php +++ b/app/Module/HtmlBlockModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsDate; @@ -41,8 +41,16 @@ class HtmlBlockModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “HTML” module */ I18N::translate('Add your own text and graphics.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; $title = $this->getBlockSetting($block_id, 'title'); @@ -126,7 +134,11 @@ class HtmlBlockModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { global $WT_TREE; diff --git a/app/Module/IndividualFactsTabModule.php b/app/Module/IndividualFactsTabModule.php index 4b83605908..6e9a7a541c 100644 --- a/app/Module/IndividualFactsTabModule.php +++ b/app/Module/IndividualFactsTabModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Fact; diff --git a/app/Module/IndividualFamiliesReportModule.php b/app/Module/IndividualFamiliesReportModule.php index f0e3971cb4..2813d5c7b5 100644 --- a/app/Module/IndividualFamiliesReportModule.php +++ b/app/Module/IndividualFamiliesReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/IndividualReportModule.php b/app/Module/IndividualReportModule.php index 592898bc5f..220feaf264 100644 --- a/app/Module/IndividualReportModule.php +++ b/app/Module/IndividualReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/IndividualSidebarModule.php b/app/Module/IndividualSidebarModule.php index 3be6624914..fed9d40d0a 100644 --- a/app/Module/IndividualSidebarModule.php +++ b/app/Module/IndividualSidebarModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; @@ -38,9 +38,14 @@ class IndividualSidebarModule extends AbstractModule implements ModuleSidebarInt return /* I18N: Description of “Individuals” module */ I18N::translate('A sidebar showing an alphabetic list of all the individuals in the family tree.'); } - /** {@inheritdoc} */ - public function modAction($modAction) { - switch ($modAction) { + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ + public function modAction($mod_action) { + switch ($mod_action) { case 'ajax': header('Content-Type: text/html; charset=UTF-8'); echo $this->getSidebarAjaxContent(); @@ -80,7 +85,11 @@ class IndividualSidebarModule extends AbstractModule implements ModuleSidebarInt } } - /** {@inheritdoc} */ + /** + * Load this sidebar synchronously. + * + * @return string + */ public function getSidebarContent() { global $controller, $WT_TREE; @@ -164,6 +173,8 @@ class IndividualSidebarModule extends AbstractModule implements ModuleSidebarInt } /** + * Get the initial letters of surnames. + * * @param Tree $tree * @param string $alpha * @@ -183,6 +194,8 @@ class IndividualSidebarModule extends AbstractModule implements ModuleSidebarInt } /** + * Format a list of individuals. + * * @param Tree $tree * @param string $alpha * @param string $surname @@ -210,6 +223,8 @@ class IndividualSidebarModule extends AbstractModule implements ModuleSidebarInt } /** + * Search for individuals in a tree. + * * @param Tree $tree Search this tree * @param string $query Search for this text * diff --git a/app/Module/InteractiveTree/TreeView.php b/app/Module/InteractiveTree/TreeView.php index ccc87c079e..5125bcdcb9 100644 --- a/app/Module/InteractiveTree/TreeView.php +++ b/app/Module/InteractiveTree/TreeView.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module\InteractiveTree; + use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; @@ -24,7 +24,10 @@ use Fisharebest\Webtrees\Individual; * Class TreeView */ class TreeView { + /** @var string HTML element name */ private $name; + + /** @var string Show all partners */ private $all_partners; /** diff --git a/app/Module/InteractiveTreeModule.php b/app/Module/InteractiveTreeModule.php index c8c6eb310f..8cb5450e01 100644 --- a/app/Module/InteractiveTreeModule.php +++ b/app/Module/InteractiveTreeModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\ChartController; use Fisharebest\Webtrees\Filter; @@ -88,7 +88,12 @@ class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface '; } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { global $controller, $WT_TREE; @@ -144,6 +149,7 @@ class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface } /** + * URL for our style sheet. * @return string */ public function css() { @@ -151,6 +157,8 @@ class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface } /** + * URL for our JavaScript. + * * @return string */ public function js() { diff --git a/app/Module/LoggedInUsersModule.php b/app/Module/LoggedInUsersModule.php index 34798457c6..d19bd70441 100644 --- a/app/Module/LoggedInUsersModule.php +++ b/app/Module/LoggedInUsersModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\Functions; @@ -37,8 +37,16 @@ class LoggedInUsersModule extends AbstractModule implements ModuleBlockInterface return /* I18N: Description of the “Who is online” module */ I18N::translate('A list of users and visitors who are currently online.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $WT_TREE; $id = $this->getName() . $block_id; @@ -112,7 +120,11 @@ class LoggedInUsersModule extends AbstractModule implements ModuleBlockInterface return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { } } diff --git a/app/Module/LoginBlockModule.php b/app/Module/LoginBlockModule.php index ec0609e65f..ee674313fa 100644 --- a/app/Module/LoginBlockModule.php +++ b/app/Module/LoginBlockModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Site; @@ -34,8 +34,16 @@ class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “Login” module */ I18N::translate('An alternative way to login and logout.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $controller; $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; @@ -122,7 +130,11 @@ class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { } } diff --git a/app/Module/MarriageReportModule.php b/app/Module/MarriageReportModule.php index a59d661fbe..cd5788d1ba 100644 --- a/app/Module/MarriageReportModule.php +++ b/app/Module/MarriageReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/MediaTabModule.php b/app/Module/MediaTabModule.php index c1b6535a10..153cee5b42 100644 --- a/app/Module/MediaTabModule.php +++ b/app/Module/MediaTabModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Fact; use Fisharebest\Webtrees\Functions\Functions; @@ -27,6 +27,7 @@ use Fisharebest\Webtrees\I18N; * Class MediaTabModule */ class MediaTabModule extends AbstractModule implements ModuleTabInterface { + /** @var Fact[] A list of facts with media objects. */ private $facts; /** {@inheritdoc} */ diff --git a/app/Module/MissingFactsReportModule.php b/app/Module/MissingFactsReportModule.php index 2870e16e3b..63cad3caa1 100644 --- a/app/Module/MissingFactsReportModule.php +++ b/app/Module/MissingFactsReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/ModuleBlockInterface.php b/app/Module/ModuleBlockInterface.php index e277638eba..f79d55bb0d 100644 --- a/app/Module/ModuleBlockInterface.php +++ b/app/Module/ModuleBlockInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; /** * Interface ModuleBlockInterface - Classes and libraries for module system @@ -23,14 +22,17 @@ interface ModuleBlockInterface { /** * Generate the HTML content of this block. * - * @param int $block_id + * @param int $block_id + * @param bool $template + * @param array $cfg * * @return string */ - public function getBlock($block_id); + public function getBlock($block_id, $template = true, $cfg = array()); /** * Should this block load asynchronously using AJAX? + * * Simple blocks are faster in-line, more comples ones * can be loaded later. * diff --git a/app/Module/ModuleChartInterface.php b/app/Module/ModuleChartInterface.php index 018a978e93..664f354c4f 100644 --- a/app/Module/ModuleChartInterface.php +++ b/app/Module/ModuleChartInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; /** * Interface ModuleChartInterface - Classes and libraries for module system diff --git a/app/Module/ModuleConfigInterface.php b/app/Module/ModuleConfigInterface.php index 2a1ffda236..857c2c8924 100644 --- a/app/Module/ModuleConfigInterface.php +++ b/app/Module/ModuleConfigInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; /** * Interface ModuleConfigInterface - Classes and libraries for module system diff --git a/app/Module/ModuleMenuInterface.php b/app/Module/ModuleMenuInterface.php index 80360cea41..a47cfcaf41 100644 --- a/app/Module/ModuleMenuInterface.php +++ b/app/Module/ModuleMenuInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Menu; /** diff --git a/app/Module/ModuleReportInterface.php b/app/Module/ModuleReportInterface.php index 547ed1d40b..96a1070384 100644 --- a/app/Module/ModuleReportInterface.php +++ b/app/Module/ModuleReportInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Menu; /** diff --git a/app/Module/ModuleSidebarInterface.php b/app/Module/ModuleSidebarInterface.php index b4cf945648..8332b0b4b6 100644 --- a/app/Module/ModuleSidebarInterface.php +++ b/app/Module/ModuleSidebarInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; /** * Interface ModuleSidebarInterface - Classes and libraries for module system diff --git a/app/Module/ModuleTabInterface.php b/app/Module/ModuleTabInterface.php index 2f11c6c747..81fe490a67 100644 --- a/app/Module/ModuleTabInterface.php +++ b/app/Module/ModuleTabInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; /** * Interface ModuleTabInterface - Classes and libraries for module system diff --git a/app/Module/ModuleThemeInterface.php b/app/Module/ModuleThemeInterface.php index 9f72035a03..c0f27a80fb 100644 --- a/app/Module/ModuleThemeInterface.php +++ b/app/Module/ModuleThemeInterface.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; /** * Interface ModuleThemeInterface - Classes and libraries for module system diff --git a/app/Module/NotesTabModule.php b/app/Module/NotesTabModule.php index e2ed55fccf..86a0053b45 100644 --- a/app/Module/NotesTabModule.php +++ b/app/Module/NotesTabModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Fact; use Fisharebest\Webtrees\Functions\Functions; @@ -26,6 +26,7 @@ use Fisharebest\Webtrees\I18N; * Class NotesTabModule */ class NotesTabModule extends AbstractModule implements ModuleTabInterface { + /** @var Fact[] A list facts for this note. */ private $facts; /** {@inheritdoc} */ diff --git a/app/Module/OccupationReportModule.php b/app/Module/OccupationReportModule.php index 894120e318..cf3579d06e 100644 --- a/app/Module/OccupationReportModule.php +++ b/app/Module/OccupationReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/OnThisDayModule.php b/app/Module/OnThisDayModule.php index c78b1c1c3b..1898956d30 100644 --- a/app/Module/OnThisDayModule.php +++ b/app/Module/OnThisDayModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsEdit; @@ -36,8 +36,16 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “On this day” module */ I18N::translate('A list of the anniversaries that occur today.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; $filter = $this->getBlockSetting($block_id, 'filter', '1'); @@ -46,11 +54,9 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface { $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); $block = $this->getBlockSetting($block_id, 'block', '1'); - if ($cfg) { - foreach (array('filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -105,7 +111,11 @@ class OnThisDayModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'filter', Filter::postBool('filter')); diff --git a/app/Module/PageMenuModule.php b/app/Module/PageMenuModule.php index 1395f48ced..3a2e6044d5 100644 --- a/app/Module/PageMenuModule.php +++ b/app/Module/PageMenuModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; diff --git a/app/Module/PedigreeReportModule.php b/app/Module/PedigreeReportModule.php index 2de7ceedb0..a5926495c4 100644 --- a/app/Module/PedigreeReportModule.php +++ b/app/Module/PedigreeReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/RecentChangesModule.php b/app/Module/RecentChangesModule.php index 190d358a17..460f026932 100644 --- a/app/Module/RecentChangesModule.php +++ b/app/Module/RecentChangesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsDb; @@ -40,8 +40,16 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface return /* I18N: Description of the “Recent changes” module */ I18N::translate('A list of records that have been updated recently.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; $days = $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); @@ -50,11 +58,9 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface $block = $this->getBlockSetting($block_id, 'block', '1'); $hide_empty = $this->getBlockSetting($block_id, 'hide_empty', '0'); - if ($cfg) { - foreach (array('days', 'infoStyle', 'sortStyle', 'hide_empty', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('days', 'infoStyle', 'sortStyle', 'hide_empty', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -117,7 +123,11 @@ class RecentChangesModule extends AbstractModule implements ModuleBlockInterface return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'days', Filter::postInteger('days', 1, self::MAX_DAYS, self::DEFAULT_DAYS)); diff --git a/app/Module/RelatedIndividualsReportModule.php b/app/Module/RelatedIndividualsReportModule.php index ce940cfec5..83d93977b2 100644 --- a/app/Module/RelatedIndividualsReportModule.php +++ b/app/Module/RelatedIndividualsReportModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Menu; diff --git a/app/Module/RelativesTabModule.php b/app/Module/RelativesTabModule.php index 4be0781440..7f3b1f197b 100644 --- a/app/Module/RelativesTabModule.php +++ b/app/Module/RelativesTabModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Family; @@ -28,22 +28,37 @@ use Fisharebest\Webtrees\Theme; * Class RelativesTabModule */ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Families'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Families” module */ I18N::translate('A tab showing the close relatives of an individual.'); } - /** {@inheritdoc} */ + /** + * The user can re-arrange the tab order, but until they do, this + * is the order in which tabs are shown. + * + * @return int + */ public function defaultTabOrder() { return 20; } /** + * Display the age difference between marriages and the births of children. + * * @param Date $prev * @param Date $next * @param int $child_number @@ -77,6 +92,8 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { } /** + * Print a family group. + * * @param Family $family * @param string $type * @param string $label diff --git a/app/Module/ResearchTaskModule.php b/app/Module/ResearchTaskModule.php index 351c1b5ba1..27e0cfefde 100644 --- a/app/Module/ResearchTaskModule.php +++ b/app/Module/ResearchTaskModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; @@ -39,8 +38,16 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface return /* I18N: Description of “Research tasks” module */ I18N::translate('A list of tasks and activities that are linked to the family tree.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $controller, $WT_TREE; $show_other = $this->getBlockSetting($block_id, 'show_other', '1'); @@ -48,11 +55,9 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface $show_future = $this->getBlockSetting($block_id, 'show_future', '1'); $block = $this->getBlockSetting($block_id, 'block', '1'); - if ($cfg) { - foreach (array('show_unassigned', 'show_other', 'show_future', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('show_unassigned', 'show_other', 'show_future', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -158,7 +163,11 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'show_other', Filter::postBool('show_other')); diff --git a/app/Module/ReviewChangesModule.php b/app/Module/ReviewChangesModule.php index 3200b5c37e..3918388830 100644 --- a/app/Module/ReviewChangesModule.php +++ b/app/Module/ReviewChangesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; @@ -42,19 +42,25 @@ class ReviewChangesModule extends AbstractModule implements ModuleBlockInterface return /* I18N: Description of the “Pending changes” module */ I18N::translate('A list of changes that need moderator approval, and email notifications.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; $sendmail = $this->getBlockSetting($block_id, 'sendmail', '1'); $days = $this->getBlockSetting($block_id, 'days', '1'); $block = $this->getBlockSetting($block_id, 'block', '1'); - if ($cfg) { - foreach (array('days', 'sendmail', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('days', 'sendmail', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -151,7 +157,11 @@ class ReviewChangesModule extends AbstractModule implements ModuleBlockInterface return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'days', Filter::postInteger('num', 1, 180, 1)); diff --git a/app/Module/SiteMapModule.php b/app/Module/SiteMapModule.php index 7811d3993b..a896d2552a 100644 --- a/app/Module/SiteMapModule.php +++ b/app/Module/SiteMapModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Database; @@ -44,7 +44,12 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { return /* I18N: Description of the “Sitemaps” module */ I18N::translate('Generate sitemap files for search engines.'); } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { switch ($mod_action) { case 'admin': @@ -59,6 +64,8 @@ class SiteMapModule extends AbstractModule implements ModuleConfigInterface { } /** + * Generate an XML file. + * * @param string $file */ private function generate($file) { diff --git a/app/Module/SlideShowModule.php b/app/Module/SlideShowModule.php index 42ebec0c7a..86ec66d5ec 100644 --- a/app/Module/SlideShowModule.php +++ b/app/Module/SlideShowModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; @@ -39,8 +39,16 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “Slide show” module */ I18N::translate('Random images from the current family tree.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; $filter = $this->getBlockSetting($block_id, 'filter', 'all'); @@ -205,7 +213,11 @@ class SlideShowModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'filter', Filter::post('filter', 'indi|event|all', 'all')); diff --git a/app/Module/SourcesTabModule.php b/app/Module/SourcesTabModule.php index b0a0c3add0..c8c740bb43 100644 --- a/app/Module/SourcesTabModule.php +++ b/app/Module/SourcesTabModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Fact; use Fisharebest\Webtrees\Functions\Functions; @@ -26,6 +26,7 @@ use Fisharebest\Webtrees\I18N; * Class SourcesTabModule */ class SourcesTabModule extends AbstractModule implements ModuleTabInterface { + /** @var Fact[] All facts belonging to this source. */ private $facts; /** {@inheritdoc} */ diff --git a/app/Module/StoriesModule.php b/app/Module/StoriesModule.php index 61d7d8b40a..b2baba52de 100644 --- a/app/Module/StoriesModule.php +++ b/app/Module/StoriesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Database; @@ -41,7 +41,12 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module return /* I18N: Description of the “Stories” module */ I18N::translate('Add narrative stories to individuals in the family tree.'); } - /** {@inheritdoc} */ + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ public function modAction($mod_action) { switch ($mod_action) { case 'admin_edit': diff --git a/app/Module/ThemeSelectModule.php b/app/Module/ThemeSelectModule.php index 3851a971a4..0a7829bc40 100644 --- a/app/Module/ThemeSelectModule.php +++ b/app/Module/ThemeSelectModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Theme; -use Fisharebest\Webtrees\Theme\AbstractTheme; /** * Class ThemeSelectModule @@ -33,8 +32,16 @@ class ThemeSelectModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “Theme change” module */ I18N::translate('An alternative way to select a new theme.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; $title = $this->getTitle(); @@ -68,7 +75,11 @@ class ThemeSelectModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { } } diff --git a/app/Module/TopGivenNamesModule.php b/app/Module/TopGivenNamesModule.php index c7e93f1a79..e8fc39d9c4 100644 --- a/app/Module/TopGivenNamesModule.php +++ b/app/Module/TopGivenNamesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsEdit; @@ -36,19 +36,25 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface return /* I18N: Description of the “Top given names” module */ I18N::translate('A list of the most popular given names.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; $num = $this->getBlockSetting($block_id, 'num', '10'); $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); $block = $this->getBlockSetting($block_id, 'block', '0'); - if ($cfg) { - foreach (array('num', 'infoStyle', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('num', 'infoStyle', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -127,7 +133,11 @@ class TopGivenNamesModule extends AbstractModule implements ModuleBlockInterface return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'num', Filter::postInteger('num', 1, 10000, 10)); diff --git a/app/Module/TopPageViewsModule.php b/app/Module/TopPageViewsModule.php index 641c41e142..a705099c7b 100644 --- a/app/Module/TopPageViewsModule.php +++ b/app/Module/TopPageViewsModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; @@ -27,29 +27,43 @@ use Fisharebest\Webtrees\Theme; * Class TopPageViewsModule */ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface { - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Most viewed pages'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Most visited pages” module */ I18N::translate('A list of the pages that have been viewed the most number of times.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $WT_TREE; $num = $this->getBlockSetting($block_id, 'num', '10'); $count_placement = $this->getBlockSetting($block_id, 'count_placement', 'before'); $block = $this->getBlockSetting($block_id, 'block', '0'); - if ($cfg) { - foreach (array('count_placement', 'num', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('count_placement', 'num', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -106,22 +120,41 @@ class TopPageViewsModule extends AbstractModule implements ModuleBlockInterface } } - /** {@inheritdoc} */ + /** + * Should this block load asynchronously using AJAX? + * + * Simple blocks are faster in-line, more comples ones + * can be loaded later. + * + * @return bool + */ public function loadAjax() { return true; } - /** {@inheritdoc} */ + /** + * Can this block be shown on the user’s home page? + * + * @return bool + */ public function isUserBlock() { return false; } - /** {@inheritdoc} */ + /** + * Can this block be shown on the tree’s home page? + * + * @return bool + */ public function isGedcomBlock() { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'num', Filter::postInteger('num', 1, 10000, 10)); diff --git a/app/Module/TopSurnamesModule.php b/app/Module/TopSurnamesModule.php index 85e0423737..7d64759e25 100644 --- a/app/Module/TopSurnamesModule.php +++ b/app/Module/TopSurnamesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsDb; @@ -28,17 +28,33 @@ use Fisharebest\Webtrees\Theme; * Class TopSurnamesModule */ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface { - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module. Top=Most common */ I18N::translate('Top surnames'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Top surnames” module */ I18N::translate('A list of the most popular surnames.'); } - /** {@inheritdoc} */ + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ public function getBlock($block_id, $template = true, $cfg = null) { global $WT_TREE, $ctype; @@ -49,11 +65,9 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface { $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); $block = $this->getBlockSetting($block_id, 'block', '0'); - if ($cfg) { - foreach (array('num', 'infoStyle', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('num', 'infoStyle', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -142,7 +156,11 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'num', Filter::postInteger('num', 1, 10000, 10)); diff --git a/app/Module/UpcomingAnniversariesModule.php b/app/Module/UpcomingAnniversariesModule.php index a41a6c210f..b627764eb0 100644 --- a/app/Module/UpcomingAnniversariesModule.php +++ b/app/Module/UpcomingAnniversariesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Functions\FunctionsEdit; @@ -26,17 +26,33 @@ use Fisharebest\Webtrees\Theme; * Class UpcomingAnniversariesModule */ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockInterface { - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Upcoming events'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Upcoming events” module */ I18N::translate('A list of the anniversaries that will occur in the near future.'); } - /** {@inheritdoc} */ + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ public function getBlock($block_id, $template = true, $cfg = null) { global $ctype, $WT_TREE; @@ -47,11 +63,9 @@ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockI $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); $block = $this->getBlockSetting($block_id, 'block', '1'); - if ($cfg) { - foreach (array('days', 'filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('days', 'filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -107,7 +121,11 @@ class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockI return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'days', Filter::postInteger('days', 1, 30, 7)); diff --git a/app/Module/UserFavoritesModule.php b/app/Module/UserFavoritesModule.php index d5202b4afd..0e52ccfddc 100644 --- a/app/Module/UserFavoritesModule.php +++ b/app/Module/UserFavoritesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; @@ -35,12 +34,20 @@ class UserFavoritesModule extends FamilyTreeFavoritesModule { return /* I18N: Description of the “Favorites” module */ I18N::translate('Display and manage a user’s favorite pages.'); } - /** {@inheritdoc} */ + /** + * Can this block be shown on the user’s home page? + * + * @return bool + */ public function isUserBlock() { return true; } - /** {@inheritdoc} */ + /** + * Can this block be shown on the tree’s home page? + * + * @return bool + */ public function isGedcomBlock() { return false; } @@ -63,11 +70,16 @@ class UserFavoritesModule extends FamilyTreeFavoritesModule { ->fetchAll(PDO::FETCH_ASSOC); } - /** {@inheritdoc} */ - public function modAction($modAction) { + /** + * This is a general purpose hook, allowing modules to respond to routes + * of the form module.php?mod=FOO&mod_action=BAR + * + * @param string $mod_action + */ + public function modAction($mod_action) { global $WT_TREE; - switch ($modAction) { + switch ($mod_action) { case 'menu-add-favorite': // Process the "add to user favorites" menu item on indi/fam/etc. pages $record = GedcomRecord::getInstance(Filter::post('xref', WT_REGEX_XREF), $WT_TREE); diff --git a/app/Module/UserJournalModule.php b/app/Module/UserJournalModule.php index 026d5e3730..537afecebd 100644 --- a/app/Module/UserJournalModule.php +++ b/app/Module/UserJournalModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; @@ -26,7 +26,11 @@ use Fisharebest\Webtrees\Theme; * Class UserJournalModule */ class UserJournalModule extends AbstractModule implements ModuleBlockInterface { - /** {@inheritdoc} */ + /** + * Create a new module. + * + * @param string $directory Where is this module installed + */ public function __construct($directory) { parent::__construct($directory); @@ -34,18 +38,34 @@ class UserJournalModule extends AbstractModule implements ModuleBlockInterface { Database::updateSchema('\Fisharebest\Webtrees\Module\FamilyTreeNews\Schema', 'NB_SCHEMA_VERSION', 3); } - /** {@inheritdoc} */ + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Journal'); } - /** {@inheritdoc} */ + /** + * A sentence describing what this module does. + * + * @return string + */ public function getDescription() { return /* I18N: Description of the “Journal” module */ I18N::translate('A private area to record notes or keep a journal.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype; switch (Filter::get('action')) { @@ -57,11 +77,9 @@ class UserJournalModule extends AbstractModule implements ModuleBlockInterface { break; } $block = $this->getBlockSetting($block_id, 'block', '1'); - if ($cfg) { - foreach (array('block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } $usernews = Database::prepare( @@ -117,7 +135,11 @@ class UserJournalModule extends AbstractModule implements ModuleBlockInterface { return false; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { } } diff --git a/app/Module/UserMessagesModule.php b/app/Module/UserMessagesModule.php index 01739de07a..b090e9be96 100644 --- a/app/Module/UserMessagesModule.php +++ b/app/Module/UserMessagesModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; @@ -38,8 +38,16 @@ class UserMessagesModule extends AbstractModule implements ModuleBlockInterface return /* I18N: Description of the “Messages” module */ I18N::translate('Communicate directly with other users, using private messages.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { // Block actions $action = Filter::post('action'); $message_ids = Filter::postArray('message_id'); @@ -49,11 +57,9 @@ class UserMessagesModule extends AbstractModule implements ModuleBlockInterface } } $block = $this->getBlockSetting($block_id, 'block', '1'); - if ($cfg) { - foreach (array('block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } $messages = Database::prepare("SELECT message_id, sender, subject, body, UNIX_TIMESTAMP(created) AS created FROM `##message` WHERE user_id=? ORDER BY message_id DESC") @@ -143,7 +149,11 @@ class UserMessagesModule extends AbstractModule implements ModuleBlockInterface return false; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'block', Filter::postBool('block')); diff --git a/app/Module/UserWelcomeModule.php b/app/Module/UserWelcomeModule.php index 1cb7863d98..7ddc878fd3 100644 --- a/app/Module/UserWelcomeModule.php +++ b/app/Module/UserWelcomeModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Theme; @@ -33,8 +33,16 @@ class UserWelcomeModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “My page” module */ I18N::translate('A greeting message and useful links for a user.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $WT_TREE; $id = $this->getName() . $block_id; @@ -72,7 +80,11 @@ class UserWelcomeModule extends AbstractModule implements ModuleBlockInterface { return false; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { } } diff --git a/app/Module/WelcomeBlockModule.php b/app/Module/WelcomeBlockModule.php index e3a74b97d8..144293ec65 100644 --- a/app/Module/WelcomeBlockModule.php +++ b/app/Module/WelcomeBlockModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Site; @@ -34,8 +34,16 @@ class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface return /* I18N: Description of the “Home page” module */ I18N::translate('A greeting message for site visitors.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $controller, $WT_TREE; $indi_xref = $controller->getSignificantIndividual()->getXref(); @@ -73,7 +81,11 @@ class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { } } diff --git a/app/Module/YahrzeitModule.php b/app/Module/YahrzeitModule.php index 301d5c3f61..f520a10a5d 100644 --- a/app/Module/YahrzeitModule.php +++ b/app/Module/YahrzeitModule.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Module; use Fisharebest\ExtCalendar\JewishCalendar; use Fisharebest\Webtrees\Auth; @@ -43,8 +42,16 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface { return /* I18N: Description of the “Yahrzeiten” module. A “Hebrew death” is a death where the date is recorded in the Hebrew calendar. */ I18N::translate('A list of the Hebrew death anniversaries that will occur in the near future.'); } - /** {@inheritdoc} */ - public function getBlock($block_id, $template = true, $cfg = null) { + /** + * Generate the HTML content of this block. + * + * @param int $block_id + * @param bool $template + * @param array $cfg + * + * @return string + */ + public function getBlock($block_id, $template = true, $cfg = array()) { global $ctype, $controller, $WT_TREE; $days = $this->getBlockSetting($block_id, 'days', '7'); @@ -52,11 +59,9 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface { $calendar = $this->getBlockSetting($block_id, 'calendar', 'jewish'); $block = $this->getBlockSetting($block_id, 'block', '1'); - if ($cfg) { - foreach (array('days', 'infoStyle', 'block') as $name) { - if (array_key_exists($name, $cfg)) { - $$name = $cfg[$name]; - } + foreach (array('days', 'infoStyle', 'block') as $name) { + if (array_key_exists($name, $cfg)) { + $$name = $cfg[$name]; } } @@ -240,7 +245,11 @@ class YahrzeitModule extends AbstractModule implements ModuleBlockInterface { return true; } - /** {@inheritdoc} */ + /** + * An HTML form to edit block settings + * + * @param int $block_id + */ public function configureBlock($block_id) { if (Filter::postBool('save') && Filter::checkCsrf()) { $this->setBlockSetting($block_id, 'days', Filter::postInteger('days', 1, 30, 7)); diff --git a/app/Note.php b/app/Note.php index 283335743e..e19a7a5a56 100644 --- a/app/Note.php +++ b/app/Note.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class Note - Class file for a Shared Note (NOTE) object + * A GEDCOM note (NOTE) object. */ class Note extends GedcomRecord { const RECORD_TYPE = 'NOTE'; @@ -36,7 +35,13 @@ class Note extends GedcomRecord { } } - /** {@inheritdoc} */ + /** + * Each object type may have its own special rules, and re-implement this function. + * + * @param int $access_level + * + * @return bool + */ protected function canShowByType($access_level) { // Hide notes if they are attached to private records $linked_ids = Database::prepare( @@ -55,12 +60,25 @@ class Note extends GedcomRecord { return parent::canShowByType($access_level); } - /** {@inheritdoc} */ + /** + * Generate a private version of this record + * + * @param int $access_level + * + * @return string + */ protected function createPrivateGedcomRecord($access_level) { return '0 @' . $this->xref . '@ NOTE ' . I18N::translate('Private'); } - /** {@inheritdoc} */ + /** + * Fetch data from the database + * + * @param string $xref + * @param int $tree_id + * + * @return null|string + */ protected static function fetchGedcomRecord($xref, $tree_id) { return Database::prepare( "SELECT o_gedcom FROM `##other` WHERE o_id = :xref AND o_file = :tree_id AND o_type = 'NOTE'" @@ -73,8 +91,6 @@ class Note extends GedcomRecord { /** * Create a name for this note - apply (and remove) markup, then take * a maximum of 100 characters from the first line. - * - * {@inheritdoc} */ public function extractNames() { $text = $this->getNote(); diff --git a/app/Place.php b/app/Place.php index 5c9c51d996..3fd797f08a 100644 --- a/app/Place.php +++ b/app/Place.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees; /** - * Class Place - Gedcom Place functionality. + * A GEDCOM place (PLAC) object. */ class Place { const GEDCOM_SEPARATOR = ', '; - /** - * @var string[] e.g. array('Westminster', 'London', 'England') - */ + /** @var string[] e.g. array('Westminster', 'London', 'England') */ private $gedcom_place; - /** - * @var Tree We may have the same place name in different trees - */ + /** @var Tree We may have the same place name in different trees. */ private $tree; /** + * Create a place. + * * @param string $gedcom_place * @param Tree $tree */ @@ -47,6 +44,8 @@ class Place { } /** + * Get the identifier for a place. + * * @return int */ public function getPlaceId() { @@ -65,6 +64,8 @@ class Place { } /** + * Get the higher level place. + * * @return Place */ public function getParentPlace() { @@ -72,6 +73,8 @@ class Place { } /** + * Get the lower level places. + * * @return Place[] */ public function getChildPlaces() { @@ -99,6 +102,8 @@ class Place { } /** + * Create a URL to the place-hierarchy page. + * * @return string */ public function getURL() { @@ -117,6 +122,8 @@ class Place { } /** + * Format this name for GEDCOM data. + * * @return string */ public function getGedcomName() { @@ -124,6 +131,8 @@ class Place { } /** + * Format this place for display on screen. + * * @return string */ public function getPlaceName() { @@ -133,6 +142,8 @@ class Place { } /** + * Is this a null/empty/missing/invalid place? + * * @return bool */ public function isEmpty() { @@ -140,6 +151,8 @@ class Place { } /** + * Generate the place name for display, including the full hierarchy. + * * @return string */ public function getFullName() { @@ -197,6 +210,8 @@ class Place { } /** + * Fetch all places from the database. + * * @param Tree $tree * * @return string[] @@ -230,6 +245,8 @@ class Place { } /** + * Search for a place name. + * * @param string $filter * @param Tree $tree * diff --git a/app/Query/QueryMedia.php b/app/Query/QueryMedia.php index 3338a4cbf0..cbda1c1709 100644 --- a/app/Query/QueryMedia.php +++ b/app/Query/QueryMedia.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Query; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\Media; /** - * Class QueryMedia - generate lists of files for admin_media.php + * Generate lists of files for admin_media.php */ class QueryMedia { /** diff --git a/app/Query/QueryName.php b/app/Query/QueryName.php index 611e24aaec..722a4f50e4 100644 --- a/app/Query/QueryName.php +++ b/app/Query/QueryName.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Query; + use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\I18N; @@ -22,7 +22,7 @@ use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Tree; /** - * Class QueryName - generate lists for indilist.php and famlist.php + * Generate lists for indilist.php and famlist.php */ class QueryName { /** diff --git a/app/Report/ReportBase.php b/app/Report/ReportBase.php index 1bdef4ddfc..fab00d30f7 100644 --- a/app/Report/ReportBase.php +++ b/app/Report/ReportBase.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\I18N; /** diff --git a/app/Report/ReportBaseCell.php b/app/Report/ReportBaseCell.php index 55cd9e3829..12a024658a 100644 --- a/app/Report/ReportBaseCell.php +++ b/app/Report/ReportBaseCell.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseCell @@ -109,6 +108,7 @@ class ReportBaseCell extends ReportBaseElement { */ public $width; + /** @var int Unknown */ public $reseth; /** diff --git a/app/Report/ReportBaseElement.php b/app/Report/ReportBaseElement.php index b0952bf9fb..617b606796 100644 --- a/app/Report/ReportBaseElement.php +++ b/app/Report/ReportBaseElement.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseElement */ class ReportBaseElement { - /** - * @var string - */ - public $text = ""; + /** @var string Text*/ + public $text = ''; /** * Element renderer @@ -35,6 +32,8 @@ class ReportBaseElement { } /** + * Get the height. + * * @param ReportHtml|ReportTcpdf $renderer * * @return float @@ -44,6 +43,8 @@ class ReportBaseElement { } /** + * Get the width. + * * @param ReportHtml|ReportTcpdf $renderer * * @return float @@ -53,6 +54,8 @@ class ReportBaseElement { } /** + * Add text. + * * @param string $t * * @return int @@ -68,6 +71,8 @@ class ReportBaseElement { } /** + * Add an end-of-line. + * * @return int */ public function addNewline() { @@ -77,6 +82,8 @@ class ReportBaseElement { } /** + * Get the current text. + * * @return string */ public function getValue() { @@ -84,6 +91,8 @@ class ReportBaseElement { } /** + * Set the width to wrap text. + * * @param $wrapwidth * @param $cellwidth * @@ -94,13 +103,16 @@ class ReportBaseElement { } /** + * Render the footnotes. + * * @param $renderer */ public function renderFootnote($renderer) { - // To be implemented in inherited classes } /** + * Set the text. + * * @param $text */ public function setText($text) { diff --git a/app/Report/ReportBaseFootnote.php b/app/Report/ReportBaseFootnote.php index 4293d2cf7a..61736ffbec 100644 --- a/app/Report/ReportBaseFootnote.php +++ b/app/Report/ReportBaseFootnote.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseFootnote @@ -55,9 +54,12 @@ class ReportBaseFootnote extends ReportBaseElement { */ public $wrapWidthCell; + /** @var string A link */ public $addlink; /** + * Createa an element. + * * @param string $style */ public function __construct($style = "") { @@ -67,11 +69,11 @@ class ReportBaseFootnote extends ReportBaseElement { } else { $this->styleName = "footnote"; } - - return 0; } /** + * Add text. + * * @param $t * * @return int @@ -87,6 +89,8 @@ class ReportBaseFootnote extends ReportBaseElement { } /** + * Set the width to wrap text. + * * @param $wrapwidth * @param $cellwidth * @@ -104,6 +108,8 @@ class ReportBaseFootnote extends ReportBaseElement { } /** + * Set the number. + * * @param $n * * @return int @@ -116,6 +122,8 @@ class ReportBaseFootnote extends ReportBaseElement { } /** + * Add a link. + * * @param $a * * @return int diff --git a/app/Report/ReportBaseHtml.php b/app/Report/ReportBaseHtml.php index ea38e2eabc..0165aae94c 100644 --- a/app/Report/ReportBaseHtml.php +++ b/app/Report/ReportBaseHtml.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseHtml */ class ReportBaseHtml extends ReportBaseElement { + /** @var string The XML tag. */ public $tag; + + /** @var string[] Attributes of the XML tag. */ public $attrs; + + /** @var ReportBaseElement[] A list of elements. */ public $elements = array(); /** + * Create an element. + * * @param $tag * @param $attrs */ @@ -36,6 +42,8 @@ class ReportBaseHtml extends ReportBaseElement { } /** + * Get the start tag. + * * @return string */ public function getStart() { @@ -49,6 +57,8 @@ class ReportBaseHtml extends ReportBaseElement { } /** + * Get the end tag. + * * @return string */ public function getEnd() { @@ -56,7 +66,9 @@ class ReportBaseHtml extends ReportBaseElement { } /** - * @param $element + * Add an element. + * + * @param ReportBaseElement $element */ public function addElement($element) { $this->elements[] = $element; diff --git a/app/Report/ReportBaseImage.php b/app/Report/ReportBaseImage.php index 1a94463c8d..7aa40f1517 100644 --- a/app/Report/ReportBaseImage.php +++ b/app/Report/ReportBaseImage.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseImage @@ -87,6 +86,8 @@ class ReportBaseImage extends ReportBaseElement { } /** + * Get the height. + * * @param $renderer * * @return float @@ -96,6 +97,8 @@ class ReportBaseImage extends ReportBaseElement { } /** + * Get the width. + * * @param $renderer * * @return float diff --git a/app/Report/ReportBaseLine.php b/app/Report/ReportBaseLine.php index f36bab985f..870e61b38f 100644 --- a/app/Report/ReportBaseLine.php +++ b/app/Report/ReportBaseLine.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseLine @@ -63,6 +62,8 @@ class ReportBaseLine extends ReportBaseElement { } /** + * Get the height of the line. + * * @param $renderer * * @return number @@ -72,6 +73,8 @@ class ReportBaseLine extends ReportBaseElement { } /** + * Get the width of the line. + * * @param $renderer * * @return number diff --git a/app/Report/ReportBasePageheader.php b/app/Report/ReportBasePageheader.php index 7511fd76ab..efe8bf9437 100644 --- a/app/Report/ReportBasePageheader.php +++ b/app/Report/ReportBasePageheader.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBasePageheader */ class ReportBasePageheader extends ReportBaseElement { + /** @var ReportBaseElement[] Elements */ public $elements = array(); /** - * + * Create a page header */ public function __construct() { $this->elements = array(); @@ -32,6 +32,8 @@ class ReportBasePageheader extends ReportBaseElement { } /** + * Unknown? + * * @return int */ public function textBox() { @@ -43,7 +45,7 @@ class ReportBasePageheader extends ReportBaseElement { /** * Add element - PageHeader * - * @param $element + * @param ReportBaseElement $element */ public function addElement($element) { $this->elements[] = $element; diff --git a/app/Report/ReportBaseText.php b/app/Report/ReportBaseText.php index b28cdcef27..c90bc91d58 100644 --- a/app/Report/ReportBaseText.php +++ b/app/Report/ReportBaseText.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseText @@ -61,6 +60,8 @@ class ReportBaseText extends ReportBaseElement { } /** + * Set the width for word-wrapping. + * * @param $wrapwidth * @param $cellwidth * @@ -78,6 +79,8 @@ class ReportBaseText extends ReportBaseElement { } /** + * Get the style name. + * * @return string */ public function getStyleName() { diff --git a/app/Report/ReportBaseTextbox.php b/app/Report/ReportBaseTextbox.php index 02c16ed890..614e917463 100644 --- a/app/Report/ReportBaseTextbox.php +++ b/app/Report/ReportBaseTextbox.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseTextbox @@ -59,17 +58,12 @@ class ReportBaseTextbox extends ReportBaseElement { */ public $newline; - /** - * @var bool - */ + /** @var bool Unused? */ public $pagecheck; - /** - * Whether or not a border should be printed around this box. 0 = no border, 1 = border. Default is 0 - * - * @var bool - */ + /** @var bool Whether to print a border */ public $border; + /** * Style of rendering * diff --git a/app/Report/ReportHtml.php b/app/Report/ReportHtml.php index aa5ad15eb3..47ab83efcf 100644 --- a/app/Report/ReportHtml.php +++ b/app/Report/ReportHtml.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Controller\SimpleController; use Fisharebest\Webtrees\Functions\FunctionsRtl; use Fisharebest\Webtrees\I18N; @@ -163,6 +163,8 @@ class ReportHtml extends ReportBase { } /** + * Add an element. + * * @param $element */ public function addElement($element) { @@ -176,7 +178,7 @@ class ReportHtml extends ReportBase { } /** - * + * Generate the page header */ public function runPageHeader() { foreach ($this->pageHeaderElements as $element) { @@ -191,7 +193,7 @@ class ReportHtml extends ReportBase { } /** - * + * Generate footnotes */ public function footnotes() { $this->currentStyle = ""; @@ -203,7 +205,7 @@ class ReportHtml extends ReportBase { } /** - * + * Run the report. */ public function run() { $controller = new SimpleController; @@ -313,6 +315,8 @@ class ReportHtml extends ReportBase { } /** + * Create a text box. + * * @param $width * @param $height * @param $border @@ -333,6 +337,8 @@ class ReportHtml extends ReportBase { } /** + * Create a text element. + * * @param $style * @param $color * @@ -343,6 +349,8 @@ class ReportHtml extends ReportBase { } /** + * Create a footnote. + * * @param string $style * * @return ReportHtmlFootnote @@ -352,6 +360,8 @@ class ReportHtml extends ReportBase { } /** + * Create a page header. + * * @return ReportHtmlPageheader */ public function createPageHeader() { @@ -359,6 +369,8 @@ class ReportHtml extends ReportBase { } /** + * Create an image. + * * @param $file * @param $x * @param $y @@ -374,6 +386,8 @@ class ReportHtml extends ReportBase { } /** + * Create an image. + * * @param Media $mediaobject * @param $x * @param $y @@ -389,6 +403,8 @@ class ReportHtml extends ReportBase { } /** + * Create a line. + * * @param $x1 * @param $y1 * @param $x2 @@ -401,6 +417,7 @@ class ReportHtml extends ReportBase { } /** + * Create an HTML element. * @param $tag * @param $attrs * @@ -417,10 +434,6 @@ class ReportHtml extends ReportBase { $this->headerElements = array(); } - /**************************** - * Local HTML Report functions - ****************************/ - /** * Update the Page Number and set a new Y if max Y is larger - ReportHtml */ @@ -450,6 +463,8 @@ class ReportHtml extends ReportBase { } /** + * Add a page header. + * * @param $element * * @return int @@ -512,6 +527,8 @@ class ReportHtml extends ReportBase { } /** + * Get the current style. + * * @return string */ public function getCurrentStyle() { @@ -519,6 +536,8 @@ class ReportHtml extends ReportBase { } /** + * Get the current style height. + * * @return int */ public function getCurrentStyleHeight() { @@ -531,6 +550,8 @@ class ReportHtml extends ReportBase { } /** + * Get the current footnotes height. + * * @param $cellWidth * * @return int @@ -554,6 +575,8 @@ class ReportHtml extends ReportBase { } /** + * Get the page height. + * * @return float */ public function getPageHeight() { @@ -561,6 +584,8 @@ class ReportHtml extends ReportBase { } /** + * Get the width of a string. + * * @param $text * * @return int @@ -613,6 +638,8 @@ class ReportHtml extends ReportBase { } /** + * Set the current style. + * * @param $s */ public function setCurrentStyle($s) { diff --git a/app/Report/ReportHtmlCell.php b/app/Report/ReportHtmlCell.php index d2c5f7b308..ef42206041 100644 --- a/app/Report/ReportHtmlCell.php +++ b/app/Report/ReportHtmlCell.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlCell diff --git a/app/Report/ReportHtmlFootnote.php b/app/Report/ReportHtmlFootnote.php index 6e960ec969..324a045739 100644 --- a/app/Report/ReportHtmlFootnote.php +++ b/app/Report/ReportHtmlFootnote.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * class ReportHtmlFootnote diff --git a/app/Report/ReportHtmlHtml.php b/app/Report/ReportHtmlHtml.php index 9fb6e86169..c04b50bdb4 100644 --- a/app/Report/ReportHtmlHtml.php +++ b/app/Report/ReportHtmlHtml.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlHtml */ class ReportHtmlHtml extends ReportBaseHtml { /** + * Render the elements. + * * @param ReportHtml $renderer * @param bool $sub * @param bool $inat diff --git a/app/Report/ReportHtmlImage.php b/app/Report/ReportHtmlImage.php index 146b594f57..aa8012d9a5 100644 --- a/app/Report/ReportHtmlImage.php +++ b/app/Report/ReportHtmlImage.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlImage diff --git a/app/Report/ReportHtmlLine.php b/app/Report/ReportHtmlLine.php index 588e92e2aa..62a2b949f4 100644 --- a/app/Report/ReportHtmlLine.php +++ b/app/Report/ReportHtmlLine.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlLine diff --git a/app/Report/ReportHtmlPageheader.php b/app/Report/ReportHtmlPageheader.php index 8d773e532a..996649c137 100644 --- a/app/Report/ReportHtmlPageheader.php +++ b/app/Report/ReportHtmlPageheader.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlPageheader */ class ReportHtmlPageheader extends ReportBasePageheader { /** + * Render elements. + * * @param ReportHtml $renderer */ public function render($renderer) { diff --git a/app/Report/ReportHtmlText.php b/app/Report/ReportHtmlText.php index 68e11567dd..fada92ece4 100644 --- a/app/Report/ReportHtmlText.php +++ b/app/Report/ReportHtmlText.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlText */ class ReportHtmlText extends ReportBaseText { /** + * Render the elements. + * * @param ReportHtml $renderer * @param int $curx * @param bool $attrib Is is called from a different element? diff --git a/app/Report/ReportHtmlTextbox.php b/app/Report/ReportHtmlTextbox.php index 82db40e6d6..2ce893dfc0 100644 --- a/app/Report/ReportHtmlTextbox.php +++ b/app/Report/ReportHtmlTextbox.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlTextbox */ class ReportHtmlTextbox extends ReportBaseTextbox { /** + * Render the elements. + * * @param ReportHtml $renderer */ public function render($renderer) { diff --git a/app/Report/ReportParserBase.php b/app/Report/ReportParserBase.php index 5a40396d58..09682701b0 100644 --- a/app/Report/ReportParserBase.php +++ b/app/Report/ReportParserBase.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportParserBase @@ -31,8 +30,9 @@ class ReportParserBase { * * @param string $report The XML filename * @param ReportBase $report_root + * @param string[][] $vars */ - public function __construct($report, ReportBase $report_root = null) { + public function __construct($report, ReportBase $report_root = null, $vars = array()) { $this->xml_parser = xml_parser_create(); xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false); xml_set_element_handler($this->xml_parser, array($this, 'startElement'), array($this, 'endElement')); diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php index 58448a930e..a8dcfc3cec 100644 --- a/app/Report/ReportParserGenerate.php +++ b/app/Report/ReportParserGenerate.php @@ -1,6 +1,4 @@ . */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Date; @@ -43,13 +43,13 @@ class ReportParserGenerate extends ReportParserBase { /** @var bool[] Push-down stack of $print_data */ private $print_data_stack = array(); - /** @var int */ + /** @var int Are we processing GEDCOM data */ private $process_gedcoms = 0; - /** @var int */ + /** @var int Are we processing conditionals */ private $process_ifs = 0; - /** @var int */ + /** @var int Are we processing repeats*/ private $process_repeats = 0; /** @var int Quantity of data to repeat during loops */ @@ -112,7 +112,13 @@ class ReportParserGenerate extends ReportParserBase { /** @var string[][] Variables defined in the report at run-time */ private $vars; - /** {@inheritDoc} */ + /** + * Create a parser for a report + * + * @param string $report The XML filename + * @param ReportBase $report_root + * @param string[][] $vars + */ public function __construct($report, ReportBase $report_root = null, array $vars = array()) { $this->report_root = $report_root; $this->wt_report = $report_root; @@ -122,7 +128,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - *XML start element handler + * XML start element handler * * This function is called whenever a starting element is reached * The element handler will be called if found, otherwise it must be HTML @@ -188,7 +194,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML