PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / intervention / httpauth / src / Token / NullToken.php

NullToken.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.7.0, at vendor/intervention/httpauth/src/Token/NullToken.php

58 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Intervention\HttpAuth\Token;
4
5 use Intervention\HttpAuth\Exception\AuthentificationException;
6 use Intervention\HttpAuth\Key;
7 use Intervention\HttpAuth\TokenInterface;
8
9 class NullToken implements TokenInterface
10 {
11 /**
12 * Create new instance
13 */
14 public function __construct()
15 {
16 if ($this->parse() === false) {
17 throw new AuthentificationException('Failed to parse token');
18 }
19 }
20
21 /**
22 * Transform current instance to key object
23 *
24 * @return Key
25 */
26 public function toKey(): Key
27 {
28 return new Key();
29 }
30
31 /**
32 * Parse environment variables and store value in object
33 *
34 * @return bool "true" if value was found or "false"
35 */
36 protected function parse(): bool
37 {
38 return true;
39 }
40
41 /**
42 * Return the value of given key in given array data.
43 * Returns null if key doesn't exists
44 *
45 * @param array $data
46 * @param mixed $key
47 * @return mixed
48 */
49 protected function getArrayValue($data, $key)
50 {
51 if (array_key_exists($key, $data)) {
52 return $data[$key];
53 }
54
55 return null;
56 }
57 }
58