diff --git a/core/lib/Drupal/Core/TypedData/AllowedValuesInterface.php b/core/lib/Drupal/Core/TypedData/AllowedValuesInterface.php index 6715625..faa00b4 100644 --- a/core/lib/Drupal/Core/TypedData/AllowedValuesInterface.php +++ b/core/lib/Drupal/Core/TypedData/AllowedValuesInterface.php @@ -6,6 +6,8 @@ namespace Drupal\Core\TypedData; +use Drupal\Core\Session\AccountInterface; + /** * Interface for retrieving allowed values. * @@ -22,18 +24,18 @@ /** * Returns an array of allowed values. * - * @param object $account + * @param \Drupal\Core\Session\AccountInterface $account * (optional) The user account for which to generate the allowed values. * * @return array * An array allowed values. */ - public function getValues($account = NULL); + public function getValues(AccountInterface $account = NULL); /** * Returns an array of allowed options. * - * @param object $account + * @param \Drupal\Core\Session\AccountInterface $account * (optional) The user account for which to generate the allowed options. * * @return array @@ -44,23 +46,23 @@ public function getValues($account = NULL); * * @see Drupal\Core\TypedData\AllowedValuesInterface::getValues() */ - public function getOptions($account = NULL); + public function getOptions(AccountInterface $account = NULL); /** * Returns an array of possible values. * - * @param object $account + * @param \Drupal\Core\Session\AccountInterface $account * (optional) The user account for which to generate the possible values. * * @return array * An array of possible values. */ - public function getPossibleValues($account = NULL); + public function getPossibleValues(AccountInterface $account = NULL); /** * Returns an array of possible options. * - * @param object $account + * @param \Drupal\Core\Session\AccountInterface $account * (optional) The user account for which to generate the possible options. * * @return array @@ -71,5 +73,5 @@ public function getPossibleValues($account = NULL); * * @see Drupal\Core\TypedData\AllowedValuesInterface::getOptions() */ - public function getPossibleOptions($account = NULL); + public function getPossibleOptions(AccountInterface $account = NULL); } diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/DataType/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Plugin/DataType/FilterFormat.php index bb4b567..b7f721f 100644 --- a/core/modules/filter/lib/Drupal/filter/Plugin/DataType/FilterFormat.php +++ b/core/modules/filter/lib/Drupal/filter/Plugin/DataType/FilterFormat.php @@ -9,6 +9,7 @@ use Drupal\Core\TypedData\Annotation\DataType; use Drupal\Core\Annotation\Translation; +use Drupal\Core\Session\AccountInterface; use Drupal\Core\TypedData\AllowedValuesInterface; use Drupal\Core\TypedData\Plugin\DataType\String; @@ -25,14 +26,14 @@ class FilterFormat extends String implements AllowedValuesInterface { /** * {@inheritdoc} */ - public function getPossibleValues($account = NULL) { + public function getPossibleValues(AccountInterface $account = NULL) { return array_keys($this->getPossibleOptions()); } /** * {@inheritdoc} */ - public function getPossibleOptions($account = NULL) { + public function getPossibleOptions(AccountInterface $account = NULL) { $values = array(); foreach (filter_formats() as $format) { $values[$format->id()] = $format->label(); @@ -43,14 +44,14 @@ public function getPossibleOptions($account = NULL) { /** * {@inheritdoc} */ - public function getValues($account = NULL) { + public function getValues(AccountInterface $account = NULL) { return array_keys($this->getOptions($account)); } /** * {@inheritdoc} */ - public function getOptions($user = NULL) { + public function getOptions(AccountInterface $user = NULL) { $user = empty($user) ? $GLOBALS['user'] : $user; $values = array(); // @todo: Avoid calling functions but move to injected dependencies.