Skip to content

Commit

Permalink
Introduce typehinting and general cleanup: Core classes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jun 17, 2024
1 parent dcbe60b commit 282c7dd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
8 changes: 2 additions & 6 deletions classes/issue/IssueGalleyDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,17 @@ public function getByBestId($galleyId, $issueId)

/**
* Get the list of fields for which data is localized.
*
* @return array
*/
public function getLocaleFieldNames()
public function getLocaleFieldNames(): array
{
return [];
}

/**
* Get a list of additional fields that do not have
* dedicated accessors.
*
* @return array
*/
public function getAdditionalFieldNames()
public function getAdditionalFieldNames(): array
{
$additionalFields = parent::getAdditionalFieldNames();
// FIXME: Move this to a PID plug-in.
Expand Down
4 changes: 1 addition & 3 deletions classes/subscription/SubscriptionTypeDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,8 @@ public function _fromRow($row)

/**
* Get the list of field names for which localized data is used.
*
* @return array
*/
public function getLocaleFieldNames()
public function getLocaleFieldNames(): array
{
return ['name', 'description'];
}
Expand Down
4 changes: 1 addition & 3 deletions classes/subscription/form/SubscriptionPolicyForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ public function readInputData()

/**
* Get the names of the fields for which localized settings are used
*
* @return array
*/
public function getLocaleFieldNames()
public function getLocaleFieldNames(): array
{
return ['subscriptionAdditionalInformation'];
}
Expand Down
4 changes: 1 addition & 3 deletions controllers/grid/settings/sections/form/SectionForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ public function readInputData()

/**
* Get the names of fields for which localized data is allowed.
*
* @return array
*/
public function getLocaleFieldNames()
public function getLocaleFieldNames(): array
{
return ['title', 'policy', 'abbrev', 'identifyType'];
}
Expand Down
4 changes: 1 addition & 3 deletions controllers/grid/subscriptions/SubscriptionTypeForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ public function __construct($journalId, $typeId = null)

/**
* Get a list of localized field names for this form
*
* @return array
*/
public function getLocaleFieldNames()
public function getLocaleFieldNames(): array
{
$subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO'); /** @var SubscriptionTypeDAO $subscriptionTypeDao */
return $subscriptionTypeDao->getLocaleFieldNames();
Expand Down

0 comments on commit 282c7dd

Please sign in to comment.