UserPlaceholderHandler.php 592 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Files_External\Config;
  7. class UserPlaceholderHandler extends UserContext implements IConfigHandler {
  8. use SimpleSubstitutionTrait;
  9. /**
  10. * @param mixed $optionValue
  11. * @return mixed the same type as $optionValue
  12. * @since 16.0.0
  13. */
  14. public function handle($optionValue) {
  15. $this->placeholder = 'user';
  16. $uid = $this->getUserId();
  17. if ($uid === null) {
  18. return $optionValue;
  19. }
  20. return $this->processInput($optionValue, $uid);
  21. }
  22. }