aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Config/UserPlaceholderHandler.php
blob: ec91df5fb7a08bdf9f7794d1705b51e29cdcad28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/**
 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OCA\Files_External\Config;

class UserPlaceholderHandler extends UserContext implements IConfigHandler {
	use SimpleSubstitutionTrait;

	/**
	 * @param mixed $optionValue
	 * @return mixed the same type as $optionValue
	 * @since 16.0.0
	 */
	public function handle($optionValue) {
		$this->placeholder = 'user';
		$uid = $this->getUserId();
		if ($uid === null) {
			return $optionValue;
		}
		return $this->processInput($optionValue, $uid);
	}
}