Test Failed
Push — tmp ( 15f615...89cc97 )
by Paul
10:31 queued 04:40
created
views/partials/editor/review.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 </div>
10 10
 
11 11
 <?php if (empty($response)) {
12
-    return;
12
+	return;
13 13
 } ?>
14 14
 
15 15
 <div class="postbox glsr-response-postbox">
Please login to merge, or discard this patch.
plugin/Modules/Html/Settings.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,8 @@
 block discarded – undo
216 216
         if (!empty($field['label'])) {
217 217
             $field['legend'] = $field['label'];
218 218
             unset($field['label']);
219
-        } else {
219
+        }
220
+        else {
220 221
             $field['is_valid'] = false;
221 222
             glsr_log()->warning('Setting field is missing a label')->debug($field);
222 223
         }
Please login to merge, or discard this patch.
Indentation   +235 added lines, -235 removed lines patch added patch discarded remove patch
@@ -11,239 +11,239 @@
 block discarded – undo
11 11
 
12 12
 class Settings
13 13
 {
14
-    /**
15
-     * @var array
16
-     */
17
-    public $settings;
18
-
19
-    /**
20
-     * @param string $id
21
-     * @return string
22
-     */
23
-    public function buildFields($id)
24
-    {
25
-        $this->settings = glsr(DefaultsManager::class)->settings();
26
-        $method = Helper::buildMethodName($id, 'getTemplateDataFor');
27
-        $data = !method_exists($this, $method)
28
-            ? $this->getTemplateData($id)
29
-            : $this->$method($id);
30
-        return glsr(Template::class)->build('pages/settings/'.$id, $data);
31
-    }
32
-
33
-    /**
34
-     * @return string
35
-     */
36
-    protected function getFieldDefault(array $field)
37
-    {
38
-        return Arr::get($field, 'default');
39
-    }
40
-
41
-    /**
42
-     * @return string
43
-     */
44
-    protected function getFieldNameForDependsOn($path)
45
-    {
46
-        $fieldName = Str::convertPathToName($path, OptionManager::databaseKey());
47
-        return $this->isMultiDependency($path)
48
-            ? $fieldName.'[]'
49
-            : $fieldName;
50
-    }
51
-
52
-    /**
53
-     * @return array
54
-     */
55
-    protected function getSettingFields($path)
56
-    {
57
-        return array_filter($this->settings, function ($key) use ($path) {
58
-            return Str::startsWith($path, $key);
59
-        }, ARRAY_FILTER_USE_KEY);
60
-    }
61
-
62
-    /**
63
-     * @return string
64
-     */
65
-    protected function getSettingRows(array $fields)
66
-    {
67
-        $rows = '';
68
-        foreach ($fields as $name => $field) {
69
-            $field = wp_parse_args($field, [
70
-                'is_setting' => true,
71
-                'name' => $name,
72
-            ]);
73
-            $rows.= new Field($this->normalize($field));
74
-        }
75
-        return $rows;
76
-    }
77
-
78
-    /**
79
-     * @param string $id
80
-     * @return array
81
-     */
82
-    protected function getTemplateData($id)
83
-    {
84
-        $fields = $this->getSettingFields($this->normalizeSettingPath($id));
85
-        return [
86
-            'context' => [
87
-                'rows' => $this->getSettingRows($fields),
88
-            ],
89
-        ];
90
-    }
91
-
92
-    /**
93
-     * @param string $id
94
-     * @return array
95
-     */
96
-    protected function getTemplateDataForAddons($id)
97
-    {
98
-        $fields = $this->getSettingFields($this->normalizeSettingPath($id));
99
-        $settings = Arr::convertFromDotNotation($fields);
100
-        $settingKeys = array_keys($settings['settings']['addons']);
101
-        $results = [];
102
-        foreach ($settingKeys as $key) {
103
-            $addonFields = array_filter($fields, function ($path) use ($key) {
104
-                return Str::startsWith('settings.addons.'.$key, $path);
105
-            }, ARRAY_FILTER_USE_KEY);
106
-            $results[$key] = $this->getSettingRows($addonFields);
107
-        }
108
-        ksort($results);
109
-        return [
110
-            'settings' => $results,
111
-        ];
112
-    }
113
-
114
-    /**
115
-     * @param string $id
116
-     * @return array
117
-     */
118
-    protected function getTemplateDataForLicenses($id)
119
-    {
120
-        $fields = $this->getSettingFields($this->normalizeSettingPath($id));
121
-        ksort($fields);
122
-        return [
123
-            'context' => [
124
-                'rows' => $this->getSettingRows($fields),
125
-            ],
126
-        ];
127
-    }
128
-
129
-    /**
130
-     * @return array
131
-     */
132
-    protected function getTemplateDataForTranslations()
133
-    {
134
-        $translations = glsr(Translation::class)->renderAll();
135
-        $class = empty($translations)
136
-            ? 'glsr-hidden'
137
-            : '';
138
-        return [
139
-            'context' => [
140
-                'class' => $class,
141
-                'database_key' => OptionManager::databaseKey(),
142
-                'translations' => $translations,
143
-            ],
144
-        ];
145
-    }
146
-
147
-    /**
148
-     * @param string $path
149
-     * @param string|array $expectedValue
150
-     * @return bool
151
-     */
152
-    protected function isFieldHidden($path, $expectedValue)
153
-    {
154
-        $optionValue = glsr(OptionManager::class)->get(
155
-            $path,
156
-            Arr::get(glsr()->defaults, $path)
157
-        );
158
-        if (is_array($expectedValue)) {
159
-            return is_array($optionValue)
160
-                ? 0 === count(array_intersect($optionValue, $expectedValue))
161
-                : !in_array($optionValue, $expectedValue);
162
-        }
163
-        return $optionValue != $expectedValue;
164
-    }
165
-
166
-    /**
167
-     * @return bool
168
-     */
169
-    protected function isMultiDependency($path)
170
-    {
171
-        if (isset($this->settings[$path])) {
172
-            $field = $this->settings[$path];
173
-            return ('checkbox' == $field['type'] && !empty($field['options']))
174
-                || !empty($field['multiple']);
175
-        }
176
-        return false;
177
-    }
178
-
179
-    /**
180
-     * @return array
181
-     */
182
-    protected function normalize(array $field)
183
-    {
184
-        $field = $this->normalizeDependsOn($field);
185
-        $field = $this->normalizeLabelAndLegend($field);
186
-        $field = $this->normalizeValue($field);
187
-        return $field;
188
-    }
189
-
190
-    /**
191
-     * @return array
192
-     */
193
-    protected function normalizeDependsOn(array $field)
194
-    {
195
-        if (!empty($field['depends_on']) && is_array($field['depends_on'])) {
196
-            $isFieldHidden = false;
197
-            $conditions = [];
198
-            foreach ($field['depends_on'] as $path => $value) {
199
-                $conditions[] = [
200
-                    'name' => $this->getFieldNameForDependsOn($path),
201
-                    'value' => $value,
202
-                ];
203
-                if ($this->isFieldHidden($path, $value)) {
204
-                    $isFieldHidden = true;
205
-                }
206
-            }
207
-            $field['data-depends'] = json_encode($conditions, JSON_HEX_APOS | JSON_HEX_QUOT);
208
-            $field['is_hidden'] = $isFieldHidden;
209
-        }
210
-        return $field;
211
-    }
212
-
213
-    /**
214
-     * @return array
215
-     */
216
-    protected function normalizeLabelAndLegend(array $field)
217
-    {
218
-        if (!empty($field['label'])) {
219
-            $field['legend'] = $field['label'];
220
-            unset($field['label']);
221
-        } else {
222
-            $field['is_valid'] = false;
223
-            glsr_log()->warning('Setting field is missing a label')->debug($field);
224
-        }
225
-        return $field;
226
-    }
227
-
228
-    /**
229
-     * @return array
230
-     */
231
-    protected function normalizeValue(array $field)
232
-    {
233
-        if (!isset($field['value'])) {
234
-            $field['value'] = glsr(OptionManager::class)->get(
235
-                $field['name'],
236
-                $this->getFieldDefault($field)
237
-            );
238
-        }
239
-        return $field;
240
-    }
241
-
242
-    /**
243
-     * @return string
244
-     */
245
-    protected function normalizeSettingPath($path)
246
-    {
247
-        return Str::prefix('settings.', rtrim($path, '.'));
248
-    }
14
+	/**
15
+	 * @var array
16
+	 */
17
+	public $settings;
18
+
19
+	/**
20
+	 * @param string $id
21
+	 * @return string
22
+	 */
23
+	public function buildFields($id)
24
+	{
25
+		$this->settings = glsr(DefaultsManager::class)->settings();
26
+		$method = Helper::buildMethodName($id, 'getTemplateDataFor');
27
+		$data = !method_exists($this, $method)
28
+			? $this->getTemplateData($id)
29
+			: $this->$method($id);
30
+		return glsr(Template::class)->build('pages/settings/'.$id, $data);
31
+	}
32
+
33
+	/**
34
+	 * @return string
35
+	 */
36
+	protected function getFieldDefault(array $field)
37
+	{
38
+		return Arr::get($field, 'default');
39
+	}
40
+
41
+	/**
42
+	 * @return string
43
+	 */
44
+	protected function getFieldNameForDependsOn($path)
45
+	{
46
+		$fieldName = Str::convertPathToName($path, OptionManager::databaseKey());
47
+		return $this->isMultiDependency($path)
48
+			? $fieldName.'[]'
49
+			: $fieldName;
50
+	}
51
+
52
+	/**
53
+	 * @return array
54
+	 */
55
+	protected function getSettingFields($path)
56
+	{
57
+		return array_filter($this->settings, function ($key) use ($path) {
58
+			return Str::startsWith($path, $key);
59
+		}, ARRAY_FILTER_USE_KEY);
60
+	}
61
+
62
+	/**
63
+	 * @return string
64
+	 */
65
+	protected function getSettingRows(array $fields)
66
+	{
67
+		$rows = '';
68
+		foreach ($fields as $name => $field) {
69
+			$field = wp_parse_args($field, [
70
+				'is_setting' => true,
71
+				'name' => $name,
72
+			]);
73
+			$rows.= new Field($this->normalize($field));
74
+		}
75
+		return $rows;
76
+	}
77
+
78
+	/**
79
+	 * @param string $id
80
+	 * @return array
81
+	 */
82
+	protected function getTemplateData($id)
83
+	{
84
+		$fields = $this->getSettingFields($this->normalizeSettingPath($id));
85
+		return [
86
+			'context' => [
87
+				'rows' => $this->getSettingRows($fields),
88
+			],
89
+		];
90
+	}
91
+
92
+	/**
93
+	 * @param string $id
94
+	 * @return array
95
+	 */
96
+	protected function getTemplateDataForAddons($id)
97
+	{
98
+		$fields = $this->getSettingFields($this->normalizeSettingPath($id));
99
+		$settings = Arr::convertFromDotNotation($fields);
100
+		$settingKeys = array_keys($settings['settings']['addons']);
101
+		$results = [];
102
+		foreach ($settingKeys as $key) {
103
+			$addonFields = array_filter($fields, function ($path) use ($key) {
104
+				return Str::startsWith('settings.addons.'.$key, $path);
105
+			}, ARRAY_FILTER_USE_KEY);
106
+			$results[$key] = $this->getSettingRows($addonFields);
107
+		}
108
+		ksort($results);
109
+		return [
110
+			'settings' => $results,
111
+		];
112
+	}
113
+
114
+	/**
115
+	 * @param string $id
116
+	 * @return array
117
+	 */
118
+	protected function getTemplateDataForLicenses($id)
119
+	{
120
+		$fields = $this->getSettingFields($this->normalizeSettingPath($id));
121
+		ksort($fields);
122
+		return [
123
+			'context' => [
124
+				'rows' => $this->getSettingRows($fields),
125
+			],
126
+		];
127
+	}
128
+
129
+	/**
130
+	 * @return array
131
+	 */
132
+	protected function getTemplateDataForTranslations()
133
+	{
134
+		$translations = glsr(Translation::class)->renderAll();
135
+		$class = empty($translations)
136
+			? 'glsr-hidden'
137
+			: '';
138
+		return [
139
+			'context' => [
140
+				'class' => $class,
141
+				'database_key' => OptionManager::databaseKey(),
142
+				'translations' => $translations,
143
+			],
144
+		];
145
+	}
146
+
147
+	/**
148
+	 * @param string $path
149
+	 * @param string|array $expectedValue
150
+	 * @return bool
151
+	 */
152
+	protected function isFieldHidden($path, $expectedValue)
153
+	{
154
+		$optionValue = glsr(OptionManager::class)->get(
155
+			$path,
156
+			Arr::get(glsr()->defaults, $path)
157
+		);
158
+		if (is_array($expectedValue)) {
159
+			return is_array($optionValue)
160
+				? 0 === count(array_intersect($optionValue, $expectedValue))
161
+				: !in_array($optionValue, $expectedValue);
162
+		}
163
+		return $optionValue != $expectedValue;
164
+	}
165
+
166
+	/**
167
+	 * @return bool
168
+	 */
169
+	protected function isMultiDependency($path)
170
+	{
171
+		if (isset($this->settings[$path])) {
172
+			$field = $this->settings[$path];
173
+			return ('checkbox' == $field['type'] && !empty($field['options']))
174
+				|| !empty($field['multiple']);
175
+		}
176
+		return false;
177
+	}
178
+
179
+	/**
180
+	 * @return array
181
+	 */
182
+	protected function normalize(array $field)
183
+	{
184
+		$field = $this->normalizeDependsOn($field);
185
+		$field = $this->normalizeLabelAndLegend($field);
186
+		$field = $this->normalizeValue($field);
187
+		return $field;
188
+	}
189
+
190
+	/**
191
+	 * @return array
192
+	 */
193
+	protected function normalizeDependsOn(array $field)
194
+	{
195
+		if (!empty($field['depends_on']) && is_array($field['depends_on'])) {
196
+			$isFieldHidden = false;
197
+			$conditions = [];
198
+			foreach ($field['depends_on'] as $path => $value) {
199
+				$conditions[] = [
200
+					'name' => $this->getFieldNameForDependsOn($path),
201
+					'value' => $value,
202
+				];
203
+				if ($this->isFieldHidden($path, $value)) {
204
+					$isFieldHidden = true;
205
+				}
206
+			}
207
+			$field['data-depends'] = json_encode($conditions, JSON_HEX_APOS | JSON_HEX_QUOT);
208
+			$field['is_hidden'] = $isFieldHidden;
209
+		}
210
+		return $field;
211
+	}
212
+
213
+	/**
214
+	 * @return array
215
+	 */
216
+	protected function normalizeLabelAndLegend(array $field)
217
+	{
218
+		if (!empty($field['label'])) {
219
+			$field['legend'] = $field['label'];
220
+			unset($field['label']);
221
+		} else {
222
+			$field['is_valid'] = false;
223
+			glsr_log()->warning('Setting field is missing a label')->debug($field);
224
+		}
225
+		return $field;
226
+	}
227
+
228
+	/**
229
+	 * @return array
230
+	 */
231
+	protected function normalizeValue(array $field)
232
+	{
233
+		if (!isset($field['value'])) {
234
+			$field['value'] = glsr(OptionManager::class)->get(
235
+				$field['name'],
236
+				$this->getFieldDefault($field)
237
+			);
238
+		}
239
+		return $field;
240
+	}
241
+
242
+	/**
243
+	 * @return string
244
+	 */
245
+	protected function normalizeSettingPath($path)
246
+	{
247
+		return Str::prefix('settings.', rtrim($path, '.'));
248
+	}
249 249
 }
