public function deleteKey(EventInterface $event) {
        $acl = $event->getAccessControl();

        if (!($acl instanceof MutableAdapterInterface)) {
            throw new ResourceException('Access control adapter is immutable', 405);
        }

        $request = $event->getRequest();
        $publicKey = $request->getRoute()->get('publickey');

        $keyExists = $acl->publicKeyExists($publicKey);

        if (!$keyExists) {
            throw new RuntimeException('Public key not found', 404);
        }

        $request = $event->getRequest();
        $publicKey = $request->getRoute()->get('publickey');

        $acl->deletePublicKey($publicKey);
    }
public function deleteKey(EventInterface $event) {
        $acl = $event->getAccessControl();

        if (!($acl instanceof MutableAdapterInterface)) {
            throw new ResourceException('Access control adapter is immutable', 405);
        }

        $request = $event->getRequest();
        $publicKey = $request->getRoute()->get('publickey');

        $keyExists = $acl->publicKeyExists($publicKey);

        if (!$keyExists) {
            throw new RuntimeException('Public key not found', 404);
        }

        $request = $event->getRequest();
        $publicKey = $request->getRoute()->get('publickey');

        $acl->deletePublicKey($publicKey);
    }
public function deleteKey ( EventInterface $ event ) { $ acl = $ event -> getAccessControl ( ) ; if ( ! ( $ acl instanceof MutableAdapterInterface ) ) { throw new ResourceException ( 'Access control adapter is immutable' , 405 ) ; } $ request = $ event -> getRequest ( ) ; $ publicKey = $ request -> getRoute ( ) -> get ( 'publickey' ) ; $ keyExists = $ acl -> publicKeyExists ( $ publicKey ) ; if ( ! $ keyExists ) { throw new RuntimeException ( 'Public key not found' , 404 ) ; } $ request = $ event -> getRequest ( ) ; $ publicKey = $ request -> getRoute ( ) -> get ( 'publickey' ) ; $ acl -> deletePublicKey ( $ publicKey ) ; }
Delete public key

@param EventInterface $event The current event
Delete public key