<?php

/**
 * @deprecated 1.4. Replaced by Replaced by Barn2\Plugin\Password_Protected_Categories\Plugin.
 */
final class Password_Protected_Categories_Plugin {

	/**
	 * @deprecated 1.4 Replaced by Barn2\Plugin\Password_Protected_Categories\ppc().
	 */
	public static function instance() {
		_deprecated_function( __FUNCTION__, '1.4', 'Barn2\\Plugin\\Password_Protected_Categories\\ppc()' );
		return \Barn2\Plugin\Password_Protected_Categories\ppc();
	}

}

/**
 * @deprecated 1.4. Replaced by Barn2\Plugin\Password_Protected_Categories\PPC_Util.
 */
class PPC_Util {

	public static function __callStatic( $method, $args ) {
		_deprecated_function( __FUNCTION__, '1.4', "Barn2\\Plugin\\Password_Protected_Categories\\PPC_Util::{$method}" );

		if ( method_exists( 'Barn2\\Plugin\\Password_Protected_Categories\\PPC_Util', $method ) ) {
			return \Barn2\Plugin\Password_Protected_Categories\PPC_Util::$method( $args );
		}
	}

}

/**
 * @deprecated 1.4. Replaced by Barn2\Plugin\Password_Protected_Categories\Login_Shortcode.
 */
class PPC_Login_Shortcode {

	const SHORTCODE = 'category_login';

	/**
	 * @deprecated 1.4. Replaced by Barn2\Plugin\Password_Protected_Categories\Login_Shortcode::login_shortcode().
	 */
	public static function login_shortcode( $atts = [] ) {
		_deprecated_function( __FUNCTION__, '1.4', 'Barn2\\Plugin\\Password_Protected_Categories\\Login_Shortcode::login_shortcode()' );
		$shortcode = new \Barn2\Plugin\Password_Protected_Categories\Login_Shortcode();
		$shortcode->login_shortcode( $atts );
	}

}

/**
 * @deprecated 1.4. Replaced by Replaced by Barn2\Plugin\Password_Protected_Categories\Password_Form.
 */
class PPC_Password_Form {

	/**
	 * @deprecated 1.4. Replaced by Barn2\Plugin\Password_Protected_Categories\Password_Form::handle_login().
	 */
	public function handle_login() {
		_deprecated_function( __FUNCTION__, '1.4', 'Barn2\\Plugin\\Password_Protected_Categories\\Password_Form::handle_login()' );
		$form = new \Barn2\Plugin\Password_Protected_Categories\Password_Form();
		$form->handle_login();
	}

	/**
	 * @deprecated 1.4. Replaced by Barn2\Plugin\Password_Protected_Categories\Password_Form::display_password_form().
	 */
	public static function display_password_form( $message = '' ) {
		_deprecated_function( __FUNCTION__, '1.4', 'Barn2\\Plugin\\Password_Protected_Categories\\Password_Form::display_password_form()' );
		$form = new \Barn2\Plugin\Password_Protected_Categories\Password_Form();
		$form->display_password_form( $message );
	}

	/**
	 * @deprecated 1.4. Replaced by Barn2\Plugin\Password_Protected_Categories\Password_Form::get_password_form().
	 */
	public static function get_password_form( $message = '', $central_login = true ) {
		_deprecated_function( __FUNCTION__, '1.4', 'Barn2\\Plugin\\Password_Protected_Categories\\Password_Form::get_password_form()' );
		$form = new \Barn2\Plugin\Password_Protected_Categories\Password_Form();
		$form->get_password_form( $message, $central_login );
	}

}

/**
 * @deprecated 1.4. Replaced by Barn2\Plugin\Password_Protected_Categories\Term_Visibility.
 */
class PPC_Term_Visibility {

	public $term;
	public $visibility = false;
	private $term_visibility;

	public function __construct( WP_Term $term ) {
		_deprecated_constructor( __CLASS__, '1.4' );

		$this->term_visibility = new \Barn2\Plugin\Password_Protected_Categories\Term_Visibility( $term );
		$this->term            = $term;
		$this->visibility      = $this->term_visibility->visibility;
	}

	public function __call( $method, $args ) {
		_deprecated_function( __FUNCTION__, '1.4', "Barn2\\Plugin\\Password_Protected_Categories\\Term_Visibility::{$method}" );

		if ( method_exists( $this->term_visibility, $method ) ) {
			$this->term_visibility->{$method}( $args );
		}
	}

}