Please login to merge, or discard this patch.
plugin/Modules/Html/Form.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -4,36 +4,36 @@
 block discarded – undo
4 4
 
5 5
 class Form
6 6
 {
7
-    /**
8
-     * @param string $id
9
-     * @return string
10
-     */
11
-    public function buildFields($id)
12
-    {
13
-        return array_reduce($this->getFields($id), function ($carry, $field) {
14
-            return $carry.$field;
15
-        });
16
-    }
7
+	/**
8
+	 * @param string $id
9
+	 * @return string
10
+	 */
11
+	public function buildFields($id)
12
+	{
13
+		return array_reduce($this->getFields($id), function ($carry, $field) {
14
+			return $carry.$field;
15
+		});
16
+	}
17 17
 
18
-    /**
19
-     * @param string $id
20
-     * @return array
21
-     */
22
-    public function getFields($id)
23
-    {
24
-        $fields = [];
25
-        foreach (glsr()->config('forms/'.$id) as $name => $field) {
26
-            $fields[] = new Field(wp_parse_args($field, ['name' => $name]));
27
-        }
28
-        return $fields;
29
-    }
18
+	/**
19
+	 * @param string $id
20
+	 * @return array
21
+	 */
22
+	public function getFields($id)
23
+	{
24
+		$fields = [];
25
+		foreach (glsr()->config('forms/'.$id) as $name => $field) {
26
+			$fields[] = new Field(wp_parse_args($field, ['name' => $name]));
27
+		}
28
+		return $fields;
29
+	}
30 30
 
31
-    /**
32
-     * @param string $id
33
-     * @return void
34
-     */
35
-    public function renderFields($id)
36
-    {
37
-        echo $this->buildFields($id);
38
-    }
31
+	/**
32
+	 * @param string $id
33
+	 * @return void
34
+	 */
35
+	public function renderFields($id)
36
+	{
37
+		echo $this->buildFields($id);
38
+	}
39 39
 }
