diff --git a/classes/file/PublicFileManager.php b/classes/file/PublicFileManager.php index f22c5a34dc7..f773fd96502 100644 --- a/classes/file/PublicFileManager.php +++ b/classes/file/PublicFileManager.php @@ -24,9 +24,9 @@ class PublicFileManager extends PKPPublicFileManager /** * @copydoc PKPPublicFileManager::getContextFilesPath() */ - public function getContextFilesPath($contextId) + public function getContextFilesPath(int $contextId) { - return Config::getVar('files', 'public_files_dir') . '/presses/' . (int) $contextId; + return Config::getVar('files', 'public_files_dir') . '/presses/' . $contextId; } } diff --git a/classes/migration/upgrade/v3_5_0/I8333_AddMissingForeignKeys.php b/classes/migration/upgrade/v3_5_0/I8333_AddMissingForeignKeys.php new file mode 100644 index 00000000000..17b00c0017e --- /dev/null +++ b/classes/migration/upgrade/v3_5_0/I8333_AddMissingForeignKeys.php @@ -0,0 +1,33 @@ +_pressCache[$pressId])) { - $this->_pressCache[$pressId] = $this->_pressDao->getById($pressId); - } - return $this->_pressCache[$pressId]; + return $this->_pressCache[$pressId] ??= $this->_pressDao->getById($pressId); } /** @@ -94,7 +89,6 @@ public function getSeries($seriesId) /** * Return hierarchy of OAI sets (presses plus press series). * - * @param int|null $pressId * @param int $offset * @param int $total * @@ -102,7 +96,7 @@ public function getSeries($seriesId) * * @hook OAIDAO::getSets [[&$this, $pressId, $offset, $limit, $total, &$sets]] */ - public function getSets($pressId, $offset, $limit, &$total) + public function getSets(?int $pressId, $offset, $limit, &$total) { if (isset($pressId)) { $presses = [$this->getPress($pressId)]; diff --git a/classes/oai/omp/PressOAI.php b/classes/oai/omp/PressOAI.php index f4c655c06a3..4d4230f0dce 100644 --- a/classes/oai/omp/PressOAI.php +++ b/classes/oai/omp/PressOAI.php @@ -42,8 +42,7 @@ class PressOAI extends OAI /** @var Press $press associated press object */ public $press; - /** @var int $pressId null if no press */ - public $pressId; + public ?int $pressId; /** @var OAIDAO $dao DAO for retrieving OAI records/tokens from database */ public $dao; @@ -99,11 +98,10 @@ public function identifierToPublicationFormatId($identifier) * Get press ID and series ID corresponding to a set specifier. * * @param string $setSpec - * @param int $pressId * * @return array */ - public function setSpecToSeriesId($setSpec, $pressId = null) + public function setSpecToSeriesId($setSpec, ?int $pressId = null) { $tmpArray = preg_split('/:/', $setSpec); if (count($tmpArray) == 1) { diff --git a/classes/observers/events/UsageEvent.php b/classes/observers/events/UsageEvent.php index 329ec063cc5..a69eef1bfbd 100644 --- a/classes/observers/events/UsageEvent.php +++ b/classes/observers/events/UsageEvent.php @@ -32,7 +32,7 @@ class UsageEvent extends \PKP\observers\events\UsageEvent public ?Chapter $chapter; public ?Section $series; - public function __construct(int $assocType, Context $context, Submission $submission = null, Representation $publicationFormat = null, SubmissionFile $submissionFile = null, Chapter $chapter = null, Section $series = null) + public function __construct(int $assocType, Context $context, ?Submission $submission = null, ?Representation $publicationFormat = null, ?SubmissionFile $submissionFile = null, ?Chapter $chapter = null, ?Section $series = null) { $this->chapter = $chapter; $this->series = $series; diff --git a/classes/payment/omp/OMPCompletedPaymentDAO.php b/classes/payment/omp/OMPCompletedPaymentDAO.php index feb3269672c..4648623df87 100644 --- a/classes/payment/omp/OMPCompletedPaymentDAO.php +++ b/classes/payment/omp/OMPCompletedPaymentDAO.php @@ -31,11 +31,10 @@ class OMPCompletedPaymentDAO extends DAO * Retrieve a CompletedPayment by its ID. * * @param int $completedPaymentId - * @param int $contextId optional * * @return CompletedPayment|null */ - public function getById($completedPaymentId, $contextId = null) + public function getById($completedPaymentId, ?int $contextId = null) { $params = [(int) $completedPaymentId]; if ($contextId) { @@ -141,12 +140,11 @@ public function hasPaidPurchaseFile($userId, $submissionFileId) /** * Retrieve an array of payments for a particular context ID. * - * @param int $contextId * @param DBResultRange|null $rangeInfo * * @return DAOResultFactory containing matching payments */ - public function getByContextId($contextId, $rangeInfo = null) + public function getByContextId(int $contextId, $rangeInfo = null) { return new DAOResultFactory( $this->retrieveRange( diff --git a/classes/plugins/PubIdPlugin.php b/classes/plugins/PubIdPlugin.php index 80b02771690..f8b5188337e 100644 --- a/classes/plugins/PubIdPlugin.php +++ b/classes/plugins/PubIdPlugin.php @@ -221,7 +221,7 @@ public function getDAOs() /** * @copydoc PKPPubIdPlugin::checkDuplicate() */ - public function checkDuplicate($pubId, $pubObjectType, $excludeId, $contextId) + public function checkDuplicate($pubId, $pubObjectType, $excludeId, int $contextId) { /** @var ChapterDAO */ $chapterDao = DAORegistry::getDAO('ChapterDAO'); diff --git a/classes/press/PressDAO.php b/classes/press/PressDAO.php index ec2714fb276..84cbd5feb90 100644 --- a/classes/press/PressDAO.php +++ b/classes/press/PressDAO.php @@ -64,12 +64,11 @@ public function newDataObject() /** * Delete the public IDs of all publishing objects in a press. * - * @param int $pressId * @param string $pubIdType One of the NLM pub-id-type values or * 'other::something' if not part of the official NLM list * (see ). */ - public function deleteAllPubIds($pressId, $pubIdType) + public function deleteAllPubIds(int $pressId, $pubIdType) { $pubObjectDaos = ['ChapterDAO', 'PublicationFormatDAO']; foreach ($pubObjectDaos as $daoName) { @@ -87,7 +86,6 @@ public function deleteAllPubIds($pressId, $pubIdType) * Check whether the given public ID exists for any publishing * object in a press. * - * @param int $pressId * @param string $pubIdType One of the NLM pub-id-type values or * 'other::something' if not part of the official NLM list * (see ). @@ -100,7 +98,7 @@ public function deleteAllPubIds($pressId, $pubIdType) * @return bool */ public function anyPubIdExists( - $pressId, + int $pressId, $pubIdType, $pubId, $assocType = MetadataTypeDescription::ASSOC_TYPE_ANY, diff --git a/classes/publication/Publication.php b/classes/publication/Publication.php index 390db4abc0a..12049ff31a0 100644 --- a/classes/publication/Publication.php +++ b/classes/publication/Publication.php @@ -48,12 +48,11 @@ public function getEditorString() /** * Get the URL to a localized cover image * - * @param int $contextId * @param string $preferredLocale Return the cover image in a specified locale. * * @return string */ - public function getLocalizedCoverImageUrl($contextId, $preferredLocale = null) + public function getLocalizedCoverImageUrl(int $contextId, $preferredLocale = null) { $coverImage = $this->getLocalizedData('coverImage', $preferredLocale); @@ -73,11 +72,9 @@ public function getLocalizedCoverImageUrl($contextId, $preferredLocale = null) /** * Get the URL to the thumbnail of a localized cover image * - * @param int $contextId - * * @return string */ - public function getLocalizedCoverImageThumbnailUrl($contextId) + public function getLocalizedCoverImageThumbnailUrl(int $contextId) { $url = $this->getLocalizedCoverImageUrl($contextId); $pathParts = pathinfo($url); diff --git a/classes/publicationFormat/PublicationFormatDAO.php b/classes/publicationFormat/PublicationFormatDAO.php index 98f266e8f4c..93e209c5d4a 100644 --- a/classes/publicationFormat/PublicationFormatDAO.php +++ b/classes/publicationFormat/PublicationFormatDAO.php @@ -29,9 +29,6 @@ class PublicationFormatDAO extends DAO implements RepresentationDAOInterface { /** * @copydoc RepresentationDAO::getById() - * - * @param null|mixed $publicationId - * @param null|mixed $contextId */ public function getById(int $representationId, ?int $publicationId = null, ?int $contextId = null): PublicationFormat { @@ -45,11 +42,11 @@ public function getById(int $representationId, ?int $publicationId = null, ?int $result = $this->retrieve( 'SELECT pf.* - FROM publication_formats pf - ' . ($contextId ? ' - JOIN publications p ON (p.publication_id = pf.publicationId) - JOIN submissions s ON (s.submission_id=p.submission_id)' : '') . ' - WHERE pf.publication_format_id=?' . + FROM publication_formats pf + ' . ($contextId ? ' + JOIN publications p ON (p.publication_id = pf.publicationId) + JOIN submissions s ON (s.submission_id=p.submission_id)' : '') . ' + WHERE pf.publication_format_id=?' . ($publicationId ? ' AND pf.publication_id = ?' : '') . ($contextId ? ' AND s.context_id = ?' : ''), $params @@ -63,27 +60,26 @@ public function getById(int $representationId, ?int $publicationId = null, ?int * * @param string $settingName * @param int $publicationId optional - * @param int $pressId optional * * @return array The publication formats identified by setting. */ - public function getBySetting($settingName, $settingValue, $publicationId = null, $pressId = null) + public function getBySetting($settingName, $settingValue, $publicationId = null, ?int $pressId = null) { $params = [$settingName]; $sql = 'SELECT pf.* - FROM publication_formats pf '; + FROM publication_formats pf '; if ($pressId) { $sql .= 'INNER JOIN publications p ON p.publication_id = pf.publication_id - INNER JOIN submissions s ON s.submission_id = p.submission_id '; + INNER JOIN submissions s ON s.submission_id = p.submission_id '; } if (is_null($settingValue)) { $sql .= 'LEFT JOIN publication_format_settings pfs ON pf.publication_format_id = pfs.publication_format_id AND pfs.setting_name = ? - WHERE (pfs.setting_value IS NULL OR pfs.setting_value = \'\')'; + WHERE (pfs.setting_value IS NULL OR pfs.setting_value = \'\')'; } else { $params[] = (string) $settingValue; $sql .= 'INNER JOIN publication_format_settings pfs ON pf.publication_format_id = pfs.publication_format_id - WHERE pfs.setting_name = ? AND pfs.setting_value = ?'; + WHERE pfs.setting_name = ? AND pfs.setting_value = ?'; } if ($publicationId) { @@ -115,11 +111,10 @@ public function getBySetting($settingName, $settingValue, $publicationId = null, * (see ). * @param string $pubId * @param int $publicationId optional - * @param int $pressId optional * * @return PublicationFormat|null */ - public function getByPubId($pubIdType, $pubId, $publicationId = null, $pressId = null) + public function getByPubId($pubIdType, $pubId, $publicationId = null, ?int $pressId = null) { if (empty($pubId)) { return null; @@ -160,9 +155,9 @@ public function getByBestId($representationId, $publicationId) { $result = $this->retrieve( 'SELECT pf.* - FROM publication_formats pf - WHERE pf.url_path = ? - AND pf.publication_id = ?', + FROM publication_formats pf + WHERE pf.url_path = ? + AND pf.publication_id = ?', [ $representationId, $publicationId, @@ -179,11 +174,9 @@ public function getByBestId($representationId, $publicationId) /** * @copydoc RepresentationDAO::getByPublicationId() * - * @param null|mixed $contextId - * * @return DAOResultFactory */ - public function getByPublicationId($publicationId, $contextId = null): array + public function getByPublicationId($publicationId, ?int $contextId = null): array { $params = [(int) $publicationId]; if ($contextId) { @@ -193,10 +186,10 @@ public function getByPublicationId($publicationId, $contextId = null): array $result = new DAOResultFactory( $this->retrieve( 'SELECT pf.* - FROM publication_formats pf ' . + FROM publication_formats pf ' . ($contextId ? 'INNER JOIN publications p ON (pf.publication_id=p.publication_id) - INNER JOIN submissions s ON (s.submission_id = p.submission_id) ' + INNER JOIN submissions s ON (s.submission_id = p.submission_id) ' : '') . 'WHERE pf.publication_id=? ' . ($contextId ? ' AND s.context_id = ? ' : '') @@ -213,21 +206,19 @@ public function getByPublicationId($publicationId, $contextId = null): array /** * Retrieves a list of publication formats for a press * - * @param int $pressId - * * @return DAOResultFactory */ - public function getByContextId($pressId) + public function getByContextId(int $pressId) { return new DAOResultFactory( $this->retrieve( 'SELECT pf.* - FROM publication_formats pf - JOIN publications p ON (p.publication_id = pf.publication_id) - JOIN submissions s ON (s.submission_id = p.submission_id) - WHERE s.context_id = ? - ORDER BY pf.seq', - [(int) $pressId] + FROM publication_formats pf + JOIN publications p ON (p.publication_id = pf.publication_id) + JOIN submissions s ON (s.submission_id = p.submission_id) + WHERE s.context_id = ? + ORDER BY pf.seq', + [$pressId] ), $this, '_fromRow' @@ -364,9 +355,9 @@ public function insertObject($publicationFormat) { $this->update( 'INSERT INTO publication_formats - (is_approved, entry_key, physical_format, publication_id, seq, file_size, front_matter, back_matter, height, height_unit_code, width, width_unit_code, thickness, thickness_unit_code, weight, weight_unit_code, product_composition_code, product_form_detail_code, country_manufacture_code, imprint, product_availability_code, technical_protection_code, returnable_indicator_code, remote_url, url_path, is_available, doi_id) - VALUES - (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + (is_approved, entry_key, physical_format, publication_id, seq, file_size, front_matter, back_matter, height, height_unit_code, width, width_unit_code, thickness, thickness_unit_code, weight, weight_unit_code, product_composition_code, product_form_detail_code, country_manufacture_code, imprint, product_availability_code, technical_protection_code, returnable_indicator_code, remote_url, url_path, is_available, doi_id) + VALUES + (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [ (int) $publicationFormat->getIsApproved(), $publicationFormat->getEntryKey(), @@ -413,33 +404,33 @@ public function updateObject(Representation $publicationFormat): void { $this->update( 'UPDATE publication_formats - SET is_approved = ?, - entry_key = ?, - physical_format = ?, - seq = ?, - file_size = ?, - front_matter = ?, - back_matter = ?, - height = ?, - height_unit_code = ?, - width = ?, - width_unit_code = ?, - thickness = ?, - thickness_unit_code = ?, - weight = ?, - weight_unit_code = ?, - product_composition_code = ?, - product_form_detail_code = ?, - country_manufacture_code = ?, - imprint = ?, - product_availability_code = ?, - technical_protection_code = ?, - returnable_indicator_code = ?, - remote_url = ?, - url_path = ?, - is_available = ?, - doi_id = ? - WHERE publication_format_id = ?', + SET is_approved = ?, + entry_key = ?, + physical_format = ?, + seq = ?, + file_size = ?, + front_matter = ?, + back_matter = ?, + height = ?, + height_unit_code = ?, + width = ?, + width_unit_code = ?, + thickness = ?, + thickness_unit_code = ?, + weight = ?, + weight_unit_code = ?, + product_composition_code = ?, + product_form_detail_code = ?, + country_manufacture_code = ?, + imprint = ?, + product_availability_code = ?, + technical_protection_code = ?, + returnable_indicator_code = ?, + remote_url = ?, + url_path = ?, + is_available = ?, + doi_id = ? + WHERE publication_format_id = ?', [ (int) $publicationFormat->getIsApproved(), $publicationFormat->getEntryKey(), diff --git a/classes/publicationFormat/PublicationFormatTombstoneManager.php b/classes/publicationFormat/PublicationFormatTombstoneManager.php index 6fd4e76c92c..22fbd63c2f8 100755 --- a/classes/publicationFormat/PublicationFormatTombstoneManager.php +++ b/classes/publicationFormat/PublicationFormatTombstoneManager.php @@ -134,10 +134,8 @@ public function deleteTombstonesByPublicationFormats($publicationFormats) /** * Delete tombstone for every publication format inside the passed press. - * - * @param int $pressId */ - public function deleteTombstonesByPressId($pressId) + public function deleteTombstonesByPressId(int $pressId) { $submissions = Repo::submission() ->getCollector() diff --git a/classes/section/DAO.php b/classes/section/DAO.php index 87a234fc709..e6f4e104914 100644 --- a/classes/section/DAO.php +++ b/classes/section/DAO.php @@ -62,7 +62,7 @@ public function getParentColumn(): string /** * Retrieve a series by path. */ - public function getByPath(string $path, int $pressId = null): ?Section + public function getByPath(string $path, ?int $pressId = null): ?Section { $row = DB::table($this->table) ->where('path', $path) diff --git a/classes/section/Repository.php b/classes/section/Repository.php index 70a66266034..a85c2c532b1 100644 --- a/classes/section/Repository.php +++ b/classes/section/Repository.php @@ -21,7 +21,7 @@ class Repository extends \PKP\section\Repository public string $schemaMap = maps\Schema::class; /** @copydoc DAO::getByPath() */ - public function getByPath(string $path, int $pressId = null): ?Section + public function getByPath(string $path, ?int $pressId = null): ?Section { return $this->dao->getByPath($path, $pressId); } diff --git a/classes/section/Section.php b/classes/section/Section.php index 9f23f1e2abf..5cd26e9a08f 100644 --- a/classes/section/Section.php +++ b/classes/section/Section.php @@ -93,7 +93,7 @@ public function getPrefix(?string $locale): string|array|null /** * Set prefix of series. */ - public function setPrefix(string|array $prefix, string $locale = null): void + public function setPrefix(string|array $prefix, ?string $locale = null): void { $this->setData('prefix', $prefix, $locale); } @@ -117,7 +117,7 @@ public function getSubtitle(?string $locale): string|array|null /** * Set subtitle of series */ - public function setSubtitle(string|array $subtitle, string $locale = null): void + public function setSubtitle(string|array $subtitle, ?string $locale = null): void { $this->setData('subtitle', $subtitle, $locale); } @@ -259,7 +259,7 @@ public function getDescription(?string $locale): string|array|null /** * Set series description. */ - public function setDescription(string|array $description, string $locale = null): void + public function setDescription(string|array $description, ?string $locale = null): void { $this->setData('description', $description, $locale); } diff --git a/classes/services/NavigationMenuService.php b/classes/services/NavigationMenuService.php index 2c0d7823e41..c2b1f9455de 100644 --- a/classes/services/NavigationMenuService.php +++ b/classes/services/NavigationMenuService.php @@ -49,7 +49,7 @@ public function __construct() */ public function getMenuItemTypesCallback($hookName, $args) { - $types = & $args[0]; + $types = &$args[0]; $ompTypes = [ self::NMI_TYPE_CATALOG => [ @@ -64,7 +64,7 @@ public function getMenuItemTypesCallback($hookName, $args) $request = Application::get()->getRequest(); $context = $request->getContext(); - $contextId = $context ? $context->getId() : Application::CONTEXT_ID_NONE; + $contextId = $context?->getId() ?? Application::SITE_CONTEXT_ID; $series = Repo::section() ->getCollector() @@ -109,7 +109,7 @@ public function getMenuItemTypesCallback($hookName, $args) */ public function getMenuItemCustomEditTemplatesCallback($hookName, $args) { - $templates = & $args[0]; + $templates = &$args[0]; $ompTemplates = [ self::NMI_TYPE_CATEGORY => [ @@ -131,7 +131,7 @@ public function getMenuItemCustomEditTemplatesCallback($hookName, $args) */ public function getDisplayStatusCallback($hookName, $args) { - $navigationMenuItem = & $args[0]; + $navigationMenuItem = &$args[0]; $request = Application::get()->getRequest(); $dispatcher = $request->getDispatcher(); @@ -140,7 +140,7 @@ public function getDisplayStatusCallback($hookName, $args) $isUserLoggedIn = Validation::isLoggedIn(); $isUserLoggedInAs = (bool) Validation::loggedInAs(); $context = $request->getContext(); - $contextId = $context ? $context->getId() : Application::CONTEXT_ID_NONE; + $contextId = $context?->getId() ?? Application::SITE_CONTEXT_ID; $this->transformNavMenuItemTitle($templateMgr, $navigationMenuItem); diff --git a/classes/submission/Collector.php b/classes/submission/Collector.php index 41e61a6ea8d..46179d24546 100644 --- a/classes/submission/Collector.php +++ b/classes/submission/Collector.php @@ -151,7 +151,7 @@ public function getQueryBuilder(): Builder $assocType = Application::ASSOC_TYPE_PRESS; $assocIds = is_array($this->contextIds) ? $this->contextIds - : [Application::CONTEXT_ID_NONE]; + : [Application::SITE_CONTEXT_ID]; } $q->leftJoin('features as sf', function ($join) use ($assocType, $assocIds) { diff --git a/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php b/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php index dba67d27bbc..9e1fb1f01bc 100644 --- a/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php +++ b/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php @@ -39,7 +39,7 @@ public function fetch($request, $template = null, $display = false) $request = Application::get()->getRequest(); $context = $request->getContext(); - $contextId = $context ? $context->getId() : Application::CONTEXT_ID_NONE; + $contextId = $context?->getId() ?? Application::SITE_CONTEXT_ID; $series = Repo::section() ->getCollector() diff --git a/controllers/grid/settings/series/form/SeriesForm.php b/controllers/grid/settings/series/form/SeriesForm.php index 7cb9802fb2f..dc3251557eb 100644 --- a/controllers/grid/settings/series/form/SeriesForm.php +++ b/controllers/grid/settings/series/form/SeriesForm.php @@ -31,8 +31,7 @@ class SeriesForm extends PKPSectionForm { - /** @var int $_pressId */ - public $_pressId; + public int $_pressId; /** * Constructor. diff --git a/dbscripts/xml/upgrade.xml b/dbscripts/xml/upgrade.xml index 2ff2abef957..7bad485c766 100644 --- a/dbscripts/xml/upgrade.xml +++ b/dbscripts/xml/upgrade.xml @@ -113,6 +113,7 @@ + @@ -126,7 +127,6 @@ - diff --git a/lib/pkp b/lib/pkp index 041cc4f5f0e..1d6663be9ca 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 041cc4f5f0e6b9b952ff5459064a995d53d2b0fc +Subproject commit 1d6663be9ca3f83ce27cd2078629fc1c3b30e003 diff --git a/pages/information/InformationHandler.php b/pages/information/InformationHandler.php index 61dbd7e57fa..94d0db9e584 100644 --- a/pages/information/InformationHandler.php +++ b/pages/information/InformationHandler.php @@ -16,6 +16,7 @@ namespace APP\pages\information; +use APP\core\Application; use APP\core\Request; use APP\handler\Handler; use APP\template\TemplateManager; @@ -33,7 +34,7 @@ public function index($args, $request) $this->validate(null, $request); $press = $request->getPress(); if ($press == null) { - $request->redirect('index'); + $request->redirect(Application::SITE_CONTEXT_PATH); } $this->setupTemplate($request); diff --git a/plugins/blocks/browse/BrowseBlockSettingsForm.php b/plugins/blocks/browse/BrowseBlockSettingsForm.php index a59f4d8bf5f..e484270473a 100644 --- a/plugins/blocks/browse/BrowseBlockSettingsForm.php +++ b/plugins/blocks/browse/BrowseBlockSettingsForm.php @@ -20,9 +20,6 @@ class BrowseBlockSettingsForm extends Form { - // - // Private properties - // /** @var int press ID */ public $_pressId; @@ -30,16 +27,12 @@ class BrowseBlockSettingsForm extends Form public $_plugin; - // - // Constructor - // /** * Constructor * * @param BrowseBlockPlugin $plugin - * @param int $pressId */ - public function __construct($plugin, $pressId) + public function __construct($plugin, int $pressId) { $this->setPressId($pressId); $this->setPlugin($plugin); @@ -53,25 +46,18 @@ public function __construct($plugin, $pressId) $this->setData('pluginJavaScriptPath', $plugin->getPluginPath()); } - // - // Getters and Setters - // /** * Get the Press ID. - * - * @return int */ - public function getPressId() + public function getPressId(): int { return $this->_pressId; } /** * Set the Press ID. - * - * @param int $pressId */ - public function setPressId($pressId) + public function setPressId(int $pressId) { $this->_pressId = $pressId; } @@ -96,9 +82,6 @@ public function setPlugin($plugin) $this->_plugin = $plugin; } - // - // Implement template methods from Form - // /** * @see Form::initData() */ @@ -132,9 +115,6 @@ public function execute(...$functionArgs) parent::execute(...$functionArgs); } - // - // Private helper methods - // public function _getFormFields() { return [ diff --git a/plugins/generic/acron b/plugins/generic/acron index dede22d5d7d..a1545b0017a 160000 --- a/plugins/generic/acron +++ b/plugins/generic/acron @@ -1 +1 @@ -Subproject commit dede22d5d7d18fdd6fddf6b7dad6f034c8ae1fc3 +Subproject commit a1545b0017a57a6681ab727783ab870998e75361 diff --git a/plugins/generic/customBlockManager b/plugins/generic/customBlockManager index 07a20379a34..9d92d839c3c 160000 --- a/plugins/generic/customBlockManager +++ b/plugins/generic/customBlockManager @@ -1 +1 @@ -Subproject commit 07a20379a345083998f489533582886bfe3c4a27 +Subproject commit 9d92d839c3c7a8299eea2bc736f23c90bece1120 diff --git a/plugins/generic/staticPages b/plugins/generic/staticPages index 9ad23c8abc8..04fda9308ee 160000 --- a/plugins/generic/staticPages +++ b/plugins/generic/staticPages @@ -1 +1 @@ -Subproject commit 9ad23c8abc85eb1abf63df20b4ae65435f3e2435 +Subproject commit 04fda9308eeb2a7eb034fcd1076602cfadaff143 diff --git a/plugins/pubIds/urn/URNPubIdPlugin.php b/plugins/pubIds/urn/URNPubIdPlugin.php index 637a6ef1c07..6135d54106b 100644 --- a/plugins/pubIds/urn/URNPubIdPlugin.php +++ b/plugins/pubIds/urn/URNPubIdPlugin.php @@ -79,7 +79,7 @@ public function getDescription() /** * @copydoc PKPPubIdPlugin::constructPubId() */ - public function constructPubId($pubIdPrefix, $pubIdSuffix, $contextId) + public function constructPubId($pubIdPrefix, $pubIdSuffix, int $contextId) { $urn = $pubIdPrefix . $pubIdSuffix; $suffixFieldName = $this->getSuffixFieldName(); @@ -118,7 +118,7 @@ public function getPubIdFullName() /** * @copydoc PKPPubIdPlugin::getResolvingURL() */ - public function getResolvingURL($contextId, $pubId) + public function getResolvingURL(int $contextId, $pubId) { $resolverURL = $this->getSetting($contextId, 'urnResolver'); return $resolverURL . $pubId; @@ -158,7 +158,7 @@ public function getPubIdAssignFile() /** * @copydoc PKPPubIdPlugin::instantiateSettingsForm() */ - public function instantiateSettingsForm($contextId) + public function instantiateSettingsForm(int $contextId) { return new URNSettingsForm($this, $contextId); } @@ -246,7 +246,7 @@ public function getDAOFieldNames() /** * @copydoc PKPPubIdPlugin::isObjectTypeEnabled() */ - public function isObjectTypeEnabled($pubObjectType, $contextId) + public function isObjectTypeEnabled($pubObjectType, int $contextId) { return (bool) $this->getSetting($contextId, "enable{$pubObjectType}URN"); } @@ -264,9 +264,9 @@ public function getNotUniqueErrorMsg() */ public function validatePublicationUrn(string $hookName, array $args): void { - $errors = & $args[0]; + $errors = &$args[0]; $object = $args[1]; - $props = & $args[2]; + $props = &$args[2]; if (empty($props['pub-id::other::urn'])) { return; @@ -351,8 +351,8 @@ public function addPublicationFormFields(string $hookName, FormComponent $form): } $form->addField(new FieldPubIdUrn('pub-id::other::urn', $fieldData)); - // Otherwise add a field for manual entry that includes a button to generate - // the check number + // Otherwise add a field for manual entry that includes a button to generate + // the check number } else { $form->addField(new FieldTextUrn('pub-id::other::urn', [ 'label' => __('plugins.pubIds.urn.displayName'), @@ -383,7 +383,7 @@ public function addPublishFormNotice(string $hookName, FormComponent $form): voi if (!$publicationUrnEnabled && !$chapterUrnEnabled && !$publicationFormatUrnEnabled && !$submissionFileUrnEnabled) { return; - // Use a simplified view when only assigning to the publication + // Use a simplified view when only assigning to the publication } elseif ($publicationFormatUrnEnabled && !$chapterUrnEnabled && !$publicationFormatUrnEnabled && !$submissionFileUrnEnabled) { if ($form->publication->getData('pub-id::other::urn')) { $msg = __('plugins.pubIds.urn.editor.preview.publication', ['urn' => $form->publication->getData('pub-id::other::urn')]); @@ -396,7 +396,7 @@ public function addPublishFormNotice(string $hookName, FormComponent $form): voi ])); return; - // Show a table if probably more than one URN is going to be created + // Show a table if probably more than one URN is going to be created } else { $urnTableRows = []; if ($publicationUrnEnabled) { diff --git a/plugins/pubIds/urn/classes/form/URNSettingsForm.php b/plugins/pubIds/urn/classes/form/URNSettingsForm.php index c8995bf13fc..0e9b3b92b2a 100644 --- a/plugins/pubIds/urn/classes/form/URNSettingsForm.php +++ b/plugins/pubIds/urn/classes/form/URNSettingsForm.php @@ -58,9 +58,8 @@ public function _getPlugin() * Constructor * * @param \APP\plugins\pubIds\urn\URNPubIdPlugin $plugin - * @param int $contextId */ - public function __construct($plugin, $contextId) + public function __construct($plugin, int $contextId) { $this->_contextId = $contextId; $this->_plugin = $plugin;