Completed
Branch Gutenberg/switch-eventespresso... (7adb18)
by
unknown
16:22 queued 14:31
created
core/services/collections/DuplicateCollectionIdentifierException.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -16,25 +16,25 @@
 block discarded – undo
16 16
 class DuplicateCollectionIdentifierException extends OutOfRangeException
17 17
 {
18 18
 
19
-    /**
20
-     * DuplicateCollectionIdentifierException constructor.
21
-     *
22
-     * @param                $identifier
23
-     * @param string         $message
24
-     * @param int            $code
25
-     * @param Exception|null $previous
26
-     */
27
-    public function __construct($identifier, $message = '', $code = 0, Exception $previous = null)
28
-    {
29
-        if (empty($message)) {
30
-            $message = sprintf(
31
-                __(
32
-                    'The supplied identifier "%1$s" already exists within this collection.',
33
-                    'event_espresso'
34
-                ),
35
-                $identifier
36
-            );
37
-        }
38
-        parent::__construct($message, $code, $previous);
39
-    }
19
+	/**
20
+	 * DuplicateCollectionIdentifierException constructor.
21
+	 *
22
+	 * @param                $identifier
23
+	 * @param string         $message
24
+	 * @param int            $code
25
+	 * @param Exception|null $previous
26
+	 */
27
+	public function __construct($identifier, $message = '', $code = 0, Exception $previous = null)
28
+	{
29
+		if (empty($message)) {
30
+			$message = sprintf(
31
+				__(
32
+					'The supplied identifier "%1$s" already exists within this collection.',
33
+					'event_espresso'
34
+				),
35
+				$identifier
36
+			);
37
+		}
38
+		parent::__construct($message, $code, $previous);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
core/exceptions/InvalidIdentifierException.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -16,28 +16,28 @@
 block discarded – undo
16 16
 class InvalidIdentifierException extends InvalidArgumentException
17 17
 {
18 18
 
19
-    /**
20
-     * InvalidIdentifierException constructor.
21
-     *
22
-     * @param string     $actual   the identifier that was supplied
23
-     * @param string     $expected example of an acceptable identifier
24
-     * @param string     $message
25
-     * @param int        $code
26
-     * @param Exception $previous
27
-     */
28
-    public function __construct($actual, $expected, $message = '', $code = 0, Exception $previous = null)
29
-    {
30
-        if (empty($message)) {
31
-            $message = sprintf(
32
-                __(
33
-                    'The supplied identifier "%1$s" is invalid. A value like "%2$s" was expected.',
34
-                    'event_espresso'
35
-                ),
36
-                $actual,
37
-                $expected
38
-            );
39
-        }
40
-        parent::__construct($message, $code, $previous);
41
-    }
19
+	/**
20
+	 * InvalidIdentifierException constructor.
21
+	 *
22
+	 * @param string     $actual   the identifier that was supplied
23
+	 * @param string     $expected example of an acceptable identifier
24
+	 * @param string     $message
25
+	 * @param int        $code
26
+	 * @param Exception $previous
27
+	 */
28
+	public function __construct($actual, $expected, $message = '', $code = 0, Exception $previous = null)
29
+	{
30
+		if (empty($message)) {
31
+			$message = sprintf(
32
+				__(
33
+					'The supplied identifier "%1$s" is invalid. A value like "%2$s" was expected.',
34
+					'event_espresso'
35
+				),
36
+				$actual,
37
+				$expected
38
+			);
39
+		}
40
+		parent::__construct($message, $code, $previous);
41
+	}
42 42
 }
43 43
 // Location: core/exceptions/InvalidIdentifierException.php
Please login to merge, or discard this patch.
core/domain/DomainBase.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function distributionAssetsPath()
138 138
     {
139
-        return $this->pluginPath() . 'assets/dist/';
139
+        return $this->pluginPath().'assets/dist/';
140 140
     }
141 141
 
142 142
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function distributionAssetsUrl()
147 147
     {
148
-        return $this->pluginUrl() . 'assets/dist/';
148
+        return $this->pluginUrl().'assets/dist/';
149 149
     }
150 150
 
151 151
 
Please login to merge, or discard this patch.
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -16,153 +16,153 @@
 block discarded – undo
16 16
 abstract class DomainBase implements DomainInterface
17 17
 {
18 18
 
19
-    /**
20
-     * Equivalent to `__FILE__` for main plugin file.
21
-     *
22
-     * @var FilePath
23
-     */
24
-    private $plugin_file;
25
-
26
-    /**
27
-     * String indicating version for plugin
28
-     *
29
-     * @var string
30
-     */
31
-    private $version;
32
-
33
-    /**
34
-     * @var string $plugin_basename
35
-     */
36
-    private $plugin_basename;
37
-
38
-    /**
39
-     * @var string $plugin_path
40
-     */
41
-    private $plugin_path;
42
-
43
-    /**
44
-     * @var string $plugin_url
45
-     */
46
-    private $plugin_url;
47
-
48
-    /**
49
-     * @var string $asset_namespace
50
-     */
51
-    private $asset_namespace;
52
-
53
-
54
-
55
-    /**
56
-     * Initializes internal properties.
57
-     *
58
-     * @param FilePath $plugin_file
59
-     * @param Version  $version
60
-     */
61
-    public function __construct(FilePath $plugin_file, Version $version)
62
-    {
63
-        $this->plugin_file = $plugin_file;
64
-        $this->version = $version;
65
-        $this->plugin_basename = plugin_basename($this->pluginFile());
66
-        $this->plugin_path = plugin_dir_path($this->pluginFile());
67
-        $this->plugin_url = plugin_dir_url($this->pluginFile());
68
-        $this->setAssetNamespace();
69
-    }
70
-
71
-
72
-    /**
73
-     * @return string
74
-     */
75
-    public function pluginFile()
76
-    {
77
-        return (string) $this->plugin_file;
78
-    }
79
-
80
-
81
-
82
-    /**
83
-     * @return string
84
-     */
85
-    public function pluginBasename()
86
-    {
87
-        return $this->plugin_basename;
88
-    }
89
-
90
-
91
-
92
-    /**
93
-     * @return string
94
-     */
95
-    public function pluginPath()
96
-    {
97
-        return $this->plugin_path;
98
-    }
99
-
100
-
101
-
102
-    /**
103
-     * @return string
104
-     */
105
-    public function pluginUrl()
106
-    {
107
-        return $this->plugin_url;
108
-    }
109
-
110
-
111
-
112
-    /**
113
-     * @return string
114
-     */
115
-    public function version()
116
-    {
117
-        return (string) $this->version;
118
-    }
119
-
120
-
121
-
122
-    /**
123
-     * @return Version
124
-     */
125
-    public function versionValueObject()
126
-    {
127
-        return $this->version;
128
-    }
129
-
130
-
131
-    /**
132
-     * @return string
133
-     */
134
-    public function distributionAssetsPath()
135
-    {
136
-        return $this->pluginPath() . 'assets/dist/';
137
-    }
138
-
139
-
140
-    /**
141
-     * @return string
142
-     */
143
-    public function distributionAssetsUrl()
144
-    {
145
-        return $this->pluginUrl() . 'assets/dist/';
146
-    }
147
-
148
-
149
-    /**
150
-     * @return string
151
-     */
152
-    public function assetNamespace()
153
-    {
154
-        return $this->asset_namespace;
155
-    }
156
-
157
-
158
-    /**
159
-     * @return void
160
-     */
161
-    private function setAssetNamespace()
162
-    {
163
-        $this->asset_namespace = sanitize_key(
164
-            // convert directory separators to dashes and remove file extension
165
-            str_replace(array('/', '.php'), array('-', ''), $this->plugin_basename)
166
-        );
167
-    }
19
+	/**
20
+	 * Equivalent to `__FILE__` for main plugin file.
21
+	 *
22
+	 * @var FilePath
23
+	 */
24
+	private $plugin_file;
25
+
26
+	/**
27
+	 * String indicating version for plugin
28
+	 *
29
+	 * @var string
30
+	 */
31
+	private $version;
32
+
33
+	/**
34
+	 * @var string $plugin_basename
35
+	 */
36
+	private $plugin_basename;
37
+
38
+	/**
39
+	 * @var string $plugin_path
40
+	 */
41
+	private $plugin_path;
42
+
43
+	/**
44
+	 * @var string $plugin_url
45
+	 */
46
+	private $plugin_url;
47
+
48
+	/**
49
+	 * @var string $asset_namespace
50
+	 */
51
+	private $asset_namespace;
52
+
53
+
54
+
55
+	/**
56
+	 * Initializes internal properties.
57
+	 *
58
+	 * @param FilePath $plugin_file
59
+	 * @param Version  $version
60
+	 */
61
+	public function __construct(FilePath $plugin_file, Version $version)
62
+	{
63
+		$this->plugin_file = $plugin_file;
64
+		$this->version = $version;
65
+		$this->plugin_basename = plugin_basename($this->pluginFile());
66
+		$this->plugin_path = plugin_dir_path($this->pluginFile());
67
+		$this->plugin_url = plugin_dir_url($this->pluginFile());
68
+		$this->setAssetNamespace();
69
+	}
70
+
71
+
72
+	/**
73
+	 * @return string
74
+	 */
75
+	public function pluginFile()
76
+	{
77
+		return (string) $this->plugin_file;
78
+	}
79
+
80
+
81
+
82
+	/**
83
+	 * @return string
84
+	 */
85
+	public function pluginBasename()
86
+	{
87
+		return $this->plugin_basename;
88
+	}
89
+
90
+
91
+
92
+	/**
93
+	 * @return string
94
+	 */
95
+	public function pluginPath()
96
+	{
97
+		return $this->plugin_path;
98
+	}
99
+
100
+
101
+
102
+	/**
103
+	 * @return string
104
+	 */
105
+	public function pluginUrl()
106
+	{
107
+		return $this->plugin_url;
108
+	}
109
+
110
+
111
+
112
+	/**
113
+	 * @return string
114
+	 */
115
+	public function version()
116
+	{
117
+		return (string) $this->version;
118
+	}
119
+
120
+
121
+
122
+	/**
123
+	 * @return Version
124
+	 */
125
+	public function versionValueObject()
126
+	{
127
+		return $this->version;
128
+	}
129
+
130
+
131
+	/**
132
+	 * @return string
133
+	 */
134
+	public function distributionAssetsPath()
135
+	{
136
+		return $this->pluginPath() . 'assets/dist/';
137
+	}
138
+
139
+
140
+	/**
141
+	 * @return string
142
+	 */
143
+	public function distributionAssetsUrl()
144
+	{
145
+		return $this->pluginUrl() . 'assets/dist/';
146
+	}
147
+
148
+
149
+	/**
150
+	 * @return string
151
+	 */
152
+	public function assetNamespace()
153
+	{
154
+		return $this->asset_namespace;
155
+	}
156
+
157
+
158
+	/**
159
+	 * @return void
160
+	 */
161
+	private function setAssetNamespace()
162
+	{
163
+		$this->asset_namespace = sanitize_key(
164
+			// convert directory separators to dashes and remove file extension
165
+			str_replace(array('/', '.php'), array('-', ''), $this->plugin_basename)
166
+		);
167
+	}
168 168
 }
Please login to merge, or discard this patch.
core/domain/values/assets/ManifestFile.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -16,26 +16,26 @@
 block discarded – undo
16 16
 class ManifestFile extends Asset
17 17
 {
18 18
 
19
-    /**
20
-     * Asset constructor.
21
-     *
22
-     * @param DomainInterface $domain
23
-     * @throws InvalidDataTypeException
24
-     */
25
-    public function __construct(DomainInterface $domain)
26
-    {
27
-        parent::__construct(Asset::TYPE_MANIFEST, $domain->assetNamespace(), $domain);
28
-    }
29
-
30
-
31
-    public function urlBase()
32
-    {
33
-        return $this->domain->distributionAssetsUrl();
34
-    }
35
-
36
-
37
-    public function filepath()
38
-    {
39
-        return $this->domain->distributionAssetsPath();
40
-    }
19
+	/**
20
+	 * Asset constructor.
21
+	 *
22
+	 * @param DomainInterface $domain
23
+	 * @throws InvalidDataTypeException
24
+	 */
25
+	public function __construct(DomainInterface $domain)
26
+	{
27
+		parent::__construct(Asset::TYPE_MANIFEST, $domain->assetNamespace(), $domain);
28
+	}
29
+
30
+
31
+	public function urlBase()
32
+	{
33
+		return $this->domain->distributionAssetsUrl();
34
+	}
35
+
36
+
37
+	public function filepath()
38
+	{
39
+		return $this->domain->distributionAssetsPath();
40
+	}
41 41
 }
Please login to merge, or discard this patch.
core/domain/values/assets/Asset.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     private function setType($type)
84 84
     {
85
-        if (! in_array($type, $this->validAssetTypes(), true)) {
85
+        if ( ! in_array($type, $this->validAssetTypes(), true)) {
86 86
             throw new InvalidDataTypeException(
87 87
                 'Asset::$type',
88 88
                 $type,
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     private function setHandle($handle)
101 101
     {
102
-        if (! is_string($handle)) {
102
+        if ( ! is_string($handle)) {
103 103
             throw new InvalidDataTypeException(
104 104
                 '$handle',
105 105
                 $handle,
Please login to merge, or discard this patch.
Indentation   +150 added lines, -150 removed lines patch added patch discarded remove patch
@@ -16,154 +16,154 @@
 block discarded – undo
16 16
 abstract class Asset
17 17
 {
18 18
 
19
-    /**
20
-     * indicates the file extension for a build distribution CSS file
21
-     */
22
-    const FILE_EXTENSION_DISTRIBUTION_CSS = '.dist.css';
23
-
24
-    /**
25
-     * indicates the file extension for a build distribution JS file
26
-     */
27
-    const FILE_EXTENSION_DISTRIBUTION_JS = '.dist.js';
28
-
29
-    /**
30
-     * indicates a Cascading Style Sheet asset
31
-     */
32
-    const TYPE_CSS = 'css';
33
-
34
-    /**
35
-     * indicates a Javascript asset
36
-     */
37
-    const TYPE_JS = 'js';
38
-
39
-    /**
40
-     * indicates a Javascript manifest file
41
-     */
42
-    const TYPE_MANIFEST = 'manifest';
43
-
44
-    /**
45
-     * @var DomainInterface $domain
46
-     */
47
-    protected $domain;
48
-
49
-    /**
50
-     * @var string $type
51
-     */
52
-    private $type;
53
-
54
-    /**
55
-     * @var string $handle
56
-     */
57
-    private $handle;
58
-
59
-    /**
60
-     * @var bool $registered
61
-     */
62
-    private $registered = false;
63
-
64
-
65
-    /**
66
-     * Asset constructor.
67
-     *
68
-     * @param                 $type
69
-     * @param string          $handle
70
-     * @param DomainInterface $domain
71
-     * @throws InvalidDataTypeException
72
-     */
73
-    public function __construct($type, $handle, DomainInterface $domain)
74
-    {
75
-        $this->domain = $domain;
76
-        $this->setType($type);
77
-        $this->setHandle($handle);
78
-    }
79
-
80
-
81
-    /**
82
-     * @return array
83
-     */
84
-    public function validAssetTypes()
85
-    {
86
-        return array(
87
-            Asset::TYPE_CSS,
88
-            Asset::TYPE_JS,
89
-            Asset::TYPE_MANIFEST,
90
-        );
91
-    }
92
-
93
-
94
-    /**
95
-     * @param string $type
96
-     * @throws InvalidDataTypeException
97
-     */
98
-    private function setType($type)
99
-    {
100
-        if (! in_array($type, $this->validAssetTypes(), true)) {
101
-            throw new InvalidDataTypeException(
102
-                'Asset::$type',
103
-                $type,
104
-                'one of the TYPE_* class constants on \EventEspresso\core\domain\values\Asset is required'
105
-            );
106
-        }
107
-        $this->type = $type;
108
-    }
109
-
110
-
111
-    /**
112
-     * @param string $handle
113
-     * @throws InvalidDataTypeException
114
-     */
115
-    private function setHandle($handle)
116
-    {
117
-        if (! is_string($handle)) {
118
-            throw new InvalidDataTypeException(
119
-                '$handle',
120
-                $handle,
121
-                'string'
122
-            );
123
-        }
124
-        $this->handle = $handle;
125
-    }
126
-
127
-
128
-    /**
129
-     * @return string
130
-     */
131
-    public function assetNamespace()
132
-    {
133
-        return $this->domain->assetNamespace();
134
-    }
135
-
136
-
137
-    /**
138
-     * @return string
139
-     */
140
-    public function type()
141
-    {
142
-        return $this->type;
143
-    }
144
-
145
-
146
-    /**
147
-     * @return string
148
-     */
149
-    public function handle()
150
-    {
151
-        return $this->handle;
152
-    }
153
-
154
-    /**
155
-     * @return bool
156
-     */
157
-    public function isRegistered()
158
-    {
159
-        return $this->registered;
160
-    }
161
-
162
-    /**
163
-     * @param bool $registered
164
-     */
165
-    public function setRegistered($registered = true)
166
-    {
167
-        $this->registered = filter_var($registered, FILTER_VALIDATE_BOOLEAN);
168
-    }
19
+	/**
20
+	 * indicates the file extension for a build distribution CSS file
21
+	 */
22
+	const FILE_EXTENSION_DISTRIBUTION_CSS = '.dist.css';
23
+
24
+	/**
25
+	 * indicates the file extension for a build distribution JS file
26
+	 */
27
+	const FILE_EXTENSION_DISTRIBUTION_JS = '.dist.js';
28
+
29
+	/**
30
+	 * indicates a Cascading Style Sheet asset
31
+	 */
32
+	const TYPE_CSS = 'css';
33
+
34
+	/**
35
+	 * indicates a Javascript asset
36
+	 */
37
+	const TYPE_JS = 'js';
38
+
39
+	/**
40
+	 * indicates a Javascript manifest file
41
+	 */
42
+	const TYPE_MANIFEST = 'manifest';
43
+
44
+	/**
45
+	 * @var DomainInterface $domain
46
+	 */
47
+	protected $domain;
48
+
49
+	/**
50
+	 * @var string $type
51
+	 */
52
+	private $type;
53
+
54
+	/**
55
+	 * @var string $handle
56
+	 */
57
+	private $handle;
58
+
59
+	/**
60
+	 * @var bool $registered
61
+	 */
62
+	private $registered = false;
63
+
64
+
65
+	/**
66
+	 * Asset constructor.
67
+	 *
68
+	 * @param                 $type
69
+	 * @param string          $handle
70
+	 * @param DomainInterface $domain
71
+	 * @throws InvalidDataTypeException
72
+	 */
73
+	public function __construct($type, $handle, DomainInterface $domain)
74
+	{
75
+		$this->domain = $domain;
76
+		$this->setType($type);
77
+		$this->setHandle($handle);
78
+	}
79
+
80
+
81
+	/**
82
+	 * @return array
83
+	 */
84
+	public function validAssetTypes()
85
+	{
86
+		return array(
87
+			Asset::TYPE_CSS,
88
+			Asset::TYPE_JS,
89
+			Asset::TYPE_MANIFEST,
90
+		);
91
+	}
92
+
93
+
94
+	/**
95
+	 * @param string $type
96
+	 * @throws InvalidDataTypeException
97
+	 */
98
+	private function setType($type)
99
+	{
100
+		if (! in_array($type, $this->validAssetTypes(), true)) {
101
+			throw new InvalidDataTypeException(
102
+				'Asset::$type',
103
+				$type,
104
+				'one of the TYPE_* class constants on \EventEspresso\core\domain\values\Asset is required'
105
+			);
106
+		}
107
+		$this->type = $type;
108
+	}
109
+
110
+
111
+	/**
112
+	 * @param string $handle
113
+	 * @throws InvalidDataTypeException
114
+	 */
115
+	private function setHandle($handle)
116
+	{
117
+		if (! is_string($handle)) {
118
+			throw new InvalidDataTypeException(
119
+				'$handle',
120
+				$handle,
121
+				'string'
122
+			);
123
+		}
124
+		$this->handle = $handle;
125
+	}
126
+
127
+
128
+	/**
129
+	 * @return string
130
+	 */
131
+	public function assetNamespace()
132
+	{
133
+		return $this->domain->assetNamespace();
134
+	}
135
+
136
+
137
+	/**
138
+	 * @return string
139
+	 */
140
+	public function type()
141
+	{
142
+		return $this->type;
143
+	}
144
+
145
+
146
+	/**
147
+	 * @return string
148
+	 */
149
+	public function handle()
150
+	{
151
+		return $this->handle;
152
+	}
153
+
154
+	/**
155
+	 * @return bool
156
+	 */
157
+	public function isRegistered()
158
+	{
159
+		return $this->registered;
160
+	}
161
+
162
+	/**
163
+	 * @param bool $registered
164
+	 */
165
+	public function setRegistered($registered = true)
166
+	{
167
+		$this->registered = filter_var($registered, FILTER_VALIDATE_BOOLEAN);
168
+	}
169 169
 }
Please login to merge, or discard this patch.
core/domain/values/assets/StylesheetAsset.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
      */
55 55
     private function setMedia($media)
56 56
     {
57
-        if (! is_string($media)) {
57
+        if ( ! is_string($media)) {
58 58
             throw new InvalidDataTypeException(
59 59
                 '$media',
60 60
                 $media,
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -16,60 +16,60 @@
 block discarded – undo
16 16
 class StylesheetAsset extends BrowserAsset
17 17
 {
18 18
 
19
-    /**
20
-     * @var string $media
21
-     */
22
-    private $media;
19
+	/**
20
+	 * @var string $media
21
+	 */
22
+	private $media;
23 23
 
24 24
 
25
-    /**
26
-     * CssFile constructor.
27
-     *
28
-     * @param                 $handle
29
-     * @param string          $source
30
-     * @param array           $dependencies
31
-     * @param DomainInterface $domain
32
-     * @param                 $media
33
-     * @throws InvalidDataTypeException
34
-     */
35
-    public function __construct($handle, $source, array $dependencies, DomainInterface $domain, $media = 'all')
36
-    {
37
-        parent::__construct(Asset::TYPE_CSS, $handle, $source, $dependencies, $domain);
38
-        $this->setMedia($media);
39
-    }
25
+	/**
26
+	 * CssFile constructor.
27
+	 *
28
+	 * @param                 $handle
29
+	 * @param string          $source
30
+	 * @param array           $dependencies
31
+	 * @param DomainInterface $domain
32
+	 * @param                 $media
33
+	 * @throws InvalidDataTypeException
34
+	 */
35
+	public function __construct($handle, $source, array $dependencies, DomainInterface $domain, $media = 'all')
36
+	{
37
+		parent::__construct(Asset::TYPE_CSS, $handle, $source, $dependencies, $domain);
38
+		$this->setMedia($media);
39
+	}
40 40
 
41 41
 
42
-    /**
43
-     * @return string
44
-     */
45
-    public function media()
46
-    {
47
-        return $this->media;
48
-    }
42
+	/**
43
+	 * @return string
44
+	 */
45
+	public function media()
46
+	{
47
+		return $this->media;
48
+	}
49 49
 
50 50
 
51
-    /**
52
-     * @param string $media
53
-     * @throws InvalidDataTypeException
54
-     */
55
-    private function setMedia($media)
56
-    {
57
-        if (! is_string($media)) {
58
-            throw new InvalidDataTypeException(
59
-                '$media',
60
-                $media,
61
-                'string'
62
-            );
63
-        }
64
-        $this->media = $media;
65
-    }
51
+	/**
52
+	 * @param string $media
53
+	 * @throws InvalidDataTypeException
54
+	 */
55
+	private function setMedia($media)
56
+	{
57
+		if (! is_string($media)) {
58
+			throw new InvalidDataTypeException(
59
+				'$media',
60
+				$media,
61
+				'string'
62
+			);
63
+		}
64
+		$this->media = $media;
65
+	}
66 66
 
67 67
 
68
-    /**
69
-     * @since 4.9.62.p
70
-     */
71
-    public function enqueueAsset()
72
-    {
73
-        wp_enqueue_style($this->handle());
74
-    }
68
+	/**
69
+	 * @since 4.9.62.p
70
+	 */
71
+	public function enqueueAsset()
72
+	{
73
+		wp_enqueue_style($this->handle());
74
+	}
75 75
 }
Please login to merge, or discard this patch.
widgets/EspressoWidget.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,28 +13,28 @@
 block discarded – undo
13 13
 {
14 14
 
15 15
 
16
-    /**
17
-     * @param string $name
18
-     * @param array  $widget_options
19
-     * @param array  $control_options
20
-     */
21
-    public function __construct($name = '', array $widget_options = array(), array $control_options = array())
22
-    {
23
-        $id_base = EspressoWidget::getIdBase(get_class($this));
24
-        $control_options['id_base'] = $id_base;
25
-        $control_options['height'] = isset($control_options['height']) ? $control_options['height'] : 300;
26
-        $control_options['width'] = isset($control_options['width']) ? $control_options['width'] : 350;
27
-        // Register widget with WordPress
28
-        parent::__construct($id_base, $name, $widget_options, $control_options);
29
-    }
16
+	/**
17
+	 * @param string $name
18
+	 * @param array  $widget_options
19
+	 * @param array  $control_options
20
+	 */
21
+	public function __construct($name = '', array $widget_options = array(), array $control_options = array())
22
+	{
23
+		$id_base = EspressoWidget::getIdBase(get_class($this));
24
+		$control_options['id_base'] = $id_base;
25
+		$control_options['height'] = isset($control_options['height']) ? $control_options['height'] : 300;
26
+		$control_options['width'] = isset($control_options['width']) ? $control_options['width'] : 350;
27
+		// Register widget with WordPress
28
+		parent::__construct($id_base, $name, $widget_options, $control_options);
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @param string $widget_class
34
-     * @return string
35
-     */
36
-    public static function getIdBase($widget_class)
37
-    {
38
-        return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)) . '-widget';
39
-    }
32
+	/**
33
+	 * @param string $widget_class
34
+	 * @return string
35
+	 */
36
+	public static function getIdBase($widget_class)
37
+	{
38
+		return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)) . '-widget';
39
+	}
40 40
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,6 +35,6 @@
 block discarded – undo
35 35
      */
36 36
     public static function getIdBase($widget_class)
37 37
     {
38
-        return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)) . '-widget';
38
+        return sanitize_title(str_replace(array('EEW_', '_'), array('EE_', '-'), $widget_class)).'-widget';
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorRowStandard.php 2 patches
Indentation   +355 added lines, -355 removed lines patch added patch discarded remove patch
@@ -17,359 +17,359 @@
 block discarded – undo
17 17
 class TicketSelectorRowStandard extends TicketSelectorRow
18 18
 {
19 19
 
20
-    /**
21
-     * @var TicketDetails $ticket_details
22
-     */
23
-    protected $ticket_details;
24
-
25
-    /**
26
-     * @var \EE_Ticket_Selector_Config $template_settings
27
-     */
28
-    protected $template_settings;
29
-
30
-    /**
31
-     * @var EE_Tax_Config $tax_settings
32
-     */
33
-    protected $tax_settings;
34
-
35
-    /**
36
-     * @var boolean $prices_displayed_including_taxes
37
-     */
38
-    protected $prices_displayed_including_taxes;
39
-
40
-    /**
41
-     * @var int $row
42
-     */
43
-    protected $row;
44
-
45
-    /**
46
-     * @var int $cols
47
-     */
48
-    protected $cols;
49
-
50
-    /**
51
-     * @var boolean $hidden_input_qty
52
-     */
53
-    protected $hidden_input_qty;
54
-
55
-    /**
56
-     * @var string $ticket_datetime_classes
57
-     */
58
-    protected $ticket_datetime_classes;
59
-
60
-
61
-    /**
62
-     * TicketDetails constructor.
63
-     *
64
-     * @param TicketDetails $ticket_details
65
-     * @param EE_Tax_Config $tax_settings
66
-     * @param int           $total_tickets
67
-     * @param int           $max_attendees
68
-     * @param int           $row
69
-     * @param int           $cols
70
-     * @param boolean       $required_ticket_sold_out
71
-     * @param string        $event_status
72
-     * @param string        $ticket_datetime_classes
73
-     * @throws EE_Error
74
-     * @throws UnexpectedEntityException
75
-     */
76
-    public function __construct(
77
-        TicketDetails $ticket_details,
78
-        EE_Tax_Config $tax_settings,
79
-        $total_tickets,
80
-        $max_attendees,
81
-        $row,
82
-        $cols,
83
-        $required_ticket_sold_out,
84
-        $event_status,
85
-        $ticket_datetime_classes
86
-    ) {
87
-        $this->ticket_details = $ticket_details;
88
-        $this->template_settings = $ticket_details->getTemplateSettings();
89
-        $this->tax_settings = $tax_settings;
90
-        $this->row = $row;
91
-        $this->cols = $cols;
92
-        $this->ticket_datetime_classes = $ticket_datetime_classes;
93
-        parent::__construct(
94
-            $ticket_details->getTicket(),
95
-            $max_attendees,
96
-            $ticket_details->getDateFormat(),
97
-            $event_status,
98
-            $required_ticket_sold_out,
99
-            $total_tickets
100
-        );
101
-    }
102
-
103
-
104
-    /**
105
-     * other ticket rows will need to know if a required ticket is sold out,
106
-     * so that they are not offered for sale
107
-     *
108
-     * @return boolean
109
-     */
110
-    public function getRequiredTicketSoldOut()
111
-    {
112
-        return $this->required_ticket_sold_out;
113
-    }
114
-
115
-
116
-    /**
117
-     * @return int
118
-     */
119
-    public function getCols()
120
-    {
121
-        return $this->cols;
122
-    }
123
-
124
-
125
-    /**
126
-     * getHtml
127
-     *
128
-     * @return string
129
-     * @throws EE_Error
130
-     */
131
-    public function getHtml()
132
-    {
133
-        $this->min = 0;
134
-        $this->max = $this->ticket->max();
135
-        $remaining = $this->ticket->remaining();
136
-        if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
137
-            $this->setTicketMinAndMax($remaining);
138
-        } else {
139
-            // set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
140
-            $this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
141
-                ? $this->ticket->start_date()
142
-                : $this->required_ticket_sold_out;
143
-        }
144
-        $this->setTicketPriceDetails();
145
-        $this->setTicketStatusClasses($remaining);
146
-        $filtered_row_html = $this->getFilteredRowHtml();
147
-        if ($filtered_row_html !== false) {
148
-            return $filtered_row_html;
149
-        }
150
-        $ticket_selector_row_html = EEH_HTML::tr(
151
-            '',
152
-            '',
153
-            "tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} "
154
-            . espresso_get_object_css_class($this->ticket)
155
-        );
156
-        $filtered_row_content = $this->getFilteredRowContents();
157
-        if ($filtered_row_content !== false && $this->max_attendees === 1) {
158
-            return $ticket_selector_row_html
159
-                   . $filtered_row_content
160
-                   . $this->ticketQtyAndIdHiddenInputs()
161
-                   . EEH_HTML::trx();
162
-        }
163
-        if ($filtered_row_content !== false) {
164
-            return $ticket_selector_row_html
165
-                   . $filtered_row_content
166
-                   . EEH_HTML::trx();
167
-        }
168
-        $this->hidden_input_qty = $this->max_attendees > 1;
169
-
170
-        $ticket_selector_row_html .= $this->ticketNameTableCell();
171
-        $ticket_selector_row_html .= $this->ticketPriceTableCell();
172
-        $ticket_selector_row_html .= EEH_HTML::td(
173
-            '',
174
-            '',
175
-            'tckt-slctr-tbl-td-qty cntr',
176
-            '',
177
-            'headers="quantity-' . $this->EVT_ID . '"'
178
-        );
179
-        $this->setTicketStatusDisplay($remaining);
180
-        if (empty($this->ticket_status_display)) {
181
-            if ($this->max_attendees === 1) {
182
-                // only ONE attendee is allowed to register at a time
183
-                $ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
184
-            } elseif ($this->max > 0) {
185
-                $ticket_selector_row_html .= $this->ticketQuantitySelector();
186
-            }
187
-        }
188
-        $ticket_selector_row_html .= $this->ticket_status_display;
189
-        $ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
190
-        $ticket_selector_row_html .= $this->ticket_details->display(
191
-            $this->ticket_price,
192
-            $remaining,
193
-            $this->cols
194
-        );
195
-        $ticket_selector_row_html .= EEH_HTML::tdx();
196
-        $ticket_selector_row_html .= EEH_HTML::trx();
197
-
198
-
199
-        $this->row++;
200
-        return $ticket_selector_row_html;
201
-    }
202
-
203
-
204
-    /**
205
-     * getTicketPriceDetails
206
-     *
207
-     * @return void
208
-     * @throws EE_Error
209
-     */
210
-    protected function setTicketPriceDetails()
211
-    {
212
-        $this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
213
-            ? $this->ticket->get_ticket_total_with_taxes()
214
-            : $this->ticket->get_ticket_subtotal();
215
-        $this->ticket_bundle = false;
216
-        $ticket_min = $this->ticket->min();
217
-        // for ticket bundles, set min and max qty the same
218
-        if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
219
-            $this->ticket_price *= $ticket_min;
220
-            $this->ticket_bundle = true;
221
-        }
222
-        $this->ticket_price = apply_filters(
223
-            'FHEE__ticket_selector_chart_template__ticket_price',
224
-            $this->ticket_price,
225
-            $this->ticket
226
-        );
227
-    }
228
-
229
-
230
-    /**
231
-     * ticketNameTableCell
232
-     *
233
-     * @return string
234
-     * @throws EE_Error
235
-     */
236
-    protected function ticketNameTableCell()
237
-    {
238
-        $html = EEH_HTML::td(
239
-            '',
240
-            '',
241
-            'tckt-slctr-tbl-td-name',
242
-            '',
243
-            'headers="details-' . $this->EVT_ID . '"'
244
-        );
245
-        $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
246
-        $html .= $this->ticket_details->getShowHideLinks();
247
-        if ($this->ticket->required()) {
248
-            $html .= EEH_HTML::p(
249
-                apply_filters(
250
-                    'FHEE__ticket_selector_chart_template__ticket_required_message',
251
-                    esc_html__('This ticket is required and must be purchased.', 'event_espresso')
252
-                ),
253
-                '',
254
-                'ticket-required-pg'
255
-            );
256
-        }
257
-        $html .= EEH_HTML::tdx();
258
-        return $html;
259
-    }
260
-
261
-
262
-    /**
263
-     * ticketPriceTableCell
264
-     *
265
-     * @return string
266
-     * @throws EE_Error
267
-     */
268
-    protected function ticketPriceTableCell()
269
-    {
270
-        $html = '';
271
-        if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
272
-            $html .= EEH_HTML::td(
273
-                '',
274
-                '',
275
-                'tckt-slctr-tbl-td-price jst-rght',
276
-                '',
277
-                'headers="price-' . $this->EVT_ID . '"'
278
-            );
279
-            $html .= \EEH_Template::format_currency($this->ticket_price);
280
-            $html .= $this->ticket->taxable()
281
-                ? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text')
282
-                : '';
283
-            $html .= ' ';
284
-            // phpcs:disable WordPress.WP.I18n.NoEmptyStrings
285
-            $html .= EEH_HTML::span(
286
-                $this->ticket_bundle
287
-                    ? apply_filters(
288
-                        'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
289
-                        __(' / bundle', 'event_espresso')
290
-                    )
291
-                    : apply_filters(
292
-                        'FHEE__ticket_selector_chart_template__per_ticket_text',
293
-                        __('', 'event_espresso')
294
-                    ),
295
-                '',
296
-                'smaller-text no-bold'
297
-            );
298
-            $html .= ' ';
299
-            $html .= EEH_HTML::tdx();
300
-            $this->cols++;
301
-        }
302
-        return $html;
303
-    }
304
-
305
-
306
-    /**
307
-     * onlyOneAttendeeCanRegister
308
-     *
309
-     * @return string
310
-     */
311
-    protected function onlyOneAttendeeCanRegister()
312
-    {
313
-        // display submit button since we have tickets available
314
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
315
-        $this->hidden_input_qty = false;
316
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
317
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
318
-        $html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
319
-        $html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
320
-        $html .= ' id="' . $id . '"';
321
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
322
-        $html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
323
-        $html .= ' title=""/>';
324
-        return $html;
325
-    }
326
-
327
-
328
-    /**
329
-     * ticketQuantitySelector
330
-     *
331
-     * @return string
332
-     * @throws EE_Error
333
-     */
334
-    protected function ticketQuantitySelector()
335
-    {
336
-        // display submit button since we have tickets available
337
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
338
-        $this->hidden_input_qty = false;
339
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
340
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
341
-        $html .= esc_html__('Quantity', 'event_espresso') . '</label>';
342
-        $html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
343
-        $html .= ' id="' . $id . '"';
344
-        $html .= ' class="ticket-selector-tbl-qty-slct">';
345
-        // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
346
-        if ($this->min !== 0 && ! $this->ticket->required()) {
347
-            $html .= '<option value="0">&nbsp;0&nbsp;</option>';
348
-        }
349
-        // offer ticket quantities from the min to the max
350
-        for ($i = $this->min; $i <= $this->max; $i++) {
351
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
352
-        }
353
-        $html .= '</select>';
354
-        return $html;
355
-    }
356
-
357
-
358
-    /**
359
-     * getHiddenInputs
360
-     *
361
-     * @return string
362
-     * @throws EE_Error
363
-     */
364
-    protected function ticketQtyAndIdHiddenInputs()
365
-    {
366
-        $html = '';
367
-        // depending on group reg we need to change the format for qty
368
-        if ($this->hidden_input_qty) {
369
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
370
-        }
371
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
372
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
373
-        return $html;
374
-    }
20
+	/**
21
+	 * @var TicketDetails $ticket_details
22
+	 */
23
+	protected $ticket_details;
24
+
25
+	/**
26
+	 * @var \EE_Ticket_Selector_Config $template_settings
27
+	 */
28
+	protected $template_settings;
29
+
30
+	/**
31
+	 * @var EE_Tax_Config $tax_settings
32
+	 */
33
+	protected $tax_settings;
34
+
35
+	/**
36
+	 * @var boolean $prices_displayed_including_taxes
37
+	 */
38
+	protected $prices_displayed_including_taxes;
39
+
40
+	/**
41
+	 * @var int $row
42
+	 */
43
+	protected $row;
44
+
45
+	/**
46
+	 * @var int $cols
47
+	 */
48
+	protected $cols;
49
+
50
+	/**
51
+	 * @var boolean $hidden_input_qty
52
+	 */
53
+	protected $hidden_input_qty;
54
+
55
+	/**
56
+	 * @var string $ticket_datetime_classes
57
+	 */
58
+	protected $ticket_datetime_classes;
59
+
60
+
61
+	/**
62
+	 * TicketDetails constructor.
63
+	 *
64
+	 * @param TicketDetails $ticket_details
65
+	 * @param EE_Tax_Config $tax_settings
66
+	 * @param int           $total_tickets
67
+	 * @param int           $max_attendees
68
+	 * @param int           $row
69
+	 * @param int           $cols
70
+	 * @param boolean       $required_ticket_sold_out
71
+	 * @param string        $event_status
72
+	 * @param string        $ticket_datetime_classes
73
+	 * @throws EE_Error
74
+	 * @throws UnexpectedEntityException
75
+	 */
76
+	public function __construct(
77
+		TicketDetails $ticket_details,
78
+		EE_Tax_Config $tax_settings,
79
+		$total_tickets,
80
+		$max_attendees,
81
+		$row,
82
+		$cols,
83
+		$required_ticket_sold_out,
84
+		$event_status,
85
+		$ticket_datetime_classes
86
+	) {
87
+		$this->ticket_details = $ticket_details;
88
+		$this->template_settings = $ticket_details->getTemplateSettings();
89
+		$this->tax_settings = $tax_settings;
90
+		$this->row = $row;
91
+		$this->cols = $cols;
92
+		$this->ticket_datetime_classes = $ticket_datetime_classes;
93
+		parent::__construct(
94
+			$ticket_details->getTicket(),
95
+			$max_attendees,
96
+			$ticket_details->getDateFormat(),
97
+			$event_status,
98
+			$required_ticket_sold_out,
99
+			$total_tickets
100
+		);
101
+	}
102
+
103
+
104
+	/**
105
+	 * other ticket rows will need to know if a required ticket is sold out,
106
+	 * so that they are not offered for sale
107
+	 *
108
+	 * @return boolean
109
+	 */
110
+	public function getRequiredTicketSoldOut()
111
+	{
112
+		return $this->required_ticket_sold_out;
113
+	}
114
+
115
+
116
+	/**
117
+	 * @return int
118
+	 */
119
+	public function getCols()
120
+	{
121
+		return $this->cols;
122
+	}
123
+
124
+
125
+	/**
126
+	 * getHtml
127
+	 *
128
+	 * @return string
129
+	 * @throws EE_Error
130
+	 */
131
+	public function getHtml()
132
+	{
133
+		$this->min = 0;
134
+		$this->max = $this->ticket->max();
135
+		$remaining = $this->ticket->remaining();
136
+		if ($this->ticket->is_on_sale() && $this->ticket->is_remaining()) {
137
+			$this->setTicketMinAndMax($remaining);
138
+		} else {
139
+			// set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
140
+			$this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
141
+				? $this->ticket->start_date()
142
+				: $this->required_ticket_sold_out;
143
+		}
144
+		$this->setTicketPriceDetails();
145
+		$this->setTicketStatusClasses($remaining);
146
+		$filtered_row_html = $this->getFilteredRowHtml();
147
+		if ($filtered_row_html !== false) {
148
+			return $filtered_row_html;
149
+		}
150
+		$ticket_selector_row_html = EEH_HTML::tr(
151
+			'',
152
+			'',
153
+			"tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} "
154
+			. espresso_get_object_css_class($this->ticket)
155
+		);
156
+		$filtered_row_content = $this->getFilteredRowContents();
157
+		if ($filtered_row_content !== false && $this->max_attendees === 1) {
158
+			return $ticket_selector_row_html
159
+				   . $filtered_row_content
160
+				   . $this->ticketQtyAndIdHiddenInputs()
161
+				   . EEH_HTML::trx();
162
+		}
163
+		if ($filtered_row_content !== false) {
164
+			return $ticket_selector_row_html
165
+				   . $filtered_row_content
166
+				   . EEH_HTML::trx();
167
+		}
168
+		$this->hidden_input_qty = $this->max_attendees > 1;
169
+
170
+		$ticket_selector_row_html .= $this->ticketNameTableCell();
171
+		$ticket_selector_row_html .= $this->ticketPriceTableCell();
172
+		$ticket_selector_row_html .= EEH_HTML::td(
173
+			'',
174
+			'',
175
+			'tckt-slctr-tbl-td-qty cntr',
176
+			'',
177
+			'headers="quantity-' . $this->EVT_ID . '"'
178
+		);
179
+		$this->setTicketStatusDisplay($remaining);
180
+		if (empty($this->ticket_status_display)) {
181
+			if ($this->max_attendees === 1) {
182
+				// only ONE attendee is allowed to register at a time
183
+				$ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
184
+			} elseif ($this->max > 0) {
185
+				$ticket_selector_row_html .= $this->ticketQuantitySelector();
186
+			}
187
+		}
188
+		$ticket_selector_row_html .= $this->ticket_status_display;
189
+		$ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
190
+		$ticket_selector_row_html .= $this->ticket_details->display(
191
+			$this->ticket_price,
192
+			$remaining,
193
+			$this->cols
194
+		);
195
+		$ticket_selector_row_html .= EEH_HTML::tdx();
196
+		$ticket_selector_row_html .= EEH_HTML::trx();
197
+
198
+
199
+		$this->row++;
200
+		return $ticket_selector_row_html;
201
+	}
202
+
203
+
204
+	/**
205
+	 * getTicketPriceDetails
206
+	 *
207
+	 * @return void
208
+	 * @throws EE_Error
209
+	 */
210
+	protected function setTicketPriceDetails()
211
+	{
212
+		$this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
213
+			? $this->ticket->get_ticket_total_with_taxes()
214
+			: $this->ticket->get_ticket_subtotal();
215
+		$this->ticket_bundle = false;
216
+		$ticket_min = $this->ticket->min();
217
+		// for ticket bundles, set min and max qty the same
218
+		if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
219
+			$this->ticket_price *= $ticket_min;
220
+			$this->ticket_bundle = true;
221
+		}
222
+		$this->ticket_price = apply_filters(
223
+			'FHEE__ticket_selector_chart_template__ticket_price',
224
+			$this->ticket_price,
225
+			$this->ticket
226
+		);
227
+	}
228
+
229
+
230
+	/**
231
+	 * ticketNameTableCell
232
+	 *
233
+	 * @return string
234
+	 * @throws EE_Error
235
+	 */
236
+	protected function ticketNameTableCell()
237
+	{
238
+		$html = EEH_HTML::td(
239
+			'',
240
+			'',
241
+			'tckt-slctr-tbl-td-name',
242
+			'',
243
+			'headers="details-' . $this->EVT_ID . '"'
244
+		);
245
+		$html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
246
+		$html .= $this->ticket_details->getShowHideLinks();
247
+		if ($this->ticket->required()) {
248
+			$html .= EEH_HTML::p(
249
+				apply_filters(
250
+					'FHEE__ticket_selector_chart_template__ticket_required_message',
251
+					esc_html__('This ticket is required and must be purchased.', 'event_espresso')
252
+				),
253
+				'',
254
+				'ticket-required-pg'
255
+			);
256
+		}
257
+		$html .= EEH_HTML::tdx();
258
+		return $html;
259
+	}
260
+
261
+
262
+	/**
263
+	 * ticketPriceTableCell
264
+	 *
265
+	 * @return string
266
+	 * @throws EE_Error
267
+	 */
268
+	protected function ticketPriceTableCell()
269
+	{
270
+		$html = '';
271
+		if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
272
+			$html .= EEH_HTML::td(
273
+				'',
274
+				'',
275
+				'tckt-slctr-tbl-td-price jst-rght',
276
+				'',
277
+				'headers="price-' . $this->EVT_ID . '"'
278
+			);
279
+			$html .= \EEH_Template::format_currency($this->ticket_price);
280
+			$html .= $this->ticket->taxable()
281
+				? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text')
282
+				: '';
283
+			$html .= '&nbsp;';
284
+			// phpcs:disable WordPress.WP.I18n.NoEmptyStrings
285
+			$html .= EEH_HTML::span(
286
+				$this->ticket_bundle
287
+					? apply_filters(
288
+						'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
289
+						__(' / bundle', 'event_espresso')
290
+					)
291
+					: apply_filters(
292
+						'FHEE__ticket_selector_chart_template__per_ticket_text',
293
+						__('', 'event_espresso')
294
+					),
295
+				'',
296
+				'smaller-text no-bold'
297
+			);
298
+			$html .= '&nbsp;';
299
+			$html .= EEH_HTML::tdx();
300
+			$this->cols++;
301
+		}
302
+		return $html;
303
+	}
304
+
305
+
306
+	/**
307
+	 * onlyOneAttendeeCanRegister
308
+	 *
309
+	 * @return string
310
+	 */
311
+	protected function onlyOneAttendeeCanRegister()
312
+	{
313
+		// display submit button since we have tickets available
314
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
315
+		$this->hidden_input_qty = false;
316
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
317
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
318
+		$html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
319
+		$html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
320
+		$html .= ' id="' . $id . '"';
321
+		$html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
322
+		$html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
323
+		$html .= ' title=""/>';
324
+		return $html;
325
+	}
326
+
327
+
328
+	/**
329
+	 * ticketQuantitySelector
330
+	 *
331
+	 * @return string
332
+	 * @throws EE_Error
333
+	 */
334
+	protected function ticketQuantitySelector()
335
+	{
336
+		// display submit button since we have tickets available
337
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
338
+		$this->hidden_input_qty = false;
339
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
340
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
341
+		$html .= esc_html__('Quantity', 'event_espresso') . '</label>';
342
+		$html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
343
+		$html .= ' id="' . $id . '"';
344
+		$html .= ' class="ticket-selector-tbl-qty-slct">';
345
+		// this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
346
+		if ($this->min !== 0 && ! $this->ticket->required()) {
347
+			$html .= '<option value="0">&nbsp;0&nbsp;</option>';
348
+		}
349
+		// offer ticket quantities from the min to the max
350
+		for ($i = $this->min; $i <= $this->max; $i++) {
351
+			$html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
352
+		}
353
+		$html .= '</select>';
354
+		return $html;
355
+	}
356
+
357
+
358
+	/**
359
+	 * getHiddenInputs
360
+	 *
361
+	 * @return string
362
+	 * @throws EE_Error
363
+	 */
364
+	protected function ticketQtyAndIdHiddenInputs()
365
+	{
366
+		$html = '';
367
+		// depending on group reg we need to change the format for qty
368
+		if ($this->hidden_input_qty) {
369
+			$html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
370
+		}
371
+		$html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
372
+		$html .= ' value="' . $this->ticket->ID() . '"/>';
373
+		return $html;
374
+	}
375 375
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             '',
175 175
             'tckt-slctr-tbl-td-qty cntr',
176 176
             '',
177
-            'headers="quantity-' . $this->EVT_ID . '"'
177
+            'headers="quantity-'.$this->EVT_ID.'"'
178 178
         );
179 179
         $this->setTicketStatusDisplay($remaining);
180 180
         if (empty($this->ticket_status_display)) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             '',
241 241
             'tckt-slctr-tbl-td-name',
242 242
             '',
243
-            'headers="details-' . $this->EVT_ID . '"'
243
+            'headers="details-'.$this->EVT_ID.'"'
244 244
         );
245 245
         $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
246 246
         $html .= $this->ticket_details->getShowHideLinks();
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 '',
275 275
                 'tckt-slctr-tbl-td-price jst-rght',
276 276
                 '',
277
-                'headers="price-' . $this->EVT_ID . '"'
277
+                'headers="price-'.$this->EVT_ID.'"'
278 278
             );
279 279
             $html .= \EEH_Template::format_currency($this->ticket_price);
280 280
             $html .= $this->ticket->taxable()
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
         // display submit button since we have tickets available
314 314
         add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
315 315
         $this->hidden_input_qty = false;
316
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
317
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
318
-        $html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
319
-        $html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
320
-        $html .= ' id="' . $id . '"';
321
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
316
+        $id = 'ticket-selector-tbl-qty-slct-'.$this->EVT_ID.'-'.$this->row;
317
+        $html = '<label class="ee-a11y-screen-reader-text" for="'.$id.'">';
318
+        $html .= esc_html__('Select this ticket', 'event_espresso').'</label>';
319
+        $html .= '<input type="radio" name="tkt-slctr-qty-'.$this->EVT_ID.'"';
320
+        $html .= ' id="'.$id.'"';
321
+        $html .= ' class="ticket-selector-tbl-qty-slct" value="'.$this->row.'-1"';
322 322
         $html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
323 323
         $html .= ' title=""/>';
324 324
         return $html;
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
         // display submit button since we have tickets available
337 337
         add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
338 338
         $this->hidden_input_qty = false;
339
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
340
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
341
-        $html .= esc_html__('Quantity', 'event_espresso') . '</label>';
342
-        $html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
343
-        $html .= ' id="' . $id . '"';
339
+        $id = 'ticket-selector-tbl-qty-slct-'.$this->EVT_ID.'-'.$this->row;
340
+        $html = '<label class="ee-a11y-screen-reader-text" for="'.$id.'">';
341
+        $html .= esc_html__('Quantity', 'event_espresso').'</label>';
342
+        $html .= '<select name="tkt-slctr-qty-'.$this->EVT_ID.'[]"';
343
+        $html .= ' id="'.$id.'"';
344 344
         $html .= ' class="ticket-selector-tbl-qty-slct">';
345 345
         // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
346 346
         if ($this->min !== 0 && ! $this->ticket->required()) {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
         }
349 349
         // offer ticket quantities from the min to the max
350 350
         for ($i = $this->min; $i <= $this->max; $i++) {
351
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
351
+            $html .= '<option value="'.$i.'">&nbsp;'.$i.'&nbsp;</option>';
352 352
         }
353 353
         $html .= '</select>';
354 354
         return $html;
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
         $html = '';
367 367
         // depending on group reg we need to change the format for qty
368 368
         if ($this->hidden_input_qty) {
369
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
369
+            $html .= '<input type="hidden" name="tkt-slctr-qty-'.$this->EVT_ID.'[]" value="0"/>';
370 370
         }
371
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
372
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
371
+        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-'.$this->EVT_ID.'[]"';
372
+        $html .= ' value="'.$this->ticket->ID().'"/>';
373 373
         return $html;
374 374
     }
375 375
 }
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorIframeEmbedButton.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@
 block discarded – undo
14 14
 class TicketSelectorIframeEmbedButton extends IframeEmbedButton
15 15
 {
16 16
 
17
-    /**
18
-     * TicketSelectorIframeEmbedButton constructor.
19
-     */
20
-    public function __construct()
21
-    {
22
-        parent::__construct(
23
-            esc_html__('Ticket Selector', 'event_espresso'),
24
-            'ticket_selector'
25
-        );
26
-    }
17
+	/**
18
+	 * TicketSelectorIframeEmbedButton constructor.
19
+	 */
20
+	public function __construct()
21
+	{
22
+		parent::__construct(
23
+			esc_html__('Ticket Selector', 'event_espresso'),
24
+			'ticket_selector'
25
+		);
26
+	}
27 27
 
28 28
 
29
-    /**
30
-     * Adds an iframe embed code button to the Event editor.
31
-     */
32
-    public function addEventEditorIframeEmbedButton()
33
-    {
34
-        // add button for iframe code to event editor.
35
-        $this->addEventEditorIframeEmbedButtonFilter();
36
-    }
29
+	/**
30
+	 * Adds an iframe embed code button to the Event editor.
31
+	 */
32
+	public function addEventEditorIframeEmbedButton()
33
+	{
34
+		// add button for iframe code to event editor.
35
+		$this->addEventEditorIframeEmbedButtonFilter();
36
+	}
37 37
 }
Please login to merge, or discard this patch.