Please login to merge, or discard this patch.
plugin/Modules/Console.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -415,7 +415,8 @@
 block discarded – undo
415 415
     {
416 416
         if ($value instanceof DateTime) {
417 417
             $value = $value->format('Y-m-d H:i:s');
418
-        } elseif ($this->isObjectOrArray($value)) {
418
+        }
419
+        elseif ($this->isObjectOrArray($value)) {
419 420
             $value = json_encode($value);
420 421
         }
421 422
         return (string) $value;
Please login to merge, or discard this patch.
Indentation   +346 added lines, -346 removed lines patch added patch discarded remove patch
@@ -21,377 +21,377 @@
 block discarded – undo
21 21
  */
22 22
 class Console
23 23
 {
24
-    const DEBUG = 0;      // Detailed debug information
25
-    const INFO = 1;       // Interesting events
26
-    const NOTICE = 2;     // Normal but significant events
27
-    const WARNING = 4;    // Exceptional occurrences that are not errors
28
-    const ERROR = 8;      // Runtime errors that do not require immediate action
29
-    const CRITICAL = 16;  // Critical conditions
30
-    const ALERT = 32;     // Action must be taken immediately
31
-    const EMERGENCY = 64; // System is unusable
24
+	const DEBUG = 0;      // Detailed debug information
25
+	const INFO = 1;       // Interesting events
26
+	const NOTICE = 2;     // Normal but significant events
27
+	const WARNING = 4;    // Exceptional occurrences that are not errors
28
+	const ERROR = 8;      // Runtime errors that do not require immediate action
29
+	const CRITICAL = 16;  // Critical conditions
30
+	const ALERT = 32;     // Action must be taken immediately
31
+	const EMERGENCY = 64; // System is unusable
32 32
 
33
-    protected $file;
34
-    protected $log;
35
-    protected $logOnceKey = 'glsr_log_once';
33
+	protected $file;
34
+	protected $log;
35
+	protected $logOnceKey = 'glsr_log_once';
36 36
 
37
-    public function __construct()
38
-    {
39
-        $this->setLogFile();
40
-        $this->reset();
41
-    }
37
+	public function __construct()
38
+	{
39
+		$this->setLogFile();
40
+		$this->reset();
41
+	}
42 42
 
43
-    public function __call($method, $args)
44
-    {
45
-        $constant = 'static::'.strtoupper($method);
46
-        if (defined($constant)) {
47
-            $args = Arr::prepend($args, constant($constant));
48
-            return call_user_func_array([$this, 'log'], array_slice($args, 0, 3));
49
-        }
50
-        throw new BadMethodCallException("Method [$method] does not exist.");
51
-    }
43
+	public function __call($method, $args)
44
+	{
45
+		$constant = 'static::'.strtoupper($method);
46
+		if (defined($constant)) {
47
+			$args = Arr::prepend($args, constant($constant));
48
+			return call_user_func_array([$this, 'log'], array_slice($args, 0, 3));
49
+		}
50
+		throw new BadMethodCallException("Method [$method] does not exist.");
51
+	}
52 52
 
53
-    /**
54
-     * @return string
55
-     */
56
-    public function __toString()
57
-    {
58
-        return $this->get();
59
-    }
53
+	/**
54
+	 * @return string
55
+	 */
56
+	public function __toString()
57
+	{
58
+		return $this->get();
59
+	}
60 60
 
61
-    /**
62
-     * @return void
63
-     */
64
-    public function clear()
65
-    {
66
-        $this->log = '';
67
-        file_put_contents($this->file, $this->log);
68
-    }
61
+	/**
62
+	 * @return void
63
+	 */
64
+	public function clear()
65
+	{
66
+		$this->log = '';
67
+		file_put_contents($this->file, $this->log);
68
+	}
69 69
 
70
-    /**
71
-     * @return string
72
-     */
73
-    public function get()
74
-    {
75
-        return empty($this->log)
76
-            ? _x('Console is empty', 'admin-text', 'site-reviews')
77
-            : $this->log;
78
-    }
70
+	/**
71
+	 * @return string
72
+	 */
73
+	public function get()
74
+	{
75
+		return empty($this->log)
76
+			? _x('Console is empty', 'admin-text', 'site-reviews')
77
+			: $this->log;
78
+	}
79 79
 
80
-    /**
81
-     * @return int
82
-     */
83
-    public function getLevel()
84
-    {
85
-        return glsr()->filterInt('console/level', static::INFO);
86
-    }
80
+	/**
81
+	 * @return int
82
+	 */
83
+	public function getLevel()
84
+	{
85
+		return glsr()->filterInt('console/level', static::INFO);
86
+	}
87 87
 
88
-    /**
89
-     * @return array
90
-     */
91
-    public function getLevels()
92
-    {
93
-        $constants = (new ReflectionClass(__CLASS__))->getConstants();
94
-        return array_map('strtolower', array_flip($constants));
95
-    }
88
+	/**
89
+	 * @return array
90
+	 */
91
+	public function getLevels()
92
+	{
93
+		$constants = (new ReflectionClass(__CLASS__))->getConstants();
94
+		return array_map('strtolower', array_flip($constants));
95
+	}
96 96
 
97
-    /**
98
-     * @return string
99
-     */
100
-    public function humanLevel()
101
-    {
102
-        $level = $this->getLevel();
103
-        return sprintf('%s (%d)', strtoupper(Arr::get($this->getLevels(), $level, 'unknown')), $level);
104
-    }
97
+	/**
98
+	 * @return string
99
+	 */
100
+	public function humanLevel()
101
+	{
102
+		$level = $this->getLevel();
103
+		return sprintf('%s (%d)', strtoupper(Arr::get($this->getLevels(), $level, 'unknown')), $level);
104
+	}
105 105
 
106
-    /**
107
-     * @param string|null $valueIfEmpty
108
-     * @return string
109
-     */
110
-    public function humanSize($valueIfEmpty = null)
111
-    {
112
-        $bytes = $this->size();
113
-        if (empty($bytes) && is_string($valueIfEmpty)) {
114
-            return $valueIfEmpty;
115
-        }
116
-        $exponent = floor(log(max($bytes, 1), 1024));
117
-        return round($bytes / pow(1024, $exponent), 2).' '.['bytes', 'KB', 'MB', 'GB'][$exponent];
118
-    }
106
+	/**
107
+	 * @param string|null $valueIfEmpty
108
+	 * @return string
109
+	 */
110
+	public function humanSize($valueIfEmpty = null)
111
+	{
112
+		$bytes = $this->size();
113
+		if (empty($bytes) && is_string($valueIfEmpty)) {
114
+			return $valueIfEmpty;
115
+		}
116
+		$exponent = floor(log(max($bytes, 1), 1024));
117
+		return round($bytes / pow(1024, $exponent), 2).' '.['bytes', 'KB', 'MB', 'GB'][$exponent];
118
+	}
119 119
 
120
-    /**
121
-     * @param int $level
122
-     * @param mixed $message
123
-     * @param array $context
124
-     * @param string $backtraceLine
125
-     * @return static
126
-     */
127
-    public function log($level, $message, $context = [], $backtraceLine = '')
128
-    {
129
-        if (empty($backtraceLine)) {
130
-            $backtraceLine = $this->getBacktraceLine();
131
-        }
132
-        if ($this->canLogEntry($level, $backtraceLine)) {
133
-            $levelName = Arr::get($this->getLevels(), $level);
134
-            $context = Arr::consolidate($context);
135
-            $backtraceLine = $this->normalizeBacktraceLine($backtraceLine);
136
-            $message = $this->interpolate($message, $context);
137
-            $entry = $this->buildLogEntry($levelName, $message, $backtraceLine);
138
-            file_put_contents($this->file, $entry.PHP_EOL, FILE_APPEND | LOCK_EX);
139
-            apply_filters('console', $message, $levelName, $backtraceLine); // Show in Blackbar plugin if installed
140
-            $this->reset();
141
-        }
142
-        return $this;
143
-    }
120
+	/**
121
+	 * @param int $level
122
+	 * @param mixed $message
123
+	 * @param array $context
124
+	 * @param string $backtraceLine
125
+	 * @return static
126
+	 */
127
+	public function log($level, $message, $context = [], $backtraceLine = '')
128
+	{
129
+		if (empty($backtraceLine)) {
130
+			$backtraceLine = $this->getBacktraceLine();
131
+		}
132
+		if ($this->canLogEntry($level, $backtraceLine)) {
133
+			$levelName = Arr::get($this->getLevels(), $level);
134
+			$context = Arr::consolidate($context);
135
+			$backtraceLine = $this->normalizeBacktraceLine($backtraceLine);
136
+			$message = $this->interpolate($message, $context);
137
+			$entry = $this->buildLogEntry($levelName, $message, $backtraceLine);
138
+			file_put_contents($this->file, $entry.PHP_EOL, FILE_APPEND | LOCK_EX);
139
+			apply_filters('console', $message, $levelName, $backtraceLine); // Show in Blackbar plugin if installed
140
+			$this->reset();
141
+		}
142
+		return $this;
143
+	}
144 144
 
145
-    /**
146
-     * @return void
147
-     */
148
-    public function logOnce()
149
-    {
150
-        $once = Arr::consolidate(glsr()->{$this->logOnceKey});
151
-        $levels = $this->getLevels();
152
-        foreach ($once as $entry) {
153
-            $levelName = Arr::get($entry, 'level');
154
-            if (!in_array($levelName, $levels)) {
155
-                continue;
156
-            }
157
-            $level = Arr::get(array_flip($levels), $levelName);
158
-            $message = Arr::get($entry, 'message');
159
-            $backtraceLine = Arr::get($entry, 'backtrace');
160
-            $this->log($level, $message, [], $backtraceLine);
161
-        }
162
-        glsr()->{$this->logOnceKey} = [];
163
-    }
145
+	/**
146
+	 * @return void
147
+	 */
148
+	public function logOnce()
149
+	{
150
+		$once = Arr::consolidate(glsr()->{$this->logOnceKey});
151
+		$levels = $this->getLevels();
152
+		foreach ($once as $entry) {
153
+			$levelName = Arr::get($entry, 'level');
154
+			if (!in_array($levelName, $levels)) {
155
+				continue;
156
+			}
157
+			$level = Arr::get(array_flip($levels), $levelName);
158
+			$message = Arr::get($entry, 'message');
159
+			$backtraceLine = Arr::get($entry, 'backtrace');
160
+			$this->log($level, $message, [], $backtraceLine);
161
+		}
162
+		glsr()->{$this->logOnceKey} = [];
163
+	}
164 164
 
165
-    /**
166
-     * @param string $levelName
167
-     * @param string $handle
168
-     * @param mixed $data
169
-     * @return void
170
-     */
171
-    public function once($levelName, $handle, $data)
172
-    {
173
-        $once = Arr::consolidate(glsr()->{$this->logOnceKey});
174
-        $filtered = array_filter($once, function ($entry) use ($levelName, $handle) {
175
-            return Arr::get($entry, 'level') == $levelName
176
-                && Arr::get($entry, 'handle') == $handle;
177
-        });
178
-        if (!empty($filtered)) {
179
-            return;
180
-        }
181
-        $once[] = [
182
-            'backtrace' => $this->getBacktraceLineFromData($data),
183
-            'handle' => $handle,
184
-            'level' => $levelName,
185
-            'message' => '[RECURRING] '.$this->getMessageFromData($data),
186
-        ];
187
-        glsr()->{$this->logOnceKey} = $once;
188
-    }
165
+	/**
166
+	 * @param string $levelName
167
+	 * @param string $handle
168
+	 * @param mixed $data
169
+	 * @return void
170
+	 */
171
+	public function once($levelName, $handle, $data)
172
+	{
173
+		$once = Arr::consolidate(glsr()->{$this->logOnceKey});
174
+		$filtered = array_filter($once, function ($entry) use ($levelName, $handle) {
175
+			return Arr::get($entry, 'level') == $levelName
176
+				&& Arr::get($entry, 'handle') == $handle;
177
+		});
178
+		if (!empty($filtered)) {
179
+			return;
180
+		}
181
+		$once[] = [
182
+			'backtrace' => $this->getBacktraceLineFromData($data),
183
+			'handle' => $handle,
184
+			'level' => $levelName,
185
+			'message' => '[RECURRING] '.$this->getMessageFromData($data),
186
+		];
187
+		glsr()->{$this->logOnceKey} = $once;
188
+	}
189 189
 
190
-    /**
191
-     * @return int
192
-     */
193
-    public function size()
194
-    {
195
-        return file_exists($this->file)
196
-            ? filesize($this->file)
197
-            : 0;
198
-    }
190
+	/**
191
+	 * @return int
192
+	 */
193
+	public function size()
194
+	{
195
+		return file_exists($this->file)
196
+			? filesize($this->file)
197
+			: 0;
198
+	}
199 199
 
200
-    /**
201
-     * @param array $backtrace
202
-     * @param int $index
203
-     * @return string
204
-     */
205
-    protected function buildBacktraceLine($backtrace, $index)
206
-    {
207
-        return sprintf('%s:%s',
208
-            Arr::get($backtrace, $index.'.file'), // realpath
209
-            Arr::get($backtrace, $index.'.line')
210
-        );
211
-    }
200
+	/**
201
+	 * @param array $backtrace
202
+	 * @param int $index
203
+	 * @return string
204
+	 */
205
+	protected function buildBacktraceLine($backtrace, $index)
206
+	{
207
+		return sprintf('%s:%s',
208
+			Arr::get($backtrace, $index.'.file'), // realpath
209
+			Arr::get($backtrace, $index.'.line')
210
+		);
211
+	}
212 212
 
213
-    /**
214
-     * @param string $levelName
215
-     * @param mixed $message
216
-     * @param string $backtraceLine
217
-     * @return string
218
-     */
219
-    protected function buildLogEntry($levelName, $message, $backtraceLine = '')
220
-    {
221
-        return sprintf('[%s] %s [%s] %s',
222
-            current_time('mysql'),
223
-            strtoupper($levelName),
224
-            $backtraceLine,
225
-            $message
226
-        );
227
-    }
213
+	/**
214
+	 * @param string $levelName
215
+	 * @param mixed $message
216
+	 * @param string $backtraceLine
217
+	 * @return string
218
+	 */
219
+	protected function buildLogEntry($levelName, $message, $backtraceLine = '')
220
+	{
221
+		return sprintf('[%s] %s [%s] %s',
222
+			current_time('mysql'),
223
+			strtoupper($levelName),
224
+			$backtraceLine,
225
+			$message
226
+		);
227
+	}
228 228
 
229
-    /**
230
-     * @param int $level
231
-     * @return bool
232
-     */
233
-    protected function canLogEntry($level, $backtraceLine)
234
-    {
235
-        $levelExists = array_key_exists($level, $this->getLevels());
236
-        if (!Str::contains($backtraceLine, glsr()->path())) {
237
-            return $levelExists; // ignore level restriction if triggered outside of the plugin
238
-        }
239
-        return $levelExists && $level >= $this->getLevel();
240
-    }
229
+	/**
230
+	 * @param int $level
231
+	 * @return bool
232
+	 */
233
+	protected function canLogEntry($level, $backtraceLine)
234
+	{
235
+		$levelExists = array_key_exists($level, $this->getLevels());
236
+		if (!Str::contains($backtraceLine, glsr()->path())) {
237
+			return $levelExists; // ignore level restriction if triggered outside of the plugin
238
+		}
239
+		return $levelExists && $level >= $this->getLevel();
240
+	}
241 241
 
242
-    /**
243
-     * @return void|string
244
-     */
245
-    protected function getBacktraceLine()
246
-    {
247
-        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 6);
248
-        $search = array_search('glsr_log', wp_list_pluck($backtrace, 'function'));
249
-        if (false !== $search) {
250
-            return $this->buildBacktraceLine($backtrace, (int) $search);
251
-        }
252
-        $search = array_search('log', wp_list_pluck($backtrace, 'function'));
253
-        if (false !== $search) {
254
-            $index = '{closure}' == Arr::get($backtrace, ($search + 2).'.function')
255
-                ? $search + 4
256
-                : $search + 1;
257
-            return $this->buildBacktraceLine($backtrace, $index);
258
-        }
259
-        return 'Unknown';
260
-    }
242
+	/**
243
+	 * @return void|string
244
+	 */
245
+	protected function getBacktraceLine()
246
+	{
247
+		$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 6);
248
+		$search = array_search('glsr_log', wp_list_pluck($backtrace, 'function'));
249
+		if (false !== $search) {
250
+			return $this->buildBacktraceLine($backtrace, (int) $search);
251
+		}
252
+		$search = array_search('log', wp_list_pluck($backtrace, 'function'));
253
+		if (false !== $search) {
254
+			$index = '{closure}' == Arr::get($backtrace, ($search + 2).'.function')
255
+				? $search + 4
256
+				: $search + 1;
257
+			return $this->buildBacktraceLine($backtrace, $index);
258
+		}
259
+		return 'Unknown';
260
+	}
261 261
 
