isOk()) { return; } if (!in_array($response->status(), ['NO', 'BAD'], true)) { throw new ImapException($command . ' received an invalid completion status: ' . $response->status()); } throw new CommandFailedException( $command, $response->status(), $response->text(), (new ResponseCodeParser())->parse($response->text()), ); } }