do_not_run_on_fresh_install( $version ); } /** * @throws Migration_Exception */ public function up() { try { $oauth = $this->storage->get_oauth(); $integration = $this->api_wrapper->get_integration( $oauth->get_integration_id() ); if ( $integration->getChannel( Methods::TOTP ) && $integration->getChannel( Methods::SMS ) && $integration->getChannel( Methods::CALL ) ) { return; } $client = $this->api_wrapper->get_client(); $integration->enableChannel( Methods::TOTP ); if ( $client->hasCard() ) { $integration->enableChannel( Methods::SMS ); $integration->enableChannel( Methods::CALL ); } $this->api_wrapper->update_integration( $integration ); } catch ( Account_Exception $e ) { } } }