262
-    /**
263
-     * @param mixed $data
264
-     * @return string
265
-     */
266
-    protected function getBacktraceLineFromData($data)
267
-    {
268
-        $backtrace = $data instanceof Throwable
269
-            ? $data->getTrace()
270
-            : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
271
-        return $this->buildBacktraceLine($backtrace, 0);
272
-    }
262
+	/**
263
+	 * @param mixed $data
264
+	 * @return string
265
+	 */
266
+	protected function getBacktraceLineFromData($data)
267
+	{
268
+		$backtrace = $data instanceof Throwable
269
+			? $data->getTrace()
270
+			: debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
271
+		return $this->buildBacktraceLine($backtrace, 0);
272
+	}
273 273
 
274
-    /**
275
-     * @param mixed $data
276
-     * @return string
277
-     */
278
-    protected function getMessageFromData($data)
279
-    {
280
-        return $data instanceof Throwable
281
-            ? $this->normalizeThrowableMessage($data->getMessage())
282
-            : print_r($data, 1);
283
-    }
274
+	/**
275
+	 * @param mixed $data
276
+	 * @return string
277
+	 */
278
+	protected function getMessageFromData($data)
279
+	{
280
+		return $data instanceof Throwable
281
+			? $this->normalizeThrowableMessage($data->getMessage())
282
+			: print_r($data, 1);
283
+	}
284 284
 
