Completed
Pull Request — develop (#1713)
by Zack
17:42
created
vendor/psr/log/Psr/Log/LoggerAwareTrait.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -13,20 +13,20 @@
 block discarded – undo
13 13
  */
14 14
 trait LoggerAwareTrait
15 15
 {
16
-    /**
17
-     * The logger instance.
18
-     *
19
-     * @var LoggerInterface|null
20
-     */
21
-    protected $logger;
16
+	/**
17
+	 * The logger instance.
18
+	 *
19
+	 * @var LoggerInterface|null
20
+	 */
21
+	protected $logger;
22 22
 
23
-    /**
24
-     * Sets a logger.
25
-     *
26
-     * @param LoggerInterface $logger
27
-     */
28
-    public function setLogger(LoggerInterface $logger)
29
-    {
30
-        $this->logger = $logger;
31
-    }
23
+	/**
24
+	 * Sets a logger.
25
+	 *
26
+	 * @param LoggerInterface $logger
27
+	 */
28
+	public function setLogger(LoggerInterface $logger)
29
+	{
30
+		$this->logger = $logger;
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      *
26 26
      * @param LoggerInterface $logger
27 27
      */
28
-    public function setLogger(LoggerInterface $logger)
28
+    public function setLogger( LoggerInterface $logger )
29 29
     {
30 30
         $this->logger = $logger;
31 31
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
 /**
12 12
  * Basic Implementation of LoggerAwareInterface.
13 13
  */
14
-trait LoggerAwareTrait
15
-{
14
+trait LoggerAwareTrait {
16 15
     /**
17 16
      * The logger instance.
18 17
      *
@@ -25,8 +24,7 @@  discard block
 block discarded – undo
25 24
      *
26 25
      * @param LoggerInterface $logger
27 26
      */
28
-    public function setLogger(LoggerInterface $logger)
29
-    {
27
+    public function setLogger(LoggerInterface $logger) {
30 28
         $this->logger = $logger;
31 29
     }
32 30
 }
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/AbstractLogger.php 3 patches
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -17,118 +17,118 @@
 block discarded – undo
17 17
  */
18 18
 abstract class AbstractLogger implements LoggerInterface
19 19
 {
20
-    /**
21
-     * System is unusable.
22
-     *
23
-     * @param string  $message
24
-     * @param mixed[] $context
25
-     *
26
-     * @return void
27
-     */
28
-    public function emergency($message, array $context = array())
29
-    {
30
-        $this->log(LogLevel::EMERGENCY, $message, $context);
31
-    }
20
+	/**
21
+	 * System is unusable.
22
+	 *
23
+	 * @param string  $message
24
+	 * @param mixed[] $context
25
+	 *
26
+	 * @return void
27
+	 */
28
+	public function emergency($message, array $context = array())
29
+	{
30
+		$this->log(LogLevel::EMERGENCY, $message, $context);
31
+	}
32 32
 
33
-    /**
34
-     * Action must be taken immediately.
35
-     *
36
-     * Example: Entire website down, database unavailable, etc. This should
37
-     * trigger the SMS alerts and wake you up.
38
-     *
39
-     * @param string  $message
40
-     * @param mixed[] $context
41
-     *
42
-     * @return void
43
-     */
44
-    public function alert($message, array $context = array())
45
-    {
46
-        $this->log(LogLevel::ALERT, $message, $context);
47
-    }
33
+	/**
34
+	 * Action must be taken immediately.
35
+	 *
36
+	 * Example: Entire website down, database unavailable, etc. This should
37
+	 * trigger the SMS alerts and wake you up.
38
+	 *
39
+	 * @param string  $message
40
+	 * @param mixed[] $context
41
+	 *
42
+	 * @return void
43
+	 */
44
+	public function alert($message, array $context = array())
45
+	{
46
+		$this->log(LogLevel::ALERT, $message, $context);
47
+	}
48 48
 
49
-    /**
50
-     * Critical conditions.
51
-     *
52
-     * Example: Application component unavailable, unexpected exception.
53
-     *
54
-     * @param string  $message
55
-     * @param mixed[] $context
56
-     *
57
-     * @return void
58
-     */
59
-    public function critical($message, array $context = array())
60
-    {
61
-        $this->log(LogLevel::CRITICAL, $message, $context);
62
-    }
49
+	/**
50
+	 * Critical conditions.
51
+	 *
52
+	 * Example: Application component unavailable, unexpected exception.
53
+	 *
54
+	 * @param string  $message
55
+	 * @param mixed[] $context
56
+	 *
57
+	 * @return void
58
+	 */
59
+	public function critical($message, array $context = array())
60
+	{
61
+		$this->log(LogLevel::CRITICAL, $message, $context);
62
+	}
63 63
 
64
-    /**
65
-     * Runtime errors that do not require immediate action but should typically
66
-     * be logged and monitored.
67
-     *
68
-     * @param string  $message
69
-     * @param mixed[] $context
70
-     *
71
-     * @return void
72
-     */
73
-    public function error($message, array $context = array())
74
-    {
75
-        $this->log(LogLevel::ERROR, $message, $context);
76
-    }
64
+	/**
65
+	 * Runtime errors that do not require immediate action but should typically
66
+	 * be logged and monitored.
67
+	 *
68
+	 * @param string  $message
69
+	 * @param mixed[] $context
70
+	 *
71
+	 * @return void
72
+	 */
73
+	public function error($message, array $context = array())
74
+	{
75
+		$this->log(LogLevel::ERROR, $message, $context);
76
+	}
77 77
 
78
-    /**
79
-     * Exceptional occurrences that are not errors.
80
-     *
81
-     * Example: Use of deprecated APIs, poor use of an API, undesirable things
82
-     * that are not necessarily wrong.
83
-     *
84
-     * @param string  $message
85
-     * @param mixed[] $context
86
-     *
87
-     * @return void
88
-     */
89
-    public function warning($message, array $context = array())
90
-    {
91
-        $this->log(LogLevel::WARNING, $message, $context);
92
-    }
78
+	/**
79
+	 * Exceptional occurrences that are not errors.
80
+	 *
81
+	 * Example: Use of deprecated APIs, poor use of an API, undesirable things
82
+	 * that are not necessarily wrong.
83
+	 *
84
+	 * @param string  $message
85
+	 * @param mixed[] $context
86
+	 *
87
+	 * @return void
88
+	 */
89
+	public function warning($message, array $context = array())
90
+	{
91
+		$this->log(LogLevel::WARNING, $message, $context);
92
+	}
93 93
 
94
-    /**
95
-     * Normal but significant events.
96
-     *
97
-     * @param string  $message
98
-     * @param mixed[] $context
99
-     *
100
-     * @return void
101
-     */
102
-    public function notice($message, array $context = array())
103
-    {
104
-        $this->log(LogLevel::NOTICE, $message, $context);
105
-    }
94
+	/**
95
+	 * Normal but significant events.
96
+	 *
97
+	 * @param string  $message
98
+	 * @param mixed[] $context
99
+	 *
100
+	 * @return void
101
+	 */
102
+	public function notice($message, array $context = array())
103
+	{
104
+		$this->log(LogLevel::NOTICE, $message, $context);
105
+	}
106 106
 
107
-    /**
108
-     * Interesting events.
109
-     *
110
-     * Example: User logs in, SQL logs.
111
-     *
112
-     * @param string  $message
113
-     * @param mixed[] $context
114
-     *
115
-     * @return void
116
-     */
117
-    public function info($message, array $context = array())
118
-    {
119
-        $this->log(LogLevel::INFO, $message, $context);
120
-    }
107
+	/**
108
+	 * Interesting events.
109
+	 *
110
+	 * Example: User logs in, SQL logs.
111
+	 *
112
+	 * @param string  $message
113
+	 * @param mixed[] $context
114
+	 *
115
+	 * @return void
116
+	 */
117
+	public function info($message, array $context = array())
118
+	{
119
+		$this->log(LogLevel::INFO, $message, $context);
120
+	}
121 121
 
122
-    /**
123
-     * Detailed debug information.
124
-     *
125
-     * @param string  $message
126
-     * @param mixed[] $context
127
-     *
128
-     * @return void
129
-     */
130
-    public function debug($message, array $context = array())
131
-    {
132
-        $this->log(LogLevel::DEBUG, $message, $context);
133
-    }
122
+	/**
123
+	 * Detailed debug information.
124
+	 *
125
+	 * @param string  $message
126
+	 * @param mixed[] $context
127
+	 *
128
+	 * @return void
129
+	 */
130
+	public function debug($message, array $context = array())
131
+	{
132
+		$this->log(LogLevel::DEBUG, $message, $context);
133
+	}
134 134
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @return void
27 27
      */
28
-    public function emergency($message, array $context = array())
28
+    public function emergency( $message, array $context = array() )
29 29
     {
30
-        $this->log(LogLevel::EMERGENCY, $message, $context);
30
+        $this->log( LogLevel::EMERGENCY, $message, $context );
31 31
     }
32 32
 
33 33
     /**
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @return void
43 43
      */
44
-    public function alert($message, array $context = array())
44
+    public function alert( $message, array $context = array() )
45 45
     {
46
-        $this->log(LogLevel::ALERT, $message, $context);
46
+        $this->log( LogLevel::ALERT, $message, $context );
47 47
     }
48 48
 
49 49
     /**
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      *
57 57
      * @return void
58 58
      */
59
-    public function critical($message, array $context = array())
59
+    public function critical( $message, array $context = array() )
60 60
     {
61
-        $this->log(LogLevel::CRITICAL, $message, $context);
61
+        $this->log( LogLevel::CRITICAL, $message, $context );
62 62
     }
63 63
 
64 64
     /**
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return void
72 72
      */
73
-    public function error($message, array $context = array())
73
+    public function error( $message, array $context = array() )
74 74
     {
75
-        $this->log(LogLevel::ERROR, $message, $context);
75
+        $this->log( LogLevel::ERROR, $message, $context );
76 76
     }
77 77
 
78 78
     /**
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
      *
87 87
      * @return void
88 88
      */
89
-    public function warning($message, array $context = array())
89
+    public function warning( $message, array $context = array() )
90 90
     {
91
-        $this->log(LogLevel::WARNING, $message, $context);
91
+        $this->log( LogLevel::WARNING, $message, $context );
92 92
     }
93 93
 
94 94
     /**
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
      *
100 100
      * @return void
101 101
      */
102
-    public function notice($message, array $context = array())
102
+    public function notice( $message, array $context = array() )
103 103
     {
104
-        $this->log(LogLevel::NOTICE, $message, $context);
104
+        $this->log( LogLevel::NOTICE, $message, $context );
105 105
     }
106 106
 
107 107
     /**
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
      *
115 115
      * @return void
116 116
      */
117
-    public function info($message, array $context = array())
117
+    public function info( $message, array $context = array() )
118 118
     {
119
-        $this->log(LogLevel::INFO, $message, $context);
119
+        $this->log( LogLevel::INFO, $message, $context );
120 120
     }
121 121
 
122 122
     /**
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
      *
128 128
      * @return void
129 129
      */
130
-    public function debug($message, array $context = array())
130
+    public function debug( $message, array $context = array() )
131 131
     {
132
-        $this->log(LogLevel::DEBUG, $message, $context);
132
+        $this->log( LogLevel::DEBUG, $message, $context );
133 133
     }
134 134
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
  * reduce boilerplate code that a simple Logger that does the same thing with
16 16
  * messages regardless of the error level has to implement.
17 17
  */
18
-abstract class AbstractLogger implements LoggerInterface
19
-{
18
+abstract class AbstractLogger implements LoggerInterface {
20 19
     /**
21 20
      * System is unusable.
22 21
      *
@@ -25,8 +24,7 @@  discard block
 block discarded – undo
25 24
      *
26 25
      * @return void
27 26
      */
28
-    public function emergency($message, array $context = array())
29
-    {
27
+    public function emergency($message, array $context = array()) {
30 28
         $this->log(LogLevel::EMERGENCY, $message, $context);
31 29
     }
32 30
 
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
      *
42 40
      * @return void
43 41
      */
44
-    public function alert($message, array $context = array())
45
-    {
42
+    public function alert($message, array $context = array()) {
46 43
         $this->log(LogLevel::ALERT, $message, $context);
47 44
     }
48 45
 
@@ -56,8 +53,7 @@  discard block
 block discarded – undo
56 53
      *
57 54
      * @return void
58 55
      */
59
-    public function critical($message, array $context = array())
60
-    {
56
+    public function critical($message, array $context = array()) {
61 57
         $this->log(LogLevel::CRITICAL, $message, $context);
62 58
     }
63 59
 
@@ -70,8 +66,7 @@  discard block
 block discarded – undo
70 66
      *
71 67
      * @return void
72 68
      */
73
-    public function error($message, array $context = array())
74
-    {
69
+    public function error($message, array $context = array()) {
75 70
         $this->log(LogLevel::ERROR, $message, $context);
76 71
     }
77 72
 
@@ -86,8 +81,7 @@  discard block
 block discarded – undo
86 81
      *
87 82
      * @return void
88 83
      */
89
-    public function warning($message, array $context = array())
90
-    {
84
+    public function warning($message, array $context = array()) {
91 85
         $this->log(LogLevel::WARNING, $message, $context);
92 86
     }
93 87
 
@@ -99,8 +93,7 @@  discard block
 block discarded – undo
99 93
      *
100 94
      * @return void
101 95
      */
102
-    public function notice($message, array $context = array())
103
-    {
96
+    public function notice($message, array $context = array()) {
104 97
         $this->log(LogLevel::NOTICE, $message, $context);
105 98
     }
106 99
 
@@ -114,8 +107,7 @@  discard block
 block discarded – undo
114 107
      *
115 108
      * @return void
116 109
      */
117
-    public function info($message, array $context = array())
118
-    {
110
+    public function info($message, array $context = array()) {
119 111
         $this->log(LogLevel::INFO, $message, $context);
120 112
     }
121 113
 
@@ -127,8 +119,7 @@  discard block
 block discarded – undo
127 119
      *
128 120
      * @return void
129 121
      */
130
-    public function debug($message, array $context = array())
131
-    {
122
+    public function debug($message, array $context = array()) {
132 123
         $this->log(LogLevel::DEBUG, $message, $context);
133 124
     }
134 125
 }
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/LoggerAwareInterface.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@
 block discarded – undo
13 13
  */
14 14
 interface LoggerAwareInterface
15 15
 {
16
-    /**
17
-     * Sets a logger instance on the object.
18
-     *
19
-     * @param LoggerInterface $logger
20
-     *
21
-     * @return void
22
-     */
23
-    public function setLogger(LoggerInterface $logger);
16
+	/**
17
+	 * Sets a logger instance on the object.
18
+	 *
19
+	 * @param LoggerInterface $logger
20
+	 *
21
+	 * @return void
22
+	 */
23
+	public function setLogger(LoggerInterface $logger);
24 24
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,5 +20,5 @@
 block discarded – undo
20 20
      *
21 21
      * @return void
22 22
      */
23
-    public function setLogger(LoggerInterface $logger);
23
+    public function setLogger( LoggerInterface $logger );
24 24
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@
 block discarded – undo
11 11
 /**
12 12
  * Describes a logger-aware instance.
13 13
  */
14
-interface LoggerAwareInterface
15
-{
14
+interface LoggerAwareInterface {
16 15
     /**
17 16
      * Sets a logger instance on the object.
18 17
      *
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/Test/TestLogger.php 3 patches
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -62,92 +62,92 @@
 block discarded – undo
62 62
  */
63 63
 class TestLogger extends AbstractLogger
64 64
 {
65
-    /**
66
-     * @var array
67
-     */
68
-    public $records = [];
65
+	/**
66
+	 * @var array
67
+	 */
68
+	public $records = [];
69 69
 
70
-    public $recordsByLevel = [];
70
+	public $recordsByLevel = [];
71 71
 
72
-    /**
73
-     * @inheritdoc
74
-     */
75
-    public function log($level, $message, array $context = [])
76
-    {
77
-        $record = [
78
-            'level' => $level,
79
-            'message' => $message,
80
-            'context' => $context,
81
-        ];
72
+	/**
73
+	 * @inheritdoc
74
+	 */
75
+	public function log($level, $message, array $context = [])
76
+	{
77
+		$record = [
78
+			'level' => $level,
79
+			'message' => $message,
80
+			'context' => $context,
81
+		];
82 82
 
83
-        $this->recordsByLevel[$record['level']][] = $record;
84
-        $this->records[] = $record;
85
-    }
83
+		$this->recordsByLevel[$record['level']][] = $record;
84
+		$this->records[] = $record;
85
+	}
86 86
 
87
-    public function hasRecords($level)
88
-    {
89
-        return isset($this->recordsByLevel[$level]);
90
-    }
87
+	public function hasRecords($level)
88
+	{
89
+		return isset($this->recordsByLevel[$level]);
90
+	}
91 91
 
92
-    public function hasRecord($record, $level)
93
-    {
94
-        if (is_string($record)) {
95
-            $record = ['message' => $record];
96
-        }
97
-        return $this->hasRecordThatPasses(function ($rec) use ($record) {
98
-            if ($rec['message'] !== $record['message']) {
99
-                return false;
100
-            }
101
-            if (isset($record['context']) && $rec['context'] !== $record['context']) {
102
-                return false;
103
-            }
104
-            return true;
105
-        }, $level);
106
-    }
92
+	public function hasRecord($record, $level)
93
+	{
94
+		if (is_string($record)) {
95
+			$record = ['message' => $record];
96
+		}
97
+		return $this->hasRecordThatPasses(function ($rec) use ($record) {
98
+			if ($rec['message'] !== $record['message']) {
99
+				return false;
100
+			}
101
+			if (isset($record['context']) && $rec['context'] !== $record['context']) {
102
+				return false;
103
+			}
104
+			return true;
105
+		}, $level);
106
+	}
107 107
 
108
-    public function hasRecordThatContains($message, $level)
109
-    {
110
-        return $this->hasRecordThatPasses(function ($rec) use ($message) {
111
-            return strpos($rec['message'], $message) !== false;
112
-        }, $level);
113
-    }
108
+	public function hasRecordThatContains($message, $level)
109
+	{
110
+		return $this->hasRecordThatPasses(function ($rec) use ($message) {
111
+			return strpos($rec['message'], $message) !== false;
112
+		}, $level);
113
+	}
114 114
 
115
-    public function hasRecordThatMatches($regex, $level)
116
-    {
117
-        return $this->hasRecordThatPasses(function ($rec) use ($regex) {
118
-            return preg_match($regex, $rec['message']) > 0;
119
-        }, $level);
120
-    }
115
+	public function hasRecordThatMatches($regex, $level)
116
+	{
117
+		return $this->hasRecordThatPasses(function ($rec) use ($regex) {
118
+			return preg_match($regex, $rec['message']) > 0;
119
+		}, $level);
120
+	}
121 121
 
122
-    public function hasRecordThatPasses(callable $predicate, $level)
123
-    {
124
-        if (!isset($this->recordsByLevel[$level])) {
125
-            return false;
126
-        }
127
-        foreach ($this->recordsByLevel[$level] as $i => $rec) {
128
-            if (call_user_func($predicate, $rec, $i)) {
129
-                return true;
130
-            }
131
-        }
132
-        return false;
133
-    }
122
+	public function hasRecordThatPasses(callable $predicate, $level)
123
+	{
124
+		if (!isset($this->recordsByLevel[$level])) {
125
+			return false;
126
+		}
127
+		foreach ($this->recordsByLevel[$level] as $i => $rec) {
128
+			if (call_user_func($predicate, $rec, $i)) {
129
+				return true;
130
+			}
131
+		}
132
+		return false;
133
+	}
134 134
 
135
-    public function __call($method, $args)
136
-    {
137
-        if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
138
-            $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
139
-            $level = strtolower($matches[2]);
140
-            if (method_exists($this, $genericMethod)) {
141
-                $args[] = $level;
142
-                return call_user_func_array([$this, $genericMethod], $args);
143
-            }
144
-        }
145
-        throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
146
-    }
135
+	public function __call($method, $args)
136
+	{
137
+		if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
138
+			$genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
139
+			$level = strtolower($matches[2]);
140
+			if (method_exists($this, $genericMethod)) {
141
+				$args[] = $level;
142
+				return call_user_func_array([$this, $genericMethod], $args);
143
+			}
144
+		}
145
+		throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
146
+	}
147 147
 
148
-    public function reset()
149
-    {
150
-        $this->records = [];
151
-        $this->recordsByLevel = [];
152
-    }
148
+	public function reset()
149
+	{
150
+		$this->records = [];
151
+		$this->recordsByLevel = [];
152
+	}
153 153
 }
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
     /**
66 66
      * @var array
67 67
      */
68
-    public $records = [];
68
+    public $records = [ ];
69 69
 
70
-    public $recordsByLevel = [];
70
+    public $recordsByLevel = [ ];
71 71
 
72 72
     /**
73 73
      * @inheritdoc
74 74
      */
75
-    public function log($level, $message, array $context = [])
75
+    public function log( $level, $message, array $context = [ ] )
76 76
     {
77 77
         $record = [
78 78
             'level' => $level,
@@ -80,74 +80,74 @@  discard block
 block discarded – undo
80 80
             'context' => $context,
81 81
         ];
82 82
 
83
-        $this->recordsByLevel[$record['level']][] = $record;
84
-        $this->records[] = $record;
83
+        $this->recordsByLevel[ $record[ 'level' ] ][ ] = $record;
84
+        $this->records[ ] = $record;
85 85
     }
86 86
 
87
-    public function hasRecords($level)
87
+    public function hasRecords( $level )
88 88
     {
89
-        return isset($this->recordsByLevel[$level]);
89
+        return isset( $this->recordsByLevel[ $level ] );
90 90
     }
91 91
 
92
-    public function hasRecord($record, $level)
92
+    public function hasRecord( $record, $level )
93 93
     {
94
-        if (is_string($record)) {
95
-            $record = ['message' => $record];
94
+        if ( is_string( $record ) ) {
95
+            $record = [ 'message' => $record ];
96 96
         }
97
-        return $this->hasRecordThatPasses(function ($rec) use ($record) {
98
-            if ($rec['message'] !== $record['message']) {
97
+        return $this->hasRecordThatPasses( function( $rec ) use ( $record ) {
98
+            if ( $rec[ 'message' ] !== $record[ 'message' ] ) {
99 99
                 return false;
100 100
             }
101
-            if (isset($record['context']) && $rec['context'] !== $record['context']) {
101
+            if ( isset( $record[ 'context' ] ) && $rec[ 'context' ] !== $record[ 'context' ] ) {
102 102
                 return false;
103 103
             }
104 104
             return true;
105
-        }, $level);
105
+        }, $level );
106 106
     }
107 107
 
108
-    public function hasRecordThatContains($message, $level)
108
+    public function hasRecordThatContains( $message, $level )
109 109
     {
110
-        return $this->hasRecordThatPasses(function ($rec) use ($message) {
111
-            return strpos($rec['message'], $message) !== false;
112
-        }, $level);
110
+        return $this->hasRecordThatPasses( function( $rec ) use ( $message ) {
111
+            return strpos( $rec[ 'message' ], $message ) !== false;
112
+        }, $level );
113 113
     }
114 114
 
115
-    public function hasRecordThatMatches($regex, $level)
115
+    public function hasRecordThatMatches( $regex, $level )
116 116
     {
117
-        return $this->hasRecordThatPasses(function ($rec) use ($regex) {
118
-            return preg_match($regex, $rec['message']) > 0;
119
-        }, $level);
117
+        return $this->hasRecordThatPasses( function( $rec ) use ( $regex ) {
118
+            return preg_match( $regex, $rec[ 'message' ] ) > 0;
119
+        }, $level );
120 120
     }
121 121
 
122
-    public function hasRecordThatPasses(callable $predicate, $level)
122
+    public function hasRecordThatPasses( callable $predicate, $level )
123 123
     {
124
-        if (!isset($this->recordsByLevel[$level])) {
124
+        if ( ! isset( $this->recordsByLevel[ $level ] ) ) {
125 125
             return false;
126 126
         }
127
-        foreach ($this->recordsByLevel[$level] as $i => $rec) {
128
-            if (call_user_func($predicate, $rec, $i)) {
127
+        foreach ( $this->recordsByLevel[ $level ] as $i => $rec ) {
128
+            if ( call_user_func( $predicate, $rec, $i ) ) {
129 129
                 return true;
130 130
             }
131 131
         }
132 132
         return false;
133 133
     }
134 134
 
135
-    public function __call($method, $args)
135
+    public function __call( $method, $args )
136 136
     {
137
-        if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
138
-            $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
139
-            $level = strtolower($matches[2]);
140
-            if (method_exists($this, $genericMethod)) {
141
-                $args[] = $level;
142
-                return call_user_func_array([$this, $genericMethod], $args);
137
+        if ( preg_match( '/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches ) > 0 ) {
138
+            $genericMethod = $matches[ 1 ] . ( 'Records' !== $matches[ 3 ] ? 'Record' : '' ) . $matches[ 3 ];
139
+            $level = strtolower( $matches[ 2 ] );
140
+            if ( method_exists( $this, $genericMethod ) ) {
141
+                $args[ ] = $level;
142
+                return call_user_func_array( [ $this, $genericMethod ], $args );
143 143
             }
144 144
         }
145
-        throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
145
+        throw new \BadMethodCallException( 'Call to undefined method ' . get_class( $this ) . '::' . $method . '()' );
146 146
     }
147 147
 
148 148
     public function reset()
149 149
     {
150
-        $this->records = [];
151
-        $this->recordsByLevel = [];
150
+        $this->records = [ ];
151
+        $this->recordsByLevel = [ ];
152 152
     }
153 153
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
  * @method bool hasInfoThatPasses($message)
61 61
  * @method bool hasDebugThatPasses($message)
62 62
  */
63
-class TestLogger extends AbstractLogger
64
-{
63
+class TestLogger extends AbstractLogger {
65 64
     /**
66 65
      * @var array
67 66
      */
@@ -72,8 +71,7 @@  discard block
 block discarded – undo
72 71
     /**
73 72
      * @inheritdoc
74 73
      */
75
-    public function log($level, $message, array $context = [])
76
-    {
74
+    public function log($level, $message, array $context = []) {
77 75
         $record = [
78 76
             'level' => $level,
79 77
             'message' => $message,
@@ -84,13 +82,11 @@  discard block
 block discarded – undo
84 82
         $this->records[] = $record;
85 83
     }
86 84
 
87
-    public function hasRecords($level)
88
-    {
85
+    public function hasRecords($level) {
89 86
         return isset($this->recordsByLevel[$level]);
90 87
     }
91 88
 
92
-    public function hasRecord($record, $level)
93
-    {
89
+    public function hasRecord($record, $level) {
94 90
         if (is_string($record)) {
95 91
             $record = ['message' => $record];
96 92
         }
@@ -105,22 +101,19 @@  discard block
 block discarded – undo
105 101
         }, $level);
106 102
     }
107 103
 
108
-    public function hasRecordThatContains($message, $level)
109
-    {
104
+    public function hasRecordThatContains($message, $level) {
110 105
         return $this->hasRecordThatPasses(function ($rec) use ($message) {
111 106
             return strpos($rec['message'], $message) !== false;
112 107
         }, $level);
113 108
     }
114 109
 
115
-    public function hasRecordThatMatches($regex, $level)
116
-    {
110
+    public function hasRecordThatMatches($regex, $level) {
117 111
         return $this->hasRecordThatPasses(function ($rec) use ($regex) {
118 112
             return preg_match($regex, $rec['message']) > 0;
119 113
         }, $level);
120 114
     }
121 115
 
122
-    public function hasRecordThatPasses(callable $predicate, $level)
123
-    {
116
+    public function hasRecordThatPasses(callable $predicate, $level) {
124 117
         if (!isset($this->recordsByLevel[$level])) {
125 118
             return false;
126 119
         }
@@ -132,8 +125,7 @@  discard block
 block discarded – undo
132 125
         return false;
133 126
     }
134 127
 
135
-    public function __call($method, $args)
136
-    {
128
+    public function __call($method, $args) {
137 129
         if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
138 130
             $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
139 131
             $level = strtolower($matches[2]);
@@ -145,8 +137,7 @@  discard block
 block discarded – undo
145 137
         throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
146 138
     }
147 139
 
148
-    public function reset()
149
-    {
140
+    public function reset() {
150 141
         $this->records = [];
151 142
         $this->recordsByLevel = [];
152 143
     }
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/Test/DummyTest.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
  */
18 18
 class DummyTest
19 19
 {
20
-    public function __toString()
21
-    {
22
-        return 'DummyTest';
23
-    }
20
+	public function __toString()
21
+	{
22
+		return 'DummyTest';
23
+	}
24 24
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,10 +15,8 @@
 block discarded – undo
15 15
  *
16 16
  * @internal
17 17
  */
18
-class DummyTest
19
-{
20
-    public function __toString()
21
-    {
18
+class DummyTest {
19
+    public function __toString() {
22 20
         return 'DummyTest';
23 21
     }
24 22
 }
Please login to merge, or discard this patch.
vendor/psr/log/Psr/Log/LogLevel.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@
 block discarded – undo
13 13
  */
14 14
 class LogLevel
15 15
 {
16
-    const EMERGENCY = 'emergency';
17
-    const ALERT     = 'alert';
18
-    const CRITICAL  = 'critical';
19
-    const ERROR     = 'error';
20
-    const WARNING   = 'warning';
21
-    const NOTICE    = 'notice';
22
-    const INFO      = 'info';
23
-    const DEBUG     = 'debug';
16
+	const EMERGENCY = 'emergency';
17
+	const ALERT     = 'alert';
18
+	const CRITICAL  = 'critical';
19
+	const ERROR     = 'error';
20
+	const WARNING   = 'warning';
21
+	const NOTICE    = 'notice';
22
+	const INFO      = 'info';
23
+	const DEBUG     = 'debug';
24 24
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@
 block discarded – undo
11 11
 /**
12 12
  * Describes log levels.
13 13
  */
14
-class LogLevel
15
-{
14
+class LogLevel {
16 15
     const EMERGENCY = 'emergency';
17 16
     const ALERT     = 'alert';
18 17
     const CRITICAL  = 'critical';
Please login to merge, or discard this patch.
vendor/composer/ClassLoader.php 3 patches
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     /**
104 104
      * @param ?string $vendorDir
105 105
      */
106
-    public function __construct($vendorDir = null)
106
+    public function __construct( $vendorDir = null )
107 107
     {
108 108
         $this->vendorDir = $vendorDir;
109 109
     }
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function getPrefixes()
115 115
     {
116
-        if (!empty($this->prefixesPsr0)) {
117
-            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
116
+        if ( ! empty( $this->prefixesPsr0 ) ) {
117
+            return call_user_func_array( 'array_merge', array_values( $this->prefixesPsr0 ) );
118 118
         }
119 119
 
120 120
         return array();
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
      *
163 163
      * @return void
164 164
      */
165
-    public function addClassMap(array $classMap)
165
+    public function addClassMap( array $classMap )
166 166
     {
167
-        if ($this->classMap) {
168
-            $this->classMap = array_merge($this->classMap, $classMap);
167
+        if ( $this->classMap ) {
168
+            $this->classMap = array_merge( $this->classMap, $classMap );
169 169
         } else {
170 170
             $this->classMap = $classMap;
171 171
         }
@@ -181,39 +181,39 @@  discard block
 block discarded – undo
181 181
      *
182 182
      * @return void
183 183
      */
184
-    public function add($prefix, $paths, $prepend = false)
184
+    public function add( $prefix, $paths, $prepend = false )
185 185
     {
186
-        if (!$prefix) {
187
-            if ($prepend) {
186
+        if ( ! $prefix ) {
187
+            if ( $prepend ) {
188 188
                 $this->fallbackDirsPsr0 = array_merge(
189
-                    (array) $paths,
189
+                    (array)$paths,
190 190
                     $this->fallbackDirsPsr0
191 191
                 );
192 192
             } else {
193 193
                 $this->fallbackDirsPsr0 = array_merge(
194 194
                     $this->fallbackDirsPsr0,
195
-                    (array) $paths
195
+                    (array)$paths
196 196
                 );
197 197
             }
198 198
 
199 199
             return;
200 200
         }
201 201
 
202
-        $first = $prefix[0];
203
-        if (!isset($this->prefixesPsr0[$first][$prefix])) {
204
-            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
202
+        $first = $prefix[ 0 ];
203
+        if ( ! isset( $this->prefixesPsr0[ $first ][ $prefix ] ) ) {
204
+            $this->prefixesPsr0[ $first ][ $prefix ] = (array)$paths;
205 205
 
206 206
             return;
207 207
         }
208
-        if ($prepend) {
209
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
210
-                (array) $paths,
211
-                $this->prefixesPsr0[$first][$prefix]
208
+        if ( $prepend ) {
209
+            $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
210
+                (array)$paths,
211
+                $this->prefixesPsr0[ $first ][ $prefix ]
212 212
             );
213 213
         } else {
214
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
215
-                $this->prefixesPsr0[$first][$prefix],
216
-                (array) $paths
214
+            $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
215
+                $this->prefixesPsr0[ $first ][ $prefix ],
216
+                (array)$paths
217 217
             );
218 218
         }
219 219
     }
@@ -230,40 +230,40 @@  discard block
 block discarded – undo
230 230
      *
231 231
      * @return void
232 232
      */
233
-    public function addPsr4($prefix, $paths, $prepend = false)
233
+    public function addPsr4( $prefix, $paths, $prepend = false )
234 234
     {
235
-        if (!$prefix) {
235
+        if ( ! $prefix ) {
236 236
             // Register directories for the root namespace.
237
-            if ($prepend) {
237
+            if ( $prepend ) {
238 238
                 $this->fallbackDirsPsr4 = array_merge(
239
-                    (array) $paths,
239
+                    (array)$paths,
240 240
                     $this->fallbackDirsPsr4
241 241
                 );
242 242
             } else {
243 243
                 $this->fallbackDirsPsr4 = array_merge(
244 244
                     $this->fallbackDirsPsr4,
245
-                    (array) $paths
245
+                    (array)$paths
246 246
                 );
247 247
             }
248
-        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
248
+        } elseif ( ! isset( $this->prefixDirsPsr4[ $prefix ] ) ) {
249 249
             // Register directories for a new namespace.
250
-            $length = strlen($prefix);
251
-            if ('\\' !== $prefix[$length - 1]) {
252
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
250
+            $length = strlen( $prefix );
251
+            if ( '\\' !== $prefix[ $length - 1 ] ) {
252
+                throw new \InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." );
253 253
             }
254
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
255
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
256
-        } elseif ($prepend) {
254
+            $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length;
255
+            $this->prefixDirsPsr4[ $prefix ] = (array)$paths;
256
+        } elseif ( $prepend ) {
257 257
             // Prepend directories for an already registered namespace.
258
-            $this->prefixDirsPsr4[$prefix] = array_merge(
259
-                (array) $paths,
260
-                $this->prefixDirsPsr4[$prefix]
258
+            $this->prefixDirsPsr4[ $prefix ] = array_merge(
259
+                (array)$paths,
260
+                $this->prefixDirsPsr4[ $prefix ]
261 261
             );
262 262
         } else {
263 263
             // Append directories for an already registered namespace.
264
-            $this->prefixDirsPsr4[$prefix] = array_merge(
265
-                $this->prefixDirsPsr4[$prefix],
266
-                (array) $paths
264
+            $this->prefixDirsPsr4[ $prefix ] = array_merge(
265
+                $this->prefixDirsPsr4[ $prefix ],
266
+                (array)$paths
267 267
             );
268 268
         }
269 269
     }
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
      *
278 278
      * @return void
279 279
      */
280
-    public function set($prefix, $paths)
280
+    public function set( $prefix, $paths )
281 281
     {
282
-        if (!$prefix) {
283
-            $this->fallbackDirsPsr0 = (array) $paths;
282
+        if ( ! $prefix ) {
283
+            $this->fallbackDirsPsr0 = (array)$paths;
284 284
         } else {
285
-            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
285
+            $this->prefixesPsr0[ $prefix[ 0 ] ][ $prefix ] = (array)$paths;
286 286
         }
287 287
     }
288 288
 
@@ -297,17 +297,17 @@  discard block
 block discarded – undo
297 297
      *
298 298
      * @return void
299 299
      */
300
-    public function setPsr4($prefix, $paths)
300
+    public function setPsr4( $prefix, $paths )
301 301
     {
302
-        if (!$prefix) {
303
-            $this->fallbackDirsPsr4 = (array) $paths;
302
+        if ( ! $prefix ) {
303
+            $this->fallbackDirsPsr4 = (array)$paths;
304 304
         } else {
305
-            $length = strlen($prefix);
306
-            if ('\\' !== $prefix[$length - 1]) {
307
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
305
+            $length = strlen( $prefix );
306
+            if ( '\\' !== $prefix[ $length - 1 ] ) {
307
+                throw new \InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." );
308 308
             }
309
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
310
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
309
+            $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length;
310
+            $this->prefixDirsPsr4[ $prefix ] = (array)$paths;
311 311
         }
312 312
     }
313 313
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      *
319 319
      * @return void
320 320
      */
321
-    public function setUseIncludePath($useIncludePath)
321
+    public function setUseIncludePath( $useIncludePath )
322 322
     {
323 323
         $this->useIncludePath = $useIncludePath;
324 324
     }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      *
343 343
      * @return void
344 344
      */
345
-    public function setClassMapAuthoritative($classMapAuthoritative)
345
+    public function setClassMapAuthoritative( $classMapAuthoritative )
346 346
     {
347 347
         $this->classMapAuthoritative = $classMapAuthoritative;
348 348
     }
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
      *
365 365
      * @return void
366 366
      */
367
-    public function setApcuPrefix($apcuPrefix)
367
+    public function setApcuPrefix( $apcuPrefix )
368 368
     {
369
-        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
369
+        $this->apcuPrefix = function_exists( 'apcu_fetch' ) && filter_var( ini_get( 'apc.enabled' ), FILTER_VALIDATE_BOOLEAN ) ? $apcuPrefix : null;
370 370
     }
371 371
 
372 372
     /**
@@ -386,19 +386,19 @@  discard block
 block discarded – undo
386 386
      *
387 387
      * @return void
388 388
      */
389
-    public function register($prepend = false)
389
+    public function register( $prepend = false )
390 390
     {
391
-        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
391
+        spl_autoload_register( array( $this, 'loadClass' ), true, $prepend );
392 392
 
393
-        if (null === $this->vendorDir) {
393
+        if ( null === $this->vendorDir ) {
394 394
             return;
395 395
         }
396 396
 
397
-        if ($prepend) {
398
-            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
397
+        if ( $prepend ) {
398
+            self::$registeredLoaders = array( $this->vendorDir => $this ) + self::$registeredLoaders;
399 399
         } else {
400
-            unset(self::$registeredLoaders[$this->vendorDir]);
401
-            self::$registeredLoaders[$this->vendorDir] = $this;
400
+            unset( self::$registeredLoaders[ $this->vendorDir ] );
401
+            self::$registeredLoaders[ $this->vendorDir ] = $this;
402 402
         }
403 403
     }
404 404
 
@@ -409,10 +409,10 @@  discard block
 block discarded – undo
409 409
      */
410 410
     public function unregister()
411 411
     {
412
-        spl_autoload_unregister(array($this, 'loadClass'));
412
+        spl_autoload_unregister( array( $this, 'loadClass' ) );
413 413
 
414
-        if (null !== $this->vendorDir) {
415
-            unset(self::$registeredLoaders[$this->vendorDir]);
414
+        if ( null !== $this->vendorDir ) {
415
+            unset( self::$registeredLoaders[ $this->vendorDir ] );
416 416
         }
417 417
     }
418 418
 
@@ -422,10 +422,10 @@  discard block
 block discarded – undo
422 422
      * @param  string    $class The name of the class
423 423
      * @return true|null True if loaded, null otherwise
424 424
      */
425
-    public function loadClass($class)
425
+    public function loadClass( $class )
426 426
     {
427
-        if ($file = $this->findFile($class)) {
428
-            includeFile($file);
427
+        if ( $file = $this->findFile( $class ) ) {
428
+            includeFile( $file );
429 429
 
430 430
             return true;
431 431
         }
@@ -440,36 +440,36 @@  discard block
 block discarded – undo
440 440
      *
441 441
      * @return string|false The path if found, false otherwise
442 442
      */
443
-    public function findFile($class)
443
+    public function findFile( $class )
444 444
     {
445 445
         // class map lookup
446
-        if (isset($this->classMap[$class])) {
447
-            return $this->classMap[$class];
446
+        if ( isset( $this->classMap[ $class ] ) ) {
447
+            return $this->classMap[ $class ];
448 448
         }
449
-        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
449
+        if ( $this->classMapAuthoritative || isset( $this->missingClasses[ $class ] ) ) {
450 450
             return false;
451 451
         }
452
-        if (null !== $this->apcuPrefix) {
453
-            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
454
-            if ($hit) {
452
+        if ( null !== $this->apcuPrefix ) {
453
+            $file = apcu_fetch( $this->apcuPrefix . $class, $hit );
454
+            if ( $hit ) {
455 455
                 return $file;
456 456
             }
457 457
         }
458 458
 
459
-        $file = $this->findFileWithExtension($class, '.php');
459
+        $file = $this->findFileWithExtension( $class, '.php' );
460 460
 
461 461
         // Search for Hack files if we are running on HHVM
462
-        if (false === $file && defined('HHVM_VERSION')) {
463
-            $file = $this->findFileWithExtension($class, '.hh');
462
+        if ( false === $file && defined( 'HHVM_VERSION' ) ) {
463
+            $file = $this->findFileWithExtension( $class, '.hh' );
464 464
         }
465 465
 
466
-        if (null !== $this->apcuPrefix) {
467
-            apcu_add($this->apcuPrefix.$class, $file);
466
+        if ( null !== $this->apcuPrefix ) {
467
+            apcu_add( $this->apcuPrefix . $class, $file );
468 468
         }
469 469
 
470
-        if (false === $file) {
470
+        if ( false === $file ) {
471 471
             // Remember that this class does not exist.
472
-            $this->missingClasses[$class] = true;
472
+            $this->missingClasses[ $class ] = true;
473 473
         }
474 474
 
475 475
         return $file;
@@ -490,21 +490,21 @@  discard block
 block discarded – undo
490 490
      * @param  string       $ext
491 491
      * @return string|false
492 492
      */
493
-    private function findFileWithExtension($class, $ext)
493
+    private function findFileWithExtension( $class, $ext )
494 494
     {
495 495
         // PSR-4 lookup
496
-        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
496
+        $logicalPathPsr4 = strtr( $class, '\\', DIRECTORY_SEPARATOR ) . $ext;
497 497
 
498
-        $first = $class[0];
499
-        if (isset($this->prefixLengthsPsr4[$first])) {
498
+        $first = $class[ 0 ];
499
+        if ( isset( $this->prefixLengthsPsr4[ $first ] ) ) {
500 500
             $subPath = $class;
501
-            while (false !== $lastPos = strrpos($subPath, '\\')) {
502
-                $subPath = substr($subPath, 0, $lastPos);
501
+            while ( false !== $lastPos = strrpos( $subPath, '\\' ) ) {
502
+                $subPath = substr( $subPath, 0, $lastPos );
503 503
                 $search = $subPath . '\\';
504
-                if (isset($this->prefixDirsPsr4[$search])) {
505
-                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
506
-                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
507
-                        if (file_exists($file = $dir . $pathEnd)) {
504
+                if ( isset( $this->prefixDirsPsr4[ $search ] ) ) {
505
+                    $pathEnd = DIRECTORY_SEPARATOR . substr( $logicalPathPsr4, $lastPos + 1 );
506
+                    foreach ( $this->prefixDirsPsr4[ $search ] as $dir ) {
507
+                        if ( file_exists( $file = $dir . $pathEnd ) ) {
508 508
                             return $file;
509 509
                         }
510 510
                     }
@@ -513,27 +513,27 @@  discard block
 block discarded – undo
513 513
         }
514 514
 
515 515
         // PSR-4 fallback dirs
516
-        foreach ($this->fallbackDirsPsr4 as $dir) {
517
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
516
+        foreach ( $this->fallbackDirsPsr4 as $dir ) {
517
+            if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4 ) ) {
518 518
                 return $file;
519 519
             }
520 520
         }
521 521
 
522 522
         // PSR-0 lookup
523
-        if (false !== $pos = strrpos($class, '\\')) {
523
+        if ( false !== $pos = strrpos( $class, '\\' ) ) {
524 524
             // namespaced class name
525
-            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
526
-                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
525
+            $logicalPathPsr0 = substr( $logicalPathPsr4, 0, $pos + 1 )
526
+                . strtr( substr( $logicalPathPsr4, $pos + 1 ), '_', DIRECTORY_SEPARATOR );
527 527
         } else {
528 528
             // PEAR-like class name
529
-            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
529
+            $logicalPathPsr0 = strtr( $class, '_', DIRECTORY_SEPARATOR ) . $ext;
530 530
         }
531 531
 
532
-        if (isset($this->prefixesPsr0[$first])) {
533
-            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
534
-                if (0 === strpos($class, $prefix)) {
535
-                    foreach ($dirs as $dir) {
536
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
532
+        if ( isset( $this->prefixesPsr0[ $first ] ) ) {
533
+            foreach ( $this->prefixesPsr0[ $first ] as $prefix => $dirs ) {
534
+                if ( 0 === strpos( $class, $prefix ) ) {
535
+                    foreach ( $dirs as $dir ) {
536
+                        if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
537 537
                             return $file;
538 538
                         }
539 539
                     }
@@ -542,14 +542,14 @@  discard block
 block discarded – undo
542 542
         }
543 543
 
544 544
         // PSR-0 fallback dirs
545
-        foreach ($this->fallbackDirsPsr0 as $dir) {
546
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
545
+        foreach ( $this->fallbackDirsPsr0 as $dir ) {
546
+            if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
547 547
                 return $file;
548 548
             }
549 549
         }
550 550
 
551 551
         // PSR-0 include paths.
552
-        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
552
+        if ( $this->useIncludePath && $file = stream_resolve_include_path( $logicalPathPsr0 ) ) {
553 553
             return $file;
554 554
         }
555 555
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
  * @return void
567 567
  * @private
568 568
  */
569
-function includeFile($file)
569
+function includeFile( $file )
570 570
 {
571 571
     include $file;
572 572
 }
Please login to merge, or discard this patch.
Indentation   +514 added lines, -514 removed lines patch added patch discarded remove patch
@@ -42,519 +42,519 @@  discard block
 block discarded – undo
42 42
  */
43 43
 class ClassLoader
44 44
 {
45
-    /** @var ?string */
46
-    private $vendorDir;
47
-
48
-    // PSR-4
49
-    /**
50
-     * @var array[]
51
-     * @psalm-var array<string, array<string, int>>
52
-     */
53
-    private $prefixLengthsPsr4 = array();
54
-    /**
55
-     * @var array[]
56
-     * @psalm-var array<string, array<int, string>>
57
-     */
58
-    private $prefixDirsPsr4 = array();
59
-    /**
60
-     * @var array[]
61
-     * @psalm-var array<string, string>
62
-     */
63
-    private $fallbackDirsPsr4 = array();
64
-
65
-    // PSR-0
66
-    /**
67
-     * @var array[]
68
-     * @psalm-var array<string, array<string, string[]>>
69
-     */
70
-    private $prefixesPsr0 = array();
71
-    /**
72
-     * @var array[]
73
-     * @psalm-var array<string, string>
74
-     */
75
-    private $fallbackDirsPsr0 = array();
76
-
77
-    /** @var bool */
78
-    private $useIncludePath = false;
79
-
80
-    /**
81
-     * @var string[]
82
-     * @psalm-var array<string, string>
83
-     */
84
-    private $classMap = array();
85
-
86
-    /** @var bool */
87
-    private $classMapAuthoritative = false;
88
-
89
-    /**
90
-     * @var bool[]
91
-     * @psalm-var array<string, bool>
92
-     */
93
-    private $missingClasses = array();
94
-
95
-    /** @var ?string */
96
-    private $apcuPrefix;
97
-
98
-    /**
99
-     * @var self[]
100
-     */
101
-    private static $registeredLoaders = array();
102
-
103
-    /**
104
-     * @param ?string $vendorDir
105
-     */
106
-    public function __construct($vendorDir = null)
107
-    {
108
-        $this->vendorDir = $vendorDir;
109
-    }
110
-
111
-    /**
112
-     * @return string[]
113
-     */
114
-    public function getPrefixes()
115
-    {
116
-        if (!empty($this->prefixesPsr0)) {
117
-            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
118
-        }
119
-
120
-        return array();
121
-    }
122
-
123
-    /**
124
-     * @return array[]
125
-     * @psalm-return array<string, array<int, string>>
126
-     */
127
-    public function getPrefixesPsr4()
128
-    {
129
-        return $this->prefixDirsPsr4;
130
-    }
131
-
132
-    /**
133
-     * @return array[]
134
-     * @psalm-return array<string, string>
135
-     */
136
-    public function getFallbackDirs()
137
-    {
138
-        return $this->fallbackDirsPsr0;
139
-    }
140
-
141
-    /**
142
-     * @return array[]
143
-     * @psalm-return array<string, string>
144
-     */
145
-    public function getFallbackDirsPsr4()
146
-    {
147
-        return $this->fallbackDirsPsr4;
148
-    }
149
-
150
-    /**
151
-     * @return string[] Array of classname => path
152
-     * @psalm-return array<string, string>
153
-     */
154
-    public function getClassMap()
155
-    {
156
-        return $this->classMap;
157
-    }
158
-
159
-    /**
160
-     * @param string[] $classMap Class to filename map
161
-     * @psalm-param array<string, string> $classMap
162
-     *
163
-     * @return void
164
-     */
165
-    public function addClassMap(array $classMap)
166
-    {
167
-        if ($this->classMap) {
168
-            $this->classMap = array_merge($this->classMap, $classMap);
169
-        } else {
170
-            $this->classMap = $classMap;
171
-        }
172
-    }
173
-
174
-    /**
175
-     * Registers a set of PSR-0 directories for a given prefix, either
176
-     * appending or prepending to the ones previously set for this prefix.
177
-     *
178
-     * @param string          $prefix  The prefix
179
-     * @param string[]|string $paths   The PSR-0 root directories
180
-     * @param bool            $prepend Whether to prepend the directories
181
-     *
182
-     * @return void
183
-     */
184
-    public function add($prefix, $paths, $prepend = false)
185
-    {
186
-        if (!$prefix) {
187
-            if ($prepend) {
188
-                $this->fallbackDirsPsr0 = array_merge(
189
-                    (array) $paths,
190
-                    $this->fallbackDirsPsr0
191
-                );
192
-            } else {
193
-                $this->fallbackDirsPsr0 = array_merge(
194
-                    $this->fallbackDirsPsr0,
195
-                    (array) $paths
196
-                );
197
-            }
198
-
199
-            return;
200
-        }
201
-
202
-        $first = $prefix[0];
203
-        if (!isset($this->prefixesPsr0[$first][$prefix])) {
204
-            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
205
-
206
-            return;
207
-        }
208
-        if ($prepend) {
209
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
210
-                (array) $paths,
211
-                $this->prefixesPsr0[$first][$prefix]
212
-            );
213
-        } else {
214
-            $this->prefixesPsr0[$first][$prefix] = array_merge(
215
-                $this->prefixesPsr0[$first][$prefix],
216
-                (array) $paths
217
-            );
218
-        }
219
-    }
220
-
221
-    /**
222
-     * Registers a set of PSR-4 directories for a given namespace, either
223
-     * appending or prepending to the ones previously set for this namespace.
224
-     *
225
-     * @param string          $prefix  The prefix/namespace, with trailing '\\'
226
-     * @param string[]|string $paths   The PSR-4 base directories
227
-     * @param bool            $prepend Whether to prepend the directories
228
-     *
229
-     * @throws \InvalidArgumentException
230
-     *
231
-     * @return void
232
-     */
233
-    public function addPsr4($prefix, $paths, $prepend = false)
234
-    {
235
-        if (!$prefix) {
236
-            // Register directories for the root namespace.
237
-            if ($prepend) {
238
-                $this->fallbackDirsPsr4 = array_merge(
239
-                    (array) $paths,
240
-                    $this->fallbackDirsPsr4
241
-                );
242
-            } else {
243
-                $this->fallbackDirsPsr4 = array_merge(
244
-                    $this->fallbackDirsPsr4,
245
-                    (array) $paths
246
-                );
247
-            }
248
-        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
249
-            // Register directories for a new namespace.
250
-            $length = strlen($prefix);
251
-            if ('\\' !== $prefix[$length - 1]) {
252
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
253
-            }
254
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
255
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
256
-        } elseif ($prepend) {
257
-            // Prepend directories for an already registered namespace.
258
-            $this->prefixDirsPsr4[$prefix] = array_merge(
259
-                (array) $paths,
260
-                $this->prefixDirsPsr4[$prefix]
261
-            );
262
-        } else {
263
-            // Append directories for an already registered namespace.
264
-            $this->prefixDirsPsr4[$prefix] = array_merge(
265
-                $this->prefixDirsPsr4[$prefix],
266
-                (array) $paths
267
-            );
268
-        }
269
-    }
270
-
271
-    /**
272
-     * Registers a set of PSR-0 directories for a given prefix,
273
-     * replacing any others previously set for this prefix.
274
-     *
275
-     * @param string          $prefix The prefix
276
-     * @param string[]|string $paths  The PSR-0 base directories
277
-     *
278
-     * @return void
279
-     */
280
-    public function set($prefix, $paths)
281
-    {
282
-        if (!$prefix) {
283
-            $this->fallbackDirsPsr0 = (array) $paths;
284
-        } else {
285
-            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
286
-        }
287
-    }
288
-
289
-    /**
290
-     * Registers a set of PSR-4 directories for a given namespace,
291
-     * replacing any others previously set for this namespace.
292
-     *
293
-     * @param string          $prefix The prefix/namespace, with trailing '\\'
294
-     * @param string[]|string $paths  The PSR-4 base directories
295
-     *
296
-     * @throws \InvalidArgumentException
297
-     *
298
-     * @return void
299
-     */
300
-    public function setPsr4($prefix, $paths)
301
-    {
302
-        if (!$prefix) {
303
-            $this->fallbackDirsPsr4 = (array) $paths;
304
-        } else {
305
-            $length = strlen($prefix);
306
-            if ('\\' !== $prefix[$length - 1]) {
307
-                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
308
-            }
309
-            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
310
-            $this->prefixDirsPsr4[$prefix] = (array) $paths;
311
-        }
312
-    }
313
-
314
-    /**
315
-     * Turns on searching the include path for class files.
316
-     *
317
-     * @param bool $useIncludePath
318
-     *
319
-     * @return void
320
-     */
321
-    public function setUseIncludePath($useIncludePath)
322
-    {
323
-        $this->useIncludePath = $useIncludePath;
324
-    }
325
-
326
-    /**
327
-     * Can be used to check if the autoloader uses the include path to check
328
-     * for classes.
329
-     *
330
-     * @return bool
331
-     */
332
-    public function getUseIncludePath()
333
-    {
334
-        return $this->useIncludePath;
335
-    }
336
-
337
-    /**
338
-     * Turns off searching the prefix and fallback directories for classes
339
-     * that have not been registered with the class map.
340
-     *
341
-     * @param bool $classMapAuthoritative
342
-     *
343
-     * @return void
344
-     */
345
-    public function setClassMapAuthoritative($classMapAuthoritative)
346
-    {
347
-        $this->classMapAuthoritative = $classMapAuthoritative;
348
-    }
349
-
350
-    /**
351
-     * Should class lookup fail if not found in the current class map?
352
-     *
353
-     * @return bool
354
-     */
355
-    public function isClassMapAuthoritative()
356
-    {
357
-        return $this->classMapAuthoritative;
358
-    }
359
-
360
-    /**
361
-     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362
-     *
363
-     * @param string|null $apcuPrefix
364
-     *
365
-     * @return void
366
-     */
367
-    public function setApcuPrefix($apcuPrefix)
368
-    {
369
-        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
370
-    }
371
-
372
-    /**
373
-     * The APCu prefix in use, or null if APCu caching is not enabled.
374
-     *
375
-     * @return string|null
376
-     */
377
-    public function getApcuPrefix()
378
-    {
379
-        return $this->apcuPrefix;
380
-    }
381
-
382
-    /**
383
-     * Registers this instance as an autoloader.
384
-     *
385
-     * @param bool $prepend Whether to prepend the autoloader or not
386
-     *
387
-     * @return void
388
-     */
389
-    public function register($prepend = false)
390
-    {
391
-        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
392
-
393
-        if (null === $this->vendorDir) {
394
-            return;
395
-        }
396
-
397
-        if ($prepend) {
398
-            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
399
-        } else {
400
-            unset(self::$registeredLoaders[$this->vendorDir]);
401
-            self::$registeredLoaders[$this->vendorDir] = $this;
402
-        }
403
-    }
404
-
405
-    /**
406
-     * Unregisters this instance as an autoloader.
407
-     *
408
-     * @return void
409
-     */
410
-    public function unregister()
411
-    {
412
-        spl_autoload_unregister(array($this, 'loadClass'));
413
-
414
-        if (null !== $this->vendorDir) {
415
-            unset(self::$registeredLoaders[$this->vendorDir]);
416
-        }
417
-    }
418
-
419
-    /**
420
-     * Loads the given class or interface.
421
-     *
422
-     * @param  string    $class The name of the class
423
-     * @return true|null True if loaded, null otherwise
424
-     */
425
-    public function loadClass($class)
426
-    {
427
-        if ($file = $this->findFile($class)) {
428
-            includeFile($file);
429
-
430
-            return true;
431
-        }
432
-
433
-        return null;
434
-    }
435
-
436
-    /**
437
-     * Finds the path to the file where the class is defined.
438
-     *
439
-     * @param string $class The name of the class
440
-     *
441
-     * @return string|false The path if found, false otherwise
442
-     */
443
-    public function findFile($class)
444
-    {
445
-        // class map lookup
446
-        if (isset($this->classMap[$class])) {
447
-            return $this->classMap[$class];
448
-        }
449
-        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
450
-            return false;
451
-        }
452
-        if (null !== $this->apcuPrefix) {
453
-            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
454
-            if ($hit) {
455
-                return $file;
456
-            }
457
-        }
458
-
459
-        $file = $this->findFileWithExtension($class, '.php');
460
-
461
-        // Search for Hack files if we are running on HHVM
462
-        if (false === $file && defined('HHVM_VERSION')) {
463
-            $file = $this->findFileWithExtension($class, '.hh');
464
-        }
465
-
466
-        if (null !== $this->apcuPrefix) {
467
-            apcu_add($this->apcuPrefix.$class, $file);
468
-        }
469
-
470
-        if (false === $file) {
471
-            // Remember that this class does not exist.
472
-            $this->missingClasses[$class] = true;
473
-        }
474
-
475
-        return $file;
476
-    }
477
-
478
-    /**
479
-     * Returns the currently registered loaders indexed by their corresponding vendor directories.
480
-     *
481
-     * @return self[]
482
-     */
483
-    public static function getRegisteredLoaders()
484
-    {
485
-        return self::$registeredLoaders;
486
-    }
487
-
488
-    /**
489
-     * @param  string       $class
490
-     * @param  string       $ext
491
-     * @return string|false
492
-     */
493
-    private function findFileWithExtension($class, $ext)
494
-    {
495
-        // PSR-4 lookup
496
-        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
497
-
498
-        $first = $class[0];
499
-        if (isset($this->prefixLengthsPsr4[$first])) {
500
-            $subPath = $class;
501
-            while (false !== $lastPos = strrpos($subPath, '\\')) {
502
-                $subPath = substr($subPath, 0, $lastPos);
503
-                $search = $subPath . '\\';
504
-                if (isset($this->prefixDirsPsr4[$search])) {
505
-                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
506
-                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
507
-                        if (file_exists($file = $dir . $pathEnd)) {
508
-                            return $file;
509
-                        }
510
-                    }
511
-                }
512
-            }
513
-        }
514
-
515
-        // PSR-4 fallback dirs
516
-        foreach ($this->fallbackDirsPsr4 as $dir) {
517
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
518
-                return $file;
519
-            }
520
-        }
521
-
522
-        // PSR-0 lookup
523
-        if (false !== $pos = strrpos($class, '\\')) {
524
-            // namespaced class name
525
-            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
526
-                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
527
-        } else {
528
-            // PEAR-like class name
529
-            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
530
-        }
531
-
532
-        if (isset($this->prefixesPsr0[$first])) {
533
-            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
534
-                if (0 === strpos($class, $prefix)) {
535
-                    foreach ($dirs as $dir) {
536
-                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
537
-                            return $file;
538
-                        }
539
-                    }
540
-                }
541
-            }
542
-        }
543
-
544
-        // PSR-0 fallback dirs
545
-        foreach ($this->fallbackDirsPsr0 as $dir) {
546
-            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
547
-                return $file;
548
-            }
549
-        }
550
-
551
-        // PSR-0 include paths.
552
-        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
553
-            return $file;
554
-        }
555
-
556
-        return false;
557
-    }
45
+	/** @var ?string */
46
+	private $vendorDir;
47
+
48
+	// PSR-4
49
+	/**
50
+	 * @var array[]
51
+	 * @psalm-var array<string, array<string, int>>
52
+	 */
53
+	private $prefixLengthsPsr4 = array();
54
+	/**
55
+	 * @var array[]
56
+	 * @psalm-var array<string, array<int, string>>
57
+	 */
58
+	private $prefixDirsPsr4 = array();
59
+	/**
60
+	 * @var array[]
61
+	 * @psalm-var array<string, string>
62
+	 */
63
+	private $fallbackDirsPsr4 = array();
64
+
65
+	// PSR-0
66
+	/**
67
+	 * @var array[]
68
+	 * @psalm-var array<string, array<string, string[]>>
69
+	 */
70
+	private $prefixesPsr0 = array();
71
+	/**
72
+	 * @var array[]
73
+	 * @psalm-var array<string, string>
74
+	 */
75
+	private $fallbackDirsPsr0 = array();
76
+
77
+	/** @var bool */
78
+	private $useIncludePath = false;
79
+
80
+	/**
81
+	 * @var string[]
82
+	 * @psalm-var array<string, string>
83
+	 */
84
+	private $classMap = array();
85
+
86
+	/** @var bool */
87
+	private $classMapAuthoritative = false;
88
+
89
+	/**
90
+	 * @var bool[]
91
+	 * @psalm-var array<string, bool>
92
+	 */
93
+	private $missingClasses = array();
94
+
95
+	/** @var ?string */
96
+	private $apcuPrefix;
97
+
98
+	/**
99
+	 * @var self[]
100
+	 */
101
+	private static $registeredLoaders = array();
102
+
103
+	/**
104
+	 * @param ?string $vendorDir
105
+	 */
106
+	public function __construct($vendorDir = null)
107
+	{
108
+		$this->vendorDir = $vendorDir;
109
+	}
110
+
111
+	/**
112
+	 * @return string[]
113
+	 */
114
+	public function getPrefixes()
115
+	{
116
+		if (!empty($this->prefixesPsr0)) {
117
+			return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
118
+		}
119
+
120
+		return array();
121
+	}
122
+
123
+	/**
124
+	 * @return array[]
125
+	 * @psalm-return array<string, array<int, string>>
126
+	 */
127
+	public function getPrefixesPsr4()
128
+	{
129
+		return $this->prefixDirsPsr4;
130
+	}
131
+
132
+	/**
133
+	 * @return array[]
134
+	 * @psalm-return array<string, string>
135
+	 */
136
+	public function getFallbackDirs()
137
+	{
138
+		return $this->fallbackDirsPsr0;
139
+	}
140
+
141
+	/**
142
+	 * @return array[]
143
+	 * @psalm-return array<string, string>
144
+	 */
145
+	public function getFallbackDirsPsr4()
146
+	{
147
+		return $this->fallbackDirsPsr4;
148
+	}
149
+
150
+	/**
151
+	 * @return string[] Array of classname => path
152
+	 * @psalm-return array<string, string>
153
+	 */
154
+	public function getClassMap()
155
+	{
156
+		return $this->classMap;
157
+	}
158
+
159
+	/**
160
+	 * @param string[] $classMap Class to filename map
161
+	 * @psalm-param array<string, string> $classMap
162
+	 *
163
+	 * @return void
164
+	 */
165
+	public function addClassMap(array $classMap)
166
+	{
167
+		if ($this->classMap) {
168
+			$this->classMap = array_merge($this->classMap, $classMap);
169
+		} else {
170
+			$this->classMap = $classMap;
171
+		}
172
+	}
173
+
174
+	/**
175
+	 * Registers a set of PSR-0 directories for a given prefix, either
176
+	 * appending or prepending to the ones previously set for this prefix.
177
+	 *
178
+	 * @param string          $prefix  The prefix
179
+	 * @param string[]|string $paths   The PSR-0 root directories
180
+	 * @param bool            $prepend Whether to prepend the directories
181
+	 *
182
+	 * @return void
183
+	 */
184
+	public function add($prefix, $paths, $prepend = false)
185
+	{
186
+		if (!$prefix) {
187
+			if ($prepend) {
188
+				$this->fallbackDirsPsr0 = array_merge(
189
+					(array) $paths,
190
+					$this->fallbackDirsPsr0
191
+				);
192
+			} else {
193
+				$this->fallbackDirsPsr0 = array_merge(
194
+					$this->fallbackDirsPsr0,
195
+					(array) $paths
196
+				);
197
+			}
198
+
199
+			return;
200
+		}
201
+
202
+		$first = $prefix[0];
203
+		if (!isset($this->prefixesPsr0[$first][$prefix])) {
204
+			$this->prefixesPsr0[$first][$prefix] = (array) $paths;
205
+
206
+			return;
207
+		}
208
+		if ($prepend) {
209
+			$this->prefixesPsr0[$first][$prefix] = array_merge(
210
+				(array) $paths,
211
+				$this->prefixesPsr0[$first][$prefix]
212
+			);
213
+		} else {
214
+			$this->prefixesPsr0[$first][$prefix] = array_merge(
215
+				$this->prefixesPsr0[$first][$prefix],
216
+				(array) $paths
217
+			);
218
+		}
219
+	}
220
+
221
+	/**
222
+	 * Registers a set of PSR-4 directories for a given namespace, either
223
+	 * appending or prepending to the ones previously set for this namespace.
224
+	 *
225
+	 * @param string          $prefix  The prefix/namespace, with trailing '\\'
226
+	 * @param string[]|string $paths   The PSR-4 base directories
227
+	 * @param bool            $prepend Whether to prepend the directories
228
+	 *
229
+	 * @throws \InvalidArgumentException
230
+	 *
231
+	 * @return void
232
+	 */
233
+	public function addPsr4($prefix, $paths, $prepend = false)
234
+	{
235
+		if (!$prefix) {
236
+			// Register directories for the root namespace.
237
+			if ($prepend) {
238
+				$this->fallbackDirsPsr4 = array_merge(
239
+					(array) $paths,
240
+					$this->fallbackDirsPsr4
241
+				);
242
+			} else {
243
+				$this->fallbackDirsPsr4 = array_merge(
244
+					$this->fallbackDirsPsr4,
245
+					(array) $paths
246
+				);
247
+			}
248
+		} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
249
+			// Register directories for a new namespace.
250
+			$length = strlen($prefix);
251
+			if ('\\' !== $prefix[$length - 1]) {
252
+				throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
253
+			}
254
+			$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
255
+			$this->prefixDirsPsr4[$prefix] = (array) $paths;
256
+		} elseif ($prepend) {
257
+			// Prepend directories for an already registered namespace.
258
+			$this->prefixDirsPsr4[$prefix] = array_merge(
259
+				(array) $paths,
260
+				$this->prefixDirsPsr4[$prefix]
261
+			);
262
+		} else {
263
+			// Append directories for an already registered namespace.
264
+			$this->prefixDirsPsr4[$prefix] = array_merge(
265
+				$this->prefixDirsPsr4[$prefix],
266
+				(array) $paths
267
+			);
268
+		}
269
+	}
270
+
271
+	/**
272
+	 * Registers a set of PSR-0 directories for a given prefix,
273
+	 * replacing any others previously set for this prefix.
274
+	 *
275
+	 * @param string          $prefix The prefix
276
+	 * @param string[]|string $paths  The PSR-0 base directories
277
+	 *
278
+	 * @return void
279
+	 */
280
+	public function set($prefix, $paths)
281
+	{
282
+		if (!$prefix) {
283
+			$this->fallbackDirsPsr0 = (array) $paths;
284
+		} else {
285
+			$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
286
+		}
287
+	}
288
+
289
+	/**
290
+	 * Registers a set of PSR-4 directories for a given namespace,
291
+	 * replacing any others previously set for this namespace.
292
+	 *
293
+	 * @param string          $prefix The prefix/namespace, with trailing '\\'
294
+	 * @param string[]|string $paths  The PSR-4 base directories
295
+	 *
296
+	 * @throws \InvalidArgumentException
297
+	 *
298
+	 * @return void
299
+	 */
300
+	public function setPsr4($prefix, $paths)
301
+	{
302
+		if (!$prefix) {
303
+			$this->fallbackDirsPsr4 = (array) $paths;
304
+		} else {
305
+			$length = strlen($prefix);
306
+			if ('\\' !== $prefix[$length - 1]) {
307
+				throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
308
+			}
309
+			$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
310
+			$this->prefixDirsPsr4[$prefix] = (array) $paths;
311
+		}
312
+	}
313
+
314
+	/**
315
+	 * Turns on searching the include path for class files.
316
+	 *
317
+	 * @param bool $useIncludePath
318
+	 *
319
+	 * @return void
320
+	 */
321
+	public function setUseIncludePath($useIncludePath)
322
+	{
323
+		$this->useIncludePath = $useIncludePath;
324
+	}
325
+
326
+	/**
327
+	 * Can be used to check if the autoloader uses the include path to check
328
+	 * for classes.
329
+	 *
330
+	 * @return bool
331
+	 */
332
+	public function getUseIncludePath()
333
+	{
334
+		return $this->useIncludePath;
335
+	}
336
+
337
+	/**
338
+	 * Turns off searching the prefix and fallback directories for classes
339
+	 * that have not been registered with the class map.
340
+	 *
341
+	 * @param bool $classMapAuthoritative
342
+	 *
343
+	 * @return void
344
+	 */
345
+	public function setClassMapAuthoritative($classMapAuthoritative)
346
+	{
347
+		$this->classMapAuthoritative = $classMapAuthoritative;
348
+	}
349
+
350
+	/**
351
+	 * Should class lookup fail if not found in the current class map?
352
+	 *
353
+	 * @return bool
354
+	 */
355
+	public function isClassMapAuthoritative()
356
+	{
357
+		return $this->classMapAuthoritative;
358
+	}
359
+
360
+	/**
361
+	 * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362
+	 *
363
+	 * @param string|null $apcuPrefix
364
+	 *
365
+	 * @return void
366
+	 */
367
+	public function setApcuPrefix($apcuPrefix)
368
+	{
369
+		$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
370
+	}
371
+
372
+	/**
373
+	 * The APCu prefix in use, or null if APCu caching is not enabled.
374
+	 *
375
+	 * @return string|null
376
+	 */
377
+	public function getApcuPrefix()
378
+	{
379
+		return $this->apcuPrefix;
380
+	}
381
+
382
+	/**
383
+	 * Registers this instance as an autoloader.
384
+	 *
385
+	 * @param bool $prepend Whether to prepend the autoloader or not
386
+	 *
387
+	 * @return void
388
+	 */
389
+	public function register($prepend = false)
390
+	{
391
+		spl_autoload_register(array($this, 'loadClass'), true, $prepend);
392
+
393
+		if (null === $this->vendorDir) {
394
+			return;
395
+		}
396
+
397
+		if ($prepend) {
398
+			self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
399
+		} else {
400
+			unset(self::$registeredLoaders[$this->vendorDir]);
401
+			self::$registeredLoaders[$this->vendorDir] = $this;
402
+		}
403
+	}
404
+
405
+	/**
406
+	 * Unregisters this instance as an autoloader.
407
+	 *
408
+	 * @return void
409
+	 */
410
+	public function unregister()
411
+	{
412
+		spl_autoload_unregister(array($this, 'loadClass'));
413
+
414
+		if (null !== $this->vendorDir) {
415
+			unset(self::$registeredLoaders[$this->vendorDir]);
416
+		}
417
+	}
418
+
419
+	/**
420
+	 * Loads the given class or interface.
421
+	 *
422
+	 * @param  string    $class The name of the class
423
+	 * @return true|null True if loaded, null otherwise
424
+	 */
425
+	public function loadClass($class)
426
+	{
427
+		if ($file = $this->findFile($class)) {
428
+			includeFile($file);
429
+
430
+			return true;
431
+		}
432
+
433
+		return null;
434
+	}
435
+
436
+	/**
437
+	 * Finds the path to the file where the class is defined.
438
+	 *
439
+	 * @param string $class The name of the class
440
+	 *
441
+	 * @return string|false The path if found, false otherwise
442
+	 */
443
+	public function findFile($class)
444
+	{
445
+		// class map lookup
446
+		if (isset($this->classMap[$class])) {
447
+			return $this->classMap[$class];
448
+		}
449
+		if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
450
+			return false;
451
+		}
452
+		if (null !== $this->apcuPrefix) {
453
+			$file = apcu_fetch($this->apcuPrefix.$class, $hit);
454
+			if ($hit) {
455
+				return $file;
456
+			}
457
+		}
458
+
459
+		$file = $this->findFileWithExtension($class, '.php');
460
+
461
+		// Search for Hack files if we are running on HHVM
462
+		if (false === $file && defined('HHVM_VERSION')) {
463
+			$file = $this->findFileWithExtension($class, '.hh');
464
+		}
465
+
466
+		if (null !== $this->apcuPrefix) {
467
+			apcu_add($this->apcuPrefix.$class, $file);
468
+		}
469
+
470
+		if (false === $file) {
471
+			// Remember that this class does not exist.
472
+			$this->missingClasses[$class] = true;
473
+		}
474
+
475
+		return $file;
476
+	}
477
+
478
+	/**
479
+	 * Returns the currently registered loaders indexed by their corresponding vendor directories.
480
+	 *
481
+	 * @return self[]
482
+	 */
483
+	public static function getRegisteredLoaders()
484
+	{
485
+		return self::$registeredLoaders;
486
+	}
487
+
488
+	/**
489
+	 * @param  string       $class
490
+	 * @param  string       $ext
491
+	 * @return string|false
492
+	 */
493
+	private function findFileWithExtension($class, $ext)
494
+	{
495
+		// PSR-4 lookup
496
+		$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
497
+
498
+		$first = $class[0];
499
+		if (isset($this->prefixLengthsPsr4[$first])) {
500
+			$subPath = $class;
501
+			while (false !== $lastPos = strrpos($subPath, '\\')) {
502
+				$subPath = substr($subPath, 0, $lastPos);
503
+				$search = $subPath . '\\';
504
+				if (isset($this->prefixDirsPsr4[$search])) {
505
+					$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
506
+					foreach ($this->prefixDirsPsr4[$search] as $dir) {
507
+						if (file_exists($file = $dir . $pathEnd)) {
508
+							return $file;
509
+						}
510
+					}
511
+				}
512
+			}
513
+		}
514
+
515
+		// PSR-4 fallback dirs
516
+		foreach ($this->fallbackDirsPsr4 as $dir) {
517
+			if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
518
+				return $file;
519
+			}
520
+		}
521
+
522
+		// PSR-0 lookup
523
+		if (false !== $pos = strrpos($class, '\\')) {
524
+			// namespaced class name
525
+			$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
526
+				. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
527
+		} else {
528
+			// PEAR-like class name
529
+			$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
530
+		}
531
+
532
+		if (isset($this->prefixesPsr0[$first])) {
533
+			foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
534
+				if (0 === strpos($class, $prefix)) {
535
+					foreach ($dirs as $dir) {
536
+						if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
537
+							return $file;
538
+						}
539
+					}
540
+				}
541
+			}
542
+		}
543
+
544
+		// PSR-0 fallback dirs
545
+		foreach ($this->fallbackDirsPsr0 as $dir) {
546
+			if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
547
+				return $file;
548
+			}
549
+		}
550
+
551
+		// PSR-0 include paths.
552
+		if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
553
+			return $file;
554
+		}
555
+
556
+		return false;
557
+	}
558 558
 }
559 559
 
560 560
 /**
@@ -568,5 +568,5 @@  discard block
 block discarded – undo
568 568
  */
569 569
 function includeFile($file)
570 570
 {
571
-    include $file;
571
+	include $file;
572 572
 }
Please login to merge, or discard this patch.
Braces   +25 added lines, -50 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
  * @see    https://www.php-fig.org/psr/psr-0/
41 41
  * @see    https://www.php-fig.org/psr/psr-4/
42 42
  */
43
-class ClassLoader
44
-{
43
+class ClassLoader {
45 44
     /** @var ?string */
46 45
     private $vendorDir;
47 46
 
@@ -103,16 +102,14 @@  discard block
 block discarded – undo
103 102
     /**
104 103
      * @param ?string $vendorDir
105 104
      */
106
-    public function __construct($vendorDir = null)
107
-    {
105
+    public function __construct($vendorDir = null) {
108 106
         $this->vendorDir = $vendorDir;
109 107
     }
110 108
 
111 109
     /**
112 110
      * @return string[]
113 111
      */
114
-    public function getPrefixes()
115
-    {
112
+    public function getPrefixes() {
116 113
         if (!empty($this->prefixesPsr0)) {
117 114
             return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
118 115
         }
@@ -124,8 +121,7 @@  discard block
 block discarded – undo
124 121
      * @return array[]
125 122
      * @psalm-return array<string, array<int, string>>
126 123
      */
127
-    public function getPrefixesPsr4()
128
-    {
124
+    public function getPrefixesPsr4() {
129 125
         return $this->prefixDirsPsr4;
130 126
     }
131 127
 
@@ -133,8 +129,7 @@  discard block
 block discarded – undo
133 129
      * @return array[]
134 130
      * @psalm-return array<string, string>
135 131
      */
136
-    public function getFallbackDirs()
137
-    {
132
+    public function getFallbackDirs() {
138 133
         return $this->fallbackDirsPsr0;
139 134
     }
140 135
 
@@ -142,8 +137,7 @@  discard block
 block discarded – undo
142 137
      * @return array[]
143 138
      * @psalm-return array<string, string>
144 139
      */
145
-    public function getFallbackDirsPsr4()
146
-    {
140
+    public function getFallbackDirsPsr4() {
147 141
         return $this->fallbackDirsPsr4;
148 142
     }
149 143
 
@@ -151,8 +145,7 @@  discard block
 block discarded – undo
151 145
      * @return string[] Array of classname => path
152 146
      * @psalm-return array<string, string>
153 147
      */
154
-    public function getClassMap()
155
-    {
148
+    public function getClassMap() {
156 149
         return $this->classMap;
157 150
     }
158 151
 
@@ -162,8 +155,7 @@  discard block
 block discarded – undo
162 155
      *
163 156
      * @return void
164 157
      */
165
-    public function addClassMap(array $classMap)
166
-    {
158
+    public function addClassMap(array $classMap) {
167 159
         if ($this->classMap) {
168 160
             $this->classMap = array_merge($this->classMap, $classMap);
169 161
         } else {
@@ -181,8 +173,7 @@  discard block
 block discarded – undo
181 173
      *
182 174
      * @return void
183 175
      */
184
-    public function add($prefix, $paths, $prepend = false)
185
-    {
176
+    public function add($prefix, $paths, $prepend = false) {
186 177
         if (!$prefix) {
187 178
             if ($prepend) {
188 179
                 $this->fallbackDirsPsr0 = array_merge(
@@ -230,8 +221,7 @@  discard block
 block discarded – undo
230 221
      *
231 222
      * @return void
232 223
      */
233
-    public function addPsr4($prefix, $paths, $prepend = false)
234
-    {
224
+    public function addPsr4($prefix, $paths, $prepend = false) {
235 225
         if (!$prefix) {
236 226
             // Register directories for the root namespace.
237 227
             if ($prepend) {
@@ -277,8 +267,7 @@  discard block
 block discarded – undo
277 267
      *
278 268
      * @return void
279 269
      */
280
-    public function set($prefix, $paths)
281
-    {
270
+    public function set($prefix, $paths) {
282 271
         if (!$prefix) {
283 272
             $this->fallbackDirsPsr0 = (array) $paths;
284 273
         } else {
@@ -297,8 +286,7 @@  discard block
 block discarded – undo
297 286
      *
298 287
      * @return void
299 288
      */
300
-    public function setPsr4($prefix, $paths)
301
-    {
289
+    public function setPsr4($prefix, $paths) {
302 290
         if (!$prefix) {
303 291
             $this->fallbackDirsPsr4 = (array) $paths;
304 292
         } else {
@@ -318,8 +306,7 @@  discard block
 block discarded – undo
318 306
      *
319 307
      * @return void
320 308
      */
321
-    public function setUseIncludePath($useIncludePath)
322
-    {
309
+    public function setUseIncludePath($useIncludePath) {
323 310
         $this->useIncludePath = $useIncludePath;
324 311
     }
325 312
 
@@ -329,8 +316,7 @@  discard block
 block discarded – undo
329 316
      *
330 317
      * @return bool
331 318
      */
332
-    public function getUseIncludePath()
333
-    {
319
+    public function getUseIncludePath() {
334 320
         return $this->useIncludePath;
335 321
     }
336 322
 
@@ -342,8 +328,7 @@  discard block
 block discarded – undo
342 328
      *
343 329
      * @return void
344 330
      */
345
-    public function setClassMapAuthoritative($classMapAuthoritative)
346
-    {
331
+    public function setClassMapAuthoritative($classMapAuthoritative) {
347 332
         $this->classMapAuthoritative = $classMapAuthoritative;
348 333
     }
349 334
 
@@ -352,8 +337,7 @@  discard block
 block discarded – undo
352 337
      *
353 338
      * @return bool
354 339
      */
355
-    public function isClassMapAuthoritative()
356
-    {
340
+    public function isClassMapAuthoritative() {
357 341
         return $this->classMapAuthoritative;
358 342
     }
359 343
 
@@ -364,8 +348,7 @@  discard block
 block discarded – undo
364 348
      *
365 349
      * @return void
366 350
      */
367
-    public function setApcuPrefix($apcuPrefix)
368
-    {
351
+    public function setApcuPrefix($apcuPrefix) {
369 352
         $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
370 353
     }
371 354
 
@@ -374,8 +357,7 @@  discard block
 block discarded – undo
374 357
      *
375 358
      * @return string|null
376 359
      */
377
-    public function getApcuPrefix()
378
-    {
360
+    public function getApcuPrefix() {
379 361
         return $this->apcuPrefix;
380 362
     }
381 363
 
@@ -386,8 +368,7 @@  discard block
 block discarded – undo
386 368
      *
387 369
      * @return void
388 370
      */
389
-    public function register($prepend = false)
390
-    {
371
+    public function register($prepend = false) {
391 372
         spl_autoload_register(array($this, 'loadClass'), true, $prepend);
392 373
 
393 374
         if (null === $this->vendorDir) {
@@ -407,8 +388,7 @@  discard block
 block discarded – undo
407 388
      *
408 389
      * @return void
409 390
      */
410
-    public function unregister()
411
-    {
391
+    public function unregister() {
412 392
         spl_autoload_unregister(array($this, 'loadClass'));
413 393
 
414 394
         if (null !== $this->vendorDir) {
@@ -422,8 +402,7 @@  discard block
 block discarded – undo
422 402
      * @param  string    $class The name of the class
423 403
      * @return true|null True if loaded, null otherwise
424 404
      */
425
-    public function loadClass($class)
426
-    {
405
+    public function loadClass($class) {
427 406
         if ($file = $this->findFile($class)) {
428 407
             includeFile($file);
429 408
 
@@ -440,8 +419,7 @@  discard block
 block discarded – undo
440 419
      *
441 420
      * @return string|false The path if found, false otherwise
442 421
      */
443
-    public function findFile($class)
444
-    {
422
+    public function findFile($class) {
445 423
         // class map lookup
446 424
         if (isset($this->classMap[$class])) {
447 425
             return $this->classMap[$class];
@@ -480,8 +458,7 @@  discard block
 block discarded – undo
480 458
      *
481 459
      * @return self[]
482 460
      */
483
-    public static function getRegisteredLoaders()
484
-    {
461
+    public static function getRegisteredLoaders() {
485 462
         return self::$registeredLoaders;
486 463
     }
487 464
 
@@ -490,8 +467,7 @@  discard block
 block discarded – undo
490 467
      * @param  string       $ext
491 468
      * @return string|false
492 469
      */
493
-    private function findFileWithExtension($class, $ext)
494
-    {
470
+    private function findFileWithExtension($class, $ext) {
495 471
         // PSR-4 lookup
496 472
         $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
497 473
 
@@ -566,7 +542,6 @@  discard block
 block discarded – undo
566 542
  * @return void
567 543
  * @private
568 544
  */
569
-function includeFile($file)
570
-{
545
+function includeFile($file) {
571 546
     include $file;
572 547
 }
Please login to merge, or discard this patch.
vendor/composer/InstalledVersions.php 3 patches
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
     public static function getInstalledPackages()
38 38
     {
39 39
         $packages = array();
40
-        foreach (self::getInstalled() as $installed) {
41
-            $packages[] = array_keys($installed['versions']);
40
+        foreach ( self::getInstalled() as $installed ) {
41
+            $packages[ ] = array_keys( $installed[ 'versions' ] );
42 42
         }
43 43
 
44
-        if (1 === \count($packages)) {
45
-            return $packages[0];
44
+        if ( 1 === \count( $packages ) ) {
45
+            return $packages[ 0 ];
46 46
         }
47 47
 
48
-        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
48
+        return array_keys( array_flip( \call_user_func_array( 'array_merge', $packages ) ) );
49 49
     }
50 50
 
51 51
     /**
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
      * @return string[]
56 56
      * @psalm-return list<string>
57 57
      */
58
-    public static function getInstalledPackagesByType($type)
58
+    public static function getInstalledPackagesByType( $type )
59 59
     {
60 60
         $packagesByType = array();
61 61
 
62
-        foreach (self::getInstalled() as $installed) {
63
-            foreach ($installed['versions'] as $name => $package) {
64
-                if (isset($package['type']) && $package['type'] === $type) {
65
-                    $packagesByType[] = $name;
62
+        foreach ( self::getInstalled() as $installed ) {
63
+            foreach ( $installed[ 'versions' ] as $name => $package ) {
64
+                if ( isset( $package[ 'type' ] ) && $package[ 'type' ] === $type ) {
65
+                    $packagesByType[ ] = $name;
66 66
                 }
67 67
             }
68 68
         }
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
      * @param  bool   $includeDevRequirements
80 80
      * @return bool
81 81
      */
82
-    public static function isInstalled($packageName, $includeDevRequirements = true)
82
+    public static function isInstalled( $packageName, $includeDevRequirements = true )
83 83
     {
84
-        foreach (self::getInstalled() as $installed) {
85
-            if (isset($installed['versions'][$packageName])) {
86
-                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
84
+        foreach ( self::getInstalled() as $installed ) {
85
+            if ( isset( $installed[ 'versions' ][ $packageName ] ) ) {
86
+                return $includeDevRequirements || empty( $installed[ 'versions' ][ $packageName ][ 'dev_requirement' ] );
87 87
             }
88 88
         }
89 89
 
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
      * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
103 103
      * @return bool
104 104
      */
105
-    public static function satisfies(VersionParser $parser, $packageName, $constraint)
105
+    public static function satisfies( VersionParser $parser, $packageName, $constraint )
106 106
     {
107
-        $constraint = $parser->parseConstraints($constraint);
108
-        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
107
+        $constraint = $parser->parseConstraints( $constraint );
108
+        $provided = $parser->parseConstraints( self::getVersionRanges( $packageName ) );
109 109
 
110
-        return $provided->matches($constraint);
110
+        return $provided->matches( $constraint );
111 111
     }
112 112
 
113 113
     /**
@@ -119,111 +119,111 @@  discard block
 block discarded – undo
119 119
      * @param  string $packageName
120 120
      * @return string Version constraint usable with composer/semver
121 121
      */
122
-    public static function getVersionRanges($packageName)
122
+    public static function getVersionRanges( $packageName )
123 123
     {
124
-        foreach (self::getInstalled() as $installed) {
125
-            if (!isset($installed['versions'][$packageName])) {
124
+        foreach ( self::getInstalled() as $installed ) {
125
+            if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) {
126 126
                 continue;
127 127
             }
128 128
 
129 129
             $ranges = array();
130
-            if (isset($installed['versions'][$packageName]['pretty_version'])) {
131
-                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
130
+            if ( isset( $installed[ 'versions' ][ $packageName ][ 'pretty_version' ] ) ) {
131
+                $ranges[ ] = $installed[ 'versions' ][ $packageName ][ 'pretty_version' ];
132 132
             }
133
-            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
134
-                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
133
+            if ( array_key_exists( 'aliases', $installed[ 'versions' ][ $packageName ] ) ) {
134
+                $ranges = array_merge( $ranges, $installed[ 'versions' ][ $packageName ][ 'aliases' ] );
135 135
             }
136
-            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
137
-                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
136
+            if ( array_key_exists( 'replaced', $installed[ 'versions' ][ $packageName ] ) ) {
137
+                $ranges = array_merge( $ranges, $installed[ 'versions' ][ $packageName ][ 'replaced' ] );
138 138
             }
139
-            if (array_key_exists('provided', $installed['versions'][$packageName])) {
140
-                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
139
+            if ( array_key_exists( 'provided', $installed[ 'versions' ][ $packageName ] ) ) {
140
+                $ranges = array_merge( $ranges, $installed[ 'versions' ][ $packageName ][ 'provided' ] );
141 141
             }
142 142
 
143
-            return implode(' || ', $ranges);
143
+            return implode( ' || ', $ranges );
144 144
         }
145 145
 
146
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
146
+        throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
147 147
     }
148 148
 
149 149
     /**
150 150
      * @param  string      $packageName
151 151
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
152 152
      */
153
-    public static function getVersion($packageName)
153
+    public static function getVersion( $packageName )
154 154
     {
155
-        foreach (self::getInstalled() as $installed) {
156
-            if (!isset($installed['versions'][$packageName])) {
155
+        foreach ( self::getInstalled() as $installed ) {
156
+            if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) {
157 157
                 continue;
158 158
             }
159 159
 
160
-            if (!isset($installed['versions'][$packageName]['version'])) {
160
+            if ( ! isset( $installed[ 'versions' ][ $packageName ][ 'version' ] ) ) {
161 161
                 return null;
162 162
             }
163 163
 
164
-            return $installed['versions'][$packageName]['version'];
164
+            return $installed[ 'versions' ][ $packageName ][ 'version' ];
165 165
         }
166 166
 
167
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
167
+        throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
168 168
     }
169 169
 
170 170
     /**
171 171
      * @param  string      $packageName
172 172
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
173 173
      */
174
-    public static function getPrettyVersion($packageName)
174
+    public static function getPrettyVersion( $packageName )
175 175
     {
176
-        foreach (self::getInstalled() as $installed) {
177
-            if (!isset($installed['versions'][$packageName])) {
176
+        foreach ( self::getInstalled() as $installed ) {
177
+            if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) {
178 178
                 continue;
179 179
             }
180 180
 
181
-            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
181
+            if ( ! isset( $installed[ 'versions' ][ $packageName ][ 'pretty_version' ] ) ) {
182 182
                 return null;
183 183
             }
184 184
 
185
-            return $installed['versions'][$packageName]['pretty_version'];
185
+            return $installed[ 'versions' ][ $packageName ][ 'pretty_version' ];
186 186
         }
187 187
 
188
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
188
+        throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
189 189
     }
190 190
 
191 191
     /**
192 192
      * @param  string      $packageName
193 193
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
194 194
      */
195
-    public static function getReference($packageName)
195
+    public static function getReference( $packageName )
196 196
     {
197
-        foreach (self::getInstalled() as $installed) {
198
-            if (!isset($installed['versions'][$packageName])) {
197
+        foreach ( self::getInstalled() as $installed ) {
198
+            if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) {
199 199
                 continue;
200 200
             }
201 201
 
202
-            if (!isset($installed['versions'][$packageName]['reference'])) {
202
+            if ( ! isset( $installed[ 'versions' ][ $packageName ][ 'reference' ] ) ) {
203 203
                 return null;
204 204
             }
205 205
 
206
-            return $installed['versions'][$packageName]['reference'];
206
+            return $installed[ 'versions' ][ $packageName ][ 'reference' ];
207 207
         }
208 208
 
209
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
209
+        throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
210 210
     }
211 211
 
212 212
     /**
213 213
      * @param  string      $packageName
214 214
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
215 215
      */
216
-    public static function getInstallPath($packageName)
216
+    public static function getInstallPath( $packageName )
217 217
     {
218
-        foreach (self::getInstalled() as $installed) {
219
-            if (!isset($installed['versions'][$packageName])) {
218
+        foreach ( self::getInstalled() as $installed ) {
219
+            if ( ! isset( $installed[ 'versions' ][ $packageName ] ) ) {
220 220
                 continue;
221 221
             }
222 222
 
223
-            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
223
+            return isset( $installed[ 'versions' ][ $packageName ][ 'install_path' ] ) ? $installed[ 'versions' ][ $packageName ][ 'install_path' ] : null;
224 224
         }
225 225
 
226
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
226
+        throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
227 227
     }
228 228
 
229 229
     /**
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     {
235 235
         $installed = self::getInstalled();
236 236
 
237
-        return $installed[0]['root'];
237
+        return $installed[ 0 ][ 'root' ];
238 238
     }
239 239
 
240 240
     /**
@@ -246,12 +246,12 @@  discard block
 block discarded – undo
246 246
      */
247 247
     public static function getRawData()
248 248
     {
249
-        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
249
+        @trigger_error( 'getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED );
250 250
 
251
-        if (null === self::$installed) {
251
+        if ( null === self::$installed ) {
252 252
             // only require the installed.php file if this file is loaded from its dumped location,
253 253
             // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
254
-            if (substr(__DIR__, -8, 1) !== 'C') {
254
+            if ( substr( __DIR__, -8, 1 ) !== 'C' ) {
255 255
                 self::$installed = include __DIR__ . '/installed.php';
256 256
             } else {
257 257
                 self::$installed = array();
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      *
291 291
      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
292 292
      */
293
-    public static function reload($data)
293
+    public static function reload( $data )
294 294
     {
295 295
         self::$installed = $data;
296 296
         self::$installedByVendor = array();
@@ -302,35 +302,35 @@  discard block
 block discarded – undo
302 302
      */
303 303
     private static function getInstalled()
304 304
     {
305
-        if (null === self::$canGetVendors) {
306
-            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
305
+        if ( null === self::$canGetVendors ) {
306
+            self::$canGetVendors = method_exists( 'Composer\Autoload\ClassLoader', 'getRegisteredLoaders' );
307 307
         }
308 308
 
309 309
         $installed = array();
310 310
 
311
-        if (self::$canGetVendors) {
312
-            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
313
-                if (isset(self::$installedByVendor[$vendorDir])) {
314
-                    $installed[] = self::$installedByVendor[$vendorDir];
315
-                } elseif (is_file($vendorDir.'/composer/installed.php')) {
316
-                    $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
317
-                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
318
-                        self::$installed = $installed[count($installed) - 1];
311
+        if ( self::$canGetVendors ) {
312
+            foreach ( ClassLoader::getRegisteredLoaders() as $vendorDir => $loader ) {
313
+                if ( isset( self::$installedByVendor[ $vendorDir ] ) ) {
314
+                    $installed[ ] = self::$installedByVendor[ $vendorDir ];
315
+                } elseif ( is_file( $vendorDir . '/composer/installed.php' ) ) {
316
+                    $installed[ ] = self::$installedByVendor[ $vendorDir ] = require $vendorDir . '/composer/installed.php';
317
+                    if ( null === self::$installed && strtr( $vendorDir . '/composer', '\\', '/' ) === strtr( __DIR__, '\\', '/' ) ) {
318
+                        self::$installed = $installed[ count( $installed ) - 1 ];
319 319
                     }
320 320
                 }
321 321
             }
322 322
         }
323 323
 
324
-        if (null === self::$installed) {
324
+        if ( null === self::$installed ) {
325 325
             // only require the installed.php file if this file is loaded from its dumped location,
326 326
             // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
327
-            if (substr(__DIR__, -8, 1) !== 'C') {
327
+            if ( substr( __DIR__, -8, 1 ) !== 'C' ) {
328 328
                 self::$installed = require __DIR__ . '/installed.php';
329 329
             } else {
330 330
                 self::$installed = array();
331 331
             }
332 332
         }
333
-        $installed[] = self::$installed;
333
+        $installed[ ] = self::$installed;
334 334
 
335 335
         return $installed;
336 336
     }
Please login to merge, or discard this patch.
Indentation   +323 added lines, -323 removed lines patch added patch discarded remove patch
@@ -24,327 +24,327 @@
 block discarded – undo
24 24
  */
25 25
 class InstalledVersions
26 26
 {
27
-    /**
28
-     * @var mixed[]|null
29
-     * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
30
-     */
31
-    private static $installed;
32
-
33
-    /**
34
-     * @var bool|null
35
-     */
36
-    private static $canGetVendors;
37
-
38
-    /**
39
-     * @var array[]
40
-     * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
41
-     */
42
-    private static $installedByVendor = array();
43
-
44
-    /**
45
-     * Returns a list of all package names which are present, either by being installed, replaced or provided
46
-     *
47
-     * @return string[]
48
-     * @psalm-return list<string>
49
-     */
50
-    public static function getInstalledPackages()
51
-    {
52
-        $packages = array();
53
-        foreach (self::getInstalled() as $installed) {
54
-            $packages[] = array_keys($installed['versions']);
55
-        }
56
-
57
-        if (1 === \count($packages)) {
58
-            return $packages[0];
59
-        }
60
-
61
-        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
62
-    }
63
-
64
-    /**
65
-     * Returns a list of all package names with a specific type e.g. 'library'
66
-     *
67
-     * @param  string   $type
68
-     * @return string[]
69
-     * @psalm-return list<string>
70
-     */
71
-    public static function getInstalledPackagesByType($type)
72
-    {
73
-        $packagesByType = array();
74
-
75
-        foreach (self::getInstalled() as $installed) {
76
-            foreach ($installed['versions'] as $name => $package) {
77
-                if (isset($package['type']) && $package['type'] === $type) {
78
-                    $packagesByType[] = $name;
79
-                }
80
-            }
81
-        }
82
-
83
-        return $packagesByType;
84
-    }
85
-
86
-    /**
87
-     * Checks whether the given package is installed
88
-     *
89
-     * This also returns true if the package name is provided or replaced by another package
90
-     *
91
-     * @param  string $packageName
92
-     * @param  bool   $includeDevRequirements
93
-     * @return bool
94
-     */
95
-    public static function isInstalled($packageName, $includeDevRequirements = true)
96
-    {
97
-        foreach (self::getInstalled() as $installed) {
98
-            if (isset($installed['versions'][$packageName])) {
99
-                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
100
-            }
101
-        }
102
-
103
-        return false;
104
-    }
105
-
106
-    /**
107
-     * Checks whether the given package satisfies a version constraint
108
-     *
109
-     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
110
-     *
111
-     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
112
-     *
113
-     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
114
-     * @param  string        $packageName
115
-     * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
116
-     * @return bool
117
-     */
118
-    public static function satisfies(VersionParser $parser, $packageName, $constraint)
119
-    {
120
-        $constraint = $parser->parseConstraints($constraint);
121
-        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
122
-
123
-        return $provided->matches($constraint);
124
-    }
125
-
126
-    /**
127
-     * Returns a version constraint representing all the range(s) which are installed for a given package
128
-     *
129
-     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
130
-     * whether a given version of a package is installed, and not just whether it exists
131
-     *
132
-     * @param  string $packageName
133
-     * @return string Version constraint usable with composer/semver
134
-     */
135
-    public static function getVersionRanges($packageName)
136
-    {
137
-        foreach (self::getInstalled() as $installed) {
138
-            if (!isset($installed['versions'][$packageName])) {
139
-                continue;
140
-            }
141
-
142
-            $ranges = array();
143
-            if (isset($installed['versions'][$packageName]['pretty_version'])) {
144
-                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
145
-            }
146
-            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
147
-                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
148
-            }
149
-            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
150
-                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
151
-            }
152
-            if (array_key_exists('provided', $installed['versions'][$packageName])) {
153
-                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
154
-            }
155
-
156
-            return implode(' || ', $ranges);
157
-        }
158
-
159
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
160
-    }
161
-
162
-    /**
163
-     * @param  string      $packageName
164
-     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
165
-     */
166
-    public static function getVersion($packageName)
167
-    {
168
-        foreach (self::getInstalled() as $installed) {
169
-            if (!isset($installed['versions'][$packageName])) {
170
-                continue;
171
-            }
172
-
173
-            if (!isset($installed['versions'][$packageName]['version'])) {
174
-                return null;
175
-            }
176
-
177
-            return $installed['versions'][$packageName]['version'];
178
-        }
179
-
180
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
181
-    }
182
-
183
-    /**
184
-     * @param  string      $packageName
185
-     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
186
-     */
187
-    public static function getPrettyVersion($packageName)
188
-    {
189
-        foreach (self::getInstalled() as $installed) {
190
-            if (!isset($installed['versions'][$packageName])) {
191
-                continue;
192
-            }
193
-
194
-            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
195
-                return null;
196
-            }
197
-
198
-            return $installed['versions'][$packageName]['pretty_version'];
199
-        }
200
-
201
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
202
-    }
203
-
204
-    /**
205
-     * @param  string      $packageName
206
-     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
207
-     */
208
-    public static function getReference($packageName)
209
-    {
210
-        foreach (self::getInstalled() as $installed) {
211
-            if (!isset($installed['versions'][$packageName])) {
212
-                continue;
213
-            }
214
-
215
-            if (!isset($installed['versions'][$packageName]['reference'])) {
216
-                return null;
217
-            }
218
-
219
-            return $installed['versions'][$packageName]['reference'];
220
-        }
221
-
222
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
223
-    }
224
-
225
-    /**
226
-     * @param  string      $packageName
227
-     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
228
-     */
229
-    public static function getInstallPath($packageName)
230
-    {
231
-        foreach (self::getInstalled() as $installed) {
232
-            if (!isset($installed['versions'][$packageName])) {
233
-                continue;
234
-            }
235
-
236
-            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
237
-        }
238
-
239
-        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
240
-    }
241
-
242
-    /**
243
-     * @return array
244
-     * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
245
-     */
246
-    public static function getRootPackage()
247
-    {
248
-        $installed = self::getInstalled();
249
-
250
-        return $installed[0]['root'];
251
-    }
252
-
253
-    /**
254
-     * Returns the raw installed.php data for custom implementations
255
-     *
256
-     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
257
-     * @return array[]
258
-     * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
259
-     */
260
-    public static function getRawData()
261
-    {
262
-        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
263
-
264
-        if (null === self::$installed) {
265
-            // only require the installed.php file if this file is loaded from its dumped location,
266
-            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
267
-            if (substr(__DIR__, -8, 1) !== 'C') {
268
-                self::$installed = include __DIR__ . '/installed.php';
269
-            } else {
270
-                self::$installed = array();
271
-            }
272
-        }
273
-
274
-        return self::$installed;
275
-    }
276
-
277
-    /**
278
-     * Returns the raw data of all installed.php which are currently loaded for custom implementations
279
-     *
280
-     * @return array[]
281
-     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
282
-     */
283
-    public static function getAllRawData()
284
-    {
285
-        return self::getInstalled();
286
-    }
287
-
288
-    /**
289
-     * Lets you reload the static array from another file
290
-     *
291
-     * This is only useful for complex integrations in which a project needs to use
292
-     * this class but then also needs to execute another project's autoloader in process,
293
-     * and wants to ensure both projects have access to their version of installed.php.
294
-     *
295
-     * A typical case would be PHPUnit, where it would need to make sure it reads all
296
-     * the data it needs from this class, then call reload() with
297
-     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
298
-     * the project in which it runs can then also use this class safely, without
299
-     * interference between PHPUnit's dependencies and the project's dependencies.
300
-     *
301
-     * @param  array[] $data A vendor/composer/installed.php data set
302
-     * @return void
303
-     *
304
-     * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
305
-     */
306
-    public static function reload($data)
307
-    {
308
-        self::$installed = $data;
309
-        self::$installedByVendor = array();
310
-    }
311
-
312
-    /**
313
-     * @return array[]
314
-     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
315
-     */
316
-    private static function getInstalled()
317
-    {
318
-        if (null === self::$canGetVendors) {
319
-            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
320
-        }
321
-
322
-        $installed = array();
323
-
324
-        if (self::$canGetVendors) {
325
-            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
326
-                if (isset(self::$installedByVendor[$vendorDir])) {
327
-                    $installed[] = self::$installedByVendor[$vendorDir];
328
-                } elseif (is_file($vendorDir.'/composer/installed.php')) {
329
-                    $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
330
-                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
331
-                        self::$installed = $installed[count($installed) - 1];
332
-                    }
333
-                }
334
-            }
335
-        }
336
-
337
-        if (null === self::$installed) {
338
-            // only require the installed.php file if this file is loaded from its dumped location,
339
-            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
340
-            if (substr(__DIR__, -8, 1) !== 'C') {
341
-                self::$installed = require __DIR__ . '/installed.php';
342
-            } else {
343
-                self::$installed = array();
344
-            }
345
-        }
346
-        $installed[] = self::$installed;
347
-
348
-        return $installed;
349
-    }
27
+	/**
28
+	 * @var mixed[]|null
29
+	 * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
30
+	 */
31
+	private static $installed;
32
+
33
+	/**
34
+	 * @var bool|null
35
+	 */
36
+	private static $canGetVendors;
37
+
38
+	/**
39
+	 * @var array[]
40
+	 * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
41
+	 */
42
+	private static $installedByVendor = array();
43
+
44
+	/**
45
+	 * Returns a list of all package names which are present, either by being installed, replaced or provided
46
+	 *
47
+	 * @return string[]
48
+	 * @psalm-return list<string>
49
+	 */
50
+	public static function getInstalledPackages()
51
+	{
52
+		$packages = array();
53
+		foreach (self::getInstalled() as $installed) {
54
+			$packages[] = array_keys($installed['versions']);
55
+		}
56
+
57
+		if (1 === \count($packages)) {
58
+			return $packages[0];
59
+		}
60
+
61
+		return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
62
+	}
63
+
64
+	/**
65
+	 * Returns a list of all package names with a specific type e.g. 'library'
66
+	 *
67
+	 * @param  string   $type
68
+	 * @return string[]
69
+	 * @psalm-return list<string>
70
+	 */
71
+	public static function getInstalledPackagesByType($type)
72
+	{
73
+		$packagesByType = array();
74
+
75
+		foreach (self::getInstalled() as $installed) {
76
+			foreach ($installed['versions'] as $name => $package) {
77
+				if (isset($package['type']) && $package['type'] === $type) {
78
+					$packagesByType[] = $name;
79
+				}
80
+			}
81
+		}
82
+
83
+		return $packagesByType;
84
+	}
85
+
86
+	/**
87
+	 * Checks whether the given package is installed
88
+	 *
89
+	 * This also returns true if the package name is provided or replaced by another package
90
+	 *
91
+	 * @param  string $packageName
92
+	 * @param  bool   $includeDevRequirements
93
+	 * @return bool
94
+	 */
95
+	public static function isInstalled($packageName, $includeDevRequirements = true)
96
+	{
97
+		foreach (self::getInstalled() as $installed) {
98
+			if (isset($installed['versions'][$packageName])) {
99
+				return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
100
+			}
101
+		}
102
+
103
+		return false;
104
+	}
105
+
106
+	/**
107
+	 * Checks whether the given package satisfies a version constraint
108
+	 *
109
+	 * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
110
+	 *
111
+	 *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
112
+	 *
113
+	 * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
114
+	 * @param  string        $packageName
115
+	 * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
116
+	 * @return bool
117
+	 */
118
+	public static function satisfies(VersionParser $parser, $packageName, $constraint)
119
+	{
120
+		$constraint = $parser->parseConstraints($constraint);
121
+		$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
122
+
123
+		return $provided->matches($constraint);
124
+	}
125
+
126
+	/**
127
+	 * Returns a version constraint representing all the range(s) which are installed for a given package
128
+	 *
129
+	 * It is easier to use this via isInstalled() with the $constraint argument if you need to check
130
+	 * whether a given version of a package is installed, and not just whether it exists
131
+	 *
132
+	 * @param  string $packageName
133
+	 * @return string Version constraint usable with composer/semver
134
+	 */
135
+	public static function getVersionRanges($packageName)
136
+	{
137
+		foreach (self::getInstalled() as $installed) {
138
+			if (!isset($installed['versions'][$packageName])) {
139
+				continue;
140
+			}
141
+
142
+			$ranges = array();
143
+			if (isset($installed['versions'][$packageName]['pretty_version'])) {
144
+				$ranges[] = $installed['versions'][$packageName]['pretty_version'];
145
+			}
146
+			if (array_key_exists('aliases', $installed['versions'][$packageName])) {
147
+				$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
148
+			}
149
+			if (array_key_exists('replaced', $installed['versions'][$packageName])) {
150
+				$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
151
+			}
152
+			if (array_key_exists('provided', $installed['versions'][$packageName])) {
153
+				$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
154
+			}
155
+
156
+			return implode(' || ', $ranges);
157
+		}
158
+
159
+		throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
160
+	}
161
+
162
+	/**
163
+	 * @param  string      $packageName
164
+	 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
165
+	 */
166
+	public static function getVersion($packageName)
167
+	{
168
+		foreach (self::getInstalled() as $installed) {
169
+			if (!isset($installed['versions'][$packageName])) {
170
+				continue;
171
+			}
172
+
173
+			if (!isset($installed['versions'][$packageName]['version'])) {
174
+				return null;
175
+			}
176
+
177
+			return $installed['versions'][$packageName]['version'];
178
+		}
179
+
180
+		throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
181
+	}
182
+
183
+	/**
184
+	 * @param  string      $packageName
185
+	 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
186
+	 */
187
+	public static function getPrettyVersion($packageName)
188
+	{
189
+		foreach (self::getInstalled() as $installed) {
190
+			if (!isset($installed['versions'][$packageName])) {
191
+				continue;
192
+			}
193
+
194
+			if (!isset($installed['versions'][$packageName]['pretty_version'])) {
195
+				return null;
196
+			}
197
+
198
+			return $installed['versions'][$packageName]['pretty_version'];
199
+		}
200
+
201
+		throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
202
+	}
203
+
204
+	/**
205
+	 * @param  string      $packageName
206
+	 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
207
+	 */
208
+	public static function getReference($packageName)
209
+	{
210
+		foreach (self::getInstalled() as $installed) {
211
+			if (!isset($installed['versions'][$packageName])) {
212
+				continue;
213
+			}
214
+
215
+			if (!isset($installed['versions'][$packageName]['reference'])) {
216
+				return null;
217
+			}
218
+
219
+			return $installed['versions'][$packageName]['reference'];
220
+		}
221
+
222
+		throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
223
+	}
224
+
225
+	/**
226
+	 * @param  string      $packageName
227
+	 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
228
+	 */
229
+	public static function getInstallPath($packageName)
230
+	{
231
+		foreach (self::getInstalled() as $installed) {
232
+			if (!isset($installed['versions'][$packageName])) {
233
+				continue;
234
+			}
235
+
236
+			return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
237
+		}
238
+
239
+		throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
240
+	}
241
+
242
+	/**
243
+	 * @return array
244
+	 * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
245
+	 */
246
+	public static function getRootPackage()
247
+	{
248
+		$installed = self::getInstalled();
249
+
250
+		return $installed[0]['root'];
251
+	}
252
+
253
+	/**
254
+	 * Returns the raw installed.php data for custom implementations
255
+	 *
256
+	 * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
257
+	 * @return array[]
258
+	 * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
259
+	 */
260
+	public static function getRawData()
261
+	{
262
+		@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
263
+
264
+		if (null === self::$installed) {
265
+			// only require the installed.php file if this file is loaded from its dumped location,
266
+			// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
267
+			if (substr(__DIR__, -8, 1) !== 'C') {
268
+				self::$installed = include __DIR__ . '/installed.php';
269
+			} else {
270
+				self::$installed = array();
271
+			}
272
+		}
273
+
274
+		return self::$installed;
275
+	}
276
+
277
+	/**
278
+	 * Returns the raw data of all installed.php which are currently loaded for custom implementations
279
+	 *
280
+	 * @return array[]
281
+	 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
282
+	 */
283
+	public static function getAllRawData()
284
+	{
285
+		return self::getInstalled();
286
+	}
287
+
288
+	/**
289
+	 * Lets you reload the static array from another file
290
+	 *
291
+	 * This is only useful for complex integrations in which a project needs to use
292
+	 * this class but then also needs to execute another project's autoloader in process,
293
+	 * and wants to ensure both projects have access to their version of installed.php.
294
+	 *
295
+	 * A typical case would be PHPUnit, where it would need to make sure it reads all
296
+	 * the data it needs from this class, then call reload() with
297
+	 * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
298
+	 * the project in which it runs can then also use this class safely, without
299
+	 * interference between PHPUnit's dependencies and the project's dependencies.
300
+	 *
301
+	 * @param  array[] $data A vendor/composer/installed.php data set
302
+	 * @return void
303
+	 *
304
+	 * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
305
+	 */
306
+	public static function reload($data)
307
+	{
308
+		self::$installed = $data;
309
+		self::$installedByVendor = array();
310
+	}
311
+
312
+	/**
313
+	 * @return array[]
314
+	 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
315
+	 */
316
+	private static function getInstalled()
317
+	{
318
+		if (null === self::$canGetVendors) {
319
+			self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
320
+		}
321
+
322
+		$installed = array();
323
+
324
+		if (self::$canGetVendors) {
325
+			foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
326
+				if (isset(self::$installedByVendor[$vendorDir])) {
327
+					$installed[] = self::$installedByVendor[$vendorDir];
328
+				} elseif (is_file($vendorDir.'/composer/installed.php')) {
329
+					$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
330
+					if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
331
+						self::$installed = $installed[count($installed) - 1];
332
+					}
333
+				}
334
+			}
335
+		}
336
+
337
+		if (null === self::$installed) {
338
+			// only require the installed.php file if this file is loaded from its dumped location,
339
+			// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
340
+			if (substr(__DIR__, -8, 1) !== 'C') {
341
+				self::$installed = require __DIR__ . '/installed.php';
342
+			} else {
343
+				self::$installed = array();
344
+			}
345
+		}
346
+		$installed[] = self::$installed;
347
+
348
+		return $installed;
349
+	}
350 350
 }
Please login to merge, or discard this patch.
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * To require its presence, you can require `composer-runtime-api ^2.0`
24 24
  */
25
-class InstalledVersions
26
-{
25
+class InstalledVersions {
27 26
     /**
28 27
      * @var mixed[]|null
29 28
      * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
@@ -47,8 +46,7 @@  discard block
 block discarded – undo
47 46
      * @return string[]
48 47
      * @psalm-return list<string>
49 48
      */
50
-    public static function getInstalledPackages()
51
-    {
49
+    public static function getInstalledPackages() {
52 50
         $packages = array();
53 51
         foreach (self::getInstalled() as $installed) {
54 52
             $packages[] = array_keys($installed['versions']);
@@ -68,8 +66,7 @@  discard block
 block discarded – undo
68 66
      * @return string[]
69 67
      * @psalm-return list<string>
70 68
      */
71
-    public static function getInstalledPackagesByType($type)
72
-    {
69
+    public static function getInstalledPackagesByType($type) {
73 70
         $packagesByType = array();
74 71
 
75 72
         foreach (self::getInstalled() as $installed) {
@@ -92,8 +89,7 @@  discard block
 block discarded – undo
92 89
      * @param  bool   $includeDevRequirements
93 90
      * @return bool
94 91
      */
95
-    public static function isInstalled($packageName, $includeDevRequirements = true)
96
-    {
92
+    public static function isInstalled($packageName, $includeDevRequirements = true) {
97 93
         foreach (self::getInstalled() as $installed) {
98 94
             if (isset($installed['versions'][$packageName])) {
99 95
                 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
@@ -115,8 +111,7 @@  discard block
 block discarded – undo
115 111
      * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
116 112
      * @return bool
117 113
      */
118
-    public static function satisfies(VersionParser $parser, $packageName, $constraint)
119
-    {
114
+    public static function satisfies(VersionParser $parser, $packageName, $constraint) {
120 115
         $constraint = $parser->parseConstraints($constraint);
121 116
         $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
122 117
 
@@ -132,8 +127,7 @@  discard block
 block discarded – undo
132 127
      * @param  string $packageName
133 128
      * @return string Version constraint usable with composer/semver
134 129
      */
135
-    public static function getVersionRanges($packageName)
136
-    {
130
+    public static function getVersionRanges($packageName) {
137 131
         foreach (self::getInstalled() as $installed) {
138 132
             if (!isset($installed['versions'][$packageName])) {
139 133
                 continue;
@@ -163,8 +157,7 @@  discard block
 block discarded – undo
163 157
      * @param  string      $packageName
164 158
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
165 159
      */
166
-    public static function getVersion($packageName)
167
-    {
160
+    public static function getVersion($packageName) {
168 161
         foreach (self::getInstalled() as $installed) {
169 162
             if (!isset($installed['versions'][$packageName])) {
170 163
                 continue;
@@ -184,8 +177,7 @@  discard block
 block discarded – undo
184 177
      * @param  string      $packageName
185 178
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
186 179
      */
187
-    public static function getPrettyVersion($packageName)
188
-    {
180
+    public static function getPrettyVersion($packageName) {
189 181
         foreach (self::getInstalled() as $installed) {
190 182
             if (!isset($installed['versions'][$packageName])) {
191 183
                 continue;
@@ -205,8 +197,7 @@  discard block
 block discarded – undo
205 197
      * @param  string      $packageName
206 198
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
207 199
      */
208
-    public static function getReference($packageName)
209
-    {
200
+    public static function getReference($packageName) {
210 201
         foreach (self::getInstalled() as $installed) {
211 202
             if (!isset($installed['versions'][$packageName])) {
212 203
                 continue;
@@ -226,8 +217,7 @@  discard block
 block discarded – undo
226 217
      * @param  string      $packageName
227 218
      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
228 219
      */
229
-    public static function getInstallPath($packageName)
230
-    {
220
+    public static function getInstallPath($packageName) {
231 221
         foreach (self::getInstalled() as $installed) {
232 222
             if (!isset($installed['versions'][$packageName])) {
233 223
                 continue;
@@ -243,8 +233,7 @@  discard block
 block discarded – undo
243 233
      * @return array
244 234
      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
245 235
      */
246
-    public static function getRootPackage()
247
-    {
236
+    public static function getRootPackage() {
248 237
         $installed = self::getInstalled();
249 238
 
250 239
         return $installed[0]['root'];
@@ -257,8 +246,7 @@  discard block
 block discarded – undo
257 246
      * @return array[]
258 247
      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
259 248
      */
260
-    public static function getRawData()
261
-    {
249
+    public static function getRawData() {
262 250
         @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
263 251
 
264 252
         if (null === self::$installed) {
@@ -280,8 +268,7 @@  discard block
 block discarded – undo
280 268
      * @return array[]
281 269
      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
282 270
      */
283
-    public static function getAllRawData()
284
-    {
271
+    public static function getAllRawData() {
285 272
         return self::getInstalled();
286 273
     }
287 274
 
@@ -303,8 +290,7 @@  discard block
 block discarded – undo
303 290
      *
304 291
      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
305 292
      */
306
-    public static function reload($data)
307
-    {
293
+    public static function reload($data) {
308 294
         self::$installed = $data;
309 295
         self::$installedByVendor = array();
310 296
     }
@@ -313,8 +299,7 @@  discard block
 block discarded – undo
313 299
      * @return array[]
314 300
      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
315 301
      */
316
-    private static function getInstalled()
317
-    {
302
+    private static function getInstalled() {
318 303
         if (null === self::$canGetVendors) {
319 304
             self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
320 305
         }
Please login to merge, or discard this patch.
vendor/composer/autoload_classmap.php 2 patches
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -6,132 +6,132 @@
 block discarded – undo
6 6
 $baseDir = dirname($vendorDir);
7 7
 
8 8
 return array(
9
-    'ComposerAutoloaderInitb5638313a52df4893eb45c04efdaa356' => $vendorDir . '/trustedlogin/client/vendor/composer/autoload_real.php',
10
-    'Composer\\Autoload\\ClassLoader' => $vendorDir . '/trustedlogin/client/vendor/composer/ClassLoader.php',
11
-    'Composer\\Autoload\\ComposerStaticInitb5638313a52df4893eb45c04efdaa356' => $vendorDir . '/trustedlogin/client/vendor/composer/autoload_static.php',
12
-    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
13
-    'Error' => $vendorDir . '/paragonie/random_compat/lib/error_polyfill.php',
14
-    'Katzgrau\\KLogger\\Logger' => $vendorDir . '/katzgrau/klogger/src/Logger.php',
15
-    'Katzgrau\\KLogger\\TrustedLogin_Logger' => $vendorDir . '/trustedlogin/client/vendor/TrustedLogin/katzgrau/klogger/src/Logger.php',
16
-    'LoggerTest' => $vendorDir . '/katzgrau/klogger/tests/LoggerTest.php',
17
-    'ParagonIE\\Sodium\\Compat' => $vendorDir . '/paragonie/sodium_compat/namespaced/Compat.php',
18
-    'ParagonIE\\Sodium\\Core\\BLAKE2b' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/BLAKE2b.php',
19
-    'ParagonIE\\Sodium\\Core\\ChaCha20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/ChaCha20.php',
20
-    'ParagonIE\\Sodium\\Core\\ChaCha20\\Ctx' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/ChaCha20/Ctx.php',
21
-    'ParagonIE\\Sodium\\Core\\ChaCha20\\IetfCtx' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/ChaCha20/IetfCtx.php',
22
-    'ParagonIE\\Sodium\\Core\\Curve25519' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519.php',
23
-    'ParagonIE\\Sodium\\Core\\Curve25519\\Fe' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Fe.php',
24
-    'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\Cached' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Cached.php',
25
-    'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\P1p1' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P1p1.php',
26
-    'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\P2' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P2.php',
27
-    'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\P3' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P3.php',
28
-    'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\Precomp' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Precomp.php',
29
-    'ParagonIE\\Sodium\\Core\\Curve25519\\H' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/H.php',
30
-    'ParagonIE\\Sodium\\Core\\Ed25519' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Ed25519.php',
31
-    'ParagonIE\\Sodium\\Core\\HChaCha20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/HChaCha20.php',
32
-    'ParagonIE\\Sodium\\Core\\HSalsa20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/HSalsa20.php',
33
-    'ParagonIE\\Sodium\\Core\\Poly1305' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Poly1305.php',
34
-    'ParagonIE\\Sodium\\Core\\Poly1305\\State' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Poly1305/State.php',
35
-    'ParagonIE\\Sodium\\Core\\Salsa20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Salsa20.php',
36
-    'ParagonIE\\Sodium\\Core\\SipHash' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/SipHash.php',
37
-    'ParagonIE\\Sodium\\Core\\Util' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Util.php',
38
-    'ParagonIE\\Sodium\\Core\\X25519' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/X25519.php',
39
-    'ParagonIE\\Sodium\\Core\\XChaCha20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/XChaCha20.php',
40
-    'ParagonIE\\Sodium\\Core\\Xsalsa20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Xsalsa20.php',
41
-    'ParagonIE\\Sodium\\Crypto' => $vendorDir . '/paragonie/sodium_compat/namespaced/Crypto.php',
42
-    'ParagonIE\\Sodium\\File' => $vendorDir . '/paragonie/sodium_compat/namespaced/File.php',
43
-    'ParagonIE_Sodium_Compat' => $vendorDir . '/paragonie/sodium_compat/src/Compat.php',
44
-    'ParagonIE_Sodium_Core32_BLAKE2b' => $vendorDir . '/paragonie/sodium_compat/src/Core32/BLAKE2b.php',
45
-    'ParagonIE_Sodium_Core32_ChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/ChaCha20.php',
46
-    'ParagonIE_Sodium_Core32_ChaCha20_Ctx' => $vendorDir . '/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php',
47
-    'ParagonIE_Sodium_Core32_ChaCha20_IetfCtx' => $vendorDir . '/paragonie/sodium_compat/src/Core32/ChaCha20/IetfCtx.php',
48
-    'ParagonIE_Sodium_Core32_Curve25519' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519.php',
49
-    'ParagonIE_Sodium_Core32_Curve25519_Fe' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Fe.php',
50
-    'ParagonIE_Sodium_Core32_Curve25519_Ge_Cached' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Cached.php',
51
-    'ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P1p1.php',
52
-    'ParagonIE_Sodium_Core32_Curve25519_Ge_P2' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P2.php',
53
-    'ParagonIE_Sodium_Core32_Curve25519_Ge_P3' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P3.php',
54
-    'ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Precomp.php',
55
-    'ParagonIE_Sodium_Core32_Curve25519_H' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/H.php',
56
-    'ParagonIE_Sodium_Core32_Ed25519' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Ed25519.php',
57
-    'ParagonIE_Sodium_Core32_HChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/HChaCha20.php',
58
-    'ParagonIE_Sodium_Core32_HSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/HSalsa20.php',
59
-    'ParagonIE_Sodium_Core32_Int32' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Int32.php',
60
-    'ParagonIE_Sodium_Core32_Int64' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Int64.php',
61
-    'ParagonIE_Sodium_Core32_Poly1305' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Poly1305.php',
62
-    'ParagonIE_Sodium_Core32_Poly1305_State' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Poly1305/State.php',
63
-    'ParagonIE_Sodium_Core32_Salsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Salsa20.php',
64
-    'ParagonIE_Sodium_Core32_SecretStream_State' => $vendorDir . '/paragonie/sodium_compat/src/Core32/SecretStream/State.php',
65
-    'ParagonIE_Sodium_Core32_SipHash' => $vendorDir . '/paragonie/sodium_compat/src/Core32/SipHash.php',
66
-    'ParagonIE_Sodium_Core32_Util' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Util.php',
67
-    'ParagonIE_Sodium_Core32_X25519' => $vendorDir . '/paragonie/sodium_compat/src/Core32/X25519.php',
68
-    'ParagonIE_Sodium_Core32_XChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/XChaCha20.php',
69
-    'ParagonIE_Sodium_Core32_XSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/XSalsa20.php',
70
-    'ParagonIE_Sodium_Core_BLAKE2b' => $vendorDir . '/paragonie/sodium_compat/src/Core/BLAKE2b.php',
71
-    'ParagonIE_Sodium_Core_Base64_Common' => $vendorDir . '/paragonie/sodium_compat/src/Core/Base64/Common.php',
72
-    'ParagonIE_Sodium_Core_Base64_Original' => $vendorDir . '/paragonie/sodium_compat/src/Core/Base64/Original.php',
73
-    'ParagonIE_Sodium_Core_Base64_UrlSafe' => $vendorDir . '/paragonie/sodium_compat/src/Core/Base64/UrlSafe.php',
74
-    'ParagonIE_Sodium_Core_ChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core/ChaCha20.php',
75
-    'ParagonIE_Sodium_Core_ChaCha20_Ctx' => $vendorDir . '/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php',
76
-    'ParagonIE_Sodium_Core_ChaCha20_IetfCtx' => $vendorDir . '/paragonie/sodium_compat/src/Core/ChaCha20/IetfCtx.php',
77
-    'ParagonIE_Sodium_Core_Curve25519' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519.php',
78
-    'ParagonIE_Sodium_Core_Curve25519_Fe' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Fe.php',
79
-    'ParagonIE_Sodium_Core_Curve25519_Ge_Cached' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/Cached.php',
80
-    'ParagonIE_Sodium_Core_Curve25519_Ge_P1p1' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/P1p1.php',
81
-    'ParagonIE_Sodium_Core_Curve25519_Ge_P2' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/P2.php',
82
-    'ParagonIE_Sodium_Core_Curve25519_Ge_P3' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/P3.php',
83
-    'ParagonIE_Sodium_Core_Curve25519_Ge_Precomp' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/Precomp.php',
84
-    'ParagonIE_Sodium_Core_Curve25519_H' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/H.php',
85
-    'ParagonIE_Sodium_Core_Ed25519' => $vendorDir . '/paragonie/sodium_compat/src/Core/Ed25519.php',
86
-    'ParagonIE_Sodium_Core_HChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core/HChaCha20.php',
87
-    'ParagonIE_Sodium_Core_HSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core/HSalsa20.php',
88
-    'ParagonIE_Sodium_Core_Poly1305' => $vendorDir . '/paragonie/sodium_compat/src/Core/Poly1305.php',
89
-    'ParagonIE_Sodium_Core_Poly1305_State' => $vendorDir . '/paragonie/sodium_compat/src/Core/Poly1305/State.php',
90
-    'ParagonIE_Sodium_Core_Ristretto255' => $vendorDir . '/paragonie/sodium_compat/src/Core/Ristretto255.php',
91
-    'ParagonIE_Sodium_Core_Salsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core/Salsa20.php',
92
-    'ParagonIE_Sodium_Core_SecretStream_State' => $vendorDir . '/paragonie/sodium_compat/src/Core/SecretStream/State.php',
93
-    'ParagonIE_Sodium_Core_SipHash' => $vendorDir . '/paragonie/sodium_compat/src/Core/SipHash.php',
94
-    'ParagonIE_Sodium_Core_Util' => $vendorDir . '/paragonie/sodium_compat/src/Core/Util.php',
95
-    'ParagonIE_Sodium_Core_X25519' => $vendorDir . '/paragonie/sodium_compat/src/Core/X25519.php',
96
-    'ParagonIE_Sodium_Core_XChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core/XChaCha20.php',
97
-    'ParagonIE_Sodium_Core_XSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core/XSalsa20.php',
98
-    'ParagonIE_Sodium_Crypto' => $vendorDir . '/paragonie/sodium_compat/src/Crypto.php',
99
-    'ParagonIE_Sodium_Crypto32' => $vendorDir . '/paragonie/sodium_compat/src/Crypto32.php',
100
-    'ParagonIE_Sodium_File' => $vendorDir . '/paragonie/sodium_compat/src/File.php',
101
-    'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
102
-    'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
103
-    'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
104
-    'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
105
-    'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
106
-    'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
107
-    'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
108
-    'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
109
-    'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
110
-    'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
111
-    'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
112
-    'SodiumException' => $vendorDir . '/paragonie/sodium_compat/src/SodiumException.php',
113
-    'SplFixedArray' => $vendorDir . '/paragonie/sodium_compat/src/PHP52/SplFixedArray.php',
114
-    'TrustedLoginAJAXTest' => $vendorDir . '/trustedlogin/client/tests/test-ajax.php',
115
-    'TrustedLoginConfigTest' => $vendorDir . '/trustedlogin/client/tests/test-config.php',
116
-    'TrustedLoginUsersTest' => $vendorDir . '/trustedlogin/client/tests/test-users.php',
117
-    'TrustedLogin\\Admin' => $vendorDir . '/trustedlogin/client/src/Admin.php',
118
-    'TrustedLogin\\Ajax' => $vendorDir . '/trustedlogin/client/src/Ajax.php',
119
-    'TrustedLogin\\Client' => $vendorDir . '/trustedlogin/client/src/Client.php',
120
-    'TrustedLogin\\Config' => $vendorDir . '/trustedlogin/client/src/Config.php',
121
-    'TrustedLogin\\Cron' => $vendorDir . '/trustedlogin/client/src/Cron.php',
122
-    'TrustedLogin\\Encryption' => $vendorDir . '/trustedlogin/client/src/Encryption.php',
123
-    'TrustedLogin\\Endpoint' => $vendorDir . '/trustedlogin/client/src/Endpoint.php',
124
-    'TrustedLogin\\Envelope' => $vendorDir . '/trustedlogin/client/src/Envelope.php',
125
-    'TrustedLogin\\Logging' => $vendorDir . '/trustedlogin/client/src/Logging.php',
126
-    'TrustedLogin\\Remote' => $vendorDir . '/trustedlogin/client/src/Remote.php',
127
-    'TrustedLogin\\SecurityChecks' => $vendorDir . '/trustedlogin/client/src/SecurityChecks.php',
128
-    'TrustedLogin\\SiteAccess' => $vendorDir . '/trustedlogin/client/src/SiteAccess.php',
129
-    'TrustedLogin\\SupportRole' => $vendorDir . '/trustedlogin/client/src/SupportRole.php',
130
-    'TrustedLogin\\SupportUser' => $vendorDir . '/trustedlogin/client/src/SupportUser.php',
131
-    'TrustedLogin\\TrustedLoginClientTest' => $vendorDir . '/trustedlogin/client/tests/test-client.php',
132
-    'TrustedLogin\\TrustedLoginEncryptionTest' => $vendorDir . '/trustedlogin/client/tests/test-encryption.php',
133
-    'TrustedLogin\\TrustedLoginLoggingTest' => $vendorDir . '/trustedlogin/client/tests/test-logging.php',
134
-    'TrustedLogin\\TrustedLoginRemoteTest' => $vendorDir . '/trustedlogin/client/tests/test-remote.php',
135
-    'TrustedLogin\\TrustedLoginSiteAccessTest' => $vendorDir . '/trustedlogin/client/tests/test-siteaccess.php',
136
-    'TypeError' => $vendorDir . '/paragonie/random_compat/lib/error_polyfill.php',
9
+	'ComposerAutoloaderInitb5638313a52df4893eb45c04efdaa356' => $vendorDir . '/trustedlogin/client/vendor/composer/autoload_real.php',
10
+	'Composer\\Autoload\\ClassLoader' => $vendorDir . '/trustedlogin/client/vendor/composer/ClassLoader.php',
11
+	'Composer\\Autoload\\ComposerStaticInitb5638313a52df4893eb45c04efdaa356' => $vendorDir . '/trustedlogin/client/vendor/composer/autoload_static.php',
12
+	'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
13
+	'Error' => $vendorDir . '/paragonie/random_compat/lib/error_polyfill.php',
14
+	'Katzgrau\\KLogger\\Logger' => $vendorDir . '/katzgrau/klogger/src/Logger.php',
15
+	'Katzgrau\\KLogger\\TrustedLogin_Logger' => $vendorDir . '/trustedlogin/client/vendor/TrustedLogin/katzgrau/klogger/src/Logger.php',
16
+	'LoggerTest' => $vendorDir . '/katzgrau/klogger/tests/LoggerTest.php',
17
+	'ParagonIE\\Sodium\\Compat' => $vendorDir . '/paragonie/sodium_compat/namespaced/Compat.php',
18
+	'ParagonIE\\Sodium\\Core\\BLAKE2b' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/BLAKE2b.php',
19
+	'ParagonIE\\Sodium\\Core\\ChaCha20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/ChaCha20.php',
20
+	'ParagonIE\\Sodium\\Core\\ChaCha20\\Ctx' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/ChaCha20/Ctx.php',
21
+	'ParagonIE\\Sodium\\Core\\ChaCha20\\IetfCtx' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/ChaCha20/IetfCtx.php',
22
+	'ParagonIE\\Sodium\\Core\\Curve25519' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519.php',
23
+	'ParagonIE\\Sodium\\Core\\Curve25519\\Fe' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Fe.php',
24
+	'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\Cached' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Cached.php',
25
+	'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\P1p1' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P1p1.php',
26
+	'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\P2' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P2.php',
27
+	'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\P3' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P3.php',
28
+	'ParagonIE\\Sodium\\Core\\Curve25519\\Ge\\Precomp' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Precomp.php',
29
+	'ParagonIE\\Sodium\\Core\\Curve25519\\H' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Curve25519/H.php',
30
+	'ParagonIE\\Sodium\\Core\\Ed25519' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Ed25519.php',
31
+	'ParagonIE\\Sodium\\Core\\HChaCha20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/HChaCha20.php',
32
+	'ParagonIE\\Sodium\\Core\\HSalsa20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/HSalsa20.php',
33
+	'ParagonIE\\Sodium\\Core\\Poly1305' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Poly1305.php',
34
+	'ParagonIE\\Sodium\\Core\\Poly1305\\State' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Poly1305/State.php',
35
+	'ParagonIE\\Sodium\\Core\\Salsa20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Salsa20.php',
36
+	'ParagonIE\\Sodium\\Core\\SipHash' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/SipHash.php',
37
+	'ParagonIE\\Sodium\\Core\\Util' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Util.php',
38
+	'ParagonIE\\Sodium\\Core\\X25519' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/X25519.php',
39
+	'ParagonIE\\Sodium\\Core\\XChaCha20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/XChaCha20.php',
40
+	'ParagonIE\\Sodium\\Core\\Xsalsa20' => $vendorDir . '/paragonie/sodium_compat/namespaced/Core/Xsalsa20.php',
41
+	'ParagonIE\\Sodium\\Crypto' => $vendorDir . '/paragonie/sodium_compat/namespaced/Crypto.php',
42
+	'ParagonIE\\Sodium\\File' => $vendorDir . '/paragonie/sodium_compat/namespaced/File.php',
43
+	'ParagonIE_Sodium_Compat' => $vendorDir . '/paragonie/sodium_compat/src/Compat.php',
44
+	'ParagonIE_Sodium_Core32_BLAKE2b' => $vendorDir . '/paragonie/sodium_compat/src/Core32/BLAKE2b.php',
45
+	'ParagonIE_Sodium_Core32_ChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/ChaCha20.php',
46
+	'ParagonIE_Sodium_Core32_ChaCha20_Ctx' => $vendorDir . '/paragonie/sodium_compat/src/Core32/ChaCha20/Ctx.php',
47
+	'ParagonIE_Sodium_Core32_ChaCha20_IetfCtx' => $vendorDir . '/paragonie/sodium_compat/src/Core32/ChaCha20/IetfCtx.php',
48
+	'ParagonIE_Sodium_Core32_Curve25519' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519.php',
49
+	'ParagonIE_Sodium_Core32_Curve25519_Fe' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Fe.php',
50
+	'ParagonIE_Sodium_Core32_Curve25519_Ge_Cached' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Cached.php',
51
+	'ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P1p1.php',
52
+	'ParagonIE_Sodium_Core32_Curve25519_Ge_P2' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P2.php',
53
+	'ParagonIE_Sodium_Core32_Curve25519_Ge_P3' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/P3.php',
54
+	'ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/Ge/Precomp.php',
55
+	'ParagonIE_Sodium_Core32_Curve25519_H' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Curve25519/H.php',
56
+	'ParagonIE_Sodium_Core32_Ed25519' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Ed25519.php',
57
+	'ParagonIE_Sodium_Core32_HChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/HChaCha20.php',
58
+	'ParagonIE_Sodium_Core32_HSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/HSalsa20.php',
59
+	'ParagonIE_Sodium_Core32_Int32' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Int32.php',
60
+	'ParagonIE_Sodium_Core32_Int64' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Int64.php',
61
+	'ParagonIE_Sodium_Core32_Poly1305' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Poly1305.php',
62
+	'ParagonIE_Sodium_Core32_Poly1305_State' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Poly1305/State.php',
63
+	'ParagonIE_Sodium_Core32_Salsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Salsa20.php',
64
+	'ParagonIE_Sodium_Core32_SecretStream_State' => $vendorDir . '/paragonie/sodium_compat/src/Core32/SecretStream/State.php',
65
+	'ParagonIE_Sodium_Core32_SipHash' => $vendorDir . '/paragonie/sodium_compat/src/Core32/SipHash.php',
66
+	'ParagonIE_Sodium_Core32_Util' => $vendorDir . '/paragonie/sodium_compat/src/Core32/Util.php',
67
+	'ParagonIE_Sodium_Core32_X25519' => $vendorDir . '/paragonie/sodium_compat/src/Core32/X25519.php',
68
+	'ParagonIE_Sodium_Core32_XChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/XChaCha20.php',
69
+	'ParagonIE_Sodium_Core32_XSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core32/XSalsa20.php',
70
+	'ParagonIE_Sodium_Core_BLAKE2b' => $vendorDir . '/paragonie/sodium_compat/src/Core/BLAKE2b.php',
71
+	'ParagonIE_Sodium_Core_Base64_Common' => $vendorDir . '/paragonie/sodium_compat/src/Core/Base64/Common.php',
72
+	'ParagonIE_Sodium_Core_Base64_Original' => $vendorDir . '/paragonie/sodium_compat/src/Core/Base64/Original.php',
73
+	'ParagonIE_Sodium_Core_Base64_UrlSafe' => $vendorDir . '/paragonie/sodium_compat/src/Core/Base64/UrlSafe.php',
74
+	'ParagonIE_Sodium_Core_ChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core/ChaCha20.php',
75
+	'ParagonIE_Sodium_Core_ChaCha20_Ctx' => $vendorDir . '/paragonie/sodium_compat/src/Core/ChaCha20/Ctx.php',
76
+	'ParagonIE_Sodium_Core_ChaCha20_IetfCtx' => $vendorDir . '/paragonie/sodium_compat/src/Core/ChaCha20/IetfCtx.php',
77
+	'ParagonIE_Sodium_Core_Curve25519' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519.php',
78
+	'ParagonIE_Sodium_Core_Curve25519_Fe' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Fe.php',
79
+	'ParagonIE_Sodium_Core_Curve25519_Ge_Cached' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/Cached.php',
80
+	'ParagonIE_Sodium_Core_Curve25519_Ge_P1p1' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/P1p1.php',
81
+	'ParagonIE_Sodium_Core_Curve25519_Ge_P2' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/P2.php',
82
+	'ParagonIE_Sodium_Core_Curve25519_Ge_P3' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/P3.php',
83
+	'ParagonIE_Sodium_Core_Curve25519_Ge_Precomp' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/Ge/Precomp.php',
84
+	'ParagonIE_Sodium_Core_Curve25519_H' => $vendorDir . '/paragonie/sodium_compat/src/Core/Curve25519/H.php',
85
+	'ParagonIE_Sodium_Core_Ed25519' => $vendorDir . '/paragonie/sodium_compat/src/Core/Ed25519.php',
86
+	'ParagonIE_Sodium_Core_HChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core/HChaCha20.php',
87
+	'ParagonIE_Sodium_Core_HSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core/HSalsa20.php',
88
+	'ParagonIE_Sodium_Core_Poly1305' => $vendorDir . '/paragonie/sodium_compat/src/Core/Poly1305.php',
89
+	'ParagonIE_Sodium_Core_Poly1305_State' => $vendorDir . '/paragonie/sodium_compat/src/Core/Poly1305/State.php',
90
+	'ParagonIE_Sodium_Core_Ristretto255' => $vendorDir . '/paragonie/sodium_compat/src/Core/Ristretto255.php',
91
+	'ParagonIE_Sodium_Core_Salsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core/Salsa20.php',
92
+	'ParagonIE_Sodium_Core_SecretStream_State' => $vendorDir . '/paragonie/sodium_compat/src/Core/SecretStream/State.php',
93
+	'ParagonIE_Sodium_Core_SipHash' => $vendorDir . '/paragonie/sodium_compat/src/Core/SipHash.php',
94
+	'ParagonIE_Sodium_Core_Util' => $vendorDir . '/paragonie/sodium_compat/src/Core/Util.php',
95
+	'ParagonIE_Sodium_Core_X25519' => $vendorDir . '/paragonie/sodium_compat/src/Core/X25519.php',
96
+	'ParagonIE_Sodium_Core_XChaCha20' => $vendorDir . '/paragonie/sodium_compat/src/Core/XChaCha20.php',
97
+	'ParagonIE_Sodium_Core_XSalsa20' => $vendorDir . '/paragonie/sodium_compat/src/Core/XSalsa20.php',
98
+	'ParagonIE_Sodium_Crypto' => $vendorDir . '/paragonie/sodium_compat/src/Crypto.php',
99
+	'ParagonIE_Sodium_Crypto32' => $vendorDir . '/paragonie/sodium_compat/src/Crypto32.php',
100
+	'ParagonIE_Sodium_File' => $vendorDir . '/paragonie/sodium_compat/src/File.php',
101
+	'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
102
+	'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
103
+	'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
104
+	'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
105
+	'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
106
+	'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
107
+	'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
108
+	'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
109
+	'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
110
+	'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
111
+	'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
112
+	'SodiumException' => $vendorDir . '/paragonie/sodium_compat/src/SodiumException.php',
113
+	'SplFixedArray' => $vendorDir . '/paragonie/sodium_compat/src/PHP52/SplFixedArray.php',
114
+	'TrustedLoginAJAXTest' => $vendorDir . '/trustedlogin/client/tests/test-ajax.php',
115
+	'TrustedLoginConfigTest' => $vendorDir . '/trustedlogin/client/tests/test-config.php',
116
+	'TrustedLoginUsersTest' => $vendorDir . '/trustedlogin/client/tests/test-users.php',
117
+	'TrustedLogin\\Admin' => $vendorDir . '/trustedlogin/client/src/Admin.php',
118
+	'TrustedLogin\\Ajax' => $vendorDir . '/trustedlogin/client/src/Ajax.php',
119
+	'TrustedLogin\\Client' => $vendorDir . '/trustedlogin/client/src/Client.php',
120
+	'TrustedLogin\\Config' => $vendorDir . '/trustedlogin/client/src/Config.php',
121
+	'TrustedLogin\\Cron' => $vendorDir . '/trustedlogin/client/src/Cron.php',
122
+	'TrustedLogin\\Encryption' => $vendorDir . '/trustedlogin/client/src/Encryption.php',
123
+	'TrustedLogin\\Endpoint' => $vendorDir . '/trustedlogin/client/src/Endpoint.php',
124
+	'TrustedLogin\\Envelope' => $vendorDir . '/trustedlogin/client/src/Envelope.php',
125
+	'TrustedLogin\\Logging' => $vendorDir . '/trustedlogin/client/src/Logging.php',
126
+	'TrustedLogin\\Remote' => $vendorDir . '/trustedlogin/client/src/Remote.php',
127
+	'TrustedLogin\\SecurityChecks' => $vendorDir . '/trustedlogin/client/src/SecurityChecks.php',
128
+	'TrustedLogin\\SiteAccess' => $vendorDir . '/trustedlogin/client/src/SiteAccess.php',
129
+	'TrustedLogin\\SupportRole' => $vendorDir . '/trustedlogin/client/src/SupportRole.php',
130
+	'TrustedLogin\\SupportUser' => $vendorDir . '/trustedlogin/client/src/SupportUser.php',
131
+	'TrustedLogin\\TrustedLoginClientTest' => $vendorDir . '/trustedlogin/client/tests/test-client.php',
132
+	'TrustedLogin\\TrustedLoginEncryptionTest' => $vendorDir . '/trustedlogin/client/tests/test-encryption.php',
133
+	'TrustedLogin\\TrustedLoginLoggingTest' => $vendorDir . '/trustedlogin/client/tests/test-logging.php',
134
+	'TrustedLogin\\TrustedLoginRemoteTest' => $vendorDir . '/trustedlogin/client/tests/test-remote.php',
135
+	'TrustedLogin\\TrustedLoginSiteAccessTest' => $vendorDir . '/trustedlogin/client/tests/test-siteaccess.php',
136
+	'TypeError' => $vendorDir . '/paragonie/random_compat/lib/error_polyfill.php',
137 137
 );
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 // autoload_classmap.php @generated by Composer
4 4
 
5
-$vendorDir = dirname(dirname(__FILE__));
6
-$baseDir = dirname($vendorDir);
5
+$vendorDir = dirname( dirname( __FILE__ ) );
6
+$baseDir = dirname( $vendorDir );
7 7
 
8 8
 return array(
9 9
     'ComposerAutoloaderInitb5638313a52df4893eb45c04efdaa356' => $vendorDir . '/trustedlogin/client/vendor/composer/autoload_real.php',
Please login to merge, or discard this patch.