Lines Matching defs:mechanism
44 * Get a mechanism object by its name.
46 public function get(string $mechanism): MechanismInterface
48 $mech = $this->mechanisms[$mechanism] ?? null;
51 throw new SaslException('The mechanism "%s" is not supported.');
58 * Whether or not the mechanism is supported.
60 public function supports(string $mechanism): bool
62 return isset($this->mechanisms()[$mechanism]);
66 * Add a mechanism object.
70 public function add(MechanismInterface $mechanism): self
72 $this->mechanisms[$mechanism->getName()] = $mechanism;
78 * Remove a mechanism by its name.
82 public function remove(string $mechanism): self
84 if (isset($this->mechanisms[$mechanism])) {
85 unset($this->mechanisms[$mechanism]);
92 * Given an array of mechanism names, and optional options, select the best supported mechanism available.
96 * @return MechanismInterface the mechanism selected.
97 * @throws SaslException if no supported mechanism could be found.