285
-    /**
286
-     * Interpolates context values into the message placeholders.
287
-     * @param mixed $message
288
-     * @param array $context
289
-     * @return string
290
-     */
291
-    protected function interpolate($message, $context = [])
292
-    {
293
-        if ($this->isObjectOrArray($message) || !is_array($context)) {
294
-            return print_r($message, true);
295
-        }
296
-        $replace = [];
297
-        foreach ($context as $key => $value) {
298
-            $replace['{'.$key.'}'] = $this->normalizeValue($value);
299
-        }
300
-        return strtr($message, $replace);
301
-    }
285
+	/**
286
+	 * Interpolates context values into the message placeholders.
287
+	 * @param mixed $message
288
+	 * @param array $context
289
+	 * @return string
290
+	 */
291
+	protected function interpolate($message, $context = [])
292
+	{
293
+		if ($this->isObjectOrArray($message) || !is_array($context)) {
294
+			return print_r($message, true);
295
+		}
296
+		$replace = [];
297
+		foreach ($context as $key => $value) {
298
+			$replace['{'.$key.'}'] = $this->normalizeValue($value);
299
+		}
300
+		return strtr($message, $replace);
301
+	}
302 302
 
303
-    /**
304
-     * @param mixed $value
305
-     * @return bool
306
-     */
307
-    protected function isObjectOrArray($value)
308
-    {
309
-        return is_object($value) || is_array($value);
310
-    }
303
+	/**
304
+	 * @param mixed $value
305
+	 * @return bool
306
+	 */
307
+	protected function isObjectOrArray($value)
308
+	{
309
+		return is_object($value) || is_array($value);
310
+	}
311 311
 
312
-    /**
313
-     * @param string $backtraceLine
314
-     * @return string
315
-     */
316
-    protected function normalizeBacktraceLine($backtraceLine)
317
-    {
318
-        $search = [
319
-            glsr()->path('plugin/'),
320
-            glsr()->path('plugin/', false),
321
-            trailingslashit(glsr()->path()),
322
-            trailingslashit(glsr()->path('', false)),
323
-            WP_CONTENT_DIR,
324
-            ABSPATH,
325
-        ];
326
-        return str_replace(array_unique($search), '', $backtraceLine);
327
-    }
312
+	/**
313
+	 * @param string $backtraceLine
314
+	 * @return string
315
+	 */
316
+	protected function normalizeBacktraceLine($backtraceLine)
317
+	{
318
+		$search = [
319
+			glsr()->path('plugin/'),
320
+			glsr()->path('plugin/', false),
321
+			trailingslashit(glsr()->path()),
322
+			trailingslashit(glsr()->path('', false)),
323
+			WP_CONTENT_DIR,
324
+			ABSPATH,
325
+		];
326
+		return str_replace(array_unique($search), '', $backtraceLine);
327
+	}
328 328
 
