# disco/1.3.48/vendor/micropackage/requirements/src/Checker/SSL.php

Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO, version 1.3.48. 50 lines.

- Page: https://pluginprobe.com/plugins/disco/1.3.48/code/vendor/micropackage/requirements/src/Checker/SSL.php
- Raw: https://pluginprobe.com/plugins/disco/1.3.48/raw/vendor/micropackage/requirements/src/Checker/SSL.php
- Modified: 2024-09-18T11:17:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/disco/1.3.48/code/vendor/micropackage/requirements/src/Checker/SSL.php#L10-L20`.

```php
<?php
/**
 * SSL Checker class
 *
 * @package micropackage/requirements
 */

namespace Micropackage\Requirements\Checker;

use Micropackage\Requirements\Abstracts;
use Micropackage\Requirements\Requirements;

/**
 * SSL Checker class
 */
class SSL extends Abstracts\Checker {

	/**
	 * Checker name
	 *
	 * @var string
	 */
	protected $name = 'ssl';

	/**
	 * Checks if the requirement is met
	 *
	 * @since  1.1.0
	 * @throws \Exception When provided value is not a string or numeric.
	 * @param  string $enabled If SSL should be enabled or disabled.
	 * @return void
	 */
	public function check( $enabled ) {

		if ( ! is_bool( $enabled ) ) {
			throw new \Exception( 'SSL Check requires bool parameter' );
		}

		if ( $enabled && ! is_ssl() ) {
			$this->add_error( __( 'SSL is required', Requirements::$textdomain ) );
		}

		if ( ! $enabled && is_ssl() ) {
			$this->add_error( __( 'SSL is superfluous', Requirements::$textdomain ) );
		}

	}

}

```
