Skip to content

Commit

Permalink
better docblocks; moving deprecated methods down
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Apr 26, 2018
1 parent 16bbd1d commit 74f2fd0
Showing 1 changed file with 146 additions and 146 deletions.
292 changes: 146 additions & 146 deletions lib/WP_Auth0_Lock10_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,6 @@ public function __construct( $extended_settings = array() ) {
$this->extended_settings = $extended_settings;
}

/**
* @deprecated 3.6.0 - Not used, determined in wp-content/plugins/auth0/assets/js/lock-init.js
*
* @return string
*/
public function get_lock_classname() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
if ( $this->_get_boolean( $this->wp_options->get( 'passwordless_enabled' ) ) ) {
return 'Auth0LockPasswordless';
} else {
return 'Auth0Lock';
}
}

/**
* @deprecated 3.6.0 - Not used
*
* @return bool
*/
public function isPasswordlessEnable() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->_get_boolean( $this->wp_options->get( 'passwordless_enabled' ) );
}

/**
* @deprecated 3.6.0 - Not used, invalid way to display Passwordless in new library
*
* @return string
*/
public function get_lock_show_method() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return 'show';
}

public function get_code_callback_url() {
$protocol = $this->_get_boolean( $this->wp_options->get( 'force_https_callback' ) ) ? 'https' : null;
return $this->wp_options->get_wp_auth0_url( $protocol );
Expand All @@ -67,39 +30,6 @@ public function get_sso() {
return $this->_get_boolean( $this->wp_options->get( 'sso' ) );
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance->get( 'custom_css' ) instead
*
* @return string
*/
public function get_custom_css() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get( 'custom_css' );
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance->get( 'custom_js' ) instead
*
* @return string
*/
public function get_custom_js() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get( 'custom_js' );
}

/**
* @deprecated 3.6.0 - Not used, call WP_Auth0::ready() instead
*
* @return string
*/
public function can_show() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return WP_Auth0::ready();
}

public function get_client_id() {
return $this->wp_options->get( 'client_id' );
}
Expand All @@ -108,43 +38,10 @@ public function get_domain() {
return $this->wp_options->get( 'domain' );
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance->get( 'cdn_url' ) instead
*
* @return string
*/
public function get_cdn_url() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get( 'cdn_url' );
}

/**
* @deprecated 3.6.0 - Not used, use (bool) WP_Auth0_Options::Instance->get( 'wordpress_login_enabled' ) instead
*
* @return string
*/
public function get_wordpress_login_enabled() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->_get_boolean( $this->wp_options->get( 'wordpress_login_enabled' ) );
}

public function get_auth0_implicit_workflow() {
return $this->_get_boolean( $this->wp_options->get( 'auth0_implicit_workflow' ) );
}

/**
* @deprecated 3.6.0 - Not used
*
* @param bool $enabled - disallow logins?
*/
public function set_#_mode( $enabled ) {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
$this->#_mode = $enabled;
}

public function is_registration_enabled() {
return $this->wp_options->is_wp_registration_enabled();
}
Expand All @@ -153,21 +50,6 @@ public function show_as_modal() {
return isset( $this->extended_settings['show_as_modal'] ) && $this->extended_settings['show_as_modal'];
}

/**
* @deprecated 3.6.0 - Not used
*
* @return mixed|string
*/
public function modal_button_name() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
$name = 'Login';
if ( isset( $this->extended_settings['modal_trigger_name'] ) && $this->extended_settings['modal_trigger_name'] != '' ) {
$name = $this->extended_settings['modal_trigger_name'];
}
return $name;
}

public function get_state_obj( $redirect_to = null ) {

$stateObj = array(
Expand Down Expand Up @@ -250,34 +132,6 @@ protected function build_settings( $settings ) {
return $options_obj;
}

/**
* @deprecated 3.6.0 - Not used
*
* @return mixed|string
*/
public function get_custom_#_fields() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
$fields = $this->wp_options->get('custom_#_fields');

if (trim($fields) === '') {
return "[]";
}

return $fields;
}

/**
* @deprecated 3.6.0 - Not used
*
* @return mixed|string
*/
public function has_custom_#_fields() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get('custom_#_fields');
}

public function get_sso_options() {
$options["scope"] = $this->_scopes;

Expand Down Expand Up @@ -347,4 +201,150 @@ public function get_lock_options() {

return $options_obj;
}

/**
* @deprecated 3.6.0 - Not used, determined in wp-content/plugins/auth0/assets/js/lock-init.js.
*
* @return string
*/
public function get_lock_classname() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
if ( $this->_get_boolean( $this->wp_options->get( 'passwordless_enabled' ) ) ) {
return 'Auth0LockPasswordless';
} else {
return 'Auth0Lock';
}
}

/**
* @deprecated 3.6.0 - Replaced with WP_Auth0_Options::Instance()->get( 'passwordless_enabled' ).
*
* @return bool
*/
public function isPasswordlessEnable() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->_get_boolean( $this->wp_options->get( 'passwordless_enabled' ) );
}

/**
* @deprecated 3.6.0 - Not used, invalid way to display Passwordless in Lock 11.2.
*
* @return string
*/
public function get_lock_show_method() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return 'show';
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance->get( 'custom_css' ) instead.
*
* @return string
*/
public function get_custom_css() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get( 'custom_css' );
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance->get( 'custom_js' ) instead.
*
* @return string
*/
public function get_custom_js() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get( 'custom_js' );
}

/**
* @deprecated 3.6.0 - Not used, call WP_Auth0::ready() instead.
*
* @return string
*/
public function can_show() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return WP_Auth0::ready();
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance->get( 'cdn_url' ) instead.
*
* @return string
*/
public function get_cdn_url() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get( 'cdn_url' );
}

/**
* @deprecated 3.6.0 - Not used, use (bool) WP_Auth0_Options::Instance->get( 'wordpress_login_enabled' ) instead.
*
* @return string
*/
public function get_wordpress_login_enabled() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->_get_boolean( $this->wp_options->get( 'wordpress_login_enabled' ) );
}

/**
* @deprecated 3.6.0 - Not used, $this->#_mode is never changed.
*
* @param bool $enabled - disallow logins?
*/
public function set_#_mode( $enabled ) {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
$this->#_mode = $enabled;
}

/**
* @deprecated 3.6.0 - Not used, value and default are passed to wp_localize_script() in templates/#-form.php.
*
* @return mixed|string
*/
public function modal_button_name() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
$name = 'Login';
if ( isset( $this->extended_settings['modal_trigger_name'] ) && $this->extended_settings['modal_trigger_name'] != '' ) {
$name = $this->extended_settings['modal_trigger_name'];
}
return $name;
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance()->get('custom_#_fields') instead.
*
* @return mixed|string
*/
public function get_custom_#_fields() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
$fields = $this->wp_options->get('custom_#_fields');

if (trim($fields) === '') {
return "[]";
}

return $fields;
}

/**
* @deprecated 3.6.0 - Not used, use WP_Auth0_Options::Instance()->get('custom_#_fields') instead.
*
* @return mixed|string
*/
public function has_custom_#_fields() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return $this->wp_options->get('custom_#_fields');
}
}

0 comments on commit 74f2fd0

Please # to comment.