329
-    /**
330
-     * @param string $message
331
-     * @return string
332
-     */
333
-    protected function normalizeThrowableMessage($message)
334
-    {
335
-        $calledIn = strpos($message, ', called in');
336
-        return false !== $calledIn
337
-            ? substr($message, 0, $calledIn)
338
-            : $message;
339
-    }
329
+	/**
330
+	 * @param string $message
331
+	 * @return string
332
+	 */
333
+	protected function normalizeThrowableMessage($message)
334
+	{
335
+		$calledIn = strpos($message, ', called in');
336
+		return false !== $calledIn
337
+			? substr($message, 0, $calledIn)
338
+			: $message;
339
+	}
340 340
 
341
-    /**
342
-     * @param mixed $value
343
-     * @return string
344
-     */
345
-    protected function normalizeValue($value)
346
-    {
347
-        if ($value instanceof DateTime) {
348
-            $value = $value->format('Y-m-d H:i:s');
349
-        } elseif ($this->isObjectOrArray($value)) {
350
-            $value = json_encode($value);
351
-        }
352
-        return (string) $value;
353
-    }
341
+	/**
342
+	 * @param mixed $value
343
+	 * @return string
344
+	 */
345
+	protected function normalizeValue($value)
346
+	{
347
+		if ($value instanceof DateTime) {
348
+			$value = $value->format('Y-m-d H:i:s');
349
+		} elseif ($this->isObjectOrArray($value)) {
350
+			$value = json_encode($value);
351
+		}
352
+		return (string) $value;
353
+	}
354 354
 
355
-    /**
356
-     * @return void
357
-     */
358
-    protected function reset()
359
-    {
360
-        if ($this->size() <= pow(1024, 2) / 4) {
361
-            return;
362
-        }
363
-        $this->clear();
364
-        file_put_contents(
365
-            $this->file,
366
-            $this->buildLogEntry(
367
-                static::NOTICE,
368
-                _x('Console was automatically cleared (256KB maximum size)', 'admin-text', 'site-reviews')
369
-            )
370
-        );
371
-    }
355
+	/**
356
+	 * @return void
357
+	 */
358
+	protected function reset()
359
+	{
360
+		if ($this->size() <= pow(1024, 2) / 4) {
361
+			return;
362
+		}
363
+		$this->clear();
364
+		file_put_contents(
365
+			$this->file,
366
+			$this->buildLogEntry(
367
+				static::NOTICE,
368
+				_x('Console was automatically cleared (256KB maximum size)', 'admin-text', 'site-reviews')
369
+			)
370
+		);
371
+	}
372 372
 
373
-    /**
374
-     * @return void
375
-     */
376
-    protected function setLogFile()
377
-    {
378
-        if (!function_exists('wp_hash')) {
379
-            require_once ABSPATH.WPINC.'/pluggable.php';
380
-        }
381
-        $uploads = wp_upload_dir();
382
-        $base = trailingslashit($uploads['basedir'].'/'.glsr()->id);
383
-        $this->file = $base.'logs/'.sanitize_file_name('console-'.wp_hash(glsr()->id).'.log');
384
-        $files = [
385
-            $base.'index.php' => '<?php',
386
-            $base.'logs/.htaccess' => 'deny from all',
387
-            $base.'logs/index.php' => '<?php',
388
-            $this->file => '',
389
-        ];
390
-        foreach ($files as $file => $contents) {
391
-            if (wp_mkdir_p(dirname($file)) && !file_exists($file)) {
392
-                file_put_contents($file, $contents);
393
-            }
394
-        }
395
-        $this->log = file_get_contents($this->file);
396
-    }
373
+	/**
374
+	 * @return void
375
+	 */
376
+	protected function setLogFile()
377
+	{
378
+		if (!function_exists('wp_hash')) {
379
+			require_once ABSPATH.WPINC.'/pluggable.php';
380
+		}
381
+		$uploads = wp_upload_dir();
382
+		$base = trailingslashit($uploads['basedir'].'/'.glsr()->id);
383
+		$this->file = $base.'logs/'.sanitize_file_name('console-'.wp_hash(glsr()->id).'.log');
384
+		$files = [
385
+			$base.'index.php' => '<?php',
386
+			$base.'logs/.htaccess' => 'deny from all',
387
+			$base.'logs/index.php' => '<?php',
388
+			$this->file => '',
389
+		];
390
+		foreach ($files as $file => $contents) {
391
+			if (wp_mkdir_p(dirname($file)) && !file_exists($file)) {
392
+				file_put_contents($file, $contents);
393
+			}
394
+		}
395
+		$this->log = file_get_contents($this->file);
396
+	}
397 397
 }
Please login to merge, or discard this patch.
plugin/Modules/Schema/Thing.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 block discarded – undo
19 19
  */
20 20
 class Thing extends BaseType
21 21
 {
22
-    /**
23
-     * @var array
24
-     * @see http://schema.org/{property_name}
25
-     */
26
-    public $allowed = [
27
-        'additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier',
28
-        'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'url',
29
-    ];
22
+	/**
23
+	 * @var array
24
+	 * @see http://schema.org/{property_name}
25
+	 */
26
+	public $allowed = [
27
+		'additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier',
28
+		'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'url',
29
+	];
30 30
 }
Please login to merge, or discard this patch.
plugin/Modules/Schema/UnknownType.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,19 +4,19 @@
 block discarded – undo
4 4
 
5 5
 class UnknownType extends BaseType
6 6
 {
7
-    /**
8
-     * @var array
9
-     * @see http://schema.org/{property_name}
10
-     */
11
-    public $allowed = [
12
-        'aggregateRating',
13
-    ];
7
+	/**
8
+	 * @var array
9
+	 * @see http://schema.org/{property_name}
10
+	 */
11
+	public $allowed = [
12
+		'aggregateRating',
13
+	];
14 14
 
15
-    /**
16
-     * @var array
17
-     * @see http://schema.org/{property_name}
18
-     */
19
-    public $parents = [
20
-        'Thing',
21
-    ];
15
+	/**
16
+	 * @var array
17
+	 * @see http://schema.org/{property_name}
18
+	 */
19
+	public $parents = [
20
+		'Thing',
21
+	];
22 22
 }
Please login to merge, or discard this patch.
plugin/Modules/Schema/Type.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -4,22 +4,22 @@
 block discarded – undo
4 4
 
5 5
 interface Type
6 6
 {
7
-    /**
8
-     * Return an array representation of the type. If the array contains child types,
9
-     * their context needs to be stripped if it's the same.
10
-     * @return array
11
-     */
12
-    public function toArray();
7
+	/**
8
+	 * Return an array representation of the type. If the array contains child types,
9
+	 * their context needs to be stripped if it's the same.
10
+	 * @return array
11
+	 */
12
+	public function toArray();
13 13
 
14
-    /**
15
-     * Create a json-ld script tag for this type, built from the data that `toArray` returns.
16
-     * @return string
17
-     */
18
-    public function toScript();
14
+	/**
15
+	 * Create a json-ld script tag for this type, built from the data that `toArray` returns.
16
+	 * @return string
17
+	 */
18
+	public function toScript();
19 19
 
20
-    /**
21
-     * Create a json-ld script tag for this type, built from the data that `toArray` returns.
22
-     * @return string
23
-     */
24
-    public function __toString();
20
+	/**
21
+	 * Create a json-ld script tag for this type, built from the data that `toArray` returns.
22
+	 * @return string
23
+	 */
24
+	public function __toString();
25 25
 }
