Completed
Push — add/product-ratings-to-search ( 91683c...b05261 )
by
unknown
344:08 queued 334:42
created

Unconfigured_Subscription_Service::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * The environment does not have a subscription service available.
4
 * This represents this scenario.
5
 *
6
 * @package Automattic\Jetpack\Extensions\Premium_Content
7
 */
8
9
namespace Automattic\Jetpack\Extensions\Premium_Content\Subscription_Service;
10
11
use function site_url;
12
// phpcs:disable
13
14
/**
15
 * Class Unconfigured_Subscription_Service
16
 *
17
 * @package Automattic\Jetpack\Extensions\Premium_Content\Subscription_Service
18
 */
19
class Unconfigured_Subscription_Service implements Subscription_Service {
20
21
	/**
22
	 * Is always available because it is the fallback.
23
	 *
24
	 * @inheritDoc
25
	 */
26
	public static function available() {
27
		return true;
28
	}
29
30
	/**
31
	 * Function: initialize()
32
	 *
33
	 * @inheritDoc
34
	 */
35
	public function initialize() {
36
		// noop.
37
	}
38
39
	/**
40
	 * No subscription service available, no users can see this content.
41
	 *
42
	 * @param array $valid_plan_ids .
43
	 */
44
	public function visitor_can_view_content( $valid_plan_ids ) {
45
		return false;
46
	}
47
48
	/**
49
	 * The current visitor would like to obtain access. Where do they go?
50
	 *
51
	 * @param string $mode .
52
	 */
53
	public function access_url( $mode = 'subscribe' ) {
54
		return site_url();
55
	}
56
57
}
58
// phpcs:enable
59