Changeset View
Changeset View
Standalone View
Standalone View
src/applications/passphrase/keys/PassphraseAbstractKey.php
| Show All 26 Lines | private function loadCredential( | ||||
| return $credential; | return $credential; | ||||
| } | } | ||||
| private function validateCredential( | private function validateCredential( | ||||
| PassphraseCredential $credential, | PassphraseCredential $credential, | ||||
| $provides_type) { | $provides_type) { | ||||
| $type = $credential->getCredentialTypeImplementation(); | $type = $credential->getImplementation(); | ||||
| if (!$type) { | if (!$type) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Credential "%s" is of unknown type "%s"!', | 'Credential "%s" is of unknown type "%s"!', | ||||
| 'K'.$credential->getID(), | $credential->getMonogram(), | ||||
| $credential->getCredentialType())); | $credential->getCredentialType())); | ||||
| } | } | ||||
| if ($type->getProvidesType() !== $provides_type) { | if ($type->getProvidesType() !== $provides_type) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Credential "%s" must provide "%s", but provides "%s"!', | 'Credential "%s" must provide "%s", but provides "%s"!', | ||||
| 'K'.$credential->getID(), | $credential->getMonogram(), | ||||
| $provides_type, | $provides_type, | ||||
| $type->getProvidesType())); | $type->getProvidesType())); | ||||
| } | } | ||||
| } | } | ||||
| protected function loadAndValidateFromPHID( | protected function loadAndValidateFromPHID( | ||||
| $phid, | $phid, | ||||
| PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
| Show All 17 Lines | |||||