Please login to merge, or discard this patch.
plugin/Modules/Schema/Organization.php 1 patch
Indentation   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -57,166 +57,166 @@
 block discarded – undo
57 57
  */
58 58
 class Organization extends BaseType
59 59
 {
60
-    /**
61
-     * The schema.org Actions mechanism benefited from extensive discussions across the Web
62
-     * standards community around W3C, in particular from the [Hydra project](http://purl.org/hydra/)
63
-     * community group.
64
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass
65
-     */
66
-    const ActionCollabClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass';
67
-
68
-    /**
69
-     * This element is based on the work of the Automotive Ontology Working Group,
70
-     * see [www.automotive-ontology.org](http://www.automotive-ontology.org) for details.
71
-     * Many class and property definitions are inspired by or based on abstracts from Wikipedia,
72
-     * the free encyclopedia.
73
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group
74
-     */
75
-    const AutomotiveOntologyWGClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group';
76
-
77
-    /**
78
-     * The W3C [Schema Bib Extend](http://www.w3.org/community/schemabibex/) (BibEx) group led the
79
-     * work to improve schema.org for bibliographic information, including terms for periodicals,
80
-     * articles and multi-volume works. The design was inspired in places (e.g. [[pageStart]],
81
-     * [[pageEnd]], [[pagination]]) by the [Bibliographic Ontology](http://bibliontology.com/),
82
-     * 'bibo'.
83
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex
84
-     */
85
-    const BibExTerm = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex';
86
-
87
-    /**
88
-     * This class is based upon W3C DCAT work, and benefits from collaboration around the DCAT, ADMS
89
-     * and VoID vocabularies. See http://www.w3.org/wiki/WebSchemas/Datasets for full details and
90
-     * mappings.
91
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass
92
-     */
93
-    const DatasetClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass';
94
-
95
-    /**
96
-     * This element is based on the work of the Financial Industry Business Ontology project (see
97
-     * [http://www.fibo.org/schema](http://www.fibo.org/schema) for details), in support of the W3C
98
-     * Financial Industry Business Ontology Community Group
99
-     * ([http://www.fibo.org/community](http://www.fibo.org/community)). Many class and property
100
-     * definitions are inspired by or based on [http://www.fibo.org](http://www.fibo.org).
101
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO
102
-     */
103
-    const FIBO = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO';
104
-
105
-    /**
106
-     * The implementation and use of Legal Entity Identifier (LEI) is supported by Global Legal
107
-     * Entity Identifier Foundation [https://www.gleif.org](https://www.gleif.org).
108
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF
109
-     */
110
-    const GLEIF = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF';
111
-
112
-    /**
113
-     * This class is derived from the GoodRelations Vocabulary for E-Commerce, created by Martin
114
-     * Hepp. GoodRelations is a data model for sharing e-commerce data on the Web that can be
115
-     * expressed in a variety of syntaxes, including RDFa and HTML5 Microdata. More information
116
-     * about GoodRelations can be found at
117
-     * [http://purl.org/goodrelations/](http://purl.org/goodrelations/).
118
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass
119
-     */
120
-    const GoodRelationsClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass';
121
-
122
-    /**
123
-     * This term [uses](http://blog.schema.org/2012/11/good-relations-and-schemaorg.html)
124
-     * terminology from the GoodRelations Vocabulary for E-Commerce, created by Martin Hepp.
125
-     * GoodRelations is a data model for sharing e-commerce data on the Web. More information about
126
-     * GoodRelations can be found at
127
-     * [http://purl.org/goodrelations/](http://purl.org/goodrelations/).
128
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms
129
-     */
130
-    const GoodRelationsTerms = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms';
131
-
132
-    /**
133
-     * This element is based on work by the Web Applications for the Future Internet Lab, Institute
134
-     * of Informatics and Telematics, Pisa, Italy.
135
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it
136
-     */
137
-    const IITCNRit = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it';
138
-
139
-    /**
140
-     * This class is based on the work of the LRMI project, see lrmi.net for details.
141
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass
142
-     */
143
-    const LRMIClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass';
144
-
145
-    /**
146
-     * This vocabulary was improved through collaboration with the MusicBrainz project
147
-     *     ([www.musicbrainz.org](http://www.musicbrainz.org)), and is partially inspired by the
148
-     * MusicBrainz and
149
-     *     [Music Ontology](http://musicontology.com/docs/getting-started.html) schemas.
150
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ
151
-     */
152
-    const MBZ = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ';
153
-
154
-    /**
155
-     * This element is based on the STI Accommodation Ontology, see <a
156
-     * href="http://ontologies.sti-innsbruck.at/acco/ns.html">http://ontologies.sti-innsbruck.at/acco/ns.html</a>
157
-     * for details.
158
-     *     Many class and property definitions are inspired by or based on abstracts from Wikipedia,
159
-     * the free encyclopedia.
160
-     * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology
161
-     */
162
-    const STI_Accommodation_Ontology = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology';
163
-
164
-    /**
165
-     * The Question/Answer types were [based
166
-     * on](https://www.w3.org/wiki/WebSchemas/QASchemaResearch) the Stack Overflow API.
167
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange
168
-     */
169
-    const Stack_Exchange = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange';
170
-
171
-    /**
172
-     * This term and associated definitions draws upon the work of [The Trust
173
-     * Project](http://thetrustproject.org/).
174
-     * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws
175
-     */
176
-    const The_Trust_Project = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws';
177
-
178
-    /**
179
-     * This element is based on the work of the [Tourism Structured Web Data Community
180
-     * Group](https://www.w3.org/community/tourismdata).
181
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism
182
-     */
183
-    const Tourism = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism';
184
-
185
-    /**
186
-     * This class contains information contributed by
187
-     * [http://wikidoc.org>WikiDoc](http://wikidoc.org>WikiDoc).
188
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc
189
-     */
190
-    const WikiDoc = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc';
191
-
192
-    /**
193
-     * This class contains derivatives of IPTC rNews properties. rNews is a data model of publishing
194
-     * metadata with serializations currently available for RDFa as well as HTML5 Microdata. More
195
-     * information about the IPTC and rNews can be found at [rnews.org](http://rnews.org).
196
-     * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews
197
-     */
198
-    const rNews = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews';
199
-
200
-    /**
201
-     * @var array
202
-     * @see http://schema.org/{property_name}
203
-     */
204
-    public $allowed = [
205
-        'address', 'aggregateRating', 'areaServed', 'award', 'awards', 'brand', 'contactPoint',
206
-        'contactPoints', 'department', 'dissolutionDate', 'duns', 'email', 'employee', 'employees',
207
-        'event', 'events', 'faxNumber', 'founder', 'founders', 'foundingDate', 'foundingLocation',
208
-        'funder', 'globalLocationNumber', 'hasOfferCatalog', 'hasPOS', 'isicV4', 'legalName',
209
-        'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'members', 'naics',
210
-        'numberOfEmployees', 'offeredBy', 'owns', 'parentOrganization', 'publishingPrinciples',
211
-        'review', 'reviews', 'seeks', 'serviceArea', 'sponsor', 'subOrganization', 'taxID',
212
-        'telephone', 'vatID',
213
-    ];
214
-
215
-    /**
216
-     * @var array
217
-     * @see http://schema.org/{property_name}
218
-     */
219
-    public $parents = [
220
-        'Thing',
221
-    ];
60
+	/**
61
+	 * The schema.org Actions mechanism benefited from extensive discussions across the Web
62
+	 * standards community around W3C, in particular from the [Hydra project](http://purl.org/hydra/)
63
+	 * community group.
64
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass
65
+	 */
66
+	const ActionCollabClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass';
67
+
68
+	/**
69
+	 * This element is based on the work of the Automotive Ontology Working Group,
70
+	 * see [www.automotive-ontology.org](http://www.automotive-ontology.org) for details.
71
+	 * Many class and property definitions are inspired by or based on abstracts from Wikipedia,
72
+	 * the free encyclopedia.
73
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group
74
+	 */
75
+	const AutomotiveOntologyWGClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group';
76
+
77
+	/**
78
+	 * The W3C [Schema Bib Extend](http://www.w3.org/community/schemabibex/) (BibEx) group led the
79
+	 * work to improve schema.org for bibliographic information, including terms for periodicals,
80
+	 * articles and multi-volume works. The design was inspired in places (e.g. [[pageStart]],
81
+	 * [[pageEnd]], [[pagination]]) by the [Bibliographic Ontology](http://bibliontology.com/),
82
+	 * 'bibo'.
83
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex
84
+	 */
85
+	const BibExTerm = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex';
86
+
87
+	/**
88
+	 * This class is based upon W3C DCAT work, and benefits from collaboration around the DCAT, ADMS
89
+	 * and VoID vocabularies. See http://www.w3.org/wiki/WebSchemas/Datasets for full details and
90
+	 * mappings.
91
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass
92
+	 */
93
+	const DatasetClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass';
94
+
95
+	/**
96
+	 * This element is based on the work of the Financial Industry Business Ontology project (see
97
+	 * [http://www.fibo.org/schema](http://www.fibo.org/schema) for details), in support of the W3C
98
+	 * Financial Industry Business Ontology Community Group
99
+	 * ([http://www.fibo.org/community](http://www.fibo.org/community)). Many class and property
100
+	 * definitions are inspired by or based on [http://www.fibo.org](http://www.fibo.org).
101
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO
102
+	 */
103
+	const FIBO = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO';
104
+
105
+	/**
106
+	 * The implementation and use of Legal Entity Identifier (LEI) is supported by Global Legal
107
+	 * Entity Identifier Foundation [https://www.gleif.org](https://www.gleif.org).
108
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF
109
+	 */
110
+	const GLEIF = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF';
111
+
112
+	/**
113
+	 * This class is derived from the GoodRelations Vocabulary for E-Commerce, created by Martin
114
+	 * Hepp. GoodRelations is a data model for sharing e-commerce data on the Web that can be
115
+	 * expressed in a variety of syntaxes, including RDFa and HTML5 Microdata. More information
116
+	 * about GoodRelations can be found at
117
+	 * [http://purl.org/goodrelations/](http://purl.org/goodrelations/).
118
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass
119
+	 */
120
+	const GoodRelationsClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass';
121
+
122
+	/**
123
+	 * This term [uses](http://blog.schema.org/2012/11/good-relations-and-schemaorg.html)
124
+	 * terminology from the GoodRelations Vocabulary for E-Commerce, created by Martin Hepp.
125
+	 * GoodRelations is a data model for sharing e-commerce data on the Web. More information about
126
+	 * GoodRelations can be found at
127
+	 * [http://purl.org/goodrelations/](http://purl.org/goodrelations/).
128
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms
129
+	 */
130
+	const GoodRelationsTerms = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms';
131
+
132
+	/**
133
+	 * This element is based on work by the Web Applications for the Future Internet Lab, Institute
134
+	 * of Informatics and Telematics, Pisa, Italy.
135
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it
136
+	 */
137
+	const IITCNRit = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it';
138
+
139
+	/**
140
+	 * This class is based on the work of the LRMI project, see lrmi.net for details.
141
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass
142
+	 */
143
+	const LRMIClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass';
144
+
145
+	/**
146
+	 * This vocabulary was improved through collaboration with the MusicBrainz project
147
+	 *     ([www.musicbrainz.org](http://www.musicbrainz.org)), and is partially inspired by the
148
+	 * MusicBrainz and
149
+	 *     [Music Ontology](http://musicontology.com/docs/getting-started.html) schemas.
150
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ
151
+	 */
152
+	const MBZ = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ';
153
+
154
+	/**
155
+	 * This element is based on the STI Accommodation Ontology, see <a
156
+	 * href="http://ontologies.sti-innsbruck.at/acco/ns.html">http://ontologies.sti-innsbruck.at/acco/ns.html</a>
157
+	 * for details.
158
+	 *     Many class and property definitions are inspired by or based on abstracts from Wikipedia,
159
+	 * the free encyclopedia.
160
+	 * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology
161
+	 */
162
+	const STI_Accommodation_Ontology = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology';
163
+
164
+	/**
165
+	 * The Question/Answer types were [based
166
+	 * on](https://www.w3.org/wiki/WebSchemas/QASchemaResearch) the Stack Overflow API.
167
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange
168
+	 */
169
+	const Stack_Exchange = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange';
170
+
171
+	/**
172
+	 * This term and associated definitions draws upon the work of [The Trust
173
+	 * Project](http://thetrustproject.org/).
174
+	 * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws
175
+	 */
176
+	const The_Trust_Project = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws';
177
+
178
+	/**
179
+	 * This element is based on the work of the [Tourism Structured Web Data Community
180
+	 * Group](https://www.w3.org/community/tourismdata).
181
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism
182
+	 */
183
+	const Tourism = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism';
184
+
185
+	/**
186
+	 * This class contains information contributed by
187
+	 * [http://wikidoc.org>WikiDoc](http://wikidoc.org>WikiDoc).
188
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc
189
+	 */
190
+	const WikiDoc = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc';
191
+
192
+	/**
193
+	 * This class contains derivatives of IPTC rNews properties. rNews is a data model of publishing
194
+	 * metadata with serializations currently available for RDFa as well as HTML5 Microdata. More
195
+	 * information about the IPTC and rNews can be found at [rnews.org](http://rnews.org).
196
+	 * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews
197
+	 */
198
+	const rNews = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews';
199
+
200
+	/**
201
+	 * @var array
202
+	 * @see http://schema.org/{property_name}
203
+	 */
204
+	public $allowed = [
205
+		'address', 'aggregateRating', 'areaServed', 'award', 'awards', 'brand', 'contactPoint',
206
+		'contactPoints', 'department', 'dissolutionDate', 'duns', 'email', 'employee', 'employees',
207
+		'event', 'events', 'faxNumber', 'founder', 'founders', 'foundingDate', 'foundingLocation',
208
+		'funder', 'globalLocationNumber', 'hasOfferCatalog', 'hasPOS', 'isicV4', 'legalName',
209
+		'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'members', 'naics',
210
+		'numberOfEmployees', 'offeredBy', 'owns', 'parentOrganization', 'publishingPrinciples',
211
+		'review', 'reviews', 'seeks', 'serviceArea', 'sponsor', 'subOrganization', 'taxID',
212
+		'telephone', 'vatID',
213
+	];
214
+
215
+	/**
216
+	 * @var array
217
+	 * @see http://schema.org/{property_name}
218
+	 */
219
+	public $parents = [
220
+		'Thing',
221
+	];
222 222
 }
Please login to merge, or discard this patch.
plugin/Modules/Schema/Intangible.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@
 block discarded – undo
9 9
  */
10 10
 class Intangible extends BaseType
11 11
 {
12
-    /**
13
-     * @var array
14
-     * @see http://schema.org/{property_name}
15
-     */
16
-    public $parents = [
17
-        'Thing',
18
-    ];
12
+	/**
13
+	 * @var array
14
+	 * @see http://schema.org/{property_name}
15
+	 */
16
+	public $parents = [
17
+		'Thing',
18
+	];
19 19
 }
Please login to merge, or discard this patch.