1 | <?php |
||
30 | class CloudIDFormatter implements IFormatter { |
||
31 | /** @var IManager */ |
||
32 | protected $manager; |
||
33 | /** @var array */ |
||
34 | protected $federatedContacts; |
||
35 | |||
36 | /** |
||
37 | * @param IManager $contactsManager |
||
38 | */ |
||
39 | 19 | public function __construct(IManager $contactsManager) { |
|
43 | |||
44 | /** |
||
45 | * @param IEvent $event |
||
46 | * @param string $parameter The parameter to be formatted |
||
47 | * @param bool $allowHtml Should HTML be used to format the parameter? |
||
48 | * @param bool $verbose Should paths, names, etc be shortened or full length |
||
49 | * @return string The formatted parameter |
||
50 | */ |
||
51 | 13 | public function format(IEvent $event, $parameter, $allowHtml, $verbose = false) { |
|
52 | 13 | $displayName = $parameter; |
|
53 | try { |
||
54 | 13 | list($user, $server) = Helper::splitUserRemote($parameter); |
|
55 | 13 | } catch (HintException $e) { |
|
|
|||
56 | 4 | $user = $parameter; |
|
57 | 4 | $server = ''; |
|
58 | } |
||
59 | |||
60 | 13 | if (!$verbose && $server !== '') { |
|
61 | 5 | $displayName = $user . '@…'; |
|
62 | 5 | } |
|
63 | |||
64 | try { |
||
65 | 13 | $displayName = $this->getDisplayNameFromContact($parameter); |
|
66 | 13 | } catch (\OutOfBoundsException $e) {} |
|
67 | |||
68 | |||
69 | 13 | if ($allowHtml === null) { |
|
70 | 1 | return '<federated-cloud-id display-name="' . Util::sanitizeHTML($displayName) . '" user="' . $user . '" server="' . $server . '">' . Util::sanitizeHTML($parameter) . '</federated-cloud-id>'; |
|
71 | } |
||
72 | |||
73 | 12 | if ($allowHtml) { |
|
74 | 6 | $title = ' title="' . Util::sanitizeHTML($parameter) . '"'; |
|
75 | 6 | return '<strong class="has-tooltip"' . $title . '>' . Util::sanitizeHTML($displayName) . '</strong>'; |
|
76 | } else { |
||
77 | 6 | return $displayName; |
|
78 | } |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * Try to find the user in the contacts |
||
83 | * |
||
84 | * @param string $federatedCloudId |
||
85 | * @return string |
||
86 | * @throws \OutOfBoundsException when there is no contact for the id |
||
87 | */ |
||
88 | 5 | protected function getDisplayNameFromContact($federatedCloudId) { |
|
113 | } |
||
114 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.