private static function fromSource($source, $elements, $key, $type = null) {
		if (!isset($elements) || !isset($elements[$key])) {
			return null;
		}

		$type = self::dataTypeOrDefault($type);

		$filtered = \filter_input($source, $key, self::determineFilterMode($type), self::composeFilterFlags($type));

		return self::applyPostProcessing($filtered, $type);
	}